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..2c07fac20 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -2,12 +2,15 @@ This document generated by [dt-contributors-generator](https://github.com/vvakame/dt-contributors-generator). (but run scripts are manual operation. please wait :P) +* [:link:](abs/abs.d.ts) [abs](https://github.com/IonicaBizau/node-abs) by [Aya Morisawa](https://github.com/AyaMorisawa) +* [:link:](absolute/absolute.d.ts) [absolute](https://github.com/bahamas10/node-absolute) by [Aya Morisawa](https://github.com/AyaMorisawa) * [:link:](acc-wizard/acc-wizard.d.ts) [acc-wizard](https://github.com/sathomas/acc-wizard) by [Cyril Schumacher](https://github.com/cyrilschumacher) * [:link:](accounting/accounting.d.ts) [accounting.js](http://josscrowcroft.github.io/accounting.js) by [Sergey Gerasimov](https://github.com/gerich-home) * [:link:](ace/ace.d.ts) [Ace Ajax.org Cloud9 Editor](http://ace.ajax.org) by [Diullei Gomes](https://github.com/Diullei) * [:link:](acorn/acorn.d.ts) [Acorn](https://github.com/marijnh/acorn) by [RReverser](https://github.com/RReverser) * [:link:](add2home/add2home.d.ts) [add2home](http://cubiq.org/add-to-home-screen) by [James Wilkins](http://www.codeplex.com/site/users/view/jamesnw) * [:link:](adm-zip/adm-zip.d.ts) [adm-zip](https://github.com/cthackers/adm-zip) by [John Vilk](https://github.com/jvilk) +* [:link:](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 +18,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,26 +40,27 @@ 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) * [:link:](angular-signalr-hub/angular-signalr-hub.d.ts) [angular-signalr-hub](https://github.com/JustMaier/angular-signalr-hub) by [Adam Santaniello](https://github.com/AdamSantaniello) * [:link:](angular-spinner/angular-spinner.d.ts) [angular-spinner.js](https://github.com/urish/angular-spinner) by [Marcin Biegała](https://github.com/Biegal) * [:link:](angular-storage/angular-storage.d.ts) [angular-storage](https://github.com/auth0/angular-storage) by [Matthew DeKrey](https://github.com/mdekrey) +* [:link:](angular-strap/angular-strap.d.ts) [angular-strap v2.2.x](http://mgcrea.github.io/angular-strap) by [Sam Herrmann](https://github.com/samherrmann) * [:link:](angular-ui-tree/angular-ui-tree.d.ts) [angular-ui-tree](https://github.com/angular-ui-tree/angular-ui-tree) by [Calvin Fernandez](https://github.com/CalvinFernandez) * [:link:](angular.throttle/angular.throttle.d.ts) [angular.throttle](https://github.com/BaggersIO/angular.throttle) by [Stefan Steinhart](https://github.com/reppners) * [:link:](angular-ui-sortable/angular-ui-sortable.d.ts) [angular.ui.sortable module](https://github.com/angular-ui/ui-sortable) by [Thodoris Greasidis](https://github.com/thgreasi) @@ -69,6 +75,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 +87,14 @@ 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:](async-writer/async-writer.d.ts) [async-writer](https://github.com/marko-js/async-writer) by [Yuce Tekol](http://yuce.me) * [: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) @@ -99,67 +110,90 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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:](babylonjs/babylon.d.ts) [BabylonJS](http://www.babylonjs.com) by [David Catuhe](https://github.com/deltakosh) +* [: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) * [:link:](backbone.layoutmanager/backbone.layoutmanager.d.ts) [Backbone.LayoutManager](http://layoutmanager.org) by [He Jiang](https://github.com/hejiang2000) +* [:link:](backbone.localstorage/backbone.localstorage.d.ts) [backbone.localStorage](https://github.com/jeromegn/Backbone.localStorage) by [Louis Grignon](https://github.com/lgrignon) * [:link:](backbone.paginator/backbone.paginator.d.ts) [backbone.paginator](https://github.com/backbone-paginator/backbone.paginator) by [Nyamazing](https://github.com/Nyamazing) * [: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:](bcrypt-nodejs/bcrypt-nodejs.d.ts) [bcrypt-nodejs](https://github.com/shaneGirish/bcrypt-nodejs) by [David Broder-Rodgers](https://github.com/DavidBR-SW) +* [:link:](bcryptjs/bcryptjs.d.ts) [bcryptjs](https://github.com/dcodeIO/bcrypt.js) by [Joshua Filby](https://github.com/Joshua-F) +* [: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:](bezier-easing/bezier-easing.d.ts) [bezier-easing](https://github.com/gre/bezier-easing) by [brian ridley](https://github.com/ptlis) * [: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) -* [:link:](bluebird/bluebird.d.ts) [bluebird](https://github.com/petkaantonov/bluebird) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](blue-tape/blue-tape.d.ts) [blue-tape](https://github.com/spion/blue-tape) by [Haoqun Jiang](https://github.com/sodatea) +* [:link:](bluebird/bluebird.d.ts) [bluebird](https://github.com/petkaantonov/bluebird) by [Bart van der Schoor](https://github.com/Bartvds), [falsandtru](https://github.com/falsandtru) * [: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:](browserify/browserify.d.ts) [Browserify](http://browserify.org) by [Andrew Gaspar](https://github.com/AndrewGaspar) +* [: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), [John Vilk](https://github.com/jvilk) * [:link:](bucks/bucks.d.ts) [bucks.js](https://github.com/CyberAgent/bucks.js) by [Shunsuke Ohtani](https://github.com/zaneli) +* [:link:](buffer-compare/buffer-compare.d.ts) [buffer-compare](https://github.com/soldair/node-buffer-compare) by [Ilya Mochalov](https://github.com/chrootsu) * [: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) * [:link:](bl/bl.d.ts) [BufferList](https://github.com/rvagg/bl) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](buffers/buffers.d.ts) [buffers](https://github.com/substack/node-buffers) by [Robert Hencke](https://github.com/rhencke) * [:link:](bufferstream/bufferstream.d.ts) [bufferstream](https://github.com/dodo/node-bufferstream) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](bull/bull.d.ts) [bull](https://github.com/OptimalBits/bull) by [Bruno Grieder](https://github.com/bgrieder) * [:link:](bunyan-prettystream/bunyan-prettystream.d.ts) [bunyan-prettystream](https://www.npmjs.com/package/bunyan-prettystream) by [Jason Swearingen](https://github.com/jasonswearingen), [Vadim Macagon](https://github.com/enlight) * [: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:](bytebuffer/bytebuffer.d.ts) [bytebuffer.js](https://github.com/dcodeIO/bytebuffer.js) by [Denis Cappellin](http://github.com/cappellin) +* [: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:](cal-heatmap/cal-heatmap.d.ts) [cal-heatmap](https://github.com/wa0x6e/cal-heatmap) by [Chris Baker](https://github.com/RetroChrisB) * [: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) * [:link:](canvasjs/canvasjs.d.ts) [CanvasJS](http://canvasjs.com) by [Mark Overholt](https://github.com/mover5) * [:link:](casperjs/casperjs.d.ts) [CasperJS](http://casperjs.org) by [Jed Mao](https://github.com/jedmao) -* [:link:](chai/chai.d.ts) [chai](http://chaijs.com) by [Jed Mao](https://github.com/jedmao), [Bart van der Schoor](https://github.com/Bartvds), [Andrew Brown](https://github.com/AGBrown), [Olivier Chevet](https://github.com/olivr70) +* [:link:](chai/chai.d.ts) [chai](http://chaijs.com) by [Jed Mao](https://github.com/jedmao), [Bart van der Schoor](https://github.com/Bartvds), [Andrew Brown](https://github.com/AGBrown), [Olivier Chevet](https://github.com/olivr70), [Matt Wistrand](https://github.com/mwistrand) * [:link:](chai-as-promised/chai-as-promised.d.ts) [chai-as-promised](https://github.com/domenic/chai-as-promised) by [jt000](https://github.com/jt000), [Yuki Kokubun](https://github.com/Kuniwak) * [:link:](chai-datetime/chai-datetime.d.ts) [chai-datetime](https://github.com/gaslight/chai-datetime.git) by [Cliff Burger](https://github.com/cliffburger) * [:link:](chai-fuzzy/chai-fuzzy.d.ts) [chai-fuzzy](http://chaijs.com/plugins/chai-fuzzy) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](chai-http/chai-http.d.ts) [chai-http](https://github.com/chaijs/chai-http) by [Wim Looman](https://github.com/Nemo157) * [:link:](chai-jquery/chai-jquery.d.ts) [chai-jquery](https://github.com/chaijs/chai-jquery) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid) +* [:link:](chai-string/chai-string.d.ts) [chai-string](https://github.com/onechiporenko/chai-string) by [Nick Malaguti](https://github.com/nmalaguti) * [:link:](chai-subset/chai-subset.d.ts) [chai-subset](https://github.com/e-conomic/chai-subset) by [Sam Noedel](https://github.com/delta62), [Andrew Brown](https://github.com/AGBrown) +* [:link:](chai-things/chai-things.d.ts) [chai-things](https://github.com/chaijs/chai-things) by [David Broder-Rodgers](https://github.com/DavidBR-SW) * [:link:](chalk/chalk.d.ts) [chalk](https://github.com/sindresorhus/chalk) by [Diullei Gomes](https://github.com/Diullei), [Bart van der Schoor](https://github.com/Bartvds) * [:link:](chance/chance.d.ts) [Chance](http://chancejs.com) by [Chris Bowdon](https://github.com/cbowdon) * [:link:](change-case/change-case.d.ts) [change-case](https://github.com/blakeembrey/change-case) by [Asana](https://asana.com) @@ -172,7 +206,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://github.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,49 +214,67 @@ 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:](codemirror/codemirror-showhint.d.ts) [CodeMirror](https://github.com/marijnh/CodeMirror) by [jacqt](https://github.com/jacqt), [basarat](https://github.com/basarat) +* [: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.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:](codemirror/codemirror-showhint.d.ts) [CodeMirror](https://github.com/marijnh/CodeMirror) by [jacqt](https://github.com/jacqt), [basarat](https://github.com/basarat) +* [:link:](codemirror/codemirror-matchbrackets.d.ts) [CodeMirror](https://github.com/marijnh/CodeMirror) by [Sixin Li](https://github.com/sixinli) * [:link:](coffeeify/coffeeify.d.ts) [coffeeify](https://github.com/jnordberg/coffeeify) by [Qubo](https://github.com/tkQubo) * [:link:](colorbrewer/colorbrewer.d.ts) [colorbrewer](https://github.com/jeanlauliac/colorbrewer) by [Matt Traynham](https://github.com/mtraynham) * [:link:](colors/colors.d.ts) [Colors.js 0.6.0-1](https://github.com/Marak/colors.js) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](cometd/cometd.d.ts) [CometD](http://cometd.org) by [Derek Cicerone](https://github.com/derekcicerone) * [:link:](commander/commander.d.ts) [commanderjs](https://github.com/visionmedia/commander.js) by [Marcelo Dezem](http://github.com/mdezem), [vvakame](http://github.com/vvakame) +* [:link:](commonmark/commonmark.d.ts) [commonmark.js](https://github.com/jgm/commonmark.js) by [Nico Jansen](https://github.com/nicojs) * [:link:](compare-version/compare-version.d.ts) [compare-version](https://www.npmjs.com/package/compare-version) by [Jonathan Pevarnek](https://github.com/jpevarnek) +* [:link:](complex/complex.d.ts) [Complex](https://github.com/arian/Complex) by [Aya Morisawa](https://github.com/AyaMorisawa) +* [:link:](debounce/debounce.d.ts) [compose-function](https://github.com/component/debounce) by [Denis Sokolov](https://github.com/denis-sokolov) +* [:link:](compose-function/compose-function.d.ts) [compose-function](https://github.com/stoeffel/compose-function) by [Denis Sokolov](https://github.com/denis-sokolov) * [: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) +* [:link:](connect-timeout/connect-timeout.d.ts) [connect-timeout](https://github.com/expressjs/timeout) by [Cyril Schumacher](https://github.com/cyrilschumacher) +* [:link:](console-stamp/console-stamp.d.ts) [console-stamp](https://github.com/starak/node-console-stamp) by [Eric Byers](https://github.com/ericbyers) * [:link:](consolidate/consolidate.d.ts) [consolidate](https://github.com/visionmedia/consolidate.js) by [Carlos Ballesteros Velasco](https://github.com/soywiz) * [:link:](constant-case/constant-case.d.ts) [constant-case](https://github.com/blakeembrey/constant-case) by [Sam Saint-Pettersen](https://github.com/stpettersens) * [:link:](content-type/content-type.d.ts) [content-type](https://github.com/deoxxa/content-type) by [Pine Mizune](https://github.com/pine613) +* [:link:](contentful-resolve-response/contentful-resolve-response.d.ts) [contentful-resolve-response](https://github.com/contentful/contentful-resolve-response) by [Anton Karsten](https://github.com/antonkarsten) * [:link:](contextjs/contextjs.d.ts) [contextjs](https://github.com/jakiestfu/Context.js) by [Kern Handa](https://github.com/kernhanda) * [:link:](convert-source-map/convert-source-map.d.ts) [convert-source-map](https://github.com/thlorenz/convert-source-map) by [Andrew Gaspar](https://github.com/AndrewGaspar) * [:link:](cookie/cookie.d.ts) [cookie](https://github.com/jshttp/cookie) by [Pine Mizune](https://github.com/pine613) * [:link:](cookie-parser/cookie-parser.d.ts) [cookie-parser](https://github.com/expressjs/cookie-parser) by [Santi Albo](https://github.com/santialbo) +* [:link:](cookies/cookies.d.ts) [cookie-parser](https://github.com/pillarjs/cookies) by [Wang Zishi](https://github.com/WangZishi) * [:link:](cookiejs/cookiejs.d.ts) [cookie.js](https://github.com/js-coder/cookie.js) by [Boltmade](https://github.com/Boltmade) * [:link:](cordova-ionic/plugins/keyboard.d.ts) [Cordova Keyboard plugin](https://github.com/driftyco/ionic-plugins-keyboard) by [Hendrik Maus](https://github.com/hendrikmaus) * [:link:](cordova-plugin-app-version/cordova-plugin-app-version.d.ts) [cordova-plugin-app-version](https://github.com/whiteoctober/cordova-plugin-app-version) by [Markus Wagner](https://github.com/Ritzlgrmft) * [:link:](cordova-plugin-ibeacon/cordova-plugin-ibeacon.d.ts) [cordova-plugin-ibeacon](https://github.com/petermetz/cordova-plugin-ibeacon) by [Markus Wagner](https://github.com/Ritzlgrmft) +* [:link:](cordova-plugin-mapsforge/cordova-plugin-mapsforge.d.ts) [cordova-plugin-mapsforge](https://github.com/afsuarez/mapsforge-cordova-plugin) by [rafw87](https://github.com/rafw87) * [:link:](cordova-plugin-ouralabs/cordova-plugin-ouralabs.d.ts) [cordova-plugin-ouralabs](https://github.com/Justin-Credible/cordova-plugin-ouralabs) by [Justin Unterreiner](https://github.com/Justin-Credible) +* [:link:](cordova-plugin-spinner/cordova-plugin-spinner.d.ts) [cordova-plugin-spinner](https://github.com/Justin-Credible/cordova-plugin-spinner) by [Justin Unterreiner](https://github.com/Justin-Credible) * [:link:](cordovarduino/cordovarduino.d.ts) [Cordovarduino plugin](https://github.com/stereolux/cordovarduino) by [Hendrik Maus](https://github.com/hendrikmaus) * [:link:](core-decorators/core-decorators.d.ts) [core-decorators.js](https://github.com/jayphelps/core-decorators.js) by [Qubo](https://github.com/tkqubo) * [:link:](core-js/core-js.d.ts) [core-js](https://github.com/zloirock/core-js) by [Ron Buckton](http://github.com/rbuckton) * [: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:](couchbase/couchbase.d.ts) [Couchbase Node.js SDK](https://github.com/couchbase/couchnode) by [Marwan Aouida](https://github.com/maouida) +* [:link:](cradle/cradle.d.ts) [cradle](https://github.com/flatiron/cradle) by [Panu Horsmalahti](https://github.com/panuhorsmalahti) +* [:link:](create-error/create-error.d.ts) [create-error.js](https://github.com/tgriesser/create-error) by [Tanguy Krotoff](https://github.com/tkrotoff) * [: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) +* [:link:](cucumber/cucumber.d.ts) [cucumber-js](https://github.com/cucumber/cucumber-js) by [Abraão Alves](https://github.com/abraaoalves) * [:link:](cuid/cuid.d.ts) [cuid](https://github.com/ericelliott/cuid) by [Dave Keen](http://www.keendevelopment.ch) * [:link:](custom-error-generator/custom-error-generator.d.ts) [custom-error-generator](https://github.com/jproulx/node-custom-error) by [Thierry Miceli](https://github.com/thmiceli) * [:link:](md5/md5.d.ts) [CybozuLabs.MD5](http://labs.cybozu.co.jp/blog/mitsunari/2007/07/md5js_1.html) by [MIZUNE Pine](https://github.com/pine613) @@ -236,14 +288,17 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](date.format.js/date.format.d.ts) [Date Format](http://blog.stevenlevithan.com/archives/date-time-format) by [Rob Stutton](https://github.com/balrob) * [:link:](datejs/datejs.d.ts) [DateJS](http://www.datejs.com) by [David Khristepher Santos](http://github.com/rupertavery) * [: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:](debug/debug.d.ts) [debug](https://github.com/visionmedia/debug) by [Seon-Wook Park](https://github.com/swook), [Gal Talmor](https://github.com/galtalmor) * [: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,12 +307,14 @@ 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:](domready/domready.d.ts) [domready](https://github.com/ded/domready) by [Christian Holm Nielsen](https://github.com/dotnetnerd) +* [:link:](requirejs-domready/domready.d.ts) [domReady](https://github.com/requirejs/domReady) by [Nobuhiro Nakamura](https://github.com/lefb766) * [: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) * [:link:](dot-case/dot-case.d.ts) [dot-case](https://github.com/blakeembrey/dot-case) by [Sam Saint-Pettersen](https://github.com/stpettersens) @@ -276,9 +333,9 @@ 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-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-table/easy-table.d.ts) [easy-table](https://github.com/eldargab/easy-table) by [Niklas Mollenhauer](https://github.com/nikeee) * [: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-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-xapi/easy-xapi.d.ts) [easy-xapi](https://github.com/DeadAlready/easy-xapi) by [Karl Düüna](https://github.com/DeadAlready) * [:link:](easy-xapi-utils/easy-xapi-utils.d.ts) [easy-xapi-utils](https://github.com/DeadAlready/easy-xapi-utils) by [Karl Düüna](https://github.com/DeadAlready) * [:link:](easystarjs/easystarjs.d.ts) [EasyStar.js](http://easystarjs.com) by [Magnus Gustafsson](https://github.com/borundin) @@ -286,15 +343,20 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](ejs-locals/ejs-locals.d.ts) [ejs-locals](https://github.com/randometc/ejs-locals) by [jt000](https://github.com/jt000) * [:link:](ejs/ejs.d.ts) [ejs.js](http://ejs.co) by [Ben Liddicott](https://github.com/benliddicott/DefinitelyTyped) * [:link:](jquery.elang/jquery.elang.d.ts) [eLang](https://github.com/sumegizoltan/ELang) by [Zoltan Sumegi](https://github.com/sumegizoltan) -* [:link:](github-electron/github-electron.d.ts) [Electron (shared between main and rederer processes)](http://electron.atom.io) by [jedmao](https://github.com/jedmao) +* [:link:](github-electron/github-electron.d.ts) [Electron](http://electron.atom.io) by [jedmao](https://github.com/jedmao), [rhysd](https://rhysd.github.io) +* [: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) +* [:link:](email-addresses/email-addresses.d.ts) [email-addresses](https://github.com/jackbowman/email-addresses) by [John Grimsey](https://github.com/johngrimsey) +* [:link:](email-validator/email-validator.d.ts) [email-validator](https://github.com/Sembiance/email-validator) by [Paul Lessing](https://github.com/paullessing) * [:link:](ember/ember.d.ts) [Ember.js](http://emberjs.com) by [Jed Mao](https://github.com/jedmao) * [:link:](emissary/emissary.d.ts) [emissary](https://github.com/atom/emissary) by [vvakame](https://github.com/vvakame) * [:link:](empower/empower.d.ts) [empower](https://github.com/twada/empower) by [vvakame](https://github.com/vvakame) * [:link:](emscripten/emscripten.d.ts) [Emscripten](http://kripken.github.io/emscripten-site/index.html) by [Kensuke Matsuzaki](https://github.com/zakki) * [:link:](envify/envify.d.ts) [envify](https://github.com/hughsk/envify) by [Qubo](https://github.com/tkQubo) +* [:link:](enzyme/enzyme.d.ts) [Enzyme](https://github.com/airbnb/enzyme) by [Marian Palkus](https://github.com/MarianPalkus), [Cap3](http://www.cap3.de) * [:link:](epiceditor/epiceditor.d.ts) [EpicEditor](http://epiceditor.com) by [Boris Yankov](https://github.com/borisyankov) * [:link:](eq.js/eq.js.d.ts) [eq.js](https://github.com/Snugug/eq.js) by [Stephen Lautier](https://github.com/stephenlautier) * [:link:](errorhandler/errorhandler.d.ts) [errorhandler](https://github.com/expressjs/errorhandler) by [Santi Albo](https://github.com/santialbo) @@ -308,13 +370,16 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](event-kit/event-kit.d.ts) [event-kit](https://github.com/atom/event-kit) by [Vadim Macagon](https://github.com/enlight) * [:link:](event-loop-lag/event-loop-lag.d.ts) [event-loop-lag](https://github.com/pebble/event-loop-lag) by [Rogier Schouten](https://github.com/rogierschouten) * [:link:](eventemitter2/eventemitter2.d.ts) [EventEmitter2](https://github.com/asyncly/EventEmitter2) by [ryiwamoto](https://github.com/ryiwamoto) -* [:link:](eventemitter3/eventemitter3.d.ts) [EventEmitter3](https://github.com/primus/eventemitter3) by [Yuichi Murata](https://github.com/mrk21) +* [:link:](eventemitter3/eventemitter3.d.ts) [EventEmitter3](https://github.com/primus/eventemitter3) by [Yuichi Murata](https://github.com/mrk21), [Leon Yu](https://github.com/leonyu) * [:link:](evernote/evernote.d.ts) [evernote v](https://www.npmjs.com/package/evernote) by [Zachary Collins](https://github.com/corps) * [:link:](exit/exit.d.ts) [exit](https://github.com/cowboy/node-exit) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](expect.js/expect.js.d.ts) [expect.js](https://github.com/Automattic/expect.js) by [Teppei Sato](https://github.com/teppeis) * [:link:](expectations/expectations.d.ts) [expectations.js](https://github.com/spmason/expectations) by [vvakame](https://github.com/vvakame) * [:link:](express/express.d.ts) [Express 4.x](http://expressjs.com) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](express-brute/express-brute.d.ts) [express-brute](https://github.com/AdamPflug/express-brute) by [Cyril Schumacher](https://github.com/cyrilschumacher) +* [:link:](express-brute-mongo/express-brute-mongo.d.ts) [express-brute-mongo](https://github.com/auth0/express-brute-mongo) by [Cyril Schumacher](https://github.com/cyrilschumacher) * [: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) @@ -328,6 +393,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](eyes/eyes.d.ts) [eyes](https://github.com/cloudhead/eyes.js) by [bryn austin bellomy](https://github.com/brynbellomy) * [:link:](fabricjs/fabricjs.d.ts) [FabricJS](http://fabricjs.com) by [Oliver Klemencic](https://github.com/oklemencic), [Joseph Livecchi](https://github.com/joewashear007), [Michael Randolph](https://github.com/mrand01) * [:link:](fbsdk/fbsdk.d.ts) [Facebook Javascript SDK](https://developers.facebook.com/docs/javascript) by [Joshua Strobl](https://github.com/JoshStrobl) +* [:link:](fbemitter/fbemitter.d.ts) [Facebook's EventEmitter](https://github.com/facebook/emitter) by [kmxz](https://github.com/kmxz) * [:link:](faker/faker.d.ts) [faker](http://marak.com/faker.js) by [Bas Pennings](https://github.com/basp), [Yuki Kokubun](https://github.com/Kuniwak) * [:link:](famous/famous.d.ts) [Famous Engine](http://famous.org) by [Boris Vasilenko](https://github.com/borisvasilenko) * [:link:](fancybox/fancybox.d.ts) [fancyBox](https://github.com/fancyapps/fancyBox) by [Boris Yankov](https://github.com/borisyankov) @@ -337,37 +403,44 @@ 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:](field/field.d.ts) [field](https://www.npmjs.com/package/field) by [Leo Liang](https://github.com/aleung/DefinitelyTyped) * [: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), [Stephen Jelfs](https://github.com/stephenjelfs) * [: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/flux.d.ts) [Flux](http://facebook.github.io/flux) by [Steve Baker](https://github.com/stkb), [Giedrius Grabauskas](https://github.com/QuatroDevOfficial) +* [: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) +* [:link:](jee-jsf/jsf.d.ts) [for the JSF 2.0 Ajax request API](https://docs.oracle.com/cd/E17802_01/j2ee/javaee/javaserverfaces/2.0/docs/js-api/symbols/jsf.ajax.html) by [Lars Michaelis and Stephan Zerhusen](https://github.com/ButterFaces/ButterFaces) * [:link:](forge-di/forge-di.d.ts) [forge-di](https://github.com/nkohari/forge) by [Adam Carr](https://github.com/adamcarr) -* [:link:](form-data/form-data.d.ts) [form-data](https://github.com/felixge/node-form-data) by [Carlos Ballesteros Velasco](https://github.com/soywiz) * [:link:](formidable/formidable.d.ts) [Formidable](https://github.com/felixge/node-formidable) by [Wim Looman](https://github.com/Nemo157) * [:link:](foundation/foundation.d.ts) [Foundation](http://foundation.zurb.com) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](foundation-sites/foundation-sites.d.ts) [Foundation Sites](http://foundation.zurb.com) by [Sam Vloeberghs](https://github.com/samvloeberghs) * [:link:](fpsmeter/FPSMeter.d.ts) [FPSmeter](http://darsa.in/fpsmeter) by [Aaron Lampros](http://github.com/alampros) -* [:link:](freedom/freedom-core-env.d.ts) [freedom](https://github.com/freedomjs/freedom) by [Jonathan Pevarnek](https://github.com/jpevarnek) * [:link:](freedom/freedom-module-env.d.ts) [freedom](https://github.com/freedomjs/freedom) by [Jonathan Pevarnek](https://github.com/jpevarnek) * [:link:](freedom/freedom.d.ts) [freedom](https://github.com/freedomjs/freedom) by [Jonathan Pevarnek](https://github.com/jpevarnek) +* [:link:](freedom/freedom-core-env.d.ts) [freedom](https://github.com/freedomjs/freedom) by [Jonathan Pevarnek](https://github.com/jpevarnek) * [:link:](from/from.d.ts) [from](https://github.com/dominictarr/from) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](fs-ext/fs-ext.d.ts) [fs-ext](https://github.com/baudehlo/node-fs-ext) by [Oguzhan Ergin](https://github.com/OguzhanE) * [:link:](fs-extra/fs-extra.d.ts) [fs-extra](https://github.com/jprichardson/node-fs-extra) by [midknight41](https://github.com/midknight41) @@ -377,6 +450,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](ftp/ftp.d.ts) [ftp](https://github.com/mscdex/node-ftp) by [Rogier Schouten](https://github.com/rogierschouten) * [:link:](ftpd/ftpd.d.ts) [ftpd](https://github.com/sstur/nodeftpd) by [Rogier Schouten](https://github.com/rogierschouten) * [:link:](fullCalendar/fullCalendar.d.ts) [FullCalendar](http://arshaw.com/fullcalendar) by [Neil Stalker](https://github.com/nestalk), [Marcelo Camargo](https://github.com/hasellcamargo) +* [:link:](fullname/fullname.d.ts) [fullname](https://www.npmjs.com/package/fullname) by [Klaus Reimer](https://github.com/kayahr) * [:link:](fuse/fuse.d.ts) [Fuse.js](https://github.com/krisk/Fuse) by [Greg Smith](https://github.com/smrq) * [:link:](jquery-galleria/jquery-galleria.d.ts) [galleria.js](https://github.com/aino/galleria) by [Robert Imig](https://github.com/rimig) * [:link:](gamepad/gamepad.d.ts) [Gamepad API](http://www.w3.org/TR/gamepad) by [Kon](http://phyzkit.net) @@ -391,12 +465,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.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.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.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.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.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.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.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.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.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.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.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.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.maps.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) +* [:link:](google-apps-script/google-apps-script.mail.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) +* [:link:](google-apps-script/google-apps-script.lock.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) +* [:link:](google-apps-script/google-apps-script.language.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) +* [:link:](google-apps-script/google-apps-script.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.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.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.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-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.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.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.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.gmail.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) @@ -408,19 +510,22 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](gapi.translate/gapi.translate.d.ts) [Google Translate API](https://developers.google.com/translate) by [Frank M](https://github.com/sgtfrankieboy) * [:link:](gapi.urlshortener/gapi.urlshortener.d.ts) [Google Url Shortener API](https://developers.google.com/url-shortener) by [Frank M](https://github.com/sgtfrankieboy) * [:link:](google.visualization/google.visualization.d.ts) [Google Visualisation Apis](https://developers.google.com/chart) by [Dan Ludwig](https://github.com/danludwig) +* [:link:](google-maps/google-maps.d.ts) [google-maps](https://www.npmjs.com/package/google-maps) by [Deividas Bakanas](https://github.com/DeividasBakanas), [Giedrius Grabauskas](https://github.com/GiedriusGrabauskas) * [:link:](gae.channel.api/gae.channel.api.d.ts) [GoogleAppEngine's Channel API](https://developers.google.com/appengine/docs/java/channel/javascript) by [vvakame](https://github.com/vvakame) * [:link:](graceful-fs/graceful-fs.d.ts) [graceful-fs](https://github.com/cowboy/graceful-fs) by [Bart van der Schoor](https://github.com/Bartvds) -* [: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-babel/gulp-babel.d.ts) [gulp-babel](https://github.com/babel/gulp-babel) by [Aya Morisawa](https://github.com/AyaMorisawa) * [:link:](gulp-cached/gulp-cached.d.ts) [gulp-cached](https://github.com/wearefractal/gulp-cached) by [Thomas Corbière](https://github.com/tomc974) * [:link:](gulp-changed/gulp-changed.d.ts) [gulp-changed](https://github.com/sindresorhus/gulp-changed) by [Thomas Corbière](https://github.com/tomc974) * [:link:](gulp-cheerio/gulp-cheerio.d.ts) [gulp-cheerio](https://github.com/KenPowers/gulp-cheerio) by [Qubo](https://github.com/tkQubo) @@ -428,7 +533,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 +557,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,28 +586,32 @@ 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) * [:link:](highcharts/highstock.d.ts) [Highstock](http://www.highcharts.com) by [David Deutsch](http://github.com/DavidKDeutsch) +* [:link:](react-router/history.d.ts) [history](https://github.com/rackt/history) by [Sergey Buturlakin](http://github.com/sergey-buturlakin) * [: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:](hopscotch/hopscotch.d.ts) [Hopscotch](http://linkedin.github.io/hopscotch) by [Tim Perry](https://github.com/pimterry) * [:link:](howlerjs/howler.d.ts) [howler.js](https://github.com/goldfire/howler.js) by [Pedro Casaubon](https://github.com/xperiments) * [:link:](touch-events/touch-events.d.ts) [HTML Touch Events](http://www.w3.org/TR/touch-events) by [Kevin Barabash](https://github.com/kevinb7) +* [:link:](html-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) * [:link:](humane/humane.d.ts) [Humane](http://wavded.github.com/humane-js) by [jmvrbanac](https://github.com/jmvrbanac) * [:link:](hypertext-application-language/hypertext-application-language.d.ts) [Hypertext Application Language Draft 6](https://tools.ietf.org/html/draft-kelly-json-hal-06) by [Maks3w](https://github.com/maks3w) * [:link:](i18n-node/i18n-node.d.ts) [i18n-node](https://github.com/mashpie/i18n-node) by [Maxime LUCE](https://github.com/SomaticIT) -* [:link:](ng-i18next/ng-i18next.d.ts) [i18next](https://github.com/i18next/ng-i18next) by [Cyril Schumacher](https://github.com/cyrilschumacher) * [:link:](i18next/i18next.d.ts) [i18next](http://i18next.com) by [Maarten Docter](https://github.com/mdocter) +* [:link:](ng-i18next/ng-i18next.d.ts) [i18next](https://github.com/i18next/ng-i18next) by [Cyril Schumacher](https://github.com/cyrilschumacher) * [:link:](iban/iban.d.ts) [iban.js](https://github.com/arhs/iban.js) by [Cyril Schumacher](https://github.com/cyrilschumacher) +* [:link:](icepick/icepick.d.ts) [icepick](https://github.com/aearly/icepick) by [Nathan Brown](https://github.com/ngbrown) * [:link:](icheck/icheck.d.ts) [iCheck](http://damirfoy.com/iCheck) by [Dániel Tar](https://github.com/qcz) * [:link:](imagemagick/imagemagick.d.ts) [imagemagick](http://github.com/rsms/node-imagemagick) by [Carlos Ballesteros Velasco](https://github.com/soywiz) * [:link:](imagemagick-native/imagemagick-native.d.ts) [imagemagick-native](https://www.npmjs.org/package/imagemagick-native) by [Hiroki Horiuchi](https://github.com/horiuchi) @@ -512,11 +621,15 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](impress/impress.d.ts) [Impress.js](https://github.com/bartaz/impress.js) by [Boris Yankov](https://github.com/borisyankov) * [:link:](incremental-dom/incremental-dom.d.ts) [Incremetal DOM](https://github.com/google/incremental-dom) by [Basarat Ali Syed](https://github.com/basarat) * [:link:](inflection/inflection.d.ts) [inflection](https://github.com/dreamerslab/node.inflection) by [Shogo Iwano](https://github.com/shiwano) +* [:link:](inherits/inherits.d.ts) [inherits](https://github.com/isaacs/inherits) by [Ilya Mochalov](https://github.com/chrootsu) * [: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) @@ -529,6 +642,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](iscroll/iscroll-lite.d.ts) [iScroll Lite](http://cubiq.org/iscroll-4) by [Boris Yankov](https://github.com/borisyankov), [Christiaan Rakowski](https://github.com/csrakowski) * [:link:](iscroll/iscroll-5-lite.d.ts) [iScroll Lite 5](http://cubiq.org/iscroll-5-ready-for-beta-test) by [Christiaan Rakowski](https://github.com/csrakowski) * [:link:](iso8601-localizer/iso8601-localizer.d.ts) [ISO8601-Localizer](https://github.com/avielfedida/ISO8601-Localizer) by [Aviel Fedida](https://github.com/avielfedida) +* [:link:](istanbul/istanbul.d.ts) [Istanbul](https://github.com/gotwarlost/istanbul) by [Tanguy Krotoff](https://github.com/tkrotoff) * [:link:](ix.js/ix.d.ts) [IxJS 1.0.6 / ix.js](https://github.com/Reactive-Extensions/IxJS) by [Igor Oleinikov](https://github.com/Igorbek) * [:link:](ix.js/l2o.d.ts) [IxJS 1.0.6 / l2o.js](https://github.com/Reactive-Extensions/IxJS) by [Igor Oleinikov](https://github.com/Igorbek) * [:link:](jade/jade.d.ts) [jade](https://github.com/jadejs/jade) by [Panu Horsmalahti](https://github.com/panuhorsmalahti) @@ -537,6 +651,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](jasmine-data_driven_tests/jasmine-data_driven_tests.d.ts) [Jasmine Data Driven Tests](https://github.com/gburghardt/jasmine-data_driven_tests) by [Anthony MacKinnon](https://github.com/AnthonyMacKinnon) * [:link:](jasmine-ajax/jasmine-ajax.d.ts) [jasmine-ajax](https://github.com/jasmine/jasmine-ajax) by [Louis Grignon](https://github.com/lgrignon) * [:link:](jasmine-es6-promise-matchers/jasmine-es6-promise-matchers.d.ts) [jasmine-es6-promise-matchers](https://github.com/bvaughn/jasmine-es6-promise-matchers) by [Stephen Lautier](https://github.com/stephenlautier) +* [:link:](jasmine-expect/jasmine-expect.d.ts) [jasmine-expect](https://github.com/JamieMason/Jasmine-Matchers) by [UserPixel](https://github.com/UserPixel) * [:link:](jasmine-fixture/jasmine-fixture.d.ts) [Jasmine-fixture](https://github.com/searls/jasmine-fixture) by [Craig Brett](https://github.com/craigbrett17) * [:link:](jasmine-jquery/jasmine-jquery.d.ts) [Jasmine-JQuery](https://github.com/velesin/jasmine-jquery) by [Gregor Stamac](https://github.com/gstamac) * [:link:](jasmine-matchers/jasmine-matchers.d.ts) [jasmine-matchers](https://github.com/uxebu/jasmine-matchers) by [Bart van der Schoor](https://github.com/Bartvds) @@ -545,6 +660,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](java-applet/java-applet.d.ts) [Java Applet](https://www.java.com) by [Cyril Schumacher](https://github.com/cyrilschumacher) * [:link:](hooker/hooker.d.ts) [JavaScript Hooker](https://github.com/cowboy/javascript-hooker) by [Michael Zabka](https://github.com/misak113) * [:link:](oauth.js/oauth.js.d.ts) [JavaScript software for implementing an OAuth consumer](https://code.google.com/p/oauth) by [NOBUOKA Yu](https://github.com/nobuoka) +* [:link:](javascript-bignum/javascript-bignum.d.ts) [javascript-bignum](https://github.com/jtobey/javascript-bignum) by [Nathan Shively-Sanders](https://github.com/sandersn) * [:link:](jbinary/jbinary.d.ts) [jBinary](https://github.com/jDataView/jBinary) by [Tim Bureck](https://github.com/tbureck) * [:link:](jdataview/jdataview.d.ts) [jDataView](https://github.com/jDataView/jDataView) by [Ingvar Stepanyan](https://github.com/RReverser) * [:link:](jest/jest.d.ts) [Jest](http://facebook.github.io/jest) by [Asana](https://asana.com) @@ -552,7 +668,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](jjve/jjve.d.ts) [JJVE](https://github.com/silas/jjve) by [Wim Looman](https://github.com/Nemo157) * [:link:](joData/joData.d.ts) [joData](https://github.com/mccow002/joData) by [Chris Wrench](https://github.com/cgwrench) * [:link:](johnny-five/johnny-five.d.ts) [johnny-five](https://github.com/rwaldron/johnny-five) by [Toshiya Nakakura](https://github.com/nakakura) -* [:link:](joi/joi.d.ts) [joi](https://github.com/spumko/joi) by [Bart van der Schoor](https://github.com/Bartvds), [Laurence Dougal Myers](https://github.com/laurence-myers), [Christopher Glantschnig](https://github.com/cglantschnig) +* [:link:](joi/joi.d.ts) [joi](https://github.com/spumko/joi) by [Bart van der Schoor](https://github.com/Bartvds), [Laurence Dougal Myers](https://github.com/laurence-myers), [Christopher Glantschnig](https://github.com/cglantschnig), [David Broder-Rodgers](https://github.com/DavidBR-SW) * [:link:](jointjs/jointjs.d.ts) [Joint JS](http://www.jointjs.com) by [Aidan Reel](http://github.com/areel), [David Durman](http://github.com/DavidDurman), [Ewout Van Gossum](https://github.com/DenEwout) * [:link:](jqrangeslider/jqrangeslider.d.ts) [jQRangeSlider](http://ghusse.github.com/jQRangeSlider) by [Dániel Tar](https://github.com/qcz) * [:link:](jquery/jquery.d.ts) [jQuery 1.10.x / 2.0.x](http://jquery.com) by [Boris Yankov](https://github.com/borisyankov), [Christian Hoffmeister](https://github.com/choffmeister), [Steve Fenton](https://github.com/Steve-Fenton), [Diullei Gomes](https://github.com/Diullei), [Tass Iliopoulos](https://github.com/tasoili), [Jason Swearingen](https://github.com/jasons-novaleaf), [Sean Hill](https://github.com/seanski), [Guus Goossens](https://github.com/Guuz), [Kelly Summerlin](https://github.com/ksummerlin), [Basarat Ali Syed](https://github.com/basarat), [Nicholas Wolverson](https://github.com/nwolverson), [Derek Cicerone](https://github.com/derekcicerone), [Andrew Gaspar](https://github.com/AndrewGaspar), [James Harrison Fisher](https://github.com/jameshfisher), [Seikichi Kondo](https://github.com/seikichi), [Benjamin Jackman](https://github.com/benjaminjackman), [Poul Sorensen](https://github.com/s093294), [Josh Strobl](https://github.com/JoshStrobl), [John Reilly](https://github.com/johnnyreilly), [Dick van den Brink](https://github.com/DickvdBrink) @@ -568,6 +684,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](jquery.joyride/jquery.joyride.d.ts) [jQuery JoyRide Plugin](https://github.com/zurb/joyride) by [Vincent Bortone](https://github.com/vbortone) * [:link:](jqgrid/jqgrid.d.ts) [jQuery jqgrid Plugin](https://github.com/tonytomov/jqGrid) by [Lokesh Peta](https://github.com/lokeshpeta) * [:link:](jquery-knob/jquery-knob.d.ts) [jQuery Knob](http://anthonyterrien.com/knob) by [Iain Buchanan](https://github.com/iain8) +* [:link:](jquery.mmenu/jquery.mmenu.d.ts) [jQuery mmenu](http://mmenu.frebsite.nl) by [John Gouigouix](https://github.com/orchestra-ts/DefinitelyTyped) * [:link:](jquerymobile/jquerymobile.d.ts) [jQuery Mobile](http://jquerymobile.com) by [Boris Yankov](https://github.com/borisyankov) * [:link:](jquery.notifyBar/jquery.notifyBar.d.ts) [jQuery Notify Bar](http://www.whoop.ee/posts/2013-04-05-the-resurrection-of-jquery-notify-bar) by [Shunsuke Ohtani](https://github.com/zaneli) * [:link:](jquery.base64/jquery.base64.d.ts) [jQuery Plugin - base64 codec](https://github.com/yatt/jquery.base64) by [Shinya Mochizuki](https://github.com/enrapt-mochizuki) @@ -607,7 +724,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 +735,10 @@ 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:](raty/raty.d.ts) [jQuery.raty](https://github.com/wbotelhos/raty) by [Matt Wheatley](http://github.com/terrawheat) * [: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,6 +753,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:](js-combinatorics/js-combinatorics.d.ts) [js-combinatorics](https://github.com/dankogai/js-combinatorics) by [Vasya Aksyonov](https://github.com/outring) +* [:link:](js-combinatorics/js-combinatorics-global.d.ts) [js-combinatorics (global)](https://github.com/dankogai/js-combinatorics) by [Vasya Aksyonov](https://github.com/outring) * [: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:](js-fixtures/fixtures.d.ts) [js-fixtures](https://github.com/badunk/js-fixtures) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid) @@ -651,6 +775,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) @@ -662,16 +787,20 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](jsonwebtoken/jsonwebtoken.d.ts) [jsonwebtoken](https://github.com/auth0/node-jsonwebtoken) by [Maxime LUCE](https://github.com/SomaticIT) * [:link:](jsplumb/jquery.jsPlumb.d.ts) [jsPlumb 1.3.16 jQuery adapter](http://jsplumb.org) by [Steve Shearn](https://github.com/shearnie) * [:link:](jsrender/jsrender.d.ts) [JsRender](http://www.jsviews.com/#jsrender) by [Kensuke Matsuzaki](https://github.com/zakki) -* [:link:](jssha/jssha.d.ts) [jsSHA](https://github.com/Caligatio/jsSHA) by [David Li](https://github.com/randombk) +* [:link:](jssha/jssha.d.ts) [jsSHA](https://github.com/Caligatio/jsSHA) by [David Li](https://github.com/randombk), [Tobias Kahlert](https://github.com/SrTobi) * [: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:](jsurl/jsurl.d.ts) [jsurl](https://github.com/Mikhus/jsurl) by [Alexey Gorshkov](https://github.com/agorshkov23) * [: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) +* [:link:](jwt-decode/jwt-decode.d.ts) [jwt-decode](https://github.com/auth0/jwt-decode) by [Giedrius Grabauskas](https://github.com/QuatroDevOfficial) * [:link:](jwt-simple/jwt-simple.d.ts) [jwt-simple](https://github.com/hokaccha/node-jwt-simple) by [Ken Fukuyama](https://github.com/kenfdev) * [:link:](kafka-node/kafka-node.d.ts) [kafka-node](https://github.com/SOHU-Co/kafka-node) by [Daniel Imrie-Situnayake](https://github.com/dansitu) * [:link:](karma/karma.d.ts) [karma](https://github.com/karma-runner/karma) by [Tanguy Krotoff](https://github.com/tkrotoff) +* [:link:](karma-coverage/karma-coverage.d.ts) [karma-coverage](https://github.com/karma-runner/karma-coverage) by [Tanguy Krotoff](https://github.com/tkrotoff) * [:link:](karma-jasmine/karma-jasmine.d.ts) [karma-jasmine plugin](https://github.com/karma-runner/karma-jasmine) by [Michel Salib](https://github.com/michelsalib) * [:link:](katex/katex.d.ts) [KaTeX v.0.5.0](http://khan.github.io/KaTeX) by [Michael Randolph](https://github.com/mrand01) * [:link:](kefir/kefir.d.ts) [Kefir](http://rpominov.github.io/kefir) by [Aya Morisawa](https://github.com/AyaMorisawa) @@ -679,6 +808,8 @@ 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:](keytar/keytar.d.ts) [keytar](http://atom.github.io/node-keytar) by [Milan Burda](https://github.com/miniak) +* [: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,31 +840,38 @@ 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) * [:link:](leapmotionTS/LeapMotionTS.d.ts) [Leap Motion TS](https://github.com/logotype/LeapMotionTS) by [Victor Norgren](https://github.com/logotype) * [:link:](less/less.d.ts) [LESS](http://lesscss.org) by [Tom Hasner](https://github.com/thasner) * [:link:](less-middleware/less-middleware.d.ts) [less-middleware](https://github.com/emberfeather/less.js-middleware) by [Federico Bond](https://github.com/federicobond) +* [:link:](lestate/lestate.d.ts) [LeState](https://github.com/LeTools/LeState) by [Hadrian Oliveira](https://github.com/thelambdaparty) * [: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:](lwip/lwip.d.ts) [Light-weight image processor](https://github.com/EyalAr/lwip) by [Aya Morisawa](https://github.com/AyaMorisawa) +* [:link:](lime-js/lime-js.d.ts) [lime-js](https://github.com/takenet/lime-js) by [Arthur Xavier](https://github.com/arthur-xavier) +* [: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:](lobibox/lobibox.d.ts) [lobibox](https://github.com/arboshiki/lobibox) by [Sabeeh Ul Hussnain](https://github.com/itboy87) * [:link:](lockfile/lockfile.d.ts) [lockfile](https://github.com/isaacs/lockfile) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](lodash-decorators/lodash-decorators.d.ts) [lodash-decorators](https://github.com/steelsojka/lodash-decorators) by [Qubo](https://github.com/tkqubo) * [:link:](log4javascript/log4javascript.d.ts) [log4javascript](http://log4javascript.org) by [Markus Wagner](https://github.com/Ritzlgrmft) * [:link:](log4js/log4js.d.ts) [log4js](https://github.com/nomiddlename/log4js-node) by [Kentaro Okuno](http://github.com/armorik83) * [:link:](logg/logg.d.ts) [logg](https://github.com/dpup/node-logg) by [Bret Little](https://github.com/blittle) * [:link:](loggly/loggly.d.ts) [loggly](https://github.com/nodejitsu/node-loggly) by [Ray Martone](https://github.com/rmartone) -* [:link:](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) -* [:link:](long/long.d.ts) [Long.js](https://github.com/dcodeIO/Long.js) by [Peter Kooijmans](https://github.com/peterkooijmans) +* [:link:](long/long.d.ts) [long.js](https://github.com/dcodeIO/long.js) by [Peter Kooijmans](https://github.com/peterkooijmans) * [:link:](lory.js/lory.js.d.ts) [lory](https://github.com/meandmax/lory) by [kubosho](https://github.com/kubosho) * [:link:](lovefield/lovefield.d.ts) [Lovefield](http://google.github.io/lovefield) by [freshp86](https://github.com/freshp86) * [:link:](lower-case/lower-case.d.ts) [lower-case](https://github.com/blakeembrey/lower-case) by [Sam Saint-Pettersen](https://github.com/stpettersens) @@ -757,15 +895,18 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](mariasql/mariasql.d.ts) [mariasql](https://github.com/mscdex/node-mariasql) by [MichaelBennett](https://github.com/bennett000) * [:link:](marionette/marionette.d.ts) [Marionette](https://github.com/marionettejs) by [Zeeshan Hamid](https://github.com/zhamid), [Natan Vivo](https://github.com/nvivo), [Sven Tschui](https://github.com/sventschui) * [:link:](marked/marked.d.ts) [Marked](https://github.com/chjj/marked) by [William Orr](https://github.com/worr) +* [:link:](ngwysiwyg/ngwysiwyg.d.ts) [Marked](https://github.com/psergus/ngWYSIWYG) by [Patrick Mac Kay](https://github.com/patrick-mackay) * [: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 +931,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) @@ -799,6 +941,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](mixto/mixto.d.ts) [mixto](https://github.com/atom/mixto) by [vvakame](https://github.com/vvakame) * [: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:](mmmagic/mmmagic.d.ts) [mmmagic](https://github.com/mscdex/mmmagic) by [Andrei Sebastian Cîmpean](http://andreime.com) * [:link:](mobile-detect/mobile-detect.d.ts) [mobile-detect](http://hgoebl.github.io/mobile-detect.js) by [Martin McWhorter](https://github.com/martinmcwhorter) * [:link:](mobservable/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) @@ -807,13 +950,15 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](mocha-phantomjs/mocha-phantomjs.d.ts) [mocha-phantomjs](http://metaskills.net/mocha-phantomjs) by [Erik Schierboom](https://github.com/ErikSchierboom) * [:link:](mock-fs/mock-fs.d.ts) [mock-fs](https://github.com/tschaub/mock-fs) by [Wim Looman](https://github.com/Nemo157) * [: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:](modernizr/modernizr.d.ts) [Modernizr](http://modernizr.com) by [Boris Yankov](https://github.com/borisyankov), [Theodore Brown](https://github.com/theodorejb), [Leon Yu](https://github.com/leonyu) * [:link:](moment-timezone/moment-timezone.d.ts) [moment-timezone.js](http://momentjs.com/timezone) by [Michel Salib](https://github.com/michelsalib) +* [:link:](moment-range/moment-range.d.ts) [Moment.js](https://github.com/gf3/moment-range) by [Bart van den Burg](https://github.com/Burgov), [Wilgert Velinga](https://github.com/wilgert) * [:link:](moment/moment-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-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) +* [:link:](mongoose-auto-increment/mongoose-auto-increment.d.ts) [mongoose-auto-increment](https://github.com/codetunnel/mongoose-auto-increment) by [Aya Morisawa](https://github.com/AyaMorisawa) +* [:link:](mongoose-deep-populate/mongoose-deep-populate.d.ts) [mongoose-deep-populate](https://github.com/buunguyen/mongoose-deep-populate) by [Aya Morisawa](https://github.com/AyaMorisawa) * [:link:](mongoose-mock/mongoose-mock.d.ts) [mongoose-mock](https://github.com/JohanObrink/mongoose-mock) by [jt000](https://github.com/jt000) * [:link:](morgan/morgan.d.ts) [morgan](https://github.com/expressjs/morgan) by [James Roland Cabresos](https://github.com/staticfunction) * [:link:](mousetrap/mousetrap-global-bind.d.ts) [Mousetrap 1.4.6's global-bind extension](http://craig.is/killing/mice#extensions.global) by [Andrew Bradley](https://github.com/cspotcode) @@ -822,12 +967,13 @@ 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) * [:link:](mssql/mssql.d.ts) [mssql](https://www.npmjs.com/package/mssql) by [COLSA Corporation](http://www.colsa.com), [Ben Farr](https://github.com/jaminfarr) * [:link:](mu2/mu2.d.ts) [mu2](http://github.com/raycmorgan/mu) by [Jeff Goddard](https://github.com/jedigo) -* [:link:](multer/multer.d.ts) [multer](https://github.com/expressjs/multer) by [jt000](https://github.com/jt000), [vilicvane](https://vilic.github.io) +* [:link:](multer/multer.d.ts) [multer](https://github.com/expressjs/multer) by [jt000](https://github.com/jt000), [vilicvane](https://vilic.github.io), [David Broder-Rodgers](https://github.com/DavidBR-SW) * [:link:](multiplexjs/multiplexjs.d.ts) [Multiplex.js](http://github.com/multiplex/multiplex.js) by [Kamyar Nazeri](http://github.com/KamyarNazeri) * [:link:](mustache/mustache.d.ts) [Mustache](https://github.com/janl/mustache.js) by [Mark Ashley Bell](https://github.com/markashleybell) * [:link:](natural/natural.d.ts) [Natural](https://github.com/NaturalNode/natural) by [Dylan R. E. Moonfire](https://github.com/dmoonfire) @@ -842,10 +988,30 @@ 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:](ng-notify/ng-notify.d.ts) [ng-notify](https://github.com/matowens/ng-notify) by [Nick Zamosenchuk](https://github.com/nzamosenchuk) +* [:link:](ngbootbox/ngbootbox.d.ts) [ngbootbox](https://github.com/eriktufvesson/ngBootbox) by [Sam Saint-Pettersen](https://github.com/stpettersens) +* [:link:](ng-cordova/actionSheet.d.ts) [ngCordova Action Sheet plugin](https://github.com/driftyco/ng-cordova) by [Phil McCloghry-Laing](https://github.com/pmccloghrylaing) +* [: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/badge.d.ts) [ngCordova badge plugin](https://github.com/driftyco/ng-cordova) by [Phil McCloghry-Laing](https://github.com/pmccloghrylaing) +* [: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/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/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/file.d.ts) [ngCordova file plugin](https://github.com/driftyco/ng-cordova) by [Phil McCloghry-Laing](https://github.com/pmccloghrylaing) +* [:link:](ng-cordova/fileTransfer.d.ts) [ngCordova file-transfer plugin](https://github.com/driftyco/ng-cordova) by [Phil McCloghry-Laing](https://github.com/pmccloghrylaing) +* [: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-cordova/camera.d.ts) [ngCordova.plugins.camera](https://github.com/driftyco/ng-cordova) by [Jacques Kang](https://www.linkedin.com/in/jacqueskang) * [: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) * [:link:](ngprogress-lite/ngprogress-lite.d.ts) [ngprogress-lite](https://github.com/voronianski/ngprogress-lite) by [Luke Forder](https://github.com/LukeForder) +* [:link:](ng-stomp/ng-stomp.d.ts) [ngStomp](https://github.com/beevelop/ng-stomp) by [Lukasz Potapczuk](https://github.com/lpotapczuk) * [:link:](nightmare/nightmare.d.ts) [Nightmare](https://github.com/segmentio/nightmare) by [horiuchi](https://github.com/horiuchi) * [:link:](noble/noble.d.ts) [noble](https://github.com/sandeepmistry/noble) by [Seon-Wook Park](https://github.com/swook) * [:link:](nock/nock.d.ts) [nock](https://github.com/pgte/nock) by [bonnici](https://github.com/bonnici) @@ -855,6 +1021,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) @@ -862,6 +1029,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](config/config.d.ts) [node-config](https://github.com/lorenwest/node-config) by [Roman Korneev](https://github.com/RWander) * [:link:](node-config-manager/node-config-manager.d.ts) [node-config-manager](https://www.npmjs.com/package/node-config-manager) by [TANAKA Koichi](https://gitnub.com/mugeso) * [:link:](convict/convict.d.ts) [node-convict](https://github.com/mozilla/node-convict) by [Wim Looman](https://github.com/Nemo157) +* [:link:](node-dir/node-dir.d.ts) [node-dir](https://github.com/fshost/node-dir) by [Panu Horsmalahti](https://github.com/panuhorsmalahti) +* [:link:](email-templates/email-templates.d.ts) [node-email-templates](https://github.com/niftylettuce/node-email-templates) by [Cyril Schumacher](https://github.com/cyrilschumacher) * [:link:](node-ffi/node-ffi.d.ts) [node-ffi](https://github.com/rbranson/node-ffi) by [Paul Loyd](https://github.com/loyd) * [:link:](node-fibers/node-fibers.d.ts) [node-fibers](https://github.com/laverdet/node-fibers) by [Cary Haynie](https://github.com/caryhaynie) * [:link:](node-form/node-form.d.ts) [node-form](https://github.com/rsamec/form) by [Roman Samec](https://github.com/rsamec) @@ -881,18 +1050,20 @@ 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-base.d.ts) [node-uuid.js](https://github.com/broofa/node-uuid) by [Jeff May](https://github.com/jeffmay) +* [:link:](node-uuid/node-uuid.d.ts) [node-uuid.js](https://github.com/broofa/node-uuid) by [Jeff May](https://github.com/jeffmay) +* [:link:](node-uuid/node-uuid-global.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:](yandex-money-sdk/yandex-money-sdk.d.ts) [NodeJS Yandex.Money API SDK](https://github.com/yandex-money/yandex-money-sdk-nodejs) by [Ilya Mochalov](https://github.com/chrootsu) * [: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) * [:link:](nodemailer-direct-transport/nodemailer-direct-transport.d.ts) [nodemailer-direct-transport](https://github.com/andris9/nodemailer-direct-transport) by [Rogier Schouten](https://github.com/rogierschouten) @@ -902,8 +1073,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](nodeunit/nodeunit.d.ts) [nodeunit](https://github.com/caolan/nodeunit) by [Jeff Goddard](https://github.com/jedigo) * [:link:](nomnom/nomnom.d.ts) [nomnom](https://github.com/harthur/nomnom) by [Paul Vick](https://github.com/panopticoncentral) * [:link:](nopt/nopt.d.ts) [nopt](https://github.com/npm/nopt) by [jbondc](https://github.com/jbondc) -* [:link:](notifyjs/notifyjs.d.ts) [notify.js](https://github.com/alexgibson/notify.js) by [soundTricker](https://github.com/soundTricker) * [:link:](notify/notify.d.ts) [Notify.js](https://github.com/jpillora/notifyjs) by [Xiaohan Zhang](https://github.com/hellochar) +* [:link:](notifyjs/notifyjs.d.ts) [notify.js](https://github.com/alexgibson/notify.js) by [soundTricker](https://github.com/soundTricker) * [:link:](wnumb/wnumb.d.ts) [nouislider](https://github.com/leongersen/wnumb) by [Corey Jepperson](https://github.com/acoreyj) * [:link:](nouislider/nouislider.d.ts) [nouislider](https://github.com/leongersen/noUiSlider) by [Patrick Davies](https://github.com/bleuarg) * [:link:](noVNC/noVNC.d.ts) [noVNC](https://github.com/kanaka/noVNC) by [Ken Smith](https://github.com/smithkl42) @@ -920,30 +1091,34 @@ 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) +* [:link:](opn/opn.d.ts) [opn](https://github.com/sindresorhus/opn) by [Shinnosuke Watanabe](https://github.com/shinnn), [Maxime LUCE](https://github.com/SomaticIT) * [:link:](optimist/optimist.d.ts) [optimist](https://github.com/substack/node-optimist) by [Carlos Ballesteros Velasco](https://github.com/soywiz) * [:link:](orchestrator/orchestrator.d.ts) [Orchestrator](https://github.com/orchestrator/orchestrator) by [Qubo](https://github.com/tkQubo) * [:link:](os-locale/os-locale.d.ts) [os-locale](https://github.com/sindresorhus/os-locale) by [Aya Morisawa](https://github.com/AyaMorisawa) * [:link:](owlcarousel/owlcarousel.d.ts) [OwlCarousel v.1.3.3](https://github.com/OwlFonk/OwlCarousel) by [Damian Piątkowski](https://github.com/dpiatkowski) +* [:link:](p2/p2.d.ts) [p2.js](https://github.com/schteppe/p2.js) by [Clark Stevenson](https://github.com/clark-stevenson) * [:link:](packery/packery.d.ts) [Packery](http://packery.metafizzy.co) by [Piraveen Kamalathas from Kilix](https://github.com/piraveen) * [:link:](page/page.d.ts) [page](http://visionmedia.github.io/page.js) by [Alan Norbauer](http://alan.norbauer.com) +* [:link:](pako/pako.d.ts) [pako](https://github.com/nodeca/pako) by [Denis Cappellin](http://github.com/cappellin) * [:link:](papaparse/papaparse.d.ts) [PapaParse](https://github.com/mholt/PapaParse) by [Pedro Flemming](https://github.com/torpedro) * [:link:](parallel/parallel.d.ts) [parallel.js](http://adambom.github.io/parallel.js) by [Josh Baldwin](https://github.com/jbaldwin) * [:link:](param-case/param-case.d.ts) [param-case](https://github.com/blakeembrey/param-case) by [Sam Saint-Pettersen](https://github.com/stpettersens) * [:link:](parse/parse.d.ts) [Parse](https://parse.com) by [Ullisen Media Group](http://ullisenmedia.com) -* [:link:](parsimmon/parsimmon.d.ts) [Parsimmon](https://github.com/jneen/parsimmon) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](parsimmon/parsimmon.d.ts) [Parsimmon](https://github.com/jneen/parsimmon) by [Bart van der Schoor](https://github.com/Bartvds), [Mizunashi Mana](https://github.com/mizunashi-mana) * [: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-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,19 +1145,22 @@ 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) * [:link:](polymer/polymer.d.ts) [polymer](https://github.com/Polymer/polymer) by [Louis Grignon](https://github.com/lgrignon), [Suguru Inatomi](https://github.com/laco0416) +* [:link:](polymer-ts/polymer-ts.d.ts) [PolymerTS](https://github.com/nippur72/PolymerTS) by [Louis Grignon](https://github.com/lgrignon) * [:link:](popcorn/popcorn.d.ts) [Popcorn](https://github.com/mozilla/popcorn-js) by [grapswiz](https://github.com/grapswiz) * [:link:](postal/postal.d.ts) [Postal](https://github.com/postaljs/postal.js) by [Lokesh Peta](https://github.com/lokeshpeta), [Paul Jolly](https://github.com/myitcv) * [:link:](pouchDB/pouch.d.ts) [Pouch](http://pouchdb.com) by [Bill Sears](https://github.com/MrBigDog2U) @@ -997,6 +1175,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](promise-pool/promise-pool.d.ts) [promise-pool](https://github.com/vilic/promise-pool) by [VILIC VANE](https://github.com/vilic) * [:link:](promises-a-plus/promises-a-plus.d.ts) [promises-a-plus](http://promisesaplus.com) by [Igor Oleinikov](https://github.com/Igorbek) * [:link:](protobufjs/protobufjs.d.ts) [ProtoBuf.js](https://github.com/dcodeIO/ProtoBuf.js) by [Panu Horsmalahti](https://github.com/panuhorsmalahti) +* [:link:](protractor-http-mock/protractor-http-mock.d.ts) [protractor-http-mock](https://github.com/atecarlos/protractor-http-mock) by [Crevil](https://github.com/Crevil) * [:link:](proxyquire/proxyquire.d.ts) [Proxyquire](https://github.com/thlorenz/proxyquire) by [jt000](https://github.com/jt000) * [:link:](pty.js/pty.js.d.ts) [pty.js 0.2.7-1](https://github.com/chjj/pty.js) by [Vadim Macagon](https://github.com/enlight) * [:link:](pubsubjs/pubsub.d.ts) [PubSubJS](https://github.com/mroderick/PubSubJS) by [Boris Yankov](https://github.com/borisyankov) @@ -1008,6 +1187,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](qajax/qajax.d.ts) [Qajax](https://github.com/gre/qajax) by [Boltmade](https://github.com/Boltmade) * [:link:](qs/qs.d.ts) [qs](https://github.com/hapijs/qs) by [Roman Korneev](https://github.com/RWander) * [:link:](qtip2/qtip2.d.ts) [qtip2](http://qtip2.com) by [Nathan Pitman](https://github.com/Seltzer) +* [:link:](query-string/query-string.d.ts) [query-string](https://github.com/sindresorhus/query-string) by [Sam Verschueren](https://github.com/SamVerschueren) * [:link:](quixote/quixote.d.ts) [quixote](http://quixote-css.com) by [Aleksandr Filatov](https://github.com/greybax) * [:link:](qunit/qunit.d.ts) [QUnit](http://qunitjs.com) by [Diullei Gomes](https://github.com/diullei) * [:link:](qwest/qwest.d.ts) [qwest](https://github.com/pyrsmk/qwest) by [Lindsay Evans](https://github.com/lindsayevans) @@ -1017,18 +1197,39 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](rangy/rangy.d.ts) [Rangy](https://github.com/timdown/rangy) by [Rudolph Gottesheim](http://www.midnight-design.at) * [:link:](raphael/raphael.d.ts) [Raphael](http://raphaeljs.com) by [CheCoxshall](https://github.com/CheCoxshall) * [:link:](rappid/rappid.d.ts) [Rappid](http://jointjs.com/about-rappid) by [Ewout Van Gossum](https://github.com/DenEwout) +* [:link:](ratelimiter/ratelimiter.d.ts) [ratelimiter](https://github.com/tj/node-ratelimiter) by [Aya Morisawa](https://github.com/AyaMorisawa) * [:link:](ravenjs/ravenjs.d.ts) [Raven.js](https://github.com/getsentry/raven-js) by [Santi Albo](https://github.com/santialbo) * [:link:](raygun4js/raygun4js.d.ts) [raygun4js](https://github.com/MindscapeHQ/raygun4js) by [Brian Surowiec](https://github.com/xt0rted) +* [:link:](rcloader/rcloader.d.ts) [rcloader](https://github.com/spalger/rcloader) by [Panu Horsmalahti](https://github.com/panuhorsmalahti) * [: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-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-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-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-datagrid/react-datagrid.d.ts) [react-datagrid](https://github.com/zippyui/react-datagrid.git) by [Stephen Jelfs](https://github.com/stephenjelfs) +* [:link:](react-day-picker/react-day-picker.d.ts) [react-day-picker](https://github.com/gpbl/react-day-picker) by [Giampaolo Bellavite](https://github.com/gpbl), [Jason Killian](https://github.com/jkillian) +* [:link:](react-dropzone/react-dropzone.d.ts) [react-dropzone](https://github.com/paramaggarwal/react-dropzone) by [Mathieu Larouche Dube](https://github.com/matdube) +* [:link:](react-infinite/react-infinite.d.ts) [react-infinite](https://github.com/seatgeek/react-infinite) by [rhysd](https://github.com/rhysd) +* [: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-router/react-router.d.ts) [react-router](https://github.com/rackt/react-router) by [Sergey Buturlakin](http://github.com/sergey-buturlakin), [Yuichi Murata](https://github.com/mrk21), [Václav Ostrožlík](https://github.com/vasek17) +* [:link:](react-select/react-select.d.ts) [react-select](https://github.com/JedWatson/react-select) by [ESQUIBET Hugo](https://github.com/Hesquibet) * [: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) @@ -1037,15 +1238,15 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](redux-action-utils/redux-action-utils.d.ts) [redux-action-utils](https://github.com/insin/redux-action-utils) by [Qubo](https://github.com/tkqubo) * [:link:](redux-actions/redux-actions.d.ts) [redux-actions](https://github.com/acdlite/redux-actions) by [Jack Hsu](https://github.com/jaysoo) * [:link:](redux-devtools/redux-devtools.d.ts) [redux-devtools](https://github.com/gaearon/redux-devtools) by [Qubo](https://github.com/tkqubo) +* [:link:](redux-form/redux-form.d.ts) [redux-form](https://github.com/erikras/redux-form) by [Daniel Lytkin](https://github.com/aikoven) * [:link:](redux-logger/redux-logger.d.ts) [redux-logger](https://github.com/fcomb/redux-logger) by [Alexander Rusakov](https://github.com/arusakov) * [:link:](redux-thunk/redux-thunk.d.ts) [redux-thunk](https://github.com/gaearon/redux-thunk) by [Qubo](https://github.com/tkqubo) -* [:link:](ref/ref.d.ts) [ref](https://github.com/TooTallNate/ref) by [Paul Loyd](https://github.com/loyd) * [: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,14 +1258,17 @@ 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) * [:link:](rsmq-worker/rsmq-worker.d.ts) [rsmq-worker](http://smrchy.github.io/rsmq/rsmq-worker) by [TANAKA Koichi](https://github.com/MugeSo) +* [:link:](rss/rss.d.ts) [rss](https://github.com/dylang/node-rss) by [Second Datke](https://github.com/secondwtq) * [:link:](rtree/rtree.d.ts) [rtree](https://github.com/leaflet-extras/RTree) by [Omede Firouz](https://github.com/oefirouz) * [:link:](run-sequence/run-sequence.d.ts) [run-sequence](https://github.com/OverZealous/run-sequence) by [Keita Kagurazaka](https://github.com/k-kagurazaka) * [:link:](rx/rx.d.ts) [RxJS](http://rx.codeplex.com) by [gsino](http://www.codeplex.com/site/users/view/gsino), [Igor Oleinikov](https://github.com/Igorbek) @@ -1082,14 +1286,18 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](rx/rx.time.d.ts) [RxJS-Time](http://rx.codeplex.com) by [Carl de Billy](http://carl.debilly.net), [Igor Oleinikov](https://github.com/Igorbek) * [:link:](rx/rx.virtualtime.d.ts) [RxJS-VirtualTime](http://rx.codeplex.com) by [gsino](http://www.codeplex.com/site/users/view/gsino), [Igor Oleinikov](https://github.com/Igorbek) * [:link:](s3-uploader/s3-uploader.d.ts) [s3-uploader](https://www.npmjs.com/package/s3-uploader) by [COLSA Corporation](http://www.colsa.com) +* [:link:](s3rver/s3rver.d.ts) [S3rver](https://github.com/jamhall/s3rver) by [David Broder-Rodgers](https://github.com/DavidBR-SW) * [:link:](sammyjs/sammyjs.d.ts) [Sammy.js](http://sammyjs.org) by [Boris Yankov](https://github.com/borisyankov), [Oisin Grehan](https://github.com/oising) +* [:link:](sandboxed-module/sandboxed-module.d.ts) [sandboxed-module](https://github.com/felixge/node-sandboxed-module) by [Sven Reglitzki](https://github.com/svi3c) * [:link:](sanitize-filename/sanitize-filename.d.ts) [sanitize-filename](https://github.com/parshap/node-sanitize-filename) by [Wim Looman](https://github.com/Nemo157) * [:link:](sanitize-html/sanitize-html.d.ts) [sanitize-html](https://github.com/punkave/sanitize-html) by [Rogier Schouten](https://github.com/rogierschouten) * [: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:](scrypt-async/scrypt-async.d.ts) [scrypt-async](https://github.com/dchest/scrypt-async-js) by [Kaur Kuut](https://github.com/xStrom) * [:link:](seedrandom/seedrandom.d.ts) [seedrandom](https://github.com/davidbau/seedrandom) by [Kern Handa](https://github.com/kernhanda) * [:link:](segment-analytics/segment-analytics.d.ts) [Segment's analytics.js](https://segment.com/docs/libraries/analytics.js) by [Andrew Fong](https://github.com/fongandrew) * [:link:](analytics-node/analytics-node.d.ts) [Segment's analytics.js for Node.js](https://segment.com/docs/libraries/node) by [Andrew Fong](https://github.com/fongandrew) @@ -1102,24 +1310,27 @@ 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-index/serve-index.d.ts) [serve-index](https://github.com/expressjs/serve-index) by [Tanguy Krotoff](https://github.com/tkrotoff) * [:link:](serve-static/serve-static.d.ts) [serve-static](https://github.com/expressjs/serve-static) by [Uros Smolnik](https://github.com/urossmolnik) * [:link:](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) * [:link:](should/should.d.ts) [should.js](https://github.com/visionmedia/should.js) by [Alex Varju](https://github.com/varju), [Maxime LUCE](https://github.com/SomaticIT) * [:link:](showdown/showdown.d.ts) [Showdown](https://github.com/coreyti/showdown) by [cbowdon](https://github.com/cbowdon) +* [:link:](shuffle-array/shuffle-array.d.ts) [shuffle-array](https://github.com/pazguille/shuffle-array) by [rhysd](https://rhysd.github.io) * [:link:](siesta/siesta.d.ts) [Siesta](http://www.bryntum.com/products/siesta) by [bquarmby](https://github.com/bquarmby) * [:link:](sigmajs/sigmajs.d.ts) [sigma.js](https://github.com/jacomyal/sigma.js) by [Qinfeng Chen](https://github.com/qinfchen) * [:link:](signalr/signalr.d.ts) [SignalR](http://www.asp.net/signalr) by [Boris Yankov](https://github.com/borisyankov), [T. Michael Keesey](https://github.com/keesey) * [:link:](signature_pad/signature_pad.d.ts) [signature_pad](https://github.com/szimek/signature_pad) by [Abubaker Bashir](https://github.com/AbubakerB) * [:link:](simple-cw-node/simple-cw-node.d.ts) [simple-cw-node](https://github.com/astronaughts/simple-cw-node) by [vvakame](https://github.com/vvakame) +* [:link:](simple-mock/simple-mock.d.ts) [simple-mock](https://github.com/jupiter/simple-mock) by [Leon Yu](https://github.com/leonyu) * [: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) @@ -1137,9 +1348,11 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](socket.io/socket.io.d.ts) [socket.io](http://socket.io) by [PROGRE](https://github.com/progre), [Damian Connolly](https://github.com/divillysausages) * [:link:](socket.io-client/socket.io-client.d.ts) [socket.io-client](http://socket.io) by [PROGRE](https://github.com/progre), [Damian Connolly](https://github.com/divillysausages) * [:link:](socket.io.users/socket.io.users.d.ts) [socket.io.users](https://github.com/nodets/socket.io.users) by [Makis Maropoulos](https://github.com/kataras) +* [:link:](socketty/socketty.d.ts) [Socketty](https://www.npmjs.com/package/socketty) by [Nax](https://github.com/Nax) * [:link:](sockjs/sockjs.d.ts) [SockJS 0.3.x](https://github.com/sockjs/sockjs-client) by [Emil Ivanov](https://github.com/vladev) * [: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) @@ -1149,6 +1362,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](split/split.d.ts) [split](https://github.com/dominictarr/split) by [Marcin Porębski](https://github.com/marcinporebski) * [:link:](sprintf-js/sprintf-js.d.ts) [sprintf-js](https://www.npmjs.com/package/sprintf-js) by [Jason Swearingen](https://jasonswearingen.github.io) * [:link:](sprintf/sprintf.d.ts) [sprintff](https://github.com/maritz/node-sprintff) by [Carlos Ballesteros Velasco](https://github.com/soywiz) +* [:link:](sql.js/sql.js.d.ts) [sql.js](https://github.com/kripken/sql.js) by [George Wu](https://github.com/Hozuki) * [:link:](sqlite3/sqlite3.d.ts) [sqlite3](https://github.com/mapbox/node-sqlite3) by [Nick Malaguti](https://github.com/nmalaguti) * [:link:](squirejs/squirejs.d.ts) [Squire](https://github.com/iammerrick/Squire.js) by [Bradley Ayers](https://github.com/bradleyayers) * [:link:](ssh2/ssh2.d.ts) [ssh2](https://github.com/mscdex/ssh2) by [Qubo](https://github.com/tkQubo) @@ -1160,14 +1374,17 @@ 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:](slick-carousel/slick-carousel.d.ts) [stick](http://kenwheeler.github.io/slick) by [John Gouigouix](https://github.com/orchestra-ts/DefinitelyTyped) * [:link:](storejs/storejs.d.ts) [store.js](https://github.com/marcuswestin/store.js) by [Vincent Bortone](https://github.com/vbortone) * [:link:](stream-series/stream-series.d.ts) [stream-series](https://github.com/rschmukler/stream-series) by [Keita Kagurazaka](https://github.com/k-kagurazaka) * [:link:](stream-to-array/stream-to-array.d.ts) [stream-to-array](https://github.com/stream-utils/stream-to-array) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](streamjs/streamjs.d.ts) [streamjs](http://winterbe.github.io/streamjs) by [Bence Eros](https://github.com/erosb) * [:link:](string_score/string_score.d.ts) [string_score](https://github.com/joshaven/string_score) by [Marcin Porębski](https://github.com/marcinporebski) * [:link:](string/string.d.ts) [string.js](http://stringjs.com) by [Bas Pennings](https://github.com/basp) -* [:link:](stripe/stripe.d.ts) [stripe](https://stripe.com) by [Andy Hawkins](https://github.com/a904guy/,http://a904guy.com), [Eric J. Smith](https://github.com/ejsmith) +* [:link:](strip-json-comments/strip-json-comments.d.ts) [strip-json-comments](https://github.com/sindresorhus/strip-json-comments) by [Dylan R. E. Moonfire](https://github.com/dmoonfire) +* [:link:](stripe/stripe.d.ts) [stripe](https://stripe.com) by [Andy Hawkins](https://github.com/a904guy/,http://a904guy.com), [Eric J. Smith](https://github.com/ejsmith), [Amrit Kahlon](https://github.com/amritk) * [:link:](stripe-checkout/stripe-checkout.d.ts) [Stripe Checkout](https://stripe.com/checkout) by [Chris Wrench](https://github.com/cgwrench) * [:link:](stripe/stripe-node.d.ts) [stripe-node](https://github.com/stripe/stripe-node) by [William Johnston](https://github.com/wjohnsto) * [:link:](strophe/strophe.d.ts) [Strophe.js](http://strophe.im/strophejs) by [David Deutsch](https://github.com/DavidKDeutsch) @@ -1175,6 +1392,8 @@ 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:](supertest-as-promised/supertest-as-promised.d.ts) [SuperTest as Promised](https://github.com/WhoopInc/supertest-as-promised) by [Tanguy Krotoff](https://github.com/tkrotoff) +* [: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) @@ -1185,6 +1404,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](swap-case/swap-case.d.ts) [swap-case](https://github.com/blakeembrey/swap-case) by [Sam Saint-Pettersen](https://github.com/stpettersens) * [:link:](sweetalert/sweetalert.d.ts) [SweetAlert](https://github.com/t4t5/sweetalert) by [Markus Peloso](https://github.com/ToastHawaii) * [:link:](swfobject/swfobject.d.ts) [swfobject](https://code.google.com/p/swfobject) by [rou](https://github.com/rou) +* [:link:](swiftclick/swiftclick.d.ts) [SwiftClick](https://github.com/munkychop/swiftclick) by [Laurence C](https://github.com/Laurence-C) * [:link:](swig/swig.d.ts) [swig](http://github.com/paularmstrong/swig) by [Peter Harris](https://github.com/CodeAnimal), [Carlos Ballesteros Velasco](https://github.com/soywiz) * [:link:](swig-email-templates/swig-email-templates.d.ts) [swig-email-templates](https://github.com/andrewrk/swig-email-templates) by [Adam Babcock](https://github.com/mrhen) * [:link:](swipe/swipe.d.ts) [Swipe](https://github.com/thebird/Swipe) by [Andrey Kurdyumov](https://github.com/kant2002) @@ -1195,23 +1415,26 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](systemjs/systemjs.d.ts) [System.js](https://github.com/systemjs/systemjs) by [Ludovic HENIN](https://github.com/ludohenin), [Nathan Walker](https://github.com/NathanWalker) * [:link:](tabris/tabris.d.ts) [Tabris.js](http://tabrisjs.com) by [Tabris.js team](http://github.com/eclipsesource/tabris) * [:link:](tabtab/tabtab.d.ts) [tabtab](https://github.com/mklabs/node-tabtab) by [Vojtěch Habarta](https://github.com/vojtechhabarta) -* [:link:](tape/tape.d.ts) [tape](https://github.com/substack/tape) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](tape/tape.d.ts) [tape](https://github.com/substack/tape) by [Bart van der Schoor](https://github.com/Bartvds), [Haoqun Jiang](https://github.com/sodatea) * [:link:](tar/tar.d.ts) [tar](https://github.com/npm/node-tar) by [Maxime LUCE](https://github.com/SomaticIT) * [:link:](tcomb/tcomb.d.ts) [tcomb](http://gcanti.github.io/tcomb/guide/index.html) by [Hans Windhoff](https://github.com/hansrwindhoff) * [:link:](tea-merge/tea-merge.d.ts) [tea-merge](https://github.com/qualiancy/tea-merge) by [Mihhail Lapushkin](https://github.com/mihhail-lapushkin) * [: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/temp.d.ts) [temp](https://www.npmjs.com/package/temp) by [Daniel Rosenwasser](https://github.com/DanielRosenwasser) +* [: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:](spotify-api/spotify-api.d.ts) [The Spotify Web API](https://developer.spotify.com/web-api) by [Niels Kristian Hansen Skovmand](https://github.com/skovmand) +* [:link:](threejs/three-FirstPersonControls.d.ts) [three.js](http://mrdoob.github.com/three.js) by [Poul Kjeldager Sørensen](https://github.com/s093294) * [:link:](threejs/three-canvasrenderer.d.ts) [three.js (CanvasRenderer.js)](https://github.com/mrdoob/three.js/blob/master/examples/js/renderers/CanvasRenderer.js) by [Satoru Kimura](https://github.com/gyohk) * [: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,10 +1445,10 @@ 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) +* [:link:](through2/through2.d.ts) [through2 v](https://github.com/rvagg/through2) by [Bart van der Schoor](https://github.com/Bartvds), [jedmao](https://github.com/jedmao), [Georgios Valotasios](https://github.com/valotas) * [:link:](timelinejs/timelinejs.d.ts) [timelinejs](https://github.com/NUKnightLab/TimelineJS) by [Roland Zwaga](https://github.com/rolandzwaga) * [:link:](timezone-js/timezone-js.d.ts) [timezone-js](https://github.com/mde/timezone-js) by [bonnici](https://github.com/bonnici) * [:link:](timezonecomplete/timezonecomplete.d.ts) [timezonecomplete](https://github.com/SpiritIT/timezonecomplete) by [Rogier Schouten](https://github.com/rogierschouten) @@ -1239,10 +1462,12 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](tooltipster/tooltipster.d.ts) [tooltipster](https://github.com/iamceege/tooltipster) by [Stephen Lautier](https://github.com/stephenlautier) * [:link:](sencha_touch/SenchaTouch.d.ts) [Touch](http://www.sencha.com/products/touch) by [Brian Kotek](https://github.com/brian428) * [:link:](traceback/traceback.d.ts) [Traceback](http://github.com/iriscouch/traceback) by [Michael Zabka](https://github.com/misak113) +* [:link:](tracking/tracking.d.ts) [Tracking.js](https://github.com/eduardolundgren/tracking.js) by [Tim Perry](https://github.com/pimterry) * [:link:](traverson/traverson.d.ts) [Traverson](https://github.com/basti1302/traverson) by [Marcin Porębski](https://github.com/marcinporebski) * [:link:](trunk8/trunk8.d.ts) [trunk8](https://github.com/rviscomi/trunk8) by [Blake Niemyjski](https://github.com/niemyjski) * [:link:](tsmonad/tsmonad.d.ts) [TsMonad](https://github.com/cbowdon/TsMonad) by [Chris Bowdon](https://github.com/cbowdon) * [:link:](tspromise/tspromise.d.ts) [tspromise](https://github.com/soywiz/tspromise) by [Carlos Ballesteros Velasco](https://github.com/soywiz) +* [:link:](turf/turf.d.ts) [Turf](http://turfjs.org) by [Guillaume Croteau](https://github.com/gcroteau) * [:link:](tween.js/tween.js.d.ts) [tween.js r12](https://github.com/sole/tween.js) by [sunetos](https://github.com/sunetos), [jzarnikov](https://github.com/jzarnikov) * [:link:](tweenjs/tweenjs.d.ts) [TweenJS](http://www.createjs.com/#!/TweenJS) by [Pedro Ferreira](https://bitbucket.org/drk4), [Chris Smith](https://github.com/evilangelist) * [:link:](twig/twig.d.ts) [twig](https://github.com/justjohn/twig.js) by [Carlos Ballesteros Velasco](https://github.com/soywiz) @@ -1254,15 +1479,17 @@ 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:](uikit/uikit.d.ts) [uikit](http://getuikit.org) by [Giovanni Silva](https://github.com/giovannicandido) +* [:link:](umbraco/umbraco-services.d.ts) [Umbraco](https://github.com/umbraco) by [DeCareSystemsIreland](https://github.com/DeCareSystemsIreland) * [:link:](umbraco/umbraco-resources.d.ts) [Umbraco](https://github.com/umbraco) by [DeCareSystemsIreland](https://github.com/DeCareSystemsIreland) * [:link:](umbraco/umbraco.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:](umzug/umzug.d.ts) [Umzug](https://github.com/sequelize/umzug) by [Ivan Drinchev](https://github.com/drinchev) * [:link:](underscore/underscore.d.ts) [Underscore](http://underscorejs.org) by [Boris Yankov](https://github.com/borisyankov), [Josh Baldwin](https://github.com/jbaldwin) * [: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) * [:link:](underscore.string/underscore.string.d.ts) [underscore.string](https://github.com/epeli/underscore.string) by [Ry Racherbaumer](http://github.com/rygine) @@ -1270,6 +1497,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](jquery.uniform/jquery.uniform.d.ts) [Uniform.js](https://github.com/pixelmatrix/uniform) by [flyfishMT](https://github.com/flyfishMT) * [:link:](uniq/uniq.d.ts) [uniq](https://www.npmjs.com/package/uniq) by [Hans Windhoff](https://github.com/hansrwindhoff) * [:link:](unique-random/unique-random.d.ts) [unique-random](https://github.com/sindresorhus/unique-random) by [Yuki Kokubun](https://github.com/Kuniwak) +* [:link:](winrt/winrt-uwp.d.ts) [Universal Windows Platform](http://msdn.microsoft.com/en-us/library/windows/apps/br211377.aspx) by [Kagami Sascha Rosylight](https://github.com/saschanaz), [Taylor Starfield](https://github.com/taylor224) * [:link:](universal-analytics/universal-analytics.d.ts) [universal-analytics](https://github.com/peaksandpies/universal-analytics) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](unorm/unorm.d.ts) [unorm](https://github.com/walling/unorm) by [Christopher Brown](https://github.com/chbrown) * [:link:](update-notifier/update-notifier.d.ts) [update-notifier](https://github.com/yeoman/update-notifier) by [vvakame](https://github.com/vvakame) @@ -1282,11 +1510,14 @@ 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:](UUID/UUID.d.ts) [UUID.js core](https://github.com/LiosK/UUID.js) by [Jason Jarrett](https://github.com/staxmanade) +* [:link:](username/username.d.ts) [username](https://www.npmjs.com/package/username) by [Klaus Reimer](https://github.com/kayahr) +* [:link:](utils-merge/utils-merge.d.ts) [utils-merge](https://github.com/jaredhanson/utils-merge) by [Ilya Mochalov](https://github.com/chrootsu) +* [:link:](uuid/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) * [:link:](vega/vega.d.ts) [Vega](http://trifacta.github.io/vega) by [Tom Crockett](http://github.com/pelotom) * [:link:](velocity-animate/velocity-animate.d.ts) [Velocity](http://velocityjs.org) by [Greg Smith](https://github.com/smrq) +* [:link:](verror/verror.d.ts) [verror](https://github.com/davepacheco/node-verror) by [Sven Reglitzki](https://github.com/svi3c) * [:link:](vex-js/vex-js.d.ts) [Vex](https://github.com/HubSpot/vex) by [Greg Cohan](https://github.com/gdcohan) * [:link:](vexflow/vexflow.d.ts) [VexFlow](http://vexflow.com) by [Roman Quiring](https://github.com/rquiring) * [:link:](victor/victor.d.ts) [Victor.js](http://victorjs.org) by [Ivane Gegia](https://twitter.com/ivanegegia) @@ -1299,17 +1530,21 @@ 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:](vue-router/vue-router.d.ts) [vue-router](https://github.com/vuejs/vue-router) by [kaorun343](https://github.com/kaorun343) +* [:link:](vue/vue.d.ts) [vuejs](https://github.com/vuejs/vue) by [odangosan](https://github.com/odangosan), [kaorun343](https://github.com/kaorun343) +* [:link:](wake_on_lan/wake_on_lan.d.ts) [wake_on_lan](https://github.com/agnat/node_wake_on_lan) by [Tobias Kahlert](https://github.com/SrTobi) * [:link:](watch/watch.d.ts) [watch](https://github.com/mikeal/watch) by [Carlos Ballesteros Velasco](https://github.com/soywiz) * [:link:](jquery.watermark/jquery.watermark.d.ts) [Watermark plugin for jQuery](http://jquery-watermark.googlecode.com) by [Anwar Javed](https://github.com/anwarjaved) * [:link:](webaudioapi/waa.d.ts) [Web Audio API](http://www.w3.org/TR/webaudio) by [Baruch Berger](https://github.com/bbss), [Kon](http://phyzkit.net), [kubosho](https://github.com/kubosho) * [: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:](webdriverio/webdriverio.d.ts) [webdriverio](http://www.webdriver.io) by [Nick Malaguti](https://github.com/nmalaguti) * [:link:](webgl-ext/webgl-ext.d.ts) [WebGL Extensions](http://webgl.org) by [Arthur Langereis](https://github.com/zenmumbler) * [:link:](webix/webix.d.ts) [Webix UI](http://webix.com) by [Maksim Kozhukh](http://github.com/mkozhukh) * [:link:](webpack/webpack.d.ts) [webpack](https://github.com/webpack/webpack) by [Qubo](https://github.com/tkqubo) @@ -1326,8 +1561,11 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](winrt/winrt.d.ts) [WinRT](http://msdn.microsoft.com/en-us/library/windows/apps/br211377.aspx) by [TypeScript samples](https://www.typescriptlang.org) * [:link:](winston/winston.d.ts) [winston](https://github.com/flatiron/winston) by [bonnici](https://github.com/bonnici), [Peter Harris](https://github.com/codeanimal) * [:link:](wolfy87-eventemitter/wolfy87-eventemitter.d.ts) [wolfy87-eventemitter](https://github.com/Wolfy87/EventEmitter) by [ryiwamoto](https://github.com/ryiwamoto) +* [:link:](wordcloud/wordcloud.d.ts) [wordcloud](https://github.com/timdream/wordcloud2.js) by [Joe Skeen](http://github.com/joeskeen) +* [:link:](wreck/wreck.d.ts) [wreck](https://github.com/hapijs/wreck) by [Marcin Porębski](http://github.com/marcinporebski) * [:link:](wrench/wrench.d.ts) [wrench](https://github.com/ryanmcgrath/wrench-js) by [Carlos Ballesteros Velasco](https://github.com/soywiz) * [:link:](ws/ws.d.ts) [ws](https://github.com/einaros/ws) by [Paul Loyd](https://github.com/loyd) +* [:link:](wu/wu.d.ts) [wu.js](https://fitzgen.github.io/wu.js) by [phiresky](https://github.com/phiresky) * [:link:](x-editable/x-editable.d.ts) [X-Editable](http://vitalets.github.io/x-editable/index.html) by [Chris Kirby](https://github.com/sirkirby) * [:link:](x2js/xml2json.d.ts) [x2js](https://code.google.com/p/x2js) by [Horiuchi_H](https://github.com/horiuchi) * [:link:](xdate/xdate.d.ts) [XDate](http://arshaw.com/xdate) by [yamada28go](https://github.com/yamada28go) @@ -1336,7 +1574,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 +1586,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:](zeroclipboard/zeroclipboard.d.ts) [ZeroClipboard v2.x.x](https://github.com/zeroclipboard/zeroclipboard) by [Eric J. Smith](https://github.com/ejsmith), [Blake Niemyjski](https://github.com/niemyjski), [György Balássy](https://github.com/balassy), [Leon Yu](https://github.com/leonyu) * [: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/README.md b/README.md index 82833752d..7e1d60d87 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# DefinitelyTyped [![Build Status](https://travis-ci.org/borisyankov/DefinitelyTyped.png?branch=master)](https://travis-ci.org/borisyankov/DefinitelyTyped) +# DefinitelyTyped [![Build Status](https://travis-ci.org/DefinitelyTyped/DefinitelyTyped.png?branch=master)](https://travis-ci.org/DefinitelyTyped/DefinitelyTyped) [![Join the chat at https://gitter.im/borisyankov/DefinitelyTyped](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/borisyankov/DefinitelyTyped?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 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/acc-wizard/acc-wizard.ts.tscparams b/acc-wizard/acc-wizard.ts.tscparams deleted file mode 100644 index 934bc29ef..000000000 --- a/acc-wizard/acc-wizard.ts.tscparams +++ /dev/null @@ -1 +0,0 @@ ---noImplicitAny \ No newline at end of file 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/ace/ace.d.ts.tscparams b/ace/ace.d.ts.tscparams deleted file mode 100644 index d3f5a12fa..000000000 --- a/ace/ace.d.ts.tscparams +++ /dev/null @@ -1 +0,0 @@ - diff --git a/ace/tests/ace-editor_text_edit-tests.ts.tscparams b/ace/tests/ace-editor_text_edit-tests.ts.tscparams deleted file mode 100644 index d3f5a12fa..000000000 --- a/ace/tests/ace-editor_text_edit-tests.ts.tscparams +++ /dev/null @@ -1 +0,0 @@ - diff --git a/ace/tests/ace-range-tests.ts.tscparams b/ace/tests/ace-range-tests.ts.tscparams deleted file mode 100644 index d3f5a12fa..000000000 --- a/ace/tests/ace-range-tests.ts.tscparams +++ /dev/null @@ -1 +0,0 @@ - diff --git a/ace/tests/ace-search-tests.ts.tscparams b/ace/tests/ace-search-tests.ts.tscparams deleted file mode 100644 index d3f5a12fa..000000000 --- a/ace/tests/ace-search-tests.ts.tscparams +++ /dev/null @@ -1 +0,0 @@ - diff --git a/acl/acl.d.ts b/acl/acl.d.ts index 57e85d9d5..66fee09d1 100644 --- a/acl/acl.d.ts +++ b/acl/acl.d.ts @@ -7,7 +7,7 @@ /// /// -/// +/// declare module "acl" { import http = require('http'); 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/ag-grid/ag-grid.d.ts b/ag-grid/ag-grid.d.ts index f385a90f4..6dd6e90e4 100644 --- a/ag-grid/ag-grid.d.ts +++ b/ag-grid/ag-grid.d.ts @@ -1464,7 +1464,6 @@ declare module ag.grid { addDropTarget(eDropTarget: any, dropTargetCallback: any): void; } } -declare function require(name: string): any; declare module ag.grid { class AgList { private eGui; diff --git a/amplifyjs/amplifyjs.d.ts b/amplifyjs/amplifyjs.d.ts index 961d815c6..3eb8829e4 100644 --- a/amplifyjs/amplifyjs.d.ts +++ b/amplifyjs/amplifyjs.d.ts @@ -179,4 +179,4 @@ interface amplifyStatic { } declare var amplify: amplifyStatic; - +declare module "amplify" { export =amplify; } diff --git a/angular-dynamic-locale/angular-dynamic-locale.d.ts b/angular-dynamic-locale/angular-dynamic-locale.d.ts index a30df1d7e..e404e9532 100644 --- a/angular-dynamic-locale/angular-dynamic-locale.d.ts +++ b/angular-dynamic-locale/angular-dynamic-locale.d.ts @@ -5,6 +5,11 @@ /// +declare module "angular-dynamic-locale" { + import ng = angular.dynamicLocale; + export = ng; +} + declare module angular.dynamicLocale { interface tmhDynamicLocaleService { diff --git a/angular-formly/angular-formly-tests.ts b/angular-formly/angular-formly-tests.ts index ef6a38463..01449aa4b 100644 --- a/angular-formly/angular-formly-tests.ts +++ b/angular-formly/angular-formly-tests.ts @@ -20,11 +20,23 @@ class FormConfig { name: 'customInput', extends: 'input' }); + + formlyConfig.disableWarnings = true; + formlyConfig.templateManipulators = undefined; + + formlyConfig.extras.apiCheckInstance = null; + formlyConfig.extras.defaultHideDirective = 'ng-if'; + formlyConfig.extras.disableNgModelAttrsManipulator = true; + formlyConfig.extras.errorExistsAndShouldBeVisibleExpression = angular.noop; + formlyConfig.extras.explicitAsync = true; + formlyConfig.extras.fieldTransform = angular.noop; + formlyConfig.extras.getFieldId = angular.noop; + formlyConfig.extras.ngModelAttrsManipulatorPreferUnbound = true; } } class AppController { - fields: AngularFormly.IFieldConfigurationObject[]; + fields: AngularFormly.IFieldArray; constructor() { var vm = this; vm.fields = [ @@ -99,6 +111,21 @@ class AppController { templateOptions: { label: 'no wrapper here...' } + }, + { + //From http://angular-formly.com/#/example/other/nested-formly-forms + key: 'address', + wrapper: 'panel', + templateOptions: { label: 'Address' }, + fieldGroup: [{ + key: 'town', + type: 'input', + templateOptions: { + required: true, + type: 'text', + label: 'Town' + } + }] } ] } diff --git a/angular-formly/angular-formly.d.ts b/angular-formly/angular-formly.d.ts index 8f76b3ccf..423e6ff9b 100644 --- a/angular-formly/angular-formly.d.ts +++ b/angular-formly/angular-formly.d.ts @@ -1,7 +1,7 @@ -// Type definitions for angular-formly 6.18.0 +// Type definitions for angular-formly 7.2.3 // Project: https://github.com/formly-js/angular-formly // Definitions by: Scott Hatcher -// Definitions: https://github.com/borisyankov/DefinitelyTyped +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -9,20 +9,30 @@ declare module 'AngularFormly' { export = AngularFormly; } +declare module 'angular-formly' { + var angularFormlyDefaultExport: string; + export = angularFormlyDefaultExport; +} + declare module AngularFormly { + interface IFieldArray extends Array { + + } interface IFieldGroup { data?: Object; className?: string; - elementAttributes?: { [key: string]: string }; - fieldGroup: IFieldConfigurationObject[]; + elementAttributes?: string; + fieldGroup?: IFieldArray; form?: Object; hide?: boolean; - hideExpression?: string | IExpresssionFunction; + hideExpression?: string | IExpressionFunction; key?: string | number; model?: string | Object; - options?: IFormOptionsAPI + options?: IFormOptionsAPI; + templateOptions?: ITemplateOptions; + wrapper?: string | string[]; } @@ -41,7 +51,7 @@ declare module AngularFormly { /** * see http://docs.angular-formly.com/docs/formly-expressions#expressionproperties-validators--messages */ - interface IExpresssionFunction { + interface IExpressionFunction { ($viewValue: any, $modelValue: any, scope: ITemplateScope): any; } @@ -65,6 +75,11 @@ declare module AngularFormly { postWrapper?: ITemplateManipulator[]; } + interface ISelectOption { + name: string; + value?: string; + group?: string; + } /** * see http://docs.angular-formly.com/docs/ngmodelattrstemplatemanipulator @@ -86,19 +101,25 @@ declare module AngularFormly { type?: string; //expression types - onBlur?: string; - onChange?: string; - onClick?: string; - onFocus?: string; - onKeydown?: string; - onKeypress?: string; - onKeyup?: string; + onBlur?: string | IExpressionFunction; + onChange?: string | IExpressionFunction; + onClick?: string | IExpressionFunction; + onFocus?: string | IExpressionFunction; + onKeydown?: string | IExpressionFunction; + onKeypress?: string | IExpressionFunction; + onKeyup?: string | IExpressionFunction; //Bootstrap types label?: string; description?: string; [key: string]: any; + // types for select/radio fields + options?: Array; + groupProp?: string; // default: group + valueProp?: string; // default: value + labelProp?: string; // default: name + } @@ -106,8 +127,8 @@ declare module AngularFormly { * see http://docs.angular-formly.com/docs/field-configuration-object#validators-object */ interface IValidator { - expression: string | IExpresssionFunction; - message?: string | IExpresssionFunction; + expression: string | IExpressionFunction; + message?: string | IExpressionFunction; } @@ -138,8 +159,8 @@ declare module AngularFormly { * see http://angular-formly.com/#/example/other/unique-value-async-validation */ asyncValidators?: { - [key: string]: string | IExpresssionFunction | IValidator; - } + [key: string]: string | IExpressionFunction | IValidator; + }; /** * This is a great way to add custom behavior to a specific field. It is injectable with the $scope of the @@ -188,8 +209,8 @@ declare module AngularFormly { * see http://docs.angular-formly.com/docs/field-configuration-object#expressionproperties-object */ expressionProperties?: { - [key: string]: string | IExpresssionFunction | IValidator; - } + [key: string]: string | IExpressionFunction | IValidator; + }; /** @@ -198,7 +219,7 @@ declare module AngularFormly { * * see http://docs.angular-formly.com/docs/field-configuration-object#hide-boolean */ - hide?: boolean + hide?: boolean; /** @@ -208,7 +229,7 @@ declare module AngularFormly { * * see http://docs.angular-formly.com/docs/field-configuration-object#hideexpression-string--function */ - hideExpression?: string | IExpresssionFunction; + hideExpression?: string | IExpressionFunction; /** @@ -297,6 +318,18 @@ declare module AngularFormly { bound?: any; expression?: any; value?: any; + [key: string]: any; + }; + + + /** + * 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; }; @@ -388,7 +421,7 @@ declare module AngularFormly { * like in this example. */ messages?: { - [key: string]: IExpresssionFunction | string; + [key: string]: IExpressionFunction | string; } @@ -399,7 +432,7 @@ declare module AngularFormly { */ show?: boolean; - } + }; /** @@ -412,8 +445,8 @@ declare module AngularFormly { * see http://docs.angular-formly.com/docs/field-configuration-object#validators-object */ validators?: { - [key: string]: string | IExpresssionFunction | IValidator; - } + [key: string]: string | IExpressionFunction | IValidator; + }; /** @@ -525,10 +558,24 @@ declare module AngularFormly { validateOptions?: Function; } + interface IFormlyConfigExtras { + disableNgModelAttrsManipulator: boolean; + apiCheckInstance: any; + ngModelAttrsManipulatorPreferUnbound: boolean; + removeChromeAutoComplete: boolean; + defaultHideDirective: string; + errorExistsAndShouldBeVisibleExpression: any; + getFieldId: Function; + fieldTransform: Function; + explicitAsync: boolean; + } + interface IFormlyConfig { + disableWarnings: boolean; + extras: IFormlyConfigExtras; setType(typeOptions: ITypeOptions): void; setWrapper(wrapperOptions: IWrapperOptions): void; - + templateManipulators: ITemplateManipulators; } interface ITemplateScopeOptions { @@ -545,7 +592,7 @@ declare module AngularFormly { //Shortcut to options.formControl fc: ng.IFormController | ng.IFormController[]; //all the fields for the form - fields: IFieldConfigurationObject[]; + fields: IFieldArray; //the form controller the field is in form: any; //The object passed as options.formState to the formly-form directive. Use this to share state between fields. @@ -571,4 +618,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..c03e0725a 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,14 @@ 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]); + + var testMessage = growl.warning(message); + testMessage.setText("Some other message"); + testMessage.destroy(); }); diff --git a/angular-growl-v2/angular-growl-v2.d.ts b/angular-growl-v2/angular-growl-v2.d.ts index 039490e3d..07c0dbe37 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 @@ -39,6 +39,16 @@ declare module angular.growl { */ interface IGrowlMessage extends IGrowlMessageConfig { text: string; + + /** + * Destroy the message. + */ + destroy(): void; + /** + * Update the message body. + * @param newText new message body + */ + setText(newText: string): void; } /** @@ -54,73 +64,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 +221,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): angular.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-idle/angular-idle-tests.ts b/angular-idle/angular-idle-tests.ts index fc39bf72a..e6eb1a9f2 100644 --- a/angular-idle/angular-idle-tests.ts +++ b/angular-idle/angular-idle-tests.ts @@ -1,23 +1,53 @@ /// angular.module('app', ['ngIdle']) - .config(['$keepaliveProvider', '$idleProvider', - ($keepaliveProvider: ng.idle.IKeepAliveProvider, $idleProvider: ng.idle.IIdleProvider) => { - $idleProvider.activeOn('mousemove keydown DOMMouseScroll mousewheel mousedown'); - $idleProvider.idleDuration(5); - $idleProvider.warningDuration(5); - $idleProvider.keepalive(true) - $idleProvider.autoResume(true); - $keepaliveProvider.interval(10); + .config(['KeepaliveProvider', 'IdleProvider', 'TitleProvider', + (keepaliveProvider: angular.idle.IKeepAliveProvider, idleProvider: angular.idle.IIdleProvider, + titleProvider: angular.idle.ITitleProvider) => { + idleProvider.interrupt('mousemove keydown DOMMouseScroll mousewheel mousedown'); + idleProvider.idle(5); + idleProvider.timeout(5); + idleProvider.keepalive(true) + idleProvider.autoResume(true); + + const config: ng.IRequestConfig = { + url: "http://google.com", + method: "GET" + }; + + keepaliveProvider.http(config.url); // should accept string and ng.IRequestConfig + keepaliveProvider.http(config); + keepaliveProvider.interval(10); + + titleProvider.enabled(true); }]) - .run(['$keepalive', '$idle', ($keepalive: ng.idle.IKeepAliveService, $idle: ng.idle.IIdleService) => { - $idle.watch(); - - if ($idle.running() || $idle.idling()) { - $idle.unwatch(); + .run(['Keepalive', 'Idle', 'Title', (Keepalive: angular.idle.IKeepAliveService, Idle: angular.idle.IIdleService, + Title: angular.idle.ITitleService) => { + Idle.setTimeout(Idle.getTimeout()); + Idle.setIdle(Idle.getIdle()); + + Idle.watch(); + Idle.interrupt(); + + const expired: boolean = Idle.isExpired(); + + if (Idle.running() || Idle.idling()) { + Idle.unwatch(); } - - $keepalive.start(); - $keepalive.ping(); - $keepalive.stop(); + + Keepalive.start(); + Keepalive.ping(); + Keepalive.stop(); + Keepalive.setInterval(10); + + Title.setEnabled(Title.isEnabled()); + Title.original(Title.original()); + Title.value(Title.value()); + Title.store(false); + Title.store(); + Title.restore(); + Title.idleMessage(Title.idleMessage()); + Title.timedOutMessage(Title.timedOutMessage()); + Title.setAsIdle(120); + Title.setAsTimedOut(); }]); \ No newline at end of file diff --git a/angular-idle/angular-idle.d.ts b/angular-idle/angular-idle.d.ts index 4e1e98fb5..725beac67 100644 --- a/angular-idle/angular-idle.d.ts +++ b/angular-idle/angular-idle.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ng-idle v0.3.5 +// Type definitions for ng-idle v1.1.1 // Project: http://hackedbychinese.github.io/ng-idle/ // Definitions by: mthamil // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -8,7 +8,99 @@ declare module angular.idle { /** - * Used to configure the $keepalive service. + * Used to configure the Title service. + */ + interface ITitleProvider extends IServiceProvider { + + /** + * Enables or disables the Title functionality. + * + * @param enabled Boolean, default is true. + */ + enabled(enabled: boolean): void; + } + + interface ITitleService { + + /** + * Allows the title functionality to be enabled or disabled on the fly. + */ + setEnabled(enabled: boolean): void; + + /** + * Returns whether or not the title functionality has been enabled. + */ + isEnabled(): boolean; + + /** + * Will store val as the "original" title of the document. + * + * Tracking the original title is important when restoring the title after displaying, for example, the idle warning message. + */ + original(val: string): void; + + /** + * Returns the "original" title value that has been previously set. + * + * Tracking the original title is important when restoring the title after displaying, for example, the idle warning message. + */ + original(): string; + + /** + * Changes the actual title of the document. + */ + value(val: string): void; + + /** + * Returns the current document title. + */ + value(): string; + + /** + * If overwrite is false or unspecified, updates the "original" title with the current document title + * if it has not already been stored. If overwrite is true, the current document title is stored regardless. + */ + store(overwrite?: boolean): void; + + /** + * Sets the title to the original value (if it was stored or set previously). + */ + restore(): void; + + /** + * Sets the text to use as the message displayed when the user is idle. + */ + idleMessage(val: string): void; + + /** + * Gets the text to use as the message displayed when the user is idle. + */ + idleMessage(): string; + + /** + * Sets the text to use as the message displayed when the user is timed out. + */ + timedOutMessage(val: string): void; + + /** + * Gets the text to use as the message displayed when the user is timed out. + */ + timedOutMessage(): string; + + /** + * Stores the original title if it hasn't been already, determines the number minutes, seconds, + * and total seconds from countdown, and displays the idleMessage with the aforementioned values interpolated. + */ + setAsIdle(countdown: number): void; + + /** + * Stores the original title if it hasn't been already, and displays the timedOutMessage. + */ + setAsTimedOut(): void; + } + + /** + * Used to configure the Keepalive service. */ interface IKeepAliveProvider extends IServiceProvider { @@ -18,24 +110,24 @@ declare module angular.idle { * You can specify a string, which it will assume to be a URL to a simple GET request. * Otherwise, you can use the same options $http takes. However, cache will always be false. * - * @param value May be string or object, default is null. + * @param value May be string or IRequestConfig, default is null. */ - http(value: any): void; + http(value: string | IRequestConfig): void; /** * This specifies how often the keepalive event is triggered and the * HTTP request is issued. * - * @param seconds Integer, default is 5 minutes. Must be greater than 0. + * @param seconds Integer, default is 10 minutes. Must be greater than 0. */ interval(seconds: number): void; } /** - * $keepalive will use a timeout to periodically wake, broadcast a $keepalive event on the root scope, - * and optionally make an $http request. By default, the $idle service will stop and start $keepalive + * Keepalive will use a timeout to periodically wake, broadcast a Keepalive event on the root scope, + * and optionally make an $http request. By default, the Idle service will stop and start Keepalive * when a user becomes idle or returns from idle, respectively. It is also started automatically when - * $idle.watch() is called. This can be disabled by configuring the $idleProvider. + * Idle.watch() is called. This can be disabled by configuring the IdleProvider. */ interface IKeepAliveService { @@ -53,20 +145,25 @@ declare module angular.idle { * Performs one ping only. */ ping(): void; + + /** + * Changes the interval value at runtime. + * You will need to restart the pinging process by calling start() manually for the changes to be reflected. + */ + setInterval(seconds: number): void; } /** - * Used to configure the $idle service. + * Used to configure the Idle service. */ interface IIdleProvider extends IServiceProvider { - /** * Specifies the DOM events the service will watch to reset the idle timeout. * Multiple events should be separated by a space. * * @param events string, default 'mousemove keydown DOMMouseScroll mousewheel mousedown' */ - activeOn(events: string): void; + interrupt(events: string): void; /** * The idle timeout duration in seconds. After this amount of time passes without the user @@ -75,7 +172,7 @@ declare module angular.idle { * * @param seconds integer, default is 20min */ - idleDuration(seconds: number): void; + idle(seconds: number): void; /** * The amount of time the user has to respond (in seconds) before they have been considered @@ -83,19 +180,20 @@ declare module angular.idle { * * @param seconds integer, default is 30s */ - warningDuration(seconds: number): void; + timeout(seconds: number): void; /** - * When true, user activity will automatically interrupt the warning countdown and reset the - * idle state. If false, you will need to manually call watch() when you want to start - * watching for idleness again. + * When true or idle, user activity will automatically interrupt the warning countdown + * and reset the idle state. If false or off, you will need to manually call watch() + * when you want to start watching for idleness again. If notIdle, user activity will + * only automatically interrupt if the user is not yet idle. * - * @param enabled boolean, default is true + * @param enabled boolean or string, possible values: off/false, idle/true, or notIdle */ - autoResume(enabled: boolean): void; + autoResume(enabled: boolean | string): void; /** - * When true, the $keepalive service is automatically stopped and started as needed. + * When true, the Keepalive service is automatically stopped and started as needed. * * @param enabled boolean, default is true */ @@ -103,13 +201,39 @@ declare module angular.idle { } /** - * $idle, once watch() is called, will start a timeout which if expires, will enter a warning state + * Idle, once watch() is called, will start a timeout which if expires, will enter a warning state * countdown. Once the countdown reaches zero, idle will broadcast a timeout event indicating the * user has timed out (where your app should log them out or whatever you like). If the user performs * an action that triggers a watched DOM event that bubbles up to document.body, this will reset the * idle/warning state and start the process over again. */ interface IIdleService { + /** + * Gets the current idle value + */ + getIdle(): number; + + /** + * Gets the current timeout value + */ + getTimeout(): number; + + /** + * Updates the idle value (see IdleProvider.idle()) and + * restarts the watch if its running. + */ + setIdle(idle: number): void; + + /** + * Updates the timeout value (see IdleProvider.timeout()) and + * restarts the watch if its running. + */ + setTimeout(timeout: number): void; + + /** + * Whether user has timed out (meaning idleDuration + timeout has passed without any activity) + */ + isExpired(): boolean; /** * Whether or not the watch() has been called and it is watching for idleness. @@ -130,5 +254,10 @@ declare module angular.idle { * Stops watching for idleness, and resets the idle/warning state. */ unwatch(): void; + + /** + * Manually trigger the idle interrupt that normally occurs during user activity. + */ + interrupt(): any; } } 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-loading-bar/angular-loading-bar-tests.ts b/angular-loading-bar/angular-loading-bar-tests.ts index b7ca2894e..b8bde9e93 100644 --- a/angular-loading-bar/angular-loading-bar-tests.ts +++ b/angular-loading-bar/angular-loading-bar-tests.ts @@ -7,9 +7,17 @@ class TestController { constructor($http: ng.IHttpService) { $http.get("http://xyz.com", { ignoreLoadingBar: true }) - + } } app.controller('TestController', TestController); + +var barConfig: angular.loadingBar.ILoadingBarProvider[] = []; +barConfig.push({ + includeSpinner: true, + includeBar: true, + spinnerTemplate: 'template', + latencyThreshold: 100 +}); diff --git a/angular-loading-bar/angular-loading-bar.d.ts b/angular-loading-bar/angular-loading-bar.d.ts index b1a8cd55d..acea6f048 100644 --- a/angular-loading-bar/angular-loading-bar.d.ts +++ b/angular-loading-bar/angular-loading-bar.d.ts @@ -14,5 +14,30 @@ declare module angular { */ ignoreLoadingBar?: boolean; } +} -} \ No newline at end of file +declare module angular.loadingBar { + + interface ILoadingBarProvider{ + /** + * Turn the spinner on or off + */ + includeSpinner?: boolean; + + /** + * Turn the loading bar on or off + */ + includeBar?: boolean; + + /** + * HTML template + */ + spinnerTemplate?: string; + + /** + * Latency Threshold + */ + latencyThreshold?: number; + } + +} diff --git a/angular-locker/angular-locker-tests.ts b/angular-locker/angular-locker-tests.ts new file mode 100644 index 000000000..c3c280e77 --- /dev/null +++ b/angular-locker/angular-locker-tests.ts @@ -0,0 +1,133 @@ +/// +/// + +angular +.module('angular-locker-tests', ['angular-locker']) +.config(['lockerProvider', function config(lockerProvider: angular.locker.ILockerProvider) { + let lockerSettings: angular.locker.ILockerSettings = { + driver: 'session', + namespace: 'myApp', + separator: '.', + eventsEnabled: true, + extend: {} + }; + + lockerProvider.defaults(lockerSettings); +}]) +.controller('LockerController', ['$scope', 'locker', function ($scope: angular.IScope, locker: angular.locker.ILockerService) { + locker.put('someKey', 'someVal'); + + // put an item into session storage + locker.driver('session').put('sessionKey', ['some', 'session', 'data']); + + // add an item within a different namespace + locker.namespace('otherNamespace').put('foo', 'bar'); + + locker.put('someString', 'anyDataType'); + locker.put('someObject', { foo: 'I will be serialized', bar: 'pretty cool eh' }); + locker.put('someArray', ['foo', 'bar', 'baz']); + // etc + + //Inserts specified key and return value of function + locker.put('someKey', function() { + var obj = { foo: 'bar', bar: 'baz' }; + // some other logic + return obj; + }); + + locker.put('someKey', ['foo', 'bar']); + + //The current value will be passed into the function so you can perform logic on the current value, before returning it. e.g. + locker.put('someKey', function(current: any) { + current.push('baz'); + + return current; + }); + + locker.get('someKey'); // = ['foo', 'bar', 'baz'] + + // given locker.get('foo') is not defined + locker.put('foo', function (current: any) { + // current will equal 'bar' + }, 'bar'); + + //This will add each key/value pair as a separate item in storage + locker.put({ + someKey: 'johndoe', + anotherKey: ['some', 'random', 'array'], + boolKey: true + }); + + locker.add('someKey', 'someVal'); // true or false - whether the item was added or not + + // locker.put('fooArray', ['bar', 'baz', 'bob']); + + locker.get('fooArray'); // ['bar', 'baz', 'bob'] + + locker.get('keyDoesNotExist', 'a default value'); // 'a default value' + + locker.get(['someKey', 'anotherKey', 'foo']); + /* will return something like... + { + someKey: 'someValue', + anotherKey: true, + foo: 'bar' + }*/ + + // locker.put('someKey', { foo: 'bar', baz: 'bob' }); + + locker.pull('someKey', 'defaultVal'); // { foo: 'bar', baz: 'bob' } + + // then... + + locker.get('someKey', 'defaultVal'); // 'defaultVal' + + locker.all(); + // or + locker.namespace('somethingElse').all(); + + locker.count(); + // or + locker.namespace('somethingElse').count(); + + locker.has('someKey'); // true or false + + // or + locker.namespace('foo').has('bar'); + + // e.g. + if (locker.has('user.authToken') ) { + // we're logged in + } else { + // go to login page or something + } + + locker.forget('keyToRemove'); + // or + locker.driver('session').forget('sessionKey'); + // etc.. + + locker.forget(['keyToRemove', 'anotherKeyToRemove', 'something', 'else']); + + locker.clean(); + // or + locker.namespace('someOtherNamespace').clean(); + + locker.empty(); + + locker.bind($scope, 'foo'); + $scope['foo'] = ['bar', 'baz']; + locker.get('foo'); // = ['bar', 'baz'] + + locker.bind($scope, 'foo', 'someDefault'); + $scope['foo']; // = 'someDefault' + locker.get('foo'); // = 'someDefault' + + locker.unbind($scope, 'foo'); + $scope['foo']; // = undefined + locker.get('foo'); // = undefined + + if (! locker.supported()) { + // load a polyfill? + } +}]); diff --git a/angular-locker/angular-locker.d.ts b/angular-locker/angular-locker.d.ts new file mode 100644 index 000000000..e911e3be7 --- /dev/null +++ b/angular-locker/angular-locker.d.ts @@ -0,0 +1,170 @@ +// Type definitions for Angular Locker v2.0.3 +// Project: https://github.com/tymondesigns/angular-locker +// Definitions by: Niko Kovačič +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "angular-locker" { + var _: string; + export = _; +} + +declare module angular.locker { + interface ILockerServicePutFunction { + (current: any): any + } + + interface ILockerService { + /** + * Add an item to storage if it doesn't already exist + * + * @param {String} key The key to add + * @param {Mixed} value The value to add + */ + add(key: string, value: any): boolean; + /** + * Return all items in storage within the current namespace/driver + * + */ + all(): any; + /** + * Remove all items set within the current namespace/driver + */ + clean(): ILockerService; + /** + * Get the total number of items within the current namespace + */ + count(): number; + /** + * Retrieve the specified item from storage + * + * @param {String|Array} key The key to get + * @param {Mixed} def The default value if it does not exist + */ + get(key: string | Array, defaultValue?: any): any; + /** + * Determine whether the item exists in storage + * + * @param {String|Function} key - The key to remove + */ + has(key: string): boolean + /** + * Get the storage keys as an array + */ + keys(): Array; + /** + * Add a new item to storage (even if it already exists) + * + * @param {Object} keyValuePairs Key value object + */ + put(keyValuePairs: Object): ILockerService | boolean; + /** + * Add a new item to storage (even if it already exists) + * + * @param {Mixed} putFunction The default to pass to function if doesn't already exist + */ + put(putFunction: Function): ILockerService | boolean; + /** + * Add a new item to storage (even if it already exists) + * + * @param {Mixed} key The key to add + * @param {Mixed} value The value to add + */ + put(key: string, value: any): ILockerService | boolean; + /** + * Add a new item to storage (even if it already exists) + * + * @param {Mixed} key The key to add + * @param {Mixed} putFunction The default to pass to function if doesn't already exist + * @param {Mixed} value The value to add + */ + put(key: string, putFunction: ILockerServicePutFunction, value: any): ILockerService | boolean; + /** + * Remove specified item(s) from storage + * + * @param {String} key The key to remove + */ + forget(key: string): ILockerService; + /** + * Remove specified item(s) from storage + * + * @param {Array} keys The array of keys to remove + * + */ + forget(keys: Array): ILockerService; + /** + * Retrieve the specified item from storage and then remove it + * + * @param {String|Array} key The key to pull from storage + * @param {Mixed} def The default value if it does not exist + */ + pull(key: string | Array, defaultValue?: any): any; + /** + * Bind a storage key to a $scope property + * + * @param {Object} $scope The angular $scope object + * @param {String} key The key in storage to bind to + * @param {Mixed} def The default value to initially bind + */ + bind(scope: IScope, property: string, defaultPropertyValue?: any): ILockerService; + /** + * Set the storage driver on a new instance to enable overriding defaults + * + * @param {String} driver The driver to switch to + */ + driver(localStorageType: string): ILockerService; + /** + * Empty the current storage driver completely. careful now. + */ + empty(): ILockerService; + /** + * Get the currently set namespace + */ + getNamespace(): string; + /** + * Get a new instance of Locker + * + * @param {Object} options The config options to instantiate with + */ + instance(lockerSettings: ILockerSettings): ILockerService; + /** + * Set the namespace on a new instance to enable overriding defaults + * + * @param {String} namespace The namespace to switch to + */ + 'namespace'(name: string): ILockerService; + /** + * Check browser support + * + * @see github.com/Modernizr/Modernizr/blob/master/feature-detects/storage/localstorage.js#L38-L47 + * + * @param {String} driver The driver to check support with + */ + supported(): boolean; + /** + * Unbind a storage key from a $scope property + * + * @param {Object} $scope The angular $scope object + * @param {String} key The key to remove from bindings + */ + unbind(scope: IScope, property: string): ILockerService; + } + + interface ILockerSettings { + driver?: string; + 'namespace'?: string | boolean; + separator?: string; + eventsEnabled?: boolean; + extend?: Object; + } + + interface ILockerProvider extends angular.IServiceProvider { + /** + * Allow the defaults to be specified via the `lockerProvider` + * + * @param {ILockerSettings} lockerSettings The defaults to override + */ + defaults(lockerSettings: ILockerSettings): void; + } +} \ No newline at end of file diff --git a/angular-material/angular-material-0.8.3.d.ts b/angular-material/angular-material-0.8.3.d.ts index 1e3eda18a..10724b812 100644 --- a/angular-material/angular-material-0.8.3.d.ts +++ b/angular-material/angular-material-0.8.3.d.ts @@ -59,7 +59,7 @@ declare module angular.material { show(dialog: MDDialogOptions|MDPresetDialog): angular.IPromise; confirm(): MDConfirmDialog; alert(): MDAlertDialog; - hide(response?: any): void; + hide(response?: any): angular.IPromise; cancel(response?: any): void; } diff --git a/angular-material/angular-material-0.9.0.d.ts b/angular-material/angular-material-0.9.0.d.ts index 1383b0beb..96134f114 100644 --- a/angular-material/angular-material-0.9.0.d.ts +++ b/angular-material/angular-material-0.9.0.d.ts @@ -64,7 +64,7 @@ declare module angular.material { show(dialog: MDDialogOptions|MDAlertDialog|MDConfirmDialog): angular.IPromise; confirm(): MDConfirmDialog; alert(): MDAlertDialog; - hide(response?: any): void; + hide(response?: any): angular.IPromise; cancel(response?: any): void; } 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..4ce3fe103 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 @@ -16,6 +16,7 @@ declare module angular.material { targetEvent?: MouseEvent; resolve?: {[index: string]: angular.IPromise} controllerAs?: string; + bindToController?: boolean; parent?: string|Element|JQuery; // default: root node disableParentScroll?: boolean; // default: true } @@ -28,7 +29,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; @@ -75,6 +77,7 @@ declare module angular.material { resolve?: {[index: string]: angular.IPromise} controllerAs?: string; parent?: string|Element|JQuery; // default: root node + fullscreen?: boolean; onComplete?: Function; } @@ -82,7 +85,7 @@ declare module angular.material { show(dialog: IDialogOptions|IAlertDialog|IConfirmDialog): angular.IPromise; confirm(): IConfirmDialog; alert(): IAlertDialog; - hide(response?: any): void; + hide(response?: any): angular.IPromise; cancel(response?: any): void; } @@ -115,7 +118,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-meteor/angular-meteor.d.ts b/angular-meteor/angular-meteor.d.ts index b3f520ac5..e536e3203 100644 --- a/angular-meteor/angular-meteor.d.ts +++ b/angular-meteor/angular-meteor.d.ts @@ -39,6 +39,28 @@ declare module angular.meteor { * @return The promise solved successfully when subscription is ready. The success promise holds the subscription handle. */ subscribe(name: string, ...publisherArguments: any[]): angular.IPromise; + + /** + * The helpers method is part of the ReactiveContext, and available on every context and $scope. + * These method are defined as Object, where each key is the name of the variable that will be available on the context we run, and each value is a function with a return value. + * Under the hood, each helper starts a new Tracker.autorun. When its reactive dependencies change, the helper is rerun. + * To trigger a rerun every time an specific Angular variable change, use getReactively](/api/1.3.1/get-reactively) to make your Angular variable reactive inside the helper its used in. + * Each helper function should return a MongoDB Cursor and the helpers will expose it as a normal array to the context. + * + * @param definitions - Object containing `name` => `function` definition, where each name is a string and each function is the helper function. Should return a [MongoDB Cursor](http://docs.meteor.com/#/full/mongo_cursor) + * @return This method returns this, which the the reactive context, in order to provide the ability to chain the logic. + */ + helpers(definitions : { [helperName : string] : () => Mongo.Cursor }): IScope; + + /** + * This method is a wrapper of Tracker.autorun and shares exactly the same API. + * The autorun method is part of the ReactiveContext, and available on every context and $scope. + * The argument of this method is a callback, which will be called each time Autorun will be used. + * The Autorun will stop automatically when when it's context ($scope) is destroyed. + * + * @param runFunc - The function to run. It receives one argument: the Computation object that will be returned. + */ + autorun(runFunc : () => void) : Tracker.Computation; } /** 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/angular-odata-resources/angular-odata-resources-tests.ts b/angular-odata-resources/angular-odata-resources-tests.ts index 23286adc0..a9194b006 100644 --- a/angular-odata-resources/angular-odata-resources-tests.ts +++ b/angular-odata-resources/angular-odata-resources-tests.ts @@ -174,6 +174,7 @@ var user = odataResourceClass.odata() .skip(10) .take(20) .orderBy("Name", "desc") + .transformUrl((s)=>s) .single(); user.$save(); diff --git a/angular-odata-resources/angular-odata-resources.d.ts b/angular-odata-resources/angular-odata-resources.d.ts index 65e7d26e2..d9c59ddf3 100644 --- a/angular-odata-resources/angular-odata-resources.d.ts +++ b/angular-odata-resources/angular-odata-resources.d.ts @@ -281,6 +281,7 @@ declare module OData { constructor(callback: ProviderCallback); filter(operand1: any, operand2?: any, operand3?: any): Provider; orderBy(arg1: string, arg2?: string): Provider; + transformUrl(transformMethod : (url:string)=>string): Provider; take(amount: number): Provider; skip(amount: number): Provider; private execute(); diff --git a/angular-protractor/angular-protractor-tests.ts b/angular-protractor/angular-protractor-tests.ts index 45a5d7edc..64bf8d6d6 100644 --- a/angular-protractor/angular-protractor-tests.ts +++ b/angular-protractor/angular-protractor-tests.ts @@ -196,6 +196,27 @@ function TestWebDriverUntilModule() { conditionWebElements = protractor.until.elementsLocated(by.className('class')); } +function TestWebDriverExpectedConditionsModule() { + var conditionB: protractor.until.Condition; + var el: protractor.ElementFinder = element(by.id('id')); + + conditionB = protractor.ExpectedConditions.alertIsPresent(); + conditionB = protractor.ExpectedConditions.elementToBeClickable(el); + conditionB = protractor.ExpectedConditions.textToBePresentInElement(el, 'text'); + conditionB = protractor.ExpectedConditions.textToBePresentInElementValue(el, 'text'); + conditionB = protractor.ExpectedConditions.titleContains('text'); + conditionB = protractor.ExpectedConditions.titleIs('text'); + conditionB = protractor.ExpectedConditions.presenceOf(el); + conditionB = protractor.ExpectedConditions.stalenessOf(el); + conditionB = protractor.ExpectedConditions.visibilityOf(el); + conditionB = protractor.ExpectedConditions.invisibilityOf(el); + conditionB = protractor.ExpectedConditions.elementToBeSelected(el); + + conditionB = protractor.ExpectedConditions.not(protractor.ExpectedConditions.alertIsPresent()); + conditionB = protractor.ExpectedConditions.and(protractor.ExpectedConditions.alertIsPresent(), protractor.ExpectedConditions.elementToBeClickable(el)); + conditionB = protractor.ExpectedConditions.or(protractor.ExpectedConditions.alertIsPresent(), protractor.ExpectedConditions.elementToBeClickable(el)); +} + function TestProtractor() { var ptor: protractor.Protractor; var driver: webdriver.WebDriver = new webdriver.Builder(). @@ -385,9 +406,19 @@ function TestElementArrayFinder() { elementArrayFinder.each(function(element: protractor.ElementFinder){ // nothing }); + stringPromise = elementArrayFinder.map(function(element: protractor.ElementFinder, index: number){ return 'abc'; - }) + }); + + stringPromise = elementArrayFinder.map(function(element: protractor.ElementFinder, index: number): string { + return 'abc'; + }); + + stringPromise = elementArrayFinder.map>(function(element: protractor.ElementFinder, index: number): webdriver.promise.Promise { + return element.getText(); + }); + elementArrayFinder = elementArrayFinder.filter(function(element: protractor.ElementFinder, index: number){ return element.getText().then((text: string) => { return text === "foo"; diff --git a/angular-protractor/angular-protractor.d.ts b/angular-protractor/angular-protractor.d.ts index ff8324238..78158df9c 100644 --- a/angular-protractor/angular-protractor.d.ts +++ b/angular-protractor/angular-protractor.d.ts @@ -501,6 +501,145 @@ declare module protractor { function titleMatches(regex: RegExp): webdriver.until.Condition; } + module ExpectedConditions { + /** + * Negates the result of a promise. + * + * @param {webdriver.until.Condition} expectedCondition + * @return {!webdriver.until.Condition} An expected condition that returns the negated value. + */ + function not(expectedCondition: webdriver.until.Condition): webdriver.until.Condition; + + /** + * Chain a number of expected conditions using logical_and, short circuiting at the + * first expected condition that evaluates to false. + * + * @param {...webdriver.until.Condition[]} fns An array of expected conditions to 'and' together. + * @return {!webdriver.until.Condition} An expected condition that returns a promise which evaluates + * to the result of the logical and. + */ + function and(...fns: webdriver.until.Condition[]): webdriver.until.Condition; + + /** + * Chain a number of expected conditions using logical_or, short circuiting at the + * first expected condition that evaluates to true. + * + * @param {...webdriver.until.Condition[]} fns An array of expected conditions to 'or' together. + * @return {!webdriver.until.Condition} An expected condition that returns a promise which + * evaluates to the result of the logical or. + */ + function or(...fns: webdriver.until.Condition[]): webdriver.until.Condition; + + /** + * Expect an alert to be present. + * + * @return {!webdriver.until.Condition} An expected condition that returns a promise representing + * whether an alert is present. + */ + function alertIsPresent(): webdriver.until.Condition; + + /** + * An Expectation for checking an element is visible and enabled such that you can click it. + * + * @param {ElementFinder} element The element to check + * @return {!webdriver.until.Condition} An expected condition that returns a promise representing + * whether the element is clickable. + */ + function elementToBeClickable(element: ElementFinder): webdriver.until.Condition; + + /** + * An expectation for checking if the given text is present in the element. + * Returns false if the elementFinder does not find an element. + * + * @param {ElementFinder} element The element to check + * @param {string} text The text to verify against + * @return {!webdriver.until.Condition} An expected condition that returns a promise representing + * whether the text is present in the element. + */ + function textToBePresentInElement(element: ElementFinder, text: string): webdriver.until.Condition; + + /** + * An expectation for checking if the given text is present in the element’s value. + * Returns false if the elementFinder does not find an element. + * + * @param {ElementFinder} element The element to check + * @param {string} text The text to verify against + * @return {!webdriver.until.Condition} An expected condition that returns a promise representing + * whether the text is present in the element's value. + */ + function textToBePresentInElementValue( + element: ElementFinder, text: string + ): webdriver.until.Condition; + + /** + * An expectation for checking that the title contains a case-sensitive substring. + * + * @param {string} title The fragment of title expected + * @return {!webdriver.until.Condition} An expected condition that returns a promise representing + * whether the title contains the string. + */ + function titleContains(title: string): webdriver.until.Condition; + + /** + * An expectation for checking the title of a page. + * + * @param {string} title The expected title, which must be an exact match. + * @return {!webdriver.until.Condition} An expected condition that returns a promise representing + * whether the title equals the string. + */ + function titleIs(title: string): webdriver.until.Condition; + + /** + * An expectation for checking that an element is present on the DOM of a page. This does not necessarily + * mean that the element is visible. This is the opposite of 'stalenessOf'. + * + * @param {ElementFinder} elementFinder The element to check + * @return {!webdriver.until.Condition} An expected condition that returns a promise + * representing whether the element is present. + */ + function presenceOf(element: ElementFinder): webdriver.until.Condition; + + /** + * An expectation for checking that an element is not attached to the DOM of a page. + * This is the opposite of 'presenceOf'. + * + * @param {ElementFinder} elementFinder The element to check + * @return {!webdriver.until.Condition} An expected condition that returns a promise representing + * whether the element is stale. + */ + function stalenessOf(element: ElementFinder): webdriver.until.Condition; + + /** + * An expectation for checking that an element is present on the DOM of a page and visible. + * Visibility means that the element is not only displayed but also has a height and width that is + * greater than 0. This is the opposite of 'invisibilityOf'. + * + * @param {ElementFinder} elementFinder The element to check + * @return {!webdriver.until.Condition} An expected condition that returns a promise representing + * whether the element is visible. + */ + function visibilityOf(element: ElementFinder): webdriver.until.Condition; + + /** + * An expectation for checking that an element is present on the DOM of a page. This does not necessarily + * mean that the element is visible. This is the opposite of 'stalenessOf'. + * + * @param {ElementFinder} elementFinder The element to check + * @return {!webdriver.until.Condition} An expected condition that returns a promise representing + * whether the element is invisible. + */ + function invisibilityOf(element: ElementFinder): webdriver.until.Condition; + + /** + * An expectation for checking the selection is selected. + * + * @param {ElementFinder} elementFinder The element to check + * @return {!webdriver.until.Condition} An expected condition that returns a promise representing + * whether the element is selected. + */ + function elementToBeSelected(element: ElementFinder): webdriver.until.Condition; + } + //endregion /** @@ -853,6 +992,7 @@ declare module protractor { * of values returned by the map function. */ map(mapFn: (element: ElementFinder, index: number) => T): webdriver.promise.Promise; + map(mapFn: (element: ElementFinder, index: number) => T2): webdriver.promise.Promise; /** * Apply a filter function to each element within the ElementArrayFinder. Returns @@ -1667,6 +1807,16 @@ declare module protractor { * @return {Protractor} a protractor instance. */ forkNewDriverInstance(opt_useSameUrl?: boolean, opt_copyMockModules?: boolean): Protractor; + + /** + * Get the processed configuration object that is currently being run. This will contain + * the specs and capabilities properties of the current runner instance. + * + * Set by the runner. + * + * @return {webdriver.promise.Promise} A promise which resolves to the capabilities object. + */ + getProcessedConfig(): webdriver.promise.Promise; } /** diff --git a/angular-strap/angular-strap-tests.ts b/angular-strap/angular-strap-tests.ts new file mode 100644 index 000000000..90c7a2bde --- /dev/null +++ b/angular-strap/angular-strap-tests.ts @@ -0,0 +1,378 @@ +/// +/// + +module angularStrapTests { + + import ngStrap = mgcrea.ngStrap; + + /////////////////////////////////////////////////////////////////////////// + // Modal + /////////////////////////////////////////////////////////////////////////// + + module modalTests { + + interface IDemoCtrlScope extends ngStrap.modal.IModalScope { + showModal: () => void; + } + + angular.module('demoApp') + .config($modalConfig) + .controller('demoCtrl', demoCtrl); + + function demoCtrl($scope: IDemoCtrlScope, + $modal: ngStrap.modal.IModalService): void { + + var myModalOptions: ngStrap.modal.IModalOptions = {}; + myModalOptions.title = 'My Title'; + myModalOptions.content = 'Hello Modal
This is a multiline message!'; + myModalOptions.show = true; + + var myModal = $modal(myModalOptions); + + var myOtherModalOptions: ngStrap.modal.IModalOptions = {}; + myOtherModalOptions.scope = $scope; + myOtherModalOptions.template = 'modal/docs/modal.demo.tpl.html'; + myOtherModalOptions.show = false; + + var myOtherModal = $modal(myOtherModalOptions); + + $scope.showModal = (): void => { + myOtherModal.$promise.then(myOtherModal.show); + }; + } + + function $modalConfig($modalProvider: ngStrap.modal.IModalProvider): void { + var defaults: ngStrap.modal.IModalOptions = { + animation: 'am-flip-x' + } + angular.extend($modalProvider.defaults, defaults); + } + } + + + /////////////////////////////////////////////////////////////////////////// + // Aside + /////////////////////////////////////////////////////////////////////////// + + module asideTests { + + angular.module('demoApp') + .config($asideConfig) + .controller('demoCtrl', demoCtrl); + + function demoCtrl($scope: ngStrap.aside.IAsideScope, + $aside: ngStrap.aside.IAsideService): void { + + var myAsideOptions: ngStrap.aside.IAsideOptions = {}; + myAsideOptions.title = 'My Title'; + myAsideOptions.content = 'My content'; + myAsideOptions.show = true; + + var myAside = $aside(myAsideOptions); + + var myOtherAsideOptions: ngStrap.aside.IAsideOptions = {}; + myOtherAsideOptions.scope = $scope; + myOtherAsideOptions.template = 'aside/docs/aside.demo.tpl.html'; + + var myOtherAside = $aside(); + + myOtherAside.$promise.then(() => { + myOtherAside.show(); + }); + } + + function $asideConfig($asideProvider: ngStrap.aside.IAsideProvider): void { + var defaults: ngStrap.aside.IAsideOptions = {}; + defaults.animation = 'am-fadeAndSlideLeft'; + defaults.placement = 'left'; + + angular.extend($asideProvider.defaults, defaults); + } + } + + + /////////////////////////////////////////////////////////////////////////// + // Alert + /////////////////////////////////////////////////////////////////////////// + + module alertTests { + + angular.module('demoApp') + .config($alertConfig) + .controller('demoCtrl', demoCtrl); + + function demoCtrl($scope: ngStrap.alert.IAlertScope, + $alert: ngStrap.alert.IAlertService): void { + + var options: ngStrap.alert.IAlertOptions = {}; + options.title = 'Holy guacamole!'; + options.content = 'Best check yo self, you\'re not looking too good.'; + options.placement = 'top'; + options.type = 'info'; + options.show = true; + + var myAlert = $alert(); + } + + function $alertConfig($alertProvider: ngStrap.alert.IAlertProvider): void { + var defaults: ngStrap.alert.IAlertOptions = {}; + defaults.animation = 'am-fade-and-slide-top'; + defaults.placement = 'top'; + + angular.extend($alertProvider.defaults, defaults); + }; + } + + + /////////////////////////////////////////////////////////////////////////// + // Tooltip + /////////////////////////////////////////////////////////////////////////// + + module tooltipTests { + + angular.module('demoApp') + .config($tooltipConfig) + .controller('demoDrct', demoDrct); + + function demoDrct($tooltip: ngStrap.tooltip.ITooltipService): ng.IDirective { + var drct: ng.IDirective = {}; + drct.restrict = 'EA'; + drct.link = link; + return drct; + + function link(scope: ng.IScope, elem: ng.IAugmentedJQuery, attrs: ng.IAttributes): void { + var options: ngStrap.tooltip.ITooltipOptions = {}; + options.title = 'My Title'; + $tooltip(elem, options); + } + } + + function $tooltipConfig($tooltipProvider: ngStrap.tooltip.ITooltipProvider): void { + var defaults: ngStrap.tooltip.ITooltipOptions = {}; + defaults.animation = 'am-flip-x'; + defaults.trigger = 'hover'; + + angular.extend($tooltipProvider.defaults, defaults); + }; + } + + + /////////////////////////////////////////////////////////////////////////// + // Popover + /////////////////////////////////////////////////////////////////////////// + + module popoverTests { + + angular.module('demoApp') + .config($popoverConfig) + .controller('demoDrct', demoDrct); + + function demoDrct($popover: ngStrap.popover.IPopoverService): ng.IDirective { + var drct: ng.IDirective = {}; + drct.restrict = 'EA'; + drct.link = link; + return drct; + + function link(scope: ng.IScope, elem: ng.IAugmentedJQuery, attrs: ng.IAttributes): void { + var options: ngStrap.tooltip.ITooltipOptions = {}; + options.title = 'My Title'; + + $popover(elem, options); + } + } + + function $popoverConfig($popoverProvider: ngStrap.popover.IPopoverProvider): void { + var defaults: ngStrap.tooltip.ITooltipOptions = {} + defaults.animation = 'am-flip-x'; + defaults.trigger = 'hover'; + + angular.extend($popoverProvider.defaults, defaults); + }; + } + + + /////////////////////////////////////////////////////////////////////////// + // Typeahead + /////////////////////////////////////////////////////////////////////////// + + module typeaheadTests { + + angular.module('myApp') + .config($typeaheadConfig); + + function $typeaheadConfig($typeaheadProvider: ngStrap.typeahead.ITypeaheadProvider) { + var defaults: ngStrap.typeahead.ITypeaheadOptions = {} + defaults.animation = 'am-flip-x'; + defaults.minLength = 2; + defaults.limit = 8; + + angular.extend($typeaheadProvider.defaults, defaults); + } + } + + + /////////////////////////////////////////////////////////////////////////// + // Datepicker + /////////////////////////////////////////////////////////////////////////// + + module datepickerTests { + + angular.module('myApp') + .config($datepickerConfig); + + function $datepickerConfig($datepickerProvider: ngStrap.datepicker.IDatepickerProvider): void { + var defaults: ngStrap.datepicker.IDatepickerOptions = {}; + defaults.dateFormat = 'dd/MM/yyyy'; + defaults.startWeek = 1; + + angular.extend($datepickerProvider.defaults, defaults); + }; + } + + + /////////////////////////////////////////////////////////////////////////// + // Timepicker + /////////////////////////////////////////////////////////////////////////// + + module timepickerTests { + + angular.module('myApp') + .config($timepickerConfig); + + function $timepickerConfig($timepickerProvider: ngStrap.timepicker.ITimepickerProvider): void { + var defaults: ngStrap.timepicker.ITimepickerOptions = {}; + defaults.timeFormat = 'HH:mm'; + defaults.length = 7; + + angular.extend($timepickerProvider.defaults, defaults); + }; + } + + + /////////////////////////////////////////////////////////////////////////// + // Select + /////////////////////////////////////////////////////////////////////////// + + module selectTests { + + angular.module('myApp') + .config($selectConfig); + + function $selectConfig($selectProvider: ngStrap.select.ISelectProvider): void { + var defaults: ngStrap.select.ISelectOptions = {}; + defaults.animation = 'am-flip-x'; + defaults.sort = false; + + angular.extend($selectProvider.defaults, defaults); + } + } + + + /////////////////////////////////////////////////////////////////////////// + // Tabs + /////////////////////////////////////////////////////////////////////////// + + module tabTests { + + angular.module('myApp') + .config($tabConfig); + + function $tabConfig($tabProvider: ngStrap.tab.ITabProvider) { + var defaults: ngStrap.tab.ITabOptions = {}; + defaults.animation = 'am-flip-x'; + + angular.extend($tabProvider.defaults, defaults); + } + } + + /////////////////////////////////////////////////////////////////////////// + // Collapse + /////////////////////////////////////////////////////////////////////////// + + module collapseTests { + + angular.module('myApp') + .config($collapseConfig); + + function $collapseConfig($collapseProvider: ngStrap.collapse.ICollapseProvider):void { + var defaults: ngStrap.collapse.ICollapseOptions = {}; + defaults.animation = 'am-flip-x'; + + angular.extend($collapseProvider.defaults, defaults); + } + } + + + /////////////////////////////////////////////////////////////////////////// + // Dropdown + /////////////////////////////////////////////////////////////////////////// + + module dropdownTests { + + angular.module('myApp') + .config($dropdownConfig); + + function $dropdownConfig($dropdownProvider: ngStrap.dropdown.IDropdownProvider):void { + var defaults: ngStrap.dropdown.IDropdownOptions = {}; + defaults.animation = 'am-flip-x'; + defaults.trigger = 'hover'; + + angular.extend($dropdownProvider.defaults, defaults); + } + } + + + /////////////////////////////////////////////////////////////////////////// + // Navbar + /////////////////////////////////////////////////////////////////////////// + + module navbarTests { + + angular.module('myApp') + .config($navbarConfig); + + function $navbarConfig($navbarProvider: ngStrap.navbar.INavbarProvider):void { + var defaults: ngStrap.navbar.INavbarOptions = {}; + defaults.activeClass = 'in'; + + angular.extend($navbarProvider.defaults, defaults); + } + } + + + /////////////////////////////////////////////////////////////////////////// + // Scrollspy + /////////////////////////////////////////////////////////////////////////// + + module scrollspyTests { + + angular.module('myApp') + .config($scrollspyConfig); + + function $scrollspyConfig($scrollspyProvider: ngStrap.scrollspy.IScrollspyProvider):void { + var defaults: ngStrap.scrollspy.IScrollspyOptions = {}; + defaults.offset = 0; + defaults.target = 'my-selector'; + + angular.extend($scrollspyProvider.defaults, defaults); + } + } + + + /////////////////////////////////////////////////////////////////////////// + // Affix + /////////////////////////////////////////////////////////////////////////// + + module affixTests { + + angular.module('myApp') + .config($affixConfig); + + function $affixConfig($affixProvider: ngStrap.affix.IAffixProvider):void { + var defaults: ngStrap.affix.IAffixOptions = {}; + defaults.offsetTop = 100; + + angular.extend($affixProvider.defaults, defaults); + } + } +} \ No newline at end of file diff --git a/angular-strap/angular-strap.d.ts b/angular-strap/angular-strap.d.ts new file mode 100644 index 000000000..10e46bc1c --- /dev/null +++ b/angular-strap/angular-strap.d.ts @@ -0,0 +1,600 @@ +// Type definitions for angular-strap v2.2.x +// Project: http://mgcrea.github.io/angular-strap/ +// Definitions by: Sam Herrmann +// Definitions: https://github.com/borisyankov/DefinitelyTyped + + +/// + +declare module mgcrea.ngStrap { + + /////////////////////////////////////////////////////////////////////////// + // Modal + // see http://mgcrea.github.io/angular-strap/#/modals + /////////////////////////////////////////////////////////////////////////// + + module modal { + + interface IModalService { + (config?: IModalOptions): IModal; + } + + interface IModalProvider { + defaults: IModalOptions; + } + + interface IModal { + $promise: ng.IPromise; + show: () => void; + hide: () => void; + toggle: () => void; + } + + interface IModalOptions { + animation?: string; + backdropAnimation?: string; + placement?: string; + title?: string; + content?: string; + html?: boolean; + backdrop?: boolean | string; + keyboard?: boolean; + show?: boolean; + container?: string | boolean; + template?: string; + contentTemplate?: string; + prefixEvent?: string; + id?: string; + scope?: ng.IScope; + } + + interface IModalScope extends ng.IScope { + $show: () => void; + $hide: () => void; + $toggle: () => void; + } + } + + + /////////////////////////////////////////////////////////////////////////// + // Aside + // see http://mgcrea.github.io/angular-strap/#/asides + /////////////////////////////////////////////////////////////////////////// + + module aside { + + interface IAsideService { + (config?: IAsideOptions): IAside; + } + + interface IAsideProvider { + defaults: IAsideOptions; + } + + interface IAside { + $promise: ng.IPromise; + show: () => void; + hide: () => void; + toggle: () => void; + } + + interface IAsideOptions { + animation?: string; + placement?: string; + title?: string; + content?: string; + html?: boolean; + backdrop?: boolean | string; + keyboard?: boolean; + show?: boolean; + container?: string | boolean; + template?: string; + contentTemplate?: string; + scope?: ng.IScope; + } + + interface IAsideScope extends ng.IScope { + $show: () => void; + $hide: () => void; + $toggle: () => void; + } + } + + + + /////////////////////////////////////////////////////////////////////////// + // Alert + // see http://mgcrea.github.io/angular-strap/#/alerts + /////////////////////////////////////////////////////////////////////////// + + module alert { + + interface IAlertService { + (config?: IAlertOptions): IAlert; + } + + interface IAlertProvider { + defaults: IAlertOptions; + } + + interface IAlert { + $promise: ng.IPromise; + show: () => void; + hide: () => void; + toggle: () => void; + } + + interface IAlertOptions { + animation?: string; + placement?: string; + title?: string; + content?: string; + type?: string; + keyboard?: boolean; + show?: boolean; + container?: string | boolean; + template?: string; + duration?: number | boolean; + dismissable?: boolean; + } + + interface IAlertScope extends ng.IScope { + $show: () => void; + $hide: () => void; + $toggle: () => void; + } + } + + + /////////////////////////////////////////////////////////////////////////// + // Tooltip + // see http://mgcrea.github.io/angular-strap/#/tooltips + /////////////////////////////////////////////////////////////////////////// + + module tooltip { + + interface ITooltipService { + (element: ng.IAugmentedJQuery, config?: ITooltipOptions): ITooltip; + } + + interface ITooltipProvider { + defaults: ITooltipOptions; + } + + interface ITooltip { + $promise: ng.IPromise; + show: () => void; + hide: () => void; + toggle: () => void; + } + + interface ITooltipOptions { + animation?: string; + placement?: string; + trigger?: string; + title?: string; + html?: boolean; + delay?: number | { show: number; hide: number}; + container?: string | boolean; + target?: string | ng.IAugmentedJQuery | boolean; + template?: string; + contentTemplate?: string; + prefixEvent?: string; + id?: string; + viewport?: string | { selector: string; padding: string | number }; + } + + interface ITooltipScope extends ng.IScope { + $show: () => void; + $hide: () => void; + $toggle: () => void; + $setEnabled: (isEnabled: boolean) => void; + } + } + + + /////////////////////////////////////////////////////////////////////////// + // Popover + // see http://mgcrea.github.io/angular-strap/#/popovers + /////////////////////////////////////////////////////////////////////////// + + module popover { + + interface IPopoverService { + (element: ng.IAugmentedJQuery, config?: IPopoverOptions): IPopover; + } + + interface IPopoverProvider { + defaults: IPopoverOptions; + } + + interface IPopover { + $promise: ng.IPromise; + show: () => void; + hide: () => void; + toggle: () => void; + } + + interface IPopoverOptions { + animation?: string; + placement?: string; + trigger?: string; + title?: string; + content?: string; + html?: boolean; + delay?: number | { show: number; hide: number }; + container?: string | boolean; + target?: string | ng.IAugmentedJQuery | boolean; + template?: string; + contentTemplate?: string; + autoClose?: boolean; + id?: string; + viewport?: string | { selector: string; padding: string | number }; + } + + interface IPopoverScope extends ng.IScope { + $show: () => void; + $hide: () => void; + $toggle: () => void; + } + } + + + + /////////////////////////////////////////////////////////////////////////// + // Typeahead + // see http://mgcrea.github.io/angular-strap/#/typeaheads + /////////////////////////////////////////////////////////////////////////// + + module typeahead { + + interface ITypeaheadService { + (element: ng.IAugmentedJQuery, controller: any, config?: ITypeaheadOptions): ITypeahead; + } + + interface ITypeaheadProvider { + defaults: ITypeaheadOptions; + } + + interface ITypeahead { + $promise: ng.IPromise; + show: () => void; + hide: () => void; + toggle: () => void; + } + + interface ITypeaheadOptions { + animation?: string; + placement?: string; + trigger?: string; + html?: boolean; + delay?: number | { show: number; hide: number }; + container?: string | boolean; + template?: string; + limit?: number; + minLength?: number; + autoSelect?: boolean; + comparator?: string; + id?: string; + watchOptions?: boolean; + } + } + + + /////////////////////////////////////////////////////////////////////////// + // Datepicker + // see http://mgcrea.github.io/angular-strap/#/datepickers + /////////////////////////////////////////////////////////////////////////// + + module datepicker { + + interface IDatepickerService { + (element: ng.IAugmentedJQuery, controller: any, config?: IDatepickerOptions): IDatepicker; + } + + interface IDatepickerProvider { + defaults: IDatepickerOptions; + } + + interface IDatepicker { + update: (date: Date) => void; + updateDisabledDates: (dateRanges: IDatepickerDateRange[]) => void; + select: (dateConstructorArg: string | number | number[], keep: boolean) => void; + setMode: (mode: any) => void; + int: () => void; + destroy: () => void; + show: () => void; + hide: () => void; + } + + interface IDatepickerDateRange { + start: Date; + end: Date; + } + + interface IDatepickerOptions { + animation?: string; + placement?: string; + trigger?: string; + html?: boolean; + delay?: number | { show: number; hide: number }; + container?: string | boolean; + template?: string; + dateFormat?: string; + modelDateFormat?: string; + dateType?: string; + timezone?: string; + autoclose?: boolean; + useNative?: boolean; + minDate?: Date; + maxDate?: Date; + startView?: number; + minView?: number; + startWeek?: number; + startDate?: Date; + iconLeft?: string; + iconRight?: string; + daysOfWeekDisabled?: string; + disabledDates?: IDatepickerDateRange[]; + } + } + + + /////////////////////////////////////////////////////////////////////////// + // Timepicker + // see http://mgcrea.github.io/angular-strap/#/timepickers + /////////////////////////////////////////////////////////////////////////// + + module timepicker { + + interface ITimepickerService { + (element: ng.IAugmentedJQuery, controller: any, config?: ITimepickerOptions): ITimepicker; + } + + interface ITimepickerProvider { + defaults: ITimepickerOptions; + } + + interface ITimepicker { + + } + + interface ITimepickerOptions { + animation?: string; + placement?: string; + trigger?: string; + html?: boolean; + delay?: number | { show: number; hide: number; }; + container?: string | boolean; + template?: string; + timeFormat?: string; + modelTimeFormat?: string; + timeType?: string; + autoclose?: boolean; + useNative?: boolean; + minTime?: Date; // TODO + maxTime?: Date; // TODO + length?: number; + hourStep?: number; + minuteStep?: number; + secondStep?: number; + roundDisplay?: boolean; + iconUp?: string; + iconDown?: string; + arrowBehaviour?: string; + } + } + + + /////////////////////////////////////////////////////////////////////////// + // Button + // see http://mgcrea.github.io/angular-strap/#/buttons + /////////////////////////////////////////////////////////////////////////// + + // No definitions for this module + + + /////////////////////////////////////////////////////////////////////////// + // Select + // see http://mgcrea.github.io/angular-strap/#/selects + /////////////////////////////////////////////////////////////////////////// + + module select { + + interface ISelectService { + (element: ng.IAugmentedJQuery, controller: any, config: ISelectOptions): ISelect; + } + + interface ISelectProvider { + defaults: ISelectOptions; + } + + interface ISelect { + update: (matches: any) => void; + active: (index: number) => number; + select: (index: number) => void; + show: () => void; + hide: () => void; + } + + interface ISelectOptions { + animation?: string; + placement?: string; + trigger?: string; + html?: boolean; + delay?: number | { show: number; hide: number; }; + container?: string | boolean; + template?: string; + multiple?: boolean; + allNoneButtons?: boolean; + allText?: string; + noneText?: string; + maxLength?: number; + maxLengthHtml?: string; + sort?: boolean; + placeholder?: string; + iconCheckmark?: string; + id?: string; + } + } + + /////////////////////////////////////////////////////////////////////////// + // Tabs + // see http://mgcrea.github.io/angular-strap/#/tabs + /////////////////////////////////////////////////////////////////////////// + + module tab { + + interface ITabProvider { + defaults: ITabOptions; + } + + interface ITabService { + defaults: ITabOptions; + controller: any; + } + + interface ITabOptions { + animation?: string; + template?: string; + navClass?: string; + activeClass?: string; + } + } + + + /////////////////////////////////////////////////////////////////////////// + // Collapses + // see http://mgcrea.github.io/angular-strap/#/collapses + /////////////////////////////////////////////////////////////////////////// + + module collapse { + + interface ICollapseProvider { + defaults: ICollapseOptions; + } + + interface ICollapseOptions { + animation?: string; + activeClass?: string; + disallowToggle?: boolean; + startCollapsed?: boolean; + allowMultiple?: boolean; + } + } + + + /////////////////////////////////////////////////////////////////////////// + // Dropdowsn + // see http://mgcrea.github.io/angular-strap/#/dropdowns + /////////////////////////////////////////////////////////////////////////// + + module dropdown { + + interface IDropdownProvider { + defaults: IDropdownOptions; + } + + interface IDropdownService { + (element: ng.IAugmentedJQuery, config: IDropdownOptions): IDropdown; + } + + interface IDropdown { + show: () => void; + hide: () => void; + destroy: () => void; + } + + interface IDropdownOptions { + animation?: string; + placement?: string; + trigger?: string; + html?: boolean; + delay?: number | { show: number; hide: number; }; + container?: string | boolean; + template?: string; + } + } + + + /////////////////////////////////////////////////////////////////////////// + // Navbar + // see http://mgcrea.github.io/angular-strap/#/navbars + /////////////////////////////////////////////////////////////////////////// + + module navbar { + + interface INavbarProvider { + defaults: INavbarOptions; + } + + interface INavbarOptions { + activeClass?: string; + routeAttr?: string; + } + + interface INavbarService { + defaults: INavbarOptions; + } + } + + + /////////////////////////////////////////////////////////////////////////// + // Scrollspy + // see http://mgcrea.github.io/angular-strap/#/scrollspy + /////////////////////////////////////////////////////////////////////////// + + module scrollspy { + + interface IScrollspyProvider { + defaults: IScrollspyOptions; + } + + interface IScrollspyService { + (element: ng.IAugmentedJQuery, options: IScrollspyOptions): IScrollspy; + } + + interface IScrollspy { + checkOffsets: () => void; + trackElement: (target: any, source: any) => void; + untrackElement: (target: any, source: any) => void; + activate: (index: number) => void; + } + + interface IScrollspyOptions { + target?: string; + offset?: number; + } + } + + + /////////////////////////////////////////////////////////////////////////// + // Affix + // see http://mgcrea.github.io/angular-strap/#/affix + /////////////////////////////////////////////////////////////////////////// + + module affix { + + interface IAffixProvider { + defaults: IAffixOptions; + } + + interface IAffixService { + (element: ng.IAugmentedJQuery, options: IAffixOptions): IAffix; + } + + interface IAffix { + init: () => void; + destroy: () => void; + checkPositionWithEventLoop: () => void; + checkPosition: () => void; + } + + interface IAffixOptions { + offsetTop?: number; + offsetBottom?: number; + offsetParent?: number; + offsetUnpin?: number; + } + } +} diff --git a/angular-toastr/angular-toastr-tests.ts b/angular-toastr/angular-toastr-tests.ts new file mode 100644 index 000000000..e5701746f --- /dev/null +++ b/angular-toastr/angular-toastr-tests.ts @@ -0,0 +1,64 @@ +/// +/// + + +angular + .module('toastr-tests', ['toastr']) + .config(function(toastrConfig: angular.toastr.IToastrConfig) { + let toastContainerConfig: angular.toastr.IToastContainerConfig = { + autoDismiss: false, + containerId: 'toast-container', + maxOpened: 0, + newestOnTop: true, + positionClass: 'toast-top-right', + preventDuplicates: false, + preventOpenDuplicates: false, + target: 'body' + }, + toastConfig: angular.toastr.IToastConfig = { + allowHtml: false, + closeButton: false, + closeHtml: '', + extendedTimeOut: 1000, + iconClasses: { + error: 'toast-error', + info: 'toast-info', + success: 'toast-success', + warning: 'toast-warning' + }, + messageClass: 'toast-message', + onHidden: null, + onShown: null, + onTap: null, + progressBar: false, + tapToDismiss: true, + templates: { + + toast: 'directives/toast/toast.html', + progressbar: 'directives/progressbar/progressbar.html' + }, + timeOut: 5000, + titleClass: 'toast-title', + toastClass: 'toast' + }; + + angular.extend(toastrConfig, toastContainerConfig, toastConfig); + }) + .controller('ToastrController', function(toastr: angular.toastr.IToastrService) { + toastr.info(' Success!', 'With HTML', { + allowHtml: true + }); + + toastr.success('What a nice button', 'Button spree', { + closeButton: true + }); + + toastr.info('What a nice apple button', 'Button spree', { + closeButton: true, + closeHtml: '' + }); + + toastr.info('I am totally custom!', 'Happy toast', { + iconClass: 'toast-pink' + }); + }); \ No newline at end of file diff --git a/angular-toastr/angular-toastr.d.ts b/angular-toastr/angular-toastr.d.ts new file mode 100644 index 000000000..698b88634 --- /dev/null +++ b/angular-toastr/angular-toastr.d.ts @@ -0,0 +1,121 @@ +// Type definitions for Angular Toastr v1.6.0 +// Project: https://github.com/Foxandxss/angular-toastr +// Definitions by: Niko Kovačič +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "angular-toastr" { + var _: string; + export = _; +} + +declare module angular.toastr { + interface IToastBaseConfig { + allowHtml?: boolean; + closeButton?: boolean; + closeHtml?: string; + extendedTimeOut?: number; + messageClass?: string; + onHidden?: Function; + onShown?: Function; + onTap?: Function; + progressBar?: boolean; + tapToDismiss?: boolean; + templates?: { + toast?: string; + progressbar?: string; + }; + timeOut?: number; + titleClass?: string; + toastClass?: string; + } + + interface IToastContainerConfig { + autoDismiss?: boolean; + containerId?: string; + maxOpened?: number; + newestOnTop?: boolean; + positionClass?: string; + preventDuplicates?: boolean; + preventOpenDuplicates?: boolean; + target?: string; + } + + interface IToastConfig extends IToastBaseConfig { + iconClasses?: { + error?: string; + info?: string; + success?: string; + warning?: string; + }; + } + + interface IToastrConfig extends IToastContainerConfig, IToastConfig { } + + interface IToastScope extends angular.IScope { + message: string; + options: IToastConfig; + title: string; + toastId: number; + toastType: string; + } + + interface IToast { + el: angular.IAugmentedJQuery; + iconClass: string; + isOpened: boolean; + open: angular.IPromise; + scope: IToastScope; + toastId: number; + } + + interface IToastOptions extends IToastBaseConfig { + iconClass?: string; + } + + interface IToastrService { + /** + * Return the number of active toasts in screen. + */ + active(): number; + /** + * Remove toast from screen. If no toast is passed in, all toasts will be closed. + * + * @param {IToast} toast Optional toast object to delete + */ + clear(toast?: IToast): void; + /** + * Create error toast notification message. + * + * @param {String} message Message to show on toast + * @param {String} title Title to show on toast + * @param {IToastOptions} options Override default toast options + */ + error(message: string, title?: string, options?: IToastOptions): IToast; + /** + * Create info toast notification message. + * + * @param {String} message Message to show on toast + * @param {String} title Title to show on toast + * @param {IToastOptions} options Override default toast options + */ + info(message: string, title?: string, options?: IToastOptions): IToast; + /** + * Create success toast notification message. + * + * @param {String} message Message to show on toast + * @param {String} title Title to show on toast + * @param {IToastOptions} options Override default toast options + */ + success(message: string, title?: string, options?: IToastOptions): IToast; + /** + * Create warning toast notification message. + * + * @param {String} message Message to show on toast + * @param {String} title Title to show on toast + * @param {IToastOptions} options Override default toast options + */ + warning(message: string, title?: string, options?: IToastOptions): IToast; + } +} \ No newline at end of file diff --git a/angular-translate/angular-translate-tests.ts b/angular-translate/angular-translate-tests.ts index c60247f42..8ef1ab2e3 100644 --- a/angular-translate/angular-translate-tests.ts +++ b/angular-translate/angular-translate-tests.ts @@ -26,6 +26,7 @@ app.config(($translateProvider: angular.translate.ITranslateProvider) => { $translateProvider.preferredLanguage('en'); $translateProvider.useLoader('customLoader'); + $translateProvider.forceAsyncReload(true); }); interface Scope extends ng.IScope { @@ -36,4 +37,9 @@ app.controller('Ctrl', ($scope: Scope, $translate: angular.translate.ITranslateS $scope['changeLanguage'] = function (key: any) { $translate.use(key); }; +}).run(($filter: ng.IFilterService) => { + var x: string; + x = $filter('translate')('something'); + x = $filter('translate')('something', {}); + x = $filter('translate')('something', {}, ''); }); diff --git a/angular-translate/angular-translate.d.ts b/angular-translate/angular-translate.d.ts index e4f69c688..379bd05ec 100644 --- a/angular-translate/angular-translate.d.ts +++ b/angular-translate/angular-translate.d.ts @@ -6,8 +6,8 @@ /// declare module "angular-translate" { - var _: string; - export = _; + import ngt = angular.translate; + export = ngt; } declare module angular.translate { @@ -22,7 +22,7 @@ declare module angular.translate { interface IStorage { get(name: string): string; - set(name: string, value: string): void; + put(name: string, value: string): void; } interface IStaticFilesLoaderOptions { @@ -87,6 +87,7 @@ declare module angular.translate { fallbackLanguage(): ITranslateProvider; fallbackLanguage(language: string): ITranslateProvider; fallbackLanguage(languages: string[]): ITranslateProvider; + forceAsyncReload(value: boolean): ITranslateProvider; use(): string; use(key: string): ITranslateProvider; storageKey(): string; @@ -108,3 +109,11 @@ declare module angular.translate { useLoaderCache(cache?: any): ITranslateProvider; } } + +declare module angular { + interface IFilterService { + (name:'translate'): { + (translationId: string, interpolateParams?: any, interpolation?: string): string; + }; + } +} diff --git a/angular-ui-router/angular-ui-router-tests.ts b/angular-ui-router/angular-ui-router-tests.ts index 3211faee5..07711b9b8 100644 --- a/angular-ui-router/angular-ui-router-tests.ts +++ b/angular-ui-router/angular-ui-router-tests.ts @@ -177,8 +177,13 @@ class UrlLocatorTestService implements IUrlLocatorTestService { if (this.$state.href("myState") === "/myState") { // } - this.$state.get("myState"); this.$state.get(); + this.$state.get("myState"); + this.$state.get("myState", "yourState"); + this.$state.get("myState", this.$state.current); + this.$state.get(this.$state.current); + this.$state.get(this.$state.current, "yourState"); + this.$state.get(this.$state.current, this.$state.current); this.$state.reload(); // http://angular-ui.github.io/ui-router/site/#/api/ui.router.state.$state#properties @@ -230,7 +235,7 @@ module UrlRouterProviderTests { // this allows you to configure custom behavior in between // location changes and route synchronization: $urlRouterProvider.deferIntercept(); - }).run(($rootScope: ng.IRootScopeService, $urlRouter: ng.ui.IUrlRouterService, UserService: ITestUserService) => { + }).run(($rootScope: ng.IRootScopeService, $urlRouter: ng.ui.IUrlRouterService, UserService: ITestUserService, $urlMatcher: ng.ui.IUrlMatcher) => { $rootScope.$on('$locationChangeSuccess', e => { // UserService is an example service for managing user state if (UserService.isLoggedIn()) return; @@ -245,6 +250,18 @@ module UrlRouterProviderTests { }); // Configures $urlRouter's listener *after* your custom listener - $urlRouter.listen(); + var listen: Function = $urlRouter.listen(); + + var href: string; + href = $urlRouter.href($urlMatcher); + href = $urlRouter.href($urlMatcher, {}); + href = $urlRouter.href($urlMatcher, {}, {}); + + $urlRouter.update(); + $urlRouter.update(false); + + $urlRouter.push($urlMatcher); + $urlRouter.push($urlMatcher, {}); + $urlRouter.push($urlMatcher, {}, {}); }); } diff --git a/angular-ui-router/angular-ui-router.d.ts b/angular-ui-router/angular-ui-router.d.ts index 014baf5ac..d5a52ff73 100644 --- a/angular-ui-router/angular-ui-router.d.ts +++ b/angular-ui-router/angular-ui-router.d.ts @@ -5,10 +5,27 @@ /// -// Support for AMD require +// Support for AMD require and CommonJS declare module 'angular-ui-router' { - var _: string; - export = _; + // Since angular-ui-router adds providers for a bunch of + // injectable dependencies, it doesn't really return any + // actual data except the plain string 'ui.router'. + // + // As such, I don't think anybody will ever use the actual + // default value of the module. So I've only included the + // the types. (@xogeny) + export type IState = angular.ui.IState; + export type IStateProvider = angular.ui.IStateProvider; + export type IUrlMatcher = angular.ui.IUrlMatcher; + export type IUrlRouterProvider = angular.ui.IUrlRouterProvider; + export type IStateOptions = angular.ui.IStateOptions; + export type IHrefOptions = angular.ui.IHrefOptions; + export type IStateService = angular.ui.IStateService; + export type IResolvedState = angular.ui.IResolvedState; + export type IStateParamsService = angular.ui.IStateParamsService; + export type IUrlRouterService = angular.ui.IUrlRouterService; + export type IUiViewScrollProvider = angular.ui.IUiViewScrollProvider; + export type IType = angular.ui.IType; } declare module angular.ui { @@ -240,11 +257,15 @@ declare module angular.ui { transitionTo(state: string, params?: {}, options?: IStateOptions): angular.IPromise; transitionTo(state: IState, params?: {}, options?: IStateOptions): angular.IPromise; includes(state: string, params?: {}): boolean; + includes(state: string, params?: {}, options?:any): boolean; is(state:string, params?: {}): boolean; is(state: IState, params?: {}): boolean; href(state: IState, params?: {}, options?: IHrefOptions): string; href(state: string, params?: {}, options?: IHrefOptions): string; - get(state: string): IState; + get(state: string, context?: string): IState; + get(state: IState, context?: string): IState; + get(state: string, context?: IState): IState; + get(state: IState, context?: IState): IState; get(): IState[]; /** A reference to the state's config object. However you passed it in. Useful for accessing custom data. */ current: IState; @@ -283,7 +304,10 @@ declare module angular.ui { * */ sync(): void; - listen(): void; + listen(): Function; + href(urlMatcher: IUrlMatcher, params?: IStateParamsService, options?: IHrefOptions): string; + update(read?: boolean): void; + push(urlMatcher: IUrlMatcher, params?: IStateParamsService, options?: IHrefOptions): void; } interface IUiViewScrollProvider { diff --git a/angular-ui-tree/angular-ui-tree-tests.ts b/angular-ui-tree/angular-ui-tree-tests.ts index e66408814..718fada2c 100644 --- a/angular-ui-tree/angular-ui-tree-tests.ts +++ b/angular-ui-tree/angular-ui-tree-tests.ts @@ -11,3 +11,73 @@ var treeNode2: AngularUITree.ITreeNode = { nodes: [treeNode], title: "test2" }; + +// fake jquery node here so that we can pull a pretend +// angular scope element out of it +var dummyJQueryNode: ng.IAugmentedJQuery; +var fakeScope: (ng.IScope | AngularUITree.IParentTreeNodeScope) = dummyJQueryNode.scope(); + +( fakeScope).node = treeNode; + +var treeNodeScope: AngularUITree.ITreeNodeScope = fakeScope; + +( fakeScope).isParent = (nodeScope: AngularUITree.ITreeNodeScope) => { + return true; +}; + +var parentTreeNodeScope: AngularUITree.IParentTreeNodeScope = fakeScope; + +var eventSourceInfo: AngularUITree.IEventSourceInfo = { + cloneModel: {}, + nodeScope: treeNodeScope, + index: 0, + nodesScope: parentTreeNodeScope +}; + +var position: AngularUITree.IPosition = { + dirAx: 0, + dirX: 0, + dirY: 0, + distAxX: 0, + distAxY: 0, + distX: 0, + distY: 0, + lastDirX: 0, + lastDirY: 0, + lastX: 0, + lastY: 0, + moving: true, + nowX: 0, + nowY: 0, + offsetX: 0, + offsetY: 0, + startX: 0, + startY: 0 + +}; + +var eventInfo: AngularUITree.IEventInfo = { + source: eventSourceInfo, + dest: { + index: 0, + nodesScope: parentTreeNodeScope + }, + elements: {}, + pos: position +}; + +var acceptCallback: AngularUITree.IAcceptCallback = (source: AngularUITree.ITreeNodeScope, + destination: AngularUITree.ITreeNodeScope, + destinationIndex: number) => { + return false; +}; + +var droppedCallback: AngularUITree.IDroppedCallback = (eventInfo: AngularUITree.IEventInfo) => { + return; +}; + +var callbacks: AngularUITree.ICallbacks = { + accept: acceptCallback, + dragStart: droppedCallback, + dropped: droppedCallback +}; diff --git a/angular-ui-tree/angular-ui-tree.d.ts b/angular-ui-tree/angular-ui-tree.d.ts index 1017ac11c..cfcb2b108 100644 --- a/angular-ui-tree/angular-ui-tree.d.ts +++ b/angular-ui-tree/angular-ui-tree.d.ts @@ -3,7 +3,72 @@ // Definitions by: Calvin Fernandez // Definitions: https://github.com/borisyankov/DefinitelyTyped +/// + declare module AngularUITree { + interface IEventSourceInfo { + cloneModel: any; + index: number; + nodeScope: ITreeNodeScope; + nodesScope: ITreeNodeScope; + } + + interface IPosition { + dirAx: number; + dirX: number; + dirY: number; + distAxX: number; + distAxY: number; + distX: number; + distY: number; + lastDirX: number; + lastDirY: number; + lastX: number; + lastY: number; + moving: boolean; + nowX: number; + nowY: number; + offsetX: number; + offsetY: number; + startX: number; + startY: number; + } + + interface IEventInfo { + dest: { + index: number; + nodesScope: IParentTreeNodeScope; + }; + elements: any; + pos: IPosition; + source: IEventSourceInfo; + } + + interface IAcceptCallback { + (source: ITreeNodeScope, destination: ITreeNodeScope, destinationIndex: number): boolean; + } + + interface IDroppedCallback { + (eventInfo: IEventInfo): void; + } + + interface ICallbacks { + accept: IAcceptCallback; + dragStart: IDroppedCallback; + dropped: IDroppedCallback; + } + + /** + * Internal representation of node in the UI + */ + interface ITreeNodeScope extends ng.IScope { + node: ITreeNode; + } + + interface IParentTreeNodeScope extends ITreeNodeScope { + isParent(nodeScope: ITreeNodeScope): boolean; + } + /** * Node in list */ diff --git a/angular-wizard/angular-wizard-tests.ts b/angular-wizard/angular-wizard-tests.ts index 61ad7a484..05a5d574f 100644 --- a/angular-wizard/angular-wizard-tests.ts +++ b/angular-wizard/angular-wizard-tests.ts @@ -1,68 +1,114 @@ /// /// +/// /// // test file taken from https://github.com/mgonto/angular-wizard -interface WizardScope extends ng.IScope { - referenceCurrentStep:string; - stepValidation:()=>void; - finishedWizard:()=>void; - enterValidation:()=>void; +interface IWizardScope extends ng.IScope { + referenceCurrentStep: string; + stepValidation: () => void; + finishedWizard: () => void; + enterValidation: () => void; + exitValidation: boolean; + dynamicStepDisabled: string; } describe('AngularWizard', function () { - var $compile:ng.ICompileService, - $rootScope:ng.IRootScopeService, WizardHandler:angular.mgoAngularWizard.WizardHandler, scope:WizardScope; + var $compile: ng.ICompileService, + $q: ng.IQService, + $rootScope: ng.IRootScopeService, + $timeout: ng.ITimeoutService, + WizardHandler: angular.mgoAngularWizard.WizardHandler; + + beforeEach(() => angular.module('mgo-angular-wizard')); + + beforeEach(inject(function (_$compile_: ng.ICompileService, + _$q_: ng.IQService, + _$rootScope_: ng.IRootScopeService, + _$timeout_: ng.ITimeoutService, + _WizardHandler_: angular.mgoAngularWizard.WizardHandler) { + $compile = _$compile_; + $q = _$q_; + $rootScope = _$rootScope_; + $timeout = _$timeout_; + WizardHandler = _WizardHandler_; + })); /** - * Create the view with wizard to test + * Create the generic view with wizard to test * @param {Scope} scope A scope to bind to * @return {[DOM element]} A DOM element compiled */ - function createView(scope:WizardScope) { + function createGenericView(scope: IWizardScope) { scope.referenceCurrentStep = null; var element = angular.element('' - + ' ' - + '

This is the first step

' - + '

Here you can use whatever you want. You can use other directives, binding, etc.

' - + ' ' - + '
' - + ' ' - + '

Continuing

' - + '

You have continued here!

' - + ' ' - + '
' - + ' ' - + '

Even more steps!!

' - + ' ' - + '
' - + '
'); + + ' ' + + '

This is the first step

' + + '

Here you can use whatever you want. You can use other directives, binding, etc.

' + + ' ' + + '
' + + ' ' + + '

Dynamic {{dynamicStepDisabled}}

' + + '

You have continued here!

' + + ' ' + + '
' + + ' ' + + '

Continuing

' + + '

You have continued here!

' + + ' ' + + '
' + + ' ' + + '

Even more steps!!

' + + ' ' + + '
' + + ''); var elementCompiled = $compile(element)(scope); $rootScope.$digest(); return elementCompiled; } it("should correctly create the wizard", function () { - var view = createView(scope); + var scope = $rootScope.$new(); + var view = createGenericView(scope); expect(WizardHandler).toBeTruthy(); - expect(view.find('section').length).toEqual(3); + expect(view.find('section').length).toEqual(4); // expect the correct step to be desirable one expect(scope.referenceCurrentStep).toEqual('Starting'); }); - it("should go to the next step", function () { - var view = createView(scope); + var scope = $rootScope.$new(); + var view = createGenericView(scope); + expect(scope.referenceCurrentStep).toEqual('Starting'); + WizardHandler.wizard().next(); + $rootScope.$digest(); + expect(scope.referenceCurrentStep).toEqual('Dynamic'); + }); + it("should render only those steps which are enabled", function () { + var scope =$rootScope.$new(); + scope.dynamicStepDisabled = 'Y'; + var view = createGenericView(scope); expect(scope.referenceCurrentStep).toEqual('Starting'); WizardHandler.wizard().next(); $rootScope.$digest(); expect(scope.referenceCurrentStep).toEqual('Continuing'); }); + it("should enable or disable dynamic steps based on conditions", function () { + var scope = $rootScope.$new(); + var view = createGenericView(scope); + expect(scope.referenceCurrentStep).toEqual('Starting'); + scope.dynamicStepDisabled = 'Y'; + $rootScope.$digest(); + WizardHandler.wizard().goTo(2); + $rootScope.$digest(); + expect(scope.referenceCurrentStep).toEqual('More steps'); + }); it("should return to a previous step", function () { - - var view = createView(scope); + var scope = $rootScope.$new(); + scope.dynamicStepDisabled = 'Y'; + var view = createGenericView(scope); expect(scope.referenceCurrentStep).toEqual('Starting'); WizardHandler.wizard().next(); $rootScope.$digest(); @@ -72,24 +118,27 @@ describe('AngularWizard', function () { expect(scope.referenceCurrentStep).toEqual('Starting'); }); it("should go to a step specified by name", function () { - - var view = createView(scope); + var scope = $rootScope.$new(); + scope.dynamicStepDisabled = 'Y'; + var view = createGenericView(scope); expect(scope.referenceCurrentStep).toEqual('Starting'); WizardHandler.wizard().goTo('More steps'); $rootScope.$digest(); expect(scope.referenceCurrentStep).toEqual('More steps'); }); it("should go to a step specified by index", function () { - - var view = createView(scope); + var scope = $rootScope.$new(); + scope.dynamicStepDisabled = 'Y'; + var view = createGenericView(scope); expect(scope.referenceCurrentStep).toEqual('Starting'); WizardHandler.wizard().goTo(2); $rootScope.$digest(); expect(scope.referenceCurrentStep).toEqual('More steps'); }); it("should go to next step becasue callback is truthy", function () { - - var view = createView(scope); + var scope = $rootScope.$new(); + scope.dynamicStepDisabled = 'Y'; + var view = createGenericView(scope); expect(scope.referenceCurrentStep).toEqual('Starting'); WizardHandler.wizard().next(function () { return true @@ -98,8 +147,9 @@ describe('AngularWizard', function () { expect(scope.referenceCurrentStep).toEqual('Continuing'); }); it("should NOT go to next step because callback is falsey", function () { - - var view = createView(scope); + var scope = $rootScope.$new(); + scope.dynamicStepDisabled = 'Y'; + var view = createGenericView(scope); expect(scope.referenceCurrentStep).toEqual('Starting'); WizardHandler.wizard().next(function () { return false @@ -108,16 +158,18 @@ describe('AngularWizard', function () { expect(scope.referenceCurrentStep).toEqual('Starting'); }); it("should go to next step because CANEXIT is UNDEFINED", function () { - - var view = createView(scope); + var scope = $rootScope.$new(); + scope.dynamicStepDisabled = 'Y'; + var view = createGenericView(scope); expect(scope.referenceCurrentStep).toEqual('Starting'); WizardHandler.wizard().next(); $rootScope.$digest(); expect(scope.referenceCurrentStep).toEqual('Continuing'); }); it("should go to next step because CANEXIT is TRUE", function () { - - var view = createView(scope); + var scope = $rootScope.$new(); + scope.dynamicStepDisabled = 'Y'; + var view = createGenericView(scope); scope.stepValidation = function () { return true; }; @@ -130,8 +182,9 @@ describe('AngularWizard', function () { expect(scope.referenceCurrentStep).toEqual('More steps'); }); it("should NOT go to next step because CANEXIT is FALSE", function () { - - var view = createView(scope); + var scope = $rootScope.$new(); + scope.dynamicStepDisabled = 'Y'; + var view = createGenericView(scope); scope.stepValidation = function () { return false; }; @@ -144,8 +197,9 @@ describe('AngularWizard', function () { expect(scope.referenceCurrentStep).toEqual('Continuing'); }); it("should go to next step because CANENTER is TRUE", function () { - - var view = createView(scope); + var scope = $rootScope.$new(); + scope.dynamicStepDisabled = 'Y'; + var view = createGenericView(scope); scope.enterValidation = function () { return true; }; @@ -158,8 +212,9 @@ describe('AngularWizard', function () { expect(scope.referenceCurrentStep).toEqual('More steps'); }); it("should NOT go to next step because CANENTER is FALSE", function () { - - var view = createView(scope); + var scope = $rootScope.$new(); + scope.dynamicStepDisabled = 'Y'; + var view = createGenericView(scope); scope.enterValidation = function () { return false; }; @@ -172,8 +227,9 @@ describe('AngularWizard', function () { expect(scope.referenceCurrentStep).toEqual('Continuing'); }); it("should NOT return to a previous step. Although CANEXIT is false and we are heading to a previous state, the can enter validation is false", function () { - - var view = createView(scope); + var scope = $rootScope.$new(); + scope.dynamicStepDisabled = 'Y'; + var view = createGenericView(scope); scope.stepValidation = function () { return false; }; @@ -189,8 +245,9 @@ describe('AngularWizard', function () { expect(scope.referenceCurrentStep).toEqual('Continuing'); }); it("should return to a previous step even though CANEXIT is false", function () { - - var view = createView(scope); + var scope = $rootScope.$new(); + scope.dynamicStepDisabled = 'Y'; + var view = createGenericView(scope); scope.stepValidation = function () { return false; }; @@ -202,17 +259,66 @@ describe('AngularWizard', function () { $rootScope.$digest(); expect(scope.referenceCurrentStep).toEqual('Starting'); }); - it("should finish", function () { - - var flag = false; - scope.finishedWizard = function () { - flag = true; + it("should go to the next step because the promise that CANENTER returns resolves to true", function (done) { + var scope = $rootScope.$new(); + scope.dynamicStepDisabled = 'Y'; + var view = createGenericView(scope); + scope.enterValidation = function () { + var deferred = $q.defer(); + $timeout(function () { + deferred.resolve(true); + done(); + }); + return deferred.promise; }; - var view = createView(scope); + expect(scope.referenceCurrentStep).toEqual('Starting'); + WizardHandler.wizard().next(); + $rootScope.$digest(); + expect(scope.referenceCurrentStep).toEqual('Continuing'); + WizardHandler.wizard().next(); + $timeout.flush(); + expect(scope.referenceCurrentStep).toEqual('More steps'); + }); + it("should go to the next step because CANEXIT is set to true", function () { + var scope = $rootScope.$new(); + scope.dynamicStepDisabled = 'Y'; + var view = createGenericView(scope); + scope.exitValidation = true; + expect(scope.referenceCurrentStep).toEqual('Starting'); + WizardHandler.wizard().next(); + $rootScope.$digest(); + expect(scope.referenceCurrentStep).toEqual('Continuing'); + WizardHandler.wizard().next(); + $rootScope.$digest(); + expect(scope.referenceCurrentStep).toEqual('More steps'); + }); + it("should finish", function () { + var scope = $rootScope.$new(); + scope.dynamicStepDisabled = 'Y'; + var flag = false; + scope.finishedWizard = function () { flag = true; }; + var view = createGenericView(scope); expect(scope.referenceCurrentStep).toEqual('Starting'); WizardHandler.wizard().finish(); expect(flag).toBeTruthy(); $rootScope.$digest(); }); + it("should go to first step when reset is called", function () { + var scope = $rootScope.$new(); + scope.dynamicStepDisabled = 'Y'; + var view = createGenericView(scope); + expect(scope.referenceCurrentStep).toEqual('Starting'); + WizardHandler.wizard().goTo(2); + $rootScope.$digest(); + expect(scope.referenceCurrentStep).toEqual('More steps'); + WizardHandler.wizard().reset(); + $rootScope.$digest(); + expect(scope.referenceCurrentStep).toEqual('Starting'); + }); + it("step description should be accessible", function () { + var scope = $rootScope.$new(); + scope.dynamicStepDisabled = 'Y'; + var view = createGenericView(scope); + expect((view.isolateScope()).steps[0].description).toEqual('Step description'); + }); }); - diff --git a/angular-wizard/angular-wizard.d.ts b/angular-wizard/angular-wizard.d.ts index f079a46c2..a854f94a0 100644 --- a/angular-wizard/angular-wizard.d.ts +++ b/angular-wizard/angular-wizard.d.ts @@ -1,21 +1,38 @@ -// Type definitions for Angular Wizard 0.4.2 +// Type definitions for Angular Wizard 0.6.1 // Project: https://github.com/mgonto/angular-wizard -// Definitions by: Marko Jurisic +// Definitions by: Marko Jurisic , Ronald Wildenberg // Definitions: https://github.com/borisyankov/DefinitelyTyped declare module angular.mgoAngularWizard { interface WizardHandler { - wizard(name?:string): Wizard; - addWizard(name:string, wizard:Wizard):void; - removeWizard(name:string):void; + wizard(name?: string): Wizard; + addWizard(name: string, wizard: Wizard): void; + removeWizard(name: string): void; } interface Wizard { - next(nextHandler?:Function):void; - previous():void; - goTo(step:number):void; - goTo(step:string):void; - finish():void; - currentStepNumber():number; + next(nextHandler?: () => boolean): void; + previous(): void; + cancel: () => void; + goTo(step: number | string): void; + finish(): void; + reset: () => void; + + addStep: (step: WzStep) => void; + currentStep: () => WzStep; + currentStepNumber(): number; + currentStepDescription: () => string; + currentStepTitle: () => string; + getEnabledSteps(): WzStep[]; + } + + interface WzStep { + canenter: (...args: any[]) => boolean; + canexit: (...args: any[]) => boolean; + description: string; + selected: boolean; + title: string; + wzData: any; + wzTitle: string; } } 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-component-router.d.ts b/angularjs/angular-component-router.d.ts new file mode 100644 index 000000000..228db1e01 --- /dev/null +++ b/angularjs/angular-component-router.d.ts @@ -0,0 +1,432 @@ +// Type definitions for Angular JS 1.5 component router +// Project: http://angularjs.org +// Definitions by: David Reher +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare module angular { + /** + * `Instruction` is a tree of {@link ComponentInstruction}s with all the information needed + * to transition each component in the app to a given route, including all auxiliary routes. + * + * `Instruction`s can be created using {@link Router#generate}, and can be used to + * perform route changes with {@link Router#navigateByInstruction}. + * + * ### Example + * + * ``` + * import {Component} from 'angular2/core'; + * import {bootstrap} from 'angular2/platform/browser'; + * import {Router, ROUTER_DIRECTIVES, ROUTER_PROVIDERS, RouteConfig} from 'angular2/router'; + * + * @Component({directives: [ROUTER_DIRECTIVES]}) + * @RouteConfig([ + * {...}, + * ]) + * class AppCmp { + * constructor(router: Router) { + * var instruction = router.generate(['/MyRoute']); + * router.navigateByInstruction(instruction); + * } + * } + * + * bootstrap(AppCmp, ROUTER_PROVIDERS); + * ``` + */ + interface Instruction { + component: ComponentInstruction; + child: Instruction; + auxInstruction: {[key: string]: Instruction}; + + urlPath(): string; + + urlParams(): string[]; + + specificity(): number; + + resolveComponent(): Promise; + + /** + * converts the instruction into a URL string + */ + toRootUrl(): string; + + toUrlQuery(): string; + + /** + * Returns a new instruction that shares the state of the existing instruction, but with + * the given child {@link Instruction} replacing the existing child. + */ + replaceChild(child: Instruction): Instruction; + + /** + * If the final URL for the instruction is `` + */ + toUrlPath(): string; + + /** + * default instructions override these + */ + toLinkUrl(): string; + } + + /** + * A router outlet is a placeholder that Angular dynamically fills based on the application's route. + * + * ## Use + * + * ``` + * + * ``` + */ + interface RouterOutlet { + name: string; + + /** + * Called by the Router to instantiate a new component during the commit phase of a navigation. + * This method in turn is responsible for calling the `routerOnActivate` hook of its child. + */ + activate(nextInstruction: ComponentInstruction): Promise; + + /** + * Called by the {@link Router} during the commit phase of a navigation when an outlet + * reuses a component between different routes. + * This method in turn is responsible for calling the `routerOnReuse` hook of its child. + */ + reuse(nextInstruction: ComponentInstruction): Promise; + + /** + * Called by the {@link Router} when an outlet disposes of a component's contents. + * This method in turn is responsible for calling the `routerOnDeactivate` hook of its child. + */ + deactivate(nextInstruction: ComponentInstruction): Promise; + + /** + * Called by the {@link Router} during recognition phase of a navigation. + * + * If this resolves to `false`, the given navigation is cancelled. + * + * This method delegates to the child component's `routerCanDeactivate` hook if it exists, + * and otherwise resolves to true. + */ + routerCanDeactivate(nextInstruction: ComponentInstruction): Promise; + + /** + * Called by the {@link Router} during recognition phase of a navigation. + * + * If the new child component has a different Type than the existing child component, + * this will resolve to `false`. You can't reuse an old component when the new component + * is of a different Type. + * + * Otherwise, this method delegates to the child component's `routerCanReuse` hook if it exists, + * or resolves to true if the hook is not present. + */ + routerCanReuse(nextInstruction: ComponentInstruction): Promise; + } + + interface RouteRegistry { + /** + * Given a component and a configuration object, add the route to this registry + */ + config(parentComponent: any, config: RouteDefinition): void; + + /** + * Reads the annotations of a component and configures the registry based on them + */ + configFromComponent(component: any): void; + + /** + * Given a URL and a parent component, return the most specific instruction for navigating + * the application into the state specified by the url + */ + recognize(url: string, ancestorInstructions: Instruction[]): Promise; + + /** + * Given a normalized list with component names and params like: `['user', {id: 3 }]` + * generates a url with a leading slash relative to the provided `parentComponent`. + * + * If the optional param `_aux` is `true`, then we generate starting at an auxiliary + * route boundary. + */ + generate(linkParams: any[], ancestorInstructions: Instruction[], _aux?: boolean): Instruction; + + hasRoute(name: string, parentComponent: any): boolean; + + generateDefault(componentCursor: any): Instruction; + } + + /** + * The `Router` is responsible for mapping URLs to components. + * + * You can see the state of the router by inspecting the read-only field `router.navigating`. + * This may be useful for showing a spinner, for instance. + * + * ## Concepts + * + * Routers and component instances have a 1:1 correspondence. + * + * The router holds reference to a number of {@link RouterOutlet}. + * An outlet is a placeholder that the router dynamically fills in depending on the current URL. + * + * When the router navigates from a URL, it must first recognize it and serialize it into an + * `Instruction`. + * The router uses the `RouteRegistry` to get an `Instruction`. + */ + interface Router { + navigating: boolean; + lastNavigationAttempt: string; + registry: RouteRegistry; + parent: Router; + hostComponent: any; + + /** + * Constructs a child router. You probably don't need to use this unless you're writing a reusable + * component. + */ + childRouter(hostComponent: any): Router; + + /** + * Constructs a child router. You probably don't need to use this unless you're writing a reusable + * component. + */ + auxRouter(hostComponent: any): Router; + + /** + * Register an outlet to be notified of primary route changes. + * + * You probably don't need to use this unless you're writing a reusable component. + */ + registerPrimaryOutlet(outlet: RouterOutlet): Promise; + + /** + * Register an outlet to notified of auxiliary route changes. + * + * You probably don't need to use this unless you're writing a reusable component. + */ + registerAuxOutlet(outlet: RouterOutlet): Promise; + + /** + * Given an instruction, returns `true` if the instruction is currently active, + * otherwise `false`. + */ + isRouteActive(instruction: Instruction): boolean; + + /** + * Dynamically update the routing configuration and trigger a navigation. + * + * ### Usage + * + * ``` + * router.config([ + * { 'path': '/', 'component': IndexComp }, + * { 'path': '/user/:id', 'component': UserComp }, + * ]); + * ``` + */ + config(definitions: RouteDefinition[]): Promise; + + /** + * Navigate based on the provided Route Link DSL. It's preferred to navigate with this method + * over `navigateByUrl`. + * + * ### Usage + * + * This method takes an array representing the Route Link DSL: + * ``` + * ['./MyCmp', {param: 3}] + * ``` + * See the {@link RouterLink} directive for more. + */ + navigate(linkParams: any[]): Promise; + + /** + * Navigate to a URL. Returns a promise that resolves when navigation is complete. + * It's preferred to navigate with `navigate` instead of this method, since URLs are more brittle. + * + * If the given URL begins with a `/`, router will navigate absolutely. + * If the given URL does not begin with `/`, the router will navigate relative to this component. + */ + navigateByUrl(url: string, _skipLocationChange?: boolean): Promise; + + /** + * Navigate via the provided instruction. Returns a promise that resolves when navigation is + * complete. + */ + navigateByInstruction(instruction: Instruction, + _skipLocationChange?: boolean): Promise; + + /** + * Updates this router and all descendant routers according to the given instruction + */ + commit(instruction: Instruction, _skipLocationChange?: boolean): Promise; + + /** + * Subscribe to URL updates from the router + */ + subscribe(onNext: (value: any) => void): Object; + + /** + * Removes the contents of this router's outlet and all descendant outlets + */ + deactivate(instruction: Instruction): Promise; + + /** + * Given a URL, returns an instruction representing the component graph + */ + recognize(url: string): Promise; + + /** + * Navigates to either the last URL successfully navigated to, or the last URL requested if the + * router has yet to successfully navigate. + */ + renavigate(): Promise; + + /** + * Generate an `Instruction` based on the provided Route Link DSL. + */ + generate(linkParams: any[]): Instruction; + } + + /** + * RouteData is an immutable map of additional data you can configure in your Route. + * You can inject RouteData into the constructor of a component to use it. + */ + interface RouteData { + data: {[key: string]: any}; + get(key: string): any; + } + + /** + * A `ComponentInstruction` represents the route state for a single component. An `Instruction` is + * composed of a tree of these `ComponentInstruction`s. + * + * `ComponentInstructions` is a public API. Instances of `ComponentInstruction` are passed + * to route lifecycle hooks, like {@link CanActivate}. + * + * `ComponentInstruction`s are [https://en.wikipedia.org/wiki/Hash_consing](hash consed). You should + * never construct one yourself with "new." Instead, rely on {@link Router/RouteRecognizer} to + * construct `ComponentInstruction`s. + * + * You should not modify this object. It should be treated as immutable. + */ + interface ComponentInstruction { + reuse: boolean; + routeData: RouteData; + urlPath: string; + urlParams: string[]; + data: RouteData; + componentType: any; + terminal: boolean; + specificity: number; + params: {[key: string]: any}; + } + + /** + * Defines route lifecycle method `routerOnActivate`, which is called by the router at the end of a + * successful route navigation. + * + * For a single component's navigation, only one of either {@link OnActivate} or {@link OnReuse} + * will be called depending on the result of {@link CanReuse}. + * + * The `routerOnActivate` hook is called with two {@link ComponentInstruction}s as parameters, the + * first + * representing the current route being navigated to, and the second parameter representing the + * previous route or `null`. + * + * If `routerOnActivate` returns a promise, the route change will wait until the promise settles to + * instantiate and activate child components. + * + * ### Example + * {@example router/ts/on_activate/on_activate_example.ts region='routerOnActivate'} + */ + interface OnActivate { + $routerOnActivate(next?: angular.ComponentInstruction, prev?: angular.ComponentInstruction): any; + } + + /** + * Defines route lifecycle method `routerCanDeactivate`, which is called by the router to determine + * if a component can be removed as part of a navigation. + * + * The `routerCanDeactivate` hook is called with two {@link ComponentInstruction}s as parameters, + * the + * first representing the current route being navigated to, and the second parameter + * representing the previous route. + * + * If `routerCanDeactivate` returns or resolves to `false`, the navigation is cancelled. If it + * returns or + * resolves to `true`, then the navigation continues, and the component will be deactivated + * (the {@link OnDeactivate} hook will be run) and removed. + * + * If `routerCanDeactivate` throws or rejects, the navigation is also cancelled. + * + * ### Example + * {@example router/ts/can_deactivate/can_deactivate_example.ts region='routerCanDeactivate'} + */ + interface CanDeactivate { + $routerCanDeactivate(next?: ComponentInstruction, prev?: ComponentInstruction): boolean | Promise; + } + + /** + * Defines route lifecycle method `routerOnDeactivate`, which is called by the router before + * destroying + * a component as part of a route change. + * + * The `routerOnDeactivate` hook is called with two {@link ComponentInstruction}s as parameters, the + * first + * representing the current route being navigated to, and the second parameter representing the + * previous route. + * + * If `routerOnDeactivate` returns a promise, the route change will wait until the promise settles. + * + * ### Example + * {@example router/ts/on_deactivate/on_deactivate_example.ts region='routerOnDeactivate'} + */ + interface OnDeactivate { + $routerOnDeactivate(next?: angular.ComponentInstruction, prev?: angular.ComponentInstruction): any; + } + + /** + * Defines route lifecycle method `routerCanReuse`, which is called by the router to determine + * whether a + * component should be reused across routes, or whether to destroy and instantiate a new component. + * + * The `routerCanReuse` hook is called with two {@link ComponentInstruction}s as parameters, the + * first + * representing the current route being navigated to, and the second parameter representing the + * previous route. + * + * If `routerCanReuse` returns or resolves to `true`, the component instance will be reused and the + * {@link OnDeactivate} hook will be run. If `routerCanReuse` returns or resolves to `false`, a new + * component will be instantiated, and the existing component will be deactivated and removed as + * part of the navigation. + * + * If `routerCanReuse` throws or rejects, the navigation will be cancelled. + * + * ### Example + * {@example router/ts/reuse/reuse_example.ts region='reuseCmp'} + */ + interface CanReuse { + $routerCanReuse(next?: angular.ComponentInstruction, prev?: angular.ComponentInstruction): boolean | Promise; + } + + /** + * Defines route lifecycle method `routerOnReuse`, which is called by the router at the end of a + * successful route navigation when {@link CanReuse} is implemented and returns or resolves to true. + * + * For a single component's navigation, only one of either {@link OnActivate} or {@link OnReuse} + * will be called, depending on the result of {@link CanReuse}. + * + * The `routerOnReuse` hook is called with two {@link ComponentInstruction}s as parameters, the + * first + * representing the current route being navigated to, and the second parameter representing the + * previous route or `null`. + * + * ### Example + * {@example router/ts/reuse/reuse_example.ts region='reuseCmp'} + */ + interface OnReuse { + $routerOnReuse(next?: angular.ComponentInstruction, prev?: angular.ComponentInstruction): any; + } +} diff --git a/angularjs/angular-resource-tests.ts b/angularjs/angular-resource-tests.ts index cfa7712cc..fcf0bd0a9 100644 --- a/angularjs/angular-resource-tests.ts +++ b/angularjs/angular-resource-tests.ts @@ -89,6 +89,9 @@ resource = resourceClass.save({ key: 'value' }, { key: 'value' }, function () { var promise : angular.IPromise; var arrayPromise : angular.IPromise; +var json: { + [index: string]: any; +}; promise = resource.$delete(); promise = resource.$delete({ key: 'value' }); @@ -127,6 +130,8 @@ promise = resource.$save(function () { }); promise = resource.$save(function () { }, function () { }); promise = resource.$save({ key: 'value' }, function () { }, function () { }); +json = resource.toJSON(); + /////////////////////////////////////// // IResourceService /////////////////////////////////////// diff --git a/angularjs/angular-resource.d.ts b/angularjs/angular-resource.d.ts index 76930196b..1e82f3154 100644 --- a/angularjs/angular-resource.d.ts +++ b/angularjs/angular-resource.d.ts @@ -5,6 +5,10 @@ /// +declare module 'angular-resource' { + var _: string; + export = _; +} /////////////////////////////////////////////////////////////////////////////// // ngResource module (angular-resource.js) @@ -136,12 +140,15 @@ declare module angular.resource { /** the promise of the original server interaction that created this instance. **/ $promise : angular.IPromise; $resolved : boolean; + toJSON: () => { + [index: string]: any; + } } /** * Really just a regular Array object with $promise and $resolve attached to it */ - interface IResourceArray extends Array { + interface IResourceArray extends Array> { /** the promise of the original server interaction that created this collection. **/ $promise : angular.IPromise>; $resolved : boolean; diff --git a/angularjs/angular-route.d.ts b/angularjs/angular-route.d.ts index 662b2c11d..eafdf714c 100644 --- a/angularjs/angular-route.d.ts +++ b/angularjs/angular-route.d.ts @@ -35,6 +35,16 @@ declare module angular.route { // May not always be available. For instance, current will not be available // to a controller that was not initialized as a result of a route maching. current?: ICurrentRoute; + + /** + * Causes $route service to update the current URL, replacing current route parameters with those specified in newParams. + * Provided property names that match the route's path segment definitions will be interpolated into the + * location's path, while remaining properties will be treated as query params. + * + * @param newParams Object. mapping of URL parameter names to values + */ + updateParams(newParams:{[key:string]:string}): void; + } @@ -118,6 +128,12 @@ declare module angular.route { } interface IRouteProvider extends IServiceProvider { + /** + * Match routes without being case sensitive + * + * This option defaults to false. If the option is set to true, then the particular route can be matched without being case sensitive + */ + caseInsensitiveMatch?: boolean; /** * Sets route definition that will be used on route change when no other route definition is matched. * diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index 040622b51..d1197dec1 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; } /////////////////////////////////////////////////////////////////////////// @@ -175,6 +181,13 @@ declare module angular { animation(name: string, animationFactory: Function): IModule; animation(name: string, inlineAnnotatedFunction: any[]): IModule; animation(object: Object): IModule; + /** + * Use this method to register a component. + * + * @param name The name of the component. + * @param options A definition object passed into the component. + */ + component(name: string, options: IComponentOptions): IModule; /** * Use this method to register work which needs to be performed on module loading. * @@ -615,7 +628,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 +787,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[]; } /** @@ -1614,6 +1627,110 @@ declare module angular { totalPendingRequests: number; } + /////////////////////////////////////////////////////////////////////////// + // Component + // see http://angularjs.blogspot.com.br/2015/11/angularjs-15-beta2-and-14-releases.html + // and http://toddmotto.com/exploring-the-angular-1-5-component-method/ + /////////////////////////////////////////////////////////////////////////// + /** + * Runtime representation a type that a Component or other object is instances of. + * + * An example of a `Type` is `MyCustomComponent` class, which in JavaScript is be represented by + * the `MyCustomComponent` constructor function. + */ + interface Type extends Function { + } + + /** + * `RouteDefinition` defines a route within a {@link RouteConfig} decorator. + * + * Supported keys: + * - `path` or `aux` (requires exactly one of these) + * - `component`, `loader`, `redirectTo` (requires exactly one of these) + * - `name` or `as` (optional) (requires exactly one of these) + * - `data` (optional) + * + * See also {@link Route}, {@link AsyncRoute}, {@link AuxRoute}, and {@link Redirect}. + */ + interface RouteDefinition { + path?: string; + aux?: string; + component?: Type | ComponentDefinition | string; + loader?: Function; + redirectTo?: any[]; + as?: string; + name?: string; + data?: any; + useAsDefault?: boolean; + } + + /** + * Represents either a component type (`type` is `component`) or a loader function + * (`type` is `loader`). + * + * See also {@link RouteDefinition}. + */ + interface ComponentDefinition { + type: string; + loader?: Function; + component?: Type; + } + + /** + * Component definition object (a simplified directive definition object) + */ + interface IComponentOptions { + /** + * Controller constructor function that should be associated with newly created scope or the name of a registered + * controller if passed as a string. Empty function by default. + */ + controller?: string | Function; + /** + * An identifier name for a reference to the controller. If present, the controller will be published to scope under + * the controllerAs name. If not present, this will default to be the same as the component name. + */ + controllerAs?: string; + /** + * html template as a string or a function that returns an html template as a string which should be used as the + * contents of this component. Empty string by default. + * If template is a function, then it is injected with the following locals: + * $element - Current element + * $attrs - Current attributes object for the element + */ + template?: string | Function; + /** + * path or function that returns a path to an html template that should be used as the contents of this component. + * If templateUrl is a function, then it is injected with the following locals: + * $element - Current element + * $attrs - Current attributes object for the element + */ + templateUrl?: string | Function; + /** + * Define DOM attribute binding to component properties. Component properties are always bound to the component + * controller and not to the scope. + */ + bindings?: any; + /** + * Whether transclusion is enabled. Enabled by default. + */ + transclude?: boolean; + /** + * Whether the new scope is isolated. Isolated by default. + */ + isolate?: boolean; + /** + * String of subset of EACM which restricts the component to specific directive declaration style. If omitted, + * this defaults to 'E'. + */ + restrict?: string; + $canActivate?: () => boolean; + $routeConfig?: RouteDefinition[]; + } + + interface IComponentTemplateFn { + ( $element?: IAugmentedJQuery, $attrs?: IAttributes ): string; + } + /////////////////////////////////////////////////////////////////////////// // Directive // see http://docs.angularjs.org/api/ng.$compileProvider#directive @@ -1660,6 +1777,7 @@ declare module angular { restrict?: string; scope?: any; template?: any; + templateNamespace?: string; templateUrl?: any; terminal?: boolean; transclude?: any; @@ -1758,6 +1876,7 @@ declare module angular { provider(name: string, provider: IServiceProvider): IServiceProvider; provider(name: string, serviceProviderConstructor: Function): IServiceProvider; service(name: string, constructor: Function): IServiceProvider; + service(name: string, inlineAnnotatedFunction: any[]): IServiceProvider; value(name: string, value: any): IServiceProvider; } diff --git a/angularjs/legacy/angular-cookies-1.0.d.ts b/angularjs/legacy/angular-cookies-1.0.d.ts index b451dc431..546affdea 100644 --- a/angularjs/legacy/angular-cookies-1.0.d.ts +++ b/angularjs/legacy/angular-cookies-1.0.d.ts @@ -1,4 +1,4 @@ -/// Type definitions for Angular JS 1.0 (ngCookies module) +// Type definitions for Angular JS 1.0 (ngCookies module) // Project: http://angularjs.org // Definitions by: Diego Vilar // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/angularjs/legacy/angular-scenario-1.0.d.ts b/angularjs/legacy/angular-scenario-1.0.d.ts index a44b79096..af8a1e204 100644 --- a/angularjs/legacy/angular-scenario-1.0.d.ts +++ b/angularjs/legacy/angular-scenario-1.0.d.ts @@ -1,6 +1,6 @@ // Type definitions for Angular Scenario Testing 1.0 (ngScenario module) -// Project: [http://angularjs.org] -// Definitions by: [RomanoLindano] +// Project: http://angularjs.org +// Definitions by: RomanoLindano // Definitions: https://github.com/borisyankov/DefinitelyTyped declare module angularScenario { diff --git a/angulartics/angulartics.d.ts b/angulartics/angulartics.d.ts index edb9aefb3..fdcb409ca 100644 --- a/angulartics/angulartics.d.ts +++ b/angulartics/angulartics.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Angulartics v0.19.2 +// Type definitions for Angulartics v0.20.2 // Project: http://luisfarzati.github.io/angulartics/ // Definitions by: Steven Fan // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -21,6 +21,7 @@ declare module angulartics { interface IAnalyticsServiceProvider extends angular.IServiceProvider { virtualPageviews(value: boolean): void; + excludeRoutes(value: string[]): void; firstPageview(value: boolean): void; withBase(value: boolean): void; withAutoBase(value: boolean): void; diff --git a/any-db/any-db.d.ts b/any-db/any-db.d.ts index 04817623a..f14befb20 100644 --- a/any-db/any-db.d.ts +++ b/any-db/any-db.d.ts @@ -50,7 +50,7 @@ declare module "any-db" { /** * Result rows */ - rows: Object[]; + rows: any[]; /** * Result field descriptions */ 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/api-error-handler/api-error-handler-tests.ts b/api-error-handler/api-error-handler-tests.ts index 83df91e86..fc92cf9a7 100644 --- a/api-error-handler/api-error-handler-tests.ts +++ b/api-error-handler/api-error-handler-tests.ts @@ -1,7 +1,7 @@ /// -import errorHandler = require('api-error-handler'); -import express = require('express'); +import * as errorHandler from 'api-error-handler'; +import * as express from 'express'; var api = express.Router(); api.get('/users/:userid', function (req, res, next) { @@ -9,3 +9,5 @@ api.get('/users/:userid', function (req, res, next) { }); api.use(errorHandler()); + +let res: errorHandler.Response; diff --git a/api-error-handler/api-error-handler.d.ts b/api-error-handler/api-error-handler.d.ts index 61a63825d..90318acd0 100644 --- a/api-error-handler/api-error-handler.d.ts +++ b/api-error-handler/api-error-handler.d.ts @@ -6,7 +6,23 @@ /// declare module 'api-error-handler' { - import express = require('express'); + import * as express from 'express'; + + namespace apiErrorHandler { + + // Body response: the JSON returned by api-error-handler + // See https://github.com/expressjs/api-error-handler/blob/1.0.0/index.js + interface Response { + status: number; + stack?: string; + message: string; + + // Client errors + code?: any; + name?: string; + type?: any; + } + } function apiErrorHandler(options?: any): express.ErrorRequestHandler; diff --git a/applicationinsights/applicationinsights-tests.ts b/applicationinsights/applicationinsights-tests.ts index 871a029e8..eb9d5e701 100644 --- a/applicationinsights/applicationinsights-tests.ts +++ b/applicationinsights/applicationinsights-tests.ts @@ -1,5 +1,5 @@ /// -import appInsights = require("applicationinsights"); +import * as appInsights from "applicationinsights"; // basic use appInsights.setup("").start(); @@ -18,8 +18,14 @@ 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 = { environment: "dev" }; + +// send any pending data and log the response +appInsights.client.sendPendingData(function (response) { + console.log(response); +}); diff --git a/applicationinsights/applicationinsights.d.ts b/applicationinsights/applicationinsights.d.ts index 12dffdd81..d5c895466 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.8 // Project: https://github.com/Microsoft/ApplicationInsights-node.js // Definitions by: Scott Southwood // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -342,10 +342,23 @@ 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. */ - sendPendingData(): void; + sendPendingData(callback?: (response: string) => void): void; getEnvelope(data: ContractsModule.Data, tagOverrides?: { [key: string]: string; }): ContractsModule.Envelope; @@ -396,66 +409,58 @@ interface Sender { * The singleton meta interface for the default client of the client. This interface is used to setup/start and configure * the auto-collection behavior of the application insights module. */ -declare class ApplicationInsights { - static client: Client; - private static _isConsole; - private static _isExceptions; - private static _isPerformance; - private static _isRequests; - private static _console; - private static _exceptions; - private static _performance; - private static _requests; - private static _isStarted; +interface ApplicationInsights { + client: Client; /** * Initializes a client with the given instrumentation key, if this is not specified, the value will be * read from the environment variable APPINSIGHTS_INSTRUMENTATIONKEY * @returns {ApplicationInsights/Client} a new client */ - static getClient(instrumentationKey?: string): Client; + getClient(instrumentationKey?: string): Client; /** * Initializes the default client of the client and sets the default configuration * @param instrumentationKey the instrumentation key to use. Optional, if this is not specified, the value will be * read from the environment variable APPINSIGHTS_INSTRUMENTATIONKEY * @returns {ApplicationInsights} this interface */ - static setup(instrumentationKey?: string): typeof ApplicationInsights; + setup(instrumentationKey?: string): ApplicationInsights; /** * Starts automatic collection of telemetry. Prior to calling start no telemetry will be collected * @returns {ApplicationInsights} this interface */ - static start(): typeof ApplicationInsights; + start(): ApplicationInsights; /** * Sets the state of console tracking (enabled by default) * @param value if true console activity will be sent to Application Insights * @returns {ApplicationInsights} this interface */ - static setAutoCollectConsole(value: boolean): typeof ApplicationInsights; + setAutoCollectConsole(value: boolean): ApplicationInsights; /** * Sets the state of exception tracking (enabled by default) * @param value if true uncaught exceptions will be sent to Application Insights * @returns {ApplicationInsights} this interface */ - static setAutoCollectExceptions(value: boolean): typeof ApplicationInsights; + setAutoCollectExceptions(value: boolean): ApplicationInsights; /** * Sets the state of performance tracking (enabled by default) * @param value if true performance counters will be collected every second and sent to Application Insights * @returns {ApplicationInsights} this interface */ - static setAutoCollectPerformance(value: boolean): typeof ApplicationInsights; + setAutoCollectPerformance(value: boolean): ApplicationInsights; /** * Sets the state of request tracking (enabled by default) * @param value if true requests will be sent to Application Insights * @returns {ApplicationInsights} this interface */ - static setAutoCollectRequests(value: boolean): typeof ApplicationInsights; + setAutoCollectRequests(value: boolean): ApplicationInsights; /** * Enables verbose debug logging * @returns {ApplicationInsights} this interface */ - static enableVerboseLogging(): typeof ApplicationInsights; + enableVerboseLogging(): ApplicationInsights; } declare module "applicationinsights" { - export = ApplicationInsights; + const applicationinsights: ApplicationInsights; + export = applicationinsights; } \ No newline at end of file diff --git a/arcgis-js-api/arcgis-js-api.d.ts b/arcgis-js-api/arcgis-js-api.d.ts index ba5e0fb9f..88d68cb19 100644 --- a/arcgis-js-api/arcgis-js-api.d.ts +++ b/arcgis-js-api/arcgis-js-api.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ArcGIS API for JavaScript v3.14 +// Type definitions for ArcGIS API for JavaScript v3.15 // Project: http://js.arcgis.com // Definitions by: Esri // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -146,7 +146,7 @@ declare module "esri" { /** Class attribute to set for the layer's node. */ className?: string; /** Lists which levels to draw. */ - displayLevels?: number; + displayLevels?: number[]; /** An array of objects that define areas where a tiled map service should not display tiles. */ exclusionAreas?: any[]; /** Id to assign to the layer. */ @@ -157,7 +157,7 @@ declare module "esri" { opacity?: number; /** Refresh interval of the layer in minutes. */ refreshInterval?: number; - /** When true, tile resampling is enabled. */ + /** The purpose of resampling is to enlarge the image and fill in at the levels where there are no tiles available. */ resampling?: boolean; /** Number of levels beyond the last level where tiles are available. */ resamplingTolerance?: number; @@ -215,6 +215,8 @@ declare module "esri" { opacity?: number; /** Specify subDomains where tiles are served to speed up tile retrieval (using subDomains gets around the browser limit of the max number of concurrent requests to a domain). */ subDomains?: string[]; + /** The URL template used to retrieve the tiles. */ + templateUrl?: string; /** Define the tile info for the layer including lods, rows, cols, origin and spatial reference. */ tileInfo?: TileInfo; /** Define additional tile server domains for the layer. */ @@ -307,19 +309,15 @@ declare module "esri" { export interface ClassedColorSliderOptions { /** Data map containing renderer information. */ breakInfos: any; - /** Classification method. */ + /** Indicates the classification method used to divide the range of values into bins. */ classificationMethod?: string; - /** Handles identified by their index values within the stops array. */ + /** Required: Handles identified by their index values within the stops array. */ handles: number[]; - /** Represents histogram data object. */ + /** Represents the histogram data object. */ histogram?: any; /** Width of the histogram in pixels. */ histogramWidth?: number; - /** Absolute maximum value of the slider. */ - maxValue?: number; - /** Absolute minimum value of the slider. */ - minValue?: number; - /** Normalization type. */ + /** Indicates how data values are normalized. */ normalizationType?: string; /** Handle identified by its index value within the stops array. */ primaryHandle?: number; @@ -333,61 +331,51 @@ declare module "esri" { showLabels?: boolean; /** Displays ticks on slider when true. */ showTicks?: boolean; - /** Represents statistics data object. */ + /** Represents the statistics data object. */ statistics?: any; } export interface ClassedSizeSliderOptions { - /** Data map containing renderer information. */ + /** The data map containing renderer information. */ breakInfos: any; - /** Classification method. */ + /** Optional: Indicates the classification method used to divide the range of values into bins. */ classificationMethod?: string; - /** Handles identified by their index values within the stops array. */ + /** Required: Handles identified by their index values within the stops array. */ handles: number[]; - /** Represents histogram data object. */ + /** Represents the histogram data object. */ histogram?: any; /** Width of histogram in pixels. */ histogramWidth?: number; - /** Absolute maximum value of the slider. */ - maxValue?: number; - /** Absolute minimum value of the slider. */ - minValue?: number; - /** Normalization type. */ + /** Indicates how data values are normalized. */ normalizationType?: string; - /** Handle identified by its index value within the stops array. */ + /** The handle identified by its index value within the stops array. */ primaryHandle?: number; /** Width of slider ramp in pixels. */ rampWidth?: number; /** Displays slider handles when true. */ showHandles?: boolean; - /** Displays the histogram when true. */ + /** Indicates whether to display the histogram. */ showHistogram?: boolean; /** Displays labels when true. */ showLabels?: boolean; /** Displays slider ticks when true. */ showTicks?: boolean; - /** Represents statistics data object. */ + /** Optional: Represents the statistics data object. */ statistics?: any; - /** Indicates whether to use a circle or line-based ClassedSizeSlider. */ - symbol?: any; } export interface ColorInfoSliderOptions { - /** Classification method. */ - classificationMethod?: string; - /** Data map containing renderer information. */ + /** The data map containing renderer information. */ colorInfo: any; /** Handles identified by their index values within the stops array. */ handles: number[]; - /** Represents histogram data object. */ + /** Optional: Represents the histogram data object. */ histogram?: any; /** Width of histogram in pixels. */ histogramWidth?: number; - /** Absolute maximum value of slider. */ + /** The absolute maximum value of the slider. */ maxValue?: number; - /** Absolute minimum value of slider. */ + /** The absolute minimum value of the slider. */ minValue?: number; - /** Normalization Type. */ - normalizationType?: string; - /** Handle identified by its index value within the stops array. */ + /** The handle identified by its index value within the stops array. */ primaryHandle?: number; /** Width of widget ramp in pixels. */ rampWidth?: number; @@ -397,13 +385,15 @@ declare module "esri" { showHistogram?: boolean; /** Displays labels when set to true. */ showLabels?: boolean; - /** Displays ticks when set to true. */ + /** Indicates whether to display percentage labels. */ + showRatioLabels?: boolean | string; + /** Displays tick marks when set to true. */ showTicks?: boolean; /** Displays transparent background when set to true. */ showTransparentBackground?: boolean; - /** Represents statistics data object. */ + /** Represents a statistics data object. */ statistics?: any; - /** Object containing additional options. */ + /** Additional options to customize slider. */ zoomOptions?: any; } export interface ColorPickerOptions { @@ -655,8 +645,6 @@ declare module "esri" { traffic?: boolean; /** The traffic layer used for real-time traffic. */ trafficLayer?: ArcGISDynamicMapServiceLayer; - /** An example of when to use this is when working with a proxied ArcGIS Online route service item with stored credentials. */ - travelModesServiceUrl?: string; } export interface DissolveBoundariesOptions { /** The URL to the GPServer used to execute an analysis job. */ @@ -718,7 +706,7 @@ declare module "esri" { /** Specifies whether users can add new vertices. */ allowAddVertices?: boolean; /** Specifies whether users can delete vertices. */ - allowDeletevertices?: boolean; + allowDeleteVertices?: boolean; /** Line symbol used to draw the guild lines, displayed when moving vertices. */ ghostLineSymbol?: LineSymbol; /** Marker symbol used to display the insertable vertices. */ @@ -859,8 +847,14 @@ declare module "esri" { cellNavigation?: boolean; /** Object defining the date options specifically for formatting date and time editors. */ dateOptions?: any; + /** Allows selection of a table's row via clicking a feature on the map. */ + enableLayerClick?: boolean; + /** Allows selection of a feature on a map via clicking row in the table. */ + enableLayerSelection?: boolean; /** The featureLayer that the table is associated with. */ featureLayer: FeatureLayer; + /** Reference to the 'Options' drop-down menu. */ + gridMenu?: any; /** Columns to hide by default using the dGrid ColumnHider extension. */ hiddenFields?: string[]; /** A reference to the Map. */ @@ -1173,8 +1167,12 @@ declare module "esri" { map: Map; /** Indicates whether to remove underscores from the layer title. */ removeUnderscores?: boolean; + /** Indicates whether to display a legend for the layer items. */ + showLegend?: boolean; + /** Indicates whether to display the opacity slider. */ + showOpacitySlider?: boolean; /** Indicates whether to show sublayers in the list of layers. */ - subLayers?: boolean; + showSubLayers?: boolean; /** The CSS class selector used to uniquely style the widget. */ theme?: string; /** Indicates whether to show the LayerList widget. */ @@ -1455,19 +1453,19 @@ declare module "esri" { export interface OpacitySliderOptions { /** Handles identified by their index values within the stops array. */ handles: number[]; - /** Represents histogram data object. */ + /** Represents the histogram data object. */ histogram?: any; /** Width of histogram in pixels. */ histogramWidth?: number; - /** Absolute maximum value of the slider. */ + /** The absolute maximum value of the slider. */ maxValue?: number; - /** Absolute minimum value of the slider. */ + /** The absolute minimum value of the slider. */ minValue?: number; - /** Data map containing renderer information. */ + /** The data map containing renderer information. */ opacityInfo: any; - /** Handle identified by its index value within the stops array. */ + /** The handle identified by its index value within the stops array. */ primaryHandle?: number; - /** Width of slider ramp in pixels. */ + /** Represents the width of the SVG ramp in pixels. */ rampWidth?: number; /** Displays slider handles when true. */ showHandles?: boolean; @@ -1479,9 +1477,9 @@ declare module "esri" { showTicks?: boolean; /** Displays the transparent background when true. */ showTransparentBackground?: boolean; - /** Represents statistics data object. */ + /** Represents a statistics data object. */ statistics?: any; - /** Additional options for slider customization. */ + /** Additional options to customize slider. */ zoomOptions?: any; } export interface OpenStreetMapLayerOptions { @@ -1699,7 +1697,7 @@ declare module "esri" { minimum: number; /** Bottom label for the slider. */ minLabel?: string; - /** **CHECK THIS: Is it num of dec places? - Accuracy of the data (related to rounding). */ + /** Accuracy of the data (related to rounding). */ precision?: number; /** Primary handle identified by its index value within the related infos array (color, size, break). */ primaryHandle?: number; @@ -1737,9 +1735,11 @@ declare module "esri" { activeSourceIndex?: number | string; /** Indicates whether to automatically add all the feature layers from the map. */ addLayersFromMap?: boolean; + /** This is the default value used as a hint for input text when searching on multiple sources. */ + allPlaceholder?: string; /** Indicates whether to automatically navigate to the selected result. */ autoNavigate?: boolean; - /** Indicates whether to automatically select the first result. */ + /** Indicates whether to automatically select the first geocoded result (not the first suggestion). */ autoSelect?: boolean; /** Indicates whether to enable an option to collapse/expand the search into a button. */ enableButtonMode?: boolean; @@ -1749,6 +1749,8 @@ declare module "esri" { enableInfoWindow?: boolean; /** Indicates whether to enable showing a label for the geometry.The default value is false. */ enableLabel?: boolean; + /** Indicates whether to display the option to search "All" sources. */ + enableSearchingAll?: boolean; /** Indicates whether to enable the menu for selecting different sources. */ enableSourcesMenu?: boolean; /** Indicates whether or not to enable suggest on the widget. */ @@ -1765,7 +1767,7 @@ declare module "esri" { infoTemplate?: InfoTemplate; /** The text symbol for the label graphic. */ labelSymbol?: TextSymbol; - /** The default distance specified in meters used to reverse geocode, (if not specified by source).The default value is 1500. */ + /** The default distance specified in meters used to reverse geocode, (if not specified by source). */ locationToAddressDistance?: number; /** Reference to the map. */ map?: Map; @@ -1791,23 +1793,19 @@ declare module "esri" { zoomScale?: number; } export interface SizeInfoSliderOptions { - /** Classification method. */ - classificationMethod?: string; /** Handles identified by their index values within the stops array. */ handles: number[]; - /** Represents histogram data object. */ + /** Represents the histogram data object. */ histogram?: any; /** Width of the histogram in pixels. */ histogramWidth?: number; - /** Absolute maximum value of the slider. */ + /** The absolute maximum value of the slider. */ maxValue?: number; - /** Absolute minimum value of the slider. */ + /** The absolute minimum value of the slider. */ minValue?: number; - /** Normalization type. */ - normalizationType?: string; - /** Handle identified by its index value within the stops array. */ + /** The handle identified by its index value within the stops array. */ primaryHandle?: number; - /** Width of slider ramp in pixels. */ + /** Represents the width of the SVG ramp in pixels. */ rampWidth?: number; /** Displays slider handles when true. */ showHandles?: boolean; @@ -1817,11 +1815,11 @@ declare module "esri" { showLabels?: boolean; /** Displays slider ticks when true. */ showTicks?: boolean; - /** Data map containing renderer information. */ + /** Defines the size of the symbol where feature size is proportional to data value. */ sizeInfo: any; - /** Represents statistics data object. */ + /** Represents the statistics data object. */ statistics?: any; - /** The symbol used with the widget. */ + /** The SimpleLineSymbol or SimpleMarkerSymbol used with the widget. */ symbol: Symbol; /** Additional options to customize slider. */ zoomOptions?: any; @@ -1969,10 +1967,12 @@ declare module "esri" { sumWithinLayer: FeatureLayer; } export interface SymbolStylerOptions { + /** Added at v. */ + portal?: string | any; /** Self response of Portal used as symbol provider. */ - portalSelf: string; + portalSelf?: any; /** URL to Portal used as symbol provider. */ - portalUrl: string; + portalUrl?: string; } export interface TemplatePickerOptions { /** Number of visible columns. */ @@ -2062,6 +2062,18 @@ declare module "esri" { /** A predefined style. */ style?: string; } + export interface VectorTileLayerOptions { + /** Lists which levels of the layer to draw. */ + displayLevels?: number[]; + /** Maximum visible scale for the layer. */ + maxScale?: number; + /** Minimum visible scale for the layer. */ + minScale?: number; + /** Initial opacity or transparency of layer. */ + opacity?: number; + /** Visibility of the layer. */ + visible?: boolean; + } export interface VisibleScaleRangeSliderOptions { /** Layer used to determine the suggested scale range and set the minScale, maxScale values. */ layer: FeatureLayer; @@ -2275,7 +2287,7 @@ declare module "esri/IdentityManager" { /** Dialog box widget used to challenge the user for their credentials when the application attempts to access a secure resource. */ dialog: any; /** - * When accessing secure resources via Oauth2 from ArcGIS.com or one of its sub-domains the IdentityManager redirects the user to the ArcGIS.com or Portal for ArcGIS sign-in page. + * When accessing secure resources via OAuth2 from ArcGIS.com or one of its sub-domains the IdentityManager redirects the user to the ArcGIS.com or Portal for ArcGIS sign-in page. * @param handlerFunction When called, the function passed to setOAuthRedirectionHandler receives an object containing the redirection properties. */ setOAuthRedirectionHandler(handlerFunction: Function): void; @@ -2391,7 +2403,7 @@ declare module "esri/IdentityManagerBase" { /** Return properties of this object in JSON. */ toJson(): any; /** Fired when a credential is created. */ - on(type: "credential-create", listener: (event: { target: IdentityManagerBase }) => void): esri.Handle; + on(type: "credential-create", listener: (event: { credential: Credential; target: IdentityManagerBase }) => void): esri.Handle; /** Fired when all credentials are destroyed. */ on(type: "credentials-destroy", listener: (event: { target: IdentityManagerBase }) => void): esri.Handle; on(type: string, listener: (event: any) => void): esri.Handle; @@ -2675,7 +2687,7 @@ declare module "esri/arcgis/OAuthInfo" { minTimeUntilExpiration: number; /** Set to true to show the OAuth sign in page in a popup window. */ popup: boolean; - /** The relative page URL for the user to be sent to from the OAuth sign in page. */ + /** Applicable if working with the popup user-login workflow. */ popupCallbackUrl: string; /** The window features passed to window.open(). */ popupWindowFeatures: string; @@ -2886,7 +2898,7 @@ declare module "esri/arcgis/Portal" { /** The date the group was last modified. */ modified: Date; /** The username of the group's owner. */ - owner: Portal; + owner: string; /** The portal for the group. */ portal: Portal; /** A short summary that describes the group. */ @@ -3062,7 +3074,7 @@ declare module "esri/arcgis/Portal" { * Retrieve all the items in the specified folder. * @param folderId The id of the folder that contains the items to retrieve. */ - getItems(folderId: string): any; + getItems(folderId?: string): any; /** Get information about any notifications for the portal user. */ getNotifications(): any; /** Access the tag objects that have been created by the portal user. */ @@ -3087,6 +3099,11 @@ declare module "esri/arcgis/utils" { * @param itemId The itemId for a publicly shared ArcGIS.com item. */ getItem(itemId: string): any; + /** + * Can be used with LayerList widget to get the layers list to be passed into the constructor. + * @param createMapResponse The object created from the resolved promise returned by createMap(). + */ + getLayerList(createMapResponse: any): any[]; /** * Can be used with esri.dijit.Legend to get the layerInfos list to be passed into the Legend constructor. * @param createMapResponse Object returned by .createMap() in the .then() callback. @@ -3422,37 +3439,35 @@ declare module "esri/dijit/ClassedColorSlider" { /** A widget to assist with managing a renderer used for visualizing features by their class and color. */ class ClassedColorSlider extends RendererSlider { - /** Required */ + /** Required: The data map containing renderer information. */ breakInfos: any; - /** Optional */ + /** Optional: Indicates the classification method used to divide the range of values into bins. */ classificationMethod: string; /** Required: Handles identified by their index values within the stops array. */ handles: number[]; - /** Optional: Property representing histogram data object. */ + /** Optional: Represents the histogram data object. */ histogram: any; - /** Optional */ + /** Optional: The width of the histogram in pixels. */ histogramWidth: boolean; - /** Optional */ + /** Read Only. */ maxValue: number; - /** Optional */ + /** Read Only. */ minValue: number; - /** Optional */ + /** Optional: Indicates how data values are normalized. */ normalizationType: string; - /** Optional: Handle identified by its index value within the stops array. */ + /** Optional: The handle identified by its index value within the stops array. */ primaryHandle: number; - /** Optional */ + /** Optional: Width of the widget ramp in pixels. */ rampWidth: number; - /** Property for showing handles. */ + /** Optional: Indicates whether to display handles. */ showHandles: boolean; - /** Optional: Property for displaying the histogram. */ + /** Optional: Indicates whether to display the histogram. */ showHistogram: boolean; - /** Property for showing labels. */ + /** Optional: Indicates whether to display labels. */ showLabels: boolean; - /** Property for showing ticks. */ + /** Optional: Indicates whether to display tick marks. */ showTicks: boolean; - /** Property for displaying the transparent background. */ - showTransparentBackground: boolean; - /** Optional: Property representing statistics data object. */ + /** Optional: Represents the statistics data object. */ statistics: any; /** * Creates a new ClassedColorSlider widget. @@ -3464,7 +3479,7 @@ declare module "esri/dijit/ClassedColorSlider" { startup(): void; /** Fires when the ClassedColorSlider widget properties change. */ on(type: "change", listener: (event: { breakInfos: any; target: ClassedColorSlider }) => void): esri.Handle; - /** Fires when minValue or maxValue of ClassedColorSlider changes. */ + /** Fires when minValue or maxValue of the ClassedColorSlider changes. */ on(type: "data-value-change", listener: (event: { breakInfos: any; maxValue: number; minValue: number; target: ClassedColorSlider }) => void): esri.Handle; /** Fires when a ClassedColorSlider handle is moved. */ on(type: "handle-value-change", listener: (event: { breakInfos: any; target: ClassedColorSlider }) => void): esri.Handle; @@ -3479,35 +3494,35 @@ declare module "esri/dijit/ClassedSizeSlider" { /** A widget to assist with managing a renderer for visualizing features by varying classes and size. */ class ClassedSizeSlider extends RendererSlider { - /** Required. */ + /** Required: The data map containing renderer information. */ breakInfos: any; - /** Optional. */ + /** Optional: Indicates the classification method used to divide the range of values into bins. */ classificationMethod: string; - /** Required. */ + /** Required: Handles identified by their index values within the stops array. */ handles: number[]; - /** Optional. */ + /** Optional: Represents the histogram data object. */ histogram: any; - /** Optional. */ - histogramWidth: boolean; - /** Optional. */ + /** Optional: Width of histogram in pixels. */ + histogramWidth: number; + /** Read Only. */ maxValue: number; - /** Optional. */ + /** Read Only. */ minValue: number; - /** Optional. */ + /** Optional: Indicates how data values are normalized. */ normalizationType: string; - /** Optional. */ + /** Optional: Handle identified by its index value within the stops array. */ primaryHandle: number; - /** Optional */ + /** Optional: Width of the widget ramp in pixels. */ rampWidth: number; - /** Property for showing handles. */ + /** Optional: Indicates whether to display handles. */ showHandles: boolean; - /** Optional. */ + /** Optional: Indicates whether to display the histogram. */ showHistogram: boolean; - /** Property for showing labels. */ + /** Optional: Indicates whether to display labels. */ showLabels: boolean; - /** Property for showing ticks. */ + /** Optional: Indicates whether to display ticks marks. */ showTicks: boolean; - /** Optional. */ + /** Optional: Represents the statistics data object. */ statistics: any; /** * Creates a new ClassedSizeSlider widget within the provided DOM node srcNodeRef. @@ -3517,7 +3532,7 @@ declare module "esri/dijit/ClassedSizeSlider" { constructor(params: esri.ClassedSizeSliderOptions, srcNodeRef: Node | string); /** Fires when ClassedSizeSlider changes. */ on(type: "change", listener: (event: { breakInfos: any; target: ClassedSizeSlider }) => void): esri.Handle; - /** Fires when minValue or maxValue changes in ClassedSizeSlider. */ + /** Fires when minValue or maxValue of the ClassedSizeSlider changes. */ on(type: "data-value-change", listener: (event: { breakInfos: any; maxValue: number; minValue: number; target: ClassedSizeSlider }) => void): esri.Handle; /** Fires when a ClassedSizeSlider handle is moved. */ on(type: "handle-value-change", listener: (event: { breakInfos: any; target: ClassedSizeSlider }) => void): esri.Handle; @@ -3532,39 +3547,41 @@ declare module "esri/dijit/ColorInfoSlider" { /** A widget to assist with managing a renderer for visualizing features based upon colors. */ class ColorInfoSlider extends RendererSlider { - /** Optional */ + /** The classification method used for the ColorInfoSlider. */ classificationMethod: string; - /** Required: Example colorInfo: colorRenderer.renderer.visualVariables[0]. */ + /** Required: The data map containing renderer information. */ colorInfo: any; /** Required: Handles identified by their index values within the stops array. */ handles: number[]; - /** Optional: Property representing histogram data object. */ + /** Optional: Represents the histogram data object. */ histogram: any; - /** Optional */ - histogramWidth: boolean; - /** Optional */ + /** Optional: Width of histogram in pixels. */ + histogramWidth: number; + /** Optional: The absolute maximum value of the slider. */ maxValue: number; - /** Optional */ + /** Optional: The absolute minimum value of the slider. */ minValue: number; /** Optional */ normalizationType: string; - /** Optional: Handle identified by its index value within the stops array. */ + /** Optional: The handle identified by its index value within the stops array. */ primaryHandle: number; - /** Optional */ + /** Optional: Width of the widget ramp in pixels. */ rampWidth: number; - /** Property for showing handles. */ + /** Optional: Indicates whether to display handles. */ showHandles: boolean; - /** Optional: Property for displaying the histogram. */ + /** Optional: Indicates whether to display the histogram. */ showHistogram: boolean; - /** Property for showing labels. */ + /** Optional: Indicates whether to display handles. */ showLabels: boolean; - /** Property for showing ticks. */ + /** Indicates whether to display percentage labels. */ + showRatioLabels: boolean | string; + /** Optional: Indicates whether to display ticks marks. */ showTicks: boolean; - /** Property for displaying the transparent background. */ + /** Optional: Indicates whether to display a transparent background. */ showTransparentBackground: boolean; - /** Optional: Property representing statistics data object. */ + /** Optional: Represents a statistics data object. */ statistics: any; - /** Optional */ + /** Optional: Additional options to customize slider. */ zoomOptions: any; /** * Creates a new ColorInfoSlider widget within the provided DOM node srcNodeRef. @@ -3576,10 +3593,12 @@ declare module "esri/dijit/ColorInfoSlider" { startup(): void; /** Fires when ColorInfoSlider changes. */ on(type: "change", listener: (event: { colorInfo: any; target: ColorInfoSlider }) => void): esri.Handle; - /** Fires when minValue or maxValue of ColorInfoSlider changes. */ + /** Fires when minValue or maxValue of the ColorInfoSlider changes. */ on(type: "data-value-change", listener: (event: { colorInfo: any; maxValue: number; minValue: number; target: ColorInfoSlider }) => void): esri.Handle; /** Fires when a ColorInfoSlider handle is moved. */ - on(type: "handle-value-change", listener: (event: { target: ColorInfoSlider }) => void): esri.Handle; + on(type: "handle-value-change", listener: (event: { colorInfo: any; target: ColorInfoSlider }) => void): esri.Handle; + /** Fires when the zoom state changes. */ + on(type: "zoomed", listener: (event: { zoomed: boolean; target: ColorInfoSlider }) => void): esri.Handle; on(type: string, listener: (event: any) => void): esri.Handle; } export = ColorInfoSlider; @@ -3765,6 +3784,8 @@ declare module "esri/dijit/ElevationProfile" { measureUnits: string; /** The polyline input geometry used to create the elevation profile. */ profileGeometry: Geometry; + /** The title of the resulting elevation profile. */ + title: string; /** * Create a new ElevationProfile widget using the given DOM node. * @param options See options table below for the full descriptions of the properties needed for this object. @@ -3781,6 +3802,8 @@ declare module "esri/dijit/ElevationProfile" { on(type: "clear-profile", listener: (event: { target: ElevationProfile }) => void): esri.Handle; /** Fires when the widget has fully loaded. */ on(type: "load", listener: (event: { target: ElevationProfile }) => void): esri.Handle; + /** Fires when the title of the elevation profile is changed */ + on(type: "title-changed", listener: (event: { target: ElevationProfile }) => void): esri.Handle; /** Fires when the elevation profile is updated. */ on(type: "update-profile", listener: (event: { profileResults: any; target: ElevationProfile }) => void): esri.Handle; on(type: string, listener: (event: any) => void): esri.Handle; @@ -3793,7 +3816,7 @@ declare module "esri/dijit/FeatureTable" { import FeatureLayer = require("esri/layers/FeatureLayer"); import Map = require("esri/map"); - /** (Currently in beta) Creates an instance of the FeatureTable widget within the provided DOM node. */ + /** Creates an instance of the FeatureTable widget within the provided DOM node. */ class FeatureTable { /** An optional dGrid property. */ allowSelectAll: boolean; @@ -3805,10 +3828,16 @@ declare module "esri/dijit/FeatureTable" { dataStore: any; /** Object defining the date options specifically for formatting date and time editors. */ dateOptions: any; + /** Allows selection of a table's row via clicking a feature on the map. */ + enableLayerClick: boolean; + /** Allows selection of a feature on a map via clicking row in the table. */ + enableLayerSelection: boolean; /** The featureLayer that the table is associated with. */ featureLayer: FeatureLayer; /** Reference to the dGrid. */ grid: any; + /** Reference to the 'Options' drop-down menu. */ + gridMenu: any; /** Optional columns to hide by default using the dGrid ColumnHider extension. */ hiddenFields: string[]; /** A reference to the primary key used by the dataStore to differentiate columns. */ @@ -4004,15 +4033,15 @@ declare module "esri/dijit/HeatmapSlider" { import esri = require("esri"); import RendererSlider = require("esri/dijit/RendererSlider"); - /** A widget to assist in managing properties of a HeatmapRenderer. */ + /** A widget to assist in obtaining values for managing and setting properties on a HeatmapRenderer. */ class HeatmapSlider extends RendererSlider { /** Required. */ colorStops: any; /** Required. */ handles: number[]; - /** Optional. */ + /** Optional, absolute maximum value of the slider.NOTE: This value overrides statistics' max property. */ maxValue: number; - /** Optional. */ + /** Optional, absolute minimum value of the slider.NOTE: This value overrides statistics' min property. */ minValue: number; /** Optional */ rampWidth: number; @@ -4127,6 +4156,7 @@ declare module "esri/dijit/ImageServiceMeasure" { import SimpleFillSymbol = require("esri/symbols/SimpleFillSymbol"); import SimpleLineSymbol = require("esri/symbols/SimpleLineSymbol"); import SimpleMarkerSymbol = require("esri/symbols/SimpleMarkerSymbol"); + import ImageServiceMeasureTool = require("esri/toolbars/ImageServiceMeasureTool"); /** This widget allows you to perform measurements on image services. */ class ImageServiceMeasure { @@ -4136,6 +4166,8 @@ declare module "esri/dijit/ImageServiceMeasure" { lineSymbol: SimpleLineSymbol; /** Symbol to be used when drawing a point. */ markerSymbol: SimpleMarkerSymbol; + /** The instance of ImageServiceMeasureTool associated with this widget. */ + measureToolbar: ImageServiceMeasureTool; /** * Creates an instance of the ImageServiceMeasure widget. * @param params An Object containing constructor options. @@ -4294,8 +4326,12 @@ declare module "esri/dijit/LayerList" { map: Map; /** Indicates whether to remove underscores from the layer title */ removeUnderscores: boolean; + /** Indicates whether to display a legend for the layer items. */ + showLegend: boolean; + /** Indicates whether to display the opacity slider. */ + showOpacitySlider: boolean; /** Indicates whether to show sublayers in the list of layers. */ - sublayers: boolean; + showSubLayers: boolean; /** CSS Class for uniquely styling the widget. */ theme: string; /** Indicates whether to show the widget. */ @@ -4314,7 +4350,7 @@ declare module "esri/dijit/LayerList" { startup(): void; /** Fired when the LayerList widget has fully loaded. */ on(type: "load", listener: (event: { target: LayerList }) => void): esri.Handle; - /** Fired when refresh is called on the LabelList widget. */ + /** Fired when refresh() is called on the widget. */ on(type: "refresh", listener: (event: { target: LayerList }) => void): esri.Handle; /** Fired when the layer is toggled on/off within the widget. */ on(type: "toggle", listener: (event: { layerIndex: number; subLayerIndex: number; visible: boolean; target: LayerList }) => void): esri.Handle; @@ -4622,33 +4658,35 @@ declare module "esri/dijit/OpacitySlider" { /** A widget to assist with managing opacity with a renderer. */ class OpacitySlider extends RendererSlider { - /** Required. */ + /** Required: Handles identified by their index values within the stops array. */ handles: number[]; - /** Optional. */ + /** Optional: Represents the histogram data object. */ histogram: any; - /** Optional: */ - histogramWidth: boolean; - /** Optional. */ + /** Optional: Width of histogram in pixels. */ + histogramWidth: number; + /** Optional: The absolute maximum value of the slider. */ maxValue: number; - /** Optional. */ + /** Optional: The absolute minimum value of the slider. */ minValue: number; - /** Required. */ + /** Required: The data map containing renderer information. */ opacityInfo: any; - /** Optional */ + /** Optional: The handle identified by its index value within the stops array. */ + primaryHandle: number; + /** Optional: Represents the width of the SVG ramp in pixels. */ rampWidth: number; - /** Property for showing handles. */ + /** Optional: Indicates whether to display slider handles. */ showHandles: boolean; - /** Optional. */ + /** Optional: Indicates whether to display the histogram. */ showHistogram: boolean; - /** Property for showing labels. */ + /** Optional: Indicates whether to display slider labels. */ showLabels: boolean; - /** Property for showing ticks. */ + /** Optional: Indicates whether to display slider tick marks. */ showTicks: boolean; - /** Property for displaying the transparent background. */ + /** Optional: Indicates whether to display the transparent background. */ showTransparentBackground: boolean; - /** Optional. */ + /** Optional: Represents a statistics data object. */ statistics: any; - /** Optional. */ + /** Optional: Additional options to customize slider. */ zoomOptions: any; /** * Creates a new OpacitySlider widget within the provided DOM node srcNodeRef. @@ -4658,10 +4696,12 @@ declare module "esri/dijit/OpacitySlider" { constructor(params: esri.OpacitySliderOptions, srcNodeRef: Node | string); /** Fires when OpacitySlider changes. */ on(type: "change", listener: (event: { opacityInfo: any; target: OpacitySlider }) => void): esri.Handle; - /** Fires when minValue or maxValue of OpacitySlider changes. */ + /** Fires when minValue or maxValue of the OpacitySlider changes. */ on(type: "data-value-change", listener: (event: { maxValue: number; minValue: number; opacityInfo: any; target: OpacitySlider }) => void): esri.Handle; /** Fires when an OpacitySlider handle is moved. */ on(type: "handle-value-change", listener: (event: { opacityInfo: any; target: OpacitySlider }) => void): esri.Handle; + /** Fires when the zoom state changes. */ + on(type: "zoomed", listener: (event: { zoomed: boolean; target: OpacitySlider }) => void): esri.Handle; on(type: string, listener: (event: any) => void): esri.Handle; } export = OpacitySlider; @@ -4985,7 +5025,7 @@ declare module "esri/dijit/RendererSlider" { showLabels: boolean | string[]; /** Toggle for showing the horizontal line indicators from the center of the handle. */ showTicks: boolean; - /** Handle positions represented as numbers that fall between minimum and maximum. */ + /** Required: Handle positions represented as numbers that fall between minimum and maximum. */ values: number[]; /** * Creates a new RendererSlider widget. @@ -5044,10 +5084,14 @@ declare module "esri/dijit/Search" { activeSourceIndex: number; /** Indicates whether to automatically add all the feature layers from the map. */ addLayersFromMap: boolean; + /** This is the default value used as a hint for input text when searching on multiple sources. */ + allPlaceholder: string; /** Indicates whether to automatically navigate to the selected result. */ autoNavigate: boolean; - /** Indicates whether to automatically select and zoom to the first geocoded result. */ + /** Indicates whether to automatically select the first geocoded result. */ autoSelect: boolean; + /** (Read-only), the default source used for the Search widget. */ + defaultSource: any; /** Indicates whether to enable an option to collapse/expand the search into a button. */ enableButtonMode: boolean; /** Show the selected feature on the map using a default symbol determined by the source's geometry type. */ @@ -5056,6 +5100,8 @@ declare module "esri/dijit/Search" { enableInfoWindow: boolean; /** Indicates whether to enable showing a label for the geometry. */ enableLabel: boolean; + /** Indicates whether to display the option to search "All" sources. */ + enableSearchingAll: boolean; /** Indicates whether to enable the menu for selecting different sources. */ enableSourcesMenu: boolean; /** Enable suggestions for the widget. */ @@ -5150,8 +5196,8 @@ declare module "esri/dijit/Search" { /** Finalizes the creation of the Search widget. */ startup(): void; /** - * Performs a suggest() request on the active Locator. - * @param value The string value used to suggest() on an active Locator. + * Performs a suggest() request on the active Locator or feature layer. + * @param value The string value used to suggest() on an active locator or feature layer. */ suggest(value?: string): any; /** Fired when the widget's text input loses focus. */ @@ -5176,39 +5222,44 @@ declare module "esri/dijit/Search" { declare module "esri/dijit/SizeInfoSlider" { import esri = require("esri"); import RendererSlider = require("esri/dijit/RendererSlider"); + import SimpleMarkerSymbol = require("esri/symbols/SimpleMarkerSymbol"); + import SimpleLineSymbol = require("esri/symbols/SimpleLineSymbol"); + /** A widget to assist with managing size with a renderer. */ class SizeInfoSlider extends RendererSlider { - /** Optional. */ + /** Optional, the classification method used for the SizeInfoSlider. */ classificationMethod: string; - /** Required. */ + /** Required: Handles identified by their index values within the stops array. */ handles: number[]; - /** Optional. */ + /** Optional: Represents the histogram data object. */ histogram: any; - /** Optional. */ - histogramWidth: boolean; - /** Optional. */ + /** Optional: Width of the histogram in pixels. */ + histogramWidth: number; + /** Optional: The absolute maximum value of the slider. */ maxValue: number; - /** Optional. */ + /** Optional: The absolute minimum value of the slider. */ minValue: number; - /** Optional. */ + /** Optional, indicates how data values are normalized. */ normalizationType: string; - /** Optional. */ + /** Optional: The handle identified by its index value within the stops array. */ primaryHandle: number; - /** Optional */ + /** Optional: Represents the width of the SVG ramp in pixels. */ rampWidth: number; - /** Property for showing handles. */ + /** Optional: Indicates whether to display slider handles. */ showHandles: boolean; - /** Optional. */ + /** Optional: Indicates whether to display the histogram. */ showHistogram: boolean; - /** Property for showing labels. */ + /** Optional: Indicates whether to display the slider labels. */ showLabels: boolean; - /** Property for showing ticks. */ + /** Optional: Indicates whether to display the slider tick marks. */ showTicks: boolean; - /** Required. */ + /** Required: Defines the size of the symbol where feature size is proportional to data value. */ sizeInfo: any; - /** Optional. */ + /** Optional: Represents the statistics data object. */ statistics: any; - /** Optional. */ + /** Required: The SimpleLineSymbol or SimpleMarkerSymbol used with the widget. */ + symbol: SimpleMarkerSymbol | SimpleLineSymbol; + /** Optional: Additional options to customize slider. */ zoomOptions: any; /** * Creates a new SizeInfoSlider widget. @@ -5220,10 +5271,12 @@ declare module "esri/dijit/SizeInfoSlider" { startup(): void; /** Fires when the SizeInfoSlider properties change. */ on(type: "change", listener: (event: { sizeInfo: any; target: SizeInfoSlider }) => void): esri.Handle; - /** Fires when minValue or maxValue of SizeInfoSlider change. */ + /** Fires when minValue or maxValue of the SizeInfoSlider changes. */ on(type: "data-value-change", listener: (event: { maxValue: number; minValue: number; sizeInfo: any; target: SizeInfoSlider }) => void): esri.Handle; /** Fires when a SizeInfoSlider handle is moved. */ on(type: "handle-value-change", listener: (event: { sizeInfo: any; target: SizeInfoSlider }) => void): esri.Handle; + /** Fires when the zoom state changes. */ + on(type: "zoomed", listener: (event: { zoomed: boolean; target: SizeInfoSlider }) => void): esri.Handle; on(type: string, listener: (event: any) => void): esri.Handle; } export = SizeInfoSlider; @@ -6730,7 +6783,7 @@ declare module "esri/dijit/geoenrichment/DataBrowser" { export = DataBrowser; } -declare module "esri/dijit/geoenrichment/InfoGraphic" { +declare module "esri/dijit/geoenrichment/Infographic" { import esri = require("esri"); import GeometryStudyArea = require("esri/tasks/geoenrichment/GeometryStudyArea"); import RingBuffer = require("esri/tasks/geoenrichment/RingBuffer"); @@ -7451,13 +7504,13 @@ declare module "esri/geometry/geometryEngine" { import SpatialReference = require("esri/SpatialReference"); import Point = require("esri/geometry/Point"); - /** (Currently in beta) A client-side geometry engine. */ + /** A client-side geometry engine. */ var geometryEngine: { /** * Creates planar (or Euclidean) buffer polygons at a specified distance around the input geometries. * @param geometry The buffer input geometry. * @param distance The specified distance(s) for buffering. - * @param unit Unit for the distance(s). + * @param unit Measurement unit for the distance(s). * @param unionResults Whether the output geometries should be unioned into a single polygon. */ buffer(geometry: Geometry | Geometry[], distance: number | number[], unit: string | number, unionResults?: boolean): Polygon | Polygon[]; @@ -7495,7 +7548,7 @@ declare module "esri/geometry/geometryEngine" { * Densify geometries by plotting points between existing vertices. * @param geometry The geometry to be densified. * @param maxSegmentLength The maximum segment length allowed. - * @param maxSegmentLengthUnit Unit for the maximum segment length. + * @param maxSegmentLengthUnit Measurement unit for maxSegmentLength. */ densify(geometry: Geometry, maxSegmentLength: number, maxSegmentLengthUnit: string | number): Geometry; /** @@ -7514,7 +7567,7 @@ declare module "esri/geometry/geometryEngine" { * Calculates the shortest planar distance between two geometries. * @param geometry1 First input geometry. * @param geometry2 Second input geometry. - * @param distanceUnit Units of the return value. + * @param distanceUnit Measurement unit of the return value. */ distance(geometry1: Geometry, geometry2: Geometry, distanceUnit: string | number): number; /** @@ -7545,27 +7598,34 @@ declare module "esri/geometry/geometryEngine" { * @param geometry The geometry to be generalized. * @param maxDeviation The maximum allowed deviation from the generalized geometry to the original geometry. * @param removeDegenerateParts When true, the degenerate parts of the geometry will be removed from the output (may be undesired for drawing). - * @param maxDeviationUnit A unit for maximum deviation. + * @param maxDeviationUnit Measurement unit for maxDeviation. */ generalize(geometry: Geometry, maxDeviation: number, removeDegenerateParts?: boolean, maxDeviationUnit?: string | number): Geometry; /** * Calculates the area of the input geometry. * @param geometry The input geometry. - * @param unit Units of the return value. + * @param unit Measurement unit of the return value. */ geodesicArea(geometry: Geometry, unit: string | number): number; /** * Creates geodesic buffer polygons at a specified distance around the input geometries. * @param geometry The buffer input geometry. * @param distance The specified distance(s) for buffering. - * @param unit Unit for the distance(s). + * @param unit Measurement unit for the distance(s). * @param unionResults Whether the output geometries should be unioned into a single polygon. */ geodesicBuffer(geometry: Geometry | Geometry[], distance: number | number[], unit: string | number, unionResults?: boolean): Polygon | Polygon[]; + /** + * Returns a geodesically densified version of the input geometry. + * @param geometry A polyline or polygon geometry to densify. + * @param maxSegmentLength The maximum segment length allowed. + * @param maxSegmentLengthUnit Measurement unit for maxSegmentLength. + */ + geodesicDensify(geometry: Polyline | Polygon, maxSegmentLength: number, maxSegmentLengthUnit?: number): Geometry; /** * Calculates the length of the input geometry. * @param geometry The input geometry. - * @param unit Units of the return value. + * @param unit Measurement unit of the return value. */ geodesicLength(geometry: Geometry, unit: string | number): number; /** @@ -7609,7 +7669,7 @@ declare module "esri/geometry/geometryEngine" { * Creates offset version of the input geometry. * @param geometry The geometries to offset. * @param offsetDistance The offset distance for the Geometries. - * @param offsetUnit Unit for the offset. + * @param offsetUnit Measurement unit for the offset. * @param joinType The join type. * @param bevelRatio Applicable to MITER, bevelRatio is multiplied by the offset distance and the result determines how far a mitered offset intersection can be located before it is beveled. * @param flattenError Applicable to ROUND, flattenError determines the maximum distance of the resulting segments compared to the true circular arc. @@ -7624,13 +7684,13 @@ declare module "esri/geometry/geometryEngine" { /** * Calculates the area of the input geometry. * @param geometry The input geometry. - * @param unit Units of the return value. + * @param unit Measurement unit of the return value. */ planarArea(geometry: Geometry, unit: string | number): number; /** * Calculates the length of the input geometry. * @param geometry The input geometry. - * @param unit Units of the return value. + * @param unit Measurement unit of the return value. */ planarLength(geometry: Geometry, unit: string | number): number; /** @@ -7685,14 +7745,15 @@ declare module "esri/geometry/geometryEngineAsync" { import Polyline = require("esri/geometry/Polyline"); import SpatialReference = require("esri/SpatialReference"); import Point = require("esri/geometry/Point"); + import Polygon = require("esri/geometry/Polygon"); - /** (Currently in beta) A client-side asynchronous geometry engine. */ + /** A client-side asynchronous geometry engine. */ var geometryEngineAsync: { /** * Creates planar (or Euclidean) buffer polygons at a specified distance around the input geometries. * @param geometry The buffer input geometry. * @param distance The specified distance(s) for buffering. - * @param unit Unit for the distance(s). + * @param unit Measurement unit for the distance(s). * @param unionResults Whether the output geometries should be unioned into a single polygon. */ buffer(geometry: Geometry | Geometry[], distance: number | number[], unit: string | number, unionResults?: boolean): any; @@ -7730,7 +7791,7 @@ declare module "esri/geometry/geometryEngineAsync" { * Densify geometries by plotting points between existing vertices. * @param geometry The geometry to be densified. * @param maxSegmentLength The maximum segment length allowed. - * @param maxSegmentLengthUnit Defaults to the units of the input geometries. + * @param maxSegmentLengthUnit Measurement unit for maxSegmentLength. */ densify(geometry: Geometry, maxSegmentLength: number, maxSegmentLengthUnit: string | number): any; /** @@ -7749,7 +7810,7 @@ declare module "esri/geometry/geometryEngineAsync" { * Calculates the shortest planar distance between two geometries. * @param geometry1 First input geometry. * @param geometry2 Second input geometry. - * @param distanceUnit Units of the return value. + * @param distanceUnit Measurement unit of the return value. */ distance(geometry1: Geometry, geometry2: Geometry, distanceUnit: string | number): any; /** @@ -7780,27 +7841,34 @@ declare module "esri/geometry/geometryEngineAsync" { * @param geometry The geometry to be generalized. * @param maxDeviation The maximum allowed deviation from the generalized geometry to the original geometry. * @param removeDegenerateParts When true, the degenerate parts of the geometry will be removed from the output (may be undesired for drawing). - * @param maxDeviationUnit Defaults to the units of the input geometries. + * @param maxDeviationUnit Measurement unit for maxDeviation. */ generalize(geometry: Geometry, maxDeviation: number, removeDegenerateParts?: boolean, maxDeviationUnit?: string | number): any; /** * Calculates the area of the input geometry. * @param geometry The input geometry. - * @param unit Units of the return value. + * @param unit Measurement unit of the return value. */ geodesicArea(geometry: Geometry, unit: string | number): any; /** * Creates geodesic buffer polygons at a specified distance around the input geometries. * @param geometry The buffer input geometry. * @param distance The specified distance(s) for buffering. - * @param unit Unit for the distance(s). + * @param unit Measurement unit for the distance(s). * @param unionResults Whether the output geometries should be unioned into a single polygon. */ geodesicBuffer(geometry: Geometry | Geometry[], distance: number | number[], unit: string | number, unionResults?: boolean): any; + /** + * Resolves to a geodesically densified version of the input geometry. + * @param geometry A polyline or polygon geometry to densify. + * @param maxSegmentLength The maximum segment length allowed. + * @param maxSegmentLengthUnit Measurement unit for maxSegmentLength. + */ + geodesicDensify(geometry: Polyline | Polygon, maxSegmentLength: number, maxSegmentLengthUnit?: number): any; /** * Calculates the length of the input geometry. * @param geometry The input geometry. - * @param unit Units of the return value. + * @param unit Measurement unit of the return value. */ geodesicLength(geometry: Geometry, unit: string | number): any; /** @@ -7844,7 +7912,7 @@ declare module "esri/geometry/geometryEngineAsync" { * Creates offset version of the input geometry. * @param geometry The geometries to offset. * @param offsetDistance The offset distance for the Geometries. - * @param offsetUnit Unit for the offset. + * @param offsetUnit Measurement unit for the offset. * @param joinType The join type. * @param bevelRatio Applicable to MITER, bevelRatio is multiplied by the offset distance and the result determines how far a mitered offset intersection can be located before it is beveled. * @param flattenError Applicable to ROUND, flattenError determines the maximum distance of the resulting segments compared to the true circular arc. @@ -7859,13 +7927,13 @@ declare module "esri/geometry/geometryEngineAsync" { /** * Calculates the area of the input geometry. * @param geometry The input geometry. - * @param unit Units of the return value. + * @param unit Measurement unit of the return value. */ planarArea(geometry: Geometry, unit: string | number): any; /** * Calculates the length of the input geometry. * @param geometry The input geometry. - * @param unit Units of the return value. + * @param unit Measurement unit of the return value. */ planarLength(geometry: Geometry, unit: string | number): any; /** @@ -9219,7 +9287,7 @@ declare module "esri/layers/FeatureLayer" { */ setAutoGeneralize(enable: boolean): FeatureLayer; /** - * Set's the definition expression for the FeatureLayer. + * Sets the definition expression for the FeatureLayer. * @param expression The definition expression to apply. */ setDefinitionExpression(expression: string): FeatureLayer; @@ -9275,7 +9343,7 @@ declare module "esri/layers/FeatureLayer" { */ setScaleRange(minScale: number, maxScale: number): void; /** - * Set's the selection symbol for the feature layer. + * Sets the selection symbol for the feature layer. * @param symbol Symbol for the current selection. */ setSelectionSymbol(symbol: Symbol): FeatureLayer; @@ -9285,7 +9353,7 @@ declare module "esri/layers/FeatureLayer" { */ setShowLabels(showLabels: boolean): void; /** - * Set's the time definition for the feature layer. + * Sets the time definition for the feature layer. * @param definition The new time extent used to filter the layer. */ setTimeDefinition(definition: TimeExtent): FeatureLayer; @@ -9458,6 +9526,8 @@ declare module "esri/layers/GeoRSSLayer" { items: Graphic[]; /** The name of the layer. */ name: string; + /** The publicly accessible URL to a GeoRSS file. */ + url: string; /** * Creates a new GeoRSSLayer object. * @param url URL to the GeoRSS resource. @@ -9805,10 +9875,14 @@ declare module "esri/layers/LOD" { declare module "esri/layers/LabelClass" { import TextSymbol = require("esri/symbols/TextSymbol"); - /** LabelClass defines the styles of labels for ArcGISDynamicMapServiceLayer. */ + /** Use label classes to restrict labels to certain features or to specify different label fields, symbols, scale ranges, label priorities, and sets of label placement options for different groups of labels. */ class LabelClass { + /** An array of objects representing field information to label. */ + fieldInfos: any[]; /** Adjusts the formatting of labels. */ labelExpression: string; + /** Use this when working with FeatureLayer layer types. */ + labelExpressionInfo: any; /** The position of the label. */ labelPlacement: string; /** The maximum scale to show labels. */ @@ -9824,7 +9898,7 @@ declare module "esri/layers/LabelClass" { /** A where clause determining which features are labeled. */ where: string; /** - * Create a LabelClass, in order to be added to layerDrawingOption.labelingInfo. + * Creates a label class, used for formatting parameters, symbols, date, etc. * @param json Various options to configure this LabelClass. */ constructor(json?: Object); @@ -9840,7 +9914,7 @@ declare module "esri/layers/LabelLayer" { import UniqueValueRenderer = require("esri/renderers/UniqueValueRenderer"); import ClassBreaksRenderer = require("esri/renderers/ClassBreaksRenderer"); - /** The LabelLayer inherits from the graphics layer and can be used to display texts and symbols on map. */ + /** NOTE: Deprecated as of version 3.14, read below for additional information on the suggested method of labeling. */ class LabelLayer extends GraphicsLayer { /** * Creates a new Label layer. @@ -10248,6 +10322,8 @@ declare module "esri/layers/RasterLayer" { /** The RasterLayer is used to display image services. */ class RasterLayer extends Layer { + /** A function that takes a pixelData object as input, processes it, and returns it. */ + pixelFilter: Function; /** * Creates a new RasterLayer object. * @param url URL to the ArcGIS Server REST resource that represents a raster layer service. @@ -10262,6 +10338,11 @@ declare module "esri/layers/RasterLayer" { * @param doNotRefresh Use true to avoid refreshing the layer; false to refresh it. */ setImageFormat(imageFormat: string, doNotRefresh?: boolean): void; + /** + * Sets a pixelFilter on the layer. + * @param pixelFilter The function defining the PixelFilter to set on the layer. + */ + setPixelFilter(pixelFilter: Function): void; /** * Determines if the layer will update its content based on the map's current time extent. * @param use Use true to update the layer's content based on the map's current time extent. @@ -10495,16 +10576,55 @@ declare module "esri/layers/TimeInfo" { } declare module "esri/layers/TimeReference" { - /** TimeReference contains information about how the time was measured. */ + /** TimeReference contains read-only information about how the time was captured when the data was created. */ class TimeReference { - /** Indicates whether the time reference respects daylight savings time. */ + /** A read-only property that indicates whether the time reference takes into account daylight savings time. */ respectsDaylightSaving: boolean; - /** The time zone information associated with the time reference. */ + /** The time zone in which the data was captured. */ timeZone: string; } export = TimeReference; } +declare module "esri/layers/VectorTileLayer" { + import esri = require("esri"); + import Layer = require("esri/layers/layer"); + import Extent = require("esri/geometry/Extent"); + import SpatialReference = require("esri/SpatialReference"); + import TileInfo = require("esri/layers/TileInfo"); + + /** A VectorTileLayer accesses cached tiles of data and renders it in vector format. */ + class VectorTileLayer extends Layer { + /** The full extent of the layer. */ + fullExtent: Extent; + /** The initial extent of the layer. */ + initialExtent: Extent; + /** The spatial reference of the layer. */ + spatialReference: SpatialReference; + /** The style object of the service with fully qualified URLs for glyphs and sprite. */ + style: any; + /** Contains information about the tiling scheme for the layer. */ + tileInfo: TileInfo; + /** The URL to the vector tile service or style JSON that will be used to draw the layer. */ + url: string; + /** + * Create a new VectorTileLayer object. + * @param url The URL to the vector tile service or style JSON that will be used to draw the layer. + * @param options Optional parameters. + */ + constructor(url: string | any, options?: esri.VectorTileLayerOptions); + /** + * Changes the style properties used to render the layers. + * @param styleUrl A url to a JSON file containing the stylesheet information to render the layer. + */ + setStyle(styleUrl: string | any): void; + /** Fires when the style is changed on the layer. */ + on(type: "style-change", listener: (event: { style: any; target: VectorTileLayer }) => void): esri.Handle; + on(type: string, listener: (event: any) => void): esri.Handle; + } + export = VectorTileLayer; +} + declare module "esri/layers/WFSLayer" { import esri = require("esri"); import Field = require("esri/layers/Field"); @@ -10513,7 +10633,7 @@ declare module "esri/layers/WFSLayer" { import InfoTemplate = require("esri/InfoTemplate"); import Renderer = require("esri/renderers/Renderer"); - /** (Currently in beta)A layer for OGC Web Feature Services (WFS). */ + /** (Currently in beta) A layer for OGC Web Feature Services (WFS). */ class WFSLayer { /** An array of fields in the layer. */ fields: Field[]; @@ -11262,6 +11382,8 @@ declare module "esri/opsdashboard/DataSourceProxy" { id: string; /** Read-only: Indicates if the last query failed and the data source is in a broken state. */ isBroken: boolean; + /** Read-only: The mapWidgetId of the data source. */ + mapWidgetId: string; /** Read-only: The name of the data source. */ name: string; /** Read-only: The name of the object id field. */ @@ -11279,6 +11401,8 @@ declare module "esri/opsdashboard/DataSourceProxy" { * @param query The query object to apply. */ executeQuery(query: Query): any; + /** An object that contains service level metadata about whether or not the layer supports queries using statistics, order by fields, DISTINCT, pagination, query with distance, and returning queries with extents. */ + getAdvancedQueryCapabilities(): any; /** Retrieve the associated data source that supports selection. */ getAssociatedSelectionDataSourceProxy(): any; /** Get the associated popupInfo for the data source if any available. */ @@ -11334,8 +11458,8 @@ declare module "esri/opsdashboard/ExtensionBase" { static POLYLINE: any; /** Read-only: Indicates if the host application is the Windows Operations Dashboard. */ isNative: boolean; - /** Get the collection of data sources from the host application. */ - getDataSourceProxies(): any; + /** Read-only: The URL to the ArcGIS.com site or in-house portal that you are currently signed in to. */ + portalUrl: string; /** Get the collection of data sources from the host application. */ getDataSourceProxies(): any; /** Get the data source corresponding to the data source id from the host application. */ @@ -11386,6 +11510,8 @@ declare module "esri/opsdashboard/ExtensionConfigurationBase" { /** ExtensionConfigurationBase is a base class used by all the extension configuration proxies. */ class ExtensionConfigurationBase extends ExtensionBase { + /** The object that will store the Widget/MapTool/FeatureAction configuration. */ + config: any; /** Indicates that the configuration is ready to be persisted or not. */ readyToPersistConfig: boolean; } @@ -11467,10 +11593,10 @@ declare module "esri/opsdashboard/GraphicsLayerProxy" { */ addOrUpdateGraphic(graphic: Graphic): void; /** - * Update a graphic in the host graphics layer with a new version. - * @param graphic The graphic to update in the host graphics layer. + * Update graphics in the host graphics layer with a new version. + * @param graphics The graphics to update in the host graphics layer. */ - addOrUpdateGraphics(graphic: Graphic): void; + addOrUpdateGraphics(graphics: Graphic[]): void; /** Removes all the graphics from the host graphics layer. */ clear(): void; /** @@ -11625,8 +11751,6 @@ declare module "esri/opsdashboard/WidgetConfigurationProxy" { /** WidgetConfigurationProxy is a class used to provide the configuration user experience for an operations dashboard extension widget. */ class WidgetConfigurationProxy extends ExtensionConfigurationBase { - /** The object that will store the widget configuration. */ - config: any; /** * Called by the host application when the user has changed the selected data source in the data source selector. * @param dataSourceProxy The selected data source. @@ -11639,7 +11763,7 @@ declare module "esri/opsdashboard/WidgetConfigurationProxy" { */ getDataSourceConfig(dataSourceProxyOrDataSourceId: DataSourceProxy | string): any; /** - * Called by the host application when the user has changed the slected map widget in the map widget selector. + * Called by the host application when the user has changed the selected map widget in the map widget selector. * @param mapWidgetProxy The selected map widget. */ mapWidgetSelectionChanged(mapWidgetProxy: MapWidgetProxy): void; @@ -11897,7 +12021,7 @@ declare module "esri/renderers/BlendRenderer" { import esri = require("esri"); import Symbol = require("esri/symbols/Symbol"); - /** (Currently in beta) BlendRenderer allows you to easily identify a predominant attribute among two or more competing attributes in a feature. */ + /** (Currently in beta) BlendRenderer allows you to easily identify the predominant attribute among two or more competing attributes of a feature and visualizes the strength of that predominance using blended colors. */ class BlendRenderer { /** This determines how colors are blended together. */ blendMode: string; @@ -12129,7 +12253,7 @@ declare module "esri/renderers/Renderer" { import Color = require("esri/Color"); import Symbol = require("esri/symbols/Symbol"); - /** The base class for the renderers - SimpleRenderer, ClassBreaksRenderer, UniqueValueRenderer, DotDensityRenderer, ScaleDependentRenderer, and TemporalRenderer used with a GraphicsLayer and FeatureLayer. */ + /** The base class for the renderers - SimpleRenderer, ClassBreaksRenderer, UniqueValueRenderer, DotDensityRenderer, ScaleDependentRenderer, TemporalRenderer, HeatmapRenderer, and VectorFieldRenderer used with a GraphicsLayer and FeatureLayer. */ class Renderer { /** An object defining a color ramp used to render the layer. */ colorInfo: any; @@ -12188,11 +12312,14 @@ declare module "esri/renderers/Renderer" { * @param info An object with the same properties as rotationInfo. */ setRotationInfo(info: any): Renderer; - /** Set size info of the renderer to modify the symbol size based on data value. */ - setSizeInfo(): Renderer; + /** + * Set size info of the renderer to modify the symbol size based on data value. + * @param info An object with the same properties as sizeInfo. + */ + setSizeInfo(info: any): Renderer; /** * Sets the renderer with the specified visualVariables. - * @param visualParams The specified visualVariables. + * @param visualParams The specified visualVariables. */ setVisualVariables(visualParams: any[]): void; /** Converts object to its ArcGIS Server JSON representation. */ @@ -12503,6 +12630,11 @@ declare module "esri/renderers/smartMapping" { * @param params See the object specifications table below for the structure of the params object. */ createClassedSizeRenderer(params: any): any; + /** + * Creates an object defining a color ramp used to render a layer. + * @param params See the object specifications table below for the structure of the params object. + */ + createColorInfo(params: any): any; /** * Creates a renderer for visualizing features using colors. * @param params See the object specifications table below for the structure of the params object. @@ -12518,6 +12650,16 @@ declare module "esri/renderers/smartMapping" { * @param params See the object specifications table below for the structure of the params object. */ createOpacityInfo(params: any): any; + /** + * Creates a renderer for identifying features by their color. + * @param params See the Object Specifications table below for the structure of the params object. + */ + createPredominanceRenderer(params: any): any; + /** + * Defines the size of the symbol where feature size is proportional to data value. + * @param params See the object specifications table below for the structure of the params object. + */ + createSizeInfo(params: any): any; /** * Creates a renderer for visualizing features by varying their size based on data. * @param params See the object specifications table below for the structure of the params object. @@ -13113,6 +13255,10 @@ declare module "esri/symbols/TextSymbol" { decoration: string; /** Font for displaying text. */ font: Font; + /** The halo color used for the text symbol.Known limitations:IE 9 and below not supported.Sub-pixel halo (i.e. */ + haloColor: Color; + /** The size (in pixel units) used if setting a halo on a text symbol.Known limitations:IE 9 and below not supported.Sub-pixel halo (i.e. */ + haloSize: number; /** Horizontal alignment of the text with respect to the graphic. */ horizontalAlignment: string; /** Determines whether to adjust the spacing between characters in the text string. */ @@ -13164,6 +13310,16 @@ declare module "esri/symbols/TextSymbol" { * @param font Text font. */ setFont(font: Font): TextSymbol; + /** + * Sets a halo color for the text symbol.NOTE: Known limitations when working with the text symbol halo:IE 9 and below not supported.Sub-pixel halo (i.e. + * @param color The color used for the text symbol halo. + */ + setHaloColor(color: Color): TextSymbol; + /** + * Sets the size of the halo (in pixels) used for the text symbol.NOTE: Known limitations when working with the text symbol halo:IE 9 and below not supported.Sub-pixel halo (i.e. + * @param size The size (in pixels) of the text symbol halo. + */ + setHaloSize(size: number): TextSymbol; /** * Updates the horizontal alignment of the text symbol. * @param alignment Horizontal alignment of the text with respect to the graphic. @@ -13658,6 +13814,8 @@ declare module "esri/tasks/FindParameters" { contains: boolean; /** An array of DynamicLayerInfos used to change the layer ordering or redefine the map. */ dynamicLayerInfos: DynamicLayerInfo[]; + /** Specifies the number of decimal places for the geometries returned by the query operation. */ + geometryPrecision: number; /** Array of layer definition expressions that allows you to filter the features of individual layers. */ layerDefinitions: string[]; /** The layers to perform the find operation on. */ @@ -13731,26 +13889,26 @@ declare module "esri/tasks/FindTask" { declare module "esri/tasks/GPMessage" { /** Represents a message generated during the execution of a geoprocessing task. */ class GPMessage { - /** esriJobMessageTypeAbort */ + /** esriJobMessageTypeAbort - Indicates the job has aborted. */ static TYPE_ABORT: any; - /** esriGPMessageTypeEmpty */ + /** esriJobMessageTypeEmpty - Indicates the task returned an empty result. */ static TYPE_EMPTY: any; - /** esriGPMessageTypeError */ + /** esriJobMessageTypeError - Indicates an error was returned during the execution of the job. */ static TYPE_ERROR: any; - /** esriGPMessageTypeInformative */ + /** esriJobMessageTypeInformative - Indicates the message is informative. */ static TYPE_INFORMATIVE: any; - /** TBA */ + /** esriJobMessageTypeProcessDefinition */ static TYPE_PROCESS_DEFINITION: any; - /** TBA */ + /** esriJobMessageTypeProcessStart - Indicates the GP process has started. */ static TYPE_PROCESS_START: any; - /** TBA */ + /** esriJobMessageTypeProcessStop - Indicates the GP process has stopped. */ static TYPE_PROCESS_STOP: any; - /** esriGPMessageTypeWarning */ + /** esriJobMessageTypeWarning - Indicates the message is a warning. */ static TYPE_WARNING: any; /** A description of the geoprocessing message. */ description: string; /** The geoprocessing message type. */ - type: number; + type: string; } export = GPMessage; } @@ -14127,7 +14285,7 @@ declare module "esri/tasks/Geoprocessor" { * @param callback The function to call when the method has completed. * @param errback An error object is returned if an error occurs on the Server during task execution. */ - checkJobStatus(jobId: string, callback?: Function, errback?: Function): void; + checkJobStatus(jobId: string, callback?: Function, errback?: Function): any; /** * Sends a request to the server to execute a synchronous GP task. * @param inputParameters The inputParameters argument specifies the input parameters accepted by the task and their corresponding values. @@ -14187,7 +14345,7 @@ declare module "esri/tasks/Geoprocessor" { * @param statusCallback Checks the current status of the job. * @param errback An error object is returned if an error occurs on the Server during task execution. */ - submitJob(inputParameters: any, callback?: Function, statusCallback?: Function, errback?: Function): void; + submitJob(inputParameters: any, callback?: Function, statusCallback?: Function, errback?: Function): any; /** Fires when an error occurs when executing the task. */ on(type: "error", listener: (event: { error: Error; target: Geoprocessor }) => void): esri.Handle; /** Fires when a synchronous GP task is completed. */ @@ -14231,6 +14389,8 @@ declare module "esri/tasks/IdentifyParameters" { dynamicLayerInfos: DynamicLayerInfo[]; /** The geometry used to select features during Identify. */ geometry: Geometry; + /** Specifies the number of decimal places for the geometries returned by the query operation. */ + geometryPrecision: number; /** Height of the map currently being viewed in pixels. */ height: number; /** Array of layer definition expressions that allows you to filter the features of individual layers. */ @@ -14403,6 +14563,28 @@ declare module "esri/tasks/ImageServiceMeasureParameters" { /** Defines parameters for the ImageServiceMeasureTask. */ class ImageServiceMeasureParameters { + /** Calculates the area and perimeter of given geometry. */ + static OPERATION_AREA_PERIMETER: any; + /** Calculates the area and perimeter of the given geometry using the DEM defined by the service to refine the calculation. */ + static OPERATION_AREA_PERIMETER_3D: any; + /** Calculates the height of a structure by measuring from the base of the structure to the top of the structure. */ + static OPERATION_BASE_TOP: any; + /** Calculates the height of a structure by measuring from the base of the structure to the top of the structure's shadow on the ground. */ + static OPERATION_BASE_TOP_SHADOW: any; + /** Calculates the centroid of a given area. */ + static OPERATION_CENTROID: any; + /** Calculates the centroid of a given area, using the DEM defined by the service to refine the calculation. */ + static OPERATION_CENTROID_3D: any; + /** Calculates the distance and azimuth angle between two points. */ + static OPERATION_DISTANCE_ANGLE: any; + /** Calculates the distance and azimuth angle between two points using the DEM defined by the service to refine the calculation. */ + static OPERATION_DISTANCE_ANGLE_3D: any; + /** Measures the location of a given point. */ + static OPERATION_POINT: any; + /** Measures the location of a given point, using the DEM defined by the service to refine the calculation. */ + static OPERATION_POINT_3D: any; + /** Calculates the height of a structure by measuring from the top of the structure to the top of the structure's shadow on the ground. */ + static OPERATION_TOP_TOP_SHADOW: any; /** The angular unit in which directions of line segments will be calculated. */ angularUnit: string; /** The area unit in which areas of polygons will be calculated. */ @@ -14613,6 +14795,8 @@ declare module "esri/tasks/ParameterValue" { class ParameterValue { /** Specifies the type of data for the parameter. */ dataType: string; + /** The name of the output parameter as defined by the geoprocessing task in the Services Directory. */ + paramName: string; /** The value of the parameter. */ value: any; } @@ -14707,7 +14891,7 @@ declare module "esri/tasks/ProjectParameters" { geometries: Geometry[]; /** The spatial reference to which you are projecting the geometries. */ outSR: SpatialReference; - /** The well-known id {wkid:number} or well-known text {wkt:string} or for the datum transfomation to be applied on the projected geometries. */ + /** The well-known id {wkid:number} or well-known text {wkt:string} or for the datum transformation to be applied on the projected geometries. */ transformation: any; /** Indicates whether to transform forward or not. */ transformForward: boolean; @@ -15331,6 +15515,8 @@ declare module "esri/tasks/datareviewer/BatchValidationTask" { executeJob(parameters: BatchValidationParameters): any; /** Retrieves all adhoc jobs from the server and returns an array of BatchValidationJob with the information. */ getAdhocJobsList(): any; + /** Returns an array of custom field names defined in a Reviewer workspace. */ + getCustomFieldNames(): any; /** * Fetches Batch Validation Job details. * @param jobId Job Id of the batch validation job. @@ -15373,19 +15559,21 @@ declare module "esri/tasks/datareviewer/BatchValidationTask" { /** Fires when the executeJob method is complete. */ on(type: "execute-job", listener: (event: { jobId: string; target: BatchValidationTask }) => void): esri.Handle; /** Fires when the getAdhocJobsList method is complete. */ - on(type: "get-adhoc-jobs-list", listener: (event: { adhocJobs: any[]; target: BatchValidationTask }) => void): esri.Handle; + on(type: "get-adhoc-jobs-list", listener: (event: { adhocJobs: BatchValidationJob[]; target: BatchValidationTask }) => void): esri.Handle; + /** Fires when the getCustomFieldNames method is complete. */ + on(type: "get-custom-field-names", listener: (event: { customFieldNames: string[]; target: BatchValidationTask }) => void): esri.Handle; /** Fires when the getJobDetails method is complete. */ on(type: "get-job-details", listener: (event: { jobDetails: BatchValidationJob; target: BatchValidationTask }) => void): esri.Handle; /** Fires when the getJobExecutionDetails method is complete. */ on(type: "get-job-execution-details", listener: (event: { jobInfo: BatchValidationJobInfo; target: BatchValidationTask }) => void): esri.Handle; /** Fires when the getJobIds method is complete. */ - on(type: "get-job-ids", listener: (event: { adhocJobs: any[]; scheduledJobs: any[]; target: BatchValidationTask }) => void): esri.Handle; + on(type: "get-job-ids", listener: (event: { adhocJobs: string[]; scheduledJobs: string[]; target: BatchValidationTask }) => void): esri.Handle; /** Fires when the getLifecycleStatusStrings method is complete. */ - on(type: "get-lifecycle-status-strings", listener: (event: { lifecycleStatusStrings: any[]; target: BatchValidationTask }) => void): esri.Handle; + on(type: "get-lifecycle-status-strings", listener: (event: { lifecycleStatusStrings: string[]; target: BatchValidationTask }) => void): esri.Handle; /** Fires when the getReviewerSessions method is complete. */ - on(type: "get-reviewer-sessions", listener: (event: { reviewerSessions: any[]; target: BatchValidationTask }) => void): esri.Handle; + on(type: "get-reviewer-sessions", listener: (event: { reviewerSessions: ReviewerSession[]; target: BatchValidationTask }) => void): esri.Handle; /** Fires when the getScheduledJobsList method is complete. */ - on(type: "get-scheduled-jobs-list", listener: (event: { scheduledJobs: any[]; target: BatchValidationTask }) => void): esri.Handle; + on(type: "get-scheduled-jobs-list", listener: (event: { scheduledJobs: BatchValidationJob[]; target: BatchValidationTask }) => void): esri.Handle; /** Fires when the scheduleJob method is complete. */ on(type: "schedule-job", listener: (event: { jobId: string; target: BatchValidationTask }) => void): esri.Handle; on(type: string, listener: (event: any) => void): esri.Handle; @@ -15435,6 +15623,8 @@ declare module "esri/tasks/datareviewer/DashboardTask" { * @param sessionOptions Session properties to be used to create the session. */ createReviewerSession(sessionName: string, sessionOptions: SessionOptions): any; + /** Returns an array of custom field names defined in a Reviewer workspace. */ + getCustomFieldNames(): any; /** Requests Dashboard results field names. */ getDashboardFieldNames(): any; /** @@ -15453,14 +15643,16 @@ declare module "esri/tasks/datareviewer/DashboardTask" { on(type: "create-reviewer-sessions", listener: (event: { reviewerSession: ReviewerSession; target: DashboardTask }) => void): esri.Handle; /** Fires when an error occurs during a DashboardTask method execution. */ on(type: "error", listener: (event: { error: Error; target: DashboardTask }) => void): esri.Handle; + /** Fires when the getCustomFieldNames method is complete. */ + on(type: "get-custom-field-names", listener: (event: { customFieldNames: string[]; target: DashboardTask }) => void): esri.Handle; /** Fires when the getDashboardFieldNames method is complete. */ - on(type: "get-dashboard-field-names", listener: (event: { fieldNames: any[]; target: DashboardTask }) => void): esri.Handle; + on(type: "get-dashboard-field-names", listener: (event: { fieldNames: string[]; target: DashboardTask }) => void): esri.Handle; /** Fires when the getDashboardResults method is complete. */ on(type: "get-dashboard-results", listener: (event: { dashboardResult: DashboardResult; target: DashboardTask }) => void): esri.Handle; /** Fires when the getLifecycleStatusStrings method is complete. */ - on(type: "get-lifecycle-status-strings", listener: (event: { lifecycleStatusStrings: any[]; target: DashboardTask }) => void): esri.Handle; + on(type: "get-lifecycle-status-strings", listener: (event: { lifecycleStatusStrings: string[]; target: DashboardTask }) => void): esri.Handle; /** Fires when the getReviewerSessions method is complete. */ - on(type: "get-reviewer-sessions", listener: (event: { reviewerSessions: any[]; target: DashboardTask }) => void): esri.Handle; + on(type: "get-reviewer-sessions", listener: (event: { reviewerSessions: ReviewerSession[]; target: DashboardTask }) => void): esri.Handle; on(type: string, listener: (event: any) => void): esri.Handle; } export = DashboardTask; @@ -15542,8 +15734,8 @@ declare module "esri/tasks/datareviewer/ReviewerFilters" { } declare module "esri/tasks/datareviewer/ReviewerLifecycle" { - /** The ReviewerLifecycle class specifies constant values for all lifecycle status and lifecycle phase strings within the Reviewer quality control workflow. */ - class ReviewerLifecycle { + /** The ReviewerLifecycle object specifies constant values for all lifecycle status and lifecycle phase strings within the Reviewer quality control workflow. */ + var ReviewerLifecycle: { /** Acceptable lifecycleStatus code = 4 belongs to Verification Phase. */ ACCEPTABLE: number; /** Code for Correction Phase. */ @@ -15600,7 +15792,7 @@ declare module "esri/tasks/datareviewer/ReviewerLifecycle" { * @param lifecycleStatus The lifecycle status code. */ toLifecycleStatusString(lifecycleStatus: number): string; - } + }; export = ReviewerLifecycle; } @@ -15614,6 +15806,7 @@ declare module "esri/tasks/datareviewer/ReviewerResultsTask" { import Geometry = require("esri/geometry/Geometry"); import ReviewerSession = require("esri/tasks/datareviewer/ReviewerSession"); import FeatureSet = require("esri/tasks/FeatureSet"); + import FeatureEditResult = require("esri/layers/FeatureEditResult"); /** ReviewerResults allows access to the reviewer workspace. */ class ReviewerResultsTask { @@ -15633,6 +15826,8 @@ declare module "esri/tasks/datareviewer/ReviewerResultsTask" { * @param batchRunIds Array of batchRunIds used to get batch run details. */ getBatchRunDetails(batchRunIds: any[]): any; + /** Returns an array of custom field names defined in a Reviewer workspace. */ + getCustomFieldNames(): any; /** * Utility operation that returns a where clause given a set of input filters. * @param filters An instance of ReviewerFilters used to create a layer definition. @@ -15646,8 +15841,10 @@ declare module "esri/tasks/datareviewer/ReviewerResultsTask" { * @param filters Instance of ReviewerFilters used to query reviewer results. */ getResults(getResultsQueryParameters: GetResultsQueryParameters, filters?: ReviewerFilters): any; + /** Retrieves a list of field names that can be used to fetch or query results from reviewer workspace. */ + getResultsFieldNames(): string[]; /** Extracts the MapServer url from the full ArcGIS Data Reviewer for Server SOE url. */ - getReviewerMapServerUrl(): any; + getReviewerMapServerUrl(): string; /** Returns an array of sessions in a Reviewer workspace. */ getReviewerSessions(): any; /** @@ -15676,16 +15873,18 @@ declare module "esri/tasks/datareviewer/ReviewerResultsTask" { on(type: "error", listener: (event: { error: Error; target: ReviewerResultsTask }) => void): esri.Handle; /** Fires when the getBatchRunDetails method is complete. */ on(type: "get-batch-run-details", listener: (event: { featureSet: FeatureSet; target: ReviewerResultsTask }) => void): esri.Handle; + /** Fires when the getCustomFieldNames method is complete. */ + on(type: "get-custom-field-names", listener: (event: { customFieldNames: string[]; target: ReviewerResultsTask }) => void): esri.Handle; /** Fires when the getLayerDefinition method is complete. */ on(type: "get-layer-definition", listener: (event: { whereClause: string; target: ReviewerResultsTask }) => void): esri.Handle; /** Fires when the getLifecycleStatusStrings method is complete. */ - on(type: "get-lifecycle-status-strings", listener: (event: { lifecycleStatusStrings: any[]; target: ReviewerResultsTask }) => void): esri.Handle; + on(type: "get-lifecycle-status-strings", listener: (event: { lifecycleStatusStrings: string[]; target: ReviewerResultsTask }) => void): esri.Handle; /** Fires when the getResults method is complete. */ on(type: "get-results", listener: (event: { featureSet: FeatureSet; target: ReviewerResultsTask }) => void): esri.Handle; /** Fires when the getReviewerSessions method is complete. */ - on(type: "get-reviewer-sessions", listener: (event: { reviewerSessions: any[]; target: ReviewerResultsTask }) => void): esri.Handle; + on(type: "get-reviewer-sessions", listener: (event: { reviewerSessions: ReviewerSession[]; target: ReviewerResultsTask }) => void): esri.Handle; /** Fires when the updateLifecycleStatus method is complete. */ - on(type: "update-lifecycle-status", listener: (event: { featureEditResults: any[]; target: ReviewerResultsTask }) => void): esri.Handle; + on(type: "update-lifecycle-status", listener: (event: { featureEditResults: FeatureEditResult[]; target: ReviewerResultsTask }) => void): esri.Handle; /** Fires when the writeFeatureAsResult method is complete. */ on(type: "write-feature-as-result", listener: (event: { success: boolean; target: ReviewerResultsTask }) => void): esri.Handle; /** Fires when the writeResult method is complete. */ 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/asana/asana-tests.ts b/asana/asana-tests.ts new file mode 100644 index 000000000..050fbb36f --- /dev/null +++ b/asana/asana-tests.ts @@ -0,0 +1,104 @@ +/// +/// + +import * as asana from 'asana'; +import * as util from 'util'; + +let version: string = asana.VERSION; + +// https://github.com/Asana/node-asana#usage +// Usage + +var client = asana.Client.create().useAccessToken('my_access_token'); +client.users.me().then(function(me) { + console.log(me); +}); + +client = asana.Client.create({ + clientId: 123, + clientSecret: 'my_client_secret', + redirectUri: 'my_redirect_uri' +}); + +client.useOauth({ + credentials: 'my_access_token' +}); + +var credentials = { + // access_token: 'my_access_token', + refresh_token: 'my_refresh_token' +}; + +client.useOauth({ + credentials: credentials +}); + +// https://github.com/Asana/node-asana#collections +// Collections + +let tagId: string = null; +client.tasks.findByTag(tagId, { limit: 5 }).then((collection: any) => { + console.log(collection.data); + // [ .. array of up to 5 task objects .. ] + + client.tasks.findByTag(tagId).then((firstPage: any) => { + console.log(firstPage.data); + collection.nextPage().then((secondPage: any) => { + console.log(secondPage.data); + }); + }); +}); + +client.tasks.findByTag(tagId).then((collection: any) => { + // Fetch up to 200 tasks, using multiple pages if necessary + collection.fetch(200).then((tasks: any) => { + console.log(tasks); + }); +}); + +client.tasks.findByTag(tagId).then((collection: any) => { + collection.stream().on('data', (task: any) => { + console.log(task); + }); +}); + +// https://github.com/Asana/node-asana#examples +// Examples + +var Asana = asana; + +// Using the API key for basic authentication. This is reasonable to get +// started with, but Oauth is more secure and provides more features. +var client = Asana.Client.create().useBasicAuth(process.env.ASANA_API_KEY); + +client.users.me() + .then((user: any) => { + var userId = user.id; + // The user's "default" workspace is the first one in the list, though + // any user can have multiple workspaces so you can't always assume this + // is the one you want to work with. + var workspaceId = user.workspaces[0].id; + return client.tasks.findAll({ + assignee: userId, + workspace: workspaceId, + completed_since: 'now', + opt_fields: 'id,name,assignee_status,completed' + }); + }) + .then((response: any) => { + // There may be more pages of data, we could stream or return a promise + // to request those here - for now, let's just return the first page + // of items. + return response.data; + }) + .filter((task: any) => { + return task.assignee_status === 'today' || + task.assignee_status === 'new'; + }) + .then((list: any) => { + console.log(util.inspect(list, { + colors: true, + depth: null + })); + }); + diff --git a/asana/asana.d.ts b/asana/asana.d.ts new file mode 100644 index 000000000..85e202788 --- /dev/null +++ b/asana/asana.d.ts @@ -0,0 +1,2199 @@ +// Type definitions for node-asana 0.14.0 +// Project: https://github.com/Asana/node-asana +// Definitions by: Qubo +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare module "asana" { + import * as Promise from 'bluebird'; + import {CoreOptions} from 'request'; + import * as request from 'request'; + + namespace asana { + var Client: ClientStatic; + + interface ClientStatic { + /** + * Constructs a Client with instances of all the resources using the dispatcher. + * It also keeps a reference to the dispatcher so that way the end user can have + * access to it. + * @class + * @classdesc A wrapper for the Asana API which is authenticated for one user + * @param {Dispatcher} dispatcher The request dispatcher to use + * @param {Object} options Options to configure the client + * @param {String} [clientId] ID of the client, required for Oauth + * @param {String} [clientSecret] Secret key, for some Oauth flows + * @param {String} [redirectUri] Default redirect URI for this client + * @param {String} [asanaBaseUrl] Base URL for Asana, for debugging + */ + (dispatcher: Dispatcher, options?: ClientOptions): asana.Client; + /** + * Creates a new client. + * @param {Object} options Options for specifying the client, see constructor. + */ + create(options?: ClientOptions): Client; + } + + /** Options to configure the client */ + interface ClientOptions extends DispatcherOptions { + clientId?: string|number; + clientSecret?: string; + redirectUri?: string; + asanaBaseUrl?: string; + } + + interface Client { + /** + * Ensures the client is authorized to make requests. Kicks off the + * configured Oauth flow, if any. + * + * @returns {Promise} A promise that resolves to this client when + * authorization is complete. + */ + authorize(): Promise; + + /** + * Configure the Client to use a user's API Key and then authenticate + * through HTTP Basic Authentication. This should only be done for testing, + * as requests using Oauth can provide more security, higher rate limits, and + * more features. + * @param {String} apiKey The Asana Api Key of the user + * @return {Client} this + * @param apiKey + * @return + */ + useBasicAuth(apiKey: string): this; + + /** + * Configure the client to authenticate using a Personal Access Token. + * @param {String} accessToken The Personal Access Token to use for + * authenticating requests. + * @return {Client} this + * @param accessToken + * @return + */ + useAccessToken(accessToken: string): this; + + /** + * Configure the client to authenticate via Oauth. Credentials can be + * supplied, or they can be obtained by running an Oauth flow. + * @param {Object} options Options for Oauth. Includes any options for + * the selected flow. + * @option {Function} [flowType] Type of OauthFlow to use to obtain user + * authorization. Defaults to autodetect based on environment. + * @option {Object} [credentials] Credentials to use; no flow required to + * obtain authorization. This object should at a minimum contain an + * `access_token` string field. + * @return {Client} this + * @param options + * @return + */ + useOauth(options?: auth.OauthAuthenticatorOptions): this; + + /** + * The internal dispatcher. This is mostly used by the resources but provided + * for custom requests to the API or API features that have not yet been added + * to the client. + * @type {Dispatcher} + */ + dispatcher: Dispatcher; + /** + * An instance of the Attachments resource. + * @type {Attachments} + */ + attachments: resources.Attachments; + /** + * An instance of the Events resource. + * @type {Events} + */ + events: resources.Events; + /** + * An instance of the Projects resource. + * @type {Projects} + */ + projects: resources.Projects; + /** + * An instance of the Stories resource. + * @type {Stories} + */ + stories: resources.Stories; + /** + * An instance of the Tags resource. + * @type {Tags} + */ + tags: resources.Tags; + /** + * An instance of the Tasks resource. + * @type {Tasks} + */ + tasks: resources.Tasks; + /** + * An instance of the Teams resource. + * @type {Teams} + */ + teams: resources.Teams; + /** + * An instance of the Users resource. + * @type {Users} + */ + users: resources.Users; + /** + * An instance of the Workspaces resource. + * @type {Workspaces} + */ + workspaces: resources.Workspaces; + /** + * Store off Oauth info. + */ + app: auth.App; + } + + var Dispatcher: DispatcherStatic; + + interface DispatcherStatic { + /** + * Creates a dispatcher which will act as a basic wrapper for making HTTP + * requests to the API, and handle authentication. + * @class + * @classdesc A HTTP wrapper for the Asana API + * @param {Object} options for default behavior of the Dispatcher + * @option {Authenticator} [authenticator] Object to use for authentication. + * Can also be set later with `setAuthenticator`. + * @option {String} [retryOnRateLimit] Automatically handle `RateLimitEnforced` + * errors by sleeping and retrying after the waiting period. + * @option {Function} [handleUnauthorized] Automatically handle + * `NoAuthorization` with the callback. If the callback returns `true` + * (or a promise resolving to `true), will retry the request. + * @option {String} [asanaBaseUrl] Base URL for Asana, for debugging + * @option {Number} [requestTimeout] Timeout (in milliseconds) to wait for the + * request to finish. + */ + new (options?: DispatcherOptions): Dispatcher; + + /** + * Default handler for requests that are considered unauthorized. + * Requests that the authenticator try to refresh its credentials if + * possible. + * @return {Promise} True iff refresh was successful, false if not. + * @return + */ + maybeReauthorize(): Promise; + + /** + * The relative API path for the current version of the Asana API. + * @type {String} + */ + API_PATH : string; + } + + interface DispatcherOptions { + authenticator?: auth.Authenticator; + retryOnRateLimit?: boolean; + handleUnauthorized?: () => boolean|Promise; + requestTimeout?: string; + } + + interface Dispatcher { + /** + * Creates an Asana API Url by concatenating the ROOT_URL with path provided. + * @param {String} path The path + * @return {String} The url + * @param path + * @return + */ + url(path: string): string; + + /** + * Configure the authentication mechanism to use. + * @returns {Dispatcher} this + * @param authenticator + * @return + */ + setAuthenticator(authenticator: auth.Authenticator): this; + + /** + * Ensure the dispatcher is authorized to make requests. Call this before + * making any API requests. + * + * @returns {Promise} Resolves when the dispatcher is authorized, rejected if + * there was a problem authorizing. + * @return + */ + authorize(): Promise; + + /** + * Dispatches a request to the Asana API. The request parameters are passed to + * the request module. + * @param {Object} params The params for request + * @param {Object} [dispatchOptions] Options for handling request/response + * @return {Promise} The response for the request + * @param params + * @param dispatchOptions? + * @return + */ + dispatch(params: any, dispatchOptions?: any): Promise; + + /** + * Dispatches a GET request to the Asana API. + * @param {String} path The path of the API + * @param {Object} [query] The query params + * @param {Object} [dispatchOptions] Options for handling the request and + * response. See `dispatch`. + * @return {Promise} The response for the request + * @param path + * @param query? + * @param dispatchOptions? + * @return + */ + get(path: string, query?: any, dispatchOptions?: any): Promise; + + /** + * Dispatches a POST request to the Asana API. + * @param {String} path The path of the API + * @param {Object} data The data to be sent + * @param {Object} [dispatchOptions] Options for handling the request and + * response. See `dispatch`. + * @return {Promise} The response for the request + * @param path + * @param data + * @param dispatchOptions? + * @return + */ + post(path: string, data: any, dispatchOptions?: any): Promise; + + /** + * Dispatches a PUT request to the Asana API. + * @param {String} path The path of the API + * @param {Object} data The data to be sent + * @param {Object} [dispatchOptions] Options for handling the request and + * response. See `dispatch`. + * @return {Promise} The response for the request + * @param path + * @param data + * @param dispatchOptions? + * @return + */ + put(path: string, data: any, dispatchOptions?: any): Promise; + + /** + * Dispatches a DELETE request to the Asana API. + * @param {String} path The path of the API + * @param {Object} [dispatchOptions] Options for handling the request and + * response. See `dispatch`. + * @return {Promise} The response for the request + * @param path + * @param dispatchOptions? + * @return + */ + delete(path: string, dispatchOptions?: any): Promise; + + /** + * The base URL for Asana + * @type {String} + */ + asanaBaseUrl : string; + + /** + * Whether requests should be automatically retried if rate limited. + * @type {Boolean} + */ + retryOnRateLimit : boolean; + + /** + * Handler for unauthorized requests which may seek reauthorization. + * Default behavior is available if configured with an Oauth authenticator + * that has a refresh token, and will refresh the current access token. + * @type {Function} + */ + handleUnauthorized : () => boolean|Promise; + + /** + * The amount of time in milliseconds to wait for a request to finish. + * @type {Number} + */ + requestTimeout : number; + } + + namespace auth { + var BasicAuthenticator: BasicAuthenticatorStatic; + + interface BasicAuthenticatorStatic { + /** + * @param apiKey + */ + new (apiKey: string): BasicAuthenticator; + } + + interface BasicAuthenticator extends Authenticator { + /** + * @param {Object} request The request to modify, for the `request` library. + * @return {Object} The `request` parameter, modified to include authentication + * information using the stored credentials. + * @param request + * @return + */ + authenticateRequest(request: BasicAuthenticatorRequest): BasicAuthenticatorRequest; + } + + interface BasicAuthenticatorRequest { + auth : { + username : string; + password : string; + } + } + + var OauthAuthenticator: OauthAuthenticatorStatic; + + interface OauthAuthenticatorStatic { + /** + * Creates an authenticator that uses Oauth for authentication. + * + * @param {Object} options Configure the authenticator; must specify one + * of `flow` or `credentials`. + * @option {App} app The app being authenticated for. + * @option {OauthFlow} [flow] The flow to use to get credentials + * when needed. + * @option {String|Object} [credentials] Initial credentials to use. This can + * be either the object returned from an access token request (which + * contains the token and some other metadata) or just the `access_token` + * field. + * @constructor + */ + new (options: OauthAuthenticatorOptions): OauthAuthenticator; + } + + interface OauthAuthenticatorOptions { + flowType?: auth.FlowType; + credentials?: Credentials|string; + } + + interface Credentials { + access_token?: string; + refresh_token?: string; + } + + interface OauthAuthenticator extends Authenticator { + /** + * @param {Object} request The request to modify, for the `request` library. + * @return {Object} The `request` parameter, modified to include authentication + * information using the stored credentials. + * @param request + * @return + */ + authenticateRequest(request: OauthAuthenticatorRequest): OauthAuthenticatorRequest; + } + + interface OauthAuthenticatorRequest { + /** + * When browserify-d, the `auth` component of the `request` library + * doesn't work so well, so we just manually set the bearer token instead. + */ + headers : { + Authorization : string; + } + } + + /** + * A layer to abstract the differences between using different types of + * authentication (Oauth vs. Basic). The Authenticator is responsible for + * establishing credentials and applying them to outgoing requests. + * @constructor + */ + interface Authenticator { + /** + * Establishes credentials. + * + * @return {Promise} Resolves when initial credentials have been + * completed and `authenticateRequest` calls can expect to succeed. + * @return + */ + establishCredentials(): Promise; + + /** + * Attempts to refresh credentials, if possible, given the current credentials. + * + * @return {Promise} Resolves to `true` if credentials have been successfully + * established and `authenticateRequests` can expect to succeed, else + * resolves to `false`. + * @return + */ + refreshCredentials(): Promise; + } + + var App: AppStatic; + + interface AppStatic { + /** + * An abstraction around an App used with Asana. + * + * @options {Object} Options to construct the app + * @option {String} clientId The ID of the app + * @option {String} [clientSecret] The secret key, if available here + * @option {String} [redirectUri] The default redirect URI + * @option {String} [scope] Scope to use, supports `default` and `scim` + * @option {String} [asanaBaseUrl] Base URL to use for Asana, for debugging + * @constructor + */ + new (options: AppOptions): App; + } + + interface AppOptions extends AsanaAuthorizeUrlOptions { + clientId?: string|number; + clientSecret?: string; + scope?: string; + } + + interface App { + /** + * @param {Object} options Overrides to the app's defaults + * @option {String} asanaBaseUrl + * @option {String} redirectUri + * @returns {String} The URL used to authorize a user for the app. + * @param options + * @return + */ + asanaAuthorizeUrl(options?: AsanaAuthorizeUrlOptions): string; + + /** + * @param {Object} options Overrides to the app's defaults + * @option {String} asanaBaseUrl + * @option {String} redirectUri + * @returns {String} The URL used to acquire an access token. + * @param options + * @return + */ + asanaTokenUrl(options?: AsanaAuthorizeUrlOptions): string; + + /** + * @param {String} code An authorization code obtained via `asanaAuthorizeUrl`. + * @param {Object} options Overrides to the app's defaults + * @option {String} asanaBaseUrl + * @option {String} redirectUri + * @return {Promise} The token, which will include the `access_token` + * used for API access, as well as a `refresh_token` which can be stored + * to get a new access token without going through the flow again. + * @param code + * @param options + * @return + */ + accessTokenFromCode(code: string, options?: AsanaAuthorizeUrlOptions): Promise; + + /** + * @param {String} refreshToken A refresh token obtained via Oauth. + * @param {Object} options Overrides to the app's defaults + * @option {String} asanaBaseUrl + * @option {String} redirectUri + * @return {Promise} The token, which will include the `access_token` + * used for API access. + * @param refreshToken + * @param options + * @return + */ + accessTokenFromRefreshToken(refreshToken: string, options: AsanaAuthorizeUrlOptions): Promise; + + scope : string; + + asanaBaseUrl : string; + } + + interface AsanaAuthorizeUrlOptions { + redirectUri?: string; + asanaBaseUrl?: string; + } + + var OauthError: OauthErrorStatic; + + interface OauthErrorStatic { + /** + * @param options {Object} A data blob parsed from a query string or JSON + * response from the Asana API + * @option {String} error The string code identifying the error. + * @option {String} [error_uri] A link to help and information about the error. + * @option {String} [error_description] A description of the error. + * @constructor + */ + new (options: OauthErrorOptions): OauthError; + } + + interface OauthErrorOptions { + error?: string; + error_uri?: string; + error_description?: string; + } + + interface OauthError extends Error { + } + + /** + * Auto-detects the type of Oauth flow to use that's appropriate to the + * environment. + * + * @returns {Function|null} The type of Oauth flow to use, or null if no + * appropriate type could be determined. + * @param env + * @return + */ + function autoDetect(env: any): Function; + + var RedirectFlow: RedirectFlowStatic; + + interface RedirectFlowStatic extends FlowType { + /** + * An Oauth flow that runs in the browser and requests user authorization by + * redirecting to an authorization page on Asana, and redirecting back with + * the credentials. + * @param {Object} options See `BaseBrowserFlow` for options. + * @constructor + */ + new (options: any): RedirectFlow; + } + + interface RedirectFlow extends BaseBrowserFlow { + } + + var PopupFlow: PopupFlowStatic; + + interface PopupFlowStatic extends FlowType { + /** + * An Oauth flow that runs in the browser and requests user authorization by + * popping up a window and prompting the user. + * @param {Object} options See `BaseBrowserFlow` for options. + * @constructor + */ + new (options: any): PopupFlow; + } + + interface PopupFlow extends BaseBrowserFlow { + /** + * @param popupWidth + * @param popupHeight + */ + _popupParams(popupWidth: number, popupHeight: number): void; + + runReceiver(): void; + } + + var NativeFlow: NativeFlowStatic; + + interface NativeFlowStatic extends FlowType { + /** + * An Oauth flow that can be run from the console or an app that does + * not have the ability to open and manage a browser on its own. + * @param {Object} options + * @option {App} app App to authenticate for + * @option {String function(String)} [instructions] Function returning the + * instructions to output to the user. Passed the authorize url. + * @option {String function()} [prompt] String to output immediately before + * waiting for a line from stdin. + * @constructor + */ + new (options: any): NativeFlow; + } + + interface NativeFlow extends Flow { + /** + * Run the Oauth flow, prompting the user to go to the authorization URL + * and enter the code it displays when finished. + * + * @return {Promise} The access token object, which will include + * `access_token` and `refresh_token`. + */ + run(): void; + + /** + * @param {String} code An authorization code obtained via `asanaAuthorizeUrl`. + * @return {Promise} The token, which will include the `access_token` + * used for API access, as well as a `refresh_token` which can be stored + * to get a new access token without going through the flow again. + * @param code + */ + accessToken(code: string): void; + + /** + * @return {Promise} The access token, which will include a refresh token + * that can be stored in the future to create a client without going + * through the Oauth flow. + * @param url + * @return + */ + promptForCode(url: string): any; + } + + var ChromeExtensionFlow: ChromeExtensionFlowStatic; + + interface ChromeExtensionFlowStatic extends FlowType { + /** + * An Oauth flow that runs in a Chrome browser extension and requests user + * authorization by opening a temporary tab to prompt the user. + * @param {Object} options See `BaseBrowserFlow` for options, plus the below: + * @options {String} [receiverPath] Full path and filename from the base + * directory of the extension to the receiver page. This is an HTML file + * that has been made web-accessible, and that calls the receiver method + * `Asana.auth.ChromeExtensionFlow.runReceiver();`. + * @constructor + */ + new (options: any): ChromeExtensionFlow; + } + + interface ChromeExtensionFlow extends BaseBrowserFlow { + /** + * Runs the receiver code to send the Oauth result to the requesting tab. + */ + runReceiver(): void; + } + + var BaseBrowserFlow: BaseBrowserFlowStatic; + + interface BaseBrowserFlowStatic extends FlowType { + /** + * A base class for any flow that runs in the browser. All subclasses use the + * "implicit grant" flow to authenticate via the browser. + * @param {Object} options + * @option {App} app The app this flow is for + * @option {String} [redirectUri] The URL that Asana should redirect to once + * user authorization is complete. Defaults to the URL configured in + * the app, and if none then the current page URL. + * @constructor + */ + new (options: any): BaseBrowserFlow; + } + + interface BaseBrowserFlow extends Flow { + /** + * @param {String} authUrl The URL the user should be navigated to in order + * to authorize the app. + * @param {String} state The unique state generated for this auth request. + * @return {Promise} Resolved when authorization has successfully started, + * i.e. the user has been navigated to a page requesting authorization. + * @param authUrl + * @param state + * @return + */ + startAuthorization(authUrl: string, state: string): any; + + /** + * @return {Promise} Credentials returned from Oauth. + * @param state + */ + finishAuthorization(state: string): void; + + /** + * @return {String} The URL to redirect to that will receive the + * @return + */ + receiverUrl(): string; + + /** + * @return {String} The URL to redirect to that will receive the + * @return + */ + asanaBaseUrl(): string; + + /** + * @returns {String} Generate a new unique state parameter for a request. + * @return + */ + getStateParam(): string; + } + + interface FlowType { + new (options: any): Flow; + } + + interface Flow { + /** + * @returns {String} The URL used to authorize the user for the app. + * @return + */ + authorizeUrl(): string; + + /** + * Run the appropriate parts of the Oauth flow, attempting to establish user + * authorization. + * @returns {Promise} A promise that resolves to the Oauth credentials. + */ + run(): void; + } + } + + namespace errors { + class AsanaError extends Error { + /** + * @param message + * @return + */ + constructor(message: any); + + code: number; + value: any; + } + + class Forbidden extends AsanaError { + /** + * @param value + * @return + */ + constructor(value: any); + } + + + class InvalidRequest extends AsanaError { + /** + * @param value + * @return + */ + constructor(value: any); + } + + class NoAuthorization extends AsanaError { + /** + * @param value + * @return + */ + constructor(value: any); + } + + class NotFound extends AsanaError { + /** + * @param value + * @return + */ + constructor(value: any); + } + + class RateLimitEnforced extends AsanaError { + /** + * @param value + * @return + */ + constructor(value: any); + } + + class ServerError extends AsanaError { + /** + * @param value + * @return + */ + constructor(value: any); + } + } + + namespace resources { + /** + * An _attachment_ object represents any file attached to a task in Asana, + * whether it's an uploaded file or one associated via a third-party service + * such as Dropbox or Google Drive. + * @class + * @param {Dispatcher} dispatcher The API dispatcher + */ + class Attachments extends Resource { + /** + * @param dispatcher + */ + constructor(dispatcher: Dispatcher); + + /** + * * Returns the full record for a single attachment. + * * @param {String} attachment Globally unique identifier for the attachment. + * * @param {Object} [params] Parameters for the request + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The requested resource + * @param attachment + * @param params? + * @param dispatchOptions? + * @return + */ + findById(attachment: string, params?: any, dispatchOptions?: any): Promise; + + /** + * * Returns the compact records for all attachments on the task. + * * @param {String} task Globally unique identifier for the task. + * * @param {Object} [params] Parameters for the request + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param task + * @param params? + * @param dispatchOptions? + * @return + */ + findByTask(task: string, params?: any, dispatchOptions?: any): Promise; + } + + /** + * An _event_ is an object representing a change to a resource that was observed + * by an event subscription. + * + * In general, requesting events on a resource is faster and subject to higher + * rate limits than requesting the resource itself. Additionally, change events + * bubble up - listening to events on a project would include when stories are + * added to tasks in the project, even on subtasks. + * + * Establish an initial sync token by making a request with no sync token. + * The response will be a `412` error - the same as if the sync token had + * expired. + * + * Subsequent requests should always provide the sync token from the immediately + * preceding call. + * + * Sync tokens may not be valid if you attempt to go 'backward' in the history + * by requesting previous tokens, though re-requesting the current sync token + * is generally safe, and will always return the same results. + * + * When you receive a `412 Precondition Failed` error, it means that the + * sync token is either invalid or expired. If you are attempting to keep a set + * of data in sync, this signals you may need to re-crawl the data. + * + * Sync tokens always expire after 24 hours, but may expire sooner, depending on + * load on the service. + * @class + * @param {Dispatcher} dispatcher The API dispatcher + */ + class Events extends Resource { + /** + * @param dispatcher + * @return + */ + constructor(dispatcher: Dispatcher); + } + + /** + * A _project_ represents a prioritized list of tasks in Asana. It exists in a + * single workspace or organization and is accessible to a subset of users in + * that workspace or organization, depending on its permissions. + * + * Projects in organizations are shared with a single team. You cannot currently + * change the team of a project via the API. Non-organization workspaces do not + * have teams and so you should not specify the team of project in a + * regular workspace. + * @class + * @param {Dispatcher} dispatcher The API dispatcher + */ + class Projects extends Resource { + /** + * @param dispatcher + */ + constructor(dispatcher: Dispatcher); + + /** + * * Creates a new project in a workspace or team. + * * + * * Every project is required to be created in a specific workspace or + * * organization, and this cannot be changed once set. Note that you can use + * * the `workspace` parameter regardless of whether or not it is an + * * organization. + * * + * * If the workspace for your project _is_ an organization, you must also + * * supply a `team` to share the project with. + * * + * * Returns the full record of the newly created project. + * * @param {Object} data Data for the request + * * @param {String} data.workspace The workspace or organization to create the project in. + * * @param {String} [data.team] If creating in an organization, the specific team to create the + * * project in. + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param data + * @param dispatchOptions? + * @return + */ + create(data: any, dispatchOptions?: any): Promise; + + /** + * * If the workspace for your project _is_ an organization, you must also + * * supply a `team` to share the project with. + * * + * * Returns the full record of the newly created project. + * * @param {String} workspace The workspace or organization to create the project in. + * * @param {Object} data Data for the request + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param workspace + * @param data + * @param dispatchOptions? + * @return + */ + createInWorkspace(workspace: string, data: any, dispatchOptions?: any): Promise; + + /** + * * Creates a project shared with the given team. + * * + * * Returns the full record of the newly created project. + * * @param {String} team The team to create the project in. + * * @param {Object} data Data for the request + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param team + * @param data + * @param dispatchOptions? + * @return + */ + createInTeam(team: string, data: any, dispatchOptions?: any): Promise; + + /** + * * Returns the complete project record for a single project. + * * @param {String} project The project to get. + * * @param {Object} [params] Parameters for the request + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The requested resource + * @param project + * @param params? + * @param dispatchOptions? + * @return + */ + findById(project: string, params?: any, dispatchOptions?: any): Promise; + + /** + * * A specific, existing project can be updated by making a PUT request on the + * * URL for that project. Only the fields provided in the `data` block will be + * * updated; any unspecified fields will remain unchanged. + * * + * * When using this method, it is best to specify only those fields you wish + * * to change, or else you may overwrite changes made by another user since + * * you last retrieved the task. + * * + * * Returns the complete updated project record. + * * @param {String} project The project to update. + * * @param {Object} data Data for the request + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param project + * @param data + * @param dispatchOptions? + * @return + */ + update(project: string, data: any, dispatchOptions?: any): Promise; + + /** + * * A specific, existing project can be deleted by making a DELETE request + * * on the URL for that project. + * * + * * Returns an empty data record. + * * @param {String} project The project to delete. + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param project + * @param dispatchOptions? + * @return + */ + delete(project: string, dispatchOptions?: any): Promise; + + /** + * * Returns the compact project records for some filtered set of projects. + * * Use one or more of the parameters provided to filter the projects returned. + * * @param {Object} [params] Parameters for the request + * * @param {String} [params.workspace] The workspace or organization to filter projects on. + * * @param {String} [params.team] The team to filter projects on. + * * @param {Boolean} [params.archived] Only return projects whose `archived` field takes on the value of + * * this parameter. + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param params? + * @param dispatchOptions? + * @return + */ + findAll(params?: any, dispatchOptions?: any): Promise; + + /** + * * Returns the compact project records for all projects in the workspace. + * * @param {String} workspace The workspace or organization to find projects in. + * * @param {Object} [params] Parameters for the request + * * @param {Boolean} [params.archived] Only return projects whose `archived` field takes on the value of + * * this parameter. + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param workspace + * @param params? + * @param dispatchOptions? + * @return + */ + findByWorkspace(workspace: string, params?: any, dispatchOptions?: any): Promise; + + /** + * * Returns the compact project records for all projects in the team. + * * @param {String} team The team to find projects in. + * * @param {Object} [params] Parameters for the request + * * @param {Boolean} [params.archived] Only return projects whose `archived` field takes on the value of + * * this parameter. + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param team + * @param params? + * @param dispatchOptions? + * @return + */ + findByTeam(team: string, params?: any, dispatchOptions?: any): Promise; + + /** + * * Returns compact records for all sections in the specified project. + * * @param {String} project The project to get sections from. + * * @param {Object} [params] Parameters for the request + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param project + * @param params? + * @param dispatchOptions? + * @return + */ + sections(project: string, params?: any, dispatchOptions?: any): Promise; + + /** + * * Returns the compact task records for all tasks within the given project, + * * ordered by their priority within the project. Tasks can exist in more than one project at a time. + * * @param {String} project The project in which to search for tasks. + * * @param {Object} [params] Parameters for the request + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param project + * @param params? + * @param dispatchOptions? + * @return + */ + tasks(project: string, params?: any, dispatchOptions?: any): Promise; + + /** + * * Adds the specified list of users as followers to the project. Followers are a subset of members, therefore if + * * the users are not already members of the project they will also become members as a result of this operation. + * * Returns the updated project record. + * * @param {String} project The project to add followers to. + * * @param {Object} data Data for the request + * * @param {Array} data.followers An array of followers to add to the project. + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param project + * @param data + * @param dispatchOptions? + * @return + */ + addFollowers(project: string, data: any, dispatchOptions?: any): Promise; + + /** + * * Removes the specified list of users from following the project, this will not affect project membership status. + * * Returns the updated project record. + * * @param {String} project The project to remove followers from. + * * @param {Object} data Data for the request + * * @param {Array} data.followers An array of followers to remove from the project. + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param project + * @param data + * @param dispatchOptions? + * @return + */ + removeFollowers(project: string, data: any, dispatchOptions?: any): Promise; + + /** + * * Adds the specified list of users as members of the project. Returns the updated project record. + * * @param {String} project The project to add members to. + * * @param {Object} data Data for the request + * * @param {Array} data.members An array of members to add to the project. + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param project + * @param data + * @param dispatchOptions? + * @return + */ + addMembers(project: string, data: any, dispatchOptions?: any): Promise; + + /** + * * Removes the specified list of members from the project. Returns the updated project record. + * * @param {String} project The project to remove members from. + * * @param {Object} data Data for the request + * * @param {Array} data.members An array of members to remove from the project. + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param project + * @param data + * @param dispatchOptions? + * @return + */ + removeMembers(project: string, data: any, dispatchOptions?: any): Promise; + } + + /** + * A _story_ represents an activity associated with an object in the Asana + * system. Stories are generated by the system whenever users take actions such + * as creating or assigning tasks, or moving tasks between projects. _Comments_ + * are also a form of user-generated story. + * + * Stories are a form of history in the system, and as such they are read-only. + * Once generated, it is not possible to modify a story. + * @class + * @param {Dispatcher} dispatcher The API dispatcher + */ + class Stories extends Resource { + /** + * + * @param dispatcher + */ + constructor(dispatcher: Dispatcher); + + /** + * * Returns the compact records for all stories on the task. + * * @param {String} task Globally unique identifier for the task. + * * @param {Object} [params] Parameters for the request + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param task + * @param params? + * @param dispatchOptions? + * @return + */ + findByTask(task: string, params?: any, dispatchOptions?: any): Promise; + + /** + * * Returns the full record for a single story. + * * @param {String} story Globally unique identifier for the story. + * * @param {Object} [params] Parameters for the request + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The requested resource + * @param story + * @param params? + * @param dispatchOptions? + * @return + */ + findById(story: string, params?: any, dispatchOptions?: any): Promise; + + /** + * * Adds a comment to a task. The comment will be authored by the + * * currently authenticated user, and timestamped when the server receives + * * the request. + * * + * * Returns the full record for the new story added to the task. + * * @param {String} task Globally unique identifier for the task. + * * @param {Object} data Data for the request + * * @param {String} data.text The plain text of the comment to add. + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param task + * @param data + * @param dispatchOptions? + * @return + */ + createOnTask(task: string, data: any, dispatchOptions?: any): Promise; + } + + /** + * A _tag_ is a label that can be attached to any task in Asana. It exists in a + * single workspace or organization. + * + * Tags have some metadata associated with them, but it is possible that we will + * simplify them in the future so it is not encouraged to rely too heavily on it. + * Unlike projects, tags do not provide any ordering on the tasks they + * are associated with. + * @class + * @param {Dispatcher} dispatcher The API dispatcher + */ + class Tags extends Resource { + /** + * @param dispatcher + */ + constructor(dispatcher: Dispatcher); + + /** + * * Creates a new tag in a workspace or organization. + * * + * * Every tag is required to be created in a specific workspace or + * * organization, and this cannot be changed once set. Note that you can use + * * the `workspace` parameter regardless of whether or not it is an + * * organization. + * * + * * Returns the full record of the newly created tag. + * * @param {Object} data Data for the request + * * @param {String} data.workspace The workspace or organization to create the tag in. + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param data + * @param dispatchOptions? + * @return + */ + create(data: any, dispatchOptions?: any): Promise; + + /** + * * Creates a new tag in a workspace or organization. + * * + * * Every tag is required to be created in a specific workspace or + * * organization, and this cannot be changed once set. Note that you can use + * * the `workspace` parameter regardless of whether or not it is an + * * organization. + * * + * * Returns the full record of the newly created tag. + * * @param {String} workspace The workspace or organization to create the tag in. + * * @param {Object} data Data for the request + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param workspace + * @param data + * @param dispatchOptions? + * @return + */ + createInWorkspace(workspace: string, data: any, dispatchOptions?: any): Promise; + + /** + * * Returns the complete tag record for a single tag. + * * @param {String} tag The tag to get. + * * @param {Object} [params] Parameters for the request + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The requested resource + * @param tag + * @param params? + * @param dispatchOptions? + * @return + */ + findById(tag: string, params?: any, dispatchOptions?: any): Promise; + + /** + * * Updates the properties of a tag. Only the fields provided in the `data` + * * block will be updated; any unspecified fields will remain unchanged. + * * + * * When using this method, it is best to specify only those fields you wish + * * to change, or else you may overwrite changes made by another user since + * * you last retrieved the task. + * * + * * Returns the complete updated tag record. + * * @param {String} tag The tag to update. + * * @param {Object} data Data for the request + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param tag + * @param data + * @param dispatchOptions? + * @return + */ + update(tag: string, data: any, dispatchOptions?: any): Promise; + + /** + * * A specific, existing tag can be deleted by making a DELETE request + * * on the URL for that tag. + * * + * * Returns an empty data record. + * * @param {String} tag The tag to delete. + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param tag + * @param dispatchOptions? + * @return + */ + delete(tag: string, dispatchOptions?: any): Promise; + + /** + * * Returns the compact tag records for some filtered set of tags. + * * Use one or more of the parameters provided to filter the tags returned. + * * @param {Object} [params] Parameters for the request + * * @param {String} [params.workspace] The workspace or organization to filter tags on. + * * @param {String} [params.team] The team to filter tags on. + * * @param {Boolean} [params.archived] Only return tags whose `archived` field takes on the value of + * * this parameter. + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param params? + * @param dispatchOptions? + * @return + */ + findAll(params?: any, dispatchOptions?: any): Promise; + + /** + * * Returns the compact tag records for all tags in the workspace. + * * @param {String} workspace The workspace or organization to find tags in. + * * @param {Object} [params] Parameters for the request + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param workspace + * @param params? + * @param dispatchOptions? + * @return + */ + findByWorkspace(workspace: string, params?: any, dispatchOptions?: any): Promise; + + /** + * * Returns the compact task records for all tasks with the given tag. + * * Tasks can have more than one tag at a time. + * * @param {String} tag The tag to fetch tasks from. + * * @param {Object} [params] Parameters for the request + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param tag + * @param params? + * @param dispatchOptions? + * @return + */ + getTasksWithTag(tag: string, params?: any, dispatchOptions?: any): Promise; + } + + /** + * The _task_ is the basic object around which many operations in Asana are + * centered. In the Asana application, multiple tasks populate the middle pane + * according to some view parameters, and the set of selected tasks determines + * the more detailed information presented in the details pane. + * @class + * @param {Dispatcher} dispatcher The API dispatcher + */ + class Tasks extends Resource { + /** + * @param dispatcher + */ + constructor(dispatcher: Dispatcher); + + /** + * * Creating a new task is as easy as POSTing to the `/tasks` endpoint + * * with a data block containing the fields you'd like to set on the task. + * * Any unspecified fields will take on default values. + * * + * * Every task is required to be created in a specific workspace, and this + * * workspace cannot be changed once set. The workspace need not be set + * * explicitly if you specify a `project` or a `parent` task instead. + * * @param {Object} data Data for the request + * * @param {String} [data.workspace] The workspace to create a task in. + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param data + * @param dispatchOptions? + * @return + */ + create(data: any, dispatchOptions?: any): Promise; + + /** + * * Creating a new task is as easy as POSTing to the `/tasks` endpoint + * * with a data block containing the fields you'd like to set on the task. + * * Any unspecified fields will take on default values. + * * + * * Every task is required to be created in a specific workspace, and this + * * workspace cannot be changed once set. The workspace need not be set + * * explicitly if you specify a `project` or a `parent` task instead. + * * @param {String} workspace The workspace to create a task in. + * * @param {Object} data Data for the request + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param workspace + * @param data + * @param dispatchOptions? + * @return + */ + createInWorkspace(workspace: string, data: any, dispatchOptions?: any): Promise; + + /** + * * Returns the complete task record for a single task. + * * @param {String} task The task to get. + * * @param {Object} [params] Parameters for the request + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The requested resource + * @param task + * @param params? + * @param dispatchOptions? + * @return + */ + findById(task: string, params?: any, dispatchOptions?: any): Promise; + + /** + * * A specific, existing task can be updated by making a PUT request on the + * * URL for that task. Only the fields provided in the `data` block will be + * * updated; any unspecified fields will remain unchanged. + * * + * * When using this method, it is best to specify only those fields you wish + * * to change, or else you may overwrite changes made by another user since + * * you last retrieved the task. + * * + * * Returns the complete updated task record. + * * @param {String} task The task to update. + * * @param {Object} data Data for the request + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param task + * @param data + * @param dispatchOptions? + * @return + */ + update(task: string, data: any, dispatchOptions?: any): Promise; + + /** + * * A specific, existing task can be deleted by making a DELETE request on the + * * URL for that task. Deleted tasks go into the "trash" of the user making + * * the delete request. Tasks can be recovered from the trash within a period + * * of 30 days; afterward they are completely removed from the system. + * * + * * Returns an empty data record. + * * @param {String} task The task to delete. + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param task + * @param dispatchOptions? + * @return + */ + delete(task: string, dispatchOptions?: any): Promise; + + /** + * * Returns the compact task records for all tasks within the given project, + * * ordered by their priority within the project. + * * @param {String} projectId The project in which to search for tasks. + * * @param {Object} [params] Parameters for the request + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param projectId + * @param params? + * @param dispatchOptions? + * @return + */ + findByProject(projectId: string, params?: any, dispatchOptions?: any): Promise; + + /** + * * Returns the compact task records for all tasks with the given tag. + * * @param {String} tag The tag in which to search for tasks. + * * @param {Object} [params] Parameters for the request + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param tag + * @param params? + * @param dispatchOptions? + * @return + */ + findByTag(tag: string, params?: any, dispatchOptions?: any): Promise; + + /** + * * Returns the compact task records for some filtered set of tasks. Use one + * * or more of the parameters provided to filter the tasks returned. + * * @param {Object} [params] Parameters for the request + * * @param {String} [params.assignee] The assignee to filter tasks on. + * * @param {String} [params.workspace] The workspace or organization to filter tasks on. + * * @param {String} [params.completed_since] Only return tasks that are either incomplete or that have been + * * completed since this time. + * * @param {String} [params.modified_since] Only return tasks that have been modified since the given time. + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param params? + * @param dispatchOptions? + * @return + */ + findAll(params?: any, dispatchOptions?: any): Promise; + + /** + * * Adds each of the specified followers to the task, if they are not already + * * following. Returns the complete, updated record for the affected task. + * * @param {String} task The task to add followers to. + * * @param {Object} data Data for the request + * * @param {Array} data.followers An array of followers to add to the task. + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param task + * @param data + * @param dispatchOptions? + * @return + */ + addFollowers(task: string, data: any, dispatchOptions?: any): Promise; + + /** + * * Removes each of the specified followers from the task if they are + * * following. Returns the complete, updated record for the affected task. + * * @param {String} task The task to remove followers from. + * * @param {Object} data Data for the request + * * @param {Array} data.followers An array of followers to remove from the task. + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param task + * @param data + * @param dispatchOptions? + * @return + */ + removeFollowers(task: string, data: any, dispatchOptions?: any): Promise; + + /** + * * Returns a compact representation of all of the projects the task is in. + * * @param {String} task The task to get projects on. + * * @param {Object} [params] Parameters for the request + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param task + * @param params? + * @param dispatchOptions? + * @return + */ + projects(task: string, params?: any, dispatchOptions?: any): Promise; + + /** + * * Adds the task to the specified project, in the optional location + * * specified. If no location arguments are given, the task will be added to + * * the beginning of the project. + * * + * * `addProject` can also be used to reorder a task within a project that + * * already contains it. + * * + * * Returns an empty data block. + * * @param {String} task The task to add to a project. + * * @param {Object} data Data for the request + * * @param {String} data.project The project to add the task to. + * * @param {String} [data.insertAfter] A task in the project to insert the task after, or `null` to + * * insert at the beginning of the list. + * * @param {String} [data.insertBefore] A task in the project to insert the task before, or `null` to + * * insert at the end of the list. + * * @param {String} [data.section] A section in the project to insert the task into. The task will be + * * inserted at the top of the section. + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param task + * @param data + * @param dispatchOptions? + * @return + */ + addProject(task: string, data: any, dispatchOptions?: any): Promise; + + /** + * * Removes the task from the specified project. The task will still exist + * * in the system, but it will not be in the project anymore. + * * + * * Returns an empty data block. + * * @param {String} task The task to remove from a project. + * * @param {Object} data Data for the request + * * @param {String} data.project The project to remove the task from. + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param task + * @param data + * @param dispatchOptions? + * @return + */ + removeProject(task: string, data: any, dispatchOptions?: any): Promise; + + /** + * * Returns a compact representation of all of the tags the task has. + * * @param {String} task The task to get tags on. + * * @param {Object} [params] Parameters for the request + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param task + * @param params? + * @param dispatchOptions? + * @return + */ + tags(task: string, params?: any, dispatchOptions?: any): Promise; + + /** + * * Adds a tag to a task. Returns an empty data block. + * * @param {String} task The task to add a tag to. + * * @param {Object} data Data for the request + * * @param {String} data.tag The tag to add to the task. + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param task + * @param data + * @param dispatchOptions? + * @return + */ + addTag(task: string, data: any, dispatchOptions?: any): Promise; + + /** + * * Removes a tag from the task. Returns an empty data block. + * * @param {String} task The task to remove a tag from. + * * @param {Object} data Data for the request + * * @param {String} data.tag The tag to remove from the task. + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param task + * @param data + * @param dispatchOptions? + * @return + */ + removeTag(task: string, data: any, dispatchOptions?: any): Promise; + + /** + * * Returns a compact representation of all of the subtasks of a task. + * * @param {String} task The task to get the subtasks of. + * * @param {Object} [params] Parameters for the request + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param task + * @param params? + * @param dispatchOptions? + * @return + */ + subtasks(task: string, params?: any, dispatchOptions?: any): Promise; + + /** + * * Creates a new subtask and adds it to the parent task. Returns the full record + * * for the newly created subtask. + * * @param {String} task The task to add a subtask to. + * * @param {Object} data Data for the request + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param task + * @param data + * @param dispatchOptions? + * @return + */ + addSubtask(task: string, data: any, dispatchOptions?: any): Promise; + + /** + * * Returns a compact representation of all of the stories on the task. + * * @param {String} task The task containing the stories to get. + * * @param {Object} [params] Parameters for the request + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param task + * @param params? + * @param dispatchOptions? + * @return + */ + stories(task: string, params?: any, dispatchOptions?: any): Promise; + + /** + * * Adds a comment to a task. The comment will be authored by the + * * currently authenticated user, and timestamped when the server receives + * * the request. + * * + * * Returns the full record for the new story added to the task. + * * @param {String} task Globally unique identifier for the task. + * * @param {Object} data Data for the request + * * @param {String} data.text The plain text of the comment to add. + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param task + * @param data + * @param dispatchOptions? + * @return + */ + addComment(task: string, data: any, dispatchOptions?: any): Promise; + } + + /** + * A _team_ is used to group related projects and people together within an + * organization. Each project in an organization is associated with a team. + * @class + * @param {Dispatcher} dispatcher The API dispatcher + */ + class Teams extends Resource { + /** + * @param dispatcher + */ + constructor(dispatcher: Dispatcher); + + /** + * * Returns the full record for a single team. + * * @param {String} team Globally unique identifier for the team. + * * @param {Object} [params] Parameters for the request + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The requested resource + * @param team + * @param params? + * @param dispatchOptions? + * @return + */ + findById(team: string, params?: any, dispatchOptions?: any): Promise; + + /** + * * Returns the compact records for all teams in the organization visible to + * * the authorized user. + * * @param {String} organization Globally unique identifier for the workspace or organization. + * * @param {Object} [params] Parameters for the request + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param organization + * @param params? + * @param dispatchOptions? + * @return + */ + findByOrganization(organization: string, params?: any, dispatchOptions?: any): Promise; + + /** + * * Returns the compact records for all users that are members of the team. + * * @param {String} team Globally unique identifier for the team. + * * @param {Object} [params] Parameters for the request + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param team + * @param params? + * @param dispatchOptions? + * @return + */ + users(team: string, params?: any, dispatchOptions?: any): Promise; + + /** + * * The user making this call must be a member of the team in order to add others. + * * The user to add must exist in the same organization as the team in order to be added. + * * The user to add can be referenced by their globally unique user ID or their email address. + * * Returns the full user record for the added user. + * * @param {String} team Globally unique identifier for the team. + * * @param {Object} data Data for the request + * * @param {String} data.user An identifier for the user. Can be one of an email address, + * * the globally unique identifier for the user, or the keyword `me` + * * to indicate the current user making the request. + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param team + * @param data + * @param dispatchOptions? + * @return + */ + addUser(team: string, data: any, dispatchOptions?: any): Promise; + + /** + * * The user to remove can be referenced by their globally unique user ID or their email address. + * * Removes the user from the specified team. Returns an empty data record. + * * @param {String} team Globally unique identifier for the team. + * * @param {Object} data Data for the request + * * @param {String} data.user An identifier for the user. Can be one of an email address, + * * the globally unique identifier for the user, or the keyword `me` + * * to indicate the current user making the request. + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param team + * @param data + * @param dispatchOptions? + * @return + */ + removeUser(team: string, data: any, dispatchOptions?: any): Promise; + } + + /** + * A _user_ object represents an account in Asana that can be given access to + * various workspaces, projects, and tasks. + * + * Like other objects in the system, users are referred to by numerical IDs. + * However, the special string identifier `me` can be used anywhere + * a user ID is accepted, to refer to the current authenticated user. + * @class + * @param {Dispatcher} dispatcher The API dispatcher + */ + class Users extends Resource { + /** + * @param dispatcher + */ + constructor(dispatcher: Dispatcher); + + /** + * * Returns the full user record for the currently authenticated user. + * * @param {Object} [params] Parameters for the request + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The requested resource + * @param params? + * @param dispatchOptions? + * @return + */ + me(params?: any, dispatchOptions?: any): Promise; + + /** + * * Returns the full user record for the single user with the provided ID. + * * @param {String} user An identifier for the user. Can be one of an email address, + * * the globally unique identifier for the user, or the keyword `me` + * * to indicate the current user making the request. + * * @param {Object} [params] Parameters for the request + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The requested resource + * @param user + * @param params? + * @param dispatchOptions? + * @return + */ + findById(user: string, params?: any, dispatchOptions?: any): Promise; + + /** + * * Returns the user records for all users in the specified workspace or + * * organization. + * * @param {String} workspace The workspace in which to get users. + * * @param {Object} [params] Parameters for the request + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param workspace + * @param params? + * @param dispatchOptions? + * @return + */ + findByWorkspace(workspace: string, params?: any, dispatchOptions?: any): Promise; + + /** + * * Returns the user records for all users in all workspaces and organizations + * * accessible to the authenticated user. Accepts an optional workspace ID + * * parameter. + * * @param {Object} [params] Parameters for the request + * * @param {String} [params.workspace] The workspace or organization to filter users on. + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param params? + * @param dispatchOptions? + * @return + */ + findAll(params?: any, dispatchOptions?: any): Promise; + } + + /** + * **Webhooks are currently in BETA - The information here may change.** + * + * Webhooks allow an application to be notified of changes. This is in addition + * to the ability to fetch those changes directly as + * [Events](/developers/api-reference/events) - in fact, Webhooks are just a way + * to receive Events via HTTP POST at the time they occur instead of polling for + * them. For services accessible via HTTP this is often vastly more convenient, + * and if events are not too frequent can be significantly more efficient. + * + * In both cases, however, changes are represented as Event objects - refer to + * the [Events documentation](/developers/api-reference/events) for more + * information on what data these events contain. + * + * **NOTE:** While Webhooks send arrays of Event objects to their target, the + * Event objects themselves contain *only IDs*, rather than the actual resource + * they are referencing. So while a normal event you receive via GET /events + * would look like this: + * + * {\ + * "resource": {\ + * "id": 1337,\ + * "name": "My Task"\ + * },\ + * "parent": null,\ + * "created_at": "2013-08-21T18:20:37.972Z",\ + * "user": {\ + * "id": 1123,\ + * "name": "Tom Bizarro"\ + * },\ + * "action": "changed",\ + * "type": "task"\ + * } + * + * In a Webhook payload you would instead receive this: + * + * {\ + * "resource": 1337,\ + * "parent": null,\ + * "created_at": "2013-08-21T18:20:37.972Z",\ + * "user": 1123,\ + * "action": "changed",\ + * "type": "task"\ + * } + * + * Webhooks themselves contain only the information necessary to deliver the + * events to the desired target as they are generated. + * @class + * @param {Dispatcher} dispatcher The API dispatcher + */ + class Webhooks extends Resource { + /** + * @param dispatcher + */ + constructor(dispatcher: Dispatcher); + + /** + * * Establishing a webhook is a two-part process. First, a simple HTTP POST + * * similar to any other resource creation. Since you could have multiple + * * webhooks we recommend specifying a unique local id for each target. + * * + * * Next comes the confirmation handshake. When a webhook is created, we will + * * send a test POST to the `target` with an `X-Hook-Secret` header as + * * described in the + * * [Resthooks Security documentation](http://resthooks.org/docs/security/). + * * The target must respond with a `200 OK` and a matching `X-Hook-Secret` + * * header to confirm that this webhook subscription is indeed expected. + * * + * * If you do not acknowledge the webhook's confirmation handshake it will + * * fail to setup, and you will receive an error in response to your attempt + * * to create it. This means you need to be able to receive and complete the + * * webhook *while* the POST request is in-flight. + * * @param {String} resource A resource ID to subscribe to. The resource can be a task or project. + * * @param {String} target The URL to receive the HTTP POST. + * * @param {Object} data Data for the request + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param resource + * @param target + * @param data + * @param dispatchOptions? + * @return + */ + create(resource: string, target: string, data: any, dispatchOptions?: any): Promise; + + /** + * * Returns the compact representation of all webhooks your app has + * * registered for the authenticated user in the given workspace. + * * @param {String} workspace The workspace to query for webhooks in. + * * @param {Object} [params] Parameters for the request + * * @param {String} [params.resource] Only return webhooks for the given resource. + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param workspace + * @param params? + * @param dispatchOptions? + * @return + */ + getAll(workspace: string, params?: any, dispatchOptions?: any): Promise; + + /** + * * Returns the full record for the given webhook. + * * @param {String} webhook The webhook to get. + * * @param {Object} [params] Parameters for the request + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The requested resource + * @param webhook + * @param params? + * @param dispatchOptions? + * @return + */ + getById(webhook: string, params?: any, dispatchOptions?: any): Promise; + + /** + * * This method permanently removes a webhook. Note that it may be possible + * * to receive a request that was already in flight after deleting the + * * webhook, but no further requests will be issued. + * * @param {String} webhook The webhook to delete. + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param webhook + * @param dispatchOptions? + * @return + */ + deleteById(webhook: string, dispatchOptions?: any): Promise; + } + + /** + * A _workspace_ is the highest-level organizational unit in Asana. All projects + * and tasks have an associated workspace. + * + * An _organization_ is a special kind of workspace that represents a company. + * In an organization, you can group your projects into teams. You can read + * more about how organizations work on the Asana Guide. + * To tell if your workspace is an organization or not, check its + * `is_organization` property. + * + * Over time, we intend to migrate most workspaces into organizations and to + * release more organization-specific functionality. We may eventually deprecate + * using workspace-based APIs for organizations. Currently, and until after + * some reasonable grace period following any further announcements, you can + * still reference organizations in any `workspace` parameter. + * @class + * @param {Dispatcher} dispatcher The API dispatcher + */ + class Workspaces extends Resource { + /** + * @param dispatcher + */ + constructor(dispatcher: Dispatcher); + + /** + * * Returns the full workspace record for a single workspace. + * * @param {String} workspace Globally unique identifier for the workspace or organization. + * * @param {Object} [params] Parameters for the request + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The requested resource + * @param workspace + * @param params? + * @param dispatchOptions? + * @return + */ + findById(workspace: string, params?: any, dispatchOptions?: any): Promise; + + /** + * * Returns the compact records for all workspaces visible to the authorized user. + * * @param {Object} [params] Parameters for the request + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param params? + * @param dispatchOptions? + * @return + */ + findAll(params?: any, dispatchOptions?: any): Promise; + + /** + * * A specific, existing workspace can be updated by making a PUT request on + * * the URL for that workspace. Only the fields provided in the data block + * * will be updated; any unspecified fields will remain unchanged. + * * + * * Currently the only field that can be modified for a workspace is its `name`. + * * + * * Returns the complete, updated workspace record. + * * @param {String} workspace The workspace to update. + * * @param {Object} data Data for the request + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param workspace + * @param data + * @param dispatchOptions? + * @return + */ + update(workspace: string, data: any, dispatchOptions?: any): Promise; + + /** + * * Retrieves objects in the workspace based on an auto-completion/typeahead + * * search algorithm. This feature is meant to provide results quickly, so do + * * not rely on this API to provide extremely accurate search results. The + * * result set is limited to a single page of results with a maximum size, + * * so you won't be able to fetch large numbers of results. + * * @param {String} workspace The workspace to fetch objects from. + * * @param {Object} [params] Parameters for the request + * * @param {String} params.type The type of values the typeahead should return. + * * Note that unlike in the names of endpoints, the types listed here are + * * in singular form (e.g. `task`). Using multiple types is not yet supported. + * * @param {String} [params.query] The string that will be used to search for relevant objects. If an + * * empty string is passed in, the API will currently return an empty + * * result set. + * * @param {Number} [params.count] The number of results to return. The default is `20` if this + * * parameter is omitted, with a minimum of `1` and a maximum of `100`. + * * If there are fewer results found than requested, all will be returned. + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param workspace + * @param params? + * @param dispatchOptions? + * @return + */ + typeahead(workspace: string, params?: any, dispatchOptions?: any): Promise; + + /** + * * The user can be referenced by their globally unique user ID or their email address. + * * Returns the full user record for the invited user. + * * @param {String} workspace The workspace or organization to invite the user to. + * * @param {Object} data Data for the request + * * @param {String} data.user An identifier for the user. Can be one of an email address, + * * the globally unique identifier for the user, or the keyword `me` + * * to indicate the current user making the request. + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param workspace + * @param data + * @param dispatchOptions? + * @return + */ + addUser(workspace: string, data: any, dispatchOptions?: any): Promise; + + /** + * * The user making this call must be an admin in the workspace. + * * Returns an empty data record. + * * @param {String} workspace The workspace or organization to invite the user to. + * * @param {Object} data Data for the request + * * @param {String} data.user An identifier for the user. Can be one of an email address, + * * the globally unique identifier for the user, or the keyword `me` + * * to indicate the current user making the request. + * * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * * @return {Promise} The response from the API + * @param workspace + * @param data + * @param dispatchOptions? + * @return + */ + removeUser(workspace: string, data: any, dispatchOptions?: any): Promise; + } + + interface ResourceStatic { + /** + * @param dispatcher + */ + new (dispatcher: Dispatcher): Resource; + + /** + * @type {number} Default number of items to get per page. + */ + DEFAULT_PAGE_LIMIT: number; + + /** + * Helper method that dispatches a GET request to the API, where the expected + * result is a collection. + * @param {Dispatcher} dispatcher + * @param {String} path The path of the API + * @param {Object} [query] The query params + * @param {Object} [dispatchOptions] Options for handling the request and + * response. See `Dispatcher.dispatch`. + * @return {Promise} The Collection response for the request + * @param dispatcher + * @param path + * @param query? + * @param dispatchOptions? + */ + getCollection(dispatcher: any, path: string, query?: any, dispatchOptions?: any): Promise; + + /** + * Helper method for any request Promise from the Dispatcher, unwraps the `data` + * value from the payload. + * @param {Promise} promise A promise returned from a `Dispatcher` request. + * @return {Promise} The `data` portion of the response payload. + * @param promise + * @return + */ + unwrap(promise: any): Promise; + } + + var Resource: ResourceStatic; + + /** + * Base class for a resource accessible via the API. Uses a `Dispatcher` to + * access the resources. + * @param {Dispatcher} dispatcher + * @constructor + */ + interface Resource { + /** + * Dispatches a GET request to the API, where the expected result is a + * single resource. + * @param {String} path The path of the API + * @param {Object} [query] The query params + * @param {Object} [dispatchOptions] Options for handling the request and + * response. See `Dispatcher.dispatch`. + * @return {Promise} The response for the request + * @param path + * @param query? + * @param dispatchOptions? + * @return + */ + dispatchGet(path: string, query?: any, dispatchOptions?: any): Promise; + + /** + * Dispatches a GET request to the API, where the expected result is a + * collection. + * @param {String} path The path of the API + * @param {Object} [query] The query params + * @param {Object} [dispatchOptions] Options for handling the request and + * response. See `Dispatcher.dispatch`. + * @return {Promise} The response for the request + * @param path + * @param query? + * @param dispatchOptions? + * @return + */ + dispatchGetCollection(path: string, query?: any, dispatchOptions?: any): Promise; + + /** + * Dispatches a POST request to the API, where the expected response is a + * single resource. + * @param {String} path The path of the API + * @param {Object} [query] The query params + * @param {Object} [dispatchOptions] Options for handling the request and + * response. See `Dispatcher.dispatch`. + * @return {Promise} The response for the request + * @param path + * @param query? + * @param dispatchOptions? + * @return + */ + dispatchPost(path: string, query?: any, dispatchOptions?: any): Promise; + + /** + * Dispatches a POST request to the API, where the expected response is a + * single resource. + * @param {String} path The path of the API + * @param {Object} [query] The query params + * @param {Object} [dispatchOptions] Options for handling the request and + * response. See `Dispatcher.dispatch`. + * @return {Promise} The response for the request + * @param path + * @param query? + * @param dispatchOptions? + * @return + */ + dispatchPut(path: string, query?: any, dispatchOptions?: any): Promise; + + /** + * Dispatches a DELETE request to the API. The expected response is an + * empty resource. + * @param {String} path The path of the API + * @param {Object} [dispatchOptions] Options for handling the request and + * response. See `Dispatcher.dispatch`. + * @return {Promise} The response for the request + * @param path + * @param dispatchOptions? + * @return + */ + dispatchDelete(path: string, dispatchOptions?: any): Promise; + } + } + + var VERSION: string; + } + + export = asana; +} + diff --git a/assertsharp/assertsharp-tests.ts b/assertsharp/assertsharp-tests.ts new file mode 100644 index 000000000..484e3ac77 --- /dev/null +++ b/assertsharp/assertsharp-tests.ts @@ -0,0 +1,16 @@ +/// + +import Assert from "assertsharp"; + +Assert.AreEqual(0, 0, "Pass"); +Assert.AreNotEqual(0, 1, "Pass"); +Assert.AreNotSame(new Date(), new Date(), "Pass"); +Assert.AreSequenceEqual([0], [0], (x, y) => x === y, "Pass"); +Assert.Fail("Should fail"); +Assert.IsFalse(false, "Pass"); +Assert.IsInstanceOfType(new Date(), Date, "Pass"); +Assert.IsNotInstanceOfType(true, Date, "Pass"); +Assert.IsNotNull(new Date(), "Pass"); +Assert.IsNull(null, "Pass"); +Assert.IsTrue(true, "Pass"); +Assert.Throws(() => { throw ""; }, "Pass"); diff --git a/assertsharp/assertsharp.d.ts b/assertsharp/assertsharp.d.ts new file mode 100644 index 000000000..e66442cf7 --- /dev/null +++ b/assertsharp/assertsharp.d.ts @@ -0,0 +1,21 @@ +// Type definitions for assertsharp +// Project: https://www.npmjs.com/package/assertsharp +// Definitions by: Bruno Leonardo Michels +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "assertsharp" { + export default class Assert { + static AreEqual(expected: T, actual: T, message?: string): void; + static AreNotEqual(notExpected: T, actual: T, message?: string): void; + static AreNotSame(notExpected: T, actual: T, message?: string): void; + static AreSequenceEqual(expected: T[], actual: T[], equals?: (x: any, y: any) => boolean, message?: string): void; + static Fail(message?: string): void; + static IsFalse(actual: boolean, message?: string): void; + static IsInstanceOfType(actual: any, expectedType: Function, message?: string): void; + static IsNotInstanceOfType(actual: any, wrongType: Function, message?: string): void; + static IsNotNull(actual: any, message?: string): void; + static IsNull(actual: any, message?: string): void; + static IsTrue(actual: boolean, message?: string): void; + static Throws(fn: () => void, message?: string): void; + } +} 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/auth0.lock/auth0.lock.d.ts b/auth0.lock/auth0.lock.d.ts index bef269dbc..3269103ab 100644 --- a/auth0.lock/auth0.lock.d.ts +++ b/auth0.lock/auth0.lock.d.ts @@ -72,6 +72,8 @@ interface Auth0LockStatic { hide(callback: () => void): void; logout(callback: () => void): void; + + getClient(): Auth0Static; } declare var Auth0Lock: Auth0LockStatic; diff --git a/auth0/auth0.d.ts b/auth0/auth0.d.ts index b2e1149fb..1548bd06f 100644 --- a/auth0/auth0.d.ts +++ b/auth0/auth0.d.ts @@ -51,6 +51,8 @@ interface Auth0UserProfile { user_id: string; /** Represents one or more Identities that may be associated with the User. */ identities: Auth0Identity[]; + user_metadata?: any; + app_metadata?: any; } /** Represents an Auth0UserProfile that has a Microsoft Account as the primary identity. */ diff --git a/autobahn/autobahn.d.ts b/autobahn/autobahn.d.ts index 6debcca7c..7d5589dad 100644 --- a/autobahn/autobahn.d.ts +++ b/autobahn/autobahn.d.ts @@ -4,7 +4,6 @@ // Definitions: https://github.com/borisyankov/DefinitelyTyped /// -/// declare module autobahn { @@ -194,7 +193,7 @@ declare module autobahn { type: string; } - type DeferFactory = () => JQueryPromise; + type DeferFactory = () => When.Promise; type OnChallengeHandler = (session: Session, method: string, extra: any) => When.Promise; 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.d.ts b/aws-sdk/aws-sdk.d.ts index 3a500bbbb..b482cad48 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; @@ -46,6 +56,7 @@ declare module "aws-sdk" { directconnect?: any; dynamodb?: any; ec2?: any; + ecs?: any; elasticache?: any; elasticbeanstalk?: any; elastictranscoder?: any; @@ -99,7 +110,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 { @@ -119,43 +148,101 @@ declare module "aws-sdk" { export class S3 { constructor(options?: any); - public client: s3.Client; + putObject(params: s3.PutObjectRequest, callback: (err: any, data: any) => void): void; + getObject(params: s3.GetObjectRequest, callback: (err: any, data: any) => void): void; + } + + export class ECS { + constructor(options?: any); + + createService(params: ecs.CreateServicesParams, callback: (err: any, data: any) => void): void; + describeServices(params: ecs.DescribeServicesParams, callback: (err: any, data: any) => void): void; + describeTaskDefinition(params: ecs.DescribeTaskDefinitionParams, callback: (err: any, data: any) => void): void; + registerTaskDefinition(params: ecs.RegisterTaskDefinitionParams, callback: (err: any, data: any) => void): void; + updateService(params: ecs.UpdateServiceParams, callback: (err: any, data: any) => void): void; } export class DynamoDB { constructor(options?: any); } - export module Sqs { + export module DynamoDB { + export class DocumentClient { + constructor(options?: any); + } + } - 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 +250,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; + } } @@ -935,14 +1054,7 @@ declare module "aws-sdk" { } export module s3 { - - export interface Client { - config: ClientConfig; - - putObject(params: PutObjectRequest, callback: (err: any, data: any) => void): void; - getObject(params: GetObjectRequest, callback: (err: any, data: any) => void): void; - } - + export interface PutObjectRequest { ACL?: string; Body?: any; @@ -984,4 +1096,102 @@ declare module "aws-sdk" { } } + + export module ecs { + export interface CreateServicesParams { + desiredCount: number; + serviceName: string; + taskDefinition: string; + clientToken?: string; + cluster?: string; + deploymentConfiguration?: { + maximumPercent?: number; + minimumHealthyPercent?: number; + }; + loadBalancers?: { + containerName?: string; + containerPort?: number; + loadBalancerName?: string; + }[]; + role?: string; + } + + export interface DescribeServicesParams { + services: string[]; + cluster: string; + } + + export interface DescribeTaskDefinitionParams { + taskDefinition: string; + } + + export interface RegisterTaskDefinitionParams { + containerDefinitions: { + command?: string[], + cpu?: number, + disableNetworking?: boolean, + dnsSearchDomains?: string[], + dnsServers?: string[], + dockerLabels?: any, + dockerSecurityOptions?: string[], + entryPoint?: string[], + environment?: any[], + essential?: boolean, + extraHosts?: { + hostName: string, + ipAddress: string + }[]; + hostname?: string, + image?: string, + links?: string[], + logConfiguration?: { + logDriver: string, + options: any + }[], + memory?: number, + mountPoints?: { + containerPath: string, + readOnly: boolean, + sourceVolume: string + }[]; + name?: string, + portMappings?: { + containerPort?: number, + hostPort?: number, + protocol: string + }[]; + privileged?: boolean, + readonlyRootFilesystem?: boolean, + ulimits?: { + hardLimit: number, + name: string, + softLimit: number + }[]; + user?: string, + volumesFrom?: { + readOnly?: boolean, + sourceContainer?: string + }[], + workingDirectory?: string + }[]; + family: string; + volumes?: { + host: { + sourcePath: string + }, + name: string + }[]; + } + + export interface UpdateServiceParams { + service: string; + cluster?: string; + deploymentConfiguration?: { + maximumPercent: number; + minimumHealthyPercent: number; + }; + desiredCount?: number; + taskDefinition: string; + } + } } diff --git a/axios/axios-tests.ts b/axios/axios-tests.ts index 3f692307a..184292c92 100644 --- a/axios/axios-tests.ts +++ b/axios/axios-tests.ts @@ -8,21 +8,64 @@ interface Repository { name: string; } +interface Issue { + id: number; + title: string; +} + +axios.interceptors.request.use(config => { + console.log("Method:" + config.method + " Url:" +config.url); + return config; +}); + +axios.interceptors.response.use(config => { + console.log("Status:" + config.status); + return config; +}); + axios.get("https://api.github.com/repos/mzabriskie/axios") .then(r => console.log(r.config.method)); -axios({ +var getRepoDetails = axios({ url: "https://api.github.com/repos/mzabriskie/axios", method: HttpMethod[HttpMethod.GET], headers: {}, -}).then(r => console.log("ID:" + r.data.id + " Name: " + r.data.name)); +}).then(r => { + console.log("ID:" + r.data.id + " Name: " + r.data.name); + return r; +}); axios.post("http://example.com/", {}, { transformRequest: (data: any) => data }); -axios.post("http://example.com/", {}, { +axios.post("http://example.com/", { + headers: {'X-Custom-Header': 'foobar'} +}, { transformRequest: [ (data: any) => data ] }); + +var getRepoIssue = axios.get("https://api.github.com/repos/mzabriskie/axios/issues/1"); + +var axiosInstance = axios.create({ + baseURL: "https://api.github.com/repos/mzabriskie/axios/", + timeout: 1000 +}); + +axiosInstance.request({url: "issues/1"}); + +axios.all([getRepoDetails, getRepoDetails]).then(([repo1, repo2]) => { + var sumIds = repo1.data.id + repo2.data.id; + console.log("Sum ID:" + sumIds); + return sumIds; +}); + +var repoSum = (repo1: Axios.AxiosXHR, repo2: Axios.AxiosXHR) => { + var sumIds = repo1.data.id + repo2.data.id; + console.log("Sum ID:" + sumIds); + return sumIds; +}; + +axios.all([getRepoDetails, getRepoDetails]).then(axios.spread(repoSum)); diff --git a/axios/axios.d.ts b/axios/axios.d.ts index 48f57a73a..7348ec651 100644 --- a/axios/axios.d.ts +++ b/axios/axios.d.ts @@ -1,162 +1,276 @@ -// Type definitions for axios 0.5.2 +// Type definitions for axios 0.8.1 // Project: https://github.com/mzabriskie/axios // Definitions by: Marcel Buesing // Definitions: https://github.com/borisyankov/DefinitelyTyped -/// - declare module Axios { - /** - * - request body data type - */ - interface AxiosXHRConfigBase { + 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; + } /** - * Change the request data before it is sent to the server. - * This is only applicable for request methods 'PUT', 'POST', and 'PATCH' - * The last function in the array must return a string or an ArrayBuffer + * HTTP Basic auth details */ - transformRequest?: ((data:T) => U)|[(data:T) => U]; + interface AxiosHttpBasicAuth { + username: string; + password: string; + } /** - * change the response data to be made before it is passed to then/catch + * Common axios XHR config interface + * - request body data type */ - transformResponse?: (data:T) => U; + interface AxiosXHRConfigBase { + /** + * will be prepended to `url` unless `url` is absolute. + * It can be convenient to set `baseURL` for an instance + * of axios to pass relative URLs to methods of that instance. + */ + baseURL?: string; + + /** + * custom headers to be sent + */ + headers?: Object; + + /** + * URL parameters to be sent with the request + */ + params?: Object; + + /** + * optional function in charge of serializing `params` + * (e.g. https://www.npmjs.com/package/qs, http://api.jquery.com/jquery.param/) + */ + paramsSerializer?: (params: Object) => string; + + /** + * specifies the number of milliseconds before the request times out. + * If the request takes longer than `timeout`, the request will be aborted. + */ + timeout?: number; + + /** + * indicates whether or not cross-site Access-Control requests + * should be made using credentials + */ + withCredentials?: boolean; + + /** + * indicates that HTTP Basic auth should be used, and supplies + * credentials. This will set an `Authorization` header, + * overwriting any existing `Authorization` custom headers you have + * set using `headers`. + */ + auth?: AxiosHttpBasicAuth; + + /** + * indicates the type of data that the server will respond with + * options are 'arraybuffer', 'blob', 'document', 'json', 'text' + */ + responseType?: string; + + /** + * name of the cookie to use as a value for xsrf token + */ + xsrfCookieName?: string; + + /** + * name of the http header that carries the xsrf token value + */ + xsrfHeaderName?: string; + + /** + * Change the request data before it is sent to the server. + * This is only applicable for request methods 'PUT', 'POST', and 'PATCH' + * The last function in the array must return a string or an ArrayBuffer + */ + transformRequest?: ((data: T) => U) | [(data: T) => U]; + + /** + * change the response data to be made before it is passed to then/catch + */ + transformResponse?: (data: T) => U; + } /** - * custom headers to be sent + * - request body data type */ - headers?: Object; + interface AxiosXHRConfig extends AxiosXHRConfigBase { + /** + * server URL that will be used for the request, options are: + * GET, PUT, POST, DELETE, CONNECT, HEAD, OPTIONS, TRACE, PATCH + */ + url: string; + + /** + * request method to be used when making the request + */ + method?: string; + + /** + * data to be sent as the request body + * Only applicable for request methods 'PUT', 'POST', and 'PATCH' + * When no `transformRequest` is set, must be a string, an ArrayBuffer or a hash + */ + data?: T; + } /** - * URL parameters to be sent with the request + * - expected response type, + * - request body data type */ - params?: Object; + interface AxiosXHR { + /** + * Response that was provided by the server + */ + data: T; + + /** + * HTTP status code from the server response + */ + status: number; + + /** + * HTTP status message from the server response + */ + statusText: string; + + /** + * headers that the server responded with + */ + headers: Object; + + /** + * config that was provided to `axios` for the request + */ + config: AxiosXHRConfig; + } + + interface Interceptor { + /** + * intercept request before it is sent + */ + request: RequestInterceptor; + + /** + * intercept response of request when it is received. + */ + response: ResponseInterceptor + } + + interface RequestInterceptor { + /** + * - request body data type + */ + use(fn: (config: AxiosXHRConfig) => AxiosXHRConfig): void; + } + + interface ResponseInterceptor { + /** + * - expected response type + */ + use(fn: (config: AxiosXHR) => AxiosXHR): void; + } /** - * indicates whether or not cross-site Access-Control requests - * should be made using credentials + * - expected response type, + * - request body data type */ - withCredentials?: boolean; + interface AxiosInstance { + + /** + * Send request as configured + */ + (config: AxiosXHRConfig): IPromise>; + + /** + * Send request as configured + */ + new (config: AxiosXHRConfig): IPromise>; + + /** + * Send request as configured + */ + request(config: AxiosXHRConfig): IPromise>; + + /** + * intercept requests or responses before they are handled by then or catch + */ + interceptors: Interceptor; + + /** + * equivalent to `Promise.all` + */ + all(values: [T1 | IPromise>, T2 | IPromise>, T3 | IPromise>, T4 | IPromise>, T5 | IPromise>, T6 | IPromise>, T7 | IPromise>, T8 | IPromise>, T9 | IPromise>, T10 | IPromise>]): IPromise<[AxiosXHR, AxiosXHR, AxiosXHR, AxiosXHR, AxiosXHR, AxiosXHR, AxiosXHR, AxiosXHR, AxiosXHR, AxiosXHR]>; + all(values: [T1 | IPromise>, T2 | IPromise>, T3 | IPromise>, T4 | IPromise>, T5 | IPromise>, T6 | IPromise>, T7 | IPromise>, T8 | IPromise>, T9 | IPromise>]): IPromise<[AxiosXHR, AxiosXHR, AxiosXHR, AxiosXHR, AxiosXHR, AxiosXHR, AxiosXHR, AxiosXHR, AxiosXHR]>; + all(values: [T1 | IPromise>, T2 | IPromise>, T3 | IPromise>, T4 | IPromise>, T5 | IPromise>, T6 | IPromise>, T7 | IPromise>, T8 | IPromise>]): IPromise<[AxiosXHR, AxiosXHR, AxiosXHR, AxiosXHR, AxiosXHR, AxiosXHR, AxiosXHR, AxiosXHR]>; + all(values: [T1 | IPromise>, T2 | IPromise>, T3 | IPromise>, T4 | IPromise>, T5 | IPromise>, T6 | IPromise>, T7 | IPromise>]): IPromise<[AxiosXHR, AxiosXHR, AxiosXHR, AxiosXHR, AxiosXHR, AxiosXHR, AxiosXHR]>; + all(values: [T1 | IPromise>, T2 | IPromise>, T3 | IPromise>, T4 | IPromise>, T5 | IPromise>, T6 | IPromise>]): IPromise<[AxiosXHR, AxiosXHR, AxiosXHR, AxiosXHR, AxiosXHR, AxiosXHR]>; + all(values: [T1 | IPromise>, T2 | IPromise>, T3 | IPromise>, T4 | IPromise>, T5 | IPromise>]): IPromise<[AxiosXHR, AxiosXHR, AxiosXHR, AxiosXHR, AxiosXHR]>; + all(values: [T1 | IPromise>, T2 | IPromise>, T3 | IPromise>, T4 | IPromise>]): IPromise<[AxiosXHR, AxiosXHR, AxiosXHR, AxiosXHR]>; + all(values: [T1 | IPromise>, T2 | IPromise>, T3 | IPromise>]): IPromise<[AxiosXHR, AxiosXHR, AxiosXHR]>; + all(values: [T1 | IPromise>, T2 | IPromise>]): IPromise<[AxiosXHR, AxiosXHR]>; + + /** + * spread array parameter to `fn`. + * note: alternative to `spread`, destructuring assignment. + */ + spread(fn: (t1: T1, t2: T2) => U): (arr: ([T1, T2])) => U; + + /** + * convenience alias, method = GET + */ + get(url: string, config?: AxiosXHRConfigBase): IPromise>; + + + /** + * convenience alias, method = DELETE + */ + delete(url: string, config?: AxiosXHRConfigBase): IPromise>; + + /** + * convenience alias, method = HEAD + */ + head(url: string, config?: AxiosXHRConfigBase): IPromise>; + + /** + * convenience alias, method = POST + */ + post(url: string, data?: any, config?: AxiosXHRConfigBase): IPromise>; + + /** + * convenience alias, method = PUT + */ + put(url: string, data?: any, config?: AxiosXHRConfigBase): IPromise>; + + /** + * convenience alias, method = PATCH + */ + patch(url: string, data?: any, config?: AxiosXHRConfigBase): IPromise>; + } /** - * indicates the type of data that the server will respond with - * options are 'arraybuffer', 'blob', 'document', 'json', 'text' + * - expected response type, */ - responseType?: string; - - /** - * name of the cookie to use as a value for xsrf token - */ - xsrfCookieName?: string; - - /** - * name of the http header that carries the xsrf token value - */ - xsrfHeaderName?: string; - - } - - /** - * - request body data type - */ - interface AxiosXHRConfig extends AxiosXHRConfigBase { - /** - * server URL that will be used for the request, options are: - * GET, PUT, POST, DELETE, CONNECT, HEAD, OPTIONS, TRACE, PATCH - */ - url: string; - - /** - * request method to be used when making the request - */ - method?: string; - - /** - * data to be sent as the request body - * Only applicable for request methods 'PUT', 'POST', and 'PATCH' - * When no `transformRequest` is set, must be a string, an ArrayBuffer or a hash - */ - data?: T; - } - - /** - * - expected response type, - * - request body data type - */ - interface AxiosXHR { - /** - * Response that was provided by the server - */ - data: T; - - /** - * HTTP status code from the server response - */ - status: number; - - /** - * HTTP status message from the server response - */ - statusText: string; - - /** - * headers that the server responded with - */ - headers: Object; - - /** - * config that was provided to `axios` for the request - */ - config: AxiosXHRConfig; - } - - /** - * - expected response type, - * - request body data type - */ - interface AxiosStatic { - - (config: AxiosXHRConfig): Promise>; - - new (config: AxiosXHRConfig): Promise>; - - /** - * convenience alias, method = GET - */ - get(url: string, config?: AxiosXHRConfigBase): Promise>; - - - /** - * convenience alias, method = DELETE - */ - delete(url: string, config?: AxiosXHRConfigBase): Promise>; - - /** - * convenience alias, method = HEAD - */ - head(url: string, config?: AxiosXHRConfigBase): Promise>; - - /** - * convenience alias, method = POST - */ - post(url: string, data?: any, config?: AxiosXHRConfigBase): Promise>; - - /** - * convenience alias, method = PUT - */ - put(url: string, data?: any, config?: AxiosXHRConfigBase): Promise>; - - /** - * convenience alias, method = PATCH - */ - patch(url: string, data?: any, config?: AxiosXHRConfigBase): Promise>; - } + interface AxiosStatic extends AxiosInstance { + /** + * create a new instance of axios with a custom config + */ + create(config: AxiosXHRConfigBase): AxiosInstance; + } } declare var axios: Axios.AxiosStatic; declare module "axios" { - export = axios; + export = axios; } diff --git a/azure-mobile-apps/azure-mobile-apps-tests.ts b/azure-mobile-apps/azure-mobile-apps-tests.ts new file mode 100644 index 000000000..093932c2f --- /dev/null +++ b/azure-mobile-apps/azure-mobile-apps-tests.ts @@ -0,0 +1,87 @@ +/// + +import express = require('express'); +import mobileApps = require('azure-mobile-apps'); +import logger = require('azure-mobile-apps/src/logger'); +import queries = require('azure-mobile-apps/src/query'); + +var app = express(), + mobileApp = mobileApps(); + +// various configuration permutations +mobileApps({ + debug: true, + data: { + provider: 'mssql', + server: '', + user: '', + database: '', + password: '' + } +}); + +mobileApps({ + data: { + provider: 'memory' + } +}) + +// it would be nice to integrate with winston +mobileApps({ logging: { level: 'silly', transports: [{}] } }) + +// various custom middleware syntaxes +mobileApp.use(function (req: any, res: any, next: any) { next(); }); +mobileApp.use([function () {}, function () {}]); +mobileApp.use(function () {}, function () {}); +mobileApp.use(function () {}).use(function () {}); + +// basic syntax for tables and api +mobileApp.tables.add('todoitem'); +mobileApp.tables.add('todoitem', { authorize: true }); +mobileApp.tables.add('todoitem', mobileApps.table()); +mobileApp.tables.import('tables'); +mobileApp.api.add('api', { authorize: true, get: function () {}, delete: function () {} }); +mobileApp.api.import('api'); + +// Express.Table, instantiated from the mobile app +var table = mobileApp.table() +table.use(function (req: Express.Request, res: Express.Response, next: any) { + next(new Error()); +}); +table.use([function () {}, function () {}]); +table.read(function (context: Azure.MobileApps.Context) { + context.query.where({ p1: 'test' }); + return context.execute() + .then(function (result: any) { + return result; + }) + .catch(function (error: any) { }) + .then(function () {}); +}); +table.insert(function (context: Azure.MobileApps.Context) { + context.query.id = 'anotherId'; + context.query.single = true; + context.item.userId = context.user.id; + context.push.send('tag', {}, function (error, result) {}); + context.push.gcm.send('tag', {}, function (error, result) {}); + context.push.apns.send('tag', { payload: { } }, function (error, result) {}); + context.push.wns.sendToastText01('tag', '', { headers: { } }, function (error, result) {}); +}); +table.read.use(function () {}); +table.read.use([function () {}, function () {}]); +table.read.use(function () {}, function () {}); +table.use(function () {}).use(function () {}).read(function () {}).use(function () {}) + +// Express.Table, instantiated from the static require('azure-mobile-apps').table() +// This is going to be interesting if we ever support more than one provider +var table2 = mobileApps.table(); +table2.read(function (context: Azure.MobileApps.Context) {}) + +// Logger +logger.silly('test', 'message'); +logger.error('Something happened', new Error()); +mobileApps.logger.debug('a debug message') + +// Query +queries.create('table').where({ x: 10 }).select('col1,col2'); +mobileApps.query.create('table'); \ No newline at end of file diff --git a/azure-mobile-apps/azure-mobile-apps.d.ts b/azure-mobile-apps/azure-mobile-apps.d.ts new file mode 100644 index 000000000..5441515fe --- /dev/null +++ b/azure-mobile-apps/azure-mobile-apps.d.ts @@ -0,0 +1,279 @@ +// Type definitions for azure-mobile-apps v2.0.0-beta3 +// Project: https://github.com/Azure/azure-mobile-apps-node/ +// Definitions by: Microsoft Azure +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// + +declare module "azure-mobile-apps" { + interface AzureMobileApps { + (configuration?: Azure.MobileApps.Configuration): Azure.MobileApps.Platforms.Express.MobileApp; + table(): Azure.MobileApps.Platforms.Express.Table; + logger: Azure.MobileApps.Logger; + query: Azure.MobileApps.Query; + } + + var out: AzureMobileApps; + export = out; +} +declare module "azure-mobile-apps/src/logger" { + var logger: Azure.MobileApps.Logger; + export = logger; +} + +declare module "azure-mobile-apps/src/query" { + var query: Azure.MobileApps.Query; + export = query; +} + +declare module Azure.MobileApps { + // the additional Platforms namespace is required to avoid collisions with the main Express namespace + export module Platforms { + export module Express { + interface MobileApp { + configuration: Configuration; + tables: Tables; + table(): Table; + api: Api; + use(...middleware: Middleware[]): MobileApp; + use(middleware: Middleware[]): MobileApp; + } + + interface Api { + add(name: string, definition: ApiDefinition): void; + import(fileOrFolder: string): void; + } + + interface Table { + authorize?: boolean; + autoIncrement?: boolean; + dynamicSchema?: boolean; + name: string; + columns?: any; + schema: string; + + use(...middleware: Middleware[]): Table; + use(middleware: Middleware[]): Table; + read: TableOperation; + update: TableOperation; + insert: TableOperation; + delete: TableOperation; + undelete: TableOperation; + } + + interface TableOperation { + (operationHandler: (context: Context) => void): Table; + use(...middleware: Middleware[]): Table; + use(middleware: Middleware[]): Table; + } + + interface Tables { + configuration: Configuration; + add(name: string, definition?: Table | TableDefinition): void; + import(fileOrFolder: string): void; + initialize(): Thenable; + } + } + } + + export module Data { + interface Table { + read(query: QueryJs): Thenable; + update(item: any, query: QueryJs): Thenable; + insert(item: any): Thenable; + delete(query: QueryJs, version: string): Thenable; + undelete(query: QueryJs, version: string): Thenable; + truncate(): Thenable; + initialize(): Thenable; + schema(): Thenable; + } + + interface Column { + name: string; + type: string; + } + } + + // auth + interface User { + id: string; + claims: any[]; + token: string; + getIdentity(provider: string): Thenable; + } + + interface Auth { + validate(token: string): Thenable; + decode(token: string): User; + sign(payload: any): string; + } + + // configuration + interface Configuration { + platform?: string; + basePath?: string; + configFile?: string; + promiseConstructor?: (resolve: (result: any) => void, reject: (error: any) => void) => Thenable; + apiRootPath?: string; + tableRootPath?: string; + notificationRootPath?: string; + swaggerPath?: string; + authStubRoute?: string; + debug?: boolean; + version?: string; + apiVersion?: string; + homePage?: boolean; + swagger?: boolean; + maxTop?: number; + pageSize?: number; + logging?: Configuration.Logging; + data?: Configuration.Data; + auth?: Configuration.Auth; + cors?: Configuration.Cors; + notifications?: Configuration.Notifications; + } + + export module Configuration { + // it would be nice to have the config for various providers in separate interfaces, + // but this is the simplest solution to support variations of the current setup + interface Data { + provider: string; + user?: string; + password?: string; + server?: string; + port?: number; + database?: string; + connectionTimeout?: string; + options?: { encrypt: boolean }; + schema?: string; + dynamicSchema?: boolean; + } + + interface Auth { + secret: string; + validateTokens?: boolean; + } + + interface Logging { + level?: string; + transports?: LoggingTransport[]; + } + + interface LoggingTransport { } + + interface Cors { + maxAge?: number; + origins: string[]; + } + + interface Notifications { + hubName: string; + connectionString?: string; + endpoint?: string; + sharedAccessKeyName?: string; + sharedAccessKeyValue?: string; + } + } + + // query + interface Query { + create(tableName: string): QueryJs; + fromRequest(req: Express.Request): QueryJs; + toOData(query: QueryJs): OData; + } + + interface QueryJs { + includeTotalCount?: boolean; + orderBy(properties: string): QueryJs; + orderByDescending(properties: string): QueryJs; + select(properties: string): QueryJs; + skip(count: number): QueryJs; + take(count: number): QueryJs; + where(filter: any): QueryJs; + // these are properties added by the SDK + id?: string | number; + single?: boolean; + } + + interface OData { + table: string; + filters?: string; + ordering?: string; + orderClauses?: string; + skip?: number; + take?: number; + selections?: string; + includeTotalCount?: boolean; + } + + // general + var nh: Azure.ServiceBus.NotificationHubService; + interface Context { + query: QueryJs; + id: string | number; + item: any; + req: Express.Request; + res: Express.Response; + data: (table: TableDefinition) => Data.Table; + tables: (tableName: string) => Data.Table; + user: User; + push: typeof nh; + logger: Logger; + execute(): Thenable; + } + + interface TableDefinition { + authorize?: boolean; + autoIncrement?: boolean; + dynamicSchema?: boolean; + name?: string; + columns?: any; + schema?: string; + } + + interface ApiDefinition { + authorize?: boolean; + get?: Middleware | Middleware[]; + post?: Middleware | Middleware[]; + patch?: Middleware | Middleware[]; + put?: Middleware | Middleware[]; + delete?: Middleware | Middleware[]; + } + + interface Thenable { + then(onFulfilled?: (value: R) => U | Thenable, onRejected?: (error: any) => U | Thenable): Thenable; + then(onFulfilled?: (value: R) => U | Thenable, onRejected?: (error: any) => void): Thenable; + catch(onRejected?: (error: any) => U | Thenable): Thenable; + catch(onRejected?: (error: any) => void): Thenable; + } + + interface Logger { + log(level: string, ...message: any[]): void; + silly(...message: any[]): void; + debug(...message: any[]): void; + verbose(...message: any[]): void; + info(...message: any[]): void; + warn(...message: any[]): void; + error(...message: any[]): void; + } + + interface Middleware { + (req: Express.Request, res: Express.Response, next: NextMiddleware): void; + } + + interface NextMiddleware { + (error?: any): void; + } +} + +// additions to the Express modules +declare module Express { + interface Request { + azureMobile: Azure.MobileApps.Context + } + + interface Response { + results?: any; + } +} \ No newline at end of file diff --git a/azure-sb/azure-sb-tests.ts b/azure-sb/azure-sb-tests.ts new file mode 100644 index 000000000..508685181 --- /dev/null +++ b/azure-sb/azure-sb-tests.ts @@ -0,0 +1,16 @@ +/// + +var nh = new Azure.ServiceBus.NotificationHubService(); +nh.send('tag', '', function (error, result) {}); +nh.send('tag', '', { headers: {} }, function (error, result) {}); + +nh.apns.send('tag', { payload: { } }, function (error, result) {}); +nh.apns.send(['tag'], { payload: { } }, function (error, result) {}); +nh.gcm.send('tag', { }, function (error, result) {}); +nh.gcm.send(['tag'], { }, function (error, result) {}); +nh.wns.send('tag', '', 'wns/toast', function (error, result) {}); +nh.wns.send(['tag'], '', 'wns/toast', function (error, result) {}); +nh.wns.send('tag', '', 'wns/toast', { headers: {} }, function (error, result) {}); +nh.wns.sendToastText01('tag', '', function (error, result) {}); +nh.wns.sendToastText01(['tag'], '', function (error, result) {}); +nh.wns.sendToastText01('tag', '', { headers: {} }, function (error, result) {}); \ No newline at end of file diff --git a/azure-sb/azure-sb.d.ts b/azure-sb/azure-sb.d.ts new file mode 100644 index 000000000..afa4074a9 --- /dev/null +++ b/azure-sb/azure-sb.d.ts @@ -0,0 +1,173 @@ +// Type definitions for azure-sb +// Project: https://github.com/Azure/azure-sdk-for-node/tree/master/lib/services/serviceBus +// Definitions by: Microsoft Azure +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module Azure.ServiceBus { + interface Callback { + (error: any, response: any): void; + } + + interface NotificationHubRegistration { + RegistrationId: string; + ChannelUri?: string; + DeviceToken?: string; + gcmRegistrationId?: string; + Tags?: string; + BodyTemplate?: any; + WnsHeaders?: any; + MpnsHeaders?: any; + Expiry?: Date; + } + + export class NotificationHubService { + new(hubName: string, endpointOrConnectionString: string, sharedAccessKeyName?: string, sharedAccessKeyValue?: string): NotificationHubService; + hubName: string; + wns: Wns.Service; + apns: Apns.Service; + gcm: Gcm.Service; + mpns: Mpns.Service; + send(tags: string, payload: Object | string, optionsOrCallback?: { headers: Object } | Callback, callback?: Callback): void; + + createOrUpdateInstallation(installation: string, options: any, callback?: Callback): void; + patchInstallation(installationId: string, partialUpdateOperations: any[], options: any, callback?: Callback): void; + deleteInstallation(installationId: string, options: any, callback?: Callback): void; + getInstallation(installationId: string, options: any, callback?: Callback): void; + + /* + // old school? + createRegistrationId(callback?: Callback): void; + getRegistration(registrationId: string, options: any, callback?: Callback): void; + deleteRegistration(registrationId: string, options?: { etag: any }, callback?: Callback): void; + updateRegistration(registration: NotificationHubRegistration, options?: { etag: any }, callback?: Callback): void; + createOrUpdateRegistration(registration: NotificationHubRegistration, options?: { etag: any }, callback?: Callback): void; + listRegistrations(options?: { top: number, skip: number }, callback?: Callback): void; + listRegistrationsByTag(tag: string, options?: { top: number, skip: number }, callback?: Callback): void; + */ + } + + export module Apns { + interface Payload { + expiry?: Date; + aps?: Object; + badge?: number; + alert?: string; + sound?: string; + payload: Object; + } + + interface Service { + new(service: NotificationHubService): Service; + send(tags: string | string[], payload: Apns.Payload, callback?: Callback): void; + createNativeRegistration(token: string, tags: string | string[], optionsOrCallback?: Object | Callback, callback?: Callback): void; + createOrUpdateNativeRegistration(registrationId: string, token: string, tags: string | string[], optionsOrCallback?: Object | Callback, callback?: Callback): void; + createTemplateRegistration(token: string, tags: string | string[], template: Apns.Payload, optionsOrCallback?: Object | Callback, callback?: Callback): void; + createOrUpdateTemplateRegistration(registrationId: string, token: string, tags: string | string[], template: Apns.Payload, optionsOrCallback?: Object | Callback, callback?: Callback): void; + updateTemplateRegistration(registrationId: string, token: string, tags: string | string[], template: Apns.Payload, optionsOrCallback?: Object | Callback, callback?: Callback): void; + listRegistrationsByToken(token: string, optionsOrCallback?: { top: number, skip: number } | Callback, callback?: Callback): void; + } + } + export module Gcm { + interface Service { + new(service: NotificationHubService): Service; + send(tags: string | string[], payload: any, callback?: Callback): void; + createNativeRegistration(gcmRegistrationId: string, tags: string | string[], optionsOrCallback?: Object | Callback, callback?: Callback): void; + createOrUpdateNativeRegistration(registrationId: string, gcmRegistrationId: string, tags: string | string[], optionsOrCallback?: Object | Callback, callback?: Callback): void; + createTemplateRegistration(gcmRegistrationId: string, tags: string | string[], template: any, optionsOrCallback?: Object | Callback, callback?: Callback): void; + createOrUpdateTemplateRegistration(registrationId: string, gcmRegistrationId: string, tags: string | string[], template: any, optionsOrCallback?: Object | Callback, callback?: Callback): void; + updateTemplateRegistration(registrationId: string, gcmRegistrationId: string, tags: string | string[], template: any, optionsOrCallback?: Object | Callback, callback?: Callback): void; + listRegistrationsByGcmRegistrationId(gcmRegistrationId: string, optionsOrCallback?: { top: number, skip: number } | Callback, callback?: Callback): void; + } + } + + export module Mpns { interface Service { } } + + export module Wns { + interface Payload { + text1?: string; + text2?: string; + text3?: string; + text4?: string; + image1src?: string; + image1alt?: string; + image2src?: string; + image2alt?: string; + image3src?: string; + image3alt?: string; + image4src?: string; + image4alt?: string; + lang?: string; + type?: string; + } + + interface Options { + headers: Object; + } + + interface Service { + new(service: NotificationHubService): Service; + sendTileSquareBlock(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileSquareText01(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileSquareText02(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileSquareText03(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileSquareText04(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileWideText01(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileWideText02(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileWideText03(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileWideText04(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileWideText05(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileWideText06(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileWideText07(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileWideText08(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileWideText09(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileWideText10(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileWideText11(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileSquareImage(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileSquarePeekImageAndText01(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileSquarePeekImageAndText02(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileSquarePeekImageAndText03(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileSquarePeekImageAndText04(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileWideImage(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileWideImageCollection(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileWideImageAndText01(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileWideImageAndText02(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileWideBlockAndText01(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileWideBlockAndText02(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileWideSmallImageAndText01(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileWideSmallImageAndText02(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileWideSmallImageAndText03(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileWideSmallImageAndText04(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileWideSmallImageAndText05(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileWidePeekImageCollection01(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileWidePeekImageCollection02(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileWidePeekImageCollection03(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileWidePeekImageCollection04(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileWidePeekImageCollection05(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileWidePeekImageCollection06(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileWidePeekImageAndText01(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileWidePeekImageAndText02(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileWidePeekImage01(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileWidePeekImage02(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileWidePeekImage03(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileWidePeekImage04(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileWidePeekImage05(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendTileWidePeekImage06(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendToastText01(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendToastText02(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendToastText03(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendToastText04(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendToastImageAndText01(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendToastImageAndText02(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendToastImageAndText03(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendToastImageAndText04(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + // badges = ['none','activity','alert','available','away','busy','newMessage','paused','playing','unavailable','error', 'attention'] + sendBadge(tags: string | string[], value: string | number, optionsOrCallback?: Options | Callback, callback?: Callback): void; + sendRaw(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; + // types = ['wns/toast', 'wns/badge', 'wns/tile', 'wns/raw'] + send(tags: string | string[], payload: string, type: string, optionsOrCallback?: Options | Callback, callback?: Callback): void; + createNativeRegistration(channel: string, tags: string | string[], optionsOrCallback?: Options | Callback, callback?: Callback): void; + createOrUpdateNativeRegistration(registrationId: string, channel: string, tags: string | string[], optionsOrCallback?: Options | Callback, callback?: Callback): void; + listRegistrationsByChannel(channel: string, optionsOrCallback?: { top: number, skip: number } | Callback, callback?: Callback): void; + } + } +} \ No newline at end of file diff --git a/babylonjs/babylon-tests.ts b/babylonjs/babylon-tests.ts new file mode 100644 index 000000000..142d3840f --- /dev/null +++ b/babylonjs/babylon-tests.ts @@ -0,0 +1 @@ +/// diff --git a/babylonjs/babylon.d.ts b/babylonjs/babylon.d.ts new file mode 100644 index 000000000..1cc835442 --- /dev/null +++ b/babylonjs/babylon.d.ts @@ -0,0 +1,6327 @@ +// Type definitions for BabylonJS v2.2 +// Project: http://www.babylonjs.com/ +// Definitions by: David Catuhe +// Definitions: https://github.com/borisyankov/babylonjs + + +declare module BABYLON { + class _DepthCullingState { + private _isDepthTestDirty; + private _isDepthMaskDirty; + private _isDepthFuncDirty; + private _isCullFaceDirty; + private _isCullDirty; + private _isZOffsetDirty; + private _depthTest; + private _depthMask; + private _depthFunc; + private _cull; + private _cullFace; + private _zOffset; + isDirty: boolean; + zOffset: number; + cullFace: number; + cull: boolean; + depthFunc: number; + depthMask: boolean; + depthTest: boolean; + reset(): void; + apply(gl: WebGLRenderingContext): void; + } + class _AlphaState { + private _isAlphaBlendDirty; + private _isBlendFunctionParametersDirty; + private _alphaBlend; + private _blendFunctionParameters; + isDirty: boolean; + alphaBlend: boolean; + setAlphaBlendFunctionParameters(value0: number, value1: number, value2: number, value3: number): void; + reset(): void; + apply(gl: WebGLRenderingContext): void; + } + class EngineCapabilities { + maxTexturesImageUnits: number; + maxTextureSize: number; + maxCubemapTextureSize: number; + maxRenderTextureSize: number; + standardDerivatives: boolean; + s3tc: any; + textureFloat: boolean; + textureAnisotropicFilterExtension: any; + maxAnisotropy: number; + instancedArrays: any; + uintIndices: boolean; + highPrecisionShaderSupported: boolean; + } + /** + * The engine class is responsible for interfacing with all lower-level APIs such as WebGL and Audio. + */ + class Engine { + private static _ALPHA_DISABLE; + private static _ALPHA_ADD; + private static _ALPHA_COMBINE; + private static _ALPHA_SUBTRACT; + private static _ALPHA_MULTIPLY; + private static _ALPHA_MAXIMIZED; + private static _ALPHA_ONEONE; + private static _DELAYLOADSTATE_NONE; + private static _DELAYLOADSTATE_LOADED; + private static _DELAYLOADSTATE_LOADING; + private static _DELAYLOADSTATE_NOTLOADED; + private static _TEXTUREFORMAT_ALPHA; + private static _TEXTUREFORMAT_LUMINANCE; + private static _TEXTUREFORMAT_LUMINANCE_ALPHA; + private static _TEXTUREFORMAT_RGB; + private static _TEXTUREFORMAT_RGBA; + private static _TEXTURETYPE_UNSIGNED_INT; + private static _TEXTURETYPE_FLOAT; + static ALPHA_DISABLE: number; + static ALPHA_ONEONE: number; + static ALPHA_ADD: number; + static ALPHA_COMBINE: number; + static ALPHA_SUBTRACT: number; + static ALPHA_MULTIPLY: number; + static ALPHA_MAXIMIZED: number; + static DELAYLOADSTATE_NONE: number; + static DELAYLOADSTATE_LOADED: number; + static DELAYLOADSTATE_LOADING: number; + static DELAYLOADSTATE_NOTLOADED: number; + static TEXTUREFORMAT_ALPHA: number; + static TEXTUREFORMAT_LUMINANCE: number; + static TEXTUREFORMAT_LUMINANCE_ALPHA: number; + static TEXTUREFORMAT_RGB: number; + static TEXTUREFORMAT_RGBA: number; + static TEXTURETYPE_UNSIGNED_INT: number; + static TEXTURETYPE_FLOAT: number; + static Version: string; + static Epsilon: number; + static CollisionsEpsilon: number; + static CodeRepository: string; + static ShadersRepository: string; + isFullscreen: boolean; + isPointerLock: boolean; + cullBackFaces: boolean; + renderEvenInBackground: boolean; + enableOfflineSupport: boolean; + scenes: Scene[]; + _gl: WebGLRenderingContext; + private _renderingCanvas; + private _windowIsBackground; + static audioEngine: AudioEngine; + private _onBlur; + private _onFocus; + private _onFullscreenChange; + private _onPointerLockChange; + private _hardwareScalingLevel; + private _caps; + private _pointerLockRequested; + private _alphaTest; + private _resizeLoadingUI; + private _loadingDiv; + private _loadingTextDiv; + private _loadingDivBackgroundColor; + private _drawCalls; + private _glVersion; + private _glRenderer; + private _glVendor; + private _videoTextureSupported; + private _renderingQueueLaunched; + private _activeRenderLoops; + private fpsRange; + private previousFramesDuration; + private fps; + private deltaTime; + private _depthCullingState; + private _alphaState; + private _alphaMode; + private _loadedTexturesCache; + _activeTexturesCache: BaseTexture[]; + private _currentEffect; + private _compiledEffects; + private _vertexAttribArrays; + private _cachedViewport; + private _cachedVertexBuffers; + private _cachedIndexBuffer; + private _cachedEffectForVertexBuffers; + private _currentRenderTarget; + private _uintIndicesCurrentlySet; + private _workingCanvas; + private _workingContext; + /** + * @constructor + * @param {HTMLCanvasElement} canvas - the canvas to be used for rendering + * @param {boolean} [antialias] - enable antialias + * @param options - further options to be sent to the getContext function + */ + constructor(canvas: HTMLCanvasElement, antialias?: boolean, options?: any); + private _prepareWorkingCanvas(); + getGlInfo(): { + vendor: string; + renderer: string; + version: string; + }; + getAspectRatio(camera: Camera): number; + getRenderWidth(): number; + getRenderHeight(): number; + getRenderingCanvas(): HTMLCanvasElement; + getRenderingCanvasClientRect(): ClientRect; + setHardwareScalingLevel(level: number): void; + getHardwareScalingLevel(): number; + getLoadedTexturesCache(): WebGLTexture[]; + getCaps(): EngineCapabilities; + drawCalls: number; + resetDrawCalls(): void; + setDepthFunctionToGreater(): void; + setDepthFunctionToGreaterOrEqual(): void; + setDepthFunctionToLess(): void; + setDepthFunctionToLessOrEqual(): void; + /** + * stop executing a render loop function and remove it from the execution array + * @param {Function} [renderFunction] the function to be removed. If not provided all functions will be removed. + */ + stopRenderLoop(renderFunction?: () => void): void; + _renderLoop(): void; + /** + * Register and execute a render loop. The engine can have more than one render function. + * @param {Function} renderFunction - the function to continuesly execute starting the next render loop. + * @example + * engine.runRenderLoop(function () { + * scene.render() + * }) + */ + runRenderLoop(renderFunction: () => void): void; + /** + * Toggle full screen mode. + * @param {boolean} requestPointerLock - should a pointer lock be requested from the user + */ + switchFullscreen(requestPointerLock: boolean): void; + clear(color: any, backBuffer: boolean, depthStencil: boolean): void; + /** + * Set the WebGL's viewport + * @param {BABYLON.Viewport} viewport - the viewport element to be used. + * @param {number} [requiredWidth] - the width required for rendering. If not provided the rendering canvas' width is used. + * @param {number} [requiredHeight] - the height required for rendering. If not provided the rendering canvas' height is used. + */ + setViewport(viewport: Viewport, requiredWidth?: number, requiredHeight?: number): void; + setDirectViewport(x: number, y: number, width: number, height: number): void; + beginFrame(): void; + endFrame(): void; + /** + * resize the view according to the canvas' size. + * @example + * window.addEventListener("resize", function () { + * engine.resize(); + * }); + */ + resize(): void; + /** + * force a specific size of the canvas + * @param {number} width - the new canvas' width + * @param {number} height - the new canvas' height + */ + setSize(width: number, height: number): void; + bindFramebuffer(texture: WebGLTexture): void; + unBindFramebuffer(texture: WebGLTexture): void; + flushFramebuffer(): void; + restoreDefaultFramebuffer(): void; + private _resetVertexBufferBinding(); + createVertexBuffer(vertices: number[]): WebGLBuffer; + createDynamicVertexBuffer(capacity: number): WebGLBuffer; + updateDynamicVertexBuffer(vertexBuffer: WebGLBuffer, vertices: any, offset?: number): void; + private _resetIndexBufferBinding(); + createIndexBuffer(indices: number[]): WebGLBuffer; + bindBuffers(vertexBuffer: WebGLBuffer, indexBuffer: WebGLBuffer, vertexDeclaration: number[], vertexStrideSize: number, effect: Effect): void; + bindMultiBuffers(vertexBuffers: VertexBuffer[], indexBuffer: WebGLBuffer, effect: Effect): void; + _releaseBuffer(buffer: WebGLBuffer): boolean; + createInstancesBuffer(capacity: number): WebGLBuffer; + deleteInstancesBuffer(buffer: WebGLBuffer): void; + updateAndBindInstancesBuffer(instancesBuffer: WebGLBuffer, data: Float32Array, offsetLocations: number[]): void; + unBindInstancesBuffer(instancesBuffer: WebGLBuffer, offsetLocations: number[]): void; + applyStates(): void; + draw(useTriangles: boolean, indexStart: number, indexCount: number, instancesCount?: number): void; + drawPointClouds(verticesStart: number, verticesCount: number, instancesCount?: number): void; + _releaseEffect(effect: Effect): void; + createEffect(baseName: any, attributesNames: string[], uniformsNames: string[], samplers: string[], defines: string, fallbacks?: EffectFallbacks, onCompiled?: (effect: Effect) => void, onError?: (effect: Effect, errors: string) => void): Effect; + createEffectForParticles(fragmentName: string, uniformsNames?: string[], samplers?: string[], defines?: string, fallbacks?: EffectFallbacks, onCompiled?: (effect: Effect) => void, onError?: (effect: Effect, errors: string) => void): Effect; + createShaderProgram(vertexCode: string, fragmentCode: string, defines: string): WebGLProgram; + getUniforms(shaderProgram: WebGLProgram, uniformsNames: string[]): WebGLUniformLocation[]; + getAttributes(shaderProgram: WebGLProgram, attributesNames: string[]): number[]; + enableEffect(effect: Effect): void; + setArray(uniform: WebGLUniformLocation, array: number[]): void; + setArray2(uniform: WebGLUniformLocation, array: number[]): void; + setArray3(uniform: WebGLUniformLocation, array: number[]): void; + setArray4(uniform: WebGLUniformLocation, array: number[]): void; + setMatrices(uniform: WebGLUniformLocation, matrices: Float32Array): void; + setMatrix(uniform: WebGLUniformLocation, matrix: Matrix): void; + setMatrix3x3(uniform: WebGLUniformLocation, matrix: Float32Array): void; + setMatrix2x2(uniform: WebGLUniformLocation, matrix: Float32Array): void; + setFloat(uniform: WebGLUniformLocation, value: number): void; + setFloat2(uniform: WebGLUniformLocation, x: number, y: number): void; + setFloat3(uniform: WebGLUniformLocation, x: number, y: number, z: number): void; + setBool(uniform: WebGLUniformLocation, bool: number): void; + setFloat4(uniform: WebGLUniformLocation, x: number, y: number, z: number, w: number): void; + setColor3(uniform: WebGLUniformLocation, color3: Color3): void; + setColor4(uniform: WebGLUniformLocation, color3: Color3, alpha: number): void; + setState(culling: boolean, zOffset?: number, force?: boolean): void; + setDepthBuffer(enable: boolean): void; + getDepthWrite(): boolean; + setDepthWrite(enable: boolean): void; + setColorWrite(enable: boolean): void; + setAlphaMode(mode: number): void; + getAlphaMode(): number; + setAlphaTesting(enable: boolean): void; + getAlphaTesting(): boolean; + wipeCaches(): void; + setSamplingMode(texture: WebGLTexture, samplingMode: number): void; + createTexture(url: string, noMipmap: boolean, invertY: boolean, scene: Scene, samplingMode?: number, onLoad?: () => void, onError?: () => void, buffer?: any): WebGLTexture; + updateRawTexture(texture: WebGLTexture, data: ArrayBufferView, format: number, invertY: boolean, compression?: string): void; + createRawTexture(data: ArrayBufferView, width: number, height: number, format: number, generateMipMaps: boolean, invertY: boolean, samplingMode: number, compression?: string): WebGLTexture; + createDynamicTexture(width: number, height: number, generateMipMaps: boolean, samplingMode: number, forceExponantOfTwo?: boolean): WebGLTexture; + updateTextureSamplingMode(samplingMode: number, texture: WebGLTexture): void; + updateDynamicTexture(texture: WebGLTexture, canvas: HTMLCanvasElement, invertY: boolean): void; + updateVideoTexture(texture: WebGLTexture, video: HTMLVideoElement, invertY: boolean): void; + createRenderTargetTexture(size: any, options: any): WebGLTexture; + createCubeTexture(rootUrl: string, scene: Scene, extensions: string[], noMipmap?: boolean): WebGLTexture; + _releaseTexture(texture: WebGLTexture): void; + bindSamplers(effect: Effect): void; + _bindTexture(channel: number, texture: WebGLTexture): void; + setTextureFromPostProcess(channel: number, postProcess: PostProcess): void; + setTexture(channel: number, texture: BaseTexture): void; + _setAnisotropicLevel(key: number, texture: BaseTexture): void; + readPixels(x: number, y: number, width: number, height: number): Uint8Array; + dispose(): void; + displayLoadingUI(): void; + loadingUIText: string; + loadingUIBackgroundColor: string; + hideLoadingUI(): void; + getFps(): number; + getDeltaTime(): number; + private _measureFps(); + static isSupported(): boolean; + } +} + +interface Window { + mozIndexedDB(func: any): any; + webkitIndexedDB(func: any): any; + IDBTransaction(func: any): any; + webkitIDBTransaction(func: any): any; + msIDBTransaction(func: any): any; + IDBKeyRange(func: any): any; + webkitIDBKeyRange(func: any): any; + msIDBKeyRange(func: any): any; + webkitURL: HTMLURL; + webkitRequestAnimationFrame(func: any): any; + mozRequestAnimationFrame(func: any): any; + oRequestAnimationFrame(func: any): any; + WebGLRenderingContext: WebGLRenderingContext; + MSGesture: MSGesture; + CANNON: any; + SIMD: any; + AudioContext: AudioContext; + webkitAudioContext: AudioContext; +} +interface HTMLURL { + createObjectURL(param1: any, param2?: any): any; +} +interface Document { + exitFullscreen(): void; + webkitCancelFullScreen(): void; + mozCancelFullScreen(): void; + msCancelFullScreen(): void; + mozFullScreen: boolean; + msIsFullScreen: boolean; + fullscreen: boolean; + mozPointerLockElement: HTMLElement; + msPointerLockElement: HTMLElement; + webkitPointerLockElement: HTMLElement; +} +interface HTMLCanvasElement { + requestPointerLock(): void; + msRequestPointerLock(): void; + mozRequestPointerLock(): void; + webkitRequestPointerLock(): void; +} +interface CanvasRenderingContext2D { + imageSmoothingEnabled: boolean; + mozImageSmoothingEnabled: boolean; + oImageSmoothingEnabled: boolean; + webkitImageSmoothingEnabled: boolean; +} +interface WebGLTexture { + isReady: boolean; + isCube: boolean; + url: string; + noMipmap: boolean; + samplingMode: number; + references: number; + generateMipMaps: boolean; + _size: number; + _baseWidth: number; + _baseHeight: number; + _width: number; + _height: number; + _workingCanvas: HTMLCanvasElement; + _workingContext: CanvasRenderingContext2D; + _framebuffer: WebGLFramebuffer; + _depthBuffer: WebGLRenderbuffer; + _cachedCoordinatesMode: number; + _cachedWrapU: number; + _cachedWrapV: number; + _isDisabled: boolean; +} +interface WebGLBuffer { + references: number; + capacity: number; + is32Bits: boolean; +} +interface MouseEvent { + mozMovementX: number; + mozMovementY: number; + webkitMovementX: number; + webkitMovementY: number; + msMovementX: number; + msMovementY: number; +} +interface MSStyleCSSProperties { + webkitTransform: string; + webkitTransition: string; +} +interface Navigator { + getVRDevices: () => any; + mozGetVRDevices: (any: any) => any; + isCocoonJS: boolean; +} +interface Screen { + orientation: string; + mozOrientation: string; +} + +declare module BABYLON { + /** + * Node is the basic class for all scene objects (Mesh, Light Camera). + */ + class Node { + parent: Node; + name: string; + id: string; + uniqueId: number; + state: string; + animations: Animation[]; + onReady: (node: Node) => void; + private _childrenFlag; + private _isEnabled; + private _isReady; + _currentRenderId: number; + private _parentRenderId; + _waitingParentId: string; + private _scene; + _cache: any; + /** + * @constructor + * @param {string} name - the name and id to be given to this node + * @param {BABYLON.Scene} the scene this node will be added to + */ + constructor(name: string, scene: Scene); + getScene(): Scene; + getEngine(): Engine; + getWorldMatrix(): Matrix; + _initCache(): void; + updateCache(force?: boolean): void; + _updateCache(ignoreParentClass?: boolean): void; + _isSynchronized(): boolean; + _markSyncedWithParent(): void; + isSynchronizedWithParent(): boolean; + isSynchronized(updateCache?: boolean): boolean; + hasNewParent(update?: boolean): boolean; + /** + * Is this node ready to be used/rendered + * @return {boolean} is it ready + */ + isReady(): boolean; + /** + * Is this node enabled. + * If the node has a parent and is enabled, the parent will be inspected as well. + * @return {boolean} whether this node (and its parent) is enabled. + * @see setEnabled + */ + isEnabled(): boolean; + /** + * Set the enabled state of this node. + * @param {boolean} value - the new enabled state + * @see isEnabled + */ + setEnabled(value: boolean): void; + /** + * Is this node a descendant of the given node. + * The function will iterate up the hierarchy until the ancestor was found or no more parents defined. + * @param {BABYLON.Node} ancestor - The parent node to inspect + * @see parent + */ + isDescendantOf(ancestor: Node): boolean; + _getDescendants(list: Node[], results: Node[]): void; + /** + * Will return all nodes that have this node as parent. + * @return {BABYLON.Node[]} all children nodes of all types. + */ + getDescendants(): Node[]; + _setReady(state: boolean): void; + } +} + +declare module BABYLON { + interface IDisposable { + dispose(): void; + } + /** + * Represents a scene to be rendered by the engine. + * @see http://doc.babylonjs.com/page.php?p=21911 + */ + class Scene { + private static _FOGMODE_NONE; + private static _FOGMODE_EXP; + private static _FOGMODE_EXP2; + private static _FOGMODE_LINEAR; + static MinDeltaTime: number; + static MaxDeltaTime: number; + static FOGMODE_NONE: number; + static FOGMODE_EXP: number; + static FOGMODE_EXP2: number; + static FOGMODE_LINEAR: number; + autoClear: boolean; + clearColor: any; + ambientColor: Color3; + /** + * A function to be executed before rendering this scene + * @type {Function} + */ + beforeRender: () => void; + /** + * A function to be executed after rendering this scene + * @type {Function} + */ + afterRender: () => void; + /** + * A function to be executed when this scene is disposed. + * @type {Function} + */ + onDispose: () => void; + beforeCameraRender: (camera: Camera) => void; + afterCameraRender: (camera: Camera) => void; + forceWireframe: boolean; + forcePointsCloud: boolean; + forceShowBoundingBoxes: boolean; + clipPlane: Plane; + animationsEnabled: boolean; + private _onPointerMove; + private _onPointerDown; + private _onPointerUp; + onPointerDown: (evt: PointerEvent, pickInfo: PickingInfo) => void; + onPointerUp: (evt: PointerEvent, pickInfo: PickingInfo) => void; + cameraToUseForPointers: Camera; + private _pointerX; + private _pointerY; + private _meshUnderPointer; + private _onKeyDown; + private _onKeyUp; + /** + * is fog enabled on this scene. + * @type {boolean} + */ + fogEnabled: boolean; + fogMode: number; + fogColor: Color3; + fogDensity: number; + fogStart: number; + fogEnd: number; + /** + * is shadow enabled on this scene. + * @type {boolean} + */ + shadowsEnabled: boolean; + /** + * is light enabled on this scene. + * @type {boolean} + */ + lightsEnabled: boolean; + /** + * All of the lights added to this scene. + * @see BABYLON.Light + * @type {BABYLON.Light[]} + */ + lights: Light[]; + onNewLightAdded: (newLight?: Light, positionInArray?: number, scene?: Scene) => void; + onLightRemoved: (removedLight?: Light) => void; + /** + * All of the cameras added to this scene. + * @see BABYLON.Camera + * @type {BABYLON.Camera[]} + */ + cameras: Camera[]; + onNewCameraAdded: (newCamera?: Camera, positionInArray?: number, scene?: Scene) => void; + onCameraRemoved: (removedCamera?: Camera) => void; + activeCameras: Camera[]; + activeCamera: Camera; + /** + * All of the (abstract) meshes added to this scene. + * @see BABYLON.AbstractMesh + * @type {BABYLON.AbstractMesh[]} + */ + meshes: AbstractMesh[]; + onNewMeshAdded: (newMesh?: AbstractMesh, positionInArray?: number, scene?: Scene) => void; + onMeshRemoved: (removedMesh?: AbstractMesh) => void; + private _geometries; + onGeometryAdded: (newGeometry?: Geometry) => void; + onGeometryRemoved: (removedGeometry?: Geometry) => void; + materials: Material[]; + multiMaterials: MultiMaterial[]; + defaultMaterial: StandardMaterial; + texturesEnabled: boolean; + textures: BaseTexture[]; + particlesEnabled: boolean; + particleSystems: ParticleSystem[]; + spritesEnabled: boolean; + spriteManagers: SpriteManager[]; + layers: Layer[]; + skeletonsEnabled: boolean; + skeletons: Skeleton[]; + lensFlaresEnabled: boolean; + lensFlareSystems: LensFlareSystem[]; + collisionsEnabled: boolean; + private _workerCollisions; + collisionCoordinator: ICollisionCoordinator; + gravity: Vector3; + postProcessesEnabled: boolean; + postProcessManager: PostProcessManager; + postProcessRenderPipelineManager: PostProcessRenderPipelineManager; + renderTargetsEnabled: boolean; + dumpNextRenderTargets: boolean; + customRenderTargets: RenderTargetTexture[]; + useDelayedTextureLoading: boolean; + importedMeshesFiles: String[]; + database: any; + /** + * This scene's action manager + * @type {BABYLON.ActionManager} + */ + actionManager: ActionManager; + _actionManagers: ActionManager[]; + private _meshesForIntersections; + proceduralTexturesEnabled: boolean; + _proceduralTextures: ProceduralTexture[]; + mainSoundTrack: SoundTrack; + soundTracks: SoundTrack[]; + private _audioEnabled; + private _headphone; + simplificationQueue: SimplificationQueue; + private _engine; + private _totalVertices; + _activeIndices: number; + _activeParticles: number; + private _lastFrameDuration; + private _evaluateActiveMeshesDuration; + private _renderTargetsDuration; + _particlesDuration: number; + private _renderDuration; + _spritesDuration: number; + private _animationRatio; + private _animationStartDate; + _cachedMaterial: Material; + private _renderId; + private _executeWhenReadyTimeoutId; + _toBeDisposed: SmartArray; + private _onReadyCallbacks; + private _pendingData; + private _onBeforeRenderCallbacks; + private _onAfterRenderCallbacks; + private _activeMeshes; + private _processedMaterials; + private _renderTargets; + _activeParticleSystems: SmartArray; + private _activeSkeletons; + private _softwareSkinnedMeshes; + _activeBones: number; + private _renderingManager; + private _physicsEngine; + _activeAnimatables: Animatable[]; + private _transformMatrix; + private _pickWithRayInverseMatrix; + private _edgesRenderers; + private _boundingBoxRenderer; + private _outlineRenderer; + private _viewMatrix; + private _projectionMatrix; + private _frustumPlanes; + private _selectionOctree; + private _pointerOverMesh; + private _debugLayer; + private _depthRenderer; + private _uniqueIdCounter; + /** + * @constructor + * @param {BABYLON.Engine} engine - the engine to be used to render this scene. + */ + constructor(engine: Engine); + debugLayer: DebugLayer; + workerCollisions: boolean; + SelectionOctree: Octree; + /** + * The mesh that is currently under the pointer. + * @return {BABYLON.AbstractMesh} mesh under the pointer/mouse cursor or null if none. + */ + meshUnderPointer: AbstractMesh; + /** + * Current on-screen X position of the pointer + * @return {number} X position of the pointer + */ + pointerX: number; + /** + * Current on-screen Y position of the pointer + * @return {number} Y position of the pointer + */ + pointerY: number; + getCachedMaterial(): Material; + getBoundingBoxRenderer(): BoundingBoxRenderer; + getOutlineRenderer(): OutlineRenderer; + getEngine(): Engine; + getTotalVertices(): number; + getActiveIndices(): number; + getActiveParticles(): number; + getActiveBones(): number; + getLastFrameDuration(): number; + getEvaluateActiveMeshesDuration(): number; + getActiveMeshes(): SmartArray; + getRenderTargetsDuration(): number; + getRenderDuration(): number; + getParticlesDuration(): number; + getSpritesDuration(): number; + getAnimationRatio(): number; + getRenderId(): number; + incrementRenderId(): void; + private _updatePointerPosition(evt); + attachControl(): void; + detachControl(): void; + isReady(): boolean; + resetCachedMaterial(): void; + registerBeforeRender(func: () => void): void; + unregisterBeforeRender(func: () => void): void; + registerAfterRender(func: () => void): void; + unregisterAfterRender(func: () => void): void; + _addPendingData(data: any): void; + _removePendingData(data: any): void; + getWaitingItemsCount(): number; + /** + * Registers a function to be executed when the scene is ready. + * @param {Function} func - the function to be executed. + */ + executeWhenReady(func: () => void): void; + _checkIsReady(): void; + /** + * Will start the animation sequence of a given target + * @param target - the target + * @param {number} from - from which frame should animation start + * @param {number} to - till which frame should animation run. + * @param {boolean} [loop] - should the animation loop + * @param {number} [speedRatio] - the speed in which to run the animation + * @param {Function} [onAnimationEnd] function to be executed when the animation ended. + * @param {BABYLON.Animatable} [animatable] an animatable object. If not provided a new one will be created from the given params. + * @return {BABYLON.Animatable} the animatable object created for this animation + * @see BABYLON.Animatable + * @see http://doc.babylonjs.com/page.php?p=22081 + */ + beginAnimation(target: any, from: number, to: number, loop?: boolean, speedRatio?: number, onAnimationEnd?: () => void, animatable?: Animatable): Animatable; + beginDirectAnimation(target: any, animations: Animation[], from: number, to: number, loop?: boolean, speedRatio?: number, onAnimationEnd?: () => void): Animatable; + getAnimatableByTarget(target: any): Animatable; + /** + * Will stop the animation of the given target + * @param target - the target + * @see beginAnimation + */ + stopAnimation(target: any): void; + private _animate(); + getViewMatrix(): Matrix; + getProjectionMatrix(): Matrix; + getTransformMatrix(): Matrix; + setTransformMatrix(view: Matrix, projection: Matrix): void; + addMesh(newMesh: AbstractMesh): void; + removeMesh(toRemove: AbstractMesh): number; + removeLight(toRemove: Light): number; + removeCamera(toRemove: Camera): number; + addLight(newLight: Light): void; + addCamera(newCamera: Camera): void; + /** + * sets the active camera of the scene using its ID + * @param {string} id - the camera's ID + * @return {BABYLON.Camera|null} the new active camera or null if none found. + * @see activeCamera + */ + setActiveCameraByID(id: string): Camera; + /** + * sets the active camera of the scene using its name + * @param {string} name - the camera's name + * @return {BABYLON.Camera|null} the new active camera or null if none found. + * @see activeCamera + */ + setActiveCameraByName(name: string): Camera; + /** + * get a material using its id + * @param {string} the material's ID + * @return {BABYLON.Material|null} the material or null if none found. + */ + getMaterialByID(id: string): Material; + /** + * get a material using its name + * @param {string} the material's name + * @return {BABYLON.Material|null} the material or null if none found. + */ + getMaterialByName(name: string): Material; + getLensFlareSystemByName(name: string): LensFlareSystem; + getCameraByID(id: string): Camera; + getCameraByUniqueID(uniqueId: number): Camera; + /** + * get a camera using its name + * @param {string} the camera's name + * @return {BABYLON.Camera|null} the camera or null if none found. + */ + getCameraByName(name: string): Camera; + /** + * get a light node using its name + * @param {string} the light's name + * @return {BABYLON.Light|null} the light or null if none found. + */ + getLightByName(name: string): Light; + /** + * get a light node using its ID + * @param {string} the light's id + * @return {BABYLON.Light|null} the light or null if none found. + */ + getLightByID(id: string): Light; + /** + * get a light node using its scene-generated unique ID + * @param {number} the light's unique id + * @return {BABYLON.Light|null} the light or null if none found. + */ + getLightByUniqueID(uniqueId: number): Light; + /** + * get a geometry using its ID + * @param {string} the geometry's id + * @return {BABYLON.Geometry|null} the geometry or null if none found. + */ + getGeometryByID(id: string): Geometry; + /** + * add a new geometry to this scene. + * @param {BABYLON.Geometry} geometry - the geometry to be added to the scene. + * @param {boolean} [force] - force addition, even if a geometry with this ID already exists + * @return {boolean} was the geometry added or not + */ + pushGeometry(geometry: Geometry, force?: boolean): boolean; + /** + * Removes an existing geometry + * @param {BABYLON.Geometry} geometry - the geometry to be removed from the scene. + * @return {boolean} was the geometry removed or not + */ + removeGeometry(geometry: Geometry): boolean; + getGeometries(): Geometry[]; + /** + * Get the first added mesh found of a given ID + * @param {string} id - the id to search for + * @return {BABYLON.AbstractMesh|null} the mesh found or null if not found at all. + */ + getMeshByID(id: string): AbstractMesh; + /** + * Get a mesh with its auto-generated unique id + * @param {number} uniqueId - the unique id to search for + * @return {BABYLON.AbstractMesh|null} the mesh found or null if not found at all. + */ + getMeshByUniqueID(uniqueId: number): AbstractMesh; + /** + * Get a the last added mesh found of a given ID + * @param {string} id - the id to search for + * @return {BABYLON.AbstractMesh|null} the mesh found or null if not found at all. + */ + getLastMeshByID(id: string): AbstractMesh; + /** + * Get a the last added node (Mesh, Camera, Light) found of a given ID + * @param {string} id - the id to search for + * @return {BABYLON.Node|null} the node found or null if not found at all. + */ + getLastEntryByID(id: string): Node; + getNodeByID(id: string): Node; + getNodeByName(name: string): Node; + getMeshByName(name: string): AbstractMesh; + getSoundByName(name: string): Sound; + getLastSkeletonByID(id: string): Skeleton; + getSkeletonById(id: string): Skeleton; + getSkeletonByName(name: string): Skeleton; + isActiveMesh(mesh: Mesh): boolean; + private _evaluateSubMesh(subMesh, mesh); + private _evaluateActiveMeshes(); + private _activeMesh(mesh); + updateTransformMatrix(force?: boolean): void; + private _renderForCamera(camera); + private _processSubCameras(camera); + private _checkIntersections(); + render(): void; + private _updateAudioParameters(); + audioEnabled: boolean; + private _disableAudio(); + private _enableAudio(); + headphone: boolean; + private _switchAudioModeForHeadphones(); + private _switchAudioModeForNormalSpeakers(); + enableDepthRenderer(): DepthRenderer; + disableDepthRenderer(): void; + dispose(): void; + disposeSounds(): void; + getWorldExtends(): { + min: Vector3; + max: Vector3; + }; + createOrUpdateSelectionOctree(maxCapacity?: number, maxDepth?: number): Octree; + createPickingRay(x: number, y: number, world: Matrix, camera: Camera): Ray; + private _internalPick(rayFunction, predicate, fastCheck?); + pick(x: number, y: number, predicate?: (mesh: AbstractMesh) => boolean, fastCheck?: boolean, camera?: Camera): PickingInfo; + pickWithRay(ray: Ray, predicate: (mesh: Mesh) => boolean, fastCheck?: boolean): PickingInfo; + setPointerOverMesh(mesh: AbstractMesh): void; + getPointerOverMesh(): AbstractMesh; + getPhysicsEngine(): PhysicsEngine; + enablePhysics(gravity: Vector3, plugin?: IPhysicsEnginePlugin): boolean; + disablePhysicsEngine(): void; + isPhysicsEnabled(): boolean; + setGravity(gravity: Vector3): void; + createCompoundImpostor(parts: any, options: PhysicsBodyCreationOptions): any; + deleteCompoundImpostor(compound: any): void; + createDefaultCameraOrLight(): void; + private _getByTags(list, tagsQuery, forEach?); + getMeshesByTags(tagsQuery: string, forEach?: (mesh: AbstractMesh) => void): Mesh[]; + getCamerasByTags(tagsQuery: string, forEach?: (camera: Camera) => void): Camera[]; + getLightsByTags(tagsQuery: string, forEach?: (light: Light) => void): Light[]; + getMaterialByTags(tagsQuery: string, forEach?: (material: Material) => void): Material[]; + } +} + +declare module BABYLON { + class Action { + triggerOptions: any; + trigger: number; + _actionManager: ActionManager; + private _nextActiveAction; + private _child; + private _condition; + private _triggerParameter; + constructor(triggerOptions: any, condition?: Condition); + _prepare(): void; + getTriggerParameter(): any; + _executeCurrent(evt: ActionEvent): void; + execute(evt: ActionEvent): void; + then(action: Action): Action; + _getProperty(propertyPath: string): string; + _getEffectiveTarget(target: any, propertyPath: string): any; + } +} + +declare module BABYLON { + /** + * ActionEvent is the event beint sent when an action is triggered. + */ + class ActionEvent { + source: AbstractMesh; + pointerX: number; + pointerY: number; + meshUnderPointer: AbstractMesh; + sourceEvent: any; + additionalData: any; + /** + * @constructor + * @param source The mesh that triggered the action. + * @param pointerX the X mouse cursor position at the time of the event + * @param pointerY the Y mouse cursor position at the time of the event + * @param meshUnderPointer The mesh that is currently pointed at (can be null) + * @param sourceEvent the original (browser) event that triggered the ActionEvent + */ + constructor(source: AbstractMesh, pointerX: number, pointerY: number, meshUnderPointer: AbstractMesh, sourceEvent?: any, additionalData?: any); + /** + * Helper function to auto-create an ActionEvent from a source mesh. + * @param source the source mesh that triggered the event + * @param evt {Event} The original (browser) event + */ + static CreateNew(source: AbstractMesh, evt?: Event, additionalData?: any): ActionEvent; + /** + * Helper function to auto-create an ActionEvent from a scene. If triggered by a mesh use ActionEvent.CreateNew + * @param scene the scene where the event occurred + * @param evt {Event} The original (browser) event + */ + static CreateNewFromScene(scene: Scene, evt: Event): ActionEvent; + } + /** + * Action Manager manages all events to be triggered on a given mesh or the global scene. + * A single scene can have many Action Managers to handle predefined actions on specific meshes. + */ + class ActionManager { + private static _NothingTrigger; + private static _OnPickTrigger; + private static _OnLeftPickTrigger; + private static _OnRightPickTrigger; + private static _OnCenterPickTrigger; + private static _OnPointerOverTrigger; + private static _OnPointerOutTrigger; + private static _OnEveryFrameTrigger; + private static _OnIntersectionEnterTrigger; + private static _OnIntersectionExitTrigger; + private static _OnKeyDownTrigger; + private static _OnKeyUpTrigger; + private static _OnPickUpTrigger; + static NothingTrigger: number; + static OnPickTrigger: number; + static OnLeftPickTrigger: number; + static OnRightPickTrigger: number; + static OnCenterPickTrigger: number; + static OnPointerOverTrigger: number; + static OnPointerOutTrigger: number; + static OnEveryFrameTrigger: number; + static OnIntersectionEnterTrigger: number; + static OnIntersectionExitTrigger: number; + static OnKeyDownTrigger: number; + static OnKeyUpTrigger: number; + static OnPickUpTrigger: number; + actions: Action[]; + private _scene; + constructor(scene: Scene); + dispose(): void; + getScene(): Scene; + /** + * Does this action manager handles actions of any of the given triggers + * @param {number[]} triggers - the triggers to be tested + * @return {boolean} whether one (or more) of the triggers is handeled + */ + hasSpecificTriggers(triggers: number[]): boolean; + /** + * Does this action manager handles actions of a given trigger + * @param {number} trigger - the trigger to be tested + * @return {boolean} whether the trigger is handeled + */ + hasSpecificTrigger(trigger: number): boolean; + /** + * Does this action manager has pointer triggers + * @return {boolean} whether or not it has pointer triggers + */ + hasPointerTriggers: boolean; + /** + * Does this action manager has pick triggers + * @return {boolean} whether or not it has pick triggers + */ + hasPickTriggers: boolean; + /** + * Registers an action to this action manager + * @param {BABYLON.Action} action - the action to be registered + * @return {BABYLON.Action} the action amended (prepared) after registration + */ + registerAction(action: Action): Action; + /** + * Process a specific trigger + * @param {number} trigger - the trigger to process + * @param evt {BABYLON.ActionEvent} the event details to be processed + */ + processTrigger(trigger: number, evt: ActionEvent): void; + _getEffectiveTarget(target: any, propertyPath: string): any; + _getProperty(propertyPath: string): string; + } +} + +declare module BABYLON { + class Condition { + _actionManager: ActionManager; + _evaluationId: number; + _currentResult: boolean; + constructor(actionManager: ActionManager); + isValid(): boolean; + _getProperty(propertyPath: string): string; + _getEffectiveTarget(target: any, propertyPath: string): any; + } + class ValueCondition extends Condition { + propertyPath: string; + value: any; + operator: number; + private static _IsEqual; + private static _IsDifferent; + private static _IsGreater; + private static _IsLesser; + static IsEqual: number; + static IsDifferent: number; + static IsGreater: number; + static IsLesser: number; + _actionManager: ActionManager; + private _target; + private _property; + constructor(actionManager: ActionManager, target: any, propertyPath: string, value: any, operator?: number); + isValid(): boolean; + } + class PredicateCondition extends Condition { + predicate: () => boolean; + _actionManager: ActionManager; + constructor(actionManager: ActionManager, predicate: () => boolean); + isValid(): boolean; + } + class StateCondition extends Condition { + value: string; + _actionManager: ActionManager; + private _target; + constructor(actionManager: ActionManager, target: any, value: string); + isValid(): boolean; + } +} + +declare module BABYLON { + class SwitchBooleanAction extends Action { + propertyPath: string; + private _target; + private _property; + constructor(triggerOptions: any, target: any, propertyPath: string, condition?: Condition); + _prepare(): void; + execute(): void; + } + class SetStateAction extends Action { + value: string; + private _target; + constructor(triggerOptions: any, target: any, value: string, condition?: Condition); + execute(): void; + } + class SetValueAction extends Action { + propertyPath: string; + value: any; + private _target; + private _property; + constructor(triggerOptions: any, target: any, propertyPath: string, value: any, condition?: Condition); + _prepare(): void; + execute(): void; + } + class IncrementValueAction extends Action { + propertyPath: string; + value: any; + private _target; + private _property; + constructor(triggerOptions: any, target: any, propertyPath: string, value: any, condition?: Condition); + _prepare(): void; + execute(): void; + } + class PlayAnimationAction extends Action { + from: number; + to: number; + loop: boolean; + private _target; + constructor(triggerOptions: any, target: any, from: number, to: number, loop?: boolean, condition?: Condition); + _prepare(): void; + execute(): void; + } + class StopAnimationAction extends Action { + private _target; + constructor(triggerOptions: any, target: any, condition?: Condition); + _prepare(): void; + execute(): void; + } + class DoNothingAction extends Action { + constructor(triggerOptions?: any, condition?: Condition); + execute(): void; + } + class CombineAction extends Action { + children: Action[]; + constructor(triggerOptions: any, children: Action[], condition?: Condition); + _prepare(): void; + execute(evt: ActionEvent): void; + } + class ExecuteCodeAction extends Action { + func: (evt: ActionEvent) => void; + constructor(triggerOptions: any, func: (evt: ActionEvent) => void, condition?: Condition); + execute(evt: ActionEvent): void; + } + class SetParentAction extends Action { + private _parent; + private _target; + constructor(triggerOptions: any, target: any, parent: any, condition?: Condition); + _prepare(): void; + execute(): void; + } + class PlaySoundAction extends Action { + private _sound; + constructor(triggerOptions: any, sound: Sound, condition?: Condition); + _prepare(): void; + execute(): void; + } + class StopSoundAction extends Action { + private _sound; + constructor(triggerOptions: any, sound: Sound, condition?: Condition); + _prepare(): void; + execute(): void; + } +} + +declare module BABYLON { + class InterpolateValueAction extends Action { + propertyPath: string; + value: any; + duration: number; + stopOtherAnimations: boolean; + private _target; + private _property; + constructor(triggerOptions: any, target: any, propertyPath: string, value: any, duration?: number, condition?: Condition, stopOtherAnimations?: boolean); + _prepare(): void; + execute(): void; + } +} + +declare module BABYLON { + class Animatable { + target: any; + fromFrame: number; + toFrame: number; + loopAnimation: boolean; + speedRatio: number; + onAnimationEnd: any; + private _localDelayOffset; + private _pausedDelay; + private _animations; + private _paused; + private _scene; + animationStarted: boolean; + constructor(scene: Scene, target: any, fromFrame?: number, toFrame?: number, loopAnimation?: boolean, speedRatio?: number, onAnimationEnd?: any, animations?: any); + appendAnimations(target: any, animations: Animation[]): void; + getAnimationByTargetProperty(property: string): Animation; + reset(): void; + pause(): void; + restart(): void; + stop(): void; + _animate(delay: number): boolean; + } +} + +declare module BABYLON { + class Animation { + name: string; + targetProperty: string; + framePerSecond: number; + dataType: number; + loopMode: number; + private _keys; + private _offsetsCache; + private _highLimitsCache; + private _stopped; + _target: any; + private _easingFunction; + targetPropertyPath: string[]; + currentFrame: number; + allowMatricesInterpolation: boolean; + static CreateAndStartAnimation(name: string, mesh: AbstractMesh, targetProperty: string, framePerSecond: number, totalFrame: number, from: any, to: any, loopMode?: number, easingFunction?: EasingFunction): Animatable; + constructor(name: string, targetProperty: string, framePerSecond: number, dataType: number, loopMode?: number); + reset(): void; + isStopped(): boolean; + getKeys(): any[]; + getEasingFunction(): IEasingFunction; + setEasingFunction(easingFunction: EasingFunction): void; + floatInterpolateFunction(startValue: number, endValue: number, gradient: number): number; + quaternionInterpolateFunction(startValue: Quaternion, endValue: Quaternion, gradient: number): Quaternion; + vector3InterpolateFunction(startValue: Vector3, endValue: Vector3, gradient: number): Vector3; + vector2InterpolateFunction(startValue: Vector2, endValue: Vector2, gradient: number): Vector2; + color3InterpolateFunction(startValue: Color3, endValue: Color3, gradient: number): Color3; + matrixInterpolateFunction(startValue: Matrix, endValue: Matrix, gradient: number): Matrix; + clone(): Animation; + setKeys(values: Array): void; + private _getKeyValue(value); + private _interpolate(currentFrame, repeatCount, loopMode, offsetValue?, highLimitValue?); + animate(delay: number, from: number, to: number, loop: boolean, speedRatio: number): boolean; + private static _ANIMATIONTYPE_FLOAT; + private static _ANIMATIONTYPE_VECTOR3; + private static _ANIMATIONTYPE_QUATERNION; + private static _ANIMATIONTYPE_MATRIX; + private static _ANIMATIONTYPE_COLOR3; + private static _ANIMATIONTYPE_VECTOR2; + private static _ANIMATIONLOOPMODE_RELATIVE; + private static _ANIMATIONLOOPMODE_CYCLE; + private static _ANIMATIONLOOPMODE_CONSTANT; + static ANIMATIONTYPE_FLOAT: number; + static ANIMATIONTYPE_VECTOR3: number; + static ANIMATIONTYPE_VECTOR2: number; + static ANIMATIONTYPE_QUATERNION: number; + static ANIMATIONTYPE_MATRIX: number; + static ANIMATIONTYPE_COLOR3: number; + static ANIMATIONLOOPMODE_RELATIVE: number; + static ANIMATIONLOOPMODE_CYCLE: number; + static ANIMATIONLOOPMODE_CONSTANT: number; + } +} + +declare module BABYLON { + interface IEasingFunction { + ease(gradient: number): number; + } + class EasingFunction implements IEasingFunction { + private static _EASINGMODE_EASEIN; + private static _EASINGMODE_EASEOUT; + private static _EASINGMODE_EASEINOUT; + static EASINGMODE_EASEIN: number; + static EASINGMODE_EASEOUT: number; + static EASINGMODE_EASEINOUT: number; + private _easingMode; + setEasingMode(easingMode: number): void; + getEasingMode(): number; + easeInCore(gradient: number): number; + ease(gradient: number): number; + } + class CircleEase extends EasingFunction implements IEasingFunction { + easeInCore(gradient: number): number; + } + class BackEase extends EasingFunction implements IEasingFunction { + amplitude: number; + constructor(amplitude?: number); + easeInCore(gradient: number): number; + } + class BounceEase extends EasingFunction implements IEasingFunction { + bounces: number; + bounciness: number; + constructor(bounces?: number, bounciness?: number); + easeInCore(gradient: number): number; + } + class CubicEase extends EasingFunction implements IEasingFunction { + easeInCore(gradient: number): number; + } + class ElasticEase extends EasingFunction implements IEasingFunction { + oscillations: number; + springiness: number; + constructor(oscillations?: number, springiness?: number); + easeInCore(gradient: number): number; + } + class ExponentialEase extends EasingFunction implements IEasingFunction { + exponent: number; + constructor(exponent?: number); + easeInCore(gradient: number): number; + } + class PowerEase extends EasingFunction implements IEasingFunction { + power: number; + constructor(power?: number); + easeInCore(gradient: number): number; + } + class QuadraticEase extends EasingFunction implements IEasingFunction { + easeInCore(gradient: number): number; + } + class QuarticEase extends EasingFunction implements IEasingFunction { + easeInCore(gradient: number): number; + } + class QuinticEase extends EasingFunction implements IEasingFunction { + easeInCore(gradient: number): number; + } + class SineEase extends EasingFunction implements IEasingFunction { + easeInCore(gradient: number): number; + } + class BezierCurveEase extends EasingFunction implements IEasingFunction { + x1: number; + y1: number; + x2: number; + y2: number; + constructor(x1?: number, y1?: number, x2?: number, y2?: number); + easeInCore(gradient: number): number; + } +} + +declare module BABYLON { + class Analyser { + SMOOTHING: number; + FFT_SIZE: number; + BARGRAPHAMPLITUDE: number; + DEBUGCANVASPOS: { + x: number; + y: number; + }; + DEBUGCANVASSIZE: { + width: number; + height: number; + }; + private _byteFreqs; + private _byteTime; + private _floatFreqs; + private _webAudioAnalyser; + private _debugCanvas; + private _debugCanvasContext; + private _scene; + private _registerFunc; + private _audioEngine; + constructor(scene: Scene); + getFrequencyBinCount(): number; + getByteFrequencyData(): Uint8Array; + getByteTimeDomainData(): Uint8Array; + getFloatFrequencyData(): Uint8Array; + drawDebugCanvas(): void; + stopDebugCanvas(): void; + connectAudioNodes(inputAudioNode: AudioNode, outputAudioNode: AudioNode): void; + dispose(): void; + } +} + +declare module BABYLON { + class AudioEngine { + private _audioContext; + private _audioContextInitialized; + canUseWebAudio: boolean; + masterGain: GainNode; + private _connectedAnalyser; + WarnedWebAudioUnsupported: boolean; + audioContext: AudioContext; + constructor(); + private _initializeAudioContext(); + dispose(): void; + getGlobalVolume(): number; + setGlobalVolume(newVolume: number): void; + connectToAnalyser(analyser: Analyser): void; + } +} + +declare module BABYLON { + class Sound { + name: string; + autoplay: boolean; + loop: boolean; + useCustomAttenuation: boolean; + soundTrackId: number; + spatialSound: boolean; + refDistance: number; + rolloffFactor: number; + maxDistance: number; + distanceModel: string; + private _panningModel; + onended: () => any; + private _playbackRate; + private _startTime; + private _startOffset; + private _position; + private _localDirection; + private _volume; + private _isLoaded; + private _isReadyToPlay; + isPlaying: boolean; + isPaused: boolean; + private _isDirectional; + private _readyToPlayCallback; + private _audioBuffer; + private _soundSource; + private _soundPanner; + private _soundGain; + private _inputAudioNode; + private _ouputAudioNode; + private _coneInnerAngle; + private _coneOuterAngle; + private _coneOuterGain; + private _scene; + private _connectedMesh; + private _customAttenuationFunction; + private _registerFunc; + private _isOutputConnected; + /** + * Create a sound and attach it to a scene + * @param name Name of your sound + * @param urlOrArrayBuffer Url to the sound to load async or ArrayBuffer + * @param readyToPlayCallback Provide a callback function if you'd like to load your code once the sound is ready to be played + * @param options Objects to provide with the current available options: autoplay, loop, volume, spatialSound, maxDistance, rolloffFactor, refDistance, distanceModel, panningModel + */ + constructor(name: string, urlOrArrayBuffer: any, scene: Scene, readyToPlayCallback?: () => void, options?: any); + dispose(): void; + private _soundLoaded(audioData); + setAudioBuffer(audioBuffer: AudioBuffer): void; + updateOptions(options: any): void; + private _createSpatialParameters(); + private _updateSpatialParameters(); + switchPanningModelToHRTF(): void; + switchPanningModelToEqualPower(): void; + private _switchPanningModel(); + connectToSoundTrackAudioNode(soundTrackAudioNode: AudioNode): void; + /** + * Transform this sound into a directional source + * @param coneInnerAngle Size of the inner cone in degree + * @param coneOuterAngle Size of the outer cone in degree + * @param coneOuterGain Volume of the sound outside the outer cone (between 0.0 and 1.0) + */ + setDirectionalCone(coneInnerAngle: number, coneOuterAngle: number, coneOuterGain: number): void; + setPosition(newPosition: Vector3): void; + setLocalDirectionToMesh(newLocalDirection: Vector3): void; + private _updateDirection(); + updateDistanceFromListener(): void; + setAttenuationFunction(callback: (currentVolume: number, currentDistance: number, maxDistance: number, refDistance: number, rolloffFactor: number) => number): void; + /** + * Play the sound + * @param time (optional) Start the sound after X seconds. Start immediately (0) by default. + */ + play(time?: number): void; + private _onended(); + /** + * Stop the sound + * @param time (optional) Stop the sound after X seconds. Stop immediately (0) by default. + */ + stop(time?: number): void; + pause(): void; + setVolume(newVolume: number, time?: number): void; + setPlaybackRate(newPlaybackRate: number): void; + getVolume(): number; + attachToMesh(meshToConnectTo: AbstractMesh): void; + private _onRegisterAfterWorldMatrixUpdate(connectedMesh); + } +} + +declare module BABYLON { + class SoundTrack { + private _audioEngine; + private _outputAudioNode; + private _inputAudioNode; + private _trackConvolver; + private _scene; + id: number; + soundCollection: Array; + private _isMainTrack; + private _connectedAnalyser; + constructor(scene: Scene, options?: any); + dispose(): void; + AddSound(sound: Sound): void; + RemoveSound(sound: Sound): void; + setVolume(newVolume: number): void; + switchPanningModelToHRTF(): void; + switchPanningModelToEqualPower(): void; + connectToAnalyser(analyser: Analyser): void; + } +} + +declare module BABYLON { + class Bone extends Node { + name: string; + children: Bone[]; + animations: Animation[]; + private _skeleton; + private _matrix; + private _baseMatrix; + private _worldTransform; + private _absoluteTransform; + private _invertedAbsoluteTransform; + private _parent; + constructor(name: string, skeleton: Skeleton, parentBone: Bone, matrix: Matrix); + getParent(): Bone; + getLocalMatrix(): Matrix; + getBaseMatrix(): Matrix; + getWorldMatrix(): Matrix; + getInvertedAbsoluteTransform(): Matrix; + getAbsoluteMatrix(): Matrix; + updateMatrix(matrix: Matrix): void; + private _updateDifferenceMatrix(); + markAsDirty(): void; + } +} + +declare module BABYLON { + class Skeleton { + name: string; + id: string; + bones: Bone[]; + private _scene; + private _isDirty; + private _transformMatrices; + private _animatables; + private _identity; + constructor(name: string, id: string, scene: Scene); + getTransformMatrices(): Float32Array; + getScene(): Scene; + _markAsDirty(): void; + prepare(): void; + getAnimatables(): IAnimatable[]; + clone(name: string, id: string): Skeleton; + } +} + +declare module BABYLON { + class ArcRotateCamera extends TargetCamera { + alpha: number; + beta: number; + radius: number; + target: any; + inertialAlphaOffset: number; + inertialBetaOffset: number; + inertialRadiusOffset: number; + lowerAlphaLimit: any; + upperAlphaLimit: any; + lowerBetaLimit: number; + upperBetaLimit: number; + lowerRadiusLimit: any; + upperRadiusLimit: any; + angularSensibilityX: number; + angularSensibilityY: number; + wheelPrecision: number; + pinchPrecision: number; + panningSensibility: number; + inertialPanningX: number; + inertialPanningY: number; + keysUp: number[]; + keysDown: number[]; + keysLeft: number[]; + keysRight: number[]; + zoomOnFactor: number; + targetScreenOffset: Vector2; + pinchInwards: boolean; + allowUpsideDown: boolean; + private _keys; + _viewMatrix: Matrix; + private _attachedElement; + private _onContextMenu; + private _onPointerDown; + private _onPointerUp; + private _onPointerMove; + private _wheel; + private _onMouseMove; + private _onKeyDown; + private _onKeyUp; + private _onLostFocus; + _reset: () => void; + private _onGestureStart; + private _onGesture; + private _MSGestureHandler; + private _localDirection; + private _transformedDirection; + private _isRightClick; + private _isCtrlPushed; + onCollide: (collidedMesh: AbstractMesh) => void; + checkCollisions: boolean; + collisionRadius: Vector3; + private _collider; + private _previousPosition; + private _collisionVelocity; + private _newPosition; + private _previousAlpha; + private _previousBeta; + private _previousRadius; + private _collisionTriggered; + angularSensibility: number; + constructor(name: string, alpha: number, beta: number, radius: number, target: any, scene: Scene); + _getTargetPosition(): Vector3; + _initCache(): void; + _updateCache(ignoreParentClass?: boolean): void; + _isSynchronizedViewMatrix(): boolean; + attachControl(element: HTMLElement, noPreventDefault?: boolean, useCtrlForPanning?: boolean): void; + detachControl(element: HTMLElement): void; + _checkInputs(): void; + private _checkLimits(); + setPosition(position: Vector3): void; + setTarget(target: Vector3): void; + _getViewMatrix(): Matrix; + private _onCollisionPositionChange; + zoomOn(meshes?: AbstractMesh[], doNotUpdateMaxZ?: boolean): void; + focusOn(meshesOrMinMaxVectorAndDistance: any, doNotUpdateMaxZ?: boolean): void; + /** + * @override + * Override Camera.createRigCamera + */ + createRigCamera(name: string, cameraIndex: number): Camera; + /** + * @override + * Override Camera._updateRigCameras + */ + _updateRigCameras(): void; + } +} + +declare module BABYLON { + class VRCameraMetrics { + hResolution: number; + vResolution: number; + hScreenSize: number; + vScreenSize: number; + vScreenCenter: number; + eyeToScreenDistance: number; + lensSeparationDistance: number; + interpupillaryDistance: number; + distortionK: number[]; + chromaAbCorrection: number[]; + postProcessScaleFactor: number; + lensCenterOffset: number; + compensateDistorsion: boolean; + aspectRatio: number; + aspectRatioFov: number; + leftHMatrix: Matrix; + rightHMatrix: Matrix; + leftPreViewMatrix: Matrix; + rightPreViewMatrix: Matrix; + static GetDefault(): VRCameraMetrics; + } + class Camera extends Node { + position: Vector3; + private static _PERSPECTIVE_CAMERA; + private static _ORTHOGRAPHIC_CAMERA; + private static _FOVMODE_VERTICAL_FIXED; + private static _FOVMODE_HORIZONTAL_FIXED; + private static _RIG_MODE_NONE; + private static _RIG_MODE_STEREOSCOPIC_ANAGLYPH; + private static _RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL; + private static _RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED; + private static _RIG_MODE_STEREOSCOPIC_OVERUNDER; + private static _RIG_MODE_VR; + static PERSPECTIVE_CAMERA: number; + static ORTHOGRAPHIC_CAMERA: number; + static FOVMODE_VERTICAL_FIXED: number; + static FOVMODE_HORIZONTAL_FIXED: number; + static RIG_MODE_NONE: number; + static RIG_MODE_STEREOSCOPIC_ANAGLYPH: number; + static RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL: number; + static RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED: number; + static RIG_MODE_STEREOSCOPIC_OVERUNDER: number; + static RIG_MODE_VR: number; + upVector: Vector3; + orthoLeft: any; + orthoRight: any; + orthoBottom: any; + orthoTop: any; + fov: number; + minZ: number; + maxZ: number; + inertia: number; + mode: number; + isIntermediate: boolean; + viewport: Viewport; + layerMask: number; + fovMode: number; + cameraRigMode: number; + _cameraRigParams: any; + _rigCameras: Camera[]; + private _computedViewMatrix; + _projectionMatrix: Matrix; + private _worldMatrix; + _postProcesses: PostProcess[]; + _postProcessesTakenIndices: any[]; + _activeMeshes: SmartArray; + private _globalPosition; + constructor(name: string, position: Vector3, scene: Scene); + globalPosition: Vector3; + getActiveMeshes(): SmartArray; + isActiveMesh(mesh: Mesh): boolean; + _initCache(): void; + _updateCache(ignoreParentClass?: boolean): void; + _updateFromScene(): void; + _isSynchronized(): boolean; + _isSynchronizedViewMatrix(): boolean; + _isSynchronizedProjectionMatrix(): boolean; + attachControl(element: HTMLElement): void; + detachControl(element: HTMLElement): void; + _update(): void; + _checkInputs(): void; + attachPostProcess(postProcess: PostProcess, insertAt?: number): number; + detachPostProcess(postProcess: PostProcess, atIndices?: any): number[]; + getWorldMatrix(): Matrix; + _getViewMatrix(): Matrix; + getViewMatrix(force?: boolean): Matrix; + _computeViewMatrix(force?: boolean): Matrix; + getProjectionMatrix(force?: boolean): Matrix; + dispose(): void; + setCameraRigMode(mode: number, rigParams: any): void; + private _getVRProjectionMatrix(); + setCameraRigParameter(name: string, value: any): void; + /** + * May needs to be overridden by children so sub has required properties to be copied + */ + createRigCamera(name: string, cameraIndex: number): Camera; + /** + * May needs to be overridden by children + */ + _updateRigCameras(): void; + } +} + +declare module BABYLON { + class DeviceOrientationCamera extends FreeCamera { + private _offsetX; + private _offsetY; + private _orientationGamma; + private _orientationBeta; + private _initialOrientationGamma; + private _initialOrientationBeta; + private _attachedCanvas; + private _orientationChanged; + angularSensibility: number; + moveSensibility: number; + constructor(name: string, position: Vector3, scene: Scene); + attachControl(canvas: HTMLCanvasElement, noPreventDefault: boolean): void; + detachControl(canvas: HTMLCanvasElement): void; + _checkInputs(): void; + } +} + +declare module BABYLON { + class FollowCamera extends TargetCamera { + radius: number; + rotationOffset: number; + heightOffset: number; + cameraAcceleration: number; + maxCameraSpeed: number; + target: AbstractMesh; + constructor(name: string, position: Vector3, scene: Scene); + private getRadians(degrees); + private follow(cameraTarget); + _checkInputs(): void; + } + class ArcFollowCamera extends TargetCamera { + alpha: number; + beta: number; + radius: number; + target: AbstractMesh; + private _cartesianCoordinates; + constructor(name: string, alpha: number, beta: number, radius: number, target: AbstractMesh, scene: Scene); + private follow(); + _checkInputs(): void; + } +} + +declare module BABYLON { + class FreeCamera extends TargetCamera { + ellipsoid: Vector3; + keysUp: number[]; + keysDown: number[]; + keysLeft: number[]; + keysRight: number[]; + checkCollisions: boolean; + applyGravity: boolean; + angularSensibility: number; + onCollide: (collidedMesh: AbstractMesh) => void; + private _keys; + private _collider; + private _needMoveForGravity; + private _oldPosition; + private _diffPosition; + private _newPosition; + private _attachedElement; + private _localDirection; + private _transformedDirection; + private _onMouseDown; + private _onMouseUp; + private _onMouseOut; + private _onMouseMove; + private _onKeyDown; + private _onKeyUp; + _onLostFocus: (e: FocusEvent) => any; + _waitingLockedTargetId: string; + constructor(name: string, position: Vector3, scene: Scene); + attachControl(element: HTMLElement, noPreventDefault?: boolean): void; + detachControl(element: HTMLElement): void; + _collideWithWorld(velocity: Vector3): void; + private _onCollisionPositionChange; + _checkInputs(): void; + _decideIfNeedsToMove(): boolean; + _updatePosition(): void; + } +} + +declare module BABYLON { + class GamepadCamera extends FreeCamera { + private _gamepad; + private _gamepads; + angularSensibility: number; + moveSensibility: number; + constructor(name: string, position: Vector3, scene: Scene); + private _onNewGameConnected(gamepad); + _checkInputs(): void; + dispose(): void; + } +} + +declare module BABYLON { + class AnaglyphFreeCamera extends FreeCamera { + constructor(name: string, position: Vector3, interaxialDistance: number, scene: Scene); + } + class AnaglyphArcRotateCamera extends ArcRotateCamera { + constructor(name: string, alpha: number, beta: number, radius: number, target: any, interaxialDistance: number, scene: Scene); + } + class AnaglyphGamepadCamera extends GamepadCamera { + constructor(name: string, position: Vector3, interaxialDistance: number, scene: Scene); + } + class StereoscopicFreeCamera extends FreeCamera { + constructor(name: string, position: Vector3, interaxialDistance: number, isSideBySide: boolean, scene: Scene); + } + class StereoscopicArcRotateCamera extends ArcRotateCamera { + constructor(name: string, alpha: number, beta: number, radius: number, target: any, interaxialDistance: number, isSideBySide: boolean, scene: Scene); + } + class StereoscopicGamepadCamera extends GamepadCamera { + constructor(name: string, position: Vector3, interaxialDistance: number, isSideBySide: boolean, scene: Scene); + } +} + +declare module BABYLON { + class TargetCamera extends Camera { + cameraDirection: Vector3; + cameraRotation: Vector2; + rotation: Vector3; + speed: number; + noRotationConstraint: boolean; + lockedTarget: any; + _currentTarget: Vector3; + _viewMatrix: Matrix; + _camMatrix: Matrix; + _cameraTransformMatrix: Matrix; + _cameraRotationMatrix: Matrix; + private _rigCamTransformMatrix; + _referencePoint: Vector3; + _transformedReferencePoint: Vector3; + _lookAtTemp: Matrix; + _tempMatrix: Matrix; + _reset: () => void; + _waitingLockedTargetId: string; + constructor(name: string, position: Vector3, scene: Scene); + getFrontPosition(distance: number): Vector3; + _getLockedTargetPosition(): Vector3; + _initCache(): void; + _updateCache(ignoreParentClass?: boolean): void; + _isSynchronizedViewMatrix(): boolean; + _computeLocalCameraSpeed(): number; + setTarget(target: Vector3): void; + getTarget(): Vector3; + _decideIfNeedsToMove(): boolean; + _updatePosition(): void; + _checkInputs(): void; + _getViewMatrix(): Matrix; + _getVRViewMatrix(): Matrix; + /** + * @override + * Override Camera.createRigCamera + */ + createRigCamera(name: string, cameraIndex: number): Camera; + /** + * @override + * Override Camera._updateRigCameras + */ + _updateRigCameras(): void; + private _getRigCamPosition(halfSpace, result); + } +} + +declare module BABYLON { + class TouchCamera extends FreeCamera { + private _offsetX; + private _offsetY; + private _pointerCount; + private _pointerPressed; + private _attachedCanvas; + private _onPointerDown; + private _onPointerUp; + private _onPointerMove; + angularSensibility: number; + moveSensibility: number; + constructor(name: string, position: Vector3, scene: Scene); + attachControl(canvas: HTMLCanvasElement, noPreventDefault: boolean): void; + detachControl(canvas: HTMLCanvasElement): void; + _checkInputs(): void; + } +} + +declare module BABYLON { + class VirtualJoysticksCamera extends FreeCamera { + private _leftjoystick; + private _rightjoystick; + constructor(name: string, position: Vector3, scene: Scene); + getLeftJoystick(): VirtualJoystick; + getRightJoystick(): VirtualJoystick; + _checkInputs(): void; + dispose(): void; + } +} + +declare module BABYLON { + class Collider { + radius: Vector3; + retry: number; + velocity: Vector3; + basePoint: Vector3; + epsilon: number; + collisionFound: boolean; + velocityWorldLength: number; + basePointWorld: Vector3; + velocityWorld: Vector3; + normalizedVelocity: Vector3; + initialVelocity: Vector3; + initialPosition: Vector3; + nearestDistance: number; + intersectionPoint: Vector3; + collidedMesh: AbstractMesh; + private _collisionPoint; + private _planeIntersectionPoint; + private _tempVector; + private _tempVector2; + private _tempVector3; + private _tempVector4; + private _edge; + private _baseToVertex; + private _destinationPoint; + private _slidePlaneNormal; + private _displacementVector; + _initialize(source: Vector3, dir: Vector3, e: number): void; + _checkPointInTriangle(point: Vector3, pa: Vector3, pb: Vector3, pc: Vector3, n: Vector3): boolean; + _canDoCollision(sphereCenter: Vector3, sphereRadius: number, vecMin: Vector3, vecMax: Vector3): boolean; + _testTriangle(faceIndex: number, trianglePlaneArray: Array, p1: Vector3, p2: Vector3, p3: Vector3, hasMaterial: boolean): void; + _collide(trianglePlaneArray: Array, pts: Vector3[], indices: number[], indexStart: number, indexEnd: number, decal: number, hasMaterial: boolean): void; + _getResponse(pos: Vector3, vel: Vector3): void; + } +} + +declare module BABYLON { + var CollisionWorker: string; + interface ICollisionCoordinator { + getNewPosition(position: Vector3, velocity: Vector3, collider: Collider, maximumRetry: number, excludedMesh: AbstractMesh, onNewPosition: (collisionIndex: number, newPosition: Vector3, collidedMesh?: AbstractMesh) => void, collisionIndex: number): void; + init(scene: Scene): void; + destroy(): void; + onMeshAdded(mesh: AbstractMesh): any; + onMeshUpdated(mesh: AbstractMesh): any; + onMeshRemoved(mesh: AbstractMesh): any; + onGeometryAdded(geometry: Geometry): any; + onGeometryUpdated(geometry: Geometry): any; + onGeometryDeleted(geometry: Geometry): any; + } + interface SerializedMesh { + id: string; + name: string; + uniqueId: number; + geometryId: string; + sphereCenter: Array; + sphereRadius: number; + boxMinimum: Array; + boxMaximum: Array; + worldMatrixFromCache: any; + subMeshes: Array; + checkCollisions: boolean; + } + interface SerializedSubMesh { + position: number; + verticesStart: number; + verticesCount: number; + indexStart: number; + indexCount: number; + hasMaterial: boolean; + sphereCenter: Array; + sphereRadius: number; + boxMinimum: Array; + boxMaximum: Array; + } + interface SerializedGeometry { + id: string; + positions: Float32Array; + indices: Int32Array; + normals: Float32Array; + } + interface BabylonMessage { + taskType: WorkerTaskType; + payload: InitPayload | CollidePayload | UpdatePayload; + } + interface SerializedColliderToWorker { + position: Array; + velocity: Array; + radius: Array; + } + enum WorkerTaskType { + INIT = 0, + UPDATE = 1, + COLLIDE = 2, + } + interface WorkerReply { + error: WorkerReplyType; + taskType: WorkerTaskType; + payload?: any; + } + interface CollisionReplyPayload { + newPosition: Array; + collisionId: number; + collidedMeshUniqueId: number; + } + interface InitPayload { + } + interface CollidePayload { + collisionId: number; + collider: SerializedColliderToWorker; + maximumRetry: number; + excludedMeshUniqueId?: number; + } + interface UpdatePayload { + updatedMeshes: { + [n: number]: SerializedMesh; + }; + updatedGeometries: { + [s: string]: SerializedGeometry; + }; + removedMeshes: Array; + removedGeometries: Array; + } + enum WorkerReplyType { + SUCCESS = 0, + UNKNOWN_ERROR = 1, + } + class CollisionCoordinatorWorker implements ICollisionCoordinator { + private _scene; + private _scaledPosition; + private _scaledVelocity; + private _collisionsCallbackArray; + private _init; + private _runningUpdated; + private _runningCollisionTask; + private _worker; + private _addUpdateMeshesList; + private _addUpdateGeometriesList; + private _toRemoveMeshesArray; + private _toRemoveGeometryArray; + constructor(); + static SerializeMesh: (mesh: AbstractMesh) => SerializedMesh; + static SerializeGeometry: (geometry: Geometry) => SerializedGeometry; + getNewPosition(position: Vector3, velocity: Vector3, collider: Collider, maximumRetry: number, excludedMesh: AbstractMesh, onNewPosition: (collisionIndex: number, newPosition: Vector3, collidedMesh?: AbstractMesh) => void, collisionIndex: number): void; + init(scene: Scene): void; + destroy(): void; + onMeshAdded(mesh: AbstractMesh): void; + onMeshUpdated: (mesh: AbstractMesh) => void; + onMeshRemoved(mesh: AbstractMesh): void; + onGeometryAdded(geometry: Geometry): void; + onGeometryUpdated: (geometry: Geometry) => void; + onGeometryDeleted(geometry: Geometry): void; + private _afterRender; + private _onMessageFromWorker; + } + class CollisionCoordinatorLegacy implements ICollisionCoordinator { + private _scene; + private _scaledPosition; + private _scaledVelocity; + private _finalPosition; + getNewPosition(position: Vector3, velocity: Vector3, collider: Collider, maximumRetry: number, excludedMesh: AbstractMesh, onNewPosition: (collisionIndex: number, newPosition: Vector3, collidedMesh?: AbstractMesh) => void, collisionIndex: number): void; + init(scene: Scene): void; + destroy(): void; + onMeshAdded(mesh: AbstractMesh): void; + onMeshUpdated(mesh: AbstractMesh): void; + onMeshRemoved(mesh: AbstractMesh): void; + onGeometryAdded(geometry: Geometry): void; + onGeometryUpdated(geometry: Geometry): void; + onGeometryDeleted(geometry: Geometry): void; + private _collideWithWorld(position, velocity, collider, maximumRetry, finalPosition, excludedMesh?); + } +} + +declare module BABYLON { + var WorkerIncluded: boolean; + class CollisionCache { + private _meshes; + private _geometries; + getMeshes(): { + [n: number]: SerializedMesh; + }; + getGeometries(): { + [s: number]: SerializedGeometry; + }; + getMesh(id: any): SerializedMesh; + addMesh(mesh: SerializedMesh): void; + getGeometry(id: string): SerializedGeometry; + addGeometry(geometry: SerializedGeometry): void; + } + class CollideWorker { + collider: Collider; + private _collisionCache; + private finalPosition; + private collisionsScalingMatrix; + private collisionTranformationMatrix; + constructor(collider: Collider, _collisionCache: CollisionCache, finalPosition: Vector3); + collideWithWorld(position: Vector3, velocity: Vector3, maximumRetry: number, excludedMeshUniqueId?: number): void; + private checkCollision(mesh); + private processCollisionsForSubMeshes(transformMatrix, mesh); + private collideForSubMesh(subMesh, transformMatrix, meshGeometry); + private checkSubmeshCollision(subMesh); + } + interface ICollisionDetector { + onInit(payload: InitPayload): void; + onUpdate(payload: UpdatePayload): void; + onCollision(payload: CollidePayload): void; + } + class CollisionDetectorTransferable implements ICollisionDetector { + private _collisionCache; + onInit(payload: InitPayload): void; + onUpdate(payload: UpdatePayload): void; + onCollision(payload: CollidePayload): void; + } +} + +declare module BABYLON { + class IntersectionInfo { + bu: number; + bv: number; + distance: number; + faceId: number; + subMeshId: number; + constructor(bu: number, bv: number, distance: number); + } + class PickingInfo { + hit: boolean; + distance: number; + pickedPoint: Vector3; + pickedMesh: AbstractMesh; + bu: number; + bv: number; + faceId: number; + subMeshId: number; + getNormal(useWorldCoordinates?: boolean, useVerticesNormals?: boolean): Vector3; + getTextureCoordinates(): Vector2; + } +} + +declare module BABYLON { + class BoundingBox { + minimum: Vector3; + maximum: Vector3; + vectors: Vector3[]; + center: Vector3; + extendSize: Vector3; + directions: Vector3[]; + vectorsWorld: Vector3[]; + minimumWorld: Vector3; + maximumWorld: Vector3; + private _worldMatrix; + constructor(minimum: Vector3, maximum: Vector3); + getWorldMatrix(): Matrix; + _update(world: Matrix): void; + isInFrustum(frustumPlanes: Plane[]): boolean; + isCompletelyInFrustum(frustumPlanes: Plane[]): boolean; + intersectsPoint(point: Vector3): boolean; + intersectsSphere(sphere: BoundingSphere): boolean; + intersectsMinMax(min: Vector3, max: Vector3): boolean; + static Intersects(box0: BoundingBox, box1: BoundingBox): boolean; + static IntersectsSphere(minPoint: Vector3, maxPoint: Vector3, sphereCenter: Vector3, sphereRadius: number): boolean; + static IsCompletelyInFrustum(boundingVectors: Vector3[], frustumPlanes: Plane[]): boolean; + static IsInFrustum(boundingVectors: Vector3[], frustumPlanes: Plane[]): boolean; + } +} + +declare module BABYLON { + class BoundingInfo { + minimum: Vector3; + maximum: Vector3; + boundingBox: BoundingBox; + boundingSphere: BoundingSphere; + constructor(minimum: Vector3, maximum: Vector3); + _update(world: Matrix): void; + isInFrustum(frustumPlanes: Plane[]): boolean; + isCompletelyInFrustum(frustumPlanes: Plane[]): boolean; + _checkCollision(collider: Collider): boolean; + intersectsPoint(point: Vector3): boolean; + intersects(boundingInfo: BoundingInfo, precise: boolean): boolean; + } +} + +declare module BABYLON { + class BoundingSphere { + minimum: Vector3; + maximum: Vector3; + center: Vector3; + radius: number; + centerWorld: Vector3; + radiusWorld: number; + private _tempRadiusVector; + constructor(minimum: Vector3, maximum: Vector3); + _update(world: Matrix): void; + isInFrustum(frustumPlanes: Plane[]): boolean; + intersectsPoint(point: Vector3): boolean; + static Intersects(sphere0: BoundingSphere, sphere1: BoundingSphere): boolean; + } +} + +declare module BABYLON { + class DebugLayer { + private _scene; + private _camera; + private _transformationMatrix; + private _enabled; + private _labelsEnabled; + private _displayStatistics; + private _displayTree; + private _displayLogs; + private _globalDiv; + private _statsDiv; + private _statsSubsetDiv; + private _optionsDiv; + private _optionsSubsetDiv; + private _logDiv; + private _logSubsetDiv; + private _treeDiv; + private _treeSubsetDiv; + private _drawingCanvas; + private _drawingContext; + private _syncPositions; + private _syncData; + private _syncUI; + private _onCanvasClick; + private _clickPosition; + private _ratio; + private _identityMatrix; + private _showUI; + private _needToRefreshMeshesTree; + shouldDisplayLabel: (node: Node) => boolean; + shouldDisplayAxis: (mesh: Mesh) => boolean; + axisRatio: number; + accentColor: string; + customStatsFunction: () => string; + constructor(scene: Scene); + private _refreshMeshesTreeContent(); + private _renderSingleAxis(zero, unit, unitText, label, color); + private _renderAxis(projectedPosition, mesh, globalViewport); + private _renderLabel(text, projectedPosition, labelOffset, onClick, getFillStyle); + private _isClickInsideRect(x, y, width, height); + isVisible(): boolean; + hide(): void; + show(showUI?: boolean, camera?: Camera): void; + private _clearLabels(); + private _generateheader(root, text); + private _generateTexBox(root, title, color); + private _generateAdvancedCheckBox(root, leftTitle, rightTitle, initialState, task, tag?); + private _generateCheckBox(root, title, initialState, task, tag?); + private _generateButton(root, title, task, tag?); + private _generateRadio(root, title, name, initialState, task, tag?); + private _generateDOMelements(); + private _displayStats(); + } +} + +declare module BABYLON { + class Layer { + name: string; + texture: Texture; + isBackground: boolean; + color: Color4; + onDispose: () => void; + private _scene; + private _vertexDeclaration; + private _vertexStrideSize; + private _vertexBuffer; + private _indexBuffer; + private _effect; + constructor(name: string, imgUrl: string, scene: Scene, isBackground?: boolean, color?: Color4); + render(): void; + dispose(): void; + } +} + +declare module BABYLON { + class LensFlare { + size: number; + position: number; + color: Color3; + texture: Texture; + private _system; + constructor(size: number, position: number, color: any, imgUrl: string, system: LensFlareSystem); + dispose: () => void; + } +} + +declare module BABYLON { + class LensFlareSystem { + name: string; + lensFlares: LensFlare[]; + borderLimit: number; + meshesSelectionPredicate: (mesh: Mesh) => boolean; + layerMask: number; + private _scene; + private _emitter; + private _vertexDeclaration; + private _vertexStrideSize; + private _vertexBuffer; + private _indexBuffer; + private _effect; + private _positionX; + private _positionY; + private _isEnabled; + constructor(name: string, emitter: any, scene: Scene); + isEnabled: boolean; + getScene(): Scene; + getEmitter(): any; + setEmitter(newEmitter: any): void; + getEmitterPosition(): Vector3; + computeEffectivePosition(globalViewport: Viewport): boolean; + _isVisible(): boolean; + render(): boolean; + dispose(): void; + } +} + +declare module BABYLON { + class DirectionalLight extends Light implements IShadowLight { + direction: Vector3; + position: Vector3; + private _transformedDirection; + transformedPosition: Vector3; + private _worldMatrix; + shadowOrthoScale: number; + constructor(name: string, direction: Vector3, scene: Scene); + getAbsolutePosition(): Vector3; + setDirectionToTarget(target: Vector3): Vector3; + setShadowProjectionMatrix(matrix: Matrix, viewMatrix: Matrix, renderList: Array): void; + supportsVSM(): boolean; + needRefreshPerFrame(): boolean; + computeTransformedPosition(): boolean; + transferToEffect(effect: Effect, directionUniformName: string): void; + _getWorldMatrix(): Matrix; + } +} + +declare module BABYLON { + class HemisphericLight extends Light { + direction: Vector3; + groundColor: Color3; + private _worldMatrix; + constructor(name: string, direction: Vector3, scene: Scene); + setDirectionToTarget(target: Vector3): Vector3; + getShadowGenerator(): ShadowGenerator; + transferToEffect(effect: Effect, directionUniformName: string, groundColorUniformName: string): void; + _getWorldMatrix(): Matrix; + } +} + +declare module BABYLON { + interface IShadowLight { + position: Vector3; + direction: Vector3; + transformedPosition: Vector3; + name: string; + computeTransformedPosition(): boolean; + getScene(): Scene; + setShadowProjectionMatrix(matrix: Matrix, viewMatrix: Matrix, renderList: Array): void; + supportsVSM(): boolean; + needRefreshPerFrame(): boolean; + _shadowGenerator: ShadowGenerator; + } + class Light extends Node { + diffuse: Color3; + specular: Color3; + intensity: number; + range: number; + includeOnlyWithLayerMask: number; + includedOnlyMeshes: AbstractMesh[]; + excludedMeshes: AbstractMesh[]; + excludeWithLayerMask: number; + _shadowGenerator: ShadowGenerator; + private _parentedWorldMatrix; + _excludedMeshesIds: string[]; + _includedOnlyMeshesIds: string[]; + constructor(name: string, scene: Scene); + getShadowGenerator(): ShadowGenerator; + getAbsolutePosition(): Vector3; + transferToEffect(effect: Effect, uniformName0?: string, uniformName1?: string): void; + _getWorldMatrix(): Matrix; + canAffectMesh(mesh: AbstractMesh): boolean; + getWorldMatrix(): Matrix; + dispose(): void; + } +} + +declare module BABYLON { + class PointLight extends Light { + position: Vector3; + private _worldMatrix; + private _transformedPosition; + constructor(name: string, position: Vector3, scene: Scene); + getAbsolutePosition(): Vector3; + transferToEffect(effect: Effect, positionUniformName: string): void; + getShadowGenerator(): ShadowGenerator; + _getWorldMatrix(): Matrix; + } +} + +declare module BABYLON { + class SpotLight extends Light implements IShadowLight { + position: Vector3; + direction: Vector3; + angle: number; + exponent: number; + transformedPosition: Vector3; + private _transformedDirection; + private _worldMatrix; + constructor(name: string, position: Vector3, direction: Vector3, angle: number, exponent: number, scene: Scene); + getAbsolutePosition(): Vector3; + setShadowProjectionMatrix(matrix: Matrix, viewMatrix: Matrix, renderList: Array): void; + supportsVSM(): boolean; + needRefreshPerFrame(): boolean; + setDirectionToTarget(target: Vector3): Vector3; + computeTransformedPosition(): boolean; + transferToEffect(effect: Effect, positionUniformName: string, directionUniformName: string): void; + _getWorldMatrix(): Matrix; + } +} + +declare module BABYLON { + interface ISceneLoaderPlugin { + extensions: string; + importMesh: (meshesNames: any, scene: Scene, data: any, rootUrl: string, meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => boolean; + load: (scene: Scene, data: string, rootUrl: string) => boolean; + } + class SceneLoader { + private static _ForceFullSceneLoadingForIncremental; + private static _ShowLoadingScreen; + static ForceFullSceneLoadingForIncremental: boolean; + static ShowLoadingScreen: boolean; + private static _registeredPlugins; + private static _getPluginForFilename(sceneFilename); + static RegisterPlugin(plugin: ISceneLoaderPlugin): void; + static ImportMesh(meshesNames: any, rootUrl: string, sceneFilename: string, scene: Scene, onsuccess?: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, progressCallBack?: () => void, onerror?: (scene: Scene, e: any) => void): void; + /** + * Load a scene + * @param rootUrl a string that defines the root url for scene and resources + * @param sceneFilename a string that defines the name of the scene file. can start with "data:" following by the stringified version of the scene + * @param engine is the instance of BABYLON.Engine to use to create the scene + */ + static Load(rootUrl: string, sceneFilename: any, engine: Engine, onsuccess?: (scene: Scene) => void, progressCallBack?: any, onerror?: (scene: Scene) => void): void; + /** + * Append a scene + * @param rootUrl a string that defines the root url for scene and resources + * @param sceneFilename a string that defines the name of the scene file. can start with "data:" following by the stringified version of the scene + * @param scene is the instance of BABYLON.Scene to append to + */ + static Append(rootUrl: string, sceneFilename: any, scene: Scene, onsuccess?: (scene: Scene) => void, progressCallBack?: any, onerror?: (scene: Scene) => void): void; + } +} + +declare module BABYLON { + class EffectFallbacks { + private _defines; + private _currentRank; + private _maxRank; + addFallback(rank: number, define: string): void; + isMoreFallbacks: boolean; + reduce(currentDefines: string): string; + } + class Effect { + name: any; + defines: string; + onCompiled: (effect: Effect) => void; + onError: (effect: Effect, errors: string) => void; + onBind: (effect: Effect) => void; + private _engine; + private _uniformsNames; + private _samplers; + private _isReady; + private _compilationError; + private _attributesNames; + private _attributes; + private _uniforms; + _key: string; + private _program; + private _valueCache; + constructor(baseName: any, attributesNames: string[], uniformsNames: string[], samplers: string[], engine: any, defines?: string, fallbacks?: EffectFallbacks, onCompiled?: (effect: Effect) => void, onError?: (effect: Effect, errors: string) => void); + isReady(): boolean; + getProgram(): WebGLProgram; + getAttributesNames(): string[]; + getAttributeLocation(index: number): number; + getAttributeLocationByName(name: string): number; + getAttributesCount(): number; + getUniformIndex(uniformName: string): number; + getUniform(uniformName: string): WebGLUniformLocation; + getSamplers(): string[]; + getCompilationError(): string; + _loadVertexShader(vertex: any, callback: (data: any) => void): void; + _loadFragmentShader(fragment: any, callback: (data: any) => void): void; + private _prepareEffect(vertexSourceCode, fragmentSourceCode, attributesNames, defines, fallbacks?); + _bindTexture(channel: string, texture: WebGLTexture): void; + setTexture(channel: string, texture: BaseTexture): void; + setTextureFromPostProcess(channel: string, postProcess: PostProcess): void; + _cacheFloat2(uniformName: string, x: number, y: number): void; + _cacheFloat3(uniformName: string, x: number, y: number, z: number): void; + _cacheFloat4(uniformName: string, x: number, y: number, z: number, w: number): void; + setArray(uniformName: string, array: number[]): Effect; + setArray2(uniformName: string, array: number[]): Effect; + setArray3(uniformName: string, array: number[]): Effect; + setArray4(uniformName: string, array: number[]): Effect; + setMatrices(uniformName: string, matrices: Float32Array): Effect; + setMatrix(uniformName: string, matrix: Matrix): Effect; + setMatrix3x3(uniformName: string, matrix: Float32Array): Effect; + setMatrix2x2(uniformname: string, matrix: Float32Array): Effect; + setFloat(uniformName: string, value: number): Effect; + setBool(uniformName: string, bool: boolean): Effect; + setVector2(uniformName: string, vector2: Vector2): Effect; + setFloat2(uniformName: string, x: number, y: number): Effect; + setVector3(uniformName: string, vector3: Vector3): Effect; + setFloat3(uniformName: string, x: number, y: number, z: number): Effect; + setVector4(uniformName: string, vector4: Vector4): Effect; + setFloat4(uniformName: string, x: number, y: number, z: number, w: number): Effect; + setColor3(uniformName: string, color3: Color3): Effect; + setColor4(uniformName: string, color3: Color3, alpha: number): Effect; + static ShadersStore: {}; + } +} + +declare module BABYLON { + class Material { + name: string; + private static _TriangleFillMode; + private static _WireFrameFillMode; + private static _PointFillMode; + static TriangleFillMode: number; + static WireFrameFillMode: number; + static PointFillMode: number; + id: string; + checkReadyOnEveryCall: boolean; + checkReadyOnlyOnce: boolean; + state: string; + alpha: number; + backFaceCulling: boolean; + onCompiled: (effect: Effect) => void; + onError: (effect: Effect, errors: string) => void; + onDispose: () => void; + onBind: (material: Material, mesh: Mesh) => void; + getRenderTargetTextures: () => SmartArray; + alphaMode: number; + disableDepthWrite: boolean; + _effect: Effect; + _wasPreviouslyReady: boolean; + private _scene; + private _fillMode; + private _cachedDepthWriteState; + pointSize: number; + zOffset: number; + wireframe: boolean; + pointsCloud: boolean; + fillMode: number; + constructor(name: string, scene: Scene, doNotAdd?: boolean); + isReady(mesh?: AbstractMesh, useInstances?: boolean): boolean; + getEffect(): Effect; + getScene(): Scene; + needAlphaBlending(): boolean; + needAlphaTesting(): boolean; + getAlphaTestTexture(): BaseTexture; + trackCreation(onCompiled: (effect: Effect) => void, onError: (effect: Effect, errors: string) => void): void; + _preBind(): void; + bind(world: Matrix, mesh?: Mesh): void; + bindOnlyWorldMatrix(world: Matrix): void; + unbind(): void; + clone(name: string): Material; + dispose(forceDisposeEffect?: boolean): void; + } +} + +declare module BABYLON { + class MultiMaterial extends Material { + subMaterials: Material[]; + constructor(name: string, scene: Scene); + getSubMaterial(index: any): Material; + isReady(mesh?: AbstractMesh): boolean; + clone(name: string): MultiMaterial; + } +} + +declare module BABYLON { + class ShaderMaterial extends Material { + private _shaderPath; + private _options; + private _textures; + private _floats; + private _floatsArrays; + private _colors3; + private _colors4; + private _vectors2; + private _vectors3; + private _vectors4; + private _matrices; + private _matrices3x3; + private _matrices2x2; + private _cachedWorldViewMatrix; + private _renderId; + constructor(name: string, scene: Scene, shaderPath: any, options: any); + needAlphaBlending(): boolean; + needAlphaTesting(): boolean; + private _checkUniform(uniformName); + setTexture(name: string, texture: Texture): ShaderMaterial; + setFloat(name: string, value: number): ShaderMaterial; + setFloats(name: string, value: number[]): ShaderMaterial; + setColor3(name: string, value: Color3): ShaderMaterial; + setColor4(name: string, value: Color4): ShaderMaterial; + setVector2(name: string, value: Vector2): ShaderMaterial; + setVector3(name: string, value: Vector3): ShaderMaterial; + setVector4(name: string, value: Vector4): ShaderMaterial; + setMatrix(name: string, value: Matrix): ShaderMaterial; + setMatrix3x3(name: string, value: Float32Array): ShaderMaterial; + setMatrix2x2(name: string, value: Float32Array): ShaderMaterial; + isReady(mesh?: AbstractMesh, useInstances?: boolean): boolean; + bindOnlyWorldMatrix(world: Matrix): void; + bind(world: Matrix, mesh?: Mesh): void; + clone(name: string): ShaderMaterial; + dispose(forceDisposeEffect?: boolean): void; + } +} + +declare module BABYLON { + class FresnelParameters { + isEnabled: boolean; + leftColor: Color3; + rightColor: Color3; + bias: number; + power: number; + } + class StandardMaterial extends Material { + diffuseTexture: BaseTexture; + ambientTexture: BaseTexture; + opacityTexture: BaseTexture; + reflectionTexture: BaseTexture; + emissiveTexture: BaseTexture; + specularTexture: BaseTexture; + bumpTexture: BaseTexture; + ambientColor: Color3; + diffuseColor: Color3; + specularColor: Color3; + specularPower: number; + emissiveColor: Color3; + useAlphaFromDiffuseTexture: boolean; + useEmissiveAsIllumination: boolean; + useReflectionFresnelFromSpecular: boolean; + useSpecularOverAlpha: boolean; + fogEnabled: boolean; + roughness: number; + diffuseFresnelParameters: FresnelParameters; + opacityFresnelParameters: FresnelParameters; + reflectionFresnelParameters: FresnelParameters; + emissiveFresnelParameters: FresnelParameters; + useGlossinessFromSpecularMapAlpha: boolean; + private _renderTargets; + private _worldViewProjectionMatrix; + private _globalAmbientColor; + private _scaledDiffuse; + private _scaledSpecular; + private _renderId; + private _defines; + private _cachedDefines; + constructor(name: string, scene: Scene); + needAlphaBlending(): boolean; + needAlphaTesting(): boolean; + private _shouldUseAlphaFromDiffuseTexture(); + getAlphaTestTexture(): BaseTexture; + isReady(mesh?: AbstractMesh, useInstances?: boolean): boolean; + unbind(): void; + bindOnlyWorldMatrix(world: Matrix): void; + bind(world: Matrix, mesh?: Mesh): void; + getAnimatables(): IAnimatable[]; + dispose(forceDisposeEffect?: boolean): void; + clone(name: string): StandardMaterial; + static DiffuseTextureEnabled: boolean; + static AmbientTextureEnabled: boolean; + static OpacityTextureEnabled: boolean; + static ReflectionTextureEnabled: boolean; + static EmissiveTextureEnabled: boolean; + static SpecularTextureEnabled: boolean; + static BumpTextureEnabled: boolean; + static FresnelEnabled: boolean; + } +} + +declare module BABYLON { + class Color3 { + r: number; + g: number; + b: number; + constructor(r?: number, g?: number, b?: number); + toString(): string; + toArray(array: number[], index?: number): Color3; + toColor4(alpha?: number): Color4; + asArray(): number[]; + toLuminance(): number; + multiply(otherColor: Color3): Color3; + multiplyToRef(otherColor: Color3, result: Color3): Color3; + equals(otherColor: Color3): boolean; + equalsFloats(r: number, g: number, b: number): boolean; + scale(scale: number): Color3; + scaleToRef(scale: number, result: Color3): Color3; + add(otherColor: Color3): Color3; + addToRef(otherColor: Color3, result: Color3): Color3; + subtract(otherColor: Color3): Color3; + subtractToRef(otherColor: Color3, result: Color3): Color3; + clone(): Color3; + copyFrom(source: Color3): Color3; + copyFromFloats(r: number, g: number, b: number): Color3; + toHexString(): string; + static FromHexString(hex: string): Color3; + static FromArray(array: number[], offset?: number): Color3; + static FromInts(r: number, g: number, b: number): Color3; + static Lerp(start: Color3, end: Color3, amount: number): Color3; + static Red(): Color3; + static Green(): Color3; + static Blue(): Color3; + static Black(): Color3; + static White(): Color3; + static Purple(): Color3; + static Magenta(): Color3; + static Yellow(): Color3; + static Gray(): Color3; + } + class Color4 { + r: number; + g: number; + b: number; + a: number; + constructor(r: number, g: number, b: number, a: number); + addInPlace(right: any): Color4; + asArray(): number[]; + toArray(array: number[], index?: number): Color4; + add(right: Color4): Color4; + subtract(right: Color4): Color4; + subtractToRef(right: Color4, result: Color4): Color4; + scale(scale: number): Color4; + scaleToRef(scale: number, result: Color4): Color4; + toString(): string; + clone(): Color4; + copyFrom(source: Color4): Color4; + toHexString(): string; + static FromHexString(hex: string): Color4; + static Lerp(left: Color4, right: Color4, amount: number): Color4; + static LerpToRef(left: Color4, right: Color4, amount: number, result: Color4): void; + static FromArray(array: number[], offset?: number): Color4; + static FromInts(r: number, g: number, b: number, a: number): Color4; + } + class Vector2 { + x: number; + y: number; + constructor(x: number, y: number); + toString(): string; + toArray(array: number[], index?: number): Vector2; + asArray(): number[]; + copyFrom(source: Vector2): Vector2; + copyFromFloats(x: number, y: number): Vector2; + add(otherVector: Vector2): Vector2; + addVector3(otherVector: Vector3): Vector2; + subtract(otherVector: Vector2): Vector2; + subtractInPlace(otherVector: Vector2): Vector2; + multiplyInPlace(otherVector: Vector2): Vector2; + multiply(otherVector: Vector2): Vector2; + multiplyToRef(otherVector: Vector2, result: Vector2): Vector2; + multiplyByFloats(x: number, y: number): Vector2; + divide(otherVector: Vector2): Vector2; + divideToRef(otherVector: Vector2, result: Vector2): Vector2; + negate(): Vector2; + scaleInPlace(scale: number): Vector2; + scale(scale: number): Vector2; + equals(otherVector: Vector2): boolean; + equalsWithEpsilon(otherVector: Vector2, epsilon?: number): boolean; + length(): number; + lengthSquared(): number; + normalize(): Vector2; + clone(): Vector2; + static Zero(): Vector2; + static FromArray(array: number[], offset?: number): Vector2; + static FromArrayToRef(array: number[], offset: number, result: Vector2): void; + static CatmullRom(value1: Vector2, value2: Vector2, value3: Vector2, value4: Vector2, amount: number): Vector2; + static Clamp(value: Vector2, min: Vector2, max: Vector2): Vector2; + static Hermite(value1: Vector2, tangent1: Vector2, value2: Vector2, tangent2: Vector2, amount: number): Vector2; + static Lerp(start: Vector2, end: Vector2, amount: number): Vector2; + static Dot(left: Vector2, right: Vector2): number; + static Normalize(vector: Vector2): Vector2; + static Minimize(left: Vector2, right: Vector2): Vector2; + static Maximize(left: Vector2, right: Vector2): Vector2; + static Transform(vector: Vector2, transformation: Matrix): Vector2; + static Distance(value1: Vector2, value2: Vector2): number; + static DistanceSquared(value1: Vector2, value2: Vector2): number; + } + class Vector3 { + x: number; + y: number; + z: number; + constructor(x: number, y: number, z: number); + toString(): string; + asArray(): number[]; + toArray(array: number[], index?: number): Vector3; + toQuaternion(): Quaternion; + addInPlace(otherVector: Vector3): Vector3; + add(otherVector: Vector3): Vector3; + addToRef(otherVector: Vector3, result: Vector3): Vector3; + subtractInPlace(otherVector: Vector3): Vector3; + subtract(otherVector: Vector3): Vector3; + subtractToRef(otherVector: Vector3, result: Vector3): Vector3; + subtractFromFloats(x: number, y: number, z: number): Vector3; + subtractFromFloatsToRef(x: number, y: number, z: number, result: Vector3): Vector3; + negate(): Vector3; + scaleInPlace(scale: number): Vector3; + scale(scale: number): Vector3; + scaleToRef(scale: number, result: Vector3): void; + equals(otherVector: Vector3): boolean; + equalsWithEpsilon(otherVector: Vector3, epsilon?: number): boolean; + equalsToFloats(x: number, y: number, z: number): boolean; + multiplyInPlace(otherVector: Vector3): Vector3; + multiply(otherVector: Vector3): Vector3; + multiplyToRef(otherVector: Vector3, result: Vector3): Vector3; + multiplyByFloats(x: number, y: number, z: number): Vector3; + divide(otherVector: Vector3): Vector3; + divideToRef(otherVector: Vector3, result: Vector3): Vector3; + MinimizeInPlace(other: Vector3): Vector3; + MaximizeInPlace(other: Vector3): Vector3; + length(): number; + lengthSquared(): number; + normalize(): Vector3; + clone(): Vector3; + copyFrom(source: Vector3): Vector3; + copyFromFloats(x: number, y: number, z: number): Vector3; + static GetClipFactor(vector0: Vector3, vector1: Vector3, axis: Vector3, size: any): number; + static FromArray(array: number[], offset?: number): Vector3; + static FromFloatArray(array: Float32Array, offset?: number): Vector3; + static FromArrayToRef(array: number[], offset: number, result: Vector3): void; + static FromFloatArrayToRef(array: Float32Array, offset: number, result: Vector3): void; + static FromFloatsToRef(x: number, y: number, z: number, result: Vector3): void; + static Zero(): Vector3; + static Up(): Vector3; + static TransformCoordinates(vector: Vector3, transformation: Matrix): Vector3; + static TransformCoordinatesToRef(vector: Vector3, transformation: Matrix, result: Vector3): void; + static TransformCoordinatesFromFloatsToRef(x: number, y: number, z: number, transformation: Matrix, result: Vector3): void; + static TransformCoordinatesToRefSIMD(vector: Vector3, transformation: Matrix, result: Vector3): void; + static TransformCoordinatesFromFloatsToRefSIMD(x: number, y: number, z: number, transformation: Matrix, result: Vector3): void; + static TransformNormal(vector: Vector3, transformation: Matrix): Vector3; + static TransformNormalToRef(vector: Vector3, transformation: Matrix, result: Vector3): void; + static TransformNormalFromFloatsToRef(x: number, y: number, z: number, transformation: Matrix, result: Vector3): void; + static CatmullRom(value1: Vector3, value2: Vector3, value3: Vector3, value4: Vector3, amount: number): Vector3; + static Clamp(value: Vector3, min: Vector3, max: Vector3): Vector3; + static Hermite(value1: Vector3, tangent1: Vector3, value2: Vector3, tangent2: Vector3, amount: number): Vector3; + static Lerp(start: Vector3, end: Vector3, amount: number): Vector3; + static Dot(left: Vector3, right: Vector3): number; + static Cross(left: Vector3, right: Vector3): Vector3; + static CrossToRef(left: Vector3, right: Vector3, result: Vector3): void; + static Normalize(vector: Vector3): Vector3; + static NormalizeToRef(vector: Vector3, result: Vector3): void; + static Project(vector: Vector3, world: Matrix, transform: Matrix, viewport: Viewport): Vector3; + static UnprojectFromTransform(source: Vector3, viewportWidth: number, viewportHeight: number, world: Matrix, transform: Matrix): Vector3; + static Unproject(source: Vector3, viewportWidth: number, viewportHeight: number, world: Matrix, view: Matrix, projection: Matrix): Vector3; + static Minimize(left: Vector3, right: Vector3): Vector3; + static Maximize(left: Vector3, right: Vector3): Vector3; + static Distance(value1: Vector3, value2: Vector3): number; + static DistanceSquared(value1: Vector3, value2: Vector3): number; + static Center(value1: Vector3, value2: Vector3): Vector3; + /** + * Given three orthogonal left-handed oriented Vector3 axis in space (target system), + * RotationFromAxis() returns the rotation Euler angles (ex : rotation.x, rotation.y, rotation.z) to apply + * to something in order to rotate it from its local system to the given target system. + */ + static RotationFromAxis(axis1: Vector3, axis2: Vector3, axis3: Vector3): Vector3; + /** + * The same than RotationFromAxis but updates the passed ref Vector3 parameter. + */ + static RotationFromAxisToRef(axis1: Vector3, axis2: Vector3, axis3: Vector3, ref: Vector3): void; + } + class Vector4 { + x: number; + y: number; + z: number; + w: number; + constructor(x: number, y: number, z: number, w: number); + toString(): string; + asArray(): number[]; + toArray(array: number[], index?: number): Vector4; + addInPlace(otherVector: Vector4): Vector4; + add(otherVector: Vector4): Vector4; + addToRef(otherVector: Vector4, result: Vector4): Vector4; + subtractInPlace(otherVector: Vector4): Vector4; + subtract(otherVector: Vector4): Vector4; + subtractToRef(otherVector: Vector4, result: Vector4): Vector4; + subtractFromFloats(x: number, y: number, z: number, w: number): Vector4; + subtractFromFloatsToRef(x: number, y: number, z: number, w: number, result: Vector4): Vector4; + negate(): Vector4; + scaleInPlace(scale: number): Vector4; + scale(scale: number): Vector4; + scaleToRef(scale: number, result: Vector4): void; + equals(otherVector: Vector4): boolean; + equalsWithEpsilon(otherVector: Vector4, epsilon?: number): boolean; + equalsToFloats(x: number, y: number, z: number, w: number): boolean; + multiplyInPlace(otherVector: Vector4): Vector4; + multiply(otherVector: Vector4): Vector4; + multiplyToRef(otherVector: Vector4, result: Vector4): Vector4; + multiplyByFloats(x: number, y: number, z: number, w: number): Vector4; + divide(otherVector: Vector4): Vector4; + divideToRef(otherVector: Vector4, result: Vector4): Vector4; + MinimizeInPlace(other: Vector4): Vector4; + MaximizeInPlace(other: Vector4): Vector4; + length(): number; + lengthSquared(): number; + normalize(): Vector4; + clone(): Vector4; + copyFrom(source: Vector4): Vector4; + copyFromFloats(x: number, y: number, z: number, w: number): Vector4; + static FromArray(array: number[], offset?: number): Vector4; + static FromArrayToRef(array: number[], offset: number, result: Vector4): void; + static FromFloatArrayToRef(array: Float32Array, offset: number, result: Vector4): void; + static FromFloatsToRef(x: number, y: number, z: number, w: number, result: Vector4): void; + static Zero(): Vector4; + static Normalize(vector: Vector4): Vector4; + static NormalizeToRef(vector: Vector4, result: Vector4): void; + static Minimize(left: Vector4, right: Vector4): Vector4; + static Maximize(left: Vector4, right: Vector4): Vector4; + static Distance(value1: Vector4, value2: Vector4): number; + static DistanceSquared(value1: Vector4, value2: Vector4): number; + static Center(value1: Vector4, value2: Vector4): Vector4; + } + class Quaternion { + x: number; + y: number; + z: number; + w: number; + constructor(x?: number, y?: number, z?: number, w?: number); + toString(): string; + asArray(): number[]; + equals(otherQuaternion: Quaternion): boolean; + clone(): Quaternion; + copyFrom(other: Quaternion): Quaternion; + copyFromFloats(x: number, y: number, z: number, w: number): Quaternion; + add(other: Quaternion): Quaternion; + subtract(other: Quaternion): Quaternion; + scale(value: number): Quaternion; + multiply(q1: Quaternion): Quaternion; + multiplyToRef(q1: Quaternion, result: Quaternion): Quaternion; + length(): number; + normalize(): Quaternion; + toEulerAngles(): Vector3; + toEulerAnglesToRef(result: Vector3): Quaternion; + toRotationMatrix(result: Matrix): Quaternion; + fromRotationMatrix(matrix: Matrix): Quaternion; + static FromRotationMatrix(matrix: Matrix): Quaternion; + static FromRotationMatrixToRef(matrix: Matrix, result: Quaternion): void; + static Inverse(q: Quaternion): Quaternion; + static Identity(): Quaternion; + static RotationAxis(axis: Vector3, angle: number): Quaternion; + static FromArray(array: number[], offset?: number): Quaternion; + static RotationYawPitchRoll(yaw: number, pitch: number, roll: number): Quaternion; + static RotationYawPitchRollToRef(yaw: number, pitch: number, roll: number, result: Quaternion): void; + static RotationAlphaBetaGamma(alpha: number, beta: number, gamma: number): Quaternion; + static RotationAlphaBetaGammaToRef(alpha: number, beta: number, gamma: number, result: Quaternion): void; + static Slerp(left: Quaternion, right: Quaternion, amount: number): Quaternion; + } + class Matrix { + private static _tempQuaternion; + private static _xAxis; + private static _yAxis; + private static _zAxis; + m: Float32Array; + isIdentity(): boolean; + determinant(): number; + toArray(): Float32Array; + asArray(): Float32Array; + invert(): Matrix; + reset(): Matrix; + add(other: Matrix): Matrix; + addToRef(other: Matrix, result: Matrix): Matrix; + addToSelf(other: Matrix): Matrix; + invertToRef(other: Matrix): Matrix; + invertToRefSIMD(other: Matrix): Matrix; + setTranslation(vector3: Vector3): Matrix; + multiply(other: Matrix): Matrix; + copyFrom(other: Matrix): Matrix; + copyToArray(array: Float32Array, offset?: number): Matrix; + multiplyToRef(other: Matrix, result: Matrix): Matrix; + multiplyToArray(other: Matrix, result: Float32Array, offset: number): Matrix; + multiplyToArraySIMD(other: Matrix, result: Matrix, offset?: number): void; + equals(value: Matrix): boolean; + clone(): Matrix; + decompose(scale: Vector3, rotation: Quaternion, translation: Vector3): boolean; + static FromArray(array: number[], offset?: number): Matrix; + static FromArrayToRef(array: number[], offset: number, result: Matrix): void; + static FromFloat32ArrayToRefScaled(array: Float32Array, offset: number, scale: number, result: Matrix): void; + static FromValuesToRef(initialM11: number, initialM12: number, initialM13: number, initialM14: number, initialM21: number, initialM22: number, initialM23: number, initialM24: number, initialM31: number, initialM32: number, initialM33: number, initialM34: number, initialM41: number, initialM42: number, initialM43: number, initialM44: number, result: Matrix): void; + static FromValues(initialM11: number, initialM12: number, initialM13: number, initialM14: number, initialM21: number, initialM22: number, initialM23: number, initialM24: number, initialM31: number, initialM32: number, initialM33: number, initialM34: number, initialM41: number, initialM42: number, initialM43: number, initialM44: number): Matrix; + static Compose(scale: Vector3, rotation: Quaternion, translation: Vector3): Matrix; + static Identity(): Matrix; + static IdentityToRef(result: Matrix): void; + static Zero(): Matrix; + static RotationX(angle: number): Matrix; + static Invert(source: Matrix): Matrix; + static RotationXToRef(angle: number, result: Matrix): void; + static RotationY(angle: number): Matrix; + static RotationYToRef(angle: number, result: Matrix): void; + static RotationZ(angle: number): Matrix; + static RotationZToRef(angle: number, result: Matrix): void; + static RotationAxis(axis: Vector3, angle: number): Matrix; + static RotationYawPitchRoll(yaw: number, pitch: number, roll: number): Matrix; + static RotationYawPitchRollToRef(yaw: number, pitch: number, roll: number, result: Matrix): void; + static Scaling(x: number, y: number, z: number): Matrix; + static ScalingToRef(x: number, y: number, z: number, result: Matrix): void; + static Translation(x: number, y: number, z: number): Matrix; + static TranslationToRef(x: number, y: number, z: number, result: Matrix): void; + static LookAtLH(eye: Vector3, target: Vector3, up: Vector3): Matrix; + static LookAtLHToRef(eye: Vector3, target: Vector3, up: Vector3, result: Matrix): void; + static LookAtLHToRefSIMD(eyeRef: Vector3, targetRef: Vector3, upRef: Vector3, result: Matrix): void; + static OrthoLH(width: number, height: number, znear: number, zfar: number): Matrix; + static OrthoLHToRef(width: number, height: number, znear: number, zfar: number, result: Matrix): void; + static OrthoOffCenterLH(left: number, right: number, bottom: number, top: number, znear: number, zfar: number): Matrix; + static OrthoOffCenterLHToRef(left: number, right: any, bottom: number, top: number, znear: number, zfar: number, result: Matrix): void; + static PerspectiveLH(width: number, height: number, znear: number, zfar: number): Matrix; + static PerspectiveFovLH(fov: number, aspect: number, znear: number, zfar: number): Matrix; + static PerspectiveFovLHToRef(fov: number, aspect: number, znear: number, zfar: number, result: Matrix, fovMode?: number): void; + static GetFinalMatrix(viewport: Viewport, world: Matrix, view: Matrix, projection: Matrix, zmin: number, zmax: number): Matrix; + static GetAsMatrix2x2(matrix: Matrix): Float32Array; + static GetAsMatrix3x3(matrix: Matrix): Float32Array; + static Transpose(matrix: Matrix): Matrix; + static Reflection(plane: Plane): Matrix; + static ReflectionToRef(plane: Plane, result: Matrix): void; + } + class Plane { + normal: Vector3; + d: number; + constructor(a: number, b: number, c: number, d: number); + asArray(): number[]; + clone(): Plane; + normalize(): Plane; + transform(transformation: Matrix): Plane; + dotCoordinate(point: any): number; + copyFromPoints(point1: Vector3, point2: Vector3, point3: Vector3): Plane; + isFrontFacingTo(direction: Vector3, epsilon: number): boolean; + signedDistanceTo(point: Vector3): number; + static FromArray(array: number[]): Plane; + static FromPoints(point1: any, point2: any, point3: any): Plane; + static FromPositionAndNormal(origin: Vector3, normal: Vector3): Plane; + static SignedDistanceToPlaneFromPositionAndNormal(origin: Vector3, normal: Vector3, point: Vector3): number; + } + class Viewport { + x: number; + y: number; + width: number; + height: number; + constructor(x: number, y: number, width: number, height: number); + toGlobal(engine: any): Viewport; + } + class Frustum { + static GetPlanes(transform: Matrix): Plane[]; + static GetPlanesToRef(transform: Matrix, frustumPlanes: Plane[]): void; + } + class Ray { + origin: Vector3; + direction: Vector3; + length: number; + private _edge1; + private _edge2; + private _pvec; + private _tvec; + private _qvec; + constructor(origin: Vector3, direction: Vector3, length?: number); + intersectsBoxMinMax(minimum: Vector3, maximum: Vector3): boolean; + intersectsBox(box: BoundingBox): boolean; + intersectsSphere(sphere: any): boolean; + intersectsTriangle(vertex0: Vector3, vertex1: Vector3, vertex2: Vector3): IntersectionInfo; + static CreateNew(x: number, y: number, viewportWidth: number, viewportHeight: number, world: Matrix, view: Matrix, projection: Matrix): Ray; + /** + * Function will create a new transformed ray starting from origin and ending at the end point. Ray's length will be set, and ray will be + * transformed to the given world matrix. + * @param origin The origin point + * @param end The end point + * @param world a matrix to transform the ray to. Default is the identity matrix. + */ + static CreateNewFromTo(origin: Vector3, end: Vector3, world?: Matrix): Ray; + static Transform(ray: Ray, matrix: Matrix): Ray; + } + enum Space { + LOCAL = 0, + WORLD = 1, + } + class Axis { + static X: Vector3; + static Y: Vector3; + static Z: Vector3; + } + class BezierCurve { + static interpolate(t: number, x1: number, y1: number, x2: number, y2: number): number; + } + enum Orientation { + CW = 0, + CCW = 1, + } + class Angle { + private _radians; + constructor(radians: number); + degrees: () => number; + radians: () => number; + static BetweenTwoPoints(a: Vector2, b: Vector2): Angle; + static FromRadians(radians: number): Angle; + static FromDegrees(degrees: number): Angle; + } + class Arc2 { + startPoint: Vector2; + midPoint: Vector2; + endPoint: Vector2; + centerPoint: Vector2; + radius: number; + angle: Angle; + startAngle: Angle; + orientation: Orientation; + constructor(startPoint: Vector2, midPoint: Vector2, endPoint: Vector2); + } + class PathCursor { + private path; + private _onchange; + value: number; + animations: Animation[]; + constructor(path: Path2); + getPoint(): Vector3; + moveAhead(step?: number): PathCursor; + moveBack(step?: number): PathCursor; + move(step: number): PathCursor; + private ensureLimits(); + private markAsDirty(propertyName); + private raiseOnChange(); + onchange(f: (cursor: PathCursor) => void): PathCursor; + } + class Path2 { + private _points; + private _length; + closed: boolean; + constructor(x: number, y: number); + addLineTo(x: number, y: number): Path2; + addArcTo(midX: number, midY: number, endX: number, endY: number, numberOfSegments?: number): Path2; + close(): Path2; + length(): number; + getPoints(): Vector2[]; + getPointAtLengthPosition(normalizedLengthPosition: number): Vector2; + static StartingAt(x: number, y: number): Path2; + } + class Path3D { + path: Vector3[]; + private _curve; + private _distances; + private _tangents; + private _normals; + private _binormals; + private _raw; + /** + * new Path3D(path, normal, raw) + * path : an array of Vector3, the curve axis of the Path3D + * normal (optional) : Vector3, the first wanted normal to the curve. Ex (0, 1, 0) for a vertical normal. + * raw (optional, default false) : boolean, if true the returned Path3D isn't normalized. Useful to depict path acceleration or speed. + */ + constructor(path: Vector3[], firstNormal?: Vector3, raw?: boolean); + getCurve(): Vector3[]; + getTangents(): Vector3[]; + getNormals(): Vector3[]; + getBinormals(): Vector3[]; + getDistances(): number[]; + update(path: Vector3[], firstNormal?: Vector3): Path3D; + private _compute(firstNormal); + private _getFirstNonNullVector(index); + private _getLastNonNullVector(index); + private _normalVector(v0, vt, va); + } + class Curve3 { + private _points; + private _length; + static CreateQuadraticBezier(v0: Vector3, v1: Vector3, v2: Vector3, nbPoints: number): Curve3; + static CreateCubicBezier(v0: Vector3, v1: Vector3, v2: Vector3, v3: Vector3, nbPoints: number): Curve3; + static CreateHermiteSpline(p1: Vector3, t1: Vector3, p2: Vector3, t2: Vector3, nbPoints: number): Curve3; + constructor(points: Vector3[]); + getPoints(): Vector3[]; + length(): number; + continue(curve: Curve3): Curve3; + private _computeLength(path); + } + class PositionNormalVertex { + position: Vector3; + normal: Vector3; + constructor(position?: Vector3, normal?: Vector3); + clone(): PositionNormalVertex; + } + class PositionNormalTextureVertex { + position: Vector3; + normal: Vector3; + uv: Vector2; + constructor(position?: Vector3, normal?: Vector3, uv?: Vector2); + clone(): PositionNormalTextureVertex; + } + class SIMDHelper { + private static _isEnabled; + static IsEnabled: boolean; + static DisableSIMD(): void; + static EnableSIMD(): void; + } +} + +declare module BABYLON { + class AbstractMesh extends Node implements IDisposable { + private static _BILLBOARDMODE_NONE; + private static _BILLBOARDMODE_X; + private static _BILLBOARDMODE_Y; + private static _BILLBOARDMODE_Z; + private static _BILLBOARDMODE_ALL; + static BILLBOARDMODE_NONE: number; + static BILLBOARDMODE_X: number; + static BILLBOARDMODE_Y: number; + static BILLBOARDMODE_Z: number; + static BILLBOARDMODE_ALL: number; + definedFacingForward: boolean; + position: Vector3; + rotation: Vector3; + rotationQuaternion: Quaternion; + scaling: Vector3; + billboardMode: number; + visibility: number; + alphaIndex: number; + infiniteDistance: boolean; + isVisible: boolean; + isPickable: boolean; + showBoundingBox: boolean; + showSubMeshesBoundingBox: boolean; + onDispose: any; + isBlocker: boolean; + skeleton: Skeleton; + renderingGroupId: number; + material: Material; + receiveShadows: boolean; + actionManager: ActionManager; + renderOutline: boolean; + outlineColor: Color3; + outlineWidth: number; + renderOverlay: boolean; + overlayColor: Color3; + overlayAlpha: number; + hasVertexAlpha: boolean; + useVertexColors: boolean; + applyFog: boolean; + computeBonesUsingShaders: boolean; + useOctreeForRenderingSelection: boolean; + useOctreeForPicking: boolean; + useOctreeForCollisions: boolean; + layerMask: number; + alwaysSelectAsActiveMesh: boolean; + _physicImpostor: number; + _physicsMass: number; + _physicsFriction: number; + _physicRestitution: number; + private _checkCollisions; + ellipsoid: Vector3; + ellipsoidOffset: Vector3; + private _collider; + private _oldPositionForCollisions; + private _diffPositionForCollisions; + private _newPositionForCollisions; + onCollide: (collidedMesh: AbstractMesh) => void; + private _meshToBoneReferal; + edgesWidth: number; + edgesColor: Color4; + _edgesRenderer: EdgesRenderer; + private _localScaling; + private _localRotation; + private _localTranslation; + private _localBillboard; + private _localPivotScaling; + private _localPivotScalingRotation; + private _localMeshReferalTransform; + private _localWorld; + _worldMatrix: Matrix; + private _rotateYByPI; + private _absolutePosition; + private _collisionsTransformMatrix; + private _collisionsScalingMatrix; + _positions: Vector3[]; + private _isDirty; + _masterMesh: AbstractMesh; + _boundingInfo: BoundingInfo; + private _pivotMatrix; + _isDisposed: boolean; + _renderId: number; + subMeshes: SubMesh[]; + _submeshesOctree: Octree; + _intersectionsInProgress: AbstractMesh[]; + private _onAfterWorldMatrixUpdate; + private _isWorldMatrixFrozen; + _waitingActions: any; + _waitingFreezeWorldMatrix: boolean; + constructor(name: string, scene: Scene); + disableEdgesRendering(): void; + enableEdgesRendering(epsilon?: number, checkVerticesInsteadOfIndices?: boolean): void; + isBlocked: boolean; + getLOD(camera: Camera): AbstractMesh; + getTotalVertices(): number; + getIndices(): number[]; + getVerticesData(kind: string): number[]; + isVerticesDataPresent(kind: string): boolean; + getBoundingInfo(): BoundingInfo; + useBones: boolean; + _preActivate(): void; + _activate(renderId: number): void; + getWorldMatrix(): Matrix; + worldMatrixFromCache: Matrix; + absolutePosition: Vector3; + freezeWorldMatrix(): void; + unfreezeWorldMatrix(): void; + isWorldMatrixFrozen: boolean; + rotate(axis: Vector3, amount: number, space: Space): void; + translate(axis: Vector3, distance: number, space: Space): void; + getAbsolutePosition(): Vector3; + setAbsolutePosition(absolutePosition: Vector3): void; + /** + * Perform relative position change from the point of view of behind the front of the mesh. + * This is performed taking into account the meshes current rotation, so you do not have to care. + * Supports definition of mesh facing forward or backward. + * @param {number} amountRight + * @param {number} amountUp + * @param {number} amountForward + */ + movePOV(amountRight: number, amountUp: number, amountForward: number): void; + /** + * Calculate relative position change from the point of view of behind the front of the mesh. + * This is performed taking into account the meshes current rotation, so you do not have to care. + * Supports definition of mesh facing forward or backward. + * @param {number} amountRight + * @param {number} amountUp + * @param {number} amountForward + */ + calcMovePOV(amountRight: number, amountUp: number, amountForward: number): Vector3; + /** + * Perform relative rotation change from the point of view of behind the front of the mesh. + * Supports definition of mesh facing forward or backward. + * @param {number} flipBack + * @param {number} twirlClockwise + * @param {number} tiltRight + */ + rotatePOV(flipBack: number, twirlClockwise: number, tiltRight: number): void; + /** + * Calculate relative rotation change from the point of view of behind the front of the mesh. + * Supports definition of mesh facing forward or backward. + * @param {number} flipBack + * @param {number} twirlClockwise + * @param {number} tiltRight + */ + calcRotatePOV(flipBack: number, twirlClockwise: number, tiltRight: number): Vector3; + setPivotMatrix(matrix: Matrix): void; + getPivotMatrix(): Matrix; + _isSynchronized(): boolean; + _initCache(): void; + markAsDirty(property: string): void; + _updateBoundingInfo(): void; + _updateSubMeshesBoundingInfo(matrix: Matrix): void; + computeWorldMatrix(force?: boolean): Matrix; + /** + * If you'd like to be callbacked after the mesh position, rotation or scaling has been updated + * @param func: callback function to add + */ + registerAfterWorldMatrixUpdate(func: (mesh: AbstractMesh) => void): void; + unregisterAfterWorldMatrixUpdate(func: (mesh: AbstractMesh) => void): void; + setPositionWithLocalVector(vector3: Vector3): void; + getPositionExpressedInLocalSpace(): Vector3; + locallyTranslate(vector3: Vector3): void; + lookAt(targetPoint: Vector3, yawCor: number, pitchCor: number, rollCor: number): void; + attachToBone(bone: Bone, affectedMesh: AbstractMesh): void; + detachFromBone(): void; + isInFrustum(frustumPlanes: Plane[]): boolean; + isCompletelyInFrustum(camera?: Camera): boolean; + intersectsMesh(mesh: AbstractMesh, precise?: boolean): boolean; + intersectsPoint(point: Vector3): boolean; + setPhysicsState(impostor?: any, options?: PhysicsBodyCreationOptions): any; + getPhysicsImpostor(): number; + getPhysicsMass(): number; + getPhysicsFriction(): number; + getPhysicsRestitution(): number; + getPositionInCameraSpace(camera?: Camera): Vector3; + getDistanceToCamera(camera?: Camera): number; + applyImpulse(force: Vector3, contactPoint: Vector3): void; + setPhysicsLinkWith(otherMesh: Mesh, pivot1: Vector3, pivot2: Vector3, options?: any): void; + updatePhysicsBodyPosition(): void; + checkCollisions: boolean; + moveWithCollisions(velocity: Vector3): void; + private _onCollisionPositionChange; + /** + * This function will create an octree to help select the right submeshes for rendering, picking and collisions + * Please note that you must have a decent number of submeshes to get performance improvements when using octree + */ + createOrUpdateSubmeshesOctree(maxCapacity?: number, maxDepth?: number): Octree; + _collideForSubMesh(subMesh: SubMesh, transformMatrix: Matrix, collider: Collider): void; + _processCollisionsForSubMeshes(collider: Collider, transformMatrix: Matrix): void; + _checkCollision(collider: Collider): void; + _generatePointsArray(): boolean; + intersects(ray: Ray, fastCheck?: boolean): PickingInfo; + clone(name: string, newParent: Node, doNotCloneChildren?: boolean): AbstractMesh; + releaseSubMeshes(): void; + dispose(doNotRecurse?: boolean): void; + } +} + +declare module BABYLON { + class CSG { + private polygons; + matrix: Matrix; + position: Vector3; + rotation: Vector3; + rotationQuaternion: Quaternion; + scaling: Vector3; + static FromMesh(mesh: Mesh): CSG; + private static FromPolygons(polygons); + clone(): CSG; + private toPolygons(); + union(csg: CSG): CSG; + unionInPlace(csg: CSG): void; + subtract(csg: CSG): CSG; + subtractInPlace(csg: CSG): void; + intersect(csg: CSG): CSG; + intersectInPlace(csg: CSG): void; + inverse(): CSG; + inverseInPlace(): void; + copyTransformAttributes(csg: CSG): CSG; + buildMeshGeometry(name: string, scene: Scene, keepSubMeshes: boolean): Mesh; + toMesh(name: string, material: Material, scene: Scene, keepSubMeshes: boolean): Mesh; + } +} + +declare module BABYLON { + class Geometry implements IGetSetVerticesData { + id: string; + delayLoadState: number; + delayLoadingFile: string; + onGeometryUpdated: (geometry: Geometry, kind?: string) => void; + private _scene; + private _engine; + private _meshes; + private _totalVertices; + private _indices; + private _vertexBuffers; + private _isDisposed; + _delayInfo: any; + private _indexBuffer; + _boundingInfo: BoundingInfo; + _delayLoadingFunction: (any: any, geometry: Geometry) => void; + constructor(id: string, scene: Scene, vertexData?: VertexData, updatable?: boolean, mesh?: Mesh); + getScene(): Scene; + getEngine(): Engine; + isReady(): boolean; + setAllVerticesData(vertexData: VertexData, updatable?: boolean): void; + setVerticesData(kind: string, data: number[], updatable?: boolean, stride?: number): void; + updateVerticesDataDirectly(kind: string, data: Float32Array, offset: number): void; + updateVerticesData(kind: string, data: number[], updateExtends?: boolean): void; + getTotalVertices(): number; + getVerticesData(kind: string, copyWhenShared?: boolean): number[]; + getVertexBuffer(kind: string): VertexBuffer; + getVertexBuffers(): VertexBuffer[]; + isVerticesDataPresent(kind: string): boolean; + getVerticesDataKinds(): string[]; + setIndices(indices: number[], totalVertices?: number): void; + getTotalIndices(): number; + getIndices(copyWhenShared?: boolean): number[]; + getIndexBuffer(): any; + releaseForMesh(mesh: Mesh, shouldDispose?: boolean): void; + applyToMesh(mesh: Mesh): void; + private _applyToMesh(mesh); + private notifyUpdate(kind?); + load(scene: Scene, onLoaded?: () => void): void; + isDisposed(): boolean; + dispose(): void; + copy(id: string): Geometry; + static ExtractFromMesh(mesh: Mesh, id: string): Geometry; + static RandomId(): string; + } + module Geometry.Primitives { + class _Primitive extends Geometry { + private _beingRegenerated; + private _canBeRegenerated; + constructor(id: string, scene: Scene, vertexData?: VertexData, canBeRegenerated?: boolean, mesh?: Mesh); + canBeRegenerated(): boolean; + regenerate(): void; + asNewGeometry(id: string): Geometry; + setAllVerticesData(vertexData: VertexData, updatable?: boolean): void; + setVerticesData(kind: string, data: number[], updatable?: boolean): void; + _regenerateVertexData(): VertexData; + copy(id: string): Geometry; + } + class Ribbon extends _Primitive { + pathArray: Vector3[][]; + closeArray: boolean; + closePath: boolean; + offset: number; + side: number; + constructor(id: string, scene: Scene, pathArray: Vector3[][], closeArray: boolean, closePath: boolean, offset: number, canBeRegenerated?: boolean, mesh?: Mesh, side?: number); + _regenerateVertexData(): VertexData; + copy(id: string): Geometry; + } + class Box extends _Primitive { + size: number; + side: number; + constructor(id: string, scene: Scene, size: number, canBeRegenerated?: boolean, mesh?: Mesh, side?: number); + _regenerateVertexData(): VertexData; + copy(id: string): Geometry; + } + class Sphere extends _Primitive { + segments: number; + diameter: number; + side: number; + constructor(id: string, scene: Scene, segments: number, diameter: number, canBeRegenerated?: boolean, mesh?: Mesh, side?: number); + _regenerateVertexData(): VertexData; + copy(id: string): Geometry; + } + class Cylinder extends _Primitive { + height: number; + diameterTop: number; + diameterBottom: number; + tessellation: number; + subdivisions: number; + side: number; + constructor(id: string, scene: Scene, height: number, diameterTop: number, diameterBottom: number, tessellation: number, subdivisions?: number, canBeRegenerated?: boolean, mesh?: Mesh, side?: number); + _regenerateVertexData(): VertexData; + copy(id: string): Geometry; + } + class Torus extends _Primitive { + diameter: number; + thickness: number; + tessellation: number; + side: number; + constructor(id: string, scene: Scene, diameter: number, thickness: number, tessellation: number, canBeRegenerated?: boolean, mesh?: Mesh, side?: number); + _regenerateVertexData(): VertexData; + copy(id: string): Geometry; + } + class Ground extends _Primitive { + width: number; + height: number; + subdivisions: number; + constructor(id: string, scene: Scene, width: number, height: number, subdivisions: number, canBeRegenerated?: boolean, mesh?: Mesh); + _regenerateVertexData(): VertexData; + copy(id: string): Geometry; + } + class TiledGround extends _Primitive { + xmin: number; + zmin: number; + xmax: number; + zmax: number; + subdivisions: { + w: number; + h: number; + }; + precision: { + w: number; + h: number; + }; + constructor(id: string, scene: Scene, xmin: number, zmin: number, xmax: number, zmax: number, subdivisions: { + w: number; + h: number; + }, precision: { + w: number; + h: number; + }, canBeRegenerated?: boolean, mesh?: Mesh); + _regenerateVertexData(): VertexData; + copy(id: string): Geometry; + } + class Plane extends _Primitive { + size: number; + side: number; + constructor(id: string, scene: Scene, size: number, canBeRegenerated?: boolean, mesh?: Mesh, side?: number); + _regenerateVertexData(): VertexData; + copy(id: string): Geometry; + } + class TorusKnot extends _Primitive { + radius: number; + tube: number; + radialSegments: number; + tubularSegments: number; + p: number; + q: number; + side: number; + constructor(id: string, scene: Scene, radius: number, tube: number, radialSegments: number, tubularSegments: number, p: number, q: number, canBeRegenerated?: boolean, mesh?: Mesh, side?: number); + _regenerateVertexData(): VertexData; + copy(id: string): Geometry; + } + } +} + +declare module BABYLON { + class GroundMesh extends Mesh { + generateOctree: boolean; + private _worldInverse; + _subdivisions: number; + constructor(name: string, scene: Scene); + subdivisions: number; + optimize(chunksCount: number, octreeBlocksSize?: number): void; + getHeightAtCoordinates(x: number, z: number): number; + } +} + +declare module BABYLON { + /** + * Creates an instance based on a source mesh. + */ + class InstancedMesh extends AbstractMesh { + private _sourceMesh; + private _currentLOD; + constructor(name: string, source: Mesh); + receiveShadows: boolean; + material: Material; + visibility: number; + skeleton: Skeleton; + getTotalVertices(): number; + sourceMesh: Mesh; + getVerticesData(kind: string): number[]; + isVerticesDataPresent(kind: string): boolean; + getIndices(): number[]; + _positions: Vector3[]; + refreshBoundingInfo(): void; + _preActivate(): void; + _activate(renderId: number): void; + getLOD(camera: Camera): AbstractMesh; + _syncSubMeshes(): void; + _generatePointsArray(): boolean; + clone(name: string, newParent: Node, doNotCloneChildren?: boolean): InstancedMesh; + dispose(doNotRecurse?: boolean): void; + } +} + +declare module BABYLON { + class LinesMesh extends Mesh { + color: Color3; + alpha: number; + private _colorShader; + constructor(name: string, scene: Scene, parent?: Node, source?: Mesh, doNotCloneChildren?: boolean); + material: Material; + isPickable: boolean; + checkCollisions: boolean; + _bind(subMesh: SubMesh, effect: Effect, fillMode: number): void; + _draw(subMesh: SubMesh, fillMode: number, instancesCount?: number): void; + intersects(ray: Ray, fastCheck?: boolean): any; + dispose(doNotRecurse?: boolean): void; + clone(name: string, newParent?: Node, doNotCloneChildren?: boolean): LinesMesh; + } +} + +declare module BABYLON { + class _InstancesBatch { + mustReturn: boolean; + visibleInstances: InstancedMesh[][]; + renderSelf: boolean[]; + } + class Mesh extends AbstractMesh implements IGetSetVerticesData { + static _FRONTSIDE: number; + static _BACKSIDE: number; + static _DOUBLESIDE: number; + static _DEFAULTSIDE: number; + static _NO_CAP: number; + static _CAP_START: number; + static _CAP_END: number; + static _CAP_ALL: number; + static FRONTSIDE: number; + static BACKSIDE: number; + static DOUBLESIDE: number; + static DEFAULTSIDE: number; + static NO_CAP: number; + static CAP_START: number; + static CAP_END: number; + static CAP_ALL: number; + delayLoadState: number; + instances: InstancedMesh[]; + delayLoadingFile: string; + _binaryInfo: any; + private _LODLevels; + onLODLevelSelection: (distance: number, mesh: Mesh, selectedLevel: Mesh) => void; + _geometry: Geometry; + private _onBeforeRenderCallbacks; + private _onAfterRenderCallbacks; + _delayInfo: any; + _delayLoadingFunction: (any: any, mesh: Mesh) => void; + _visibleInstances: any; + private _renderIdForInstances; + private _batchCache; + private _worldMatricesInstancesBuffer; + private _worldMatricesInstancesArray; + private _instancesBufferSize; + _shouldGenerateFlatShading: boolean; + private _preActivateId; + private _sideOrientation; + private _areNormalsFrozen; + private _sourcePositions; + private _sourceNormals; + /** + * @constructor + * @param {string} name - The value used by scene.getMeshByName() to do a lookup. + * @param {Scene} scene - The scene to add this mesh to. + * @param {Node} parent - The parent of this mesh, if it has one + * @param {Mesh} source - An optional Mesh from which geometry is shared, cloned. + * @param {boolean} doNotCloneChildren - When cloning, skip cloning child meshes of source, default False. + * When false, achieved by calling a clone(), also passing False. + * This will make creation of children, recursive. + */ + constructor(name: string, scene: Scene, parent?: Node, source?: Mesh, doNotCloneChildren?: boolean); + hasLODLevels: boolean; + private _sortLODLevels(); + /** + * Add a mesh as LOD level triggered at the given distance. + * @param {number} distance - the distance from the center of the object to show this level + * @param {BABYLON.Mesh} mesh - the mesh to be added as LOD level + * @return {BABYLON.Mesh} this mesh (for chaining) + */ + addLODLevel(distance: number, mesh: Mesh): Mesh; + getLODLevelAtDistance(distance: number): Mesh; + /** + * Remove a mesh from the LOD array + * @param {BABYLON.Mesh} mesh - the mesh to be removed. + * @return {BABYLON.Mesh} this mesh (for chaining) + */ + removeLODLevel(mesh: Mesh): Mesh; + getLOD(camera: Camera, boundingSphere?: BoundingSphere): AbstractMesh; + geometry: Geometry; + getTotalVertices(): number; + getVerticesData(kind: string, copyWhenShared?: boolean): number[]; + getVertexBuffer(kind: any): VertexBuffer; + isVerticesDataPresent(kind: string): boolean; + getVerticesDataKinds(): string[]; + getTotalIndices(): number; + getIndices(copyWhenShared?: boolean): number[]; + isBlocked: boolean; + isReady(): boolean; + isDisposed(): boolean; + sideOrientation: number; + areNormalsFrozen: boolean; + /** This function affects parametric shapes on update only : ribbons, tubes, etc. It has no effect at all on other shapes */ + freezeNormals(): void; + /** This function affects parametric shapes on update only : ribbons, tubes, etc. It has no effect at all on other shapes */ + unfreezeNormals(): void; + _preActivate(): void; + _registerInstanceForRenderId(instance: InstancedMesh, renderId: number): void; + refreshBoundingInfo(): void; + _createGlobalSubMesh(): SubMesh; + subdivide(count: number): void; + setVerticesData(kind: any, data: any, updatable?: boolean, stride?: number): void; + updateVerticesData(kind: string, data: number[], updateExtends?: boolean, makeItUnique?: boolean): void; + updateVerticesDataDirectly(kind: string, data: Float32Array, offset?: number, makeItUnique?: boolean): void; + updateMeshPositions(positionFunction: any, computeNormals?: boolean): void; + makeGeometryUnique(): void; + setIndices(indices: number[], totalVertices?: number): void; + _bind(subMesh: SubMesh, effect: Effect, fillMode: number): void; + _draw(subMesh: SubMesh, fillMode: number, instancesCount?: number): void; + registerBeforeRender(func: (mesh: AbstractMesh) => void): void; + unregisterBeforeRender(func: (mesh: AbstractMesh) => void): void; + registerAfterRender(func: (mesh: AbstractMesh) => void): void; + unregisterAfterRender(func: (mesh: AbstractMesh) => void): void; + _getInstancesRenderList(subMeshId: number): _InstancesBatch; + _renderWithInstances(subMesh: SubMesh, fillMode: number, batch: _InstancesBatch, effect: Effect, engine: Engine): void; + _processRendering(subMesh: SubMesh, effect: Effect, fillMode: number, batch: _InstancesBatch, hardwareInstancedRendering: boolean, onBeforeDraw: (isInstance: boolean, world: Matrix) => void): void; + render(subMesh: SubMesh, enableAlphaMode: boolean): void; + getEmittedParticleSystems(): ParticleSystem[]; + getHierarchyEmittedParticleSystems(): ParticleSystem[]; + getChildren(): Node[]; + _checkDelayState(): void; + isInFrustum(frustumPlanes: Plane[]): boolean; + setMaterialByID(id: string): void; + getAnimatables(): IAnimatable[]; + bakeTransformIntoVertices(transform: Matrix): void; + bakeCurrentTransformIntoVertices(): void; + _resetPointsArrayCache(): void; + _generatePointsArray(): boolean; + clone(name: string, newParent?: Node, doNotCloneChildren?: boolean): Mesh; + dispose(doNotRecurse?: boolean): void; + applyDisplacementMap(url: string, minHeight: number, maxHeight: number, onSuccess?: (mesh: Mesh) => void): void; + applyDisplacementMapFromBuffer(buffer: Uint8Array, heightMapWidth: number, heightMapHeight: number, minHeight: number, maxHeight: number): void; + convertToFlatShadedMesh(): void; + flipFaces(flipNormals?: boolean): void; + createInstance(name: string): InstancedMesh; + synchronizeInstances(): void; + /** + * Simplify the mesh according to the given array of settings. + * Function will return immediately and will simplify async. + * @param settings a collection of simplification settings. + * @param parallelProcessing should all levels calculate parallel or one after the other. + * @param type the type of simplification to run. + * @param successCallback optional success callback to be called after the simplification finished processing all settings. + */ + simplify(settings: Array, parallelProcessing?: boolean, simplificationType?: SimplificationType, successCallback?: (mesh?: Mesh, submeshIndex?: number) => void): void; + /** + * Optimization of the mesh's indices, in case a mesh has duplicated vertices. + * The function will only reorder the indices and will not remove unused vertices to avoid problems with submeshes. + * This should be used together with the simplification to avoid disappearing triangles. + * @param successCallback an optional success callback to be called after the optimization finished. + */ + optimizeIndices(successCallback?: (mesh?: Mesh) => void): void; + static CreateRibbon(name: string, pathArray: Vector3[][], closeArray: boolean, closePath: boolean, offset: number, scene: Scene, updatable?: boolean, sideOrientation?: number, ribbonInstance?: Mesh): Mesh; + static CreateDisc(name: string, radius: number, tessellation: number, scene: Scene, updatable?: boolean, sideOrientation?: number): Mesh; + static CreateBox(name: string, size: number, scene: Scene, updatable?: boolean, sideOrientation?: number): Mesh; + static CreateBox(name: string, options: { + width?: number; + height?: number; + depth?: number; + faceUV?: Vector4[]; + faceColors?: Color4[]; + sideOrientation?: number; + updatable?: boolean; + }, scene: Scene): Mesh; + static CreateSphere(name: string, segments: number, diameter: number, scene?: Scene, updatable?: boolean, sideOrientation?: number): Mesh; + static CreateSphere(name: string, options: { + segments?: number; + diameterX?: number; + diameterY?: number; + diameterZ?: number; + sideOrientation?: number; + updatable?: boolean; + }, scene: any): Mesh; + static CreateCylinder(name: string, height: number, diameterTop: number, diameterBottom: number, tessellation: number, subdivisions: any, scene: Scene, updatable?: any, sideOrientation?: number): Mesh; + static CreateTorus(name: string, diameter: number, thickness: number, tessellation: number, scene: Scene, updatable?: boolean, sideOrientation?: number): Mesh; + static CreateTorusKnot(name: string, radius: number, tube: number, radialSegments: number, tubularSegments: number, p: number, q: number, scene: Scene, updatable?: boolean, sideOrientation?: number): Mesh; + static CreateLines(name: string, points: Vector3[], scene: Scene, updatable?: boolean, linesInstance?: LinesMesh): LinesMesh; + static CreateDashedLines(name: string, points: Vector3[], dashSize: number, gapSize: number, dashNb: number, scene: Scene, updatable?: boolean, linesInstance?: LinesMesh): LinesMesh; + static ExtrudeShape(name: string, shape: Vector3[], path: Vector3[], scale: number, rotation: number, cap: number, scene: Scene, updatable?: boolean, sideOrientation?: number, extrudedInstance?: Mesh): Mesh; + static ExtrudeShapeCustom(name: string, shape: Vector3[], path: Vector3[], scaleFunction: any, rotationFunction: any, ribbonCloseArray: boolean, ribbonClosePath: boolean, cap: number, scene: Scene, updatable?: boolean, sideOrientation?: number, extrudedInstance?: Mesh): Mesh; + private static _ExtrudeShapeGeneric(name, shape, curve, scale, rotation, scaleFunction, rotateFunction, rbCA, rbCP, cap, custom, scene, updtbl, side, instance); + static CreateLathe(name: string, shape: Vector3[], radius: number, tessellation: number, scene: Scene, updatable?: boolean, sideOrientation?: number): Mesh; + static CreatePlane(name: string, size: number, scene: Scene, updatable?: boolean, sideOrientation?: number): Mesh; + static CreatePlane(name: string, options: { + width?: number; + height?: number; + sideOrientation?: number; + updatable?: boolean; + }, scene: Scene): Mesh; + static CreateGround(name: string, width: number, height: number, subdivisions: number, scene: Scene, updatable?: boolean): Mesh; + static CreateGround(name: string, options: { + width?: number; + height?: number; + subdivisions?: number; + sideOrientation?: number; + updatable?: boolean; + }, scene: any): Mesh; + static CreateTiledGround(name: string, xmin: number, zmin: number, xmax: number, zmax: number, subdivisions: { + w: number; + h: number; + }, precision: { + w: number; + h: number; + }, scene: Scene, updatable?: boolean): Mesh; + static CreateGroundFromHeightMap(name: string, url: string, width: number, height: number, subdivisions: number, minHeight: number, maxHeight: number, scene: Scene, updatable?: boolean, onReady?: (mesh: GroundMesh) => void): GroundMesh; + static CreateTube(name: string, path: Vector3[], radius: number, tessellation: number, radiusFunction: { + (i: number, distance: number): number; + }, cap: number, scene: Scene, updatable?: boolean, sideOrientation?: number, tubeInstance?: Mesh): Mesh; + static CreateDecal(name: string, sourceMesh: AbstractMesh, position: Vector3, normal: Vector3, size: Vector3, angle?: number): Mesh; + /** + * Update the vertex buffers by applying transformation from the bones + * @param {skeleton} skeleton to apply + */ + applySkeleton(skeleton: Skeleton): Mesh; + static MinMax(meshes: AbstractMesh[]): { + min: Vector3; + max: Vector3; + }; + static Center(meshesOrMinMaxVector: any): Vector3; + /** + * Merge the array of meshes into a single mesh for performance reasons. + * @param {Array} meshes - The vertices source. They should all be of the same material. Entries can empty + * @param {boolean} disposeSource - When true (default), dispose of the vertices from the source meshes + * @param {boolean} allow32BitsIndices - When the sum of the vertices > 64k, this must be set to true. + * @param {Mesh} meshSubclass - When set, vertices inserted into this Mesh. Meshes can then be merged into a Mesh sub-class. + */ + static MergeMeshes(meshes: Array, disposeSource?: boolean, allow32BitsIndices?: boolean, meshSubclass?: Mesh): Mesh; + } +} + +declare module BABYLON { + interface IGetSetVerticesData { + isVerticesDataPresent(kind: string): boolean; + getVerticesData(kind: string, copyWhenShared?: boolean): number[]; + getIndices(copyWhenShared?: boolean): number[]; + setVerticesData(kind: string, data: number[], updatable?: boolean): void; + updateVerticesData(kind: string, data: number[], updateExtends?: boolean, makeItUnique?: boolean): void; + setIndices(indices: number[]): void; + } + class VertexData { + positions: number[]; + normals: number[]; + uvs: number[]; + uvs2: number[]; + uvs3: number[]; + uvs4: number[]; + uvs5: number[]; + uvs6: number[]; + colors: number[]; + matricesIndices: number[]; + matricesWeights: number[]; + indices: number[]; + set(data: number[], kind: string): void; + applyToMesh(mesh: Mesh, updatable?: boolean): void; + applyToGeometry(geometry: Geometry, updatable?: boolean): void; + updateMesh(mesh: Mesh, updateExtends?: boolean, makeItUnique?: boolean): void; + updateGeometry(geometry: Geometry, updateExtends?: boolean, makeItUnique?: boolean): void; + private _applyTo(meshOrGeometry, updatable?); + private _update(meshOrGeometry, updateExtends?, makeItUnique?); + transform(matrix: Matrix): void; + merge(other: VertexData): void; + static ExtractFromMesh(mesh: Mesh, copyWhenShared?: boolean): VertexData; + static ExtractFromGeometry(geometry: Geometry, copyWhenShared?: boolean): VertexData; + private static _ExtractFrom(meshOrGeometry, copyWhenShared?); + static CreateRibbon(pathArray: Vector3[][], closeArray: boolean, closePath: boolean, offset: number, sideOrientation?: number): VertexData; + static CreateBox(options: { + width?: number; + height?: number; + depth?: number; + faceUV?: Vector4[]; + faceColors?: Color4[]; + sideOrientation?: number; + }): VertexData; + static CreateBox(size: number, sideOrientation?: number): VertexData; + static CreateSphere(options: { + segments?: number; + diameterX?: number; + diameterY?: number; + diameterZ?: number; + sideOrientation?: number; + }): VertexData; + static CreateSphere(segments: number, diameter?: number, sideOrientation?: number): VertexData; + static CreateCylinder(height: number, diameterTop: number, diameterBottom: number, tessellation: number, subdivisions?: number, sideOrientation?: number): VertexData; + static CreateTorus(diameter: any, thickness: any, tessellation: any, sideOrientation?: number): VertexData; + static CreateLines(points: Vector3[]): VertexData; + static CreateDashedLines(points: Vector3[], dashSize: number, gapSize: number, dashNb: number): VertexData; + static CreateGround(options: { + width?: number; + height?: number; + subdivisions?: number; + sideOrientation?: number; + }): VertexData; + static CreateGround(width: number, height: number, subdivisions?: number): VertexData; + static CreateTiledGround(xmin: number, zmin: number, xmax: number, zmax: number, subdivisions?: { + w: number; + h: number; + }, precision?: { + w: number; + h: number; + }): VertexData; + static CreateGroundFromHeightMap(width: number, height: number, subdivisions: number, minHeight: number, maxHeight: number, buffer: Uint8Array, bufferWidth: number, bufferHeight: number): VertexData; + static CreatePlane(options: { + width?: number; + height?: number; + sideOrientation?: number; + }): VertexData; + static CreatePlane(size: number, sideOrientation?: number): VertexData; + static CreateDisc(radius: number, tessellation: number, sideOrientation?: number): VertexData; + static CreateTorusKnot(radius: number, tube: number, radialSegments: number, tubularSegments: number, p: number, q: number, sideOrientation?: number): VertexData; + /** + * @param {any} - positions (number[] or Float32Array) + * @param {any} - indices (number[] or Uint16Array) + * @param {any} - normals (number[] or Float32Array) + */ + static ComputeNormals(positions: any, indices: any, normals: any): void; + private static _ComputeSides(sideOrientation, positions, indices, normals, uvs); + } +} + +declare module BABYLON.Internals { + class MeshLODLevel { + distance: number; + mesh: Mesh; + constructor(distance: number, mesh: Mesh); + } +} + +declare module BABYLON { + /** + * A simplifier interface for future simplification implementations. + */ + interface ISimplifier { + /** + * Simplification of a given mesh according to the given settings. + * Since this requires computation, it is assumed that the function runs async. + * @param settings The settings of the simplification, including quality and distance + * @param successCallback A callback that will be called after the mesh was simplified. + * @param errorCallback in case of an error, this callback will be called. optional. + */ + simplify(settings: ISimplificationSettings, successCallback: (simplifiedMeshes: Mesh) => void, errorCallback?: () => void): void; + } + /** + * Expected simplification settings. + * Quality should be between 0 and 1 (1 being 100%, 0 being 0%); + */ + interface ISimplificationSettings { + quality: number; + distance: number; + optimizeMesh?: boolean; + } + class SimplificationSettings implements ISimplificationSettings { + quality: number; + distance: number; + optimizeMesh: boolean; + constructor(quality: number, distance: number, optimizeMesh?: boolean); + } + interface ISimplificationTask { + settings: Array; + simplificationType: SimplificationType; + mesh: Mesh; + successCallback?: () => void; + parallelProcessing: boolean; + } + class SimplificationQueue { + private _simplificationArray; + running: any; + constructor(); + addTask(task: ISimplificationTask): void; + executeNext(): void; + runSimplification(task: ISimplificationTask): void; + private getSimplifier(task); + } + /** + * The implemented types of simplification. + * At the moment only Quadratic Error Decimation is implemented. + */ + enum SimplificationType { + QUADRATIC = 0, + } + class DecimationTriangle { + vertices: Array; + normal: Vector3; + error: Array; + deleted: boolean; + isDirty: boolean; + borderFactor: number; + deletePending: boolean; + originalOffset: number; + constructor(vertices: Array); + } + class DecimationVertex { + position: Vector3; + id: any; + q: QuadraticMatrix; + isBorder: boolean; + triangleStart: number; + triangleCount: number; + originalOffsets: Array; + constructor(position: Vector3, id: any); + updatePosition(newPosition: Vector3): void; + } + class QuadraticMatrix { + data: Array; + constructor(data?: Array); + det(a11: any, a12: any, a13: any, a21: any, a22: any, a23: any, a31: any, a32: any, a33: any): number; + addInPlace(matrix: QuadraticMatrix): void; + addArrayInPlace(data: Array): void; + add(matrix: QuadraticMatrix): QuadraticMatrix; + static FromData(a: number, b: number, c: number, d: number): QuadraticMatrix; + static DataFromNumbers(a: number, b: number, c: number, d: number): number[]; + } + class Reference { + vertexId: number; + triangleId: number; + constructor(vertexId: number, triangleId: number); + } + /** + * An implementation of the Quadratic Error simplification algorithm. + * Original paper : http://www1.cs.columbia.edu/~cs4162/html05s/garland97.pdf + * Ported mostly from QSlim and http://voxels.blogspot.de/2014/05/quadric-mesh-simplification-with-source.html to babylon JS + * @author RaananW + */ + class QuadraticErrorSimplification implements ISimplifier { + private _mesh; + private triangles; + private vertices; + private references; + private initialized; + private _reconstructedMesh; + syncIterations: number; + aggressiveness: number; + decimationIterations: number; + boundingBoxEpsilon: number; + constructor(_mesh: Mesh); + simplify(settings: ISimplificationSettings, successCallback: (simplifiedMesh: Mesh) => void): void; + private isTriangleOnBoundingBox(triangle); + private runDecimation(settings, submeshIndex, successCallback); + private initWithMesh(submeshIndex, callback, optimizeMesh?); + private init(callback); + private reconstructMesh(submeshIndex); + private initDecimatedMesh(); + private isFlipped(vertex1, vertex2, point, deletedArray, borderFactor, delTr); + private updateTriangles(origVertex, vertex, deletedArray, deletedTriangles); + private identifyBorder(); + private updateMesh(identifyBorders?); + private vertexError(q, point); + private calculateError(vertex1, vertex2, pointResult?, normalResult?, uvResult?, colorResult?); + } +} + +declare module BABYLON { + class Polygon { + static Rectangle(xmin: number, ymin: number, xmax: number, ymax: number): Vector2[]; + static Circle(radius: number, cx?: number, cy?: number, numberOfSides?: number): Vector2[]; + static Parse(input: string): Vector2[]; + static StartingAt(x: number, y: number): Path2; + } + class PolygonMeshBuilder { + private _swctx; + private _points; + private _outlinepoints; + private _holes; + private _name; + private _scene; + constructor(name: string, contours: Path2, scene: Scene); + constructor(name: string, contours: Vector2[], scene: Scene); + addHole(hole: Vector2[]): PolygonMeshBuilder; + build(updatable?: boolean, depth?: number): Mesh; + private addSide(positions, normals, uvs, indices, bounds, points, depth, flip); + } +} + +declare module BABYLON { + class SubMesh { + materialIndex: number; + verticesStart: number; + verticesCount: number; + indexStart: any; + indexCount: number; + linesIndexCount: number; + private _mesh; + private _renderingMesh; + private _boundingInfo; + private _linesIndexBuffer; + _lastColliderWorldVertices: Vector3[]; + _trianglePlanes: Plane[]; + _lastColliderTransformMatrix: Matrix; + _renderId: number; + _alphaIndex: number; + _distanceToCamera: number; + _id: number; + constructor(materialIndex: number, verticesStart: number, verticesCount: number, indexStart: any, indexCount: number, mesh: AbstractMesh, renderingMesh?: Mesh, createBoundingBox?: boolean); + getBoundingInfo(): BoundingInfo; + getMesh(): AbstractMesh; + getRenderingMesh(): Mesh; + getMaterial(): Material; + refreshBoundingInfo(): void; + _checkCollision(collider: Collider): boolean; + updateBoundingInfo(world: Matrix): void; + isInFrustum(frustumPlanes: Plane[]): boolean; + render(enableAlphaMode: boolean): void; + getLinesIndexBuffer(indices: number[], engine: any): WebGLBuffer; + canIntersects(ray: Ray): boolean; + intersects(ray: Ray, positions: Vector3[], indices: number[], fastCheck?: boolean): IntersectionInfo; + clone(newMesh: AbstractMesh, newRenderingMesh?: Mesh): SubMesh; + dispose(): void; + static CreateFromIndices(materialIndex: number, startIndex: number, indexCount: number, mesh: AbstractMesh, renderingMesh?: Mesh): SubMesh; + } +} + +declare module BABYLON { + class VertexBuffer { + private _mesh; + private _engine; + private _buffer; + private _data; + private _updatable; + private _kind; + private _strideSize; + constructor(engine: any, data: number[], kind: string, updatable: boolean, postponeInternalCreation?: boolean, stride?: number); + isUpdatable(): boolean; + getData(): number[]; + getBuffer(): WebGLBuffer; + getStrideSize(): number; + create(data?: number[]): void; + update(data: number[]): void; + updateDirectly(data: Float32Array, offset: number): void; + dispose(): void; + private static _PositionKind; + private static _NormalKind; + private static _UVKind; + private static _UV2Kind; + private static _UV3Kind; + private static _UV4Kind; + private static _UV5Kind; + private static _UV6Kind; + private static _ColorKind; + private static _MatricesIndicesKind; + private static _MatricesWeightsKind; + static PositionKind: string; + static NormalKind: string; + static UVKind: string; + static UV2Kind: string; + static UV3Kind: string; + static UV4Kind: string; + static UV5Kind: string; + static UV6Kind: string; + static ColorKind: string; + static MatricesIndicesKind: string; + static MatricesWeightsKind: string; + } +} + +declare module BABYLON { + class Particle { + position: Vector3; + direction: Vector3; + color: Color4; + colorStep: Color4; + lifeTime: number; + age: number; + size: number; + angle: number; + angularSpeed: number; + copyTo(other: Particle): void; + } +} + +declare module BABYLON { + class ParticleSystem implements IDisposable { + name: string; + static BLENDMODE_ONEONE: number; + static BLENDMODE_STANDARD: number; + id: string; + renderingGroupId: number; + emitter: any; + emitRate: number; + manualEmitCount: number; + updateSpeed: number; + targetStopDuration: number; + disposeOnStop: boolean; + minEmitPower: number; + maxEmitPower: number; + minLifeTime: number; + maxLifeTime: number; + minSize: number; + maxSize: number; + minAngularSpeed: number; + maxAngularSpeed: number; + particleTexture: Texture; + layerMask: number; + onDispose: () => void; + updateFunction: (particles: Particle[]) => void; + blendMode: number; + forceDepthWrite: boolean; + gravity: Vector3; + direction1: Vector3; + direction2: Vector3; + minEmitBox: Vector3; + maxEmitBox: Vector3; + color1: Color4; + color2: Color4; + colorDead: Color4; + textureMask: Color4; + startDirectionFunction: (emitPower: number, worldMatrix: Matrix, directionToUpdate: Vector3) => void; + startPositionFunction: (worldMatrix: Matrix, positionToUpdate: Vector3) => void; + private particles; + private _capacity; + private _scene; + private _vertexDeclaration; + private _vertexStrideSize; + private _stockParticles; + private _newPartsExcess; + private _vertexBuffer; + private _indexBuffer; + private _vertices; + private _effect; + private _customEffect; + private _cachedDefines; + private _scaledColorStep; + private _colorDiff; + private _scaledDirection; + private _scaledGravity; + private _currentRenderId; + private _alive; + private _started; + private _stopped; + private _actualFrame; + private _scaledUpdateSpeed; + constructor(name: string, capacity: number, scene: Scene, customEffect?: Effect); + recycleParticle(particle: Particle): void; + getCapacity(): number; + isAlive(): boolean; + isStarted(): boolean; + start(): void; + stop(): void; + _appendParticleVertex(index: number, particle: Particle, offsetX: number, offsetY: number): void; + private _update(newParticles); + private _getEffect(); + animate(): void; + render(): number; + dispose(): void; + clone(name: string, newEmitter: any): ParticleSystem; + } +} + +declare module BABYLON { + interface IPhysicsEnginePlugin { + initialize(iterations?: number): any; + setGravity(gravity: Vector3): void; + runOneStep(delta: number): void; + registerMesh(mesh: AbstractMesh, impostor: number, options: PhysicsBodyCreationOptions): any; + registerMeshesAsCompound(parts: PhysicsCompoundBodyPart[], options: PhysicsBodyCreationOptions): any; + unregisterMesh(mesh: AbstractMesh): any; + applyImpulse(mesh: AbstractMesh, force: Vector3, contactPoint: Vector3): void; + createLink(mesh1: AbstractMesh, mesh2: AbstractMesh, pivot1: Vector3, pivot2: Vector3, options?: any): boolean; + dispose(): void; + isSupported(): boolean; + updateBodyPosition(mesh: AbstractMesh): void; + } + interface PhysicsBodyCreationOptions { + mass: number; + friction: number; + restitution: number; + } + interface PhysicsCompoundBodyPart { + mesh: Mesh; + impostor: number; + } + class PhysicsEngine { + gravity: Vector3; + private _currentPlugin; + constructor(plugin?: IPhysicsEnginePlugin); + _initialize(gravity?: Vector3): void; + _runOneStep(delta: number): void; + _setGravity(gravity: Vector3): void; + _registerMesh(mesh: AbstractMesh, impostor: number, options: PhysicsBodyCreationOptions): any; + _registerMeshesAsCompound(parts: PhysicsCompoundBodyPart[], options: PhysicsBodyCreationOptions): any; + _unregisterMesh(mesh: AbstractMesh): void; + _applyImpulse(mesh: AbstractMesh, force: Vector3, contactPoint: Vector3): void; + _createLink(mesh1: AbstractMesh, mesh2: AbstractMesh, pivot1: Vector3, pivot2: Vector3, options?: any): boolean; + _updateBodyPosition(mesh: AbstractMesh): void; + dispose(): void; + isSupported(): boolean; + static NoImpostor: number; + static SphereImpostor: number; + static BoxImpostor: number; + static PlaneImpostor: number; + static MeshImpostor: number; + static CapsuleImpostor: number; + static ConeImpostor: number; + static CylinderImpostor: number; + static ConvexHullImpostor: number; + static Epsilon: number; + } +} + +declare module BABYLON { + class BoundingBoxRenderer { + frontColor: Color3; + backColor: Color3; + showBackLines: boolean; + renderList: SmartArray; + private _scene; + private _colorShader; + private _vb; + private _ib; + constructor(scene: Scene); + private _prepareRessources(); + reset(): void; + render(): void; + dispose(): void; + } +} + +declare module BABYLON { + class DepthRenderer { + private _scene; + private _depthMap; + private _effect; + private _viewMatrix; + private _projectionMatrix; + private _transformMatrix; + private _worldViewProjection; + private _cachedDefines; + constructor(scene: Scene, type?: number); + isReady(subMesh: SubMesh, useInstances: boolean): boolean; + getDepthMap(): RenderTargetTexture; + dispose(): void; + } +} + +declare module BABYLON { + class EdgesRenderer { + private _source; + private _linesPositions; + private _linesNormals; + private _linesIndices; + private _epsilon; + private _indicesCount; + private _lineShader; + private _vb0; + private _vb1; + private _ib; + private _buffers; + private _checkVerticesInsteadOfIndices; + constructor(source: AbstractMesh, epsilon?: number, checkVerticesInsteadOfIndices?: boolean); + private _prepareRessources(); + dispose(): void; + private _processEdgeForAdjacencies(pa, pb, p0, p1, p2); + private _processEdgeForAdjacenciesWithVertices(pa, pb, p0, p1, p2); + private _checkEdge(faceIndex, edge, faceNormals, p0, p1); + _generateEdgesLines(): void; + render(): void; + } +} + +declare module BABYLON { + class OutlineRenderer { + private _scene; + private _effect; + private _cachedDefines; + constructor(scene: Scene); + render(subMesh: SubMesh, batch: _InstancesBatch, useOverlay?: boolean): void; + isReady(subMesh: SubMesh, useInstances: boolean): boolean; + } +} + +declare module BABYLON { + class RenderingGroup { + index: number; + private _scene; + private _opaqueSubMeshes; + private _transparentSubMeshes; + private _alphaTestSubMeshes; + private _activeVertices; + constructor(index: number, scene: Scene); + render(customRenderFunction: (opaqueSubMeshes: SmartArray, transparentSubMeshes: SmartArray, alphaTestSubMeshes: SmartArray) => void): boolean; + prepare(): void; + dispatch(subMesh: SubMesh): void; + } +} + +declare module BABYLON { + class RenderingManager { + static MAX_RENDERINGGROUPS: number; + private _scene; + private _renderingGroups; + private _depthBufferAlreadyCleaned; + constructor(scene: Scene); + private _renderParticles(index, activeMeshes); + private _renderSprites(index); + private _clearDepthBuffer(); + render(customRenderFunction: (opaqueSubMeshes: SmartArray, transparentSubMeshes: SmartArray, alphaTestSubMeshes: SmartArray) => void, activeMeshes: AbstractMesh[], renderParticles: boolean, renderSprites: boolean): void; + reset(): void; + dispatch(subMesh: SubMesh): void; + } +} + +declare module BABYLON { + class AnaglyphPostProcess extends PostProcess { + constructor(name: string, ratio: number, camera: Camera, samplingMode?: number, engine?: Engine, reusable?: boolean); + } +} + +declare module BABYLON { + class BlackAndWhitePostProcess extends PostProcess { + constructor(name: string, ratio: number, camera: Camera, samplingMode?: number, engine?: Engine, reusable?: boolean); + } +} + +declare module BABYLON { + class BlurPostProcess extends PostProcess { + direction: Vector2; + blurWidth: number; + constructor(name: string, direction: Vector2, blurWidth: number, ratio: number, camera: Camera, samplingMode?: number, engine?: Engine, reusable?: boolean); + } +} + +declare module BABYLON { + class ColorCorrectionPostProcess extends PostProcess { + private _colorTableTexture; + constructor(name: string, colorTableUrl: string, ratio: number, camera: Camera, samplingMode?: number, engine?: Engine, reusable?: boolean); + } +} + +declare module BABYLON { + class ConvolutionPostProcess extends PostProcess { + kernel: number[]; + constructor(name: string, kernel: number[], ratio: number, camera: Camera, samplingMode?: number, engine?: Engine, reusable?: boolean); + static EdgeDetect0Kernel: number[]; + static EdgeDetect1Kernel: number[]; + static EdgeDetect2Kernel: number[]; + static SharpenKernel: number[]; + static EmbossKernel: number[]; + static GaussianKernel: number[]; + } +} + +declare module BABYLON { + class DisplayPassPostProcess extends PostProcess { + constructor(name: string, ratio: number, camera: Camera, samplingMode?: number, engine?: Engine, reusable?: boolean); + } +} + +declare module BABYLON { + class FilterPostProcess extends PostProcess { + kernelMatrix: Matrix; + constructor(name: string, kernelMatrix: Matrix, ratio: number, camera?: Camera, samplingMode?: number, engine?: Engine, reusable?: boolean); + } +} + +declare module BABYLON { + class FxaaPostProcess extends PostProcess { + texelWidth: number; + texelHeight: number; + constructor(name: string, ratio: number, camera: Camera, samplingMode?: number, engine?: Engine, reusable?: boolean); + } +} + +declare module BABYLON { + class HDRRenderingPipeline extends PostProcessRenderPipeline implements IDisposable { + /** + * Public members + */ + /** + * Gaussian blur coefficient + * @type {number} + */ + gaussCoeff: number; + /** + * Gaussian blur mean + * @type {number} + */ + gaussMean: number; + /** + * Gaussian blur standard deviation + * @type {number} + */ + gaussStandDev: number; + /** + * Exposure, controls the overall intensity of the pipeline + * @type {number} + */ + exposure: number; + /** + * Minimum luminance that the post-process can output. Luminance is >= 0 + * @type {number} + */ + minimumLuminance: number; + /** + * Maximum luminance that the post-process can output. Must be suprerior to minimumLuminance + * @type {number} + */ + maximumLuminance: number; + /** + * Increase rate for luminance: eye adaptation speed to dark + * @type {number} + */ + luminanceIncreaserate: number; + /** + * Decrease rate for luminance: eye adaptation speed to bright + * @type {number} + */ + luminanceDecreaseRate: number; + /** + * Minimum luminance needed to compute HDR + * @type {number} + */ + brightThreshold: number; + /** + * Private members + */ + private _guassianBlurHPostProcess; + private _guassianBlurVPostProcess; + private _brightPassPostProcess; + private _textureAdderPostProcess; + private _downSampleX4PostProcess; + private _originalPostProcess; + private _hdrPostProcess; + private _hdrCurrentLuminance; + private _hdrOutputLuminance; + static LUM_STEPS: number; + private _downSamplePostProcesses; + private _scene; + private _needUpdate; + /** + * @constructor + * @param {string} name - The rendering pipeline name + * @param {BABYLON.Scene} scene - The scene linked to this pipeline + * @param {any} ratio - The size of the postprocesses (0.5 means that your postprocess will have a width = canvas.width 0.5 and a height = canvas.height 0.5) + * @param {BABYLON.PostProcess} originalPostProcess - the custom original color post-process. Must be "reusable". Can be null. + * @param {BABYLON.Camera[]} cameras - The array of cameras that the rendering pipeline will be attached to + */ + constructor(name: string, scene: Scene, ratio: number, originalPostProcess?: PostProcess, cameras?: Camera[]); + /** + * Tells the pipeline to update its post-processes + */ + update(): void; + /** + * Returns the current calculated luminance + */ + getCurrentLuminance(): number; + /** + * Returns the currently drawn luminance + */ + getOutputLuminance(): number; + /** + * Releases the rendering pipeline and its internal effects. Detaches pipeline from cameras + */ + dispose(): void; + /** + * Creates the HDR post-process and computes the luminance adaptation + */ + private _createHDRPostProcess(scene, ratio); + /** + * Texture Adder post-process + */ + private _createTextureAdderPostProcess(scene, ratio); + /** + * Down sample X4 post-process + */ + private _createDownSampleX4PostProcess(scene, ratio); + /** + * Bright pass post-process + */ + private _createBrightPassPostProcess(scene, ratio); + /** + * Luminance generator. Creates the luminance post-process and down sample post-processes + */ + private _createLuminanceGeneratorPostProcess(scene); + /** + * Gaussian blur post-processes. Horizontal and Vertical + */ + private _createGaussianBlurPostProcess(scene, ratio); + } +} + +declare module BABYLON { + class LensRenderingPipeline extends PostProcessRenderPipeline { + /** + * The chromatic aberration PostProcess id in the pipeline + * @type {string} + */ + LensChromaticAberrationEffect: string; + /** + * The highlights enhancing PostProcess id in the pipeline + * @type {string} + */ + HighlightsEnhancingEffect: string; + /** + * The depth-of-field PostProcess id in the pipeline + * @type {string} + */ + LensDepthOfFieldEffect: string; + private _scene; + private _depthTexture; + private _grainTexture; + private _chromaticAberrationPostProcess; + private _highlightsPostProcess; + private _depthOfFieldPostProcess; + private _edgeBlur; + private _grainAmount; + private _chromaticAberration; + private _distortion; + private _highlightsGain; + private _highlightsThreshold; + private _dofDistance; + private _dofAperture; + private _dofDarken; + private _dofPentagon; + private _blurNoise; + /** + * @constructor + * + * Effect parameters are as follow: + * { + * chromatic_aberration: number; // from 0 to x (1 for realism) + * edge_blur: number; // from 0 to x (1 for realism) + * distortion: number; // from 0 to x (1 for realism) + * grain_amount: number; // from 0 to 1 + * grain_texture: BABYLON.Texture; // texture to use for grain effect; if unset, use random B&W noise + * dof_focus_distance: number; // depth-of-field: focus distance; unset to disable (disabled by default) + * dof_aperture: number; // depth-of-field: focus blur bias (default: 1) + * dof_darken: number; // depth-of-field: darken that which is out of focus (from 0 to 1, disabled by default) + * dof_pentagon: boolean; // depth-of-field: makes a pentagon-like "bokeh" effect + * dof_gain: number; // depth-of-field: highlights gain; unset to disable (disabled by default) + * dof_threshold: number; // depth-of-field: highlights threshold (default: 1) + * blur_noise: boolean; // add a little bit of noise to the blur (default: true) + * } + * Note: if an effect parameter is unset, effect is disabled + * + * @param {string} name - The rendering pipeline name + * @param {object} parameters - An object containing all parameters (see above) + * @param {BABYLON.Scene} scene - The scene linked to this pipeline + * @param {number} ratio - The size of the postprocesses (0.5 means that your postprocess will have a width = canvas.width 0.5 and a height = canvas.height 0.5) + * @param {BABYLON.Camera[]} cameras - The array of cameras that the rendering pipeline will be attached to + */ + constructor(name: string, parameters: any, scene: Scene, ratio?: number, cameras?: Camera[]); + setEdgeBlur(amount: number): void; + disableEdgeBlur(): void; + setGrainAmount(amount: number): void; + disableGrain(): void; + setChromaticAberration(amount: number): void; + disableChromaticAberration(): void; + setEdgeDistortion(amount: number): void; + disableEdgeDistortion(): void; + setFocusDistance(amount: number): void; + disableDepthOfField(): void; + setAperture(amount: number): void; + setDarkenOutOfFocus(amount: number): void; + enablePentagonBokeh(): void; + disablePentagonBokeh(): void; + enableNoiseBlur(): void; + disableNoiseBlur(): void; + setHighlightsGain(amount: number): void; + setHighlightsThreshold(amount: number): void; + disableHighlights(): void; + /** + * Removes the internal pipeline assets and detaches the pipeline from the scene cameras + */ + dispose(disableDepthRender?: boolean): void; + private _createChromaticAberrationPostProcess(ratio); + private _createHighlightsPostProcess(ratio); + private _createDepthOfFieldPostProcess(ratio); + private _createGrainTexture(); + } +} + +declare module BABYLON { + class PassPostProcess extends PostProcess { + constructor(name: string, ratio: number, camera: Camera, samplingMode?: number, engine?: Engine, reusable?: boolean); + } +} + +declare module BABYLON { + class PostProcess { + name: string; + onApply: (effect: Effect) => void; + onBeforeRender: (effect: Effect) => void; + onAfterRender: (effect: Effect) => void; + onSizeChanged: () => void; + onActivate: (camera: Camera) => void; + width: number; + height: number; + renderTargetSamplingMode: number; + clearColor: Color4; + private _camera; + private _scene; + private _engine; + private _renderRatio; + private _reusable; + private _textureType; + _textures: SmartArray; + _currentRenderTextureInd: number; + private _effect; + constructor(name: string, fragmentUrl: string, parameters: string[], samplers: string[], ratio: number | any, camera: Camera, samplingMode?: number, engine?: Engine, reusable?: boolean, defines?: string, textureType?: number); + isReusable(): boolean; + activate(camera: Camera, sourceTexture?: WebGLTexture): void; + apply(): Effect; + dispose(camera?: Camera): void; + } +} + +declare module BABYLON { + class PostProcessManager { + private _scene; + private _indexBuffer; + private _vertexDeclaration; + private _vertexStrideSize; + private _vertexBuffer; + constructor(scene: Scene); + private _prepareBuffers(); + _prepareFrame(sourceTexture?: WebGLTexture): boolean; + directRender(postProcesses: PostProcess[], targetTexture?: WebGLTexture): void; + _finalizeFrame(doNotPresent?: boolean, targetTexture?: WebGLTexture, postProcesses?: PostProcess[]): void; + dispose(): void; + } +} + +declare module BABYLON { + class RefractionPostProcess extends PostProcess { + color: Color3; + depth: number; + colorLevel: number; + private _refRexture; + constructor(name: string, refractionTextureUrl: string, color: Color3, depth: number, colorLevel: number, ratio: number, camera: Camera, samplingMode?: number, engine?: Engine, reusable?: boolean); + dispose(camera: Camera): void; + } +} + +declare module BABYLON { + class SSAORenderingPipeline extends PostProcessRenderPipeline { + /** + * The PassPostProcess id in the pipeline that contains the original scene color + * @type {string} + */ + SSAOOriginalSceneColorEffect: string; + /** + * The SSAO PostProcess id in the pipeline + * @type {string} + */ + SSAORenderEffect: string; + /** + * The horizontal blur PostProcess id in the pipeline + * @type {string} + */ + SSAOBlurHRenderEffect: string; + /** + * The vertical blur PostProcess id in the pipeline + * @type {string} + */ + SSAOBlurVRenderEffect: string; + /** + * The PostProcess id in the pipeline that combines the SSAO-Blur output with the original scene color (SSAOOriginalSceneColorEffect) + * @type {string} + */ + SSAOCombineRenderEffect: string; + /** + * The output strength of the SSAO post-process. Default value is 1.0. + * @type {number} + */ + totalStrength: number; + /** + * The radius around the analyzed pixel used by the SSAO post-process. Default value is 0.0002 + * @type {number} + */ + radius: number; + /** + * Related to fallOff, used to interpolate SSAO samples (first interpolate function input) based on the occlusion difference of each pixel + * Must not be equal to fallOff and superior to fallOff. + * Default value is 0.0075 + * @type {number} + */ + area: number; + /** + * Related to area, used to interpolate SSAO samples (second interpolate function input) based on the occlusion difference of each pixel + * Must not be equal to area and inferior to area. + * Default value is 0.0002 + * @type {number} + */ + fallOff: number; + private _scene; + private _depthTexture; + private _randomTexture; + private _originalColorPostProcess; + private _ssaoPostProcess; + private _blurHPostProcess; + private _blurVPostProcess; + private _ssaoCombinePostProcess; + private _firstUpdate; + /** + * @constructor + * @param {string} name - The rendering pipeline name + * @param {BABYLON.Scene} scene - The scene linked to this pipeline + * @param {any} ratio - The size of the postprocesses. Can be a number shared between passes or an object for more precision: { ssaoRatio: 0.5, combineRatio: 1.0 } + * @param {BABYLON.Camera[]} cameras - The array of cameras that the rendering pipeline will be attached to + */ + constructor(name: string, scene: Scene, ratio: any, cameras?: Camera[]); + /** + * Returns the horizontal blur PostProcess + * @return {BABYLON.BlurPostProcess} The horizontal blur post-process + */ + getBlurHPostProcess(): BlurPostProcess; + /** + * Returns the vertical blur PostProcess + * @return {BABYLON.BlurPostProcess} The vertical blur post-process + */ + getBlurVPostProcess(): BlurPostProcess; + /** + * Removes the internal pipeline assets and detatches the pipeline from the scene cameras + */ + dispose(disableDepthRender?: boolean): void; + private _createSSAOPostProcess(ratio); + private _createSSAOCombinePostProcess(ratio); + private _createRandomTexture(); + } +} + +declare module BABYLON { + class StereoscopicInterlacePostProcess extends PostProcess { + private _stepSize; + constructor(name: string, camB: Camera, postProcessA: PostProcess, isStereoscopicHoriz: boolean, samplingMode?: number); + } +} + +declare module BABYLON { + enum TonemappingOperator { + Hable = 0, + Reinhard = 1, + HejiDawson = 2, + Photographic = 3, + } + class TonemapPostProcess extends PostProcess { + private _operator; + private _exposureAdjustment; + constructor(name: string, operator: TonemappingOperator, exposureAdjustment: number, camera: Camera, samplingMode?: number, engine?: Engine, textureFormat?: number); + } +} + +declare module BABYLON { + class VolumetricLightScatteringPostProcess extends PostProcess { + private _volumetricLightScatteringPass; + private _volumetricLightScatteringRTT; + private _viewPort; + private _screenCoordinates; + private _cachedDefines; + private _customMeshPosition; + /** + * Set if the post-process should use a custom position for the light source (true) or the internal mesh position (false) + * @type {boolean} + */ + useCustomMeshPosition: boolean; + /** + * If the post-process should inverse the light scattering direction + * @type {boolean} + */ + invert: boolean; + /** + * The internal mesh used by the post-process + * @type {boolean} + */ + mesh: Mesh; + /** + * Set to true to use the diffuseColor instead of the diffuseTexture + * @type {boolean} + */ + useDiffuseColor: boolean; + /** + * Array containing the excluded meshes not rendered in the internal pass + */ + excludedMeshes: AbstractMesh[]; + /** + * Controls the overall intensity of the post-process + * @type {number} + */ + exposure: number; + /** + * Dissipates each sample's contribution in range [0, 1] + * @type {number} + */ + decay: number; + /** + * Controls the overall intensity of each sample + * @type {number} + */ + weight: number; + /** + * Controls the density of each sample + * @type {number} + */ + density: number; + /** + * @constructor + * @param {string} name - The post-process name + * @param {any} ratio - The size of the post-process and/or internal pass (0.5 means that your postprocess will have a width = canvas.width 0.5 and a height = canvas.height 0.5) + * @param {BABYLON.Camera} camera - The camera that the post-process will be attached to + * @param {BABYLON.Mesh} mesh - The mesh used to create the light scattering + * @param {number} samples - The post-process quality, default 100 + * @param {number} samplingMode - The post-process filtering mode + * @param {BABYLON.Engine} engine - The babylon engine + * @param {boolean} reusable - If the post-process is reusable + * @param {BABYLON.Scene} scene - The constructor needs a scene reference to initialize internal components. If "camera" is null (RenderPipelineà, "scene" must be provided + */ + constructor(name: string, ratio: any, camera: Camera, mesh?: Mesh, samples?: number, samplingMode?: number, engine?: Engine, reusable?: boolean, scene?: Scene); + isReady(subMesh: SubMesh, useInstances: boolean): boolean; + /** + * Sets the new light position for light scattering effect + * @param {BABYLON.Vector3} The new custom light position + */ + setCustomMeshPosition(position: Vector3): void; + /** + * Returns the light position for light scattering effect + * @return {BABYLON.Vector3} The custom light position + */ + getCustomMeshPosition(): Vector3; + /** + * Disposes the internal assets and detaches the post-process from the camera + */ + dispose(camera: Camera): void; + /** + * Returns the render target texture used by the post-process + * @return {BABYLON.RenderTargetTexture} The render target texture used by the post-process + */ + getPass(): RenderTargetTexture; + private _meshExcluded(mesh); + private _createPass(scene, ratio); + private _updateMeshScreenCoordinates(scene); + /** + * Creates a default mesh for the Volumeric Light Scattering post-process + * @param {string} The mesh name + * @param {BABYLON.Scene} The scene where to create the mesh + * @return {BABYLON.Mesh} the default mesh + */ + static CreateDefaultMesh(name: string, scene: Scene): Mesh; + } +} + +declare module BABYLON { + class VRDistortionCorrectionPostProcess extends PostProcess { + aspectRatio: number; + private _isRightEye; + private _distortionFactors; + private _postProcessScaleFactor; + private _lensCenterOffset; + private _scaleIn; + private _scaleFactor; + private _lensCenter; + constructor(name: string, camera: Camera, isRightEye: boolean, vrMetrics: VRCameraMetrics); + } +} + +declare module BABYLON { + class Sprite { + name: string; + position: Vector3; + color: Color4; + width: number; + height: number; + angle: number; + cellIndex: number; + invertU: number; + invertV: number; + disposeWhenFinishedAnimating: boolean; + animations: Animation[]; + private _animationStarted; + private _loopAnimation; + private _fromIndex; + private _toIndex; + private _delay; + private _direction; + private _frameCount; + private _manager; + private _time; + size: number; + constructor(name: string, manager: SpriteManager); + playAnimation(from: number, to: number, loop: boolean, delay: number): void; + stopAnimation(): void; + _animate(deltaTime: number): void; + dispose(): void; + } +} + +declare module BABYLON { + class SpriteManager { + name: string; + cellSize: number; + sprites: Sprite[]; + renderingGroupId: number; + layerMask: number; + onDispose: () => void; + fogEnabled: boolean; + private _capacity; + private _spriteTexture; + private _epsilon; + private _scene; + private _vertexDeclaration; + private _vertexStrideSize; + private _vertexBuffer; + private _indexBuffer; + private _vertices; + private _effectBase; + private _effectFog; + constructor(name: string, imgUrl: string, capacity: number, cellSize: number, scene: Scene, epsilon?: number, samplingMode?: number); + private _appendSpriteVertex(index, sprite, offsetX, offsetY, rowSize); + render(): void; + dispose(): void; + } +} + +declare module BABYLON.Internals { + class AndOrNotEvaluator { + static Eval(query: string, evaluateCallback: (val: any) => boolean): boolean; + private static _HandleParenthesisContent(parenthesisContent, evaluateCallback); + private static _SimplifyNegation(booleanString); + } +} + +declare module BABYLON { + interface IAssetTask { + onSuccess: (task: IAssetTask) => void; + onError: (task: IAssetTask) => void; + isCompleted: boolean; + run(scene: Scene, onSuccess: () => void, onError: () => void): any; + } + class MeshAssetTask implements IAssetTask { + name: string; + meshesNames: any; + rootUrl: string; + sceneFilename: string; + loadedMeshes: Array; + loadedParticleSystems: Array; + loadedSkeletons: Array; + onSuccess: (task: IAssetTask) => void; + onError: (task: IAssetTask) => void; + isCompleted: boolean; + constructor(name: string, meshesNames: any, rootUrl: string, sceneFilename: string); + run(scene: Scene, onSuccess: () => void, onError: () => void): void; + } + class TextFileAssetTask implements IAssetTask { + name: string; + url: string; + onSuccess: (task: IAssetTask) => void; + onError: (task: IAssetTask) => void; + isCompleted: boolean; + text: string; + constructor(name: string, url: string); + run(scene: Scene, onSuccess: () => void, onError: () => void): void; + } + class BinaryFileAssetTask implements IAssetTask { + name: string; + url: string; + onSuccess: (task: IAssetTask) => void; + onError: (task: IAssetTask) => void; + isCompleted: boolean; + data: ArrayBuffer; + constructor(name: string, url: string); + run(scene: Scene, onSuccess: () => void, onError: () => void): void; + } + class ImageAssetTask implements IAssetTask { + name: string; + url: string; + onSuccess: (task: IAssetTask) => void; + onError: (task: IAssetTask) => void; + isCompleted: boolean; + image: HTMLImageElement; + constructor(name: string, url: string); + run(scene: Scene, onSuccess: () => void, onError: () => void): void; + } + class TextureAssetTask implements IAssetTask { + name: string; + url: string; + noMipmap: boolean; + invertY: boolean; + samplingMode: number; + onSuccess: (task: IAssetTask) => void; + onError: (task: IAssetTask) => void; + isCompleted: boolean; + texture: Texture; + constructor(name: string, url: string, noMipmap?: boolean, invertY?: boolean, samplingMode?: number); + run(scene: Scene, onSuccess: () => void, onError: () => void): void; + } + class AssetsManager { + private _tasks; + private _scene; + private _waitingTasksCount; + onFinish: (tasks: IAssetTask[]) => void; + onTaskSuccess: (task: IAssetTask) => void; + onTaskError: (task: IAssetTask) => void; + useDefaultLoadingScreen: boolean; + constructor(scene: Scene); + addMeshTask(taskName: string, meshesNames: any, rootUrl: string, sceneFilename: string): IAssetTask; + addTextFileTask(taskName: string, url: string): IAssetTask; + addBinaryFileTask(taskName: string, url: string): IAssetTask; + addImageTask(taskName: string, url: string): IAssetTask; + addTextureTask(taskName: string, url: string, noMipmap?: boolean, invertY?: boolean, samplingMode?: number): IAssetTask; + private _decreaseWaitingTasksCount(); + private _runTask(task); + reset(): AssetsManager; + load(): AssetsManager; + } +} + +declare module BABYLON { + class Database { + private callbackManifestChecked; + private currentSceneUrl; + private db; + private enableSceneOffline; + private enableTexturesOffline; + private manifestVersionFound; + private mustUpdateRessources; + private hasReachedQuota; + private isSupported; + private idbFactory; + static IsUASupportingBlobStorage: boolean; + static IDBStorageEnabled: boolean; + constructor(urlToScene: string, callbackManifestChecked: (checked: boolean) => any); + static parseURL: (url: string) => string; + static ReturnFullUrlLocation: (url: string) => string; + checkManifestFile(): void; + openAsync(successCallback: any, errorCallback: any): void; + loadImageFromDB(url: string, image: HTMLImageElement): void; + private _loadImageFromDBAsync(url, image, notInDBCallback); + private _saveImageIntoDBAsync(url, image); + private _checkVersionFromDB(url, versionLoaded); + private _loadVersionFromDBAsync(url, callback, updateInDBCallback); + private _saveVersionIntoDBAsync(url, callback); + private loadFileFromDB(url, sceneLoaded, progressCallBack, errorCallback, useArrayBuffer?); + private _loadFileFromDBAsync(url, callback, notInDBCallback, useArrayBuffer?); + private _saveFileIntoDBAsync(url, callback, progressCallback, useArrayBuffer?); + } +} + +declare module BABYLON { + class FilesInput { + private _engine; + private _currentScene; + private _canvas; + private _sceneLoadedCallback; + private _progressCallback; + private _additionnalRenderLoopLogicCallback; + private _textureLoadingCallback; + private _startingProcessingFilesCallback; + private _elementToMonitor; + static FilesTextures: any[]; + static FilesToLoad: any[]; + private _sceneFileToLoad; + private _filesToLoad; + constructor(p_engine: Engine, p_scene: Scene, p_canvas: HTMLCanvasElement, p_sceneLoadedCallback: any, p_progressCallback: any, p_additionnalRenderLoopLogicCallback: any, p_textureLoadingCallback: any, p_startingProcessingFilesCallback: any); + monitorElementForDragNDrop(p_elementToMonitor: HTMLElement): void; + private renderFunction(); + private drag(e); + private drop(eventDrop); + loadFiles(event: any): void; + reload(): void; + } +} + +declare module BABYLON { + class Gamepads { + private babylonGamepads; + private oneGamepadConnected; + private isMonitoring; + private gamepadEventSupported; + private gamepadSupportAvailable; + private _callbackGamepadConnected; + private buttonADataURL; + private static gamepadDOMInfo; + constructor(ongamedpadconnected: (gamepad: Gamepad) => void); + private _insertGamepadDOMInstructions(); + private _insertGamepadDOMNotSupported(); + dispose(): void; + private _onGamepadConnected(evt); + private _addNewGamepad(gamepad); + private _onGamepadDisconnected(evt); + private _startMonitoringGamepads(); + private _stopMonitoringGamepads(); + private _checkGamepadsStatus(); + private _updateGamepadObjects(); + } + class StickValues { + x: any; + y: any; + constructor(x: any, y: any); + } + class Gamepad { + id: string; + index: number; + browserGamepad: any; + private _leftStick; + private _rightStick; + private _onleftstickchanged; + private _onrightstickchanged; + constructor(id: string, index: number, browserGamepad: any); + onleftstickchanged(callback: (values: StickValues) => void): void; + onrightstickchanged(callback: (values: StickValues) => void): void; + leftStick: StickValues; + rightStick: StickValues; + update(): void; + } + class GenericPad extends Gamepad { + id: string; + index: number; + gamepad: any; + private _buttons; + private _onbuttondown; + private _onbuttonup; + onbuttondown(callback: (buttonPressed: number) => void): void; + onbuttonup(callback: (buttonReleased: number) => void): void; + constructor(id: string, index: number, gamepad: any); + private _setButtonValue(newValue, currentValue, buttonIndex); + update(): void; + } + enum Xbox360Button { + A = 0, + B = 1, + X = 2, + Y = 3, + Start = 4, + Back = 5, + LB = 6, + RB = 7, + LeftStick = 8, + RightStick = 9, + } + enum Xbox360Dpad { + Up = 0, + Down = 1, + Left = 2, + Right = 3, + } + class Xbox360Pad extends Gamepad { + private _leftTrigger; + private _rightTrigger; + private _onlefttriggerchanged; + private _onrighttriggerchanged; + private _onbuttondown; + private _onbuttonup; + private _ondpaddown; + private _ondpadup; + private _buttonA; + private _buttonB; + private _buttonX; + private _buttonY; + private _buttonBack; + private _buttonStart; + private _buttonLB; + private _buttonRB; + private _buttonLeftStick; + private _buttonRightStick; + private _dPadUp; + private _dPadDown; + private _dPadLeft; + private _dPadRight; + onlefttriggerchanged(callback: (value: number) => void): void; + onrighttriggerchanged(callback: (value: number) => void): void; + leftTrigger: number; + rightTrigger: number; + onbuttondown(callback: (buttonPressed: Xbox360Button) => void): void; + onbuttonup(callback: (buttonReleased: Xbox360Button) => void): void; + ondpaddown(callback: (dPadPressed: Xbox360Dpad) => void): void; + ondpadup(callback: (dPadReleased: Xbox360Dpad) => void): void; + private _setButtonValue(newValue, currentValue, buttonType); + private _setDPadValue(newValue, currentValue, buttonType); + buttonA: number; + buttonB: number; + buttonX: number; + buttonY: number; + buttonStart: number; + buttonBack: number; + buttonLB: number; + buttonRB: number; + buttonLeftStick: number; + buttonRightStick: number; + dPadUp: number; + dPadDown: number; + dPadLeft: number; + dPadRight: number; + update(): void; + } +} +interface Navigator { + getGamepads(func?: any): any; + webkitGetGamepads(func?: any): any; + msGetGamepads(func?: any): any; + webkitGamepads(func?: any): any; +} + +declare module BABYLON { + class SceneOptimization { + priority: number; + apply: (scene: Scene) => boolean; + constructor(priority?: number); + } + class TextureOptimization extends SceneOptimization { + priority: number; + maximumSize: number; + constructor(priority?: number, maximumSize?: number); + apply: (scene: Scene) => boolean; + } + class HardwareScalingOptimization extends SceneOptimization { + priority: number; + maximumScale: number; + private _currentScale; + constructor(priority?: number, maximumScale?: number); + apply: (scene: Scene) => boolean; + } + class ShadowsOptimization extends SceneOptimization { + apply: (scene: Scene) => boolean; + } + class PostProcessesOptimization extends SceneOptimization { + apply: (scene: Scene) => boolean; + } + class LensFlaresOptimization extends SceneOptimization { + apply: (scene: Scene) => boolean; + } + class ParticlesOptimization extends SceneOptimization { + apply: (scene: Scene) => boolean; + } + class RenderTargetsOptimization extends SceneOptimization { + apply: (scene: Scene) => boolean; + } + class MergeMeshesOptimization extends SceneOptimization { + static _UpdateSelectionTree: boolean; + static UpdateSelectionTree: boolean; + private _canBeMerged; + apply: (scene: Scene, updateSelectionTree?: boolean) => boolean; + } + class SceneOptimizerOptions { + targetFrameRate: number; + trackerDuration: number; + optimizations: SceneOptimization[]; + constructor(targetFrameRate?: number, trackerDuration?: number); + static LowDegradationAllowed(targetFrameRate?: number): SceneOptimizerOptions; + static ModerateDegradationAllowed(targetFrameRate?: number): SceneOptimizerOptions; + static HighDegradationAllowed(targetFrameRate?: number): SceneOptimizerOptions; + } + class SceneOptimizer { + static _CheckCurrentState(scene: Scene, options: SceneOptimizerOptions, currentPriorityLevel: number, onSuccess?: () => void, onFailure?: () => void): void; + static OptimizeAsync(scene: Scene, options?: SceneOptimizerOptions, onSuccess?: () => void, onFailure?: () => void): void; + } +} + +declare module BABYLON { + class SceneSerializer { + static Serialize(scene: Scene): any; + static SerializeMesh(toSerialize: any, withParents?: boolean, withChildren?: boolean): any; + } +} + +declare module BABYLON { + class SmartArray { + data: Array; + length: number; + private _id; + private _duplicateId; + constructor(capacity: number); + push(value: any): void; + pushNoDuplicate(value: any): void; + sort(compareFn: any): void; + reset(): void; + concat(array: any): void; + concatWithNoDuplicate(array: any): void; + indexOf(value: any): number; + private static _GlobalId; + } +} + +declare module BABYLON { + class SmartCollection { + count: number; + items: any; + private _keys; + private _initialCapacity; + constructor(capacity?: number); + add(key: any, item: any): number; + remove(key: any): number; + removeItemOfIndex(index: number): number; + indexOf(key: any): number; + item(key: any): any; + getAllKeys(): any[]; + getKeyByIndex(index: number): any; + getItemByIndex(index: number): any; + empty(): void; + forEach(block: (item: any) => void): void; + } +} + +declare module BABYLON { + class Tags { + static EnableFor(obj: any): void; + static DisableFor(obj: any): void; + static HasTags(obj: any): boolean; + static GetTags(obj: any): any; + static AddTagsTo(obj: any, tagsString: string): void; + static _AddTagTo(obj: any, tag: string): void; + static RemoveTagsFrom(obj: any, tagsString: string): void; + static _RemoveTagFrom(obj: any, tag: string): void; + static MatchesQuery(obj: any, tagsQuery: string): boolean; + } +} + +declare module BABYLON.Internals { + interface DDSInfo { + width: number; + height: number; + mipmapCount: number; + isFourCC: boolean; + isRGB: boolean; + isLuminance: boolean; + isCube: boolean; + } + class DDSTools { + static GetDDSInfo(arrayBuffer: any): DDSInfo; + private static GetRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer); + private static GetRGBArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer); + private static GetLuminanceArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer); + static UploadDDSLevels(gl: WebGLRenderingContext, ext: any, arrayBuffer: any, info: DDSInfo, loadMipmaps: boolean, faces: number): void; + } +} + +declare module BABYLON.Internals { + class TGATools { + private static _TYPE_NO_DATA; + private static _TYPE_INDEXED; + private static _TYPE_RGB; + private static _TYPE_GREY; + private static _TYPE_RLE_INDEXED; + private static _TYPE_RLE_RGB; + private static _TYPE_RLE_GREY; + private static _ORIGIN_MASK; + private static _ORIGIN_SHIFT; + private static _ORIGIN_BL; + private static _ORIGIN_BR; + private static _ORIGIN_UL; + private static _ORIGIN_UR; + static GetTGAHeader(data: Uint8Array): any; + static UploadContent(gl: WebGLRenderingContext, data: Uint8Array): void; + static _getImageData8bits(header: any, palettes: Uint8Array, pixel_data: Uint8Array, y_start: number, y_step: number, y_end: number, x_start: number, x_step: number, x_end: number): Uint8Array; + static _getImageData16bits(header: any, palettes: Uint8Array, pixel_data: Uint8Array, y_start: number, y_step: number, y_end: number, x_start: number, x_step: number, x_end: number): Uint8Array; + static _getImageData24bits(header: any, palettes: Uint8Array, pixel_data: Uint8Array, y_start: number, y_step: number, y_end: number, x_start: number, x_step: number, x_end: number): Uint8Array; + static _getImageData32bits(header: any, palettes: Uint8Array, pixel_data: Uint8Array, y_start: number, y_step: number, y_end: number, x_start: number, x_step: number, x_end: number): Uint8Array; + static _getImageDataGrey8bits(header: any, palettes: Uint8Array, pixel_data: Uint8Array, y_start: number, y_step: number, y_end: number, x_start: number, x_step: number, x_end: number): Uint8Array; + static _getImageDataGrey16bits(header: any, palettes: Uint8Array, pixel_data: Uint8Array, y_start: number, y_step: number, y_end: number, x_start: number, x_step: number, x_end: number): Uint8Array; + } +} + +declare module BABYLON { + interface IAnimatable { + animations: Array; + } + interface ISize { + width: number; + height: number; + } + class Tools { + static BaseUrl: string; + static ToHex(i: number): string; + static SetImmediate(action: () => void): void; + static IsExponantOfTwo(value: number): boolean; + static GetExponantOfTwo(value: number, max: number): number; + static GetFilename(path: string): string; + static GetDOMTextContent(element: HTMLElement): string; + static ToDegrees(angle: number): number; + static ToRadians(angle: number): number; + static ExtractMinAndMaxIndexed(positions: number[], indices: number[], indexStart: number, indexCount: number): { + minimum: Vector3; + maximum: Vector3; + }; + static ExtractMinAndMax(positions: number[], start: number, count: number): { + minimum: Vector3; + maximum: Vector3; + }; + static MakeArray(obj: any, allowsNullUndefined?: boolean): Array; + static GetPointerPrefix(): string; + static QueueNewFrame(func: any): void; + static RequestFullscreen(element: any): void; + static ExitFullscreen(): void; + static CleanUrl(url: string): string; + static LoadImage(url: string, onload: any, onerror: any, database: any): HTMLImageElement; + static LoadFile(url: string, callback: (data: any) => void, progressCallBack?: () => void, database?: any, useArrayBuffer?: boolean, onError?: () => void): void; + static ReadFileAsDataURL(fileToLoad: any, callback: any, progressCallback: any): void; + static ReadFile(fileToLoad: any, callback: any, progressCallBack: any, useArrayBuffer?: boolean): void; + static Clamp(value: number, min?: number, max?: number): number; + static Sign(value: number): number; + static Format(value: number, decimals?: number): string; + static CheckExtends(v: Vector3, min: Vector3, max: Vector3): void; + static WithinEpsilon(a: number, b: number, epsilon?: number): boolean; + static DeepCopy(source: any, destination: any, doNotCopyList?: string[], mustCopyList?: string[]): void; + static IsEmpty(obj: any): boolean; + static RegisterTopRootEvents(events: { + name: string; + handler: EventListener; + }[]): void; + static UnregisterTopRootEvents(events: { + name: string; + handler: EventListener; + }[]): void; + static DumpFramebuffer(width: number, height: number, engine: Engine, successCallback?: (data: String) => void): void; + static CreateScreenshot(engine: Engine, camera: Camera, size: any, successCallback?: (data: String) => void): void; + static ValidateXHRData(xhr: XMLHttpRequest, dataType?: number): boolean; + private static _NoneLogLevel; + private static _MessageLogLevel; + private static _WarningLogLevel; + private static _ErrorLogLevel; + private static _LogCache; + static errorsCount: number; + static OnNewCacheEntry: (entry: string) => void; + static NoneLogLevel: number; + static MessageLogLevel: number; + static WarningLogLevel: number; + static ErrorLogLevel: number; + static AllLogLevel: number; + private static _AddLogEntry(entry); + private static _FormatMessage(message); + static Log: (message: string) => void; + private static _LogDisabled(message); + private static _LogEnabled(message); + static Warn: (message: string) => void; + private static _WarnDisabled(message); + private static _WarnEnabled(message); + static Error: (message: string) => void; + private static _ErrorDisabled(message); + private static _ErrorEnabled(message); + static LogCache: string; + static ClearLogCache(): void; + static LogLevels: number; + private static _PerformanceNoneLogLevel; + private static _PerformanceUserMarkLogLevel; + private static _PerformanceConsoleLogLevel; + private static _performance; + static PerformanceNoneLogLevel: number; + static PerformanceUserMarkLogLevel: number; + static PerformanceConsoleLogLevel: number; + static PerformanceLogLevel: number; + static _StartPerformanceCounterDisabled(counterName: string, condition?: boolean): void; + static _EndPerformanceCounterDisabled(counterName: string, condition?: boolean): void; + static _StartUserMark(counterName: string, condition?: boolean): void; + static _EndUserMark(counterName: string, condition?: boolean): void; + static _StartPerformanceConsole(counterName: string, condition?: boolean): void; + static _EndPerformanceConsole(counterName: string, condition?: boolean): void; + static StartPerformanceCounter: (counterName: string, condition?: boolean) => void; + static EndPerformanceCounter: (counterName: string, condition?: boolean) => void; + static Now: number; + static GetFps(): number; + } + /** + * An implementation of a loop for asynchronous functions. + */ + class AsyncLoop { + iterations: number; + private _fn; + private _successCallback; + index: number; + private _done; + /** + * Constroctor. + * @param iterations the number of iterations. + * @param _fn the function to run each iteration + * @param _successCallback the callback that will be called upon succesful execution + * @param offset starting offset. + */ + constructor(iterations: number, _fn: (asyncLoop: AsyncLoop) => void, _successCallback: () => void, offset?: number); + /** + * Execute the next iteration. Must be called after the last iteration was finished. + */ + executeNext(): void; + /** + * Break the loop and run the success callback. + */ + breakLoop(): void; + /** + * Helper function + */ + static Run(iterations: number, _fn: (asyncLoop: AsyncLoop) => void, _successCallback: () => void, offset?: number): AsyncLoop; + /** + * A for-loop that will run a given number of iterations synchronous and the rest async. + * @param iterations total number of iterations + * @param syncedIterations number of synchronous iterations in each async iteration. + * @param fn the function to call each iteration. + * @param callback a success call back that will be called when iterating stops. + * @param breakFunction a break condition (optional) + * @param timeout timeout settings for the setTimeout function. default - 0. + * @constructor + */ + static SyncAsyncForLoop(iterations: number, syncedIterations: number, fn: (iteration: number) => void, callback: () => void, breakFunction?: () => boolean, timeout?: number): void; + } +} + +declare module BABYLON { + enum JoystickAxis { + X = 0, + Y = 1, + Z = 2, + } + class VirtualJoystick { + reverseLeftRight: boolean; + reverseUpDown: boolean; + deltaPosition: Vector3; + pressed: boolean; + private static _globalJoystickIndex; + private static vjCanvas; + private static vjCanvasContext; + private static vjCanvasWidth; + private static vjCanvasHeight; + private static halfWidth; + private static halfHeight; + private _action; + private _axisTargetedByLeftAndRight; + private _axisTargetedByUpAndDown; + private _joystickSensibility; + private _inversedSensibility; + private _rotationSpeed; + private _inverseRotationSpeed; + private _rotateOnAxisRelativeToMesh; + private _joystickPointerID; + private _joystickColor; + private _joystickPointerPos; + private _joystickPreviousPointerPos; + private _joystickPointerStartPos; + private _deltaJoystickVector; + private _leftJoystick; + private _joystickIndex; + private _touches; + private _onPointerDownHandlerRef; + private _onPointerMoveHandlerRef; + private _onPointerUpHandlerRef; + private _onPointerOutHandlerRef; + private _onResize; + constructor(leftJoystick?: boolean); + setJoystickSensibility(newJoystickSensibility: number): void; + private _onPointerDown(e); + private _onPointerMove(e); + private _onPointerUp(e); + /** + * Change the color of the virtual joystick + * @param newColor a string that must be a CSS color value (like "red") or the hexa value (like "#FF0000") + */ + setJoystickColor(newColor: string): void; + setActionOnTouch(action: () => any): void; + setAxisForLeftRight(axis: JoystickAxis): void; + setAxisForUpDown(axis: JoystickAxis): void; + private _clearCanvas(); + private _drawVirtualJoystick(); + releaseCanvas(): void; + } +} + +declare module BABYLON { + class VRDeviceOrientationFreeCamera extends FreeCamera { + _alpha: number; + _beta: number; + _gamma: number; + private _offsetOrientation; + private _deviceOrientationHandler; + constructor(name: string, position: Vector3, scene: Scene, compensateDistorsion?: boolean); + _onOrientationEvent(evt: DeviceOrientationEvent): void; + attachControl(element: HTMLElement, noPreventDefault?: boolean): void; + detachControl(element: HTMLElement): void; + } +} + +declare var HMDVRDevice: any; +declare var PositionSensorVRDevice: any; +declare module BABYLON { + class WebVRFreeCamera extends FreeCamera { + _hmdDevice: any; + _sensorDevice: any; + _cacheState: any; + _cacheQuaternion: Quaternion; + _cacheRotation: Vector3; + _vrEnabled: boolean; + constructor(name: string, position: Vector3, scene: Scene, compensateDistorsion?: boolean); + private _getWebVRDevices(devices); + _checkInputs(): void; + attachControl(element: HTMLElement, noPreventDefault?: boolean): void; + detachControl(element: HTMLElement): void; + } +} + +declare module BABYLON { + interface IOctreeContainer { + blocks: Array>; + } + class Octree { + maxDepth: number; + blocks: Array>; + dynamicContent: T[]; + private _maxBlockCapacity; + private _selectionContent; + private _creationFunc; + constructor(creationFunc: (entry: T, block: OctreeBlock) => void, maxBlockCapacity?: number, maxDepth?: number); + update(worldMin: Vector3, worldMax: Vector3, entries: T[]): void; + addMesh(entry: T): void; + select(frustumPlanes: Plane[], allowDuplicate?: boolean): SmartArray; + intersects(sphereCenter: Vector3, sphereRadius: number, allowDuplicate?: boolean): SmartArray; + intersectsRay(ray: Ray): SmartArray; + static _CreateBlocks(worldMin: Vector3, worldMax: Vector3, entries: T[], maxBlockCapacity: number, currentDepth: number, maxDepth: number, target: IOctreeContainer, creationFunc: (entry: T, block: OctreeBlock) => void): void; + static CreationFuncForMeshes: (entry: AbstractMesh, block: OctreeBlock) => void; + static CreationFuncForSubMeshes: (entry: SubMesh, block: OctreeBlock) => void; + } +} + +declare module BABYLON { + class OctreeBlock { + entries: T[]; + blocks: Array>; + private _depth; + private _maxDepth; + private _capacity; + private _minPoint; + private _maxPoint; + private _boundingVectors; + private _creationFunc; + constructor(minPoint: Vector3, maxPoint: Vector3, capacity: number, depth: number, maxDepth: number, creationFunc: (entry: T, block: OctreeBlock) => void); + capacity: number; + minPoint: Vector3; + maxPoint: Vector3; + addEntry(entry: T): void; + addEntries(entries: T[]): void; + select(frustumPlanes: Plane[], selection: SmartArray, allowDuplicate?: boolean): void; + intersects(sphereCenter: Vector3, sphereRadius: number, selection: SmartArray, allowDuplicate?: boolean): void; + intersectsRay(ray: Ray, selection: SmartArray): void; + createInnerBlocks(): void; + } +} + +declare module BABYLON { + class ShadowGenerator { + private static _FILTER_NONE; + private static _FILTER_VARIANCESHADOWMAP; + private static _FILTER_POISSONSAMPLING; + private static _FILTER_BLURVARIANCESHADOWMAP; + static FILTER_NONE: number; + static FILTER_VARIANCESHADOWMAP: number; + static FILTER_POISSONSAMPLING: number; + static FILTER_BLURVARIANCESHADOWMAP: number; + private _filter; + blurScale: number; + private _blurBoxOffset; + private _bias; + private _lightDirection; + bias: number; + blurBoxOffset: number; + filter: number; + useVarianceShadowMap: boolean; + usePoissonSampling: boolean; + useBlurVarianceShadowMap: boolean; + private _light; + private _scene; + private _shadowMap; + private _shadowMap2; + private _darkness; + private _transparencyShadow; + private _effect; + private _viewMatrix; + private _projectionMatrix; + private _transformMatrix; + private _worldViewProjection; + private _cachedPosition; + private _cachedDirection; + private _cachedDefines; + private _currentRenderID; + private _downSamplePostprocess; + private _boxBlurPostprocess; + private _mapSize; + constructor(mapSize: number, light: IShadowLight); + isReady(subMesh: SubMesh, useInstances: boolean): boolean; + getShadowMap(): RenderTargetTexture; + getShadowMapForRendering(): RenderTargetTexture; + getLight(): IShadowLight; + getTransformMatrix(): Matrix; + getDarkness(): number; + setDarkness(darkness: number): void; + setTransparencyShadow(hasShadow: boolean): void; + private _packHalf(depth); + dispose(): void; + } +} + +declare module BABYLON.Internals { +} + +declare module BABYLON { + class BaseTexture { + name: string; + delayLoadState: number; + hasAlpha: boolean; + getAlphaFromRGB: boolean; + level: number; + isCube: boolean; + isRenderTarget: boolean; + animations: Animation[]; + onDispose: () => void; + coordinatesIndex: number; + coordinatesMode: number; + wrapU: number; + wrapV: number; + uScale: number; + vScale: number; + anisotropicFilteringLevel: number; + _cachedAnisotropicFilteringLevel: number; + private _scene; + _texture: WebGLTexture; + constructor(scene: Scene); + getScene(): Scene; + getTextureMatrix(): Matrix; + getReflectionTextureMatrix(): Matrix; + getInternalTexture(): WebGLTexture; + isReady(): boolean; + getSize(): ISize; + getBaseSize(): ISize; + scale(ratio: number): void; + canRescale: boolean; + _removeFromCache(url: string, noMipmap: boolean): void; + _getFromCache(url: string, noMipmap: boolean, sampling?: number): WebGLTexture; + delayLoad(): void; + releaseInternalTexture(): void; + clone(): BaseTexture; + dispose(): void; + } +} + +declare module BABYLON { + class CubeTexture extends BaseTexture { + url: string; + coordinatesMode: number; + private _noMipmap; + private _extensions; + private _textureMatrix; + constructor(rootUrl: string, scene: Scene, extensions?: string[], noMipmap?: boolean); + clone(): CubeTexture; + delayLoad(): void; + getReflectionTextureMatrix(): Matrix; + } +} + +declare module BABYLON { + class DynamicTexture extends Texture { + private _generateMipMaps; + private _canvas; + private _context; + constructor(name: string, options: any, scene: Scene, generateMipMaps: boolean, samplingMode?: number); + canRescale: boolean; + scale(ratio: number): void; + getContext(): CanvasRenderingContext2D; + clear(): void; + update(invertY?: boolean): void; + drawText(text: string, x: number, y: number, font: string, color: string, clearColor: string, invertY?: boolean, update?: boolean): void; + clone(): DynamicTexture; + } +} + +declare module BABYLON { + class MirrorTexture extends RenderTargetTexture { + mirrorPlane: Plane; + private _transformMatrix; + private _mirrorMatrix; + private _savedViewMatrix; + constructor(name: string, size: number, scene: Scene, generateMipMaps?: boolean); + clone(): MirrorTexture; + } +} + +declare module BABYLON { + class RawTexture extends Texture { + format: number; + constructor(data: ArrayBufferView, width: number, height: number, format: number, scene: Scene, generateMipMaps?: boolean, invertY?: boolean, samplingMode?: number); + update(data: ArrayBufferView): void; + static CreateLuminanceTexture(data: ArrayBufferView, width: number, height: number, scene: Scene, generateMipMaps?: boolean, invertY?: boolean, samplingMode?: number): RawTexture; + static CreateLuminanceAlphaTexture(data: ArrayBufferView, width: number, height: number, scene: Scene, generateMipMaps?: boolean, invertY?: boolean, samplingMode?: number): RawTexture; + static CreateAlphaTexture(data: ArrayBufferView, width: number, height: number, scene: Scene, generateMipMaps?: boolean, invertY?: boolean, samplingMode?: number): RawTexture; + static CreateRGBTexture(data: ArrayBufferView, width: number, height: number, scene: Scene, generateMipMaps?: boolean, invertY?: boolean, samplingMode?: number): RawTexture; + static CreateRGBATexture(data: ArrayBufferView, width: number, height: number, scene: Scene, generateMipMaps?: boolean, invertY?: boolean, samplingMode?: number): RawTexture; + } +} + +declare module BABYLON { + class RenderTargetTexture extends Texture { + renderList: AbstractMesh[]; + renderParticles: boolean; + renderSprites: boolean; + coordinatesMode: number; + onBeforeRender: () => void; + onAfterRender: () => void; + onAfterUnbind: () => void; + onClear: (engine: Engine) => void; + activeCamera: Camera; + customRenderFunction: (opaqueSubMeshes: SmartArray, transparentSubMeshes: SmartArray, alphaTestSubMeshes: SmartArray, beforeTransparents?: () => void) => void; + private _size; + _generateMipMaps: boolean; + private _renderingManager; + _waitingRenderList: string[]; + private _doNotChangeAspectRatio; + private _currentRefreshId; + private _refreshRate; + constructor(name: string, size: any, scene: Scene, generateMipMaps?: boolean, doNotChangeAspectRatio?: boolean, type?: number); + resetRefreshCounter(): void; + refreshRate: number; + _shouldRender(): boolean; + isReady(): boolean; + getRenderSize(): number; + canRescale: boolean; + scale(ratio: number): void; + resize(size: any, generateMipMaps?: boolean): void; + render(useCameraPostProcess?: boolean, dumpForDebug?: boolean): void; + clone(): RenderTargetTexture; + } +} + +declare module BABYLON { + class Texture extends BaseTexture { + static NEAREST_SAMPLINGMODE: number; + static BILINEAR_SAMPLINGMODE: number; + static TRILINEAR_SAMPLINGMODE: number; + static EXPLICIT_MODE: number; + static SPHERICAL_MODE: number; + static PLANAR_MODE: number; + static CUBIC_MODE: number; + static PROJECTION_MODE: number; + static SKYBOX_MODE: number; + static CLAMP_ADDRESSMODE: number; + static WRAP_ADDRESSMODE: number; + static MIRROR_ADDRESSMODE: number; + url: string; + uOffset: number; + vOffset: number; + uScale: number; + vScale: number; + uAng: number; + vAng: number; + wAng: number; + private _noMipmap; + _invertY: boolean; + private _rowGenerationMatrix; + private _cachedTextureMatrix; + private _projectionModeMatrix; + private _t0; + private _t1; + private _t2; + private _cachedUOffset; + private _cachedVOffset; + private _cachedUScale; + private _cachedVScale; + private _cachedUAng; + private _cachedVAng; + private _cachedWAng; + private _cachedCoordinatesMode; + _samplingMode: number; + private _buffer; + private _deleteBuffer; + constructor(url: string, scene: Scene, noMipmap?: boolean, invertY?: boolean, samplingMode?: number, onLoad?: () => void, onError?: () => void, buffer?: any, deleteBuffer?: boolean); + delayLoad(): void; + updateSamplingMode(samplingMode: number): void; + private _prepareRowForTextureGeneration(x, y, z, t); + getTextureMatrix(): Matrix; + getReflectionTextureMatrix(): Matrix; + clone(): Texture; + static CreateFromBase64String(data: string, name: string, scene: Scene, noMipmap?: boolean, invertY?: boolean, samplingMode?: number, onLoad?: () => void, onError?: () => void): Texture; + } +} + +declare module BABYLON { + class VideoTexture extends Texture { + video: HTMLVideoElement; + private _autoLaunch; + private _lastUpdate; + constructor(name: string, urls: string[], scene: Scene, generateMipMaps?: boolean, invertY?: boolean, samplingMode?: number); + update(): boolean; + } +} + +declare module BABYLON { + class CannonJSPlugin implements IPhysicsEnginePlugin { + checkWithEpsilon: (value: number) => number; + private _world; + private _registeredMeshes; + private _physicsMaterials; + initialize(iterations?: number): void; + private _checkWithEpsilon(value); + runOneStep(delta: number): void; + setGravity(gravity: Vector3): void; + registerMesh(mesh: AbstractMesh, impostor: number, options?: PhysicsBodyCreationOptions): any; + private _createSphere(radius, mesh, options?); + private _createBox(x, y, z, mesh, options?); + private _createPlane(mesh, options?); + private _createConvexPolyhedron(rawVerts, rawFaces, mesh, options?); + private _addMaterial(friction, restitution); + private _createRigidBodyFromShape(shape, mesh, mass, friction, restitution); + registerMeshesAsCompound(parts: PhysicsCompoundBodyPart[], options: PhysicsBodyCreationOptions): any; + private _unbindBody(body); + unregisterMesh(mesh: AbstractMesh): void; + applyImpulse(mesh: AbstractMesh, force: Vector3, contactPoint: Vector3): void; + updateBodyPosition: (mesh: AbstractMesh) => void; + createLink(mesh1: AbstractMesh, mesh2: AbstractMesh, pivot1: Vector3, pivot2: Vector3): boolean; + dispose(): void; + isSupported(): boolean; + } +} + +declare module BABYLON { + class OimoJSPlugin implements IPhysicsEnginePlugin { + private _world; + private _registeredMeshes; + private _checkWithEpsilon(value); + initialize(iterations?: number): void; + setGravity(gravity: Vector3): void; + registerMesh(mesh: AbstractMesh, impostor: number, options: PhysicsBodyCreationOptions): any; + registerMeshesAsCompound(parts: PhysicsCompoundBodyPart[], options: PhysicsBodyCreationOptions): any; + private _createBodyAsCompound(part, options, initialMesh); + unregisterMesh(mesh: AbstractMesh): void; + private _unbindBody(body); + /** + * Update the body position according to the mesh position + * @param mesh + */ + updateBodyPosition: (mesh: AbstractMesh) => void; + applyImpulse(mesh: AbstractMesh, force: Vector3, contactPoint: Vector3): void; + createLink(mesh1: AbstractMesh, mesh2: AbstractMesh, pivot1: Vector3, pivot2: Vector3, options?: any): boolean; + dispose(): void; + isSupported(): boolean; + private _getLastShape(body); + runOneStep(time: number): void; + } +} + +declare module BABYLON { + class PostProcessRenderEffect { + private _engine; + private _postProcesses; + private _getPostProcess; + private _singleInstance; + private _cameras; + private _indicesForCamera; + private _renderPasses; + private _renderEffectAsPasses; + _name: string; + applyParameters: (postProcess: PostProcess) => void; + constructor(engine: Engine, name: string, getPostProcess: () => PostProcess, singleInstance?: boolean); + _update(): void; + addPass(renderPass: PostProcessRenderPass): void; + removePass(renderPass: PostProcessRenderPass): void; + addRenderEffectAsPass(renderEffect: PostProcessRenderEffect): void; + getPass(passName: string): void; + emptyPasses(): void; + _attachCameras(cameras: Camera): any; + _attachCameras(cameras: Camera[]): any; + _detachCameras(cameras: Camera): any; + _detachCameras(cameras: Camera[]): any; + _enable(cameras: Camera): any; + _enable(cameras: Camera[]): any; + _disable(cameras: Camera): any; + _disable(cameras: Camera[]): any; + getPostProcess(camera?: Camera): PostProcess; + private _linkParameters(); + private _linkTextures(effect); + } +} + +declare module BABYLON { + class PostProcessRenderPass { + private _enabled; + private _renderList; + private _renderTexture; + private _scene; + private _refCount; + _name: string; + constructor(scene: Scene, name: string, size: number, renderList: Mesh[], beforeRender: () => void, afterRender: () => void); + _incRefCount(): number; + _decRefCount(): number; + _update(): void; + setRenderList(renderList: Mesh[]): void; + getRenderTexture(): RenderTargetTexture; + } +} + +declare module BABYLON { + class PostProcessRenderPipeline { + private _engine; + private _renderEffects; + private _renderEffectsForIsolatedPass; + private _cameras; + _name: string; + private static PASS_EFFECT_NAME; + private static PASS_SAMPLER_NAME; + constructor(engine: Engine, name: string); + addEffect(renderEffect: PostProcessRenderEffect): void; + _enableEffect(renderEffectName: string, cameras: Camera): any; + _enableEffect(renderEffectName: string, cameras: Camera[]): any; + _disableEffect(renderEffectName: string, cameras: Camera): any; + _disableEffect(renderEffectName: string, cameras: Camera[]): any; + _attachCameras(cameras: Camera, unique: boolean): any; + _attachCameras(cameras: Camera[], unique: boolean): any; + _detachCameras(cameras: Camera): any; + _detachCameras(cameras: Camera[]): any; + _enableDisplayOnlyPass(passName: any, cameras: Camera): any; + _enableDisplayOnlyPass(passName: any, cameras: Camera[]): any; + _disableDisplayOnlyPass(cameras: Camera): any; + _disableDisplayOnlyPass(cameras: Camera[]): any; + _update(): void; + } +} + +declare module BABYLON { + class PostProcessRenderPipelineManager { + private _renderPipelines; + constructor(); + addPipeline(renderPipeline: PostProcessRenderPipeline): void; + attachCamerasToRenderPipeline(renderPipelineName: string, cameras: Camera, unique?: boolean): any; + attachCamerasToRenderPipeline(renderPipelineName: string, cameras: Camera[], unique?: boolean): any; + detachCamerasFromRenderPipeline(renderPipelineName: string, cameras: Camera): any; + detachCamerasFromRenderPipeline(renderPipelineName: string, cameras: Camera[]): any; + enableEffectInPipeline(renderPipelineName: string, renderEffectName: string, cameras: Camera): any; + enableEffectInPipeline(renderPipelineName: string, renderEffectName: string, cameras: Camera[]): any; + disableEffectInPipeline(renderPipelineName: string, renderEffectName: string, cameras: Camera): any; + disableEffectInPipeline(renderPipelineName: string, renderEffectName: string, cameras: Camera[]): any; + enableDisplayOnlyPassInPipeline(renderPipelineName: string, passName: string, cameras: Camera): any; + enableDisplayOnlyPassInPipeline(renderPipelineName: string, passName: string, cameras: Camera[]): any; + disableDisplayOnlyPassInPipeline(renderPipelineName: string, cameras: Camera): any; + disableDisplayOnlyPassInPipeline(renderPipelineName: string, cameras: Camera[]): any; + update(): void; + } +} + +declare module BABYLON { + class CustomProceduralTexture extends ProceduralTexture { + private _animate; + private _time; + private _config; + private _texturePath; + constructor(name: string, texturePath: any, size: number, scene: Scene, fallbackTexture?: Texture, generateMipMaps?: boolean); + private loadJson(jsonUrl); + isReady(): boolean; + render(useCameraPostProcess?: boolean): void; + updateTextures(): void; + updateShaderUniforms(): void; + animate: boolean; + } +} + +declare module BABYLON { + class ProceduralTexture extends Texture { + private _size; + _generateMipMaps: boolean; + isEnabled: boolean; + private _doNotChangeAspectRatio; + private _currentRefreshId; + private _refreshRate; + private _vertexBuffer; + private _indexBuffer; + private _effect; + private _vertexDeclaration; + private _vertexStrideSize; + private _uniforms; + private _samplers; + private _fragment; + _textures: Texture[]; + private _floats; + private _floatsArrays; + private _colors3; + private _colors4; + private _vectors2; + private _vectors3; + private _matrices; + private _fallbackTexture; + private _fallbackTextureUsed; + constructor(name: string, size: any, fragment: any, scene: Scene, fallbackTexture?: Texture, generateMipMaps?: boolean); + reset(): void; + isReady(): boolean; + resetRefreshCounter(): void; + setFragment(fragment: any): void; + refreshRate: number; + _shouldRender(): boolean; + getRenderSize(): number; + resize(size: any, generateMipMaps: any): void; + private _checkUniform(uniformName); + setTexture(name: string, texture: Texture): ProceduralTexture; + setFloat(name: string, value: number): ProceduralTexture; + setFloats(name: string, value: number[]): ProceduralTexture; + setColor3(name: string, value: Color3): ProceduralTexture; + setColor4(name: string, value: Color4): ProceduralTexture; + setVector2(name: string, value: Vector2): ProceduralTexture; + setVector3(name: string, value: Vector3): ProceduralTexture; + setMatrix(name: string, value: Matrix): ProceduralTexture; + render(useCameraPostProcess?: boolean): void; + clone(): ProceduralTexture; + dispose(): void; + } +} + +declare module BABYLON { + class WoodProceduralTexture extends ProceduralTexture { + private _ampScale; + private _woodColor; + constructor(name: string, size: number, scene: Scene, fallbackTexture?: Texture, generateMipMaps?: boolean); + updateShaderUniforms(): void; + ampScale: number; + woodColor: Color3; + } + class FireProceduralTexture extends ProceduralTexture { + private _time; + private _speed; + private _autoGenerateTime; + private _fireColors; + private _alphaThreshold; + constructor(name: string, size: number, scene: Scene, fallbackTexture?: Texture, generateMipMaps?: boolean); + updateShaderUniforms(): void; + render(useCameraPostProcess?: boolean): void; + static PurpleFireColors: Color3[]; + static GreenFireColors: Color3[]; + static RedFireColors: Color3[]; + static BlueFireColors: Color3[]; + fireColors: Color3[]; + time: number; + speed: Vector2; + alphaThreshold: number; + } + class CloudProceduralTexture extends ProceduralTexture { + private _skyColor; + private _cloudColor; + constructor(name: string, size: number, scene: Scene, fallbackTexture?: Texture, generateMipMaps?: boolean); + updateShaderUniforms(): void; + skyColor: Color4; + cloudColor: Color4; + } + class GrassProceduralTexture extends ProceduralTexture { + private _grassColors; + private _herb1; + private _herb2; + private _herb3; + private _groundColor; + constructor(name: string, size: number, scene: Scene, fallbackTexture?: Texture, generateMipMaps?: boolean); + updateShaderUniforms(): void; + grassColors: Color3[]; + groundColor: Color3; + } + class RoadProceduralTexture extends ProceduralTexture { + private _roadColor; + constructor(name: string, size: number, scene: Scene, fallbackTexture?: Texture, generateMipMaps?: boolean); + updateShaderUniforms(): void; + roadColor: Color3; + } + class BrickProceduralTexture extends ProceduralTexture { + private _numberOfBricksHeight; + private _numberOfBricksWidth; + private _jointColor; + private _brickColor; + constructor(name: string, size: number, scene: Scene, fallbackTexture?: Texture, generateMipMaps?: boolean); + updateShaderUniforms(): void; + numberOfBricksHeight: number; + numberOfBricksWidth: number; + jointColor: Color3; + brickColor: Color3; + } + class MarbleProceduralTexture extends ProceduralTexture { + private _numberOfTilesHeight; + private _numberOfTilesWidth; + private _amplitude; + private _marbleColor; + private _jointColor; + constructor(name: string, size: number, scene: Scene, fallbackTexture?: Texture, generateMipMaps?: boolean); + updateShaderUniforms(): void; + numberOfTilesHeight: number; + numberOfTilesWidth: number; + jointColor: Color3; + marbleColor: Color3; + } +} diff --git a/backbone-relational/backbone-relational.d.ts b/backbone-relational/backbone-relational.d.ts index 4f4aa45cc..af8e4e31f 100644 --- a/backbone-relational/backbone-relational.d.ts +++ b/backbone-relational/backbone-relational.d.ts @@ -35,15 +35,15 @@ declare module Backbone { toJSON():any; - setup(); + static setup(); - build(attributes:any, options?:any); + static build(attributes:any, options?:any); - findOrCreate(attributes:string, options?:any); + static findOrCreate(attributes:string, options?:any); - findOrCreate(attributes:number, options?:any); + static findOrCreate(attributes:number, options?:any); - findOrCreate(attributes:any, options?:any); + static findOrCreate(attributes:any, options?:any); } export class Relation extends Model { @@ -147,13 +147,13 @@ declare module Backbone { resolveIdForItem(type:any, item:any):any; - find(type:any, item:string):RelationalModel; + static find(type:any, item:string):RelationalModel; - find(type:any, item:number):RelationalModel; + static find(type:any, item:number):RelationalModel; - find(type:any, item:RelationalModel):RelationalModel; + static find(type:any, item:RelationalModel):RelationalModel; - find(type:any, item:any):RelationalModel; + static find(type:any, item:any):RelationalModel; register(model:RelationalModel):void; @@ -169,3 +169,4 @@ declare module Backbone { } } + diff --git a/backbone.localstorage/backbone.localstorage-tests.ts b/backbone.localstorage/backbone.localstorage-tests.ts new file mode 100644 index 000000000..0d44897a8 --- /dev/null +++ b/backbone.localstorage/backbone.localstorage-tests.ts @@ -0,0 +1,6 @@ +/// + +var store: Store = new Store('testStore'); +store.findAll(); + +store.save(); diff --git a/backbone.localstorage/backbone.localstorage.d.ts b/backbone.localstorage/backbone.localstorage.d.ts new file mode 100644 index 000000000..122c47587 --- /dev/null +++ b/backbone.localstorage/backbone.localstorage.d.ts @@ -0,0 +1,51 @@ +// Type definitions for backbone.localStorage 1.0.0 +// Project: https://github.com/jeromegn/Backbone.localStorage +// Definitions by: Louis Grignon +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module Backbone { + interface Serializer { + serialize(item: any): any; + deserialize(data: any): any; + } + + class LocalStorage { + name: string; + serializer: Serializer; + records: string[]; + + constructor(name: string, serializer?: Serializer); + + save(): void; + + // Add a model, giving it a (hopefully)-unique GUID, if it doesn't already + // have an id of it's own. + create(model: any): any; + + // Update a model by replacing its copy in `this.data`. + update(model: any): any; + + // Retrieve a model from `this.data` by id. + find(model: any): any; + + // Return the array of all models currently in storage. + findAll(): any; + + // Delete a model from `this.data`, returning it. + destroy(model: T): T; + + localStorage(): any; + + // Clear localStorage for specific collection. + _clear(): void; + + _storageSize(): number; + + _itemName(id: any): string; + } +} + +import Store = Backbone.LocalStorage; + diff --git a/backbone/backbone-global.d.ts b/backbone/backbone-global.d.ts index ae111aea0..c16e1a59e 100644 --- a/backbone/backbone-global.d.ts +++ b/backbone/backbone-global.d.ts @@ -43,6 +43,7 @@ declare module Backbone { interface PersistenceOptions { url?: string; + data?: any; beforeSend?: (jqxhr: JQueryXHR) => void; success?: (modelOrCollection?: any, response?: any, options?: any) => void; error?: (modelOrCollection?: any, jqxhr?: JQueryXHR, options?: any) => void; @@ -367,7 +368,9 @@ declare module Backbone { remove(): View; make(tagName: any, attributes?: any, content?: any): any; delegateEvents(events?: EventsHash): any; + delegate(eventName: string, selector: string, listener: Function): View; undelegateEvents(): any; + undelegate(eventName: string, selector?: string, listener?: Function): View; _ensureElement(): void; } diff --git a/backbone/backbone-with-lodash-tests.ts b/backbone/backbone-with-lodash-tests.ts index c4f5fdf4d..dc7ebd2de 100644 --- a/backbone/backbone-with-lodash-tests.ts +++ b/backbone/backbone-with-lodash-tests.ts @@ -1,5 +1,5 @@ /// -/// +/// /// function test_events() { diff --git a/base-x/base-x-tests.ts b/base-x/base-x-tests.ts new file mode 100644 index 000000000..3e082c45b --- /dev/null +++ b/base-x/base-x-tests.ts @@ -0,0 +1,14 @@ +/// + +import * as basex from 'base-x'; + +let bs16: BaseX.BaseConverter = basex('0123456789ABCDEF'); + +{ + let encoded: string; + + encoded = bs16.encode([255]); + encoded = bs16.encode({0: 255, length: 1}); +} + +let decoded: number[] = bs16.decode('FF'); diff --git a/base-x/base-x.d.ts b/base-x/base-x.d.ts new file mode 100644 index 000000000..681a05806 --- /dev/null +++ b/base-x/base-x.d.ts @@ -0,0 +1,28 @@ +// Type definitions for base-x v1.0.1 +// Project: https://github.com/cryptocoinjs/base-x +// Definitions by: Ilya Mochalov +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare namespace BaseX { + interface EncodeBuffer { + [index: number]: number; + length: number; + } + + interface BaseConverter { + encode: (buffer: EncodeBuffer) => string; + decode: (string: string) => number[]; + } + + interface Base { + (ALPHABET: string): BaseX.BaseConverter + } +} + +declare module "base-x" { + namespace base {} + + let base: BaseX.Base; + + export = base; +} diff --git a/bcrypt-nodejs/bcrypt-nodejs-tests.ts b/bcrypt-nodejs/bcrypt-nodejs-tests.ts new file mode 100644 index 000000000..2a151c1c7 --- /dev/null +++ b/bcrypt-nodejs/bcrypt-nodejs-tests.ts @@ -0,0 +1,30 @@ +/// + +import bCrypt = require("bcrypt-nodejs"); + +function test_sync() { + var salt1 = bCrypt.genSaltSync(); + var salt2 = bCrypt.genSaltSync(8); + + var hash1 = bCrypt.hashSync('super secret'); + var hash2 = bCrypt.hashSync('super secret', salt1); + + var compare1 = bCrypt.compareSync('super secret', hash1); + + var rounds1 = bCrypt.getRounds(hash2); +} + +function test_async() { + var cbString = (error: Error, result: string) => {}; + var cbVoid = () => {}; + var cbBoolean = (error: Error, result: boolean) => {}; + + bCrypt.genSalt(8, cbString); + + var salt = bCrypt.genSaltSync(); + bCrypt.hash('super secret', salt, cbString); + bCrypt.hash('super secret', salt, cbVoid, cbString); + + var hash = bCrypt.hashSync('super secret'); + bCrypt.compare('super secret', hash, cbBoolean); +} \ No newline at end of file diff --git a/bcrypt-nodejs/bcrypt-nodejs.d.ts b/bcrypt-nodejs/bcrypt-nodejs.d.ts new file mode 100644 index 000000000..32b735d68 --- /dev/null +++ b/bcrypt-nodejs/bcrypt-nodejs.d.ts @@ -0,0 +1,68 @@ +// Type definitions for bcrypt-nodejs +// Project: https://github.com/shaneGirish/bcrypt-nodejs +// Definitions by: David Broder-Rodgers +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "bcrypt-nodejs" { + /** + * Generate a salt synchronously + * @param rounds Number of rounds to process the data for (default - 10) + * @return Generated salt + */ + export function genSaltSync(rounds?: number): string; + + /** + * Generate a salt asynchronously + * @param rounds Number of rounds to process the data for (default - 10) + * @param callback Callback with error and resulting salt, to be fired once the salt has been generated + */ + export function genSalt(rounds: number, callback: (error: Error, result: string) => void): void; + + /** + * Generate a hash synchronously + * @param data Data to be encrypted + * @param salt Salt to be used in encryption (default - new salt generated with 10 rounds) + * @return Generated hash + */ + export function hashSync(data: string, salt?: string): string; + + /** + * Generate a hash asynchronously + * @param data Data to be encrypted + * @param salt Salt to be used in encryption + * @param callback Callback with error and hashed result, to be fired once the data has been encrypted + */ + export function hash(data: string, salt: string, callback: (error: Error, result: string) => void): void; + + /** + * Generate a hash asynchronously + * @param data Data to be encrypted + * @param salt Salt to be used in encryption + * @param progressCallback Callback to be fired multiple times during the hash calculation to signify progress + * @param callback Callback with error and hashed result, to be fired once the data has been encrypted + */ + export function hash(data: string, salt: string, progressCallback: () => void, callback: (error: Error, result: string) => void): void; + + /** + * Compares data with a hash synchronously + * @param data Data to be compared + * @param hash Hash to be compared to + * @return true if matching, false otherwise + */ + export function compareSync(data: string, hash: string): boolean; + + /** + * Compares data with a hash asynchronously + * @param data Data to be compared + * @param hash Hash to be compared to + * @param callback Callback with error and match result, to be fired once the data has been compared + */ + export function compare(data: string, hash: string, callback: (error: Error, result: boolean) => void): void; + + /** + * Get number of rounds used for hash + * @param hash Hash from which the number of rounds used should be extracted + * @return number of rounds used to encrypt a given hash + */ + export function getRounds(hash: string): number; +} diff --git a/bcryptjs/bcryptjs-tests.ts b/bcryptjs/bcryptjs-tests.ts new file mode 100644 index 000000000..acfc48e43 --- /dev/null +++ b/bcryptjs/bcryptjs-tests.ts @@ -0,0 +1,54 @@ +/// + +import bcryptjs = require("bcryptjs"); + +let str: string; +let num: number; +let bool: boolean; + +str = bcryptjs.genSaltSync(); +str = bcryptjs.genSaltSync(10); + +bcryptjs.genSalt((err: Error, salt: string) => { + str = salt; +}); +bcryptjs.genSalt(10, (err: Error, salt: string) => { + str = salt; +}); + +str = bcryptjs.hashSync("string"); +str = bcryptjs.hashSync("string", 10); +str = bcryptjs.hashSync("string", "salt"); + +bcryptjs.hash("string", 10, (err: Error, hash: string) => { + str = hash; +}); +bcryptjs.hash("string", 10, (err: Error, hash: string) => { + str = hash; +}, (percent: number) => { + num = percent; +}); + +bcryptjs.hash("string", "salt", (err: Error, hash: string) => { + str = hash; +}); +bcryptjs.hash("string", "salt", (err: Error, hash: string) => { + str = hash; +}, (percent: number) => { + num = percent; +}); + +bool = bcryptjs.compareSync("string1", "string2"); + +bcryptjs.compare("string1", "string2", (err: Error, success: boolean) => { + bool = success; +}); +bcryptjs.compare("string1", "string2", (err: Error, success: boolean) => { + bool = success; +}, (percent: number) => { + num = percent; +}); + +num = bcryptjs.getRounds("string"); + +str = bcryptjs.getSalt("string"); diff --git a/bcryptjs/bcryptjs.d.ts b/bcryptjs/bcryptjs.d.ts new file mode 100644 index 000000000..3d3128d02 --- /dev/null +++ b/bcryptjs/bcryptjs.d.ts @@ -0,0 +1,82 @@ +// Type definitions for bcryptjs v2.3.0 +// Project: https://github.com/dcodeIO/bcrypt.js +// Definitions by: Joshua Filby +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module "bcryptjs" { + + /** + * Sets the pseudo random number generator to use as a fallback if neither node's crypto module nor the Web Crypto API is available. + * Please note: It is highly important that the PRNG used is cryptographically secure and that it is seeded properly! + * @param random Function taking the number of bytes to generate as its sole argument, returning the corresponding array of cryptographically secure random byte values. + */ + export function setRandomFallback(random: (random: number) => number[]): void; + + /** + * Synchronously generates a salt. + * @param rounds Number of rounds to use, defaults to 10 if omitted + * @return Resulting salt + */ + export function genSaltSync(rounds?: number): string; + + /** + * Asynchronously generates a salt. + * @param callback Callback receiving the error, if any, and the resulting salt + */ + export function genSalt(callback: (err: Error, salt: string) => void): void; + + /** + * Asynchronously generates a salt. + * @param rounds Number of rounds to use, defaults to 10 if omitted + * @param callback Callback receiving the error, if any, and the resulting salt + */ + export function genSalt(rounds: number, callback: (err: Error, salt: string) => void): void; + + /** + * Synchronously generates a hash for the given string. + * @param s String to hash + * @param salt Salt length to generate or salt to use, default to 10 + * @return Resulting hash + */ + export function hashSync(s: string, salt?: number | string): string; + + /** + * Asynchronously generates a hash for the given string. + * @param s String to hash + * @param salt Salt length to generate or salt to use + * @param callback Callback receiving the error, if any, and the resulting hash + * @param progressCallback Callback successively called with the percentage of rounds completed (0.0 - 1.0), maximally once per MAX_EXECUTION_TIME = 100 ms. + */ + export function hash(s: string, salt: number | string, callback: (err: Error, hash: string) => void, progressCallback?: (percent: number) => void): void; + + /** + * Synchronously tests a string against a hash. + * @param s String to compare + * @param hash Hash to test against + * @return true if matching, otherwise false + */ + export function compareSync(s: string, hash: string): boolean; + + /** + * Asynchronously compares the given data against the given hash. + * @param s Data to compare + * @param hash Data to be compared to + * @param callback Callback receiving the error, if any, otherwise the result + * @param progressCallback Callback successively called with the percentage of rounds completed (0.0 - 1.0), maximally once per MAX_EXECUTION_TIME = 100 ms. + */ + export function compare(s: string, hash: string, callback: (err: Error, success: boolean) => void, progressCallback?: (percent: number) => void): void; + + /** + * Gets the number of rounds used to encrypt the specified hash. + * @param hash Hash to extract the used number of rounds from + * @return Number of rounds used + */ + export function getRounds(hash: string): number; + + /** + * Gets the salt portion from a hash. Does not validate the hash. + * @param hash Hash to extract the salt from + * @return Extracted salt part + */ + export function getSalt(hash: string): string; +} diff --git a/bezier-easing/bezier-easing-tests.ts b/bezier-easing/bezier-easing-tests.ts new file mode 100644 index 000000000..eab1fb4f1 --- /dev/null +++ b/bezier-easing/bezier-easing-tests.ts @@ -0,0 +1,21 @@ +/// + +function test_create_from_array() { + let easing: BezierEasing = BezierEasing([0, 0, 1, 0.5]); +} + +function test_create_from_params() { + let easing: BezierEasing = BezierEasing(0, 0, 1, 0.5); +} + +function test_create_from_builtins() { + let easing: BezierEasing = BezierEasing.css['ease-in']; +} + +function test_methods() { + let easing: BezierEasing = BezierEasing.css['ease-in']; + let easedRatio: number = easing.get(0.5); + let points: Array = easing.getPoints(); + let stringified: string = easing.toString(); + let asCSS: string = easing.toCSS(); +} diff --git a/bezier-easing/bezier-easing.d.ts b/bezier-easing/bezier-easing.d.ts new file mode 100644 index 000000000..695368e7a --- /dev/null +++ b/bezier-easing/bezier-easing.d.ts @@ -0,0 +1,24 @@ +// Type definitions for bezier-easing +// Project: https://github.com/gre/bezier-easing +// Definitions by: brian ridley +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare interface BezierEasing { + get(ratio: number): number; + getPoints(): Array; + toString(): string; + toCSS(): string; +} + +declare function BezierEasing(points: Array): BezierEasing; +declare function BezierEasing(a: number, b: number, c: number, d: number): BezierEasing; + +declare namespace BezierEasing { + let css: { + 'ease': BezierEasing, + 'linear': BezierEasing, + 'ease-in': BezierEasing, + 'ease-out': BezierEasing, + 'ease-in-out': BezierEasing + }; +} diff --git a/big.js/big.js.d.ts b/big.js/big.js.d.ts index d4ca239e3..2ad360a56 100644 --- a/big.js/big.js.d.ts +++ b/big.js/big.js.d.ts @@ -200,4 +200,9 @@ declare module BigJsLibrary { } } +declare module "big.js" { + var bigjs : BigJsLibrary.BigJS; + export = bigjs; +} + declare var Big: BigJsLibrary.BigJS; 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/blazy/blazy-tests.ts b/blazy/blazy-tests.ts new file mode 100644 index 000000000..6e95801e9 --- /dev/null +++ b/blazy/blazy-tests.ts @@ -0,0 +1,44 @@ +/// + +/* Constructor test */ +var tester: BlazyInstance = new Blazy({ + breakpoints: [ + { + width: 420, + src: 'data-src-small' + }, + { + width: 768, + src: 'data-src-medium' + } + ], + container: '#scrolling-container', + error: function(ele: HTMLElement, msg: string) { + if (msg === 'missing') { + console.log('missing'); + } + else if (msg === 'invalid') { + console.log('invalid'); + } + }, + errorClass: 'b-error', + loadInvisible: false, + offset: 100, + saveViewportOffsetDelay: 50, + selector: '.b-lazy', + separator: '|', + src: 'data-src', + success: function(ele: HTMLElement) { + console.log('success'); + }, + successClass: 'b-loaded', + validateDelay: 25 +}); + +/* Functions tests */ +tester.revalidate(); + +var elements = document.getElementsByTagName('img'); +tester.load(elements, true); + +tester.destroy(); diff --git a/blazy/blazy.d.ts b/blazy/blazy.d.ts new file mode 100644 index 000000000..dedeff416 --- /dev/null +++ b/blazy/blazy.d.ts @@ -0,0 +1,72 @@ +// Type definitions for bLazy v1.5.2 +// Project: https://github.com/dinbror/blazy +// Definitions by: Julien Paroche +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/blazy +// Definitions based on: http://dinbror.dk/blog/blazy + +declare var Blazy: Blazy; + +interface Blazy { + + new (options: BlazyOptions): BlazyInstance; + +} + +interface BlazyOptions { + + breakpoints?: Breakpoint[]; + + container?: string; + + error?: (ele: Element|HTMLElement, msg: string) => void; + + errorClass?: string; + + loadInvisible?: boolean; + + offset?: number; + + saveViewportOffsetDelay?: number; + + selector?: string; + + separator?: string; + + src?: string; + + success?: (ele: Element|HTMLElement) => void; + + successClass?: string; + + validateDelay?: number; + +} + +interface BlazyInstance { + + /** + * Revalidates document for visible images. Useful if you add images with scripting or ajax. + */ + revalidate(): void; + + /** + * Forces the given element(s) to load if not collapsed. If you also want to load a collapsed/hidden elements you can add true as the second parameter. + * You can pass a single element or a list of elements. Tested with getElementById, getElementsByClassName, querySelectorAll, querySelector and jQuery selector. + */ + load(elements: Element|Element[]|HTMLElement|HTMLElement[]|NodeList, force: boolean): void; + + /** + * Unbind events and resets image array. + */ + destroy(): void; + +} + +interface Breakpoint { + width: number; + src: string; +} + +declare module 'Blazy' { + export = Blazy; +} diff --git a/blissfuljs/blissfuljs-tests.ts b/blissfuljs/blissfuljs-tests.ts new file mode 100644 index 000000000..ea55c63a9 --- /dev/null +++ b/blissfuljs/blissfuljs-tests.ts @@ -0,0 +1,445 @@ +/// + +function test_overview() { + /*Bliss includes several static methods (on the Bliss or $ object). For example, to copy all properties of an object onto another object, you would + call $.extend():*/ + var yolo = $.extend({ foo: 1 }, { bar: 2 }); + + var element = $.create(); + + /*Many of Bliss’ methods take an element or an array of elements as their first argument. For example, to set both the width and padding of an element to 0, + you could use the $.style() method:*/ + $.style(element, { width: 0, padding: 0 }); + + /*These types of methods are also available on elements and arrays, for convenience. However, since adding convenience methods to elements and arrays directly + would be a JS Mortal Sin™, Bliss only adds a _ property on elements & arrays, on which it hangs all its methods, to avoid conflicts. The previous example would + be written as: */ + element._.style({ + "width": 0, + "padding": 0 + }); + + + var myArray = $$("div"); + /*The ._. sequence of characters that appears all too often when coding with Bliss is where Bliss gets its logo from. However, the property can be + customized to anything you want. + + Methods that are available on elements like this will have an ELEMENT tag in these docs. + + If you wanted to set the width and padding of multiple elements to 0, you could use an array:*/ + myArray._.style({ + "width": 0, + "padding": 0 + }); + + /*Methods that are available on arrays like this will have an ARRAY tag in these docs. + + /*For example, assume that in addition to these CSS changes you also wanted to add a hidden attribute to this element. Bliss methods that don’t return a value + return the element or array they are called on, so you could call more element methods on them, including native ones:*/ + element._.style({ + "width": 0, + "padding": 0 + }).setAttribute("hidden", ""); + + /*Now assume you also wanted to set a second attribute: The "class" attribute to "foo". The native setAttribute() method is not chainable, it returns undefined. + However, all native element methods are also available on the almighty _ property, and there they are also chainable:*/ + element._.style({ + "width": 0, + "padding": 0 + })._.setAttribute("hidden", "").setAttribute("class", "foo"); + + //This works, but it’s a bit unwieldy. Thankfully, Bliss offers an $.attributes() method for setting multiple attributes at once: + element._.style({ + "width": 0, + "padding": 0 + })._.attributes({ + "hidden": "", + "class": "foo" + }); + + //This is better and more readable, but still a bit awkward. Turns out there is a special $.set() method to do both at once: + element._.set({ + attributes: { + "hidden": "", + "class": "foo" + }, + style: { + "width": 0, + "padding": 0 + } + }); + + /*Because $.attributes() and $.style() are also available for $.set() parameters, they will have the special $.SET() tag in these docs. + Note that you don’t actually need attributes: {…} in $.set() at all: if there are any unrecognized properties in the parameter object, + Bliss will first check if there is a property with that name on the element and if not, + set an attribute. So you could rewrite the example above as:*/ + element._.set({ + "hidden": "", + "class": "foo", // or "className": "foo" to use the property + style: { + "width": 0, + "padding": 0 + } + }); + +} + + +function vanilla_test() { + var element = $.create(); + + element.classList.add("my-class"); + element.classList.remove("my-class"); + element.classList.toggle("my-class"); + element.classList.contains("my-class") + element.remove(); + //element.contains(otherElement) // Not working + //element.matches(selector) // Not working + //element.closest(selector) // Not working + element.nextElementSibling + //element.children // Not working + + $$("div")._.remove(); +} + +function $_test() { + // return the first element with a class of .foo + // that is inside the first element with a class of .bar + var ret = $(".foo", $(".bar")); + // Return the first element with a class of .foo + // that is inside any element with a class of .bar + var ret = $(".bar .foo"); + // Get the first element with a class of .foo + // and set its title attribute to "yolo" + // If there is no such element, this will throw an exception! + $(".foo").setAttribute("title", "yolo"); + + // Check if the .foo element exists + // and set an attribute by using a variable "foo" + // as a reference of the element + var foo = $(".foo"); + if (foo) { + foo.setAttribute("title", "yolo"); + } +} + +function $$_test() { + // Add an id to all

headings that don’t already have one + $$("h1:not([id])").forEach(function(h1){ + h1.id = h1.textContent.replace(/\W/g, ""); + }); + // Get an array with all ids on the page + var ids = $$("[id]").map(function(element){ + return element.id; + }); + // Get all of an element’s attributes starting with data-bliss- + var element = $.create("div"); + + $$(element.attributes).filter(function(attribute){ + return attribute.name.indexOf("data-bliss-") === 0; + }).map(function(attribute){ + return attribute.name; + }); +} + +function $_create_test() { + $.create("ul", { + className: "nav", + contents: [ + "Navigation: ", + {tag: "li", + contents: {tag: "a", + href: "index.html", + textContent: "Home" + } + }, + {tag: "li", + contents: {tag: "a", + href: "contact.html", + textContent: "Contact", + target: "_blank" + }} + ] + }); + + var paragraph = $.create("p"); + var div = $.create(); +} + +function $_set_test() { + $.set(document.createElement("nav"), { + style: { + color: "red" + }, + events: { + click: function(evt:Event) { + console.log("YOLO"); + } + }, + contents: ["Navigation: ", {tag: "ul", + className: "buttons", + delegate: { + click: { + li: function() { + console.log("A list item was clicked"); + } + } + }, + contents: [{tag: "li", + contents: {tag: "a", + href: "index.html", + textContent: "Home" + } + }, {tag: "li", + contents: {tag: "a", + href: "docs.html", + textContent: "Docs" + } + } + ] + }], + inside: $("body > header") + }); +} + +function $_contents_test() { + var nav = $.create(); + + nav._.contents(["Navigation: ", {tag: "ul", + className: "buttons", + delegate: { + click: { + li: function() { + console.log("A list item was clicked") + } + } + }, + contents: [{tag: "li", + contents: {tag: "a", + href: "index.html", + textContent: "Home" + } + }, {tag: "li", + contents: {tag: "a", + href: "docs.html", + textContent: "Docs" + } + } + ] + }]) +} + +function $_clone_test() { + var button = $("button"); + button.addEventListener("click", function() { console.log("Click from listener!"); }); + button.onclick = function() { console.log("Click from inline event!"); }; + var button2 = button._.clone(); + // If clicked, button2 will print both messages +} + +function $_after_test() { + var button = $("button"); + $.after(button, $(".selector")); +} + +function $_around_test() { + var button = $("button"); + $.around(button, $(".selector")); + + // Wrap headings with a link to their section + $$("section[id] > h1, article[id] > h1").forEach(function(h1){ + $.create("a", { + href: "#" + (h1.parentNode).id, + around: h1 + }); + }); +} + +function $_attributes_test() { + var button = $("button"); + $.attributes(button, { backgroundColor: "#FFFFFF" }); + + button._.attributes({color: "#000000"}); +} + +function $_before_test() { + var button = $("button"); + $.before(button, $(".selector")); + + button._.before($(".selector")); +} + +function $_inside_test() { + var button = $("button"); + $.inside(button, $(".selector")); + + button._.inside($(".selector")); +} + +function $_properties_test() { + document.createElement("button")._.properties({ + className: "continue", + textContent: "Next Step", + onclick: function() { /*MyApp.next()*/ } + }); +} + +function $_start_test() { + var button = $("button"); + $.start(button, $(".selector")); + + button._.start($(".selector")); +} + +function $_style_test() { + document.body._.style({ + color: "white", + backgroundColor: "red", + cssFloat: "left" + }); +} + +function $_transition_test() { + var element = $(".selector"); + + // Fade out an element then remove it from the DOM + $.transition(element, {opacity: 0}).then($.remove); + + // Fade out and shrink all
s on a page, + // then remove them from the DOM + Promise.all($$("div")._.transition({ + opacity: 0, + transform: "scale(0)" + })).then( (elts) => { + elts.forEach(elt => { + $.remove(elt); + }); + }); +} + +function $_delegate_test() { + var element = $(".selector"); + + $.delegate(element, "locationchange", ".selected", () => {}); + $.delegate(element, "locationchange", { + "callback1" : () => {} + }); + $.delegate(element, { + "locationchange" : { + "callback1" : () => {} + } + }); + + element._.delegate("locationchange", ".selected", () => {}); + element._.delegate( "locationchange", { + "callback1" : () => {} + }); + element._.delegate({ + "locationchange" : { + "callback1" : () => {} + } + }); +} + +function $_events_test() { + $$('input[type="range"]')._.events({ + "input change": function(evt) { this.title = this.value} + }); + + $$("input")._.addEventListener("input", function(){ /* ... */}); +} + +function $_fire_test() { + + var myMap = $(".myMap"); + var myInput = $(".myInput"); + + // Fire a custom event on a map widget + myMap._.fire("locationchange", { + location: [42.361667, -71.092751] + }); + // Fire a fake input event + myInput._.fire("input"); +} + +function $_once_test() { + $$('input[type="range"]')._.once({ + "input change": function(evt) { this.title = this.value} + }); +} + +function $_ready_test() { + // Add a red border to all divs on a page + $.ready().then(function(){ + $$("div")._.style({ border: "1px solid red" }); + }); +} + +function $_all_test() { + // Uppercase all strings in an array + ["Foo", "bar"]._.all("toUpperCase"); // Returns ["FOO", "BAR"] +} + +function $_class_test() { + var cls = $.Class({ + constructor: function() {/* ... */} + }); +} + +function $_each_test() { + var elt = {a:"a", b:"b"}; + + $.each(elt, function (name:string, value:any) { + /* ... */ + }, elt); +} + +function $_extend_test() { + var o1 = {foo: 1, bar:2} + var o2 = $.extend(o1, {foo: 3, baz: 4}); + // o2 is {foo: 3, bar: 2, baz: 4} + // Get typography-related computed style on + var type = $.extend({}, + getComputedStyle(document.body), + /^font|^lineHeight$/); +} + +function $_lazy_test() { + var x = {a:""}; + $.lazy(x, "foo", () => {return "bar";}); + + $.lazy(x, { + "foo" : function() { + return "bar" + } + }); +} + +function $_live_test() { + var x = {a:""}; + $.live(x, "foo", () => {return "bar";}); +} + +function $_type_test(...args: any[]) { + // Check if the second argument of a function is a regexp + if ($.type(args[1]) === "regexp") { + // ... + } +} + +function $_value_test() { + $.value(document, "body", "nodeType"); // 1 + $.value(document, "body", "foo", "bar", "baz"); // undefined, no errors + $.value("document", "body", "nodeType"); // 1, no root, starting from self +} + +function $_fetch_test() { + $.fetch("/api/create", { + method: "POST", + responseType: "json" + }).then(function(){ + alert("success!"); + }).catch(function(error){ + console.error(error); + }); +} \ No newline at end of file diff --git a/blissfuljs/blissfuljs.d.ts b/blissfuljs/blissfuljs.d.ts new file mode 100644 index 000000000..99ef63e7e --- /dev/null +++ b/blissfuljs/blissfuljs.d.ts @@ -0,0 +1,670 @@ +// Type definitions for bliss +// Project: http://blissfuljs.com/ +// Definitions by: François Skorzec +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +interface Element { + _: BlissNS.BlissBindedElement; +} + +interface Array { + _: BlissNS.BlissBindedArray & BlissNS.BlissCollectionArray; +} + +declare module BlissNS { + export type BlissDecoratedElement = Element & T; + export type BlissDecoratedArrayElement = Array & BlissNS.BlissCollectionArray; + + interface BlissStatic { + (selector: string, context?: Element): BlissDecoratedElement; + + classProps: Object; + + create(tag: "a"): HTMLAnchorElement; + create(tag: "applet"): HTMLAppletElement; + create(tag: "area"):HTMLAreaElement; + create(tag: "audio"): HTMLAudioElement; + create(tag: "base"): HTMLBaseElement; + create(tag: "basefont"): HTMLBaseFontElement; + create(tag: "blockquote"): HTMLBlockElement; + create(tag: "body"): HTMLBodyElement; + create(tag: "br"): HTMLBRElement; + create(tag: "button"): HTMLButtonElement; + create(tag: "canvas"): HTMLCanvasElement; + create(tag: "datalist"): HTMLDataListElement; + create(tag: "dd"): HTMLDDElement; + create(tag: "directory"): HTMLDirectoryElement; + create(tag: "div"): HTMLDivElement; + create(tag: "embeded"): HTMLEmbedElement; + create(tag: "fieldset"): HTMLFieldSetElement; + create(tag: "form"): HTMLFormElement; + create(tag: "frame"): HTMLFrameElement; + create(tag: "frameset"): HTMLFrameSetElement; + create(tag: "iframe"): HTMLDListElement; + create(tag: "image"): HTMLImageElement; + create(tag: "input"): HTMLInputElement; + create(tag: "i"): HTMLLIElement; + create(tag: "label"): HTMLLabelElement; + create(tag: "legend"): HTMLLegendElement; + create(tag: "li"): HTMLLIElement; + create(tag: "link"): HTMLLinkElement; + create(tag: "map"): HTMLMapElement; + create(tag: "mark"): HTMLMarqueeElement; + create(tag: "menu"): HTMLMenuElement; + create(tag: "meta"): HTMLMetaElement; + create(tag: "object"): HTMLObjectElement; + create(tag: "ol"): HTMLOListElement; + create(tag: "optgroup"): HTMLOptGroupElement; + create(tag: "option"): HTMLOptionElement; + create(tag: "p"): HTMLParagraphElement; + create(tag: "param"): HTMLParamElement; + create(tag: "pre"): HTMLPreElement; + create(tag: "progress"): HTMLProgressElement; + create(tag: "q"): HTMLQuoteElement; + create(tag: "script"): HTMLScriptElement; + create(tag: "select"): HTMLSelectElement; + create(tag: "source"): HTMLSourceElement; + create(tag: "span"): HTMLSpanElement; + create(tag: "style"): HTMLStyleElement; + create(tag: "table"): HTMLTableElement; + create(tag: "thead"): HTMLTableHeaderCellElement; + create(tag: "ul"): HTMLUListElement; + create(tag: "video"): HTMLVideoElement; + create(tag: string): BlissDecoratedElement; + + create(options: Object): BlissDecoratedElement; + + create(tag: "a", options: Object): HTMLAnchorElement; + create(tag: "applet", options: Object): HTMLAppletElement; + create(tag: "area", options: Object): HTMLAreaElement; + create(tag: "audio", options: Object): HTMLAudioElement; + create(tag: "base", options: Object): HTMLBaseElement; + create(tag: "basefont", options: Object): HTMLBaseFontElement; + create(tag: "blockquote", options: Object): HTMLBlockElement; + create(tag: "body", options: Object): HTMLBodyElement; + create(tag: "br", options: Object): HTMLBRElement; + create(tag: "button", options: Object): HTMLButtonElement; + create(tag: "canvas", options: Object): HTMLCanvasElement; + create(tag: "datalist", options: Object): HTMLDataListElement; + create(tag: "dd", options: Object): HTMLDDElement; + create(tag: "directory", options: Object): HTMLDirectoryElement; + create(tag: "div", options: Object): HTMLDivElement; + create(tag: "embeded", options: Object): HTMLEmbedElement; + create(tag: "fieldset", options: Object): HTMLFieldSetElement; + create(tag: "form", options: Object): HTMLFormElement; + create(tag: "frame", options: Object): HTMLFrameElement; + create(tag: "frameset", options: Object): HTMLFrameSetElement; + create(tag: "iframe", options: Object): HTMLDListElement; + create(tag: "image", options: Object): HTMLImageElement; + create(tag: "input", options: Object): HTMLInputElement; + create(tag: "i", options: Object): HTMLLIElement; + create(tag: "label", options: Object): HTMLLabelElement; + create(tag: "legend", options: Object): HTMLLegendElement; + create(tag: "li", options: Object): HTMLLIElement; + create(tag: "link", options: Object): HTMLLinkElement; + create(tag: "map", options: Object): HTMLMapElement; + create(tag: "mark", options: Object): HTMLMarqueeElement; + create(tag: "menu", options: Object): HTMLMenuElement; + create(tag: "meta", options: Object): HTMLMetaElement; + create(tag: "object", options: Object): HTMLObjectElement; + create(tag: "ol", options: Object): HTMLOListElement; + create(tag: "optgroup", options: Object): HTMLOptGroupElement; + create(tag: "option", options: Object): HTMLOptionElement; + create(tag: "p", options: Object): HTMLParagraphElement; + create(tag: "param", options: Object): HTMLParamElement; + create(tag: "pre", options: Object): HTMLPreElement; + create(tag: "progress", options: Object): HTMLProgressElement; + create(tag: "q", options: Object): HTMLQuoteElement; + create(tag: "script", options: Object): HTMLScriptElement; + create(tag: "select", options: Object): HTMLSelectElement; + create(tag: "source", options: Object): HTMLSourceElement; + create(tag: "span", options: Object): HTMLSpanElement; + create(tag: "style", options: Object): HTMLStyleElement; + create(tag: "table", options: Object): HTMLTableElement; + create(tag: "thead", options: Object): HTMLTableHeaderCellElement; + create(tag: "ul", options: Object): HTMLUListElement; + create(tag: "video", options: Object): HTMLVideoElement; + create(tag: string, options: Object): BlissDecoratedElement; + + create(...args:any[]): BlissDecoratedElement; + + set(subject: BlissDecoratedElement, options: Object): BlissDecoratedElement; + contents(subject: BlissDecoratedElement , elements: Object | Array | string | Number | Node): BlissDecoratedElement; + contents(subject: BlissDecoratedElement[], elements: Object | Array | string | Number | Node): BlissDecoratedElement[]; + clone(subject:BlissDecoratedElement) : BlissDecoratedElement; + after(subject:BlissDecoratedElement, element: Element) : BlissDecoratedElement; + around(subject:BlissDecoratedElement, element: Element) : BlissDecoratedElement; + attributes(subject:BlissDecoratedElement, attrs: Object) : BlissDecoratedElement; + attributes(subject:BlissDecoratedElement[], attrs: Object) : BlissDecoratedElement[]; + before(subject:BlissDecoratedElement, element: Element) : BlissDecoratedElement; + inside(subject:BlissDecoratedElement, element: Element) : BlissDecoratedElement; + properties(subject:BlissDecoratedElement, props: Object) : BlissDecoratedElement; + properties(subject:BlissDecoratedElement[], props: Object) : BlissDecoratedElement[]; + start(subject:BlissDecoratedElement, element: Element) : BlissDecoratedElement; + style(subject:BlissDecoratedElement, properties: Object) : BlissDecoratedElement; + style(subject:BlissDecoratedElement[], properties: Object) : BlissDecoratedElement[]; + transition(subject:BlissDecoratedElement | BlissDecoratedElement[], properties: Object, duration?: number) : Promise; + delegate(subject:BlissDecoratedElement , type: string, selector: string, callback: (event: Event) => void): BlissDecoratedElement; + delegate(subject: BlissDecoratedElement[], type: string, selector: string, callback: (event: Event) => void): BlissDecoratedElement[]; + delegate(subject:BlissDecoratedElement , type: string, selectorsToCallbacks: {[selector: string] : (event: Event) => void}): BlissDecoratedElement; + delegate(subject:BlissDecoratedElement[], type: string, selectorsToCallbacks: {[selector: string] : (event: Event) => void}): BlissDecoratedElement[]; + delegate(subject:BlissDecoratedElement , typesToSelectorsToCallbacks: {[type: string] : {[selector: string] : (event: Event) => void}}): BlissDecoratedElement; + delegate(subject:BlissDecoratedElement[], typesToSelectorsToCallbacks: {[type: string] : {[selector: string] : (event: Event) => void}}): BlissDecoratedElement[]; + events(subject:BlissDecoratedElement , handlers: {[eventName:string] : (event: Event) => void} | Element): BlissDecoratedElement; + events(subject: BlissDecoratedElement[], handlers: {[eventName:string] : (event: Event) => void} | Element): BlissDecoratedElement[]; + fire(subject:BlissDecoratedElement, type: string, properties?: {[propertyName: string] : any}): BlissDecoratedElement; + fire(subject:BlissDecoratedElement[], type: string, properties?: {[propertyName: string] : any}): BlissDecoratedElement[]; + once(subject:BlissDecoratedElement, handlers: {[eventName:string] : (event: Event) => void} | Element): BlissDecoratedElement; + once(subject:BlissDecoratedElement[], handlers: {[eventName:string] : (event: Event) => void} | Element): BlissDecoratedElement[]; + ready(context?: Document): Promise; + + remove(subject:Element | BlissStatic): void; + + all(array: Array, method: string, ...args: Array): Array; + all(array: Array, method: string, ...args: Array): Array; + + Class(options: { + constructor?: Function; + extends?: Function; + abstract?: boolean; + lazy?: Object; + live?: Object; + static?: Object; + [propertyName: string]:any; + }): T; + + Class(options: { + constructor?: Function; + extends?: Function; + abstract?: boolean; + lazy?: Object; + live?: Object; + static?: Object; + [propertyName: string]:any; + }): Object; + + each(obj: {[propertyName: string] : any}, callback: Function, ret?: Object): T; + each(obj: {[propertyName: string] : any}, callback: Function, ret?: Object): Object; + + extend(target: Object, source: any, whitelist? : string[] | string | Function | RegExp): Object; + extend(target: Object, source: any, whitelist? : string[] | string | Function | RegExp): T; + + lazy(object: Object, property: string, getter: () => any): Object; + lazy(object:Object, property: string, getter:() => any): T; + + lazy(object: Object, properties: {[propertyName:string]: () => any}): Object; + lazy(object: Object, properties: {[propertyName:string]: () => any}): T; + + live(object: Object, property: string, descriptor: Object | Function): Object; + live(object: Object, property: string, descriptor: Object | Function): T; + + live(object: Object, properties: {[propertyName: string]: Object | Function}): Object; + live(object: Object, properties: {[propertyName: string]: Object | Function}): T; + + type(object: Object): string; + + value(obj: Object, ...properties: string[]): any; + value(obj: Object, ...properties: string[]): T; + + value(property: string, ...properties: string[]): any; + value(property: string , ...properties: string[]): T; + + fetch(url: string, options?: { + method?: string; + data?: string; + headers?:{[key:string]:string}; + + onreadystatechange?: (ev: ProgressEvent) => any; + readyState?: number; + response?: any; + responseBody?: any; + responseText?: string; + responseType?: string; + responseXML?: any; + status?: number; + statusText?: string; + timeout?: number; + upload?: XMLHttpRequestUpload; + withCredentials?: boolean; + + [propertyName: string]: any; + }): Promise; + + include(condition: any, url: string ): Promise; + include(url: string ): Promise; + + add(name: string, callback: Function, on?: BlissStatic | BlissStaticCollection | Element | Array): void; + add(callbacks:{[callbackName: string]: Function}, on?: BlissStatic | BlissStaticCollection | Element | Array): void; + + hooks: { + add(name: string, callback: Function): void; + run(name: string, env: Object): void; + }; + } + + interface BlissStaticCollection extends BlissStatic { + (selector: string, context?: Element): BlissDecoratedArrayElement; + (expr: Object, context?: Element): Array; + (expr: Window, context?: Element): [Window]; + (expr: Node, context?: Element): [Node]; + } + + // Native methods added into "_" property, but methods that return "void" now return thi stype in order to be chainables + // Methods are All HTMLElement a ELement methods + interface BlissNativeExtentions { + blur(): T; + click(): T; + contains(child: HTMLElement): boolean; + dragDrop(): boolean; + focus(): T; + insertAdjacentElement(position: string, insertedElement: Element): Element; + insertAdjacentHTML(where: string, html: string): T; + insertAdjacentText(where: string, text: string): T; + msGetInputContext(): MSInputMethodContext; + scrollIntoView(top?: boolean): T; + setActive(): T; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): T; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): T; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): T; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): T; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): T; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): T; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): T; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): T; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): T; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): T; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): T; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): T; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): T; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): T; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): T; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): T; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): T; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): T; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): T; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): T; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): T; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): T; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): T; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): T; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): T; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): T; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): T; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): T; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): T; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): T; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): T; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): T; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): T; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): T; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): T; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): T; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): T; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): T; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): T; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): T; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): T; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): T; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): T; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): T; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): T; + getAttribute(name?: string): string; + getAttributeNS(namespaceURI: string, localName: string): string; + getAttributeNode(name: string): Attr; + getAttributeNodeNS(namespaceURI: string, localName: string): Attr; + getBoundingClientRect(): ClientRect; + getClientRects(): ClientRectList; + getElementsByTagName(name: "a"): NodeListOf; + getElementsByTagName(name: "abbr"): NodeListOf; + getElementsByTagName(name: "acronym"): NodeListOf; + getElementsByTagName(name: "address"): NodeListOf; + getElementsByTagName(name: "applet"): NodeListOf; + getElementsByTagName(name: "area"): NodeListOf; + getElementsByTagName(name: "article"): NodeListOf; + getElementsByTagName(name: "aside"): NodeListOf; + getElementsByTagName(name: "audio"): NodeListOf; + getElementsByTagName(name: "b"): NodeListOf; + getElementsByTagName(name: "base"): NodeListOf; + getElementsByTagName(name: "basefont"): NodeListOf; + getElementsByTagName(name: "bdo"): NodeListOf; + getElementsByTagName(name: "big"): NodeListOf; + getElementsByTagName(name: "blockquote"): NodeListOf; + getElementsByTagName(name: "body"): NodeListOf; + getElementsByTagName(name: "br"): NodeListOf; + getElementsByTagName(name: "button"): NodeListOf; + getElementsByTagName(name: "canvas"): NodeListOf; + getElementsByTagName(name: "caption"): NodeListOf; + getElementsByTagName(name: "center"): NodeListOf; + getElementsByTagName(name: "circle"): NodeListOf; + getElementsByTagName(name: "cite"): NodeListOf; + getElementsByTagName(name: "clippath"): NodeListOf; + getElementsByTagName(name: "code"): NodeListOf; + getElementsByTagName(name: "col"): NodeListOf; + getElementsByTagName(name: "colgroup"): NodeListOf; + getElementsByTagName(name: "datalist"): NodeListOf; + getElementsByTagName(name: "dd"): NodeListOf; + getElementsByTagName(name: "defs"): NodeListOf; + getElementsByTagName(name: "del"): NodeListOf; + getElementsByTagName(name: "desc"): NodeListOf; + getElementsByTagName(name: "dfn"): NodeListOf; + getElementsByTagName(name: "dir"): NodeListOf; + getElementsByTagName(name: "div"): NodeListOf; + getElementsByTagName(name: "dl"): NodeListOf; + getElementsByTagName(name: "dt"): NodeListOf; + getElementsByTagName(name: "ellipse"): NodeListOf; + getElementsByTagName(name: "em"): NodeListOf; + getElementsByTagName(name: "embed"): NodeListOf; + getElementsByTagName(name: "feblend"): NodeListOf; + getElementsByTagName(name: "fecolormatrix"): NodeListOf; + getElementsByTagName(name: "fecomponenttransfer"): NodeListOf; + getElementsByTagName(name: "fecomposite"): NodeListOf; + getElementsByTagName(name: "feconvolvematrix"): NodeListOf; + getElementsByTagName(name: "fediffuselighting"): NodeListOf; + getElementsByTagName(name: "fedisplacementmap"): NodeListOf; + getElementsByTagName(name: "fedistantlight"): NodeListOf; + getElementsByTagName(name: "feflood"): NodeListOf; + getElementsByTagName(name: "fefunca"): NodeListOf; + getElementsByTagName(name: "fefuncb"): NodeListOf; + getElementsByTagName(name: "fefuncg"): NodeListOf; + getElementsByTagName(name: "fefuncr"): NodeListOf; + getElementsByTagName(name: "fegaussianblur"): NodeListOf; + getElementsByTagName(name: "feimage"): NodeListOf; + getElementsByTagName(name: "femerge"): NodeListOf; + getElementsByTagName(name: "femergenode"): NodeListOf; + getElementsByTagName(name: "femorphology"): NodeListOf; + getElementsByTagName(name: "feoffset"): NodeListOf; + getElementsByTagName(name: "fepointlight"): NodeListOf; + getElementsByTagName(name: "fespecularlighting"): NodeListOf; + getElementsByTagName(name: "fespotlight"): NodeListOf; + getElementsByTagName(name: "fetile"): NodeListOf; + getElementsByTagName(name: "feturbulence"): NodeListOf; + getElementsByTagName(name: "fieldset"): NodeListOf; + getElementsByTagName(name: "figcaption"): NodeListOf; + getElementsByTagName(name: "figure"): NodeListOf; + getElementsByTagName(name: "filter"): NodeListOf; + getElementsByTagName(name: "font"): NodeListOf; + getElementsByTagName(name: "footer"): NodeListOf; + getElementsByTagName(name: "foreignobject"): NodeListOf; + getElementsByTagName(name: "form"): NodeListOf; + getElementsByTagName(name: "frame"): NodeListOf; + getElementsByTagName(name: "frameset"): NodeListOf; + getElementsByTagName(name: "g"): NodeListOf; + getElementsByTagName(name: "h1"): NodeListOf; + getElementsByTagName(name: "h2"): NodeListOf; + getElementsByTagName(name: "h3"): NodeListOf; + getElementsByTagName(name: "h4"): NodeListOf; + getElementsByTagName(name: "h5"): NodeListOf; + getElementsByTagName(name: "h6"): NodeListOf; + getElementsByTagName(name: "head"): NodeListOf; + getElementsByTagName(name: "header"): NodeListOf; + getElementsByTagName(name: "hgroup"): NodeListOf; + getElementsByTagName(name: "hr"): NodeListOf; + getElementsByTagName(name: "html"): NodeListOf; + getElementsByTagName(name: "i"): NodeListOf; + getElementsByTagName(name: "iframe"): NodeListOf; + getElementsByTagName(name: "image"): NodeListOf; + getElementsByTagName(name: "img"): NodeListOf; + getElementsByTagName(name: "input"): NodeListOf; + getElementsByTagName(name: "ins"): NodeListOf; + getElementsByTagName(name: "isindex"): NodeListOf; + getElementsByTagName(name: "kbd"): NodeListOf; + getElementsByTagName(name: "keygen"): NodeListOf; + getElementsByTagName(name: "label"): NodeListOf; + getElementsByTagName(name: "legend"): NodeListOf; + getElementsByTagName(name: "li"): NodeListOf; + getElementsByTagName(name: "line"): NodeListOf; + getElementsByTagName(name: "lineargradient"): NodeListOf; + getElementsByTagName(name: "link"): NodeListOf; + getElementsByTagName(name: "listing"): NodeListOf; + getElementsByTagName(name: "map"): NodeListOf; + getElementsByTagName(name: "mark"): NodeListOf; + getElementsByTagName(name: "marker"): NodeListOf; + getElementsByTagName(name: "marquee"): NodeListOf; + getElementsByTagName(name: "mask"): NodeListOf; + getElementsByTagName(name: "menu"): NodeListOf; + getElementsByTagName(name: "meta"): NodeListOf; + getElementsByTagName(name: "metadata"): NodeListOf; + getElementsByTagName(name: "nav"): NodeListOf; + getElementsByTagName(name: "nextid"): NodeListOf; + getElementsByTagName(name: "nobr"): NodeListOf; + getElementsByTagName(name: "noframes"): NodeListOf; + getElementsByTagName(name: "noscript"): NodeListOf; + getElementsByTagName(name: "object"): NodeListOf; + getElementsByTagName(name: "ol"): NodeListOf; + getElementsByTagName(name: "optgroup"): NodeListOf; + getElementsByTagName(name: "option"): NodeListOf; + getElementsByTagName(name: "p"): NodeListOf; + getElementsByTagName(name: "param"): NodeListOf; + getElementsByTagName(name: "path"): NodeListOf; + getElementsByTagName(name: "pattern"): NodeListOf; + getElementsByTagName(name: "plaintext"): NodeListOf; + getElementsByTagName(name: "polygon"): NodeListOf; + getElementsByTagName(name: "polyline"): NodeListOf; + getElementsByTagName(name: "pre"): NodeListOf; + getElementsByTagName(name: "progress"): NodeListOf; + getElementsByTagName(name: "q"): NodeListOf; + getElementsByTagName(name: "radialgradient"): NodeListOf; + getElementsByTagName(name: "rect"): NodeListOf; + getElementsByTagName(name: "rt"): NodeListOf; + getElementsByTagName(name: "ruby"): NodeListOf; + getElementsByTagName(name: "s"): NodeListOf; + getElementsByTagName(name: "samp"): NodeListOf; + getElementsByTagName(name: "script"): NodeListOf; + getElementsByTagName(name: "section"): NodeListOf; + getElementsByTagName(name: "select"): NodeListOf; + getElementsByTagName(name: "small"): NodeListOf; + getElementsByTagName(name: "source"): NodeListOf; + getElementsByTagName(name: "span"): NodeListOf; + getElementsByTagName(name: "stop"): NodeListOf; + getElementsByTagName(name: "strike"): NodeListOf; + getElementsByTagName(name: "strong"): NodeListOf; + getElementsByTagName(name: "style"): NodeListOf; + getElementsByTagName(name: "sub"): NodeListOf; + getElementsByTagName(name: "sup"): NodeListOf; + getElementsByTagName(name: "svg"): NodeListOf; + getElementsByTagName(name: "switch"): NodeListOf; + getElementsByTagName(name: "symbol"): NodeListOf; + getElementsByTagName(name: "table"): NodeListOf; + getElementsByTagName(name: "tbody"): NodeListOf; + getElementsByTagName(name: "td"): NodeListOf; + getElementsByTagName(name: "text"): NodeListOf; + getElementsByTagName(name: "textpath"): NodeListOf; + getElementsByTagName(name: "textarea"): NodeListOf; + getElementsByTagName(name: "tfoot"): NodeListOf; + getElementsByTagName(name: "th"): NodeListOf; + getElementsByTagName(name: "thead"): NodeListOf; + getElementsByTagName(name: "title"): NodeListOf; + getElementsByTagName(name: "tr"): NodeListOf; + getElementsByTagName(name: "track"): NodeListOf; + getElementsByTagName(name: "tspan"): NodeListOf; + getElementsByTagName(name: "tt"): NodeListOf; + getElementsByTagName(name: "u"): NodeListOf; + getElementsByTagName(name: "ul"): NodeListOf; + getElementsByTagName(name: "use"): NodeListOf; + getElementsByTagName(name: "var"): NodeListOf; + getElementsByTagName(name: "video"): NodeListOf; + getElementsByTagName(name: "view"): NodeListOf; + getElementsByTagName(name: "wbr"): NodeListOf; + getElementsByTagName(name: "x-ms-webview"): NodeListOf; + getElementsByTagName(name: "xmp"): NodeListOf; + getElementsByTagName(name: string): NodeListOf; + getElementsByTagNameNS(namespaceURI: string, localName: string): NodeListOf; + hasAttribute(name: string): boolean; + hasAttributeNS(namespaceURI: string, localName: string): boolean; + msGetRegionContent(): MSRangeCollection; + msGetUntransformedBounds(): ClientRect; + msMatchesSelector(selectors: string): boolean; + msReleasePointerCapture(pointerId: number): T; + msSetPointerCapture(pointerId: number): T; + msZoomTo(args: MsZoomToOptions): T; + releasePointerCapture(pointerId: number): T; + removeAttribute(name?: string): T; + removeAttributeNS(namespaceURI: string, localName: string): T; + removeAttributeNode(oldAttr: Attr): Attr; + requestFullscreen(): T; + requestPointerLock(): T; + setAttribute(name?: string, value?: string): T; + setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): T; + setAttributeNode(newAttr: Attr): Attr; + setAttributeNodeNS(newAttr: Attr): Attr; + setPointerCapture(pointerId: number): T; + webkitMatchesSelector(selectors: string): boolean; + webkitRequestFullScreen(): T; + webkitRequestFullscreen(): T; + getElementsByClassName(classNames: string): NodeListOf; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): T; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): T; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): T; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): T; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): T; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): T; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): T; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): T; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): T; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): T; + } + + interface BlissBindedElement extends BlissNativeExtentions { + set(options: Object): BlissDecoratedElement + contents(elements: Object | Array | string | Number | Node): BlissDecoratedElement + clone(): BlissDecoratedElement; + after(element:Element) : BlissDecoratedElement; + around(element:Element) : BlissDecoratedElement; + attributes(attrs: Object) : BlissDecoratedElement; + before(element:Element) : BlissDecoratedElement; + inside(element:Element) : BlissDecoratedElement; + properties(props: Object) : BlissDecoratedElement; + start(element:Element) : BlissDecoratedElement; + style(properties: Object) : BlissDecoratedElement; + transition(properties: Object, duration?: number) : Promise; + delegate(type: string, selector: string, callback: (event: Event) => void): BlissDecoratedElement; + delegate(type: string, selectorsToCallbacks: {[selector: string] : (event: Event) => void}): BlissDecoratedElement; + delegate(typesToSelectorsToCallbacks: {[type: string] : {[selector: string] : (event: Event) => void}}): BlissDecoratedElement; + events(handlers: {[eventName:string] : (event: Event) => void} | Element): BlissDecoratedElement; + fire(type: string, properties?: {[propertyName: string] : any}): BlissDecoratedElement; + once(handlers: {[eventName:string] : (event: Event) => void} | Element): BlissDecoratedElement; + + remove(): BlissDecoratedElement; + } + + interface BlissBindedArray { + all(method: string, ...args: Array): Array; + all(method: string, ...args: Array): Array; + } + + interface BlissCollectionArray { + set(options: Object): BlissCollectionArray + contents(elements: Object | Array | string | Number | Node): BlissCollectionArray + clone(): BlissCollectionArray; + after(element:Element) : BlissCollectionArray; + around(element:Element) : BlissCollectionArray; + attributes(attrs: Object) : BlissCollectionArray; + before(element:Element) : BlissCollectionArray; + inside(element:Element) : BlissCollectionArray; + properties(props: Object) : BlissCollectionArray; + start(element:Element) : BlissCollectionArray; + style(properties: Object) : BlissCollectionArray; + transition(properties: Object, duration?: number) : Promise[]; + delegate(type: string, selector: string, callback: (event: Event) => void): BlissCollectionArray; + delegate(type: string, selectorsToCallbacks: {[selector: string] : (event: Event) => void}): BlissCollectionArray; + delegate(typesToSelectorsToCallbacks: {[type: string] : {[selector: string] : (event: Event) => void}}): BlissCollectionArray; + events(handlers: {[eventName:string] : (event: Event) => void} | Element): BlissCollectionArray; + fire(type: string, properties?: {[propertyName: string] : any}): BlissCollectionArray; + once(handlers: {[eventName:string] : (event: Event) => void} | Element): BlissCollectionArray; + + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): BlissCollectionArray; + + remove(): BlissCollectionArray; + } +} + +declare var Bliss: BlissNS.BlissStatic; +declare var $: BlissNS.BlissStatic; +declare var $$: BlissNS.BlissStaticCollection; diff --git a/blue-tape/blue-tape-tests.ts b/blue-tape/blue-tape-tests.ts new file mode 100644 index 000000000..a01675a1c --- /dev/null +++ b/blue-tape/blue-tape-tests.ts @@ -0,0 +1,170 @@ +/// +/// +/// + +import tape = require('blue-tape'); +import P = require('bluebird'); + +var name: string; +var cb: tape.TestCase; +var opts: tape.TestOptions; +var t: tape.Test; + +tape(cb); +tape(name, cb); +tape(opts, cb); +tape(name, opts, cb); + +tape(name, (test: tape.Test) => { + t = test; +}); + +tape.skip(name, cb); +tape.only(name, cb); + + +var sopts: tape.StreamOptions; +var rs: NodeJS.ReadableStream; +rs = tape.createStream(); +rs = tape.createStream(sopts); + + +var htest: typeof tape; +htest = tape.createHarness(); + + +tape(name, (test: tape.Test) => { + var num: number; + var ms: number; + var value: any; + var actual: any; + var expected: any; + var err: any; + var fn = function() {}; + var msg: string; + + var exceptionExpected: RegExp | (() => void); + + test.plan(num); + test.end(); + test.end(err); + + test.fail(msg); + test.pass(msg); + test.timeoutAfter(ms); + test.skip(msg); + + test.ok(value); + test.ok(value, msg); + test.true(value); + test.true(value, msg); + test.assert(value); + test.assert(value, msg); + + test.notOk(value); + test.notOk(value, msg); + test.false(value); + test.false(value, msg); + test.notok(value); + test.notok(value, msg); + + test.error(err, msg); + test.ifError(err, msg); + test.ifErr(err, msg); + test.iferror(err, msg); + + test.equal(actual, expected); + test.equal(actual, expected, msg); + test.equals(actual, expected); + test.equals(actual, expected, msg); + test.isEqual(actual, expected); + test.isEqual(actual, expected, msg); + test.is(actual, expected); + test.is(actual, expected, msg); + test.strictEqual(actual, expected); + test.strictEqual(actual, expected, msg); + test.strictEquals(actual, expected); + test.strictEquals(actual, expected, msg); + + test.notEqual(actual, expected); + test.notEqual(actual, expected, msg); + test.notEquals(actual, expected); + test.notEquals(actual, expected, msg); + test.notStrictEqual(actual, expected); + test.notStrictEqual(actual, expected, msg); + test.notStrictEquals(actual, expected); + test.notStrictEquals(actual, expected, msg); + test.isNotEqual(actual, expected); + test.isNotEqual(actual, expected, msg); + test.isNot(actual, expected); + test.isNot(actual, expected, msg); + test.not(actual, expected); + test.not(actual, expected, msg); + test.doesNotEqual(actual, expected); + test.doesNotEqual(actual, expected, msg); + test.isInequal(actual, expected); + test.isInequal(actual, expected, msg); + + test.deepEqual(actual, expected); + test.deepEqual(actual, expected, msg); + test.deepEquals(actual, expected); + test.deepEquals(actual, expected, msg); + test.isEquivalent(actual, expected); + test.isEquivalent(actual, expected, msg); + test.same(actual, expected); + test.same(actual, expected, msg); + + test.notDeepEqual(actual, expected); + test.notDeepEqual(actual, expected, msg); + test.notEquivalent(actual, expected); + test.notEquivalent(actual, expected, msg); + test.notDeeply(actual, expected); + test.notDeeply(actual, expected, msg); + test.notSame(actual, expected); + test.notSame(actual, expected, msg); + test.isNotDeepEqual(actual, expected); + test.isNotDeepEqual(actual, expected, msg); + test.isNotDeeply(actual, expected); + test.isNotDeeply(actual, expected, msg); + test.isNotEquivalent(actual, expected); + test.isNotEquivalent(actual, expected, msg); + test.isInequivalent(actual, expected); + test.isInequivalent(actual, expected, msg); + + test.deepLooseEqual(actual, expected); + test.deepLooseEqual(actual, expected, msg); + test.looseEqual(actual, expected); + test.looseEqual(actual, expected, msg); + test.looseEquals(actual, expected); + test.looseEquals(actual, expected, msg); + + test.notDeepLooseEqual(actual, expected); + test.notDeepLooseEqual(actual, expected, msg); + test.notLooseEqual(actual, expected); + test.notLooseEqual(actual, expected, msg); + test.notLooseEquals(actual, expected); + test.notLooseEquals(actual, expected, msg); + + test.throws(fn); + test.throws(fn, msg); + test.throws(fn, exceptionExpected); + test.throws(fn, exceptionExpected, msg); + + test.doesNotThrow(fn); + test.doesNotThrow(fn, msg); + test.doesNotThrow(fn, exceptionExpected); + test.doesNotThrow(fn, exceptionExpected, msg); + + test.test(name, (st) => { + t = st; + }); + + test.comment(msg); +}); + +tape('simple delay', (test) => P.delay(1)); + +tape('nested tests with promises', function(test) { + test.test('delay1', () => P.delay(1) ); + test.test('delay2', () => P.delay(1) ); +}); diff --git a/blue-tape/blue-tape.d.ts b/blue-tape/blue-tape.d.ts new file mode 100644 index 000000000..50bf0aab8 --- /dev/null +++ b/blue-tape/blue-tape.d.ts @@ -0,0 +1,12 @@ +// Type definitions for blue-tape v0.1.11 +// Project: https://github.com/spion/blue-tape +// Definitions by: Haoqun Jiang +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare module 'blue-tape' { + import tape = require('tape'); + export = tape; +} diff --git a/bluebird/bluebird-1.0.d.ts b/bluebird/bluebird-1.0.d.ts index 69a4f9152..b8287e57c 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. @@ -394,7 +394,7 @@ declare class Promise implements Promise.Thenable { * Note that the original methods on the object are not overwritten but new methods are created with the `Async`-postfix. For example, if you `promisifyAll()` the node.js `fs` object use `fs.statAsync()` to call the promisified `stat` method. */ // TODO how to model promisifyAll? - static promisifyAll(target: Object): Object; + static promisifyAll(target: Object): any; /** * 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. diff --git a/bluebird/bluebird-tests.ts b/bluebird/bluebird-tests.ts index ade461074..00f6e951f 100644 --- a/bluebird/bluebird-tests.ts +++ b/bluebird/bluebird-tests.ts @@ -80,19 +80,20 @@ var voidProm: Promise; var fooProm: Promise; var barProm: Promise; +var fooOrBarProm: Promise; var bazProm: Promise; // - - - - - - - - - - - - - - - - - -var numThen: Promise.Thenable; -var strThen: Promise.Thenable; -var anyThen: Promise.Thenable; -var boolThen: Promise.Thenable; -var objThen: Promise.Thenable; -var voidThen: Promise.Thenable; +var numThen: PromiseLike; +var strThen: PromiseLike; +var anyThen: PromiseLike; +var boolThen: PromiseLike; +var objThen: PromiseLike; +var voidThen: PromiseLike; -var fooThen: Promise.Thenable; -var barThen: Promise.Thenable; +var fooThen: PromiseLike; +var barThen: PromiseLike; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -105,12 +106,12 @@ var barArrProm: Promise; // - - - - - - - - - - - - - - - - - -var numArrThen: Promise.Thenable; -var strArrThen: Promise.Thenable; -var anyArrThen: Promise.Thenable; +var numArrThen: PromiseLike; +var strArrThen: PromiseLike; +var anyArrThen: PromiseLike; -var fooArrThen: Promise.Thenable; -var barArrThen: Promise.Thenable; +var fooArrThen: PromiseLike; +var barArrThen: PromiseLike; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -123,18 +124,18 @@ var barPromArr: Promise[]; // - - - - - - - - - - - - - - - - - -var numThenArr: Promise.Thenable[]; -var strThenArr: Promise.Thenable[]; -var anyThenArr: Promise.Thenable[]; +var numThenArr: PromiseLike[]; +var strThenArr: PromiseLike[]; +var anyThenArr: PromiseLike[]; -var fooThenArr: Promise.Thenable[]; -var barThenArr: Promise.Thenable[]; +var fooThenArr: PromiseLike[]; +var barThenArr: PromiseLike[]; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // booya! -var fooThenArrThen: Promise.Thenable[]>; -var barThenArrThen: Promise.Thenable[]>; +var fooThenArrThen: PromiseLike[]>; +var barThenArrThen: PromiseLike[]>; var fooResolver: Promise.Resolver; var barResolver: Promise.Resolver; @@ -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; }); @@ -530,19 +607,19 @@ Promise.all([fooProm, barProm, fooProm]).then(result => { //TODO fix collection inference -barArrProm = fooProm.map((item: Foo, index: number, arrayLength: number) => { +barArrProm = fooArrProm.map((item: Foo, index: number, arrayLength: number) => { return bar; }); -barArrProm = fooProm.map((item: Foo) => { +barArrProm = fooArrProm.map((item: Foo) => { return bar; }); -barArrProm = fooProm.map((item: Foo, index: number, arrayLength: number) => { +barArrProm = fooArrProm.map((item: Foo, index: number, arrayLength: number) => { return bar; }, { concurrency: 1 }); -barArrProm = fooProm.map((item: Foo) => { +barArrProm = fooArrProm.map((item: Foo) => { return bar; }, { concurrency: 1 @@ -550,10 +627,20 @@ barArrProm = fooProm.map((item: Foo) => { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -barProm = fooProm.reduce((memo: Bar, item: Foo, index: number, arrayLength: number) => { +barArrProm = fooArrProm.mapSeries((item: Foo, index: number, arrayLength: number) => { + return bar; +}); +barArrProm = fooArrProm.mapSeries((item: Foo) => { + return bar; +}); + + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +barProm = fooArrProm.reduce((memo: Bar, item: Foo, index: number, arrayLength: number) => { return memo; }); -barProm = fooProm.reduce((memo: Bar, item: Foo) => { +barProm = fooArrProm.reduce((memo: Bar, item: Foo) => { return memo; }, bar); @@ -667,8 +754,8 @@ Promise.longStackTraces(); //TODO enable delay -fooProm = Promise.delay(fooThen, num); -fooProm = Promise.delay(foo, num); +fooProm = Promise.delay(num, fooThen); +fooProm = Promise.delay(num, foo); voidProm = Promise.delay(num); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -678,6 +765,14 @@ func = Promise.promisify(f, obj); obj = Promise.promisifyAll(obj); anyProm = Promise.fromNode(callback => nodeCallbackFunc(callback)); +anyProm = Promise.fromNode(callback => nodeCallbackFuncErrorOnly(callback)); +anyProm = Promise.fromNode(callback => nodeCallbackFunc(callback), {multiArgs : true}); +anyProm = Promise.fromNode(callback => nodeCallbackFuncErrorOnly(callback), {multiArgs : true}); + +anyProm = Promise.fromCallback(callback => nodeCallbackFunc(callback)); +anyProm = Promise.fromCallback(callback => nodeCallbackFuncErrorOnly(callback)); +anyProm = Promise.fromCallback(callback => nodeCallbackFunc(callback), {multiArgs : true}); +anyProm = Promise.fromCallback(callback => nodeCallbackFuncErrorOnly(callback), {multiArgs : true}); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -930,6 +1025,81 @@ barArrProm = Promise.map(fooArr, (item: Foo, index: number, arrayLength: number) concurrency: 1 }); +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// mapSeries() + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// fooThenArrThen + +barArrProm = Promise.mapSeries(fooThenArrThen, (item: Foo) => { + return bar; +}); +barArrProm = Promise.mapSeries(fooThenArrThen, (item: Foo) => { + return barThen; +}); +barArrProm = Promise.mapSeries(fooThenArrThen, (item: Foo, index: number, arrayLength: number) => { + return bar; +}); +barArrProm = Promise.mapSeries(fooThenArrThen, (item: Foo, index: number, arrayLength: number) => { + return barThen; +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// fooArrThen + +barArrProm = Promise.mapSeries(fooArrThen, (item: Foo) => { + return bar; +}); +barArrProm = Promise.mapSeries(fooArrThen, (item: Foo) => { + return barThen; +}); +barArrProm = Promise.mapSeries(fooArrThen, (item: Foo, index: number, arrayLength: number) => { + return bar; +}); +barArrProm = Promise.mapSeries(fooArrThen, (item: Foo, index: number, arrayLength: number) => { + return barThen; +}); + + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// fooThenArr + +barArrProm = Promise.mapSeries(fooThenArr, (item: Foo) => { + return bar; +}); +barArrProm = Promise.mapSeries(fooThenArr, (item: Foo) => { + return barThen; +}); +barArrProm = Promise.mapSeries(fooThenArr, (item: Foo, index: number, arrayLength: number) => { + return bar; +}); +barArrProm = Promise.mapSeries(fooThenArr, (item: Foo, index: number, arrayLength: number) => { + return barThen; +}); + + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// fooArr + +barArrProm = Promise.mapSeries(fooArr, (item: Foo) => { + return bar; +}); +barArrProm = Promise.mapSeries(fooArr, (item: Foo) => { + return barThen; +}); +barArrProm = Promise.mapSeries(fooArr, (item: Foo, index: number, arrayLength: number) => { + return bar; +}); +barArrProm = Promise.mapSeries(fooArr, (item: Foo, index: number, arrayLength: number) => { + return barThen; +}); + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // reduce() diff --git a/bluebird/bluebird.d.ts b/bluebird/bluebird.d.ts index 878e1051e..2dfdcf854 100644 --- a/bluebird/bluebird.d.ts +++ b/bluebird/bluebird.d.ts @@ -1,6 +1,6 @@ // Type definitions for bluebird 2.0.0 // Project: https://github.com/petkaantonov/bluebird -// Definitions by: Bart van der Schoor +// Definitions by: Bart van der Schoor , falsandtru // Definitions: https://github.com/borisyankov/DefinitelyTyped // ES6 model with generics overload was sourced and trans-multiplied from es6-promises.d.ts @@ -16,736 +16,767 @@ // TODO verify support to have no return statement in handlers to get a Promise (more overloads?) -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); - - /** - * 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; - - /** - * 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) => U): Promise; - caught(onReject?: (error: any) => U): 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. - * - * This method also supports predicate-based filters. If you pass a predicate function instead of an error constructor, the predicate will receive the error as an argument. The return result of the predicate will be used determine whether the error handler should be called. - * - * 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) => U): Promise; - caught(predicate: (error: any) => boolean, onReject: (error: any) => U): 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) => 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. - */ - error(onReject: (reason: any) => Promise.Thenable): Promise; - error(onReject: (reason: any) => U): Promise; - - /** - * Pass a handler that will be called regardless of this promise's fate. Returns a new promise chained from this promise. There are special semantics for `.finally()` in that the final value cannot be modified from the handler. - * - * Alias `.lastly();` for compatibility with earlier ECMAScript version. - */ - finally(handler: () => Promise.Thenable): Promise; - finally(handler: () => U): Promise; - - lastly(handler: () => Promise.Thenable): Promise; - lastly(handler: () => U): Promise; - - /** - * Create a promise that follows this promise, but is bound to the given `thisArg` value. A bound promise will call its handlers with the bound value set to `this`. Additionally promises derived from a bound promise will also be bound promises with the same `thisArg` binding as the original promise. - */ - bind(thisArg: any): Promise; - - /** - * Like `.then()`, but any unhandled rejection that ends up here will be thrown as an error. - */ - done(onFulfilled: (value: R) => Promise.Thenable, onRejected: (error: any) => Promise.Thenable, onProgress?: (note: any) => any): void; - done(onFulfilled: (value: R) => Promise.Thenable, onRejected?: (error: any) => U, onProgress?: (note: any) => any): void; - done(onFulfilled: (value: R) => U, onRejected: (error: any) => Promise.Thenable, onProgress?: (note: any) => any): void; - done(onFulfilled?: (value: R) => U, onRejected?: (error: any) => U, onProgress?: (note: any) => any): void; - - /** - * Like `.finally()`, but not called for rejections. - */ - tap(onFulFill: (value: R) => Promise.Thenable): Promise; - tap(onFulfill: (value: R) => U): Promise; - - /** - * Shorthand for `.then(null, null, handler);`. Attach a progress handler that will be called if this promise is progressed. Returns a new promise chained from this promise. - */ - progressed(handler: (note: any) => any): Promise; - - /** - * Same as calling `Promise.delay(this, ms)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. - */ - delay(ms: number): Promise; - - /** - * Returns a promise that will be fulfilled with this promise's fulfillment value or rejection reason. However, if this promise is not fulfilled or rejected within `ms` milliseconds, the returned promise is rejected with a `Promise.TimeoutError` instance. - * - * You may specify a custom error message with the `message` parameter. - */ - timeout(ms: number, message?: string): Promise; - - /** - * Register a node-style callback on this promise. When this promise is is either fulfilled or rejected, the node callback will be called back with the node.js convention where error reason is the first argument and success value is the second argument. The error argument will be `null` in case of success. - * Returns back this promise instead of creating a new one. If the `callback` argument is not a function, this method does not do anything. - */ - nodeify(callback: (err: any, value?: R) => void, options?: Promise.SpreadOption): Promise; - nodeify(...sink: any[]): void; - - /** - * Marks this promise as cancellable. Promises by default are not cancellable after v0.11 and must be marked as such for `.cancel()` to have any effect. Marking a promise as cancellable is infectious and you don't need to remark any descendant promise. - */ - cancellable(): Promise; - - /** - * Cancel this promise. The cancellation will propagate to farthest cancellable ancestor promise which is still pending. - * - * That ancestor will then be rejected with a `CancellationError` (get a reference from `Promise.CancellationError`) object as the rejection reason. - * - * In a promise rejection handler you may check for a cancellation by seeing if the reason object has `.name === "Cancel"`. - * - * Promises are by default not cancellable. Use `.cancellable()` to mark a promise as cancellable. - */ - // TODO what to do with this? - cancel(): 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. - */ - fork(onFulfilled: (value: R) => Promise.Thenable, onRejected: (error: any) => Promise.Thenable, onProgress?: (note: any) => any): Promise; - fork(onFulfilled: (value: R) => Promise.Thenable, onRejected?: (error: any) => U, onProgress?: (note: any) => any): Promise; - fork(onFulfilled: (value: R) => U, onRejected: (error: any) => Promise.Thenable, onProgress?: (note: any) => any): Promise; - fork(onFulfilled?: (value: R) => U, onRejected?: (error: any) => U, onProgress?: (note: any) => any): Promise; - - /** - * Create an uncancellable promise based on this promise. - */ - uncancellable(): Promise; - - /** - * See if this promise can be cancelled. - */ - isCancellable(): boolean; - - /** - * See if this `promise` has been fulfilled. - */ - isFulfilled(): boolean; - - /** - * See if this `promise` has been rejected. - */ - isRejected(): boolean; - - /** - * See if this `promise` is still defer. - */ - isPending(): boolean; - - /** - * See if this `promise` is resolved -> either fulfilled or rejected. - */ - isResolved(): boolean; - - /** - * Get the fulfillment value of the underlying promise. Throws if the promise isn't fulfilled yet. - * - * throws `TypeError` - */ - value(): R; - - /** - * Get the rejection reason for the underlying promise. Throws if the promise isn't rejected yet. - * - * throws `TypeError` - */ - reason(): any; - - /** - * Synchronously inspect the state of this `promise`. The `PromiseInspection` will represent the state of the promise as snapshotted at the time of calling `.inspect()`. - */ - inspect(): Promise.Inspection; - - /** - * This is a convenience method for doing: - * - * - * promise.then(function(obj){ - * return obj[propertyName].call(obj, arg...); - * }); - * - */ - call(propertyName: string, ...args: any[]): Promise; - - /** - * This is a convenience method for doing: - * - * - * promise.then(function(obj){ - * return obj[propertyName]; - * }); - * - */ - // TODO find way to fix get() - // get(propertyName: string): Promise; - - /** - * Convenience method for: - * - * - * .then(function() { - * return value; - * }); - * - * - * in the case where `value` doesn't change its value. That means `value` is bound at the time of calling `.return()` - * - * Alias `.thenReturn();` for compatibility with earlier ECMAScript version. - */ - return(): Promise; - thenReturn(): Promise; - return(value: U): Promise; - thenReturn(value: U): Promise; - - /** - * Convenience method for: - * - * - * .then(function() { - * throw reason; - * }); - * - * Same limitations apply as with `.return()`. - * - * Alias `.thenThrow();` for compatibility with earlier ECMAScript version. - */ - throw(reason: Error): Promise; - thenThrow(reason: Error): Promise; - - /** - * Convert to String. - */ - toString(): string; - - /** - * This is implicitly called by `JSON.stringify` when serializing the object. Returns a serialized representation of the `Promise`. - */ - toJSON(): Object; - - /** - * Like calling `.then`, but the fulfillment value or rejection reason is assumed to be an array, which is flattened to the formal parameters of the handlers. - */ - // TODO how to model instance.spread()? like Q? - spread(onFulfill: Function, onReject?: (reason: any) => Promise.Thenable): Promise; - spread(onFulfill: Function, onReject?: (reason: any) => U): Promise; - /* - // TODO or something like this? - spread(onFulfill: (...values: W[]) => Promise.Thenable, onReject?: (reason: any) => Promise.Thenable): Promise; - spread(onFulfill: (...values: W[]) => Promise.Thenable, onReject?: (reason: any) => U): Promise; - spread(onFulfill: (...values: W[]) => U, onReject?: (reason: any) => Promise.Thenable): Promise; - spread(onFulfill: (...values: W[]) => U, onReject?: (reason: any) => U): Promise; - */ - /** - * Same as calling `Promise.all(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. - */ - // TODO type inference from array-resolving promise? - all(): Promise; - - /** - * Same as calling `Promise.props(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. - */ - // TODO how to model instance.props()? - props(): Promise; - - /** - * Same as calling `Promise.settle(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. - */ - // TODO type inference from array-resolving promise? - settle(): Promise[]>; - - /** - * Same as calling `Promise.any(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. - */ - // TODO type inference from array-resolving promise? - any(): Promise; - - /** - * Same as calling `Promise.some(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. - */ - // TODO type inference from array-resolving promise? - some(count: number): Promise; - - /** - * Same as calling `Promise.race(thisPromise, count)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. - */ - // TODO type inference from array-resolving promise? - race(): Promise; - - /** - * Same as calling `Promise.map(thisPromise, mapper)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. - */ - // TODO type inference from array-resolving promise? - map(mapper: (item: Q, index: number, arrayLength: number) => Promise.Thenable, options?: Promise.ConcurrencyOption): Promise; - map(mapper: (item: Q, index: number, arrayLength: number) => U, options?: Promise.ConcurrencyOption): Promise; - - /** - * Same as calling `Promise.reduce(thisPromise, Function reducer, initialValue)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. - */ - // TODO type inference from array-resolving promise? - reduce(reducer: (memo: U, item: Q, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; - reduce(reducer: (memo: U, item: Q, index: number, arrayLength: number) => U, initialValue?: U): Promise; - - /** - * Same as calling ``Promise.filter(thisPromise, filterer)``. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. - */ - // TODO type inference from array-resolving promise? - filter(filterer: (item: U, index: number, arrayLength: number) => Promise.Thenable, options?: Promise.ConcurrencyOption): Promise; - filter(filterer: (item: U, index: number, arrayLength: number) => boolean, options?: Promise.ConcurrencyOption): Promise; - - /** - * Same as calling ``Promise.each(thisPromise, iterator)``. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. - */ - each(iterator: (item: R, index: number, arrayLength: number) => U | Promise.Thenable): Promise; - - /** - * Start the chain of promises with `Promise.try`. Any synchronous exceptions will be turned into rejections on the returned promise. - * - * Note about second argument: if it's specifically a true array, its values become respective arguments for the function call. Otherwise it is passed as is as the first argument for the function call. - * - * Alias for `attempt();` for compatibility with earlier ECMAScript version. - */ - static try(fn: () => Promise.Thenable, args?: any[], ctx?: any): Promise; - static try(fn: () => R, args?: any[], ctx?: any): Promise; - - static attempt(fn: () => Promise.Thenable, args?: any[], ctx?: any): Promise; - static attempt(fn: () => R, args?: any[], ctx?: any): Promise; - - /** - * Returns a new function that wraps the given function `fn`. The new function will always return a promise that is fulfilled with the original functions return values or rejected with thrown exceptions from the original function. - * This method is convenient when a function can sometimes return synchronously or throw synchronously. - */ - static method(fn: Function): Function; - - /** - * Create a promise that is resolved with the given `value`. If `value` is a thenable or promise, the returned promise will assume its state. - */ - static resolve(): Promise; - static resolve(value: Promise.Thenable): Promise; - static resolve(value: R): Promise; - - /** - * Create a promise that is rejected with the given `reason`. - */ - static reject(reason: any): Promise; - static reject(reason: any): Promise; - - /** - * Create a promise with undecided fate and return a `PromiseResolver` to control it. See resolution?: Promise(#promise-resolution). - */ - static defer(): Promise.Resolver; - - /** - * Cast the given `value` to a trusted promise. If `value` is already a trusted `Promise`, it is returned as is. If `value` is not a thenable, a fulfilled is: Promise returned with `value` as its fulfillment value. If `value` is a thenable (Promise-like object, like those returned by jQuery's `$.ajax`), returns a trusted that: Promise assimilates the state of the thenable. - */ - static cast(value: Promise.Thenable): Promise; - static cast(value: R): Promise; - - /** - * Sugar for `Promise.resolve(undefined).bind(thisArg);`. See `.bind()`. - */ - static bind(thisArg: any): Promise; - - /** - * See if `value` is a trusted Promise. - */ - static is(value: any): boolean; - - /** - * Call this right after the library is loaded to enabled long stack traces. Long stack traces cannot be disabled after being enabled, and cannot be enabled after promises have alread been created. Long stack traces imply a substantial performance penalty, around 4-5x for throughput and 0.5x for latency. - */ - static longStackTraces(): void; - - /** - * Returns a promise that will be fulfilled with `value` (or `undefined`) after given `ms` milliseconds. If `value` is a promise, the delay will start counting down when it is fulfilled and the returned promise will be fulfilled with the fulfillment value of the `value` promise. - */ - // TODO enable more overloads - static delay(value: Promise.Thenable, ms: number): Promise; - static delay(value: R, ms: number): Promise; - static delay(ms: number): Promise; - - /** - * Returns a function that will wrap the given `nodeFunction`. Instead of taking a callback, the returned function will return a promise whose fate is decided by the callback behavior of the given node function. The node function should conform to node.js convention of accepting a callback as last argument and calling that callback with error as the first argument and success value on the second argument. - * - * If the `nodeFunction` calls its callback with multiple success values, the fulfillment value will be an array of them. - * - * If you pass a `receiver`, the `nodeFunction` will be called as a method on the `receiver`. - */ - static promisify(func: (callback: (err:any, result: T) => void) => void, receiver?: any): () => Promise; - static promisify(func: (arg1: A1, callback: (err: any, result: T) => void) => void, receiver?: any): (arg1: A1) => Promise; - static promisify(func: (arg1: A1, arg2: A2, callback: (err: any, result: T) => void) => void, receiver?: any): (arg1: A1, arg2: A2) => Promise; - static promisify(func: (arg1: A1, arg2: A2, arg3: A3, callback: (err: any, result: T) => void) => void, receiver?: any): (arg1: A1, arg2: A2, arg3: A3) => Promise; - static promisify(func: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, callback: (err: any, result: T) => void) => void, receiver?: any): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Promise; - static promisify(func: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5, callback: (err: any, result: T) => void) => void, receiver?: any): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Promise; - static promisify(nodeFunction: Function, receiver?: any): Function; - - /** - * Promisifies the entire object by going through the object's properties and creating an async equivalent of each function on the object and its prototype chain. The promisified method name will be the original method name postfixed with `Async`. Returns the input object. - * - * Note that the original methods on the object are not overwritten but new methods are created with the `Async`-postfix. For example, if you `promisifyAll()` the node.js `fs` object use `fs.statAsync()` to call the promisified `stat` method. - */ - // TODO how to model promisifyAll? - static promisifyAll(target: Object, options?: Promise.PromisifyAllOptions): Object; - - - /** - * Returns a promise that is resolved by a node style callback function. - */ - 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. - */ - // TODO fix coroutine GeneratorFunction - static coroutine(generatorFunction: Function): Function; - - /** - * Spawn a coroutine which may yield promises 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. - */ - // TODO fix spawn GeneratorFunction - static spawn(generatorFunction: Function): Promise; - - /** - * This is relevant to browser environments with no module loader. - * - * Release control of the `Promise` namespace to whatever it was before this library was loaded. Returns a reference to the library namespace so you can attach it to something else. - */ - static noConflict(): typeof Promise; - - /** - * Add `handler` as the handler to call when there is a possibly unhandled rejection. The default handler logs the error stack to stderr or `console.error` in browsers. - * - * Passing no value or a non-function will have the effect of removing any kind of handling for possibly unhandled rejections. - */ - static onPossiblyUnhandledRejection(handler: (reason: any) => any): void; - - /** - * Given an array, or a promise of an array, which contains promises (or a mix of promises and values) return a promise that is fulfilled when all the items in the array are fulfilled. The promise's fulfillment value is an array with fulfillment values at respective positions to the original array. If any promise in the array rejects, the returned promise is rejected with the rejection reason. - */ - // TODO enable more overloads - // promise of array with promises of value - static all(values: Promise.Thenable[]>): Promise; - // promise of array with values - static all(values: Promise.Thenable): Promise; - // array with promises of value - static all(values: Promise.Thenable[]): Promise; +declare var Promise: PromiseConstructor; + +interface PromiseConstructor { + /** + * 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. + */ + new (callback: (resolve: (thenableOrResult?: T | PromiseLike) => void, reject: (error: any) => void) => void): Promise; + + // Ideally, we'd define e.g. "export class RangeError extends Error {}", + // but as Error is defined as an interface (not a class), TypeScript doesn't + // allow extending Error, only implementing it. + // However, if we want to catch() only a specific error type, we need to pass + // a constructor function to it. So, as a workaround, we define them here as such. + RangeError(): RangeError; + CancellationError(): Promise.CancellationError; + TimeoutError(): Promise.TimeoutError; + TypeError(): Promise.TypeError; + RejectionError(): Promise.RejectionError; + OperationalError(): Promise.OperationalError; + + /** + * Changes how bluebird schedules calls a-synchronously. + * + * @param scheduler Should be a function that asynchronously schedules + * the calling of the passed in function + */ + setScheduler(scheduler: (callback: (...args: any[]) => void) => void): void; + + /** + * Start the chain of promises with `Promise.try`. Any synchronous exceptions will be turned into rejections on the returned promise. + * + * Note about second argument: if it's specifically a true array, its values become respective arguments for the function call. Otherwise it is passed as is as the first argument for the function call. + * + * Alias for `attempt();` for compatibility with earlier ECMAScript version. + */ + try(fn: () => PromiseLike, args?: any[], ctx?: any): Promise; + try(fn: () => T, args?: any[], ctx?: any): Promise; + + attempt(fn: () => PromiseLike, args?: any[], ctx?: any): Promise; + attempt(fn: () => T, args?: any[], ctx?: any): Promise; + + /** + * Returns a new function that wraps the given function `fn`. The new function will always return a promise that is fulfilled with the original functions return values or rejected with thrown exceptions from the original function. + * This method is convenient when a function can sometimes return synchronously or throw synchronously. + */ + method(fn: Function): Function; + + /** + * Create a promise that is resolved with the given `value`. If `value` is a thenable or promise, the returned promise will assume its state. + */ + resolve(): Promise; + resolve(value: PromiseLike): Promise; + resolve(value: T): Promise; + + /** + * Create a promise that is rejected with the given `reason`. + */ + reject(reason: any): Promise; + reject(reason: any): Promise; + + /** + * Create a promise with undecided fate and return a `PromiseResolver` to control it. See resolution?: Promise(#promise-resolution). + */ + defer(): Promise.Resolver; + + /** + * Cast the given `value` to a trusted promise. If `value` is already a trusted `Promise`, it is returned as is. If `value` is not a thenable, a fulfilled is: Promise returned with `value` as its fulfillment value. If `value` is a thenable (Promise-like object, like those returned by jQuery's `$.ajax`), returns a trusted that: Promise assimilates the state of the thenable. + */ + cast(value: PromiseLike): Promise; + cast(value: T): Promise; + + /** + * Sugar for `Promise.resolve(undefined).bind(thisArg);`. See `.bind()`. + */ + bind(thisArg: any): Promise; + + /** + * See if `value` is a trusted Promise. + */ + is(value: any): boolean; + + /** + * Call this right after the library is loaded to enabled long stack traces. Long stack traces cannot be disabled after being enabled, and cannot be enabled after promises have alread been created. Long stack traces imply a substantial performance penalty, around 4-5x for throughput and 0.5x for latency. + */ + longStackTraces(): void; + + /** + * Returns a promise that will be fulfilled with `value` (or `undefined`) after given `ms` milliseconds. If `value` is a promise, the delay will start counting down when it is fulfilled and the returned promise will be fulfilled with the fulfillment value of the `value` promise. + */ + // TODO enable more overloads + delay(ms: number, value: PromiseLike): Promise; + delay(ms: number, value: T): Promise; + delay(ms: number): Promise; + + /** + * Returns a function that will wrap the given `nodeFunction`. Instead of taking a callback, the returned function will return a promise whose fate is decided by the callback behavior of the given node function. The node function should conform to node.js convention of accepting a callback as last argument and calling that callback with error as the first argument and success value on the second argument. + * + * If the `nodeFunction` calls its callback with multiple success values, the fulfillment value will be an array of them. + * + * If you pass a `receiver`, the `nodeFunction` will be called as a method on the `receiver`. + */ + promisify(func: (callback: (err: any, result: T) => void) => void, receiver?: any): () => Promise; + promisify(func: (arg1: A1, callback: (err: any, result: T) => void) => void, receiver?: any): (arg1: A1) => Promise; + promisify(func: (arg1: A1, arg2: A2, callback: (err: any, result: T) => void) => void, receiver?: any): (arg1: A1, arg2: A2) => Promise; + promisify(func: (arg1: A1, arg2: A2, arg3: A3, callback: (err: any, result: T) => void) => void, receiver?: any): (arg1: A1, arg2: A2, arg3: A3) => Promise; + promisify(func: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, callback: (err: any, result: T) => void) => void, receiver?: any): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Promise; + promisify(func: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5, callback: (err: any, result: T) => void) => void, receiver?: any): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Promise; + promisify(nodeFunction: Function, receiver?: any): Function; + + /** + * Promisifies the entire object by going through the object's properties and creating an async equivalent of each function on the object and its prototype chain. The promisified method name will be the original method name postfixed with `Async`. Returns the input object. + * + * Note that the original methods on the object are not overwritten but new methods are created with the `Async`-postfix. For example, if you `promisifyAll()` the node.js `fs` object use `fs.statAsync()` to call the promisified `stat` method. + */ + // TODO how to model promisifyAll? + promisifyAll(target: Object, options?: Promise.PromisifyAllOptions): any; + + + /** + * Returns a promise that is resolved by a node style callback function. + */ + fromNode(resolver: (callback: (err: any, result?: any) => void) => void, options? : {multiArgs? : boolean}): Promise; + fromCallback(resolver: (callback: (err: any, result?: any) => void) => void, options? : {multiArgs? : boolean}): 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. + */ + // TODO fix coroutine GeneratorFunction + coroutine(generatorFunction: Function): Function; + + /** + * Spawn a coroutine which may yield promises 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. + */ + // TODO fix spawn GeneratorFunction + spawn(generatorFunction: Function): Promise; + + /** + * This is relevant to browser environments with no module loader. + * + * Release control of the `Promise` namespace to whatever it was before this library was loaded. Returns a reference to the library namespace so you can attach it to something else. + */ + noConflict(): typeof Promise; + + /** + * Add `handler` as the handler to call when there is a possibly unhandled rejection. The default handler logs the error stack to stderr or `console.error` in browsers. + * + * Passing no value or a non-function will have the effect of removing any kind of handling for possibly unhandled rejections. + */ + onPossiblyUnhandledRejection(handler: (reason: any) => any): void; + + /** + * Given an array, or a promise of an array, which contains promises (or a mix of promises and values) return a promise that is fulfilled when all the items in the array are fulfilled. The promise's fulfillment value is an array with fulfillment values at respective positions to the original array. If any promise in the array rejects, the returned promise is rejected with the rejection reason. + */ + // TODO enable more overloads + // promise of array with promises of value + all(values: PromiseLike[]>): Promise; + // promise of array with values + all(values: PromiseLike): Promise; + // array with promises of value + all(values: PromiseLike[]): Promise; // array with promises of different types - static all(values: [Promise.Thenable, Promise.Thenable]): Promise<[T1, T2]>; - static all(values: [Promise.Thenable, Promise.Thenable, Promise.Thenable]): Promise<[T1, T2, T3]>; - static all(values: [Promise.Thenable, Promise.Thenable, Promise.Thenable, Promise.Thenable]): Promise<[T1, T2, T3, T4]>; - static all(values: [Promise.Thenable, Promise.Thenable, Promise.Thenable, Promise.Thenable, Promise.Thenable]): Promise<[T1, T2, T3, T4, T5]>; - // array with values - static all(values: R[]): Promise; + all(values: [PromiseLike, PromiseLike]): Promise<[T1, T2]>; + all(values: [PromiseLike, PromiseLike, PromiseLike]): Promise<[T1, T2, T3]>; + all(values: [PromiseLike, PromiseLike, PromiseLike, PromiseLike]): Promise<[T1, T2, T3, T4]>; + all(values: [PromiseLike, PromiseLike, PromiseLike, PromiseLike, PromiseLike]): Promise<[T1, T2, T3, T4, T5]>; + // array with values + all(values: T[]): Promise; - /** - * Like ``Promise.all`` but for object properties instead of array items. Returns a promise that is fulfilled when all the properties of the object are fulfilled. The promise's fulfillment value is an object with fulfillment values at respective keys to the original object. If any promise in the object rejects, the returned promise is rejected with the rejection reason. - * - * If `object` is a trusted `Promise`, then it will be treated as a promise for object rather than for its properties. All other objects are treated for their properties as is returned by `Object.keys` - the object's own enumerable properties. - * - * *The original object is not modified.* - */ - // TODO verify this is correct - // trusted promise for object - static props(object: Promise): Promise; - // object - static props(object: Object): Promise; + /** + * Like ``Promise.all`` but for object properties instead of array items. Returns a promise that is fulfilled when all the properties of the object are fulfilled. The promise's fulfillment value is an object with fulfillment values at respective keys to the original object. If any promise in the object rejects, the returned promise is rejected with the rejection reason. + * + * If `object` is a trusted `Promise`, then it will be treated as a promise for object rather than for its properties. All other objects are treated for their properties as is returned by `Object.keys` - the object's own enumerable properties. + * + * *The original object is not modified.* + */ + // TODO verify this is correct + // trusted promise for object + props(object: Promise): Promise; + // object + props(object: Object): Promise; - /** - * Given an array, or a promise of an array, which contains promises (or a mix of promises and values) return a promise that is fulfilled when all the items in the array are either fulfilled or rejected. The fulfillment value is an array of ``PromiseInspection`` instances at respective positions in relation to the input array. - * - * *original: The array is not modified. The input array sparsity is retained in the resulting array.* - */ - // promise of array with promises of value - static settle(values: Promise.Thenable[]>): Promise[]>; - // promise of array with values - static settle(values: Promise.Thenable): Promise[]>; - // array with promises of value - static settle(values: Promise.Thenable[]): Promise[]>; - // array with values - static settle(values: R[]): Promise[]>; + /** + * Given an array, or a promise of an array, which contains promises (or a mix of promises and values) return a promise that is fulfilled when all the items in the array are either fulfilled or rejected. The fulfillment value is an array of ``PromiseInspection`` instances at respective positions in relation to the input array. + * + * *original: The array is not modified. The input array sparsity is retained in the resulting array.* + */ + // promise of array with promises of value + settle(values: PromiseLike[]>): Promise[]>; + // promise of array with values + settle(values: PromiseLike): Promise[]>; + // array with promises of value + settle(values: PromiseLike[]): Promise[]>; + // array with values + settle(values: T[]): Promise[]>; - /** - * Like `Promise.some()`, with 1 as `count`. However, if the promise fulfills, the fulfillment value is not an array of 1 but the value directly. - */ - // promise of array with promises of value - static any(values: Promise.Thenable[]>): Promise; - // promise of array with values - static any(values: Promise.Thenable): Promise; - // array with promises of value - static any(values: Promise.Thenable[]): Promise; - // array with values - static any(values: R[]): Promise; + /** + * Like `Promise.some()`, with 1 as `count`. However, if the promise fulfills, the fulfillment value is not an array of 1 but the value directly. + */ + // promise of array with promises of value + any(values: PromiseLike[]>): Promise; + // promise of array with values + any(values: PromiseLike): Promise; + // array with promises of value + any(values: PromiseLike[]): Promise; + // array with values + any(values: T[]): Promise; - /** - * Given an array, or a promise of an array, which contains promises (or a mix of promises and values) return a promise that is fulfilled or rejected as soon as a promise in the array is fulfilled or rejected with the respective rejection reason or fulfillment value. - * - * **Note** If you pass empty array or a sparse array with no values, or a promise/thenable for such, it will be forever pending. - */ - // promise of array with promises of value - static race(values: Promise.Thenable[]>): Promise; - // promise of array with values - static race(values: Promise.Thenable): Promise; - // array with promises of value - static race(values: Promise.Thenable[]): Promise; - // array with values - static race(values: R[]): Promise; + /** + * Given an array, or a promise of an array, which contains promises (or a mix of promises and values) return a promise that is fulfilled or rejected as soon as a promise in the array is fulfilled or rejected with the respective rejection reason or fulfillment value. + * + * **Note** If you pass empty array or a sparse array with no values, or a promise/thenable for such, it will be forever pending. + */ + // promise of array with promises of value + race(values: PromiseLike[]>): Promise; + // promise of array with values + race(values: PromiseLike): Promise; + // array with promises of value + race(values: PromiseLike[]): Promise; + // array with values + race(values: T[]): Promise; - /** - * Initiate a competetive race between multiple promises or values (values will become immediately fulfilled promises). When `count` amount of promises have been fulfilled, the returned promise is fulfilled with an array that contains the fulfillment values of the winners in order of resolution. - * - * If too many promises are rejected so that the promise can never become fulfilled, it will be immediately rejected with an array of rejection reasons in the order they were thrown in. - * - * *The original array is not modified.* - */ - // promise of array with promises of value - static some(values: Promise.Thenable[]>, count: number): Promise; - // promise of array with values - static some(values: Promise.Thenable, count: number): Promise; - // array with promises of value - static some(values: Promise.Thenable[], count: number): Promise; - // array with values - static some(values: R[], count: number): Promise; + /** + * Initiate a competetive race between multiple promises or values (values will become immediately fulfilled promises). When `count` amount of promises have been fulfilled, the returned promise is fulfilled with an array that contains the fulfillment values of the winners in order of resolution. + * + * If too many promises are rejected so that the promise can never become fulfilled, it will be immediately rejected with an array of rejection reasons in the order they were thrown in. + * + * *The original array is not modified.* + */ + // promise of array with promises of value + some(values: PromiseLike[]>, count: number): Promise; + // promise of array with values + some(values: PromiseLike, count: number): Promise; + // array with promises of value + some(values: PromiseLike[], count: number): Promise; + // array with values + some(values: T[], count: number): Promise; - /** - * Like `Promise.all()` but instead of having to pass an array, the array is generated from the passed variadic arguments. - */ - // variadic array with promises of value - static join(...values: Promise.Thenable[]): Promise; - // variadic array with values - static join(...values: R[]): Promise; + /** + * Like `Promise.all()` but instead of having to pass an array, the array is generated from the passed variadic arguments. + */ + // variadic array with promises of value + join(...values: PromiseLike[]): Promise; + // variadic array with values + join(...values: T[]): Promise; - /** - * Map an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `mapper` function with the signature `(item, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. If any promise in the input array is rejected the returned promise is rejected as well. - * - * If the `mapper` function returns promises or thenables, the returned promise will wait for all the mapped results to be resolved as well. - * - * *The original array is not modified.* - */ - // promise of array with promises of value - static map(values: Promise.Thenable[]>, mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable, options?: Promise.ConcurrencyOption): Promise; - static map(values: Promise.Thenable[]>, mapper: (item: R, index: number, arrayLength: number) => U, options?: Promise.ConcurrencyOption): Promise; + /** + * Map an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `mapper` function with the signature `(item, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. If any promise in the input array is rejected the returned promise is rejected as well. + * + * If the `mapper` function returns promises or thenables, the returned promise will wait for all the mapped results to be resolved as well. + * + * *The original array is not modified.* + */ + // promise of array with promises of value + map(values: PromiseLike[]>, mapper: (item: T, index: number, arrayLength: number) => PromiseLike, options?: Promise.ConcurrencyOption): Promise; + map(values: PromiseLike[]>, mapper: (item: T, index: number, arrayLength: number) => U, options?: Promise.ConcurrencyOption): Promise; - // promise of array with values - static map(values: Promise.Thenable, mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable, options?: Promise.ConcurrencyOption): Promise; - static map(values: Promise.Thenable, mapper: (item: R, index: number, arrayLength: number) => U, options?: Promise.ConcurrencyOption): Promise; + // promise of array with values + map(values: PromiseLike, mapper: (item: T, index: number, arrayLength: number) => PromiseLike, options?: Promise.ConcurrencyOption): Promise; + map(values: PromiseLike, mapper: (item: T, index: number, arrayLength: number) => U, options?: Promise.ConcurrencyOption): Promise; - // array with promises of value - static map(values: Promise.Thenable[], mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable, options?: Promise.ConcurrencyOption): Promise; - static map(values: Promise.Thenable[], mapper: (item: R, index: number, arrayLength: number) => U, options?: Promise.ConcurrencyOption): Promise; + // array with promises of value + map(values: PromiseLike[], mapper: (item: T, index: number, arrayLength: number) => PromiseLike, options?: Promise.ConcurrencyOption): Promise; + map(values: PromiseLike[], mapper: (item: T, index: number, arrayLength: number) => U, options?: Promise.ConcurrencyOption): Promise; - // array with values - static map(values: R[], mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable, options?: Promise.ConcurrencyOption): Promise; - static map(values: R[], mapper: (item: R, index: number, arrayLength: number) => U, options?: Promise.ConcurrencyOption): Promise; + // array with values + map(values: T[], mapper: (item: T, index: number, arrayLength: number) => PromiseLike, options?: Promise.ConcurrencyOption): Promise; + map(values: T[], mapper: (item: T, index: number, arrayLength: number) => U, options?: Promise.ConcurrencyOption): Promise; - /** - * Reduce an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `reducer` function with the signature `(total, current, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. If any promise in the input array is rejected the returned promise is rejected as well. - * - * If the reducer function returns a promise or a thenable, the result for the promise is awaited for before continuing with next iteration. - * - * *The original array is not modified. If no `intialValue` is given and the array doesn't contain at least 2 items, the callback will not be called and `undefined` is returned. If `initialValue` is given and the array doesn't have at least 1 item, `initialValue` is returned.* - */ - // promise of array with promises of value - static reduce(values: Promise.Thenable[]>, reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; - static reduce(values: Promise.Thenable[]>, reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; + /** + * Similar to `map` with concurrency set to 1 but guaranteed to execute in sequential order + * + * If the `mapper` function returns promises or thenables, the returned promise will wait for all the mapped results to be resolved as well. + * + * *The original array is not modified.* + */ + // promise of array with promises of value + mapSeries(values: PromiseLike[]>, mapper: (item: R, index: number, arrayLength: number) => U | PromiseLike): Promise; - // promise of array with values - static reduce(values: Promise.Thenable, reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; - static reduce(values: Promise.Thenable, reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; + // promise of array with values + mapSeries(values: PromiseLike, mapper: (item: R, index: number, arrayLength: number) => U | PromiseLike): Promise; - // array with promises of value - static reduce(values: Promise.Thenable[], reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; - static reduce(values: Promise.Thenable[], reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; + // array with promises of value + mapSeries(values: PromiseLike[], mapper: (item: R, index: number, arrayLength: number) => U | PromiseLike): Promise; - // array with values - static reduce(values: R[], reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; - static reduce(values: R[], reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; + // array with values + mapSeries(values: R[], mapper: (item: R, index: number, arrayLength: number) => U | PromiseLike): Promise; + - /** - * Filter an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `filterer` function with the signature `(item, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. If any promise in the input array is rejected the returned promise is rejected as well. - * - * The return values from the filtered functions are coerced to booleans, with the exception of promises and thenables which are awaited for their eventual result. - * - * *The original array is not modified. - */ - // promise of array with promises of value - static filter(values: Promise.Thenable[]>, filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable, option?: Promise.ConcurrencyOption): Promise; - static filter(values: Promise.Thenable[]>, filterer: (item: R, index: number, arrayLength: number) => boolean, option?: Promise.ConcurrencyOption): Promise; + /** + * Reduce an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `reducer` function with the signature `(total, current, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. If any promise in the input array is rejected the returned promise is rejected as well. + * + * If the reducer function returns a promise or a thenable, the result for the promise is awaited for before continuing with next iteration. + * + * *The original array is not modified. If no `intialValue` is given and the array doesn't contain at least 2 items, the callback will not be called and `undefined` is returned. If `initialValue` is given and the array doesn't have at least 1 item, `initialValue` is returned.* + */ + // promise of array with promises of value + reduce(values: PromiseLike[]>, reducer: (total: U, current: T, index: number, arrayLength: number) => PromiseLike, initialValue?: U): Promise; + reduce(values: PromiseLike[]>, reducer: (total: U, current: T, index: number, arrayLength: number) => U, initialValue?: U): Promise; - // promise of array with values - static filter(values: Promise.Thenable, filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable, option?: Promise.ConcurrencyOption): Promise; - static filter(values: Promise.Thenable, filterer: (item: R, index: number, arrayLength: number) => boolean, option?: Promise.ConcurrencyOption): Promise; + // promise of array with values + reduce(values: PromiseLike, reducer: (total: U, current: T, index: number, arrayLength: number) => PromiseLike, initialValue?: U): Promise; + reduce(values: PromiseLike, reducer: (total: U, current: T, index: number, arrayLength: number) => U, initialValue?: U): Promise; - // array with promises of value - static filter(values: Promise.Thenable[], filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable, option?: Promise.ConcurrencyOption): Promise; - static filter(values: Promise.Thenable[], filterer: (item: R, index: number, arrayLength: number) => boolean, option?: Promise.ConcurrencyOption): Promise; + // array with promises of value + reduce(values: PromiseLike[], reducer: (total: U, current: T, index: number, arrayLength: number) => PromiseLike, initialValue?: U): Promise; + reduce(values: PromiseLike[], reducer: (total: U, current: T, index: number, arrayLength: number) => U, initialValue?: U): Promise; - // array with values - static filter(values: R[], filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable, option?: Promise.ConcurrencyOption): Promise; - static filter(values: R[], filterer: (item: R, index: number, arrayLength: number) => boolean, option?: Promise.ConcurrencyOption): Promise; + // array with values + reduce(values: T[], reducer: (total: U, current: T, index: number, arrayLength: number) => PromiseLike, initialValue?: U): Promise; + reduce(values: T[], reducer: (total: U, current: T, index: number, arrayLength: number) => U, initialValue?: U): Promise; - /** - * Iterate over an array, or a promise of an array, which contains promises (or a mix of promises and values) with the given iterator function with the signature (item, index, value) where item is the resolved value of a respective promise in the input array. Iteration happens serially. If any promise in the input array is rejected the returned promise is rejected as well. - * - * Resolves to the original array unmodified, this method is meant to be used for side effects. If the iterator function returns a promise or a thenable, the result for the promise is awaited for before continuing with next iteration. - */ - // promise of array with promises of value - static each(values: Promise.Thenable[]>, iterator: (item: R, index: number, arrayLength: number) => U | Promise.Thenable): Promise; - // array with promises of value - static each(values: Promise.Thenable[], iterator: (item: R, index: number, arrayLength: number) => U | Promise.Thenable): Promise; - // array with values OR promise of array with values - static each(values: R[] | Promise.Thenable, iterator: (item: R, index: number, arrayLength: number) => U | Promise.Thenable): Promise; + /** + * Filter an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `filterer` function with the signature `(item, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. If any promise in the input array is rejected the returned promise is rejected as well. + * + * The return values from the filtered functions are coerced to booleans, with the exception of promises and thenables which are awaited for their eventual result. + * + * *The original array is not modified. + */ + // promise of array with promises of value + filter(values: PromiseLike[]>, filterer: (item: T, index: number, arrayLength: number) => PromiseLike, option?: Promise.ConcurrencyOption): Promise; + filter(values: PromiseLike[]>, filterer: (item: T, index: number, arrayLength: number) => boolean, option?: Promise.ConcurrencyOption): Promise; + + // promise of array with values + filter(values: PromiseLike, filterer: (item: T, index: number, arrayLength: number) => PromiseLike, option?: Promise.ConcurrencyOption): Promise; + filter(values: PromiseLike, filterer: (item: T, index: number, arrayLength: number) => boolean, option?: Promise.ConcurrencyOption): Promise; + + // array with promises of value + filter(values: PromiseLike[], filterer: (item: T, index: number, arrayLength: number) => PromiseLike, option?: Promise.ConcurrencyOption): Promise; + filter(values: PromiseLike[], filterer: (item: T, index: number, arrayLength: number) => boolean, option?: Promise.ConcurrencyOption): Promise; + + // array with values + filter(values: T[], filterer: (item: T, index: number, arrayLength: number) => PromiseLike, option?: Promise.ConcurrencyOption): Promise; + filter(values: T[], filterer: (item: T, index: number, arrayLength: number) => boolean, option?: Promise.ConcurrencyOption): Promise; + + /** + * Iterate over an array, or a promise of an array, which contains promises (or a mix of promises and values) with the given iterator function with the signature (item, index, value) where item is the resolved value of a respective promise in the input array. Iteration happens serially. If any promise in the input array is rejected the returned promise is rejected as well. + * + * Resolves to the original array unmodified, this method is meant to be used for side effects. If the iterator function returns a promise or a thenable, the result for the promise is awaited for before continuing with next iteration. + */ + // promise of array with promises of value + each(values: PromiseLike[]>, iterator: (item: T, index: number, arrayLength: number) => U | PromiseLike): Promise; + // array with promises of value + each(values: PromiseLike[], iterator: (item: T, index: number, arrayLength: number) => U | PromiseLike): Promise; + // array with values OR promise of array with values + each(values: T[] | PromiseLike, iterator: (item: T, index: number, arrayLength: number) => U | PromiseLike): Promise; } -declare module Promise { - export interface RangeError extends Error { - } - export interface CancellationError extends Error { - } - export interface TimeoutError extends Error { - } - export interface TypeError extends Error { - } - export interface RejectionError extends Error { - } - export interface OperationalError extends Error { - } +interface Promise extends PromiseLike, Promise.Inspection { + /** + * 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: T) => U | PromiseLike, onReject?: (error: any) => U | PromiseLike, onProgress?: (note: any) => any): Promise; + then(onFulfill: (value: T) => U | PromiseLike, onReject?: (error: any) => void | PromiseLike, onProgress?: (note: any) => any): Promise; - export interface ConcurrencyOption { - concurrency: number; - } - export interface SpreadOption { - spread: boolean; - } - export interface PromisifyAllOptions { - suffix?: string; - filter?: (name: string, func: Function, target?: any, passesDefaultFilter?: boolean) => boolean; - // The promisifier gets a reference to the original method and should return a function which returns a promise - promisifier?: (originalMethod: Function) => () => Thenable ; - } + /** + * 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) => T | PromiseLike | void | PromiseLike): Promise; + caught(onReject?: (error: any) => T | PromiseLike | void | PromiseLike): Promise; - // Ideally, we'd define e.g. "export class RangeError extends Error {}", - // but as Error is defined as an interface (not a class), TypeScript doesn't - // allow extending Error, only implementing it. - // However, if we want to catch() only a specific error type, we need to pass - // a constructor function to it. So, as a workaround, we define them here as such. - export function RangeError(): RangeError; - export function CancellationError(): CancellationError; - export function TimeoutError(): TimeoutError; - export function TypeError(): TypeError; - export function RejectionError(): RejectionError; - export function OperationalError(): OperationalError; + catch(onReject?: (error: any) => U | PromiseLike): Promise; + caught(onReject?: (error: any) => U | PromiseLike): Promise; - 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; - } + /** + * 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. + * + * This method also supports predicate-based filters. If you pass a predicate function instead of an error constructor, the predicate will receive the error as an argument. The return result of the predicate will be used determine whether the error handler should be called. + * + * Alias `.caught();` for compatibility with earlier ECMAScript version. + */ + catch(predicate: (error: any) => boolean, onReject: (error: any) => T | PromiseLike | void | PromiseLike): Promise; + caught(predicate: (error: any) => boolean, onReject: (error: any) => T | PromiseLike | void | PromiseLike): Promise; - export interface Resolver { - /** - * Returns a reference to the controlled promise that can be passed to clients. - */ - promise: Promise; + catch(predicate: (error: any) => boolean, onReject: (error: any) => U | PromiseLike): Promise; + caught(predicate: (error: any) => boolean, onReject: (error: any) => U | PromiseLike): Promise; - /** - * Resolve the underlying promise with `value` as the resolution value. If `value` is a thenable or a promise, the underlying promise will assume its state. - */ - resolve(value: R): void; - resolve(): void; + catch(ErrorClass: Function, onReject: (error: any) => T | PromiseLike | void | PromiseLike): Promise; + caught(ErrorClass: Function, onReject: (error: any) => T | PromiseLike | void | PromiseLike): Promise; - /** - * Reject the underlying promise with `reason` as the rejection reason. - */ - reject(reason: any): void; + catch(ErrorClass: Function, onReject: (error: any) => U | PromiseLike): Promise; + caught(ErrorClass: Function, onReject: (error: any) => U | PromiseLike): Promise; - /** - * Progress the underlying promise with `value` as the progression value. - */ - progress(value: any): void; - /** - * Gives you a callback representation of the `PromiseResolver`. Note that this is not a method but a property. The callback accepts error object in first argument and success values on the 2nd parameter and the rest, I.E. node js conventions. - * - * If the the callback is called with multiple success values, the resolver fullfills its promise with an array of the values. - */ - // TODO specify resolver callback - callback: (err: any, value: R, ...values: R[]) => void; - } + /** + * 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. + */ + error(onReject: (reason: any) => PromiseLike): Promise; + error(onReject: (reason: any) => U): Promise; - export interface Inspection { - /** - * See if the underlying promise was fulfilled at the creation time of this inspection object. - */ - isFulfilled(): boolean; + /** + * Pass a handler that will be called regardless of this promise's fate. Returns a new promise chained from this promise. There are special semantics for `.finally()` in that the final value cannot be modified from the handler. + * + * Alias `.lastly();` for compatibility with earlier ECMAScript version. + */ + finally(handler: () => PromiseLike): Promise; + finally(handler: () => U): Promise; - /** - * See if the underlying promise was rejected at the creation time of this inspection object. - */ - isRejected(): boolean; + lastly(handler: () => PromiseLike): Promise; + lastly(handler: () => U): Promise; - /** - * See if the underlying promise was defer at the creation time of this inspection object. - */ - isPending(): boolean; + /** + * Create a promise that follows this promise, but is bound to the given `thisArg` value. A bound promise will call its handlers with the bound value set to `this`. Additionally promises derived from a bound promise will also be bound promises with the same `thisArg` binding as the original promise. + */ + bind(thisArg: any): Promise; - /** - * Get the fulfillment value of the underlying promise. Throws if the promise wasn't fulfilled at the creation time of this inspection object. - * - * throws `TypeError` - */ - value(): R; + /** + * Like `.then()`, but any unhandled rejection that ends up here will be thrown as an error. + */ + done(onFulfilled: (value: T) => PromiseLike, onRejected: (error: any) => PromiseLike, onProgress?: (note: any) => any): void; + done(onFulfilled: (value: T) => PromiseLike, onRejected?: (error: any) => U, onProgress?: (note: any) => any): void; + done(onFulfilled: (value: T) => U, onRejected: (error: any) => PromiseLike, onProgress?: (note: any) => any): void; + done(onFulfilled?: (value: T) => U, onRejected?: (error: any) => U, onProgress?: (note: any) => any): void; - /** - * Get the rejection reason for the underlying promise. Throws if the promise wasn't rejected at the creation time of this inspection object. - * - * throws `TypeError` - */ - reason(): any; - } + /** + * Like `.finally()`, but not called for rejections. + */ + tap(onFulFill: (value: T) => PromiseLike): Promise; + tap(onFulfill: (value: T) => U): Promise; - /** - * Changes how bluebird schedules calls a-synchronously. - * - * @param scheduler Should be a function that asynchronously schedules - * the calling of the passed in function - */ - export function setScheduler(scheduler: (callback: (...args: any[]) => void) => void): void; + /** + * Shorthand for `.then(null, null, handler);`. Attach a progress handler that will be called if this promise is progressed. Returns a new promise chained from this promise. + */ + progressed(handler: (note: any) => any): Promise; + + /** + * Same as calling `Promise.delay(this, ms)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. + */ + delay(ms: number): Promise; + + /** + * Returns a promise that will be fulfilled with this promise's fulfillment value or rejection reason. However, if this promise is not fulfilled or rejected within `ms` milliseconds, the returned promise is rejected with a `Promise.TimeoutError` instance. + * + * You may specify a custom error message with the `message` parameter. + */ + timeout(ms: number, message?: string): Promise; + + /** + * Register a node-style callback on this promise. When this promise is is either fulfilled or rejected, the node callback will be called back with the node.js convention where error reason is the first argument and success value is the second argument. The error argument will be `null` in case of success. + * Returns back this promise instead of creating a new one. If the `callback` argument is not a function, this method does not do anything. + */ + nodeify(callback: (err: any, value?: T) => void, options?: Promise.SpreadOption): Promise; + nodeify(...sink: any[]): Promise; + + /** + * Marks this promise as cancellable. Promises by default are not cancellable after v0.11 and must be marked as such for `.cancel()` to have any effect. Marking a promise as cancellable is infectious and you don't need to remark any descendant promise. + */ + cancellable(): Promise; + + /** + * Cancel this promise. The cancellation will propagate to farthest cancellable ancestor promise which is still pending. + * + * That ancestor will then be rejected with a `CancellationError` (get a reference from `Promise.CancellationError`) object as the rejection reason. + * + * In a promise rejection handler you may check for a cancellation by seeing if the reason object has `.name === "Cancel"`. + * + * Promises are by default not cancellable. Use `.cancellable()` to mark a promise as cancellable. + */ + // TODO what to do with this? + 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. + */ + fork(onFulfilled: (value: T) => PromiseLike, onRejected: (error: any) => PromiseLike, onProgress?: (note: any) => any): Promise; + fork(onFulfilled: (value: T) => PromiseLike, onRejected?: (error: any) => U, onProgress?: (note: any) => any): Promise; + fork(onFulfilled: (value: T) => U, onRejected: (error: any) => PromiseLike, onProgress?: (note: any) => any): Promise; + fork(onFulfilled?: (value: T) => U, onRejected?: (error: any) => U, onProgress?: (note: any) => any): Promise; + + /** + * Create an uncancellable promise based on this promise. + */ + uncancellable(): Promise; + + /** + * See if this promise can be cancelled. + */ + isCancellable(): boolean; + + /** + * See if this `promise` has been fulfilled. + */ + isFulfilled(): boolean; + + /** + * See if this `promise` has been rejected. + */ + isRejected(): boolean; + + /** + * See if this `promise` is still defer. + */ + isPending(): boolean; + + /** + * See if this `promise` is resolved -> either fulfilled or rejected. + */ + isResolved(): boolean; + + /** + * Get the fulfillment value of the underlying promise. Throws if the promise isn't fulfilled yet. + * + * throws `TypeError` + */ + value(): T; + + /** + * Get the rejection reason for the underlying promise. Throws if the promise isn't rejected yet. + * + * throws `TypeError` + */ + reason(): any; + + /** + * Synchronously inspect the state of this `promise`. The `PromiseInspection` will represent the state of the promise as snapshotted at the time of calling `.inspect()`. + */ + inspect(): Promise.Inspection; + + /** + * This is a convenience method for doing: + * + * + * promise.then(function(obj){ + * return obj[propertyName].call(obj, arg...); + * }); + * + */ + call(propertyName: string, ...args: any[]): Promise; + + /** + * This is a convenience method for doing: + * + * + * promise.then(function(obj){ + * return obj[propertyName]; + * }); + * + */ + // TODO find way to fix get() + // get(propertyName: string): Promise; + + /** + * Convenience method for: + * + * + * .then(function() { + * return value; + * }); + * + * + * in the case where `value` doesn't change its value. That means `value` is bound at the time of calling `.return()` + * + * Alias `.thenReturn();` for compatibility with earlier ECMAScript version. + */ + return(): Promise; + thenReturn(): Promise; + return(value: U): Promise; + thenReturn(value: U): Promise; + + /** + * Convenience method for: + * + * + * .then(function() { + * throw reason; + * }); + * + * Same limitations apply as with `.return()`. + * + * Alias `.thenThrow();` for compatibility with earlier ECMAScript version. + */ + throw(reason: Error): Promise; + thenThrow(reason: Error): Promise; + + /** + * Convert to String. + */ + toString(): string; + + /** + * This is implicitly called by `JSON.stringify` when serializing the object. Returns a serialized representation of the `Promise`. + */ + toJSON(): Object; + + /** + * Like calling `.then`, but the fulfillment value or rejection reason is assumed to be an array, which is flattened to the formal parameters of the handlers. + */ + // TODO how to model instance.spread()? like Q? + spread(onFulfill: Function, onReject?: (reason: any) => PromiseLike): Promise; + spread(onFulfill: Function, onReject?: (reason: any) => U): Promise; + /* + // TODO or something like this? + spread(onFulfill: (...values: W[]) => PromiseLike, onReject?: (reason: any) => PromiseLike): Promise; + spread(onFulfill: (...values: W[]) => PromiseLike, onReject?: (reason: any) => U): Promise; + spread(onFulfill: (...values: W[]) => U, onReject?: (reason: any) => PromiseLike): Promise; + spread(onFulfill: (...values: W[]) => U, onReject?: (reason: any) => U): Promise; + */ + /** + * Same as calling `Promise.all(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. + */ + // TODO type inference from array-resolving promise? + all(): Promise; + + /** + * Same as calling `Promise.props(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. + */ + // TODO how to model instance.props()? + props(): Promise; + + /** + * Same as calling `Promise.settle(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. + */ + // TODO type inference from array-resolving promise? + settle(): Promise[]>; + + /** + * Same as calling `Promise.any(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. + */ + // TODO type inference from array-resolving promise? + any(): Promise; + + /** + * Same as calling `Promise.some(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. + */ + // TODO type inference from array-resolving promise? + some(count: number): Promise; + + /** + * Same as calling `Promise.race(thisPromise, count)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. + */ + // TODO type inference from array-resolving promise? + race(): Promise; + + /** + * Same as calling `Promise.map(thisPromise, mapper)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. + */ + // TODO type inference from array-resolving promise? + map(mapper: (item: Q, index: number, arrayLength: number) => PromiseLike, options?: Promise.ConcurrencyOption): Promise; + map(mapper: (item: Q, index: number, arrayLength: number) => U, options?: Promise.ConcurrencyOption): Promise; + + /** + * Same as `Promise.mapSeries(thisPromise, mapper)`. + */ + // TODO type inference from array-resolving promise? + mapSeries(mapper: (item: Q, index: number, arrayLength: number) => U | PromiseLike): Promise; + + /** + * Same as calling `Promise.reduce(thisPromise, Function reducer, initialValue)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. + */ + // TODO type inference from array-resolving promise? + reduce(reducer: (memo: U, item: Q, index: number, arrayLength: number) => PromiseLike, initialValue?: U): Promise; + reduce(reducer: (memo: U, item: Q, index: number, arrayLength: number) => U, initialValue?: U): Promise; + + /** + * Same as calling ``Promise.filter(thisPromise, filterer)``. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. + */ + // TODO type inference from array-resolving promise? + filter(filterer: (item: U, index: number, arrayLength: number) => PromiseLike, options?: Promise.ConcurrencyOption): Promise; + filter(filterer: (item: U, index: number, arrayLength: number) => boolean, options?: Promise.ConcurrencyOption): Promise; + + /** + * Same as calling ``Promise.each(thisPromise, iterator)``. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. + */ + each(iterator: (item: T, index: number, arrayLength: number) => U | PromiseLike): Promise; +} + +/** + * Don't use variable namespace such as variables, functions, and classes. + * If you use this namespace, it will conflict in es6. + */ +declare namespace Promise { + export interface RangeError extends Error { + } + export interface CancellationError extends Error { + } + export interface TimeoutError extends Error { + } + export interface TypeError extends Error { + } + export interface RejectionError extends Error { + } + export interface OperationalError extends Error { + } + + export interface ConcurrencyOption { + concurrency: number; + } + export interface SpreadOption { + spread: boolean; + } + export interface PromisifyAllOptions { + suffix?: string; + filter?: (name: string, func: Function, target?: any, passesDefaultFilter?: boolean) => boolean; + // The promisifier gets a reference to the original method and should return a function which returns a promise + promisifier?: (originalMethod: Function) => () => PromiseLike; + } + + export interface Resolver { + /** + * Returns a reference to the controlled promise that can be passed to clients. + */ + promise: Promise; + + /** + * Resolve the underlying promise with `value` as the resolution value. If `value` is a thenable or a promise, the underlying promise will assume its state. + */ + resolve(value: T): void; + resolve(): void; + + /** + * Reject the underlying promise with `reason` as the rejection reason. + */ + reject(reason: any): void; + + /** + * Progress the underlying promise with `value` as the progression value. + */ + progress(value: any): void; + + /** + * Gives you a callback representation of the `PromiseResolver`. Note that this is not a method but a property. The callback accepts error object in first argument and success values on the 2nd parameter and the rest, I.E. node js conventions. + * + * If the the callback is called with multiple success values, the resolver fullfills its promise with an array of the values. + */ + // TODO specify resolver callback + callback: (err: any, value: T, ...values: T[]) => void; + } + + export interface Inspection { + /** + * See if the underlying promise was fulfilled at the creation time of this inspection object. + */ + isFulfilled(): boolean; + + /** + * See if the underlying promise was rejected at the creation time of this inspection object. + */ + isRejected(): boolean; + + /** + * See if the underlying promise was defer at the creation time of this inspection object. + */ + isPending(): boolean; + + /** + * Get the fulfillment value of the underlying promise. Throws if the promise wasn't fulfilled at the creation time of this inspection object. + * + * throws `TypeError` + */ + value(): T; + + /** + * Get the rejection reason for the underlying promise. Throws if the promise wasn't rejected at the creation time of this inspection object. + * + * throws `TypeError` + */ + reason(): any; + } } declare module 'bluebird' { - export = Promise; + export = Promise; } diff --git a/body-parser/body-parser.d.ts b/body-parser/body-parser.d.ts index bf318d946..b7b4e7599 100644 --- a/body-parser/body-parser.d.ts +++ b/body-parser/body-parser.d.ts @@ -110,7 +110,7 @@ declare module "body-parser" { defaultCharset?: string; }): express.RequestHandler; - export function urlencoded(options?: { + export function urlencoded(options: { /** * if deflated bodies will be inflated. (default: true) */ @@ -128,11 +128,11 @@ declare module "body-parser" { */ verify?: (req: express.Request, res: express.Response, buf: Buffer, encoding: string) => void; /** - * parse extended syntax with the qs module. (default: true) + * parse extended syntax with the qs module. */ - extended?: boolean; + extended: boolean; }): express.RequestHandler; } export = bodyParser; -} \ No newline at end of file +} diff --git a/bookshelf/bookshelf-tests.ts b/bookshelf/bookshelf-tests.ts new file mode 100644 index 000000000..42faf0909 --- /dev/null +++ b/bookshelf/bookshelf-tests.ts @@ -0,0 +1,99 @@ +/// +/// + +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..5d91927db --- /dev/null +++ b/bookshelf/bookshelf.d.ts @@ -0,0 +1,314 @@ +// 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; + + plugin(name: string) : Bookshelf; + 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..eced1096f 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,42 @@ 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; + toolbarPlacement?: string; + showClear?: boolean; + ignoreReadonly?: 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; + destroy(): void; + toggle(): void; } } diff --git a/breeze/breeze.d.ts b/breeze/breeze.d.ts index 2a60df6d8..1cc587c2f 100644 --- a/breeze/breeze.d.ts +++ b/breeze/breeze.d.ts @@ -392,6 +392,7 @@ declare module breeze { constructor(config?: EntityManagerOptions); constructor(config?: string); + acceptChanges(): void; addEntity(entity: Entity): Entity; attachEntity(entity: Entity, entityState?: EntityStateSymbol, mergeStrategy?: MergeStrategySymbol): Entity; clear(): void; diff --git a/brorand/brorand-tests.ts b/brorand/brorand-tests.ts new file mode 100644 index 000000000..1adb7b114 --- /dev/null +++ b/brorand/brorand-tests.ts @@ -0,0 +1,13 @@ +/// + +import * as brorand from 'brorand'; + +{ + let result: Buffer|Uint8Array = brorand(42); +} + +{ + let Rand = new brorand.Rand({getByte: () => 255}); + let rand: {getByte: () => number} = Rand.rand; + let result: Buffer|Uint8Array = Rand.generate(42); +} diff --git a/brorand/brorand.d.ts b/brorand/brorand.d.ts new file mode 100644 index 000000000..aa0e6ff5d --- /dev/null +++ b/brorand/brorand.d.ts @@ -0,0 +1,30 @@ +// Type definitions for Brorand v1.0.5 +// Project: https://github.com/indutny/brorand +// Definitions by: Ilya Mochalov +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "brorand" { + type rand = {getByte: () => number}; + + interface RandStatic { + new (rand: rand): RandInstance; + } + + interface RandInstance { + rand: rand; + generate(len: number): Buffer|Uint8Array; + } + + interface BrorandStatic { + (len: number): Buffer|Uint8Array; + Rand: RandStatic; + } + + namespace Brorand {} + + let Brorand: BrorandStatic; + + export = Brorand; +} diff --git a/browser-sync/browser-sync-tests.ts b/browser-sync/browser-sync-tests.ts index 50042410f..822c941d9 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: "./" @@ -71,6 +78,8 @@ evt.on("init", function () { browserSync(config); +var has = browserSync.has("My server"); + var bs = browserSync.create(); bs.init({ @@ -79,7 +88,7 @@ bs.init({ bs.reload(); -function browserSyncInit() { +function browserSyncInit(): browserSync.BrowserSyncInstance { var browser = browserSync.create(); browser.init(); console.log(browser.name); @@ -88,3 +97,26 @@ function browserSyncInit() { } var browser = browserSyncInit(); browser.exit(); + +// Stream method. + +// -- No options. +browser.stream(); + +// -- "once" option. +browser.stream({once: true}); + +// -- "match" option (string). +browser.stream({match: "**/*.js"}); + +// -- "match" option (RegExp). +browser.stream({match: /\.js$/}); + +// -- "match" option (function). +browser.stream({match: (testString) => true}); + +// -- "match" option (array). +browser.stream({match: ["**/*.js", /\.js$/, (testString) => true]}); + +// -- Both options. +browser.stream({once: true, match: ["**/*.js", /\.js$/, (testString) => true]}); diff --git a/browser-sync/browser-sync.d.ts b/browser-sync/browser-sync.d.ts index 03b751fab..6640090bc 100644 --- a/browser-sync/browser-sync.d.ts +++ b/browser-sync/browser-sync.d.ts @@ -5,410 +5,418 @@ /// /// +/// declare module "browser-sync" { import chokidar = require("chokidar"); import fs = require("fs"); import http = require("http"); + import mm = require("micromatch"); - 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?: chokidar.WatchOptions; + /** + * 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; + middleware?: MiddlewareHandler | MiddlewareHandler[]; + } + + interface Hash { + [path: string]: T; + } + + 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 StreamOptions { + once?: boolean; + match?: mm.Pattern | mm.Pattern[]; + } + + 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; + /** + * Check if an instance has been created. + * @param name the name of the instance + */ + has(name: string): boolean; + } + + 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?: StreamOptions): 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/bs58/bs58-tests.ts b/bs58/bs58-tests.ts new file mode 100644 index 000000000..801646926 --- /dev/null +++ b/bs58/bs58-tests.ts @@ -0,0 +1,12 @@ +/// + +import * as bs58 from 'bs58'; + +{ + let encoded: string; + + encoded = bs58.encode([255]); + encoded = bs58.encode({0: 255, length: 1}); +} + +let decoded: number[] = bs58.decode('5Q'); diff --git a/bs58/bs58.d.ts b/bs58/bs58.d.ts new file mode 100644 index 000000000..02b1cd318 --- /dev/null +++ b/bs58/bs58.d.ts @@ -0,0 +1,14 @@ +// Type definitions for bs58 3.0.0 +// Project: https://github.com/cryptocoinjs/bs58 +// Definitions by: Ilya Mochalov +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "bs58" { + namespace base58 {} + + let base58: BaseX.BaseConverter; + + export = base58; +} diff --git a/bson/bson-tests.ts b/bson/bson-tests.ts new file mode 100644 index 000000000..a454ed236 --- /dev/null +++ b/bson/bson-tests.ts @@ -0,0 +1,23 @@ +/// + +import * as bson from 'bson'; + +let BSON = new bson.BSONPure.BSON(); +let Long = bson.BSONPure.Long; + +let doc = {long: Long.fromNumber(100)} + +// Serialize a document +let data = BSON.serialize(doc, false, true, false); +console.log("data:", data); + +// Deserialize the resulting Buffer +let doc_2 = BSON.deserialize(data); +console.log("doc_2:", doc_2); + + +BSON = new bson.BSONNative.BSON(); +data = BSON.serialize(doc); +doc_2 = BSON.deserialize(data); + + diff --git a/bson/bson.d.ts b/bson/bson.d.ts new file mode 100644 index 000000000..e92801835 --- /dev/null +++ b/bson/bson.d.ts @@ -0,0 +1,133 @@ +// Type definitions for bson 0.4.21 +// Project: https://github.com/mongodb/js-bson +// Definitions by: Hiroki Horiuchi +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + + +declare module 'bson' { + + module bson { + + export module BSONPure { + + export interface DeserializeOptions { + /** {Boolean, default:false}, evaluate functions in the BSON document scoped to the object deserialized. */ + evalFunctions?: boolean; + /** {Boolean, default:false}, cache evaluated functions for reuse. */ + cacheFunctions?: boolean; + /** {Boolean, default:false}, use a crc32 code for caching, otherwise use the string of the function. */ + cacheFunctionsCrc32?: boolean; + /** {Boolean, default:false}, deserialize Binary data directly into node.js Buffer object. */ + promoteBuffers?: boolean; + } + export class BSON { + /** + * @param {Object} object the Javascript object to serialize. + * @param {Boolean} checkKeys the serializer will check if keys are valid. + * @param {Boolean} asBuffer return the serialized object as a Buffer object (ignore). + * @param {Boolean} serializeFunctions serialize the javascript functions (default:false) + * @return {Buffer} returns a TypedArray or Array depending on what your browser supports + */ + serialize(object: any, checkKeys?: boolean, asBuffer?: boolean, serializeFunctions?: boolean): Buffer; + deserialize(buffer: Buffer, options?: DeserializeOptions, isArray?: boolean): any; + } + + + export interface Binary {} + export interface BinaryStatic { + SUBTYPE_DEFAULT: number; + SUBTYPE_FUNCTION: number; + SUBTYPE_BYTE_ARRAY: number; + SUBTYPE_UUID_OLD: number; + SUBTYPE_UUID: number; + SUBTYPE_MD5: number; + SUBTYPE_USER_DEFINED: number; + + new (buffer: Buffer, subType?: number): Binary; + } + export let Binary: BinaryStatic; + + export interface Code {} + export interface CodeStatic { + new (code: string | Function, scope?: any): Code; + } + export let Code: CodeStatic; + + export interface DBRef {} + export interface DBRefStatic { + new (namespace: string, oid: ObjectID, db?: string): DBRef; + } + export let DBRef: DBRefStatic; + + export interface Double {} + export interface DoubleStatic { + new (value: number): Double; + } + export let Double: DoubleStatic; + + export interface Long {} + export interface LongStatic { + new (low: number, high: number): Long; + fromInt(i: number): Long; + fromNumber(n: number): Long; + fromBits(lowBits: number, highBits: number): Long; + fromString(s: string, opt_radix?: number): Long; + } + export let Long: LongStatic; + + export interface MaxKey {} + export interface MaxKeyStatic { + new (): MaxKey; + } + export let MaxKey: MaxKeyStatic; + + export interface MinKey {} + export interface MinKeyStatic { + new (): MinKey; + } + export let MinKey: MinKeyStatic; + + export interface ObjectID {} + export interface ObjectIDStatic { + new (id?: number | string | ObjectID): ObjectID; + createPk(): ObjectID; + createFromTime(time: number): ObjectID; + createFromHexString(hexString: string): ObjectID; + isValid(id: number | string | ObjectID): boolean; + } + export let ObjectID: ObjectIDStatic; + export let ObjectId: ObjectIDStatic; + + export interface BSONRegExp {} + export interface BSONRegExpStatic { + new (pattern: string, options: string): BSONRegExp; + } + export let BSONRegExp: BSONRegExpStatic; + + export interface Symbol {} + export interface SymbolStatic { + new (value: string): Symbol; + } + export let Symbol: SymbolStatic; + + export interface Timestamp {} + export interface TimestampStatic { + new (low: number, high: number): Timestamp; + fromInt(i: number): Timestamp; + fromNumber(n: number): Timestamp; + fromBits(lowBits: number, highBits: number): Timestamp; + fromString(s: string, opt_radix?: number): Timestamp; + } + export let Timestamp: TimestampStatic; + + } + + export let BSONNative: typeof BSONPure; + + } + + export = bson; +} + 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/bull/bull-tests.ts.tscparams b/bull/bull-tests.ts.tscparams new file mode 100644 index 000000000..6641df12d --- /dev/null +++ b/bull/bull-tests.ts.tscparams @@ -0,0 +1 @@ +--target es5 --noImplicitAny --module commonjs diff --git a/bull/bull-tests.tsx b/bull/bull-tests.tsx new file mode 100644 index 000000000..bd25efc0c --- /dev/null +++ b/bull/bull-tests.tsx @@ -0,0 +1,102 @@ +/** + * Created by Bruno Grieder + */ + +/// + + +import * as Queue from "bull" + +var videoQueue = Queue( 'video transcoding', 6379, '127.0.0.1' ); +var audioQueue = Queue( 'audio transcoding', 6379, '127.0.0.1' ); +var imageQueue = Queue( 'image transcoding', 6379, '127.0.0.1' ); + +videoQueue.process( ( job: Queue.Job, done: Queue.DoneCallback ) => { + + // job.data contains the custom data passed when the job was created + // job.jobId contains id of this job. + + // transcode video asynchronously and report progress + job.progress( 42 ); + + // call done when finished + done(); + + // or give a error if error + done( Error( 'error transcoding' ) ); + + // or pass it a result + done( null, { framerate: 29.5 /* etc... */ } ); + + // If the job throws an unhandled exception it is also handled correctly + throw (Error( 'some unexpected error' )); +} ); + +audioQueue.process( ( job: Queue.Job, done: Queue.DoneCallback ) => { + // transcode audio asynchronously and report progress + job.progress( 42 ); + + // call done when finished + done(); + + // or give a error if error + done( Error( 'error transcoding' ) ); + + // or pass it a result + done( null, { samplerate: 48000 /* etc... */ } ); + + // If the job throws an unhandled exception it is also handled correctly + throw (Error( 'some unexpected error' )); +} ); + +imageQueue.process( ( job: Queue.Job, done: Queue.DoneCallback ) => { + // transcode image asynchronously and report progress + job.progress( 42 ); + + // call done when finished + done(); + + // or give a error if error + done( Error( 'error transcoding' ) ); + + // or pass it a result + done( null, { width: 1280, height: 720 /* etc... */ } ); + + // If the job throws an unhandled exception it is also handled correctly + throw (Error( 'some unexpected error' )); +} ); + +videoQueue.add( { video: 'http://example.com/video1.mov' } ); +audioQueue.add( { audio: 'http://example.com/audio1.mp3' } ); +imageQueue.add( { image: 'http://example.com/image1.tiff' } ); + + +////////////////////////////////////////////////////////////////////////////////// +// +// Using Promises +// +////////////////////////////////////////////////////////////////////////////////// + +const fetchVideo = ( url: string ): Promise => { return null } +const transcodeVideo = ( data: any ): Promise => { return null } + +interface VideoJob extends Queue.Job { + data: {url: string} +} + + +videoQueue.process( ( job: VideoJob ) => { // don't forget to remove the done callback! + // Simply return a promise + return fetchVideo( job.data.url ).then( transcodeVideo ); + + // Handles promise rejection + return Promise.reject( new Error( 'error transcoding' ) ); + + // Passes the value the promise is resolved with to the "completed" event + return Promise.resolve( { framerate: 29.5 /* etc... */ } ); + + // If the job throws an unhandled exception it is also handled correctly + throw new Error( 'some unexpected error' ); + // same as + return Promise.reject( new Error( 'some unexpected error' ) ); +} ); diff --git a/bull/bull.d.ts b/bull/bull.d.ts new file mode 100644 index 000000000..b867c1123 --- /dev/null +++ b/bull/bull.d.ts @@ -0,0 +1,311 @@ +// Type definitions for bull 0.7.0 +// Project: https://github.com/OptimalBits/bull +// Definitions by: Bruno Grieder +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + + +declare module "bull" { + + import * as Redis from "redis"; + + /** + * This is the Queue constructor. + * It creates a new Queue that is persisted in Redis. + * Everytime the same queue is instantiated it tries to process all the old jobs that may exist from a previous unfinished session. + */ + function Bull(queueName: string, redisPort: number, redisHost: string, redisOpt?: Redis.ClientOpts): Bull.Queue; + + module Bull { + + export interface DoneCallback { + (error?: Error, value?: any): void + } + + export interface Job { + + id: string + + /** + * The custom data passed when the job was created + */ + data: Object; + + /** + * Report progress on a job + */ + progress(value: any): Promise; + + /** + * Removes a Job from the queue from all the lists where it may be included. + * @returns {Promise} A promise that resolves when the job is removed. + */ + remove(): Promise; + + /** + * Rerun a Job that has failed. + * @returns {Promise} A promise that resolves when the job is scheduled for retry. + */ + retry(): Promise; + } + + export interface Backoff { + + /** + * Backoff type, which can be either `fixed` or `exponential` + */ + type: string + + /** + * Backoff delay, in milliseconds + */ + delay: number; + } + + export interface AddOptions { + /** + * An amount of miliseconds to wait until this job can be processed. + * Note that for accurate delays, both server and clients should have their clocks synchronized + */ + delay?: number; + + /** + * A number of attempts to retry if the job fails [optional] + */ + attempts?: number; + + /** + * Backoff setting for automatic retries if the job fails + */ + backoff?: number | Backoff + + /** + * A boolean which, if true, adds the job to the right + * of the queue instead of the left (default false) + */ + lifo?: boolean; + + /** + * The number of milliseconds after which the job should be fail with a timeout error + */ + timeout?: number; + } + + export interface Queue { + + /** + * Defines a processing function for the jobs placed into a given Queue. + * + * The callback is called everytime a job is placed in the queue. + * It is passed an instance of the job as first argument. + * + * The done callback can be called with an Error instance, to signal that the job did not complete successfully, + * or with a result as second argument as second argument (e.g.: done(null, result);) when the job is successful. + * Errors will be passed as a second argument to the "failed" event; + * results, as a second argument to the "completed" event. + * + * concurrency: Bull will then call you handler in parallel respecting this max number. + */ + process(concurrency: number, callback: (job: Job, done: DoneCallback) => void): void; + + /** + * Defines a processing function for the jobs placed into a given Queue. + * + * The callback is called everytime a job is placed in the queue. + * It is passed an instance of the job as first argument. + * + * The done callback can be called with an Error instance, to signal that the job did not complete successfully, + * or with a result as second argument as second argument (e.g.: done(null, result);) when the job is successful. + * Errors will be passed as a second argument to the "failed" event; + * results, as a second argument to the "completed" event. + */ + process(callback: (job: Job, done: DoneCallback) => void): void; + + /** + * Defines a processing function for the jobs placed into a given Queue. + * + * The callback is called everytime a job is placed in the queue. + * It is passed an instance of the job as first argument. + * + * A promise must be returned to signal job completion. + * If the promise is rejected, the error will be passed as a second argument to the "failed" event. + * If it is resolved, its value will be the "completed" event's second argument. + * + * concurrency: Bull will then call you handler in parallel respecting this max number. + */ + process(concurrency: number, callback: (job: Job) => void): Promise; + + /** + * Defines a processing function for the jobs placed into a given Queue. + * + * The callback is called everytime a job is placed in the queue. + * It is passed an instance of the job as first argument. + * + * A promise must be returned to signal job completion. + * If the promise is rejected, the error will be passed as a second argument to the "failed" event. + * If it is resolved, its value will be the "completed" event's second argument. + */ + process(callback: (job: Job) => void): Promise; + + // process(callback: (job: Job, done?: DoneCallback) => void): Promise; + + /** + * Creates a new job and adds it to the queue. + * If the queue is empty the job will be executed directly, + * otherwise it will be placed in the queue and executed as soon as possible. + */ + add(data: Object, opts?: AddOptions): Promise; + + /** + * Returns a promise that resolves when the queue is paused. + * The pause is global, meaning that all workers in all queue instances for a given queue will be paused. + * A paused queue will not process new jobs until resumed, + * but current jobs being processed will continue until they are finalized. + * + * Pausing a queue that is already paused does nothing. + */ + pause(): Promise; + + /** + * Returns a promise that resolves when the queue is resumed after being paused. + * The resume is global, meaning that all workers in all queue instances for a given queue will be resumed. + * + * Resuming a queue that is not paused does nothing. + */ + resume(): Promise; + + /** + * Returns a promise that returns the number of jobs in the queue, waiting or paused. + * Since there may be other processes adding or processing jobs, this value may be true only for a very small amount of time. + */ + count(): Promise; + + /** + * Empties a queue deleting all the input lists and associated jobs. + */ + empty(): Promise; + + /** + * Closes the underlying redis client. Use this to perform a graceful shutdown. + * + * `close` can be called from anywhere, with one caveat: + * if called from within a job handler the queue won't close until after the job has been processed + */ + close(): Promise; + + /** + * Returns a promise that will return the job instance associated with the jobId parameter. + * If the specified job cannot be located, the promise callback parameter will be set to null. + */ + getJob(jobId: string): Promise; + + /** + * Tells the queue remove all jobs created outside of a grace period in milliseconds. + * You can clean the jobs with the following states: completed, waiting, active, delayed, and failed. + */ + clean(gracePeriod: number, jobsState?: string): Promise; + + /** + * Listens to queue events + * 'ready', 'error', 'activ', 'progress', 'completed', 'failed', 'paused', 'resumed', 'cleaned' + */ + on(eventName: string, callback: EventCallback): void; + } + + interface EventCallback { + (...args: any[]): void + } + + interface ReadyEventCallback extends EventCallback { + (): void; + } + + interface ErrorEventCallback extends EventCallback { + (error: Error): void; + } + + interface JobPromise { + /** + * Abort this job + */ + cancel(): void + } + + interface ActiveEventCallback extends EventCallback { + (job: Job, jobPromise: JobPromise): void; + } + + interface ProgressEventCallback extends EventCallback { + (job: Job, progress: any): void; + } + + interface CompletedEventCallback extends EventCallback { + (job: Job, result: Object): void; + } + + interface FailedEventCallback extends EventCallback { + (job: Job, error: Error): void; + } + + interface PausedEventCallback extends EventCallback { + (): void; + } + + interface ResumedEventCallback extends EventCallback { + (job?: Job): void; + } + + /** + * @see clean() for details + */ + interface CleanedEventCallback extends EventCallback { + (jobs: Job[], type: string): void; + } + } + + export = Bull; +} + +declare module "bull/lib/priority-queue" { + + import * as Bull from "bull"; + import * as Redis from "redis"; + + /** + * This is the Queue constructor of priority queue. + * + * It works same a normal queue, with same function and parameters. + * The only difference is that the Queue#add() allow an options opts.priority + * that could take ["low", "normal", "medium", "hight", "critical"]. If no options provider, "normal" will be taken. + * + * The priority queue will process more often highter priority jobs than lower. + */ + function PQueue(queueName: string, redisPort: number, redisHost: string, redisOpt?: Redis.ClientOpts): PQueue.PriorityQueue; + + module PQueue { + + export interface AddOptions extends Bull.AddOptions { + + /** + * "low", "normal", "medium", "high", "critical" + */ + priority?: string; + } + + + export interface PriorityQueue extends Bull.Queue { + + /** + * Creates a new job and adds it to the queue. + * If the queue is empty the job will be executed directly, + * otherwise it will be placed in the queue and executed as soon as possible. + */ + add(data: Object, opts?: PQueue.AddOptions): Promise; + + } + } + + export = PQueue; +} 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/bytes/bytes-tests.ts b/bytes/bytes-tests.ts new file mode 100644 index 000000000..4a981aee4 --- /dev/null +++ b/bytes/bytes-tests.ts @@ -0,0 +1,16 @@ +/// + +import bytes = require('bytes'); + +// 1024*1024 = 1048576 +console.log(bytes(104857)); +console.log(bytes(104857, { thousandsSeparator: ' ' })); + +console.log(bytes.format(104857)); +console.log(bytes.format(104857, { thousandsSeparator: ' ' })); + +console.log(bytes('1024kb')); +console.log(bytes(1024)); + +console.log(bytes.parse('1024kb')); +console.log(bytes.parse(1024)); \ No newline at end of file diff --git a/bytes/bytes.d.ts b/bytes/bytes.d.ts new file mode 100644 index 000000000..0d8a63cf7 --- /dev/null +++ b/bytes/bytes.d.ts @@ -0,0 +1,62 @@ +// Type definitions for bytes v2.1.0 +// Project: https://github.com/visionmedia/bytes.js +// Definitions by: Zhiyuan Wang +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module 'bytes' { + + /** + *Convert the given value in bytes into a string. + * + * @param {number} value + * @param {{ + * thousandsSeparator: [string] + * }} [options] bytes options. + * + * @returns {string} + */ + function bytes(value: number, options?: { thousandsSeparator: string }): string; + + /** + *Parse string to an integer in bytes. + * + * @param {string} value + * @returns {number} + */ + function bytes(value: string): number; + + module bytes { + + /** + * Format the given value in bytes into a string. + * + * If the value is negative, take Math.abs(). If it is a float, + * it is rounded. + * + * @param {number} value + * @param {BytesFormatOptions} [options] + */ + + function format(value: number, options?: { thousandsSeparator: string }): string; + + /** + * Just return the input number value. + * + * @param {number} value + * @return {number} + */ + function parse(value: number): number; + + /** + * Parse the string value into an integer in bytes. + * + * If no unit is given, it is assumed the value is in bytes. + * + * @param {string} value + * @return {number} + */ + function parse(value: string): number; + } + + export = bytes; +} \ No newline at end of file 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/calq/calq.d.ts b/calq/calq.d.ts index c574df58f..331b89720 100644 --- a/calq/calq.d.ts +++ b/calq/calq.d.ts @@ -19,7 +19,9 @@ declare module Calq trackSale(action:string, params:{[index:string]:any}, currency:string, amount:number):void; trackHTMLLink(action:string, params?:{[index:string]:any}):void; trackPageView(action?:string):void; - setGlobalProperty(name:string,value:any):void; + + setGlobalProperty(name:string, value:any):void; + setGlobalProperty(params: {[index:string]: any}):void; } interface User diff --git a/camelcase/camelcase-tests.ts b/camelcase/camelcase-tests.ts new file mode 100644 index 000000000..bb2ce9282 --- /dev/null +++ b/camelcase/camelcase-tests.ts @@ -0,0 +1,12 @@ +/// + +import camelCase from 'camelcase'; + +camelCase('foo-bar'); +camelCase('foo_bar'); +camelCase('Foo-Bar'); +camelCase('--foo.bar'); +camelCase('__foo__bar__'); +camelCase('foo bar'); +camelCase('foo', 'bar'); +camelCase('__foo__', '--bar'); diff --git a/camelcase/camelcase.d.ts b/camelcase/camelcase.d.ts new file mode 100644 index 000000000..c13eab8a5 --- /dev/null +++ b/camelcase/camelcase.d.ts @@ -0,0 +1,8 @@ +// Type definitions for camelcase +// Project: https://github.com/sindresorhus/camelcase +// Definitions by: Sam Verschueren +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "camelcase" { + export default function camelcase(...args: string[]): string; +} 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/chai-string/chai-string-tests.ts b/chai-string/chai-string-tests.ts new file mode 100644 index 000000000..f5380b076 --- /dev/null +++ b/chai-string/chai-string-tests.ts @@ -0,0 +1,128 @@ +/// +/// +/// + +var should = chai.should(); +var assert = chai.assert; +var expect = chai.expect; + +var chai_string = require('chai-string'); +chai.use(chai_string); + +describe('chai-string', function() { + + describe('#startsWith', function() { + + it('check that', function() { + var obj = { foo: 'hello world' }; + expect(obj).to.have.property('foo').that.startsWith('hello'); + }); + + }); + + describe('#startWith', function() { + + it('should return true', function() { + var str = 'abcdef', + prefix = 'abc'; + str.should.startWith(prefix); + }); + + it('should return false', function() { + var str = 'abcdef', + prefix = 'cba'; + str.should.not.startWith(prefix); + }); + + }); + + describe('#endWith', function() { + + it('should return true', function() { + var str = 'abcdef', + suffix = 'def'; + str.should.endWith(suffix); + }); + + it('should return false', function() { + var str = 'abcdef', + suffix = 'fed'; + str.should.not.endWith(suffix); + }); + + }); + + describe('tdd alias', function() { + + beforeEach(function() { + this.str = 'abcdef'; + this.str2 = 'a\nb\tc\r d ef'; + }); + + it('.startsWith', function() { + assert.startsWith(this.str, 'abc'); + }); + + it('.notStartsWith', function() { + assert.notStartsWith(this.str, 'cba'); + }); + + it('.endsWith', function() { + assert.endsWith(this.str, 'def'); + }); + + it('.notEndsWith', function() { + assert.notEndsWith(this.str, 'fed'); + }); + + it('.equalIgnoreCase', function() { + assert.equalIgnoreCase(this.str, 'AbCdEf'); + }); + + it('.notEqualIgnoreCase', function() { + assert.notEqualIgnoreCase(this.str, 'abDDD'); + }); + + it('.equalIgnoreSpaces', function() { + assert.equalIgnoreSpaces(this.str, this.str2); + }); + + it('.notEqualIgnoreSpaces', function() { + assert.notEqualIgnoreSpaces(this.str, this.str2 + 'g'); + }); + + it('.singleLine', function() { + assert.singleLine(this.str); + }); + + it('.notSingleLine', function() { + assert.notSingleLine("abc\ndef"); + }); + + it('.reverseOf', function() { + assert.reverseOf(this.str, 'fedcba'); + }); + + it('.notReverseOf', function() { + assert.notReverseOf(this.str, 'aaaaa'); + }); + + it('.palindrome', function() { + assert.palindrome('abcba'); + assert.palindrome('abccba'); + assert.palindrome(''); + }); + + it('.notPalindrome', function() { + assert.notPalindrome(this.str); + }); + + it('.entriesCount', function() { + assert.entriesCount('abcabd', 'ab', 2); + assert.entriesCount('ababd', 'ab', 2); + assert.entriesCount('abab', 'ab', 2); + assert.entriesCount('', 'ab', 0); + }); + + }); +}); diff --git a/chai-string/chai-string.d.ts b/chai-string/chai-string.d.ts new file mode 100644 index 000000000..fd1766523 --- /dev/null +++ b/chai-string/chai-string.d.ts @@ -0,0 +1,45 @@ +// Type definitions for chai-string 1.1.4 +// Project: https://github.com/onechiporenko/chai-string +// Definitions by: Nick Malaguti +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module Chai { + interface Assertion extends LanguageChains, NumericComparison, TypeComparison { + startsWith(expected: string, message?: string): Assertion; + startWith(expected: string, message?: string): Assertion; + endsWith(expected: string, message?: string): Assertion; + endWith(expected: string, message?: string): Assertion; + equalIgnoreCase(expected: string, message?: string): Assertion; + equalIgnoreSpaces(expected: string, message?: string): Assertion; + singleLine(message?: string): Assertion; + reverseOf(message?: string): Assertion; + palindrome(message?: string): Assertion; + entriesCount(substr: string, expected: number, message?: string): Assertion; + } + + export interface Assert { + startsWith(val: string, exp: string, msg?: string): void; + notStartsWith(val: string, exp: string, msg?: string): void; + endsWith(val: string, exp: string, msg?: string): void; + notEndsWith(val: string, exp: string, msg?: string): void; + equalIgnoreCase(val: string, exp: string, msg?: string): void; + notEqualIgnoreCase(val: string, exp: string, msg?: string): void; + equalIgnoreSpaces(val: string, exp: string, msg?: string): void; + notEqualIgnoreSpaces(val: string, exp: string, msg?: string): void; + singleLine(val: string, msg?: string): void; + notSingleLine(val: string, msg?: string): void; + reverseOf(val: string, exp: string, msg?: string): void; + notReverseOf(val: string, exp: string, msg?: string): void; + palindrome(val: string, msg?: string): void; + notPalindrome(val: string, msg?: string): void; + entriesCount(str: string, substr: string, count: number, msg?: string): void; + } +} + +declare module 'chai-string' { + function chaiString(chai: any, utils: any): void; + namespace chaiString {} + export = chaiString; +} diff --git a/chai-things/chai-things-tests.ts b/chai-things/chai-things-tests.ts new file mode 100644 index 000000000..de6a4c3ff --- /dev/null +++ b/chai-things/chai-things-tests.ts @@ -0,0 +1,59 @@ +/// + +import chai = require('chai'); +import chaiThings = require('chai-things'); + +chai.use(chaiThings); + +function test_somethingSyntax() { + [].should.not.include.something(); + [].should.not.include.something.that.equals(1); + + var array = [{ a: 1 }, { b: 2 }]; + array.should.include.something(); + array.should.include.something.that.deep.equals({ b: 2 }); + array.should.include.something.that.not.deep.equals({ b: 2 }); + array.should.not.include.something.that.deep.equals({ c: 3 }); + array.should.include.something.that.not.deep.equals({ c: 3 }); + array.should.include.something.with.property('b', 2); + array.should.not.include.something.with.property('b', 3); + + var array2 = [{ a: 'b' }, { a: 'b' }]; + array2.should.include.something.that.have.property("a"); + array2.should.include.something.that.have.property("a").not.equal("d"); +} + +function test_somethingVariantsSyntax() { + [].should.not.include.any(); + [].should.not.include.any.that.deep.equal({ b: 2 }); + + var array = [{ a: 1 }, { b: 2 }]; + array.should.include.a.thing(); + array.should.include.a.thing.that.deep.equals({ b: 2 }); + array.should.include.an.item(); + array.should.include.an.item.that.deep.equals({ b: 2 }); + array.should.include.one.that.deep.equals({ b: 2 }); + array.should.include.some(); + array.should.include.some.that.deep.equal({ b: 2 }); +} + +function test_allSyntax() { + [].should.all.equal(1); + [].should.all.not.equal(1); + + var array = [1, 1]; + array.should.all.equal(1); + array.should.all.not.equal(2); + array.should.not.all.equal(2); + array.should.not.all.not.equal(1); + + var array2 = [1, 2]; + array2.should.not.all.equal(1); + array2.should.not.all.equal(2); + array2.should.not.all.not.equal(1); + array2.should.not.all.not.equal(2); + + var array3 = [{ a: 'b' }, { a: 'c' }]; + array3.should.all.have.property("a"); + array3.should.all.have.property("a").not.equal("d"); +} \ No newline at end of file diff --git a/chai-things/chai-things.d.ts b/chai-things/chai-things.d.ts new file mode 100644 index 000000000..bc2b89c46 --- /dev/null +++ b/chai-things/chai-things.d.ts @@ -0,0 +1,55 @@ +// Type definitions for chai-things +// Project: https://github.com/chaijs/chai-things +// Definitions by: David Broder-Rodgers +// Definitions: https://github.com/DavidBR-SW/DefinitelyTyped + +/// + +declare module Chai { + interface ArrayAssertion { + include: ArrayInclude; + contain: ArrayInclude; + not: ArrayAssertion; + all: Assertion; + } + + interface ArrayInclude { + (item: any): any; + a: Item; + an: Item; + one: Something; + some: Something; + something: Something; + any: Anything; + } + + interface Anything extends Assertion { + (): any; + that: Assertion + with: Assertion + } + + interface Something extends Assertion { + (): any; + that: Assertion + with: Assertion + } + + interface Item { + item: Something; + thing: Something; + } + + interface Deep { + equals: Equal; + } +} + +interface Array { + should: Chai.ArrayAssertion; +} + +declare module "chai-things" { + function chaiThings(chai: any, utils: any): void; + export = chaiThings; +} diff --git a/chai/chai-3.2.0-tests.ts b/chai/chai-3.2.0-tests.ts new file mode 100644 index 000000000..9b646b152 --- /dev/null +++ b/chai/chai-3.2.0-tests.ts @@ -0,0 +1,1948 @@ +/// +import chai = require('chai'); + +// ReSharper disable WrongExpressionStatement + +var expect = chai.expect; +var assert = chai.assert; +var should = chai.should(); +declare var err: Function; + +function chaiVersion() { + expect(chai).to.have.property('version'); + (<{}>chai).should.have.property('version'); +} + +function assertion() { + expect('test').to.be.a('string'); + 'test'.should.be.a('string'); + expect('foo').to.equal('foo'); + 'foo'.should.equal('foo'); + should.equal('foo', 'foo'); +} + +function fail() { + err(() => { + should.fail('foo', 'bar'); + }, 'expected fail to throw an AssertionError'); + err(() => { + should.fail('foo', 'bar', 'should fail'); + }, 'expected fail to throw an AssertionError'); + err(() => { + should.fail('foo', 'bar', 'should fail', 'equal'); + }, 'expected fail to throw an AssertionError'); + + err(() => { + expect.fail('foo', 'bar'); + }, 'expected fail to throw an AssertionError'); + err(() => { + expect.fail('foo', 'bar', 'should fail'); + }, 'expected fail to throw an AssertionError'); + err(() => { + expect.fail('foo', 'bar', 'should fail', 'equal'); + }, 'expected fail to throw an AssertionError'); +} + +// ReSharper disable once InconsistentNaming +function _true() { + expect(true).to.be.true; + true.should.be.true; + expect(false).to.not.be.true; + false.should.not.be.true; + expect(1).to.not.be.true; + (1).should.not.be.true; + + err(() => { + expect('test').to.be.true; + 'test'.should.be.true; + }, 'expected \'test\' to be true'); +} + +function ok() { + expect(true).to.be.ok; + true.should.be.ok; + expect(false).to.not.be.ok; + false.should.not.be.ok; + expect(1).to.be.ok; + (1).should.be.ok; + expect(0).to.not.be.ok; + (0).should.not.be.ok; + + err(() => { + expect('').to.be.ok; + ''.should.be.ok; + }, 'expected \'\' to be truthy'); + + err(() => { + expect('test').to.not.be.ok; + 'test'.should.not.be.ok; + }, 'expected \'test\' to be falsy'); +} + +function _false() { + expect(false).to.be.false; + false.should.be.false; + expect(true).to.not.be.false; + true.should.not.be.false; + expect(0).to.not.be.false; + (0).should.not.be.false; + + err(() => { + expect('').to.be.false; + ''.should.be.false; + }, 'expected \'\' to be false'); +} + +function _null() { + expect(null).to.be.null; + should.equal(null, null); + expect(false).to.not.be.null; + false.should.not.be.null; + + err(() => { + expect('').to.be.null; + ''.should.be.null; + }, 'expected \'\' to be null'); +} + +function _undefined() { + expect(undefined).to.be.undefined; + should.equal(undefined, undefined); + expect(null).to.not.be.undefined; + should.not.equal(null, undefined); + + err(() => { + expect('').to.be.undefined; + ''.should.be.undefined; + }, 'expected \'\' to be undefined'); +} + +function _NaN() { + expect(NaN).to.be.NaN; + expect(12).to.be.not.NaN; + expect("NaN").to.be.not.NaN; + (NaN).should.be.NaN; + (12).should.be.not.NaN; + ("NaN").should.be.not.NaN; +} + +function exist() { + var foo = 'bar'; + expect(foo).to.exist; + should.exist(foo); + expect(void (0)).to.not.exist; + should.not.exist(void (0)); +} + +function argumentsTest() { + var args = arguments; + expect(args).to.be.arguments; + args.should.be.arguments; + expect([]).to.not.be.arguments; + [].should.not.be.arguments; + expect(args).to.be.an('arguments').and.be.arguments; + args.should.be.an('arguments').and.be.arguments; + expect([]).to.be.an('array').and.not.be.Arguments; + [].should.be.an('array').and.not.be.Arguments; +} + +function equal() { + expect(undefined).to.equal(void (0)); + should.equal(undefined, void (0)); +} + +function _typeof() { + expect('test').to.be.a('string'); + 'test'.should.be.a('string'); + + err(() => { + expect('test').to.not.be.a('string'); + 'test'.should.not.be.a('string'); + }, 'expected \'test\' not to be a string'); + + expect(arguments).to.be.an('arguments'); + arguments.should.be.an('arguments'); + + expect(5).to.be.a('number'); + (5).should.be.a('number'); + + expect(new Number(1)).to.be.a('number'); + (new Number(1)).should.be.a('number'); + expect(Number(1)).to.be.a('number'); + Number(1).should.be.a('number'); + expect(true).to.be.a('boolean'); + true.should.be.a('boolean'); + expect(new Array()).to.be.a('array'); + (new Array()).should.be.a('array'); + expect(new Object()).to.be.a('object'); + (new Object()).should.be.a('object'); + expect({}).to.be.a('object'); + ({}).should.be.a('object'); + expect([]).to.be.a('array'); + [].should.be.a('array'); + expect(() => { }).to.be.a('function'); + (() => { }).should.be.a('function'); + expect(null).to.be.a('null'); + // N.B. previous line has no should equivalent + + err(() => { + expect(5).to.not.be.a('number', 'blah'); + (5).should.not.be.a('number', 'blah'); + }, 'blah: expected 5 not to be a number'); +} + +class Foo { } +function _instanceof() { + expect(new Foo()).to.be.an.instanceof(Foo); + (new Foo()).should.be.an.instanceof(Foo); + + err(() => { + expect(3).to.an.instanceof(Foo, 'blah'); + (3).should.an.instanceof(Foo, 'blah'); + }, 'blah: expected 3 to be an instance of Foo'); +} + +function within() { + expect(5).to.be.within(5, 10); + (5).should.be.within(5, 10); + expect(5).to.be.within(3, 6); + (5).should.be.within(3, 6); + expect(5).to.be.within(3, 5); + (5).should.be.within(3, 5); + expect(5).to.not.be.within(1, 3); + (5).should.not.be.within(1, 3); + expect('foo').to.have.length.within(2, 4); + 'foo'.should.have.length.within(2, 4); + expect([1, 2, 3]).to.have.length.within(2, 4); + [1, 2, 3].should.have.length.within(2, 4); + + err(() => { + expect(5).to.not.be.within(4, 6, 'blah'); + (5).should.not.be.within(4, 6, 'blah'); + }, 'blah: expected 5 to not be within 4..6', 'blah'); + + err(() => { + expect(10).to.be.within(50, 100, 'blah'); + (10).should.be.within(50, 100, 'blah'); + }, 'blah: expected 10 to be within 50..100'); + + err(() => { + expect('foo').to.have.length.within(5, 7, 'blah'); + 'foo'.should.have.length.within(5, 7, 'blah'); + }, 'blah: expected \'foo\' to have a length within 5..7'); + + err(() => { + expect([1, 2, 3]).to.have.length.within(5, 7, 'blah'); + [1, 2, 3].should.have.length.within(5, 7, 'blah'); + }, 'blah: expected [ 1, 2, 3 ] to have a length within 5..7'); +} + +function above() { + expect(5).to.be.above(2); + (5).should.be.above(2); + expect(5).to.be.greaterThan(2); + (5).should.be.greaterThan(2); + expect(5).to.not.be.above(5); + (5).should.not.be.above(5); + expect(5).to.not.be.above(6); + (5).should.not.be.above(6); + expect('foo').to.have.length.above(2); + 'foo'.should.have.length.above(2); + expect([1, 2, 3]).to.have.length.above(2); + [1, 2, 3].should.have.length.above(2); + + err(() => { + expect(5).to.be.above(6, 'blah'); + (5).should.be.above(6, 'blah'); + }, 'blah: expected 5 to be above 6', 'blah'); + + err(() => { + expect(10).to.not.be.above(6, 'blah'); + (10).should.not.be.above(6, 'blah'); + }, 'blah: expected 10 to be at most 6'); + + err(() => { + expect('foo').to.have.length.above(4, 'blah'); + 'foo'.should.have.length.above(4, 'blah'); + }, 'blah: expected \'foo\' to have a length above 4 but got 3'); + + err(() => { + expect([1, 2, 3]).to.have.length.above(4, 'blah'); + [1, 2, 3].should.have.length.above(4, 'blah'); + }, 'blah: expected [ 1, 2, 3 ] to have a length above 4 but got 3'); +} + +function least() { + expect(5).to.be.at.least(2); + (5).should.be.at.least(2); + expect(5).to.be.at.least(5); + (5).should.be.at.least(5); + expect(5).to.not.be.at.least(6); + (5).should.not.be.at.least(6); + expect('foo').to.have.length.of.at.least(2); + 'foo'.should.have.length.of.at.least(2); + expect([1, 2, 3]).to.have.length.of.at.least(2); + [1, 2, 3].should.have.length.of.at.least(2); + + err(() => { + expect(5).to.be.at.least(6, 'blah'); + (5).should.be.at.least(6, 'blah'); + }, 'blah: expected 5 to be at least 6', 'blah'); + + err(() => { + expect(10).to.not.be.at.least(6, 'blah'); + (10).should.not.be.at.least(6, 'blah'); + }, 'blah: expected 10 to be below 6'); + + err(() => { + expect('foo').to.have.length.of.at.least(4, 'blah'); + 'foo'.should.have.length.of.at.least(4, 'blah'); + }, 'blah: expected \'foo\' to have a length at least 4 but got 3'); + + err(() => { + expect([1, 2, 3]).to.have.length.of.at.least(4, 'blah'); + [1, 2, 3].should.have.length.of.at.least(4, 'blah'); + }, 'blah: expected [ 1, 2, 3 ] to have a length at least 4 but got 3'); + + err(() => { + expect([1, 2, 3, 4]).to.not.have.length.of.at.least(4, 'blah'); + [1, 2, 3, 4].should.not.have.length.of.at.least(4, 'blah'); + }, 'blah: expected [ 1, 2, 3, 4 ] to have a length below 4'); +} + +function below() { + expect(2).to.be.below(5); + (2).should.be.below(5); + expect(2).to.be.lessThan(5); + (2).should.be.lessThan(5); + expect(2).to.not.be.below(2); + (2).should.not.be.below(2); + expect(2).to.not.be.below(1); + (2).should.not.be.below(1); + expect('foo').to.have.length.below(4); + 'foo'.should.have.length.below(4); + expect([1, 2, 3]).to.have.length.below(4); + [1, 2, 3].should.have.length.below(4); + + err(() => { + expect(6).to.be.below(5, 'blah'); + (6).should.be.below(5, 'blah'); + }, 'blah: expected 6 to be below 5'); + + err(() => { + expect(6).to.not.be.below(10, 'blah'); + (6).should.not.be.below(10, 'blah'); + }, 'blah: expected 6 to be at least 10'); + + err(() => { + expect('foo').to.have.length.below(2, 'blah'); + 'foo'.should.have.length.below(2, 'blah'); + }, 'blah: expected \'foo\' to have a length below 2 but got 3'); + + err(() => { + expect([1, 2, 3]).to.have.length.below(2, 'blah'); + [1, 2, 3].should.have.length.below(2, 'blah'); + }, 'blah: expected [ 1, 2, 3 ] to have a length below 2 but got 3'); +} + +function most() { + expect(2).to.be.at.most(5); + (2).should.be.at.most(5); + expect(2).to.be.at.most(2); + (2).should.be.at.most(2); + expect(2).to.not.be.at.most(1); + (2).should.not.be.at.most(1); + expect(2).to.not.be.at.most(1); + (2).should.not.be.at.most(1); + expect('foo').to.have.length.of.at.most(4); + 'foo'.should.have.length.of.at.most(4); + expect([1, 2, 3]).to.have.length.of.at.most(4); + [1, 2, 3].should.have.length.of.at.most(4); + + err(() => { + expect(6).to.be.at.most(5, 'blah'); + (6).should.be.at.most(5, 'blah'); + }, 'blah: expected 6 to be at most 5'); + + err(() => { + expect(6).to.not.be.at.most(10, 'blah'); + (6).should.not.be.at.most(10, 'blah'); + }, 'blah: expected 6 to be above 10'); + + err(() => { + expect('foo').to.have.length.of.at.most(2, 'blah'); + 'foo'.should.have.length.of.at.most(2, 'blah'); + }, 'blah: expected \'foo\' to have a length at most 2 but got 3'); + + err(() => { + expect([1, 2, 3]).to.have.length.of.at.most(2, 'blah'); + [1, 2, 3].should.have.length.of.at.most(2, 'blah'); + }, 'blah: expected [ 1, 2, 3 ] to have a length at most 2 but got 3'); + + err(() => { + expect([1, 2]).to.not.have.length.of.at.most(2, 'blah'); + [1, 2].should.not.have.length.of.at.most(2, 'blah'); + }, 'blah: expected [ 1, 2 ] to have a length above 2'); +} + +function match() { + expect('foobar').to.match(/^foo/); + 'foobar'.should.match(/^foo/); + expect('foobar').to.not.match(/^bar/); + 'foobar'.should.not.match(/^bar/); + + expect('foobar').matches(/^foo/); + 'foobar'.should.not.matches(/^bar/); + + err(() => { + expect('foobar').to.match(/^bar/i, 'blah'); + 'foobar'.should.match(/^bar/i, 'blah'); + }, 'blah: expected \'foobar\' to match /^bar/i'); + + err(() => { + expect('foobar').to.not.match(/^foo/i, 'blah'); + 'foobar'.should.not.match(/^foo/i, 'blah'); + }, 'blah: expected \'foobar\' not to match /^foo/i'); +} + +function length2() { + expect('test').to.have.length(4); + 'test'.should.have.length(4); + expect('test').to.not.have.length(3); + 'test'.should.not.have.length(3); + expect([1, 2, 3]).to.have.length(3); + [1, 2, 3].should.have.length(3); + + err(() => { + expect(4).to.have.length(3, 'blah'); + (4).should.have.length(3, 'blah'); + }, 'blah: expected 4 to have a property \'length\''); + + err(() => { + expect('asd').to.not.have.length(3, 'blah'); + 'asd'.should.not.have.length(3, 'blah'); + }, 'blah: expected \'asd\' to not have a length of 3'); +} + +function eql() { + expect('test').to.eql('test'); + 'test'.should.eql('test'); + expect({ foo: 'bar' }).to.eql({ foo: 'bar' }); + ({ foo: 'bar' }).should.eql({ foo: 'bar' }); + expect(1).to.eql(1); + (1).should.eql(1); + expect('4').to.not.eql(4); + '4'.should.not.eql(4); + + err(() => { + expect(4).to.eql(3, 'blah'); + (4).should.eql(3, 'blah'); + }, 'blah: expected 4 to deeply equal 3'); +} + +class Buffer { + constructor(arr: number[]) { + } +} +function buffer() { + expect(new Buffer([1])).to.eql(new Buffer([1])); + (new Buffer([1])).should.eql(new Buffer([1])); + + err(() => { + expect(new Buffer([0])).to.eql(new Buffer([1])); + (new Buffer([0])).should.eql(new Buffer([1])); + }, 'expected to deeply equal '); +} + +function equal2() { + expect('test').to.equal('test'); + 'test'.should.equal('test'); + should.equal('test', 'test'); + expect(1).to.equal(1); + (1).should.equal(1); + should.equal(1, 1); + + err(() => { + expect(4).to.equal(3, 'blah'); + (4).should.equal(3, 'blah'); + should.equal(4, 3, 'blah'); + }, 'blah: expected 4 to equal 3'); + + err(() => { + expect('4').to.equal(4, 'blah'); + '4'.should.equal(4, 'blah'); + should.equal(4, 4, 'blah'); + }, 'blah: expected \'4\' to equal 4'); +} + +function deepEqual() { + expect({ foo: 'bar' }).to.deep.equal({ foo: 'bar' }); + ({ foo: 'bar' }).should.deep.equal({ foo: 'bar' }); + expect({ foo: 'bar' }).not.to.deep.equal({ foo: 'baz' }); +} + +function deepEqual2() { + expect(/a/).to.deep.equal(/a/); + /a/.should.deep.equal(/a/); + expect(/a/).not.to.deep.equal(/b/); + expect(/a/).not.to.deep.equal({}); + expect(/a/g).to.deep.equal(/a/g); + /a/g.should.deep.equal(/a/g); + expect(/a/g).not.to.deep.equal(/b/g); + expect(/a/i).to.deep.equal(/a/i); + /a/i.should.deep.equal(/a/i); + expect(/a/i).not.to.deep.equal(/b/i); + expect(/a/m).to.deep.equal(/a/m); + /a/m.should.deep.equal(/a/m); + expect(/a/m).not.to.deep.equal(/b/m); +} + +// ReSharper disable once InconsistentNaming +function deepEqual3() { + var a = new Date(1, 2, 3); + var b = new Date(4, 5, 6); + expect(a).to.deep.equal(a); + a.should.deep.equal(a); + expect(a).not.to.deep.equal(b); + a.should.not.deep.equal(b); + expect(a).not.to.deep.equal({}); + a.should.not.deep.equal({}); +} + +function deepInclude() { + expect(['foo', 'bar']).to.deep.include(['bar', 'foo']); + ['foo', 'bar'].should.deep.include(['bar', 'foo']); + expect(['foo', 'bar']).not.to.deep.equal(['foo', 'baz']); + ['foo', 'bar'].should.not.deep.equal(['foo', 'baz']); +} + +class FakeArgs { + length: number; +} + +function empty() { + FakeArgs.prototype.length = 0; + + expect('').to.be.empty; + + ''.should.be.empty; + expect('foo').not.to.be.empty; + 'foo'.should.not.be.empty; + expect([]).to.be.empty; + [].should.be.empty; + expect(['foo']).not.to.be.empty; + ['foo'].should.not.be.empty; + expect(new FakeArgs).to.be.empty; + (new FakeArgs).should.be.empty; + expect({ arguments: 0 }).not.to.be.empty; + ({ arguments: 0 }).should.not.be.empty; + expect({}).to.be.empty; + ({}).should.be.empty; + expect({ foo: 'bar' }).not.to.be.empty; + ({ foo: 'bar' }).should.not.be.empty; + + err(() => { + expect('').not.to.be.empty; + ''.should.not.be.empty; + }, 'expected \'\' not to be empty'); + + err(() => { + expect('foo').to.be.empty; + 'foo'.should.be.empty; + 'foo'.should.be.empty; + }, 'expected \'foo\' to be empty'); + + err(() => { + expect([]).not.to.be.empty; + [].should.not.be.empty; + }, 'expected [] not to be empty'); + + err(() => { + expect(['foo']).to.be.empty; + ['foo'].should.be.empty; + }, 'expected [ \'foo\' ] to be empty'); + + err(() => { + expect(new FakeArgs).not.to.be.empty; + (new FakeArgs).should.not.be.empty; + }, 'expected { length: 0 } not to be empty'); + + err(() => { + expect({ arguments: 0 }).to.be.empty; + ({ arguments: 0 }).should.be.empty; + }, 'expected { arguments: 0 } to be empty'); + + err(() => { + expect({}).not.to.be.empty; + ({}).should.not.be.empty; + }, 'expected {} not to be empty'); + + err(() => { + expect({ foo: 'bar' }).to.be.empty; + ({ foo: 'bar' }).should.be.empty; + }, 'expected { foo: \'bar\' } to be empty'); +} + +function property() { + expect('test').to.have.property('length'); + 'test'.should.have.property('length'); + expect(4).to.not.have.property('length'); + (4).should.not.have.property('length'); + + expect({ 'foo.bar': 'baz' }) + .to.have.property('foo.bar'); + ({ 'foo.bar': 'baz' }).should.have.property('foo.bar'); + expect({ foo: { bar: 'baz' } }) + .to.not.have.property('foo.bar'); + ({ foo: { bar: 'baz' } }).should.not.have.property('foo.bar'); + + err(() => { + expect('asd').to.have.property('foo'); + 'asd'.should.have.property('foo'); + }, 'expected \'asd\' to have a property \'foo\''); + err(() => { + expect({ foo: { bar: 'baz' } }) + .to.have.property('foo.bar'); + ({ foo: { bar: 'baz' } }).should.have.property('foo.bar'); + }, 'expected { foo: { bar: \'baz\' } } to have a property \'foo.bar\''); +} + +function deepProperty() { + expect({ 'foo.bar': 'baz' }) + .to.not.have.deep.property('foo.bar'); + ({ 'foo.bar': 'baz' }).should + .not.have.deep.property('foo.bar'); + expect({ foo: { bar: 'baz' } }) + .to.have.deep.property('foo.bar'); + ({ foo: { bar: 'baz' } }).should + .have.deep.property('foo.bar'); + + err(() => { + expect({ 'foo.bar': 'baz' }) + .to.have.deep.property('foo.bar'); + ({ 'foo.bar': 'baz' }).should + .have.deep.property('foo.bar'); + }, 'expected { \'foo.bar\': \'baz\' } to have a deep property \'foo.bar\''); +} + +function property2() { + expect('test').to.have.property('length', 4); + 'test'.should.have.property('length', 4); + expect('asd').to.have.property('constructor', String); + 'asd'.should.have.property('constructor', String); + + err(() => { + expect('asd').to.have.property('length', 4, 'blah'); + 'asd'.should.have.property('length', 4, 'blah'); + }, 'blah: expected \'asd\' to have a property \'length\' of 4, but got 3'); + + err(() => { + expect('asd').to.not.have.property('length', 3, 'blah'); + 'asd'.should.not.have.property('length', 3, 'blah'); + }, 'blah: expected \'asd\' to not have a property \'length\' of 3'); + + err(() => { + expect('asd').to.not.have.property('foo', 3, 'blah'); + 'asd'.should.not.have.property('foo', 3, 'blah'); + }, 'blah: \'asd\' has no property \'foo\''); + + err(() => { + expect('asd').to.have.property('constructor', Number, 'blah'); + 'asd'.should.have.property('constructor', Number, 'blah'); + }, 'blah: expected \'asd\' to have a property \'constructor\' of [Function: Number], but got [Function: String]'); +} + +function deepProperty2() { + expect({ foo: { bar: 'baz' } }) + .to.have.deep.property('foo.bar', 'baz'); + ({ foo: { bar: 'baz' } }).should + .have.deep.property('foo.bar', 'baz'); + + err(() => { + expect({ foo: { bar: 'baz' } }) + .to.have.deep.property('foo.bar', 'quux', 'blah'); + ({ foo: { bar: 'baz' } }).should + .have.deep.property('foo.bar', 'quux', 'blah'); + }, 'blah: expected { foo: { bar: \'baz\' } } to have a deep property \'foo.bar\' of \'quux\', but got \'baz\''); + err(() => { + expect({ foo: { bar: 'baz' } }) + .to.not.have.deep.property('foo.bar', 'baz', 'blah'); + ({ foo: { bar: 'baz' } }).should + .not.have.deep.property('foo.bar', 'baz', 'blah'); + }, 'blah: expected { foo: { bar: \'baz\' } } to not have a deep property \'foo.bar\' of \'baz\''); + err(() => { + expect({ foo: 5 }) + .to.not.have.deep.property('foo.bar', 'baz', 'blah'); + ({ foo: 5 }).should + .not.have.deep.property('foo.bar', 'baz', 'blah'); + }, 'blah: { foo: 5 } has no deep property \'foo.bar\''); +} + +function ownProperty() { + expect('test').to.have.ownProperty('length'); + 'test'.should.have.ownProperty('length'); + expect('test').to.haveOwnProperty('length'); + 'test'.should.haveOwnProperty('length'); + expect({ length: 12 }).to.have.ownProperty('length'); + ({ length: 12 }).should.have.ownProperty('length'); + + err(() => { + expect({ length: 12 }).to.not.have.ownProperty('length', 'blah'); + ({ length: 12 }).should.not.have.ownProperty('length', 'blah'); + }, 'blah: expected { length: 12 } to not have own property \'length\''); +} + +function ownPropertyDescriptor() { + expect('test').to.have.ownPropertyDescriptor('length'); + expect('test').to.have.ownPropertyDescriptor('length', { enumerable: false, configurable: false, writable: false, value: 4 }); + expect('test').not.to.have.ownPropertyDescriptor('length', { enumerable: false, configurable: false, writable: false, value: 3 }); + expect('test').to.haveOwnPropertyDescriptor('length').to.have.property('enumerable', false); + expect('test').to.haveOwnPropertyDescriptor('length').to.contain.keys('value'); + + 'test'.should.have.ownPropertyDescriptor('length'); + 'test'.should.have.ownPropertyDescriptor('length', { enumerable: false, configurable: false, writable: false, value: 4 }); + 'test'.should.not.have.ownPropertyDescriptor('length', { enumerable: false, configurable: false, writable: false, value: 3 }); + 'test'.should.haveOwnPropertyDescriptor('length').to.have.property('enumerable', false); + 'test'.should.haveOwnPropertyDescriptor('length').to.contain.keys('value'); +} + +function string() { + expect('foobar').to.have.string('bar'); + 'foobar'.should.have.string('bar'); + expect('foobar').to.have.string('foo'); + 'foobar'.should.have.string('foo'); + expect('foobar').to.not.have.string('baz'); + 'foobar'.should.not.have.string('baz'); + + err(() => { + expect(3).to.have.string('baz'); + (3).should.have.string('baz'); + }, 'expected 3 to be a string'); + + err(() => { + expect('foobar').to.have.string('baz', 'blah'); + 'foobar'.should.have.string('baz', 'blah'); + }, 'blah: expected \'foobar\' to contain \'baz\''); + + err(() => { + expect('foobar').to.not.have.string('bar', 'blah'); + 'foobar'.should.not.have.string('bar', 'blah'); + }, 'blah: expected \'foobar\' to not contain \'bar\''); +} + +function include() { + expect(['foo', 'bar']).to.include('foo'); + ['foo', 'bar'].should.include('foo'); + expect(['foo', 'bar']).to.include('foo'); + ['foo', 'bar'].should.include('foo'); + expect(['foo', 'bar']).to.include('bar'); + ['foo', 'bar'].should.include('bar'); + expect([1, 2]).to.include(1); + [1, 2].should.include(1); + expect(['foo', 'bar']).to.not.include('baz'); + ['foo', 'bar'].should.not.include('baz'); + expect(['foo', 'bar']).to.not.include(1); + ['foo', 'bar'].should.not.include(1); + // alias + + expect(['foo', 'bar']).includes('foo'); + ['foo', 'bar'].should.includes('foo'); + + err(() => { + expect(['foo']).to.include('bar', 'blah'); + ['foo'].should.include('bar', 'blah'); + }, 'blah: expected [ \'foo\' ] to include \'bar\''); + + err(() => { + expect(['bar', 'foo']).to.not.include('foo', 'blah'); + ['bar', 'foo'].should.not.include('foo', 'blah'); + }, 'blah: expected [ \'bar\', \'foo\' ] to not include \'foo\''); +} + +function keys() { + expect({ foo: 1 }).to.have.keys(['foo']); + ({ foo: 1 }).should.have.keys(['foo']); + expect({ foo: 1, bar: 2 }).to.have.keys(['foo', 'bar']); + ({ foo: 1, bar: 2 }).should.have.keys(['foo', 'bar']); + expect({ foo: 1, bar: 2 }).to.have.keys('foo', 'bar'); + ({ foo: 1, bar: 2 }).should.have.keys('foo', 'bar'); + expect({ foo: 1, bar: 2, baz: 3 }).to.contain.keys('foo', 'bar'); + ({ foo: 1, bar: 2, baz: 3 }).should.contain.keys('foo', 'bar'); + expect({ foo: 1, bar: 2, baz: 3 }).to.contain.keys('bar', 'foo'); + ({ foo: 1, bar: 2, baz: 3 }).should.contain.keys('bar', 'foo'); + expect({ foo: 1, bar: 2, baz: 3 }).to.contain.keys('baz'); + ({ foo: 1, bar: 2, baz: 3 }).should.contain.keys('baz'); + // alias + + expect({ foo: 1, bar: 2, baz: 3 }).contains.keys('baz'); + + expect({ foo: 1, bar: 2 }).to.have.all.keys(['foo', 'bar']); + expect({ foo: 1, bar: 2 }).to.have.any.keys(['foo', 'bar']); + ({ foo: 1, bar: 2, baz: 3 }).should.contain.all.keys('baz'); + ({ foo: 1, bar: 2, baz: 3 }).should.contain.any.keys('baz'); + + expect({ foo: 1, bar: 2 }).to.contain.keys('foo'); + ({ foo: 1, bar: 2 }).should.contain.keys('foo'); + expect({ foo: 1, bar: 2 }).to.contain.keys('bar', 'foo'); + ({ foo: 1, bar: 2 }).should.contain.keys('bar', 'foo'); + expect({ foo: 1, bar: 2 }).to.contain.keys(['foo']); + ({ foo: 1, bar: 2 }).should.contain.keys(['foo']); + expect({ foo: 1, bar: 2 }).to.contain.keys(['bar']); + ({ foo: 1, bar: 2 }).should.contain.keys(['bar']); + expect({ foo: 1, bar: 2 }).to.contain.keys(['bar', 'foo']); + ({ foo: 1, bar: 2 }).should.contain.keys(['bar', 'foo']); + + expect({ foo: 1, bar: 2 }).to.not.have.keys('baz'); + ({ foo: 1, bar: 2 }).should.not.have.keys('baz'); + expect({ foo: 1, bar: 2 }).to.not.have.keys('foo', 'baz'); + ({ foo: 1, bar: 2 }).should.not.have.keys('foo', 'baz'); + expect({ foo: 1, bar: 2 }).to.not.contain.keys('baz'); + ({ foo: 1, bar: 2 }).should.not.contain.keys('baz'); + expect({ foo: 1, bar: 2 }).to.not.contain.keys('foo', 'baz'); + ({ foo: 1, bar: 2 }).should.not.contain.keys('foo', 'baz'); + expect({ foo: 1, bar: 2 }).to.not.contain.keys('baz', 'foo'); + ({ foo: 1, bar: 2 }).should.not.contain.keys('baz', 'foo'); + + err(() => { + expect({ foo: 1 }).to.have.keys(); + ({ foo: 1 }).should.have.keys(); + }, 'keys required'); + + err(() => { + expect({ foo: 1 }).to.have.keys([]); + ({ foo: 1 }).should.have.keys([]); + }, 'keys required'); + + err(() => { + expect({ foo: 1 }).to.not.have.keys([]); + ({ foo: 1 }).should.not.have.keys([]); + }, 'keys required'); + + err(() => { + expect({ foo: 1 }).to.contain.keys([]); + ({ foo: 1 }).should.contain.keys([]); + }, 'keys required'); + + err(() => { + expect({ foo: 1 }).to.have.keys(['bar']); + ({ foo: 1 }).should.have.keys(['bar']); + }, 'expected { foo: 1 } to have key \'bar\''); + + err(() => { + expect({ foo: 1 }).to.have.keys(['bar', 'baz']); + ({ foo: 1 }).should.have.keys(['bar', 'baz']); + }, 'expected { foo: 1 } to have keys \'bar\', and \'baz\''); + + err(() => { + expect({ foo: 1 }).to.have.keys(['foo', 'bar', 'baz']); + ({ foo: 1 }).should.have.keys(['foo', 'bar', 'baz']); + }, 'expected { foo: 1 } to have keys \'foo\', \'bar\', and \'baz\''); + + err(() => { + expect({ foo: 1 }).to.not.have.keys(['foo']); + ({ foo: 1 }).should.not.have.keys(['foo']); + }, 'expected { foo: 1 } to not have key \'foo\''); + + err(() => { + expect({ foo: 1 }).to.not.have.keys(['foo']); + ({ foo: 1 }).should.not.have.keys(['foo']); + }, 'expected { foo: 1 } to not have key \'foo\''); + + err(() => { + expect({ foo: 1, bar: 2 }).to.not.have.keys(['foo', 'bar']); + ({ foo: 1, bar: 2 }).should.not.have.keys(['foo', 'bar']); + }, 'expected { foo: 1, bar: 2 } to not have keys \'foo\', and \'bar\''); + + err(() => { + expect({ foo: 1 }).to.not.contain.keys(['foo']); + ({ foo: 1 }).should.not.contain.keys(['foo']); + }, 'expected { foo: 1 } to not contain key \'foo\''); + + err(() => { + expect({ foo: 1 }).to.contain.keys('foo', 'bar'); + ({ foo: 1 }).should.contain.keys('foo', 'bar'); + }, 'expected { foo: 1 } to contain keys \'foo\', and \'bar\''); +} + +function chaining() { + var tea = { name: 'chai', extras: ['milk', 'sugar', 'smile'] }; + expect(tea).to.have.property('extras').with.lengthOf(3); + tea.should.have.property('extras').with.lengthOf(3); + + err(() => { + expect(tea).to.have.property('extras').with.lengthOf(4); + tea.should.have.property('extras').with.lengthOf(4); + }, 'expected [ \'milk\', \'sugar\', \'smile\' ] to have a length of 4 but got 3'); + + expect(tea).to.be.a('object').and.have.property('name', 'chai'); + tea.should.be.a('object').and.have.property('name', 'chai'); +} + +function exxtensible() { + expect({}).to.be.extensible; + expect(Object.preventExtensions({})).to.be.not.extensible; + ({}).should.be.extensible; + Object.preventExtensions({}).should.not.be.extensible; +} +function sealed() { + expect({}).to.be.not.sealed; + expect(Object.seal({})).to.be.sealed; + ({}).should.be.not.sealed; + Object.seal({}).should.be.sealed; +} + +function frozen() { + expect({}).to.be.not.frozen; + expect(Object.freeze({})).to.be.frozen; + ({}).should.be.not.frozen; + Object.freeze({}).should.be.frozen; +} + + +class PoorlyConstructedError { } +function _throw() { + // See GH-45: some poorly-constructed custom errors don't have useful names + // on either their constructor or their constructor prototype, but instead + // only set the name inside the constructor itself. + PoorlyConstructedError.prototype = Object.create(Error.prototype); + + var specificError = new RangeError('boo'); + + var goodFn = () => { } + , badFn = () => { throw new Error('testing'); } + , refErrFn = () => { throw new ReferenceError('hello'); } + , ickyErrFn = () => { throw new PoorlyConstructedError(); } + , specificErrFn = () => { throw specificError; }; + + expect(goodFn).to.not.throw(); + goodFn.should.not.throw(); + should.not.throw(goodFn); + expect(goodFn).to.not.throw(Error); + goodFn.should.not.throw(Error); + should.not.throw(goodFn, Error); + expect(goodFn).to.not.throw(specificError); + goodFn.should.not.throw(specificError); + should.not.throw(goodFn, specificError); + + expect(badFn).to.throw(); + badFn.should.throw(); + should.throw(badFn); + expect(badFn).to.throw(Error); + badFn.should.throw(Error); + should.throw(badFn, Error); + expect(badFn).to.not.throw(ReferenceError); + badFn.should.not.throw(ReferenceError); + should.not.throw(badFn, ReferenceError); + expect(badFn).to.not.throw(specificError); + badFn.should.not.throw(specificError); + should.not.throw(badFn, specificError); + + expect(refErrFn).to.throw(); + refErrFn.should.throw(); + should.throw(refErrFn); + expect(refErrFn).to.throw(ReferenceError); + refErrFn.should.throw(ReferenceError); + should.throw(refErrFn, ReferenceError); + expect(refErrFn).to.throw(Error); + refErrFn.should.throw(Error); + should.throw(refErrFn, Error); + expect(refErrFn).to.not.throw(TypeError); + refErrFn.should.not.throw(TypeError); + should.not.throw(refErrFn, TypeError); + expect(refErrFn).to.not.throw(specificError); + refErrFn.should.not.throw(specificError); + should.not.throw(refErrFn, specificError); + + expect(ickyErrFn).to.throw(); + ickyErrFn.should.throw(); + should.throw(ickyErrFn); + expect(ickyErrFn).to.throw(PoorlyConstructedError); + ickyErrFn.should.throw(PoorlyConstructedError); + should.throw(ickyErrFn, PoorlyConstructedError); + expect(ickyErrFn).to.throw(Error); + ickyErrFn.should.throw(Error); + should.throw(ickyErrFn, Error); + expect(ickyErrFn).to.not.throw(specificError); + ickyErrFn.should.not.throw(specificError); + should.not.throw(ickyErrFn, specificError); + expect(specificErrFn).to.throw(specificError); + specificErrFn.should.throw(specificError); + should.throw(ickyErrFn, specificError); + + expect(badFn).to.throw(/testing/); + badFn.should.throw(/testing/); + should.throw(badFn, /testing/); + expect(badFn).to.not.throw(/hello/); + badFn.should.not.throw(/hello/); + should.not.throw(badFn, /hello/); + expect(badFn).to.throw('testing'); + badFn.should.throw('testing'); + should.throw(badFn, 'testing'); + expect(badFn).to.not.throw('hello'); + badFn.should.not.throw('hello'); + should.not.throw(badFn, 'hello'); + + expect(badFn).to.throw(Error, /testing/); + badFn.should.throw(Error, /testing/); + should.throw(badFn, Error, /testing/); + expect(badFn).to.throw(Error, 'testing'); + badFn.should.throw(Error, 'testing'); + should.throw(badFn, Error, 'testing'); + + err(() => { + expect(goodFn).to.throw(); + goodFn.should.throw(); + should.throw(goodFn); + }, 'expected [Function] to throw an error'); + + err(() => { + expect(goodFn).to.throw(ReferenceError); + goodFn.should.throw(ReferenceError); + should.throw(goodFn, ReferenceError); + }, 'expected [Function] to throw ReferenceError'); + + err(() => { + expect(goodFn).to.throw(specificError); + goodFn.should.throw(specificError); + should.throw(goodFn, specificError); + }, 'expected [Function] to throw [RangeError: boo]'); + + err(() => { + expect(badFn).to.not.throw(); + badFn.should.not.throw(); + should.not.throw(badFn); + }, 'expected [Function] to not throw an error but [Error: testing] was thrown'); + + err(() => { + expect(badFn).to.throw(ReferenceError); + badFn.should.throw(ReferenceError); + should.throw(badFn, ReferenceError); + }, 'expected [Function] to throw \'ReferenceError\' but [Error: testing] was thrown'); + + err(() => { + expect(badFn).to.throw(specificError); + badFn.should.throw(specificError); + should.throw(badFn, specificError); + }, 'expected [Function] to throw [RangeError: boo] but [Error: testing] was thrown'); + + err(() => { + expect(badFn).to.not.throw(Error); + badFn.should.not.throw(Error); + should.not.throw(badFn, Error); + }, 'expected [Function] to not throw \'Error\' but [Error: testing] was thrown'); + + err(() => { + expect(refErrFn).to.not.throw(ReferenceError); + refErrFn.should.not.throw(ReferenceError); + should.not.throw(refErrFn, ReferenceError); + }, 'expected [Function] to not throw \'ReferenceError\' but [ReferenceError: hello] was thrown'); + + err(() => { + expect(badFn).to.throw(PoorlyConstructedError); + badFn.should.throw(PoorlyConstructedError); + should.throw(badFn, PoorlyConstructedError); + }, 'expected [Function] to throw \'PoorlyConstructedError\' but [Error: testing] was thrown'); + + err(() => { + expect(ickyErrFn).to.not.throw(PoorlyConstructedError); + ickyErrFn.should.not.throw(PoorlyConstructedError); + should.not.throw(ickyErrFn, PoorlyConstructedError); + }, /^(expected \[Function\] to not throw 'PoorlyConstructedError' but)(.*)(PoorlyConstructedError|\{ Object \()(.*)(was thrown)$/); + + err(() => { + expect(ickyErrFn).to.throw(ReferenceError); + ickyErrFn.should.throw(ReferenceError); + should.throw(ickyErrFn, ReferenceError); + }, /^(expected \[Function\] to throw 'ReferenceError' but)(.*)(PoorlyConstructedError|\{ Object \()(.*)(was thrown)$/); + + err(() => { + expect(specificErrFn).to.throw(new ReferenceError('eek')); + specificErrFn.should.throw(new ReferenceError('eek')); + should.throw(specificErrFn, new ReferenceError('eek')); + }, 'expected [Function] to throw [ReferenceError: eek] but [RangeError: boo] was thrown'); + + err(() => { + expect(specificErrFn).to.not.throw(specificError); + specificErrFn.should.not.throw(specificError); + should.not.throw(specificErrFn, specificError); + }, 'expected [Function] to not throw [RangeError: boo]'); + + err(() => { + expect(badFn).to.not.throw(/testing/); + badFn.should.not.throw(/testing/); + should.not.throw(badFn, /testing/); + }, 'expected [Function] to throw error not matching /testing/'); + + err(() => { + expect(badFn).to.throw(/hello/); + badFn.should.throw(/hello/); + should.throw(badFn, /hello/); + }, 'expected [Function] to throw error matching /hello/ but got \'testing\''); + + err(() => { + expect(badFn).to.throw(Error, /hello/, 'blah'); + badFn.should.throw(Error, /hello/, 'blah'); + should.throw(badFn, Error, /hello/, 'blah'); + }, 'blah: expected [Function] to throw error matching /hello/ but got \'testing\''); + + err(() => { + expect(badFn).to.throw(Error, 'hello', 'blah'); + badFn.should.throw(Error, 'hello', 'blah'); + should.throw(badFn, Error, 'hello', 'blah'); + }, 'blah: expected [Function] to throw error including \'hello\' but got \'testing\''); +} + +function use() { + // ReSharper disable once InconsistentNaming + chai.use((_chai) => { + _chai.can.use.any(); + }); +} + +class Klass { + val: number; + constructor() { this.val = 0; } + bar() { } + + static baz() { } +} + +function respondTo() { + var obj = new Klass(); + + expect(Klass).to.respondTo('bar'); + expect(obj).respondsTo('bar'); + Klass.should.respondTo('bar'); + Klass.should.respondsTo('bar'); + expect(Klass).to.not.respondTo('foo'); + Klass.should.not.respondTo('foo'); + expect(Klass).itself.to.respondTo('func'); + expect(Klass).itself.not.to.respondTo('bar'); + + expect(obj).not.to.respondTo('foo'); + obj.should.not.respondTo('foo'); + + err(() => { + expect(Klass).to.respondTo('baz', 'constructor'); + Klass.should.respondTo('baz', 'constructor'); + }, /^(constructor: expected)(.*)(\[Function: Klass\])(.*)(to respond to \'baz\')$/); + + err(() => { + expect(obj).to.respondTo('baz', 'object'); + obj.should.respondTo('baz', 'object'); + }, /^(object: expected)(.*)(\{ foo: \[Function\] \}|\{ Object \()(.*)(to respond to \'baz\')$/); +} + +function satisfy() { + function matcher(num: number) { + return num === 1; + } + + expect(1).to.satisfy(matcher); + (1).should.satisfy(matcher); + + err(() => { + expect(2).to.satisfy(matcher, 'blah'); + (2).should.satisfy(matcher, 'blah'); + }, 'blah: expected 2 to satisfy [Function: matcher]'); +} + +function closeTo() { + expect(1.5).to.be.closeTo(1.0, 0.5); + (1.5).should.be.closeTo(1.0, 0.5); + expect(10).to.be.closeTo(20, 20); + (10).should.be.closeTo(20, 20); + expect(-10).to.be.closeTo(20, 30); + (-10).should.be.closeTo(20, 30); + + err(() => { + expect(2).to.be.closeTo(1.0, 0.5, 'blah'); + (2).should.be.closeTo(1.0, 0.5, 'blah'); + }, 'blah: expected 2 to be close to 1 +/- 0.5'); + + err(() => { + expect(-10).to.be.closeTo(20, 29, 'blah'); + (-10).should.be.closeTo(20, 29, 'blah'); + }, 'blah: expected -10 to be close to 20 +/- 29'); +} + +function includeMembers() { + expect([1, 2, 3]).to.include.members([]); + [1, 2, 3].should.include.members([]); + + expect([1, 2, 3]).to.include.members([3, 2]); + + [1, 2, 3].should.include.members([3, 2]); + + expect([1, 2, 3]).to.not.include.members([8, 4]); + + [1, 2, 3].should.not.include.members([8, 4]); + + expect([1, 2, 3]).to.not.include.members([1, 2, 3, 4]); + + [1, 2, 3].should.not.include.members([1, 2, 3, 4]); +} + +function sameMembers() { + expect([5, 4]).to.have.same.members([4, 5]); + [5, 4].should.have.same.members([4, 5]); + expect([5, 4]).to.have.same.members([5, 4]); + [5, 4].should.have.same.members([5, 4]); + + expect([5, 4]).to.not.have.same.members([]); + [5, 4].should.not.have.same.members([]); + expect([5, 4]).to.not.have.same.members([6, 3]); + [5, 4].should.not.have.same.members([6, 3]); + expect([5, 4]).to.not.have.same.members([5, 4, 2]); + [5, 4].should.not.have.same.members([5, 4, 2]); + + assert.sameMembers([5, 4], [4, 5]); +} +function sameDeepMembers() { + expect([{ id: 5 }, { id: 4 }]).to.have.same.deep.members([{ id: 4 }, { id: 5 }]); + [{ id: 5 }, { id: 4 }].should.have.same.deep.members([{ id: 4 }, { id: 5 }]); + expect([{ id: 5 }, { id: 4 }]).to.have.same.members([{ id: 5 }, { id: 4 }]); + [{ id: 5 }, { id: 4 }].should.have.same.members([{ id: 5 }, { id: 4 }]); + + expect([{ id: 5 }, { id: 4 }]).to.not.have.same.members([]); + [{ id: 5 }, { id: 4 }].should.not.have.same.members([]); + expect([{ id: 5 }, { id: 4 }]).to.not.have.same.members([{ id: 6 }, { id: 3 }]); + [{ id: 5 }, { id: 4 }].should.not.have.same.members([{ id: 6 }, { id: 3 }]); + expect([{ id: 5 }, { id: 4 }]).to.not.have.same.members([{ id: 5 }, { id: 4 }, { id: 2 }]); + [{ id: 5 }, { id: 4 }].should.not.have.same.members([{ id: 5 }, { id: 4 }, { id: 2 }]); + + assert.sameDeepMembers([{ id: 5 }, { id: 4 }], [{ id: 4 }, { id: 5 }]); +} + +function members() { + expect([5, 4]).members([4, 5]); + expect([5, 4]).members([5, 4]); + + expect([5, 4]).not.members([]); + expect([5, 4]).not.members([6, 3]); + expect([5, 4]).not.members([5, 4, 2]); +} + +function increaseDecreaseChange() { + var obj = { val: 10 }; + var inc = () => { obj.val++; }; + var dec = () => { obj.val--; }; + var same = () => { }; + + expect(inc).to.increase(obj, "val"); + expect(inc).increases(obj, "val"); + expect(inc).to.change(obj, "val"); + + expect(dec).to.decrease(obj, "val"); + expect(dec).decreases(obj, "val"); + expect(dec).to.change(obj, "val"); + expect(dec).changes(obj, "val"); + + expect(inc).to.not.decrease(obj, "val"); + expect(dec).to.not.increase(obj, "val"); + expect(same).to.not.increase(obj, "val"); + expect(same).to.not.decrease(obj, "val"); + expect(same).to.not.change(obj, "val"); + + inc.should.increase(obj, "val"); + inc.should.change(obj, "val"); + + dec.should.decrease(obj, "val"); + dec.should.change(obj, "val"); + + inc.should.not.decrease(obj, "val"); + dec.should.not.increase(obj, "val"); + same.should.not.change(obj, "val"); +} + +//tdd +declare function suite(description: string, action: Function): void; +declare function test(description: string, action: Function): void; + +interface FieldObj { + field: any; +} + +class CrashyObject { + inspect(): void { + throw new Error('Arg\'s inspect() called even though the test passed'); + } +} + +suite('assert', () => { + + test('assert', () => { + var foo = 'bar'; + assert(foo === 'bar', 'expected foo to equal `bar`'); + + err(() => { + assert(foo === 'baz', 'expected foo to equal `bar`'); + }, 'expected foo to equal `bar`'); + }); + + test('isTrue', () => { + assert.isTrue(true); + + err(() => { + assert.isTrue(false); + }, 'expected false to be true'); + + err(() => { + assert.isTrue(1); + }, 'expected 1 to be true'); + + err(() => { + assert.isTrue('test'); + }, 'expected \'test\' to be true'); + }); + + test('ok', () => { + assert.ok(true); + assert.ok(1); + assert.ok('test'); + assert.isOk(true); + assert.isOk(1); + assert.isOk('test'); + + err(() => { + assert.ok(false); + }, 'expected false to be truthy'); + + err(() => { + assert.ok(0); + }, 'expected 0 to be truthy'); + + err(() => { + assert.ok(''); + }, 'expected \'\' to be truthy'); + }); + + test('notOk', () => { + assert.notOk(false); + assert.notOk(0); + assert.notOk(''); + assert.isNotOk(false); + assert.isNotOk(0); + assert.isNotOk(''); + + err(() => { + assert.notOk(true); + }, 'expected true to be falsy'); + + err(() => { + assert.notOk(1); + }, 'expected 1 to be falsy'); + + err(() => { + assert.notOk('test'); + }, 'expected \'test\' to be falsy'); + }); + + test('isFalse', () => { + assert.isFalse(false); + + err(() => { + assert.isFalse(true); + }, 'expected true to be false'); + + err(() => { + assert.isFalse(0); + }, 'expected 0 to be false'); + }); + + test('equal', () => { + assert.equal(void (0), undefined); + }); + + test('typeof / notTypeOf', () => { + assert.typeOf('test', 'string'); + assert.typeOf(true, 'boolean'); + assert.typeOf(5, 'number'); + + err(() => { + assert.typeOf(5, 'string'); + }, 'expected 5 to be a string'); + + }); + + test('notTypeOf', () => { + assert.notTypeOf('test', 'number'); + + err(() => { + assert.notTypeOf(5, 'number'); + }, 'expected 5 not to be a number'); + }); + + test('instanceOf', () => { + assert.instanceOf(new Foo(), Foo); + + err(() => { + assert.instanceOf(5, Foo); + }, 'expected 5 to be an instance of Foo'); + assert.instanceOf(new CrashyObject(), CrashyObject); + }); + + test('notInstanceOf', () => { + assert.notInstanceOf(new Foo(), String); + + err(() => { + assert.notInstanceOf(new Foo(), Foo); + }, 'expected {} to not be an instance of Foo'); + }); + + test('isObject', () => { + assert.isObject({}); + assert.isObject(new Foo()); + + err(() => { + assert.isObject(true); + }, 'expected true to be an object'); + + err(() => { + assert.isObject(Foo); + }, 'expected [Function: Foo] to be an object'); + + err(() => { + assert.isObject('foo'); + }, 'expected \'foo\' to be an object'); + }); + + test('isNotObject', () => { + assert.isNotObject(5); + + err(() => { + assert.isNotObject({}); + }, 'expected {} not to be an object'); + }); + + test('notEqual', () => { + assert.notEqual(3, 4); + + err(() => { + assert.notEqual(5, 5); + }, 'expected 5 to not equal 5'); + }); + + test('strictEqual', () => { + assert.strictEqual('foo', 'foo'); + + err(() => { + assert.strictEqual('5', 5); + }, 'expected \'5\' to equal 5'); + }); + + test('notStrictEqual', () => { + assert.notStrictEqual(5, '5'); + + err(() => { + assert.notStrictEqual(5, 5); + }, 'expected 5 to not equal 5'); + }); + + test('deepEqual', () => { + assert.deepEqual({ tea: 'chai' }, { tea: 'chai' }); + + err(() => { + assert.deepEqual({ tea: 'chai' }, { tea: 'black' }); + }, 'expected { tea: \'chai\' } to deeply equal { tea: \'black\' }'); + + var obja = Object.create({ tea: 'chai' }) + , objb = Object.create({ tea: 'chai' }); + + assert.deepEqual(obja, objb); + + var obj1 = Object.create({ tea: 'chai' }) + , obj2 = Object.create({ tea: 'black' }); + + err(() => { + assert.deepEqual(obj1, obj2); + }, 'expected { tea: \'chai\' } to deeply equal { tea: \'black\' }'); + }); + + test('deepEqual (ordering)', () => { + var a = { a: 'b', c: 'd' } + , b = { c: 'd', a: 'b' }; + assert.deepEqual(a, b); + }); + + test('deepEqual (circular)', () => { + var circularObject: any = {} + , secondCircularObject: any = {}; + circularObject.field = circularObject; + secondCircularObject.field = secondCircularObject; + + assert.deepEqual(circularObject, secondCircularObject); + + err(() => { + secondCircularObject.field2 = secondCircularObject; + assert.deepEqual(circularObject, secondCircularObject); + }, 'expected { field: [Circular] } to deeply equal { Object (field, field2) }'); + }); + + test('notDeepEqual', () => { + assert.notDeepEqual({ tea: 'jasmine' }, { tea: 'chai' }); + err(() => { + assert.notDeepEqual({ tea: 'chai' }, { tea: 'chai' }); + }, 'expected { tea: \'chai\' } to not deeply equal { tea: \'chai\' }'); + }); + + test('notDeepEqual (circular)', () => { + var circularObject: any = {} + , secondCircularObject: any = { tea: 'jasmine' }; + circularObject.field = circularObject; + secondCircularObject.field = secondCircularObject; + + assert.notDeepEqual(circularObject, secondCircularObject); + + err(() => { + delete secondCircularObject.tea; + assert.notDeepEqual(circularObject, secondCircularObject); + }, 'expected { field: [Circular] } to not deeply equal { field: [Circular] }'); + }); + + test('isNull', () => { + assert.isNull(null); + + err(() => { + assert.isNull(undefined); + }, 'expected undefined to equal null'); + }); + + test('isNotNull', () => { + assert.isNotNull(undefined); + + err(() => { + assert.isNotNull(null); + }, 'expected null to not equal null'); + }); + + test('isUndefined', () => { + assert.isUndefined(undefined); + + err(() => { + assert.isUndefined(null); + }, 'expected null to equal undefined'); + }); + + test('isDefined', () => { + assert.isDefined(null); + + err(() => { + assert.isDefined(undefined); + }, 'expected undefined to not equal undefined'); + }); + + test('isNaN', () => { + assert.isNaN(NaN); + + err(() => { + assert.isNaN(12); + }, 'expected 12 to be NaN'); + }); + + test('isNotNaN', () => { + assert.isNotNaN(12); + + err(() => { + assert.isNotNaN(NaN); + }, 'expected NaN to not NaN'); + }); + + test('isFunction', () => { + var func = () => { + }; + assert.isFunction(func); + + err(() => { + assert.isFunction({}); + }, 'expected {} to be a function'); + }); + + test('isNotFunction', () => { + assert.isNotFunction(5); + + err(() => { + assert.isNotFunction(() => { + }); + }, 'expected [Function] not to be a function'); + }); + + test('isArray', () => { + assert.isArray([]); + assert.isArray(new Array()); + + err(() => { + assert.isArray({}); + }, 'expected {} to be an array'); + }); + + test('isNotArray', () => { + assert.isNotArray(3); + + err(() => { + assert.isNotArray([]); + }, 'expected [] not to be an array'); + + err(() => { + assert.isNotArray(new Array()); + }, 'expected [] not to be an array'); + }); + + test('isString', () => { + assert.isString('Foo'); + assert.isString(new String('foo')); + + err(() => { + assert.isString(1); + }, 'expected 1 to be a string'); + }); + + test('isNotString', () => { + assert.isNotString(3); + assert.isNotString(['hello']); + + err(() => { + assert.isNotString('hello'); + }, 'expected \'hello\' not to be a string'); + }); + + test('isNumber', () => { + assert.isNumber(1); + assert.isNumber(Number('3')); + + err(() => { + assert.isNumber('1'); + }, 'expected \'1\' to be a number'); + }); + + test('isNotNumber', () => { + assert.isNotNumber('hello'); + assert.isNotNumber([5]); + + err(() => { + assert.isNotNumber(4); + }, 'expected 4 not to be a number'); + }); + + test('isBoolean', () => { + assert.isBoolean(true); + assert.isBoolean(false); + + err(() => { + assert.isBoolean('1'); + }, 'expected \'1\' to be a boolean'); + }); + + test('isNotBoolean', () => { + assert.isNotBoolean('true'); + + err(() => { + assert.isNotBoolean(true); + }, 'expected true not to be a boolean'); + + err(() => { + assert.isNotBoolean(false); + }, 'expected false not to be a boolean'); + }); + + test('include', () => { + assert.include('foobar', 'bar'); + assert.include([1, 2, 3], 3); + + err(() => { + assert.include('foobar', 'baz'); + }, 'expected \'foobar\' to contain \'baz\''); + + err(() => { + assert.include(undefined, 'bar'); + }, 'expected an array or string'); + }); + + test('notInclude', () => { + assert.notInclude('foobar', 'baz'); + assert.notInclude([1, 2, 3], 4); + + err(() => { + assert.notInclude('foobar', 'bar'); + }, 'expected \'foobar\' to not contain \'bar\''); + + err(() => { + assert.notInclude(undefined, 'bar'); + }, 'expected an array or string'); + }); + + test('lengthOf', () => { + assert.lengthOf([1, 2, 3], 3); + assert.lengthOf('foobar', 6); + + err(() => { + assert.lengthOf('foobar', 5); + }, 'expected \'foobar\' to have a length of 5 but got 6'); + + err(() => { + assert.lengthOf(1, 5); + }, 'expected 1 to have a property \'length\''); + }); + + test('match', () => { + assert.match('foobar', /^foo/); + assert.notMatch('foobar', /^bar/); + + err(() => { + assert.match('foobar', /^bar/i); + }, 'expected \'foobar\' to match /^bar/i'); + + err(() => { + assert.notMatch('foobar', /^foo/i); + }, 'expected \'foobar\' not to match /^foo/i'); + }); + + test('property', () => { + var obj = { foo: { bar: 'baz' } }; + var simpleObj = { foo: 'bar' }; + assert.property(obj, 'foo'); + assert.deepProperty(obj, 'foo.bar'); + assert.notProperty(obj, 'baz'); + assert.notProperty(obj, 'foo.bar'); + assert.notDeepProperty(obj, 'foo.baz'); + assert.deepPropertyVal(obj, 'foo.bar', 'baz'); + assert.deepPropertyNotVal(obj, 'foo.bar', 'flow'); + + err(() => { + assert.property(obj, 'baz'); + }, 'expected { foo: { bar: \'baz\' } } to have a property \'baz\''); + + err(() => { + assert.deepProperty(obj, 'foo.baz'); + }, 'expected { foo: { bar: \'baz\' } } to have a deep property \'foo.baz\''); + + err(() => { + assert.notProperty(obj, 'foo'); + }, 'expected { foo: { bar: \'baz\' } } to not have property \'foo\''); + + err(() => { + assert.notDeepProperty(obj, 'foo.bar'); + }, 'expected { foo: { bar: \'baz\' } } to not have deep property \'foo.bar\''); + + err(() => { + assert.propertyVal(simpleObj, 'foo', 'ball'); + }, 'expected { foo: \'bar\' } to have a property \'foo\' of \'ball\', but got \'bar\''); + + err(() => { + assert.deepPropertyVal(obj, 'foo.bar', 'ball'); + }, 'expected { foo: { bar: \'baz\' } } to have a deep property \'foo.bar\' of \'ball\', but got \'baz\''); + + err(() => { + assert.propertyNotVal(simpleObj, 'foo', 'bar'); + }, 'expected { foo: \'bar\' } to not have a property \'foo\' of \'bar\''); + + err(() => { + assert.deepPropertyNotVal(obj, 'foo.bar', 'baz'); + }, 'expected { foo: { bar: \'baz\' } } to not have a deep property \'foo.bar\' of \'baz\''); + }); + + test('throws', () => { + assert.throws(() => { + throw new Error('foo'); + }); + assert.throws(() => { + throw new Error('bar'); + }, 'bar'); + assert.throws(() => { + throw new Error('bar'); + }, /bar/); + assert.throws(() => { + throw new Error('bar'); + }, Error); + assert.throws(() => { + throw new Error('bar'); + }, Error, 'bar'); + + err(() => { + assert.throws(() => { + throw new Error('foo'); + }, TypeError); + }, 'expected [Function] to throw \'TypeError\' but [Error: foo] was thrown'); + + err(() => { + assert.throws(() => { + throw new Error('foo'); + }, 'bar'); + }, 'expected [Function] to throw error including \'bar\' but got \'foo\''); + + err(() => { + assert.throws(() => { + throw new Error('foo'); + }, Error, 'bar'); + }, 'expected [Function] to throw error including \'bar\' but got \'foo\''); + + err(() => { + assert.throws(() => { + throw new Error('foo'); + }, TypeError, 'bar'); + }, 'expected [Function] to throw \'TypeError\' but [Error: foo] was thrown'); + + err(() => { + assert.throws(() => { + }); + }, 'expected [Function] to throw an error'); + + err(() => { + assert.throws(() => { + throw new Error(''); + }, 'bar'); + }, 'expected [Function] to throw error including \'bar\' but got \'\''); + + err(() => { + assert.throws(() => { + throw new Error(''); + }, /bar/); + }, 'expected [Function] to throw error matching /bar/ but got \'\''); + }); + + test('doesNotThrow', () => { + assert.doesNotThrow(() => { + }); + assert.doesNotThrow(() => { + }, 'foo'); + + err(() => { + assert.doesNotThrow(() => { + throw new Error('foo'); + }); + }, 'expected [Function] to not throw an error but [Error: foo] was thrown'); + }); + + test('ifError', () => { + assert.ifError(false); + assert.ifError(null); + assert.ifError(undefined); + + err(() => { + assert.ifError('foo'); + }, 'expected \'foo\' to be falsy'); + }); + + test('operator', () => { + assert.operator(1, '<', 2); + assert.operator(2, '>', 1); + assert.operator(1, '==', 1); + assert.operator(1, '<=', 1); + assert.operator(1, '>=', 1); + assert.operator(1, '!=', 2); + assert.operator(1, '!==', 2); + + err(() => { + assert.operator(1, '=', 2); + }, 'Invalid operator "="'); + + err(() => { + assert.operator(2, '<', 1); + }, 'expected 2 to be < 1'); + + err(() => { + assert.operator(1, '>', 2); + }, 'expected 1 to be > 2'); + + err(() => { + assert.operator(1, '==', 2); + }, 'expected 1 to be == 2'); + + err(() => { + assert.operator(2, '<=', 1); + }, 'expected 2 to be <= 1'); + + err(() => { + assert.operator(1, '>=', 2); + }, 'expected 1 to be >= 2'); + + err(() => { + assert.operator(1, '!=', 1); + }, 'expected 1 to be != 1'); + + err(() => { + assert.operator(1, '!==', '1'); + }, 'expected 1 to be !== \'1\''); + }); + + test('closeTo', () => { + assert.closeTo(1.5, 1.0, 0.5); + assert.closeTo(10, 20, 20); + assert.closeTo(-10, 20, 30); + + err(() => { + assert.closeTo(2, 1.0, 0.5); + }, 'expected 2 to be close to 1 +/- 0.5'); + + err(() => { + assert.closeTo(-10, 20, 29); + }, 'expected -10 to be close to 20 +/- 29'); + }); + + test('members', () => { + assert.includeMembers([1, 2, 3], [2, 3]); + assert.includeMembers([1, 2, 3], []); + assert.includeMembers([1, 2, 3], [3]); + + err(() => { + assert.includeMembers([5, 6], [7, 8]); + }, 'expected [ 5, 6 ] to be a superset of [ 7, 8 ]'); + + err(() => { + assert.includeMembers([5, 6], [5, 6, 0]); + }, 'expected [ 5, 6 ] to be a superset of [ 5, 6, 0 ]'); + }); + + test('memberEquals', () => { + assert.sameMembers([], []); + assert.sameMembers([1, 2, 3], [3, 2, 1]); + assert.sameMembers([4, 2], [4, 2]); + + err(() => { + assert.sameMembers([], [1, 2]); + }, 'expected [] to have the same members as [ 1, 2 ]'); + + err(() => { + assert.sameMembers([1, 54], [6, 1, 54]); + }, 'expected [ 1, 54 ] to have the same members as [ 6, 1, 54 ]'); + }); + + + test('isAbove', () => { + assert.isAbove(10, 5); + + err(() => { + assert.isAbove(1, 5); + }, 'expected 1 to be above 5'); + err(() => { + assert.isAbove(5, 5); + }, 'expected 5 to be above 5'); + }); + + test('isBelow', () => { + assert.isBelow(5, 10); + + err(() => { + assert.isBelow(5, 1); + }, 'expected 5 to be above 1'); + err(() => { + assert.isBelow(5, 5); + }, 'expected 5 to be below 5'); + }); + + test('extensible', () => { assert.extensible({}); }); + test('isExtensible', () => { assert.isExtensible({}); }); + test('notExtensible', () => { assert.notExtensible(Object.preventExtensions({})); }); + test('isNotExtensible', () => { assert.isNotExtensible(Object.preventExtensions({})); }); + + test('sealed', () => { assert.sealed(Object.seal({})); }); + test('isSealed', () => { assert.isSealed(Object.seal({})); }); + test('notSealed', () => { assert.notSealed({}); }); + test('isNotSealed', () => { assert.isNotSealed({}); }); + + test('frozen', () => { assert.frozen(Object.freeze({})); }); + test('isFrozen', () => { assert.isFrozen(Object.freeze({})); }); + test('notFrozen', () => { assert.notFrozen({}); }); + test('isNotFrozen', () => { assert.isNotFrozen({}); }); + +}); diff --git a/chai/chai-3.2.0.d.ts b/chai/chai-3.2.0.d.ts new file mode 100644 index 000000000..e68e6fa3b --- /dev/null +++ b/chai/chai-3.2.0.d.ts @@ -0,0 +1,388 @@ +// Type definitions for chai 3.2.0 +// Project: http://chaijs.com/ +// Definitions by: Jed Mao , +// Bart van der Schoor , +// Andrew Brown , +// Olivier Chevet +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +// + +declare module Chai { + + interface ChaiStatic { + expect: ExpectStatic; + should(): Should; + /** + * Provides a way to extend the internals of Chai + */ + use(fn: (chai: any, utils: any) => void): any; + assert: AssertStatic; + config: Config; + AssertionError: typeof AssertionError; + } + + export interface ExpectStatic extends AssertionStatic { + fail(actual?: any, expected?: any, message?: string, operator?: string): void; + } + + export interface AssertStatic extends Assert { + } + + export interface AssertionStatic { + (target: any, message?: string): Assertion; + } + + interface ShouldAssertion { + equal(value1: any, value2: any, message?: string): void; + Throw: ShouldThrow; + throw: ShouldThrow; + exist(value: any, message?: string): void; + } + + interface Should extends ShouldAssertion { + not: ShouldAssertion; + fail(actual: any, expected: any, message?: string, operator?: string): void; + } + + interface ShouldThrow { + (actual: Function): void; + (actual: Function, expected: string|RegExp, message?: string): void; + (actual: Function, constructor: Error|Function, expected?: string|RegExp, message?: string): void; + } + + interface Assertion extends LanguageChains, NumericComparison, TypeComparison { + not: Assertion; + deep: Deep; + any: KeyFilter; + all: KeyFilter; + a: TypeComparison; + an: TypeComparison; + include: Include; + includes: Include; + contain: Include; + contains: Include; + ok: Assertion; + true: Assertion; + false: Assertion; + null: Assertion; + undefined: Assertion; + NaN: Assertion; + exist: Assertion; + empty: Assertion; + arguments: Assertion; + Arguments: Assertion; + equal: Equal; + equals: Equal; + eq: Equal; + eql: Equal; + eqls: Equal; + property: Property; + ownProperty: OwnProperty; + haveOwnProperty: OwnProperty; + ownPropertyDescriptor: OwnPropertyDescriptor; + haveOwnPropertyDescriptor: OwnPropertyDescriptor; + length: Length; + lengthOf: Length; + match: Match; + matches: Match; + string(string: string, message?: string): Assertion; + keys: Keys; + key(string: string): Assertion; + throw: Throw; + throws: Throw; + Throw: Throw; + respondTo: RespondTo; + respondsTo: RespondTo; + itself: Assertion; + satisfy: Satisfy; + satisfies: Satisfy; + closeTo(expected: number, delta: number, message?: string): Assertion; + members: Members; + increase: PropertyChange; + increases: PropertyChange; + decrease: PropertyChange; + decreases: PropertyChange; + change: PropertyChange; + changes: PropertyChange; + extensible: Assertion; + sealed: Assertion; + frozen: Assertion; + + } + + interface LanguageChains { + to: Assertion; + be: Assertion; + been: Assertion; + is: Assertion; + that: Assertion; + which: Assertion; + and: Assertion; + has: Assertion; + have: Assertion; + with: Assertion; + at: Assertion; + of: Assertion; + same: Assertion; + } + + interface NumericComparison { + above: NumberComparer; + gt: NumberComparer; + greaterThan: NumberComparer; + least: NumberComparer; + gte: NumberComparer; + below: NumberComparer; + lt: NumberComparer; + lessThan: NumberComparer; + most: NumberComparer; + lte: NumberComparer; + within(start: number, finish: number, message?: string): Assertion; + } + + interface NumberComparer { + (value: number, message?: string): Assertion; + } + + interface TypeComparison { + (type: string, message?: string): Assertion; + instanceof: InstanceOf; + instanceOf: InstanceOf; + } + + interface InstanceOf { + (constructor: Object, message?: string): Assertion; + } + + interface Deep { + equal: Equal; + include: Include; + property: Property; + members: Members; + } + + interface KeyFilter { + keys: Keys; + } + + interface Equal { + (value: any, message?: string): Assertion; + } + + interface Property { + (name: string, value?: any, message?: string): Assertion; + } + + interface OwnProperty { + (name: string, message?: string): Assertion; + } + + interface OwnPropertyDescriptor { + (name: string, descriptor: PropertyDescriptor, message?: string): Assertion; + (name: string, message?: string): Assertion; + } + + interface Length extends LanguageChains, NumericComparison { + (length: number, message?: string): Assertion; + } + + interface Include { + (value: Object, message?: string): Assertion; + (value: string, message?: string): Assertion; + (value: number, message?: string): Assertion; + keys: Keys; + members: Members; + any: KeyFilter; + all: KeyFilter; + } + + interface Match { + (regexp: RegExp|string, message?: string): Assertion; + } + + interface Keys { + (...keys: string[]): Assertion; + (keys: any[]): Assertion; + (keys: Object): Assertion; + } + + interface Throw { + (): Assertion; + (expected: string, message?: string): Assertion; + (expected: RegExp, message?: string): Assertion; + (constructor: Error, expected?: string, message?: string): Assertion; + (constructor: Error, expected?: RegExp, message?: string): Assertion; + (constructor: Function, expected?: string, message?: string): Assertion; + (constructor: Function, expected?: RegExp, message?: string): Assertion; + } + + interface RespondTo { + (method: string, message?: string): Assertion; + } + + interface Satisfy { + (matcher: Function, message?: string): Assertion; + } + + interface Members { + (set: any[], message?: string): Assertion; + } + + interface PropertyChange { + (object: Object, prop: string, msg?: string): Assertion; + } + + export interface Assert { + /** + * @param expression Expression to test for truthiness. + * @param message Message to display on error. + */ + (expression: any, message?: string): void; + + fail(actual?: any, expected?: any, msg?: string, operator?: string): void; + + ok(val: any, msg?: string): void; + isOk(val: any, msg?: string): void; + notOk(val: any, msg?: string): void; + isNotOk(val: any, msg?: string): void; + + equal(act: any, exp: any, msg?: string): void; + notEqual(act: any, exp: any, msg?: string): void; + + strictEqual(act: any, exp: any, msg?: string): void; + notStrictEqual(act: any, exp: any, msg?: string): void; + + deepEqual(act: any, exp: any, msg?: string): void; + notDeepEqual(act: any, exp: any, msg?: string): void; + + isTrue(val: any, msg?: string): void; + isFalse(val: any, msg?: string): void; + + isNull(val: any, msg?: string): void; + isNotNull(val: any, msg?: string): void; + + isUndefined(val: any, msg?: string): void; + isDefined(val: any, msg?: string): void; + + isNaN(val: any, msg?: string): void; + isNotNaN(val: any, msg?: string): void; + + isAbove(val: number, abv: number, msg?: string): void; + isBelow(val: number, blw: number, msg?: string): void; + + isFunction(val: any, msg?: string): void; + isNotFunction(val: any, msg?: string): void; + + isObject(val: any, msg?: string): void; + isNotObject(val: any, msg?: string): void; + + isArray(val: any, msg?: string): void; + isNotArray(val: any, msg?: string): void; + + isString(val: any, msg?: string): void; + isNotString(val: any, msg?: string): void; + + isNumber(val: any, msg?: string): void; + isNotNumber(val: any, msg?: string): void; + + isBoolean(val: any, msg?: string): void; + isNotBoolean(val: any, msg?: string): void; + + typeOf(val: any, type: string, msg?: string): void; + notTypeOf(val: any, type: string, msg?: string): void; + + instanceOf(val: any, type: Function, msg?: string): void; + notInstanceOf(val: any, type: Function, msg?: string): void; + + include(exp: string, inc: any, msg?: string): void; + include(exp: any[], inc: any, msg?: string): void; + + notInclude(exp: string, inc: any, msg?: string): void; + notInclude(exp: any[], inc: any, msg?: string): void; + + match(exp: any, re: RegExp, msg?: string): void; + notMatch(exp: any, re: RegExp, msg?: string): void; + + property(obj: Object, prop: string, msg?: string): void; + notProperty(obj: Object, prop: string, msg?: string): void; + deepProperty(obj: Object, prop: string, msg?: string): void; + notDeepProperty(obj: Object, prop: string, msg?: string): void; + + propertyVal(obj: Object, prop: string, val: any, msg?: string): void; + propertyNotVal(obj: Object, prop: string, val: any, msg?: string): void; + + deepPropertyVal(obj: Object, prop: string, val: any, msg?: string): void; + deepPropertyNotVal(obj: Object, prop: string, val: any, msg?: string): void; + + lengthOf(exp: any, len: number, msg?: string): void; + //alias frenzy + throw(fn: Function, msg?: string): void; + throw(fn: Function, regExp: RegExp): void; + throw(fn: Function, errType: Function, msg?: string): void; + throw(fn: Function, errType: Function, regExp: RegExp): void; + + throws(fn: Function, msg?: string): void; + throws(fn: Function, regExp: RegExp): void; + throws(fn: Function, errType: Function, msg?: string): void; + throws(fn: Function, errType: Function, regExp: RegExp): void; + + Throw(fn: Function, msg?: string): void; + Throw(fn: Function, regExp: RegExp): void; + Throw(fn: Function, errType: Function, msg?: string): void; + Throw(fn: Function, errType: Function, regExp: RegExp): void; + + doesNotThrow(fn: Function, msg?: string): void; + doesNotThrow(fn: Function, regExp: RegExp): void; + doesNotThrow(fn: Function, errType: Function, msg?: string): void; + doesNotThrow(fn: Function, errType: Function, regExp: RegExp): void; + + operator(val: any, operator: string, val2: any, msg?: string): void; + closeTo(act: number, exp: number, delta: number, msg?: string): void; + + sameMembers(set1: any[], set2: any[], msg?: string): void; + sameDeepMembers(set1: any[], set2: any[], msg?: string): void; + includeMembers(superset: any[], subset: any[], msg?: string): void; + + ifError(val: any, msg?: string): void; + + isExtensible(obj: {}, msg?: string): void; + extensible(obj: {}, msg?: string): void; + isNotExtensible(obj: {}, msg?: string): void; + notExtensible(obj: {}, msg?: string): void; + + isSealed(obj: {}, msg?: string): void; + sealed(obj: {}, msg?: string): void; + isNotSealed(obj: {}, msg?: string): void; + notSealed(obj: {}, msg?: string): void; + + isFrozen(obj: Object, msg?: string): void; + frozen(obj: Object, msg?: string): void; + isNotFrozen(obj: Object, msg?: string): void; + notFrozen(obj: Object, msg?: string): void; + + + } + + export interface Config { + includeStack: boolean; + } + + export class AssertionError { + constructor(message: string, _props?: any, ssf?: Function); + name: string; + message: string; + showDiff: boolean; + stack: string; + } +} + +declare var chai: Chai.ChaiStatic; + +declare module "chai" { + export = chai; +} + +interface Object { + should: Chai.Assertion; +} diff --git a/chai/chai-tests.ts b/chai/chai-tests.ts index 9b646b152..df09aea3e 100644 --- a/chai/chai-tests.ts +++ b/chai/chai-tests.ts @@ -1166,6 +1166,25 @@ function closeTo() { }, 'blah: expected -10 to be close to 20 +/- 29'); } +function approximately() { + expect(1.5).to.be.approximately(1.0, 0.5); + (1.5).should.be.approximately(1.0, 0.5); + expect(10).to.be.approximately(20, 20); + (10).should.be.approximately(20, 20); + expect(-10).to.be.approximately(20, 30); + (-10).should.be.approximately(20, 30); + + err(() => { + expect(2).to.be.approximately(1.0, 0.5, 'blah'); + (2).should.be.approximately(1.0, 0.5, 'blah'); + }, 'blah: expected 2 to be close to 1 +/- 0.5'); + + err(() => { + expect(-10).to.be.approximately(20, 29, 'blah'); + (-10).should.be.approximately(20, 29, 'blah'); + }, 'blah: expected -10 to be close to 20 +/- 29'); +} + function includeMembers() { expect([1, 2, 3]).to.include.members([]); [1, 2, 3].should.include.members([]); @@ -1255,6 +1274,20 @@ function increaseDecreaseChange() { same.should.not.change(obj, "val"); } +function oneOf() { + var obj = { z: 3 }; + + expect(5).to.be.oneOf([1, 5, 4]); + expect('z').to.be.oneOf(['x', 'y', 'z']); + expect(obj).to.be.oneOf([obj]); + + expect(5).to.not.be.oneOf([1, -12, 4]); + expect(5).to.not.be.oneOf([1, [5], 4]); + expect('z').to.not.be.oneOf(['w', 'x', 'y']); + expect('z').to.not.be.oneOf(['x', 'y', ['z']]); + expect(obj).to.not.be.oneOf([{ z: 3 }]); +} + //tdd declare function suite(description: string, action: Function): void; declare function test(description: string, action: Function): void; @@ -1879,6 +1912,20 @@ suite('assert', () => { }, 'expected -10 to be close to 20 +/- 29'); }); + test('approximately', () => { + assert.approximately(1.5, 1.0, 0.5); + assert.approximately(10, 20, 20); + assert.approximately(-10, 20, 30); + + err(() => { + assert.approximately(2, 1.0, 0.5); + }, 'expected 2 to be close to 1 +/- 0.5'); + + err(() => { + assert.approximately(-10, 20, 29); + }, 'expected -10 to be close to 20 +/- 29'); + }); + test('members', () => { assert.includeMembers([1, 2, 3], [2, 3]); assert.includeMembers([1, 2, 3], []); @@ -1945,4 +1992,55 @@ suite('assert', () => { test('notFrozen', () => { assert.notFrozen({}); }); test('isNotFrozen', () => { assert.isNotFrozen({}); }); + test('isNotTrue', () => { + assert.isNotTrue(false); + + err(() => { + assert.isNotTrue(true); + }, 'expected true to not be true'); + }); + + test('isNotFalse', () => { + assert.isNotFalse(true); + + err(() => { + assert.isNotFalse(false); + }, 'expected false to not be false'); + }); + + test('isAtLeast', () => { + assert.isAtLeast(5, 3); + assert.isAtLeast(5, 5); + + err(() => { + assert.isAtLeast(3, 5); + }, 'expected 3 to be greater than or equal to 5'); + }); + + test('isAtMost', () => { + assert.isAtMost(3, 5); + assert.isAtMost(5, 5); + + err(() => { + assert.isAtMost(5, 3); + }, 'expected 5 to be less than or equal to 3'); + }); + + test('oneOf', () => { + var obj = { z: 3 }; + + assert.oneOf(5, [1, 5, 4]); + assert.oneOf('z', ['x', 'y', 'z']); + assert.oneOf(obj, [obj]); + + err(() => { + assert.oneOf(5, [1, [5], 4]); + }, 'expected 5 to be one of [1, [5], 4]'); + err(() => { + assert.oneOf('z', ['w', 'x', 'y']); + }, 'expected "z" to be one of [w, x, y]'); + err(() => { + assert.oneOf(obj, [{ z: 3 }]); + }, 'expected { z: 3 } to be one of [{ z: 3 }]'); + }); }); diff --git a/chai/chai.d.ts b/chai/chai.d.ts index 28aaf48c2..074827b65 100644 --- a/chai/chai.d.ts +++ b/chai/chai.d.ts @@ -1,9 +1,10 @@ -// Type definitions for chai 3.2.0 +// Type definitions for chai 3.4.0 // Project: http://chaijs.com/ // Definitions by: Jed Mao , // Bart van der Schoor , // Andrew Brown , -// Olivier Chevet +// Olivier Chevet , +// Matt Wistrand // Definitions: https://github.com/borisyankov/DefinitelyTyped // @@ -19,7 +20,7 @@ declare module Chai { use(fn: (chai: any, utils: any) => void): any; assert: AssertStatic; config: Config; - AssertionError: AssertionError; + AssertionError: typeof AssertionError; } export interface ExpectStatic extends AssertionStatic { @@ -97,7 +98,8 @@ declare module Chai { itself: Assertion; satisfy: Satisfy; satisfies: Satisfy; - closeTo(expected: number, delta: number, message?: string): Assertion; + closeTo: CloseTo; + approximately: CloseTo; members: Members; increase: PropertyChange; increases: PropertyChange; @@ -108,7 +110,7 @@ declare module Chai { extensible: Assertion; sealed: Assertion; frozen: Assertion; - + oneOf(list: any[], message?: string): Assertion; } interface LanguageChains { @@ -155,6 +157,10 @@ declare module Chai { (constructor: Object, message?: string): Assertion; } + interface CloseTo { + (expected: number, delta: number, message?: string): Assertion; + } + interface Deep { equal: Equal; include: Include; @@ -259,6 +265,9 @@ declare module Chai { isTrue(val: any, msg?: string): void; isFalse(val: any, msg?: string): void; + isNotTrue(val: any, msg?: string): void; + isNotFalse(val: any, msg?: string): void; + isNull(val: any, msg?: string): void; isNotNull(val: any, msg?: string): void; @@ -271,6 +280,9 @@ declare module Chai { isAbove(val: number, abv: number, msg?: string): void; isBelow(val: number, blw: number, msg?: string): void; + isAtLeast(val: number, atlst: number, msg?: string): void; + isAtMost(val: number, atmst: number, msg?: string): void; + isFunction(val: any, msg?: string): void; isNotFunction(val: any, msg?: string): void; @@ -339,6 +351,7 @@ declare module Chai { operator(val: any, operator: string, val2: any, msg?: string): void; closeTo(act: number, exp: number, delta: number, msg?: string): void; + approximately(act: number, exp: number, delta: number, msg?: string): void; sameMembers(set1: any[], set2: any[], msg?: string): void; sameDeepMembers(set1: any[], set2: any[], msg?: string): void; @@ -361,7 +374,7 @@ declare module Chai { isNotFrozen(obj: Object, msg?: string): void; notFrozen(obj: Object, msg?: string): void; - + oneOf(inList: any, list: any[], msg?: string): void; } export interface Config { 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..3c7086de5 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; @@ -107,7 +107,7 @@ interface LinearInstance extends ChartInstance { getPointsAtEvent: (event: Event) => PointsAtEvent[]; update: () => void; addData: (valuesArray: number[], label: string) => void; - removeData: () => void; + removeData: (index?: number) => void; } interface CircularInstance extends ChartInstance { @@ -136,9 +136,11 @@ interface BarChartOptions extends ChartOptions { barStrokeWidth?: number; barValueSpacing?: number; barDatasetSpacing?: number; + scaleShowHorizontalLines?: boolean; + scaleShowVerticalLines?: boolean; } -interface RadarChartOptions { +interface RadarChartOptions extends ChartSettings { scaleShowLine?: boolean; angleShowLineOut?: boolean; scaleShowLabels?: boolean; @@ -159,7 +161,7 @@ interface RadarChartOptions { legendTemplate?: string; } -interface PolarAreaChartOptions { +interface PolarAreaChartOptions extends ChartSettings { scaleShowLabelBackdrop?: boolean; scaleBackdropColor?: string; scaleBeginAtZero?: boolean; @@ -176,7 +178,7 @@ interface PolarAreaChartOptions { legendTemplate?: string; } -interface PieChartOptions { +interface PieChartOptions extends ChartSettings { segmentShowStroke?: boolean; segmentStrokeColor?: string; segmentStrokeWidth?: number; diff --git a/chrome/chrome-app-tests.ts b/chrome/chrome-app-tests.ts index 970e03517..466571107 100644 --- a/chrome/chrome-app-tests.ts +++ b/chrome/chrome-app-tests.ts @@ -316,3 +316,12 @@ function testSocketsTcpServerTypes(): void { socketInfo.localAddress = "192.168.0.2"; socketInfo.localPort = 8000; } + +function testSystemNetwork() { + chrome.system.network.getNetworkInterfaces((networkInterfaces) => { + var iface: chrome.system.network.NetworkInterface; + for (var i in networkInterfaces) { + iface = networkInterfaces[i]; + } + }); +} diff --git a/chrome/chrome-app.d.ts b/chrome/chrome-app.d.ts index f75f7dca6..d40fa3b2d 100644 --- a/chrome/chrome-app.d.ts +++ b/chrome/chrome-app.d.ts @@ -378,3 +378,16 @@ declare module chrome.sockets.tcpServer { var onAccept: Event; var onAcceptError: Event; } + +//////////////////// +// System - Network +//////////////////// +declare module chrome.system.network { + interface NetworkInterface { + name: string; + address: string; + prefixLength: number; + } + + export function getNetworkInterfaces(callback: (networkInterfaces: NetworkInterface[]) => void): void; +} diff --git a/chrome/chrome-tests.ts b/chrome/chrome-tests.ts index 341738435..e184a8216 100644 --- a/chrome/chrome-tests.ts +++ b/chrome/chrome-tests.ts @@ -254,3 +254,11 @@ function testOptionsPage() { }); } +chrome.storage.sync.get("myKey", function (loadedData) { + var myValue: { x: number } = loadedData["myKey"]; +}); + +chrome.storage.onChanged.addListener(function (changes) { + var myNewValue: { x: number } = changes["myKey"].newValue; + var myOldValue: { x: number } = changes["myKey"].oldValue; +}); diff --git a/chrome/chrome.d.ts b/chrome/chrome.d.ts index 8829ab044..17613b88c 100755 --- a/chrome/chrome.d.ts +++ b/chrome/chrome.d.ts @@ -1,6 +1,6 @@ // Type definitions for Chrome extension development // Project: http://developer.chrome.com/extensions/ -// Definitions by: Matthew Kimber , otiai10 , couven92 +// Definitions by: Matthew Kimber , otiai10 , couven92 // Definitions: https://github.com/borisyankov/DefinitelyTyped /// @@ -2646,13 +2646,13 @@ declare module chrome.extension { * Parameter request: The request sent by the calling script. * Parameter sendResponse: Function to call (at most once) when you have a response. The argument should be any JSON-ifiable object, or undefined if there is no response. If you have more than one onRequest listener in the same document, then only one may send a response. */ - addListener(callback: (request: any, sender: runtime.MessageSender, sendResponse: () => void) => void): void; + addListener(callback: (request: any, sender: runtime.MessageSender, sendResponse: (response: any) => void) => void): void; /** * @param callback The callback parameter should be a function that looks like this: * function(runtime.MessageSender sender, function sendResponse) {...}; * Parameter sendResponse: Function to call (at most once) when you have a response. The argument should be any JSON-ifiable object, or undefined if there is no response. If you have more than one onRequest listener in the same document, then only one may send a response. */ - addListener(callback: (sender: runtime.MessageSender, sendResponse: () => void) => void): void; + addListener(callback: (sender: runtime.MessageSender, sendResponse: (response: any) => void) => void): void; } /** @@ -5553,7 +5553,7 @@ declare module chrome.runtime { * Optional parameter message: The message sent by the calling script. * Parameter sendResponse: Function to call (at most once) when you have a response. The argument should be any JSON-ifiable object. If you have more than one onMessage listener in the same document, then only one may send a response. This function becomes invalid when the event listener returns, unless you return true from the event listener to indicate you wish to send a response asynchronously (this will keep the message channel open to the other end until sendResponse is called). */ - addListener(callback: (message: any, sender: MessageSender, sendResponse: Function) => void): void; + addListener(callback: (message: any, sender: MessageSender, sendResponse: (response: any) => void) => void): void; } interface ExtensionConnectEvent extends chrome.events.Event { @@ -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. @@ -5866,13 +5866,13 @@ declare module chrome.sessions { * @since Chrome 20. */ declare module chrome.storage { - interface StorageArea { + interface StorageArea { /** * Gets the amount of space (in bytes) being used by one or more items. * @param callback Callback with the amount of space being used by storage, or on failure (in which case runtime.lastError will be set). * Parameter bytesInUse: Amount of space being used in storage, in bytes. */ - getBytesInUse(callback: (bytesInUse: number) => void): void; + getBytesInUse(callback: (bytesInUse: number) => void): void; /** * Gets the amount of space (in bytes) being used by one or more items. * @param key A single key to get the total usage for. Pass in null to get the total usage of all of storage. @@ -5886,11 +5886,11 @@ declare module chrome.storage { * @param callback Callback with the amount of space being used by storage, or on failure (in which case runtime.lastError will be set). * Parameter bytesInUse: Amount of space being used in storage, in bytes. */ - getBytesInUse(keys: string[], callback: (bytesInUse: number) => void): void; + getBytesInUse(keys: string[], callback: (bytesInUse: number) => void): void; /** * Removes all items from storage. * @param callback Optional. - * Callback on success, or on failure (in which case runtime.lastError will be set). + * Callback on success, or on failure (in which case runtime.lastError will be set). */ clear(callback?: () => void): void; /** @@ -5905,14 +5905,14 @@ declare module chrome.storage { * Removes one item from storage. * @param key A single key for items to remove. * @param callback Optional. - * Callback on success, or on failure (in which case runtime.lastError will be set). + * Callback on success, or on failure (in which case runtime.lastError will be set). */ remove(key: string, callback?: () => void): void; /** * Removes items from storage. * @param keys A list of keys for items to remove. * @param callback Optional. - * Callback on success, or on failure (in which case runtime.lastError will be set). + * Callback on success, or on failure (in which case runtime.lastError will be set). */ remove(keys: string[], callback?: () => void): void; /** @@ -5920,77 +5920,78 @@ declare module chrome.storage { * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set). * Parameter items: Object with items in their key-value mappings. */ - get(callback: (items: Object) => void): void; + get(callback: (items: { [key: string]: any }) => void): void; /** * Gets one or more items from storage. * @param key A single key to get. Pass in null to get the entire contents of storage. * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set). * Parameter items: Object with items in their key-value mappings. */ - get(key: string, callback: (items: Object) => void): void; + get(key: string, callback: (items: { [key: string]: any }) => void): void; /** * Gets one or more items from storage. * @param keys A list of keys to get. An empty list or object will return an empty result object. Pass in null to get the entire contents of storage. * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set). * Parameter items: Object with items in their key-value mappings. */ - get(keys: string[], callback: (items: Object) => void): void; + get(keys: string[], callback: (items: { [key: string]: any }) => void): void; /** * Gets one or more items from storage. * @param keys A dictionary specifying default values. Pass in null to get the entire contents of storage. * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set). * Parameter items: Object with items in their key-value mappings. */ - get(keys: Object, callback: (items: Object) => void): void; - } + get(keys: Object, callback: (items: { [key: string]: any }) => void): void; + } - interface StorageChange { + interface StorageChange { /** Optional. The new value of the item, if there is a new value. */ - newValue?: any; + newValue?: any; /** Optional. The old value of the item, if there was an old value. */ - oldValue?: any; - } + oldValue?: any; + } interface LocalStorageArea extends StorageArea { /** The maximum amount (in bytes) of data that can be stored in local storage, as measured by the JSON stringification of every value plus every key's length. This value will be ignored if the extension has the unlimitedStorage permission. Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError. */ - QUOTA_BYTES: number; - } + QUOTA_BYTES: number; + } interface SyncStorageArea extends StorageArea { /** @deprecated since Chrome 40. The storage.sync API no longer has a sustained write operation quota. */ - MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE: number; + MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE: number; /** The maximum total amount (in bytes) of data that can be stored in sync storage, as measured by the JSON stringification of every value plus every key's length. Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError. */ - QUOTA_BYTES: number; + QUOTA_BYTES: number; /** The maximum size (in bytes) of each individual item in sync storage, as measured by the JSON stringification of its value plus its key length. Updates containing items larger than this limit will fail immediately and set runtime.lastError. */ - QUOTA_BYTES_PER_ITEM: number; + QUOTA_BYTES_PER_ITEM: number; /** The maximum number of items that can be stored in sync storage. Updates that would cause this limit to be exceeded will fail immediately and set runtime.lastError. */ - MAX_ITEMS: number; + MAX_ITEMS: number; /** * The maximum number of set, remove, or clear operations that can be performed each hour. This is 1 every 2 seconds, a lower ceiling than the short term higher writes-per-minute limit. * Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError. */ - MAX_WRITE_OPERATIONS_PER_HOUR: number; + MAX_WRITE_OPERATIONS_PER_HOUR: number; /** * The maximum number of set, remove, or clear operations that can be performed each minute. This is 2 per second, providing higher throughput than writes-per-hour over a shorter period of time. * Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError. * @since Chrome 40. */ MAX_WRITE_OPERATIONS_PER_MINUTE: number; - } + } - interface StorageChangedEvent extends chrome.events.Event { + interface StorageChangedEvent extends chrome.events.Event { /** * @param callback * Parameter changes: Object mapping each key that changed to its corresponding storage.StorageChange for that item. * Parameter areaName: Since Chrome 22. The name of the storage area ("sync", "local" or "managed") the changes are for. */ - addListener(callback: (changes: Object, areaName: string) => void): void; - } + addListener(callback: (changes: { [key: string]: StorageChange }, areaName: string) => void): void; + } /** Items in the local storage area are local to each machine. */ var local: LocalStorageArea; /** Items in the sync storage area are synced using Chrome Sync. */ var sync: SyncStorageArea; + /** * Items in the managed storage area are set by the domain administrator, and are read-only for the extension; trying to modify this namespace results in an error. * @since Chrome 33. @@ -5998,7 +5999,7 @@ declare module chrome.storage { var managed: StorageArea; /** Fired when one or more items change. */ - var onChanged: StorageChangedEvent; + var onChanged: StorageChangedEvent; } //////////////////// @@ -7577,31 +7578,31 @@ declare module chrome.webNavigation { } interface WebNavigationEvent extends chrome.events.Event { - addListener(callback: (details: WebNavigationCallbackDetails, filters?: WebNavigationEventFilter) => void): void; + addListener(callback: (details: WebNavigationCallbackDetails) => void, filters?: WebNavigationEventFilter): void; } interface WebNavigationFramedEvent extends WebNavigationEvent { - addListener(callback: (details: WebNavigationFramedCallbackDetails, filters?: WebNavigationEventFilter) => void): void; + addListener(callback: (details: WebNavigationFramedCallbackDetails) => void, filters?: WebNavigationEventFilter): void; } interface WebNavigationFramedErrorEvent extends WebNavigationFramedEvent { - addListener(callback: (details: WebNavigationFramedErrorCallbackDetails, filters?: WebNavigationEventFilter) => void): void; + addListener(callback: (details: WebNavigationFramedErrorCallbackDetails) => void, filters?: WebNavigationEventFilter): void; } interface WebNavigationSourceEvent extends WebNavigationEvent { - addListener(callback: (details: WebNavigationSourceCallbackDetails, filters?: WebNavigationEventFilter) => void): void; + addListener(callback: (details: WebNavigationSourceCallbackDetails) => void, filters?: WebNavigationEventFilter): void; } interface WebNavigationParentedEvent extends WebNavigationEvent { - addListener(callback: (details: WebNavigationParentedCallbackDetails, filters?: WebNavigationEventFilter) => void): void; + addListener(callback: (details: WebNavigationParentedCallbackDetails) => void, filters?: WebNavigationEventFilter): void; } interface WebNavigationTransitionalEvent extends WebNavigationEvent { - addListener(callback: (details: WebNavigationTransitionCallbackDetails, filters?: WebNavigationEventFilter) => void): void; + addListener(callback: (details: WebNavigationTransitionCallbackDetails) => void, filters?: WebNavigationEventFilter): void; } interface WebNavigationReplacementEvent extends WebNavigationEvent { - addListener(callback: (details: WebNavigationReplacementCallbackDetails, filters?: WebNavigationEventFilter) => void): void; + addListener(callback: (details: WebNavigationReplacementCallbackDetails) => void, filters?: WebNavigationEventFilter): void; } /** diff --git a/ckeditor/ckeditor.d.ts b/ckeditor/ckeditor.d.ts index cab51f72c..88fee3674 100644 --- a/ckeditor/ckeditor.d.ts +++ b/ckeditor/ckeditor.d.ts @@ -74,12 +74,13 @@ 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; function getUrl(resource: string): string; function inline(element: string, instanceConfig?: config): editor; - function inline(element: HTMLTextAreaElement, instanceConfig?: config): editor; + function inline(element: HTMLElement, instanceConfig?: config): editor; function inlineAll(): void; function loadFullCore(): void; function replace(element: string, config?: config): editor; @@ -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; + } } diff --git a/clean-css/clean-css-tests.ts b/clean-css/clean-css-tests.ts new file mode 100644 index 000000000..ffbb3d127 --- /dev/null +++ b/clean-css/clean-css-tests.ts @@ -0,0 +1,55 @@ +/// + +import * as CleanCSS from 'clean-css'; + +var source = 'a{font-weight:bold;}'; +var minified = new CleanCSS().minify(source).styles; + +var source = '@import url(http://path/to/remote/styles);'; +new CleanCSS().minify(source, function (error, minified) { + console.log(minified.styles); +}); + +const pathToOutputDirectory = 'path'; + +new CleanCSS({ sourceMap: true, target: pathToOutputDirectory }) + .minify(source, function (error, minified) { + // access minified.sourceMap for SourceMapGenerator object + // see https://github.com/mozilla/source-map/#sourcemapgenerator for more details + // see https://github.com/jakubpawlowicz/clean-css/blob/master/bin/cleancss#L114 on how it's used in clean-css' CLI + console.log(minified.sourceMap); +}); + +const inputSourceMapAsString = 'input'; +new CleanCSS({ sourceMap: inputSourceMapAsString, target: pathToOutputDirectory }) + .minify(source, function (error, minified) { + // access minified.sourceMap to access SourceMapGenerator object + // see https://github.com/mozilla/source-map/#sourcemapgenerator for more details + // see https://github.com/jakubpawlowicz/clean-css/blob/master/bin/cleancss#L114 on how it's used in clean-css' CLI + console.log(minified.sourceMap); +}); + +new CleanCSS({ sourceMap: true, target: pathToOutputDirectory }).minify({ + 'path/to/source/1': { + styles: '...styles...', + sourceMap: '...source-map...' + }, + 'path/to/source/2': { + styles: '...styles...', + sourceMap: '...source-map...' + } +}, function (error, minified) { + // access minified.sourceMap as above + console.log(minified.sourceMap); +}); + +new CleanCSS().minify(['path/to/file/one', 'path/to/file/two']); + +new CleanCSS().minify({ + 'path/to/file/one': { + styles: 'contents of file one' + }, + 'path/to/file/two': { + styles: 'contents of file two' + } +}); diff --git a/clean-css/clean-css.d.ts b/clean-css/clean-css.d.ts new file mode 100644 index 000000000..25bb2471a --- /dev/null +++ b/clean-css/clean-css.d.ts @@ -0,0 +1,109 @@ +// Type definitions for clean-css v3.4.9 +// Project: https://github.com/jakubpawlowicz/clean-css +// Definitions by: Tanguy Krotoff +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module 'clean-css' { + namespace CleanCSS { + interface Options { + // Set to false to disable advanced optimizations - selector & property merging, reduction, etc. + advanced?: boolean; + + // Set to false to disable aggressive merging of properties. + aggressiveMerging?: boolean; + + // Turns on benchmarking mode measuring time spent on cleaning up (run npm run bench to see example) + benchmark?: boolean; + + // Enables compatibility mode + compatibility?: Object; + + // Set to true to get minification statistics under stats property (see test/custom-test.js for examples) + debug?: boolean; + + // A hash of options for @import inliner, see test/protocol-imports-test.js for examples, or this comment for a proxy use case. + inliner?: Object; + + // Whether to keep line breaks (default is false) + keepBreaks?: boolean; + + // * for keeping all (default), 1 for keeping first one only, 0 for removing all + keepSpecialComments?: string | number; + + // Whether to merge @media at-rules (default is true) + mediaMerging?: boolean; + + // Whether to process @import rules + processImport?: boolean; + + // A list of @import rules, can be ['all'] (default), ['local'], ['remote'], or a blacklisted path e.g. ['!fonts.googleapis.com'] + processImportFrom?: Array; + + // Set to false to skip URL rebasing + rebase?: boolean; + + // Path to resolve relative @import rules and URLs + relativeTo?: string; + + // Set to false to disable restructuring in advanced optimizations + restructuring?: boolean; + + // Path to resolve absolute @import rules and rebase relative URLs + root?: string; + + // Rounding precision; defaults to 2; -1 disables rounding + roundingPrecision?: number; + + // Set to true to enable semantic merging mode which assumes BEM-like content (default is false as it's highly likely this will break your stylesheets - use with caution!) + semanticMerging?: boolean; + + // Set to false to skip shorthand compacting (default is true unless sourceMap is set when it's false) + shorthandCompacting?: boolean; + + // Exposes source map under sourceMap property, e.g. new CleanCSS().minify(source).sourceMap (default is false) If input styles are a product of CSS preprocessor (Less, Sass) an input source map can be passed as a string. + sourceMap?: boolean | string; + + // Set to true to inline sources inside a source map's sourcesContent field (defaults to false) It is also required to process inlined sources from input source maps. + sourceMapInlineSources?: boolean; + + // Path to a folder or an output file to which rebase all URLs + target?: string; + } + + interface Output { + // Optimized output CSS as a string + styles: string; + + // Output source map (if requested with sourceMap option) + sourceMap: string; + + // A list of errors raised + errors: Array; + + // A list of warnings raised + warnings: Array; + + // A hash of statistic information (if requested with debug option) + stats: { + // Original content size (after import inlining) + originalSize: number; + + // Optimized content size + minifiedSize: number; + + // Time spent on optimizations + timeSpent: number; + + // A ratio of output size to input size (e.g. 25% if content was reduced from 100 bytes to 75 bytes) + efficiency: number; + }; + } + } + + class CleanCSS { + constructor(options?: CleanCSS.Options); + minify(sources: string | Array | Object, callback?: (error: any, minified: CleanCSS.Output) => void): CleanCSS.Output; + } + + export = CleanCSS; +} diff --git a/clipboard/clipboard-tests.ts b/clipboard/clipboard-tests.ts new file mode 100644 index 000000000..de6e9fc1a --- /dev/null +++ b/clipboard/clipboard-tests.ts @@ -0,0 +1,22 @@ +/// + +var cb1 = new clipboard.Clipboard('.btn'); +var cb2 = new clipboard.Clipboard('.btn', { + action: elem => 'copy' +}); +var cb3 = new clipboard.Clipboard('.btn', { + text: elem => null +}); +var cb4 = new clipboard.Clipboard('.btn', { + target: elem => null +}); +var cb5 = new clipboard.Clipboard('.btn', { + action: elem => 'copy', + target: elem => null +}); + +cb1.destroy(); + +cb2.on('success', function(e) { }); +cb2.on('error', function(e) { }); + diff --git a/clipboard/clipboard.d.ts b/clipboard/clipboard.d.ts new file mode 100644 index 000000000..ddba32b06 --- /dev/null +++ b/clipboard/clipboard.d.ts @@ -0,0 +1,52 @@ +// Type definitions for clipboard.js 1.5.5 +// Project: https://github.com/zenorocha/clipboard.js +// Definitions by: Andrei Kurosh +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module clipboard { + + export class Clipboard { + constructor(selector: string, options?: IOptions); + + /** + * Subscribes to events that indicate the result of a copy/cut operation. + * @param type {String} Event type ('success' or 'error'). + * @param handler Callback function. + */ + on(type: "success", handler: (e: Event) => void): void; + on(type: "error", handler: (e: Event) => void): void; + on(type: string, handler: (e: Event) => void): void; + + /** + * Clears all event bindings. + */ + destroy(): void; + } + + interface IOptions { + /** + * Overwrites default command ('cut' or 'copy'). + * @param {Element} elem Current element + * @returns {String} Only 'cut' or 'copy'. + */ + action?: (elem: Element) => string; + + /** + * Overwrites default target input element. + * @param {Element} elem Current element + * @returns {Element} element to use. + */ + target?: (elem: Element) => Element; + + /** + * Returns the explicit text to copy. + * @param {Element} elem Current element + * @returns {String} Text to be copied. + */ + text?: (elem: Element) => string; + } +} + +declare module 'clipboard' { + export = clipboard; +} \ No newline at end of file diff --git a/codemirror/codemirror-showhint.d.ts b/codemirror/codemirror-showhint.d.ts index 48a904a3b..8b620a414 100644 --- a/codemirror/codemirror-showhint.d.ts +++ b/codemirror/codemirror-showhint.d.ts @@ -41,9 +41,7 @@ declare module CodeMirror { off(eventName: string, handler: (doc: CodeMirror.Doc, event: any) => void): void; } - /** Extend CodeMirror.Doc with a state object, so that the Doc.state.completionActive property is reachable*/ interface Doc { - state: any; showHint: (options: ShowHintOptions) => void; } diff --git a/codemirror/codemirror.d.ts b/codemirror/codemirror.d.ts index 2ca58c702..81b0d8b03 100644 --- a/codemirror/codemirror.d.ts +++ b/codemirror/codemirror.d.ts @@ -390,6 +390,9 @@ declare module CodeMirror { The handler may mess with the style of the resulting element, or add event handlers, but should not try to change the state of the editor. */ on(eventName: 'renderLine', handler: (instance: CodeMirror.Editor, line: number, element: HTMLElement) => void ): void; off(eventName: 'renderLine', handler: (instance: CodeMirror.Editor, line: number, element: HTMLElement) => void ): void; + + /** Expose the state object, so that the Editor.state.completionActive property is reachable*/ + state: any; } interface EditorFromTextArea extends Editor { @@ -589,6 +592,8 @@ declare module CodeMirror { /** The reverse of posFromIndex. */ indexFromPos(object: CodeMirror.Position): number; + /** Expose the state object, so that the Doc.state.completionActive property is reachable*/ + state: any; } interface LineHandle { @@ -601,7 +606,7 @@ declare module CodeMirror { /** Returns a {from, to} object (both holding document positions), indicating the current position of the marked range, or undefined if the marker is no longer in the document. */ - find(): CodeMirror.Position; + find(): CodeMirror.Range; /** Returns an object representing the options for the marker. If copyWidget is given true, it will clone the value of the replacedWith option, if any. */ getOptions(copyWidget: boolean): CodeMirror.TextMarkerOptions; @@ -645,7 +650,12 @@ declare module CodeMirror { new (line: number, ch: number): Position; (line: number, ch: number): Position; } - + + interface Range{ + from: CodeMirror.Position; + to: CodeMirror.Position; + } + interface Position { ch: number; line: number; @@ -795,9 +805,9 @@ declare module CodeMirror { viewportMargin?: number; /** Optional lint configuration to be used in conjunction with CodeMirror's linter addon. */ - lint?: boolean | LintOptions; - - /** Optional value to be used in conduction with CodeMirror’s placeholder add-on. */ + lint?: boolean | LintOptions; + + /** Optional value to be used in conduction with CodeMirror’s placeholder add-on. */ placeholder?: string; } diff --git a/commander/commander.d.ts b/commander/commander.d.ts index cf04591bb..d0efa6305 100644 --- a/commander/commander.d.ts +++ b/commander/commander.d.ts @@ -65,10 +65,11 @@ declare module commander { * * @param {String} name * @param {String} [desc] + * @param {Mixed} [opts] * @return {Command} the new command * @api public */ - command(name:string, desc?:string):ICommand; + command(name:string, desc?:string, opts?: any):ICommand; /** * Add an implicit `help [cmd]` subcommand diff --git a/commonmark/commonmark-tests.ts b/commonmark/commonmark-tests.ts new file mode 100644 index 000000000..4896c0464 --- /dev/null +++ b/commonmark/commonmark-tests.ts @@ -0,0 +1,47 @@ +/// + +import commonmark = require('commonmark'); + +function logNode(node: commonmark.Node) { + + console.log( + node.destination, + node.firstChild, + node.info, + node.isContainer, + node.lastChild, + node.level, + node.listDelimiter, + node.listStart, + node.listTight, + node.listType, + node.literal, + node.next, + node.onEnter, + node.onExit, + node.parent, + node.prev, + node.sourcepos, + node.title, + node.type); + +} + +var parser = new commonmark.Parser({ smart: true, time: true }); +var node = parser.parse('# a piece of _markdown_'); + + +let w = node.walker(); +let step = w.next(); +if (step.entering) { + logNode(step.node); +} + + +let xmlRenderer = new commonmark.XmlRenderer({ sourcepos: true, time: true }); +let xml = xmlRenderer.render(node); +console.log(xml); + +let htmlRenderer = new commonmark.HtmlRenderer({ safe: true, smart: true, sourcepos: true, time: true}); +let html = htmlRenderer.render(node); +console.log(html); \ No newline at end of file diff --git a/commonmark/commonmark.d.ts b/commonmark/commonmark.d.ts new file mode 100644 index 000000000..8f1271451 --- /dev/null +++ b/commonmark/commonmark.d.ts @@ -0,0 +1,214 @@ +// Type definitions for commonmark.js 0.22.1 +// Project: https://github.com/jgm/commonmark.js +// Definitions by: Nico Jansen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + + +declare module commonmark { + + export interface NodeWalkingStep { + /** + * a boolean, which is true when we enter a Node from a parent or sibling, and false when we reenter it from a child + */ + entering: boolean; + /** + * The node belonging to this step + */ + node: Node; + } + + export interface NodeWalker { + /** + * Returns an object with properties entering and node. Returns null when we have finished walking the tree. + */ + next(): NodeWalkingStep; + /** + * Resets the iterator to resume at the specified node and setting for entering. (Normally this isn't needed unless you do destructive updates to the Node tree.) + */ + resumeAt(node: Node, entering?: boolean): void; + } + + export interface Position extends Array> { + } + + export interface ListData { + type?: string, + tight?: boolean, + delimiter?: string, + bulletChar?: string + } + + export class Node { + constructor(nodeType: string, sourcepos?: Position); + isContainer: boolean; + + /** + * (read-only): one of Text, Softbreak, Hardbreak, Emph, Strong, Html, Link, Image, Code, Document, Paragraph, BlockQuote, Item, List, Heading, CodeBlock, HtmlBlock ThematicBreak. + */ + type: string; + /** + * (read-only): a Node or null. + */ + firstChild: Node; + /** + * (read-only): a Node or null. + */ + lastChild: Node; + /** + * (read-only): a Node or null. + */ + next: Node; + /** + * (read-only): a Node or null. + */ + prev: Node; + /** + * (read-only): a Node or null. + */ + parent: Node; + /** + * (read-only): an Array with the following form: [[startline, startcolumn], [endline, endcolumn]] + */ + sourcepos: Position; + /** + * the literal String content of the node or null. + */ + literal: string; + /** + * link or image destination (String) or null. + */ + destination: string; + /** + * link or image title (String) or null. + */ + title: string; + /** + * fenced code block info string (String) or null. + */ + info: string; + /** + * heading level (Number). + */ + level: number; + /** + * either Bullet or Ordered (or undefined). + */ + listType: string; + /** + * true if list is tight + */ + listTight: boolean; + /** + * a Number, the starting number of an ordered list. + */ + listStart: number; + /** + * a String, either ) or . for an ordered list. + */ + listDelimiter: string; + /** + * used only for CustomBlock or CustomInline. + */ + onEnter: string; + /** + * used only for CustomBlock or CustomInline. + */ + onExit: string; + /** + * Append a Node child to the end of the Node's children. + */ + appendChild(child: Node): void; + /** + * Prepend a Node child to the beginning of the Node's children. + */ + prependChild(child: Node): void; + /** + * Remove the Node from the tree, severing its links with siblings and parents, and closing up gaps as needed. + */ + unlink(): void; + /** + * Insert a Node sibling after the Node. + */ + insertAfter(sibling: Node): void; + /** + * Insert a Node sibling before the Node. + */ + insertBefore(sibling: Node): void; + /** + * Returns a NodeWalker that can be used to iterate through the Node tree rooted in the Node + */ + walker(): NodeWalker; + /** + * Setting the backing object of listType, listTight, listStat and listDelimiter directly. + * Not needed unless creating list nodes directly. Should be fixed from v>0.22.1 + * https://github.com/jgm/commonmark.js/issues/74 + */ + _listData: ListData; + } + + /** + * Instead of converting Markdown directly to HTML, as most converters do, commonmark.js parses Markdown to an AST (abstract syntax tree), and then renders this AST as HTML. + * This opens up the possibility of manipulating the AST between parsing and rendering. For example, one could transform emphasis into ALL CAPS. + */ + export class Parser { + /** + * Constructs a new Parser + */ + constructor(options?: ParserOptions); + parse(input: string): Node; + } + + export interface ParserOptions { + /** + * if true, straight quotes will be made curly, -- will be changed to an en dash, --- will be changed to an em dash, and ... will be changed to ellipses. + */ + smart?: boolean; + time?: boolean; + } + + export interface HtmlRenderingOptions extends XmlRenderingOptions { + /** + * if true, raw HTML will not be passed through to HTML output (it will be replaced by comments), and potentially unsafe URLs in links and images (those beginning with javascript:, vbscript:, file:, and with a few exceptions data:) will be replaced with empty strings. + */ + safe?: boolean; + /** + * if true, straight quotes will be made curly, -- will be changed to an en dash, --- will be changed to an em dash, and ... will be changed to ellipses. + */ + smart?: boolean; + /** + * if true, source position information for block-level elements will be rendered in the data-sourcepos attribute (for HTML) or the sourcepos attribute (for XML). + */ + sourcepos?: boolean; + } + + export class HtmlRenderer { + constructor(options?: HtmlRenderingOptions) + render(root: Node): string; + /** + * Let's you override the softbreak properties of a renderer. So, to make soft breaks render as hard breaks in HTML: + * writer.softbreak = "
"; + */ + softbreak: string; + /** + * Override the function that will be used to escape (sanitize) the html output. Return value is used to add to the html output + * @param input the input to escape + * @param isAttributeValue indicates wheter or not the input value will be used as value of an html attribute. + */ + escape: (input: string, isAttributeValue: boolean) => string; + } + + export interface XmlRenderingOptions { + time?: boolean; + sourcepos?: boolean; + } + + export class XmlRenderer { + constructor(options?: XmlRenderingOptions) + render(root: Node): string; + } + +} + +declare module 'commonmark' { + export = commonmark; +} \ 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/confidence/confidence-tests.ts b/confidence/confidence-tests.ts new file mode 100644 index 000000000..60825e012 --- /dev/null +++ b/confidence/confidence-tests.ts @@ -0,0 +1,79 @@ +/// + +import Confidence = require('confidence'); + +let criteria = { + "env": "production", + "platform": "ios", + "xfactor": "yes", + "random": { + "a": 15 + } +}; + +/** +* The configurations in Confidence style +*/ +let config = { + "key1": "abc", + "key2": { + "$filter": "env", + "production": { + "deeper": { + "$value": "value" + } + }, + "$default": { + "$filter": "platform", + "android": 0, + "ios": 1, + "$default": 2 + } + }, + "key3": { + "sub1": 123, + "sub2": { + "$filter": "xfactor", + "yes": 6 + } + }, + "ab": { + "$filter": "random.a", + "$range": [ + { "limit": 10, "value": 4 }, + { "limit": 20, "value": 5 } + ], + "$default": 6 + }, + "$meta": { + "description": "example file" + } +}; + + +/** +* Creates an empty configuration storage container +*/ +let store = new Confidence.Store(config); + + +/** +* Validates the provided configuration, clears any existing configuration, then loads the configuration +*/ +store.load(config); + + +/** +* Retrieves a value from the configuration document after applying the provided criteria +*/ +store.get('/key1'); +//criteria - optional object +store.get('/key2', criteria); + + +/** +* Retrieves the metadata (if any) from the configuration document after applying the provided criteria +*/ +store.meta('/key1'); +//criteria - optional object +store.meta('/key2', criteria); diff --git a/confidence/confidence.d.ts b/confidence/confidence.d.ts new file mode 100644 index 000000000..4c30b4407 --- /dev/null +++ b/confidence/confidence.d.ts @@ -0,0 +1,48 @@ +// Type definitions for Confidence v1.4.2 +// Project: https://github.com/hapijs/confidence.git +// Definitions by: Jean-Philippe Pellerin +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/** +* Confidence is a configuration document format, an API, and a foundation for A/B testing. +* The configuration format is designed to work with any existing JSON-based configuration, +* serving values based on object path ('/a/b/c' translates to a.b.c). In addition, +* confidence defines special $-prefixed keys used to filter values for a given criteria. +*/ +declare module 'confidence' { + + export class Store { + + /** + * @constructor + * @param {any} document - the configuration document for this document store + */ + constructor(document?: any); + + /** + * Validates the provided configuration, clears any existing configuration, then loads the configuration where: + * @param {any} document - an object containing a confidence configuration object generated from a parsed JSON document. If the document is invlaid, will throw an error. + */ + load(document: any): void; + + + /** + * Retrieves a value from the configuration document after applying the provided criteria where: + * @param {string} key - the requested key path. All keys must begin with '/'. '/' returns the the entire document. + * @param {any} criteria - optional object used as criteria for applying filters in the configuration document. Defaults to {}. + * + * @return {any} Returns the value found after applying the criteria. If the key is invalid or not found, returns undefined. + */ + get(key: string, criteria?: any): any; + + + /** + * Retrieves the metadata (if any) from the configuration document after applying the provided criteria where: + * @param {string} key - the requested key path. All keys must begin with '/'. '/' returns the the entire document. + * @param {any} criteria - optional object used as criteria for applying filters in the configuration document. Defaults to {}. + * + * @return {any} Returns the metadata found after applying the criteria. If the key is invalid or not found, or if no metadata is available, returns undefined. + */ + meta(key: string, criteria?: any): any; + } +} diff --git a/connect-timeout/connect-timeout-tests.ts b/connect-timeout/connect-timeout-tests.ts new file mode 100644 index 000000000..4f77b597d --- /dev/null +++ b/connect-timeout/connect-timeout-tests.ts @@ -0,0 +1,28 @@ +/// +/// +/// +/// + +import * as express from "express"; +import timeout from "connect-timeout"; +import * as bodyParser from "body-parser"; +import * as cookieParser from "cookie-parser"; + +// example of using this top-level; note the use of haltOnTimedout +// after every middleware; it will stop the request flow on a timeout +var app = express(); +app.use(timeout("5s", { respond: false })); +app.use(bodyParser()); +app.use(haltOnTimedout); +app.use(cookieParser()); +app.use(haltOnTimedout); + +// Add your routes here, etc. + +function haltOnTimedout(req: express.Request, res: express.Response, next: Function) { + if (!req.timedout) { + next(); + } +} + +app.listen(3000); diff --git a/connect-timeout/connect-timeout.d.ts b/connect-timeout/connect-timeout.d.ts new file mode 100644 index 000000000..88bafbad5 --- /dev/null +++ b/connect-timeout/connect-timeout.d.ts @@ -0,0 +1,39 @@ +// Type definitions for connect-timeout +// Project: https://github.com/expressjs/timeout +// Definitions by: Cyril Schumacher +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module Express { + export interface Request { + /** + * @summary Clears the timeout on the request. + */ + clearTimeout(): void; + + /** + * + * @return {boolean} true if timeout fired; false otherwise. + */ + timedout(event: string, message: string): boolean; + } +} + +declare module "connect-timeout" { + import express = require("express"); + + /** + * @summary Interface for timeout options. + * @interface + */ + interface TimeoutOptions extends Object { + /** + * @summary Controls if this module will "respond" in the form of forwarding an error. + * @type {boolean} + */ + respond: boolean; + } + + export default function timeout(timeout: string, options?: TimeoutOptions): express.RequestHandler; +} diff --git a/console-stamp/console-stamp-tests.ts b/console-stamp/console-stamp-tests.ts new file mode 100644 index 000000000..e6ae6895b --- /dev/null +++ b/console-stamp/console-stamp-tests.ts @@ -0,0 +1,21 @@ +/// + +import consoleStamp = require("console-stamp"); + +consoleStamp(console); + +var options = {}; +consoleStamp(console, options); + +var options2 = { + metadata: function ():string { + return 'string'; + }, + colors: { + stamp: "yellow", + label: "white", + metadata: "green" + }, + label: true +}; +consoleStamp(console, options2); diff --git a/console-stamp/console-stamp.d.ts b/console-stamp/console-stamp.d.ts new file mode 100644 index 000000000..a798dc66c --- /dev/null +++ b/console-stamp/console-stamp.d.ts @@ -0,0 +1,46 @@ +// Type definitions for console-stamp 0.2.0 +// Project: https://github.com/starak/node-console-stamp +// Definitions by: Eric Byers +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module 'console-stamp' { + + function consoleStamp(console:{}, options?: { + /** + * A string with date format based on Javascript Date Format + */ + pattern?: string + + /** + * If true it will show the label (LOG | INFO | WARN | ERROR) + */ + label?: boolean; + + /** + * An array containing the methods to include in the patch + */ + include?: any; + + /** + * An array containing the methods to exclude in the patch) + */ + exclude?: any; + + /** + * Types can be String, Object (interpreted with util.inspect), or Function. See the test-metadata.js for examples. + * Note that metadata can still be sent as the third parameter (as in vesion 1.6) as a backward compatibillity feature, but this is deprecated. + */ + metadata?: any; + + /** + * An object representing a color theme. More info https://www.npmjs.com/package/colors + */ + colors?: { + stamp?: any; + label?: any; + metadata?: any; + }; + }): void; + + export = consoleStamp; +} diff --git a/consolidate/consolidate-tests.ts b/consolidate/consolidate-tests.ts index bf4fea449..77fddb631 100644 --- a/consolidate/consolidate-tests.ts +++ b/consolidate/consolidate-tests.ts @@ -1,27 +1,168 @@ /// +import cons = require('consolidate'); -import consolidate = require('consolidate'); +var path: string = 'test/path'; +var options = {user: 'tobi'}; +var fn = function(err: Error, html: string) {}; + +cons.atpl(path); +cons.atpl(path, options); +cons.atpl(path, options, fn); + +cons.dot(path); +cons.dot(path, options); +cons.dot(path, options, fn); + +cons.dust(path); +cons.dust(path, options); +cons.dust(path, options, fn); + +cons.eco(path); +cons.eco(path, options); +cons.eco(path, options, fn); + +cons.ect(path); +cons.ect(path, options); +cons.ect(path, options, fn); + +cons.ejs(path); +cons.ejs(path, options); +cons.ejs(path, options, fn); + +cons.haml(path); +cons.haml(path, options); +cons.haml(path, options, fn); + +// TODO figure out how to type haml-coffee +// cons['haml-coffee'](path, options, fn); + +cons.hamlet(path); +cons.hamlet(path, options); +cons.hamlet(path, options, fn); + +cons.handlebars(path); +cons.handlebars(path, options); +cons.handlebars(path, options, fn); + +cons.hogan(path); +cons.hogan(path, options); +cons.hogan(path, options, fn); + +cons.htmling(path); +cons.htmling(path, options); +cons.htmling(path, options, fn); + +cons.jade(path); +cons.jade(path, options); +cons.jade(path, options, fn); + +cons.jazz(path); +cons.jazz(path, options); +cons.jazz(path, options, fn); + +cons.jqtpl(path); +cons.jqtpl(path, options); +cons.jqtpl(path, options, fn); + +cons.just(path); +cons.just(path, options); +cons.just(path, options, fn); + +cons.liquid(path); +cons.liquid(path, options); +cons.liquid(path, options, fn); + +cons.liquor(path); +cons.liquor(path, options); +cons.liquor(path, options, fn); + +cons.lodash(path); +cons.lodash(path, options); +cons.lodash(path, options, fn); + +cons.mote(path); +cons.mote(path, options); +cons.mote(path, options, fn); + +cons.mustache(path); +cons.mustache(path, options); +cons.mustache(path, options, fn); + +cons.nunjucks(path); +cons.nunjucks(path, options); +cons.nunjucks(path, options, fn); + +cons.qejs(path); +cons.qejs(path, options); +cons.qejs(path, options, fn); + +cons.ractive(path); +cons.ractive(path, options); +cons.ractive(path, options, fn); + +cons.react(path); +cons.react(path, options); +cons.react(path, options, fn); + +cons.swig(path); +cons.swig(path, options); +cons.swig(path, options, fn); + +cons.templayed(path); +cons.templayed(path, options); +cons.templayed(path, options, fn); + +cons.toffee(path); +cons.toffee(path, options); +cons.toffee(path, options, fn); + +cons.underscore(path); +cons.underscore(path, options); +cons.underscore(path, options, fn); + +cons.walrus(path); +cons.walrus(path, options); +cons.walrus(path, options, fn); + +cons.whiskers(path); +cons.whiskers(path, options); +cons.whiskers(path, options, fn); + +/** + * Examples from documentation + * https://github.com/tj/consolidate.js/ + */ +// Common use +cons.swig('views/page.html', { user: 'tobi' }, function(err, html) { + if (err) throw err; + console.log(html); +}); + +// Options object is optional +cons.swig('views/page.html', function(err, html) { + if (err) throw err; + console.log(html); +}); + +// To dynamically pass the engine, simply use the subscript operator and a variable: +cons['swig']('views/page.html', { user: 'tobi' }, function(err, html) { + if (err) throw err; + console.log(html); +}); + +// Returns a promise if no is callback passed in: +cons.swig('views/page.html', { user: 'tobi' }) + .then(function(html) { + console.log(html); + }) + .catch(function(err) { + throw err; + }); + +// Caching +cons.swig('views/page.html', { cache: false, user: 'tobi' }, function(err, html) { + if (err) throw err; + console.log(html); +}); -var path: string = null; -var options: any = null; -var fn: any = null; -consolidate.clearCache(); -consolidate.jade(path, options, fn); -consolidate.dust(path, options, fn); -consolidate.swig(path, options, fn); -consolidate.liquor(path, options, fn); -consolidate.ejs(path, options, fn); -consolidate.eco(path, options, fn); -consolidate.jazz(path, options, fn); -consolidate.jqtpl(path, options, fn); -consolidate.haml(path, options, fn); -consolidate.whiskers(path, options, fn); -//consolidate.'haml-coffee':Function; -consolidate.hogan(path, options, fn); -consolidate.handlebars(path, options, fn); -consolidate.underscore(path, options, fn); -consolidate.qejs(path, options, fn); -consolidate.walrus(path, options, fn); -consolidate.mustache(path, options, fn); -consolidate.dot(path, options, fn); diff --git a/consolidate/consolidate.d.ts b/consolidate/consolidate.d.ts index 3bfe35bf0..db23a3152 100644 --- a/consolidate/consolidate.d.ts +++ b/consolidate/consolidate.d.ts @@ -1,30 +1,75 @@ // Type definitions for consolidate // Project: https://github.com/visionmedia/consolidate.js -// Definitions by: Carlos Ballesteros Velasco +// Definitions by: Carlos Ballesteros Velasco , Theo Sherry // Definitions: https://github.com/borisyankov/DefinitelyTyped // Imported from: https://github.com/soywiz/typescript-node-definitions/consolidate.d.ts /// +/// declare module "consolidate" { - export function clearCache(): void; - export var jade: (path: String, options: any, fn: any) => void; - export var dust: (path: String, options: any, fn: any) => void; - export var swig: (path: String, options: any, fn: any) => void; - export var liquor: (path: String, options: any, fn: any) => void; - export var ejs: (path: String, options: any, fn: any) => void; - export var eco: (path: String, options: any, fn: any) => void; - export var jazz: (path: String, options: any, fn: any) => void; - export var jqtpl: (path: String, options: any, fn: any) => void; - export var haml: (path: String, options: any, fn: any) => void; - export var whiskers: (path: String, options: any, fn: any) => void; - //export var 'haml-coffee':Function; - export var hogan: (path: String, options: any, fn: any) => void; - export var handlebars: (path: String, options: any, fn: any) => void; - export var underscore: (path: String, options: any, fn: any) => void; - export var qejs: (path: String, options: any, fn: any) => void; - export var walrus: (path: String, options: any, fn: any) => void; - export var mustache: (path: String, options: any, fn: any) => void; - export var dot: (path: String, options: any, fn: any) => void; + var cons: Consolidate; + + export = cons; + + interface Consolidate { + /** + * expose the instance of the engine + */ + requires: Object; + + /** + * Clear the cache. + * + * @api public + */ + clearCache(): void; + // template engines + atpl: RendererInterface; + dot: RendererInterface; + dust: RendererInterface; + eco: RendererInterface; + ejs: RendererInterface; + ect: RendererInterface; + haml: RendererInterface; + // TODO figure out how to do haml-coffee + hamlet: RendererInterface; + handlebars: RendererInterface; + hogan: RendererInterface; + htmling: RendererInterface; + jade: RendererInterface; + jazz: RendererInterface; + jqtpl: RendererInterface; + just: RendererInterface; + liquid: RendererInterface; + liquor: RendererInterface; + lodash: RendererInterface; + mote: RendererInterface; + mustache: RendererInterface; + nunjucks: RendererInterface; + qejs: RendererInterface; + ractive: RendererInterface; + react: RendererInterface; + swig: RendererInterface; + templayed: RendererInterface; + toffee: RendererInterface; + underscore: RendererInterface; + walrus: RendererInterface; + whiskers: RendererInterface; + } + + interface RendererInterface { + render(path: String, fn: (err: Error, html: String) => any): any; + + render(path: String, options: {cache?: boolean, [otherOptions: string]: any}, fn: (err: Error, html: String) => any): any; + + render(path: String, options?: { cache?: boolean, [otherOptions: string]: any }): Promise; + + (path: String, fn: (err: Error, html: String) => any): any; + + (path: String, options: { cache?: boolean, [otherOptions: string]: any }, fn: (err: Error, html: String) => any): any; + + (path: String, options?: { cache?: boolean, [otherOptions: string]: any }): Promise; + } } diff --git a/contentful-resolve-response/contentful-resolve-response-tests.ts b/contentful-resolve-response/contentful-resolve-response-tests.ts new file mode 100644 index 000000000..098641e7b --- /dev/null +++ b/contentful-resolve-response/contentful-resolve-response-tests.ts @@ -0,0 +1,20 @@ +/// +import resolveResponse = require('contentful-resolve-response'); + +var response = { + items: [ + { + someValue: 'wow', + someLink: {sys: {type: 'Link', linkType: 'Entry', id: 'suchId'}} + } + ], + includes: { + Entry: [ + {sys: {type: 'Entry', id: 'suchId'}, very: 'doge'} + ] + } +}; + +var items = resolveResponse(response) + +console.log(items); diff --git a/contentful-resolve-response/contentful-resolve-response.d.ts b/contentful-resolve-response/contentful-resolve-response.d.ts new file mode 100644 index 000000000..bd2daef9e --- /dev/null +++ b/contentful-resolve-response/contentful-resolve-response.d.ts @@ -0,0 +1,9 @@ +// Type definitions for contentful-resolve-response v0.1.2 +// Project: https://github.com/contentful/contentful-resolve-response +// Definitions by: Anton Karsten +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module 'contentful-resolve-response' { + function resolveResponse(response: any): any; + export = resolveResponse; +} diff --git a/convict/convict-tests.ts b/convict/convict-tests.ts index 6cde3b38c..3bd64c592 100644 --- a/convict/convict-tests.ts +++ b/convict/convict-tests.ts @@ -6,6 +6,42 @@ import validator = require('validator'); // define a schema +// straight from the convict tests +const format : convict.Format = { + name: 'float-percent', + validate: function(val) { + if (val !== 0 && (!val || val > 1 || val < 0)) { + throw new Error('must be a float between 0 and 1, inclusive'); + } + }, + coerce: function(val) { + return +( val); + } +}; + + + + +convict.addFormat(format); +convict.addFormats({ + prime: { + validate: function(val) { + function isPrime(n: number) { + if (n <= 1) return false; // zero and one are not prime + for (var i=2; i*i <= n; i++) { + if (n % i === 0) return false; + } + return true; + } + if (!isPrime(val)) throw new Error('must be a prime number'); + }, + coerce: function(val) { + return parseInt(val, 10); + } + } + }); + + var conf = convict({ env: { doc: 'The applicaton environment.', @@ -46,7 +82,15 @@ var conf = convict({ env: 'PORT', arg: 'port', } - } + }, + primeNumber: { + format: 'prime', + default: 17 + }, + percentNumber: { + format: 'float-percent', + default: 0.5 + }, }); @@ -72,4 +116,10 @@ if (conf.has('key')) { } }); } + +conf.getSchema(); +conf.getProperties(); +conf.getSchemaString(); +conf.toString(); + // vim:et:sw=2:ts=2 diff --git a/convict/convict.d.ts b/convict/convict.d.ts index 74ed10038..14ecae8f8 100644 --- a/convict/convict.d.ts +++ b/convict/convict.d.ts @@ -4,30 +4,74 @@ // Definitions: https://github.com/borisyankov/DefinitelyTyped declare module "convict" { - function convict(schema: convict.Schema): convict.Config; + module convict { - module convict { - interface Schema { - [name: string]: convict.Schema | { - default: any; - doc?: string; - format?: any; - env?: string; - arg?: string; - }; - } + interface Format { + name?: string; + validate?: (val: any) => void; + coerce?: (val: any) => any; + } - interface Config { - get(name: string): any; - default(name: string): any; - has(name: string): boolean; - set(name: string, value: any): void; - load(conf: Object): void; - loadFile(file: string): void; - loadFile(files: string[]): void; - validate(): void; - } - } + interface Schema { + [name: string]: convict.Schema | { + default: any; + doc?: string; + /** + * From the implementation: + * + * format can be a: + * - predefine type, as seen below + * - an array of enumerated values, e.g. ["production", "development", "testing"] + * - built-in JavaScript type, i.e. Object, Array, String, Number, Boolean + * - or if omitted, the Object.prototype.toString.call of the default value + * + * The docs also state that any function that validates is ok too + */ + format?: string | Array | Function; + env?: string; + arg?: string; + }; + } - export = convict; + interface Config { + get(name: string): any; + default(name: string): any; + has(name: string): boolean; + set(name: string, value: any): void; + load(conf: Object): void; + loadFile(file: string): void; + loadFile(files: string[]): void; + validate(): void; + /** + * Exports all the properties (that is the keys and their current values) as a {JSON} {Object} + * @returns {Object} A {JSON} compliant {Object} + */ + getProperties() : Object; + /** + * Exports the schema as a {JSON} {Object} + * @returns {Object} A {JSON} compliant {Object} + */ + getSchema() : Object; + + /** + * Exports all the properties (that is the keys and their current values) as a JSON string. + * @returns {String} a string representing this object + */ + toString() : string; + + /** + * Exports the schema as a JSON string. + * @returns {String} a string representing the schema of this {Config} + */ + getSchemaString() : string; + } + } + interface convict { + addFormat(format: convict.Format): void; + addFormats(formats: { [name: string]: convict.Format }): void; + (config: convict.Schema): convict.Config; + } + var convict : convict; + export = convict; } + diff --git a/cookies/cookies-tests.ts b/cookies/cookies-tests.ts new file mode 100644 index 000000000..3e3274a4d --- /dev/null +++ b/cookies/cookies-tests.ts @@ -0,0 +1,42 @@ +/// +/// + +import * as Cookies from 'cookies'; +import * as http from 'http'; + +const server = http.createServer((req, res) => { + const cookies = new Cookies(req, res); + let unsigned: string, + signed: string, + tampered: string + + if (req.url == "/set") { + cookies + // set a regular cookie + .set("unsigned", "foo", { httpOnly: false }) + + // set a signed cookie + .set("signed", "bar", { signed: true }) + + // mimic a signed cookie, but with a bogus signature + .set("tampered", "baz") + .set("tampered.sig", "bogus") + + res.writeHead(302, { "Location": "/" }) + return res.end("Now let's check.") + } + + unsigned = cookies.get("unsigned") + signed = cookies.get("signed", { signed: true }) + tampered = cookies.get("tampered", { signed: true }) + + res.writeHead(200, { "Content-Type": "text/plain" }) + res.end( + "unsigned expected: foo\n\n" + + "unsigned actual: " + unsigned + "\n\n" + + "signed expected: bar\n\n" + + "signed actual: " + signed + "\n\n" + + "tampered expected: undefined\n\n" + + "tampered: " + tampered + "\n\n" + ) +}) \ No newline at end of file diff --git a/cookies/cookies.d.ts b/cookies/cookies.d.ts new file mode 100644 index 000000000..5cc5f698a --- /dev/null +++ b/cookies/cookies.d.ts @@ -0,0 +1,100 @@ +// Type definitions for cookie-parser v0.5.1 +// Project: https://github.com/pillarjs/cookies +// Definitions by: Wang Zishi +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module "cookies" { + import * as http from "http" + + module cookies { + interface ICookies { + /** + * This extracts the cookie with the given name from the + * Cookie header in the request. If such a cookie exists, + * its value is returned. Otherwise, nothing is returned. + */ + get(name: string): string; + /** + * This extracts the cookie with the given name from the + * Cookie header in the request. If such a cookie exists, + * its value is returned. Otherwise, nothing is returned. + */ + get(name: string, opts: IOptions): string; + + /** + * This sets the given cookie in the response and returns + * the current context to allow chaining.If the value is omitted, + * an outbound header with an expired date is used to delete the cookie. + */ + set(name: string, value: string): ICookies; + /** + * This sets the given cookie in the response and returns + * the current context to allow chaining.If the value is omitted, + * an outbound header with an expired date is used to delete the cookie. + */ + set(name: string, value: string, opts: IOptions): ICookies; + } + + interface IOptions { + /** + * a number representing the milliseconds from Date.now() for expiry + */ + maxAge?: number; + /** + * a Date object indicating the cookie's expiration + * date (expires at the end of session by default). + */ + expires?: Date; + /** + * a string indicating the path of the cookie (/ by default). + */ + path?: string; + /** + * a string indicating the domain of the cookie (no default). + */ + domain?: string; + /** + * a boolean indicating whether the cookie is only to be sent + * over HTTPS (false by default for HTTP, true by default for HTTPS). + */ + secure?: boolean; + /** + * a boolean indicating whether the cookie is only to be sent + * over HTTPS (use this if you handle SSL not in your node process). + */ + secureProxy?: boolean; + /** + * a boolean indicating whether the cookie is only to be sent over HTTP(S), + * and not made available to client JavaScript (true by default). + */ + httpOnly?: boolean; + /** + * a boolean indicating whether the cookie is to be signed (false by default). + * If this is true, another cookie of the same name with the .sig suffix + * appended will also be sent, with a 27-byte url-safe base64 SHA1 value + * representing the hash of cookie-name=cookie-value against the first Keygrip key. + * This signature key is used to detect tampering the next time a cookie is received. + */ + signed?: boolean; + /** + * a boolean indicating whether to overwrite previously set + * cookies of the same name (false by default). If this is true, + * all cookies set during the same request with the same + * name (regardless of path or domain) are filtered out of + * the Set-Cookie header when setting this cookie. + */ + overwrite?: boolean; + } + } + + interface CookiesStatic { + new (request: http.IncomingMessage, response: http.ServerResponse): cookies.ICookies; + new (request: http.IncomingMessage, response: http.ServerResponse, keys?: Array): cookies.ICookies; + } + + const cookies: CookiesStatic; + + export = cookies +} \ No newline at end of file diff --git a/copy-paste/copy-paste-tests.ts b/copy-paste/copy-paste-tests.ts new file mode 100644 index 000000000..400c32a2a --- /dev/null +++ b/copy-paste/copy-paste-tests.ts @@ -0,0 +1,16 @@ +/// +/// + +import * as CopyPaste from 'copy-paste'; + +class TestClass {} + +let strRet: string = CopyPaste.copy("content"); +strRet = CopyPaste.copy("content", (err: Error) => { return; }); + + +let objRet: TestClass = CopyPaste.copy(new TestClass()); +objRet = CopyPaste.copy(new TestClass(), (err: Error) => { return; }); + +strRet = CopyPaste.paste(); +CopyPaste.paste((err: Error, content: string) => { return; }); \ No newline at end of file diff --git a/copy-paste/copy-paste.d.ts b/copy-paste/copy-paste.d.ts new file mode 100644 index 000000000..a8a844b5b --- /dev/null +++ b/copy-paste/copy-paste.d.ts @@ -0,0 +1,46 @@ +// Type definitions for copy-paste v1.1.3 +// Project: https://github.com/xavi-/node-copy-paste +// Definitions by: Tobias Kahlert +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module 'copy-paste' { + + export type CopyCallback = (err: Error) => void; + export type PasteCallback = (err: Error, content: string) => void; + + /** + * Asynchronously replaces the current contents of the clip board with text. + * + * @param {T} content Takes either a string, array, object, or readable stream. + * @return {T} Returns the same value passed in. + */ + export function copy(content: T): T; + + /** + * Asynchronously replaces the current contents of the clip board with text. + * + * @param {T} content Takes either a string, array, object, or readable stream. + * @param {CopyCallback} callback will fire when the copy operation is complete. + * @return {T} Returns the same value passed in. + */ + export function copy(content: T, callback: CopyCallback): T; + + + /** + * Synchronously returns the current contents of the system clip board. + * + * Note: The synchronous version of paste is not always availabled. + * An error message is shown if the synchronous version of paste is used on an unsupported platform. + * The asynchronous version of paste is always available. + * + * @return {string} Returns the current contents of the system clip board. + */ + export function paste(): string; + + /** + * Asynchronously returns the current contents of the system clip board. + * + * @param {PasteCallback} callback The contents of the system clip board are passed to the callback as the second parameter. + */ + export function paste(callback: PasteCallback): void; +} \ No newline at end of file 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-mapsforge/cordova-plugin-mapsforge-tests.ts b/cordova-plugin-mapsforge/cordova-plugin-mapsforge-tests.ts new file mode 100644 index 000000000..52ef78700 --- /dev/null +++ b/cordova-plugin-mapsforge/cordova-plugin-mapsforge-tests.ts @@ -0,0 +1,73 @@ +/// + + +mapsforge.embedded.initialize(["/mnt/sdcard/spain.map",0,0]); //Creates the view +mapsforge.embedded.setCenter(43.360056,-5.845757); //Sets the center of the view +mapsforge.embedded.setMaxZoom(18); +mapsforge.embedded.setZoom(15); + +//Adding a marker +var markerKey: number; +mapsforge.embedded.addMarker([mapsforge.embedded.MARKER_YELLOW,43.360056,-5.845757],function(key){markerKey = key;}); + +//Adding a polyline +var points = [43.360056,-5.845757, 43.160056,-5.645757,43.560056,-5.895757]; +var polylineKey: number; +mapsforge.embedded.addPolyline([mapsforge.embedded.COLOR_GREEN,10,points], function(key){polylineKey = key;}, function(error){alert(error);}); + + + +mapsforge.cache.initialize("/mnt/sdcard/spain.map"); //Initializes the renderer with the offline map + +/*Now you can use the Leaflet code seen before*/ + +mapsforge.cache.setExternalCache(false); //Sets the cache to internal for faster performance + +//Now we set the cache size to 50 MB. This will increase the time between cleanings, but +//it will also make those cleanings slower, since there are a lot more of images to +//delete...so be careful when you choose the cache size +mapsforge.cache.setMaxCacheSize(50); + + + +var L: any; + +interface TilePoint { + x: number; + y: number; + z: number; +} + +interface Tile { + src: string; + _layer: any; + onload: any; + onerror: any; +} + +L.OfflineTileLayer = L.TileLayer.extend({ + getTileUrl : function(tilePoint: TilePoint, tile: Tile) { + var zoom = tilePoint.z, x = tilePoint.x, y = tilePoint.y; + + if (mapsforge.cache) { + mapsforge.cache.getTile([x,y,zoom], function(result) {tile.src=result;}, + function() {tile.src = "path to an error image";}); + }else{ + tile.src = "path to an error image"; + } + }, + + _loadTile: function (tile: Tile, tilePoint: TilePoint) { + tile._layer = this; + tile.onload = this._tileOnLoad; + tile.onerror = this._tileOnError; + + this._adjustTilePoint(tilePoint); + this.getTileUrl(tilePoint, tile); + + this.fire('tileloadstart', { + tile: tile, + url: tile.src + }); + } +}); diff --git a/cordova-plugin-mapsforge/cordova-plugin-mapsforge.d.ts b/cordova-plugin-mapsforge/cordova-plugin-mapsforge.d.ts new file mode 100644 index 000000000..6314a09fb --- /dev/null +++ b/cordova-plugin-mapsforge/cordova-plugin-mapsforge.d.ts @@ -0,0 +1,249 @@ +// Type definitions for cordova-plugin-mapsforge +// Project: https://github.com/afsuarez/mapsforge-cordova-plugin +// Definitions by: rafw87 +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +interface Window { + mapsforge: MapsforgePlugin; +} + +declare var mapsforge: MapsforgePlugin; + +interface MapsforgePlugin { + embedded: MapsforgeEmbeddedPlugin; + cache: MapsforgeCachePlugin; +} + +interface MapsforgeEmbeddedPlugin { + + COLOR_DKGRAY: number|string; + COLOR_CYAN: number|string; + COLOR_BLACK: number|string; + COLOR_BLUE: number|string; + COLOR_GREEN: number|string; + COLOR_RED: number|string; + COLOR_WHITE: number|string; + COLOR_TRANSPARENT: number|string; + COLOR_YELLOW: number|string; + + MARKER_RED: number|string; + MARKER_GREEN: number|string; + MARKER_BLUE: number|string; + MARKER_YELLOW: number|string; + MARKER_BLACK: number|string; + MARKER_WHITE: number|string; + + /** + * The map file path provided must be the absolute file path. You can specify the width and height values for the view that will be added, + * or you can set them to 0 for set the value to MATCH_PARENT. You must call this method before any other method. + * @param args Array in the following form: [String mapFilePath, int viewWidth, int viewHeight]. + * @param success Success callback. + * @param error Error callback + */ + initialize(args: any[], success?: () => void, error?: (message: string) => void): void; + + /** + * To show the map view. + * @param success Success callback. + * @param error Error callback + */ + show(success?: () => void, error?: (message: string) => void): void; + + /** + * To hide the map view. + * @param success Success callback. + * @param error Error callback + */ + hide(success?: () => void, error?: (message: string) => void): void; + + /** + * Sets the center of the map to the given coordinates. + * @param lat Latitude of the new center. + * @param lng Longitude of the new center. + * @param success Success callback. + * @param error Error callback + */ + setCenter(lat: number, lng: number, success?: () => void, error?: (message: string) => void): void; + + /** + * Sets the zoom to the specified value (if it is between the zoom limits). + * @param zoomLevel New zoom level. + * @param success Success callback. + * @param error Error callback + */ + setZoom(zoomLevel: number, success?: () => void, error?: (message: string) => void): void; + + /** + * Sets the maximum zoom level. + * @param maxZoom New maximum zoom level. + * @param success Success callback. + * @param error Error callback + */ + setMaxZoom(maxZoom: number, success?: () => void, error?: (message: string) => void): void; + + /** + * Sets the minimum zoom level. + * @param minZoom New minimum zoom level. + * @param success Success callback. + * @param error Error callback + */ + setMinZoom(minZoom: number, success?: () => void, error?: (message: string) => void): void; + + /** + * The path to the map ile is required, and the path to the render theme may be null in order to apply the default render theme. + * @param args Array in the following form: [String mapFilePath, String renderThemePath] + * @param success Success callback. + * @param error Error callback + */ + setOfflineTileLayer(args: any[], success?: () => void, error?: (message: string) => void): void; + + /** + * + * @param args Array in the following form: [String providerName, String host, String baseUrl, String extension, int port] + * @param success Success callback. + * @param error Error callback + */ + setOnlineTileLayer(args: any[], success?: () => void, error?: (message: string) => void): void; + + /** + * Adds a marker to the map in the specified coordinates and returns the key for that marker to the success function. + * @param arg Array in the following form: [String marker_color, double lat, double lng]. + * The color of the marker should be one of the constants from mapsforge.embedded object; if the marker doesn't exist a green marker will be used instead. + * @param success Success callback. Gets the key of created marker. That key is the one you have to use if you want to delete it. + * @param error Error callback + */ + addMarker(arg: any[], success?: (key: number) => void, error?: (message: string) => void): void; + + /** + * + * @param arg Array in the following form: [int color, int strokeWidth,[double points]]. + * The color can be one of the constants specified before, or the new color you want. + * This function will use the odd positions of the array of points for the latitudes and the even positions for the longitudes. + * Example: [lat1, lng1, lat2, lng2, lat3, lng3]. + * If the length of the array is not even, the function will throw an exception and return the error message to the error function. + * @param success Success callback. Gets the key of created polyline. + * @param error Error callback + */ + addPolyline(arg: any[], success?: (key: number) => void, error?: (message: string) => void): void; + + /** + * Deletes the layer(markers or polylines) with the specified key from the map. + * @param key Key of marker or polyline. + * @param success Success callback. + * @param error Error callback + */ + deleteLayer(key: number, success?: () => void, error?: (message: string) => void): void; + + /** + * Initializes again the map if the onStop method was called. + * @param success Success callback. + * @param error Error callback + */ + onStart(success?: () => void, error?: (message: string) => void): void; + + + /** + * Stops the rendering. Useful for when the app goes to the background. You have to call the onStart method to restart it. + * @param success Success callback. + * @param error Error callback + */ + onStop(success?: () => void, error?: (message: string) => void): void; + + /** + * Stops and cleans the resources that have been used. + * @param success Success callback. + * @param error Error callback + */ + onDestroy(success?: () => void, error?: (message: string) => void): void; +} + +interface MapsforgeCachePlugin { + + /** + * You should call this method before any other one, and provide it with the absolute map file path. + * @param mapFilePath Absolute map file path. + * @param success Success callback. + * @param error Error callback + */ + initialize(mapFilePath: string, success?: () => void, error?: (message: string) => void): void; + + /** + * This method is the one that provides the tiles, generating them if their are not in the cache. + * @param args Array in the following form: [double lat, double lng, byte zoom] + * @param success Success callback. Gets the tile path. + * @param error Error callback + */ + getTile(args: any[], success?: (tilePath: string) => void, error?: (message: string) => void): void; + + /** + * Enables or disables the cache. If disabled, the plugin will generate the tiles always from scratch. Cache is enabled by default. + * @param enabled Cache enabled or disabled. + * @param success Success callback. + * @param error Error callback + */ + setCacheEnabled(enabled: boolean, success?: () => void, error?: (message: string) => void): void; + + /** + * Sets whether or not the cache should be placed in the internal memory or in the SD card. + * By default it is placed in SD card, so devices with not too much memory have a better performance. + * @param external Cache external or internal. + * @param success Success callback. + * @param error Error callback + */ + setExternalCache(external: boolean, success?: () => void, error?: (message: string) => void): void; + + /** + * Sets the map file to be used for rendering to the map specified by its absolute path. + * @param absolutePath Absolute map file path. + * @param success Success callback. + * @param error Error callback + */ + setMapFile(absolutePath: string, success?: () => void, error?: (message: string) => void): void; + + /** + * Sets the age for the generated images. This means that when the cache is being cleaned, all images younger than the specified value will be kept in the cache in order to avoid deleting images that are being used at the moment. + * @param milliseconds Max cache age in milliseconds. + * @param success Success callback. + * @param error Error callback + */ + setMaxCacheAge(milliseconds: number, success?: () => void, error?: (message: string) => void): void; + + /** + * Sets the maximum size for the cache. This size must be specified in megabytes. If there is not that space available, the cache will fit the maximum size. + * @param sizeInMB Max cache size in megabytes. + * @param success Success callback. + * @param error Error callback + */ + setMaxCacheSize(sizeInMB: number, success?: () => void, error?: (message: string) => void): void; + + /** + * Sets the tile size. By default the tile size is set to 256. + * @param size Tile size. + * @param success Success callback. + * @param error Error callback + */ + setMaxCacheSize(size: number, success?: () => void, error?: (message: string) => void): void; + + /** + * This method sets the size in megabytes that will remain always available in memory in order to avoid that the application uses all space available. + * @param sizeInMB Size in megabytes that will remain always available in memory. + * @param success Success callback. + * @param error Error callback + */ + setCacheCleaningTrigger(sizeInMB: number, success?: () => void, error?: (message: string) => void): void; + + /** + * Sets a flag to destroy the cache when the onDestroy method is called. + * @param destroy If true, cache will be destroyed when the onDestroy method will be called. + * @param success Success callback. + * @param error Error callback + */ + destroyCacheOnExit(destroy: boolean, success?: () => void, error?: (message: string) => void): void; + + /** + * Deletes the cache depending on the flag state. + * @param success Success callback. + * @param error Error callback + */ + onDestroy(success?: () => void, error?: (message: string) => void): void; +} diff --git a/cordova-plugin-qrscanner/cordova-plugin-qrscanner-tests.ts b/cordova-plugin-qrscanner/cordova-plugin-qrscanner-tests.ts new file mode 100644 index 000000000..630bfd09c --- /dev/null +++ b/cordova-plugin-qrscanner/cordova-plugin-qrscanner-tests.ts @@ -0,0 +1,50 @@ +/// + +var QRScanner: QRScanner = window.QRScanner; +QRScanner.prepare(); +QRScanner.prepare((err, status) => { var error: QRScannerError = err; var obj: QRScannerStatus = status; }); +QRScanner.scan((err, results) => { var error: QRScannerError = err; var contents: String = results; }); +QRScanner.cancelScan(); +QRScanner.cancelScan((status) => {var obj: QRScannerStatus = status; }); +QRScanner.show(); +QRScanner.show((status) => {var obj: QRScannerStatus = status; }); +QRScanner.hide(); +QRScanner.hide((status) => {var obj: QRScannerStatus = status; }); +QRScanner.enableLight(); +QRScanner.enableLight((err, status) => { var error: QRScannerError = err; var obj: QRScannerStatus = status; }); +QRScanner.disableLight(); +QRScanner.disableLight((err, status) => { var error: QRScannerError = err; var obj: QRScannerStatus = status; }); +QRScanner.useCamera(1); +QRScanner.useCamera(1, (err, status) => { var error: QRScannerError = err; var obj: QRScannerStatus = status; }); +QRScanner.useFrontCamera(); +QRScanner.useFrontCamera((err, status) => { var error: QRScannerError = err; var obj: QRScannerStatus = status; }); +QRScanner.useBackCamera(); +QRScanner.useBackCamera((err, status) => { var error: QRScannerError = err; var obj: QRScannerStatus = status; }); +QRScanner.pausePreview(); +QRScanner.pausePreview((status) => {var obj: QRScannerStatus = status; }); +QRScanner.resumePreview(); +QRScanner.resumePreview((status) => {var obj: QRScannerStatus = status; }); +QRScanner.openSettings(); +QRScanner.openSettings((err, status) => { var error: QRScannerError = err; var obj: QRScannerStatus = status; }); +QRScanner.destroy(); +QRScanner.destroy((status) => {var obj: QRScannerStatus = status; }); + +QRScanner.prepare((err, status) => { + var error: QRScannerError = err; + var num: Number = error.code; + var str: String = error.name; + str = error._message; + + var obj: QRScannerStatus = status; + var bool: Boolean = status.authorized; + bool = status.denied; + bool = status.restricted; + bool = status.prepared; + bool = status.scanning; + bool = status.previewing; + bool = status.webviewBackgroundIsTransparent; + bool = status.lightEnabled; + bool = status.canOpenSettings; + bool = status.canEnableLight; + var num: Number = status.currentCamera; +}); diff --git a/cordova-plugin-qrscanner/cordova-plugin-qrscanner.d.ts b/cordova-plugin-qrscanner/cordova-plugin-qrscanner.d.ts new file mode 100644 index 000000000..ed5f72f26 --- /dev/null +++ b/cordova-plugin-qrscanner/cordova-plugin-qrscanner.d.ts @@ -0,0 +1,258 @@ +// Type definitions for cordova-plugin-qrscanner v1.0.0 +// Project: https://github.com/bitpay/cordova-plugin-qrscanner +// Definitions by: Jason Dreyzehner +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** +* Global object QRScanner. +*/ +interface Window { + QRScanner: QRScanner; +} + +/** +* The QRScanner object provides functions to initialize, control, utilize, and +* deallocate a native QR code scanner and video preview behind the Cordova webview. +*/ +interface QRScanner { + + /** + * Request permission to access the camera (if not already granted), prepare + * the video preview, and configure everything needed by QRScanner. This will + * only be visible if `QRScanner.show()` has already made the webview transparent. + * @param {function} [callback] Callback that gets an error or the QRScannerStatus object. + */ + prepare: (callback?: (error: QRScannerError, status: QRScannerStatus) => any) => void; + + /** + * Sets QRScanner to "watch" for valid QR codes. Once a valid code is + * detected, it's contents are passed to the callback, and scanning is + * toggled off. If `QRScanner.prepare()` has not been called, + * this method performs that setup as well. The video preview does + * not need to be visible for scanning to function. + * @param {function} callback Callback that gets an error or the results string. + */ + scan: (callback: (error: QRScannerError, result: String) => any) => void; + + /** + * Cancels the current scan. If `QRScanner.prepare()` has not been called, + * this method performs that setup as well. + * @param {function} [callback] Callback that gets the QRScannerStatus object. + */ + cancelScan: (callback?: (status: QRScannerStatus) => any) => void; + + /** + * Configures the native webview to have a transparent background, then sets + * the background of the `` and parent elements to transparent, + * allowing the webview to re-render with the transparent background. + * + * To see the video preview, your application background must be transparent + * in the areas through which it should show. + * @param {function} [callback] Callback that gets the QRScannerStatus object. + */ + show: (callback?: (status: QRScannerStatus) => any) => void; + + /** + * Configures the native webview to be opaque with a white background, + * covering the video preview. + * @param {function} [callback] Callback that gets the QRScannerStatus object. + */ + hide: (callback?: (status: QRScannerStatus) => any) => void; + + + /** + * Enable the device's light (for scanning in low-light environments). If + * `QRScanner.prepare()` has not been called, this method performs that setup + * as well. + * @param {function} [callback] Callback that gets an error or the QRScannerStatus object. + */ + enableLight: (callback?: (error: QRScannerError, status: QRScannerStatus) => any) => void; + + /** + * Disable the device's light. If `QRScanner.prepare()` has not been called, + * this method performs that setup as well. + * @param {function} [callback] Callback that gets an error or the QRScannerStatus object. + */ + disableLight: (callback?: (error: QRScannerError, status: QRScannerStatus) => any) => void; + + /** + * Switch video capture to the `index` camera. Camera `0` is the back camera, + * camera `1` is front camera. If `QRScanner.prepare()` has not been called, + * this method performs that setup as well. + * @param {number} index A number representing the index of the camera to use. + * @param {function} [callback] Callback that gets an error or the QRScannerStatus object. + */ + useCamera: (index: Number, callback?: (error: QRScannerError, status: QRScannerStatus) => any) => void; + + /** + * Switch video capture to the device's front camera. If `QRScanner.prepare()` + * has not been called, this method performs that setup as well. + * @param {function} [callback] Callback that gets an error or the QRScannerStatus object. + */ + useFrontCamera: (callback?: (error: QRScannerError, status: QRScannerStatus) => any) => void; + + /** + * Switch video capture to the device's back camera. If `QRScanner.prepare()` + * has not been called, this method performs that setup as well. + * @param {function} [callback] Callback that gets an error or the QRScannerStatus object. + */ + useBackCamera: (callback?: (error: QRScannerError, status: QRScannerStatus) => any) => void; + + /** + * Pauses the video preview on the current frame (as if a snapshot was taken). + * @param {function} [callback] Callback that gets the QRScannerStatus object. + */ + pausePreview: (callback?: (status: QRScannerStatus) => any) => void; + + /** + * Resumes the video preview. + * @param {function} [callback] Callback that gets the QRScannerStatus object. + */ + resumePreview: (callback?: (status: QRScannerStatus) => any) => void; + + /** + * Open the app-specific permission settings in the user's device settings. + * Here the user can enable/disable camera (and other) access for your app. + * + * Note: iOS immediately kills all apps affected by permissions changes. If + * the user changes a permission settings, your app will stop and only + * restart when they return. + * @param {function} [callback] Callback that gets the QRScannerStatus object. + */ + openSettings: (callback?: (error: QRScannerError, status: QRScannerStatus) => any) => void; + + /** + * Retrieve the status of QRScanner and provide it to the callback function. + * @param {function} callback Callback that gets the QRScannerStatus object. + */ + getStatus: (callback: (status: QRScannerStatus) => any) => void; + + /** + * Runs hide(), stops scanning, video capture, and the preview, and + * deallocates as much as possible. (E.g. to improve performance/battery life + * when the scanner is not likely to be used for a while.) + * Basically reverts the plugin to it's startup-state. + * @param {function} [callback] Callback that gets the QRScannerStatus object. + */ + destroy: (callback?: (status: QRScannerStatus) => any) => void; +} + + +/** +* An object representing the current status of QRScanner. +*/ +interface QRScannerStatus { + + /** + * On iOS and Android 6.0+, camera access is granted at runtime by the user (by + * clicking "Allow" at the dialog). The `authorized` property is a boolean + * value which is true only when the user has allowed camera access to your app + * (`AVAuthorizationStatus.Authorized`). On platforms with permissions granted + * at install (Android pre-6.0, Windows Phone) this property is always true. + */ + authorized: Boolean, + + /** + * A boolean value which is true if the user permenantly denied camera access + * to the app (`AVAuthorizationStatus.Denied`). Once denied, camera access can + * only be gained by requesting the user change their decision (consider + * offering a link to the setting via `openSettings()`). + */ + denied: Boolean, + + /** + * A boolean value which is true if the user is unable to grant permissions due + * to parental controls, organization security configuration profiles, or + * similar reasons. + */ + restricted: Boolean, + + /** + * A boolean value which is true if QRScanner is prepared to capture video and + * render it to the view. + */ + prepared: Boolean, + + /** + * A boolean value which is true if QRScanner is actively scanning for a QR code. + */ + scanning: Boolean, + + /** + * A boolean value which is true if QRScanner is displaying a live preview + * from the device's camera. Set to false when the preview is paused. + */ + previewing: Boolean, + + /** + * A boolean value which is true when the native webview background is transparent. + */ + webviewBackgroundIsTransparent: Boolean, + + /** + * A boolean value which is true if the light is enabled. + */ + lightEnabled: Boolean, + + /** + * A boolean value which is true only if the users' operating system is able + * to `QRScanner.openSettings()`. + */ + canOpenSettings: Boolean, + + /** + * A boolean value which is true only if the users' device can enable a light + * in the direction of the currentCamera. + */ + canEnableLight: Boolean, + + /** + * A number representing the index of the currentCamera. `0` is the back + * camera, `1` is the front. + */ + currentCamera: Number +} + +/** +* An object representing an error issued by QRScanner. +* +* Many QRScanner functions accept a callback with an `error` parameter. When +* QRScanner experiences errors, this parameter contains a QRScannerError object +* with properties `name` (_String_), `code` (_Number_), and `_message` +* (_String_). When handling errors, rely only on the `name` or `code` parameter, +*as the specific content of `_message` is not considered part of the plugin's +* stable API. +* +* # Possible Error Types +* +* Code | Name | Description +* ---: | :-------------------------- | :---------------------------------------- +* 0 | `UNEXPECTED_ERROR` | An unexpected error. Returned only by bugs in QRScanner. +* 1 | `CAMERA_ACCESS_DENIED` | The user denied camera access. +* 2 | `CAMERA_ACCESS_RESTRICTED` | Camera access is restricted (due to parental controls, organization security configuration profiles, or similar reasons). +* 3 | `BACK_CAMERA_UNAVAILABLE` | The back camera is unavailable. +* 4 | `FRONT_CAMERA_UNAVAILABLE` | The front camera is unavailable. +* 5 | `CAMERA_UNAVAILABLE` | The camera is unavailable because it doesn't exist or is otherwise unable to be configured. (Returned if QRScanner cannot return one of the more specific `BACK_CAMERA_UNAVAILABLE` or `FRONT_CAMERA_UNAVAILABLE` errors.) +* 6 | `SCAN_CANCELED` | Scan was canceled by the `cancelScan()` method. (Returned exclusively to the `QRScanner.scan()` method.) +* 7 | `LIGHT_UNAVAILABLE` | The device light is unavailable because it doesn't exist or is otherwise unable to be configured. +* 8 | `OPEN_SETTINGS_UNAVAILABLE` | The device is unable to open settings. +*/ +interface QRScannerError { + + /** + * The standard string identifying the type of this QRScannerError. + */ + name: String, + + /** + * The standard number identifying the type of this QRScannerError. + */ + code: Number, + + /** + * A simple message describing this QRScannerError. + */ + _message: String +} + +declare var QRScanner: QRScanner; 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/cordova/plugins/Media.d.ts b/cordova/plugins/Media.d.ts index 21d1a17e3..b691013d8 100644 --- a/cordova/plugins/Media.d.ts +++ b/cordova/plugins/Media.d.ts @@ -37,8 +37,11 @@ interface Media { mediaError?: (error: MediaError) => void): void; /** Returns the duration of an audio file in seconds. If the duration is unknown, it returns a value of -1. */ getDuration(): number; - /** Starts or resumes playing an audio file. */ - play(): void; + /** + * Starts or resumes playing an audio file. + * @param iosPlayOptions: iOS options quirks + */ + play(iosPlayOptions?: IosPlayOptions): void; /** Pauses playing an audio file. */ pause(): void; /** @@ -71,3 +74,11 @@ interface Media { /** The duration of the media, in seconds. */ duration: number; } +/** + * iOS optional parameters for media.play + * See https://github.com/apache/cordova-plugin-media#ios-quirks + */ +interface IosPlayOptions { + numberOfLoops?: number; + playAudioWhenScreenIsLocked?: boolean; +} diff --git a/cordova/plugins/NetworkInformation.d.ts b/cordova/plugins/NetworkInformation.d.ts index 53093284f..1ba2ae9e0 100644 --- a/cordova/plugins/NetworkInformation.d.ts +++ b/cordova/plugins/NetworkInformation.d.ts @@ -45,16 +45,16 @@ interface Connection { * Connection.CELL * Connection.NONE */ - type: number + type: string } declare var Connection: { - UNKNOWN: number; - ETHERNET: number; - WIFI: number; - CELL_2G: number; - CELL_3G: number; - CELL_4G: number; - CELL: number; - NONE: number; -} \ No newline at end of file + UNKNOWN: string; + ETHERNET: string; + WIFI: string; + CELL_2G: string; + CELL_3G: string; + CELL_4G: string; + CELL: string; + NONE: string; +} diff --git a/cordova/plugins/StatusBar.d.ts b/cordova/plugins/StatusBar.d.ts index 8b5299626..599408e7b 100644 --- a/cordova/plugins/StatusBar.d.ts +++ b/cordova/plugins/StatusBar.d.ts @@ -73,3 +73,5 @@ interface StatusBar { */ isVisible: boolean; } + +declare var StatusBar: StatusBar; 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/couchbase/couchbase-tests.ts b/couchbase/couchbase-tests.ts index 4305300ee..a1a3ee6bb 100644 --- a/couchbase/couchbase-tests.ts +++ b/couchbase/couchbase-tests.ts @@ -1,21 +1,16 @@ /// import couchbase = require('couchbase'); -var db = new couchbase.Connection({ bucket: "default" }, function (err) { - if (err) throw err; +var cluster = new couchbase.Cluster('couchbase://127.0.0.1'); +var bucket = cluster.openBucket('default'); - // TS 0.9.5 bug https://typescript.codeplex.com/workitem/2035, todo: remove cast after fix - (db).set('testdoc', { name: 'Frank' }, function (err, result) { - if (err) throw err; +bucket.upsert('testdoc', { name: 'Frank' }, (error) => { + if (error) throw error; - var s: string = err.message; + bucket.get('testdoc', (err, result) => { + if (err) throw err; - // TS 0.9.5 bug https://typescript.codeplex.com/workitem/2035, todo: remove cast after fix - (db).get('testdoc', function (err, result) { - if (err) throw err; - - console.log(result.value); - // {name: Frank} - }); + console.log(result.value); + // {name: Frank} }); }); \ No newline at end of file diff --git a/couchbase/couchbase.d.ts b/couchbase/couchbase.d.ts index 3a8605b73..6afd3a781 100644 --- a/couchbase/couchbase.d.ts +++ b/couchbase/couchbase.d.ts @@ -1,729 +1,1129 @@ -// Type definitions for Couchbase Couchnode +// Type definitions for Couchbase Node.js SDK 2.1.2 // Project: https://github.com/couchbase/couchnode -// Definitions by: Basarat Ali Syed +// Definitions by: Marwan Aouida // Definitions: https://github.com/borisyankov/DefinitelyTyped /// + declare module 'couchbase' { - /** - * Enumeration of all error codes. See libcouchbase documentation - * for more details on what these errors represent. - * - * @global - * @readonly - * @enum {number} - */ - export var errors: { - /** Operation was successful **/ - success: number; + import events = require('events'); + /** + * Enumeration of all error codes. See libcouchbase documentation for more details on what these errors represent. + */ + enum errors { + /** Operation was successful. **/ + success, + /** Authentication should continue. **/ - authContinue: number; - + authContinue, + /** Error authenticating. **/ - authError: number; - + authError, + /** The passed incr/decr delta was invalid. **/ - deltaBadVal: number; - + deltaBadVal, + /** Object is too large to be stored on the cluster. **/ - objectTooBig: number; - + objectTooBig, + + /** Operation was successful. **/ + serverBusy, + /** Server is too busy to handle your request right now. **/ - serverBusy: number; - - /** Internal libcouchbase error. **/ - cLibInternal: number; - + cLibInternal, + /** An invalid arguement was passed. **/ - cLibInvalidArgument: number; - + cLinInvalidArgument, + /** The server is out of memory. **/ - cLibOutOfMemory: number; - + cLibOutOfMemory, + /** An invalid range was specified. **/ - invalidRange: number; - + invalidRange, + /** An unknown error occured within libcouchbase. **/ - cLibGenericError: number; - + cLibGenericError, + /** A temporary error occured. Try again. **/ - temporaryError: number; - + temporaryError, + /** The key already exists on the server. **/ - keyAlreadyExists: number; - + keyAlreadyExists, + /** The key does not exist on the server. **/ - keyNotFound: number; - + keyNotFound, + /** Failed to open library. **/ - failedToOpenLibrary: number; - + failedToOpenLibrary, + /** Failed to find expected symbol in library. **/ - failedToFindSymbol: number; - + failedToFindSymbol, + /** A network error occured. **/ - networkError: number; - + networkError, + /** Operations were performed on the incorrect server. **/ - wrongServer: number; - + wrongServer, + /** Operations were performed on the incorrect server. **/ - notMyVBucket: number; - - /** The document was not stored. */ - notStored: number; - + notMyVBucket, + + /** The document was not stored. **/ + notSorted, + /** An unsupported operation was sent to the server. **/ - notSupported: number; - + notSupported, + /** An unknown command was sent to the server. **/ - unknownCommand: number; - + unknownCommand, + /** An unknown host was specified. **/ - unknownHost: number; - + unknownHost, + /** A protocol error occured. **/ - protocolError: number; - + protocolError, + /** The operation timed out. **/ - timedOut: number; - + timedOut, + /** Error connecting to the server. **/ - connectError: number; - + connectError, + /** The bucket you request was not found. **/ - bucketNotFound: number; - + bukcketNotFound, + /** libcouchbase is out of memory. **/ - clientOutOfMemory: number; - + clientOutOfMemory, + /** A temporary error occured in libcouchbase. Try again. **/ - clientTemporaryError: number; - - /** A bad handle was passed. */ - badHandle: number; - + clientTemporaryError, + + /** A bad handle was passed. **/ + badHandle, + /** A server bug caused the operation to fail. **/ - serverBug: number; - + serverBug, + /** The host format specified is invalid. **/ - invalidHostFormat: number; - - /** Not enough nodes to meet the operations durability requirements. **/ - notEnoughNodes: number; - + invalidHostFormat, + + /** Not enough nodes to meet the operations durability requirements. **/ + notEnoughNodes, + /** Duplicate items. **/ - duplicateItems: number; - + duplicateItems, + /** Key mapping failed and could not match a server. **/ - noMatchingServerForKey: number; - + noMatchingServerForKey, + /** A bad environment variable was specified. **/ - badEnvironmentVariable: number; + badEnvironmentVariable, + /** Couchnode is out of memory. **/ - outOfMemory: number; - + outOfMemory, + /** Invalid arguements were passed. **/ - invalidArguments: number; - + invalidArguments, + /** An error occured while trying to schedule the operation. **/ - schedulingError: number; - + schedulingError, + /** Not all operations completed successfully. **/ - checkResults: number; - + checkResults, + /** A generic error occured in Couchnode. **/ - genericError: number; - + genericError, + /** The specified durability requirements could not be satisfied. **/ - durabilityFailed: number; - + durabilityFailed, + /** An error occured during a RESTful operation. **/ - restError: number; + restError } /** - * Enumeration of all value encoding formats. - * - * @global - * @readonly - * @enum {number} + * Represents a singular cluster containing your buckets. */ - export var format: { - /** Store as raw bytes. **/ - raw: number; + class Cluster { + /** + * Create a new instance of the Cluster class. + * @param cnstr The connection string for your cluster. + * @param options The options object. + */ + constructor(cnstr?: string, options?: ClusterConstructorOptions); - /** Store as JSON encoded string. **/ - json: number; + /** + * Creates a manager allowing the management of a Couchbase cluster. + */ + manager(): ClusterManager; - /** Store as UTF-8 encoded string. **/ - utf8: number; + /** + * Open a bucket to perform operations. This will begin the handshake process immediately and operations will complete later. Subscribe to the connect event to be alerted when the connection is ready, though be aware operations can be successfully queued before this. + * @param name The name of the bucket to open. + */ + openBucket(name?: string): Bucket; - /** Automatically determine best storage format. **/ - auto: number; - }; - /** - * The *CAS* value is a special object which indicates the current state - * of the item on the server. Each time an object is mutated on the server, the - * value is changed. CAS objects can be used in conjunction with - * mutation operations to ensure that the value on the server matches the local - * value retrieved by the client. This is useful when doing document updates - * on the server as you can ensure no changes were applied by other clients - * while you were in the process of mutating the document locally. - * - * In Couchnode, this is an opaque value. As such, you cannot generate - * CAS objects, but should rather use the values returned from a - * {@link KeyCallback}. - * - * @typedef {object} CAS - */ - export interface CAS extends Object { + /** + * Open a bucket to perform operations. This will begin the handshake process immediately and operations will complete later. Subscribe to the connect event to be alerted when the connection is ready, though be aware operations can be successfully queued before this. + * @param name The name of the bucket to open. + * @param password Password for the bucket. + */ + openBucket(name?: string, password?: string): Bucket; + + /** + * Open a bucket to perform operations. This will begin the handshake process immediately and operations will complete later. Subscribe to the connect event to be alerted when the connection is ready, though be aware operations can be successfully queued before this. + * @param name The name of the bucket to open. + * @param callback Callback to invoke on connection success or failure. + */ + openBucket(name?: string, callback?: Function): Bucket; + + /** + * Open a bucket to perform operations. This will begin the handshake process immediately and operations will complete later. Subscribe to the connect event to be alerted when the connection is ready, though be aware operations can be successfully queued before this. + * @param name The name of the bucket to open. + * @param password Password for the bucket. + * @param callback Callback to invoke on connection success or failure. + */ + openBucket(name?: string, password?: string, callback?: Function): Bucket; + } + + interface ClusterConstructorOptions { + /** + * The path to the certificate to use for SSL connections + */ + certpath: string; + } + + interface CreateBucketOptions { + /** + * The bucket name + */ + name?: string; + authType?: string, + bucketType?: string; + ramQuotaMB?: number; + replicaNumber?: number; } /** - * @class Result - * @classdesc - * The virtual class used for results of various operations. - * @private + * Class for performing management operations against a cluster. */ - export class Result { + interface ClusterManager { /** - * The CAS value for the document that was affected by the operation. - * @var {CAS} Result#cas + * + * @param name + * @param callback */ - cas: CAS; + createBucket(name: string, callback: Function): void; + /** - * The flags associate with the document. - * @var {integer} Result#flags + * + * @param name + * @param opts + * @param callback */ - flags: number; + createBucket(name: string, opts: any, callback: Function): void; + /** - * The resulting document from the retrieval operation that was executed. - * @var {Mixed} Result#value + * + * @param callback */ - value: any; + listBuckets(callback: Function): void; + + /** + * + * @param name + * @param callback + */ + removeBucket(name: string, callback: Function): void; } /** - * @class CouchbaseError - * @classdesc * The virtual class thrown for all Couchnode errors. - * @private - * @extends node#Error */ - export interface CouchbaseError extends Error { + interface CouchbaseError extends Error { /** * The error code for this error. - * @var {errors} Error#code */ - code: number; + code: errors; + } + + interface AppendOptions { + /** + * The CAS value to check. If the item on the server contains a different CAS value, the operation will fail. Note that if this option is undefined, no comparison will be performed. + */ + cas?: Bucket.CAS; /** - * The internal error that occured to cause this one. This is used to wrap - * low-level errors before throwing them from couchnode to simplify error - * handling. - * @var {(node#Error)} Error#innerError + * Ensures this operation is persisted to this many nodes. */ - innerError: Error; + persist_to?: number; /** - * A reason string describing the reason this error occured. This value is - * almost exclusively used for REST request errors. - * @var {string} Error#reason + * Ensures this operation is replicated to this many nodes. */ - reason: string; - } - - /** - * Connect callback - * This callback is invoked when a connection is successfully established. - * - * @typedef {function} ConnectCallback - * - * @param {undefined|Error} error - * The error that occurred while trying to connect to the cluster. - */ - export interface ConnectCallback { - (error: CouchbaseError): any; - } - - /** - * Design Document Management callbacks - * This callback is invoked by the *DesignDoc operations. - * - * @typedef {function} DDocCallback - * - * @param {undefined|Error} error - * An error indicator. Note that this error value may be ignored, but its - * absence is indicative that the response in the *result* parameter is ok. - * If it is set, then the request likely failed. - * @param {object} result - * The result returned from the server - */ - export interface DDocCallback { - (error: CouchbaseError, result: any): any; - } - - /** - * Single-Key callbacks. - * This callback is passed to all of the single key functions. - * - * A typical use pattern is to pass the result> parameter from the - * callback as the options parameter to one of the next operations. - * - * @typedef {function} KeyCallback - * - * @param {undefined|Error} error - * The error for the operation. This can either be an Error object - * or a false value. The error contains the following fields: - * @param {Result} result - * The result of the operation that was executed. - */ - export interface KeyCallback { - (error: CouchbaseError, result: Result): any; - } - - /** - * Multi-Key callbacks - * This callback is invoked by the *Multi operations. - * It differs from the in {@linkcode KeyCallback} that the - * response object is an object of {key: response} - * where each response object contains the response for that particular - * key. - * - * @typedef {function} MultiCallback - * - * @param {undefined|Error} error - * An error indicator. Note that this error - * value may be ignored, but its absence is indicative that each - * response in the results parameter is ok. If it - * is set, then at least one of the result objects failed - * @param {Object.} results - * The results of the operation as a dictionary of keys mapped to Result - * objects. - */ - export interface MultiCallback { - (error: CouchbaseError, result: { [key: string]: Result }): any; - } - - /** - * Query callback. - * This callback is invoked by the query operations. - * - * @typedef {function} QueryCallback - * - * @param {undefined|Error} error - * An error indicator. Note that this error - * value may be ignored, but its absence is indicative that the - * response in the results parameter is ok. If it - * is set, then the request failed. - * @param {object} results - * The results returned from the server - */ - export interface QueryCallback { - (error: CouchbaseError, result: any): any; - } - - /** - * @typedef {function} StatsCallback - * - * @param {Error} error - * @param {Object.} results - * An object containing per-server, per key entries - * - * @see Connection#stats - */ - export interface StatsCallback { - (error: CouchbaseError, result: any): any; - } - - - ///////////////////////// - // Various options structures - ///////////////////////// - - export interface ConnectionOptions { - host?: any; // string | string[] - bucket?: string; - password?: string; - } - - // Not comming up with a base interface system as that is not how the original code is written. - // Use a custom base interface system has the potential to become difficult to keep up to date. - - export interface AddOptions { - expiry?: number; - flags?: number; - format?: number - persist_to?: number; replicate_to?: number; } - export interface AddMultiOptionsForValue { - value: any; + interface PrependOptions extends AppendOptions { } + + interface RemoveOptions extends AppendOptions { } + + interface ReplaceOptions extends AppendOptions { + /** + * Set the initial expiration time for the document. A value of 0 represents never expiring. + */ expiry?: number; - flags?: number; - format?: number; } - export interface AddMultiOptions { - expiry?: number; - flags?: number; - format?: number + interface UpsertOptions extends ReplaceOptions { } + + interface TouchOptions { + /** + * Ensures this operation is persisted to this many nodes. + */ persist_to?: number; + + /** + * Ensures this operation is replicated to this many nodes. + */ replicate_to?: number; - - spooled?: boolean; } - export interface AppendOptions { - expiry?: number; - flags?: number; - format?: number; - persist_to?: number; - replicate_to?: number; - - cas: CAS; - } - - export interface AppendMultiOptionsForValue { - value: any; - cas?: CAS; - expiry?: number; - } - - export interface AppendMultiOptions { - expiry?: number; - persist_to?: number; - replicate_to?: number; - - spooled?: boolean; - } - - export interface DecrOptions { - offset?: number; + interface CounterOptions { + /** + * Sets the initial value for the document if it does not exist. Specifying a value of undefined will cause the operation to fail if the document does not exist, otherwise this value must be equal to or greater than 0. + */ initial?: number; + /** + * Set the initial expiration time for the document. A value of 0 represents never expiring. + */ expiry?: number; + + /** + * Ensures this operation is persisted to this many nodes + */ persist_to?: number; + + /** + * Ensures this operation is replicated to this many nodes + */ replicate_to?: number; } - export interface DecrMultiOptionsForValue { - offset?: number; - initial?: number; - - expiry?: number; + interface GetAndLockOptions { + lockTime?: number; } - export interface DecrMultiOptions { - spooled?: boolean; - } + interface GetReplicaOptions { - export interface GetOptions { - expiry?: number; - format?: number; - } - - export interface GetMultiOptions { - spooled?: boolean; - format?: number; - } - - export interface GetReplicaOptions { + /** + * The index for which replica you wish to retrieve this value from, or if undefined, use the value from the first server that replies. + */ index?: number; - format?: number; } - export interface GetReplicaMultiOptions { - spooled?: boolean; - format?: number; - } + interface InsertOptions { - export interface IncrOptions extends DecrOptions { } - - export interface IncrMultiOptionsForValue extends DecrMultiOptionsForValue { } - - export interface IncrMultiOptions extends DecrMultiOptions { } - - export interface LockOptions { - lockTime?: number - } - - export interface LockMultiOptions { - spooled?: boolean; - format?: number; - } - - export interface ObserveOptions { - cas: CAS; // verified not optional - } - - export interface ObserveMultiOptionsForValue { - cas: CAS; // verified not optional - } - - export interface ObserveMultiOptions { - spooled?: boolean; - } - - export interface PrependOptions { + /** + * Set the initial expiration time for the document. A value of 0 represents never expiring. + */ expiry?: number; - flags?: number; - format?: number; + + /** + * Ensures this operation is persisted to this many nodes. + */ persist_to?: number; + + /** + * Ensures this operation is replicated to this many nodes. + */ replicate_to?: number; - - cas?: CAS; - } - - export interface PrependMultiOptionsFoValue { - value: any; - cas: CAS; - expiry?: number; - } - - export interface PrependMultiOptions { - spooled?: boolean; - - expiry?: number; - persist_to?: number; - replicate_to?: number; - } - - export interface RemoveOptions { - cas?: CAS; - persist_to?: number; - replicate_to?: number; - } - - export interface RemoveMultiOptionsForValue { - cas?: CAS; - } - - export interface RemoveMultiOptions { - spooled?: boolean; - - persist_to?: number; - replicate_to?: number; - } - - // Options for Replace functions follow Set Options and this is mentioned explicitly in the documentation - - export interface ReplaceOptions extends SetOptions { } - - export interface ReplaceMultiOptionsForValue extends SetMultiOptionsForValue { } - - export interface ReplaceMultiOptions extends SetMultiOptions { } - - export interface SetOptions { - expiry?: number; - flags?: number; - format?: number; - persist_to?: number; - replicate_to?: number; - - cas?: CAS; - } - - export interface SetMultiOptionsForValue { - value: any; - cas?: CAS; - expiry?: number; - flags?: number; - format?: number; - } - - export interface SetMultiOptions { - expiry?: number; - flags?: number; - format?: number - persist_to?: number; - replicate_to?: number; - - spooled?: boolean; - } - - export interface TouchOptions { - expiry?: number; - persist_to?: number; - replicate_to?: number; - - cas?: CAS; - } - - export interface UnlockOptions { - cas: CAS; // verified not optional - } - - export interface UnlockMultiOptionsForValue { - cas: CAS; // verified not optional - } - - export interface UnlockMultiOptions { - spooled?: boolean; } /** - * @class - * A class representing a connection to a Couchbase cluster. - * Normally, your application should only need to create one of these per - * bucket and use it continuously. Operations are executed asynchronously - * and pipelined when possible. - * - * @desc - * Instantiate a new Connection object. Note that it is safe to perform - * operations before the connect callback is invoked. In this case, the - * operations are queued until the connection is ready (or an unrecoverable - * error has taken place). - * - * @param {Object} [options] - * A dictionary of options to use. You may pass - * other options than those defined below which correspond to the various - * options available on the Connection object (see their documentation). - * For example, it may be helpful to set timeout properties before connecting. - * @param {string|string[]} [options.host="localhost:8091"] - * A string or array of strings indicating the hosts to connect to. If the - * value is an array, all the hosts in the array will be tried until one of - * them succeeds. - * @param {string} [options.bucket="default"] - * The bucket to connect to. If not specified, the default is - * 'default'. - * @param {string} [options.password=""] - * The password for a password protected bucket. - * @param {ConnectCallback} callback - * A callback that will be invoked when the instance has completed connecting - * to the server. Note that this isn't required - however if the connection - * fails, an exception will be thrown if the callback is not provided. - * - * @example - * var couchbase = require('couchbase'); - * var db = new couchbase.Connection({}, function(err) { - * if (err) { - * console.log('Connection Error', err); - * } else { - * console.log('Connected!'); - * } - * }); + * A class for performing management operations against a bucket. This class should not be instantiated directly, but instead through the use of the Bucket#manager method instead. */ - export class Connection { - constructor(callback: ConnectCallback); - constructor(options: ConnectionOptions, callback: ConnectCallback); - - ///////////////////////// - // Members - ///////////////////////// + interface BucketManager { + + /** + * Flushes the cluster, deleting all data stored within this bucket. Note that this method requires the Flush permission to be enabled on the bucket from the management console before it will work. + * @param callback The callback function. + */ + flush(callback: Function): void; /** - * Get information about the Couchnode version (i.e. this library) as an array - * of [versionNumber, versionString]. - * - * @member {Mixed[]} Connection#clientVersion + * Retrieves a specific design document from this bucket. + * @param name + * @param callback The callback function. */ - clientVersion: any[]; + getDesignDocument(name: string, callback: Function): void; + /** + * Retrieves a list of all design documents registered to a bucket. + * @param callback The callback function. + */ + getDesignDocuments(callback: Function): void; + + /** + * Registers a design document to this bucket, failing if it already exists. + * @param name + * @param data + * @param callback The callback function. + * @returns {} + */ + insertDesignDocument(name: string, data: any, callback: Function): void; + + /** + * Unregisters a design document from this bucket. + * @param name + * @param callback The callback function. + * @returns {} + */ + removeDesignDocument(name: string, callback: Function): void; + + /** + * Registers a design document to this bucket, overwriting any existing design document that was previously registered. + * @param name + * @param data + * @param callback The callback function. + * @returns {} + */ + upsertDesignDocument(name: string, data: any, callback: Function): void; + } + + /** + * Class for dynamically construction of view queries. This class should never be constructed directly, instead you should use ViewQuery.from to construct this object. + */ + class ViewQuery { + /** + * Instantiates a ViewQuery object for the specified design document and view name. + * @param ddoc The design document to use. + * @param name The view to use. + */ + static from(ddoc: string, name: string): ViewQuery; + + /** + * Specifies the design document and view name to use for this query. + * @param ddoc The design document to use. + * @param name The view to use. + */ + from(ddoc: string, name: string): ViewQuery; + + /** + * Allows you to specify custom view options that may not be available though the fluent interface defined by this class. + * @param opts + */ + custom(opts: any): ViewQuery; + + /** + * Flag to request a view request accross all nodes in the case of a development view. + * @param full_set + */ + full_set(full_set: boolean): ViewQuery; + + /** + * Specifies whether to preform grouping during view execution. + * @param group + */ + group(group: boolean): ViewQuery; + + /** + * Specifies the level at which to perform view grouping. + * @param group_level + */ + group_level(group_level: number): ViewQuery; + + /** + * Specifies a range of document id's to retrieve from the index. + * @param start + * @param end + */ + id_range(start: any, end: any): ViewQuery; + + /** + * Flag to request a view request include the full document value. + * @param include_docs + */ + include_docs(include_docs: boolean): ViewQuery; + + /** + * Specifies a specified key to retrieve from the index. + * @param key + */ + key(key: any): ViewQuery; + + /** + * Specifies a list of keys you wish to retrieve from the index. + * @param keys + */ + keys(key: any[]): ViewQuery; + + /** + * Specifies the maximum number of results to return. + * @param limit + */ + limit(limit: number): ViewQuery; + + /** + * Sets the error handling mode for this query. + * @param mode + */ + on_error(mode: ViewQuery.ErrorMode): ViewQuery; + + /** + * Specifies the desired ordering for the results. + * @param order + */ + order(order: ViewQuery.Order): ViewQuery; + + /** + * Specifies a range of keys to retrieve from the index. You may specify both a start and an end point and additionally specify whether or not the end value is inclusive or exclusive. + * @param start + * @param end + * @param inclusive_end + */ + range(start: any | any[], end: any | any[], inclusive_end?: boolean): ViewQuery; + + /** + * Specifies whether to execute the map-reduce reduce step. + * @param reduce + */ + reduce(reduce: boolean): ViewQuery; + + /** + * Specifies how many results to skip from the beginning of the result set. + * @param skip + */ + skip(skip: number): ViewQuery; + + /** + * Specifies how this query will affect view indexing, both before and after the query is executed. + * @param stale + */ + stale(stale: ViewQuery.Update): ViewQuery; + } + + module ViewQuery { + /** + * Enumeration for specifying on_error behaviour. + */ + enum ErrorMode { + /** + * Continues querying when an error occurs. + */ + CONTINUE, + + /** + * Stops and errors query when an error occurs. + */ + STOP + } + + /** + * Enumeration for specifying view result ordering. + */ + enum Order { + /** + * Orders with lower values first and higher values last. + */ + ASCENDING, + + /** + * Orders with higher values first and lower values last. + */ + DESCENDING + } + + /** + * Enumeration for specifying view update semantics. + */ + enum Update { + /** + * Causes the view to be fully indexed before results are retrieved. + */ + BEFORE, + + /** + * Allows the index to stay in whatever state it is already in prior retrieval of the query results. + */ + NONE, + + /** + * Forces the view to be indexed after the results of this query has been fetched. + */ + AFTER + } + } + + /** + * Class for dynamically construction of N1QL queries. This class should never be constructed directly, instead you should use the N1qlQuery.fromString static method to instantiate a N1qlStringQuery. + */ + class N1qlQuery { + /** + * Creates a query object directly from the passed query string. + * @param str + */ + static fromString(str: string): N1qlStringQuery; + + /** + * Returns the fully prepared string representation of this query. + */ + toString(): string; + } + + module N1qlQuery { + /** + * Enumeration for specifying N1QL consistency semantics. + */ + enum Consistency { + /** + * This is the default (for single-statement requests). + */ + NOT_BOUND, + + /** + * This implements strong consistency per request. + */ + REQUEST_PLUS, + + /** + * This implements strong consistency per statement. + */ + STATEMENT_PLUS + } + } + + /** + * Class for holding a explicitly defined N1QL query string. + */ + class N1qlStringQuery extends N1qlQuery { + /** + * Specifies whether this query is adhoc or should be prepared. + * @param adhoc + */ + adhoc(adhoc: boolean): N1qlStringQuery; + + /** + * Specify the consistency level for this query. + * @param val + */ + consistency(val: N1qlQuery.Consistency): N1qlStringQuery; + + /** + * Returns the fully prepared object representation of this query. + */ + toObject(): any; + + /** + * Returns the fully prepared string representation of this query. + */ + toString(): string; + } + + /** + * Class for dynamically construction of spatial queries. This class should never be constructed directly, instead you should use SpatialQuery.from to construct this object. + */ + class SpatialQuery { + /** + * Instantiates a SpatialQuery object for the specified design document and view name. + * @param ddoc The design document to use. + * @param name The view to use. + */ + static from(ddoc: string, name: string): SpatialQuery; + + /** + * Specifies the design document and view name to use for this query. + * @param ddoc + * @param name + */ + from(ddoc: string, name: string): SpatialQuery; + + /** + * Specifies a bounding box to query the index for. This value must be an array of exactly 4 numbers which represents the left, top, right and bottom edges of the bounding box (in that order). + * @param bbox + */ + bbox(bbox: number[]): SpatialQuery; + + /** + * Allows you to specify custom view options that may not be available though the fluent interface defined by this class. + * @param opts + */ + custom(opts: any): SpatialQuery; + + /** + * Specifies the maximum number of results to return. + * @param limit + */ + limit(limit: number): SpatialQuery; + + /** + * Specifies how many results to skip from the beginning of the result set. + * @param skip + */ + skip(skip: number): SpatialQuery; + + /** + * Specifies how this query will affect view indexing, both before and after the query is executed. + * @param stale + */ + stale(stale: SpatialQuery.Update): SpatialQuery; + } + + module SpatialQuery { + /** + * Enumeration for specifying view update semantics. + */ + enum Update { + /** + * Causes the view to be fully indexed before results are retrieved. + */ + BEFORE, + + /** + * Allows the index to stay in whatever state it is already in prior retrieval of the query results. + */ + NONE, + + /** + * Forces the view to be indexed after the results of this query has been fetched. + */ + AFTER + } + } + + /** + * The Bucket class represents a connection to a Couchbase bucket. Never instantiate this class directly. Instead use the Cluster#openBucket method instead. + */ + interface Bucket { + /** + * Returns the version of the Node.js library as a string. + */ + clientVersion: string; + + /** + * Gets or sets the config throttling in milliseconds. The config throttling is the time that Bucket will wait before forcing a configuration refresh. If no refresh occurs before this period while a configuration is marked invalid, an update will be triggered. + */ + configThrottle: number; + + /** + * Sets or gets the connection timeout in milliseconds. This is the timeout value used when connecting to the configuration port during the initial connection (in this case, use this as a key in the 'options' parameter in the constructor) and/or when Bucket attempts to reconnect in-situ (if the current connection has failed). + */ connectionTimeout: number; - lcbVersion: any[]; + /** + * Gets or sets the durability interval in milliseconds. The durability interval is the time that Bucket will wait between requesting new durability information during a durability poll. + */ + durabilityInterval: number; + /** + * Gets or sets the durability timeout in milliseconds. The durability timeout is the time that Bucket will wait for a response from the server in regards to a durability request. If there are no responses received within this time frame, the request fails with an error. + */ + durabilityTimeout: number; + + /** + * Returns the libcouchbase version as a string. This information will usually be in the format of 2.4.0-fffffff representing the major, minor, patch and git-commit that the built libcouchbase is based upon. + */ + lcbVersion: string; + + /** + * Gets or sets the management timeout in milliseconds. The management timeout is the time that Bucket will wait for a response from the server for a management request. If the response is not received within this time frame, the request is failed out with an error. + */ + managementTimeout: number; + + /** + * Sets or gets the node connection timeout in msecs. This value is similar to Bucket#connectionTimeout, but defines the time to wait for a particular node to respond before trying the next one. + */ + nodeConnectionTimeout: number; + + /** + * Gets or sets the operation timeout in milliseconds. The operation timeout is the time that Bucket will wait for a response from the server for a CRUD operation. If the response is not received within this time frame, the operation is failed with an error. + */ operationTimeout: number; - serverNodes: string[]; + /** + * Gets or sets the view timeout in milliseconds. The view timeout is the time that Bucket will wait for a response from the server for a view request. If the response is not received within this time frame, the request fails with an error. + */ + viewTimeout: number; - ///////////////////////// - // Methods - ///////////////////////// + /** + * Similar to Bucket#upsert, but instead of setting a new key, it appends data to the existing key. Note that this function only makes sense when the stored data is a string; 'appending' to a JSON document may result in parse errors when the document is later retrieved. + * @param key The target document key. + * @param fragment The document's contents to append. + * @param callback The callback function. + */ + append(key: any | Buffer, fragment: any, callback: Bucket.OpCallback): void; - // TODO: not sure if these methods return void. Docmentation mentions nothing. - // TODO: For "multi" key methods the documentation says callback can be either KeyCallback | MultiCallback. Sticking with MultiCallback. - // TODO: Verify that kv is not a key value and indeed is string[] e.g. getMulti , getReplicaMulti, lockMulti + /** + * + * @param key The target document key. + * @param fragment The document's contents to append. + * @param options The options object. + * @param callback The callback function. + */ + append(key: any | Buffer, fragment: any, options: AppendOptions, callback: Bucket.OpCallback): void; - add(key: string, value: any, callback: KeyCallback): void; - add(key: string, value: any, options: AddOptions, callback: KeyCallback): void; - addMulti(kv: { [key: string]: AddMultiOptionsForValue }, options: AddMultiOptions, callback: MultiCallback): void; + /** + * Increments or decrements a key's numeric value. + * Note that JavaScript does not support 64-bit integers (while libcouchbase and the server do). You might receive an inaccurate value if the number is greater than 53-bits (JavaScript's maximum integer precision). + * @param key The target document key. + * @param delta The amount to add or subtract from the counter value. This value may be any non-zero integer. + * @param callback The callback function. + */ + counter(key: any | Buffer, delta: number, callback: Bucket.OpCallback): void; + + /** + * + * @param key The target document key. + * @param delta The amount to add or subtract from the counter value. This value may be any non-zero integer. + * @param options The options object. + * @param callback The callback function. + */ + counter(key: any | Buffer, delta: number, options: CounterOptions, callback: Bucket.OpCallback): void; - append(key: string, fragment: string, callback: KeyCallback): void; - append(key: string, fragment: string, options: AppendOptions, callback: KeyCallback): void; - append(key: string, fragment: Buffer, callback: KeyCallback): void; - append(key: string, fragment: Buffer, options: AppendOptions, callback: KeyCallback): void; - appendMulti(kv: { [key: string]: AppendMultiOptionsForValue }, options: AppendMultiOptions, callback: MultiCallback): void; + /** + * Shuts down this connection. + */ + disconnect(): void; - decr(key: string, callback: KeyCallback): void; - decr(key: string, options: DecrOptions, callback: KeyCallback): void; - decrMulti(kv: { [key: string]: DecrMultiOptionsForValue }, options: DecrMultiOptions, callback: MultiCallback): void; + /** + * Enables N1QL support on the client. A cbq-server URI must be passed. This method will be deprecated in the future in favor of automatic configuration through the connected cluster. + * @param hosts An array of host/port combinations which are N1QL servers attached to this cluster. + */ + enableN1ql(hosts: string | string[]): void; - get(key: string, callback: KeyCallback): void; - get(key: string, options: GetOptions, callback: KeyCallback): void; - getMulti(kv: string[], options: { [key: string]: GetMultiOptions }, callback:MultiCallback): void; + /** + * Retrieves a document. + * @param key The target document key. + * @param callback The callback function. + */ + get(key: any | Buffer, callback: Bucket.OpCallback): void; - getDesignDoc(name: string, callback: DDocCallback): void; + /** + * @param key The target document key. + * @param options The options object. + * @param callback The callback function. + */ + get(key: any | Buffer, options: any, callback: Bucket.OpCallback): void; - getReplica(key: string, callback: KeyCallback): void; - getReplica(key: string, options: GetReplicaOptions, callback: KeyCallback): void; - getReplicaMulti(kv: string[], options: GetReplicaMultiOptions, callback: MultiCallback): void; + /** + * Lock the document on the server and retrieve it. When an document is locked, its CAS changes and subsequent operations on the document (without providing the current CAS) will fail until the lock is no longer held. + * This function behaves identically to Bucket#get in that it will return the value. It differs in that the document is also locked. This ensures that attempts by other client instances to access this document while the lock is held will fail. + * Once locked, a document can be unlocked either by explicitly calling Bucket#unlock or by performing a storage operation (e.g. Bucket#upsert, Bucket#replace, Bucket::append) with the current CAS value. Note that any other lock operations on this key will fail while a document is locked. + * @param key The target document key. + * @param callback The callback function. + */ + getAndLock(key: any, callback: Bucket.OpCallback): void; - incr(key: string, callback: KeyCallback): void; - incr(key: string, options: IncrOptions, callback: KeyCallback): void; - incrMulti(kv: { [key: string]: IncrMultiOptionsForValue }, options: IncrMultiOptions, callback: MultiCallback): void; + /** + * Lock the document on the server and retrieve it. When an document is locked, its CAS changes and subsequent operations on the document (without providing the current CAS) will fail until the lock is no longer held. + * This function behaves identically to Bucket#get in that it will return the value. It differs in that the document is also locked. This ensures that attempts by other client instances to access this document while the lock is held will fail. + * Once locked, a document can be unlocked either by explicitly calling Bucket#unlock or by performing a storage operation (e.g. Bucket#upsert, Bucket#replace, Bucket::append) with the current CAS value. Note that any other lock operations on this key will fail while a document is locked. + * @param key The target document key. + * @param options The options object. + * @param callback The callback function. + * @returns {} + */ + getAndLock(key: any, options: GetAndLockOptions, callback: Bucket.OpCallback): void; - lock(key: string, callback: KeyCallback): void; - lock(key: string, options: LockOptions, callback: KeyCallback): void; - lockMulti(kv: string[], options: { [key: string]: LockMultiOptions }, callback: MultiCallback): void; + /** + * Retrieves a document and updates the expiry of the item at the same time. + * @param key The target document key. + * @param expiry The expiration time to use. If a value of 0 is provided, then the current expiration time is cleared and the key is set to never expire. Otherwise, the key is updated to expire in the time provided (in seconds). + * @param options The options object. + * @param callback The callback function. + */ + getAndTouch(key: any | Buffer, expiry: number, options: any, callback: Bucket.OpCallback): void; + + /** + * Retrieves a document and updates the expiry of the item at the same time. + * @param key The target document key. + * @param expiry The expiration time to use. If a value of 0 is provided, then the current expiration time is cleared and the key is set to never expire. Otherwise, the key is updated to expire in the time provided (in seconds). + * @param callback The callback function. + */ + getAndTouch(key: any | Buffer, expiry: number, callback: Bucket.OpCallback): void; - observe(key: string, options: ObserveOptions, callback: KeyCallback): void; - observeMulti(kv: { [key: string]: ObserveMultiOptionsForValue }, options: { [key: string]: ObserveMultiOptions }, callback: MultiCallback): void; + /** + * Retrieves a list of keys + * @param keys The target document keys. + * @param callback The callback function. + */ + getMulti(key: any[] | Buffer[], callback: Bucket.MultiGetCallback): void; - on(event: string, listener: Function): void; - on(event: 'connect', listener: (err: Error) => any): void; - on(event: 'error', listener: (err: Error) => any): void; + /** + * Get a document from a replica server in your cluster. + * @param key The target document key. + * @param callback The callback function. + */ + getReplica(key: any | Buffer, callback: Bucket.OpCallback): void; - prepend(key: string, fragment: string, callback: KeyCallback): void; - prepend(key: string, fragment: string, options: PrependOptions, callback: KeyCallback): void; - prepend(key: string, fragment: Buffer, callback: KeyCallback): void; - prepend(key: string, fragment: Buffer, options: PrependOptions, callback: KeyCallback): void; - prependMulti(kv: { [key: string]: PrependMultiOptionsFoValue }, options: { [key: string]: PrependMultiOptions }, callback: MultiCallback): void; + /** + * Get a document from a replica server in your cluster. + * @param key The target document key. + * @param options The options object. + * @param callback The callback function. + */ + getReplica(key: any | Buffer, options: GetReplicaOptions, callback: Bucket.OpCallback): void; - remove(key: string, callback: KeyCallback): void; - remove(key: string, options: RemoveOptions, callback: KeyCallback): void; - removeMulti(kv: { [key: string]: RemoveMultiOptionsForValue }, options: RemoveMultiOptions, callback: MultiCallback): void; - removeMulti(kv: string[], options: RemoveMultiOptions, callback: MultiCallback): void; + /** + * Identical to Bucket#upsert but will fail if the document already exists. + * @param key The target document key. + * @param value The document's contents. + * @param callback The callback function. + */ + insert(key: any | Buffer, value: any, callback: Bucket.OpCallback): void; + + /** + * Identical to Bucket#upsert but will fail if the document already exists. + * @param key The target document key. + * @param value The document's contents. + * @param options The options object. + * @param callback The callback function. + */ + insert(key: any | Buffer, value: any, options: InsertOptions, callback: Bucket.OpCallback): void; - removeDesignDoc(name: string, callback: DDocCallback): void; + /** + * Returns an instance of a BuckerManager for performing management operations against a bucket. + */ + manager(): BucketManager; - replace(key: string, value: any, callback: KeyCallback): void; - replace(key: string, value: any, options: ReplaceOptions, callback: KeyCallback): void; - replaceMulti(kv: { [key: string]: ReplaceMultiOptionsForValue }, options: ReplaceMultiOptions, callback: MultiCallback): void; + /** + * Like Bucket#append, but prepends data to the existing value. + * @param key The target document key. + * @param fragment The document's contents to prepend. + * @param callback The callback function. + */ + prepend(key: any, fragment: any, callback: Bucket.OpCallback): void; - set(key: string, value: any, callback: KeyCallback): void; - set(key: string, value: any, options: SetOptions, callback: KeyCallback): void; - setMulti(kv: { [key: string]: SetMultiOptionsForValue }, options: SetMultiOptions, callback: MultiCallback): void; + /** + * Like Bucket#append, but prepends data to the existing value. + * @param key The target document key. + * @param fragment The document's contents to prepend. + * @param options The options object. + * @param callback The callback function. + */ + prepend(key: any, fragment: any, options: PrependOptions, callback: Bucket.OpCallback): void; - setDesignDoc(name: string, data: any, callback: DDocCallback): void; + /** + * Executes a previously prepared query object. This could be a ViewQuery or a N1qlQuery. + * Note: N1qlQuery queries are currently an uncommitted interface and may be subject to change in 2.0.0's final release. + * @param query The query to execute. + * @param callback The callback function. + */ + query(query: ViewQuery | N1qlQuery, callback: Bucket.QueryCallback): Bucket.ViewQueryResponse | Bucket.N1qlQueryResponse; - shutdown(): void; + /** + * Executes a previously prepared query object. This could be a ViewQuery or a N1qlQuery. + * Note: N1qlQuery queries are currently an uncommitted interface and may be subject to change in 2.0.0's final release. + * @param query The query to execute. + * @param params A list or map to do replacements on a N1QL query. + * @param callback The callback function. + */ + query(query: ViewQuery | N1qlQuery, params: Object | Array, callback: Bucket.QueryCallback): Bucket.ViewQueryResponse | Bucket.N1qlQueryResponse; - stats(callback: StatsCallback): void; - stats(key: string, callback: StatsCallback): void; + /** + * Deletes a document on the server. + * @param key The target document key. + * @param callback The callback function. + */ + remove(key: any | Buffer, callback: Bucket.OpCallback): void; - strError(code: number): string; + /** + * Deletes a document on the server. + * @param key The target document key. + * @param options The options object. + * @param callback The callback function. + */ + remove(key: any | Buffer, options: RemoveOptions, callback: Bucket.OpCallback): void; - touch(key: string, callback: KeyCallback): void; - touch(key: string, options: TouchOptions, callback: KeyCallback): void; + /** + * Identical to Bucket#upsert, but will only succeed if the document exists already (i.e. the inverse of Bucket#insert). + * @param key The target document key. + * @param value The document's contents. + * @param callback The callback function. + */ + replace(key: any | Buffer, value: any, callback: Bucket.OpCallback): void; - unlock(key: string, options: UnlockOptions, callback: KeyCallback): void; - unlockMulti(kv: { [key: string]: UnlockMultiOptionsForValue }, options: { [key: string]: UnlockMultiOptions }, callback: UnlockMultiOptions): void; + /** + * Identical to Bucket#upsert, but will only succeed if the document exists already (i.e. the inverse of Bucket#insert). + * @param key The target document key. + * @param value The document's contents. + * @param options The options object. + * @param callback The callback function. + */ + replace(key: any | Buffer, value: any, options: ReplaceOptions, callback: Bucket.OpCallback): void; - view(ddoc: string, name: string): ViewQuery; - view(ddoc: string, name: string, query: any): ViewQuery; + /** + * Configures a custom set of transcoder functions for encoding and decoding values that are being stored or retreived from the server. + * @param encoder The function for encoding. + * @param decoder The function for decoding. + */ + setTranscoder(encoder: Bucket.EncoderFunction, decoder: Bucket.DecoderFunction): void; + + /** + * Update the document expiration time. + * @param key The target document key. + * @param expiry The expiration time to use. If a value of 0 is provided, then the current expiration time is cleared and the key is set to never expire. Otherwise, the key is updated to expire in the time provided (in seconds). Values larger than 302460*60 seconds (30 days) are interpreted as absolute times (from the epoch). + * @param options The options object. + * @param callback The callback function. + */ + touch(key: any | Buffer, expiry: number, options: TouchOptions, callback: Bucket.OpCallback): void; + + /** + * Unlock a previously locked document on the server. See the Bucket#lock method for more details on locking. + * @param key The target document key. + * @param cas The CAS value returned when the key was locked. This operation will fail if the CAS value provided does not match that which was the result of the original lock operation. + * @param callback The callback function. + */ + unlock(key: any | Buffer, cas: Bucket.CAS, callback: Bucket.OpCallback): void; + + /** + * Unlock a previously locked document on the server. See the Bucket#lock method for more details on locking. + * @param key The target document key. + * @param cas The CAS value returned when the key was locked. This operation will fail if the CAS value provided does not match that which was the result of the original lock operation. + * @param options The options object. + * @param callback The callback function. + */ + unlock(key: any | Buffer, cas: Bucket.CAS, options: any, callback: Bucket.OpCallback): void; + + /** + * Stores a document to the bucket. + * @param key The target document key. + * @param value The document's contents. + * @param callback The callback function. + */ + upsert(key: any | Buffer, value: any, callback: Bucket.OpCallback): void; + + /** + * Stores a document to the bucket. + * @param key The target document key. + * @param value The document's contents. + * @param options The options object. + * @param callback The callback function. + */ + upsert(key: any | Buffer, value: any, options: UpsertOptions, callback: Bucket.OpCallback): void; } - export class ViewQuery { - firstPage(q: any, callback: Function): void; - query(q: any, callback: Function): void; - } + module Bucket { + + /** + * his is used as a callback from executed queries. It is a shortcut method that automatically subscribes to the rows and error events of the Bucket.ViewQueryResponse. + */ + interface QueryCallback { + /** + * @param error The error for the operation. This can either be an Error object or a falsy value. + * @param rows The rows returned from the query. + * @param meta The metadata returned by the query. + */ + (error: CouchbaseError, rows: any[], meta: Bucket.ViewQueryResponse.Meta): void; + } -} + /** + * Single-Key callbacks. + * This callback is passed to all of the single key functions. + * It returns a result objcet containing a combination of a CAS and a value, depending on which operation was invoked. + */ + interface OpCallback { + /** + * @param error The error for the operation. This can either be an Error object or a value which evaluates to false (null, undefined, 0 or false). + * @param result The result of the operation that was executed. This usually contains at least a cas property, and on some operations will contain a value property as well. + */ + (error: CouchbaseError | number, result: any): void; + } + + /** + * Multi-Get Callback. + * This callback is used to return results from a getMulti operation. + */ + interface MultiGetCallback { + /** + * @param error The number of keys that failed to be retrieved. The precise errors are available by checking the error property of the individual documents. + * @param results This is a map of keys to results. The result for each key will optionally contain an error if one occured, or if no error occured will contain the CAS and value of the document. + */ + (error: number, results: any[]): void; + } + + /** + * Transcoder Encoding Function. + * This function will receive a value when a storage operation is invoked that needs to encode user-provided data for storage into Couchbase. It expects to be returned a Buffer object to store along with an integer representing any flag metadata relating to how to decode the key later using the matching DecoderFunction. + */ + interface EncoderFunction { + /** + * Transcoder Encoding Function. + * This function will receive a value when a storage operation is invoked that needs to encode user-provided data for storage into Couchbase. It expects to be returned a Buffer object to store along with an integer representing any flag metadata relating to how to decode the key later using the matching DecoderFunction. + * @param value The value needing encoding. + */ + (value: any): Bucket.TranscoderDoc; + } + + /** + * Transcoder Decoding Function. + * This function will receive an object containing a Buffer value and an integer value representing any flags metadata whenever a retrieval operation is executed. It is expected that this function will return a value representing the original value stored and encoded with its matching EncoderFunction. + */ + interface DecoderFunction { + /** + * + * @param doc The data from Couchbase to decode. + */ + (doc: Bucket.TranscoderDoc): any + } + + /** + * The CAS value is a special object that indicates the current state of the item on the server. Each time an object is mutated on the server, the value is changed. CAS objects can be used in conjunction with mutation operations to ensure that the value on the server matches the local value retrieved by the client. This is useful when doing document updates on the server as you can ensure no changes were applied by other clients while you were in the process of mutating the document locally. + * In the Node.js SDK, the CAS is represented as an opaque value. As such,y ou cannot generate CAS objects, but should rather use the values returned from a Bucket.OpCallback. + */ + interface CAS { + + } + + /** + * An event emitter allowing you to bind to various query result set events. + */ + interface N1qlQueryResponse extends events.EventEmitter { + + } + + module N1qlQueryResponse { + /** + * The meta-information available from a view query response. + */ + interface Meta { + /** + * The identifier for this query request. + */ + requestID: number; + } + } + + /** + * A class used in relation to transcoders. + */ + class TranscoderDoc { + value: Buffer; + flags: number; + } + + /** + * An event emitter allowing you to bind to various query result set events. + */ + interface ViewQueryResponse extends events.EventEmitter { + + } + + module ViewQueryResponse { + /** + * The meta-information available from a view query response. + */ + interface Meta { + /** + * The total number of rows available in the index of the view that was queried. + */ + total_rows: number; + } + } + } +} \ No newline at end of file diff --git a/cradle/cradle-tests.ts b/cradle/cradle-tests.ts new file mode 100644 index 000000000..655e92a87 --- /dev/null +++ b/cradle/cradle-tests.ts @@ -0,0 +1,185 @@ +/// + +import cradle = require("cradle"); + +cradle.setup({ + host: 'living-room.couch', + cache: true, + raw: false, + forceSave: true +}); + +const connection = new cradle.Connection(); +const connection2 = new(cradle.Connection); +const connection3 = new(cradle.Connection)('173.45.66.92'); + +connection.databases(function(error, response) {}); +connection.config(function(error, response) {}); +connection.databases(function(error, response) {}); +connection.info(function(error, response) {}); +connection.stats(function(error, response) {}); +connection.activeTasks(function(error, response) {}); +connection.uuids(function(error, response) {}); +connection.uuids(10, function(error, response) {}); +connection.replicate({ + source: "database", + target: "targetDatabase" +}, function(error, response) {}); + +const db = connection.database('starwars'); + +db.exists(function (error, exists) { + if (error) { + console.log('error', error); + } else if (exists) { + console.log('the force is with you.'); + } else { + console.log('database does not exists.'); + db.create(function(error){ + /* do something if there's an erroror */ + /* populate design documents */ + }); + } +}); + +db.get<{ + name: string; +}>('vader', function (error, doc) { + doc.name; // 'Darth Vader' +}); + +db.get('luke', function (error, doc) { + doc.prop; +}); + + db.get(['luke', 'vader'], function (error, doc) { + // + }); + +db.save('skywalker', { + force: 'light', + name: 'Luke Skywalker' +}, function (error, res) { + if (error) { + // Handle erroror + } else { + // Handle success + } +}); + +db.save({ + force: 'dark', name: 'Darth' + }, function (err, res) { + // Handle response + }); + +db.save('luke', '1-94B6F82', { + force: 'dark', name: 'Luke' +}, function (err, res) { + // Handle response +}); + +db.save([ + { name: 'Yoda' }, + { name: 'Han Solo' }, + { name: 'Leia' } +], function (err, res) { + // Handle response +}); + +db.merge('luke', {jedi: true}, function (err, res) { + // Luke is now a jedi, + // but remains on the dark side of the force. +}); + +db.view('characters/all', function (err, res) { + res.forEach(function (row: any) { + console.log("%s is on the %s side of the force.", row.name, row.force); + }); +}); + +db.view('characters/all', {group: true, reduce: true} , function (err, res) { + res.forEach(function (row: any) { + console.log("%s is on the %s side of the force.", row.name, row.force); + }); + }); + + db.temporaryView({ + map: function (doc: any) { + // + } + }, function (err, res) { + if (err) console.log(err); + console.log(res); + }); + +db.remove('luke', '1-94B6F82', function (err, res) { + // Handle response +}); + +db.update('my_designdoc/update_handler_name', 'luke', undefined, { my_param: false }, function (err, res) { + // Handle the response, specified by the update handler +}); + +db.changes(function (err, list) { + list.forEach(function (change) { console.log(change) }); +}); + +db.changes({ since: 42 }, function (err, list) { + // +}); + +const feed = db.changes({ since: 42 }); + +feed.on('change', function (change: any) { + console.log(change); +}); + +const idAndRevData = { + id: 'luke', + rev: 'my-rev' +}; + +const attachmentData = { + name: 'fooAttachment.txt', + 'Content-Type': 'text/plain', + body: 'Foo document text' +}; + +db.saveAttachment(idAndRevData, attachmentData, function (err, reply) { + if (err) { + console.dir(err) + return + } + console.dir(reply) +}); + + +db.getAttachment('luke', 'foo.txt', function (err, reply) { + if (err) { + console.dir(err); + return; + } + console.dir(reply); +}); + +db.removeAttachment('luke', 'foo.txt', function (err, reply) { + if (err) { + console.dir(err); + return; + } + console.dir(reply); +}); + +db.info(function(error, response) {}); +db.all(function(error, response) {}); +db.all({ + body: { + keys: ['key1', 'key2'] + } +}, function(error, response) {}); +db.compact(function(error, response) {}); +db.compact('design', function(error, response) {}); +db.viewCleanup(function(error, response) {}); +db.replicate('database', function(error, response) {}); +db.replicate('database', {}, function(error, response) {}); diff --git a/cradle/cradle.d.ts b/cradle/cradle.d.ts new file mode 100644 index 000000000..6434af26c --- /dev/null +++ b/cradle/cradle.d.ts @@ -0,0 +1,122 @@ +// Type definitions for cradle +// Project: https://github.com/flatiron/cradle +// Definitions by: Panu Horsmalahti +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "cradle" { + interface Options { + host?: string; + hostname?: string; + cache?: boolean; + raw?: boolean; + forceSave?: boolean; + auth?: string | { + username: string; + password: string; + } + ca?: string; + secure?: boolean; + retries?: number; + retryTimeout?: number; + maxSockets?: number; + } + + interface Callback { + (error: any, response: any): void; + } + + interface ErrorCallback { + (error: any): void; + } + + export class Connection { + constructor(uri?: string, port?: number, options?: Options); + database(name: string): Database; + databases(Callback: Callback): void; + config(callback: Callback): void; + info(callback: Callback): void; + stats(callback: Callback): void; + activeTasks(callback: Callback): void; + uuids(callback: Callback): void; + uuids(count: number, callback: Callback): void; + replicate(options: { + source: string | { + url: string; + }; + target: string | { + url: string; + }; + cancel?: boolean; + continuous?: boolean; + create_target?: boolean; + doc_ids?: string[]; + filter?: string; + proxy?: string; + query_params?: any; + }, callback: Callback): void; + } + + export interface ChangesOptions { + since: number; + } + + export class Database { + name: string; + get(id: string, callback: (error: any, document: any) => void): void; + get(id: string, callback: (error: any, document: T) => void): void; + get(id: string, rev: string, callback: (error: any, document: any) => void): void; + get(id: string, rev: string, callback: (error: any, document: T) => void): void; + get(ids: string[], callback: Callback): void; + save(document: any, callback: Callback): void; + save(id: string, document: any, callback: Callback): void; + save(id: string, revision: string, document: any, + callback: Callback): void; + save(document: T, callback: Callback): void; + save(id: string, document: T, callback: Callback): void; + save(id: string, revision: string, document: T, + callback: Callback): void; + save(documents: any[], callback: Callback): void; + merge(id: string, document: any, callback: Callback): void; + merge(id: string, document: T, callback: Callback): void; + remove(id: string, revision: string, callback: Callback): void; + update(name: string, id: string, queryObject: any, documentBody: any, + callback: Callback): void; + view(name: string, callback: Callback): void; + view(name: string, options: { + group?: boolean; + reduce?: boolean; + key?: string; + startkey?: any; + endkey?: any; + include_docs?: boolean; + limit?: number; + descending?: boolean; + }, callback: Callback): void; + temporaryView(view: any, callback: Callback): void; + create(callback: ErrorCallback): void; + exists(callback: (error: any, exists: boolean) => void): void; + destroy(callback: ErrorCallback): void; + changes(options: ChangesOptions): any; + changes(callback: (error: any, list: any[]) => void): void; + changes(options: ChangesOptions, callback: (error: any, + list: any[]) => void): void; + saveAttachment(idAndRevData: { + id: string; + rev: string; + }, attachmentData: any, callback: Callback): void; + getAttachment(id: string, attachmentName: string, + callback: Callback): void; + removeAttachment(id: string, attachmentName: string, + callback: Callback): void; + info(callback: Callback): void; + all(callback: Callback): void; + all(options: any, callback: Callback): void; + compact(callback: Callback): void; + compact(design: string, callback: Callback): void; + viewCleanup(callback: Callback): void; + replicate(target: string, callback: Callback): void; + replicate(target: string, options: any, callback: Callback): void; + } + + export function setup(options: Options): void; +} diff --git a/create-error/create-error-tests.ts b/create-error/create-error-tests.ts new file mode 100644 index 000000000..76b66adf2 --- /dev/null +++ b/create-error/create-error-tests.ts @@ -0,0 +1,149 @@ +/// +/// +/// + +import * as createError from 'create-error'; +import * as assert from 'assert'; + +// Example taken from https://github.com/tgriesser/create-error/blob/0.3.1/README.md#use + +interface MyCustomError extends createError.Error { + messages: string[]; + someVal: string; +} +var MyCustomError = createError('MyCustomError'); + +interface SubCustomError extends MyCustomError { +} +var SubCustomError = createError(MyCustomError, 'CoolSubError', {messages: []}); + +var sub = new SubCustomError('My Message', {someVal: 'value'}); + +sub instanceof SubCustomError // true +sub instanceof MyCustomError // true +sub instanceof Error // true + +assert.deepEqual(sub.messages, []) // true +assert.equal(sub.someVal, 'value') // true + + +// Taken and adapted from https://github.com/tgriesser/create-error/blob/0.3.1/test/index.js + +var equal = assert.equal; +var deepEqual = assert.deepEqual; + +describe('create-error', function() { + + describe('error creation', function() { + + it('should create a new error', function() { + var TestingError = createError('TestingError'); + var a = new TestingError('msgA'); + var b = new TestingError('msgB'); + equal((a instanceof TestingError), true); + equal((a instanceof Error), true); + equal(a.message, 'msgA'); + equal(b.message, 'msgB'); + equal((a.stack.length > 0), true); + }); + + it('should attach properties in the second argument', function() { + interface TestingError extends createError.Error { + anArray: string[]; + } + var TestingError = createError('TestingError', {anArray: []}); + var a = new TestingError('Test the array'); + deepEqual(a.anArray, []); + }); + + it('should give the name "CustomError" if the name is omitted', function() { + var TestingError = createError(); + var a = new TestingError("msg"); + equal(a.name, 'CustomError'); + }); + + it('should not reference the same property in subsequent errors', function() { + interface TestingError extends createError.Error { + anArray: string[]; + } + var TestingError = createError('TestingError', {anArray: []}); + var a = new TestingError('Test the array'); + a.anArray.push('a'); + var b = new TestingError(''); + deepEqual(b.anArray, []); + }); + + it('should allow for empty objects on the cloned hash', function() { + interface TestingError extends createError.Error { + anEmptyObj: Object; + } + var TestingError = createError('TestingError', {anEmptyObj: Object.create(null)}); + var a = new TestingError('Test the array'); + deepEqual(a.anEmptyObj, Object.create(null)); + }); + + it('attaches attrs in the second arg of the error ctor, #3', function() { + interface RequestError extends createError.Error { + status: number; + } + var RequestError = createError('RequestError', {status: 400}); + var reqErr = new RequestError('404 Error', {status: 404}); + equal(reqErr.status, 404); + equal(reqErr.message, '404 Error'); + equal(reqErr.name, 'RequestError'); + }); + + }); + + describe('subclassing errors', function() { + + it('takes an object in the first argument', function() { + var TestingError = createError('TestingError'); + var SubTestingError = createError(TestingError, 'SubTestingError'); + var x = new SubTestingError(); + equal((x instanceof SubTestingError), true); + equal((x instanceof TestingError), true); + equal((x instanceof Error), true); + }); + + it('attaches the properties appropriately.', function() { + interface SubTestingError extends createError.Error { + key: string[]; + } + var TestingError = createError('TestingError'); + var SubTestingError = createError(TestingError, 'SubTestingError', {key: []}); + var x = new SubTestingError(); + deepEqual(x.key, []); + }); + + it('allows for a default message, #4', function() { + var TestingError = createError('TestingError', {message: 'Error with testing'}); + var x = new TestingError(); + equal(x.message, 'Error with testing'); + }); + + }); + + describe('invalid values sent to the second argument', function() { + + it('should ignore falsy values', function() { + var TestingError = createError('TestingError', ''); + var TestingError2 = createError('TestingError', null); + var TestingError3 = createError('TestingError', void 0); + var a = new TestingError('Test the array'); + var b = new TestingError2('Test the array'); + var c = new TestingError3('Test the array'); + }); + + it('should ignore arrays', function() { + interface TestingError extends createError.Error { + anArray: string[]; + } + var TestingError = createError('TestingError', [{anArray: []}]); + var a = new TestingError('Test the array'); + equal(a.anArray, void 0); + }); + + }); + +}); diff --git a/create-error/create-error.d.ts b/create-error/create-error.d.ts new file mode 100644 index 000000000..5db02e474 --- /dev/null +++ b/create-error/create-error.d.ts @@ -0,0 +1,21 @@ +// Type definitions for create-error.js 0.3.1 +// Project: https://github.com/tgriesser/create-error +// Definitions by: Tanguy Krotoff +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module 'create-error' { + // FIXME See Global type references https://github.com/Microsoft/TypeScript/issues/983 + type Err = Error; + + namespace createError { + interface Error extends Err { + new (message?: string, obj?: any): T; + } + } + + function createError(): createError.Error; + function createError>(name: string, properties?: any): T; + function createError>(Target: createError.Error, name?: string, properties?: any): T; + + export = createError; +} 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/cucumber/cucumber-tests.ts b/cucumber/cucumber-tests.ts new file mode 100644 index 000000000..f8b560607 --- /dev/null +++ b/cucumber/cucumber-tests.ts @@ -0,0 +1,40 @@ +/// + +function StepSample() { + type Callback = cucumber.CallbackStepDefinition; + var step = this; + var hook = this; + + hook.Before(function(scenario, callback){ + scenario.isFailed() && callback.pending(); + }) + + hook.Around(function(scenario, runScenario) { + scenario.isFailed() && runScenario(null, function(){ + console.log('finish tasks'); + }); + }); + + hook.registerHandler('AfterFeatures', function (event, callback) { + callback(); + }); + + step.Given(/^I am on the Cucumber.js GitHub repository$/, function(callback:Callback) { + this.visit('https://github.com/cucumber/cucumber-js', callback); + }); + + step.When(/^I go to the README file$/, function(title:string, callback:Callback) { + callback.pending(); + }); + + step.Then(/^I should see "(.*)" as the page title$/, { timeout:60*1000}, function(title:string, callback:Callback) { + var pageTitle = this.browser.text('title'); + + if (title === pageTitle) { + callback(); + } else { + callback(new Error("Expected to be on page with title " + title)); + } + }); +} + diff --git a/cucumber/cucumber.d.ts b/cucumber/cucumber.d.ts new file mode 100644 index 000000000..75faeff7a --- /dev/null +++ b/cucumber/cucumber.d.ts @@ -0,0 +1,57 @@ +// Type definitions for cucumber-js +// Project: https://github.com/cucumber/cucumber-js +// Definitions by: Abraão Alves +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module cucumber { + + export interface CallbackStepDefinition{ + pending : () => Thenable; + (errror?:any):void; + } + + interface StepDefinitionCode { + (...stepArgs: Array): Thenable | any | void; + } + + interface StepDefinitionOptions{ + timeout?: number; + } + + export interface StepDefinitions { + Given(pattern: RegExp | string, options: StepDefinitionOptions, code: StepDefinitionCode): void; + Given(pattern: RegExp | string, code: StepDefinitionCode): void; + When(pattern: RegExp | string, options: StepDefinitionOptions, code: StepDefinitionCode): void; + When(pattern: RegExp | string, code: StepDefinitionCode): void; + Then(pattern: RegExp | string, options: StepDefinitionOptions, code: StepDefinitionCode): void; + Then(pattern: RegExp | string, code: StepDefinitionCode): void; + setDefaultTimeout(time:number): void; + } + + interface HookScenario{ + attach(text: string, mimeType?: string, callback?: (err?:any) => void): void; + isFailed() : boolean; + } + + interface HookCode { + (scenario: HookScenario, callback?: CallbackStepDefinition): void; + } + + interface AroundCode{ + (scenario: HookScenario, runScenario?: (error:string, callback?:Function)=>void): void; + } + + export interface Hooks { + Before(code: HookCode): void; + After(code: HookCode): void; + Around(code: AroundCode):void; + setDefaultTimeout(time:number): void; + registerHandler(handlerOption:string, code:(event:any, callback:CallbackStepDefinition) =>void): void; + } +} + +declare module 'cucumber'{ + export = cucumber; +} \ No newline at end of file diff --git a/d3-dsv/d3-dsv-tests.ts b/d3-dsv/d3-dsv-tests.ts new file mode 100644 index 000000000..44b0a6cb3 --- /dev/null +++ b/d3-dsv/d3-dsv-tests.ts @@ -0,0 +1,8 @@ +/// + +import d3dsv = require("d3-dsv"); + +var csv = d3dsv(","); + +var rows = csv.parse("a,b,c\n1,2,3\n4,5,6"); + diff --git a/d3-dsv/d3-dsv.d.ts b/d3-dsv/d3-dsv.d.ts new file mode 100644 index 000000000..09ed95491 --- /dev/null +++ b/d3-dsv/d3-dsv.d.ts @@ -0,0 +1,67 @@ +// Type definitions for d3-dsv +// Project: https://www.npmjs.com/package/d3-dsv +// Definitions by: Jason Swearingen +// Definitions: https://github.com/borisyankov/DefinitelyTyped + + +//commonjs loader +declare module "d3-dsv" { + + /** A parser and formatter for DSV (CSV and TSV) files. +Extracted from D3. */ + var loader: ( + /** the symbol used to seperate cells in the row.*/ + delimiter: string, + /** example: "text/plain" */ + encoding?: string) => _d3dsv.D3Dsv; + export = loader; +} +declare module _d3dsv { + /** A parser and formatter for DSV (CSV and TSV) files. +Extracted from D3. */ + export class D3Dsv { + /** Parses the specified string, which is the contents of a CSV file, returning an array of objects representing the parsed rows. + The string is assumed to be RFC4180-compliant. + Unlike the parseRows method, this method requires that the first line of the CSV file contains a comma-separated list of column names; + these column names become the attributes on the returned objects. + For example, consider the following CSV file: + +Year,Make,Model,Length +1997,Ford,E350,2.34 +2000,Mercury,Cougar,2.38 + +The resulting JavaScript array is: + +[ {"Year": "1997", "Make": "Ford", "Model": "E350", "Length": "2.34"}, + {"Year": "2000", "Make": "Mercury", "Model": "Cougar", "Length": "2.38"} ] + */ + public parse( + table: string, + /** coerce cells (strings) into different types or modify them. return null to strip this row from the output results. */ + accessor?: (row: any) => TRow + ): TRow[]; + /** Parses the specified string, which is the contents of a CSV file, returning an array of arrays representing the parsed rows. The string is assumed to be RFC4180-compliant. Unlike the parse method, this method treats the header line as a standard row, and should be used whenever the CSV file does not contain a header. Each row is represented as an array rather than an object. Rows may have variable length. For example, consider the following CSV file: + +1997,Ford,E350,2.34 +2000,Mercury,Cougar,2.38 +The resulting JavaScript array is: + +[ ["1997", "Ford", "E350", "2.34"], + ["2000", "Mercury", "Cougar", "2.38"] ] +Note that the values themselves are always strings; they will not be automatically converted to numbers. See parse for details.*/ + public parseRows( + table: string, + /** coerce cells (strings) into different types or modify them. return null to strip this row from the output results.*/ + accessor?: (row: string[]) => TRow + ): TRow[]; + /** Converts the specified array of rows into comma-separated values format, returning a string. This operation is the reverse of parse. Each row will be separated by a newline (\n), and each column within each row will be separated by a comma (,). Values that contain either commas, double-quotes (") or newlines will be escaped using double-quotes. + +Each row should be an object, and all object properties will be converted into fields. For greater control over which properties are converted, convert the rows into arrays containing only the properties that should be converted and use formatRows. */ + public format(rows: any[]): string; + /** Converts the specified array of rows into comma-separated values format, returning a string. This operation is the reverse of parseRows. Each row will be separated by a newline (\n), and each column within each row will be separated by a comma (,). Values that contain either commas, double-quotes (") or newlines will be escaped using double-quotes. */ + public formatRows(rows: any[]): string; + + + } + +} \ No newline at end of file diff --git a/d3/d3.d.ts b/d3/d3.d.ts index 87e6ef0e0..1f5ebe7a1 100644 --- a/d3/d3.d.ts +++ b/d3/d3.d.ts @@ -791,7 +791,7 @@ declare module d3 { /** * Returns the first non-null element in the selection, or null otherwise. */ - node(): EventTarget; + node(): Node; /** * Returns the total number of elements in the selection. @@ -854,7 +854,7 @@ declare module d3 { call(func: (transition: Transition, ...args: any[]) => any, ...args: any[]): Transition; empty(): boolean; - node(): EventTarget; + node(): Node; size(): number; } @@ -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; } @@ -3032,6 +3032,46 @@ declare module d3 { padding(padding: number): Pack; } + export function partition(): Partition; + export function partition(): Partition; + + module partition { + interface Link { + source: T; + target: T; + } + + interface Node { + parent?: Node; + children?: number; + value?: number; + depth?: number; + x?: number; + y?: number; + dx?: number; + dy?: number; + } + + } + + export interface Partition { + nodes(root: T): T[]; + + links(nodes: T[]): partition.Link[]; + + children(): (node: T, depth: number) => T[]; + children(children: (node: T, depth: number) => T[]): Partition; + + sort(): (a: T, b: T) => number; + sort(comparator: (a: T, b: T) => number): Partition; + + value(): (node: T) => number; + value(value: (node: T) => number): Partition; + + size(): [number, number]; + size(size: [number, number]): Partition; + } + export function pie(): Pie; export function pie(): Pie; diff --git a/dagre/dagre.d.ts b/dagre/dagre.d.ts index fb5bd95d9..d16df5216 100644 --- a/dagre/dagre.d.ts +++ b/dagre/dagre.d.ts @@ -31,3 +31,7 @@ declare module Dagre{ } declare var dagre: Dagre.DagreFactory; + +declare module "dagre" { + export = dagre; +} diff --git a/date.format.js/date.format.d.ts b/date.format.js/date.format.d.ts index 6e4ef4ea6..d31543ace 100644 --- a/date.format.js/date.format.d.ts +++ b/date.format.js/date.format.d.ts @@ -180,32 +180,6 @@ interface Date { format(mask?: string, utc?: boolean) : string; } -declare var Date: { - new (): Date; - new (value: number): Date; - new (value: string): Date; - new (year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date; - (): string; - prototype: Date; - /** - * Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970. - * @param s A date string - */ - parse(s: string): number; - /** - * Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date. - * @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year. - * @param month The month as an number between 0 and 11 (January to December). - * @param date The date as an number between 1 and 31. - * @param hours Must be supplied if minutes is supplied. An number from 0 to 23 (midnight to 11pm) that specifies the hour. - * @param minutes Must be supplied if seconds is supplied. An number from 0 to 59 that specifies the minutes. - * @param seconds Must be supplied if milliseconds is supplied. An number from 0 to 59 that specifies the seconds. - * @param ms An number from 0 to 999 that specifies the milliseconds. - */ - UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number; - now(): number; -}; - // Some common format strings interface DateFormatMasks { "default": string; diff --git a/debounce/debounce-tests.ts b/debounce/debounce-tests.ts new file mode 100644 index 000000000..947fbcdae --- /dev/null +++ b/debounce/debounce-tests.ts @@ -0,0 +1,14 @@ +/// + +import debounce from "debounce"; + +const doThings = () => 1; + +debounce(function(){ doThings(); })(); + +debounce(function(){ doThings(); }, 1000)(); + +debounce(function(a: string){ doThings(); }, 1000)("foo"); + +// Immediate true should return the value +const imm1: number = (debounce((x: number) => x * 2, 100, true))(2); diff --git a/debounce/debounce.d.ts b/debounce/debounce.d.ts new file mode 100644 index 000000000..7aa24601a --- /dev/null +++ b/debounce/debounce.d.ts @@ -0,0 +1,11 @@ +// Type definitions for compose-function +// Project: https://github.com/component/debounce +// Definitions by: Denis Sokolov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module "debounce" { + // Overload on boolean constants would allow us to narrow further, + // but it is not implemented for TypeScript yet + function f(f: A, interval?: number, immediate?: boolean): A + export default f; +} diff --git a/debug/debug-tests.ts b/debug/debug-tests.ts index 63a0a3ac4..a26400340 100644 --- a/debug/debug-tests.ts +++ b/debug/debug-tests.ts @@ -1,4 +1,3 @@ -/// /// import debug = require("debug"); @@ -6,7 +5,7 @@ import debug = require("debug"); debug.disable(); debug.enable("DefinitelyTyped:*"); -var log: debug.Debugger = debug("DefinitelyTyped:log"); +var log:debug.IDebugger = debug("DefinitelyTyped:log"); log("Just text"); log("Formatted test (%d arg)", 1); @@ -15,6 +14,6 @@ log("Formatted %s (%d args)", "test", 2); log("Enabled?: %s", debug.enabled("DefinitelyTyped:log")); log("Namespace: %s", log.namespace); -var error: debug.Debugger = debug("DefinitelyTyped:error"); +var error:debug.IDebugger = debug("DefinitelyTyped:error"); error.log = console.error.bind(console); error("This should be printed to stderr"); diff --git a/debug/debug.d.ts b/debug/debug.d.ts index 1a71725a8..b43cd238c 100644 --- a/debug/debug.d.ts +++ b/debug/debug.d.ts @@ -1,30 +1,38 @@ // Type definitions for debug // Project: https://github.com/visionmedia/debug -// Definitions by: Seon-Wook Park +// Definitions by: Seon-Wook Park , Gal Talmor // Definitions: https://github.com/borisyankov/DefinitelyTyped -declare module "debug" { - - function d(namespace: string): d.Debugger; - - module d { - export var log: Function; - - function enable(namespaces: string): void; - function disable(): void; - - function enabled(namespace: string): boolean; - - export interface Debugger { - (formatter: any, ...args: any[]): void; - - enabled: boolean; - log: Function; - namespace: string; - } - } - - export = d; +declare var debug: debug.IDebug; +// Support AMD require +declare module 'debug' { + export = debug; } +declare module debug { + export interface IDebug { + (namespace: string): debug.IDebugger, + coerce: (val: any) => any, + disable: () => void, + enable: (namespaces: string) => void, + enabled: (namespaces: string) => boolean, + + names: string[], + skips: string[], + + formatters: IFormatters + } + + export interface IFormatters { + [formatter: string]: Function + } + + export interface IDebugger { + (formatter: any, ...args: any[]): void; + + enabled: boolean; + log: Function; + namespace: string; + } +} diff --git a/del/del-tests.ts b/del/del-tests.ts index 867781d63..d3c45c965 100644 --- a/del/del-tests.ts +++ b/del/del-tests.ts @@ -35,3 +35,5 @@ paths = del.sync(["tmp/*.js", "!tmp/unicorn.js"], {force: true}); paths = del.sync("tmp/*.js"); paths = del.sync("tmp/*.js", {force: true}); + +paths = del.sync("tmp/*.js", {dryRun: true}); diff --git a/del/del.d.ts b/del/del.d.ts index 060861d8a..88316f4f2 100644 --- a/del/del.d.ts +++ b/del/del.d.ts @@ -1,6 +1,6 @@ -// Type definitions for del v1.2.0 +// Type definitions for del v2.2.0 // Project: https://github.com/sindresorhus/del -// Definitions by: Asana +// Definitions by: Asana , Aya Morisawa // Definitions: https://github.com/borisyankov/DefinitelyTyped /// @@ -20,7 +20,8 @@ declare module "del" { function sync(patterns: string[], options?: Options): string[]; interface Options extends glob.IOptions { - force?: boolean + force?: boolean; + dryRun?: boolean; } } diff --git a/depd/depd-tests.ts b/depd/depd-tests.ts new file mode 100644 index 000000000..14dfbe72c --- /dev/null +++ b/depd/depd-tests.ts @@ -0,0 +1,54 @@ +/// + +import depd = require('depd'); + +var deprecate = depd("depd-tests"); + +function assert(condition: boolean, message: string): void { + if (!condition) { + throw new Error(message); + } +} + +function testDepdMessage(...args: string[]): boolean { + if (arguments.length < 1) { + deprecate('testDepdMessage argument.lenth<1'); + return true; + } else { + console.log('normal logic'); + return false; + } +} + +assert(testDepdMessage() === true, "Deprecated code must be triggered!"); +assert(testDepdMessage('a') === false, "Deprecated code must be triggered!"); + +interface ITestObject { + p1: string; + p2: string; +} + +var obj = { p1: 'deprecated property', p2: 'normal property' }; +deprecate.property(obj, 'p1', 'property [p1] is deprecated!'); + +console.log(obj.p1); + +interface ITestDeprecatedFunction { + func1?: Function; + func2?: Function; +} + +var obj2 = {}; + +// message automatically derived from function name +obj2.func1 = deprecate.function(function func1() { + console.log('all calls to [func1] are deprecated '); +}); + +// specific message +obj2.func2 = deprecate.function(function () { + console.log('all calls to [func2] are deprecated '); +}, 'func2'); + +obj2.func1(); +obj2.func2(); \ No newline at end of file diff --git a/depd/depd.d.ts b/depd/depd.d.ts new file mode 100644 index 000000000..1af4eaa8d --- /dev/null +++ b/depd/depd.d.ts @@ -0,0 +1,17 @@ +// Type definitions for depd 1.1.0 +// Project: https://github.com/dougwilson/nodejs-depd +// Definitions by: Zhiyuan Wang +// Definitions: https://github.com/borisyankov/DefinitelyTyped + + +declare module 'depd' { + function depd(namespace: string): Deprecate; + + interface Deprecate { + (message: string): void; + function(fn: Function, message?: string): Function; + property(obj: Object, prop: string, message: string): void; + } + + export = depd; +} \ No newline at end of file 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-15.1.8.d.ts b/devextreme/devextreme-15.1.8.d.ts new file mode 100644 index 000000000..83e69504b --- /dev/null +++ b/devextreme/devextreme-15.1.8.d.ts @@ -0,0 +1,6580 @@ +// Type definitions for DevExtreme 15.1.8 +// 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; + /** Returns the configuration options of this component. */ + option(): { + [optionKey: string]: any; + }; + /** Sets one or more options of this component. */ + option(options: { + [optionKey: string]: any; + }): void; + /** Gets the value of the specified configuration option of this component. */ + option(optionName: string): any; + /** Sets a value to the specified configuration option of this component. */ + option(optionName: string, optionValue: any): void; + } + export interface DOMComponentOptions extends ComponentOptions { + /** Specifies whether or not the current component supports a right-to-left representation. */ + rtlEnabled?: boolean; + /** Specifies the height of the widget. */ + height?: any; + /** Specifies the width of the widget. */ + width?: any; + } + /** A base class for all components. */ + export class DOMComponent extends Component { + constructor(element: JQuery, options?: DOMComponentOptions); + constructor(element: HTMLElement, options?: DOMComponentOptions); + /** Returns the root HTML element of the widget. */ + element(): JQuery; + /** Specifies the device-dependent default configuration options for this component. */ + static defaultOptions(rule: { + device?: any; + options?: any; + }): void; + } + export module data { + export interface ODataError extends Error { + httpStatus?: number; + errorDetails?: any; + } + export interface StoreOptions { + 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?: any; + /** A key used to authenticate the application within the required map provider. */ + key?: { + /** A key used to authenticate the application within the "Bing" map provider. */ + bing?: string; + /** A key used to authenticate the application within the "Google" map provider. */ + google?: string; + /** A key used to authenticate the application within the "Google Static" map provider. */ + googleStatic?: string; + } + /** A handler for the markerAdded event. */ + onMarkerAdded?: Function; + 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?: any; + /** The zoom level of the map. */ + zoom?: number; + } + /** An interactive map widget. */ + export class dxMap extends Widget { + constructor(element: JQuery, options?: dxMapOptions); + constructor(element: Element, options?: dxMapOptions); + /** Adds a marker to the map. */ + addMarker(markerOptions: Object): JQueryPromise; + /** Adds a route to the map. */ + addRoute(routeOptions: Object): JQueryPromise; + /** Removes a marker from the map. */ + removeMarker(marker: Object): JQueryPromise; + /** Removes a route from the map. */ + removeRoute(route: any): JQueryPromise; + } + export interface dxLookupOptions extends dxDropDownListOptions { + /** An object defining widget animation options. */ + animation?: fx.AnimationOptions; + /** The text displayed on the Cancel button. */ + cancelButtonText?: string; + /** The text displayed on the Clear button. */ + clearButtonText?: string; + /** Specifies whether or not the widget cleans the search box when the popup window is displayed. */ + cleanSearchOnOpening?: boolean; + /** A Boolean value specifying whether or not 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 handler for the valueChanged event. */ + onValueChanged?: Function; + } + /** A widget used to select and upload a file or multiple files. */ + export class dxFileUploader extends Editor { + constructor(element: JQuery, options?: dxFileUploaderOptions); + constructor(element: Element, options?: dxFileUploaderOptions); + } + export interface dxTrackBarOptions extends EditorOptions { + /** The minimum value the widget can accept. */ + min?: number; + /** The maximum value the widget can accept. */ + max?: number; + /** The current widget value. */ + value?: number; + } + /** A base class for track bar widgets. */ + export class dxTrackBar extends Editor { + constructor(element: JQuery, options?: dxTrackBarOptions); + constructor(element: Element, options?: dxTrackBarOptions); + } + export interface dxProgressBarOptions extends dxTrackBarOptions { + /** Specifies a format for the progress status. */ + statusFormat?: any; + /** Specifies whether or not the widget displays a progress status. */ + showStatus?: boolean; + /** A handler for the complete event. */ + onComplete?: Function; + } + /** A widget used to indicate progress. */ + export class dxProgressBar extends dxTrackBar { + constructor(element: JQuery, options?: dxProgressBarOptions); + constructor(element: Element, options?: dxProgressBarOptions); + } + export interface dxSliderOptions extends dxTrackBarOptions { + /** 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; + dxTagBox(): JQuery; + dxTagBox(options: "instance"): DevExpress.ui.dxTagBox; + dxTagBox(options: string): any; + dxTagBox(options: string, ...params: any[]): any; + dxTagBox(options: DevExpress.ui.dxTagBoxOptions): JQuery; + dxScrollView(): JQuery; + dxScrollView(options: "instance"): DevExpress.ui.dxScrollView; + dxScrollView(options: string): any; + dxScrollView(options: string, ...params: any[]): any; + dxScrollView(options: DevExpress.ui.dxScrollViewOptions): JQuery; + dxScrollable(): JQuery; + dxScrollable(options: "instance"): DevExpress.ui.dxScrollable; + dxScrollable(options: string): any; + dxScrollable(options: string, ...params: any[]): any; + dxScrollable(options: DevExpress.ui.dxScrollableOptions): JQuery; + dxRadioGroup(): JQuery; + dxRadioGroup(options: "instance"): DevExpress.ui.dxRadioGroup; + dxRadioGroup(options: string): any; + dxRadioGroup(options: string, ...params: any[]): any; + dxRadioGroup(options: DevExpress.ui.dxRadioGroupOptions): JQuery; + dxPopup(): JQuery; + dxPopup(options: "instance"): DevExpress.ui.dxPopup; + dxPopup(options: string): any; + dxPopup(options: string, ...params: any[]): any; + dxPopup(options: DevExpress.ui.dxPopupOptions): JQuery; + dxPopover(): JQuery; + dxPopover(options: "instance"): DevExpress.ui.dxPopover; + dxPopover(options: string): any; + dxPopover(options: string, ...params: any[]): any; + dxPopover(options: DevExpress.ui.dxPopoverOptions): JQuery; + dxOverlay(): JQuery; + dxOverlay(options: "instance"): DevExpress.ui.dxOverlay; + dxOverlay(options: string): any; + dxOverlay(options: string, ...params: any[]): any; + dxOverlay(options: DevExpress.ui.dxOverlayOptions): JQuery; + dxNumberBox(): JQuery; + dxNumberBox(options: "instance"): DevExpress.ui.dxNumberBox; + dxNumberBox(options: string): any; + dxNumberBox(options: string, ...params: any[]): any; + dxNumberBox(options: DevExpress.ui.dxNumberBoxOptions): JQuery; + dxNavBar(): JQuery; + dxNavBar(options: "instance"): DevExpress.ui.dxNavBar; + dxNavBar(options: string): any; + dxNavBar(options: string, ...params: any[]): any; + dxNavBar(options: DevExpress.ui.dxNavBarOptions): JQuery; + dxMultiView(): JQuery; + dxMultiView(options: "instance"): DevExpress.ui.dxMultiView; + dxMultiView(options: string): any; + dxMultiView(options: string, ...params: any[]): any; + dxMultiView(options: DevExpress.ui.dxMultiViewOptions): JQuery; + dxMap(): JQuery; + dxMap(options: "instance"): DevExpress.ui.dxMap; + dxMap(options: string): any; + dxMap(options: string, ...params: any[]): any; + dxMap(options: DevExpress.ui.dxMapOptions): JQuery; + dxLookup(): JQuery; + dxLookup(options: "instance"): DevExpress.ui.dxLookup; + dxLookup(options: string): any; + dxLookup(options: string, ...params: any[]): any; + dxLookup(options: DevExpress.ui.dxLookupOptions): JQuery; + dxLoadPanel(): JQuery; + dxLoadPanel(options: "instance"): DevExpress.ui.dxLoadPanel; + dxLoadPanel(options: string): any; + dxLoadPanel(options: string, ...params: any[]): any; + dxLoadPanel(options: DevExpress.ui.dxLoadPanelOptions): JQuery; + dxLoadIndicator(): JQuery; + dxLoadIndicator(options: "instance"): DevExpress.ui.dxLoadIndicator; + dxLoadIndicator(options: string): any; + dxLoadIndicator(options: string, ...params: any[]): any; + dxLoadIndicator(options: DevExpress.ui.dxLoadIndicatorOptions): JQuery; + dxList(): JQuery; + dxList(options: "instance"): DevExpress.ui.dxList; + dxList(options: string): any; + dxList(options: string, ...params: any[]): any; + dxList(options: DevExpress.ui.dxListOptions): JQuery; + dxGallery(): JQuery; + dxGallery(options: "instance"): DevExpress.ui.dxGallery; + dxGallery(options: string): any; + dxGallery(options: string, ...params: any[]): any; + dxGallery(options: DevExpress.ui.dxGalleryOptions): JQuery; + dxDropDownEditor(): JQuery; + dxDropDownEditor(options: "instance"): DevExpress.ui.dxDropDownEditor; + dxDropDownEditor(options: string): any; + dxDropDownEditor(options: string, ...params: any[]): any; + dxDropDownEditor(options: DevExpress.ui.dxDropDownEditorOptions): JQuery; + dxDateBox(): JQuery; + dxDateBox(options: "instance"): DevExpress.ui.dxDateBox; + dxDateBox(options: string): any; + dxDateBox(options: string, ...params: any[]): any; + dxDateBox(options: DevExpress.ui.dxDateBoxOptions): JQuery; + dxCheckBox(): JQuery; + dxCheckBox(options: "instance"): DevExpress.ui.dxCheckBox; + dxCheckBox(options: string): any; + dxCheckBox(options: string, ...params: any[]): any; + dxCheckBox(options: DevExpress.ui.dxCheckBoxOptions): JQuery; + dxBox(): JQuery; + dxBox(options: "instance"): DevExpress.ui.dxBox; + dxBox(options: string): any; + dxBox(options: string, ...params: any[]): any; + dxBox(options: DevExpress.ui.dxBoxOptions): JQuery; + dxButton(): JQuery; + dxButton(options: "instance"): DevExpress.ui.dxButton; + dxButton(options: string): any; + dxButton(options: string, ...params: any[]): any; + dxButton(options: DevExpress.ui.dxButtonOptions): JQuery; + dxCalendar(): JQuery; + dxCalendar(options: "instance"): DevExpress.ui.dxCalendar; + dxCalendar(options: string): any; + dxCalendar(options: string, ...params: any[]): any; + dxCalendar(options: DevExpress.ui.dxCalendarOptions): JQuery; + dxAccordion(): JQuery; + dxAccordion(options: "instance"): DevExpress.ui.dxAccordion; + dxAccordion(options: string): any; + dxAccordion(options: string, ...params: any[]): any; + dxAccordion(options: DevExpress.ui.dxAccordionOptions): JQuery; + dxResponsiveBox(): JQuery; + dxResponsiveBox(options: "instance"): DevExpress.ui.dxResponsiveBox; + dxResponsiveBox(options: string): any; + dxResponsiveBox(options: string, ...params: any[]): any; + dxResponsiveBox(options: DevExpress.ui.dxResponsiveBoxOptions): JQuery; + dxAutocomplete(): JQuery; + dxAutocomplete(options: "instance"): DevExpress.ui.dxAutocomplete; + dxAutocomplete(options: string): any; + dxAutocomplete(options: string, ...params: any[]): any; + dxAutocomplete(options: DevExpress.ui.dxAutocompleteOptions): JQuery; +} + +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; + } + 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 that is small enough for the layout to begin adapting. */ + width?: number; + /** Specifies the height of the widget that is small enough for the layout to begin adapting. */ + height?: number; + /** Specifies whether or not point labels can be hidden when the layout is adapting. */ + keepLabels?: boolean; + }; + /** Specifies animation options. */ + animation?: ChartAnimation; + /** Specifies a callback function that returns an object with options for a specific point label. */ + customizeLabel?: (labelInfo: Object) => Object; + /** Specifies a callback function that returns an object with options for a specific point. */ + customizePoint?: (pointInfo: Object) => Object; + /** Specifies a data source for the chart. */ + dataSource?: any; + 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; +} \ No newline at end of file diff --git a/devextreme/devextreme.d.ts b/devextreme/devextreme.d.ts index fc593db20..e0777077c 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.2.4 // Project: http://js.devexpress.com/ // Definitions by: DevExpress Inc. // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -69,9 +69,7 @@ declare module DevExpress { 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 { } @@ -128,6 +126,8 @@ declare module DevExpress { leave(elements: JQuery, animation: any): void; /** Starts all the animations registered using the enter(elements, animation) and leave(elements, animation) methods beforehand. */ start(config: Object): JQueryPromise; + /** Stops all started animations. */ + stop(): void; } export class AnimationPresetCollection { /** Resets all the changes made in the animation repository. */ @@ -163,8 +163,8 @@ declare module DevExpress { 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; + /** Indicates whether or not the device platform is Windows. */ + win?: boolean; /** Specifies a performance grade of the current device. */ grade?: string; } @@ -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. */ @@ -258,16 +262,6 @@ declare module DevExpress { 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. */ @@ -306,16 +300,6 @@ declare module DevExpress { } /** 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; @@ -446,9 +430,6 @@ declare module DevExpress { /** 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. */ @@ -579,6 +560,7 @@ declare module DevExpress { /** A function used to customize a web request before it is sent. */ beforeSend?: (request: { url: string; + async: boolean; method: string; timeout: number; params: Object; @@ -589,6 +571,8 @@ declare module DevExpress { jsonp?: boolean; /** Specifies the type of the ODataStore key property. The following key types are supported out of the box: String, Int32, Int64, and Guid. */ keyType?: any; + /** Specifies whether or not dates found in the response are deserialized. */ + deserializeDates?: boolean; /** Specifies the URL of the data service being accessed via the current ODataContext. */ url?: string; /** Specifies the version of the OData protocol used to interact with the data service. */ @@ -710,26 +694,16 @@ declare module DevExpress { 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. */ @@ -770,7 +744,6 @@ declare module DevExpress { 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. */ @@ -783,7 +756,6 @@ declare module DevExpress { 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. */ @@ -831,6 +803,10 @@ declare module DevExpress { export var utils: { /** Sets parameters for the viewport meta tag. */ initMobileViewport(options: { allowZoom?: boolean; allowPan?: boolean; allowSelection?: boolean }): void; + /** Requests that the browser call a specified function to update animation before the next repaint. */ + requestAnimationFrame(callback: Function): number; + /** Cancels an animation frame request scheduled with the requestAnimationFrame method. */ + cancelAnimationFrame(requestID: number): void; }; /** An object that serves as a namespace for DevExtreme Data Visualization Widgets. */ export module viz { @@ -923,6 +899,8 @@ declare module DevExpress.ui { displayValue?: string; /** The minimum number of characters that must be entered into the text box to begin a search. */ minSearchLength?: number; + /** Specifies whether or not the widget displays unfiltered values until a user types a number of characters exceeding the minSearchLength option value. */ + showDataBeforeSearch?: boolean; /** Specifies the name of a data source item field or an expression whose value is compared to the search criterion. */ searchExpr?: Object; /** Specifies the binary operation used to filter data. */ @@ -954,7 +932,6 @@ declare module DevExpress.ui { 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. */ @@ -978,6 +955,10 @@ declare module DevExpress.ui { type?: string; width?: any; closeOnBackButton?: boolean; + /** A Boolean value specifying whether or not the toast is closed if a user swipes it out of the screen boundaries. */ + closeOnSwipe?: boolean; + /** A Boolean value specifying whether or not the toast is closed if a user clicks it. */ + closeOnClick?: boolean; } /** The toast message widget. */ export class dxToast extends dxOverlay { @@ -987,37 +968,26 @@ declare module DevExpress.ui { 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. */ @@ -1032,9 +1002,7 @@ declare module DevExpress.ui { 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; @@ -1044,6 +1012,8 @@ declare module DevExpress.ui { maskRules?: Object; /** A message displayed when the entered text does not match the specified pattern. */ maskInvalidMessage?: string; + /** Specifies whether the value option holds only characters entered by a user or prompt characters as well. */ + useMaskedValue?: boolean; } /** A base class for text editing widgets. */ export class dxTextEditor extends Editor { @@ -1096,9 +1066,14 @@ declare module DevExpress.ui { 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 Boolean value specifying if the list is scrolled by content. */ + scrollByContent?: boolean; + /** A Boolean value specifying whether to enable or disable scrolling. */ + scrollingEnabled?: boolean; + /** A Boolean value that specifies the availability of navigation buttons. */ + showNavButtons?: boolean; } /** A widget used to display a view and to switch between several views by clicking the appropriate tabs. */ export class dxTabPanel extends dxMultiView { @@ -1106,6 +1081,8 @@ declare module DevExpress.ui { constructor(element: Element, options?: dxTabPanelOptions); } export interface dxSelectBoxOptions extends dxDropDownListOptions { + /** Specifies DOM event names that update a widget's value. */ + valueChangeEvent?: string; /** The template to be used for rendering the widget text field. */ fieldTemplate?: any; /** The text that is provided as a hint in the select box editor. */ @@ -1121,6 +1098,8 @@ declare module DevExpress.ui { export interface dxTagBoxOptions extends dxSelectBoxOptions { /** Holds the list of selected values. */ values?: Array; + /** A read-only option that holds the last selected value. */ + value?: Object; } /** A widget that allows you to select multiple items from a dropdown list. */ export class dxTagBox extends dxSelectBox { @@ -1130,14 +1109,12 @@ declare module DevExpress.ui { 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. */ @@ -1167,12 +1144,10 @@ declare module DevExpress.ui { 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. */ @@ -1216,6 +1191,7 @@ declare module DevExpress.ui { update(): void; } export interface dxRadioGroupOptions extends CollectionWidgetOptions, DataExpressionMixinOptions { + activeStateEnabled?: boolean; /** Specifies the radio group layout. */ layout?: string; } @@ -1289,12 +1265,24 @@ declare module DevExpress.ui { resizeEnabled?: boolean; /** The height of the widget in pixels. */ height?: any; + /** Specifies the maximum height the widget can reach while resizing. */ + maxHeight?: any; + /** Specifies the maximum width the widget can reach while resizing. */ + maxWidth?: any; + /** Specifies the minimum height the widget can reach while resizing. */ + minHeight?: any; + /** Specifies the minimum width the widget can reach while resizing. */ + minWidth?: any; /** A handler for the hidden event. */ onHidden?: Function; - hiddenAction?: Function; + /** A handler for the resizeStart event. */ + onResizeStart?: Function; + /** A handler for the resize event. */ + onResize?: Function; + /** A handler for the resizeEnd event. */ + onResizeEnd?: Function; /** A handler for the hiding event. */ onHiding?: Function; - 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. */ @@ -1303,10 +1291,8 @@ declare module DevExpress.ui { 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. */ @@ -1375,7 +1361,6 @@ declare module DevExpress.ui { 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; @@ -1384,11 +1369,10 @@ declare module DevExpress.ui { }; /** 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; + 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 +1384,26 @@ declare module DevExpress.ui { } /** 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; + width?: any; /** The zoom level of the map. */ zoom?: number; } @@ -1435,7 +1414,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. */ @@ -1459,7 +1438,6 @@ declare module DevExpress.ui { 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. */ @@ -1468,7 +1446,6 @@ declare module DevExpress.ui { 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. */ @@ -1485,14 +1462,12 @@ declare module DevExpress.ui { 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. */ @@ -1516,8 +1491,6 @@ declare module DevExpress.ui { 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. */ @@ -1564,7 +1537,6 @@ declare module DevExpress.ui { 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; @@ -1572,20 +1544,16 @@ declare module DevExpress.ui { 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. */ @@ -1594,14 +1562,12 @@ declare module DevExpress.ui { 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. */ @@ -1614,7 +1580,6 @@ declare module DevExpress.ui { 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. */ @@ -1626,6 +1591,7 @@ declare module DevExpress.ui { /** Specifies item selection mode. */ selectionMode?: string; selectAllText?: string; + onSelectAllChanged?: Function; /** Specifies the array of items for a context menu called for a list item. */ menuItems?: Array; /** Specifies whether an item context menu is shown when a user holds or swipes an item. */ @@ -1733,17 +1699,13 @@ declare module DevExpress.ui { 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; + activeStateEnabled?: boolean; } /** A drop-down editor widget. */ export class dxDropDownEditor extends dxTextBox { @@ -1791,6 +1753,10 @@ declare module DevExpress.ui { minZoomLevel?: string; /** Specifies the type of date/time picker. */ pickerType?: string; + /** Specifies the message displayed if the typed value is not a valid date or time. */ + invalidDateMessage?: string; + /** Specifies the message displayed if the specified date is later than the max value or earlier than the min value. */ + dateOutOfRangeMessage?: string; } /** A date box widget. */ export class dxDateBox extends dxDropDownEditor { @@ -1798,6 +1764,7 @@ declare module DevExpress.ui { constructor(element: Element, options?: dxDateBoxOptions); } export interface dxCheckBoxOptions extends EditorOptions { + activeStateEnabled?: boolean; /** Specifies the widget state. */ value?: boolean; /** Specifies the text displayed by the check box. */ @@ -1809,6 +1776,7 @@ declare module DevExpress.ui { constructor(element: Element, options?: dxCheckBoxOptions); } export interface dxCalendarOptions extends EditorOptions { + activeStateEnabled?: boolean; /** Specifies a date displayed on the current calendar page. */ currentDate?: Date; /** Specifies the first day of a week. */ @@ -1838,7 +1806,6 @@ declare module DevExpress.ui { 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; @@ -1976,6 +1943,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 { @@ -2009,6 +1978,7 @@ declare module DevExpress.ui { constructor(element: Element, options?: dxProgressBarOptions); } export interface dxSliderOptions extends dxTrackBarOptions { + activeStateEnabled?: boolean; /** The slider step size. */ step?: number; /** The current slider value. */ @@ -2054,6 +2024,135 @@ declare module DevExpress.ui { constructor(element: JQuery, options?: dxRangeSliderOptions); constructor(element: Element, options?: dxRangeSliderOptions); } + export interface dxFormItemLabel { + /** Specifies the label text. */ + text?: string; + /** Specifies whether or not the label is visible. */ + visible?: boolean; + /** Specifies whether or not a colon is displayed at the end of the current label. */ + showColon?: boolean; + /** Specifies the location of a label against the editor. */ + location?: string; + /** Specifies the label horizontal alignment. */ + alignment?: string; + } + export interface dxFormItem { + /** Specifies the type of the current item. */ + itemType?: string; + /** Specifies whether or not the current form item is visible. */ + visible?: boolean; + /** Specifies the sequence number of the item in a form, group or tab. */ + visibleIndex?: number; + /** Specifies a CSS class to be applied to the form item. */ + cssClass?: string; + /** Specifies the number of columns spanned by the item. */ + colSpan?: number; + } + export interface dxFormSimpleItem extends dxFormItem { + /** Specifies the path to the formData object field bound to the current form item. */ + dataField?: string; + /** Specifies the form item name. */ + name?: string; + /** Specifie which editor widget is used to display and edit the form item value. */ + editorType?: string; + /** Specifies configuration options for the editor widget of the current form item. */ + editorOptions?: Object; + /** A template to be used for rendering the form item. */ + template?: any; + /** Specifies the help text displayed for the current form item. */ + helpText?: string; + /** Specifies whether the current form item is required. */ + isRequired?: boolean; + /** Specifies options for the form item label. */ + label?: dxFormItemLabel; + /** An array of validation rules to be checked for the form item editor. */ + validationRules?: Array; + } + export interface dxFormGroupItem extends dxFormItem { + /** Specifies the group caption. */ + caption?: string; + /** A template to be used for rendering the group item. */ + template?: any; + /** The count of columns in the group layout. */ + colCount?: number; + /** Specifies whether or not all group item labels are aligned. */ + alignItemLabels?: boolean; + /** Holds an array of form items displayed within the group. */ + items?: Array; + } + export interface dxFormTab { + /** Specifies the tab title. */ + title?: string; + /** The count of columns in the tab layout. */ + colCount?: number; + /** Specifies whether or not labels of items displayed within the current tab are aligned. */ + alignItemLabels?: boolean; + /** Holds an array of form items displayed within the tab. */ + items?: Array; + } + export interface dxFormTabbedItem extends dxFormItem { + /** Holds a configuration object for the dxTabPanel widget used to display the current form item. */ + tabPanelOptions?: Object; + /** An array of tab configuration objects. */ + tabs?: Array; + } + export interface dxFormOptions extends WidgetOptions { + /** An object providing data for the form. */ + formData?: Object; + /** The count of columns in the form layout. */ + colCount?: any; + /** Specifies the location of a label against the editor. */ + labelLocation?: string; + /** Specifies whether or not all editors on the form are read-only. */ + readOnly?: boolean; + /** A handler for the fieldDataChanged event. */ + onFieldDataChanged?: (e: Object) => void; + /** A handler for the editorEnterKey event. */ + onEditorEnterKey?: (e: Object) => void; + /** Specifies a function that customizes a form item after it has been created. */ + customizeItem?: Function; + /** The minimum column width used for calculating column count in the form layout. */ + minColWidth?: number; + /** Specifies whether or not all root item labels are aligned. */ + alignItemLabels?: boolean; + /** Specifies whether or not item labels in all groups are aligned. */ + alignItemLabelsInAllGroups?: boolean; + /** Specifies whether or not a colon is displayed at the end of form labels. */ + showColonAfterLabel?: boolean; + /** Specifies whether or not the required mark is displayed for optional fields. */ + showRequiredMark?: boolean; + /** Specifies whether or not the optional mark is displayed for optional fields. */ + showOptionalMark?: boolean; + /** The text displayed for required fields. */ + requiredMark?: string; + /** The text displayed for optional fields. */ + optionalMark?: string; + /** Specifies whether or not the total validation summary is displayed on the form. */ + showValidationSummary?: boolean; + /** Holds an array of form items. */ + items?: Array; + /** A Boolean value specifying whether to enable or disable form scrolling. */ + scrollingEnabled?: boolean; + } + /** A form widget used to display and edit values of object fields. */ + export class dxForm extends Widget { + constructor(element: JQuery, options?: dxFormOptions); + constructor(element: Element, options?: dxFormOptions); + /** Updates the specified field of the formData object and the corresponding editor on the form. */ + updateData(dataField: string, value: any): void; + /** Updates the specified fields of the formData object and the corresponding editors on the form. */ + updateData(data: Object): void; + /** Updates the value of a form item option. */ + itemOption(field: string, option: string, value: any): void; + /** Updates the values of form item options. */ + itemOption(field: string, options: Object): void; + /** Returns an editor instance associated with the specified formData field. */ + getEditor(field: string): Object; + /** Updates the dimensions of the widget contents. */ + updateDimensions(): JQueryPromise; + /** Validates the values of all editors on the form against the list of the validation rules specified for each form item. */ + validate(): Object; + } } interface JQuery { dxProgressBar(): JQuery; @@ -2145,6 +2244,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; @@ -2265,6 +2369,11 @@ interface JQuery { dxAutocomplete(options: string): any; dxAutocomplete(options: string, ...params: any[]): any; dxAutocomplete(options: DevExpress.ui.dxAutocompleteOptions): JQuery; + dxForm(): JQuery; + dxForm(options: "instance"): DevExpress.ui.dxForm; + dxForm(options: string): any; + dxForm(options: string, ...params: any[]): any; + dxForm(options: DevExpress.ui.dxForm): JQuery; } declare module DevExpress.ui { @@ -2275,6 +2384,8 @@ declare module DevExpress.ui { baseItemHeight?: number; /** Specifies the width of the base tile view item. */ baseItemWidth?: number; + /** Specifies whether tiles are placed horizontally or vertically. */ + direction?: string; /** Specifies the height of the widget. */ height?: any; /** Specifies the distance in pixels between adjacent tiles. */ @@ -2290,6 +2401,7 @@ declare module DevExpress.ui { scrollPosition(): number; } export interface dxSwitchOptions extends EditorOptions { + activeStateEnabled?: boolean; /** Text displayed when the widget is in a disabled state. */ offText?: string; /** Text displayed when the widget is in an enabled state. */ @@ -2303,6 +2415,8 @@ declare module DevExpress.ui { constructor(element: Element, options?: dxSwitchOptions); } export interface dxSlideOutViewOptions extends WidgetOptions { + /** Specifies the current menu position. */ + menuPosition?: string; /** Specifies whether or not the menu panel is visible. */ menuVisible?: boolean; /** Specifies whether or not the menu is shown when a user swipes the widget content. */ @@ -2332,10 +2446,10 @@ declare module DevExpress.ui { activeStateEnabled?: boolean; /** A Boolean value specifying whether or not to display a grouped menu. */ menuGrouped?: boolean; - menuGroupRender?: any; + /** Specifies the current menu position. */ + menuPosition?: string; /** 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. */ @@ -2398,18 +2512,15 @@ declare module DevExpress.ui { 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; + buttonIconSrc?: string; /** A data source used to fetch data to be displayed by the widget. */ dataSource?: any; /** A handler for the itemClick event. */ onItemClick?: any; - itemClickAction?: any; - itemRender?: any; /** An array of items displayed by the widget. */ items?: Array; /** The template to be used for rendering items. */ @@ -2422,8 +2533,8 @@ declare module DevExpress.ui { 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; + activeStateEnabled?: boolean; } /** A drop-down menu widget. */ export class dxDropDownMenu extends Widget { @@ -2436,7 +2547,6 @@ declare module DevExpress.ui { 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. */ @@ -2529,7 +2639,7 @@ declare module DevExpress.data { 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. */ + /** Specifies how to aggregate field data. Cannot be used for the XmlaStore store type. */ summaryType?: string; /** Allows you to use a custom aggregate function to calculate the summary values. Cannot be used for the XmlaStore store type. */ calculateCustomSummary?: (options: { @@ -2583,18 +2693,60 @@ declare module DevExpress.data { allowExpandAll?: boolean; /** Specifies the absolute width of the field in the pivot grid. */ width?: number; + /** Specifies the summary post-processing algorithm. */ + summaryDisplayMode?: string; + /** Specifies whether to summarize each next summary value with the previous one by rows or columns. */ + runningTotal?: string; + /** Specifies whether to allow the predefined summary post-processing functions ('absoluteVariation' and 'percentVariation') and runningTotal to take values of different groups into account. */ + allowCrossGroupCalculation?: boolean; + /** Specifies a callback function that allows you to modify summary values after they are calculated. */ + calculateSummaryValue?: (e: Object) => number; + /** Specifies whether or not to display Total values for the field. */ + showTotals?: boolean; + /** Specifies whether or not to display Grand Total values for the field. */ + showGrandTotals?: boolean; + } + export class SummaryCell { + /** Gets the parent cell in a specified direction. */ + parent(direction: string): SummaryCell; + /** Gets all children cells in a specified direction. */ + children(direction: string): Array; + /** Gets a partial Grand Total cell of a row or column. */ + grandTotal(direction: string): SummaryCell; + /** Gets the Grand Total of the entire pivot grid. */ + grandTotal(): SummaryCell; + /** Gets the cell next to the current one in a specified direction. */ + next(direction: string): SummaryCell; + /** Gets the cell next to current in a specified direction. */ + next(direction: string, allowCrossGroup: boolean): SummaryCell; + /** Gets the cell prior to the current one in a specified direction. */ + prev(direction: string): SummaryCell; + /** Gets the cell previous to current in a specified direction. */ + prev(direction: string, allowCrossGroup: boolean): SummaryCell; + /** Gets the child cell in a specified direction. */ + child(direction: string, fieldValue: any): SummaryCell; + /** Gets the cell located by the path of the source cell with one field value changed. */ + slice(field: PivotGridField, value: any): SummaryCell; + /** Gets the header cell of a row or column field to which the current cell belongs. */ + field(area: string): PivotGridField; + /** Gets the value of the current cell. */ + value(): any; + /** Gets the value of the current cell. */ + value(isCalculatedValue: boolean): any; + /** Gets the value of any field linked with the current cell. */ + value(field: PivotGridField): any; + /** Gets the value of any field linked with the current cell. */ + value(field: PivotGridField, isCalculatedValue: boolean): any; } export interface PivotGridDataSourceOptions { /** Specifies the underlying Store instance used to access data. */ store?: any; /** Indicates whether or not the automatic field generation from data in the Store is enabled. */ retrieveFields?: boolean; - /** Specifies data filtering conditions. */ + /** Specifies data filtering conditions. Cannot be used for the XmlaStore store type. */ 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. */ @@ -2607,7 +2759,9 @@ declare module DevExpress.data { /** An object that provides access to data for the dxPivotGrid widget. */ export class PivotGridDataSource implements EventsMixin { constructor(options?: PivotGridDataSource); - /** Starts loading data. */ + /** Starts reloading data from any store and updating the data source. */ + reload(): JQueryPromise; + /** Starts updating the data source. Reloads data from the XMLA store only. */ load(): JQueryPromise; /** Indicates whether or not the PivotGridDataSource is currently being loaded. */ isLoading(): boolean; @@ -2633,6 +2787,22 @@ declare module DevExpress.data { collapseAll(id: any): void; /** Disposes of all resources associated with this PivotGridDataSource. */ dispose(): void; + /** Gets the current filter expression. Cannot be used for the XmlaStore store type. */ + filter(): Object; + /** Applies a new filter expression. Cannot be used for the XmlaStore store type. */ + filter(filterExpr: Object): void; + /** Provides access to a list of records (facts) that were used to calculate a specific summary. */ + createDrillDownDataSource(options: { + columnPath?: Array; + rowPath?: Array; + dataIndex?: number; + maxRowCount?: number; + customColumns?: Array; + }): DevExpress.data.DataSource; + /** Gets the current PivotGridDataSource state (fields configuration, sorting, filters, expanded headers, etc.) */ + state(): Object; + /** Sets the PivotGridDataSource state. */ + state(state: Object): void; on(eventName: string, eventHandler: Function): PivotGridDataSource; on(events: { [eventName: string]: Function; }): PivotGridDataSource; off(eventName: string): PivotGridDataSource; @@ -2655,6 +2825,8 @@ declare module DevExpress.ui { firstDayOfWeek?: number; /** The template to be used for rendering appointments. */ appointmentTemplate?: any; + /** The template to be used for rendering an appointment tooltip. */ + appointmentTooltipTemplate?: any; /** Lists the views to be available within the scheduler's View Selector. */ views?: Array; /** Specifies the resource kinds by which the scheduler's appointments are grouped in a timetable. */ @@ -2663,14 +2835,36 @@ declare module DevExpress.ui { 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 whether or not the "All-day" panel is visible. */ + showAllDayPanel?: boolean; + /** Specifies cell duration in minutes. */ + cellDuration?: number; + /** Specifies the edit mode for recurrent appointments. */ + recurrenceEditMode?: string; + /** Specifies which editing operations an end-user can perform on appointments. */ + editing?: { + /** Specifies whether or not an end-user can add appointments. */ + allowAdding?: boolean; + /** Specifies whether or not an end-user can change appointment options. */ + allowUpdating?: boolean; + /** Specifies whether or not an end-user can delete appointments. */ + allowDeleting?: boolean; + /** Specifies whether or not an end-user can change an appointment duration. */ + allowResizing?: boolean; + /** Specifies whether or not an end-user can drag appointments. */ + allowDragging?: boolean; + } /** Specifies an array of resources available in the scheduler. */ resources?: Array<{ /** Indicates whether or not several resources of this kind can be assigned to an appointment. */ allowMultiple?: boolean; - /** Indicates whether or not resources of this kind have priority in the color identification of the appointments that have resources of different kinds assigned. */ + /** + * Indicates whether or not resources of this kind have priority in the color identification of the appointments that have resources of different kinds assigned. + * @deprecated Use the 'useColorAsDefault' property instead + */ mainColor?: boolean; + /** Indicates whether or not resources of this kind have priority in the color identification of the appointments that have resources of different kinds assigned. */ + useColorAsDefault?: boolean; /** A data source used to fetch resources to be available in the scheduler. */ dataSource?: any; /** Specifies the resource object field whose value is displayed by the Resource editor in the Appointment popup window. */ @@ -2696,6 +2890,18 @@ declare module DevExpress.ui { onAppointmentDeleted?: Function; /** A handler for the appointmentRendered event. */ onAppointmentRendered?: Function; + /** A handler for the appointmentClick event. */ + onAppointmentClick?: any; + /** A handler for the appointmentDblClick event. */ + onAppointmentDblClick?: any; + /** A handler for the cellClick event. */ + onCellClick?: any; + /** A handler for the appointmentFormCreated event. */ + onAppointmentFormCreated?: Function; + /** Specifies whether or not an end-user can scroll the view horizontally. */ + horizontalScrollingEnabled?: boolean; + /** Specifies whether a user can switch views using tabs or a drop-down menu. */ + useDropDownViewSwitcher?: boolean; } /** A widget that displays scheduled data using different views and provides the capability to load, add and edit appointments. */ export class dxScheduler extends Widget { @@ -2709,6 +2915,8 @@ declare module DevExpress.ui { deleteAppointment(appointment: Object): void; /** Scrolls the scheduler work space to the specified time. */ scrollToTime(hours: number, minutes: number): void; + /** Displays the Appointment Details popup. */ + showAppointmentPopup(appointmentData: Object, createNewAppointment?: boolean): void; } export interface dxColorBoxOptions extends dxDropDownEditorOptions { /** Specifies the text displayed on the button that applies changes and closes the drop-down editor. */ @@ -2726,55 +2934,53 @@ declare module DevExpress.ui { 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 HierarchicalCollectionWidgetOptions extends CollectionWidgetOptions { + /** Specifies the name of the data source item field whose value is displayed by the widget. */ + displayExpr?: any; + /** Specifies the name of the data source item field used as a key. */ + keyExpr?: any; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding widget items is selected. */ + selectedExpr?: any; + /** Specifies the name of the data source item field that contains an array of nested items. */ + itemsExpr?: any; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding widget item is disabled. */ + disabledExpr?: any; + /** Specifies the name of the data source item field that holds the key of the parent item. */ + parentIdExpr?: any; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding widget items is expanded. */ + expandedExpr?: any; + hoverStateEnabled?: boolean; + focusStateEnabled?: boolean; } - export interface dxTreeViewOptions extends CollectionWidgetOptions { + export class HierarchicalCollectionWidget extends CollectionWidget { + } + export interface dxTreeViewOptions extends HierarchicalCollectionWidgetOptions { /** Specifies whether or not to animate item collapsing and expanding. */ animationEnabled?: boolean; /** Specifies whether a nested or plain array is used as a data source. */ dataStructure?: string; /** Specifies whether or not a user can expand all tree view items by the "*" hot key. */ expandAllEnabled?: boolean; - /** - * 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 the current check boxes display mode. */ + showCheckBoxesMode?: string; /** Specifies whether or not to select nodes recursively. */ selectNodesRecursive?: boolean; + /** Specifies whether or not all parent nodes of an initially expanded node are displayed expanded. */ + expandNodesRecursive?: boolean; /** Specifies whether the "Select All" check box is displayed over the tree view. */ 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; + /** Specifies the current value used to filter tree view items. */ + searchValue?: string; /** A string value specifying available scrolling directions. */ scrollDirection?: string; /** A handler for the itemSelected event. */ @@ -2787,11 +2993,9 @@ declare module DevExpress.ui { onItemContextMenu?: Function; onItemRendered?: Function; onItemHold?: Function; - hoverStateEnabled?: boolean; - focusStateEnabled?: boolean; } /** A widget displaying specified data items as a tree. */ - export class dxTreeView extends CollectionWidget { + export class dxTreeView extends HierarchicalCollectionWidget { constructor(element: JQuery, options?: dxTreeViewOptions); constructor(element: Element, options?: dxTreeViewOptions); /** Updates the tree view scrollbars according to the current size of the widget content. */ @@ -2811,7 +3015,7 @@ declare module DevExpress.ui { /** Unselects all widget items. */ unselectAll(): void; } - export interface dxMenuBaseOptions extends CollectionWidgetOptions { + export interface dxMenuBaseOptions extends HierarchicalCollectionWidgetOptions { /** An object that defines the animation options of the widget. */ animation?: fx.AnimationOptions; /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ @@ -2836,10 +3040,8 @@ declare module DevExpress.ui { 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 { + export class dxMenuBase extends HierarchicalCollectionWidget { constructor(element: JQuery, options?: dxMenuBaseOptions); constructor(element: Element, options?: dxMenuBaseOptions); /** Selects the specified item. */ @@ -2868,16 +3070,12 @@ declare module DevExpress.ui { 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 { @@ -2929,6 +3127,10 @@ declare module DevExpress.ui { paging?: boolean; /** Specifies whether or not sorting must be performed on the server side. */ sorting?: boolean; + /** Specifies whether or not grouping must be performed on the server side. */ + grouping?: boolean; + /** Specifies whether or not summaries calculation must be performed on the server side. */ + summary?: boolean; } export interface dxDataGridColumn { /** Specifies the content alignment within column cells. */ @@ -2937,6 +3139,8 @@ declare module DevExpress.ui { allowEditing?: boolean; /** Specifies whether or not a column can be used for filtering grid records. Setting this option makes sense only when the filter row and column header filtering are visible. */ allowFiltering?: boolean; + /** Specifies whether or not to allow filtering by this column using its header. */ + allowHeaderFiltering?: boolean; /** Specifies whether or not the column can be anchored to a grid edge by end users. Setting this option makes sense only when the columnFixing | enabled option is set to true. */ allowFixing?: boolean; /** Specifies if a column can be used for searching grid records. Setting this option makes sense only when the search panel is visible. */ @@ -2955,14 +3159,18 @@ declare module DevExpress.ui { autoExpandGroup?: boolean; /** Specifies a callback function that returns a value to be displayed in a column cell. */ calculateCellValue?: (rowData: Object) => string; + /** Specifies a callback function to be invoked after the cell value is edited by an end-user and before the new value is saved to the data source. */ + setCellValue?: (rowData: Object, value: any) => void; /** Specifies a callback function that defines filters for customary calculated grid cells. */ - calculateFilterExpression?: (filterValue: any, selectedFilterOperation: string) => Array; + calculateFilterExpression?: (filterValue: any, selectedFilterOperation: string, target: string) => Array; /** Specifies a caption for a column. */ caption?: string; /** Specifies a custom template for grid column cells. */ cellTemplate?: any; /** Specifies a CSS class to be applied to a column. */ cssClass?: string; + /** Specifies how to get a value to be displayed in a cell when it is not in an editing state. */ + calculateDisplayValue?: any; /** Specifies a field name or a function that returns a field name or a value to be used for grouping column cells. */ calculateGroupValue?: any; /** Specifies a field name or a function that returns a field name or a value to be used for sorting column cells. */ @@ -2975,6 +3183,8 @@ declare module DevExpress.ui { dataType?: string; /** Specifies a custom template for the cell of a grid column when it is in an editing state. */ editCellTemplate?: any; + /** Specifies configuration options for the editor widget of the current column. */ + editorOptions?: Object; /** Specifies whether HTML tags are displayed as plain text or applied to the values of the column. */ encodeHtml?: boolean; /** In a boolean column, replaces all false items with a specified text. */ @@ -3010,6 +3220,13 @@ declare module DevExpress.ui { /** Specifies the expression defining the data source field whose values must be replaced. */ valueExpr?: string; }; + /** Specifies column-level options for filtering using a column header filter. */ + headerFilter?: { + /** Specifies the data source to be used for header filter. */ + dataSource?: any; + /** Specifies how header filter values should be combined into groups. */ + groupInterval?: any; + }; /** Specifies a precision for formatted values displayed in a column. */ precision?: number; /** Specifies a filter operation applied to a column. */ @@ -3036,9 +3253,8 @@ 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; + /** The form item configuration object. Used only when the editing mode is "form". */ + formItem?: DevExpress.ui.dxFormItem; } export interface dxDataGridOptions extends WidgetOptions { /** Specifies whether the outer borders of the grid are visible or not. */ @@ -3049,40 +3265,30 @@ declare module DevExpress.ui { 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; + onRowInserting?: (e: { data: Object; cancel: 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; + onRowRemoving?: (e: { data: Object; key: any; cancel: 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; + onRowUpdating?: (e: { oldData: Object; newData: Object; key: any; cancel: any }) => void; /** Enables a hint that appears when a user hovers the mouse pointer over a cell with truncated content. */ cellHintEnabled?: boolean; /** Specifies whether or not grid columns can be reordered by a user. */ allowColumnReordering?: boolean; /** Specifies whether or not grid columns can be resized by a user. */ allowColumnResizing?: boolean; - 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. */ @@ -3137,18 +3343,12 @@ declare module DevExpress.ui { /** 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; + /** Specifies whether or not to enable data caching. */ + cacheEnabled?: boolean; /** A handler for the editingStart event. */ onEditingStart?: (e: { data: Object; @@ -3156,27 +3356,31 @@ declare module DevExpress.ui { 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. */ + editEnabled?: boolean; insertEnabled?: boolean; - /** Specifies whether or not records can be deleted from a grid. */ removeEnabled?: boolean; + /** Specifies how grid values can be edited manually. */ + mode?: string; + /** Specifies whether or not grid records can be edited at runtime. */ + allowUpdating?: boolean; + /** Specifies whether or not new grid records can be added at runtime. */ + allowAdding?: boolean; + /** Specifies whether or not grid records can be deleted at runtime. */ + allowDeleting?: boolean; + /** The form configuration object. Used only when the editing mode is "form". */ + form?: DevExpress.ui.dxFormOptions; /** Contains options that specify texts for editing-related grid controls. */ texts?: { /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Save" button. Setting this option makes sense only when the editMode option is set to batch. */ saveAllChanges?: string; - /** Specifies text for a cancel button displayed when a row is in the editing state. Setting this option makes sense only when the editEnabled option is set to true. */ + /** Specifies text for a cancel button displayed when a row is in the editing state. Setting this option makes sense only when the allowUpdating option is set to true. */ cancelRowChanges?: string; /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Revert" button. Setting this option makes sense only when the editMode option is set to batch. */ cancelAllChanges?: string; @@ -3184,15 +3388,17 @@ declare module DevExpress.ui { 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. */ + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Cancel changes" button. Setting this option makes sense only when the editMode option is set to cell and the validation capabilities are enabled. */ + validationCancelChanges?: string; + /** Specifies text for a button that deletes a row from a grid. Setting this option makes sense only when the allowDeleting option is set to true. */ deleteRow?: string; - /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Add" button. Setting this option makes sense only when the insertEnabled option is true. */ + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Add" button. Setting this option makes sense only when the allowAdding option is true. */ addRow?: string; - /** Specifies text for a button that turns a row into the editing state. Setting this option makes sense only when the editEnabled option is set to true. */ + /** Specifies text for a button that turns a row into the editing state. Setting this option makes sense only when the allowUpdating option is set to true. */ editRow?: string; - /** Specifies text for a save button displayed when a row is in the editing state. Setting this option makes sense only when the editEnabled option is set to true. */ + /** Specifies text for a save button displayed when a row is in the editing state. Setting this option makes sense only when the allowUpdating option is set to true. */ saveRowChanges?: string; - /** Specifies text for a button that recovers a deleted row. Setting this option makes sense only if the grid uses the batch edit mode and the removeEnabled option is set to true. */ + /** Specifies text for a button that recovers a deleted row. Setting this option makes sense only if the grid uses the batch edit mode and the allowDeleting option is set to true. */ undeleteRow?: string; }; }; @@ -3219,6 +3425,10 @@ declare module DevExpress.ui { resetOperationText?: string; /** Specifies text for the operation of clearing the applied filter when a select box is used. */ showAllText?: string; + /** Specifies text for the range start in the 'between' filter type. */ + betweenStartText?: string; + /** Specifies text for the range end in the 'between' filter type. */ + betweenEndText?: string; /** Specifies whether or not an icon that allows the user to choose a filter operation is visible. */ showOperationChooser?: boolean; /** Specifies whether the filter row is visible or not. */ @@ -3289,10 +3499,8 @@ declare module DevExpress.ui { }; /** 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. */ @@ -3303,6 +3511,14 @@ declare module DevExpress.ui { mode?: string; /** Specifies whether or not a grid must preload pages adjacent to the current page when using virtual scrolling. */ preloadEnabled?: boolean; + /** Specifies whether or not the widget uses native scrolling. */ + useNative?: any; + /** Specifies the scrollbar display policy. */ + showScrollbar?: string; + /** Specifies whether or not the scrolling by content is enabled. */ + scrollByContent?: boolean; + /** Specifies whether or not the scrollbar thumb scrolling enabled. */ + scrollByThumb?: boolean; }; /** Specifies options of the search panel. */ searchPanel?: { @@ -3367,17 +3583,13 @@ declare module DevExpress.ui { selectedRowKeys?: Array; /** Specifies options of runtime selection. */ selection?: { + /** Specifies the checkbox row display policy in the multiple mode. */ + showCheckBoxesMode?: string; /** Specifies whether the user can select all grid records at once. */ allowSelectAll?: boolean; /** Specifies the selection mode. */ mode?: string; }; - 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. */ @@ -3427,7 +3639,7 @@ declare module DevExpress.ui { /** 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; + customSave?: (state: Object) => void; /** Specifies whether or not a grid saves its state. */ enabled?: boolean; /** Specifies the delay between the last change of a grid state and the operation of saving this state in milliseconds. */ @@ -3546,10 +3758,14 @@ declare module DevExpress.ui { getKeyByRowIndex(rowIndex: number): any; /** Adds a new column to a grid. */ addColumn(columnOptions: dxDataGridColumn): void; + /** Removes the column from the grid. */ + deleteColumn(id: any): void; /** Displays the load panel. */ beginCustomLoading(messageText: string): void; /** Discards changes made in a grid. */ cancelEditData(): void; + /** Checks whether or not the grid contains unsaved changes. */ + hasEditData(): boolean; /** Clears all the filters of a specific type applied to grid records. */ clearFilter(): void; /** Deselects all grid records. */ @@ -3569,9 +3785,19 @@ declare module DevExpress.ui { /** 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; + editCell(rowIndex: number, visibleColumnIndex: number): void; + /** Sets a specific cell into the editing state. */ + editCell(rowIndex: number, dataField: string): void; /** Sets a specific row into the editing state. */ editRow(rowIndex: number): void; + /** Gets the cell value. */ + cellValue(rowIndex: number, dataField: string): any; + /** Gets the cell value. */ + cellValue(rowIndex: number, visibleColumnIndex: number): any; + /** Sets the cell value. */ + cellValue(rowIndex: number, dataField: string, value: any): void; + /** Sets the cell value. */ + cellValue(rowIndex: number, visibleColumnIndex: number, value: any): void; /** Hides the load panel. */ endCustomLoading(): void; /** Expands groups or master rows in a grid. */ @@ -3595,6 +3821,11 @@ declare module DevExpress.ui { /** Hides the column chooser panel. */ hideColumnChooser(): void; /** Adds a new data row to a grid. */ + addRow(): void; + /** + * Adds a new data row to a grid. + * @deprecated Use the addRow() method instead. + */ insertRow(): void; /** Returns the key corresponding to the passed data object. */ keyOf(obj: Object): any; @@ -3609,6 +3840,11 @@ declare module DevExpress.ui { /** Refreshes grid data. */ refresh(): void; /** Removes a specific row from a grid. */ + deleteRow(rowIndex: number): void; + /** + * Removes a specific row from a grid. + * @deprecated Use the deleteRow() method instead. + */ removeRow(rowIndex: number): void; /** Saves changes made in a grid. */ saveEditData(): void; @@ -3648,8 +3884,14 @@ declare module DevExpress.ui { onContentReady?: Function; /** Specifies a data source for the pivot grid. */ dataSource?: any; - /** Specifies whether or not the widget uses native scrolling. */ useNativeScrolling?: any; + /** A configuration object specifying scrolling options. */ + scrolling?: { + /** Specifies the scrolling mode. */ + mode?: string; + /** Specifies whether or not the widget uses native scrolling. */ + useNative?: any; + }; /** Allows an end-user to change sorting options. */ allowSorting?: boolean; /** Allows an end-user to sort columns by summary values. */ @@ -3666,6 +3908,12 @@ declare module DevExpress.ui { showColumnTotals?: boolean; /** Specifies whether to display the Grand Total column. */ showColumnGrandTotals?: boolean; + /** Specifies whether or not to hide rows and columns with no data. */ + hideEmptySummaryCells?: boolean; + /** Specifies where to show the total rows or columns. */ + showTotalsPrior?: string; + /** Specifies whether the outer borders of the grid are visible or not. */ + showBorders?: boolean; /** The Field Chooser configuration options. */ fieldChooser?: { /** Enables or disables the field chooser. */ @@ -3712,6 +3960,8 @@ declare module DevExpress.ui { sortRowBySummary?: string; /** The string to display as a Remove All Sorting context menu item. */ removeAllSorting?: string; + /** The string to display as an Export to Excel file context menu item. */ + exportToExcel?: string; }; /** The Load panel configuration options. */ loadPanel?: { @@ -3736,6 +3986,38 @@ declare module DevExpress.ui { onCellPrepared?: (e: any) => void; /** A handler for the contextMenuPreparing event. */ onContextMenuPreparing?: (e: Object) => void; + /** Specifies options for exporting pivot grid data. */ + export?: { + /** Indicates whether the export feature is enabled for the pivot grid. */ + enabled?: boolean; + /** Specifies a default name for the file to which grid data is exported. */ + fileName?: string; + /** Specifies the URL of the server-side proxy that streams the resulting file to the end user to enable export in IE8, IE9 and Safari browsers. */ + proxyUrl?: string; + }; + /** A handler for the exporting event. */ + onExporting?: (e: { + fileName: string; + format: string; + cancel: boolean; + }) => void; + /** A handler for the exported event. */ + onExported?: (e: Object) => void; + /** A configuration object specifying options related to state storing. */ + stateStoring?: { + /** Specifies a callback function that performs specific actions on state loading. */ + customLoad?: () => JQueryPromise; + /** Specifies a callback function that performs specific actions on state saving. */ + customSave?: (gridState: Object) => void; + /** Specifies whether or not a grid saves its state. */ + enabled?: boolean; + /** Specifies the delay between the last change of a grid state and the operation of saving this state in milliseconds. */ + savingTimeout?: number; + /** Specifies a unique key to be used for storing the grid state. */ + storageKey?: string; + /** Specifies the type of storage to be used for state storing. */ + type?: string; + }; } /** A data summarization widget for multi-dimensional data analysis and data mining. */ export class dxPivotGrid extends Widget { @@ -3743,8 +4025,12 @@ declare module DevExpress.ui { constructor(element: Element, options?: dxPivotGridOptions); /** Gets the PivotGridDataSource instance. */ getDataSource(): DevExpress.data.PivotGridDataSource; + /** Gets the dxPopup instance of the field chooser window. */ + getFieldChooserPopup(): DevExpress.ui.dxPopup; /** Updates the widget to the size of its content. */ updateDimensions(): void; + /** Exports pivot grid data to the Excel file. */ + exportToExcel(): void; } export interface dxPivotGridFieldChooserOptions extends WidgetOptions { /** Specifies the height of the widget. */ @@ -3839,7 +4125,6 @@ declare module DevExpress.framework { 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. */ @@ -3925,6 +4210,8 @@ declare module DevExpress.framework { viewCache?: Object; /** Specifies a limit for the views that can be cached. */ viewCacheSize?: number; + /** Specifies the current version of application templates. */ + templatesVersion?: string; /** Specifies options for the viewport meta tag of a mobile browser. */ viewPort?: JQuery; /** A custom router to be used in the application. */ @@ -3939,6 +4226,7 @@ declare module DevExpress.framework { navigating: JQueryCallback; navigatingBack: JQueryCallback; resolveLayoutController: JQueryCallback; + resolveViewCacheKey: JQueryCallback; viewDisposed: JQueryCallback; viewDisposing: JQueryCallback; viewHidden: JQueryCallback; @@ -4005,6 +4293,11 @@ declare module DevExpress.framework { layoutController: Object; availableLayoutControllers: Array; }) => void): HtmlApplication; + on(eventName: "resolveViewCacheKey", eventHandler: (e: { + key: string; + navigationItem: Object; + routeData: Object; + }) => void): HtmlApplication; on(eventName: "viewDisposed", eventHandler: (e: { viewInfo: Object; }) => void): HtmlApplication; @@ -4033,6 +4326,7 @@ declare module DevExpress.framework { off(eventName: "navigating"): HtmlApplication; off(eventName: "navigatingBack"): HtmlApplication; off(eventName: "resolveLayoutController"): HtmlApplication; + off(eventName: "resolveViewCacheKey"): HtmlApplication; off(eventName: "viewDisposed"): HtmlApplication; off(eventName: "viewDisposing"): HtmlApplication; off(eventName: "viewHidden"): HtmlApplication; @@ -4068,6 +4362,11 @@ declare module DevExpress.framework { layoutController: Object; availableLayoutControllers: Array; }) => void): HtmlApplication; + off(eventName: "resolveViewCacheKey", eventHandler: (e: { + key: string; + navigationItem: Object; + routeData: Object; + }) => void): HtmlApplication; off(eventName: "viewDisposed", eventHandler: (e: { viewInfo: Object; }) => void): HtmlApplication; @@ -4161,13 +4460,13 @@ declare module DevExpress.viz.core { width?: number; } export interface Margins { - /** Specifies the legend's bottom margin in pixels. */ + /** Specifies the distance in pixels between the bottom side of the title and the surrounding widget elements. */ bottom?: number; - /** Specifies the legend's left margin in pixels. */ + /** Specifies the distance in pixels between the left side of the title and the surrounding widget elements. */ left?: number; - /** Specifies the legend's right margin in pixels. */ + /** Specifies the distance between the right side of the title and surrounding widget elements in pixels. */ right?: number; - /** Specifies the legend's bottom margin in pixels. */ + /** Specifies the distance between the top side of the title and surrounding widget elements in pixels. */ top?: number; } export interface Size { @@ -4176,6 +4475,27 @@ declare module DevExpress.viz.core { /** Specifies the height of the widget. */ height?: number; } + export interface Title { + /** Specifies font options for the title. */ + font?: viz.core.Font; + /** Specifies the widget title's horizontal position. */ + horizontalAlignment?: string; + /** Specifies the widget title's position in the vertical direction. */ + verticalAlignment?: string; + /** Specifies the distance between the title and surrounding widget elements in pixels. */ + margin?: viz.core.Margins; + /** Specifies the height of the space reserved for the title. */ + placeholderSize?: number; + /** Specifies text for the title. */ + text?: string; + /** Specifies a subtitle for the widget. */ + subtitle?: { + /** Specifies font options for the subtitle. */ + font?: viz.core.Font; + /** Specifies text for the subtitle. */ + text?: string; + } + } export interface Tooltip { /** Specifies the length of the tooltip's arrow in pixels. */ arrowLength?: number; @@ -4185,6 +4505,7 @@ declare module DevExpress.viz.core { color?: string; /** Specifies the z-index for tooltips. */ zIndex?: number; + /** Specifies the container to draw tooltips inside of it. */ container?: any; /** Specifies text and appearance of a set of tooltips. */ customizeTooltip?: (arg: Object) => { color?: string; text?: string }; @@ -4275,32 +4596,23 @@ declare module DevExpress.viz.core { 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; - } + 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; @@ -4326,11 +4638,6 @@ declare module DevExpress.viz.charts { 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. */ @@ -4345,6 +4652,20 @@ declare module DevExpress.viz.charts { getAllPoints(): Array; /** Returns visible series points. */ getVisiblePoints(): Array; + /** Returns the name of the series. */ + name: string; + /** Returns the tag of the series. */ + tag: string; + /** Hides a series. */ + hide(): void; + /** Provides information about the hover state of a series. */ + isHovered(): boolean; + /** Provides information about the selection state of a series. */ + isSelected(): boolean; + /** Provides information about the visibility state of a series. */ + isVisible(): boolean; + /** Makes a particular series visible. */ + show(): void; } /** This section describes the methods that can be used in code to manipulate the Point object. */ export interface BasePoint { @@ -4363,9 +4684,9 @@ declare module DevExpress.viz.charts { /** Hides the tooltip of the point. */ hideTooltip(): void; /** Provides information about the hover state of a point. */ - isHovered(): any; + isHovered(): boolean; /** Provides information about the selection state of a point. */ - isSelected(): any; + isSelected(): boolean; /** Selects the point. The point is displayed in a 'selected' style until another point is selected or the current point is deselected programmatically. */ select(): void; /** Shows the tooltip of the point. */ @@ -4381,20 +4702,6 @@ declare module DevExpress.viz.charts { 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; @@ -4449,20 +4756,6 @@ declare module DevExpress.viz.charts { 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; @@ -4811,7 +5104,10 @@ declare module DevExpress.viz.charts { /** 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. */ + /** + * Specifies the fraction of the inner radius relative to the total radius in the series of the 'doughnut' type. + * @deprecated use the 'innerRadius' option instead + */ innerRadius?: number; /** An object defining the label configuration options. */ label?: PieSeriesConfigLabel; @@ -4819,7 +5115,10 @@ declare module DevExpress.viz.charts { 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. */ + /** + * Specifies the direction in which the dxPieChart series points are located. + * @deprecated use the 'segmentsDirection' option instead + */ segmentsDirection?: string; /**

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

*/ selectionMode?: string; @@ -4843,17 +5142,30 @@ declare module DevExpress.viz.charts { /** Specifies how many segments must not be grouped. */ topCount?: number; }; - /** Specifies a start angle for a pie chart in arc degrees. */ + /** + * Specifies a start angle for a pie chart in arc degrees. + * @deprecated use the 'startAngle' option instead + */ startAngle?: number; /**

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

*/ tagField?: string; /** Specifies the data source field that provides values for series points. */ valueField?: string; } - export interface PieSeriesConfig extends CommonPieSeriesConfig { - /** Sets the series type. */ + export interface CommonPieSeriesSettings extends CommonPieSeriesConfig { type?: string; } + export interface PieSeriesConfig extends CommonPieSeriesConfig { + /** + * Sets the series type. + * @deprecated use the 'type' option instead + */ + type?: string; + /** Specifies the name that identifies the series. */ + name?: string; + /** Specifies data about a series. */ + tag?: any; + } export interface SeriesTemplate { /** Specifies a callback function that returns a series object with individual series settings. */ customizeSeries?: (seriesName: string) => SeriesConfig; @@ -4972,6 +5284,10 @@ declare module DevExpress.viz.charts { opacity?: number; /** Indicates whether or not ticks are visible on an axis. */ visible?: boolean; + /** Specifies tick width. */ + width?: number; + /** Specifies tick length. */ + length?: number; }; /** Specifies the options of the minor ticks. */ minorTick?: { @@ -4981,6 +5297,10 @@ declare module DevExpress.viz.charts { opacity?: number; /** Indicates whether or not the minor ticks are displayed on an axis. */ visible?: boolean; + /** Specifies minor tick width. */ + width?: number; + /** Specifies minor tick length. */ + length?: number; }; /** Indicates whether or not the line that represents an axis in a chart is visible. */ visible?: boolean; @@ -5194,9 +5514,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; @@ -5209,7 +5529,6 @@ declare module DevExpress.viz.charts { 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. */ @@ -5225,21 +5544,18 @@ declare module DevExpress.viz.charts { }) => 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. */ @@ -5249,20 +5565,7 @@ declare module DevExpress.viz.charts { /** 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; - }; + title?: viz.core.Title; /** Specifies tooltip options. */ tooltip?: BaseChartTooltip; /** A handler for the tooltipShown event. */ @@ -5277,8 +5580,6 @@ declare module DevExpress.viz.charts { 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 { @@ -5286,6 +5587,12 @@ declare module DevExpress.viz.charts { clearSelection(): void; /** Gets the current size of the widget. */ getSize(): { width: number; height: number }; + /** Returns an array of all series in the chart. */ + getAllSeries(): Array; + /** Gets a series within the chart's series collection by the specified name (see the name option). */ + getSeriesByName(seriesName: string): BaseSeries; + /** Gets a series within the chart's series collection by its position number. */ + getSeriesByPos(seriesIndex: number): BaseSeries; /** Displays the loading indicator. */ showLoadingIndicator(): void; /** Conceals the loading indicator. */ @@ -5341,6 +5648,10 @@ declare module DevExpress.viz.charts { seriesSelectionMode?: string; /** Specifies how the chart must behave when series point labels overlap. */ resolveLabelOverlapping?: string; + /** Specifies whether or not all bars in a series must have the same angle, or may have different angles if any points in other series are missing. */ + equalBarWidth?: boolean; + /** Specifies a common bar width as a percentage from 0 to 1. */ + barWidth?: number; } export interface Legend extends AdvancedLegend { /** Specifies whether the legend is located outside or inside the chart's plot. */ @@ -5353,8 +5664,6 @@ declare module DevExpress.viz.charts { 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; }; @@ -5366,7 +5675,6 @@ declare module DevExpress.viz.charts { 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. */ @@ -5405,7 +5713,7 @@ declare module DevExpress.viz.charts { maxBubbleSize?: number; /** Specifies the diameter of the smallest bubble measured in pixels. */ minBubbleSize?: number; - /** Defines the dxChart widget's pane(s). */ + /** 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; @@ -5413,10 +5721,6 @@ declare module DevExpress.viz.charts { 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. */ @@ -5447,12 +5751,6 @@ declare module DevExpress.viz.charts { 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; } @@ -5472,8 +5770,6 @@ declare module DevExpress.viz.charts { 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; @@ -5504,12 +5800,6 @@ declare module DevExpress.viz.charts { 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. */ @@ -5531,17 +5821,29 @@ declare module DevExpress.viz.charts { series?: Array; /** Specifies the diameter of the pie. */ diameter?: number; + /** Specifies the direction that the pie chart segments will occupy. */ + segmentsDirection?: string; + /** Specifies the starting angle in arc degrees for the first segment in a pie chart. */ + startAngle?: number; + /** Specifies the fraction of the inner radius relative to the total radius in the series of the 'doughnut' type. The value should be between 0 and 1. */ + innerRadius?: number; /** A handler for the legendClick event. */ onLegendClick?: any; - legendClick?: any; /** Specifies how a chart must behave when series point labels overlap. */ resolveLabelOverlapping?: string; + /** An object defining the configuration options that are common for all series of the dxPieChart widget. */ + commonSeriesSettings?: CommonPieSeriesSettings; + /** Specifies the type of the pie chart series. */ + type?: string; } /** A circular chart widget for HTML JS applications. */ export class dxPieChart extends BaseChart { constructor(element: JQuery, options?: dxPieChartOptions); constructor(element: Element, options?: dxPieChartOptions); - /** Provides access to the dxPieChart series. */ + /** + * Provides access to the dxPieChart series. + * @deprecated ..\..\BaseChart\3 Methods\getAllSeries().md + */ getSeries(): PieSeries; } } @@ -5576,13 +5878,22 @@ declare module DevExpress.viz.gauges { export interface ScaleTick { /** Specifies the color of the scale's minor ticks. */ color?: string; - /** Specifies an array of custom minor ticks. */ + /** + * Specifies an array of custom minor ticks. + * @deprecated ..\customMinorTicks.md + */ customTickValues?: Array; /** Specifies the length of the scale's minor ticks. */ length?: number; - /** Indicates whether automatically calculated minor ticks are visible or not. */ + /** + * Indicates whether automatically calculated minor ticks are visible or not. + * @deprecated This functionality in not more available + */ showCalculatedTicks?: boolean; - /** Specifies an interval between minor ticks. */ + /** + * Specifies an interval between minor ticks. + * @deprecated ..\minorTickInterval.md + */ tickInterval?: number; /** Indicates whether scale minor ticks are visible or not. */ visible?: boolean; @@ -5590,14 +5901,28 @@ declare module DevExpress.viz.gauges { width?: number; } export interface ScaleMajorTick extends ScaleTick { - /** Specifies whether or not to expand the current major tick interval if labels overlap each other. */ + /** + * Specifies whether or not to expand the current major tick interval if labels overlap each other. + * @deprecated ..\label\overlappingBehavior\useAutoArrangement.md + */ useTicksAutoArrangement?: boolean; } + export interface ScaleMinorTick extends ScaleTick { + /** Specifies the opacity of the scale's minor ticks. */ + opacity?: number; + } export interface BaseScaleLabel { /** Specifies whether or not scale labels should be colored similarly to their corresponding ranges in the range container. */ useRangeColors?: boolean; /** Specifies a callback function that returns the text to be displayed in scale labels. */ customizeText?: (scaleValue: { value: number; valueText: string }) => string; + /** Specifies the overlap resolving options to be applied to scale labels. */ + overlappingBehavior?: { + /** Specifies whether or not to expand the current major tick interval if labels overlap each other. */ + useAutoArrangement?: boolean; + /** Specifies what label to hide in case of overlapping. */ + hideFirstOrLast?: string; + }; /** Specifies font options for the text displayed in the scale labels of the gauge. */ font?: viz.core.Font; /** Specifies a format for the text displayed in scale labels. */ @@ -5610,20 +5935,56 @@ declare module DevExpress.viz.gauges { 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. */ + /** + * Specifies whether or not to hide the first scale label. + * @deprecated This functionality in not more available + */ hideFirstLabel?: boolean; - /** Specifies whether or not to hide the first major tick on the scale. */ + /** + * Specifies whether or not to hide the first major tick on the scale. + * @deprecated This functionality in not more available + */ hideFirstTick?: boolean; - /** Specifies whether or not to hide the last scale label. */ + /** + * Specifies whether or not to hide the last scale label. + * @deprecated This functionality in not more available + */ hideLastLabel?: boolean; - /** Specifies whether or not to hide the last major tick on the scale. */ + /** + * Specifies whether or not to hide the last major tick on the scale. + * @deprecated This functionality in not more available + */ hideLastTick?: boolean; + /** Specifies an interval between major ticks. */ + tickInterval?: number; + /** Specifies an interval between minor ticks. */ + minorTickInterval?: number; + /** Specifies an array of custom major ticks. */ + customTicks?: Array; + /** Specifies an array of custom minor ticks. */ + customMinorTicks?: Array; /** Specifies common options for scale labels. */ label?: BaseScaleLabel; - /** Specifies options of the gauge's major ticks. */ + /** + * Specifies options of the gauge's major ticks. + * @deprecated ..\tick\tick.md + */ majorTick?: ScaleMajorTick; + /** Specifies options of the gauge's major ticks. */ + tick?: { + /** Specifies the color of the scale's major ticks. */ + color?: string; + /** Specifies the length of the scale's major ticks. */ + length?: number; + /** Indicates whether scale major ticks are visible or not. */ + visible?: boolean; + /** Specifies the width of the scale's major ticks. */ + width?: number; + /** Specifies the opacity of the scale's major ticks. */ + opacity?: number; + }; /** Specifies options of the gauge's minor ticks. */ - minorTick?: ScaleTick; + minorTick?: ScaleMinorTick; /** Specifies the start value for the scale of the gauge. */ startValue?: number; } @@ -5680,21 +6041,48 @@ declare module DevExpress.viz.gauges { redrawOnResize?: boolean; /** Specifies the size of the widget in pixels. */ size?: viz.core.Size; - /** Specifies a subtitle for a gauge. */ + /** + * Specifies a subtitle for the widget. + * @deprecated ..\..\..\BaseGauge\1 Configuration\title\subtitle\subtitle.md + */ subtitle?: { - /** Specifies font options for the subtitle. */ + /** + * Specifies font options for the subtitle. + * @deprecated ..\..\title\subtitle\font\font.md + */ font?: viz.core.Font; - /** Specifies a text for the subtitle. */ + /** + * Specifies a text for the subtitle. + * @deprecated ..\title\subtitle\text.md + */ text?: string; }; /** Specifies a title for a gauge. */ title?: { /** Specifies font options for the title. */ font?: viz.core.Font; - /** Specifies a title's position on the gauge. */ + /** + * Specifies a title's position on the gauge. + * @deprecated basegaugeoptions_title_verticalAlignment and basegaugeoptions_title_horizontalAlignment + */ position?: string; - /** Specifies a text for the title. */ + /** Specifies the distance between the title and surrounding gauge elements in pixels. */ + margin?: viz.core.Margins; + /** Specifies the height of the space reserved for the title. */ + placeholderSize?: number; + /** Specifies the gauge title's position in the vertical direction. */ + verticalAlignment?: string; + /** Specifies the gauge title's horizontal position. */ + horizontalAlignment?: string; + /** Specifies text for the title. */ text?: string; + /** Specifies a subtitle for the widget. */ + subtitle?: { + /** Specifies font options for the subtitle. */ + font?: viz.core.Font; + /** Specifies text for the subtitle. */ + text?: string; + } }; /** Specifies options for gauge tooltips. */ tooltip?: viz.core.Tooltip; @@ -5903,6 +6291,8 @@ declare module DevExpress.viz.rangeSelector { /** Indicates whether or not the background (background color and/or image) is visible. */ visible?: boolean; }; + /** Specifies a title for the range selector. */ + title?: viz.core.Title; /** Specifies the dxRangeSelector's behavior options. */ behavior?: { /** Indicates whether or not you can swap sliders. */ @@ -5933,8 +6323,10 @@ declare module DevExpress.viz.rangeSelector { /** 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; + /** Specifies whether all bars in a series must have the same width, or may have different widths if any points in other series are missing. */ + equalBarWidth?: boolean; + /** Specifies a common bar width as a percentage from 0 to 1. */ + barWidth?: number; /** Sets the name of the palette to be used in the range selector's chart. Alternatively, an array of colors can be set as a custom palette to be used within this chart. */ palette?: any; /** An object defining the chart’s series. */ @@ -5994,8 +6386,12 @@ declare module DevExpress.viz.rangeSelector { }; /** Specifies the value to be raised to a power when generating ticks for a logarithmic scale. */ logarithmBase?: number; - /** Specifies an interval between major ticks. */ + /** + * Specifies an interval between major ticks. + * @deprecated ..\tickInterval\tickInterval.md + */ majorTickInterval?: any; + tickInterval?: any; /** Specifies options for the date-time scale's markers. */ marker?: { /** Defines the options that can be set for the text that is displayed by the scale markers. */ @@ -6030,7 +6426,10 @@ declare module DevExpress.viz.rangeSelector { 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. */ + /** + * Indicates whether or not to show minor ticks on the scale. + * @deprecated minorTick\visible.md + */ showMinorTicks?: boolean; /** Specifies the scale's start value. */ startValue?: any; @@ -6043,6 +6442,12 @@ declare module DevExpress.viz.rangeSelector { /** Specifies the width of the scale's ticks (both major and minor ticks). */ width?: number; }; + minorTick?: { + color?: string; + opacity?: number; + width?: number; + visible?: boolean; + }; /** Specifies the type of the scale. */ type?: string; /** Specifies whether or not to expand the current tick interval if labels overlap each other. */ @@ -6068,7 +6473,6 @@ declare module DevExpress.viz.rangeSelector { /** 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; @@ -6160,145 +6564,426 @@ interface JQuery { 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. */ + /** This section describes the fields and methods that can be used in code to manipulate the Layer object. */ + export interface MapLayer { + /** The name of the layer. */ + name: string; + /** The layer index in the layers array. */ + index: number; + /** The layer type. Can be "area", "line" or "marker". */ + type: string; + /** The type of the layer elements. */ + elementType: string; + /** Gets all layer elements. */ + getElements(): Array; + /** Deselects all layer elements. */ + clearSelection(): void; + } + /** This section describes the fields and methods that can be used in code to manipulate the Layer Element object. */ + export interface MapLayerElement { + /** The parent layer of the layer element. */ + layer: MapLayer; + /** Gets the layer element coordinates. */ + coordinates(): Object; + /** Sets the value of an attribute. */ + attribute(name: string, value: any): void; + /** Gets the value of an attribute. */ + attribute(name: string): any; + /** Gets the selection state of the layer element. */ + selected(): boolean; + /** Sets the selection state of the layer element. */ + selected(state: boolean): void; + /** Applies the layer element settings and updates element appearance. */ + applySettings(settings: any): void; + } + /** + * This section describes the fields and methods that can be used in code to manipulate the Area object. + * @deprecated Use the "Layer Element" instead + */ export interface Area { - /** Contains the element type. */ + /** + * Contains the element type. + * @deprecated ..\..\Layer\2 Fields\type.md + */ type: string; - /** Return the value of an attribute. */ + /** + * Return the value of an attribute. + * @deprecated ..\..\Layer Element\3 Methods\attribute(name_value).md + */ attribute(name: string): any; - /** Provides information about the selection state of an area. */ + /** + * Provides information about the selection state of an area. + * @deprecated Use the "selected()" method of the Layer Element + */ selected(): boolean; - /** Sets a new selection state for an area. */ + /** + * Sets a new selection state for an area. + * @deprecated Use the "selected(state)" method of the Layer Element + */ selected(state: boolean): void; - /** Applies the area settings specified as a parameter and updates the area appearance. */ + /** + * Applies the area settings specified as a parameter and updates the area appearance. + * @deprecated ..\..\Layer Element\3 Methods\applySettings(settings).md + */ applySettings(settings: any): void; } - /** This section describes the fields and methods that can be used in code to manipulate the Markers object. */ + /** + * This section describes the fields and methods that can be used in code to manipulate the Markers object. + * @deprecated Use the "Layer Element" instead + */ export interface Marker { - /** Contains the descriptive text accompanying the map marker. */ + /** + * Contains the descriptive text accompanying the map marker. + * @deprecated Get the text with the "attribute" method (using the "layers.label.dataField" value) + */ text: string; - /** Contains the type of the element. */ + /** + * Contains the type of the element. + * @deprecated ..\..\Layer\2 Fields\type.md + */ type: string; - /** Contains the URL of an image map marker. */ + /** + * Contains the URL of an image map marker. + * @deprecated Get the url with the "attribute" method (using the "layers.dataField" value) + */ url: string; - /** Contains the value of a bubble map marker. */ + /** + * Contains the value of a bubble map marker. + * @deprecated Get the value with the "attribute" method (using the "layers.dataField" value) + */ value: number; - /** Contains the values of a pie map marker. */ + /** + * Contains the values of a pie map marker. + * @deprecated Get the values with the "attribute" method (using the "layers.dataField" value) + */ values: Array; - /** Returns the value of an attribute. */ + /** + * Returns the value of an attribute. + * @deprecated ..\..\Layer Element\3 Methods\attribute(name_value).md + */ attribute(name: string): any; - /** Returns the coordinates of a specific marker. */ + /** + * Returns the coordinates of a specific marker. + * @deprecated ..\..\Layer Element\3 Methods\coordinates().md + */ coordinates(): Array; - /** Provides information about the selection state of a marker. */ + /** + * Provides information about the selection state of a marker. + * @deprecated Use the "selected()" method of the Layer Element + */ selected(): boolean; - /** Sets a new selection state for a marker. */ + /** + * Sets a new selection state for a marker. + * @deprecated Use the "selected(state)" method of the Layer Element + */ selected(state: boolean): void; - /** Applies the marker settings specified as a parameter and updates the marker appearance. */ + /** + * Applies the marker settings specified as a parameter and updates marker appearance. + * @deprecated ..\..\Layer Element\3 Methods\applySettings(settings).md + */ applySettings(settings: any): void; } - export interface AreaSettings { - /** Specifies the width of the area border in pixels. */ + export interface MapLayerSettings { + /** Specifies the layer name. */ + name?: string; + /** Specifies layer type. */ + type?: string; + /** Specifies the type of a marker element. Setting this option makes sense only if the layer type is "marker". */ + elementType?: string; + /** Specifies a data source for the layer. */ + data?: any; + /** Specifies the width of the layer elements border in pixels. */ borderWidth?: number; - /** Specifies a color for the area border. */ + /** Specifies a color for the border of the layer elements. */ borderColor?: string; - click?: any; - /** Specifies a color for an area. */ + /** Specifies a color for layer elements. */ 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. */ + /** Specifies a color for the border of the layer element when it is hovered over. */ hoveredBorderColor?: string; - /** Specifies the pixel-measured width of the area border when the area is hovered over. */ + /** Specifies the pixel-measured width for the border of the layer element when it is hovered over. */ hoveredBorderWidth?: number; - /** Specifies a color for an area when this area is hovered over. */ + /** Specifies a color for a layer element when it is hovered over. */ hoveredColor?: string; - /** Specifies whether or not to change the appearance of an area when it is hovered over. */ + /** Specifies a pixel-measured width for the border of the layer element when it is selected. */ + selectedBorderWidth?: number; + /** Specifies a color for the border of the layer element when it is selected. */ + selectedBorderColor?: string; + /** Specifies a color for the layer element when it is selected. */ + selectedColor?: string; + /** Specifies the layer opacity (from 0 to 1). */ + opacity?: number; + /** Specifies the size of markers. Setting this option makes sense only if the layer type is "marker" and the elementType is "dot", "pie" or "image". */ + size?: number; + /** Specifies the pixel-measured diameter of the marker that represents the smallest value. Setting this option makes sense only if the layer type is "marker". */ + minSize?: number; + /** Specifies the pixel-measured diameter of the marker that represents the biggest value. Setting this option makes sense only if the layer type is "marker". */ + maxSize?: number; + /** Specifies whether or not to change the appearance of a layer element when it is hovered over. */ hoverEnabled?: boolean; - /** 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. */ + /** Specifies whether single or multiple map elements can be selected on a vector map. */ + selectionMode?: string; + /** Specifies the name of the palette or a custom range of colors to be used for coloring a layer. */ palette?: any; /** Specifies the number of colors in a palette. */ paletteSize?: number; - /** Allows you to paint areas with similar attributes in the same color. */ + /** Allows you to paint layer elements with similar attributes in the same color. */ colorGroups?: Array; - /** Specifies the field that provides data to be used for coloring areas. */ + /** Specifies the field that provides data to be used for coloring of layer elements. */ 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; + /** Allows you to display bubbles with similar attributes in the same size. Setting this option makes sense only if the layer type is "marker" and the elementType is "bubble". */ + sizeGroups?: Array; + /** Specifies the field that provides data to be used for sizing bubble markers. Setting this option makes sense only if the layer type is "marker" and the elementType is "bubble". */ + sizeGroupingField?: string; + /** Specifies the name of the attribute containing marker data. Setting this option makes sense only if the layer type is "marker" and the elementType is "bubble", "pie" or "image". */ + dataField?: string; + /** Specifies the function that customizes each layer element individually. */ + customize?: (eleemnts: Array) => void; /** Specifies marker label options. */ label?: { + /** The name of the data attribute containing marker texts. */ + dataField?: string; /** Enables marker labels. */ enabled?: boolean; /** Specifies font options for marker labels. */ font?: viz.core.Font; }; - /** 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. */ + } + export interface AreaSettings { + /** + * Specifies the width of the area border in pixels. + * @deprecated ..\layers\borderWidth.md + */ + borderWidth?: number; + /** + * Specifies a color for the area border. + * @deprecated ..\layers\borderColor.md + */ + borderColor?: string; + /** + * Specifies a color for an area. + * @deprecated ..\layers\color.md + */ + color?: string; + /** + * Specifies the function that customizes each area individually. + * @deprecated ..\layers\customize.md + */ + customize?: (areaInfo: Area) => AreaSettings; + /** + * Specifies a color for the area border when the area is hovered over. + * @deprecated ..\layers\hoveredBorderColor.md + */ + hoveredBorderColor?: string; + /** + * Specifies the pixel-measured width of the area border when the area is hovered over. + * @deprecated ..\layers\hoveredBorderWidth.md + */ + hoveredBorderWidth?: number; + /** + * Specifies a color for an area when this area is hovered over. + * @deprecated ..\layers\hoveredColor.md + */ + hoveredColor?: string; + /** + * Specifies whether or not to change the appearance of an area when it is hovered over. + * @deprecated ..\layers\hoverEnabled.md + */ + hoverEnabled?: boolean; + /** + * Configures area labels. + * @deprecated ..\..\layers\label\label.md + */ + label?: { + /** + * Specifies the data field that provides data for area labels. + * @deprecated ..\..\layers\label\dataField.md + */ + dataField?: string; + /** + * Enables area labels. + * @deprecated ..\..\layers\label\enabled.md + */ + enabled?: boolean; + /** + * Specifies font options for area labels. + * @deprecated ..\..\..\layers\label\font\font.md + */ + font?: viz.core.Font; + }; + /** + * Specifies the name of the palette or a custom range of colors to be used for coloring a map. + * @deprecated ..\layers\palette.md + */ palette?: any; - /** Allows you to paint markers with similar attributes in the same color. */ + /** + * Specifies the number of colors in a palette. + * @deprecated ..\layers\paletteSize.md + */ + paletteSize?: number; + /** + * Allows you to paint areas with similar attributes in the same color. + * @deprecated ..\layers\colorGroups.md + */ colorGroups?: Array; - /** Specifies the field that provides data to be used for coloring markers. */ + /** + * Specifies the field that provides data to be used for coloring areas. + * @deprecated ..\layers\colorGroupingField.md + */ colorGroupingField?: string; - /** Allows you to display bubbles with similar attributes in the same size. */ + /** + * Specifies a color for the area border when the area is selected. + * @deprecated ..\layers\selectedBorderColor.md + */ + selectedBorderColor?: string; + /** + * Specifies a color for an area when this area is selected. + * @deprecated ..\layers\selectedColor.md + */ + selectedColor?: string; + /** + * Specifies the pixel-measured width of the area border when the area is selected. + * @deprecated ..\layers\selectedBorderWidth.md + */ + selectedBorderWidth?: number; + /** + * Specifies whether single or multiple areas can be selected on a vector map. + * @deprecated ..\layers\selectionMode.md + */ + selectionMode?: string; + } + export interface MarkerSettings { + /** + * Specifies a color for the marker border. + * @deprecated ..\layers\borderColor.md + */ + borderColor?: string; + /** + * Specifies the width of the marker border in pixels. + * @deprecated ..\layers\borderWidth.md + */ + borderWidth?: number; + /** + * Specifies a color for a marker of the dot or bubble type. + * @deprecated ..\layers\color.md + */ + color?: string; + /** + * Specifies the function that customizes each marker individually. + * @deprecated ..\layers\customize.md + */ + customize?: (markerInfo: Marker) => MarkerSettings; + /** + * Specifies the pixel-measured width of the marker border when the marker is hovered over. + * @deprecated ..\layers\hoveredBorderWidth.md + */ + hoveredBorderWidth?: number; + /** + * Specifies a color for the marker border when the marker is hovered over. + * @deprecated ..\layers\hoveredBorderColor.md + */ + hoveredBorderColor?: string; + /** + * Specifies a color for a marker of the dot or bubble type when this marker is hovered over. + * @deprecated ..\layers\hoveredColor.md + */ + hoveredColor?: string; + /** + * Specifies whether or not to change the appearance of a marker when it is hovered over. + * @deprecated ..\layers\hoverEnabled.md + */ + hoverEnabled?: boolean; + /** + * Specifies marker label options. + * @deprecated ..\..\layers\label\label.md + */ + label?: { + /** + * Enables marker labels. + * @deprecated ..\..\layers\label\enabled.md + */ + enabled?: boolean; + /** + * Specifies font options for marker labels. + * @deprecated ..\..\..\layers\label\font\font.md + */ + font?: viz.core.Font; + }; + /** + * Specifies the pixel-measured diameter of the marker that represents the biggest value. Setting this option makes sense only if you use markers of the bubble type. + * @deprecated ..\layers\maxSize.md + */ + maxSize?: number; + /** + * Specifies the pixel-measured diameter of the marker that represents the smallest value. Setting this option makes sense only if you use markers of the bubble type. + * @deprecated ..\layers\minSize.md + */ + minSize?: number; + /** + * Specifies the opacity of markers. Setting this option makes sense only if you use markers of the bubble type. + * @deprecated ..\layers\opacity.md + */ + opacity?: number; + /** + * Specifies the pixel-measured width of the marker border when the marker is selected. + * @deprecated ..\layers\selectedBorderWidth.md + */ + selectedBorderWidth?: number; + /** + * Specifies a color for the marker border when the marker is selected. + * @deprecated ..\layers\selectedBorderColor.md + */ + selectedBorderColor?: string; + /** + * Specifies a color for a marker of the dot or bubble type when this marker is selected. + * @deprecated ..\layers\selectedColor.md + */ + selectedColor?: string; + /** + * Specifies whether a single or multiple markers can be selected on a vector map. + * @deprecated ..\layers\selectionMode.md + */ + selectionMode?: string; + /** + * Specifies the size of markers. Setting this option makes sense for any type of marker except bubble. + * @deprecated ..\layers\size.md + */ + size?: number; + /** + * Specifies the type of markers to be used on the map. + * @deprecated ..\layers\elementType.md + */ + type?: string; + /** + * Specifies the name of a palette or a custom set of colors to be used for coloring markers of the pie type. + * @deprecated ..\layers\palette.md + */ + palette?: any; + /** + * Allows you to paint markers with similar attributes in the same color. + * @deprecated ..\layers\colorGroups.md + */ + colorGroups?: Array; + /** + * Specifies the field that provides data to be used for coloring markers. + * @deprecated ..\layers\colorGroupingField.md + */ + colorGroupingField?: string; + /** + * Allows you to display bubbles with similar attributes in the same size. + * @deprecated ..\layers\sizeGroups.md + */ sizeGroups?: Array; - /** Specifies the field that provides data to be used for sizing bubble markers. */ + /** + * Specifies the field that provides data to be used for sizing bubble markers. + * @deprecated ..\layers\sizeGroupingField.md + */ sizeGroupingField?: string; } export interface dxVectorMapOptions extends viz.core.BaseWidgetOptions { - /** An object specifying options for the map areas. */ + /** + * An object specifying options for the map areas. + * @deprecated Use the 'layers' option instead + */ areaSettings?: AreaSettings; /** Specifies the options for the map background. */ background?: { @@ -6307,6 +6992,10 @@ declare module DevExpress.viz.map { /** Specifies a color for the background. */ color?: string; }; + /** Specifies options for dxVectorMap widget layers. */ + layers?: Array; + /** Specifies the map projection. */ + projection?: Object; /** Specifies the positioning of a map in geographical coordinates. */ bounds?: Array; /** Specifies the options of the control bar. */ @@ -6328,14 +7017,25 @@ declare module DevExpress.viz.map { }; /** Specifies the appearance of the loading indicator. */ loadingIndicator?: viz.core.LoadingIndicator; - /** Specifies a data source for the map area. */ + /** + * Specifies a data source for the map area. + * @deprecated Use the 'layers.data' option instead + */ mapData?: any; - /** Specifies a data source for the map markers. */ + /** + * Specifies a data source for the map markers. + * @deprecated Use the 'layers.data' option instead + */ markers?: any; - /** An object specifying options for the map markers. */ + /** + * An object specifying options for the map markers. + * @deprecated Use the 'layers' option instead + */ markerSettings?: MarkerSettings; /** Specifies the size of the dxVectorMap widget. */ size?: viz.core.Size; + /** Specifies a title for the vector map. */ + title?: viz.core.Title; /** Specifies tooltip options. */ tooltip?: viz.core.Tooltip; /** Configures map legends. */ @@ -6348,7 +7048,6 @@ declare module DevExpress.viz.map { 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; @@ -6371,27 +7070,43 @@ declare module DevExpress.viz.map { 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; + zoomFactor: number; }) => void; - click?: any; /** A handler for the click event. */ onClick?: any; - /** A handler for the areaClick event. */ + /** A handler for the selectionChanged event. */ + onSelectionChanged?: (e: { + component: dxVectorMap; + element: Element; + target: MapLayerElement; + }) => void; + /** + * A handler for the areaClick event. + * @deprecated Use the 'onClick' option instead + */ onAreaClick?: any; - /** A handler for the areaSelectionChanged event. */ + /** + * A handler for the areaSelectionChanged event. + * @deprecated Use the 'onSelectionChanged' option instead + */ onAreaSelectionChanged?: (e: { target: Area; component: dxVectorMap; element: Element; }) => void; - /** A handler for the markerClick event. */ + /** + * A handler for the markerClick event. + * @deprecated Use the 'onClick' option instead + */ onMarkerClick?: any; - /** A handler for the markerSelectionChanged event. */ + /** + * A handler for the markerSelectionChanged event. + * @deprecated Use the 'onSelecitonChanged' option instead + */ onMarkerSelectionChanged?: (e: { target: Marker; component: dxVectorMap; @@ -6401,12 +7116,19 @@ declare module DevExpress.viz.map { panningEnabled?: boolean; } export interface Legend extends viz.core.BaseLegend { + /** Specifies the color of item markers in the legend. The specified color applied only when the legend uses 'size' source. */ + markerColor?: string; /** Specifies text for legend items. */ customizeText?: (itemInfo: { start: number; end: number; index: number; color: string; size: number; }) => string; /** Specifies text for a hint that appears when a user hovers the mouse pointer over the text of a legend item. */ customizeHint?: (itemInfo: { start: number; end: number; index: number; color: string; size: number }) => string; /** Specifies the source of data for the legend. */ - source?: string; + source?: { + /** Specifies a layer to which the legend belongs. */ + layer?: string; + /** Specifies the type of the legend grouping. */ + grouping?: string; + } } /** A vector map widget. */ export class dxVectorMap extends viz.core.BaseWidget { @@ -6422,17 +7144,35 @@ declare module DevExpress.viz.map { 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. */ + /** + * Deselects all the selected areas on a map. The areas are displayed in their initial style after. + * @deprecated Use the 'clearSelection' method on a layer instead + */ clearAreaSelection(): void; - /** Deselects all the selected markers on a map. The markers are displayed in their initial style after. */ + /** + * Deselects all the selected markers on a map. The markers are displayed in their initial style after. + * @deprecated Use the 'clearSelection' method on a layer instead + */ clearMarkerSelection(): void; /** Deselects all the selected area and markers on a map at once. The areas and markers are displayed in their initial style after. */ clearSelection(): void; /** Converts client area coordinates into map coordinates. */ convertCoordinates(x: number, y: number): Array; - /** Returns an array with all the map areas. */ + /** Gets all map layers. */ + getLayers(): Array; + /** Gets the layer by its index. */ + getLayerByIndex(index: number): MapLayer; + /** Gets the layer by its name. */ + getLayerByName(name: string): MapLayer; + /** + * Returns an array with all the map areas. + * @deprecated Use the 'getElements' method on a layer instead + */ getAreas(): Array; - /** Returns an array with all the map markers. */ + /** + * Returns an array with all the map markers. + * @deprecated Use the 'getElements' method on a layer instead + */ getMarkers(): Array; /** Gets the current coordinates of the map viewport. */ viewport(): Array; @@ -6443,6 +7183,19 @@ declare module DevExpress.viz.map { /** Sets the value of the map zoom factor. */ zoomFactor(zoomFactor: number): void; } + export var projection: ProjectionCreator; + export interface ProjectionCreator { + /** Creates a new projection. */ + (data: { + to?: (coordinates: Array) => Array; + from?: (coordinates: Array) => Array; + aspectRatio?: number; + }): Object; + /** Gets the default or custom projection from the projection storage. */ + get(name: string): Object; + /** Adds a new projection to the internal projections storage. */ + add(name: string, projection: Object): void; + } } interface JQuery { dxVectorMap(options?: DevExpress.viz.map.dxVectorMapOptions): JQuery; @@ -6569,4 +7322,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 36bec7b32..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/dhtmlxscheduler/dhtmlxscheduler.d.ts b/dhtmlxscheduler/dhtmlxscheduler.d.ts index c79ce78c9..78537e393 100644 --- a/dhtmlxscheduler/dhtmlxscheduler.d.ts +++ b/dhtmlxscheduler/dhtmlxscheduler.d.ts @@ -1165,11 +1165,22 @@ interface SchedulerStatic{ */ deleteEvent(id: any); + /** + * removes all blocking sets from the scheduler + */ + deleteMarkedTimespan(); + /** * removes marking/blocking set by the addMarkedTimespan() and blockTime() methods * @param id the timespan id */ deleteMarkedTimespan(id: string); + + /** + * removes marking/blocking set by the addMarkedTimespan() and blockTime() methods + * @param configuration for deleting + */ + deleteMarkedTimespan(config: any); /** * deletes a section from the currently active view (if the opened view isn't Timeline in the 'Tree' mode - the method will be ignored) @@ -1212,6 +1223,13 @@ interface SchedulerStatic{ * expands the scheduler to the full screen view */ expand(); + + /** + * filter events that will be displayed on the week view + * @param id event-id + * @param event event-object + */ + filter_week(id: any, event: any); /** * gives access to the objects of lightbox's sections 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/google-maps/google-maps-tests.ts b/google-maps/google-maps-tests.ts new file mode 100644 index 000000000..50f848936 --- /dev/null +++ b/google-maps/google-maps-tests.ts @@ -0,0 +1,27 @@ +/// + +import GoogleMapsLoader = require('google-maps'); + +GoogleMapsLoader.load(function(google) { + var loadedMap = google.maps.Map; +}); + +GoogleMapsLoader.KEY = 'qwertyuiopasdfghjklzxcvbnm'; + +GoogleMapsLoader.CLIENT = 'yourclientkey'; +GoogleMapsLoader.VERSION = '3.14'; + +GoogleMapsLoader.SENSOR = true; + +GoogleMapsLoader.LIBRARIES = ['geometry', 'places']; + +GoogleMapsLoader.LANGUAGE = 'fr'; + +GoogleMapsLoader.release(function() { + console.log('No google maps api around'); +}); + +GoogleMapsLoader.onLoad(function(google) { + var loadedMap = google.maps.Map; + console.log('I just loaded google maps api'); +}); diff --git a/google-maps/google-maps.d.ts b/google-maps/google-maps.d.ts new file mode 100644 index 000000000..edc37822c --- /dev/null +++ b/google-maps/google-maps.d.ts @@ -0,0 +1,26 @@ +// Type definitions for google-maps 3.1.0 +// Project: https://www.npmjs.com/package/google-maps +// Definitions by: Deividas Bakanas , Giedrius Grabauskas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace GoogleMapsLoader { + interface CallBack { + (google: { maps: { Map: google.maps.Map } }): void; + } + export var KEY: string; + export var CLIENT: string; + export var VERSION: string; + export var SENSOR: boolean; + export var LIBRARIES: Array; + export var LANGUAGE: string; + export function release(callBack: Function): void; + export function onLoad(callBack?: CallBack): void; + export function load(callBack?: CallBack): void; + export function isLoaded(): boolean; + +} +declare module 'google-maps' { + export = GoogleMapsLoader; +} diff --git a/google.analytics/ga-tests.ts b/google.analytics/ga-tests.ts index ba4f80dea..acff9eb55 100644 --- a/google.analytics/ga-tests.ts +++ b/google.analytics/ga-tests.ts @@ -23,6 +23,16 @@ describe('UniversalAnalytics', () => { ga('create', 'UA-65432-1', 'auto', {some: 'config'}); ga('send', 'pageview'); ga('send', 'pageview', {some: 'details'}); + ga('send', 'event', 'Videos', 'play', 'Fall Campaign'); + ga('send', {hitType: 'event', eventCategory: 'Videos', eventAction: 'play', eventLabel: 'Fall Campaign'}); + ga('send', 'event', 'Videos', 'play', 'Fall Campaign', {nonInteraction: true}); + ga('send', 'pageview', '/page'); + ga('send', 'social', {'socialNetwork': 'facebook', 'socialAction': 'like', 'socialTarget': 'http://foo.com'}); + ga('send', 'social', {'socialNetwork': 'google+', 'socialAction': 'plus', 'socialTarget': 'http://foo.com'}); + ga('send', 'timing', {'timingCategory': 'category', 'timingVar': 'lookup', 'timingValue': 123}); + ga('send', 'timing', {'timingCategory': 'category', 'timingVar': 'lookup', 'timingValue': 123, 'timingLabel': 'label'}); + ga('trackerName.send', 'event', 'load'); + ga.create('UA-65432-1', 'auto'); ga.create('UA-65432-1', {some: 'config'}); ga.create('UA-65432-1', 'auto', {some: 'config'}); @@ -30,7 +40,7 @@ describe('UniversalAnalytics', () => { ga.getByName('aNamedTracker'); }); it('should excercise Tracker APIs', () => { - var tracker: UniversalAnalytics.Tracker = ga('create', 'UA-65432-1', 'auto'); + var tracker: UniversalAnalytics.Tracker = ga.create('UA-65432-1', 'auto'); var aString: string = tracker.get('aString'); var aNumber: number = tracker.get('aNumber'); var anObject: {} = tracker.get<{}>('anObject'); diff --git a/google.analytics/ga.d.ts b/google.analytics/ga.d.ts index a8e1b1e25..68d0293a4 100644 --- a/google.analytics/ga.d.ts +++ b/google.analytics/ga.d.ts @@ -38,17 +38,56 @@ interface GoogleAnalytics { declare module UniversalAnalytics { // https://developers.google.com/analytics/devguides/collection/analyticsjs/method-reference + + enum HitType { + 'pageview', 'screenview', 'event', 'transaction', 'item', 'social', 'exception', 'timing' + } interface ga { l: number; q: any[]; - (command: string, poly: string, opt_poly?: {}): UniversalAnalytics.Tracker; - (command: string, trackingId: string, auto: string, opt_configObject?: {}): UniversalAnalytics.Tracker; - (command: string, hitDetails: {}): void; - create(trackingId: string, opt_configObject?: {}): UniversalAnalytics.Tracker; - create(trackingId: string, auto: string, opt_configObject?: {}): UniversalAnalytics.Tracker; + + (command: 'send', hitType: 'event', eventCategory: string, eventAction: string, + eventLabel?: string, eventValue?: number, fieldsObject?: {}): void; + (command: 'send', hitType: 'event', fieldsObject: { + eventCategory: string, + eventAction: string, + eventLabel?: string, + eventValue?: number, + nonInteraction?: boolean}): void; + (command: 'send', fieldsObject: { + hitType: HitType, // 'event' + eventCategory: string, + eventAction: string, + eventLabel?: string, + eventValue?: number, + nonInteraction?: boolean}): void; + (command: 'send', hitType: 'pageview', page: string): void; + (command: 'send', hitType: 'social', + socialNetwork: string, socialAction: string, socialTarget: string): void; + (command: 'send', hitType: 'social', + fieldsObject: {socialNetwork: string, socialAction: string, socialTarget: string}): void; + (command: 'send', hitType: 'timing', + timingCategory: string, timingVar: string, timingValue: number): void; + (command: 'send', hitType: 'timing', + fieldsObject: {timingCategory: string, timingVar: string, timingValue: number}): void; + (command: 'send', fieldsObject: {}): void; + (command: string, hitType: HitType, ...fields: any[]): void; + + (command: 'create', trackingId: string, cookieDomain?: string, name?: string, fieldsObject?: {}): void; + (command: 'remove'): void; + + (command: string, ...fields: any[]): void; + + (readyCallback: (defaultTracker?: UniversalAnalytics.Tracker) => void): void; + + create(trackingId: string, cookieDomain: string, name: string, fieldsObject?: {}): UniversalAnalytics.Tracker; + create(trackingId: string, cookieDomain: string, fieldsObject?: {}): UniversalAnalytics.Tracker; + create(trackingId: string, fieldsObject?: {}): UniversalAnalytics.Tracker; + getAll(): UniversalAnalytics.Tracker[]; getByName(name: string): UniversalAnalytics.Tracker; + remove(name:string): void; } interface Tracker { diff --git a/google.visualization/google.visualization.d.ts b/google.visualization/google.visualization.d.ts index 222faec1d..f1ef8278c 100644 --- a/google.visualization/google.visualization.d.ts +++ b/google.visualization/google.visualization.d.ts @@ -365,6 +365,7 @@ declare module google { export interface TransitionAnimation { duration?: number; easing?: string; // linear, in, out, inAndOut + startup?: boolean; } export interface ChartAxis { diff --git a/googlemaps/google.maps.d.ts b/googlemaps/google.maps.d.ts index 2093f2fd9..82a13d912 100644 --- a/googlemaps/google.maps.d.ts +++ b/googlemaps/google.maps.d.ts @@ -353,7 +353,7 @@ declare module google.maps { setDraggable(flag: boolean): void; setIcon(icon: string|Icon|Symbol): void; setMap(map: Map|StreetViewPanorama): void; - getOpacity(opacity: number): void; + setOpacity(opacity: number): void; setOptions(options: MarkerOptions): void; setPlace(place: Place): void; setPosition(latlng: LatLng|LatLngLiteral): void; @@ -849,7 +849,7 @@ declare module google.maps { formatted_address: string; geometry: GeocoderGeometry; partial_match: boolean; - postcode_localities: string[] + postcode_localities: string[]; types: string[]; } @@ -911,10 +911,10 @@ declare module google.maps { avoidFerries?: boolean; avoidHighways?: boolean; avoidTolls?: boolean; - destination?: LatLng|string; + destination?: LatLng|LatLngLiteral|string; durationInTraffic?: boolean; optimizeWaypoints?: boolean; - origin?: LatLng|string; + origin?: LatLng|LatLngLiteral|string; provideRouteAlternatives?: boolean; region?: string; transitOptions?: TransitOptions; @@ -959,7 +959,7 @@ declare module google.maps { export interface TransitFare { } export interface DirectionsWaypoint { - location: LatLng|string; + location: LatLng|LatLngLiteral|string; stopover: boolean; } @@ -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 { @@ -1916,16 +1917,16 @@ declare module google.maps { } export interface PlaceSearchRequest { - bounds: LatLngBounds; - keyword: string; - location: LatLng|LatLngLiteral; + bounds?: LatLngBounds; + keyword?: string; + location?: LatLng|LatLngLiteral; maxPriceLevel?: number; minPriceLevel?: number; - name: string; - openNow: boolean; - radius: number; - rankBy: RankBy; - types: string[]; + name?: string; + openNow?: boolean; + radius?: number; + rankBy?: RankBy; + types?: string[]; } export class PlacesService { @@ -1956,16 +1957,17 @@ declare module google.maps { bounds?: LatLngBounds; input?: string; location?: LatLng; + offset?: number; radius?: number; } export interface RadarSearchRequest { bounds?: LatLngBounds; - keyword: string; - location: LatLng|LatLngLiteral; - name: string; - radius: number; - types: string[]; + keyword?: string; + location?: LatLng|LatLngLiteral; + name?: string; + radius?: number; + types?: string[]; } export enum RankBy { @@ -1986,10 +1988,10 @@ declare module google.maps { export interface TextSearchRequest { bounds?: LatLngBounds; - location: LatLng|LatLngLiteral; + location?: LatLng|LatLngLiteral; query: string; - radius: number; - types: string[]; + radius?: number; + types?: string[]; } } 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..dbc30517b --- /dev/null +++ b/graham_scan/graham_scan.d.ts @@ -0,0 +1,12 @@ +// 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}[]; +} + +declare module 'graham_scan' { + export = ConvexHullGrahamScan; +} diff --git a/graphviz/graphviz.d.ts b/graphviz/graphviz.d.ts index 42dc3877a..1e9815a6b 100644 --- a/graphviz/graphviz.d.ts +++ b/graphviz/graphviz.d.ts @@ -1,5 +1,5 @@ // Type definitions for Graphviz 0.0.8 -// Project: git://github.com/glejeune/node-graphviz.git +// Project: https://github.com/glejeune/node-graphviz // Definitions by: Matt Frantz // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/gridfs-stream/gridfs-stream.d.ts b/gridfs-stream/gridfs-stream.d.ts index a8ad5f9ed..7dc355daf 100644 --- a/gridfs-stream/gridfs-stream.d.ts +++ b/gridfs-stream/gridfs-stream.d.ts @@ -52,6 +52,7 @@ declare module "gridfs-stream" { files: mongo.Collection; collection(name?: string): mongo.Collection; + curCol: string; createWriteStream(options?: GridFSStream.Options): GridFSStream.WriteStream; createReadStream(options?: GridFSStream.Options): GridFSStream.ReadStream; @@ -60,6 +61,7 @@ declare module "gridfs-stream" { remove(options: GridFSStream.Options, callback: (err: Error) => void): void; exist(options: GridFSStream.Options, callback: (err: Error, found: boolean) => void): void; + findOne(options: GridFSStream.Options, callback: (err: Error, record: any)=>void):void; } } 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-autoprefixer/gulp-autoprefixer-tests.ts b/gulp-autoprefixer/gulp-autoprefixer-tests.ts index 9fca0fa69..1b3ba0d53 100644 --- a/gulp-autoprefixer/gulp-autoprefixer-tests.ts +++ b/gulp-autoprefixer/gulp-autoprefixer-tests.ts @@ -1,7 +1,7 @@ /// /// -import gulp = require("gulp"); -import autoprefixer = require("gulp-autoprefixer"); +import * as gulp from "gulp"; +import * as autoprefixer from "gulp-autoprefixer"; gulp.src("test.css") .pipe(autoprefixer()) @@ -17,4 +17,4 @@ gulp.src("test.css") gulp.src("test.css") .pipe(autoprefixer({remove: false})) - .pipe(gulp.dest("build")); \ No newline at end of file + .pipe(gulp.dest("build")); diff --git a/gulp-autoprefixer/gulp-autoprefixer.d.ts b/gulp-autoprefixer/gulp-autoprefixer.d.ts index 5abfdc628..d372358eb 100644 --- a/gulp-autoprefixer/gulp-autoprefixer.d.ts +++ b/gulp-autoprefixer/gulp-autoprefixer.d.ts @@ -6,13 +6,15 @@ /// declare module "gulp-autoprefixer" { - interface Options { - browsers?: string[]; - cascade?: boolean; - remove?: boolean; + namespace autoPrefixer { + interface Options { + browsers?: string[]; + cascade?: boolean; + remove?: boolean; + } } - function autoPrefixer(opts?: Options): NodeJS.ReadWriteStream; + function autoPrefixer(opts?: autoPrefixer.Options): NodeJS.ReadWriteStream; export = autoPrefixer; } 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..632cb86f9 --- /dev/null +++ b/gulp-babel/gulp-babel.d.ts @@ -0,0 +1,42 @@ +// 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; + + module babel { } + + export = babel; +} diff --git a/gulp-csso/gulp-csso-tests.ts b/gulp-csso/gulp-csso-tests.ts index 5f61d4871..0ddf457c7 100644 --- a/gulp-csso/gulp-csso-tests.ts +++ b/gulp-csso/gulp-csso-tests.ts @@ -1,8 +1,8 @@ /// /// -import gulp = require('gulp'); -import csso = require('gulp-csso'); +import * as gulp from 'gulp'; +import * as csso from 'gulp-csso'; gulp.task('default', () => gulp.src('./main.css') diff --git a/gulp-csso/gulp-csso.d.ts b/gulp-csso/gulp-csso.d.ts index d5d338c4a..c2b58777a 100644 --- a/gulp-csso/gulp-csso.d.ts +++ b/gulp-csso/gulp-csso.d.ts @@ -7,6 +7,6 @@ declare module 'gulp-csso' { function csso(structureMinimization?: boolean): NodeJS.ReadWriteStream; - + namespace csso {} export = csso; } diff --git a/gulp-debug/gulp-debug-tests.ts b/gulp-debug/gulp-debug-tests.ts index e6485d8da..970107410 100644 --- a/gulp-debug/gulp-debug-tests.ts +++ b/gulp-debug/gulp-debug-tests.ts @@ -1,8 +1,8 @@ /// /// -import gulp = require('gulp'); -import debug = require('gulp-debug'); +import * as gulp from 'gulp'; +import * as debug from 'gulp-debug'; gulp.task('default', () => gulp.src('foo.js') diff --git a/gulp-debug/gulp-debug.d.ts b/gulp-debug/gulp-debug.d.ts index 743f5f5eb..d7ade91ac 100644 --- a/gulp-debug/gulp-debug.d.ts +++ b/gulp-debug/gulp-debug.d.ts @@ -13,5 +13,7 @@ declare module 'gulp-debug' { function debug(options?: IOptions): NodeJS.ReadWriteStream; + namespace debug {} + export = debug; } diff --git a/gulp-dtsm/gulp-dtsm-tests.ts b/gulp-dtsm/gulp-dtsm-tests.ts index f97f8705e..1eb505738 100644 --- a/gulp-dtsm/gulp-dtsm-tests.ts +++ b/gulp-dtsm/gulp-dtsm-tests.ts @@ -2,10 +2,9 @@ /// /// -import dtsm = require('gulp-dtsm'); -import gulp = require('gulp'); +import * as dtsm from 'gulp-dtsm'; +import * as gulp from 'gulp'; var stream: NodeJS.WritableStream = dtsm(); gulp.task('dtsm', () => gulp.src('./dtsm.json').pipe(dtsm())); - diff --git a/gulp-dtsm/gulp-dtsm.d.ts b/gulp-dtsm/gulp-dtsm.d.ts index a8fe7878f..63f01e1f5 100644 --- a/gulp-dtsm/gulp-dtsm.d.ts +++ b/gulp-dtsm/gulp-dtsm.d.ts @@ -8,6 +8,7 @@ declare module "gulp-dtsm" { function dtsm(): NodeJS.WritableStream; + namespace dtsm {} + export = dtsm; } - diff --git a/gulp-filter/gulp-filter-tests.ts b/gulp-filter/gulp-filter-tests.ts new file mode 100644 index 000000000..a542ef548 --- /dev/null +++ b/gulp-filter/gulp-filter-tests.ts @@ -0,0 +1,71 @@ +/// +/// +/// +/// +/// + +import * as gulp from 'gulp'; +import * as uglify from 'gulp-uglify'; +import * as less from 'gulp-less'; +import * as concat from 'gulp-concat'; +import * as filter from 'gulp-filter'; + +// Filter only +gulp.task('default', () => { + // create filter instance inside task function + const f = filter(['*', '!src/vendor']); + + return gulp.src('src/*.js') + // filter a subset of the files + .pipe(f) + // run them through a plugin + .pipe(uglify()) + .pipe(gulp.dest('dist')); +}); + +// Restoring filtered files +gulp.task('default', () => { + // create filter instance inside task function + const f = filter(['*', '!src/vendor'], {restore: true}); + + return gulp.src('src/*.js') + // filter a subset of the files + .pipe(f) + // run them through a plugin + .pipe(uglify()) + // bring back the previously filtered out files (optional) + .pipe(f.restore) + .pipe(gulp.dest('dist')); +}); + +// Multiple filters +gulp.task('default', () => { + const jsFilter = filter('**/*.js', {restore: true}); + const lessFilter = filter('**/*.less', {restore: true}); + + return gulp.src('assets/**') + .pipe(jsFilter) + .pipe(concat('bundle.js')) + .pipe(jsFilter.restore) + .pipe(lessFilter) + .pipe(less()) + .pipe(lessFilter.restore) + .pipe(gulp.dest('out/')); +}); + +// Restore as a file source +gulp.task('default', () => { + const f = filter(['*', '!src/vendor'], {restore: true, passthrough: false}); + + const stream = gulp.src('src/*.js') + // filter a subset of the files + .pipe(f) + // run them through a plugin + .pipe(uglify()) + .pipe(gulp.dest('dist')); + + // use filtered files as a gulp file source + f.restore.pipe(gulp.dest('vendor-dist')); + + return stream; +}); diff --git a/gulp-filter/gulp-filter.d.ts b/gulp-filter/gulp-filter.d.ts new file mode 100644 index 000000000..2e37f3bcb --- /dev/null +++ b/gulp-filter/gulp-filter.d.ts @@ -0,0 +1,33 @@ +// Type definitions for gulp-filter v3.0.1 +// Project: https://github.com/sindresorhus/gulp-filter +// Definitions by: Tanguy Krotoff +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// +/// + +declare module 'gulp-filter' { + import File = require('vinyl'); + import * as Minimatch from 'minimatch'; + + namespace filter { + interface FileFunction { + (file: File): boolean; + } + + interface Options extends Minimatch.IOptions { + restore?: boolean; + passthrough?: boolean; + } + + // A transform stream with a .restore object + interface Filter extends NodeJS.ReadWriteStream { + restore: NodeJS.ReadWriteStream + } + } + + function filter(pattern: string | string[] | filter.FileFunction, options?: filter.Options): filter.Filter; + + export = filter; +} diff --git a/gulp-flatten/gulp-flatten-tests.ts b/gulp-flatten/gulp-flatten-tests.ts index ee5622564..5a476195d 100644 --- a/gulp-flatten/gulp-flatten-tests.ts +++ b/gulp-flatten/gulp-flatten-tests.ts @@ -1,8 +1,8 @@ /// /// -import gulp = require("gulp"); -import flatten = require("gulp-flatten"); +import * as gulp from "gulp"; +import * as flatten from "gulp-flatten"; gulp.task("flatten:simple", () => { gulp.src(["files/**/*.txt"]) diff --git a/gulp-flatten/gulp-flatten.d.ts b/gulp-flatten/gulp-flatten.d.ts index ccd9cedf1..2992aff4f 100644 --- a/gulp-flatten/gulp-flatten.d.ts +++ b/gulp-flatten/gulp-flatten.d.ts @@ -13,5 +13,7 @@ declare module "gulp-flatten" { function flatten(options?: IOptions): NodeJS.ReadWriteStream; + namespace flatten {} + export = flatten; } diff --git a/gulp-gh-pages/gulp-gh-pages-tests.ts b/gulp-gh-pages/gulp-gh-pages-tests.ts index a8633c051..0d12c7329 100644 --- a/gulp-gh-pages/gulp-gh-pages-tests.ts +++ b/gulp-gh-pages/gulp-gh-pages-tests.ts @@ -1,7 +1,7 @@ /// /// -import gulp = require("gulp"); -import ghPages = require("gulp-gh-pages"); +import * as gulp from "gulp"; +import * as ghPages from "gulp-gh-pages"; gulp.src("test.css") .pipe(ghPages()); @@ -22,4 +22,4 @@ gulp.src("test.css") .pipe(ghPages({push: false})); gulp.src("test.css") - .pipe(ghPages({message: "master"})); \ No newline at end of file + .pipe(ghPages({message: "master"})); diff --git a/gulp-gh-pages/gulp-gh-pages.d.ts b/gulp-gh-pages/gulp-gh-pages.d.ts index ef7146564..228589914 100644 --- a/gulp-gh-pages/gulp-gh-pages.d.ts +++ b/gulp-gh-pages/gulp-gh-pages.d.ts @@ -17,5 +17,7 @@ declare module "gulp-gh-pages" { function ghPages(opts?: Options): NodeJS.ReadWriteStream; + namespace ghPages {} + export = ghPages; } diff --git a/gulp-html-replace/gulp-html-replace-tests.ts b/gulp-html-replace/gulp-html-replace-tests.ts new file mode 100644 index 000000000..8739921e8 --- /dev/null +++ b/gulp-html-replace/gulp-html-replace-tests.ts @@ -0,0 +1,80 @@ +/// +/// +/// + +import * as gulp from 'gulp'; +import * as htmlreplace from 'gulp-html-replace'; + +// Examples taken from README.md of the gulp-html-replace project: +// https://www.npmjs.com/package/gulp-html-replace + +// Simple examples +gulp.task('simple1', () => { + gulp.src('src') + .pipe(htmlreplace({ js: 'js/main.js' })) + .pipe(gulp.dest('dest')); +}); + +gulp.task('simple2', () => { + gulp.src('src') + .pipe(htmlreplace({ js: ['js/monster.js', 'js/hero.js'] })) + .pipe(gulp.dest('dest')); +}); + +// Advanced examples +gulp.task('advanced1', () => { + gulp.src('src') + .pipe(htmlreplace({ + js: 'js/main.js', + tpl: '' + })) + .pipe(gulp.dest('dest')); +}); + +gulp.task('advanced2', () => { + gulp.src('src') + .pipe(htmlreplace({ + js: ['data-main.js', 'require-src.js'], + tpl: '' + })) + .pipe(gulp.dest('dest')); +}); + +// Extended replacements +gulp.task('ext1', () => { + gulp.src('src') + .pipe(htmlreplace({ + js: { + src: null, + tpl: '' + } + })) + .pipe(gulp.dest('dest')); +}); + +gulp.task('ext2', () => { + gulp.src('src') + .pipe(htmlreplace({ + js: { + src: 'dir', + tpl: '' + } + })) + .pipe(gulp.dest('dest')); +}); + +// Options example +gulp.task('options1', () => { + gulp.src('src') + .pipe(htmlreplace({ + js: { + src: null, + tpl: '' + } + }, { + keepUnassigned: false, + keepBlockTags: false, + resolvePaths: false + })) + .pipe(gulp.dest('dest')); +}); diff --git a/gulp-html-replace/gulp-html-replace.d.ts b/gulp-html-replace/gulp-html-replace.d.ts new file mode 100644 index 000000000..19762294d --- /dev/null +++ b/gulp-html-replace/gulp-html-replace.d.ts @@ -0,0 +1,29 @@ +// Type definitions for gulp-html-replace v1.5.5 +// Project: https://www.npmjs.com/package/gulp-html-replace +// Definitions by: Peter Juras +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// + +declare module "gulp-html-replace" { + interface AdvancedTask { + src: string | string[]; + tpl: string; + } + + interface Tasks { + [taskId: string] : string | string[] | AdvancedTask; + } + + interface Options { + keepUnassigned?: boolean; + keepBlockTags?: boolean; + resolvePaths?: boolean; + } + + interface HtmlReplace { + (tasks: Tasks, options?: Options) : NodeJS.ReadWriteStream; + } + + const htmlReplace : HtmlReplace; + export = htmlReplace; +} diff --git a/gulp-htmlmin/gulp-htmlmin-tests.ts b/gulp-htmlmin/gulp-htmlmin-tests.ts new file mode 100644 index 000000000..78149e787 --- /dev/null +++ b/gulp-htmlmin/gulp-htmlmin-tests.ts @@ -0,0 +1,11 @@ +/// +/// + +import * as gulp from 'gulp'; +import * as htmlmin from 'gulp-htmlmin'; + +gulp.task('minify', function() { + return gulp.src('src/*.html') + .pipe(htmlmin({collapseWhitespace: true})) + .pipe(gulp.dest('dist')) +}); diff --git a/gulp-htmlmin/gulp-htmlmin.d.ts b/gulp-htmlmin/gulp-htmlmin.d.ts new file mode 100644 index 000000000..2cf947d23 --- /dev/null +++ b/gulp-htmlmin/gulp-htmlmin.d.ts @@ -0,0 +1,18 @@ +// Type definitions for gulp-htmlmin v1.3.0 +// Project: https://github.com/jonschlinkert/gulp-htmlmin +// Definitions by: Tanguy Krotoff +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare module 'gulp-htmlmin' { + import * as HTMLMinifier from 'html-minifier'; + + namespace htmlmin { + } + + function htmlmin(options?: HTMLMinifier.Options): NodeJS.ReadWriteStream; + + export = htmlmin; +} diff --git a/gulp-inject/gulp-inject-tests.ts b/gulp-inject/gulp-inject-tests.ts index 804e6f9b5..4f535c8d6 100644 --- a/gulp-inject/gulp-inject-tests.ts +++ b/gulp-inject/gulp-inject-tests.ts @@ -1,8 +1,8 @@ /// /// -import gulp = require("gulp"); -import inject = require("gulp-inject"); +import * as gulp from "gulp"; +import * as inject from "gulp-inject"; gulp.task("inject:simple", () => { gulp.src("src/index.html") diff --git a/gulp-inject/gulp-inject.d.ts b/gulp-inject/gulp-inject.d.ts index fb2668a1f..5e72e0673 100644 --- a/gulp-inject/gulp-inject.d.ts +++ b/gulp-inject/gulp-inject.d.ts @@ -35,5 +35,7 @@ declare module "gulp-inject" { function inject(sources: NodeJS.ReadableStream, options?: IOptions): NodeJS.ReadWriteStream; + namespace inject {} + export = inject; } diff --git a/gulp-install/gulp-install-tests.ts b/gulp-install/gulp-install-tests.ts new file mode 100644 index 000000000..0b9b5da0c --- /dev/null +++ b/gulp-install/gulp-install-tests.ts @@ -0,0 +1,25 @@ +/// +/// + +import * as gulp from 'gulp'; +import * as install from 'gulp-install'; + +// Examples taken from https://www.npmjs.com/package/gulp-install + +// Usage in a gulp stream +gulp.src('src') + .pipe(install()); + +// Options +install({ + production: true, + ignoreScripts: true, + noOptional: true, + allowRoot: true, + args: ['one', 'two', 'three'] +}); + +// Options: args only as a string +install({ + args: 'one' +}); \ No newline at end of file diff --git a/gulp-install/gulp-install.d.ts b/gulp-install/gulp-install.d.ts new file mode 100644 index 000000000..3d332548c --- /dev/null +++ b/gulp-install/gulp-install.d.ts @@ -0,0 +1,22 @@ +// Type definitions for gulp-install v0.6.0 +// Project: https://www.npmjs.com/package/gulp-install +// Definitions by: Peter Juras +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// + +declare module "gulp-install" { + interface Options { + production?: boolean; + ignoreScripts?: boolean; + noOptional?: boolean; + allowRoot?: boolean; + args?: string | string[]; + } + + interface Install { + (options?: Options) : NodeJS.ReadWriteStream; + } + + const install : Install; + export = install; +} diff --git a/gulp-jade/gulp-jade-tests.ts b/gulp-jade/gulp-jade-tests.ts new file mode 100644 index 000000000..d6077eae5 --- /dev/null +++ b/gulp-jade/gulp-jade-tests.ts @@ -0,0 +1,29 @@ +/// +/// + +import * as gulp from 'gulp'; +import * as jade from 'gulp-jade'; + +gulp.task('jade', () => { + gulp.src('src/**/*.jade') + .pipe(jade()) + .pipe(gulp.dest('dist/')); +}); + +gulp.task('jade:pretty', () => { + gulp.src('src/**/*.jade') + .pipe(jade({ + pretty: '\t', + })) + .pipe(gulp.dest('dist/')) +}); + +gulp.task('jade:client', () => { + gulp.src('src/**/*.jade') + .pipe(jade({ + client: true, + pretty: true, + debug: false, + compileDebug: false, + })); +}); \ No newline at end of file diff --git a/gulp-jade/gulp-jade.d.ts b/gulp-jade/gulp-jade.d.ts new file mode 100644 index 000000000..221a14db0 --- /dev/null +++ b/gulp-jade/gulp-jade.d.ts @@ -0,0 +1,87 @@ +// Type definitions for gulp-jade +// Project: https://github.com/phated/gulp-jade +// Definitions by: berwyn +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module "gulp-jade" { + + function GulpJade(params?: GulpJade.Params): any; + + module GulpJade { + interface Params { + /******* + * JADE API OPTIONS + *******/ + + /** + * If the doctype is not specified as part of the + * template, you can specify it here. It is sometimes + * useful to get self-closing tags and remove mirroring + * of boolean attributes. + */ + doctype?: string; + + /** + * Adds whitespace to the resulting html to make it + * easier for a human to read using ' ' as indentation. + * If a string is specified, that will be used as + * indentation instead (e.g. '\t'). + */ + pretty?: boolean|string; + + /** + * Use a self namespace to hold the locals (false by default) + */ + self?: boolean; + + /** + * If set to true, the tokens and function body is logged + * to stdout + */ + debug?: boolean; + + /** + * If set to true, the function source will be included in the + * compiled template for better error messages (sometimes useful + * in development). It is enabled by default unless used with + * express in production mode. + */ + compileDebug?:boolean; + + /** + * If set to true, compiled functions are cached. filename + * must be set as the cache key. + */ + cache?:boolean; + + /******* + * GULP-JADE OPTIONS + *******/ + + /** + * Used to set a version of jade other than this library's + * dependency, or to customise filters. + */ + jade?: any; + + /** + * Compile to JS instead of HTML. + */ + client?: boolean; + + /** + * Locals to be used while parsing jade files. Takes + * precedence over data. + */ + locals?: any; + + /** + * Data to be used while parsing jade files. Has lower + * precedence than locals. + */ + data?: any; + } + } + + export = GulpJade; +} \ No newline at end of file diff --git a/gulp-json-editor/gulp-json-editor-tests.ts b/gulp-json-editor/gulp-json-editor-tests.ts new file mode 100644 index 000000000..a6acbb836 --- /dev/null +++ b/gulp-json-editor/gulp-json-editor-tests.ts @@ -0,0 +1,40 @@ +/// +/// + +import * as gulp from 'gulp'; +import * as jeditor from 'gulp-json-editor'; + +// Samples taken from https://www.npmjs.com/package/gulp-json-editor + +/* + edit JSON object by merging with user specific object +*/ +gulp.src("./manifest.json") + .pipe(jeditor({ + 'version': '1.2.3' + })) + .pipe(gulp.dest("./dest")); + +/* + edit JSON object by using user specific function +*/ +gulp.src("./manifest.json") + .pipe(jeditor(function(json : any) { + json.version = "1.2.3"; + return json; // must return JSON object. + })) + .pipe(gulp.dest("./dest")); + +/* + specify js-beautify option +*/ +gulp.src("./manifest.json") + .pipe(jeditor({ + 'version': '1.2.3' + }, + // the second argument is passed to js-beautify as its option + { + 'indent_char': '\t', + 'indent_size': 1 + })) + .pipe(gulp.dest("./dest")); diff --git a/gulp-json-editor/gulp-json-editor.d.ts b/gulp-json-editor/gulp-json-editor.d.ts new file mode 100644 index 000000000..55a49f5b2 --- /dev/null +++ b/gulp-json-editor/gulp-json-editor.d.ts @@ -0,0 +1,17 @@ +// Type definitions for gulp-json-editor v2.2.1 +// Project: https://www.npmjs.com/package/gulp-json-editor +// Definitions by: Peter Juras +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// +/// + +declare module "gulp-json-editor" { + + interface JEditor { + (mergeWith: any | ((json : any) => any ), + jsBeautifyOptions? : JsBeautifyOptions ) : NodeJS.ReadWriteStream; + } + + const jeditor : JEditor; + export = jeditor; +} diff --git a/gulp-jspm/gulp-jspm-tests.ts b/gulp-jspm/gulp-jspm-tests.ts new file mode 100644 index 000000000..3b5c0f3a2 --- /dev/null +++ b/gulp-jspm/gulp-jspm-tests.ts @@ -0,0 +1,33 @@ +/// +/// + +import * as gulp from 'gulp'; +import * as gulpJspm from 'gulp-jspm'; + +// Examples taken from https://www.npmjs.com/package/gulp-jspm +gulp.task('default', function(){ + return gulp.src('src/main.js') + .pipe(gulpJspm()) + .pipe(gulp.dest('build/')); +}); + +// Options +gulp.src('src/main.js') + .pipe(gulpJspm({arithmetic: '- message'})) // exclude message.js from bundle + .pipe(gulp.dest('build/')); + +gulp.src('src/main.js') + .pipe(gulpJspm({selfExecutingBundle: true})) // `jspm bundle-sfx main` + .pipe(gulp.dest('build/')); + +gulp.src('src/main.jsx') + .pipe(gulpJspm({plugin: true})) // `jspm bundle main.jsx!` + .pipe(gulp.dest('build/')); +gulp.src('src/main.jsx') + .pipe(gulpJspm({plugin: 'jsx'})) // `jspm bundle main.jsx!jsx` + .pipe(gulp.dest('build/')); + +// all other options given to gulp-jspm are passed on to jspm, e.g. +gulp.src('src/main.js') + .pipe(gulpJspm({inject: true})) // `jspm bundle main --inject` + .pipe(gulp.dest('build/')); diff --git a/gulp-jspm/gulp-jspm.d.ts b/gulp-jspm/gulp-jspm.d.ts new file mode 100644 index 000000000..632e31741 --- /dev/null +++ b/gulp-jspm/gulp-jspm.d.ts @@ -0,0 +1,22 @@ +// Type definitions for gulp-jspm v0.5.4 +// Project: https://www.npmjs.com/package/gulp-jspm +// Definitions by: Peter Juras +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// + +declare module "gulp-jspm" { + interface Options { + arithmetic?: string; + selfExecutingBundle?: boolean; + plugin?: boolean | string; + inject?: boolean; + minify?: boolean; + } + + interface GulpJspm { + (options?: Options) : NodeJS.ReadWriteStream; + } + + const gulpJspm : GulpJspm; + export = gulpJspm; +} diff --git a/gulp-less/gulp-less-tests.ts b/gulp-less/gulp-less-tests.ts index a0671e766..ba9758649 100644 --- a/gulp-less/gulp-less-tests.ts +++ b/gulp-less/gulp-less-tests.ts @@ -1,8 +1,8 @@ /// /// -import gulp = require("gulp"); -import less = require("gulp-less"); +import * as gulp from "gulp"; +import * as less from "gulp-less"; // Without options gulp.task("less", () => { diff --git a/gulp-less/gulp-less.d.ts b/gulp-less/gulp-less.d.ts index 84adca370..daab47637 100644 --- a/gulp-less/gulp-less.d.ts +++ b/gulp-less/gulp-less.d.ts @@ -11,9 +11,12 @@ declare module "gulp-less" { modifyVars?: {}; paths?: string[]; plugins?: any[]; + relativeUrls?: boolean; } function less(options?: IOptions): NodeJS.ReadWriteStream; + namespace less {} + export = less; } diff --git a/gulp-load-plugins/gulp-load-plugins-tests.ts b/gulp-load-plugins/gulp-load-plugins-tests.ts index f479be00c..50930358f 100644 --- a/gulp-load-plugins/gulp-load-plugins-tests.ts +++ b/gulp-load-plugins/gulp-load-plugins-tests.ts @@ -3,9 +3,9 @@ /// /// -import gulp = require('gulp'); -import gulpConcat = require('gulp-concat'); -import gulpLoadPlugins = require('gulp-load-plugins'); +import * as gulp from 'gulp'; +import * as gulpConcat from 'gulp-concat'; +import * as gulpLoadPlugins from 'gulp-load-plugins'; interface GulpPlugins extends IGulpPlugins { concat: typeof gulpConcat; @@ -29,8 +29,8 @@ gulp.task('taskName', () => { }); /* - * From 0.8.0, you can pass in an object of mappings for renaming plugins. For example, - * imagine you want to load the gulp-ruby-sass plugin, but want to refer to it as just + * From 0.8.0, you can pass in an object of mappings for renaming plugins. For example, + * imagine you want to load the gulp-ruby-sass plugin, but want to refer to it as just * sass : */ plugins = gulpLoadPlugins({ @@ -39,9 +39,9 @@ plugins = gulpLoadPlugins({ } }); /* - * gulp-load-plugins comes with npm scope support. The major difference is that scoped - * plugins are accessible through an object on plugins that represents the scope. For - * example, if the plugin is @myco/gulp-test-plugin then you can access the plugin as + * gulp-load-plugins comes with npm scope support. The major difference is that scoped + * plugins are accessible through an object on plugins that represents the scope. For + * example, if the plugin is @myco/gulp-test-plugin then you can access the plugin as * shown in the following example: */ interface GulpPlugins { @@ -49,5 +49,5 @@ interface GulpPlugins { testPlugin(): NodeJS.ReadWriteStream; } } - + plugins.myco.testPlugin(); diff --git a/gulp-load-plugins/gulp-load-plugins.d.ts b/gulp-load-plugins/gulp-load-plugins.d.ts index c8a11091d..d72ca87c4 100644 --- a/gulp-load-plugins/gulp-load-plugins.d.ts +++ b/gulp-load-plugins/gulp-load-plugins.d.ts @@ -7,7 +7,7 @@ /** Loads in any gulp plugins and attaches them to an object, freeing you up from having to manually require each gulp plugin. */ declare module 'gulp-load-plugins' { - + interface IOptions { /** the glob(s) to search for, default ['gulp-*', 'gulp.*'] */ pattern?: string[]; @@ -24,14 +24,16 @@ declare module 'gulp-load-plugins' { /** a mapping of plugins to rename, the key being the NPM name of the package, and the value being an alias you define */ rename?: IPluginNameMappings; } - + interface IPluginNameMappings { [npmPackageName: string]: string } - + /** Loads in any gulp plugins and attaches them to an object, freeing you up from having to manually require each gulp plugin. */ function gulpLoadPlugins(options?: IOptions): T; - + + namespace gulpLoadPlugins {} + export = gulpLoadPlugins; } diff --git a/gulp-minify-css/gulp-minify-css-tests.ts b/gulp-minify-css/gulp-minify-css-tests.ts index 1375042dd..9bfe9697a 100644 --- a/gulp-minify-css/gulp-minify-css-tests.ts +++ b/gulp-minify-css/gulp-minify-css-tests.ts @@ -1,8 +1,8 @@ -/// +/// /// -import gulp = require("gulp"); -import minifyCSS = require("gulp-minify-css"); +import * as gulp from "gulp"; +import * as minifyCSS from "gulp-minify-css"; gulp.task("minify-css", () => { gulp.src("css/**/*.css") diff --git a/gulp-minify-css/gulp-minify-css.d.ts b/gulp-minify-css/gulp-minify-css.d.ts index be6d45b8b..cb0eea502 100644 --- a/gulp-minify-css/gulp-minify-css.d.ts +++ b/gulp-minify-css/gulp-minify-css.d.ts @@ -4,28 +4,14 @@ // Definitions: https://github.com/borisyankov/DefinitelyTyped /// +/// declare module "gulp-minify-css" { + import * as CleanCSS from 'clean-css'; - interface IOptions { - cache?: boolean; - advanced?: boolean; - aggressiveMerging?: boolean; - benchmark?: boolean; - compatibility?: string; - debug?: boolean; - inliner?: Object; - keepBreaks?: boolean; - keepSpecialComments?: string | number; - processImport?: boolean; - rebase?: boolean; - relativeTo?: string; - root?: string; - roundingPrecision?: number; - shorthandCompacting?: boolean; - } + function minifyCSS(options?: CleanCSS.Options): NodeJS.ReadWriteStream; - function minifyCSS(options?: IOptions): NodeJS.ReadWriteStream; + namespace minifyCSS {} export = minifyCSS; } diff --git a/gulp-minify-html/gulp-minify-html-tests.ts b/gulp-minify-html/gulp-minify-html-tests.ts index 9714818f5..1b3c7639d 100644 --- a/gulp-minify-html/gulp-minify-html-tests.ts +++ b/gulp-minify-html/gulp-minify-html-tests.ts @@ -1,14 +1,16 @@ /// /// -import gulp = require('gulp'); -import minifyHtml = require('gulp-minify-html'); +import * as gulp from 'gulp'; +import * as minifyHtml from 'gulp-minify-html'; + +// This package has been deprecated in favor of gulp-htmlmin, which should be faster and more comprehensive. minifyHtml(); minifyHtml({conditionals: true, loose: true}); gulp.task('minify-html', () => { - var opts = { + var opts: minifyHtml.Options = { conditionals: true, spare: true }; diff --git a/gulp-minify-html/gulp-minify-html.d.ts b/gulp-minify-html/gulp-minify-html.d.ts index 747104084..770789bbb 100644 --- a/gulp-minify-html/gulp-minify-html.d.ts +++ b/gulp-minify-html/gulp-minify-html.d.ts @@ -5,31 +5,36 @@ /// +// This package has been deprecated in favor of gulp-htmlmin, which should be faster and more comprehensive. + declare module 'gulp-minify-html' { - interface IOptions { - // Do not remove empty attributes - empty?: boolean; + namespace minifyHtml { + // Options from https://github.com/Swaagie/minimize#options + interface Options { + // Do not remove empty attributes + empty?: boolean; - // Do not strip CDATA from scripts - cdata?: boolean; + // Do not strip CDATA from scripts + cdata?: boolean; - // Do not remove comments - comments?: boolean; + // Do not remove comments + comments?: boolean; - // Do not remove conditional internet explorer comments - conditionals?: boolean; + // Do not remove conditional internet explorer comments + conditionals?: boolean; - // Do not remove redundant attributes - spare?: boolean; + // Do not remove redundant attributes + spare?: boolean; - // Do not remove arbitrary quotes - quotes?: boolean; + // Do not remove arbitrary quotes + quotes?: boolean; - // Preserve one whitespace - loose?: boolean; + // Preserve one whitespace + loose?: boolean; + } } - function minifyHtml(options?: IOptions): NodeJS.ReadWriteStream; + function minifyHtml(options?: minifyHtml.Options): NodeJS.ReadWriteStream; export = minifyHtml; } diff --git a/gulp-mocha/gulp-mocha-tests.ts b/gulp-mocha/gulp-mocha-tests.ts index 09f62b83d..8d3eda4ea 100644 --- a/gulp-mocha/gulp-mocha-tests.ts +++ b/gulp-mocha/gulp-mocha-tests.ts @@ -1,9 +1,9 @@ /// /// -import gulp = require("gulp"); -import mocha = require("gulp-mocha"); +import * as gulp from "gulp"; +import * as mocha from "gulp-mocha"; gulp.task('default', function () { return gulp.src('test.js', {read: false}) .pipe(mocha({reporter: 'nyan'})); -}); \ No newline at end of file +}); diff --git a/gulp-mocha/gulp-mocha.d.ts b/gulp-mocha/gulp-mocha.d.ts index 8d21b1323..b63714b77 100644 --- a/gulp-mocha/gulp-mocha.d.ts +++ b/gulp-mocha/gulp-mocha.d.ts @@ -8,5 +8,6 @@ declare module "gulp-mocha" { function mocha(setupOptions?: MochaSetupOptions): NodeJS.ReadWriteStream; + namespace mocha {} export = mocha; -} \ No newline at end of file +} diff --git a/gulp-replace/gulp-replace-tests.ts b/gulp-replace/gulp-replace-tests.ts index a914bfd44..8e043d774 100644 --- a/gulp-replace/gulp-replace-tests.ts +++ b/gulp-replace/gulp-replace-tests.ts @@ -1,11 +1,11 @@ /// /// -import gulp = require("gulp"); -import replace = require("gulp-replace"); +import * as gulp from "gulp"; +import * as replace from "gulp-replace"; gulp.task('templates', function(){ gulp.src(['file.txt']) .pipe(replace("test", "foo")) .pipe(replace(/foo(.{3})/g, '$1foo')) .pipe(gulp.dest('build/file.txt')); -}); \ No newline at end of file +}); diff --git a/gulp-replace/gulp-replace.d.ts b/gulp-replace/gulp-replace.d.ts index cf6ef7164..f32e33bbe 100644 --- a/gulp-replace/gulp-replace.d.ts +++ b/gulp-replace/gulp-replace.d.ts @@ -17,5 +17,7 @@ declare module "gulp-replace" { function replace(pattern: string, replacement: string | Replacer, opts?: Options): NodeJS.ReadWriteStream; function replace(pattern: RegExp, replacement: string | Replacer, opts?: Options): NodeJS.ReadWriteStream; + namespace replace {} + export = replace; -} \ No newline at end of file +} diff --git a/gulp-rev-replace/gulp-rev-replace-tests.ts b/gulp-rev-replace/gulp-rev-replace-tests.ts index 57515c9ac..7610183d8 100644 --- a/gulp-rev-replace/gulp-rev-replace-tests.ts +++ b/gulp-rev-replace/gulp-rev-replace-tests.ts @@ -3,19 +3,15 @@ /// /// -import gulp = require('gulp'); -import revReplace = require('gulp-rev-replace'); -import rev = require('gulp-rev'); -import useref = require('gulp-useref'); +import * as gulp from 'gulp'; +import * as revReplace from 'gulp-rev-replace'; +import * as rev from 'gulp-rev'; +import * as useref from '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-replace/gulp-rev-replace.d.ts b/gulp-rev-replace/gulp-rev-replace.d.ts index 3e683d183..6c258573d 100644 --- a/gulp-rev-replace/gulp-rev-replace.d.ts +++ b/gulp-rev-replace/gulp-rev-replace.d.ts @@ -6,16 +6,18 @@ /// declare module 'gulp-rev-replace' { - interface IOptions { - canonicalUris?: boolean; - replaceInExtensions?: Array; - prefix?: string; - manifest?: NodeJS.ReadWriteStream; - modifyUnreved?: Function; - modifyReved?: Function; + namespace revReplace { + interface Options { + canonicalUris?: boolean; + replaceInExtensions?: Array; + prefix?: string; + manifest?: NodeJS.ReadWriteStream; + modifyUnreved?: Function; + modifyReved?: Function; } + } - function revReplace(options?: IOptions): NodeJS.ReadWriteStream; + function revReplace(options?: revReplace.Options): NodeJS.ReadWriteStream; - export = revReplace; + export = revReplace; } 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-ruby-sass/gulp-ruby-sass-tests.ts b/gulp-ruby-sass/gulp-ruby-sass-tests.ts index cba0c4c60..5237527a4 100644 --- a/gulp-ruby-sass/gulp-ruby-sass-tests.ts +++ b/gulp-ruby-sass/gulp-ruby-sass-tests.ts @@ -1,7 +1,7 @@ /// /// -import gulp = require("gulp"); -import sass = require("gulp-ruby-sass"); +import * as gulp from "gulp"; +import * as sass from "gulp-ruby-sass"; gulp.task('sass', function () { sass('./scss/*.scss') diff --git a/gulp-ruby-sass/gulp-ruby-sass.d.ts b/gulp-ruby-sass/gulp-ruby-sass.d.ts index bb0c56328..2b0d26fdf 100644 --- a/gulp-ruby-sass/gulp-ruby-sass.d.ts +++ b/gulp-ruby-sass/gulp-ruby-sass.d.ts @@ -64,5 +64,7 @@ declare module "gulp-ruby-sass" { */ function sass(source: string, options?: Options): NodeJS.ReadableStream; + namespace sass {} + export = sass; } diff --git a/gulp-shell/gulp-shell.d.ts b/gulp-shell/gulp-shell.d.ts index d88f27ed6..4d18d610c 100644 --- a/gulp-shell/gulp-shell.d.ts +++ b/gulp-shell/gulp-shell.d.ts @@ -10,7 +10,7 @@ declare module "gulp-shell" { namespace shell { interface Shell { (commands: string|string[], options?: Option): NodeJS.ReadWriteStream; - task(commands: string|string[], options?: Option): () => NodeJS.ReadWriteStream; + task(commands: string|string[], options?: Option): (done: Function) => NodeJS.ReadWriteStream; } interface Option { diff --git a/gulp-size/gulp-size-tests.ts b/gulp-size/gulp-size-tests.ts index bfa2c6a04..8981960f2 100644 --- a/gulp-size/gulp-size-tests.ts +++ b/gulp-size/gulp-size-tests.ts @@ -2,9 +2,9 @@ /// /// -import gulp = require('gulp'); -import size = require('gulp-size'); -import debug = require('gulp-debug'); +import * as gulp from 'gulp'; +import * as size from 'gulp-size'; +import * as debug from 'gulp-debug'; gulp.task('default', () => gulp.src('fixture.js') diff --git a/gulp-size/gulp-size.d.ts b/gulp-size/gulp-size.d.ts index d25f6ed94..ba13c55a2 100644 --- a/gulp-size/gulp-size.d.ts +++ b/gulp-size/gulp-size.d.ts @@ -6,18 +6,20 @@ /// declare module 'gulp-size' { - interface IOptions { - showFiles?: boolean; - gzip?: boolean; - title?: string; + namespace size { + interface Options { + showFiles?: boolean; + gzip?: boolean; + title?: string; + } + + interface SizeStream extends NodeJS.ReadWriteStream { + size: number; + prettySize: string; + } } - interface ISizeStream extends NodeJS.ReadWriteStream { - size: number; - prettySize: string; - } - - function size(options?: IOptions): ISizeStream; + function size(options?: size.Options): size.SizeStream; export = size; } diff --git a/gulp-sort/gulp-sort-tests.ts b/gulp-sort/gulp-sort-tests.ts index 12685c085..d94f5cfdc 100644 --- a/gulp-sort/gulp-sort-tests.ts +++ b/gulp-sort/gulp-sort-tests.ts @@ -3,9 +3,9 @@ /// /// -import gulp = require('gulp'); -import sort = require('gulp-sort'); -import gulpUtil = require('gulp-util'); +import * as gulp from 'gulp'; +import * as sort from 'gulp-sort'; +import * as gulpUtil from 'gulp-util'; // default sort gulp.src('./src/js/**/*.js') @@ -38,7 +38,7 @@ gulp.src('./src/js/**/*.js') } })) .pipe(gulp.dest('./build/js')); - + function customComparator(file1: gulpUtil.File, file2: gulpUtil.File) { if (file1.path.indexOf('build') > -1) { return 1; @@ -47,4 +47,4 @@ function customComparator(file1: gulpUtil.File, file2: gulpUtil.File) { return -1; } return 0; -} \ No newline at end of file +} diff --git a/gulp-sort/gulp-sort.d.ts b/gulp-sort/gulp-sort.d.ts index c06b9c3e0..d4e740fc5 100644 --- a/gulp-sort/gulp-sort.d.ts +++ b/gulp-sort/gulp-sort.d.ts @@ -8,11 +8,11 @@ /** Sort files in stream by path or any custom sort comparator */ declare module 'gulp-sort' { - + import gulpUtil = require('gulp-util'); - + interface IOptions { - /** + /** * A function to compare two files. * Returns: * -1 if file1 should be before file2, @@ -23,9 +23,9 @@ declare module 'gulp-sort' { /** Whether to sort in ascending order, default is true */ asc?: boolean; } - + interface IComparatorFunction { - /** + /** * A function to compare two files. * Returns: * -1 if file1 should be before file2, @@ -34,11 +34,13 @@ declare module 'gulp-sort' { */ (file1: gulpUtil.File, file2: gulpUtil.File): number; } - + /** Sort files in stream by path or any custom sort comparator */ function gulpSort(): NodeJS.ReadWriteStream; function gulpSort(comparator: IComparatorFunction): NodeJS.ReadWriteStream; function gulpSort(options: IOptions): NodeJS.ReadWriteStream; - + + namespace gulpSort {} + export = gulpSort; } diff --git a/gulp-strip-debug/gulp-strip-debug-tests.ts b/gulp-strip-debug/gulp-strip-debug-tests.ts new file mode 100644 index 000000000..e6571b32f --- /dev/null +++ b/gulp-strip-debug/gulp-strip-debug-tests.ts @@ -0,0 +1,12 @@ +/// +/// + +import * as gulp from 'gulp'; +import * as stripDebug from 'gulp-strip-debug'; + +// Example taken from https://www.npmjs.com/package/gulp-strip-debug +gulp.task('default', function () { + return gulp.src('src/app.js') + .pipe(stripDebug()) + .pipe(gulp.dest('dist')); +}); diff --git a/gulp-strip-debug/gulp-strip-debug.d.ts b/gulp-strip-debug/gulp-strip-debug.d.ts new file mode 100644 index 000000000..782dea37b --- /dev/null +++ b/gulp-strip-debug/gulp-strip-debug.d.ts @@ -0,0 +1,10 @@ +// Type definitions for gulp-strip-debug v1.1.0 +// Project: https://www.npmjs.com/package/gulp-strip-debug +// Definitions by: Peter Juras +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// + +declare module "gulp-strip-debug" { + const gulpStripDebug : () => NodeJS.ReadWriteStream; + export = gulpStripDebug; +} diff --git a/gulp-tsd/gulp-tsd-tests.ts b/gulp-tsd/gulp-tsd-tests.ts index a7c20519c..734db65e8 100644 --- a/gulp-tsd/gulp-tsd-tests.ts +++ b/gulp-tsd/gulp-tsd-tests.ts @@ -1,8 +1,8 @@ /// /// -import gulp = require("gulp"); -import tsd = require("gulp-tsd"); +import * as gulp from "gulp"; +import * as tsd from "gulp-tsd"; gulp.task("tsd", () => { gulp.src("gulp_tsd.json") diff --git a/gulp-tsd/gulp-tsd.d.ts b/gulp-tsd/gulp-tsd.d.ts index 816d50d25..4e9380ebf 100644 --- a/gulp-tsd/gulp-tsd.d.ts +++ b/gulp-tsd/gulp-tsd.d.ts @@ -18,5 +18,7 @@ declare module "gulp-tsd" { function tsd(opts?: IOptions, callback?: gulp.TaskCallback): NodeJS.ReadWriteStream; + namespace tsd {} + export = tsd; } 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..ab40e478d 100644 --- a/gulp-typescript/gulp-typescript-tests.ts +++ b/gulp-typescript/gulp-typescript-tests.ts @@ -54,3 +54,13 @@ 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')); +}); + +var compilerOptions = tsProject.config.compilerOptions; +var exclude = tsProject.config.exclude; +var files = tsProject.config.files; diff --git a/gulp-typescript/gulp-typescript.d.ts b/gulp-typescript/gulp-typescript.d.ts index 7b16d0a5a..690f20c30 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; @@ -20,14 +20,33 @@ declare module "gulp-typescript" { noImplicitAny?: boolean; noLib?: boolean; removeComments?: boolean; - sourceRoot?: string; + sourceRoot?: string; // use gulp-sourcemaps instead sortOutput?: boolean; target?: string; typescript?: any; + outFile?: string; + outDir?: string; + suppressImplicitAnyIndexErrors?: boolean; + jsx?: string; + declaration?: boolean; + emitDecoratorMetadata?: boolean; + experimentalDecorators?: boolean; + experimentalAsyncFunctions?: boolean; + moduleResolution?: string; + noEmitHelpers?: boolean; + preserveConstEnums?: boolean; + isolatedModules?: boolean; + } + + interface TsConfig { + files?: string[]; + exclude?: string[]; + compilerOptions?: any; } interface Project { - src(): NodeJS.ReadWriteStream + config: TsConfig; + src(): NodeJS.ReadWriteStream; } interface FilterSettings { @@ -51,4 +70,4 @@ declare module "gulp-typescript" { } export = GulpTypescript; -} \ No newline at end of file +} diff --git a/gulp-uglify/gulp-uglify-tests.ts b/gulp-uglify/gulp-uglify-tests.ts index e4f1f0d8a..01cfb06f9 100644 --- a/gulp-uglify/gulp-uglify-tests.ts +++ b/gulp-uglify/gulp-uglify-tests.ts @@ -1,8 +1,8 @@ -/// +/// /// -import gulp = require("gulp"); -import uglify = require("gulp-uglify"); +import * as gulp from 'gulp'; +import * as uglify from 'gulp-uglify'; gulp.task('compress', function() { var tsResult = gulp.src('lib/*.ts') @@ -21,4 +21,4 @@ gulp.task('compress2', function() { } })) .pipe(gulp.dest('dist')); -}); \ No newline at end of file +}); diff --git a/gulp-uglify/gulp-uglify.d.ts b/gulp-uglify/gulp-uglify.d.ts index 840b5110b..b070f3f35 100644 --- a/gulp-uglify/gulp-uglify.d.ts +++ b/gulp-uglify/gulp-uglify.d.ts @@ -4,172 +4,39 @@ // Definitions: https://github.com/borisyankov/DefinitelyTyped /// +/// declare module "gulp-uglify" { - function GulpUglify(options?: IGulpUglifyOptions): NodeJS.ReadWriteStream; + import * as UglifyJS from 'uglify-js'; - interface IGulpUglifyOptions { - /** - * Pass false to skip mangling names. - */ - mangle?: boolean; + namespace GulpUglify { + interface Options { + /** + * Pass false to skip mangling names. + */ + mangle?: boolean; - /** - * Pass if you wish to specify additional output options. The defaults are optimized for best compression. - */ - output?: IOutputOptions; + /** + * Pass if you wish to specify additional output options. The defaults are optimized for best compression. + */ + output?: UglifyJS.BeautifierOptions; - /** - * Pass an object to specify custom compressor options. Pass false to skip compression completely. - */ - compress?: boolean; + /** + * Pass an object to specify custom compressor options. Pass false to skip compression completely. + */ + compress?: UglifyJS.CompressorOptions | boolean; - /** - * A convenience option for options.output.comments. Defaults to preserving no comments. - * all - Preserve all comments in code blocks - * some - Preserve comments that start with a bang (!) or include a Closure Compiler directive (@preserve, @license, @cc_on) - * function - Specify your own comment preservation function. You will be passed the current node and the current comment and are expected to return either true or false. - */ - preserverComments?: string|((node: any, comment: ITokenizer) => boolean); + /** + * A convenience option for options.output.comments. Defaults to preserving no comments. + * all - Preserve all comments in code blocks + * some - Preserve comments that start with a bang (!) or include a Closure Compiler directive (@preserve, @license, @cc_on) + * function - Specify your own comment preservation function. You will be passed the current node and the current comment and are expected to return either true or false. + */ + preserverComments?: string|((node: any, comment: UglifyJS.Tokenizer) => boolean); + } } - interface IOutputOptions { - /** - * Start indentation on every line (only when `beautify`) - */ - indent_start?: number; - - /** - * Indentation level (only when `beautify`) - */ - indent_level?: number; - - /** - * Quote all keys in object literals? - */ - quote_keys?: boolean; - - /** - * Add a space after colon signs? - */ - space_colon?: boolean; - - /** - * Output ASCII-safe? (encodes Unicode characters as ASCII) - */ - ascii_only?: boolean; - - /** - * Escape " /// +/// +/// +/// +/// +/// +/// +/// -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/gulp-watch/gulp-watch-tests.ts b/gulp-watch/gulp-watch-tests.ts index dd237dccc..d912199fd 100644 --- a/gulp-watch/gulp-watch-tests.ts +++ b/gulp-watch/gulp-watch-tests.ts @@ -1,8 +1,8 @@ /// /// -import gulp = require('gulp'); -import watch = require('gulp-watch'); +import * as gulp from 'gulp'; +import * as watch from 'gulp-watch'; gulp.task('stream', () => gulp.src('css/**/*.css') diff --git a/gulp-watch/gulp-watch.d.ts b/gulp-watch/gulp-watch.d.ts index 35fb7de95..74af52547 100644 --- a/gulp-watch/gulp-watch.d.ts +++ b/gulp-watch/gulp-watch.d.ts @@ -22,6 +22,6 @@ declare module 'gulp-watch' { } function watch(glob: string | Array, options?: IOptions, callback?: Function): IWatchStream; - + namespace watch {} export = watch; } diff --git a/hammerjs/hammerjs.d.ts b/hammerjs/hammerjs.d.ts index 0df86dfc6..e2d4a8c52 100644 --- a/hammerjs/hammerjs.d.ts +++ b/hammerjs/hammerjs.d.ts @@ -107,7 +107,7 @@ interface HammerManager emit( event:string, data:any ):void; get( recogniser:Recognizer ):Recognizer; get( recogniser:string ):Recognizer; - off( events:string, handler:( event:HammerInput ) => void ):void; + off( events:string, handler?:( event:HammerInput ) => void ):void; on( events:string, handler:( event:HammerInput ) => void ):void; recognize( inputData:any ):void; remove( recogniser:Recognizer ):HammerManager; diff --git a/handlebars/handlebars.d.ts b/handlebars/handlebars.d.ts index 9a0aa510a..95dd5cc79 100644 --- a/handlebars/handlebars.d.ts +++ b/handlebars/handlebars.d.ts @@ -6,7 +6,10 @@ declare module Handlebars { export function registerHelper(name: string, fn: Function, inverse?: boolean): void; + export function registerHelper(name: Object): void; export function registerPartial(name: string, str: any): void; + export function unregisterHelper(name: string): void; + export function unregisterPartial(name: string): void; export function K(): void; export function createFrame(object: any): any; export function Exception(message: string): void; diff --git a/hapi/hapi.d.ts b/hapi/hapi.d.ts index 7f2fab90e..a832922b8 100644 --- a/hapi/hapi.d.ts +++ b/hapi/hapi.d.ts @@ -1,122 +1,129 @@ -// Type definitions for hapi 8.8.0 +// Type definitions for hapi 12.0.1 // Project: http://github.com/spumko/hapi // Definitions by: Jason Swearingen // Definitions: https://github.com/borisyankov/DefinitelyTyped -//This is a total rewrite of Hakubo's original hapi.d.ts, as it was out of date/incomplete. +//Note/Disclaimer: This .d.ts was created against hapi v8.x but has been incrementally upgraded to 12.x. Some newer features/changes may be missing. YMMV. /// -/// - - - declare module "hapi" { - import http = require("http"); - import stream = require("stream"); - import Events = require("events"); + import http = require("http"); + import stream = require("stream"); + import Events = require("events"); - interface IDictionary { - [key: string]: T; - } + interface IDictionary { + [key: string]: T; + } + + interface IThenable { + then(onFulfilled?: (value: R) => U | IThenable, onRejected?: (error: any) => U | IThenable): IThenable; + then(onFulfilled?: (value: R) => U | IThenable, onRejected?: (error: any) => void): IThenable; + } + + interface 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 { - /** if true, indicates this is a Boom object instance. */ - isBoom: boolean; - /** convenience bool indicating status code >= 500. */ - isServer: boolean; - /** the error message. */ - message: string; - /** the formatted response.Can be directly manipulated after object construction to return a custom error response.Allowed root keys: */ - output: { - /** the HTTP status code (typically 4xx or 5xx). */ - statusCode: number; - /** an object containing any HTTP headers where each key is a header name and value is the header content. */ - headers: IDictionary; - /** the formatted object used as the response payload (stringified).Can be directly manipulated but any changes will be lost if reformat() is called.Any content allowed and by default includes the following content: */ - payload: { - /** the HTTP status code, derived from error.output.statusCode. */ - statusCode: number; - /** the HTTP status message (e.g. 'Bad Request', 'Internal Server Error') derived from statusCode. */ - error: string; - /** the error message derived from error.message. */ - message: string; - }; - }; - /** reformat()rebuilds error.output using the other object properties. */ - reformat(): void; + export interface IBoom extends Error { + /** if true, indicates this is a Boom object instance. */ + isBoom: boolean; + /** convenience bool indicating status code >= 500. */ + isServer: boolean; + /** the error message. */ + message: string; + /** the formatted response.Can be directly manipulated after object construction to return a custom error response.Allowed root keys: */ + output: { + /** the HTTP status code (typically 4xx or 5xx). */ + statusCode: number; + /** an object containing any HTTP headers where each key is a header name and value is the header content. */ + headers: IDictionary; + /** the formatted object used as the response payload (stringified).Can be directly manipulated but any changes will be lost if reformat() is called.Any content allowed and by default includes the following content: */ + payload: { + /** the HTTP status code, derived from error.output.statusCode. */ + statusCode: number; + /** the HTTP status message (e.g. 'Bad Request', 'Internal Server Error') derived from statusCode. */ + error: string; + /** the error message derived from error.message. */ + message: string; + }; + }; + /** reformat()rebuilds error.output using the other object properties. */ + reformat(): void; - } + } - /** cache functionality via the "CatBox" module. */ - export interface ICatBoxCacheOptions { - /** a prototype function or catbox engine object. */ - engine: any; - /** an identifier used later when provisioning or configuring caching for server methods or plugins. Each cache name must be unique. A single item may omit the name option which defines the default cache. If every cache includes a name, a default memory cache is provisions as well. */ - name?: string; - /** if true, allows multiple cache users to share the same segment (e.g. multiple methods using the same cache storage container). Default to false. */ - shared?: boolean; - } + /** cache functionality via the "CatBox" module. */ + export interface ICatBoxCacheOptions { + /** a prototype function or catbox engine object. */ + engine: any; + /** an identifier used later when provisioning or configuring caching for server methods or plugins. Each cache name must be unique. A single item may omit the name option which defines the default cache. If every cache includes a name, a default memory cache is provisions as well. */ + name?: string; + /** if true, allows multiple cache users to share the same segment (e.g. multiple methods using the same cache storage container). Default to false. */ + shared?: boolean; + } - /** Any connections configuration server defaults can be included to override and customize the individual connection. */ - export interface IServerConnectionOptions extends IConnectionConfigurationServerDefaults { - /** - the public hostname or IP address. Used only to set server.info.host and server.info.uri. If not configured, defaults to the operating system hostname and if not available, to 'localhost'.*/ - host?: string; - /** - sets the host name or IP address the connection will listen on.If not configured, defaults to host if present, otherwise to all available network interfaces (i.e. '0.0.0.0').Set to 127.0.0.1 or localhost to restrict connection to only those coming from the same machine.*/ - address?: string; - /** - the TCP port the connection will listen to.Defaults to an ephemeral port (0) which uses an available port when the server is started (and assigned to server.info.port).If port is a string containing a '/' character, it is used as a UNIX domain socket path and if it starts with '\.\pipe' as a Windows named pipe.*/ - port?: string|number; - /** - the full public URI without the path (e.g. 'http://example.com:8080').If present, used as the connection info.uri otherwise constructed from the connection settings.*/ - uri?: string; - /** - optional node.js HTTP (or HTTPS) http.Server object or any compatible object.If the listener needs to be manually started, set autoListen to false.If the listener uses TLS, set tls to true.*/ - listener?: any; - /** - indicates that the connection.listener will be started manually outside the framework.Cannot be specified with a port setting.Defaults to true.*/ - autoListen?: boolean; - /** caching headers configuration: */ - cache?: { - /** - an array of HTTP response status codes (e.g. 200) which are allowed to include a valid caching directive.Defaults to [200]. */ - statuses: number[]; - }; - /** - a string or string array of labels used to server.select() specific connections matching the specified labels.Defaults to an empty array [](no labels).*/ - labels?: string|string[]; - /** - used to create an HTTPS connection.The tls object is passed unchanged as options to the node.js HTTPS server as described in the node.js HTTPS documentation.Set to true when passing a listener object that has been configured to use TLS directly. */ - tls?: boolean|Object; + /** Any connections configuration server defaults can be included to override and customize the individual connection. */ + export interface IServerConnectionOptions extends IConnectionConfigurationServerDefaults { + /** - the public hostname or IP address. Used only to set server.info.host and server.info.uri. If not configured, defaults to the operating system hostname and if not available, to 'localhost'.*/ + host?: string; + /** - sets the host name or IP address the connection will listen on.If not configured, defaults to host if present, otherwise to all available network interfaces (i.e. '0.0.0.0').Set to 127.0.0.1 or localhost to restrict connection to only those coming from the same machine.*/ + address?: string; + /** - the TCP port the connection will listen to.Defaults to an ephemeral port (0) which uses an available port when the server is started (and assigned to server.info.port).If port is a string containing a '/' character, it is used as a UNIX domain socket path and if it starts with '\.\pipe' as a Windows named pipe.*/ + port?: string | number; + /** - the full public URI without the path (e.g. 'http://example.com:8080').If present, used as the connection info.uri otherwise constructed from the connection settings.*/ + uri?: string; + /** - optional node.js HTTP (or HTTPS) http.Server object or any compatible object.If the listener needs to be manually started, set autoListen to false.If the listener uses TLS, set tls to true.*/ + listener?: any; + /** - indicates that the connection.listener will be started manually outside the framework.Cannot be specified with a port setting.Defaults to true.*/ + autoListen?: boolean; + /** caching headers configuration: */ + cache?: { + /** - an array of HTTP response status codes (e.g. 200) which are allowed to include a valid caching directive.Defaults to [200]. */ + statuses: number[]; + }; + /** - a string or string array of labels used to server.select() specific connections matching the specified labels.Defaults to an empty array [](no labels).*/ + labels?: string | string[]; + /** - used to create an HTTPS connection.The tls object is passed unchanged as options to the node.js HTTPS server as described in the node.js HTTPS documentation.Set to true when passing a listener object that has been configured to use TLS directly. */ + tls?: boolean | { key?: string; cert?: string; pfx?: string; } | Object; - } + } - export interface IConnectionConfigurationServerDefaults { - /** application-specific connection configuration which can be accessed via connection.settings.app. Provides a safe place to store application configuration without potential conflicts with the framework internals. Should not be used to configure plugins which should use plugins[name]. Note the difference between connection.settings.app which is used to store configuration values and connection.app which is meant for storing run-time state. */ - app?: any; - /** connection load limits configuration where: */ - load?: { - /** maximum V8 heap size over which incoming requests are rejected with an HTTP Server Timeout (503) response. Defaults to 0 (no limit). */ - maxHeapUsedBytes: number; - /** maximum process RSS size over which incoming requests are rejected with an HTTP Server Timeout (503) response. Defaults to 0 (no limit). */ - maxRssBytes: number; - /** maximum event loop delay duration in milliseconds over which incoming requests are rejected with an HTTP Server Timeout (503) response. Defaults to 0 (no limit). */ - maxEventLoopDelay: number; - }; - /** plugin-specific configuration which can later be accessed via connection.settings.plugins. Provides a place to store and pass connection-specific plugin configuration. plugins is an object where each key is a plugin name and the value is the configuration. Note the difference between connection.settings.plugins which is used to store configuration values and connection.plugins which is meant for storing run-time state. */ - plugins?: any; - /** controls how incoming request URIs are matched against the routing table: */ - router?: { - /** determines whether the paths '/example' and '/EXAMPLE' are considered different resources. Defaults to true. */ - isCaseSensitive: boolean; - /** removes trailing slashes on incoming paths. Defaults to false. */ - stripTrailingSlash: boolean; - }; - /** a route options object used to set the default configuration for every route. */ - routes?: IRouteAdditionalConfigurationOptions; - state?: IServerState; - } + export interface IConnectionConfigurationServerDefaults { + /** application-specific connection configuration which can be accessed via connection.settings.app. Provides a safe place to store application configuration without potential conflicts with the framework internals. Should not be used to configure plugins which should use plugins[name]. Note the difference between connection.settings.app which is used to store configuration values and connection.app which is meant for storing run-time state. */ + app?: any; + /** connection load limits configuration where: */ + load?: { + /** maximum V8 heap size over which incoming requests are rejected with an HTTP Server Timeout (503) response. Defaults to 0 (no limit). */ + maxHeapUsedBytes: number; + /** maximum process RSS size over which incoming requests are rejected with an HTTP Server Timeout (503) response. Defaults to 0 (no limit). */ + maxRssBytes: number; + /** maximum event loop delay duration in milliseconds over which incoming requests are rejected with an HTTP Server Timeout (503) response. Defaults to 0 (no limit). */ + maxEventLoopDelay: number; + }; + /** plugin-specific configuration which can later be accessed via connection.settings.plugins. Provides a place to store and pass connection-specific plugin configuration. plugins is an object where each key is a plugin name and the value is the configuration. Note the difference between connection.settings.plugins which is used to store configuration values and connection.plugins which is meant for storing run-time state. */ + plugins?: any; + /** controls how incoming request URIs are matched against the routing table: */ + router?: { + /** determines whether the paths '/example' and '/EXAMPLE' are considered different resources. Defaults to true. */ + isCaseSensitive: boolean; + /** removes trailing slashes on incoming paths. Defaults to false. */ + stripTrailingSlash: boolean; + }; + /** a route options object used to set the default configuration for every route. */ + routes?: IRouteAdditionalConfigurationOptions; + state?: IServerState; + } - /** Note that the options object is deeply cloned and cannot contain any values that are unsafe to perform deep copy on.*/ - export interface IServerOptions { - /** application-specific configuration which can later be accessed via server.settings.app. Note the difference between server.settings.app which is used to store static configuration values and server.app which is meant for storing run-time state. Defaults to {}. */ - app?: any; + /** Note that the options object is deeply cloned and cannot contain any values that are unsafe to perform deep copy on.*/ + export interface IServerOptions { + /** application-specific configuration which can later be accessed via server.settings.app. Note the difference between server.settings.app which is used to store static configuration values and server.app which is meant for storing run-time state. Defaults to {}. */ + app?: any; /** sets up server-side caching. Every server includes a default cache for storing application state. By default, a simple memory-based cache is created which has limited capacity and capabilities. hapi uses catbox for its cache which includes support for common storage solutions (e.g. Redis, MongoDB, Memcached, and Riak). Caching is only utilized if methods and plugins explicitly store their state in the cache. The server cache configuration only defines the storage container itself. cache can be assigned: a prototype function (usually obtained by calling require() on a catbox strategy such as require('catbox-redis')). a configuration object with the following options: @@ -125,86 +132,86 @@ declare module "hapi" { sharedif true, allows multiple cache users to share the same segment (e.g. multiple methods using the same cache storage container). Default to false. other options passed to the catbox strategy used. an array of the above object for configuring multiple cache instances, each with a unique name. When an array of objects is provided, multiple cache connections are established and each array item (except one) must include a name. */ - cache?: string|ICatBoxCacheOptions|Array|any; - /** sets the default connections configuration which can be overridden by each connection where: */ - connections?: IConnectionConfigurationServerDefaults; - /** determines which logged events are sent to the console (this should only be used for development and does not affect which events are actually logged internally and recorded). Set to false to disable all console logging, or to an object*/ - debug?: boolean|{ - /** - a string array of server log tags to be displayed via console.error() when the events are logged via server.log() as well as internally generated server logs. For example, to display all errors, set the option to ['error']. To turn off all console debug messages set it to false. Defaults to uncaught errors thrown in external code (these errors are handled automatically and result in an Internal Server Error response) or runtime errors due to developer error. */ - log: string[]; - /** - a string array of request log tags to be displayed via console.error() when the events are logged via request.log() as well as internally generated request logs. For example, to display all errors, set the option to ['error']. To turn off all console debug messages set it to false. Defaults to uncaught errors thrown in external code (these errors are handled automatically and result in an Internal Server Error response) or runtime errors due to developer error.*/ - request: string[]; - }; - /** file system related settings*/ - files?: { - /** sets the maximum number of file etag hash values stored in the etags cache. Defaults to 10000.*/ - etagsCacheMaxSize?: number; - }; - /** process load monitoring*/ - load?: { - /** the frequency of sampling in milliseconds. Defaults to 0 (no sampling).*/ - sampleInterval?: number; - }; + cache?: string | ICatBoxCacheOptions | Array | any; + /** sets the default connections configuration which can be overridden by each connection where: */ + connections?: IConnectionConfigurationServerDefaults; + /** determines which logged events are sent to the console (this should only be used for development and does not affect which events are actually logged internally and recorded). Set to false to disable all console logging, or to an object*/ + debug?: boolean | { + /** - a string array of server log tags to be displayed via console.error() when the events are logged via server.log() as well as internally generated server logs. For example, to display all errors, set the option to ['error']. To turn off all console debug messages set it to false. Defaults to uncaught errors thrown in external code (these errors are handled automatically and result in an Internal Server Error response) or runtime errors due to developer error. */ + log: string[]; + /** - a string array of request log tags to be displayed via console.error() when the events are logged via request.log() as well as internally generated request logs. For example, to display all errors, set the option to ['error']. To turn off all console debug messages set it to false. Defaults to uncaught errors thrown in external code (these errors are handled automatically and result in an Internal Server Error response) or runtime errors due to developer error.*/ + request: string[]; + }; + /** file system related settings*/ + files?: { + /** sets the maximum number of file etag hash values stored in the etags cache. Defaults to 10000.*/ + etagsCacheMaxSize?: number; + }; + /** process load monitoring*/ + load?: { + /** the frequency of sampling in milliseconds. Defaults to 0 (no sampling).*/ + sampleInterval?: number; + }; - /** options passed to the mimos module (https://github.com/hapijs/mimos) when generating the mime database used by the server and accessed via server.mime.*/ - mime?: any; - /** if true, does not load the inert (file and directory support), h2o2 (proxy support), and vision (views support) plugins automatically. The plugins can be loaded manually after construction. Defaults to false (plugins loaded). */ - minimal?: boolean; - /** plugin-specific configuration which can later be accessed via server.settings.plugins. plugins is an object where each key is a plugin name and the value is the configuration. Note the difference between server.settings.plugins which is used to store static configuration values and server.plugins which is meant for storing run-time state. Defaults to {}.*/ - plugins?: IDictionary; + /** options passed to the mimos module (https://github.com/hapijs/mimos) when generating the mime database used by the server and accessed via server.mime.*/ + mime?: any; + /** if true, does not load the inert (file and directory support), h2o2 (proxy support), and vision (views support) plugins automatically. The plugins can be loaded manually after construction. Defaults to false (plugins loaded). */ + minimal?: boolean; + /** plugin-specific configuration which can later be accessed via server.settings.plugins. plugins is an object where each key is a plugin name and the value is the configuration. Note the difference between server.settings.plugins which is used to store static configuration values and server.plugins which is meant for storing run-time state. Defaults to {}.*/ + plugins?: IDictionary; - } + } - export interface IServerViewCompile { - (template: string, options: any): void; - (template: string, options: any, callback: (err: any, compiled: (context: any, options: any, callback: (err: any, rendered: boolean) => void) => void) => void): void; - } + export interface IServerViewCompile { + (template: string, options: any): void; + (template: string, options: any, callback: (err: any, compiled: (context: any, options: any, callback: (err: any, rendered: boolean) => void) => void) => void): void; + } - export interface IServerViewsAdditionalOptions { - /** path - the root file path used to resolve and load the templates identified when calling reply.view().Defaults to current working directory.*/ - path?: string; + export interface IServerViewsAdditionalOptions { + /** path - the root file path used to resolve and load the templates identified when calling reply.view().Defaults to current working directory.*/ + path?: string; /**partialsPath - the root file path where partials are located.Partials are small segments of template code that can be nested and reused throughout other templates.Defaults to no partials support (empty path). */ - partialsPath?: string; - /**helpersPath - the directory path where helpers are located.Helpers are functions used within templates to perform transformations and other data manipulations using the template context or other inputs.Each '.js' file in the helpers directory is loaded and the file name is used as the helper name.The files must export a single method with the signature function(context) and return a string.Sub - folders are not supported and are ignored.Defaults to no helpers support (empty path).Note that jade does not support loading helpers this way.*/ - helpersPath?: string; - /**relativeTo - a base path used as prefix for path and partialsPath.No default.*/ - relativeTo?: string; + partialsPath?: string; + /**helpersPath - the directory path where helpers are located.Helpers are functions used within templates to perform transformations and other data manipulations using the template context or other inputs.Each '.js' file in the helpers directory is loaded and the file name is used as the helper name.The files must export a single method with the signature function(context) and return a string.Sub - folders are not supported and are ignored.Defaults to no helpers support (empty path).Note that jade does not support loading helpers this way.*/ + helpersPath?: string; + /**relativeTo - a base path used as prefix for path and partialsPath.No default.*/ + relativeTo?: string; - /**layout - if set to true or a layout filename, layout support is enabled.A layout is a single template file used as the parent template for other view templates in the same engine.If true, the layout template name must be 'layout.ext' where 'ext' is the engine's extension. Otherwise, the provided filename is suffixed with the engine's extension and loaded.Disable layout when using Jade as it will handle including any layout files independently.Defaults to false.*/ - layout?: boolean; - /**layoutPath - the root file path where layout templates are located (using the relativeTo prefix if present). Defaults to path.*/ - layoutPath?: string; - /**layoutKeyword - the key used by the template engine to denote where primary template content should go.Defaults to 'content'.*/ - layoutKeywork?: string; - /**encoding - the text encoding used by the templates when reading the files and outputting the result.Defaults to 'utf8'.*/ - encoding?: string; - /**isCached - if set to false, templates will not be cached (thus will be read from file on every use).Defaults to true.*/ - isCached?: boolean; - /**allowAbsolutePaths - if set to true, allows absolute template paths passed to reply.view().Defaults to false.*/ - allowAbsolutePaths?: boolean; - /**allowInsecureAccess - if set to true, allows template paths passed to reply.view() to contain '../'.Defaults to false.*/ - allowInsecureAccess?: boolean; - /**compileOptions - options object passed to the engine's compile function. Defaults to empty options {}.*/ - compileOptions?: any; - /**runtimeOptions - options object passed to the returned function from the compile operation.Defaults to empty options {}.*/ - runtimeOptions?: any; - /**contentType - the content type of the engine results.Defaults to 'text/html'.*/ - contentType?: string; - /**compileMode - specify whether the engine compile() method is 'sync' or 'async'.Defaults to 'sync'.*/ - compileMode?: string; - /**context - a global context used with all templates.The global context option can be either an object or a function that takes no arguments and returns a context object.When rendering views, the global context will be merged with any context object specified on the handler or using reply.view().When multiple context objects are used, values from the global context always have lowest precedence.*/ - context?: any; - } + /**layout - if set to true or a layout filename, layout support is enabled.A layout is a single template file used as the parent template for other view templates in the same engine.If true, the layout template name must be 'layout.ext' where 'ext' is the engine's extension. Otherwise, the provided filename is suffixed with the engine's extension and loaded.Disable layout when using Jade as it will handle including any layout files independently.Defaults to false.*/ + layout?: boolean; + /**layoutPath - the root file path where layout templates are located (using the relativeTo prefix if present). Defaults to path.*/ + layoutPath?: string; + /**layoutKeyword - the key used by the template engine to denote where primary template content should go.Defaults to 'content'.*/ + layoutKeywork?: string; + /**encoding - the text encoding used by the templates when reading the files and outputting the result.Defaults to 'utf8'.*/ + encoding?: string; + /**isCached - if set to false, templates will not be cached (thus will be read from file on every use).Defaults to true.*/ + isCached?: boolean; + /**allowAbsolutePaths - if set to true, allows absolute template paths passed to reply.view().Defaults to false.*/ + allowAbsolutePaths?: boolean; + /**allowInsecureAccess - if set to true, allows template paths passed to reply.view() to contain '../'.Defaults to false.*/ + allowInsecureAccess?: boolean; + /**compileOptions - options object passed to the engine's compile function. Defaults to empty options {}.*/ + compileOptions?: any; + /**runtimeOptions - options object passed to the returned function from the compile operation.Defaults to empty options {}.*/ + runtimeOptions?: any; + /**contentType - the content type of the engine results.Defaults to 'text/html'.*/ + contentType?: string; + /**compileMode - specify whether the engine compile() method is 'sync' or 'async'.Defaults to 'sync'.*/ + compileMode?: string; + /**context - a global context used with all templates.The global context option can be either an object or a function that takes no arguments and returns a context object.When rendering views, the global context will be merged with any context object specified on the handler or using reply.view().When multiple context objects are used, values from the global context always have lowest precedence.*/ + context?: any; + } - export interface IServerViewsEnginesOptions extends IServerViewsAdditionalOptions { + export interface IServerViewsEnginesOptions extends IServerViewsAdditionalOptions { /**- the npm module used for rendering the templates.The module object must contain: "module", the rendering function. The required function signature depends on the compileMode settings. * If the compileMode is 'sync', the signature is compile(template, options), the return value is a function with signature function(context, options), and the method is allowed to throw errors.If the compileMode is 'async', the signature is compile(template, options, callback) where callback has the signature function(err, compiled) where compiled is a function with signature function(context, options, callback) and callback has the signature function(err, rendered).*/ - module: { - compile? (template: any, options: any): (context: any, options: any) => void; - compile? (template: any, options: any, callback: (err: any, compiled: (context: any, options: any, callback: (err: any, rendered: any) => void) => void) => void): void; - }; - } + module: { + compile?(template: any, options: any): (context: any, options: any) => void; + compile?(template: any, options: any, callback: (err: any, compiled: (context: any, options: any, callback: (err: any, rendered: any) => void) => void) => void): void; + }; + } /**Initializes the server views manager var Hapi = require('hapi'); @@ -219,12 +226,12 @@ declare module "hapi" { }); When server.views() is called within a plugin, the views manager is only available to plugins methods. */ - export interface IServerViewsConfiguration extends IServerViewsAdditionalOptions { - /** - required object where each key is a file extension (e.g. 'html', 'hbr'), mapped to the npm module used for rendering the templates.Alternatively, the extension can be mapped to an object with the following options:*/ - engines: IDictionary|IServerViewsEnginesOptions; - /** defines the default filename extension to append to template names when multiple engines are configured and not explicit extension is provided for a given template. No default value.*/ - defaultExtension?: string; - } + export interface IServerViewsConfiguration extends IServerViewsAdditionalOptions { + /** - required object where each key is a file extension (e.g. 'html', 'hbr'), mapped to the npm module used for rendering the templates.Alternatively, the extension can be mapped to an object with the following options:*/ + engines: IDictionary | IServerViewsEnginesOptions; + /** defines the default filename extension to append to template names when multiple engines are configured and not explicit extension is provided for a given template. No default value.*/ + defaultExtension?: string; + } /** Concludes the handler activity by setting a response and returning control over to the framework where: erran optional error response. @@ -232,275 +239,280 @@ declare module "hapi" { Since an request can only have one response regardless if it is an error or success, the reply() method can only result in a single response value. This means that passing both an err and result will only use the err. There is no requirement for either err or result to be (or not) an Error object. The framework will simply use the first argument if present, otherwise the second. The method supports two arguments to be compatible with the common callback pattern of error first. FLOW CONTROL: When calling reply(), the framework waits until process.nextTick() to continue processing the request and transmit the response. This enables making changes to the returned response object before the response is sent. This means the framework will resume as soon as the handler method exits. To suspend this behavior, the returned response object supports the following methods: hold(), send() */ - export interface IReply { - (err: Error, - result?: string|number|boolean|Buffer|stream.Stream | Promise | 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; + export interface IReply { + (err: Error, + result?: string | number | boolean | Buffer | stream.Stream | IPromise | T, + /** Note that when used to return both an error and credentials in the authentication methods, reply() must be called with three arguments function(err, null, data) where data is the additional authentication information. */ + credentialData?: any + ): IBoom; + /** Note that if result is a Stream with a statusCode property, that status code will be used as the default response code. */ + (result: string | number | boolean | Buffer | stream.Stream | IPromise | T): Response; /** Returns control back to the framework without setting a response. If called in the handler, the response defaults to an empty payload with status code 200. * The data argument is only used for passing back authentication data and is ignored elsewhere. */ - continue(credentialData?: any): void; + continue(credentialData?: any): void; - /** Transmits a file from the file system. The 'Content-Type' header defaults to the matching mime type based on filename extension. The response flow control rules do not apply. */ - file( - /** the file path. */ - path: string, - /** optional settings: */ - options?: { - /** - an optional filename to specify if sending a 'Content-Disposition' header, defaults to the basename of path*/ - filename?: string; + /** Transmits a file from the file system. The 'Content-Type' header defaults to the matching mime type based on filename extension. The response flow control rules do not apply. */ + file( + /** the file path. */ + path: string, + /** optional settings: */ + options?: { + /** - an optional filename to specify if sending a 'Content-Disposition' header, defaults to the basename of path*/ + filename?: string; /** specifies whether to include the 'Content-Disposition' header with the response. Available values: false - header is not included. This is the default value. 'attachment' 'inline'*/ - mode?: boolean|string; - /** if true, looks for the same filename with the '.gz' suffix for a pre-compressed version of the file to serve if the request supports content encoding. Defaults to false. */ - lookupCompressed: boolean; - }): void; + mode?: boolean | string; + /** if true, looks for the same filename with the '.gz' suffix for a pre-compressed version of the file to serve if the request supports content encoding. Defaults to false. */ + lookupCompressed: boolean; + }): void; /** Concludes the handler activity by returning control over to the router with a templatized view response. the response flow control rules apply. */ - view( - /** the template filename and path, relative to the templates path configured via the server views manager. */ - template: string, - /** optional object used by the template to render context-specific result. Defaults to no context {}. */ - context?: {}, - /** optional object used to override the server's views manager configuration for this response. Cannot override isCached, partialsPath, or helpersPath which are only loaded at initialization. */ - options?: any): Response; + view( + /** the template filename and path, relative to the templates path configured via the server views manager. */ + template: string, + /** optional object used by the template to render context-specific result. Defaults to no context {}. */ + context?: {}, + /** optional object used to override the server's views manager configuration for this response. Cannot override isCached, partialsPath, or helpersPath which are only loaded at initialization. */ + options?: any): Response; /** Concludes the handler activity by returning control over to the router and informing the router that a response has already been sent back directly via request.raw.res and that no further response action is needed The response flow control rules do not apply. */ - close(options?: { - /** if false, the router will not call request.raw.res.end()) to ensure the response was ended. Defaults to true. */ - end?: boolean; - }): void; + close(options?: { + /** if false, the router will not call request.raw.res.end()) to ensure the response was ended. Defaults to true. */ + end?: boolean; + }): void; /** Proxies the request to an upstream endpoint. the response flow control rules do not apply. */ - proxy(/** an object including the same keys and restrictions defined by the route proxy handler options. */ - options: IProxyHandlerConfig): void; + proxy(/** an object including the same keys and restrictions defined by the route proxy handler options. */ + options: IProxyHandlerConfig): void; /** Redirects the client to the specified uri. Same as calling reply().redirect(uri). he response flow control rules apply. */ - redirect(uri: string): Response; - } + redirect(uri: string): ResponseRedirect; + } - export interface ISessionHandler { - (request: Request, reply: IReply): void; - } - export interface IRequestHandler { - (request: Request): T; - } + export interface ISessionHandler { + (request: Request, reply: IReply): void; + } + export interface IRequestHandler { + (request: Request): T; + } - export interface IFailAction { - (source: string, error: any, next: () => void): void - } - /** generates a reverse proxy handler */ - export interface IProxyHandlerConfig { - /** the upstream service host to proxy requests to. The same path on the client request will be used as the path on the host.*/ - host?: string; - /** the upstream service port. */ - port?: number; + export interface IFailAction { + (source: string, error: any, next: () => void): void + } + /** generates a reverse proxy handler */ + export interface IProxyHandlerConfig { + /** the upstream service host to proxy requests to. The same path on the client request will be used as the path on the host.*/ + host?: string; + /** the upstream service port. */ + port?: number; /** The protocol to use when making a request to the proxied host: 'http' 'https'*/ - protocol?: string; - /** an absolute URI used instead of the incoming host, port, protocol, path, and query. Cannot be used with host, port, protocol, or mapUri.*/ - uri?: string; - /** if true, forwards the headers sent from the client to the upstream service being proxied to, headers sent from the upstream service will also be forwarded to the client. Defaults to false.*/ - passThrough?: boolean; - /** localStatePassThrough - if false, any locally defined state is removed from incoming requests before being passed upstream. This is a security feature to prevent local state (e.g. authentication cookies) from leaking upstream to other servers along with the cookies intended for those servers. This value can be overridden on a per state basis via the server.state() passThrough option. Defaults to false.*/ - localStatePassThrough?: boolean; - /**acceptEncoding - if false, does not pass-through the 'Accept-Encoding' HTTP header which is useful when using an onResponse post-processing to avoid receiving an encoded response (e.g. gzipped). Can only be used together with passThrough. Defaults to true (passing header).*/ - acceptEncoding?: boolean; - /** rejectUnauthorized - sets the rejectUnauthorized property on the https agent making the request. This value is only used when the proxied server uses TLS/SSL. When set it will override the node.js rejectUnauthorized property. If false then ssl errors will be ignored. When true the server certificate is verified and an 500 response will be sent when verification fails. This shouldn't be used alongside the agent setting as the agent will be used instead. Defaults to the https agent default value of true.*/ - rejectUnauthorized?: boolean; - /**if true, sets the 'X-Forwarded-For', 'X-Forwarded-Port', 'X-Forwarded-Proto' headers when making a request to the proxied upstream endpoint. Defaults to false.*/ - xforward?: boolean; - /** the maximum number of HTTP redirections allowed, to be followed automatically by the handler. Set to false or 0 to disable all redirections (the response will contain the redirection received from the upstream service). If redirections are enabled, no redirections (301, 302, 307, 308) will be passed along to the client, and reaching the maximum allowed redirections will return an error response. Defaults to false.*/ - redirects?: boolean|number; - /**number of milliseconds before aborting the upstream request. Defaults to 180000 (3 minutes).*/ - timeout?: number; + protocol?: string; + /** an absolute URI used instead of the incoming host, port, protocol, path, and query. Cannot be used with host, port, protocol, or mapUri.*/ + uri?: string; + /** if true, forwards the headers sent from the client to the upstream service being proxied to, headers sent from the upstream service will also be forwarded to the client. Defaults to false.*/ + passThrough?: boolean; + /** localStatePassThrough - if false, any locally defined state is removed from incoming requests before being passed upstream. This is a security feature to prevent local state (e.g. authentication cookies) from leaking upstream to other servers along with the cookies intended for those servers. This value can be overridden on a per state basis via the server.state() passThrough option. Defaults to false.*/ + localStatePassThrough?: boolean; + /**acceptEncoding - if false, does not pass-through the 'Accept-Encoding' HTTP header which is useful when using an onResponse post-processing to avoid receiving an encoded response (e.g. gzipped). Can only be used together with passThrough. Defaults to true (passing header).*/ + acceptEncoding?: boolean; + /** rejectUnauthorized - sets the rejectUnauthorized property on the https agent making the request. This value is only used when the proxied server uses TLS/SSL. When set it will override the node.js rejectUnauthorized property. If false then ssl errors will be ignored. When true the server certificate is verified and an 500 response will be sent when verification fails. This shouldn't be used alongside the agent setting as the agent will be used instead. Defaults to the https agent default value of true.*/ + rejectUnauthorized?: boolean; + /**if true, sets the 'X-Forwarded-For', 'X-Forwarded-Port', 'X-Forwarded-Proto' headers when making a request to the proxied upstream endpoint. Defaults to false.*/ + xforward?: boolean; + /** the maximum number of HTTP redirections allowed, to be followed automatically by the handler. Set to false or 0 to disable all redirections (the response will contain the redirection received from the upstream service). If redirections are enabled, no redirections (301, 302, 307, 308) will be passed along to the client, and reaching the maximum allowed redirections will return an error response. Defaults to false.*/ + redirects?: boolean | number; + /**number of milliseconds before aborting the upstream request. Defaults to 180000 (3 minutes).*/ + timeout?: number; /** a function used to map the request URI to the proxied URI. Cannot be used together with host, port, protocol, or uri. The function signature is function(request, callback) where: request - is the incoming request object. callback - is function(err, uri, headers) where: err - internal error condition. uri - the absolute proxy URI. headers - optional object where each key is an HTTP request header and the value is the header content.*/ - mapUri?: (request: Request, callback: (err: any, uri: string, headers?: { [key: string]: string }) => void) => void; - /** a custom function for processing the response from the upstream service before sending to the client. Useful for custom error handling of responses from the proxied endpoint or other payload manipulation. Function signature is function(err, res, request, reply, settings, ttl) where: - err - internal or upstream error returned from attempting to contact the upstream proxy. - res - the node response object received from the upstream service. res is a readable stream (use the wreck module read method to easily convert it to a Buffer or string). - request - is the incoming request object. - reply - the reply interface function. - settings - the proxy handler configuration. - ttl - the upstream TTL in milliseconds if proxy.ttl it set to 'upstream' and the upstream response included a valid 'Cache-Control' header with 'max-age'.*/ - onResponse?: ( - err: any, - res: http.ServerResponse, - req: Request, - reply: () => void, - settings: IProxyHandlerConfig, - ttl: number - ) => void; - /** if set to 'upstream', applies the upstream response caching policy to the response using the response.ttl() method (or passed as an argument to the onResponse method if provided).*/ - ttl?: number; - /** - a node http(s) agent to be used for connections to upstream server. see https://nodejs.org/api/http.html#http_class_http_agent */ - agent?: http.Agent; - /** sets the maximum number of sockets available per outgoing proxy host connection. false means use the wreck module default value (Infinity). Does not affect non-proxy outgoing client connections. Defaults to Infinity.*/ - maxSockets?: boolean|number; - } - /** TODO: fill in joi definition */ - export interface IJoi { + mapUri?: (request: Request, callback: (err: any, uri: string, headers?: { [key: string]: string }) => void) => void; + /** a custom function for processing the response from the upstream service before sending to the client. Useful for custom error handling of responses from the proxied endpoint or other payload manipulation. Function signature is function(err, res, request, reply, settings, ttl) where: - err - internal or upstream error returned from attempting to contact the upstream proxy. - res - the node response object received from the upstream service. res is a readable stream (use the wreck module read method to easily convert it to a Buffer or string). - request - is the incoming request object. - reply - the reply interface function. - settings - the proxy handler configuration. - ttl - the upstream TTL in milliseconds if proxy.ttl it set to 'upstream' and the upstream response included a valid 'Cache-Control' header with 'max-age'.*/ + onResponse?: ( + err: any, + res: http.ServerResponse, + req: Request, + reply: IReply, + settings: IProxyHandlerConfig, + ttl: number + ) => void; + /** if set to 'upstream', applies the upstream response caching policy to the response using the response.ttl() method (or passed as an argument to the onResponse method if provided).*/ + ttl?: number; + /** - a node http(s) agent to be used for connections to upstream server. see https://nodejs.org/api/http.html#http_class_http_agent */ + agent?: http.Agent; + /** sets the maximum number of sockets available per outgoing proxy host connection. false means use the wreck module default value (Infinity). Does not affect non-proxy outgoing client connections. Defaults to Infinity.*/ + maxSockets?: boolean | number; + } + /** TODO: fill in joi definition */ + export interface IJoi { - } - /** a validation function using the signature function(value, options, next) */ - export interface IValidationFunction { + } + /** a validation function using the signature function(value, options, next) */ + export interface IValidationFunction { - (/** the object containing the path parameters. */ - value: any, - /** the server validation options. */ - options: any, - /** the callback function called when validation is completed. */ - next: (err: any, value: any) => void): void; - } - /** a custom error handler function with the signature 'function(request, reply, source, error)` */ - export interface IRouteFailFunction { - /** a custom error handler function with the signature 'function(request, reply, source, error)` */ - ( - /** - the [request object]. */ - request: Request, - /** the continuation reply interface. */ - reply: IReply, - /** the source of the invalid field (e.g. 'path', 'query', 'payload'). */ - source: string, - /** the error object prepared for the client response (including the validation function error under error.data). */ - error: any): void; - } + (/** the object containing the path parameters. */ + value: any, + /** the server validation options. */ + options: any, + /** the callback function called when validation is completed. */ + next: (err: any, value: any) => void): void; + } + /** a custom error handler function with the signature 'function(request, reply, source, error)` */ + export interface IRouteFailFunction { + /** a custom error handler function with the signature 'function(request, reply, source, error)` */ + ( + /** - the [request object]. */ + request: Request, + /** the continuation reply interface. */ + reply: IReply, + /** the source of the invalid field (e.g. 'path', 'query', 'payload'). */ + source: string, + /** the error object prepared for the client response (including the validation function error under error.data). */ + error: any): void; + } - /** Each route can be customize to change the default behavior of the request lifecycle using the following options: */ - export interface IRouteAdditionalConfigurationOptions { - /** application specific configuration.Should not be used by plugins which should use plugins[name] instead. */ - app?: any; + /** Each route can be customize to change the default behavior of the request lifecycle using the following options: */ + export interface IRouteAdditionalConfigurationOptions { + /** application specific configuration.Should not be used by plugins which should use plugins[name] instead. */ + app?: any; /** authentication configuration.Value can be: false to disable authentication if a default strategy is set. a string with the name of an authentication strategy registered with server.auth.strategy(). an object */ - auth?: boolean|string| - { + auth?: boolean | string | + { /** the authentication mode.Defaults to 'required' if a server authentication strategy is configured, otherwise defaults to no authentication.Available values: 'required'authentication is required. 'optional'authentication is optional (must be valid if present). 'try'same as 'optional' but allows for invalid authentication. */ - mode: string; - /** a string array of strategy names in order they should be attempted.If only one strategy is used, strategy can be used instead with the single string value.Defaults to the default authentication strategy which is available only when a single strategy is configured. */ - strategies: string | Array; + mode?: string; + /** a string array of strategy names in order they should be attempted.If only one strategy is used, strategy can be used instead with the single string value.Defaults to the default authentication strategy which is available only when a single strategy is configured. */ + strategies?: string | Array; /** if set, the payload (in requests other than 'GET' and 'HEAD') is authenticated after it is processed.Requires a strategy with payload authentication support (e.g.Hawk).Cannot be set to a value other than 'required' when the scheme sets the options.payload to true.Available values: falseno payload authentication.This is the default value. 'required'payload authentication required.This is the default value when the scheme sets options.payload to true. 'optional'payload authentication performed only when the client includes payload authentication information (e.g.hash attribute in Hawk). */ - payload?: string; - /** the application scope required to access the route.Value can be a scope string or an array of scope strings.The authenticated credentials object scope property must contain at least one of the scopes defined to access the route.Set to false to remove scope requirements.Defaults to no scope required. */ - scope?: string|Array|boolean; + payload?: string; + /** the application scope required to access the route.Value can be a scope string or an array of scope strings.The authenticated credentials object scope property must contain at least one of the scopes defined to access the route.Set to false to remove scope requirements.Defaults to no scope required. */ + scope?: string | Array | boolean; /** the required authenticated entity type.If set, must match the entity value of the authentication credentials.Available values: anythe authentication can be on behalf of a user or application.This is the default value. userthe authentication must be on behalf of a user. appthe authentication must be on behalf of an application. */ - entity?: string; - }; - /** an object passed back to the provided handler (via this) when called. */ - bind?: any; - /** if the route method is 'GET', the route can be configured to include caching directives in the response using the following options */ - cache?: { + entity?: string; + /** + * an object or array of objects specifying the route access rules. Each rule is evaluated against an incoming + * request and access is granted if at least one rule matches. Each rule object must include at least one of: + */ + access?: IRouteAdditionalConfigurationAuthAccess | IRouteAdditionalConfigurationAuthAccess[]; + }; + /** an object passed back to the provided handler (via this) when called. */ + bind?: any; + /** if the route method is 'GET', the route can be configured to include caching directives in the response using the following options */ + cache?: { /** mines the privacy flag included in clientside caching using the 'Cache-Control' header.Values are: fault'no privacy flag.This is the default setting. 'public'mark the response as suitable for public caching. 'private'mark the response as suitable only for private caching. */ - privacy: string; - /** relative expiration expressed in the number of milliseconds since the item was saved in the cache.Cannot be used together with expiresAt. */ - expiresIn: number; - /** time of day expressed in 24h notation using the 'HH:MM' format, at which point all cache records for the route expire.Cannot be used together with expiresIn. */ - expiresAt: string; - }; - /** the Cross- Origin Resource Sharing protocol allows browsers to make cross- origin API calls.CORS is required by web applications running inside a browser which are loaded from a different domain than the API server.CORS headers are disabled by default. To enable, set cors to true, or to an object with the following options: */ - cors?: { - /** a strings array of allowed origin servers ('Access-Control-Allow-Origin').The array can contain any combination of fully qualified origins along with origin strings containing a wildcard '' character, or a single `''origin string. Defaults to any origin['*']`. */ - origin?: Array; - /** if true, matches the value of the incoming 'Origin' header to the list of origin values ('*' matches anything) and if a match is found, uses that as the value of the 'Access-Control-Allow-Origin' response header.When false, the origin config is returned as- is.Defaults to true. */ - matchOrigin?: boolean; - /** if false, prevents the connection from returning the full list of non- wildcard origin values if the incoming origin header does not match any of the values.Has no impact if matchOrigin is set to false.Defaults to true. */ - isOriginExposed?: boolean; - /** number of seconds the browser should cache the CORS response ('Access-Control-Max-Age').The greater the value, the longer it will take before the browser checks for changes in policy.Defaults to 86400 (one day). */ - maxAge?: number; - /** a strings array of allowed headers ('Access-Control-Allow-Headers').Defaults to ['Authorization', 'Content-Type', 'If-None-Match']. */ - headers?: string[]; - /** a strings array of additional headers to headers.Use this to keep the default headers in place. */ - additionalHeaders?: string[]; - /** a strings array of allowed HTTP methods ('Access-Control-Allow-Methods').Defaults to ['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'OPTIONS']. */ - methods?: string[]; - /** a strings array of additional methods to methods.Use this to keep the default methods in place. */ - additionalMethods?: string[]; - /** a strings array of exposed headers ('Access-Control-Expose-Headers').Defaults to ['WWW-Authenticate', 'Server-Authorization']. */ - exposedHeaders?: string[]; - /** a strings array of additional headers to exposedHeaders.Use this to keep the default headers in place. */ - additionalExposedHeaders?: string[]; - /** if true, allows user credentials to be sent ('Access-Control-Allow-Credentials').Defaults to false. */ - credentials?: boolean; - /** if false, preserves existing CORS headers set manually before the response is sent.Defaults to true. */ - override?: boolean; - }; - /** defines the behavior for serving static resources using the built-in route handlers for files and directories: */ - files?: {/** determines the folder relative paths are resolved against when using the file and directory handlers. */ - relativeTo: string; - }; + privacy: string; + /** relative expiration expressed in the number of milliseconds since the item was saved in the cache.Cannot be used together with expiresAt. */ + expiresIn: number; + /** time of day expressed in 24h notation using the 'HH:MM' format, at which point all cache records for the route expire.Cannot be used together with expiresIn. */ + expiresAt: string; + }; + /** the Cross- Origin Resource Sharing protocol allows browsers to make cross- origin API calls.CORS is required by web applications running inside a browser which are loaded from a different domain than the API server.CORS headers are disabled by default. To enable, set cors to true, or to an object with the following options: */ + cors?: { + /** a strings array of allowed origin servers ('Access-Control-Allow-Origin').The array can contain any combination of fully qualified origins along with origin strings containing a wildcard '' character, or a single `''origin string. Defaults to any origin['*']`. */ + origin?: Array; + /** if true, matches the value of the incoming 'Origin' header to the list of origin values ('*' matches anything) and if a match is found, uses that as the value of the 'Access-Control-Allow-Origin' response header.When false, the origin config is returned as- is.Defaults to true. */ + matchOrigin?: boolean; + /** if false, prevents the connection from returning the full list of non- wildcard origin values if the incoming origin header does not match any of the values.Has no impact if matchOrigin is set to false.Defaults to true. */ + isOriginExposed?: boolean; + /** number of seconds the browser should cache the CORS response ('Access-Control-Max-Age').The greater the value, the longer it will take before the browser checks for changes in policy.Defaults to 86400 (one day). */ + maxAge?: number; + /** a strings array of allowed headers ('Access-Control-Allow-Headers').Defaults to ['Authorization', 'Content-Type', 'If-None-Match']. */ + headers?: string[]; + /** a strings array of additional headers to headers.Use this to keep the default headers in place. */ + additionalHeaders?: string[]; + /** a strings array of allowed HTTP methods ('Access-Control-Allow-Methods').Defaults to ['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'OPTIONS']. */ + methods?: string[]; + /** a strings array of additional methods to methods.Use this to keep the default methods in place. */ + additionalMethods?: string[]; + /** a strings array of exposed headers ('Access-Control-Expose-Headers').Defaults to ['WWW-Authenticate', 'Server-Authorization']. */ + exposedHeaders?: string[]; + /** a strings array of additional headers to exposedHeaders.Use this to keep the default headers in place. */ + additionalExposedHeaders?: string[]; + /** if true, allows user credentials to be sent ('Access-Control-Allow-Credentials').Defaults to false. */ + credentials?: boolean; + /** if false, preserves existing CORS headers set manually before the response is sent.Defaults to true. */ + override?: boolean; + }; + /** defines the behavior for serving static resources using the built-in route handlers for files and directories: */ + files?: {/** determines the folder relative paths are resolved against when using the file and directory handlers. */ + relativeTo: string; + }; - /** an alternative location for the route handler option. */ - handler?: ISessionHandler | string | IRouteHandlerConfig; - /** an optional unique identifier used to look up the route using server.lookup(). */ - id?: number; - /** optional arguments passed to JSON.stringify() when converting an object or error response to a string payload.Supports the following: */ - json?: { - /** the replacer function or array.Defaults to no action. */ - replacer?: Function | string[]; - /** number of spaces to indent nested object keys.Defaults to no indentation. */ - space?: number|string; - /** string suffix added after conversion to JSON string.Defaults to no suffix. */ - suffix?: string; - }; - /** enables JSONP support by setting the value to the query parameter name containing the function name used to wrap the response payload.For example, if the value is 'callback', a request comes in with 'callback=me', and the JSON response is '{ "a":"b" }', the payload will be 'me({ "a":"b" });'.Does not work with stream responses. */ - jsonp?: string; - /** determines how the request payload is processed: */ - payload?: { + /** an alternative location for the route handler option. */ + handler?: ISessionHandler | string | IRouteHandlerConfig; + /** an optional unique identifier used to look up the route using server.lookup(). */ + id?: number; + /** optional arguments passed to JSON.stringify() when converting an object or error response to a string payload.Supports the following: */ + json?: { + /** the replacer function or array.Defaults to no action. */ + replacer?: Function | string[]; + /** number of spaces to indent nested object keys.Defaults to no indentation. */ + space?: number | string; + /** string suffix added after conversion to JSON string.Defaults to no suffix. */ + suffix?: string; + }; + /** enables JSONP support by setting the value to the query parameter name containing the function name used to wrap the response payload.For example, if the value is 'callback', a request comes in with 'callback=me', and the JSON response is '{ "a":"b" }', the payload will be 'me({ "a":"b" });'.Does not work with stream responses. */ + jsonp?: string; + /** determines how the request payload is processed: */ + payload?: { /** the type of payload representation requested. The value must be one of: 'data'the incoming payload is read fully into memory.If parse is true, the payload is parsed (JSON, formdecoded, multipart) based on the 'Content- Type' header.If parse is false, the raw Buffer is returned.This is the default value except when a proxy handler is used. 'stream'the incoming payload is made available via a Stream.Readable interface.If the payload is 'multipart/form-data' and parse is true, fields values are presented as text while files are provided as streams.File streams from a 'multipart/form-data' upload will also have a property hapi containing filename and headers properties. 'file'the incoming payload in written to temporary file in the directory specified by the server's payload.uploads settings. If the payload is 'multipart/ formdata' and parse is true, fields values are presented as text while files are saved. Note that it is the sole responsibility of the application to clean up the files generated by the framework. This can be done by keeping track of which files are used (e.g. using the request.app object), and listening to the server 'response' event to perform any needed cleaup. */ - output?: string; + output?: string; /** can be true, false, or gunzip; determines if the incoming payload is processed or presented raw. true and gunzip includes gunzipping when the appropriate 'Content-Encoding' is specified on the received request. If parsing is enabled and the 'Content-Type' is known (for the whole payload as well as parts), the payload is converted into an object when possible. If the format is unknown, a Bad Request (400) error response is sent. Defaults to true, except when a proxy handler is used. The supported mime types are: 'application/json' 'application/x-www-form-urlencoded' 'application/octet-stream' 'text/ *' 'multipart/form-data' */ - parse?: string | boolean; - /** a string or an array of strings with the allowed mime types for the endpoint.Defaults to any of the supported mime types listed above.Note that allowing other mime types not listed will not enable them to be parsed, and that if parsing mode is 'parse', the request will result in an error response. */ - allow?: string | string[]; - /** a mime type string overriding the 'Content-Type' header value received.Defaults to no override. */ - override?: string; - /** limits the size of incoming payloads to the specified byte count.Allowing very large payloads may cause the server to run out of memory.Defaults to 1048576 (1MB). */ - maxBytes?: number; - /** payload reception timeout in milliseconds.Sets the maximum time allowed for the client to transmit the request payload (body) before giving up and responding with a Request Timeout (408) error response.Set to false to disable.Defaults to 10000 (10 seconds). */ - timeout?: number; - /** the directory used for writing file uploads.Defaults to os.tmpDir(). */ - uploads?: string; + parse?: string | boolean; + /** a string or an array of strings with the allowed mime types for the endpoint.Defaults to any of the supported mime types listed above.Note that allowing other mime types not listed will not enable them to be parsed, and that if parsing mode is 'parse', the request will result in an error response. */ + allow?: string | string[]; + /** a mime type string overriding the 'Content-Type' header value received.Defaults to no override. */ + override?: string; + /** limits the size of incoming payloads to the specified byte count.Allowing very large payloads may cause the server to run out of memory.Defaults to 1048576 (1MB). */ + maxBytes?: number; + /** payload reception timeout in milliseconds.Sets the maximum time allowed for the client to transmit the request payload (body) before giving up and responding with a Request Timeout (408) error response.Set to false to disable.Defaults to 10000 (10 seconds). */ + timeout?: number; + /** the directory used for writing file uploads.Defaults to os.tmpDir(). */ + uploads?: string; /** determines how to handle payload parsing errors. Allowed values are: 'error'return a Bad Request (400) error response. This is the default value. 'log'report the error but continue processing the request. 'ignore'take no action and continue processing the request. */ - failAction?: string; - }; - /** pluginspecific configuration.plugins is an object where each key is a plugin name and the value is the plugin configuration. */ - plugins?: IDictionary; - /** an array with [route prerequisites] methods which are executed in serial or in parallel before the handler is called. */ - pre?: any[]; - /** validation rules for the outgoing response payload (response body).Can only validate object response: */ - response?: { + failAction?: string; + }; + /** pluginspecific configuration.plugins is an object where each key is a plugin name and the value is the plugin configuration. */ + plugins?: IDictionary; + /** an array with [route prerequisites] methods which are executed in serial or in parallel before the handler is called. */ + pre?: any[]; + /** validation rules for the outgoing response payload (response body).Can only validate object response: */ + response?: { /** the default response object validation rules (for all non-error responses) expressed as one of: trueany payload allowed (no validation performed). This is the default. falseno payload allowed. @@ -509,55 +521,57 @@ declare module "hapi" { valuethe object containing the response object. optionsthe server validation options. next(err)the callback function called when validation is completed. */ - schema: boolean|any; - /** HTTP status- codespecific validation rules.The status key is set to an object where each key is a 3 digit HTTP status code and the value has the same definition as schema.If a response status code is not present in the status object, the schema definition is used, expect for errors which are not validated by default. */ - status: number; - /** the percent of responses validated (0100).Set to 0 to disable all validation.Defaults to 100 (all responses). */ - sample: number; + schema: boolean | any; + /** HTTP status- codespecific validation rules.The status key is set to an object where each key is a 3 digit HTTP status code and the value has the same definition as schema.If a response status code is not present in the status object, the schema definition is used, expect for errors which are not validated by default. */ + status: number; + /** the percent of responses validated (0100).Set to 0 to disable all validation.Defaults to 100 (all responses). */ + sample: number; /** defines what to do when a response fails validation.Options are: errorreturn an Internal Server Error (500) error response.This is the default value. loglog the error but send the response. */ - failAction: string; - /** if true, applies the validation rule changes to the response.Defaults to false. */ - modify: boolean; - /** options to pass to Joi.Useful to set global options such as stripUnknown or abortEarly (the complete list is available here: https://github.com/hapijs/joi#validatevalue-schema-options-callback ).Defaults to no options. */ - options: any; - }; - /** sets common security headers (disabled by default).To enable set security to true or to an object with the following options */ - security?: boolean| { - /** controls the 'Strict-Transport-Security' header.If set to true the header will be set to max- age=15768000, if specified as a number the maxAge parameter will be set to that number.Defaults to true.You may also specify an object with the following fields: */ - hsts: boolean|number|{ - /** the max- age portion of the header, as a number.Default is 15768000. */ - maxAge?: number; - /** a boolean specifying whether to add the includeSubdomains flag to the header. */ - includeSubdomains?: boolean; - }; - /** controls the 'X-Frame-Options' header.When set to true the header will be set to DENY, you may also specify a string value of 'deny' or 'sameorigin'.To use the 'allow-from' rule, you must set this to an object with the following fields: */ - xframe: { - /** either 'deny', 'sameorigin', or 'allow-from' */ - rule: string; - /** when rule is 'allow-from' this is used to form the rest of the header, otherwise this field is ignored.If rule is 'allow-from' but source is unset, the rule will be automatically changed to 'sameorigin'. */ - source: string; - }; - /** boolean that controls the 'X-XSS-PROTECTION' header for IE.Defaults to true which sets the header to equal '1; mode=block'.NOTE: This setting can create a security vulnerability in versions of IE below 8, as well as unpatched versions of IE8.See here and here for more information.If you actively support old versions of IE, it may be wise to explicitly set this flag to false. */ - xss: boolean; - /** boolean controlling the 'X-Download-Options' header for IE, preventing downloads from executing in your context.Defaults to true setting the header to 'noopen'. */ - noOpen: boolean; - /** boolean controlling the 'X-Content-Type-Options' header.Defaults to true setting the header to its only and default option, 'nosniff'. */ - noSniff: boolean; - }; - /** HTTP state management (cookies) allows the server to store information on the client which is sent back to the server with every request (as defined in RFC 6265).state supports the following options: */ - state?: { - /** determines if incoming 'Cookie' headers are parsed and stored in the request.state object.Defaults to true. */ - parse: boolean; + failAction: string; + /** if true, applies the validation rule changes to the response.Defaults to false. */ + modify: boolean; + /** options to pass to Joi.Useful to set global options such as stripUnknown or abortEarly (the complete list is available here: https://github.com/hapijs/joi#validatevalue-schema-options-callback ).Defaults to no options. */ + options: any; + }; + /** sets common security headers (disabled by default).To enable set security to true or to an object with the following options */ + security?: boolean | { + /** controls the 'Strict-Transport-Security' header.If set to true the header will be set to max- age=15768000, if specified as a number the maxAge parameter will be set to that number.Defaults to true.You may also specify an object with the following fields: */ + hsts?: boolean | number | { + /** the max- age portion of the header, as a number.Default is 15768000. */ + maxAge?: number; + /** a boolean specifying whether to add the includeSubdomains flag to the header. */ + includeSubdomains?: boolean; + /** a boolean specifying whether to add the 'preload' flag (used to submit domains inclusion in Chrome's HTTP Strict Transport Security (HSTS) preload list) to the header. */ + preload?: boolean; + }; + /** controls the 'X-Frame-Options' header.When set to true the header will be set to DENY, you may also specify a string value of 'deny' or 'sameorigin'.To use the 'allow-from' rule, you must set this to an object with the following fields: */ + xframe?: { + /** either 'deny', 'sameorigin', or 'allow-from' */ + rule: string; + /** when rule is 'allow-from' this is used to form the rest of the header, otherwise this field is ignored.If rule is 'allow-from' but source is unset, the rule will be automatically changed to 'sameorigin'. */ + source: string; + }; + /** boolean that controls the 'X-XSS-PROTECTION' header for IE.Defaults to true which sets the header to equal '1; mode=block'.NOTE: This setting can create a security vulnerability in versions of IE below 8, as well as unpatched versions of IE8.See here and here for more information.If you actively support old versions of IE, it may be wise to explicitly set this flag to false. */ + xss?: boolean; + /** boolean controlling the 'X-Download-Options' header for IE, preventing downloads from executing in your context.Defaults to true setting the header to 'noopen'. */ + noOpen?: boolean; + /** boolean controlling the 'X-Content-Type-Options' header.Defaults to true setting the header to its only and default option, 'nosniff'. */ + noSniff?: boolean; + }; + /** HTTP state management (cookies) allows the server to store information on the client which is sent back to the server with every request (as defined in RFC 6265).state supports the following options: */ + state?: { + /** determines if incoming 'Cookie' headers are parsed and stored in the request.state object.Defaults to true. */ + parse: boolean; /** determines how to handle cookie parsing errors.Allowed values are: 'error'return a Bad Request (400) error response.This is the default value. 'log'report the error but continue processing the request. 'ignore'take no action. */ - failAction: string; - }; - /** request input validation rules for various request components.When using a Joi validation object, the values of the other inputs (i.e.headers, query, params, payload, and auth) are made available under the validation context (accessible in rules as Joi.ref('$query.key')).Note that validation is performed in order(i.e.headers, params, query, payload) and if type casting is used (converting a string to number), the value of inputs not yet validated will reflect the raw, unvalidated and unmodified values.The validate object supports: */ - validate?: { + failAction: string; + }; + /** request input validation rules for various request components.When using a Joi validation object, the values of the other inputs (i.e.headers, query, params, payload, and auth) are made available under the validation context (accessible in rules as Joi.ref('$query.key')).Note that validation is performed in order(i.e.headers, params, query, payload) and if type casting is used (converting a string to number), the value of inputs not yet validated will reflect the raw, unvalidated and unmodified values.The validate object supports: */ + validate?: { /** validation rules for incoming request headers.Values allowed: * trueany headers allowed (no validation performed).This is the default. falseno headers allowed (this will cause all valid HTTP requests to fail). @@ -567,7 +581,7 @@ declare module "hapi" { optionsthe server validation options. next(err, value)the callback function called when validation is completed. */ - headers?: boolean | IJoi | IValidationFunction; + headers?: boolean | IJoi | IValidationFunction; /** validation rules for incoming request path parameters, after matching the path against the route and extracting any parameters then stored in request.params.Values allowed: @@ -578,7 +592,7 @@ declare module "hapi" { valuethe object containing the path parameters. optionsthe server validation options. next(err, value)the callback function called when validation is completed. */ - params?: boolean | IJoi | IValidationFunction; + params?: boolean | IJoi | IValidationFunction; /** validation rules for an incoming request URI query component (the key- value part of the URI between '?' and '#').The query is parsed into its individual key- value pairs (using the qs module) and stored in request.query prior to validation.Values allowed: trueany query parameters allowed (no validation performed).This is the default. falseno query parameters allowed. @@ -587,7 +601,7 @@ declare module "hapi" { valuethe object containing the query parameters. optionsthe server validation options. next(err, value)the callback function called when validation is completed. */ - query?: boolean | IJoi | IValidationFunction; + query?: boolean | IJoi | IValidationFunction; /** validation rules for an incoming request payload (request body).Values allowed: trueany payload allowed (no validation performed).This is the default. falseno payload allowed. @@ -596,9 +610,9 @@ declare module "hapi" { valuethe object containing the payload object. optionsthe server validation options. next(err, value)the callback function called when validation is completed. */ - payload?: boolean | IJoi | IValidationFunction; - /** an optional object with error fields copied into every validation error response. */ - errorFields?: any; + payload?: boolean | IJoi | IValidationFunction; + /** an optional object with error fields copied into every validation error response. */ + errorFields?: any; /** determines how to handle invalid requests.Allowed values are: 'error'return a Bad Request (400) error response.This is the default value. 'log'log the error but continue processing the request. @@ -608,31 +622,54 @@ declare module "hapi" { replythe continuation reply interface. sourcethe source of the invalid field (e.g. 'path', 'query', 'payload'). errorthe error object prepared for the client response (including the validation function error under error.data). */ - failAction?: string | IRouteFailFunction; - /** options to pass to Joi.Useful to set global options such as stripUnknown or abortEarly (the complete list is available here: https://github.com/hapijs/joi#validatevalue-schema-options-callback ).Defaults to no options. */ - options?: any; - }; - /** define timeouts for processing durations: */ - timeout?: { - /** response timeout in milliseconds.Sets the maximum time allowed for the server to respond to an incoming client request before giving up and responding with a Service Unavailable (503) error response.Disabled by default (false). */ - server: boolean|number; - /** by default, node sockets automatically timeout after 2 minutes.Use this option to override this behavior.Defaults to undefined which leaves the node default unchanged.Set to false to disable socket timeouts. */ - socket: boolean|number; - }; + failAction?: string | IRouteFailFunction; + /** options to pass to Joi.Useful to set global options such as stripUnknown or abortEarly (the complete list is available here: https://github.com/hapijs/joi#validatevalue-schema-options-callback ).Defaults to no options. */ + options?: any; + }; + /** define timeouts for processing durations: */ + timeout?: { + /** response timeout in milliseconds.Sets the maximum time allowed for the server to respond to an incoming client request before giving up and responding with a Service Unavailable (503) error response.Disabled by default (false). */ + server: boolean | number; + /** by default, node sockets automatically timeout after 2 minutes.Use this option to override this behavior.Defaults to undefined which leaves the node default unchanged.Set to false to disable socket timeouts. */ + socket: boolean | number; + }; /** ONLY WHEN ADDING NEW ROUTES (not when setting defaults). *route description used for generating documentation (string). */ - description?: string; + description?: string; /** ONLY WHEN ADDING NEW ROUTES (not when setting defaults). *route notes used for generating documentation (string or array of strings). */ - notes?: string|string[]; + notes?: string | string[]; /** ONLY WHEN ADDING NEW ROUTES (not when setting defaults). *route tags used for generating documentation (array of strings). */ - tags?: string[] - } + tags?: string[] + } + + /** + * specifying the route access rules. Each rule is evaluated against an incoming request and access is granted if at least one rule matches + */ + export interface IRouteAdditionalConfigurationAuthAccess { + /** + * the application scope required to access the route. Value can be a scope string or an array of scope strings. + * The authenticated credentials object scope property must contain at least one of the scopes defined to access the route. + * If a scope string begins with a + character, that scope is required. If a scope string begins with a ! character, + * that scope is forbidden. For example, the scope ['!a', '+b', 'c', 'd'] means the incoming request credentials' + * scope must not include 'a', must include 'b', and must include on of 'c' or 'd'. You may also access properties + * on the request object (query and params} to populate a dynamic scope by using {} characters around the property name, + * such as 'user-{params.id}'. Defaults to false (no scope requirements). + */ + scope?: string | Array | boolean; + /** the required authenticated entity type. If set, must match the entity value of the authentication credentials. Available values: + * any - the authentication can be on behalf of a user or application. This is the default value. + * user - the authentication must be on behalf of a user which is identified by the presence of a user attribute in the credentials object returned by the authentication strategy. + * app - the authentication must be on behalf of an application which is identified by the lack of presence of a user attribute in the credentials object returned by the authentication strategy. + */ + entity?: string; + } + /** server.realm http://hapijs.com/api#serverrealm The realm object contains server-wide or plugin-specific state that can be shared across various methods. For example, when calling server.bind(), the active realm settings.bind property is set which is then used by routes and extensions added at the same level (server root or plugin). @@ -643,33 +680,33 @@ declare module "hapi" { return next(); }; */ - export interface IServerRealm { - /** when the server object is provided as an argument to the plugin register() method, modifiers provides the registration preferences passed the server.register() method */ - modifiers: { - /** routes preferences: */ - route: { - /** - the route path prefix used by any calls to server.route() from the server. */ - prefix: string; - /** the route virtual host settings used by any calls to server.route() from the server. */ - vhost: string; - }; + export interface IServerRealm { + /** when the server object is provided as an argument to the plugin register() method, modifiers provides the registration preferences passed the server.register() method */ + modifiers: { + /** routes preferences: */ + route: { + /** - the route path prefix used by any calls to server.route() from the server. */ + prefix: string; + /** the route virtual host settings used by any calls to server.route() from the server. */ + vhost: string; + }; - }; - /** the active plugin name (empty string if at the server root). */ - plugin: string; - /** plugin-specific state to be shared only among activities sharing the same active state. plugins is an object where each key is a plugin name and the value is the plugin state. */ - plugins: IDictionary; - /** settings overrides */ - settings: { - files: { - relativeTo: any; - }; - bind: any; - } - } + }; + /** the active plugin name (empty string if at the server root). */ + plugin: string; + /** plugin-specific state to be shared only among activities sharing the same active state. plugins is an object where each key is a plugin name and the value is the plugin state. */ + plugins: IDictionary; + /** settings overrides */ + settings: { + files: { + relativeTo: any; + }; + bind: any; + } + } /** server.state(name, [options]) http://hapijs.com/api#serverstatename-options HTTP state management uses client cookies to persist a state across multiple requests. Registers a cookie definitions where:*/ - export interface IServerState { + export interface IServerState { /** - the cookie name string. */name: string; /** - are the optional cookie settings: */options: { @@ -681,51 +718,51 @@ declare module "hapi" { /** if present and the cookie was not received from the client or explicitly set by the route handler, the cookie is automatically added to the response with the provided value. The value can be a function with signature function(request, next) where: request - the request object. next - the continuation function using the function(err, value) signature.*/ - autoValue: (request: Request, next: (err: any, value: any) => void) => void; + autoValue: (request: Request, next: (err: any, value: any) => void) => void; /** - encoding performs on the provided value before serialization. Options are: 'none' - no encoding. When used, the cookie value must be a string. This is the default value. 'base64' - string value is encoded using Base64. 'base64json' - object value is JSON-stringified than encoded using Base64. 'form' - object value is encoded using the x-www-form-urlencoded method. 'iron' - Encrypts and sign the value using iron.*/ - encoding: string; + encoding: string; /** - an object used to calculate an HMAC for cookie integrity validation.This does not provide privacy, only a mean to verify that the cookie value was generated by the server.Redundant when 'iron' encoding is used.Options are:*/sign: { /** - algorithm options.Defaults to require('iron').defaults.integrity.*/integrity: any; /** - password used for HMAC key generation.*/password: string; - }; + }; /** - password used for 'iron' encoding.*/password: string; /** - options for 'iron' encoding.Defaults to require('iron').defaults.*/iron: any; /** - if false, errors are ignored and treated as missing cookies.*/ignoreErrors: boolean; /** - if true, automatically instruct the client to remove invalid cookies.Defaults to false.*/clearInvalid: boolean; /** - if false, allows any cookie value including values in violation of RFC 6265. Defaults to true.*/strictHeader: boolean; /** - overrides the default proxy localStatePassThrough setting.*/passThrough: any; - }; - } + }; + } - export interface IFileHandlerConfig { - /** a path string or function as described above.*/ - path: string; - /** an optional filename to specify if sending a 'Content-Disposition' header, defaults to the basename of path*/ - filename?: string; + export interface IFileHandlerConfig { + /** a path string or function as described above.*/ + path: string; + /** an optional filename to specify if sending a 'Content-Disposition' header, defaults to the basename of path*/ + filename?: string; /**- specifies whether to include the 'Content-Disposition' header with the response. Available values: false - header is not included. This is the default value. 'attachment' 'inline'*/ - mode?: boolean| string; - /** if true, looks for the same filename with the '.gz' suffix for a pre-compressed version of the file to serve if the request supports content encoding. Defaults to false.*/ - lookupCompressed: boolean; - } + mode?: boolean | string; + /** if true, looks for the same filename with the '.gz' suffix for a pre-compressed version of the file to serve if the request supports content encoding. Defaults to false.*/ + lookupCompressed: boolean; + } /**http://hapijs.com/api#route-handler Built-in handlers The framework comes with a few built-in handler types available by setting the route handler config to an object containing one of these keys.*/ - export interface IRouteHandlerConfig { + export interface IRouteHandlerConfig { /** generates a static file endpoint for serving a single file. file can be set to: a relative or absolute file path string (relative paths are resolved based on the route files configuration). a function with the signature function(request) which returns the relative or absolute file path. an object with the following options */ - file?: string | IRequestHandler |IFileHandlerConfig; + file?: string | IRequestHandler | IFileHandlerConfig; /** directory - generates a directory endpoint for serving static content from a directory. Routes using the directory handler must include a path parameter at the end of the path string (e.g. /path/to/somewhere/{param} where the parameter name does not matter). The path parameter can use any of the parameter options (e.g. {param} for one level files only, {param?} for one level files or the directory root, {param*} for any level, or {param*3} for a specific level). If additional path parameters are present, they are ignored for the purpose of selecting the file system resource. The directory handler is an object with the following options: path - (required) the directory root path (relative paths are resolved based on the route files configuration). Value can be: a single path string used as the prefix for any resources requested by appending the request path parameter to the provided string. @@ -737,111 +774,111 @@ declare module "hapi" { redirectToSlash - optional boolean, determines if requests for a directory without a trailing slash are redirected to the same path with the missing slash. Useful for ensuring relative links inside the response are resolved correctly. Disabled when the server config router.stripTrailingSlash is true.Defaults to false. lookupCompressed - optional boolean, instructs the file processor to look for the same filename with the '.gz' suffix for a pre-compressed version of the file to serve if the request supports content encoding. Defaults to false. defaultExtension - optional string, appended to file requests if the requested file is not found. Defaults to no extension.*/ - directory?: { - path: string |Array | IRequestHandler | IRequestHandler>; - index?: boolean; - listing?: boolean; - showHidden?: boolean; - redirectToSlash?: boolean; - lookupCompressed?: boolean; - defaultExtension?: string; - }; - proxy?: IProxyHandlerConfig; - view?: string | { - template: string; - context: { - payload: any; - params: any; - query: any; - pre: any; - } - }; - config?: { - handler: any; - bind: any; - app: any; - plugins: { - [name: string]: any; - }; - pre: Array<() => void>; - validate: { - headers: any; - params: any; - query: any; - payload: any; - errorFields?: any; - failAction?: string | IFailAction; - }; - payload: { - output: { - data: any; - stream: any; - file: any; - }; - parse?: any; - allow?: string|Array; - override?: string; - maxBytes?: number; - uploads?: number; - failAction?: string; - }; - response: { - schema: any; - sample: number; - failAction: string; - }; - cache: { - privacy: string; - expiresIn: number; - expiresAt: number; - }; - auth: string|boolean|{ - mode: string; - strategies: Array; - payload?: boolean|string; - tos?: boolean|string; - scope?: string|Array; - entity: string; - }; - cors?: boolean; - jsonp?: string; - description?: string; - notes?: string|Array; - tags?: Array; - }; - } + directory?: { + path: string | Array | IRequestHandler | IRequestHandler>; + index?: boolean | string | string[]; + listing?: boolean; + showHidden?: boolean; + redirectToSlash?: boolean; + lookupCompressed?: boolean; + defaultExtension?: string; + }; + proxy?: IProxyHandlerConfig; + view?: string | { + template: string; + context: { + payload: any; + params: any; + query: any; + pre: any; + } + }; + config?: { + handler: any; + bind: any; + app: any; + plugins: { + [name: string]: any; + }; + pre: Array<() => void>; + validate: { + headers: any; + params: any; + query: any; + payload: any; + errorFields?: any; + failAction?: string | IFailAction; + }; + payload: { + output: { + data: any; + stream: any; + file: any; + }; + parse?: any; + allow?: string | Array; + override?: string; + maxBytes?: number; + uploads?: number; + failAction?: string; + }; + response: { + schema: any; + sample: number; + failAction: string; + }; + cache: { + privacy: string; + expiresIn: number; + expiresAt: number; + }; + auth: string | boolean | { + mode: string; + strategies: Array; + payload?: boolean | string; + tos?: boolean | string; + scope?: string | Array; + entity: string; + }; + cors?: boolean; + jsonp?: string; + description?: string; + notes?: string | Array; + tags?: Array; + }; + } /** Route configuration The route configuration object*/ - export interface IRouteConfiguration { - /** - (required) the absolute path used to match incoming requests (must begin with '/'). Incoming requests are compared to the configured paths based on the connection router configuration option.The path can include named parameters enclosed in {} which will be matched against literal values in the request as described in Path parameters.*/ - path: string; + export interface IRouteConfiguration { + /** - (required) the absolute path used to match incoming requests (must begin with '/'). Incoming requests are compared to the configured paths based on the connection router configuration option.The path can include named parameters enclosed in {} which will be matched against literal values in the request as described in Path parameters.*/ + path: string; /** - (required) the HTTP method.Typically one of 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', or 'OPTIONS'.Any HTTP method is allowed, except for 'HEAD'.Use '*' to match against any HTTP method (only when an exact match was not found, and any match with a specific method will be given a higher priority over a wildcard match). * Can be assigned an array of methods which has the same result as adding the same route with different methods manually.*/ - method: string|string[]; - /** - an optional domain string or an array of domain strings for limiting the route to only requests with a matching host header field.Matching is done against the hostname part of the header only (excluding the port).Defaults to all hosts.*/ - vhost?: string; - /** - (required) the function called to generate the response after successful authentication and validation.The handler function is described in Route handler.If set to a string, the value is parsed the same way a prerequisite server method string shortcut is processed.Alternatively, handler can be assigned an object with a single key using the name of a registered handler type and value with the options passed to the registered handler.*/ - handler: ISessionHandler | string | IRouteHandlerConfig; - /** - additional route options.*/ - config?: IRouteAdditionalConfigurationOptions; - } - /** Route public interface When route information is returned or made available as a property. http://hapijs.com/api#route-public-interface */ - export interface IRoute { + method: string | string[]; + /** - an optional domain string or an array of domain strings for limiting the route to only requests with a matching host header field.Matching is done against the hostname part of the header only (excluding the port).Defaults to all hosts.*/ + vhost?: string; + /** - (required) the function called to generate the response after successful authentication and validation.The handler function is described in Route handler.If set to a string, the value is parsed the same way a prerequisite server method string shortcut is processed.Alternatively, handler can be assigned an object with a single key using the name of a registered handler type and value with the options passed to the registered handler.*/ + handler: ISessionHandler | string | IRouteHandlerConfig; + /** - additional route options.*/ + config?: IRouteAdditionalConfigurationOptions; + } + /** Route public interface When route information is returned or made available as a property. http://hapijs.com/api#route-public-interface */ + export interface IRoute { - /** the route HTTP method. */ - method: string; - /** the route path. */ - path: string; - /** the route vhost option if configured. */ - vhost?: string|Array; - /** the [active realm] associated with the route.*/ - realm: IServerRealm; - /** the [route options] object with all defaults applied. */ - settings: IRouteAdditionalConfigurationOptions; - } + /** the route HTTP method. */ + method: string; + /** the route path. */ + path: string; + /** the route vhost option if configured. */ + vhost?: string | Array; + /** the [active realm] associated with the route.*/ + realm: IServerRealm; + /** the [route options] object with all defaults applied. */ + settings: IRouteAdditionalConfigurationOptions; + } - export interface IServerAuthScheme { + export interface IServerAuthScheme { /** authenticate(request, reply) - required function called on each incoming request configured with the authentication scheme where: request - the request object. reply - the reply interface the authentication method must call when done authenticating the request where: @@ -871,7 +908,7 @@ declare module "hapi" { }; }; server.auth.scheme('custom', scheme);*/ - authenticate(request: Request, reply: IReply): void; + authenticate(request: Request, reply: IReply): void; /** payload(request, reply) - optional function called to authenticate the request payload where: request - the request object. reply(err, response) - is called if authentication failed where: @@ -879,60 +916,70 @@ declare module "hapi" { response - any authentication response action such as redirection. Ignored if err is present, otherwise required. reply.continue() - is called if payload authentication succeeded. When the scheme payload() method returns an error with a message, it means payload validation failed due to bad payload. If the error has no message but includes a scheme name (e.g. Boom.unauthorized(null, 'Custom')), authentication may still be successful if the route auth.payload configuration is set to 'optional'.*/ - payload? (request: Request, reply: IReply): void; + payload?(request: Request, reply: IReply): void; /** response(request, reply) - optional function called to decorate the response with authentication headers before the response headers or payload is written where: request - the request object. reply(err, response) - is called if an error occurred where: err - any authentication error. response - any authentication response to send instead of the current response. Ignored if err is present, otherwise required. reply.continue() - is called if the operation succeeded.*/ - response? (request: Request, reply: IReply): void; - /** an optional object */ - options?: { - /** if true, requires payload validation as part of the scheme and forbids routes from disabling payload auth validation. Defaults to false.*/ - payload: boolean; - } - } + response?(request: Request, reply: IReply): void; + /** an optional object */ + options?: { + /** if true, requires payload validation as part of the scheme and forbids routes from disabling payload auth validation. Defaults to false.*/ + payload: boolean; + } + } - export interface IServerInject { - (options: { - /** 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; + export interface IServerInject { + (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; + /** n optional string, buffer or object containing the request payload. In case of an object it will be converted to a string for you. Defaults to no payload. Note that payload processing defaults to 'application/json' if no 'Content-Type' header provided.*/ + payload?: string | {} | Buffer; + /** an optional credentials object containing authentication information. The credentials are used to bypass the default authentication strategies, and are validated directly as if they were received via an authentication scheme. Defaults to no credentials.*/ + credentials?: any; + /** an optional artifacts object containing authentication artifact information. The artifacts are used to bypass the default authentication strategies, and are validated directly as if they were received via an authentication scheme. Ignored if set without credentials. Defaults to no artifacts.*/ + artifacts?: any; + /** sets the initial value of request.app*/ + app?: any; + /** sets the initial value of request.plugins*/ + plugins?: any; + /** allows access to routes with config.isInternal set to true. Defaults to false.*/ + allowInternals?: boolean; + /** sets the remote address for the incoming connection.*/ + remoteAddress?: boolean; /**object with options used to simulate client request stream conditions for testing: error - if true, emits an 'error' event after payload transmission (if any). Defaults to false. close - if true, emits a 'close' event after payload transmission (if any). Defaults to false. end - if false, does not end the stream. Defaults to true.*/ - simulate: { - error: boolean; - close: boolean; - end: boolean; - }; - }, - callback: ( - /**the response object where: - statusCode - the HTTP status code. - headers - an object containing the headers set. - payload - the response payload string. - rawPayload - the raw response payload buffer. - raw - an object with the injection request and response objects: - req - the simulated node request object. - res - the simulated node response object. - result - the raw handler response (e.g. when not a stream or a view) before it is serialized for transmission. If not available, the value is set to payload. Useful for inspection and reuse of the internal objects returned (instead of parsing the response string). - request - the request object.*/ - res: { statusCode: number; headers: IDictionary; payload: string; rawPayload: Buffer; raw: { req: http.ClientRequest; res: http.ServerResponse }; result: string; request: Request }) => void - ):void; + simulate?: { + error: boolean; + close: boolean; + end: boolean; + }; + }, + callback: ( + /**the response object where: + statusCode - the HTTP status code. + headers - an object containing the headers set. + payload - the response payload string. + rawPayload - the raw response payload buffer. + raw - an object with the injection request and response objects: + req - the simulated node request object. + res - the simulated node response object. + result - the raw handler response (e.g. when not a stream or a view) before it is serialized for transmission. If not available, the value is set to payload. Useful for inspection and reuse of the internal objects returned (instead of parsing the response string). + request - the request object.*/ + res: { statusCode: number; headers: IDictionary; payload: string; rawPayload: Buffer; raw: { req: http.ClientRequest; res: http.ServerResponse }; result: string; request: Request }) => void + ): void; - } + } /** host - optional host to filter routes matching a specific virtual host. Defaults to all virtual hosts. @@ -943,44 +990,44 @@ declare module "hapi" { settings - the route config with defaults applied. method - the HTTP method in lower case. path - the route path.*/ - export interface IConnectionTable { - info: any; - labels: any; - table: IRoute[]; - } + export interface IConnectionTable { + info: any; + labels: any; + table: IRoute[]; + } - export interface ICookieSettings { - /** - time - to - live in milliseconds.Defaults to null (session time- life - cookies are deleted when the browser is closed).*/ - ttl?: number; - /** - sets the 'Secure' flag.Defaults to false.*/ - isSecure?: boolean; - /** - sets the 'HttpOnly' flag.Defaults to false.*/ - isHttpOnly?: boolean; - /** - the path scope.Defaults to null (no path).*/ - path?: string; - /** - the domain scope.Defaults to null (no domain).*/ - domain?: any; + export interface ICookieSettings { + /** - time - to - live in milliseconds.Defaults to null (session time- life - cookies are deleted when the browser is closed).*/ + ttl?: number; + /** - sets the 'Secure' flag.Defaults to false.*/ + isSecure?: boolean; + /** - sets the 'HttpOnly' flag.Defaults to false.*/ + isHttpOnly?: boolean; + /** - the path scope.Defaults to null (no path).*/ + path?: string; + /** - the domain scope.Defaults to null (no domain).*/ + domain?: any; /** - if present and the cookie was not received from the client or explicitly set by the route handler, the cookie is automatically added to the response with the provided value.The value can be a function with signature function(request, next) where: request - the request object. next - the continuation function using the function(err, value) signature.*/ - autoValue?: (request: Request, next: (err: any, value: any) => void) => void; + autoValue?: (request: Request, next: (err: any, value: any) => void) => void; /** - encoding performs on the provided value before serialization.Options are: 'none' - no encoding.When used, the cookie value must be a string.This is the default value. 'base64' - string value is encoded using Base64. 'base64json' - object value is JSON- stringified than encoded using Base64. 'form' - object value is encoded using the x- www - form - urlencoded method. */ - encoding?: string; + encoding?: string; /** - an object used to calculate an HMAC for cookie integrity validation.This does not provide privacy, only a mean to verify that the cookie value was generated by the server.Redundant when 'iron' encoding is used.Options are: integrity - algorithm options.Defaults to require('iron').defaults.integrity. password - password used for HMAC key generation. */ - sign?: { integrity: any; password: string; } - password?: string; - iron?: any; - ignoreErrors?: boolean; - clearInvalid?: boolean; - strictHeader?: boolean; - passThrough?: any; - } + sign?: { integrity: any; password: string; } + password?: string; + iron?: any; + ignoreErrors?: boolean; + clearInvalid?: boolean; + strictHeader?: boolean; + passThrough?: any; + } /** method - the method function with the signature is one of: function(arg1, arg2, ..., argn, next) where: @@ -993,26 +1040,26 @@ declare module "hapi" { arg1, arg2, etc. - the method function arguments. the callback option is set to false. the method must returns a value (result, Error, or a promise) or throw an Error.*/ - export interface IServerMethod { - //(): void; - //(next: (err: any, result: any, ttl: number) => void): void; - //(arg1: any): void; - //(arg1: any, arg2: any, next: (err: any, result: any, ttl: number) => void): void; - //(arg1: any, arg2: any): void; - (...args: any[]): void; + export interface IServerMethod { + //(): void; + //(next: (err: any, result: any, ttl: number) => void): void; + //(arg1: any): void; + //(arg1: any, arg2: any, next: (err: any, result: any, ttl: number) => void): void; + //(arg1: any, arg2: any): void; + (...args: any[]): void; - } + } /** options - optional configuration: bind - a context object passed back to the method function (via this) when called. Defaults to active context (set via server.bind() when the method is registered. cache - the same cache configuration used in server.cache(). callback - if false, expects the method to be a synchronous function. Note that using a synchronous function with caching will convert the method interface to require a callback as an additional argument with the signature function(err, result, cached, report) since the cache interface cannot return values synchronously. Defaults to true. generateKey - a function used to generate a unique key (for caching) from the arguments passed to the method function (the callback argument is not passed as input). The server will automatically generate a unique key if the function's arguments are all of types 'string', 'number', or 'boolean'. However if the method uses other types of arguments, a key generation function must be provided which takes the same arguments as the function and returns a unique string (or null if no key can be generated).*/ - export interface IServerMethodOptions { - bind?: any; - cache?: ICatBoxCacheOptions; - callback?: boolean; - generateKey?(args: any[]): string; - } + export interface IServerMethodOptions { + bind?: any; + cache?: ICatBoxCacheOptions; + callback?: boolean; + generateKey?(args: any[]): string; + } /** Request object The request object is created internally for each incoming request. It is different from the node.js request object received from the HTTP server callback (which is available in request.raw.req). The request object methods and properties change throughout the request lifecycle. @@ -1048,114 +1095,116 @@ declare module "hapi" { return reply.continue(); });*/ - export class Request extends Events.EventEmitter { - /** application-specific state. Provides a safe place to store application data without potential conflicts with the framework. Should not be used by plugins which should use plugins[name].*/ - app: any; - /** authentication information*/ - auth: { - /** true is the request has been successfully authenticated, otherwise false.*/ - isAuthenticated: boolean; - /** the credential object received during the authentication process. The presence of an object does not mean successful authentication.*/ - credentials: any; - /** an artifact object received from the authentication strategy and used in authentication-related actions.*/ - artifacts: any; - /** the route authentication mode.*/ - mode: any; - /** the authentication error is failed and mode set to 'try'.*/ - error: any; - /** an object used by the ['cookie' authentication scheme] https://github.com/hapijs/hapi-auth-cookie */ - session: any - }; - /** the node domain object used to protect against exceptions thrown in extensions, handlers and route prerequisites. Can be used to manually bind callback functions otherwise bound to other domains.*/ - domain: any; - /** the raw request headers (references request.raw.headers).*/ - headers: IDictionary; - /** a unique request identifier (using the format '{now}:{connection.info.id}:{5 digits counter}').*/ - id: number; - /** request information */ - info: { - /** request reception timestamp. */ - received: number; - /** request response timestamp (0 is not responded yet). */ - responded: number; - /** remote client IP address. */ + export class Request extends Events.EventEmitter { + /** application-specific state. Provides a safe place to store application data without potential conflicts with the framework. Should not be used by plugins which should use plugins[name].*/ + app: any; + /** authentication information*/ + auth: { + /** true is the request has been successfully authenticated, otherwise false.*/ + isAuthenticated: boolean; + /** the credential object received during the authentication process. The presence of an object does not mean successful authentication. can be set in the validate function's callback.*/ + credentials: any; + /** an artifact object received from the authentication strategy and used in authentication-related actions.*/ + artifacts: any; + /** the route authentication mode.*/ + mode: any; + /** the authentication error is failed and mode set to 'try'.*/ + error: any; + /** an object used by the ['cookie' authentication scheme] https://github.com/hapijs/hapi-auth-cookie */ + session: any + }; + /** the connection used by this request*/ + connection: ServerConnection; + /** the node domain object used to protect against exceptions thrown in extensions, handlers and route prerequisites. Can be used to manually bind callback functions otherwise bound to other domains.*/ + domain: any; + /** the raw request headers (references request.raw.headers).*/ + headers: IDictionary; + /** a unique request identifier (using the format '{now}:{connection.info.id}:{5 digits counter}').*/ + id: number; + /** request information */ + info: { + /** request reception timestamp. */ + received: number; + /** request response timestamp (0 is not responded yet). */ + responded: number; + /** remote client IP address. */ - remoteAddress: string; - /** remote client port. */ - remotePort: number; - /** content of the HTTP 'Referrer' (or 'Referer') header. */ - referrer: string; - /** content of the HTTP 'Host' header (e.g. 'example.com:8080'). */ - host: string; - /** the hostname part of the 'Host' header (e.g. 'example.com').*/ - hostname: string; - }; - /** the request method in lower case (e.g. 'get', 'post'). */ - method: string; - /** the parsed content-type header. Only available when payload parsing enabled and no payload error occurred. */ - mime: string; - /** an object containing the values of params, query, and payload before any validation modifications made. Only set when input validation is performed.*/ - orig: { - params: any; - query: any; - payload: any; - }; - /** an object where each key is a path parameter name with matching value as described in Path parameters.*/ - params: IDictionary; - /** an array containing all the path params values in the order they appeared in the path.*/ - paramsArray: string[]; - /** the request URI's path component. */ - path: string; - /** the request payload based on the route payload.output and payload.parse settings.*/ - payload: any; - /** plugin-specific state. Provides a place to store and pass request-level plugin data. The plugins is an object where each key is a plugin name and the value is the state.*/ - plugins: any; - /** an object where each key is the name assigned by a route prerequisites function. The values are the raw values provided to the continuation function as argument. For the wrapped response object, use responses.*/ - pre: IDictionary; - /** the response object when set. The object can be modified but must not be assigned another object. To replace the response with another from within an extension point, use reply(response) to override with a different response. Contains null when no response has been set (e.g. when a request terminates prematurely when the client disconnects).*/ - response: Response; - /**preResponses - same as pre but represented as the response object created by the pre method.*/ - preResponses: any; - /**an object containing the query parameters.*/ - query: any; - /** an object containing the Node HTTP server objects. Direct interaction with these raw objects is not recommended.*/ - raw: { - req: http.ClientRequest; - res: http.ServerResponse; - }; - /** the route public interface.*/ - route: IRoute; - /** the server object. */ - server: Server; - /** Special key reserved for plugins implementing session support. Plugins utilizing this key must check for null value to ensure there is no conflict with another similar server. */ - session: any; - /** an object containing parsed HTTP state information (cookies) where each key is the cookie name and value is the matching cookie content after processing using any registered cookie definition. */ - state: any; - /** complex object contining details on the url */ - url: { - /** null when i tested */ - auth: any; - /** null when i tested */ - hash: any; - /** null when i tested */ - host: any; - /** null when i tested */ - hostname: any; - href: string; - path: string; - /** path without search*/ - pathname: string; - /** null when i tested */ - port: any; - /** null when i tested */ - protocol: any; - /** querystring parameters*/ - query: IDictionary; - /** querystring parameters as a string*/ - search: string; - /** null when i tested */ - slashes: any; - }; + remoteAddress: string; + /** remote client port. */ + remotePort: number; + /** content of the HTTP 'Referrer' (or 'Referer') header. */ + referrer: string; + /** content of the HTTP 'Host' header (e.g. 'example.com:8080'). */ + host: string; + /** the hostname part of the 'Host' header (e.g. 'example.com').*/ + hostname: string; + }; + /** the request method in lower case (e.g. 'get', 'post'). */ + method: string; + /** the parsed content-type header. Only available when payload parsing enabled and no payload error occurred. */ + mime: string; + /** an object containing the values of params, query, and payload before any validation modifications made. Only set when input validation is performed.*/ + orig: { + params: any; + query: any; + payload: any; + }; + /** an object where each key is a path parameter name with matching value as described in Path parameters.*/ + params: IDictionary; + /** an array containing all the path params values in the order they appeared in the path.*/ + paramsArray: string[]; + /** the request URI's path component. */ + path: string; + /** the request payload based on the route payload.output and payload.parse settings.*/ + payload: stream.Readable | Buffer | any; + /** plugin-specific state. Provides a place to store and pass request-level plugin data. The plugins is an object where each key is a plugin name and the value is the state.*/ + plugins: any; + /** an object where each key is the name assigned by a route prerequisites function. The values are the raw values provided to the continuation function as argument. For the wrapped response object, use responses.*/ + pre: IDictionary; + /** the response object when set. The object can be modified but must not be assigned another object. To replace the response with another from within an extension point, use reply(response) to override with a different response. Contains null when no response has been set (e.g. when a request terminates prematurely when the client disconnects).*/ + response: Response; + /**preResponses - same as pre but represented as the response object created by the pre method.*/ + preResponses: any; + /**an object containing the query parameters.*/ + query: any; + /** an object containing the Node HTTP server objects. Direct interaction with these raw objects is not recommended.*/ + raw: { + req: http.ClientRequest; + res: http.ServerResponse; + }; + /** the route public interface.*/ + route: IRoute; + /** the server object. */ + server: Server; + /** Special key reserved for plugins implementing session support. Plugins utilizing this key must check for null value to ensure there is no conflict with another similar server. */ + session: any; + /** an object containing parsed HTTP state information (cookies) where each key is the cookie name and value is the matching cookie content after processing using any registered cookie definition. */ + state: any; + /** complex object contining details on the url */ + url: { + /** null when i tested */ + auth: any; + /** null when i tested */ + hash: any; + /** null when i tested */ + host: any; + /** null when i tested */ + hostname: any; + href: string; + path: string; + /** path without search*/ + pathname: string; + /** null when i tested */ + port: any; + /** null when i tested */ + protocol: any; + /** querystring parameters*/ + query: IDictionary; + /** querystring parameters as a string*/ + search: string; + /** null when i tested */ + slashes: any; + }; /** request.setUrl(url) Available only in 'onRequest' extension methods. @@ -1173,7 +1222,7 @@ declare module "hapi" { request.setUrl('/test'); return reply.continue(); });*/ - setUrl(url: string): void; + setUrl(url: string): void; /** request.setMethod(method) Available only in 'onRequest' extension methods. @@ -1191,7 +1240,7 @@ declare module "hapi" { request.setMethod('GET'); return reply.continue(); });*/ - setMethod(method: string): void; + setMethod(method: string): void; /** request.log(tags, [data, [timestamp]]) Always available. @@ -1219,13 +1268,13 @@ declare module "hapi" { return reply(); }; */ - log( - /** a string or an array of strings (e.g. ['error', 'database', 'read']) used to identify the event. Tags are used instead of log levels and provide a much more expressive mechanism for describing and filtering events.*/ - tags: string|string[], - /** an optional message string or object with the application data being logged.*/ - data?: string, - /** an optional timestamp expressed in milliseconds. Defaults to Date.now() (now).*/ - timestamp?: number): void; + log( + /** a string or an array of strings (e.g. ['error', 'database', 'read']) used to identify the event. Tags are used instead of log levels and provide a much more expressive mechanism for describing and filtering events.*/ + tags: string | string[], + /** an optional message string or object with the application data being logged.*/ + data?: string, + /** an optional timestamp expressed in milliseconds. Defaults to Date.now() (now).*/ + timestamp?: number): void; /** request.getLog([tags], [internal]) Always available. @@ -1237,11 +1286,11 @@ declare module "hapi" { request.getLog(['error'], true); request.getLog(false);*/ - getLog( - /** is a single tag string or array of tag strings. If no tags specified, returns all events.*/ - tags?: string, - /** filters the events to only those with a matching event.internal value. If true, only internal logs are included. If false, only user event are included. Defaults to all events (undefined).*/ - internal?: boolean): string[]; + getLog( + /** is a single tag string or array of tag strings. If no tags specified, returns all events.*/ + tags?: string, + /** filters the events to only those with a matching event.internal value. If true, only internal logs are included. If false, only user event are included. Defaults to all events (undefined).*/ + internal?: boolean): string[]; /** request.tail([name]) @@ -1278,10 +1327,10 @@ declare module "hapi" { console.log('Request completed including db activity'); });*/ - tail( - /** an optional tail name used for logging purposes.*/ - name?: string): Function; - } + tail( + /** an optional tail name used for logging purposes.*/ + name?: string): Function; + } /** Response events The response object supports the following events: @@ -1313,14 +1362,14 @@ declare module "hapi" { return reply.continue(); });*/ - export class Response extends Events.EventEmitter { - isBoom: boolean; - /** the HTTP response status code. Defaults to 200 (except for errors).*/ - statusCode: number; - /** an object containing the response headers where each key is a header field name. Note that this is an incomplete list of headers to be included with the response. Additional headers will be added once the response is prepare for transmission.*/ - headers: IDictionary; - /** the value provided using the reply interface.*/ - source: any; + export class Response extends Events.EventEmitter { + isBoom: boolean; + /** the HTTP response status code. Defaults to 200 (except for errors).*/ + statusCode: number; + /** an object containing the response headers where each key is a header field name. Note that this is an incomplete list of headers to be included with the response. Additional headers will be added once the response is prepare for transmission.*/ + headers: IDictionary; + /** the value provided using the reply interface.*/ + source: any; /** a string indicating the type of source with available values: 'plain' - a plain response such as string, number, null, or simple object (e.g. not a Stream, Buffer, or view). 'buffer' - a Buffer. @@ -1328,11 +1377,11 @@ declare module "hapi" { 'file' - a file generated with reply.file() of via the directory handler. 'stream' - a Stream. 'promise' - a Promise object. */ - variety: string; - /** application-specific state. Provides a safe place to store application data without potential conflicts with the framework. Should not be used by plugins which should use plugins[name].*/ - app: any; - /** plugin-specific state. Provides a place to store and pass request-level plugin data. The plugins is an object where each key is a plugin name and the value is the state. */ - plugins: any; + variety: string; + /** application-specific state. Provides a safe place to store application data without potential conflicts with the framework. Should not be used by plugins which should use plugins[name].*/ + app: any; + /** plugin-specific state. Provides a place to store and pass request-level plugin data. The plugins is an object where each key is a plugin name and the value is the state. */ + plugins: any; /** settings - response handling flags: charset - the 'Content-Type' HTTP header 'charset' property. Defaults to 'utf-8'. encoding - the string encoding scheme used to serial data into the HTTP payload when source is a string or marshals into a string. Defaults to 'utf8'. @@ -1340,39 +1389,39 @@ declare module "hapi" { stringify - options used for source value requiring stringification. Defaults to no replacer and no space padding. ttl - if set, overrides the route cache expiration milliseconds value set in the route config. Defaults to no override. varyEtag - if true, a suffix will be automatically added to the 'ETag' header at transmission time (separated by a '-' character) when the HTTP 'Vary' header is present.*/ - settings: { - charset: string; - encoding: string; - passThrough: boolean; - stringify: any; - ttl: number; - varyEtag: boolean; - } + settings: { + charset: string; + encoding: string; + passThrough: boolean; + stringify: any; + ttl: number; + varyEtag: boolean; + } /** sets the HTTP 'Content-Length' header (to avoid chunked transfer encoding) where: length - the header value. Must match the actual payload size.*/ - bytes(length: number): Response; - /** sets the 'Content-Type' HTTP header 'charset' property where: charset - the charset property value.*/ - charset(charset: string): Response; + bytes(length: number): Response; + /** sets the 'Content-Type' HTTP header 'charset' property where: charset - the charset property value.*/ + charset(charset: string): Response; /** sets the HTTP status code where: statusCode - the HTTP status code.*/ - code(statusCode: number): Response; - /** sets the HTTP status code to Created (201) and the HTTP 'Location' header where: uri - an absolute or relative URI used as the 'Location' header value.*/ - created(uri: string): Response; + code(statusCode: number): Response; + /** sets the HTTP status code to Created (201) and the HTTP 'Location' header where: uri - an absolute or relative URI used as the 'Location' header value.*/ + created(uri: string): Response; - /** encoding(encoding) - sets the string encoding scheme used to serial data into the HTTP payload where: encoding - the encoding property value (see node Buffer encoding).*/ - encoding(encoding: string): Response; + /** encoding(encoding) - sets the string encoding scheme used to serial data into the HTTP payload where: encoding - the encoding property value (see node Buffer encoding).*/ + encoding(encoding: string): Response; /** etag(tag, options) - sets the representation entity tag where: tag - the entity tag string without the double-quote. options - optional settings where: weak - if true, the tag will be prefixed with the 'W/' weak signifier. Weak tags will fail to match identical tags for the purpose of determining 304 response status. Defaults to false. vary - if true and content encoding is set or applied to the response (e.g 'gzip' or 'deflate'), the encoding name will be automatically added to the tag at transmission time (separated by a '-' character). Ignored when weak is true. Defaults to true.*/ - etag(tag: string, options: { - weak: boolean; vary: boolean; - }): Response; + etag(tag: string, options: { + weak: boolean; vary: boolean; + }): Response; /**header(name, value, options) - sets an HTTP header where: name - the header name. @@ -1381,39 +1430,120 @@ declare module "hapi" { append - if true, the value is appended to any existing header value using separator. Defaults to false. separator - string used as separator when appending to an exiting value. Defaults to ','. override - if false, the header value is not set if an existing value present. Defaults to true.*/ - header(name: string, value: string, options?: { - append: boolean; - separator: string; - override: boolean; - }): Response; + header(name: string, value: string, options?: { + append: boolean; + separator: string; + override: boolean; + }): Response; /** location(uri) - sets the HTTP 'Location' header where: uri - an absolute or relative URI used as the 'Location' header value.*/ - location(uri: string): Response; + location(uri: string): Response; /** redirect(uri) - sets an HTTP redirection response (302) and decorates the response with additional methods listed below, where: uri - an absolute or relative URI used to redirect the client to another resource. */ - redirect(uri: string): Response; + redirect(uri: string): Response; /** replacer(method) - sets the JSON.stringify() replacer argument where: method - the replacer function or array. Defaults to none.*/ - replacer(method: Function| Array): Response; + replacer(method: Function | Array): Response; /** spaces(count) - sets the JSON.stringify() space argument where: count - the number of spaces to indent nested object keys. Defaults to no indentation. */ - spaces(count: number): Response; + spaces(count: number): Response; /**state(name, value, [options]) - sets an HTTP cookie where: name - the cookie name. value - the cookie value. If no encoding is defined, must be a string. options - optional configuration. If the state was previously registered with the server using server.state(), the specified keys in options override those same keys in the server definition (but not others).*/ - state(name: string, value: string, options?: any): Response; + state(name: string, value: string, options?: any): Response; + /** sets a string suffix when the response is process via JSON.stringify().*/ + suffix(suffix: string): void; + /** overrides the default route cache expiration rule for this response instance where: +msec - the time-to-live value in milliseconds.*/ + ttl(msec: number): void; /** type(mimeType) - sets the HTTP 'Content-Type' header where: mimeType - is the mime type. Should only be used to override the built-in default for each response type. */ - type(mimeType: string): Response; - } - + type(mimeType: string): Response; + /** clears the HTTP cookie by setting an expired value where: +name - the cookie name. +options - optional configuration for expiring cookie. If the state was previously registered with the server using server.state(), the specified keys in options override those same keys in the server definition (but not others).*/ + unstate(name: string, options?: { [key: string]: string }): void; + /** adds the provided header to the list of inputs affected the response generation via the HTTP 'Vary' header where: +header - the HTTP request header name.*/ + vary(header: string): void; + } + /** When using the redirect() method, the response object provides these additional methods */ + export class ResponseRedirect extends Response { + /** sets the status code to 302 or 307 (based on the rewritable() setting) where: +isTemporary - if false, sets status to permanent. Defaults to true.*/ + temporary(isTemporary: boolean): void; + /** sets the status code to 301 or 308 (based on the rewritable() setting) where: +isPermanent - if true, sets status to temporary. Defaults to false. */ + permanent(isPermanent: boolean): void; + /** sets the status code to 301/302 for rewritable (allows changing the request method from 'POST' to 'GET') or 307/308 for non-rewritable (does not allow changing the request method from 'POST' to 'GET'). Exact code based on the temporary() or permanent() setting. Arguments: +isRewritable - if false, sets to non-rewritable. Defaults to true. +Permanent Temporary +Rewritable 301 302(1) +Non-rewritable 308(2) 307 +Notes: 1. Default value. 2. Proposed code, not supported by all clients. */ + rewritable(isRewritable: boolean): void; + } + /** info about a server connection */ + export interface IServerConnectionInfo { + /** - a unique connection identifier (using the format '{hostname}:{pid}:{now base36}').*/ + id: string; + /** - the connection creation timestamp.*/ + created: number; + /** - the connection start timestamp (0 when stopped).*/ + started: number; + /** the connection port based on the following rules: + the configured port value before the server has been started. + the actual port assigned when no port is configured or set to 0 after the server has been started.*/ + port: number; + /** - the host name the connection was configured to. Defaults to the operating system hostname when available, otherwise 'localhost'.*/ + host: string; + /** - the active IP address the connection was bound to after starting.Set to undefined until the server has been started or when using a non TCP port (e.g. UNIX domain socket).*/ + address: string; + /** - the protocol used: + 'http' - HTTP. + 'https' - HTTPS. + 'socket' - UNIX domain socket or Windows named pipe.*/ + protocol: string; + /** a string representing the connection (e.g. 'http://example.com:8080' or 'socket:/unix/domain/socket/path'). Contains the uri setting if provided, otherwise constructed from the available settings. If no port is available or set to 0, the uri will not include a port component.*/ + uri: string; + } + /** + * undocumented. The connection object constructed after calling server.connection(); + * can be accessed via server.connections; or request.connection; + */ + export class ServerConnection extends Events.EventEmitter { + domain: any; + _events: { route: Function, domain: Function, _events: Function, _eventsCount: Function, _maxListeners: Function }; + _eventsCount: number; + settings: IServerConnectionOptions; + server: Server; + /** ex: "tcp" */ + type: string; + _started: boolean; + /** dictionary of sockets */ + _connections: { [ip_port: string]: any }; + _onConnection: Function; + registrations: any; + _extensions: any; + _requestCounter: { value: number; min: number; max: number }; + _load: any; + states: { + settings: any; cookies: any; names: any[] + }; + auth: { connection: ServerConnection; _schemes: any; _strategies: any; settings: any; }; + _router: any; + MSPluginsCollection: any; + applicationCache: any; + addEventListener: any; + info: IServerConnectionInfo; + } /** Server http://hapijs.com/api#server rver object is the main application container. The server manages all incoming connections along with all the facilities provided by the framework. A server can contain more than one connection (e.g. listen to port 80 and 8080). @@ -1429,9 +1559,9 @@ declare module "hapi" { 'tail' - emitted when a request finished processing, including any registered tails. Single event per request. Note that the server object should not be used to emit application events as its internal implementation is designed to fan events out to the various plugin selections and not for application events. MORE EVENTS HERE: http://hapijs.com/api#server-events*/ - export class Server extends Events.EventEmitter { + export class Server extends Events.EventEmitter { - constructor(options?: IServerOptions); + constructor(options?: IServerOptions); /** Provides a safe place to store server-specific run-time application data without potential conflicts with the framework internals. The data can be accessed whenever the server is accessible. Initialized with an empty object. var Hapi = require('hapi'); server = new Hapi.Server(); @@ -1439,7 +1569,7 @@ declare module "hapi" { var handler = function (request, reply) { return reply(request.server.app.key); }; */ - app: any; + app: any; /** An array containing the server's connections. When the server object is returned from server.select(), the connections array only includes the connections matching the selection criteria. var server = new Hapi.Server(); server.connection({ port: 80, labels: 'a' }); @@ -1447,7 +1577,7 @@ declare module "hapi" { // server.connections.length === 2 var a = server.select('a'); // a.connections.length === 1*/ - connections: Array; + connections: Array; /** When the server contains exactly one connection, info is an object containing information about the sole connection. * When the server contains more than one connection, each server.connections array member provides its own connection.info. var server = new Hapi.Server(); @@ -1457,41 +1587,18 @@ declare module "hapi" { // server.info === null // server.connections[1].info.port === 8080 */ - info: { - /** - a unique connection identifier (using the format '{hostname}:{pid}:{now base36}').*/ - id: string; - /** - the connection creation timestamp.*/ - created: number; - /** - the connection start timestamp (0 when stopped).*/ - started: number; - /** the connection port based on the following rules: - the configured port value before the server has been started. - the actual port assigned when no port is configured or set to 0 after the server has been started.*/ - port: number; - - /** - the host name the connection was configured to. Defaults to the operating system hostname when available, otherwise 'localhost'.*/ - host: string; - /** - the active IP address the connection was bound to after starting.Set to undefined until the server has been started or when using a non TCP port (e.g. UNIX domain socket).*/ - address: string; - /** - the protocol used: - 'http' - HTTP. - 'https' - HTTPS. - 'socket' - UNIX domain socket or Windows named pipe.*/ - protocol: string; - /** a string representing the connection (e.g. 'http://example.com:8080' or 'socket:/unix/domain/socket/path'). Contains the uri setting if provided, otherwise constructed from the available settings. If no port is available or set to 0, the uri will not include a port component.*/ - uri: string; - }; + info: IServerConnectionInfo; /** An object containing the process load metrics (when load.sampleInterval is enabled): rss - RSS memory usage. var Hapi = require('hapi'); var server = new Hapi.Server({ load: { sampleInterval: 1000 } }); console.log(server.load.rss);*/ - load: { - /** - event loop delay milliseconds.*/ - eventLoopDelay: number; - /** - V8 heap usage.*/ - heapUsed: number; - }; + load: { + /** - event loop delay milliseconds.*/ + eventLoopDelay: number; + /** - V8 heap usage.*/ + heapUsed: number; + }; /** When the server contains exactly one connection, listener is the node HTTP server object of the sole connection. When the server contains more than one connection, each server.connections array member provides its own connection.listener. var Hapi = require('hapi'); @@ -1502,7 +1609,7 @@ declare module "hapi" { io.sockets.on('connection', function(socket) { socket.emit({ msg: 'welcome' }); });*/ - listener: http.Server; + listener: http.Server; /** server.methods An object providing access to the server methods where each server method name is an object property. @@ -1514,7 +1621,7 @@ declare module "hapi" { server.methods.add(1, 2, function (err, result) { // result === 3 });*/ - methods: IDictionary; + methods: IDictionary; /** server.mime Provides access to the server MIME database used for setting content-type information. The object must not be modified directly but only through the mime server setting. @@ -1534,7 +1641,7 @@ declare module "hapi" { var server = new Hapi.Server(options); // server.mime.path('code.js').type === 'application/javascript' // server.mime.path('file.npm').type === 'node/module'*/ - mime: any; + mime: any; /**server.plugins An object containing the values exposed by each plugin registered where each key is a plugin name and the values are the exposed properties by each plugin using server.expose(). Plugins may set the value of the server.plugins[name] object directly or via the server.expose() method. exports.register = function (server, options, next) { @@ -1545,7 +1652,7 @@ declare module "hapi" { exports.register.attributes = { name: 'example' };*/ - plugins: IDictionary; + plugins: IDictionary; /** server.realm The realm object contains server-wide or plugin-specific state that can be shared across various methods. For example, when calling server.bind(), the active realm settings.bind property is set which is then used by routes and extensions added at the same level (server root or plugin). Realms are a limited version of a sandbox where plugins can maintain state used by the framework when adding routes, extensions, and other properties. modifiers - when the server object is provided as an argument to the plugin register() method, modifiers provides the registration preferences passed the server.register() method and includes: @@ -1562,11 +1669,11 @@ declare module "hapi" { console.log(server.realm.modifiers.route.prefix); return next(); };*/ - realm: IServerRealm; + realm: IServerRealm; /** server.root The root server object containing all the connections and the root server methods (e.g. start(), stop(), connection()).*/ - root: Server; + root: Server; /** server.settings The server configuration object after defaults applied. var Hapi = require('hapi'); @@ -1576,14 +1683,14 @@ declare module "hapi" { } }); // server.settings.app === { key: 'value' }*/ - settings: IServerOptions; + settings: IServerOptions; /** server.version The hapi module version number. var Hapi = require('hapi'); var server = new Hapi.Server(); // server.version === '8.0.0'*/ - version: string; + version: string; /** server.after(method, [dependencies]) Adds a method to be called after all the plugin dependencies have been registered and before the server starts (only called if the server is started) where: @@ -1602,9 +1709,9 @@ declare module "hapi" { // After method already executed }); server.auth.default(options)*/ - after(method: (plugin: any, next: (err: any) => void) => void, dependencies: string|string[]): void; + after(method: (plugin: any, next: (err: any) => void) => void, dependencies: string | string[]): void; - auth: { + auth: { /** server.auth.default(options) Sets a default strategy which is applied to every route where: options - a string with the default strategy name or an object with a specified strategy or strategies using the same format as the route auth handler options. @@ -1622,14 +1729,14 @@ declare module "hapi" { return reply(request.auth.credentials.user); } });*/ - default(options: string):void; + default(options: string): void; /** server.auth.scheme(name, scheme) Registers an authentication scheme where: name - the scheme name. scheme - the method implementing the scheme with signature function(server, options) where: server - a reference to the server object the scheme is added to. options - optional scheme settings used to instantiate a strategy.*/ - scheme(name: string, + scheme(name: string, /** When the scheme authenticate() method implementation calls reply() with an error condition, the specifics of the error affect whether additional authentication strategies will be attempted if configured for the route. If the err returned by the reply() method includes a message, no additional strategies will be attempted. If the err does not include a message but does include a scheme name (e.g. Boom.unauthorized(null, 'Custom')), additional strategies will be attempted in order of preference. n the scheme payload() method returns an error with a message, it means payload validation failed due to bad payload. If the error has no message but includes a scheme name (e.g. Boom.unauthorized(null, 'Custom')), authentication may still be successful if the route auth.payload configuration is set to 'optional'. server = new Hapi.Server(); @@ -1647,7 +1754,7 @@ declare module "hapi" { }; }; */ - scheme: (server: Server, options: any) => IServerAuthScheme): void; + scheme: (server: Server, options: any) => IServerAuthScheme): void; /** server.auth.strategy(name, scheme, [mode], [options]) Registers an authentication strategy where: @@ -1669,7 +1776,7 @@ declare module "hapi" { } } });*/ - strategy(name: string, scheme: any, mode?: boolean, options?: any):void; + strategy(name: string, scheme: any, mode?: boolean | string, options?: any): void; /** server.auth.test(strategy, request, next) Tests a request against an authentication strategy where: @@ -1695,8 +1802,8 @@ declare module "hapi" { }); } });*/ - test(strategy: string, request: Request, next: (err: any, credentials: any) => void): void; - }; + test(strategy: string, request: Request, next: (err: any, credentials: any) => void): void; + }; /** server.bind(context) Sets a global context used as the default bind object when adding a route or an extension where: context - the object used to bind this in handler and extension methods. @@ -1712,7 +1819,7 @@ declare module "hapi" { server.route({ method: 'GET', path: '/', handler: handler }); return next(); };*/ - bind(context: any): void; + bind(context: any): void; /** server.cache(options) @@ -1735,7 +1842,7 @@ declare module "hapi" { // value === { capital: 'oslo' }; }); });*/ - cache(options: ICatBoxCacheOptions): void; + cache(options: ICatBoxCacheOptions): void; /** server.connection([options]) Adds an incoming server connection @@ -1749,7 +1856,7 @@ declare module "hapi" { // server.connections.length === 2 // web.connections.length === 1 // admin.connections.length === 1 */ - connection(options: IServerConnectionOptions): Server; + connection(options: IServerConnectionOptions): Server; /** server.decorate(type, property, method) Extends various framework interfaces with custom methods where: type - the interface being decorated. Supported types: @@ -1771,7 +1878,7 @@ declare module "hapi" { return reply.success(); } });*/ - decorate(type: string, property: string, method: Function):void; + decorate(type: string, property: string, method: Function): void; /** server.dependency(dependencies, [after]) Used within a plugin to declares a required dependency on other plugins where: @@ -1788,7 +1895,7 @@ declare module "hapi" { // Additional plugin registration logic return next(); };*/ - dependency(dependencies: string|string[], after?: (server: Server, next: (err: any) => void) => void): void; + dependency(dependencies: string | string[], after?: (server: Server, next: (err: any) => void) => void): void; /** server.expose(key, value) @@ -1799,7 +1906,7 @@ declare module "hapi" { server.expose('util', function () { console.log('something'); }); return next(); };*/ - expose(key: string, value: any): void; + expose(key: string, value: any): void; /** server.expose(obj) Merges a deep copy of an object into to the existing content of server.plugins[name] where: @@ -1808,13 +1915,13 @@ declare module "hapi" { server.expose({ util: function () { console.log('something'); } }); return next(); };*/ - expose(obj: any): void; + expose(obj: any): void; /** server.ext(event, method, [options]) Registers an extension function in one of the available extension points where: event - the event name. method - a function or an array of functions to be executed at a specified point during request processing. The required extension function signature is function(request, reply) where: - request - the request object. + request - the request object. NOTE: Access the Response via request.response reply - the reply interface which is used to return control back to the framework. To continue normal execution of the request lifecycle, reply.continue() must be called. To abort processing and return a response to the client, call reply(value) where value is an error or any other valid response. this - the object provided via options.bind or the current active context set with server.bind(). options - an optional object with the following: @@ -1835,7 +1942,7 @@ declare module "hapi" { server.route({ method: 'GET', path: '/test', handler: handler }); server.start(); // All requests will get routed to '/test'*/ - ext(event: string, method: (request: Request, reply: IReply, bind?: any) => void, options?: { before: string|string[]; after: string|string[]; bind?: any }): void; + ext(event: string, method: (request: Request, reply: IReply, bind?: any) => void, options?: { before: string | string[]; after: string | string[]; bind?: any }): void; /** server.handler(name, method) Registers a new handler type to be used in routes where: @@ -1875,7 +1982,7 @@ declare module "hapi" { } }; server.handler('test', handler);*/ - handler(name: string, method: (route: IRoute, options: THandlerConfig) => ISessionHandler): void; + handler(name: string, method: (route: IRoute, options: THandlerConfig) => ISessionHandler): void; /** When the server contains exactly one connection, injects a request into the sole connection simulating an incoming HTTP request without making an actual socket connection. Injection is useful for testing purposes as well as for invoking routing logic internally without the overhead or limitations of the network stack. Utilizes the [shot module | https://github.com/hapijs/shot ] for performing injections, with some additional options and response properties @@ -1891,7 +1998,7 @@ declare module "hapi" { console.log(res.result); }); */ - inject: IServerInject; + inject: IServerInject; /** server.log(tags, [data, [timestamp]]) Logs server events that cannot be associated with a specific request. When called the server emits a 'log' event which can be used by other listeners or plugins to record the information or output to the console. The arguments are: @@ -1907,7 +2014,7 @@ declare module "hapi" { } }); server.log(['test', 'error'], 'Test event');*/ - log(tags: string|string[], data?: string|any, timestamp?: number): void; + log(tags: string | string[], data?: string | any, timestamp?: number): void; /**server.lookup(id) When the server contains exactly one connection, looks up a route configuration where: id - the route identifier as set in the route options. @@ -1924,7 +2031,7 @@ declare module "hapi" { }); var route = server.lookup('root'); When the server contains more than one connection, each server.connections array member provides its own connection.lookup() method.*/ - lookup(id: string): IRoute; + lookup(id: string): IRoute; /** server.match(method, path, [host]) When the server contains exactly one connection, looks up a route configuration where: method - the HTTP method (e.g. 'GET', 'POST'). @@ -1943,7 +2050,7 @@ declare module "hapi" { }); var route = server.match('get', '/'); When the server contains more than one connection, each server.connections array member provides its own connection.match() method.*/ - match(method: string, path: string, host?: string): IRoute; + match(method: string, path: string, host?: string): IRoute; @@ -1987,11 +2094,11 @@ declare module "hapi" { server.methods.sumSync(4, 5, function (err, result) { console.log(result); }); */ - method( - /** a unique method name used to invoke the method via server.methods[name]. When configured with caching enabled, server.methods[name].cache.drop(arg1, arg2, ..., argn, callback) can be used to clear the cache for a given key. Supports using nested names such as utils.users.get which will automatically create the missing path under server.methods and can be accessed for the previous example via server.methods.utils.users.get.*/ - name: string, - method: IServerMethod, - options?: IServerMethodOptions):void; + method( + /** a unique method name used to invoke the method via server.methods[name]. When configured with caching enabled, server.methods[name].cache.drop(arg1, arg2, ..., argn, callback) can be used to clear the cache for a given key. Supports using nested names such as utils.users.get which will automatically create the missing path under server.methods and can be accessed for the previous example via server.methods.utils.users.get.*/ + name: string, + method: IServerMethod, + options?: IServerMethodOptions): void; /**server.method(methods) @@ -2012,11 +2119,11 @@ declare module "hapi" { } } });*/ - method(methods: { - name: string; method: IServerMethod; options?: IServerMethodOptions - }| Array<{ - name: string; method: IServerMethod; options?: IServerMethodOptions - }>):void; + method(methods: { + name: string; method: IServerMethod; options?: IServerMethodOptions + } | Array<{ + name: string; method: IServerMethod; options?: IServerMethodOptions + }>): void; /**server.path(relativeTo) Sets the path prefix used to locate static resources (files and view templates) when relative paths are used where: relativeTo - the path prefix added to any relative file path starting with '.'. @@ -2026,7 +2133,7 @@ declare module "hapi" { server.route({ path: '/file', method: 'GET', handler: { file: './test.html' } }); next(); };*/ - path(relativeTo: string): void; + path(relativeTo: string): void; /**server.register(plugins, [options], callback) Registers a plugin where: plugins - an object or array of objects where each one is either: @@ -2051,15 +2158,15 @@ declare module "hapi" { console.log('Failed loading plugin'); } });*/ - register(plugins: any|any[], options: { - select: string|string[]; - routes: { - prefix: string; vhost?: string|string[] - }; - } - , callback: (err: any) => void):void; + register(plugins: any | any[], options: { + select: string | string[]; + routes: { + prefix: string; vhost?: string | string[] + }; + } + , callback: (err: any) => void): void; - register(plugins: any|any[], callback: (err: any) => void):void; + register(plugins: any | any[], callback: (err: any) => void): void; /**server.render(template, context, [options], callback) Utilizes the server views manager to render a template where: @@ -2084,7 +2191,7 @@ declare module "hapi" { server.render('hello', context, function (err, rendered, config) { console.log(rendered); });*/ - render(template: string, context: any, options: any, callback: (err: any, rendered: any, config: any) => void):void; + render(template: string, context: any, options: any, callback: (err: any, rendered: any, config: any) => void): void; /** server.route(options) Adds a connection route where: options - a route configuration object or an array of configuration objects. @@ -2096,8 +2203,8 @@ declare module "hapi" { { method: 'GET', path: '/1', handler: function (request, reply) { return reply('ok'); } }, { method: 'GET', path: '/2', handler: function (request, reply) { return reply('ok'); } } ]);*/ - route(options: IRouteConfiguration):void; - route(options: IRouteConfiguration[]):void; + route(options: IRouteConfiguration): void; + route(options: IRouteConfiguration[]): void; /**server.select(labels) Selects a subset of the server's connections where: labels - a single string or array of strings of labels used as a logical OR statement to select all the connections with matching labels in their configuration. @@ -2111,7 +2218,7 @@ declare module "hapi" { var a = server.select('a'); // The server with port 80 var ab = server.select(['a','b']); // A list of servers containing the server with port 80 and the server with port 8080 var c = server.select('c'); // A list of servers containing the server with port 8081 and the server with port 8082 */ - select(labels: string|string[]): Server|Server[]; + select(labels: string | string[]): Server | Server[]; /** server.start([callback]) Starts the server connections by listening for incoming requests on the configured port of each listener (unless the connection was configured with autoListen set to false), where: callback - optional callback when server startup is completed or failed with the signature function(err) where: @@ -2122,7 +2229,7 @@ declare module "hapi" { server.start(function (err) { console.log('Server started at: ' + server.info.uri); });*/ - start(callback?: (err: any) => void): void; + start(callback?: (err: any) => void): void; /** server.state(name, [options]) HTTP state management uses client cookies to persist a state across multiple requests. Registers a cookie definitions State defaults can be modified via the server connections.routes.state configuration option. @@ -2154,7 +2261,7 @@ declare module "hapi" { console.error(event); } }); */ - state(name: string, options?: ICookieSettings): void; + state(name: string, options?: ICookieSettings): void; /** server.stop([options], [callback]) Stops the server's connections by refusing to accept any new connections or requests (existing connections will continue until closed or timeout), where: @@ -2167,7 +2274,7 @@ declare module "hapi" { server.stop({ timeout: 60 * 1000 }, function () { console.log('Server stopped'); });*/ - stop(options?: { timeout: number }, callback?: () => void): void; + stop(options?: { timeout: number }, callback?: () => void): void; /**server.table([host]) Returns a copy of the routing table where: host - optional host to filter routes matching a specific virtual host. Defaults to all virtual hosts. @@ -2198,7 +2305,7 @@ declare module "hapi" { // } //] */ - table(host?: any): IConnectionTable; + table(host?: any): IConnectionTable; /**server.views(options) Initializes the server views manager @@ -2212,7 +2319,7 @@ declare module "hapi" { path: '/static/templates' }); When server.views() is called within a plugin, the views manager is only available to plugins methods.*/ - views(options: IServerViewsConfiguration): void; + views(options: IServerViewsConfiguration): void; - } + } } diff --git a/helmet/helmet-tests.ts b/helmet/helmet-tests.ts new file mode 100644 index 000000000..83fd224a7 --- /dev/null +++ b/helmet/helmet-tests.ts @@ -0,0 +1,96 @@ +/// + +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 xssFilterTest() { + app.use(helmet.xssFilter()); + app.use(helmet.xssFilter({ setOnOldIE: true })); +} + +/** + * @summary Test for {@see helmet#csp} function + */ + +function contentSecurityPolicyTest() { + + // taken directly from helmet-csp docs + const config = { + // Specify directives as normal. + directives: { + defaultSrc: ["'self'", 'default.com'], + scriptSrc: ["'self'", "'unsafe-inline'"], + styleSrc: ['style.com'], + imgSrc: ['img.com', 'data:'], + sandbox: ['allow-forms', 'allow-scripts'], + reportUri: '/report-violation', + + objectSrc: ["'self'"], // An empty array allows nothing through + }, + + // Set to true if you only want browsers to report errors, not block them + reportOnly: false, + + // Set to true if you want to blindly set all headers: Content-Security-Policy, + // X-WebKit-CSP, and X-Content-Security-Policy. + setAllHeaders: false, + + // Set to true if you want to disable CSP on Android where it can be buggy. + disableAndroid: false + } + app.use(helmet.csp()); + app.use(helmet.contentSecurityPolicy(config)); +} + +/** + * @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..4d07730db --- /dev/null +++ b/helmet/helmet.d.ts @@ -0,0 +1,107 @@ +// 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"); + + interface IHelmetCspDirectives { + defaultSrc? : string[]; + scriptSrc? : string[]; + styleSrc? : string[]; + imgSrc? : string[]; + sandbox? : string[]; + reportUri? : string; + objectSrc? : string[]; + } + + interface IHelmetCspConfiguration { + reportOnly? : boolean; + setAllHeaders? : boolean; + disableAndroid? : boolean; + directives? : IHelmetCspDirectives + } + + /** + * @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; + + /** + * @summary Set policy around third-party content via headers + * @return {RequestHandler} The Request handler + * @param {Object} options The options + */ + csp(options ?: IHelmetCspConfiguration): express.RequestHandler; + + /** + * @see csp + */ + contentSecurityPolicy(options ?: IHelmetCspConfiguration): express.RequestHandler; + + } + + var helmet: Helmet; + export = helmet; +} diff --git a/highcharts/highcharts-tests.ts b/highcharts/highcharts-tests.ts index bfcbc9137..ad57f8bc4 100644 --- a/highcharts/highcharts-tests.ts +++ b/highcharts/highcharts-tests.ts @@ -1,4 +1,4 @@ -/// +/// /// function originalTests() { @@ -135,6 +135,51 @@ function originalTests() { var multipleYAxisOptions: HighchartsOptions = { yAxis: [{}, {}] }; + + var renderToIdChart = new Highcharts.Chart("container", { + xAxis: {}, + series: [{ + data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4], + type: "line", + allowPointSelect: true + }] + }); + + var renderToElementChart = new Highcharts.Chart(div, { + xAxis: {}, + series: [{ + data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4], + type: "line", + allowPointSelect: true + }] + }); + + var createWithFunction = Highcharts.chart({ + xAxis: {}, + series: [{ + data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4], + type: "line", + allowPointSelect: true + }] + }); + + var createWithFunctionRenderToId = Highcharts.chart("container", { + xAxis: {}, + series: [{ + data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4], + type: "line", + allowPointSelect: true + }] + }); + + var createWithFunctionRenderToElement = Highcharts.chart(div, { + xAxis: {}, + series: [{ + data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4], + type: "line", + allowPointSelect: true + }] + }); } function test_alldefaults() { @@ -1554,15 +1599,18 @@ function test_Line() { series: [{ data: [1, 2, 3, 4, null, 6, 7, null, 9], step: 'right', - name: 'Right' + name: 'Right', + linecap: 'round' }, { data: [5, 6, 7, 8, null, 10, 11, null, 13], step: 'center', - name: 'Center' + name: 'Center', + linecap: 'round' }, { data: [9, 10, 11, 12, null, 14, 15, null, 17], step: 'left', - name: 'Left' + name: 'Left', + linecap: 'round' }] }); } diff --git a/highcharts/highcharts.d.ts b/highcharts/highcharts.d.ts index bc0a8e9a0..4405f2407 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; @@ -119,6 +117,13 @@ interface HighchartsAxisLabels { * @default 5 */ padding?: number; + /** + * Whether to reserve space for the labels. This can be turned off when for example the labels are rendered inside + * the plot area instead of outside. + * @default true + * @since 4.1.10 + */ + reserveSpace?: boolean; /** * Rotation of the labels in degrees. * @default 0 @@ -1306,7 +1311,7 @@ interface HighchartsChartOptions3dFrame { * @default 'transparent' * @since 4.0 */ - color?: string | HighchartsGradient, + color?: string | HighchartsGradient; /** * Thickness of the panel. * @default 1 @@ -1715,6 +1720,7 @@ interface HighchartsCSSObject { color?: string; cursor?: string; font?: string; + fontFamily?: string; fontSize?: string; fontWeight?: string; left?: string; @@ -3667,6 +3673,11 @@ interface HighchartsSeriesChart { * @default 2 */ lineWidth?: number; + /** + * The line cap used for line ends and line joins on the graph. + * @default 'round' + */ + linecap?: string; /** * The id of another series to link to. Additionally, the value can be ':previous' to link to the previous series. * When two series are linked, only the first one appears in the legend. Toggling the visibility of this also @@ -4440,7 +4451,9 @@ interface HighchartsLineChart extends HighchartsSeriesChart { */ interface HighchartsPieChart extends HighchartsSeriesChart { /** - * The color of the border surrounding each column or bar. + * The color of the border surrounding each slice. When null, the border takes the same color as the slice fill. + * This can be used together with a borderWidth to fill drawing gaps created by antialiazing artefacts in + * borderless pies. * @default '#FFFFFF' */ borderColor?: string; @@ -4719,6 +4732,11 @@ interface HighchartsTreeMapChart extends HighchartsSeriesChart { * @since 4.1.8 */ maxPointWidth?: number; + /** + * The sort index of the point inside the treemap level. + * @since 4.1.10 + */ + sortIndex?: number; /** * A wrapper object for all the series options in specific states. */ @@ -5784,6 +5802,21 @@ interface HighchartsChart { * @return {HighchartsChartObject} */ new (options: HighchartsOptions, callback: (chart: HighchartsChartObject) => void): HighchartsChartObject; + /** + * This is the constructor for creating a new chart object. + * @param {string|HTMLElement} renderTo The id or a reference to a DOM element where the chart should be rendered (since v4.2.0). + * @param {HighchartsOptions} options The chart options + * @return {HighchartsChartObject} + */ + new (renderTo: string | HTMLElement, options: HighchartsOptions): HighchartsChartObject; + /** + * This is the constructor for creating a new chart object. + * @param {string|HTMLElement} renderTo The id or a reference to a DOM element where the chart should be rendered (since v4.2.0). + * @param {HighchartsOptions} options The chart options + * @param callback A function to execute when the chart object is finished loading and rendering. In most cases the chart is built in one thread, but in Internet Explorer version 8 or less the chart is sometimes initiated before the document is ready, and in these cases the chart object will not be finished directly after callingnew Highcharts.Chart(). As a consequence, code that relies on the newly built Chart object should always run in the callback. Defining a chart.event.load handler is equivalent. + * @return {HighchartsChartObject} + */ + new (renderTo: string | HTMLElement, options: HighchartsOptions, callback: (chart: HighchartsChartObject) => void): HighchartsChartObject; } /** @@ -5965,6 +5998,16 @@ interface HighchartsStatic { Renderer: HighchartsRenderer; Color(color: string | HighchartsGradient): string | HighchartsGradient; + /** + * As Highcharts.Chart, but without need for the new keyword. + * @since 4.2.0 + */ + chart(options: HighchartsOptions, callback?: (chart: HighchartsChartObject) => void): HighchartsChartObject; + /** + * As Highcharts.Chart, but without need for the new keyword. + * @since 4.2.0 + */ + chart(renderTo: string | HTMLElement, options: HighchartsOptions, callback?: (chart: HighchartsChartObject) => void): HighchartsChartObject; /** * An array containing the current chart objects in the page. A chart's position in the array is preserved * throughout the page's lifetime. When a chart is destroyed, the array item becomes undefined. 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/highlightjs/highlightjs.d.ts b/highlightjs/highlightjs.d.ts index dc7606d88..5d6f89c71 100644 --- a/highlightjs/highlightjs.d.ts +++ b/highlightjs/highlightjs.d.ts @@ -1,154 +1,159 @@ -// Type definitions for highlight.js v8.2.0 +// Type definitions for highlight.js v9.1.0 // Project: https://github.com/isagalaev/highlight.js // Definitions by: Niklas Mollenhauer , Jeremy Hull // Definitions: https://github.com/borisyankov/DefinitelyTyped -declare module "highlight.js" +declare module 'highlight.js' { + export = hljs; +} + +declare module hljs { - module hljs + export function highlight( + name: string, + value: string, + ignore_illegals?: boolean, + continuation?: boolean) : IHighlightResult; + export function highlightAuto( + value: string, + languageSubset?: string[]) : IAutoHighlightResult; + + export function fixMarkup(value: string) : string; + + export function highlightBlock(block: Node) : void; + + export function configure(options: IOptions): void; + + export function initHighlighting(): void; + export function initHighlightingOnLoad(): void; + + export function registerLanguage( + name: string, + language: (hljs?: HLJSStatic) => IModeBase): void; + export function listLanguages(): string[]; + export function getLanguage(name: string): IMode; + + export function inherit(parent: Object, obj: Object): Object; + + export function COMMENT( + begin: (string|RegExp), + end: (string|RegExp), + inherits: IModeBase): IMode; + + // Common regexps + export var IDENT_RE: string; + export var UNDERSCORE_IDENT_RE: string; + export var NUMBER_RE: string; + export var C_NUMBER_RE: string; + export var BINARY_NUMBER_RE: string; + export var RE_STARTERS_RE: string; + + // Common modes + export var BACKSLASH_ESCAPE : IMode; + export var APOS_STRING_MODE : IMode; + export var QUOTE_STRING_MODE : IMode; + export var PHRASAL_WORDS_MODE : IMode; + export var C_LINE_COMMENT_MODE : IMode; + export var C_BLOCK_COMMENT_MODE : IMode; + export var HASH_COMMENT_MODE : IMode; + export var NUMBER_MODE : IMode; + export var C_NUMBER_MODE : IMode; + export var BINARY_NUMBER_MODE : IMode; + export var CSS_NUMBER_MODE : IMode; + export var REGEX_MODE : IMode; + export var TITLE_MODE : IMode; + export var UNDERSCORE_TITLE_MODE : IMode; + + export interface IHighlightResultBase { - export function highlight( - name: string, - value: string, - ignore_illegals?: boolean, - continuation?: boolean) : IHighlightResult; - export function highlightAuto( - value: string, - languageSubset?: string[]) : IAutoHighlightResult; + relevance: number; + language: string; + value: string; + } - export function fixMarkup(value: string) : string; + export interface IAutoHighlightResult extends IHighlightResultBase + { + second_best?: IAutoHighlightResult; + } - export function highlightBlock(block: Node) : void; + export interface IHighlightResult extends IHighlightResultBase + { + top: ICompiledMode; + } - export function configure(options: IOptions): void; - - export function initHighlighting(): void; - export function initHighlightingOnLoad(): void; - - export function registerLanguage( - name: string, - language: (hljs?: HLJSStatic) => IModeBase): void; - export function listLanguages(): string[]; - export function getLanguage(name: string): IMode; - - export function inherit(parent: Object, obj: Object): Object; + export interface HLJSStatic + { + inherit(parent: Object, obj: Object): Object; // Common regexps - export var IDENT_RE: string; - export var UNDERSCORE_IDENT_RE: string; - export var NUMBER_RE: string; - export var C_NUMBER_RE: string; - export var BINARY_NUMBER_RE: string; - export var RE_STARTERS_RE: string; + IDENT_RE: string; + UNDERSCORE_IDENT_RE: string; + NUMBER_RE: string; + C_NUMBER_RE: string; + BINARY_NUMBER_RE: string; + RE_STARTERS_RE: string; // Common modes - export var BACKSLASH_ESCAPE : IMode; - export var APOS_STRING_MODE : IMode; - export var QUOTE_STRING_MODE : IMode; - export var PHRASAL_WORDS_MODE : IMode; - export var C_LINE_COMMENT_MODE : IMode; - export var C_BLOCK_COMMENT_MODE : IMode; - export var HASH_COMMENT_MODE : IMode; - export var NUMBER_MODE : IMode; - export var C_NUMBER_MODE : IMode; - export var BINARY_NUMBER_MODE : IMode; - export var CSS_NUMBER_MODE : IMode; - export var REGEX_MODE : IMode; - export var TITLE_MODE : IMode; - export var UNDERSCORE_TITLE_MODE : IMode; - - export interface IHighlightResultBase - { - relevance: number; - language: string; - value: string; - } - - export interface IAutoHighlightResult extends IHighlightResultBase - { - second_best?: IAutoHighlightResult; - } - - export interface IHighlightResult extends IHighlightResultBase - { - top: ICompiledMode; - } - - export interface HLJSStatic - { - inherit(parent: Object, obj: Object): Object; - - // Common regexps - IDENT_RE: string; - UNDERSCORE_IDENT_RE: string; - NUMBER_RE: string; - C_NUMBER_RE: string; - BINARY_NUMBER_RE: string; - RE_STARTERS_RE: string; - - // Common modes - BACKSLASH_ESCAPE : IMode; - APOS_STRING_MODE : IMode; - QUOTE_STRING_MODE : IMode; - PHRASAL_WORDS_MODE : IMode; - C_LINE_COMMENT_MODE : IMode; - C_BLOCK_COMMENT_MODE : IMode; - HASH_COMMENT_MODE : IMode; - NUMBER_MODE : IMode; - C_NUMBER_MODE : IMode; - BINARY_NUMBER_MODE : IMode; - CSS_NUMBER_MODE : IMode; - REGEX_MODE : IMode; - TITLE_MODE : IMode; - UNDERSCORE_TITLE_MODE : IMode; - } - - // Reference: - // https://github.com/isagalaev/highlight.js/blob/master/docs/reference.rst - export interface IModeBase - { - className?: string; - aliases?: string[]; - begin?: string; - end?: string; - case_insensitive?: boolean; - beginKeyword?: string; - endsWithParent?: boolean; - lexems?: string; - illegal?: string; - excludeBegin?: boolean; - excludeEnd?: boolean; - returnBegin?: boolean; - returnEnd?: boolean; - starts?: string; - subLanguage?: string; - subLanguageMode?: string; - relevance?: number; - variants?: IMode[]; - } - - export interface IMode extends IModeBase - { - keywords?: any; - contains?: IMode[]; - } - - export interface ICompiledMode extends IModeBase - { - compiled: boolean; - contains?: ICompiledMode[]; - keywords?: Object; - terminators: RegExp; - terminator_end?: string; - } - - export interface IOptions - { - classPrefix?: string; - tabReplace?: string; - useBR?: boolean; - languages?: string[]; - } + BACKSLASH_ESCAPE : IMode; + APOS_STRING_MODE : IMode; + QUOTE_STRING_MODE : IMode; + PHRASAL_WORDS_MODE : IMode; + C_LINE_COMMENT_MODE : IMode; + C_BLOCK_COMMENT_MODE : IMode; + HASH_COMMENT_MODE : IMode; + NUMBER_MODE : IMode; + C_NUMBER_MODE : IMode; + BINARY_NUMBER_MODE : IMode; + CSS_NUMBER_MODE : IMode; + REGEX_MODE : IMode; + TITLE_MODE : IMode; + UNDERSCORE_TITLE_MODE : IMode; + } + + // Reference: + // https://github.com/isagalaev/highlight.js/blob/master/docs/reference.rst + export interface IModeBase + { + className?: string; + aliases?: string[]; + begin?: (string|RegExp); + end?: (string|RegExp); + case_insensitive?: boolean; + beginKeyword?: string; + endsWithParent?: boolean; + lexems?: string; + illegal?: string; + excludeBegin?: boolean; + excludeEnd?: boolean; + returnBegin?: boolean; + returnEnd?: boolean; + starts?: string; + subLanguage?: string; + subLanguageMode?: string; + relevance?: number; + variants?: IMode[]; + } + + export interface IMode extends IModeBase + { + keywords?: any; + contains?: IMode[]; + } + + export interface ICompiledMode extends IModeBase + { + compiled: boolean; + contains?: ICompiledMode[]; + keywords?: Object; + terminators: RegExp; + terminator_end?: string; + } + + export interface IOptions + { + classPrefix?: string; + tabReplace?: string; + useBR?: boolean; + languages?: string[]; } - export = hljs; } diff --git a/hopscotch/hopscotch-tests.ts b/hopscotch/hopscotch-tests.ts new file mode 100644 index 000000000..fb1d1c68a --- /dev/null +++ b/hopscotch/hopscotch-tests.ts @@ -0,0 +1,55 @@ +/// + +var tourDefinition: TourDefinition = { + id: 'intro-tour', + steps: [ + { + target: '.popupTarget', + placement: 'bottom', + title: 'A tour step', + content: 'A tour message' + }, + { + target: [".aSelector"], + placement: 'bottom', + + yOffset: 10, + width: 400, + xOffset: -420, + arrowOffset: 380 + }, + { + target: '.domainPatterns form', + placement: 'right', + title: 'A question?', + content: "Hello!", + onShow: function () { } + }, + { + target: '.home-button', + placement: 'left', + title: "Let's get started", + content: "Content", + + multipage: true, + nextOnTargetClick: true, + showNextButton: false + }, + { + target: '.buttons', + placement: 'top', + + title: 'Another title', + content: "A message", + + showNextButton: false, + nextOnTargetClick: true, + onShow: function () { } + } + ], + skipIfNoElement: false, + onClose: function () { }, + onEnd: function () { } +}; + +hopscotch.startTour(tourDefinition); diff --git a/hopscotch/hopscotch.d.ts b/hopscotch/hopscotch.d.ts new file mode 100644 index 000000000..46fdf17c6 --- /dev/null +++ b/hopscotch/hopscotch.d.ts @@ -0,0 +1,165 @@ +// Type definitions for Hopscotch v0.2.5 +// Project: http://linkedin.github.io/hopscotch/ +// Definitions by: Tim Perry +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare type CallbackNameNamesOrDefinition = string | string[] | (() => void); + +interface HopscotchConfiguration { + bubbleWidth?: number; + buddleHeight?: number; + + smoothScroll?: boolean; + scrollDuration?: number; + scrollTopMargin?: number; + + showCloseButton?: boolean; + showNextButton?: boolean; + showPrevButton?: boolean; + + arrowWidth?: number; + skipIfNoElement?: boolean; + nextOnTargetClick?: boolean; + + onNext?: CallbackNameNamesOrDefinition; + onPrev?: CallbackNameNamesOrDefinition; + onStart?: CallbackNameNamesOrDefinition; + onEnd?: CallbackNameNamesOrDefinition; + onClose?: CallbackNameNamesOrDefinition; + onError?: CallbackNameNamesOrDefinition; + + i18n?: { + nextBtn?: string; + prevBtn?: string; + doneBtn?: string; + skipBtn?: string; + closeTooltip?: string; + stepNums?: string[]; + } +} + +interface TourDefinition extends HopscotchConfiguration { + id: string; + steps: StepDefinition[]; +} + +interface StepDefinition { + placement: string; + target: string | HTMLElement | Array + + title?: string; + content?: string; + + width?: number; + padding?: number; + + xOffset?: number; + yOffset?: number; + arrowOffset?: number; + + delay?: number; + zIndex?: number; + + showNextButton?: boolean; + showPrevButton?: boolean; + showCTAButton?: boolean; + + ctaLabel?: string; + multipage?: boolean; + showSkip?: boolean; + fixedElement?: boolean; + nextOnTargetClick?: boolean; + + onPrev?: CallbackNameNamesOrDefinition; + onNext?: CallbackNameNamesOrDefinition; + onShow?: CallbackNameNamesOrDefinition; + onCTA?: CallbackNameNamesOrDefinition; +} + +interface HopscotchStatic { + /** + * Actually starts the tour. Optional stepNum argument specifies what step to start at. + */ + startTour(tour: TourDefinition, stepNum?: number): void; + + /** + * Skips to a given step in the tour + */ + showStep(id: number): void; + + /** + * Goes back one step in the tour + */ + prevStep(): void; + + /** + * Goes forward one step in the tour + */ + nextStep(): void; + + /** + * Ends the current tour. If clearCookie is set to false, the tour state is preserved. + * Otherwise, if clearCookie is set to true or is not provided, the tour state is cleared. + */ + endTour(clearCookie: boolean): void; + + /** + * Sets options for running the tour. + */ + configure(options: HopscotchConfiguration): void; + + /** + * Returns the currently running tour. + */ + getCurrTour(): TourDefinition; + + /** + * Returns the currently running tour. + */ + getCurrStepNum(): number; + + /** + * Checks for tour state saved in sessionStorage/cookies and returns the state if + * it exists. Use this method to determine whether or not you should resume a tour. + */ + getState(): string; + + /** + * Adds a callback for one of the event types. Valid event types are: + * *start*, *end*, *next*, *prev*, *show*, *close*, *error* + */ + listen(eventName: string, callback: () => void): void; + + /** + * Removes a callback for one of the event types. + */ + unlisten(eventName: string, callback: () => void): void; + + /** + * Remove callbacks for hopscotch events. If tourOnly is set to true, only removes + * callbacks specified by a tour (callbacks set by hopscotch.configure or hopscotch.listen + * will remain). If eventName is null or undefined, callbacks for all events will be removed. + */ + removeCallbacks(eventName?: string, tourOnly?: boolean): void; + + /** + * Registers a callback helper. See the section about Helpers below. + */ + registerHelper(id: string, helper: (...args: any[]) => void): void; + + /** + * Resets i18n strings to original default values. + */ + resetDefaultI18N(): void; + + /** + * Resets all config options to original values. + */ + resetDefaultOptions(): void; +} + +declare var hopscotch: HopscotchStatic; + +declare module "hopscotch" { + export = hopscotch; +} diff --git a/html-minifier/html-minifier-tests.ts b/html-minifier/html-minifier-tests.ts new file mode 100644 index 000000000..b02ecea19 --- /dev/null +++ b/html-minifier/html-minifier-tests.ts @@ -0,0 +1,9 @@ +/// + +import * as HTMLMinifier from 'html-minifier'; +const minify = HTMLMinifier.minify; + +var result = minify('

foo

', { + removeAttributeQuotes: true +}); +result; // '

foo

' diff --git a/html-minifier/html-minifier.d.ts b/html-minifier/html-minifier.d.ts new file mode 100644 index 000000000..9557de890 --- /dev/null +++ b/html-minifier/html-minifier.d.ts @@ -0,0 +1,115 @@ +// Type definitions for HTMLMinifier v1.1.1 +// Project: https://github.com/kangax/html-minifier +// Definitions by: Tanguy Krotoff +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// +/// + +declare module 'html-minifier' { + import * as UglifyJS from 'uglify-js'; + import * as CleanCSS from 'clean-css'; + import * as RelateUrl from 'relateurl'; + + namespace HTMLMinifier { + function minify(text: string, options?: Options): string; + + interface Options { + // Strip HTML comments + removeComments?: boolean; + + // Strip HTML comments from scripts and styles + removeCommentsFromCDATA?: boolean; + + // Remove CDATA sections from script and style elements + removeCDATASectionsFromCDATA?: boolean; + + // Collapse white space that contributes to text nodes in a document tree + collapseWhitespace?: boolean; + + // Always collapse to 1 space (never remove it entirely). Must be used in conjunction with collapseWhitespace=true + conservativeCollapse?: boolean; + + // Don't leave any spaces between display:inline; elements when collapsing. Must be used in conjunction with collapseWhitespace=true + collapseInlineTagWhitespace?: boolean; + + // Always collapse to 1 line break (never remove it entirely) when whitespace between tags include a line break. Must be used in conjunction with collapseWhitespace=true + preserveLineBreaks?: boolean; + + // Omit attribute values from boolean attributes + collapseBooleanAttributes?: boolean; + + // Remove quotes around attributes when possible + removeAttributeQuotes?: boolean; + + // Remove attributes when value matches default + removeRedundantAttributes?: boolean; + + // Prevents the escaping of the values of attributes. + preventAttributesEscaping?: boolean; + + // Replaces the doctype with the short (HTML5) doctype + useShortDoctype?: boolean; + + // Remove all attributes with whitespace-only values + removeEmptyAttributes?: boolean; + + // Remove type="text/javascript" from script tags. Other type attribute values are left intact. + removeScriptTypeAttributes?: boolean; + + // Remove type="text/css" from style and link tags. Other type attribute values are left intact. + removeStyleLinkTypeAttributes?: boolean; + + // Remove unrequired tags + removeOptionalTags?: boolean; + + // Remove all elements with empty contents + removeEmptyElements?: boolean; + + // Toggle linting + lint?: boolean; + + // Keep the trailing slash on singleton elements + keepClosingSlash?: boolean; + + // Treat attributes in case sensitive manner (useful for custom HTML tags.) + caseSensitive?: boolean; + + // Minify Javascript in script elements and on* attributes (uses UglifyJS) + minifyJS?: boolean | UglifyJS.MinifyOptions; + + // Minify CSS in style elements and style attributes (uses clean-css) + minifyCSS?: boolean | CleanCSS.Options; + + // Minify URLs in various attributes (uses relateurl) + minifyURLs?: boolean | RelateUrl.Options; + + // Array of regex'es that allow to ignore certain comments, when matched + ignoreCustomComments?: Array; + + // Array of regex'es that allow to ignore certain fragments, when matched (e.g. , {{ ... }}, etc.) + ignoreCustomFragments?: Array; + + // Array of strings corresponding to types of script elements to process through minifier (e.g. text/ng-template, text/x-handlebars-template, etc.) + processScripts?: Array; + + // Specify a maximum line length. Compressed output will be split by newlines at valid HTML split-points + maxLineLength?: number; + + // Arrays of regex'es that allow to support custom attribute assign expressions (e.g. '
') + customAttrAssign?: Array; + + // Arrays of regex'es that allow to support custom attribute surround expressions (e.g. ) + customAttrSurround?: Array; + + // Regex that specifies custom attribute to strip newlines from (e.g. /ng\-class/) + customAttrCollapse?: RegExp; + + // Type of quote to use for attribute values (' or ") + quoteCharacter?: string; + } + } + + export = HTMLMinifier; +} 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/html2canvas/html2canvas.d.ts b/html2canvas/html2canvas.d.ts index 689421971..38f6fa358 100644 --- a/html2canvas/html2canvas.d.ts +++ b/html2canvas/html2canvas.d.ts @@ -37,6 +37,8 @@ declare module Html2Canvas { /** Whether to attempt to load cross-origin images as CORS served, before reverting back to proxy. */ useCORS?: boolean; + /** Callback providing the rendered canvas element after rendering */ + onrendered?(canvas: HTMLCanvasElement): void; } } diff --git a/http-errors/http-errors-tests.ts b/http-errors/http-errors-tests.ts index 06b91f13b..440325900 100644 --- a/http-errors/http-errors-tests.ts +++ b/http-errors/http-errors-tests.ts @@ -1,8 +1,8 @@ /// /// -import createError = require('http-errors'); -import express = require('express'); +import * as createError from 'http-errors'; +import * as express from 'express'; var app = express(); @@ -67,3 +67,5 @@ var err = new createError['404'](); //createError['404'](); // TypeScript should fail with "Did you mean to include 'new'?" //new createError(); // TypeScript should fail with "Only a void function can be called with the 'new' keyword" + +let error: createError.HttpError; diff --git a/http-errors/http-errors.d.ts b/http-errors/http-errors.d.ts index 6f78ff6a7..e15a7cb4e 100644 --- a/http-errors/http-errors.d.ts +++ b/http-errors/http-errors.d.ts @@ -4,82 +4,86 @@ // Definitions: https://github.com/borisyankov/DefinitelyTyped declare module 'http-errors' { - interface HttpError extends Error { - status: number; - statusCode: number; - expose: boolean; + namespace createHttpError { + + // See https://github.com/jshttp/http-errors/blob/1.3.1/index.js#L42 + interface HttpError extends Error { + status: number; + statusCode: number; + expose: boolean; + } + + interface CreateHttpError { + // See https://github.com/Microsoft/TypeScript/issues/227#issuecomment-50092674 + [code: string]: new() => HttpError; + + (...args: Array): HttpError; + + Continue: new() => HttpError; + SwitchingProtocols: new() => HttpError; + Processing: new() => HttpError; + OK: new() => HttpError; + Created: new() => HttpError; + Accepted: new() => HttpError; + NonAuthoritativeInformation: new() => HttpError; + NoContent: new() => HttpError; + ResetContent: new() => HttpError; + PartialContent: new() => HttpError; + MultiStatus: new() => HttpError; + AlreadyReported: new() => HttpError; + IMUsed: new() => HttpError; + MultipleChoices: new() => HttpError; + MovedPermanently: new() => HttpError; + Found: new() => HttpError; + SeeOther: new() => HttpError; + NotModified: new() => HttpError; + UseProxy: new() => HttpError; + Unused: new() => HttpError; + TemporaryRedirect: new() => HttpError; + PermanentRedirect: new() => HttpError; + BadRequest: new() => HttpError; + Unauthorized: new() => HttpError; + PaymentRequired: new() => HttpError; + Forbidden: new() => HttpError; + NotFound: new() => HttpError; + MethodNotAllowed: new() => HttpError; + NotAcceptable: new() => HttpError; + ProxyAuthenticationRequired: new() => HttpError; + RequestTimeout: new() => HttpError; + Conflict: new() => HttpError; + Gone: new() => HttpError; + LengthRequired: new() => HttpError; + PreconditionFailed: new() => HttpError; + PayloadTooLarge: new() => HttpError; + URITooLong: new() => HttpError; + UnsupportedMediaType: new() => HttpError; + RangeNotSatisfiable: new() => HttpError; + ExpectationFailed: new() => HttpError; + ImATeapot: new() => HttpError; + UnprocessableEntity: new() => HttpError; + Locked: new() => HttpError; + FailedDependency: new() => HttpError; + UnorderedCollection: new() => HttpError; + UpgradeRequired: new() => HttpError; + PreconditionRequired: new() => HttpError; + TooManyRequests: new() => HttpError; + RequestHeaderFieldsTooLarge: new() => HttpError; + UnavailableForLegalReasons: new() => HttpError; + InternalServerError: new() => HttpError; + NotImplemented: new() => HttpError; + BadGateway: new() => HttpError; + ServiceUnavailable: new() => HttpError; + GatewayTimeout: new() => HttpError; + HTTPVersionNotSupported: new() => HttpError; + VariantAlsoNegotiates: new() => HttpError; + InsufficientStorage: new() => HttpError; + LoopDetected: new() => HttpError; + BandwidthLimitExceeded: new() => HttpError; + NotExtended: new() => HttpError; + NetworkAuthenticationRequired: new() => HttpError; + } } - interface CreateHttpError { - // See https://github.com/Microsoft/TypeScript/issues/227#issuecomment-50092674 - [code: string]: new() => HttpError; - - (...args: Array): HttpError; - - Continue: new() => HttpError; - SwitchingProtocols: new() => HttpError; - Processing: new() => HttpError; - OK: new() => HttpError; - Created: new() => HttpError; - Accepted: new() => HttpError; - NonAuthoritativeInformation: new() => HttpError; - NoContent: new() => HttpError; - ResetContent: new() => HttpError; - PartialContent: new() => HttpError; - MultiStatus: new() => HttpError; - AlreadyReported: new() => HttpError; - IMUsed: new() => HttpError; - MultipleChoices: new() => HttpError; - MovedPermanently: new() => HttpError; - Found: new() => HttpError; - SeeOther: new() => HttpError; - NotModified: new() => HttpError; - UseProxy: new() => HttpError; - Unused: new() => HttpError; - TemporaryRedirect: new() => HttpError; - PermanentRedirect: new() => HttpError; - BadRequest: new() => HttpError; - Unauthorized: new() => HttpError; - PaymentRequired: new() => HttpError; - Forbidden: new() => HttpError; - NotFound: new() => HttpError; - MethodNotAllowed: new() => HttpError; - NotAcceptable: new() => HttpError; - ProxyAuthenticationRequired: new() => HttpError; - RequestTimeout: new() => HttpError; - Conflict: new() => HttpError; - Gone: new() => HttpError; - LengthRequired: new() => HttpError; - PreconditionFailed: new() => HttpError; - PayloadTooLarge: new() => HttpError; - URITooLong: new() => HttpError; - UnsupportedMediaType: new() => HttpError; - RangeNotSatisfiable: new() => HttpError; - ExpectationFailed: new() => HttpError; - ImATeapot: new() => HttpError; - UnprocessableEntity: new() => HttpError; - Locked: new() => HttpError; - FailedDependency: new() => HttpError; - UnorderedCollection: new() => HttpError; - UpgradeRequired: new() => HttpError; - PreconditionRequired: new() => HttpError; - TooManyRequests: new() => HttpError; - RequestHeaderFieldsTooLarge: new() => HttpError; - UnavailableForLegalReasons: new() => HttpError; - InternalServerError: new() => HttpError; - NotImplemented: new() => HttpError; - BadGateway: new() => HttpError; - ServiceUnavailable: new() => HttpError; - GatewayTimeout: new() => HttpError; - HTTPVersionNotSupported: new() => HttpError; - VariantAlsoNegotiates: new() => HttpError; - InsufficientStorage: new() => HttpError; - LoopDetected: new() => HttpError; - BandwidthLimitExceeded: new() => HttpError; - NotExtended: new() => HttpError; - NetworkAuthenticationRequired: new() => HttpError; - } - - var httpError: CreateHttpError; - export = httpError; + var createHttpError: createHttpError.CreateHttpError; + export = createHttpError; } diff --git a/http-status-codes/http-status-codes-tests.ts b/http-status-codes/http-status-codes-tests.ts new file mode 100644 index 000000000..02c2a104b --- /dev/null +++ b/http-status-codes/http-status-codes-tests.ts @@ -0,0 +1,109 @@ +/// + +import HttpStatusCodes = require("http-status-codes"); + +var ACCEPTED = HttpStatusCodes.ACCEPTED; +var BAD_GATEWAY = HttpStatusCodes.BAD_GATEWAY; +var BAD_REQUEST = HttpStatusCodes.BAD_REQUEST; +var CONFLICT = HttpStatusCodes.CONFLICT; +var CONTINUE = HttpStatusCodes.CONTINUE; +var CREATED = HttpStatusCodes.CREATED; +var EXPECTATION_FAILED = HttpStatusCodes.EXPECTATION_FAILED; +var FAILED_DEPENDENCY = HttpStatusCodes.FAILED_DEPENDENCY ; +var FORBIDDEN = HttpStatusCodes.FORBIDDEN; +var GATEWAY_TIMEOUT = HttpStatusCodes.GATEWAY_TIMEOUT; +var GONE = HttpStatusCodes.GONE; +var HTTP_VERSION_NOT_SUPPORTED = HttpStatusCodes.HTTP_VERSION_NOT_SUPPORTED; +var INSUFFICIENT_SPACE_ON_RESOURCE = HttpStatusCodes.INSUFFICIENT_SPACE_ON_RESOURCE; +var INSUFFICIENT_STORAGE = HttpStatusCodes.INSUFFICIENT_STORAGE; +var INTERNAL_SERVER_ERROR = HttpStatusCodes.INTERNAL_SERVER_ERROR; +var LENGTH_REQUIRED = HttpStatusCodes.LENGTH_REQUIRED; +var LOCKED = HttpStatusCodes.LOCKED; +var METHOD_FAILURE = HttpStatusCodes.METHOD_FAILURE; +var METHOD_NOT_ALLOWED = HttpStatusCodes.METHOD_NOT_ALLOWED; +var MOVED_PERMANENTLY = HttpStatusCodes.MOVED_PERMANENTLY; +var MOVED_TEMPORARILY = HttpStatusCodes.MOVED_TEMPORARILY; +var MULTI_STATUS = HttpStatusCodes.MULTI_STATUS; +var MULTIPLE_CHOICES = HttpStatusCodes.MULTIPLE_CHOICES; +var NETWORK_AUTHENTICATION_REQUIRED = HttpStatusCodes.NETWORK_AUTHENTICATION_REQUIRED; +var NO_CONTENT = HttpStatusCodes.NO_CONTENT; +var NON_AUTHORITATIVE_INFORMATION = HttpStatusCodes.NON_AUTHORITATIVE_INFORMATION; +var NOT_ACCEPTABLE = HttpStatusCodes.NOT_ACCEPTABLE; +var NOT_FOUND = HttpStatusCodes.NOT_FOUND; +var NOT_IMPLEMENTED = HttpStatusCodes.NOT_IMPLEMENTED; +var NOT_MODIFIED = HttpStatusCodes.NOT_MODIFIED; +var OK = HttpStatusCodes.OK; +var PARTIAL_CONTENT = HttpStatusCodes.PARTIAL_CONTENT; +var PAYMENT_REQUIRED = HttpStatusCodes.PAYMENT_REQUIRED; +var PRECONDITION_FAILED = HttpStatusCodes.PRECONDITION_FAILED; +var PRECONDITION_REQUIRED = HttpStatusCodes.PRECONDITION_REQUIRED; +var PROCESSING = HttpStatusCodes.PROCESSING; +var PROXY_AUTHENTICATION_REQUIRED = HttpStatusCodes.PROXY_AUTHENTICATION_REQUIRED; +var REQUEST_HEADER_FIELDS_TOO_LARGE = HttpStatusCodes.REQUEST_HEADER_FIELDS_TOO_LARGE; +var REQUEST_TIMEOUT = HttpStatusCodes.REQUEST_TIMEOUT; +var REQUEST_TOO_LONG = HttpStatusCodes.REQUEST_TOO_LONG; +var REQUEST_URI_TOO_LONG = HttpStatusCodes.REQUEST_URI_TOO_LONG; +var REQUESTED_RANGE_NOT_SATISFIABLE = HttpStatusCodes.REQUESTED_RANGE_NOT_SATISFIABLE; +var RESET_CONTENT = HttpStatusCodes.RESET_CONTENT; +var SEE_OTHER = HttpStatusCodes.SEE_OTHER; +var SERVICE_UNAVAILABLE = HttpStatusCodes.SERVICE_UNAVAILABLE; +var SWITCHING_PROTOCOLS = HttpStatusCodes.SWITCHING_PROTOCOLS; +var TEMPORARY_REDIRECT = HttpStatusCodes.TEMPORARY_REDIRECT; +var TOO_MANY_REQUESTS = HttpStatusCodes.TOO_MANY_REQUESTS; +var UNAUTHORIZED = HttpStatusCodes.UNAUTHORIZED; +var UNPROCESSABLE_ENTITY = HttpStatusCodes.UNPROCESSABLE_ENTITY; +var UNSUPPORTED_MEDIA_TYPE = HttpStatusCodes.UNSUPPORTED_MEDIA_TYPE; +var USE_PROXY = HttpStatusCodes.USE_PROXY; + +var ACCEPTED_Text = HttpStatusCodes.getStatusText(202); +var BAD_GATEWAY_Text = HttpStatusCodes.getStatusText(502); +var BAD_REQUEST_Text = HttpStatusCodes.getStatusText(400); +var CONFLICT_Text = HttpStatusCodes.getStatusText(409); +var CONTINUE_Text = HttpStatusCodes.getStatusText(100); +var CREATED_Text = HttpStatusCodes.getStatusText(201); +var EXPECTATION_FAILED_Text = HttpStatusCodes.getStatusText(417); +var FAILED_DEPENDENCY_Text = HttpStatusCodes.getStatusText(424); +var FORBIDDEN_Text = HttpStatusCodes.getStatusText(403); +var GATEWAY_TIMEOUT_Text = HttpStatusCodes.getStatusText(504); +var GONE_Text = HttpStatusCodes.getStatusText(410); +var HTTP_VERSION_NOT_SUPPORTED_Text = HttpStatusCodes.getStatusText(505); +var INSUFFICIENT_SPACE_ON_RESOURCE_Text = HttpStatusCodes.getStatusText(419); +var INSUFFICIENT_STORAGE_Text = HttpStatusCodes.getStatusText(507); +var INTERNAL_SERVER_ERROR_Text = HttpStatusCodes.getStatusText(500); +var LENGTH_REQUIRED_Text = HttpStatusCodes.getStatusText(411); +var LOCKED_Text = HttpStatusCodes.getStatusText(423); +var METHOD_FAILURE_Text = HttpStatusCodes.getStatusText(420); +var METHOD_NOT_ALLOWED_Text = HttpStatusCodes.getStatusText(405); +var MOVED_PERMANENTLY_Text = HttpStatusCodes.getStatusText(301); +var MOVED_TEMPORARILY_Text = HttpStatusCodes.getStatusText(302); +var MULTI_STATUS_Text = HttpStatusCodes.getStatusText(207); +var MULTIPLE_CHOICES_Text = HttpStatusCodes.getStatusText(300); +var NETWORK_AUTHENTICATION_REQUIRED_Text = HttpStatusCodes.getStatusText(511); +var NO_CONTENT_Text = HttpStatusCodes.getStatusText(204); +var NON_AUTHORITATIVE_INFORMATION_Text = HttpStatusCodes.getStatusText(203); +var NOT_ACCEPTABLE_Text = HttpStatusCodes.getStatusText(406); +var NOT_FOUND_Text = HttpStatusCodes.getStatusText(404); +var NOT_IMPLEMENTED_Text = HttpStatusCodes.getStatusText(501); +var NOT_MODIFIED_Text = HttpStatusCodes.getStatusText(304); +var OK_Text = HttpStatusCodes.getStatusText(200); +var PARTIAL_CONTENT_Text = HttpStatusCodes.getStatusText(206); +var PAYMENT_REQUIRED_Text = HttpStatusCodes.getStatusText(402); +var PRECONDITION_FAILED_Text = HttpStatusCodes.getStatusText(412); +var PRECONDITION_REQUIRED_Text = HttpStatusCodes.getStatusText(428); +var PROCESSING_Text = HttpStatusCodes.getStatusText(102); +var PROXY_AUTHENTICATION_REQUIRED_Text = HttpStatusCodes.getStatusText(407); +var REQUEST_HEADER_FIELDS_TOO_LARGE_Text = HttpStatusCodes.getStatusText(431); +var REQUEST_TIMEOUT_Text = HttpStatusCodes.getStatusText(408); +var REQUEST_TOO_LONG_Text = HttpStatusCodes.getStatusText(413); +var REQUEST_URI_TOO_LONG_Text = HttpStatusCodes.getStatusText(414); +var REQUESTED_RANGE_NOT_SATISFIABLE_Text = HttpStatusCodes.getStatusText(416); +var RESET_CONTENT_Text = HttpStatusCodes.getStatusText(205); +var SEE_OTHER_Text = HttpStatusCodes.getStatusText(303); +var SERVICE_UNAVAILABLE_Text = HttpStatusCodes.getStatusText(503); +var SWITCHING_PROTOCOLS_Text = HttpStatusCodes.getStatusText(101); +var TEMPORARY_REDIRECT_Text = HttpStatusCodes.getStatusText(307); +var TOO_MANY_REQUESTS_Text = HttpStatusCodes.getStatusText(429); +var UNAUTHORIZED_Text = HttpStatusCodes.getStatusText(401); +var UNPROCESSABLE_ENTITY_Text = HttpStatusCodes.getStatusText(422); +var UNSUPPORTED_MEDIA_TYPE_Text = HttpStatusCodes.getStatusText(415); +var USE_PROXY_Text = HttpStatusCodes.getStatusText(305); \ No newline at end of file diff --git a/http-status-codes/http-status-codes.d.ts b/http-status-codes/http-status-codes.d.ts new file mode 100644 index 000000000..ebea4d75b --- /dev/null +++ b/http-status-codes/http-status-codes.d.ts @@ -0,0 +1,61 @@ +// Type definitions for Node.JS package http-status-codes v1.0.5 +// Project: https://github.com/prettymuchbryce/node-http-status +// Definitions by: Josh McCullough +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module "http-status-codes" { + export var ACCEPTED: number; + export var BAD_GATEWAY: number; + export var BAD_REQUEST: number; + export var CONFLICT: number; + export var CONTINUE: number; + export var CREATED: number; + export var EXPECTATION_FAILED: number; + export var FAILED_DEPENDENCY: number; + export var FORBIDDEN: number; + export var GATEWAY_TIMEOUT: number; + export var GONE: number; + export var HTTP_VERSION_NOT_SUPPORTED: number; + export var INSUFFICIENT_SPACE_ON_RESOURCE: number; + export var INSUFFICIENT_STORAGE: number; + export var INTERNAL_SERVER_ERROR: number; + export var LENGTH_REQUIRED: number; + export var LOCKED: number; + export var METHOD_FAILURE: number; + export var METHOD_NOT_ALLOWED: number; + export var MOVED_PERMANENTLY: number; + export var MOVED_TEMPORARILY: number; + export var MULTI_STATUS: number; + export var MULTIPLE_CHOICES: number; + export var NETWORK_AUTHENTICATION_REQUIRED: number; + export var NO_CONTENT: number; + export var NON_AUTHORITATIVE_INFORMATION: number; + export var NOT_ACCEPTABLE: number; + export var NOT_FOUND: number; + export var NOT_IMPLEMENTED: number; + export var NOT_MODIFIED: number; + export var OK: number; + export var PARTIAL_CONTENT: number; + export var PAYMENT_REQUIRED: number; + export var PRECONDITION_FAILED: number; + export var PRECONDITION_REQUIRED: number; + export var PROCESSING: number; + export var PROXY_AUTHENTICATION_REQUIRED: number; + export var REQUEST_HEADER_FIELDS_TOO_LARGE: number; + export var REQUEST_TIMEOUT: number; + export var REQUEST_TOO_LONG: number; + export var REQUEST_URI_TOO_LONG: number; + export var REQUESTED_RANGE_NOT_SATISFIABLE: number; + export var RESET_CONTENT: number; + export var SEE_OTHER: number; + export var SERVICE_UNAVAILABLE: number; + export var SWITCHING_PROTOCOLS: number; + export var TEMPORARY_REDIRECT: number; + export var TOO_MANY_REQUESTS: number; + export var UNAUTHORIZED: number; + export var UNPROCESSABLE_ENTITY: number; + export var UNSUPPORTED_MEDIA_TYPE: number; + export var USE_PROXY: number; + + export function getStatusText(statusCode: number): string; +} \ No newline at end of file diff --git a/i18next-express-middleware/i18next-express-middleware-tests.ts b/i18next-express-middleware/i18next-express-middleware-tests.ts new file mode 100644 index 000000000..a696f4f8a --- /dev/null +++ b/i18next-express-middleware/i18next-express-middleware-tests.ts @@ -0,0 +1,48 @@ +/// +/// + +import * as express from "express"; +import * as i18next from "i18next"; +import middleware = require("i18next-express-middleware"); + +function requestObjectTest() { + var i18nextOptions = {}; + i18next + .use(middleware.LanguageDetector) + .init(i18nextOptions); + + var app = express(); + app.use(middleware.handle(i18next, { + ignoreRoutes: ["/foo"], + removeLngFromUrl: false + })); +} + +function detectorOptionsTest() { + var options = { + // order and from where user language should be detected + order: [/*'path', 'session', */ 'querystring', 'cookie', 'header'], + + // keys or params to lookup language from + lookupQuerystring: 'lng', + lookupCookie: 'i18next', + lookupSession: 'lng', + lookupFromPathIndex: 0, + + // cache user language + caches: false, // ['cookie'] + + // optional expire and domain for set cookie + cookieExpirationDate: new Date(), + cookieDomain: 'myDomain' + }; + + i18next + .use(middleware.LanguageDetector) + .init({ + detection: options + }); + + var lngDetector = new middleware.LanguageDetector(null, options); + lngDetector.init(options); +} diff --git a/i18next-express-middleware/i18next-express-middleware.d.ts b/i18next-express-middleware/i18next-express-middleware.d.ts new file mode 100644 index 000000000..fe51928bf --- /dev/null +++ b/i18next-express-middleware/i18next-express-middleware.d.ts @@ -0,0 +1,96 @@ +// Type definitions for i18next-express-middleware +// Project: http://i18next.com/ +// Definitions by: Cyril Schumacher +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +/** + * @summary Interface for Language detector options. + * @interface + */ +interface LanguageDetectorOptions { + caches?: boolean; + cookieDomain?: string; + cookieExpirationDate?: Date; + lookupCookie?: string; + lookupFromPathIndex?: number; + lookupQuerystring?: string; + lookupSession?: string; + order?: Array; +} + +declare module "i18next-express-middleware" { + import express = require("express"); + import i18next = require("i18next"); + + /** + * @summary Interface for middleware to use i18next in express.js. + * @interface + */ + export interface i18nextExpressMiddleware { + LanguageDetector(): express.Handler; + missingKeyHandler(): express.Handler; + } + + /** + * @summary Interface for own detection functionality. + */ + export interface i18nextCustomDetection { + name: string; + lookup: (req: express.Request, res: express.Response, options?: Object) => void; + cacheUserLanguage: (req: express.Request, res: express.Response, lng?: any, options?: Object) => void; + } + + /** + * @summary Detects user language from current request. + * @class + */ + export class LanguageDetector { + /** + * @summary Constructor. + * @constructor + * @param {any} services The services. + * @param {Object} options The options. + * @param {Object} allOptions The all options. + */ + constructor(services?: any, options?: Object, allOptions?: Object); + + /** + * @summary Adds detector. + * @param {i18nextCustomDetection} detector The detector to add. + */ + addDetector(detector: i18nextCustomDetection): void; + + // NOTE: add documentation + cacheUserLanguage(req: express.Request, res: express.Response, detectionOrder: any): void; + + /** + * @summary Detects the language. + * @param {Request} req The HTTP request. + * @param {Response} res The HTTP response. + * @param {detectionOrder} detectionOrder The detection order. + */ + detect(req: express.Request, res: express.Response, detectionOrder: any): void; + + /** + * @summary Initializes class. + * @param {any} services The services. + * @param {Object} options The options. + * @param {Object} allOptions The all options. + */ + init(services: any, options?: Object, allOptions?: Object): void; + } + + export function getResourcesHandler(i18next: I18nextStatic, options: Object): express.Handler; + export function handle(i18next: I18nextStatic, options?: Object): express.Handler; + + /** + * @summary Gets handler for missing key. + * @param {I18nextStatic} i18next The i18next. + * @param {Object} options The options. + * @return {express.Handler} The express handler. + */ + export function missingKeyHandler(i18next: I18nextStatic, options: Object): express.Handler; +} diff --git a/i18next-sprintf-postprocessor/i18next-sprintf-postprocessor-tests.ts b/i18next-sprintf-postprocessor/i18next-sprintf-postprocessor-tests.ts new file mode 100644 index 000000000..b2bdf3b8d --- /dev/null +++ b/i18next-sprintf-postprocessor/i18next-sprintf-postprocessor-tests.ts @@ -0,0 +1,10 @@ +/// + +import * as i18next from "i18next"; +import sprintf from "i18next-sprintf-postprocessor"; + +function initTest() { + const i18nextOptions = {}; + i18next.use(sprintf).init(i18nextOptions); + i18next.init({ overloadTranslationOptionHandler: sprintf.overloadTranslationOptionHandler }); +} diff --git a/i18next-sprintf-postprocessor/i18next-sprintf-postprocessor.d.ts b/i18next-sprintf-postprocessor/i18next-sprintf-postprocessor.d.ts new file mode 100644 index 000000000..7983e46aa --- /dev/null +++ b/i18next-sprintf-postprocessor/i18next-sprintf-postprocessor.d.ts @@ -0,0 +1,20 @@ +// Type definitions for i18next-sprintf-postProcessor +// Project: https://github.com/i18next/i18next-sprintf-postProcessor +// Definitions by: Cyril Schumacher +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare module "i18next-sprintf-postprocessor" { + import i18next = require("i18next"); + + interface i18nextSprintfPostProcessor { + (): any; + process(value: any, key: string, options: Object): void; + overloadTranslationOptionHandler(args: Array): void; + } + + var sprintf: i18nextSprintfPostProcessor; + export default sprintf; +} diff --git a/i18next/i18next.d.ts b/i18next/i18next.d.ts index 38d91b603..c9a215953 100644 --- a/i18next/i18next.d.ts +++ b/i18next/i18next.d.ts @@ -1,11 +1,14 @@ -// Type definitions for i18next v1.5.10 +// Type definitions for i18next v2.0.17 // Project: http://i18next.com // Definitions by: Maarten Docter // Definitions: https://github.com/borisyankov/DefinitelyTyped // Sources: https://github.com/jamuhl/i18next/ +/// /// +/// +/// interface IResourceStore { [language: string]: IResourceStoreLanguage; @@ -27,7 +30,12 @@ interface I18nTranslateOptions extends I18nextOptions { context?: any; } -interface I18nextOptions { +interface i18nextSprintfPostProcessorStatic { + overloadTranslationOptionHandler?(args: Array): void; + process?(value: any, key: string, options: Object): void; +} + +interface I18nextOptions extends i18nextSprintfPostProcessorStatic { lng?: string; // Default value: undefined load?: string; // Default value: 'all' preload?: string[]; // Default value: [] @@ -99,7 +107,7 @@ interface I18nextStatic { regexEscape(str: string): string; }; init(callback?: (err: any, t: (key: string, options?: any) => string) => void ): JQueryDeferred; - init(options?: I18nextOptions, callback?: (err: any, t: (key: string, options?: any) => string) => void ): JQueryDeferred; + init(options?: I18nextOptions|any, callback?: (err: any, t: (key: string, options?: any) => string) => void ): JQueryDeferred; // NOTE: remove any for 'options' parameter. lng(): string; loadNamespace(namespace: string, callback?: () => void ): void; loadNamespaces(namespaces: string[], callback?: () => void ): void; @@ -124,6 +132,7 @@ interface I18nextStatic { t(key: string, options?: I18nTranslateOptions): string; translate(key: string, options?: I18nTranslateOptions): string; exists(key: string, options?: any): boolean; + use(module: any): I18nextStatic; } // jQuery extensions diff --git a/iban/iban.d.ts b/iban/iban.d.ts index 6a7bd803d..14c6ae764 100644 --- a/iban/iban.d.ts +++ b/iban/iban.d.ts @@ -55,4 +55,8 @@ interface IBANStatic { toBBAN(iban: string, separator: string[]): string; } -declare var IBAN: IBANStatic; \ No newline at end of file +declare var IBAN: IBANStatic; + +declare module 'iban' { + export = IBAN; +} diff --git a/ibm-mobilefirst/ibm-mobilefirst-tests.ts b/ibm-mobilefirst/ibm-mobilefirst-tests.ts new file mode 100644 index 000000000..c45b630d7 --- /dev/null +++ b/ibm-mobilefirst/ibm-mobilefirst-tests.ts @@ -0,0 +1,169 @@ +/// +/// +// Tests + +// Test WL.Client +WL.Client.connect({ + onSuccess: function (response: WL.ResponseBase) { + var title: string = response.responseJSON["title"]; + console.log(response.status + ' ' + title); + }, + onFailure: function (response: WL.FailureResponse) { + }, + timeout: 30 +}); + +WL.Client.invokeProcedure({ adapter: "", procedure: ""}).then(function(response) { + response.responseJSON; +}, function(response) { + response.status; +}); + +// Test WL.Device +WL.Device.getNetworkInfo(function(networkInfo) { + var addrs = networkInfo.Ipv4Addresses; + addrs[0].wifiAddress; +}) + +// Test user delete certificate +WL.UserAuth.deleteCertificate("entity").then(function() { + console.log('WL.UserAuth.deleteCertificate success'); +}, function(error: string) { + console.log('WL.UserAuth.deleteCertificate failure ' + error); +}); + +// Test Auhorization Manager +var xhr = new XMLHttpRequest(); +WLAuthorizationManager.addCachedAuthorizationHeader(xhr).always( + function(response: WLAuthorizationManager.RequestObject) { + // success or failure flow + } +); +WLAuthorizationManager.getAppIdentity().then(function(data) { + // success flow with application identity +}, function(error: string) { + // failure flow with error +}); +WLAuthorizationManager.getCachedAuthorizationHeader().then(function(response) { + // success flow +}, function(error) { + // error flow +}); +WLAuthorizationManager.getDeviceIdentity().then(function(data) { + // success flow with device identity +}, function(error) { + // failure flow with error +}); + +// Test WL.JSONStore +var arr: any[]; +arr = WL.JSONStore.QueryPart().between('gpa', [3.0, 4.0]); + //arr = [{$between: [{ gpa : [3.0, 4.0] }]}] +arr = WL.JSONStore.QueryPart().equal('age', 35); + //arr = [{$equal: [{ age : 35 }]}] +arr = WL.JSONStore.QueryPart().greaterOrEqualThan('age', 40); + //arr = [{$greaterOrEqualThan: [{ age : 40 }]}] +arr = WL.JSONStore.QueryPart().greaterThan('age', 40); + //arr = [{$greaterThan: [{ age : 40 }]}] +arr = WL.JSONStore.QueryPart().inside('gpa', [3.0, 4.0]); + //arr = [{$inside: [{ gpa : [3.0, 4.0] }]}] +arr = WL.JSONStore.QueryPart().leftLike('name', 'ca'); + //arr = [{$leftLike: [{ name : 'ca' }]}] +arr = WL.JSONStore.QueryPart().lessOrEqualThan('age', 40); + //arr = [{$lessOrEqualThan: [{ age : 40 }]}] +arr = WL.JSONStore.QueryPart().lessThan('age', 40); + //arr = [{$lessThan: [{ age : 40 }]}] +arr = WL.JSONStore.QueryPart().like('name', 'ca'); + //arr = [{$like: [{ name : 'ca' }]}] +arr = WL.JSONStore.QueryPart().notBetween('gpa', [3.0, 4.0]); + //arr = [{$notBetween: [{ gpa : [3.0, 4.0] }]}] +arr = WL.JSONStore.QueryPart().notEqual('name', 'ca'); + //arr = [{$notEqual: [{ name : 'ca' }]}] + +// Test WL.Logger +WL.Logger.config(); +var logger = WL.Logger.create({pkg: 'myapp'}); +logger.debug('Hello world'); +logger.error('Hello world'); +logger.fatal('Hello world'); +logger.info('Hello world'); +logger.trace('Hello world'); +logger.warn('Hello world'); +WL.Logger.ctx({pkg: 'hello'}).debug('Hello world'); //Package name context passed +WL.Logger.debug('Hello world'); +WL.Logger.error('Hello world'); +WL.Logger.fatal('Hello world'); +WL.Logger.info('Hello world'); +WL.Logger.log('Hello world'); +WL.Logger.trace('Hello world'); +WL.Logger.warn('Hello world'); +WL.Logger.metadata( { hi : 'world' } ).info('hello'); +WL.Logger.setNativeOptions({ + maxFileSize : 100000, + level : 'debug', + capture : true, + filters : { jsonstore : 'debug' } + }); +WL.Logger.status().then(function (state) { + //{ enabled : true, stringify: true, filters : {}, + // level : 'info', pkg : '', tag: {level: false, pkg: true} } +}).fail(function (errMsg) { + //errMsg = error message +}); + +// Test WL.SecurityUtils +WL.SecurityUtils.base64Encode('input string').then(function(result: string) { + console.log('Base64 Encoded: ' + result); +}, function() { + console.log('An error occurred'); +}); + +// Test WL.SimpleDialog +WL.SimpleDialog.show( + 'My Title', 'My Text', [{ + text: 'First Button', + handler: function() { + WL.Logger.debug("First button pressed"); + } + }]); + +// Test WL.TabBar +// iOS +var creditTab = WL.TabBar.addItem("CREDIT", function() { + alert("the CREDIT tab was selected!"); +}, "Visa", { + image:"images/credit.png", + badge: "2" +}); +creditTab.setEnabled(false); +creditTab.updateBadge("3"); +creditTab.updateBadge(null); +// Android +var tabFeeds = WL.TabBar.addItem ('tab2', function() { + console.log('handler'); +}, 'Engadget Feeds', { + image: 'images/feed.png', + imageSelected: 'images/feed.png' +}); +tabFeeds.setEnabled(true); + +// Test WLResourceRequest +var request1 = new WLResourceRequest('/adapters/sampleAdapter/multiplyNumbers', WLResourceRequest.GET); +request1.setQueryParameter('params', [5, 6]); +request1.send().then(function(response: WL.Response) { + console.log('Success ' + response.responseJSON); +}, function(error: WL.ResponseBase) { + console.log('Error ' + error.errorCode + ' ' + error.errorMsg); +}); +var request2 = new WLResourceRequest('url', WLResourceRequest.POST, 30000); +request2.send('content').then(function(response: WL.Response) { + console.log('Success ' + response.responseJSON); +}, function(error: WL.ResponseBase) { + console.log('Error ' + error.errorCode + ' ' + error.errorMsg); +}); +var request3 = new WLResourceRequest('url', 'METHOD', 50000); +request3.send({ data: 'content', more_data: 'more_content' }).then(function(response: WL.Response) { + console.log('Success ' + response.responseJSON); +}, function(error: WL.ResponseBase) { + console.log('Error ' + error.errorCode + ' ' + error.errorMsg); +}); diff --git a/ibm-mobilefirst/ibm-mobilefirst-tests.ts.tscparams b/ibm-mobilefirst/ibm-mobilefirst-tests.ts.tscparams new file mode 100644 index 000000000..4169d3605 --- /dev/null +++ b/ibm-mobilefirst/ibm-mobilefirst-tests.ts.tscparams @@ -0,0 +1 @@ +--noImplicitAny --module commonjs --target es5 \ No newline at end of file diff --git a/ibm-mobilefirst/ibm-mobilefirst.d.ts b/ibm-mobilefirst/ibm-mobilefirst.d.ts new file mode 100644 index 000000000..e9b0157db --- /dev/null +++ b/ibm-mobilefirst/ibm-mobilefirst.d.ts @@ -0,0 +1,908 @@ +// Type definitions for IBM MobileFirst Platform Foundation +// Project: http://www.ibm.com/software/products/en/mobilefirstfoundation +// Definitions by: Guillermo Ignacio Enriquez Gutierrez +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module WL.Events { + var WORKLIGHT_IS_CONNECTED: string; + var WORKLIGHT_IS_DISCONNECTED: string; +} +declare module WL.AppProperty { + var AIR_ICON_16x16_PATH: string; + var AIR_ICON_128x128_PATH: string; + var DOWNLOAD_APP_LINK: string; + var APP_DISPLAY_NAME: string; + var APP_LOGIN_TYPE: string; + var APP_VERSION: string; + var LATEST_VERSION: string; + var MAIN_FILE_PATH: string; + var SHOW_IN_TASKBAR: string; + var THUMBNAIL_IMAGE_URL: string; +} +declare module WL.Environment { + var ADOBE_AIR: string; + var ANDROID: string; + var EMBEDDED: string; + var IPAD: string; + var IPHONE: string; + var MOBILE_WEB: string; + var PREVIEW: string; + var WINDOWS_PHONE_8: string; + var WINDOWS8: string; +} +declare module WL { + interface IResponse { + invocationContext?: any; + } + interface Headers { + [key: string]: string; + } + class ResponseBase { + invocationContext: any; + headerJSON: {[key: string]: any}; // JSON Object + readyState: number; + request: any; + responseJSON: {[key: string]: any}; // JSON Object + responseText: string; + responseXML: string; + status: number; + statusText: string; + errorCode: number; + errorMsg: string; + } + class FailureResponse extends ResponseBase { + } + class Response extends ResponseBase { + getHeaderNames(): string[]; + getAllHeaders(): Headers; + getHeader(name: any): string; + } + interface Options { + onSuccess?: (response: IResponse) => void; + onFailure?: (response: IResponse) => void; + invocationContext?: any; + } + interface ResponseHandler { + (response: T): void; + } +} +declare module WL.Analytics { + function disable(): void; + function enable(): void; + function log(message: string, name: string): void; + /** + * @deprecated since version 6.2. WL.Analytics.restart is now a NOP. + */ + function restart(): void; + function send(): void; + function state(): void; +} +declare module WL.App { + interface ActionReceiverCallback { + (action: any): void; + } + interface Callback { + (): void; + } + interface OpenURLOptions { + status?: number; + toolbar?: number; + location?: number; + menubar?: number; + directories?: number; + resizable?: number; + scrollbars?: number; + } + interface Data { + } + interface KeepAliveInBackgroundOptions { + tickerText?: string; + contentTitle?: string; + contentTextText?: string; + icon?: string; + notificationId?: number; + className?: string; + } + function addActionReceiver(id: string, callback: ActionReceiverCallback): void; + /** + * @deprecate Deprecated. + */ + function close(): void; + function copyToClipboard(stringToCopy: string, callback?: Callback): void; + function getDeviceLanguage(): string; + function getDeviceLocale(): string; + /** + * TODO: declare exception type. (Exceptions that are thrown by the IBM® Worklight® client runtime framework) + */ + function getErrorMessage(exception: any): string; + function hideSplashScreen(): void; + function openURL(url: string, target?: string, options?: OpenURLOptions): void; + function overrideBackButton(callback: Callback): void; + function removeActionReceiver(id: string): void; + /** + * @deprecated since version 6.0.0 + */ + function resetBackButton(): void; + function sendActionToNative(action: string, data?: Data): void; + function setKeepAliveInBackground(enabled: boolean, options?: KeepAliveInBackgroundOptions): void; + function showSplashScreen(): void; +} +declare module WL.App.BackgroundHandler { + interface Handler { + (): void; + } + function setOnAppEnteringBackground(handler: Handler): void; + var hideView: Handler; + var defaultIOSBehavior: Handler; + /** + * @deprecated since version 6.0.0 + */ + var hideElements: Handler; +} +declare module WL.Badge { + function setNumber(badgeNumber: number): void; +} +declare module WL { + interface BusyIndicatorOptions { + tickerText?: string; + contentTitle?: string; + contentTextText?: string; + icon?: string; + notificationId?: number; + className?: string; + } + class BusyIndicator { + constructor(containerId?: string, options?: BusyIndicator); + hide(): void; + show(): void; + } +} +declare module WL.Client { + interface SharedTokenObject { + key: string; + } + interface ConnectOptions { + onSuccess: (response: ResponseBase) => void; + onFailure: (response: FailureResponse) => void; + timeout?: number; + } + interface ChallengehandlerInvocationData { + adapter: string; + procedure: string; + parameters: any[]; + } + interface ChallengeHandlerAuthenticationOptions { + } + interface ChallengeHandlerSubmitLoginFormOptions { + timeout?: number; + headers?: Object; + parameters?: Object; + } + class AbstractChallengeHandler { + handleChallenge(challenge: any): boolean; + isCustomResponse(transport: any): boolean; + submitAdapterAuthentication(invocationData: ChallengehandlerInvocationData, options: ChallengeHandlerAuthenticationOptions): void; + submitFailure(error: string): void; + submitLoginForm(reqURL: string, options: ChallengeHandlerSubmitLoginFormOptions, submitLoginFormCallback: (transport: any) => void): void; + submitSuccess(): void; + } + interface InitOptions extends Options { + timeout?: number; + /** + * @deprecated since version 6.2. Use WL.Logger.config function with an object specifying the level instead. + */ + enableLogger?: boolean; + messages?: string; + authenticator?: Object; + heartBeatIntervalInSecs?: number; + /** + * @deprecated. If you would like your application to connect to the Worklight Server, use WL.Client.connect(). + */ + connectOnStartup?: boolean; + onConnectionFailure?: (response: WL.FailureResponse) => void; + onUnsupportedVersion?: (response: WL.FailureResponse) => void; + onRequestTimeout?: (response: WL.FailureResponse) => void; + onUnsupportedBrowser?: (response: WL.FailureResponse) => void; + onDisabledCookies?: (response: WL.FailureResponse) => void; + onUserInstanceAccessViolation?: (response: WL.FailureResponse) => void; + onErrorRemoteDisableDenial?: (response: WL.FailureResponse) => void; + /** + * @deprecated since version 5.0.6. Instead, use onErrorRemoteDisableDenial. + */ + onErrorAppVersionAccessDenial?: (response: WL.FailureResponse) => void; + validateArguments?: boolean; + autoHideSplash?: boolean; + onGetCustomDeviceProvisioningProperties: (resumeDeviceProvisioningProcess: (data: any) => void) => void; + } + interface ProcedureInvocationData { + adapter: string; + procedure: string; + parameters?: any[]; + compressResponse?: boolean; + } + interface ProcedureInvocationResult { + isSuccessful: boolean; + errors?: string[]; + } + interface ProcedureResponse extends ResponseBase { + invocationResult?: ProcedureInvocationResult; + parameters?: any[]; + } + interface ProcedureInvocationOptions extends Options { + timeout: number; + onSuccess: (response: ProcedureResponse) => void; + } + function addGlobalHeader(headerName: string, headerValue: string): void; + function checkForDirectUpdate(options: Options): void; + function clearSharedToken(object: SharedTokenObject): JQueryDeferred; + function close(): void; + function connect(options?: ConnectOptions): void; + function createChallengeHandler(realmName: string): AbstractChallengeHandler; + function createProvisioningChallengeHandler(realmName: string): AbstractChallengeHandler; + function createWLChallengeHandler(realName: string): AbstractChallengeHandler; + function deleteUserPref(key: string, options?: Options): void; + /** + * See WL.AppProperty for possible results + */ + function getAppProperty(property: any): any; + /** + * See WL.Environment for possible results + */ + function getEnvironment(): string; + function getLanguage(): string; + function getLastAccessToken(scope?: string): string; + function getLoginName(realmName: string): string; + /** + * @deprecated since version 7.0 + */ + function getRequiredAccessTokenScope(status: number, header: string): string; + function getSharedToken(object: SharedTokenObject): JQueryDeferred; + function getUserInfo(realm: string, key: string): any; + function getUserName(realm: any): string; + function getUserPref(key: any): any; + function hasUserPref(key: any): boolean; + function init(options: InitOptions): void; + function invokeProcedure(invocationData: ProcedureInvocationData, options?: ProcedureInvocationOptions): JQueryDeferred; + /** + * @deprecated since version 4.1.3. Use WL.Device.getNetworkInfo instead. + */ + function isConnected(): void; + function isUserAuthenticated(realm: string): boolean; + /** + * @deprecated since version 7.0. Use WL.Logger instead. + */ + function logActivity(activityType: string): void; + function login(realm: string, options?: Options): void; + function logout(realm: string, options?: Options): void; + function minimize(): void; + /** + * @deprecated since version 7.0 + */ + function obtainAccessToken(scope: string, onSuccess: ResponseHandler, onFailure: ResponseHandler): void; + function purgeEventTransmissionBuffer(): void; + function reloadApp(): void; + function removeGlobalHeader(headerName: string): void; + interface EventTransmissionPolicy { + eventStorageEnabled?: boolean; + interval?: number; + } + function setEventTransmissionPolicy(policy: EventTransmissionPolicy): void; + function setHeartBeatInterval(interval: number): void; + function setSharedToken(token: SharedTokenObject): void; + function setUserPref(key: string, value: string, options?: Options): void; + interface UserPreferences { + [key: string]: string; + } + function setUserPrefs(userPrefsHash: UserPreferences, options?: Options): void; + function transmitEvent(event: any, immediate?: boolean): void; + function updateUserInfo(options: Options): void; +} +declare module WL.Device { + interface AddressPair { + wifiAddress: string; + "3GAddress": string; + } + interface NetworkInfo { + isNetworkConnected?: boolean; + isAirplaneMode?: boolean; + isRoaming?: boolean; + networkConnectionType?: string; + wifiName?: string; + telephonyNetworkType?: string; + carrierName?: string; + ipAddress?: string; + Ipv4Addresses?: AddressPair[]; + Ipv6Addresses?: AddressPair[]; + } + function getNetworkInfo(callback: (networkInfo: NetworkInfo) => void): void; +} +declare module WL.EncryptedCache { + var OK: number; + var ERROR_COULD_NOT_GENERATE_KEY: number; + var ERROR_CREDENTIALS_MISMATCH: number; + var ERROR_EOC_CLOSED: number; + var ERROR_EOC_DELETED: number; + var ERROR_EOC_TO_BE_DELETED: number; + var ERROR_INVALID_PARAMETER: number; + var ERROR_KEY_CREATION_IN_PROGRESS: number; + var ERROR_LOCAL_STORAGE_NOT_SUPPORTED: number; + var ERROR_MIGRATION: number; + var ERROR_NO_EOC: number; + var ERROR_NO_SUCH_KEY: number; + var ERROR_SECURE_RANDOM_GENERATOR_UNAVAILABLE: number; + var ERROR_UNKNOWN: number; + var ERROR_UNSAFE_CREDENTIALS: number; + /** + * See above statuses for possible values + */ + interface StatusHandler { + (status: number): void; + } + function close(successHandler: StatusHandler, failureHandler: StatusHandler): void; + function destroy(successHandler: StatusHandler, failureHandler: StatusHandler): void; + function open(credentials: string, createIfNone: boolean, successHandler: StatusHandler, failureHandler: StatusHandler): void; + function read(key: string, successHandler: StatusHandler, failureHandler: StatusHandler): void; + function remove(key: string, successHandler: StatusHandler, failureHandler: StatusHandler): void; + function write(key: string, value: string, successHandler: StatusHandler, failureHandler: StatusHandler): void; +} +declare module WL.Geo { + interface Coordinate { + latitute: number; + longitude: number; + } + interface Circle extends Coordinate { + radius: number; + } + interface DistanceOptions { + bufferZoneWidth: number; + } + interface InsideOutsideOptions { + /** + * confidenceLevel can be 'low', 'medium', 'high' + */ + confidenceLevel: string; + } + function getDistanceBetweenCoordinates(coordinate1: Coordinate, coordinate2: Coordinate): number; + function getDistanceToCircle(coordinate: Coordinate, circle: Circle, options: DistanceOptions): number; + function getDistanceToPolygon(coordinate: Coordinate, polygon: Coordinate[], options: DistanceOptions): number; + function isInsideCircle(coordinate: Coordinate, circle: Circle, options: InsideOutsideOptions): boolean; + function isInsidePolygon(coordinate: Coordinate, polygon: Coordinate[], options: InsideOutsideOptions): boolean; + function isOutsideCircle(coordinate: Coordinate, circle: Circle, options: InsideOutsideOptions): boolean; + function isOutsidePolygon(coordinate: Coordinate, polygon: Coordinate[], options: InsideOutsideOptions): boolean; +} +declare module WL { + class Item { + setEnabled(isEnable: string): void; + setImagePath(imagePath: string): void; + setTitle(title: string): void; + } +} +declare module WL.JSONStore { + /** + * Changes the password for the internal storage. You must have an initialized collection before calling WL.JSONStore.changePassword. + */ + function changePassword(oldPassword: string, newPassword: string, username: string, options: WL.Options): JQueryDeferred; + /** + * @deprecated since version 5.0.6, it is no longer needed if you use WL.JSONStore.init + */ + function clearPassword(): boolean; + /** + * Locks access to all the collections until WL.JSONStore.init is called. + */ + function closeAll(options?: WL.Options): JQueryDeferred; + /** + * Commit a transaction. + */ + function commitTransaction(): JQueryDeferred; + /** + * Completely wipes data for all users, destroys the internal storage, and clears security artifacts. + * @parameters options is @deprecated + */ + function destroy(username: string, options?: WL.Options): JQueryDeferred; + /** + * @deprecated since version 6.2.0. + */ + function documentify(id: number, data: any): any; + /** + * Returns information about the file that is used to persist data in the store. The following key value pairs are returned: + * name - name of the store + * size - the total size, in bytes, of the store + * isEncrypted - boolean that is true when encrypted and false otherwise. + */ + function fileInfo(): JQueryDeferred; + /** + * Provides an accessor to the collection if the collection exists, otherwise it returns undefined. + */ + function get(collectionName: string): JSONStoreInstance; + /** + * Returns the message that is associated with a JSONStore error code. + */ + function getErrorMessage(errorCode: number): string; + interface InitOptions { + username?: string; + password?: string; + clear?: boolean; + localKeyGen?: boolean; + analytics?: boolean; + } + function init(collections: any, options?: InitOptions): JQueryDeferred; + /** + * @deprecated since version 5.0.6, it is no longer needed if you use WL.JSONStore.init + */ + function initCollection(name: string, searchFields: any, options?: InitOptions): WL.JSONStore.JSONStoreInstance; + /** + * Creates a query for advanced find. See WL.JSONStore.QueryPart for more information. + */ + function QueryPart(): QueryPartObj; + /** + * Roll back a transaction + */ + function rollbackTransaction(): JQueryDeferred; + /** + * Initiates a transaction + */ + function startTransaction(): JQueryDeferred; + /** + * Sets the password that is used to generate keys to encrypt data that is stored locally on the device. + * @deprecated since version 5.0.6, it is no longer needed if you use WL.JSONStore.init + */ + function usePassword(pwd: string): boolean; + interface AddOptions extends WL.Options { + additionalSearchFields?: any; + markDirty?: boolean; + /** + * @deprecated + */ + push?: boolean; + } + interface BasicFindOptions extends WL.Options { + filter?: string[]; + sort?: string[]; + } + interface AdvancedFindOptions extends BasicFindOptions { + limit?: number; + offset?: number; + } + interface FindOptions extends BasicFindOptions { + exact?: boolean; + limit?: number; + offset?: number; + } + interface EraseOptions extends WL.Options { + push?: boolean; + } + interface RefreshOptions extends WL.Options { + push: boolean; + } + interface ChangeOptions extends WL.Options { + addNew?: boolean; + markDirty?: boolean; + replaceCriteria?: string[]; + } + interface RemoveOptions extends WL.Options { + markDirty?: boolean; + /** + * @deprecated + */ + push?: boolean; + exact?: boolean; + } + interface ReplaceOptions extends WL.Options { + markDirty?: boolean; + /** + * @deprecated + */ + push?: boolean; + } + interface StoreOptions extends WL.Options { + additionalSearchFields?: Object; + push?: boolean; + } + class JSONStoreInstance { + add(data: any, options?: AddOptions): JQueryDeferred; + advancedFind(query: any[], options?: AdvancedFindOptions): JQueryDeferred; + change(data: any, options?: ChangeOptions): JQueryDeferred; + clear(options?: WL.Options): JQueryDeferred; + count(query?: any, options?: WL.Options): JQueryDeferred; + countAllDirty(options?: WL.Options): JQueryDeferred; + enhance(name: string, fn: Function): number; + /** + * @deprecated since version 5.0.6, it is no longer needed if you use WL.JSONStore.JSONStoreInstance.remove with {push: false}. + */ + erase(doc: any, options?: EraseOptions): void; + find(query: Object | Object[], options?: FindOptions): JQueryDeferred; + findAll(options?: BasicFindOptions): JQueryDeferred; + findById(options?: WL.Options): JQueryDeferred; + isDirty(doc: any, options?: WL.Options): JQueryDeferred; + /** + * @deprecated since version 6.2.0. + */ + load(options?: WL.Options): JQueryDeferred; + markClean(docs: any[], options?: WL.Options): JQueryDeferred; + /** + * @deprecated since version 6.2.0. + */ + push(options?: any): JQueryDeferred; + /** + * @deprecated since version 5.0.6, it is no longer needed if you use WL.JSONStore.JSONStoreInstance.push. + */ + pushSelected(doc: any, options?: WL.Options): JQueryDeferred; + /** + * @deprecated since version 5.0.6. It is no longer needed if you use WL.JSONStore.JSONStoreInstance.replace with {push: false}. + */ + refresh(doc: any, options?: RefreshOptions): JQueryDeferred; + remove(doc: any, options?: RemoveOptions): JQueryDeferred; + /** + * Deletes all the documents that are stored inside a collection. + */ + removeCollection(options?: WL.Options): JQueryDeferred; + replace(doc: Object | Object[], options?: ReplaceOptions): JQueryDeferred; + /** + * Writes data to a collection. + * @deprecated since version 5.0.6, it is no longer needed if you use WL.JSONStore.JSONStoreInstance.add with {push: false}. + */ + store(data: Object | Object[], options?: StoreOptions): void; + toString(limit?: number, offset?: number): JQueryDeferred; + } + class QueryPartObj { + /** + * Add a between clause to a query for advanced find. + */ + between(searchField: any, value: any): any[]; + /** + * Add an equal to clause to a query for advanced find. + */ + equal(searchField: any, value: any): any[]; + /** + * Add a greater or equal thanclause to a query for advanced find. + */ + greaterOrEqualThan(searchField: any, value: any): any[]; + /** + * Add a greater than clause to a query for advanced find. + */ + greaterThan(searchField: any, value: any): any[]; + /** + * Add an in clause to a query for advanced find. + */ + inside(searchField: any, value: any): any[]; + /** + * Add a left clause to a query for advanced find. + */ + leftLike(searchField: any, value: any): any[]; + /** + * Add a less or equal than clause to a query for advanced find. + */ + lessOrEqualThan(searchField: any, value: any): any[]; + /** + * Add a less than clause to a query for advanced find. + */ + lessThan(searchField: any, value: any): any[]; + /** + * Add a like clause to a query for advanced find. + */ + like(searchField: any, value: any): any[]; + /** + * Add a not between clause to a query for advanced find. + */ + notBetween(searchField: any, value: any): any[]; + /** + * Add a not equal to clause to a query for advanced find. + */ + notEqual(searchField: any, value: any): any[]; + /** + * Add a not in clause to a query for advanced find. + */ + notInside(searchField: any, value: any): any[]; + /** + * Add a not left clause to a query for advanced find. + */ + notLeftLike(searchField: any, value: any): any[]; + /** + * Add a not like clause to a query for advanced find. + */ + notLike(searchField: any, value: any): any[]; + /** + * Add a not right clause to a query for advanced find. + */ + notRightLike(searchField: any, value: any): any[]; + /** + * Add a right clause to a query for advanced find. + */ + rightLike(searchField: any, value: any): any[]; + } +} +declare module WL.LocalStorage { + function getValue(key: string): string; + function setValue(key: string, value: string): void; + function clear(key: string): void; + function clearAll(): void; +} +declare module WL { + var Logger: LoggerObject; + interface LoggerCallback { + (message: string | string[], level: string, package: string): void; + } + interface Tag { + level?: boolean; + tag?: boolean; + } + interface Filter { + [name: string]: string; + } + interface LoggerOptions { + stringify?: boolean; + pretty?: boolean; + stacktrace?: boolean; + callback?: LoggerCallback; + pkg?: string; + tag?: Tag; + /** + * @deprecated since version 6.2. use filters instead. + */ + whitelist?: string[]; + /** + * @deprecated since version 6.2. use filters instead. + */ + blacklist?: string[]; + filters?: Filter; + capture?: boolean; + autoSendLogs?: boolean; + maxFileSize?: number; + level?: string[] | string | number; + } + interface NativeOptions { + maxFileSize?: number; + level?: string; + capture?: boolean; + autoSendLogs?: boolean; + autoUpdateConfig?: boolean; + filters?: Filter; + } + /** + * Artifact to allow chaining of Logger class as: WL.Logger.ctx({pkg: 'something'}).debug('Hello world'); + */ + class LoggerObject { + /** + * Configures the logger globally. + */ + config(options?: LoggerOptions): LoggerObject; + /** + * Creates an instance of a logger with its own context (also called status or state). + */ + create(options?: LoggerOptions): LogInstance; + /** + * Updates the state (also called context or status) of the logger. + */ + ctx(options?: LoggerOptions): WL.LoggerObject; + /** + * Prints arguments to the console. + */ + debug(message: string): void; + /** + * Prints arguments to the console. + */ + error(message: string): void; + /** + * Prints arguments to the console. + */ + fatal(message: string): void; + /** + * Prints arguments to the console. + */ + info(message: string): void; + /** + * Prints arguments to the console. + */ + log(message: string): void; + /** + * Attach additional metadata to the next logger instance call. + */ + metadata(options: any): LoggerObject; + /** + * @deprecated since version 6.2. WL.Logger.on is now a no-op. WL.Logger is always enabled. Use WL.Logger.config with {'level': 'FATAL'} to reduce verbosity. + */ + off(): WL.LoggerObject; + /** + * @deprecated since version 6.2. WL.Logger.on is now a no-op. WL.Logger is always enabled. Use WL.Logger.config with {'level': 'FATAL'} to reduce verbosity. + */ + on(options: any): WL.LoggerObject; + /** + * Send any logs collected up to this point to the IBM® Worklight® server. + */ + send(): JQueryDeferred; + /** + * @deprecated since version 6.2. Use WL.Logger.config instead. Sets options in native application layer (iOS and Android only) + */ + setNativeOptions(options?: NativeOptions): void; + /** + * Shows the status (current configuration) of the logger. + */ + status(): JQueryDeferred; + /** + * Prints arguments to the console. + */ + trace(message: string): void; + /** + * Retrieves and applies any matching configuration profile from the IBM® Worklight® Server. + */ + updateConfigFromServer(): JQueryDeferred; + /** + * Prints arguments to the console. + */ + warn(message: string): void; + } + /** + * Class which defines instances created via: WL.Logger.create({pkg: 'something'}); + * Actual definition is outside of WL namespace. For easier d.ts file compiling it is here + */ + class LogInstance { + debug(message: string): void; + error(message: string): void; + fatal(message: string): void; + info(message: string): void; + trace(message: string): void; + warn(message: string): void; + } +} +declare module WL.NativePage { + function show(className: string, callback: (data: any) => void, data: any): void; +} +declare module WL.SecurityUtils { + interface DecryptOptions { + key: string; + ct: string; + lv: string; + src: string; + v: string; + } + interface EncryptOptions { + key: string; + text: string; + } + interface KeygenOptions { + password: string; + salt: string; + iterations: number; + } + function base64Decode(input: string): JQueryDeferred; + function base64Encode(input: string): JQueryDeferred; + function decrypt(options: DecryptOptions): JQueryDeferred; + function encrypt(options: EncryptOptions): JQueryDeferred; + function keygen(options: KeygenOptions): JQueryDeferred; + function localRandomString(bytes?: number): JQueryDeferred; + function remoteRandomString(bytes?: number): JQueryDeferred; +} +declare module WL.SimpleDialog { + interface Button { + text: string; + handler?: Function; + } + interface Options { + title: string; + text: string; + } + function show(title: string, text: string, buttons: Button[], options?: Options): void; +} + +declare module WL.TabBar { + interface ItemOptions { + image: string; + badge?: string; // for iOS + imageSelected?: string; // for Android + } + function addItem(id: string, callback: Function, title: string, options: ItemOptions): WL.TabBarItem; + function init(): void; + function isVisible(): boolean; + function RemoveAllItems(): void; + function setEnabled(isEnabled: boolean): void; + /** + * @deprecated + */ + function setParentDivId(parentId: string): void; + function setSelectedItem(id: string): void; + function setVisible(isVisible: boolean): void; +} + +declare module WL { + class TabBarItem { + setEnabled(isEnabled: boolean): void; + updateBadge(badge?: string): void; + } +} + +declare module WL.Toast { + function show(): void; +} +declare module WL.Trusteer { + interface AssesmentRisk { + value: number; + additionalData: string; + lastCalculated: number; + name: string; + } + interface AssetmentRisks { + device_key: string; + 'malware.any'?: AssesmentRisk; + 'network.wifi'?: AssesmentRisk; + 'os.rooted'?: AssesmentRisk; + 'os.rooted.native'?: AssesmentRisk; + 'os.rooted.hiders'?: AssesmentRisk; + 'os.ver_up_to_date'?: AssesmentRisk; + 'plat.android.dumpsys'?: AssesmentRisk; + 'plat.android.apprestrict'?: AssesmentRisk; + 'total.risk.generic'?: AssesmentRisk; + 'tas.config_update'?: AssesmentRisk; + } + function getRiskAssessment(onSuccess: ResponseHandler, onFailure: ResponseHandler): AssetmentRisks; +} +declare module WL.UserAuth { + function deleteCertificate(provisioningEntity?: string): JQueryDeferred; +} +declare module WLAuthorizationManager { + /** + * AuthorizationPersistencePolicy possible values + */ + var ALWAYS: string; + var NEVER: string; + interface RequestObject { + setRequestHeader: (header: string, value: string) => void; + } + function addCachedAuthorizationHeader(request: RequestObject): JQueryDeferred; + function getAppIdentity(): JQueryDeferred; + function getAuthorizationScope(responseAuthenticationHeader: string): string; + /** + * TODO: Set Promise types. Should be something like: JQueryDeferred() + */ + function getCachedAuthorizationHeader(): JQueryDeferred; + /** + * TODO: Set Promise types. Should be something like: JQueryDeferred() + */ + function getDeviceIdentity(): JQueryDeferred; + /** + * TODO: Set Promise types. Should be something like: JQueryDeferred() + */ + function getUserIdentity(): JQueryDeferred; + function isAuthorizationRequired(responseStatus: number, responseAuthenticationHeader: string): boolean; + /** + * TODO: Set Promise types. Should be something like: JQueryDeferred() + */ + function obtainAuthorizationHeader(scope: string): JQueryDeferred; + /** + * See WLAuthorizarionManager.NEVER and WLAuthorizarionManager.ALWAYS + */ + function setAuthorizationPersistencePolicy(authorizationPersistencePolicy: string): void; +} + +declare module WL { + var ClientMessages: { [name: string]: string }; +} + +declare class WLResourceRequest { + constructor(url: string, method: string, timeout?: number); + addHeader(name: string, value: string|number|boolean): void; + getHeader(name: string): string; + getHeaderNames(): string[]; + getHeaders(name: string): string[]; + getMethod(): string; + getQueryParameters(): any; // JSON + getTimeout(): number; + getUrl(): string; + send(content?: any): JQueryDeferred; + sendFormParameters(json: Object): JQueryDeferred; + setHeader(name: string, value: string|number|boolean): void; + setHeaders(requestHeaders?: { [name: string]: string|string[] }): void; + setQueryParameter(name: string, value: string|number|boolean|Object): void; + setQueryParameters(parameters?: { [name: string]: string|number|boolean|Object }): void; + setTimeout(requestTimeout: number): void; + + static GET: string; + static POST: string; + static PUT: string; + static DELETE: string; + static HEAD: string; + static OPTIONS: string; + static TRACE: string; + static CONNECT: string; +} diff --git a/icepick/icepick-tests.ts b/icepick/icepick-tests.ts new file mode 100644 index 000000000..350e5f2dc --- /dev/null +++ b/icepick/icepick-tests.ts @@ -0,0 +1,177 @@ +/// +/// + + +import i = require("icepick"); + +"use strict"; // so attempted modifications of frozen objects will throw errors + +// freeze(collection) +{ + let coll = { + a: "foo", + b: [1, 2, 3], + c: { + d: "bar" + } + }; + + i.freeze(coll); +} + +// thaw(collection) +class Foo {} + +{ + let coll = i.freeze({ a: "foo", b: [1, 2, 3], c: { d: "bar" }, e: new Foo() }); + let thawed = i.thaw(coll); +} + +// assoc(collection, key, value) +{ + let coll = { a: 1, b: 2 }; + let newColl = i.assoc(coll, "b", 3); // {a: 1, b: 3} + + let arr = ["a", "b", "c"]; + let newArr = i.assoc(arr, 2, "d"); // ["a", "b", "d"] +} + +// alias: set(collection, key, value) +{ + let coll = { a: 1, b: 2 }; + let newColl = i.set(coll, "b", 3); // {a: 1, b: 3} + + let arr = ["a", "b", "c"]; + let newArr = i.set(arr, 2, "d"); // ["a", "b", "d"] +} + +// dissoc(collection, key) +{ + let coll = { a: 1, b: 2, c: 3 }; + let newColl = i.dissoc(coll, "b"); // {a: 1, c: 3} + + let arr = ["a", "b", "c"]; + let newArr = i.dissoc(arr, 2); // ["a", , "c"] +} + +// alias: unset(collection, key) +{ + let coll = { a: 1, b: 2, c: 3 }; + let newColl = i.unset(coll, "b"); // {a: 1, c: 3} + + let arr = ["a", "b", "c"]; + let newArr = i.unset(arr, 2); // ["a", , "c"] +} + +// assocIn(collection, path, value) +{ + let coll = { + a: "foo", + b: [1, 2, 3], + c: { + d: "bar" + } + }; + + let newColl = i.assocIn(coll, ["c", "d"], "baz"); + + let coll2 = {}; + let newColl2 = i.assocIn(coll2, ["a", "b", "c"], 1); +} + +// alias: setIn(collection, path, value) +{ + let coll = { + a: "foo", + b: [1, 2, 3], + c: { + d: "bar" + } + }; + + let newColl = i.setIn(coll, ["c", "d"], "baz"); + + let coll2 = {}; + let newColl2 = i.setIn(coll2, ["a", "b", "c"], 1); +} + +// getIn(collection, path) +{ + let coll = i.freeze([ + { a: 1 }, + { b: 2 } + ]); + + let result = i.getIn(coll, [1, "b"]); // 2 +} + +// updateIn(collection, path, callback) +{ + let coll = i.freeze([ + { a: 1 }, + { b: 2 } + ]); + + let newColl = i.updateIn(coll, [1, "b"], function(val: number) { + return val * 2; + }); // [ {a: 1}, {b: 4} ] +} + +// assign(coll1, coll2, ...) +{ + let obj1 = { a: 1, b: 2, c: 3 }; + let obj2 = { c: 4, d: 5 }; + + let result = i.assign(obj1, obj2); // {a: 1, b: 2, c: 4, d: 5} +} + +// merge(target, source) +{ + let defaults = { a: 1, c: { d: 1, e: [1, 2, 3], f: { g: 1 } } }; + let obj = { c: { d: 2, e: [2], f: null as any } }; + + let result1 = i.merge(defaults, obj); // {a: 1, c: {d: 2, e: [2]}, f: null} + + let obj2 = { c: { d: 2 } }; + let result2 = i.merge(result1, obj2); + + (result1 === result2); // true +} + +// arrays +{ + var a = [1]; + a = i.push(a, 2); // [1, 2]; + a = i.unshift(a, 0); // [0, 1, 2]; + a = i.pop(a); // [0, 1]; + a = i.shift(a); // [1]; +} +{ + i.map(function(v) { return v * 2 }, [1, 2, 3]); // [2, 4, 6] + + var removeEvens = _.partial(i.filter, function(v: number) { return v % 2; }); + + removeEvens([1, 2, 3]); // [1, 3] +} +{ + var arr = i.freeze([{ a: 1 }, { b: 2 }]); + + //ECMAScript 2015 + //arr.find(function(item) { return item.b != null; }); // {b: 2} +} + +// chain(coll) - not defined +{ + let o = { + a: [1, 2, 3], + b: { c: 1 }, + d: 4 + }; + + let result = i.chain(o) + .assocIn(["a", 2], 4) + .merge({ b: { c: 2, c2: 3 } }) + .assoc("e", 2) + .dissoc("d") + .value(); +} diff --git a/icepick/icepick.d.ts b/icepick/icepick.d.ts new file mode 100644 index 000000000..85bbf0ae3 --- /dev/null +++ b/icepick/icepick.d.ts @@ -0,0 +1,72 @@ +// Type definitions for icepick v1.1.0 +// Project: https://github.com/aearly/icepick +// Definitions by: Nathan Brown +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "icepick" { + export function freeze(collection: T): T; + export function thaw(collection: T): T; + export function assoc(collection: T, key: number | string, value: any): T; + export function dissoc(collection: T, key: number | string): T; + export function assocIn(collection: T, path: Array, value: any): T; + export function getIn(collection: any, path: Array): Result; + export function updateIn(collection: T, path: Array, callback: (value: V) => V): T; + + export {assoc as set}; + export {dissoc as unset}; + export {assocIn as setIn}; + + export function assign(target: T): T; + export function assign(target: T, source1: S1): (T & S1); + export function assign(target: T, s1: S1, s2: S2): (T & S1 & S2); + export function assign(target: T, s1: S1, s2: S2, s3: S3): (T & S1 & S2 & S3); + export function assign(target: T, s1: S1, s2: S2, s3: S3, s4: S4): (T & S1 & S2 & S3 & S4); + + export {assign as extend}; + + export function merge(target: T, source: S1): (T & S1); + + export function push(array: T[], element: T): T[]; + export function pop(array: T[]): T[]; + export function shift(array: T[]): T[]; + export function unshift(array: T[], element: T): T[]; + export function reverse(array: T[]): T[]; + export function sort(array: T[], compareFunction?: (a:T, b:T) => number): T[]; + export function splice(array: T[], start: number, deleteCount: number, ...items: T[]): T[]; + export function slice(array: T[], begin?: number, end?: number): T[]; + + export function map(fn: (value: T) => U, array: T[]): U[]; + export function filter(fn: (value: T) => boolean, array: T[]): T[]; + + interface IcepickWrapper { + value(): T; + + freeze(): IcepickWrapper; + thaw(): IcepickWrapper; + + assoc(key: number | string, value: any): IcepickWrapper; + set(key: number | string, value: any): IcepickWrapper; + + dissoc(key: number | string): IcepickWrapper; + unset(key: number | string): IcepickWrapper; + + assocIn(path: Array, value: any): IcepickWrapper; + setIn(path: Array, value: any): IcepickWrapper; + + getIn(collection: any, path: Array): IcepickWrapper; + updateIn(collection: T, path: Array, callback: (value: V) => V): IcepickWrapper; + + assign(source1: S1): IcepickWrapper; + assign(s1: S1, s2: S2): IcepickWrapper; + assign(s1: S1, s2: S2, s3: S3): IcepickWrapper; + assign(s1: S1, s2: S2, s3: S3, s4: S4): IcepickWrapper; + extend(source1: S1): IcepickWrapper; + extend(s1: S1, s2: S2): IcepickWrapper; + extend(s1: S1, s2: S2, s3: S3): IcepickWrapper; + extend(s1: S1, s2: S2, s3: S3, s4: S4): IcepickWrapper; + + merge(source: S1): IcepickWrapper; + } + + export function chain(target: T): IcepickWrapper; +} diff --git a/imap/imap-tests.ts b/imap/imap-tests.ts index 23f5f8f17..8d9ce6cce 100644 --- a/imap/imap-tests.ts +++ b/imap/imap-tests.ts @@ -124,7 +124,7 @@ var fs = require('fs'); openInbox(function(err : Error, box : IMAP.Box) { if (err) throw err; - imap.search([ 'UNSEEN', ['SINCE', 'May 20, 2010'] ], function(err : Error, results : string[]) { + imap.search([ 'UNSEEN', ['SINCE', 'May 20, 2010'] ], function(err : Error, results : number[]) { if (err) throw err; var f = imap.fetch(results, { bodies: '' }); f.on('message', function(msg : IMAP.ImapMessage, seqno : number) { diff --git a/imap/imap.d.ts b/imap/imap.d.ts index 128491955..4b88279ae 100644 --- a/imap/imap.d.ts +++ b/imap/imap.d.ts @@ -5,32 +5,46 @@ /// - declare module IMAP { - + // The property names of these interfaces match the documentation (where type names were given). export interface Config { - user: string; // Username for plain-text authentication. - password: string; // Password for plain-text authentication. - xoauth?: string; // Base64-encoded OAuth token for OAuth authentication for servers that support it (See Andris Reinman's xoauth.js module to help generate this string). - xoauth2?: string; // Base64-encoded OAuth2 token for The SASL XOAUTH2 Mechanism for servers that support it (See Andris Reinman's xoauth2 module to help generate this string). - host?: string; // Hostname or IP address of the IMAP server. Default: "localhost" - port?: number; // Port number of the IMAP server. Default: 143 - tls?: boolean; // Perform implicit TLS connection? Default: false - tlsOptions?: Object; // Options object to pass to tls.connect() Default: (none) - autotls?: string; // Set to 'always' to always attempt connection upgrades via STARTTLS, 'required' only if upgrading is required, or 'never' to never attempt upgrading. Default: 'never' - connTimeout?: number; // Number of milliseconds to wait for a connection to be established. Default: 10000 - authTimeout?: number; // Number of milliseconds to wait to be authenticated after a connection has been established. Default: 5000 - keepalive?: any; /* boolean|KeepAlive */ // Configures the keepalive mechanism. Set to true to enable keepalive with defaults or set to object to enable and configure keepalive behavior: Default: true - debug?: Function; // If set, the function will be called with one argument, a string containing some debug info Default: (no debug output) + /** Username for plain-text authentication. */ + user: string; + /** Password for plain-text authentication. */ + password: string; + /** Base64-encoded OAuth token for OAuth authentication for servers that support it (See Andris Reinman's xoauth.js module to help generate this string). */ + xoauth?: string; + /** Base64-encoded OAuth2 token for The SASL XOAUTH2 Mechanism for servers that support it (See Andris Reinman's xoauth2 module to help generate this string). */ + xoauth2?: string; + /** Hostname or IP address of the IMAP server. Default: "localhost" */ + host?: string; + /** Port number of the IMAP server. Default: 143 */ + port?: number; + /** Perform implicit TLS connection? Default: false */ + tls?: boolean; + /** Options object to pass to tls.connect() Default: (none) */ + tlsOptions?: Object; + /** Set to 'always' to always attempt connection upgrades via STARTTLS, 'required' only if upgrading is required, or 'never' to never attempt upgrading. Default: 'never' */ + autotls?: string; + /** Number of milliseconds to wait for a connection to be established. Default: 10000 */ + connTimeout?: number; + /** Number of milliseconds to wait to be authenticated after a connection has been established. Default: 5000 */ + authTimeout?: number; + /** Configures the keepalive mechanism. Set to true to enable keepalive with defaults or set to object to enable and configure keepalive behavior: Default: true */ + keepalive?: any; /* boolean|KeepAlive */ + /** If set, the function will be called with one argument, a string containing some debug info Default: (no debug output) */ + debug?: Function; } - export interface KeepAlive { - interval?: number; // This is the interval (in milliseconds) at which NOOPs are sent and the interval at which idleInterval is checked. Default: 10000 - idleInterval?: number; // This is the interval (in milliseconds) at which an IDLE command (for servers that support IDLE) is re-sent. Default: 300000 (5 mins) - forceNoop?: boolean; // Set to true to force use of NOOP keepalive on servers also support IDLE. Default: false + /** This is the interval (in milliseconds) at which NOOPs are sent and the interval at which idleInterval is checked. Default: 10000 */ + interval?: number; + /** This is the interval (in milliseconds) at which an IDLE command (for servers that support IDLE) is re-sent. Default: 300000 (5 mins) */ + idleInterval?: number; + /** Set to true to force use of NOOP keepalive on servers also support IDLE. Default: false */ + forceNoop?: boolean; } // One of: @@ -41,69 +55,119 @@ declare module IMAP { // type MessageSource = string | string[] - - - export interface Box { - name: string; // The name of this mailbox. - readOnly?: boolean; // True if this mailbox was opened in read-only mode. (Only available with openBox() calls) - newKeywords: boolean; //True if new keywords can be added to messages in this mailbox. - uidvalidity: number; // A 32-bit number that can be used to determine if UIDs in this mailbox have changed since the last time this mailbox was opened. - uidnext: number; // The uid that will be assigned to the next message that arrives at this mailbox. - flags: string[]; // array - A list of system-defined flags applicable for this mailbox. Flags in this list but not in permFlags may be stored for the current session only. Additional server implementation-specific flags may also be available. - permFlags: string[]; // A list of flags that can be permanently added/removed to/from messages in this mailbox. - persistentUIDs: boolean; // Whether or not this mailbox has persistent UIDs. This should almost always be true for modern mailboxes and should only be false for legacy mail stores where supporting persistent UIDs was not technically feasible. - messages: { //Contains various message counts for this mailbox: - total: number; // Total number of messages in this mailbox. - new: number; // Number of messages in this mailbox having the Recent flag (this IMAP session is the first to see these messages). - unseen: number; // (Only available with status() calls) Number of messages in this mailbox not having the Seen flag (marked as not having been read). + /** The name of this mailbox. */ + name: string; + /** True if this mailbox was opened in read-only mode. (Only available with openBox() calls) */ + readOnly?: boolean; + /** True if new keywords can be added to messages in this mailbox. */ + newKeywords: boolean; + /** A 32-bit number that can be used to determine if UIDs in this mailbox have changed since the last time this mailbox was opened. */ + uidvalidity: number; + /** The uid that will be assigned to the next message that arrives at this mailbox. */ + uidnext: number; + /** array - A list of system-defined flags applicable for this mailbox. Flags in this list but not in permFlags may be stored for the current session only. Additional server implementation-specific flags may also be available. */ + flags: string[]; + /** A list of flags that can be permanently added/removed to/from messages in this mailbox. */ + permFlags: string[]; + /** Whether or not this mailbox has persistent UIDs. This should almost always be true for modern mailboxes and should only be false for legacy mail stores where supporting persistent UIDs was not technically feasible. */ + persistentUIDs: boolean; + /** Contains various message counts for this mailbox: */ + messages: { + /** Total number of messages in this mailbox. */ + total: number; + /** Number of messages in this mailbox having the Recent flag (this IMAP session is the first to see these messages). */ + new: number; + /** (Only available with status() calls) Number of messages in this mailbox not having the Seen flag (marked as not having been read). */ + unseen: number; }; } - - // Given in a 'message' event from ImapFetch - export interface ImapMessage extends NodeJS.EventEmitter { + export interface ImapMessageBodyInfo { + /** The specifier for this body (e.g. 'TEXT', 'HEADER.FIELDS (TO FROM SUBJECT)', etc). */ + which: string; + /** The size of this body in bytes. */ + size: number; } + export interface ImapMessageAttributes { + /** A 32-bit ID that uniquely identifies this message within its mailbox. */ + uid: number; + /** A list of flags currently set on this message. */ + flags: string[]; + /** The internal server date for the message. */ + date: Date; + /** The message's body structure (only set if requested with fetch()). */ + struct?: any[]; + /** The RFC822 message size (only set if requested with fetch()). */ + size?: number; + } + + /** Given in a 'message' event from ImapFetch */ + export interface ImapMessage extends NodeJS.EventEmitter { + on(event: string, listener: Function): this; + on(event: 'body', listener: (stream: NodeJS.ReadableStream, info: ImapMessageBodyInfo) => void): this; + on(event: 'attributes', listener: (attrs: ImapMessageAttributes) => void): this; + on(event: 'end', listener: () => void): this; + } export interface FetchOptions { - markSeen?: boolean; // Mark message(s) as read when fetched. Default: false - struct?: boolean; // Fetch the message structure. Default: false - envelope?: boolean; // Fetch the message envelope. Default: false - size?: boolean; // Fetch the RFC822 size. Default: false - modifiers?: Object; // Fetch modifiers defined by IMAP extensions. Default: (none) - bodies?: any; /* string|string[] */ // A string or Array of strings containing the body part section to fetch. Default: (none) Example sections: + /** Mark message(s) as read when fetched. Default: false */ + markSeen?: boolean; + /** Fetch the message structure. Default: false */ + struct?: boolean; + /** Fetch the message envelope. Default: false */ + envelope?: boolean; + /** Fetch the RFC822 size. Default: false */ + size?: boolean; + /** Fetch modifiers defined by IMAP extensions. Default: (none) */ + modifiers?: Object; + /** A string or Array of strings containing the body part section to fetch. Default: (none) Example sections: */ + bodies?: string | string[]; } - // Returned from fetch() + /** Returned from fetch() */ export interface ImapFetch extends NodeJS.EventEmitter { + on(event: string, listener: Function): this; + on(event: 'message', listener: (message: ImapMessage, seqno: number) => void): this; + on(event: 'error', listener: (error: Error) => void): this; + once(event: string, listener: Function): this; + once(event: 'error', listener: (error: Error) => void): this; } - + export interface Folder { - attribs: string[]; - delimiter: string; - children: Folder[]; - parent: Folder; + /** mailbox attributes. An attribute of 'NOSELECT' indicates the mailbox cannot be opened */ + attribs: string[]; + /** hierarchy delimiter for accessing this mailbox's direct children. */ + delimiter: string; + /** an object containing another structure similar in format to this top level, otherwise null if no children */ + children: MailBoxes; + /** pointer to parent mailbox, null if at the top level */ + parent: Folder; } export interface MailBoxes { - [name: string] : Folder; + [name: string]: Folder; } export interface AppendOptions { - mailbox?: string; // The name of the mailbox to append the message to. Default: the currently open mailbox - flags?: any; /* string|string[] */ // A single flag (e.g. 'Seen') or an array of flags (e.g. ['Seen', 'Flagged']) to append to the message. Default: (no flags) - date?: Date; // What to use for message arrival date/time. Default: (current date/time) + /** The name of the mailbox to append the message to. Default: the currently open mailbox */ + mailbox?: string; + /** A single flag (e.g. 'Seen') or an array of flags (e.g. ['Seen', 'Flagged']) to append to the message. Default: (no flags) */ + flags?: any; /* string|string[] */ + /** What to use for message arrival date/time. Default: (current date/time) */ + date?: Date; } + export interface MessageFunctions { + /** Searches the currently open mailbox for messages using given criteria. criteria is a list describing what you want to find. For criteria types that require arguments, use an array instead of just the string criteria type name (e.g. ['FROM', 'foo@bar.com']). Prefix criteria types with an "!" to negate. + + The following message flags are valid types that do not have arguments: - // search() criteria - /** - // The following message flags are valid types that do not have arguments: ALL: void; // All messages. ANSWERED: void; // Messages with the Answered flag set. DELETED: void; // Messages with the Deleted flag set. @@ -118,8 +182,8 @@ declare module IMAP { UNDRAFT: void; // Messages that do not have the Draft flag set. UNFLAGGED: void; // Messages that do not have the Flagged flag set. UNSEEN: void; // Messages that do not have the Seen flag set. - - // The following are valid types that require string value(s): + + The following are valid types that require string value(s): BCC: any; // Messages that contain the specified string in the BCC field. CC: any; // Messages that contain the specified string in the CC field. @@ -130,143 +194,149 @@ declare module IMAP { TEXT: any; // Messages that contain the specified string in the header OR the message body. KEYWORD: any; // Messages with the specified keyword set. HEADER: any; // Requires two string values, with the first being the header name and the second being the value to search for. If this second string is empty, all messages that contain the given header name will be returned. - // The following are valid types that require a string parseable by JavaScripts Date object OR a Date instance: + + The following are valid types that require a string parseable by JavaScripts Date object OR a Date instance: + BEFORE: any; // Messages whose internal date (disregarding time and timezone) is earlier than the specified date. ON: any; // Messages whose internal date (disregarding time and timezone) is within the specified date. SINCE: any; // Messages whose internal date (disregarding time and timezone) is within or later than the specified date. SENTBEFORE: any; // Messages whose Date header (disregarding time and timezone) is earlier than the specified date. SENTON: any; // Messages whose Date header (disregarding time and timezone) is within the specified date. SENTSINCE: any; // Messages whose Date header (disregarding time and timezone) is within or later than the specified date. - //The following are valid types that require one Integer value: + + The following are valid types that require one Integer value: + LARGER: number; // Messages with a size larger than the specified number of bytes. SMALLER: number; // Messages with a size smaller than the specified number of bytes. - // The following are valid criterion that require one or more Integer values: + + The following are valid criterion that require one or more Integer values: + UID: any; // Messages with UIDs corresponding to the specified UID set. Ranges are permitted (e.g. '2504:2507' or '*' or '2504:*'). - */ - - - export interface MessageFunctions { - // Searches the currently open mailbox for messages using given criteria. criteria is a list describing what you want to find. For criteria types that require arguments, use an array instead of just the string criteria type name (e.g. ['FROM', 'foo@bar.com']). Prefix criteria types with an "!" to negate. - search(criteria : any[], callback : (error : Error, uids : string[]) => void) : void; - // Fetches message(s) in the currently open mailbox. - fetch(source : any /* MessageSource */, options : FetchOptions) : ImapFetch; - // Copies message(s) in the currently open mailbox to another mailbox. - copy(source : any /* MessageSource */, mailboxName : string, callback : (error : Error) => void) : void; - // Moves message(s) in the currently open mailbox to another mailbox. Note: The message(s) in the destination mailbox will have a new message UID. - move(source : any /* MessageSource */, mailboxName : string, callback : (error : Error) => void) : void; - // Adds flag(s) to message(s). - addFlags(source : any /* MessageSource */, flags : any, callback : (error : Error) => void) : void; - // Removes flag(s) from message(s). - delFlags(source : any /* MessageSource */, flags : any, callback : (error : Error) => void) : void; - // Sets the flag(s) for message(s). - setFlags(source : any /* MessageSource */, flags : any, callback : (error : Error) => void) : void; - // Adds keyword(s) to message(s). keywords is either a single keyword or an array of keywords. - addKeywords(source : any /* MessageSource */, keywords : any /* string|string[] */, callback : (error : Error) => void) : void; - //Removes keyword(s) from message(s). keywords is either a single keyword or an array of keywords. - delKeywords(source : any /* MessageSource */, keywords : any /* string|string[] */, callback : (error : Error) => void) : void; - // Sets keyword(s) for message(s). keywords is either a single keyword or an array of keywords. - setKeywords(source : any /* MessageSource */, keywords : any /* string|string[] */, callback : (error : Error) => void) : void; - // Checks if the server supports the specified capability. - serverSupports(capability : string) : boolean; + */ + search(criteria: any[], callback: (error: Error, uids: number[]) => void): void; + /** Fetches message(s) in the currently open mailbox; source can be a single message identifier, a message identifier range (e.g. '2504:2507' or '*' or '2504:*'), an array of message identifiers, or an array of message identifier ranges. */ + fetch(source: any /* MessageSource */, options: FetchOptions): ImapFetch; + /** Copies message(s) in the currently open mailbox to another mailbox. */ + copy(source: any /* MessageSource */, mailboxName: string, callback: (error: Error) => void): void; + /** Moves message(s) in the currently open mailbox to another mailbox. Note: The message(s) in the destination mailbox will have a new message UID. */ + move(source: any /* MessageSource */, mailboxName: string, callback: (error: Error) => void): void; + /** Adds flag(s) to message(s). */ + addFlags(source: any /* MessageSource */, flags: any, callback: (error: Error) => void): void; + /** Removes flag(s) from message(s). */ + delFlags(source: any /* MessageSource */, flags: any, callback: (error: Error) => void): void; + /** Sets the flag(s) for message(s). */ + setFlags(source: any /* MessageSource */, flags: any, callback: (error: Error) => void): void; + /** Adds keyword(s) to message(s). keywords is either a single keyword or an array of keywords. */ + addKeywords(source: any /* MessageSource */, keywords: any /* string|string[] */, callback: (error: Error) => void): void; + /** Removes keyword(s) from message(s). keywords is either a single keyword or an array of keywords. */ + delKeywords(source: any /* MessageSource */, keywords: any /* string|string[] */, callback: (error: Error) => void): void; + /** Sets keyword(s) for message(s). keywords is either a single keyword or an array of keywords. */ + setKeywords(source: any /* MessageSource */, keywords: any /* string|string[] */, callback: (error: Error) => void): void; + /** Checks if the server supports the specified capability. */ + serverSupports(capability: string): boolean; } - - - export class Connection implements NodeJS.EventEmitter, MessageFunctions { /** @constructor */ - constructor(config : Config); - + constructor(config: Config); + // from NodeJS.EventEmitter - addListener(event: string, listener: Function): NodeJS.EventEmitter; - on(event: string, listener: Function): NodeJS.EventEmitter; - once(event: string, listener: Function): NodeJS.EventEmitter; - removeListener(event: string, listener: Function): NodeJS.EventEmitter; - removeAllListeners(event?: string): NodeJS.EventEmitter; - setMaxListeners(n: number): void; + addListener(event: string, listener: Function): this; + on(event: string, listener: Function): this; + once(event: string, listener: Function): this; + removeListener(event: string, listener: Function): this; + removeAllListeners(event?: string): this; + setMaxListeners(n: number): this; + getMaxListeners(): number; listeners(event: string): Function[]; emit(event: string, ...args: any[]): boolean; - + listenerCount(type: string): number; + // from MessageFunctions - // Searches the currently open mailbox for messages using given criteria. criteria is a list describing what you want to find. For criteria types that require arguments, use an array instead of just the string criteria type name (e.g. ['FROM', 'foo@bar.com']). Prefix criteria types with an "!" to negate. - search(criteria : any[], callback : (error : Error, uids : string[]) => void) : void; - // Fetches message(s) in the currently open mailbox. - fetch(source : any /* MessageSource */, options : FetchOptions) : ImapFetch; - // Copies message(s) in the currently open mailbox to another mailbox. - copy(source : any /* MessageSource */, mailboxName : string, callback : (error : Error) => void) : void; - // Moves message(s) in the currently open mailbox to another mailbox. Note: The message(s) in the destination mailbox will have a new message UID. - move(source : any /* MessageSource */, mailboxName : string, callback : (error : Error) => void) : void; - // Adds flag(s) to message(s). - addFlags(source : any /* MessageSource */, flags : any, callback : (error : Error) => void) : void; - // Removes flag(s) from message(s). - delFlags(source : any /* MessageSource */, flags : any, callback : (error : Error) => void) : void; - // Sets the flag(s) for message(s). - setFlags(source : any /* MessageSource */, flags : any, callback : (error : Error) => void) : void; - // Adds keyword(s) to message(s). keywords is either a single keyword or an array of keywords. - addKeywords(source : any /* MessageSource */, keywords : any /* string|string[] */, callback : (error : Error) => void) : void; - //Removes keyword(s) from message(s). keywords is either a single keyword or an array of keywords. - delKeywords(source : any /* MessageSource */, keywords : any /* string|string[] */, callback : (error : Error) => void) : void; - // Sets keyword(s) for message(s). keywords is either a single keyword or an array of keywords. - setKeywords(source : any /* MessageSource */, keywords : any /* string|string[] */, callback : (error : Error) => void) : void; - // Checks if the server supports the specified capability. - serverSupports(capability : string) : boolean; - - // Parses a raw header and returns an object keyed on header fields and the values are Arrays of header field values. Set disableAutoDecode to true to disable automatic decoding of MIME encoded-words that may exist in header field values. - static parseHeader(rawHeader: string, disableAutoDecode? : boolean) : any; - - state: string; // The current state of the connection (e.g. 'disconnected', 'connected', 'authenticated'). - delimiter: string; // The (top-level) mailbox hierarchy delimiter. If the server does not support mailbox hierarchies and only a flat list, this value will be falsey. - namespaces: { // Contains information about each namespace type (if supported by the server) with the following properties: - personal: any[]; // Mailboxes that belong to the logged in user. - other: any[]; // Mailboxes that belong to other users that the logged in user has access to. - shared: any[]; // Mailboxes that are accessible by any logged in user. + /** Searches the currently open mailbox for messages using given criteria. criteria is a list describing what you want to find. For criteria types that require arguments, use an array instead of just the string criteria type name (e.g. ['FROM', 'foo@bar.com']). Prefix criteria types with an "!" to negate. */ + search(criteria: any[], callback: (error: Error, uids: number[]) => void): void; + /** Fetches message(s) in the currently open mailbox. */ + fetch(source: any /* MessageSource */, options: FetchOptions): ImapFetch; + /** Copies message(s) in the currently open mailbox to another mailbox. */ + copy(source: any /* MessageSource */, mailboxName: string, callback: (error: Error) => void): void; + /** Moves message(s) in the currently open mailbox to another mailbox. Note: The message(s) in the destination mailbox will have a new message UID. */ + move(source: any /* MessageSource */, mailboxName: string, callback: (error: Error) => void): void; + /** Adds flag(s) to message(s). */ + addFlags(source: any /* MessageSource */, flags: any, callback: (error: Error) => void): void; + /** Removes flag(s) from message(s). */ + delFlags(source: any /* MessageSource */, flags: any, callback: (error: Error) => void): void; + /** Sets the flag(s) for message(s). */ + setFlags(source: any /* MessageSource */, flags: any, callback: (error: Error) => void): void; + /** Adds keyword(s) to message(s). keywords is either a single keyword or an array of keywords. */ + addKeywords(source: any /* MessageSource */, keywords: any /* string|string[] */, callback: (error: Error) => void): void; + /** Removes keyword(s) from message(s). keywords is either a single keyword or an array of keywords. */ + delKeywords(source: any /* MessageSource */, keywords: any /* string|string[] */, callback: (error: Error) => void): void; + /** Sets keyword(s) for message(s). keywords is either a single keyword or an array of keywords. */ + setKeywords(source: any /* MessageSource */, keywords: any /* string|string[] */, callback: (error: Error) => void): void; + /** Checks if the server supports the specified capability. */ + serverSupports(capability: string): boolean; + + /** Parses a raw header and returns an object keyed on header fields and the values are Arrays of header field values. Set disableAutoDecode to true to disable automatic decoding of MIME encoded-words that may exist in header field values. */ + static parseHeader(rawHeader: string, disableAutoDecode?: boolean): {[index: string]: string[]}; + + /** The current state of the connection (e.g. 'disconnected', 'connected', 'authenticated'). */ + state: string; + /** The (top-level) mailbox hierarchy delimiter. If the server does not support mailbox hierarchies and only a flat list, this value will be falsey. */ + delimiter: string; + /** Contains information about each namespace type (if supported by the server) with the following properties: */ + namespaces: { + /** Mailboxes that belong to the logged in user. */ + personal: any[]; + /** Mailboxes that belong to other users that the logged in user has access to. */ + other: any[]; + /** Mailboxes that are accessible by any logged in user. */ + shared: any[]; }; + /** + seq exposes the search() ... serverSupports() set of commands, but returns sequence number(s) instead of UIDs. + */ seq: MessageFunctions; /** Attempts to connect and authenticate with the IMAP server. */ - connect() : void; + connect(): void; /** Closes the connection to the server after all requests in the queue have been sent. */ - end() : void; + end(): void; /** Immediately destroys the connection to the server. */ - destroy() : void; + destroy(): void; /** Opens a specific mailbox that exists on the server. mailboxName should include any necessary prefix/path. modifiers is used by IMAP extensions. */ - openBox(mailboxName : string, callback : (error : Error, mailbox: Box) => void) : void; - openBox(mailboxName : string, openReadOnly : boolean, callback : (error : Error, mailbox: Box) => void) : void; - openBox(mailboxName : string, openReadOnly : boolean, modifiers : Object, callback : (error : Error, mailbox: Box) => void) : void; + openBox(mailboxName: string, callback: (error: Error, mailbox: Box) => void): void; + openBox(mailboxName: string, openReadOnly: boolean, callback: (error: Error, mailbox: Box) => void): void; + openBox(mailboxName: string, openReadOnly: boolean, modifiers: Object, callback: (error: Error, mailbox: Box) => void): void; /** Closes the currently open mailbox. If autoExpunge is true, any messages marked as Deleted in the currently open mailbox will be removed if the mailbox was NOT opened in read-only mode. If autoExpunge is false, you disconnect, or you open another mailbox, messages marked as Deleted will NOT be removed from the currently open mailbox. */ - closeBox(callback : (error : Error) => void) : void; - closeBox(autoExpunge : boolean, callback : (error : Error) => void) : void; + closeBox(callback: (error: Error) => void): void; + closeBox(autoExpunge: boolean, callback: (error: Error) => void): void; /** Creates a new mailbox on the server. mailboxName should include any necessary prefix/path. */ - addBox(mailboxName : string, callback : (error : Error) => void) : void; + addBox(mailboxName: string, callback: (error: Error) => void): void; /** Removes a specific mailbox that exists on the server. mailboxName should including any necessary prefix/path. */ - delBox(mailboxName : string, callback : (error : Error, uids : string[]) => void) : void; + delBox(mailboxName: string, callback: (error: Error) => void): void; /** Renames a specific mailbox that exists on the server. Both oldMailboxName and newMailboxName should include any necessary prefix/path. Note: Renaming the 'INBOX' mailbox will instead cause all messages in 'INBOX' to be moved to the new mailbox. */ - renameBox(oldMailboxName : string, newMailboxName : string, callback : (error : Error, mailbox: Box) => void) : void; + renameBox(oldMailboxName: string, newMailboxName: string, callback: (error: Error, mailbox: Box) => void): void; /** Subscribes to a specific mailbox that exists on the server. mailboxName should include any necessary prefix/path. */ - subscribeBox(mailboxName : string, callback : (error : Error) => void) : void; + subscribeBox(mailboxName: string, callback: (error: Error) => void): void; /** Unsubscribes from a specific mailbox that exists on the server. mailboxName should include any necessary prefix/path. */ - unsubscribeBox(mailboxName : string, callback : (error : Error) => void) : void; + unsubscribeBox(mailboxName: string, callback: (error: Error) => void): void; /** Fetches information about a mailbox other than the one currently open. Note: There is no guarantee that this will be a fast operation on the server. Also, do not call this on the currently open mailbox. */ - status(mailboxName : string, callback : (error : Error, mailbox: Box) => void) : void; + status(mailboxName: string, callback: (error: Error, mailbox: Box) => void): void; /** Obtains the full list of mailboxes. If nsPrefix is not specified, the main personal namespace is used. */ - getBoxes(callback : (error : Error, mailboxes: MailBoxes) => void) : void; - getBoxes(nsPrefix : string, callback : (error : Error, mailboxes: MailBoxes) => void) : void; + getBoxes(callback: (error: Error, mailboxes: MailBoxes) => void): void; + getBoxes(nsPrefix: string, callback: (error: Error, mailboxes: MailBoxes) => void): void; /** Obtains the full list of subscribed mailboxes. If nsPrefix is not specified, the main personal namespace is used. */ - getSubscribedBoxes(callback : (error : Error, mailboxes: MailBoxes) => void) : void; - getSubscribedBoxes(nsPrefix : string, callback : (error : Error, mailboxes: MailBoxes) => void) : void; + getSubscribedBoxes(callback: (error: Error, mailboxes: MailBoxes) => void): void; + getSubscribedBoxes(nsPrefix: string, callback: (error: Error, mailboxes: MailBoxes) => void): void; /** Permanently removes all messages flagged as Deleted in the currently open mailbox. If the server supports the 'UIDPLUS' capability, uids can be supplied to only remove messages that both have their uid in uids and have the \Deleted flag set. Note: At least on Gmail, performing this operation with any currently open mailbox that is not the Spam or Trash mailbox will merely archive any messages marked as Deleted (by moving them to the 'All Mail' mailbox). */ - expunge(callback : (error : Error) => void) : void; - expunge(uids : any /* MessageSource */, callback : (error : Error) => void) : void; - // Appends a message to selected mailbox. msgData is a string or Buffer containing an RFC-822 compatible MIME message. Valid options properties are: - append(msgData : any, callback : (error : Error) => void) : void; - append(msgData : any, options : AppendOptions, callback : (error : Error) => void) : void; + expunge(callback: (error: Error) => void): void; + expunge(uids: any /* MessageSource */, callback: (error: Error) => void): void; + /** Appends a message to selected mailbox. msgData is a string or Buffer containing an RFC-822 compatible MIME message. Valid options properties are: */ + append(msgData: any, callback: (error: Error) => void): void; + append(msgData: any, options: AppendOptions, callback: (error: Error) => void): void; } - } - declare module "imap" { - var out: typeof IMAP.Connection; - export = out; } 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/inline-css/inline-css-tests.ts b/inline-css/inline-css-tests.ts new file mode 100644 index 000000000..e633e9e0a --- /dev/null +++ b/inline-css/inline-css-tests.ts @@ -0,0 +1,35 @@ +/// + +import inlineCss = require('inline-css'); + +var str: string; +var bool: boolean; + +var options:inlineCss.Options; + +str = options.url; +str = options.extraCss; + +bool = options.applyStyleTags; +bool = options.applyLinkTags; +bool = options.removeStyleTags; +bool = options.removeLinkTags; +bool = options.preserveMediaQueries; +bool = options.applyWidthAttributes; +bool = options.applyTableAttributes; + +options = { + url: str, + extraCss: str, + applyStyleTags: bool, + applyLinkTags: bool, + removeStyleTags: bool, + removeLinkTags: bool, + preserveMediaQueries: bool, + applyWidthAttributes: bool, + applyTableAttributes: bool +}; + +inlineCss(str, options).then((value:string) => { + +}); diff --git a/inline-css/inline-css.d.ts b/inline-css/inline-css.d.ts new file mode 100644 index 000000000..c0cd640ac --- /dev/null +++ b/inline-css/inline-css.d.ts @@ -0,0 +1,28 @@ +// Type definitions for inline-css +// Project: https://github.com/jonkemp/inline-css +// Definitions by: Philip Spain +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module 'inline-css' { + import Promise = require('bluebird'); + + module InlineCss { + export interface Options { + url:string; + extraCss?:string; + applyStyleTags?:boolean; + applyLinkTags?:boolean; + removeStyleTags?:boolean; + removeLinkTags?:boolean; + preserveMediaQueries?:boolean; + applyWidthAttributes?:boolean; + applyTableAttributes?:boolean; + } + } + + function InlineCss(html:string, options:InlineCss.Options):Promise; + + export = InlineCss; +} diff --git a/intro.js/intro.js-tests.ts b/intro.js/intro.js-tests.ts new file mode 100644 index 000000000..0ec5938f5 --- /dev/null +++ b/intro.js/intro.js-tests.ts @@ -0,0 +1,56 @@ +/// + +var intro = introJs(); + +intro.setOption('doneLabel', 'Next page'); +intro.setOption('overlayOpacity', 50); +intro.setOption('showProgress', true); +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..6763124ba --- /dev/null +++ b/intro.js/intro.js.d.ts @@ -0,0 +1,63 @@ +// Type definitions for intro.js 1.1.1 +// Project: https://github.com/usablica/intro.js +// Definitions by: Maxime Fabre +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module IntroJs { + interface Step { + intro: string; + element?: string|HTMLElement|Element; + position?: string; + } + + 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|boolean): 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/invariant/invariant-tests.ts b/invariant/invariant-tests.ts new file mode 100644 index 000000000..06a4e9b4e --- /dev/null +++ b/invariant/invariant-tests.ts @@ -0,0 +1,22 @@ +/// + +// will throw in dev mode (process.env.NODE_ENV !== 'production') +invariant(true); + +// will pass in production (process.env.NODE_ENV === 'production') +invariant(true); + +// will pass in dev mode and production mode +invariant(true, 'Error, error, read all about it'); + +// will throw in dev mode, and production mode +invariant(false, 'Some other error'); + +// will throw in dev mode, and production mode +invariant(0, 'Some other error'); + +// will throw in dev mode, and production mode +invariant('', 'Some other error'); + +// handles extra variables +invariant(true, 'Error, error, read all about it', 37, {}, 'hello'); diff --git a/invariant/invariant.d.ts b/invariant/invariant.d.ts new file mode 100644 index 000000000..6ca967c68 --- /dev/null +++ b/invariant/invariant.d.ts @@ -0,0 +1,17 @@ +// Type definitions for invariant 2.2.0 +// Project: https://github.com/zertosh/invariant +// Definitions by: MichaelBennett +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare let invariant:invariant.InvariantStatic; + +declare module "invariant" { + export = invariant; +} + +declare module invariant { + interface InvariantStatic { + (testValue:any, format?:string, ...extra:any[]):void; + } +} + diff --git a/ionic/ionic-tests.ts b/ionic/ionic-tests.ts index 45d8c2d66..8491fc13f 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"), {} @@ -143,6 +149,7 @@ class IonicTestController { ionicModalController.initialize(modalOptions); ionicModalController.show().then(() => console.log("shown modal")) ionicModalController.hide().then(() => console.log("hid modal")) + ionicModalController.remove().then(() => console.log("removed modal")) var isShown: boolean = ionicModalController.isShown(); this.$ionicModal.fromTemplateUrl("templateUrl", modalOptions) @@ -193,8 +200,9 @@ class IonicTestController { }; var ionicPopoverController: ionic.popover.IonicPopoverController = this.$ionicPopover.fromTemplate("template", popoverOptions); ionicPopoverController.initialize(popoverOptions); - ionicPopoverController.show(angular.element("body")).then(() => console.log("shown popover")) - ionicPopoverController.hide().then(() => console.log("hid popover")) + ionicPopoverController.show(angular.element("body")).then(() => console.log("shown popover")); + ionicPopoverController.hide().then(() => console.log("hid popover")); + ionicPopoverController.remove().then(() => console.log("removed popover")); var isShown: boolean = ionicPopoverController.isShown(); this.$ionicPopover.fromTemplateUrl("templateUrl", popoverOptions) @@ -226,7 +234,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 +243,7 @@ class IonicTestController { cssClass: "cssClass", template: "template", templateUrl: "templateUrl", - okText: "OK", + okText: "OK", okType: "okType" }).close(); @@ -245,20 +253,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 +276,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 +289,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..." @@ -354,11 +362,48 @@ class IonicTestController { this.$ionicTabsDelegate.select(1); var selectedIndex: number = this.$ionicTabsDelegate.selectedIndex(); var ionicTabsDelegate: ionic.tabs.IonicTabsDelegate = this.$ionicTabsDelegate.$getByHandle("handle"); + this.$ionicTabsDelegate.showBar(true); + var isBarShown: boolean = this.$ionicTabsDelegate.showBar(); } private testUtility(): void { 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..6cadd0f87 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; } @@ -40,7 +125,7 @@ declare module ionic { } module gestures { interface IonicGestureService { - on(eventType: string, callback: (e: any)=>any, $element: ng.IAugmentedJQuery, options: any): IonicGesture; + on(eventType: string, callback: (e: any)=>any, $element: angular.IAugmentedJQuery, options: any): IonicGesture; off(gesture: IonicGesture, eventType: string, callback: (e: any)=>any): void; } @@ -82,13 +167,14 @@ declare module ionic { module modal { interface IonicModalService { fromTemplate(templateString: string, options?: IonicModalOptions): IonicModalController; - fromTemplateUrl(templateUrl: string, options?: IonicModalOptions): ng.IPromise; + fromTemplateUrl(templateUrl: string, options?: IonicModalOptions): angular.IPromise; } interface IonicModalController { initialize(options: IonicModalOptions): void; - show(): ng.IPromise; - hide(): ng.IPromise; + show(): angular.IPromise; + hide(): angular.IPromise; + remove(): angular.IPromise; isShown(): boolean; } @@ -124,7 +210,7 @@ declare module ionic { goBack(backCount?: number): void; clearHistory(): void; - clearCache(): ng.IPromise; + clearCache(): angular.IPromise; nextViewOptions(options: IonicHistoryNextViewOptions): void; } interface IonicHistoryNextViewOptions { @@ -139,19 +225,20 @@ declare module ionic { offHardwareBackButton(callback: Function): void; registerBackButtonAction(callback: Function, priority: number, actionId?: any): Function; on(type: string, callback: Function): Function; - ready(callback?: Function): ng.IPromise; + ready(callback?: Function): angular.IPromise; } } module popover { interface IonicPopoverService { fromTemplate(templateString: string, options: IonicPopoverOptions): IonicPopoverController; - fromTemplateUrl(templateUrl: string, options: IonicPopoverOptions): ng.IPromise; + fromTemplateUrl(templateUrl: string, options: IonicPopoverOptions): angular.IPromise; } interface IonicPopoverController { initialize(options: IonicPopoverOptions): void; - show($event?: any): ng.IPromise; - hide(): ng.IPromise; + show($event?: any): angular.IPromise; + hide(): angular.IPromise; isShown(): boolean; + remove(): angular.IPromise; } interface IonicPopoverOptions { scope?: any; @@ -164,11 +251,14 @@ 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 IonicPopupPromise extends ng.IPromise { + interface IonicPopupConfirmPromise extends angular.IPromise { + close(value?: boolean): void; + } + interface IonicPopupPromise extends angular.IPromise { close(value?: any): any; } interface IonicPopupBaseOptions { @@ -255,6 +345,7 @@ declare module ionic { select(index: number): void; selectedIndex(): number; $getByHandle(handle: string): IonicTabsDelegate; + showBar(show?: boolean): boolean; } } module utility { diff --git a/istanbul/istanbul-tests.ts b/istanbul/istanbul-tests.ts new file mode 100644 index 000000000..b283e2dcc --- /dev/null +++ b/istanbul/istanbul-tests.ts @@ -0,0 +1,27 @@ +/// + +import * as istanbul from 'istanbul'; + +// Instrument code +var instrumenter = new istanbul.Instrumenter(); + +var generatedCode = instrumenter.instrumentSync('function meaningOfLife() { return 42; }', + 'filename.js'); + + +// Generate reports given a bunch of coverage JSON objects +var collector = new istanbul.Collector(), + reporter = new istanbul.Reporter(), + sync = false; + +var obj1 = {}, + obj2 = {}; + +collector.add(obj1); +collector.add(obj2); //etc. + +reporter.add('text'); +reporter.addAll([ 'lcov', 'clover' ]); +reporter.write(collector, sync, function () { + console.log('All reports generated'); +}); diff --git a/istanbul/istanbul.d.ts b/istanbul/istanbul.d.ts new file mode 100644 index 000000000..026ad8b00 --- /dev/null +++ b/istanbul/istanbul.d.ts @@ -0,0 +1,73 @@ +// Type definitions for Istanbul v0.4.0 +// Project: https://github.com/gotwarlost/istanbul +// Definitions by: Tanguy Krotoff +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module 'istanbul' { + namespace istanbul { + interface Istanbul { + new (options?: any): Istanbul; + Collector: Collector; + config: Config; + ContentWriter: ContentWriter; + FileWriter: FileWriter; + hook: Hook; + Instrumenter: Instrumenter; + Report: Report; + Reporter: Reporter; + Store: Store; + utils: ObjectUtils; + VERSION: string; + Writer: Writer; + } + + interface Collector { + new (options?: any): Collector; + add(coverage: any, testName?: string): void; + } + + interface Config { + } + + interface ContentWriter { + } + + interface FileWriter { + } + + interface Hook { + } + + interface Instrumenter { + new (options?: any): Instrumenter; + instrumentSync(code: string, filename: string): string; + } + + interface Report { + } + + interface Configuration { + new (obj: any, overrides: any): Configuration; + } + + interface Reporter { + new (cfg?: Configuration, dir?: string): Reporter; + add(fmt: string): void; + addAll(fmts: Array): void; + write(collector: Collector, sync: boolean, callback: Function): void; + } + + interface Store { + } + + interface ObjectUtils { + } + + interface Writer { + } + } + + var istanbul: istanbul.Istanbul; + + export = istanbul; +} diff --git a/jade/jade-tests.ts b/jade/jade-tests.ts index 8a2b6b48d..6b4774021 100644 --- a/jade/jade-tests.ts +++ b/jade/jade-tests.ts @@ -1,10 +1,10 @@ /// -import jade from 'jade'; +import * as jade from 'jade'; jade.compile("b")(); jade.compileFile("foo.jade", {})(); jade.compileClient("a")({ a: 1 }); jade.compileClientWithDependenciesTracked("test").body(); jade.render("h1",{}); -jade.renderFile("foo.jade"); \ No newline at end of file +jade.renderFile("foo.jade"); diff --git a/jade/jade.d.ts b/jade/jade.d.ts index 9615fa8c8..0764006e5 100644 --- a/jade/jade.d.ts +++ b/jade/jade.d.ts @@ -4,16 +4,13 @@ // Definitions: https://github.com/borisyankov/DefinitelyTyped declare module 'jade' { - module jade { - function compile(template: string, options?: any): (locals?: any) => string; - function compileFile(path: string, options?: any): (locals?: any) => string; - function compileClient(template: string, options?: any): (locals?: any) => string; - function compileClientWithDependenciesTracked(template: string, options?: any): { - body: (locals?: any) => string; - dependencies: string[]; - }; - function render(template: string, options?: any): string; - function renderFile(path: string, options?: any): string; - } - export default jade; + export function compile(template: string, options?: any): (locals?: any) => string; + export function compileFile(path: string, options?: any): (locals?: any) => string; + export function compileClient(template: string, options?: any): (locals?: any) => string; + export function compileClientWithDependenciesTracked(template: string, options?: any): { + body: (locals?: any) => string; + dependencies: string[]; + }; + export function render(template: string, options?: any): string; + export function renderFile(path: string, options?: any): string; } diff --git a/jake/jake.d.ts b/jake/jake.d.ts index 1812b818b..84d5c5079 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; } /** @@ -216,9 +231,11 @@ declare module jake{ once(event: string, listener: Function): NodeJS.EventEmitter; removeListener(event: string, listener: Function): NodeJS.EventEmitter; removeAllListeners(event?: string): NodeJS.EventEmitter; - setMaxListeners(n: number): void; + setMaxListeners(n: number): NodeJS.EventEmitter; + getMaxListeners(): number; listeners(event: string): Function[]; emit(event: string, ...args: any[]): boolean; + listenerCount(type: string): number; value: any; } 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-jquery/jasmine-jquery.d.ts b/jasmine-jquery/jasmine-jquery.d.ts index 903e3f7e2..0e1f2b82b 100644 --- a/jasmine-jquery/jasmine-jquery.d.ts +++ b/jasmine-jquery/jasmine-jquery.d.ts @@ -195,8 +195,8 @@ declare module jasmine { * // returns true * expect($('

      header

      ')).toContainHtml('
        ') */ - //toContainHtml(html: string): boolean; - + toContainHtml(html: string): boolean; + /** * Check if DOM element has the given Text. * @param text Accepts a string or regular expression @@ -213,8 +213,8 @@ declare module jasmine { * // returns true * expect($('

          header

          ')).toContainText('header') */ - //toContainText(text: string): boolean; - + toContainText(text: string): boolean; + /** * Check if DOM element has the given value. * This can only be applied for element on with jQuery val() can be called. 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-node/jasmine-node-tests.ts b/jasmine-node/jasmine-node-tests.ts new file mode 100644 index 000000000..2ec424da4 --- /dev/null +++ b/jasmine-node/jasmine-node-tests.ts @@ -0,0 +1,31 @@ +// Type definitions for jasmine-node v1.14.5 +// Project: https://github.com/mhevery/jasmine-node +// Definitions by: Sven Reglitzki +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +it("should have a timeout parameter", () => {}, 1000); +it("should have an optional timeout parameter", () => {}); + +import jasmine = require("jasmine-node"); + +jasmine.loadHelpersInFolder("root", /\.helper\.ts/); + +jasmine.executeSpecsInFolder({ + specFolders: [], + onComplete: (runner) => {console.log(runner.results().failedCount)}, + isVerbose: true, + showColors: true, + teamcity: false, + useRequireJs: false, + regExpSpec: /\.spec\.ts/, + junitreport: { + report: false, + savePath : "./reports/", + useDotNotation: true, + consolidate: true + }, + includeStackTrace: true, + growl: false +}); diff --git a/jasmine-node/jasmine-node.d.ts b/jasmine-node/jasmine-node.d.ts new file mode 100644 index 000000000..aa06eb920 --- /dev/null +++ b/jasmine-node/jasmine-node.d.ts @@ -0,0 +1,37 @@ +// Type definitions for jasmine-node v1.14.5 +// Project: https://github.com/mhevery/jasmine-node +// Definitions by: Sven Reglitzki +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare function it(expectation:string, assertion:(done:(err?:any) => void) => void, timeout?:number):void; + +declare module "jasmine-node" { + interface ExecuteSpecsOptions { + specFolders: string[], + onComplete?: (runner:jasmine.Runner) => void, + isVerbose?: boolean, + showColors?: boolean, + teamcity?: string | boolean, + useRequireJs?: boolean, + regExpSpec: RegExp, + junitreport?: { + report: boolean, + savePath: string, + useDotNotation: boolean, + consolidate: boolean + }, + includeStackTrace?: boolean, + growl?: boolean + } + + interface JasmineNode { + executeSpecsInFolder(options:ExecuteSpecsOptions): void; + loadHelpersInFolder(path:string, pattern:RegExp): void; + } + + var jasmine:JasmineNode; + + export = jasmine; +} 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..b17c68d8b 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 { @@ -281,7 +281,7 @@ declare module jasmine { toBe(expected: any, expectationFailOutput?: any): boolean; toEqual(expected: any, expectationFailOutput?: any): boolean; - toMatch(expected: any, expectationFailOutput?: any): boolean; + toMatch(expected: string | RegExp, expectationFailOutput?: any): boolean; toBeDefined(expectationFailOutput?: any): boolean; toBeUndefined(expectationFailOutput?: any): boolean; toBeNull(expectationFailOutput?: any): boolean; @@ -290,14 +290,14 @@ declare module jasmine { toBeFalsy(expectationFailOutput?: any): boolean; toHaveBeenCalled(): boolean; toHaveBeenCalledWith(...params: any[]): boolean; + toHaveBeenCalledTimes(expected: number): boolean; toContain(expected: any, expectationFailOutput?: any): boolean; - toBeLessThan(expected: any, expectationFailOutput?: any): boolean; - toBeGreaterThan(expected: any, expectationFailOutput?: any): boolean; - toBeCloseTo(expected: any, precision: any, expectationFailOutput?: any): boolean; - toContainHtml(expected: string): boolean; - toContainText(expected: string): boolean; + toBeLessThan(expected: number, expectationFailOutput?: any): boolean; + toBeGreaterThan(expected: number, expectationFailOutput?: any): boolean; + toBeCloseTo(expected: number, precision: any, expectationFailOutput?: any): boolean; toThrow(expected?: any): boolean; - toThrowError(expected?: any, message?: string): boolean; + toThrowError(message?: string | RegExp): boolean; + toThrowError(expected?: Error, message?: string | RegExp): boolean; not: Matchers; Any: Any; diff --git a/javascript-astar/javascript-astar-tests.ts b/javascript-astar/javascript-astar-tests.ts new file mode 100644 index 000000000..11e26fe03 --- /dev/null +++ b/javascript-astar/javascript-astar-tests.ts @@ -0,0 +1,26 @@ +/// + +function test_create() { + let graph: Graph = new Graph([]); +} + +function test_create_with_diagonals() { + let graph: Graph = new Graph([], {diagonal: true}); +} + +function test_get_node() { + let graph: Graph = new Graph([[5, 1, 0, 9], [0, 8, 7, 1]]); + let node: GridNode = graph.grid[0][1]; +} + +function test_search_returns_nodes() { + let nodes: Array = astar.search(new Graph([]), {x: 1, y: 1}, {x: 2, y: 2}); +} + +function test_search_alternative_heuristic() { + let nodes: Array = astar.search(new Graph([]), {x: 1, y: 1}, {x: 2, y: 2}, {heuristic: astar.heuristics.manhatten}); +} + +function test_search_or_closest() { + let nodes: Array = astar.search(new Graph([], {diagonal: true}), {x: 1, y: 1}, {x: 2, y: 2}, {closest: true}); +} diff --git a/javascript-astar/javascript-astar.d.ts b/javascript-astar/javascript-astar.d.ts new file mode 100644 index 000000000..c0748493c --- /dev/null +++ b/javascript-astar/javascript-astar.d.ts @@ -0,0 +1,37 @@ +// Type definitions for javascript-astar +// Project: https://github.com/bgrins/javascript-astar +// Definitions by: brian ridley +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare class Graph { + grid: Array>; + constructor(grid: Array>, options?: {diagonal?: boolean}); +} + +declare class GridNode { + x: number; + y: number; +} + +interface Heuristic { + (pos0: {x: number, y: number}, pos1: {x: number, y: number}): number; +} + +interface Heuristics { + manhatten: Heuristic; + diagonal: Heuristic; +} + +declare module astar { + function search( + graph: Graph, + start: {x: number, y: number}, + end: {x: number, y: number}, + options?: { + closest?: boolean, + heuristic?: Heuristic + } + ): Array; + var heuristics: Heuristics; +} + diff --git a/javascript-bignum/javascript-bignum-tests.ts b/javascript-bignum/javascript-bignum-tests.ts new file mode 100644 index 000000000..57555fcce --- /dev/null +++ b/javascript-bignum/javascript-bignum-tests.ts @@ -0,0 +1,21 @@ +/// +let m = SchemeNumber("1"); +let n = SchemeNumber(2); + +let sum: SchemeNumber = SchemeNumber.fn["+"](m, n); +sum = SchemeNumber.fn["+"](m, 1); +sum = SchemeNumber.fn["+"](m, "12"); +sum = SchemeNumber.fn["+"]("12", "25"); + +let floored: SchemeNumber = SchemeNumber.fn.floor(m); + +let str: string = floored.toString(16); +str = floored.toExponential(2); +str = floored.toPrecision(2); +str = floored.toFixed(2); + +let num: number = maxIntegerDigits; +num = VERSION[0]; +num = VERSION.length; + +raise("fake error", "This is not really an error", m); diff --git a/javascript-bignum/javascript-bignum.d.ts b/javascript-bignum/javascript-bignum.d.ts new file mode 100644 index 000000000..a088837d1 --- /dev/null +++ b/javascript-bignum/javascript-bignum.d.ts @@ -0,0 +1,53 @@ +// Type definitions for javascript-bignum +// Project: https://github.com/jtobey/javascript-bignum +// Definitions by: Nathan Shively-Sanders +// Definitions: https://github.com/borisyankov/DefinitelyTyped +// Documentation: http://john-edwin-tobey.org/Scheme/javascript-bignum/docs/files/schemeNumber-js.html + +// This version only includes typing for schemeNumber, not the full library +declare type SchemeOperator = (...args: (string | SchemeNumber | number)[]) => SchemeNumber; +declare var VERSION: number[]; +declare function raise(conditionType: string, message: string, ...irritants: any[]): void; +declare var maxIntegerDigits: number; +declare interface SchemeFn { + [opname: string]: SchemeOperator; + inexact: SchemeOperator; + exact: SchemeOperator; + max: SchemeOperator; + min: SchemeOperator; + abs: SchemeOperator; + div: SchemeOperator; + mod: SchemeOperator; + div0: SchemeOperator; + mod0: SchemeOperator; + gcd: SchemeOperator; + lcm: SchemeOperator; + numerator: SchemeOperator; + denominator: SchemeOperator; + floor: SchemeOperator; + ceiling: SchemeOperator; + truncate: SchemeOperator; + round: SchemeOperator; + rationalize: SchemeOperator; + exp: SchemeOperator; + log: SchemeOperator; + sin: SchemeOperator; + cos: SchemeOperator; + tan: SchemeOperator; + asin: SchemeOperator; + acos: SchemeOperator; + atan: SchemeOperator; + sqrt: SchemeOperator; + expt: SchemeOperator; + magnitude: SchemeOperator; + angle: SchemeOperator; +} +declare interface SchemeNumber { + (value: string | number): SchemeNumber; + toString(radix: number): string; + toFixed(fractionDigits: number): string; + toExponential(fractionDigits: number): string; + toPrecision(precision: number): string; + fn: SchemeFn; +} +declare var SchemeNumber: SchemeNumber; diff --git a/jee-jsf/jsf-tests.ts b/jee-jsf/jsf-tests.ts new file mode 100644 index 000000000..76815bf9e --- /dev/null +++ b/jee-jsf/jsf-tests.ts @@ -0,0 +1,27 @@ +/// + +function callbackWithoutData() { + +} + +function callback(data:jsf.ajax.RequestData) { + +} + +class RequestOptionsImpl implements jsf.ajax.RequestOptions { + execute = "@all"; + render = "@none"; +} + + +jsf.ajax.addOnEvent(callbackWithoutData); +jsf.ajax.addOnEvent(callback); + +jsf.ajax.addOnError(callbackWithoutData); +jsf.ajax.addOnError(callback); + +jsf.ajax.request("someSource"); +jsf.ajax.request("someSource", "change"); +jsf.ajax.request("someSource", "change", new RequestOptionsImpl()); + +jsf.ajax.response("someRequestObject", {context: "someContextObject"}); diff --git a/jee-jsf/jsf.d.ts b/jee-jsf/jsf.d.ts new file mode 100644 index 000000000..d19dafe0e --- /dev/null +++ b/jee-jsf/jsf.d.ts @@ -0,0 +1,72 @@ +// Type definitions for for the JSF 2.0 Ajax request API +// Project: https://docs.oracle.com/cd/E17802_01/j2ee/javaee/javaserverfaces/2.0/docs/js-api/symbols/jsf.ajax.html +// Definitions by: Lars Michaelis and Stephan Zerhusen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module jsf { + module ajax { + + interface RequestData { + status: string; + description: string; + } + + interface RequestOptions { + /** + * space seperated list of client identifiers + */ + execute?: String; + + /** + * space seperated list of client identifiers + */ + render?: String; + + /** + * function to callback for event + * @param callback the callback function + */ + onevent?(callback:(data:RequestData) => void): void; + + /** + * function to callback for error + * @param callback the callback function + */ + onerror?(callback:(data:RequestData) => void): void; + + /** + * object containing parameters to include in the request + */ + params?: any; + } + + /** + * Register a callback for event handling. + * @param callback a reference to a function to call on an event + */ + function addOnEvent(callback:(data:RequestData) => void):void; + + /** + * Register a callback for error handling. + * @param callback a reference to a function to call on an error + */ + function addOnError(callback:(data:RequestData) => void):void; + + /** + * Send an asynchronous Ajax request to the server. + * @param source The DOM element that triggered this Ajax request, or an id string of the element to use as the triggering element. + * @param event The DOM event that triggered this Ajax request. The event argument is optional. + * @param options The set of available options that can be sent as request parameters to control client and/or server side request processing. + */ + function request(source:any, event?:String, options?:RequestOptions):void; + + /** + * Receive an Ajax response from the server. + * @param request The XMLHttpRequest instance that contains the status code and response message from the server. + * @param context An object containing the request context, including the following properties: the source element, per call onerror callback function, and per call onevent callback function. + * @throws EmptyResponse error if request contains no data + */ + function response(request:any, context:any):void; + + } +} diff --git a/jest/jest-tests.ts b/jest/jest-tests.ts index 764daf142..da141ef9e 100644 --- a/jest/jest-tests.ts +++ b/jest/jest-tests.ts @@ -47,7 +47,7 @@ describe('displayUser', function() { '