diff --git a/.gitattributes b/.gitattributes index 412eeda78d..dfe0770424 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,22 +1,2 @@ # Auto detect text files and perform LF normalization * text=auto - -# Custom for Visual Studio -*.cs diff=csharp -*.sln merge=union -*.csproj merge=union -*.vbproj merge=union -*.fsproj merge=union -*.dbproj merge=union - -# Standard to msysgit -*.doc diff=astextplain -*.DOC diff=astextplain -*.docx diff=astextplain -*.DOCX diff=astextplain -*.dot diff=astextplain -*.DOT diff=astextplain -*.pdf diff=astextplain -*.PDF diff=astextplain -*.rtf diff=astextplain -*.RTF diff=astextplain diff --git a/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md similarity index 100% rename from ISSUE_TEMPLATE.md rename to .github/ISSUE_TEMPLATE.md diff --git a/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md similarity index 82% rename from PULL_REQUEST_TEMPLATE.md rename to .github/PULL_REQUEST_TEMPLATE.md index 1fc8897d23..4338219f31 100644 --- a/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,25 +1,23 @@ Please fill in this template. -- [ ] Make your PR against the `master` branch. - [ ] Use a meaningful title for the pull request. Include the name of the package modified. - [ ] Test the change in your own code. (Compile and run.) - [ ] Follow the advice from the [readme](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#make-a-pull-request). - [ ] Avoid [common mistakes](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#common-mistakes). -- [ ] Run `tsc` without errors. -- [ ] Run `npm run lint package-name` if a `tslint.json` is present. +- [ ] Run `npm run lint package-name` (or `tsc` if no `tslint.json` is present). Select one of these and delete the others: If adding a new definition: - [ ] The package does not provide its own types, and you can not add them. - [ ] If this is for an NPM package, match the name. If not, do not conflict with the name of an NPM package. -- [ ] Create it with `npm run new-package package-name`, not by basing it on an existing project. +- [ ] Create it with `dts-gen --dt`, not by basing it on an existing project. - [ ] `tslint.json` should be present, and `tsconfig.json` should have `noImplicitAny`, `noImplicitThis`, and `strictNullChecks` set to `true`. If changing an existing definition: - [ ] Provide a URL to documentation or source code which provides context for the suggested changes: <> - [ ] Increase the version number in the header if appropriate. -- [ ] If you are making substantial changes, consider adding a `tslint.json` containing `{ "extends": "../tslint.json" }`. +- [ ] If you are making substantial changes, consider adding a `tslint.json` containing `{ "extends": "dslint/dt.json" }`. If removing a declaration: - [ ] If a package was never on DefinitelyTyped, you don't need to do anything. (If you wrote a package and provided types, you don't need to register it with us.) diff --git a/.travis.yml b/.travis.yml index c8c468a417..07914721a9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: node_js node_js: - - 6.9.2 + - node sudo: false diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 3b48e78746..0000000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1 +0,0 @@ -Please see the [contribution guide](http://definitelytyped.org/guides/contributing.html) at [definitelytyped.org](http://definitelytyped.org/guides/contributing.html) for information on how to contribute to DefinitelyTyped. diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md deleted file mode 100644 index c3218efb0a..0000000000 --- a/CONTRIBUTORS.md +++ /dev/null @@ -1,1893 +0,0 @@ -# Contributors - -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:](rails-actioncable/rails-actioncable.d.ts) [ActionCable](https://github.com/rails/rails/tree/master/actioncable) by [Vincent Zhu](https://github.com/zhu1230) -* [:link:](cordova-plugin-ms-adal/cordova-plugin-ms-adal.d.ts) [Active Directory Authentication Library plugin for Apache Cordova](https://github.com/AzureAD/azure-activedirectory-library-for-cordova) by [Kai Walter](https://github.com/KaiWalter) -* [:link:](adal-angular/adal-angular.d.ts) [ADAL.JS](https://github.com/AzureAD/azure-activedirectory-library-for-js) by [mmaitre314](https://github.com/mmaitre314) -* [:link:](adal-angular/adal.d.ts) [ADAL.JS](https://github.com/AzureAD/azure-activedirectory-library-for-js) by [mmaitre314](https://github.com/mmaitre314) -* [:link:](add2home/add2home.d.ts) [add2home](http://cubiq.org/add-to-home-screen) by [James Wilkins](http://www.codeplex.com/site/users/view/jamesnw) -* [:link:](adm-zip/adm-zip.d.ts) [adm-zip](https://github.com/cthackers/adm-zip) by [John Vilk](https://github.com/jvilk), [Abner Oliveira](https://github.com/abner) -* [:link:](ag-grid/ag-grid.d.ts) [ag-grid](http://www.ag-grid.com) by [Niall Crosby](https://github.com/ceolter) -* [:link:](agenda/agenda.d.ts) [Agenda](https://github.com/rschmukler/agenda) by [Meir Gottlieb](https://github.com/meirgottlieb) -* [: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) -* [:link:](amcharts/AmCharts.d.ts) [amCharts](http://www.amcharts.com) by [aleksey-bykov](https://github.com/aleksey-bykov) -* [: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), [Ab Reitsma](https://github.com/abreits) -* [: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.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) -* [:link:](angularjs/angular-mocks.d.ts) [Angular JS (ngMock, ngMockE2E module)](http://angularjs.org) by [Diego Vilar](http://github.com/diegovilar), [Tony Curtis](http://github.com/daltin) -* [:link:](angularjs/angular-resource.d.ts) [Angular JS (ngResource module)](http://angularjs.org) by [Diego Vilar](http://github.com/diegovilar), [Michael Jess](http://github.com/miffels) -* [:link:](angularjs/angular-route.d.ts) [Angular JS (ngRoute module)](http://angularjs.org) by [Jonathan Park](https://github.com/park9140) -* [:link:](angularjs/angular-sanitize.d.ts) [Angular JS (ngSanitize module)](http://angularjs.org) by [Diego Vilar](http://github.com/diegovilar) -* [:link:](angular-ui-router/angular-ui-router.d.ts) [Angular JS (ui.router module)](https://github.com/angular-ui/ui-router) by [Michel Salib](https://github.com/michelsalib) -* [:link:](angular-ui-scroll/angular-ui-scroll.d.ts) [Angular JS (ui.scroll module)](https://github.com/angular-ui/ui-scroll) by [Mark Nadig](https://github.com/marknadig) -* [:link:](angularjs/angular-component-router.d.ts) [Angular JS 1.5 component router](http://angularjs.org) by [David Reher](http://github.com/davidreher) -* [:link:](angular-meteor/angular-meteor.d.ts) [Angular JS Meteor (angular.meteor module)](https://github.com/Urigo/angular-meteor) by [Peter Grman](https://github.com/pgrm) -* [:link:](angular-locker/angular-locker.d.ts) [Angular Locker](https://github.com/tymondesigns/angular-locker) by [Niko Kovačič](https://github.com/nkovacic) -* [:link:](angular-media-queries/match-media.d.ts) [Angular matchMedia (angular.matchMedia module)](https://github.com/jacopotarantino/angular-match-media) by [Joao Monteiro](https://github.com/jpmnteiro) -* [:link:](angular-material/angular-material.d.ts) [Angular Material (angular.material module)](https://github.com/angular/material) by [Matt Traynham](https://github.com/mtraynham) -* [:link:](angular-protractor/angular-protractor.d.ts) [Angular Protractor](https://github.com/angular/protractor) by [Bill Armstrong](https://github.com/BillArmstrong) -* [:link:](angular-scenario/angular-scenario.d.ts) [Angular Scenario Testing (ngScenario module)](http://angularjs.org) by [RomanoLindano](https://github.com/RomanoLindano) -* [:link:](angular-toastr/angular-toastr.d.ts) [Angular Toastr](https://github.com/Foxandxss/angular-toastr) by [Niko Kovačič](https://github.com/nkovacic) -* [:link:](angular-toasty/angular-toasty.d.ts) [Angular Toasty](https://github.com/invertase/angular-toasty) by [Dominik Muench](https://github.com/muenchdo) -* [:link:](angular-touchspin/angular-touchspin.d.ts) [Angular Touchspin](https://github.com/nkovacic/angular-touchspin) by [Niko Kovačič](https://github.com/nkovacic) -* [: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:](angular-wizard/angular-wizard.d.ts) [Angular Wizard](https://github.com/mgonto/angular-wizard) by [Marko Jurisic](https://github.com/mjurisic), [Ronald Wildenberg](https://github.com/rwwilden) -* [:link:](angular-bootstrap-calendar/angular-bootstrap-calendar.d.ts) [angular-bootstrap-calendar](https://github.com/mattlewis92/angular-bootstrap-calendar) by [Egor Komarov](https://github.com/Odrin) -* [: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-breadcrumb/angular-breadcrumb.d.ts) [angular-breadcrumb](https://github.com/ncuillery/angular-breadcrumb) by [Marc Talary](https://github.com/marctalary) -* [:link:](angular-cookie/angular-cookie.d.ts) [angular-cookie](https://github.com/ivpusic/angular-cookie) by [Borislav Zhivkov](https://github.com/borislavjivkov) -* [: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-environment/angular-environment.d.ts) [angular-environment](https://github.com/juanpablob/angular-environment) by [Matt Wheatley](https://github.com/terrawheat) -* [:link:](angular-formly/angular-formly.d.ts) [angular-formly](https://github.com/formly-js/angular-formly) by [Scott Hatcher](https://github.com/scatcher) -* [:link:](angular-gettext/angular-gettext.d.ts) [angular-gettext](https://angular-gettext.rocketeer.be) by [Ákos Lukács](https://github.com/AkosLukacs) -* [:link:](angular-google-analytics/angular-google-analytics.d.ts) [angular-google-analytics](https://github.com/revolunet/angular-google-analytics) by [Cyril Schumacher](https://github.com/cyrilschumacher) -* [:link:](angular-google-analytics/angular-google-analytics-service.d.ts) [angular-google-analytics](https://github.com/revolunet/angular-google-analytics) by [Matt Wheatley](https://github.com/terrawheat) -* [:link:](angular-hotkeys/angular-hotkeys.d.ts) [angular-hotkeys](https://github.com/chieffancypants/angular-hotkeys) by [Jason Zhao](https://github.com/jlz27), [Stefan Steinhart](https://github.com/reppners) -* [:link:](angular-http-auth/angular-http-auth.d.ts) [angular-http-auth](https://github.com/witoldsz/angular-http-auth) by [vvakame](https://github.com/vvakame) -* [:link:](angular-httpi/angular-httpi.d.ts) [angular-httpi](https://github.com/bennadel/httpi) by [Andrew Camilleri](https://github.com/Kukks) -* [:link:](angular-jwt/angular-jwt.d.ts) [angular-jwt](https://github.com/auth0/angular-jwt) by [Reto Rezzonico](https://github.com/rerezz) -* [:link:](angular-load/angular-load.d.ts) [angular-load](https://github.com/urish/angular-load) by [david-gang](https://github.com/david-gang) -* [: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-permission/angular-permission.d.ts) [angular-permission](https://github.com/Narzerus/angular-permission) by [Voislav Mishevski](https://github.com/vmishevski) -* [:link:](angular-scroll/angular-scroll.d.ts) [angular-scroll](https://github.com/oblador/angular-scroll) by [Sam Herrmann](https://github.com/samherrmann) -* [:link:](angular-signalr-hub/angular-signalr-hub.d.ts) [angular-signalr-hub](https://github.com/JustMaier/angular-signalr-hub) by [Adam Santaniello](https://github.com/AdamSantaniello) -* [:link:](angular-spinner/angular-spinner.d.ts) [angular-spinner.js](https://github.com/urish/angular-spinner) by [Marcin Biegała](https://github.com/Biegal) -* [: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) -* [:link:](angular-agility/angular-agility.d.ts) [AngularAgility](https://github.com/AngularAgility/AngularAgility) by [Roland Zwaga](https://github.com/rolandzwaga) -* [:link:](angularfire/angularfire.d.ts) [AngularFire](http://angularfire.com) by [Dénes Harmath](http://github.com/thSoft) -* [:link:](rx-angular/rx.angular.d.ts) [angularjs extensions to rxjs](http://reactivex.io) by [Mick Delaney](https://github.com/mickdelaney) -* [:link:](angular-fullscreen/angular-fullscreen.d.ts) [AngularJS HTML5 Fullscreen](https://github.com/fabiobiondi/angular-fullscreen) by [Julien Paroche](https://github.com/julienpa) -* [:link:](angularjs-toaster/angularjs-toaster.d.ts) [angularjs-toaster](https://github.com/jirikavi/AngularJS-Toaster) by [Ben Tesser](https://github.com/btesser) -* [:link:](angularLocalStorage/angularLocalStorage.d.ts) [AngularLocalStorage](https://github.com/agrublev/angularLocalStorage) by [Horiuchi_H](https://github.com/horiuchi) -* [:link:](angulartics/angulartics.d.ts) [Angulartics](http://luisfarzati.github.io/angulartics) by [Steven Fan](https://github.com/stevenfan) -* [:link:](animation-frame/animation-frame.d.ts) [animation-frame](https://github.com/kof/animation-frame) by [Qinfeng Chen](https://github.com/qinfchen) -* [:link:](ansi-styles/ansi-styles.d.ts) [ansi-styles](https://github.com/sindresorhus/ansi-styles) by [bryn austin bellomy](https://github.com/brynbellomy) -* [:link:](ansicolors/ansicolors.d.ts) [ansicolors](https://github.com/thlorenz/ansicolors) by [rogierschouten](https://github.com/rogierschouten) -* [:link:](antd/antd.d.ts) [Antd](http://ant.design) by [bang88](https://github.com/bang88), [Bruce Mitchener](https://github.com/waywardmonkeys) -* [:link:](any-db/any-db.d.ts) [any-db](https://github.com/grncdr/node-any-db) by [Rogier Schouten](https://github.com/rogierschouten) -* [:link:](any-db-transaction/any-db-transaction.d.ts) [any-db-transaction](https://github.com/grncdr/node-any-db-transaction) by [Rogier Schouten](https://github.com/rogierschouten) -* [:link:](anydb-sql/anydb-sql.d.ts) [anydb-sql](https://github.com/doxout/anydb-sql) by [Gorgi Kosev](https://github.com/spion) -* [:link:](anydb-sql-migrations/anydb-sql-migrations.d.ts) [anydb-sql-migrations](https://github.com/spion/anydb-sql-migrations) by [Gorgi Kosev](https://github.com/spion) -* [:link:](cordova-plugin-background-mode/cordova-plugin-background-mode.d.ts) [Apache Background Mode plugin](https://github.com/katzer/cordova-plugin-background-mode) by [Paul Thiel](https://github.com/Lordnoname) -* [:link:](cordova/cordova.d.ts) [Apache Cordova](http://cordova.apache.org) by [Microsoft Open Technologies Inc.](http://msopentech.com) -* [:link:](cordova-plugin-email-composer/cordova-plugin-email-composer.d.ts) [Apache Cordova Email Composer plugin](https://github.com/katzer/cordova-plugin-email-composer) by [Dave Taylor](http://davetayls.me) -* [:link:](api-error-handler/api-error-handler.d.ts) [api-error-handler](https://github.com/expressjs/api-error-handler) by [Tanguy Krotoff](https://github.com/tkrotoff) -* [:link:](appframework/appframework.d.ts) [AppFramework](http://app-framework-software.intel.com) by [kyo_ago](https://github.com/kyo-ago) -* [:link:](appletvjs/appletvjs.d.ts) [AppleTVJS](https://developer.apple.com/library/prerelease/tvos/documentation/TVMLJS/Reference/TVJSFrameworkReference/index.html) by [Adam Valverde](https://github.com/brainded) -* [:link:](applicationinsights/applicationinsights.d.ts) [Application Insights](https://github.com/Microsoft/ApplicationInsights-node.js) by [Scott Southwood](https://github.com/scsouthw) -* [:link:](arbiter/Arbiter.d.ts) [Arbiter.js](http://arbiterjs.com) by [Arash Shakery](https://github.com/arash16) -* [: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:](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-lock/async-lock.d.ts) [async-lock](https://github.com/rain1017/async-lock) by [Elisée MAURER](https://github.com/elisee) -* [: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) -* [:link:](atom/api-docs.d.ts) [Atom API docs](https://github.com/atom/atom/blob/master/build/tasks/docs-task.coffee) by [vvakame](https://github.com/vvakame) -* [:link:](atom-keymap/atom-keymap.d.ts) [atom-keymap](https://github.com/atom/atom-keymap) by [Vadim Macagon](https://github.com/enlight) -* [:link:](atpl/atpl.d.ts) [atpl](https://github.com/soywiz/atpl.js) by [Carlos Ballesteros Velasco](https://github.com/soywiz) -* [:link:](auth0-angular/auth0-angular.d.ts) [auth0-angular](https://github.com/auth0/auth0-angular) by [Matt Emory](https://github.com/homesar) -* [:link:](auth0/auth0.d.ts) [Auth0.js](http://auth0.com) by [Robert McLaws](https://github.com/advancedrei) -* [:link:](auth0.lock/auth0.lock.d.ts) [Auth0Widget.js](http://auth0.com) by [Robert McLaws](https://github.com/advancedrei) -* [:link:](auth0.widget/auth0.widget.d.ts) [Auth0Widget.js](http://auth0.com) by [Robert McLaws](https://github.com/advancedrei) -* [:link:](auto-launch/auto-launch.d.ts) [auto-launch](https://github.com/Teamwork/node-auto-launch) by [rhysd](https://github.com/rhysd) -* [:link:](autobahn/autobahn.d.ts) [AutobahnJS](http://autobahn.ws/js) by [Elad Zelingher](https://github.com/darkl), [Andy Hawkins](https://github.com/a904guy/,http://a904guy.com/,http://www.bmbsqd.com) -* [:link:](autolinker/autolinker.d.ts) [autolinker](https://github.com/gregjacobs/Autolinker.js) by [Leon Yu](https://github.com/leonyu) -* [:link:](autoprefixer-core/autoprefixer-core.d.ts) [Autoprefixer Core](https://github.com/postcss/autoprefixer-core) by [Asana](https://asana.com) -* [:link:](aws-sdk/aws-sdk.d.ts) [aws-sdk](https://github.com/aws/aws-sdk-js) by [midknight41](https://github.com/midknight41) -* [:link:](axios/axios.d.ts) [axios](https://github.com/mzabriskie/axios) by [Marcel Buesing](https://github.com/marcelbuesing) -* [:link:](node-azure/azure.d.ts) [Azure SDK for Node](https://github.com/WindowsAzure/azure-sdk-for-node) by [Andrew Gaspar](https://github.com/AndrewGaspar), [Anti Veeranna](https://github.com/antiveeranna), [Maxime LUCE](https://github.com/SomaticIT) -* [:link:](azure-mobile-apps/azure-mobile-apps.d.ts) [azure-mobile-apps](https://github.com/Azure/azure-mobile-apps-node) by [Microsoft Azure](https://github.com/Azure) -* [:link:](azure-sb/azure-sb.d.ts) [azure-sb](https://github.com/Azure/azure-sdk-for-node/tree/master/lib/services/serviceBus) by [Microsoft Azure](https://github.com/Azure) -* [:link:](babylonjs/babylon.d.ts) [BabylonJS](http://www.babylonjs.com) by [David Catuhe](https://github.com/deltakosh) -* [:link:](babyparse/babyparse.d.ts) [babyparse](https://github.com/Rich-Harris/BabyParse) by [Charles Parker](https://github.com/cdiddy77) -* [: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:](base-x/base-x.d.ts) [base-x](https://github.com/cryptocoinjs/base-x) by [Ilya Mochalov](https://github.com/chrootsu) -* [: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:](bip21/bip21.d.ts) [bip21](https://github.com/bitcoinjs/bip21) by [Stefan Huber](https://github.com/stefanhuber) -* [:link:](bitwise-xor/bitwise-xor.d.ts) [bitwise-xor](https://github.com/czzarr/node-bitwise-xor) by [Rogier Schouten](https://github.com/rogierschouten) -* [:link:](blazy/blazy.d.ts) [bLazy](https://github.com/dinbror/blazy) by [Julien Paroche](https://github.com/julienpa) -* [:link:](blissfuljs/blissfuljs.d.ts) [bliss](http://blissfuljs.com) by [François Skorzec](https://github.com/fskorzec) -* [:link:](blob-stream/blob-stream.d.ts) [blob-stream](https://github.com/devongovett/blob-stream) by [Eric Hillah](https://github.com/erichillah) -* [: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), [Troy McKinnon](https://github.com/trodi) -* [: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 3 Datepicker](http://eonasdan.github.io/bootstrap-datetimepicker) by [Katona Péter](https://github.com/katonap) -* [: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:](eonasdan-bootstrap-datetimepicker/eonasdan-bootstrap-datetimepicker.d.ts) [Bootstrap v3 Datepicker](http://eonasdan.github.io/bootstrap-datetimepicker) by [Markus Peloso](https://github.com/ToastHawaii) -* [: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:](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:](brorand/brorand.d.ts) [Brorand](https://github.com/indutny/brorand) by [Ilya Mochalov](https://github.com/chrootsu) -* [: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), [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:](bs58/bs58.d.ts) [bs58](https://github.com/cryptocoinjs/bs58) by [Ilya Mochalov](https://github.com/chrootsu) -* [:link:](bson/bson.d.ts) [bson](https://github.com/mongodb/js-bson) by [Hiroki Horiuchi](https://github.com/horiuchi) -* [: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:](bugsnag/bugsnag.d.ts) [Bugsnag](https://github.com/bugsnag/bugsnag-js) by [Delisa Mason](https://github.com/kattrali) -* [: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:](callsite/callsite.d.ts) [callsite](https://github.com/tj/callsite) by [newclear](https://github.com/newclear) -* [: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:](camelcase/camelcase.d.ts) [camelcase](https://github.com/sindresorhus/camelcase) by [Sam Verschueren](https://github.com/samverschueren) -* [:link:](camljs/camljs.d.ts) [camljs](http://camljs.codeplex.com) by [Andrey Markeev](http://markeev.com) -* [:link:](camo/camo.d.ts) [camo](https://github.com/scottwrobinson/camo) by [Lucas Matías Ciruzzi](https://github.com/lucasmciruzzi) -* [: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), [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), [Nico Jansen](https://github.com/nicojs) -* [: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) -* [:link:](chartjs/chart.d.ts) [Chart.js](https://github.com/nnnick/Chart.js) by [Steve Fenton](https://github.com/Steve-Fenton) -* [:link:](chartist/chartist.d.ts) [Chartist](https://github.com/gionkunz/chartist-js) by [Matt Gibbs](https://github.com/mtgibbs) -* [:link:](checksum/checksum.d.ts) [checksum](https://github.com/dshaw/checksum) by [Rogier Schouten](https://github.com/rogierschouten) -* [:link:](cheerio/cheerio.d.ts) [Cheerio](https://github.com/cheeriojs/cheerio) by [Bret Little](https://github.com/blittle), [VILIC VANE](http://vilic.info), [Wayne Maurer](https://github.com/wmaurer) -* [:link:](chocolatechipjs/chocolatechipjs.d.ts) [chocolatechip](https://github.com/chocolatechipui/ChocolateChipJS) by [Robert Biggs](http://chocolatechip-ui.com) -* [:link:](chokidar/chokidar.d.ts) [chokidar](https://github.com/paulmillr/chokidar) by [Stefan Steinhart](https://github.com/reppners) -* [: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), [couven92](https://github.com/couven92), [RReverser](https://github.com/rreverser) -* [: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), [Ingvar Stepanyan](https://github.com/RReverser) -* [: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) -* [:link:](ckeditor/ckeditor.d.ts) [CKEditor](http://ckeditor.com) by [Ondrej Sevcik](https://github.com/ondrejsevcik) -* [:link:](classnames/classnames.d.ts) [classnames](https://github.com/JedWatson/classnames) by [Dave Keen](http://www.keendevelopment.ch), [Adi Dahiya](https://github.com/adidahiya), [Jason Killian](https://github.com/JKillian) -* [:link:](cldr.js/cldr.js-event.d.ts) [Cldr.js](https://github.com/rxaviers/cldrjs) by [Raman But-Husaim](https://github.com/RamanBut-Husaim) -* [:link:](cldr.js/cldr.js-supplemental.d.ts) [Cldr.js](https://github.com/rxaviers/cldrjs) by [Raman But-Husaim](https://github.com/RamanBut-Husaim) -* [:link:](cldr.js/cldr.js.d.ts) [Cldr.js](https://github.com/rxaviers/cldrjs) by [Raman But-Husaim](https://github.com/RamanBut-Husaim), [Grégoire Castre](https://github.com/gcastre) -* [:link:](clean-css/clean-css.d.ts) [clean-css](https://github.com/jakubpawlowicz/clean-css) by [Tanguy Krotoff](https://github.com/tkrotoff) -* [:link:](cli/cli.d.ts) [cli](https://www.npmjs.com/package/cli) by [Klaus Reimer](https://github.com/kayahr) -* [:link:](cli-color/cli-color.d.ts) [cli-color](https://github.com/medikoo/cli-color) by [Joel Spadin](https://github.com/ChaosinaCan) -* [:link:](clipboard/clipboard.d.ts) [clipboard.js](https://github.com/zenorocha/clipboard.js) by [Andrei Kurosh](https://github.com/impworks) -* [:link:](clone/clone.d.ts) [clone](https://github.com/pvorb/node-clone) by [Kieran Simpson](https://github.com/kierans/DefinitelyTyped) -* [:link:](closure-compiler/closure-compiler.d.ts) [closure-compiler](https://github.com/tim-smart/node-closure) by [Martin Probst](https://github.com/mprobst) -* [:link:](codemirror/codemirror-showhint.d.ts) [CodeMirror](https://github.com/marijnh/CodeMirror) by [jacqt](https://github.com/jacqt), [basarat](https://github.com/basarat) -* [:link:](codemirror/codemirror-matchbrackets.d.ts) [CodeMirror](https://github.com/marijnh/CodeMirror) by [Sixin Li](https://github.com/sixinli) -* [:link:](codemirror/codemirror-runmode.d.ts) [CodeMirror](https://github.com/marijnh/CodeMirror) by [Joseph Vaughan](https://github.com/Joev-) -* [:link:](codemirror/searchcursor.d.ts) [CodeMirror](https://github.com/marijnh/CodeMirror) by [jacqt](https://github.com/jacqt) -* [:link:](codemirror/codemirror.d.ts) [CodeMirror](https://github.com/marijnh/CodeMirror) by [mihailik](https://github.com/mihailik) -* [:link:](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:](confidence/confidence.d.ts) [Confidence](https://github.com/hapijs/confidence.git) by [Jean-Philippe Pellerin](https://github.com/jppellerin) -* [: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), [Theo Sherry](https://github.com/theosherry) -* [:link:](constant-case/constant-case.d.ts) [constant-case](https://github.com/blakeembrey/constant-case) by [Sam Saint-Pettersen](https://github.com/stpettersens) -* [:link:](consul/consul.d.ts) [Consul](https://github.com/silas/node-consul) by [Ilya Mochalov](https://github.com/chrootsu) -* [: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:](cookies/cookies.d.ts) [cookie-parser](https://github.com/pillarjs/cookies) by [Wang Zishi](https://github.com/WangZishi) -* [:link:](cookie-parser/cookie-parser.d.ts) [cookie-parser](https://github.com/expressjs/cookie-parser) by [Santi Albo](https://github.com/santialbo) -* [:link:](cookie-session/cookie-session.d.ts) [cookie-session](https://github.com/expressjs/cookie-session) by [Borislav Zhivkov](https://github.com/borislavjivkov) -* [:link:](cookiejs/cookiejs.d.ts) [cookie.js](https://github.com/js-coder/cookie.js) by [Boltmade](https://github.com/Boltmade) -* [:link:](copy-paste/copy-paste.d.ts) [copy-paste](https://github.com/xavi-/node-copy-paste) by [Tobias Kahlert](https://github.com/SrTobi) -* [: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-qrscanner/cordova-plugin-qrscanner.d.ts) [cordova-plugin-qrscanner](https://github.com/bitpay/cordova-plugin-qrscanner) by [Jason Dreyzehner](https://github.com/bitjson) -* [: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 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:](cropperjs/cropperjs.d.ts) [cropperjs](https://github.com/fengyuanchen/cropperjs) by [Stepan Mikhaylyuk](https://github.com/stepancar) -* [:link:](cross-storage/cross-storage.d.ts) [cross-storage](https://github.com/zendesk/cross-storage) by [Daniel Chao](http://dchao.co) -* [:link:](crossfilter/crossfilter.d.ts) [CrossFilter](https://github.com/square/crossfilter) by [Schmulik Raskin](https://github.com/schmuli) -* [:link:](crossroads/crossroads.d.ts) [Crossroads.js](http://millermedeiros.github.io/crossroads.js) by [Diullei Gomes](https://github.com/diullei) -* [: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) -* [:link:](d3-dsv/d3-dsv.d.ts) [d3-dsv](https://www.npmjs.com/package/d3-dsv) by [Jason Swearingen](https://jasonswearingen.github.io) -* [:link:](d3/d3.d.ts) [d3JS](http://d3js.org) by [Alex Ford](https://github.com/gustavderdrache), [Boris Yankov](https://github.com/borisyankov) -* [:link:](d3.cloud.layout/d3.cloud.layout.d.ts) [d3JS cloud layout plugin by Jason Davies](https://github.com/jasondavies/d3-cloud) by [hans windhoff](https://github.com/hansrwindhoff) -* [:link:](dagre/dagre.d.ts) [dagre](https://github.com/cpettitt/dagre) by [Qinfeng Chen](https://github.com/qinfchen) -* [:link:](dagre-d3/dagre-d3.d.ts) [dagre-d3.core.js](https://github.com/cpettitt/dagre-d3) by [Mark Wong Siang Kai](https://github.com/markwongsk) -* [:link:](dat-gui/dat-gui.d.ts) [dat.GUI](https://github.com/dataarts/dat.gui) by [Satoru Kimura](https://github.com/gyohk) -* [:link:](data-driven/data-driven.d.ts) [data-driven.js](https://github.com/fluentsoftware/data-driven) by [Adam Babcock](https://github.com/mrhen) -* [:link:](DataStream.js/DataStream.js.d.ts) [DataStream.js](https://github.com/kig/DataStream.js) by [Tat](https://github.com/tatchx) -* [: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), [Gal Talmor](https://github.com/galtalmor) -* [:link:](decamelize/decamelize.d.ts) [decamelize](https://github.com/sindresorhus/decamelize) by [Sam Verschueren](https://github.com/samverschueren) -* [: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-equal/deep-equal.d.ts) [deep-equal](https://github.com/substack/node-deep-equal) by [remojansen](https://github.com/remojansen) -* [: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), [Aya Morisawa](https://github.com/AyaMorisawa) -* [: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:](devexpress-web/devexpress-web.d.ts) [DevExpress ASP.NET web controls (Classic and MVC)](https://www.devexpress.com/Products/NET/Controls/ASP/MVC) by [Sheron Benedict](https://github.com/INullable) -* [: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) -* [:link:](di-lite/di-lite.d.ts) [di-lite](https://github.com/NickQiZhu/di.js) by [Timothy Morris](https://github.com/dcrusader) -* [:link:](diff/diff.d.ts) [diff](https://github.com/kpdecker/jsdiff) by [vvakame](https://github.com/vvakame) -* [: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:](dom4/dom4.d.ts) [dom4](https://github.com/WebReflection/dom4) by [Adi Dahiya](https://github.com/adidahiya), [Gilad Gray](https://github.com/giladgray) -* [: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) -* [:link:](dot-prop/dot-prop.d.ts) [dot-prop](https://github.com/sindresorhus/dot-prop) by [Sam Verschueren](https://github.com/samverschueren) -* [:link:](dotdotdot/dotdotdot.d.ts) [dotdotdot](http://dotdotdot.frebsite.nl) by [Milan Jaros](https://github.com/milanjaros) -* [:link:](dotenv/dotenv.d.ts) [dotenv](https://github.com/motdotla/dotenv) by [Jussi Kinnula](https://github.com/jussikinnula) -* [:link:](doublearray/doublearray.d.ts) [doublearray](https://github.com/takuyaa/doublearray) by [MIZUSHIMA Junki](https://github.com/mzsm) -* [:link:](draft-js/draft-js.d.ts) [draft-js](https://github.com/facebook/draft-js) by [Pavel Evsegneev](https://github.com/Ahineya) -* [:link:](dragula/dragula.d.ts) [dragula](http://bevacqua.github.io/dragula) by [Paul Welter](https://github.com/pwelter34) -* [:link:](hystrixjs/hystrixjs.d.ts) [dragula](https://bitbucket.org/igor_sechyn/hystrixjs) by [Igor Sechyn](https://github.com/igorsechyn) -* [:link:](drop/drop.d.ts) [Drop](http://github.hubspot.com/drop) by [Adi Dahiya](https://github.com/adidahiya) -* [:link:](dropboxjs/dropboxjs.d.ts) [dropbox-js](https://github.com/dropbox/dropbox-js) by [Steve Fenton](https://github.com/Steve-Fenton), [Pedro Casaubon](https://github.com/xperiments) -* [:link:](dropzone/dropzone.d.ts) [Dropzone](http://www.dropzonejs.com) by [Natan Vivo](https://github.com/nvivo), [Andy Hawkins](https://github.com/a904guy/,http://a904guy.com/,http://www.bmbsqd.com), [Vasya Aksyonov](https://github.com/outring), [Simon Huber](https://github.com/renuo) -* [:link:](dsv/dsv.d.ts) [dsv](https://www.npmjs.com/package/dsv) by [Jason Swearingen](https://jasonswearingen.github.io) -* [:link:](dts-bundle/dts-bundle.d.ts) [dts-bundle](https://github.com/TypeStrong/dts-bundle) by [Asana](https://asana.com) -* [:link:](durandal/durandal.d.ts) [Durandal](http://durandaljs.com) by [Blue Spire](https://github.com/BlueSpire) -* [:link:](dymo-label-framework/dymo-label-framework.d.ts) [DYMO Label Framework](http://www.labelwriter.com/software/dls/sdk/docs/DYMOLabelFrameworkJavaScriptHelp/index.html) by [Thijs Kuipers](https://github.com/thijskuipers) -* [:link:](easeljs/easeljs.d.ts) [EaselJS](http://www.createjs.com/#!/EaselJS) by [Pedro Ferreira](https://bitbucket.org/drk4), [Chris Smith](https://github.com/evilangelist) -* [: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 [Niklas Mollenhauer](https://github.com/nikeee) -* [:link:](easy-xapi-supertest/easy-xapi-supertest.d.ts) [easy-x-headers](https://github.com/DeadAlready/easy-x-headers) by [Karl Düüna](https://github.com/DeadAlready) -* [:link:](easy-x-headers/easy-x-headers.d.ts) [easy-x-headers](https://github.com/DeadAlready/easy-x-headers) by [Karl Düüna](https://github.com/DeadAlready) -* [:link:](easy-xapi/easy-xapi.d.ts) [easy-xapi](https://github.com/DeadAlready/easy-xapi) by [Karl Düüna](https://github.com/DeadAlready) -* [: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) -* [:link:](egg.js/egg.js.d.ts) [Egg.js](https://github.com/mikeflynn/egg.js) by [Markus Peloso](https://github.com/ToastHawaii) -* [: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:](ejson/ejson.d.ts) [ejson](https://www.npmjs.com/package/ejson) by [Shantanu Bhadoria](https://github.com/shantanubhadoria) -* [:link:](elasticsearch/elasticsearch.d.ts) [elasticsearch](https://www.elastic.co) by [Casper Skydt](https://github.com/CasperSkydt/DefinitelyTyped), [Blake Smith](https://github.com/bfsmith/DefinitelyTyped) -* [:link:](jquery.elang/jquery.elang.d.ts) [eLang](https://github.com/sumegizoltan/ELang) by [Zoltan Sumegi](https://github.com/sumegizoltan) -* [:link:](github-electron/github-electron.d.ts) [Electron](http://electron.atom.io) by [jedmao](https://github.com/jedmao), [rhysd](https://rhysd.github.io), [Milan Burda](https://github.com/miniak) -* [:link:](electron-builder/electron-builder.d.ts) [electron-builder](https://github.com/loopline-systems/electron-builder) by [Maxime LUCE](https://github.com/SomaticIT) -* [:link:](electron-json-storage/electron-json-storage.d.ts) [electron-json-storage](https://github.com/jviotti/electron-json-storage) by [Sam Saint-Pettersen](https://github.com/stpettersens) -* [:link:](electron-packager/electron-packager.d.ts) [electron-packager](https://github.com/maxogden/electron-packager) by [Maxime LUCE](https://github.com/SomaticIT) -* [:link:](github-electron/electron-prebuilt.d.ts) [electron-prebuilt](https://github.com/mafintosh/electron-prebuilt) by [rhysd](https://github.com/rhysd) -* [:link:](electron-window-state/electron-window-state.d.ts) [electron-window-state](https://github.com/mawie81/electron-window-state) by [rhysd](https://github.com/rhysd) -* [: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:](encoding-japanese/encoding-japanese.d.ts) [encoding-japanese](https://github.com/polygonplanet/encoding.js) by [rhysd](https://rhysd.github.io) -* [:link:](envify/envify.d.ts) [envify](https://github.com/hughsk/envify) by [Qubo](https://github.com/tkQubo) -* [:link:](enzyme/enzyme.d.ts) [Enzyme](https://github.com/airbnb/enzyme) by [Marian Palkus](https://github.com/MarianPalkus), [Cap3](http://www.cap3.de) -* [:link:](epiceditor/epiceditor.d.ts) [EpicEditor](http://epiceditor.com) by [Boris Yankov](https://github.com/borisyankov) -* [:link:](eq.js/eq.js.d.ts) [eq.js](https://github.com/Snugug/eq.js) by [Stephen Lautier](https://github.com/stephenlautier) -* [:link:](errorhandler/errorhandler.d.ts) [errorhandler](https://github.com/expressjs/errorhandler) by [Santi Albo](https://github.com/santialbo) -* [:link:](error-stack-parser/error-stack-parser.d.ts) [ErrorStackParser](https://github.com/stacktracejs/error-stack-parser) by [Eric Wendelin](https://www.eriwen.com) -* [:link:](es6-collections/es6-collections.d.ts) [es6-collections](https://github.com/WebReflection/es6-collections) by [Ron Buckton](http://github.com/rbuckton) -* [:link:](es6-promise/es6-promise.d.ts) [es6-promise](https://github.com/jakearchibald/ES6-Promise) by [François de Campredon](https://github.com/fdecampredon), [vvakame](https://github.com/vvakame) -* [:link:](es6-shim/es6-shim.d.ts) [es6-shim](https://github.com/paulmillr/es6-shim) by [Ron Buckton](http://github.com/rbuckton) -* [:link:](escape-html/escape-html.d.ts) [escape-html](https://github.com/component/escape-html) by [Elisée MAURER](https://github.com/elisee) -* [:link:](escape-latex/escape-latex.d.ts) [escape-latex](https://github.com/dangmai/escape-latex) by [Oliver Schneider](https://github.com/olsio) -* [:link:](escape-string-regexp/escape-string-regexp.d.ts) [escape-string-regexp](https://github.com/sindresorhus/escape-string-regexp) by [kruncher](https://github.com/kruncher) -* [:link:](esprima/esprima.d.ts) [Esprima](http://esprima.org) by [teppeis](https://github.com/teppeis), [RReverser](https://github.com/RReverser) -* [:link:](estree/flow.d.ts) [ESTree AST extensions for Facebook Flow](https://github.com/estree/estree) by [RReverser](https://github.com/RReverser) -* [:link:](estree/estree.d.ts) [ESTree AST specification](https://github.com/estree/estree) by [RReverser](https://github.com/RReverser) -* [:link:](evaporate/evaporate.d.ts) [EvaporateJS](https://github.com/TTLabs/EvaporateJS) by [Andrew Kuklewicz](https://github.com/kookster), [Chris Rhoden](https://github.com/chrisrhoden) -* [:link:](event-kit/event-kit.d.ts) [event-kit](https://github.com/atom/event-kit) by [Vadim Macagon](https://github.com/enlight) -* [:link:](event-loop-lag/event-loop-lag.d.ts) [event-loop-lag](https://github.com/pebble/event-loop-lag) by [Rogier Schouten](https://github.com/rogierschouten) -* [:link:](event-stream/event-stream.d.ts) [event-stream](https://github.com/dominictarr/event-stream) by [David Gardiner](https://github.com/flcdrg) -* [: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), [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/expect.d.ts) [Expect](https://github.com/mjackson/expect) by [Justin Reidy](https://github.com/jmreidy) -* [:link:](expect.js/expect.js.d.ts) [expect.js](https://github.com/Automattic/expect.js) by [Teppei Sato](https://github.com/teppeis) -* [:link:](expectations/expectations.d.ts) [expectations.js](https://github.com/spmason/expectations) by [vvakame](https://github.com/vvakame) -* [:link:](express-serve-static-core/express-serve-static-core.d.ts) [Express 4.x](http://expressjs.com) by [Boris Yankov](https://github.com/borisyankov) -* [:link:](express/express.d.ts) [Express 4.x](http://expressjs.com) by [Boris Yankov](https://github.com/borisyankov) -* [:link:](express-brute/express-brute.d.ts) [express-brute](https://github.com/AdamPflug/express-brute) by [Cyril Schumacher](https://github.com/cyrilschumacher) -* [:link:](express-brute-memcached/express-brute-memcached.d.ts) [express-brute-memcached](https://github.com/AdamPflug/express-brute-memcached) by [Cyril Schumacher](https://github.com/cyrilschumacher) -* [:link:](express-brute-mongo/express-brute-mongo.d.ts) [express-brute-mongo](https://github.com/auth0/express-brute-mongo) by [Cyril Schumacher](https://github.com/cyrilschumacher) -* [:link:](express-debug/express-debug.d.ts) [express-debug](https://github.com/devoidfury/express-debug) by [Federico Bond](https://github.com/federicobond) -* [:link:](express-graphql/express-graphql.d.ts) [express-graphql](https://www.npmjs.org/package/express-graphql) by [Isman Usoh](https://github.com/isman-usoh), [Nitin Tutlani](https://github.com/nitintutlani) -* [:link:](express-handlebars/express-handlebars.d.ts) [express-handlebars](https://github.com/ericf/express-handlebars) by [Sam Saint-Pettersen](https://github.com/stpettersens), [Igor Dultsev](https://github.com/yhaskell) -* [: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-minify/express-minify.d.ts) [express-minify](https://github.com/SummerWish/express-minify) by [Borislav Zhivkov](https://github.com/borislavjivkov) -* [:link:](express-myconnection/express-myconnection.d.ts) [express-myconnection](https://www.npmjs.org/package/express-myconnection) by [Michael Ferris](https://github.com/Cellule) -* [:link:](express-openapi/express-openapi.d.ts) [express-openapi 0.11.x](https://github.com/kogosoftwarellc/express-openapi) by [TANAKA Koichi](https://github.com/mugeso) -* [:link:](express-partials/express-partials.d.ts) [express-partials](https://github.com/publicclass/express-partials) by [jt000](https://github.com/jt000) -* [:link:](express-route-fs/express-route-fs.d.ts) [express-route-fs](https://github.com/kripod/express-route-fs) by [Kristóf Poduszló](https://github.com/kripod) -* [:link:](express-session/express-session.d.ts) [express-session](https://www.npmjs.org/package/express-session) by [Hiroki Horiuchi](https://github.com/horiuchi) -* [:link:](express-unless/express-unless.d.ts) [express-unless](https://www.npmjs.org/package/express-unless) by [Wonshik Kim](https://github.com/wokim) -* [:link:](express-useragent/express-useragent.d.ts) [express-useragent](https://www.npmjs.org/package/express-useragent) by [Isman Usoh](https://github.com/isman-usoh) -* [:link:](express-validator/express-validator.d.ts) [express-validator](https://github.com/ctavan/express-validator) by [Nathan Ridley](https://github.com/axefrog), [Jonathan Häberle](http://dreampulse.de) -* [:link:](extend/extend.d.ts) [extend](https://www.npmjs.com/package/extend) by [Stefan Steinhart](https://github.com/reppners) -* [:link:](wiiu/wiiu.d.ts) [Extended Functionality of Wii U Internet Browser](https://www.nintendo.co.jp/wiiu/hardware/internetbrowser/extended_functionality.html) by [MIZUSHIMA Junki](https://github.com/mzsm) -* [:link:](extended-listbox/extended-listbox.d.ts) [extended-listbox 1.1.x](https://github.com/code-chris/extended-listbox) by [Christian Kotzbauer](https://github.com/code-chris) -* [:link:](extjs/ExtJS.d.ts) [ExtJS](http://www.sencha.com/products/extjs) by [Brian Kotek](https://github.com/brian428) -* [: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:](falcor/falcor-browser.d.ts) [falcor](http://netflix.github.io/falcor) by [Quramy](https://github.com/Quramy) -* [:link:](falcor/falcor.d.ts) [falcor](http://netflix.github.io/falcor) by [Quramy](https://github.com/Quramy) -* [:link:](falcor-express/falcor-express.d.ts) [falcor-express](https://github.com/Netflix/falcor-express) by [Quramy](https://github.com/Quramy) -* [:link:](falcor-http-datasource/falcor-http-datasource.d.ts) [falcor-http-datasource](https://github.com/Netflix/falcor-http-datasource) by [Quramy](https://github.com/Quramy) -* [:link:](falcor-json-graph/falcor-json-graph.d.ts) [falcor-json-graph](https://github.com/Netflix/falcor-json-graph) by [Quramy](https://github.com/Quramy) -* [:link:](falcor-router/falcor-router.d.ts) [falcor-router](https://github.com/Netflix/falcor-router) by [Quramy](https://github.com/Quramy) -* [:link:](famous/famous.d.ts) [Famous Engine](http://famous.org) by [Boris Vasilenko](https://github.com/borisvasilenko) -* [:link:](fancybox/fancybox.d.ts) [fancyBox](https://github.com/fancyapps/fancyBox) by [Boris Yankov](https://github.com/borisyankov) -* [:link:](farbtastic/farbtastic.d.ts) [Farbtastic: jQuery Color Wheel](http://mattfarina.github.io/farbtastic) by [Matt Brooks](https://github.com/EnableSoftware) -* [:link:](fast-stats/fast-stats.d.ts) [fast-stats](https://github.com/bluesmoon/node-faststats) by [Rogier Schouten](https://github.com/rogierschouten) -* [:link:](fastclick/fastclick.d.ts) [FastClick](https://github.com/ftlabs/fastclick) by [Shinnosuke Watanabe](https://github.com/shinnn) -* [: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/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:](filesize/filesize.d.ts) [filesize](https://github.com/avoidwork/filesize.js) by [Giedrius Grabauskas](https://github.com/GiedriusGrabauskas) -* [:link:](finalhandler/finalhandler.d.ts) [finalhandler](https://github.com/pillarjs/finalhandler) by [Ilya Mochalov](https://github.com/chrootsu) -* [:link:](Finch/Finch.d.ts) [Finch](https://github.com/stoodder/finchjs) by [David Sichau](https://github.com/DavidSichau) -* [:link:](findup-sync/findup-sync.d.ts) [findup-sync](https://github.com/cowboy/node-findup-sync) by [Bart van der Schoor](https://github.com/Bartvds), [Nathan Brown](https://github.com/ngbrown) -* [: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), [Sebastien Dubois](https://github.com/dsebastien), [Szymon Stasik](https://github.com/ciekawy) -* [: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:](firebase-token-generator/firebase-token-generator.d.ts) [firebase-token-generator](https://github.com/firebase/firebase-token-generator-node) by [Hans Van den Keybus](https://github.com/dotdotcommadot) -* [: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:](flickity/flickity.d.ts) [Flickity](http://flickity.metafizzy.co) by [Chris McGrath](https://www.github.com/clmcgrath) -* [:link:](flight/flight.d.ts) [Flight](http://flightjs.github.com/flight) by [Jonathan Hedrén](https://github.com/jonathanhedren) -* [:link:](flightplan/flightplan.d.ts) [flightplan](https://github.com/pstadler/flightplan) by [Borislav Zhivkov](https://github.com/borislavjivkov) -* [: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), [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:](format-unicorn/format-unicorn.d.ts) [format-unicorn](https://github.com/tallesl/format-unicorn) by [kruncher](https://github.com/kruncher) -* [:link:](format-unicorn/format-unicorn-safe.d.ts) [format-unicorn](https://github.com/tallesl/format-unicorn) by [kruncher](https://github.com/kruncher) -* [: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.d.ts) [freedom](https://github.com/freedomjs/freedom) by [Jonathan Pevarnek](https://github.com/jpevarnek) -* [:link:](freedom/freedom-module-env.d.ts) [freedom](https://github.com/freedomjs/freedom) by [Jonathan Pevarnek](https://github.com/jpevarnek) -* [:link:](freeport/freeport.d.ts) [freeport](https://github.com/daaku/nodejs-freeport) by [Arne Schubert](https://github.com/atd-schubert) -* [:link:](from/from.d.ts) [from](https://github.com/dominictarr/from) by [Bart van der Schoor](https://github.com/Bartvds) -* [:link:](fromjs/fromjs.d.ts) [fromjs](https://github.com/suckgamony/fromjs) by [Glenn Dierckx](https://github.com/glenndierckx) -* [:link:](fromnow/fromnow.d.ts) [fromnow](https://github.com/lukeed/fromNow) by [Martin Bukovics](https://github.com/marinewater) -* [: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) -* [:link:](fs-extra-promise/fs-extra-promise.d.ts) [fs-extra-promise](https://github.com/overlookmotel/fs-extra-promise) by [midknight41](https://github.com/midknight41), [Jason Swearingen](https://github.com/jasonswearingen) -* [:link:](fs-finder/fs-finder.d.ts) [fs-finder](https://github.com/sakren/node-fs-finder) by [Michael Zabka](https://github.com/misak113) -* [:link:](fs-mock/fs-mock.d.ts) [fs-mock](https://github.com/sakren/node-fs-mock) by [Rogier Schouten](https://github.com/rogierschouten) -* [:link:](ftdomdelegate/ftdomdelegate.d.ts) [ftdomdelegate](https://github.com/ftlabs/ftdomdelegate) by [Christian Holm Nielsen](https://github.com/dotnetnerd) -* [:link:](ftp/ftp.d.ts) [ftp](https://github.com/mscdex/node-ftp) by [Rogier Schouten](https://github.com/rogierschouten) -* [:link:](ftpd/ftpd.d.ts) [ftpd](https://github.com/sstur/nodeftpd) by [Rogier Schouten](https://github.com/rogierschouten) -* [:link:](fullCalendar/fullCalendar.d.ts) [FullCalendar](http://arshaw.com/fullcalendar) by [Neil Stalker](https://github.com/nestalk), [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) -* [:link:](gamequery/gamequery.d.ts) [gameQuery](http://gamequeryjs.com) by [David Laubreiter](https://github.com/Laubi) -* [:link:](gandi-livedns/gandi-livedns.d.ts) [Gandi LiveDNS](http://doc.livedns.gandi.net) by [Xavier Stouder](https://github.com/xstoudi) -* [:link:](gently/gently.d.ts) [gently](https://www.npmjs.org/package/gently) by [bonnici](https://github.com/bonnici) -* [:link:](geoip-lite/geoip-lite.d.ts) [GeoIP-lite](https://github.com/bluesmoon/node-geoip) by [Yuce Tekol](http://yuce.me) -* [:link:](geojson/geojson.d.ts) [GeoJSON Format Specification](http://geojson.org) by [Jacob Bruun](https://github.com/cobster) -* [:link:](geometry-dom/geometry-dom.d.ts) [Geometry Format Specification](http://www.w3.org/TR/geometry-1) by [Toshiya Nakakura](https://github.com/nakakura) -* [:link:](giraffe/giraffe.d.ts) [Giraffe](https://github.com/barc/backbone.giraffe) by [Matt McCray](https://github.com/darthapo) -* [:link:](git-config/git-config.d.ts) [git-config](https://github.com/eugeneware/git-config) by [Sam Saint-Pettersen](https://github.com/stpettersens) -* [:link:](gl-matrix/gl-matrix.d.ts) [gl-matrix](https://github.com/toji/gl-matrix) by [Tat](https://github.com/tatchx) -* [: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.content.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.maps.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.mail.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.lock.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.language.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.contacts.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.charts.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.calendar.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.cache.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.base.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.script.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.jdbc.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.gmail.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.forms.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.html.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.xml-service.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.utilities.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.url-fetch.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.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.types.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.spreadsheet.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.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.properties.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.document.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.optimization.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.groups.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.drive.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google.feeds/google.feed.api.d.ts) [Google Feed Apis](https://developers.google.com/feed) by [RodneyJT](https://github.com/RodneyJT) -* [:link:](google.geolocation/google.geolocation.d.ts) [Google Geolocation](https://code.google.com/p/geo-location-javascript) by [Vincent Bortone](https://github.com/vbortone) -* [:link:](googlemaps/google.maps.d.ts) [Google Maps JavaScript API](https://developers.google.com/maps) by [Folia A/S](http://www.folia.dk), [Chris Wrench](https://github.com/cgwrench) -* [:link:](gapi.pagespeedonline/gapi.pagespeedonline.d.ts) [Google Page Speed Online Api](https://developers.google.com/speed/pagespeed) by [Frank M](https://github.com/sgtfrankieboy) -* [:link:](google.picker/google.picker.d.ts) [Google Picker API](https://developers.google.com/picker) by [grapswiz](https://github.com/grapswiz) -* [:link:](google-drive-realtime-api/google-drive-realtime-api.d.ts) [Google Realtime API](https://developers.google.com/google-apps/realtime) by [Dustin Wehr](http://cs.toronto.edu/~wehr) -* [:link:](recaptcha/recaptcha.d.ts) [Google Recaptcha](https://www.google.com/recaptcha) by [Brent Jenkins](https://github.com/brentj73) -* [:link:](grecaptcha/grecaptcha.d.ts) [Google Recaptcha v2](https://www.google.com/recaptcha) by [Kristof Mattei](http://kristofmattei.be) -* [:link:](gapi.auth2/gapi.auth2.d.ts) [Google Sign-In API](https://developers.google.com/identity/sign-in/web) by [Derek Lawless](https://github.com/flawless2011) -* [:link:](gapi.translate/gapi.translate.d.ts) [Google Translate API](https://developers.google.com/translate) by [Frank M](https://github.com/sgtfrankieboy) -* [:link:](gapi.urlshortener/gapi.urlshortener.d.ts) [Google Url Shortener API](https://developers.google.com/url-shortener) by [Frank M](https://github.com/sgtfrankieboy) -* [:link:](google.visualization/google.visualization.d.ts) [Google Visualisation Apis](https://developers.google.com/chart) by [Dan Ludwig](https://github.com/danludwig) -* [:link:](google-closure-compiler/google-closure-compiler.d.ts) [google-closure-compiler](https://github.com/chadkillingsworth/closure-compiler-npm) by [Evan Martin](http://neugierig.org) -* [:link:](google-maps/google-maps.d.ts) [google-maps](https://www.npmjs.com/package/google-maps) by [Deividas Bakanas](https://github.com/DeividasBakanas), [Giedrius Grabauskas](https://github.com/GiedriusGrabauskas) -* [:link:](gae.channel.api/gae.channel.api.d.ts) [GoogleAppEngine's Channel API](https://developers.google.com/appengine/docs/java/channel/javascript) by [vvakame](https://github.com/vvakame) -* [:link:](graceful-fs/graceful-fs.d.ts) [graceful-fs](https://github.com/cowboy/graceful-fs) by [Bart van der Schoor](https://github.com/Bartvds) -* [:link:](graham_scan/graham_scan.d.ts) [graham_scan](https://github.com/brian3kb/graham_scan_js) by [Harm Berntsen](https://github.com/hberntsen) -* [:link:](graphene-pk11/graphene-pk11.d.ts) [graphene-pk11](https://github.com/PeculiarVentures/graphene) by [Stepan Miroshin](https://github.com/microshine) -* [:link:](graphviz/graphviz.d.ts) [Graphviz](https://github.com/glejeune/node-graphviz) by [Matt Frantz](https://github.com/mhfrantz) -* [:link:](gravatar/gravatar.d.ts) [gravatar](https://github.com/emerleite/node-gravatar) by [Denis Sokolov](https://github.com/denis-sokolov) -* [:link:](qrcode-generator/qrcode-generator.d.ts) [grcode-generator](https://github.com/kazuhikoarase/qrcode-generator) by [Stefan Huber](https://github.com/stefanhuber) -* [:link:](greasemonkey/greasemonkey.d.ts) [Greasemonkey](http://www.greasespot.net) by [Kota Saito](https://github.com/kotas) -* [:link:](greensock/greensock.d.ts) [GreenSock Animation Platform](http://www.greensock.com/get-started-js) by [Robert S](https://github.com/codebelt) -* [:link:](gridfs-stream/gridfs-stream.d.ts) [gridfs-stream](https://github.com/aheckmann/gridfs-stream) by [Lior Mualem](https://github.com/liorm) -* [:link:](gridstack/gridstack.d.ts) [Gridstack](http://troolee.github.io/gridstack.js) by [Pascal Senn](https://github.com/PascalSenn) -* [:link:](gruntjs/gruntjs.d.ts) [Grunt 0.4.x](http://gruntjs.com) by [Jeff May](https://github.com/jeffmay), [Basarat Ali Syed](https://github.com/basarat) -* [:link:](gsap/Ease.d.ts) [GSAP](http://greensock.com) by [VILIC VANE](https://vilic.github.io) -* [:link:](gsap/Core.d.ts) [GSAP](http://greensock.com) by [VILIC VANE](https://vilic.github.io) -* [:link:](gsap/TweenLite.d.ts) [GSAP](http://greensock.com) by [VILIC VANE](https://vilic.github.io) -* [:link:](gulp/gulp.d.ts) [Gulp v3.8.x](http://gulpjs.com) by [Drew Noakes](https://drewnoakes.com) -* [:link:](gulp-autoprefixer/gulp-autoprefixer.d.ts) [gulp-autoprefixer](https://github.com/sindresorhus/gulp-autoprefixer) by [Asana](https://asana.com) -* [: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) -* [:link:](gulp-coffeeify/gulp-coffeeify.d.ts) [gulp-coffeeify](https://github.com/nariyu/gulp-coffeeify) by [Qubo](https://github.com/tkQubo) -* [: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-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) -* [:link:](gulp-filter/gulp-filter.d.ts) [gulp-filter](https://github.com/sindresorhus/gulp-filter) by [Tanguy Krotoff](https://github.com/tkrotoff) -* [:link:](gulp-flatten/gulp-flatten.d.ts) [gulp-flatten](https://github.com/armed/gulp-flatten) by [Keita Kagurazaka](https://github.com/k-kagurazaka) -* [:link:](gulp-gh-pages/gulp-gh-pages.d.ts) [gulp-gh-pages](https://github.com/rowoot/gulp-gh-pages) by [Asana](https://asana.com) -* [:link:](gulp-gzip/gulp-gzip.d.ts) [gulp-gzip](https://github.com/jstuckey/gulp-gzip) by [Qubo](https://github.com/tkQubo) -* [:link:](gulp-help/gulp-help.d.ts) [gulp-help](https://github.com/chmontgomery/gulp-help) by [Qubo](https://github.com/tkQubo) -* [:link:](gulp-html-replace/gulp-html-replace.d.ts) [gulp-html-replace](https://www.npmjs.com/package/gulp-html-replace) by [Peter Juras](https://github.com/peterjuras) -* [:link:](gulp-htmlmin/gulp-htmlmin.d.ts) [gulp-htmlmin](https://github.com/jonschlinkert/gulp-htmlmin) by [Tanguy Krotoff](https://github.com/tkrotoff) -* [:link:](gulp-if/gulp-if.d.ts) [gulp-if](https://github.com/robrich/gulp-if) by [Asana](https://asana.com), [Joe Skeen](http://github.com/joeskeen) -* [:link:](gulp-inject/gulp-inject.d.ts) [gulp-inject](https://github.com/klei/gulp-inject) by [Keita Kagurazaka](https://github.com/k-kagurazaka) -* [:link:](gulp-install/gulp-install.d.ts) [gulp-install](https://www.npmjs.com/package/gulp-install) by [Peter Juras](https://github.com/peterjuras) -* [:link:](gulp-istanbul/gulp-istanbul.d.ts) [gulp-istanbul](https://github.com/SBoudrias/gulp-istanbul) by [Asana](https://asana.com) -* [:link:](gulp-jade/gulp-jade.d.ts) [gulp-jade](https://github.com/phated/gulp-jade) by [berwyn](https://github.com/berwyn) -* [:link:](gulp-jasmine-browser/gulp-jasmine-browser.d.ts) [gulp-jasmine-browser](https://github.com/jasmine/gulp-jasmine-browser) by [Tanguy Krotoff](https://github.com/tkrotoff) -* [:link:](gulp-json-editor/gulp-json-editor.d.ts) [gulp-json-editor](https://www.npmjs.com/package/gulp-json-editor) by [Peter Juras](https://github.com/peterjuras) -* [:link:](gulp-jspm/gulp-jspm.d.ts) [gulp-jspm](https://www.npmjs.com/package/gulp-jspm) by [Peter Juras](https://github.com/peterjuras) -* [:link:](gulp-less/gulp-less.d.ts) [gulp-less](https://github.com/plus3network/gulp-less) by [Keita Kagurazaka](https://github.com/k-kagurazaka) -* [:link:](gulp-load-plugins/gulp-load-plugins.d.ts) [gulp-load-plugins](https://github.com/jackfranklin/gulp-load-plugins) by [Joe Skeen](http://github.com/joeskeen) -* [:link:](gulp-minify-css/gulp-minify-css.d.ts) [gulp-minify-css](https://github.com/jonathanepollack/gulp-minify-css) by [Keita Kagurazaka](https://github.com/k-kagurazaka) -* [:link:](gulp-minify-html/gulp-minify-html.d.ts) [gulp-minify-html](https://github.com/murphydanger/gulp-minify-html) by [Tanguy Krotoff](https://github.com/tkrotoff) -* [:link:](gulp-mocha/gulp-mocha.d.ts) [gulp-mocha](https://github.com/sindresorhus/gulp-mocha) by [Asana](https://asana.com) -* [:link:](gulp-newer/gulp-newer.d.ts) [gulp-newer](https://github.com/tschaub/gulp-newer) by [Thomas Corbière](https://github.com/tomc974) -* [:link:](gulp-ng-annotate/gulp-ng-annotate.d.ts) [gulp-ng-annotate](https://github.com/Kagami/gulp-ng-annotate) by [Qubo](https://github.com/tkQubo) -* [:link:](gulp-nodemon/gulp-nodemon.d.ts) [gulp-nodemon](https://github.com/JacksonGariety/gulp-nodemon) by [Qubo](https://github.com/tkQubo) -* [:link:](gulp-plumber/gulp-plumber.d.ts) [gulp-plumber](https://github.com/floatdrop/gulp-plumber) by [Joe Skeen](http://github.com/joeskeen) -* [:link:](gulp-protractor/gulp-protractor.d.ts) [gulp-protractor](https://github.com/mllrsohn/gulp-protractor) by [Tanguy Krotoff](https://github.com/tkrotoff) -* [: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) -* [:link:](gulp-shell/gulp-shell.d.ts) [gulp-shell](https://github.com/sun-zheng-an/gulp-shell) by [Qubo](https://github.com/tkqubo) -* [:link:](gulp-size/gulp-size.d.ts) [gulp-size](https://github.com/sindresorhus/gulp-size) by [Tanguy Krotoff](https://github.com/tkrotoff) -* [:link:](gulp-sort/gulp-sort.d.ts) [gulp-sort](https://github.com/pgilad/gulp-sort) by [Joe Skeen](http://github.com/joeskeen) -* [:link:](gulp-sourcemaps/gulp-sourcemaps.d.ts) [gulp-sourcemaps](https://github.com/floridoo/gulp-sourcemaps) by [Asana](https://asana.com) -* [:link:](gulp-strip-debug/gulp-strip-debug.d.ts) [gulp-strip-debug](https://www.npmjs.com/package/gulp-strip-debug) by [Peter Juras](https://github.com/peterjuras) -* [:link:](gulp-svg-sprite/gulp-svg-sprite.d.ts) [gulp-svg-sprite](https://github.com/jkphl/gulp-svg-sprite) by [Qubo](https://github.com/tkqubo) -* [:link:](gulp-task-listing/gulp-task-listing.d.ts) [gulp-task-listing](https://github.com/OverZealous/gulp-task-listing) by [Joe Skeen](http://github.com/joeskeen) -* [:link:](gulp-tsd/gulp-tsd.d.ts) [gulp-tsd](https://github.com/moznion/gulp-tsd) by [Keita Kagurazaka](https://github.com/k-kagurazaka) -* [:link:](gulp-tslint/gulp-tslint.d.ts) [gulp-tslint](https://github.com/panuhorsmalahti/gulp-tslint) by [Asana](https://asana.com) -* [:link:](gulp-typedoc/gulp-typedoc.d.ts) [gulp-typedoc](https://github.com/rogierschouten/gulp-typedoc) by [Asana](https://asana.com) -* [:link:](gulp-typescript/gulp-typescript.d.ts) [gulp-typescript](https://github.com/ivogabe/gulp-typescript) by [Asana](https://asana.com), [Thomas Corbière](https://github.com/tomc974) -* [:link:](gulp-uglify/gulp-uglify.d.ts) [gulp-uglify](https://github.com/terinjokes/gulp-uglify) by [Christopher Haws](https://github.com/ChristopherHaws) -* [:link:](gulp-useref/gulp-useref.d.ts) [gulp-useref](https://github.com/jonkemp/gulp-useref) by [Tanguy Krotoff](https://github.com/tkrotoff) -* [:link:](gulp-util/gulp-util.d.ts) [gulp-util v3.0.x](https://github.com/gulpjs/gulp-util) by [jedmao](https://github.com/jedmao) -* [:link:](gulp-watch/gulp-watch.d.ts) [gulp-watch](https://github.com/floatdrop/gulp-watch) by [Tanguy Krotoff](https://github.com/tkrotoff) -* [:link:](hammerjs/hammerjs.d.ts) [Hammer.js](http://hammerjs.github.io) by [Philip Bulley](https://github.com/milkisevil), [Han Lin Yap](https://github.com/codler) -* [:link:](handlebars/handlebars.d.ts) [Handlebars](http://handlebarsjs.com) by [Boris Yankov](https://github.com/borisyankov) -* [:link:](handsontable/handsontable.d.ts) [Handsontable](https://handsontable.com) by [Handsoncode sp. z o.o.](http://handsoncode.net) -* [:link:](hapi/hapi.d.ts) [hapi](http://github.com/spumko/hapi) by [Jason Swearingen](http://github.com/jasonswearingen) -* [:link:](harmony-proxy/harmony-proxy.d.ts) [harmony-proxy](https://www.npmjs.com/package/harmony-proxy) by [Remo Jansen](https://github.com/remojansen) -* [:link:](hasher/hasher.d.ts) [Hasher.js](https://github.com/millermedeiros/hasher) by [flyfishMT](https://github.com/flyfishMT) -* [:link:](hashids/hashids.d.ts) [Hashids.js 1.x](https://github.com/ivanakimov/hashids.node.js) by [Paulo Cesar](https://github.com/pocesar) -* [:link:](hashmap/hashmap.d.ts) [HashMap](https://github.com/flesler/hashmap) by [Rafał Wrzeszcz](http://wrzasq.pl), [Vasya Aksyonov](https://github.com/outring) -* [:link:](he/he.d.ts) [he](https://github.com/mathiasbynens/he) by [Simon Edwards](https://github.com/sedwards2009) -* [:link:](Headroom/headroom.d.ts) [headroom.js](http://wicky.nillia.ms/headroom.js) by [Jakub Olek](https://github.com/hakubo) -* [:link:](heap/heap.d.ts) [heap](https://github.com/qiao/heap.js) by [Ryan McNamara](https://github.com/ryan10132) -* [:link:](heatmap.js/heatmap.d.ts) [heatmap.js](https://github.com/pa7/heatmap.js) by [Yang Guan](https://github.com/lookuptable) -* [:link:](hellojs/hellojs.d.ts) [hello.js](http://adodson.com/hello.js) by [Pavel Zika](https://github.com/PavelPZ) -* [:link:](helmet/helmet.d.ts) [helmet](https://github.com/helmetjs/helmet) by [Cyril Schumacher](https://github.com/cyrilschumacher), [Evan Hahn](https://github.com/EvanHahn) -* [:link:](highcharts/highcharts.d.ts) [Highcharts](http://www.highcharts.com) by [Damiano Gambarotto](http://github.com/damianog), [Dan Lewi Harkestad](http://github.com/baltie) -* [:link:](highcharts-ng/highcharts-ng.d.ts) [highcharts-ng](https://github.com/pablojim/highcharts-ng) by [Scott Hatcher](https://github.com/scatcher) -* [:link:](highland/highland.d.ts) [Highland](http://highlandjs.org) by [Bart van der Schoor](https://github.com/Bartvds) -* [: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](https://github.com/sergey-buturlakin), [Nathan Brown](https://github.com/ngbrown) -* [: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-entities/html-entities.d.ts) [html-entities](https://www.npmjs.com/package/html-entities) by [Xavier Stouder](https://github.com/xstoudi) -* [:link:](html-to-text/html-to-text.d.ts) [html-to-text](https://github.com/werk85/node-html-to-text) by [Eryk Warren](https://github.com/erykwarren) -* [:link:](html2canvas/html2canvas.d.ts) [html2canvas.js](https://github.com/niklasvh/html2canvas) by [Richard Hepburn](https://github.com/rwhepburn) -* [:link:](html-minifier/html-minifier.d.ts) [HTMLMinifier](https://github.com/kangax/html-minifier) by [Tanguy Krotoff](https://github.com/tkrotoff) -* [: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:](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:](i18next/i18next.d.ts) [i18next](http://i18next.com) by [Michael Ledin](https://github.com/mxl) -* [:link:](ng-i18next/ng-i18next.d.ts) [i18next](https://github.com/i18next/ng-i18next) by [Cyril Schumacher](https://github.com/cyrilschumacher) -* [:link:](i18next-browser-languagedetector/i18next-browser-languagedetector.d.ts) [i18next-browser-languagedetector](http://i18next.com) by [Cyril Schumacher](https://github.com/cyrilschumacher) -* [:link:](i18next-express-middleware/i18next-express-middleware.d.ts) [i18next-express-middleware](http://i18next.com) by [Cyril Schumacher](https://github.com/cyrilschumacher) -* [:link:](i18next-node-fs-backend/i18next-node-fs-backend.d.ts) [i18next-node-fs-backend](https://github.com/i18next/i18next-node-fs-backend) by [Cyril Schumacher](https://github.com/cyrilschumacher) -* [:link:](i18next-sprintf-postprocessor/i18next-sprintf-postprocessor.d.ts) [i18next-sprintf-postProcessor](https://github.com/i18next/i18next-sprintf-postProcessor) 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:](ibm-mobilefirst/ibm-mobilefirst.d.ts) [IBM MobileFirst Platform Foundation](http://www.ibm.com/software/products/en/mobilefirstfoundation) by [Guillermo Ignacio Enriquez Gutierrez](https://github.com/nacho4d) -* [:link:](icepick/icepick.d.ts) [icepick](https://github.com/aearly/icepick) by [Nathan Brown](https://github.com/ngbrown) -* [:link:](icheck/icheck.d.ts) [iCheck](http://damirfoy.com/iCheck) by [Dániel Tar](https://github.com/qcz) -* [:link:](iconv/iconv.d.ts) [iconv](https://github.com/bnoordhuis/node-iconv) by [delphinus](https://github.com/delphinus35) -* [:link:](image-size/image-size.d.ts) [image-size](https://github.com/image-size/image-size) by [Elisée MAURER](https://github.com/elisee) -* [:link:](imagemagick/imagemagick.d.ts) [imagemagick](http://github.com/rsms/node-imagemagick) by [Carlos Ballesteros Velasco](https://github.com/soywiz) -* [:link:](imagemagick-native/imagemagick-native.d.ts) [imagemagick-native](https://www.npmjs.org/package/imagemagick-native) by [Hiroki Horiuchi](https://github.com/horiuchi) -* [:link:](imagesloaded/imagesloaded.d.ts) [imagesLoaded](https://github.com/desandro/imagesloaded) by [Chris Charabaruk](http://github.com/coldacid) -* [:link:](imap/imap.d.ts) [imap](https://www.npmjs.com/package/imap) by [Peter Snider](https://github.com/psnider) -* [:link:](imgur-rest-api/imgur-rest-api.d.ts) [Imgur REST API v3](https://api.imgur.com) by [Luke William Westby](http://github.com/lukewestby) -* [:link:](immutability-helper/immutability-helper.d.ts) [immutability-helper](https://github.com/kolodny/immutability-helper) by [Sean Kelley](https://github.com/seansfkelley) -* [:link:](impress/impress.d.ts) [Impress.js](https://github.com/bartaz/impress.js) by [Boris Yankov](https://github.com/borisyankov) -* [:link:](incremental-dom/incremental-dom.d.ts) [Incremetal DOM](https://github.com/google/incremental-dom) by [Basarat Ali Syed](https://github.com/basarat), [Markus Lanthaler](https://github.com/lanthaler) -* [:link:](inflected/inflected.d.ts) [inflected](https://github.com/martinandert/inflected) by [Daniel Schmidt](https://github.com/dsci) -* [:link:](inflection/inflection.d.ts) [inflection](https://github.com/dreamerslab/node.inflection) by [Shogo Iwano](https://github.com/shiwano) -* [:link:](inherits/inherits.d.ts) [inherits](https://github.com/isaacs/inherits) by [Ilya Mochalov](https://github.com/chrootsu) -* [: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:](cordova-plugin-insomnia/cordova-plugin-insomnia.d.ts) [Insomnia-PhoneGap-Plugin](https://github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin) by [Markus Wagner](https://github.com/Ritzlgrmft) -* [: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:](invariant/invariant.d.ts) [invariant](https://github.com/zertosh/invariant) by [MichaelBennett](https://github.com/bennett000) -* [:link:](inversify/inversify.d.ts) [inversify](https://github.com/inversify/InversifyJS) by [inversify](https://github.com/inversify) -* [:link:](ionic/ionic.d.ts) [Ionic](http://ionicframework.com) by [Spencer Williams](https://github.com/spencerwi) -* [:link:](cordova-ionic/cordova-ionic.d.ts) [Ionic Cordova plugins](https://github.com/driftyco) by [Hendrik Maus](https://github.com/hendrikmaus) -* [:link:](ioredis/ioredis.d.ts) [ioredis](https://github.com/luin/ioredis) by [York Yao](https://github.com/plantain-00) -* [:link:](irc/irc.d.ts) [irc](https://github.com/martynsmith/node-irc) by [phillips1012](https://github.com/phillips1012) -* [:link:](is-lower-case/is-lower-case.d.ts) [is-lower-case](https://github.com/blakeembrey/is-lower-case) by [Sam Saint-Pettersen](https://github.com/stpettersens) -* [:link:](is-my-json-valid/is-my-json-valid.d.ts) [is-my-json-valid](https://github.com/mafintosh/is-my-json-valid) by [kruncher](https://github.com/kruncher) -* [:link:](is-upper-case/is-upper-case.d.ts) [is-upper-case](https://github.com/blakeembrey/is-upper-case) by [Sam Saint-Pettersen](https://github.com/stpettersens) -* [:link:](is-url/is-url.d.ts) [is-url](https://github.com/segmentio/is-url) by [Ryota Murohoshi](https://github.com/RyotaMurohoshi) -* [:link:](is_js/is_js.d.ts) [is.js](http://arasatasaygin.github.io/is.js) by [Rodrigo Cabral](https://github.com/cabralRodrigo) -* [:link:](iscroll/iscroll.d.ts) [iScroll](http://cubiq.org/iscroll-4) by [Boris Yankov](https://github.com/borisyankov), [Christiaan Rakowski](https://github.com/csrakowski) -* [:link:](iscroll/iscroll-5.d.ts) [iScroll 5](http://cubiq.org/iscroll-5-ready-for-beta-test) by [Christiaan Rakowski](https://github.com/csrakowski) -* [: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:](isomorphic-fetch/isomorphic-fetch.d.ts) [isomorphic-fetch](https://github.com/matthew-andrews/isomorphic-fetch) by [Todd Lucas](https://github.com/toddlucas) -* [: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) -* [:link:](jake/jake.d.ts) [jake](https://github.com/mde/jake) by [Kon](http://phyzkit.net) -* [:link:](jasmine/jasmine.d.ts) [Jasmine](http://jasmine.github.io) by [Boris Yankov](https://github.com/borisyankov), [Theodore Brown](https://github.com/theodorejb), [David Pärsson](https://github.com/davidparsson) -* [: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) -* [:link:](jasmine-node/jasmine-node.d.ts) [jasmine-node](https://github.com/mhevery/jasmine-node) by [Sven Reglitzki](https://github.com/svi3c) -* [:link:](jasmine-promise-matchers/jasmine-promise-matchers.d.ts) [jasmine-promise-matchers](https://github.com/bvaughn/jasmine-promise-matchers) by [Matthew Hill](https://github.com/matthewjh) -* [:link:](java/java.d.ts) [java](https://github.com/joeferner/node-java) by [Jim Lloyd](https://github.com/jimlloyd) -* [: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-astar/javascript-astar.d.ts) [javascript-astar](https://github.com/bgrins/javascript-astar) by [brian ridley](https://github.com/ptlis) -* [: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:](meteor-jboulhous-dev/meteor-jboulhous-dev.d.ts) [jboulhous:dev](https://github.com/jboulhous/dev) by [Robbie Van Gorkom](https://github.com/vangorra) -* [: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) -* [:link:](jfp/jfp.d.ts) [JFP](http://cmstead.github.io/JFP) by [Chris Stead](http://www.chrisstead.com) -* [:link:](jjv/jjv.d.ts) [JJV](https://github.com/acornejo/jjv) by [Wim Looman](https://github.com/Nemo157) -* [: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), [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) -* [:link:](jquery.blockUI/jquery.blockUI.d.ts) [jQuery BlockUI Plugin](http://malsup.com/jquery/block) by [Jeffrey Lee](http://blog.darkthread.net) -* [:link:](jquery.cleditor/jquery.cleditor.d.ts) [jQuery CLEditor Plugin](http://premiumsoftware.net/CLEditor) by [Jeffery Grajkowski](https://github.com/pushplay) -* [:link:](jquery.colorpicker/jquery.colorpicker.d.ts) [jQuery Colorpicker Plugin](https://github.com/vanderlee/colorpicker) by [Jeffery Grajkowski](https://github.com/pushplay) -* [:link:](jquery.contextMenu/jquery.contextMenu.d.ts) [jQuery contextMenu](http://medialize.github.com/jQuery-contextMenu) by [Natan Vivo](https://github.com/nvivo) -* [:link:](jquery.cookie/jquery.cookie.d.ts) [jQuery Cookie Plugin](https://github.com/carhartl/jquery-cookie) by [Roy Goode](https://github.com/RoyGoode), [Ben Lorantfy](https://github.com/BenLorantfy) -* [:link:](jquery-cropbox/jquery-cropbox.d.ts) [jQuery cropbox](https://github.com/acornejo/jquery-cropbox) by [Per Kastman](https://github.com/PerKastman) -* [:link:](jquery.cycle2/jquery.cycle2.d.ts) [jQuery Cycle2 version (build 20140216)](http://jquery.malsup.com/cycle2) by [Donny Nadolny](https://github.com/dnadolny) -* [:link:](datatables.net/index.d.ts) [JQuery DataTables](http://www.datatables.net) by [Kiarash Ghiaseddin](https://github.com/Silver-Connection/DefinitelyTyped), [Omid Rad](https://github.com/omidkrad), [Armin Sander](https://github.com/pragmatrix) -* [:link:](datatables.net-buttons/index.d.ts) [JQuery DataTables Buttons extension](http://datatables.net/extensions/buttons) by [Sam Germano](https://github.com/SammyG4Free) -* [:link:](jquery.fileupload/jquery.fileupload.d.ts) [jQuery File Upload Plugin](https://github.com/blueimp/jQuery-File-Upload) by [Rob Alarcon](https://github.com/rob-alarcon) -* [:link:](jquery.joyride/jquery.joyride.d.ts) [jQuery JoyRide Plugin](https://github.com/zurb/joyride) by [Vincent Bortone](https://github.com/vbortone) -* [:link:](jqgrid/jqgrid.d.ts) [jQuery jqgrid Plugin](https://github.com/tonytomov/jqGrid) by [Lokesh Peta](https://github.com/lokeshpeta) -* [: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-mockjax/jquery-mockjax.d.ts) [jQuery Mockjax](https://github.com/jakerella/jquery-mockjax) by [Laszlo Jakab](https://github.com/laszlojakab), [Vladimir Đokić](https://github.com/vladeck) -* [: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) -* [:link:](jquery.postMessage/jquery.postMessage.d.ts) [jQuery postMessage](http://benalman.com/projects/jquery-postmessage-plugin) by [Junle Li](https://github.com/lijunle) -* [:link:](jquery.prettyphoto/jquery.prettyphoto.d.ts) [jQuery prettyPhoto](https://github.com/scaron/prettyphoto) by [pgaske](https://github.com/pgaske) -* [:link:](jquery.rowGrid/jquery.rowGrid.d.ts) [jQuery rowGrid.js plugin (v1.0.2)](https://github.com/brunjo/rowGrid.js) by [Vinayak Garg](https://github.com/vinayak-garg) -* [:link:](royalslider/royalslider.d.ts) [jQuery royal-slider](http://dimsemenov.com/plugins/royal-slider/documentation) by [Christiaan Rakowski](https://github.com/csrakowski) -* [:link:](jquery.simplePagination/jquery.simplePagination.d.ts) [jQuery simplePagination.js](https://github.com/flaviusmatis/simplePagination.js) by [Natan Vivo](https://github.com/nvivo) -* [:link:](jquery-sortable/jquery-sortable.d.ts) [jQuery Sortable](http://johnny.github.io/jquery-sortable) by [Nathan Pitman](https://github.com/Seltzer) -* [:link:](succinct/succinct.d.ts) [jQuery Succinct](http://mikeking.io/succinct) by [Matt Brooks](https://github.com/EnableSoftware) -* [:link:](jquery.tagsmanager/jquery.tagsmanager.d.ts) [jQuery Tags Manager](http://welldonethings.com/tags/manager) by [Vincent Bortone](https://github.com/vbortone) -* [:link:](jquery.tinycarousel/jquery.tinycarousel.d.ts) [jQuery tinycarousel](http://baijs.nl/tinycarousel) by [Christiaan Rakowski](https://github.com/csrakowski) -* [:link:](jquery.tinyscrollbar/jquery.tinyscrollbar.d.ts) [jQuery tinyscrollbar](http://baijs.nl/tinyscrollbar) by [Christiaan Rakowski](https://github.com/csrakowski) -* [:link:](jquery.tooltipster/jquery.tooltipster.d.ts) [jQuery Tooltipster](https://github.com/iamceege/tooltipster) by [Patrick Magee](https://github.com/pjmagee) -* [:link:](jquery.ui.datetimepicker/jquery.ui.datetimepicker.d.ts) [jQuery UI DateTimePicker](http://trentrichardson.com/examples/timepicker) by [dougajmcdonald](https://github.com/dougajmcdonald) -* [:link:](jquery.ui.layout/jquery.ui.layout.d.ts) [jQuery UI Layout Plug-in](http://layout.jquery-dev.net) by [Steve Fenton](https://github.com/Steve-Fenton), [Douglas Armstrong](https://github.com/drarmstr) -* [:link:](jquery.timepicker/jquery.timepicker.d.ts) [jQuery UI Timepicker](http://fgelinas.com/code/timepicker) by [Anwar Javed](https://github.com/anwarjaved) -* [:link:](jquery-ajax-chain/jquery-ajax-chain.d.ts) [jquery-ajax-chain v](https://github.com/humana-fragilitas/jQuery-Ajax-Chain) by [Andrea Blasio](https://github.com/humana-fragilitas) -* [:link:](bootpag/bootpag.d.ts) [jQuery-Bootpag](http://botmonster.com/jquery-bootpag) by [MAF.DAP / Romain Deneau](https://github.com/rdeneau) -* [:link:](jquery-easy-loading/jquery-easy-loading.d.ts) [jquery-easy-loading](http://carlosbonetti.github.io/jquery-loading) by [delphinus](https://github.com/delphinus35) -* [:link:](jquery-fullscreen/jquery-fullscreen.d.ts) [jquery-fullscreen](https://github.com/kayahr/jquery-fullscreen-plugin) by [Bruno Grieder](https://github.com/bgrieder) -* [:link:](jquery-handsontable/jquery-handsontable.d.ts) [jquery-handsontable](http://handsontable.com) by [Ted John](https://github.com/intelorca) -* [:link:](jquery.menuaim/jquery.menuaim.d.ts) [jQuery-menu-aim](https://github.com/kamens/jQuery-menu-aim) by [Robert Fonseca-Ensor](http://www.robfe.com) -* [:link:](jquery.pjax/jquery.pjax.d.ts) [jquery-pjax](https://github.com/defunkt/jquery-pjax) by [Junle Li](https://github.com/lijunle) -* [:link:](jquery-timeentry/jquery-timeentry.d.ts) [jQuery-timeentry.js](https://github.com/kbwood/timeentry) by [Mark Nadig](https://github.com/marknadig) -* [:link:](jquery-urlparam/jquery-urlparam.d.ts) [jquery-urlparam](https://gist.github.com/stpettersens/e1f4478f299b6f4905c1) by [Sam Saint-Pettersen](https://github.com/stpettersens) -* [:link:](jquery.address/jquery.address.d.ts) [jQuery.Address](https://github.com/asual/jquery-address) by [Martin Duparc](https://github.com/martinduparc), [Tim Klingeleers](https://github.com/mardaneus86) -* [:link:](jquery.ajaxfile/jquery.ajaxFile.d.ts) [jquery.ajaxfile](https://github.com/fpellet/jquery.ajaxFile) by [Florent PELLET](https://github.com/fpellet) -* [:link:](jquery.are-you-sure/jquery.are-you-sure.d.ts) [jquery.are-you-sure.js](https://github.com/codedance/jquery.AreYouSure) by [Jon Egerton](https://github.com/jonegerton) -* [:link:](jquery.autosize/jquery.autosize.d.ts) [jquery.autosize](http://www.jacklmoore.com/autosize) by [Aaron T. King](https://github.com/kingdango) -* [:link:](jquery.bbq/jquery.bbq.d.ts) [jquery.bbq](http://benalman.com/projects/jquery-bbq-plugin) by [Adam R. Smith](https://github.com/sunetos) -* [:link:](jquery.clientSideLogging/jquery.clientSideLogging.d.ts) [jquery.clientSideLogging](https://github.com/remybach/jQuery.clientSideLogging) by [Diullei Gomes](https://github.com/diullei) -* [:link:](jquery.color/jquery.color.d.ts) [jquery.color.js](https://github.com/jquery/jquery-color) by [Derek Cicerone](https://github.com/derekcicerone) -* [:link:](jquery.colorbox/jquery.colorbox.d.ts) [jQuery.Colorbox](http://www.jacklmoore.com/colorbox) by [Gidon Junge](https://github.com/gjunge) -* [:link:](jquery.customSelect/jquery.customSelect.d.ts) [jquery.customSelect.js](http://adam.co/lab/jquery/customselect/) by [adamcoulombe](https://github.com/adamcoulombe) -* [:link:](jquery.cycle/jquery.cycle.d.ts) [jQuery.cycle.js](http://jquery.malsup.com/cycle) by [François Guillot](http://fguillot.developpez.com) -* [:link:](jquery.dropotron/jquery.dropotron.d.ts) [jquery.dropotron](https://github.com/n33/jquery.dropotron) by [Cyril Schumacher](https://github.com/cyrilschumacher) -* [:link:](dynatable/dynatable.d.ts) [jquery.dynatable](http://www.dynatable.com) by [François Massart](https://github.com/francoismassart) -* [:link:](jquery.dynatree/jquery.dynatree.d.ts) [jquery.dynatree](http://code.google.com/p/dynatree) by [François de Campredon](https://github.com/fdecampredon) -* [: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) -* [:link:](jquery.noty/jquery.noty.d.ts) [jQuery.noty](http://needim.github.io/noty) by [Aaron King](https://github.com/kingdango) -* [:link:](jquery.payment/jquery.payment.d.ts) [jQuery.payment](https://github.com/stripe/jquery.payment) by [Eric J. Smith](https://github.com/ejsmith), [John Rutherford](https://github.com/johnrutherford) -* [: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) -* [:link:](jquery.sortElements/jquery.sortElement.d.ts) [jQuery.sortElements](http://james.padolsey.com/javascript/sorting-elements-with-jquery) by [Tim Bureck](https://github.com/tbureck) -* [:link:](jquery.superLink/jquery.superLink.d.ts) [jquery.superLink](http://james.padolsey.com/demos/plugins/jQuery/superLink/superlink.jquery.js) by [Blake Niemyjski](https://github.com/niemyjski) -* [:link:](jquery.tile/jquery.tile.d.ts) [jquery.tile.js](https://github.com/urin/jquery.tile.js) by [Shunsuke Ohtani](https://github.com/zaneli) -* [:link:](jquery.timeago/jquery.timeago.d.ts) [jQuery.timeago.js](http://timeago.yarp.com) by [François Guillot](http://fguillot.developpez.com) -* [:link:](jquery.tipsy/jquery.tipsy.d.ts) [jQuery.tipsy](http://onehackoranother.com/projects/jquery/tipsy) by [Brian Dukes](https://github.com/bdukes) -* [:link:](jquery.transit/jquery.transit.d.ts) [jQuery.transit.js](http://ricostacruz.com/jquery.transit) by [MrBigDog2U](https://github.com/MrBigDog2U) -* [:link:](jquery.validation/jquery.validation.d.ts) [jquery.validation](http://jqueryvalidation.org) by [François de Campredon](https://github.com/fdecampredon), [John Reilly](https://github.com/johnnyreilly) -* [:link:](jquery.timer/jquery.timer.d.ts) [jQueryTimer](https://github.com/jchavannes/jquery-timer) by [Joshua Strobl](https://github.com/JoshStrobl) -* [: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-clipper/js-clipper.d.ts) [js-clipper](https://github.com/mathisonian/JsClipper) by [Hou Chunlei](https://github.com/omni360) -* [: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:](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) -* [:link:](js-git/js-git.d.ts) [js-git](https://github.com/creationix/js-git) by [Bart van der Schoor](https://github.com/Bartvds) -* [:link:](js-md5/md5.d.ts) [js-md5](https://github.com/emn178/js-md5) by [Roland Greim](https://github.com/tigerxy) -* [:link:](js-schema/js-schema.d.ts) [js-schema](https://github.com/molnarg/js-schema) by [Marcin Porebski](https://github.com/marcinporebski) -* [:link:](js-signals/js-signals.d.ts) [JS-Signals](http://millermedeiros.github.io/js-signals) by [Diullei Gomes](https://github.com/diullei) -* [:link:](js-yaml/js-yaml.d.ts) [js-yaml](https://github.com/nodeca/js-yaml) by [Bart van der Schoor](https://github.com/Bartvds), [Sebastian Clausen](https://github.com/sclausen) -* [:link:](blocks/blocks.d.ts) [jsblocks](http://jsblocks.com) by [Krzysztof Śmigiel](https://github.com/ksmigiel) -* [:link:](jsbn/jsbn.d.ts) [jsbn](http://www-cs-students.stanford.edu/%7Etjw/jsbn) by [Eugene Chernyshov](https://github.com/Evgenus) -* [:link:](jscrollpane/jscrollpane.d.ts) [jScrollPane](http://jscrollpane.kelvinluck.com) by [Dániel Tar](https://github.com/qcz) -* [:link:](js-data/js-data.d.ts) [JSData](https://github.com/js-data/js-data) by [Stefan Steinhart](https://github.com/reppners) -* [:link:](js-data-http/js-data-http.d.ts) [JSData Http Adapter](https://github.com/js-data/js-data-http) by [Stefan Steinhart](https://github.com/reppners) -* [:link:](js-data-angular/js-data-angular.d.ts) [JSDataAngular](https://github.com/js-data/js-data-angular) by [Stefan Steinhart](https://github.com/reppners) -* [:link:](jsdeferred/jsdeferred.d.ts) [JSDeferred](https://github.com/cho45/jsdeferred) by [Daisuke Mino](https://github.com/minodisk) -* [:link:](jsdom/jsdom.d.ts) [jsdom](https://github.com/tmpvar/jsdom) by [Asana](https://asana.com) -* [:link:](jsen/jsen.d.ts) [jsen (JSON Sentinel)](https://github.com/bugventure/jsen) by [Vladimir Đokić](https://github.com/vladeck) -* [:link:](jsend/jsend.d.ts) [jsend](https://github.com/Prestaul/jsend) by [Federico Caselli](https://github.com/CaselIT) -* [:link:](jsesc/jsesc.d.ts) [jsesc](https://github.com/mathiasbynens/jsesc) by [Bart van der Schoor](https://github.com/Bartvds) -* [:link:](jsfl/jsfl.d.ts) [JSFL](https://adobe.com) by [soywiz](https://github.com/soywiz) -* [: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:](jsmockito/jsmockito.d.ts) [JsMockito](http://github.com/chrisleishman/jsmockito) by [Karl Bennett](https://github.com/shiver-me-timbers) -* [: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) -* [:link:](json-socket/json-socket.d.ts) [json-socket](https://github.com/sebastianseilund/node-json-socket) by [Sven Reglitzki](https://github.com/svi3c) -* [:link:](json-stable-stringify/json-stable-stringify.d.ts) [json-stable-stringify](https://github.com/substack/json-stable-stringify) by [Matt Frantz](https://github.com/mhfrantz) -* [:link:](json5/json5.d.ts) [JSON5](http://json5.org) by [Jason Swearingen](https://jasonswearingen.github.io) -* [:link:](jsoneditoronline/jsoneditoronline.d.ts) [JSONEditorOnline](https://github.com/josdejong/jsoneditoronline) by [Vincent Bortone](https://github.com/vbortone) -* [:link:](jsonpath/jsonpath.d.ts) [jsonpath](https://www.npmjs.org/package/jsonpath) by [Hiroki Horiuchi](https://github.com/horiuchi) -* [:link:](JSONStream/JSONStream.d.ts) [JSONStream](http://github.com/dominictarr/JSONStream) by [Bart van der Schoor](https://github.com/Bartvds) -* [:link:](jsonwebtoken/jsonwebtoken.d.ts) [jsonwebtoken](https://github.com/auth0/node-jsonwebtoken) by [Maxime LUCE](https://github.com/SomaticIT), [Daniel Heim](https://github.com/danielheim) -* [:link:](jspdf/jspdf.d.ts) [jsPDF](https://github.com/MrRio/jsPDF) by [Amber Schühmacher](https://github.com/amberjs) -* [: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:](jss/jss.d.ts) [jss](https://github.com/Box9/jss) by [Valentin Robert](https://github.com/Ptival) -* [: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:](jsts/jsts.d.ts) [jsts](https://github.com/bjornharrtell/jsts) by [Stephane Alie](https://github.com/StephaneAlie) -* [:link:](jsuri/jsuri.d.ts) [jsUri](https://github.com/derek-watson/jsUri) by [Chris Charabaruk](http://github.com/coldacid), [Florian Wagner](http://github.com/flqw) -* [:link:](jsurl/jsurl.d.ts) [jsurl](https://github.com/Mikhus/jsurl) by [Alexey Gorshkov](https://github.com/agorshkov23) -* [:link:](jsx-chai/jsx-chai.d.ts) [jsx-chai](https://github.com/bkonkle/jsx-chai) by [Philipp Holzer](https://github.com/nupplaphil) -* [:link:](jszip/jszip.d.ts) [JSZip](http://stuk.github.com/jszip) by [mzeiher](https://github.com/mzeiher) -* [:link:](jug/jug.d.ts) [jug](https://github.com/kaiquewdev/Graph) by [yevt](https://github.com/yevt) -* [:link:](jwplayer/jwplayer.d.ts) [JW Player](http://developer.longtailvideo.com/trac) by [Martin Duparc](https://github.com/martinduparc) -* [: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) -* [:link:](kendo-ui/kendo-ui.d.ts) [Kendo UI Professional](http://www.telerik.com/kendo-ui) by [Telerik](https://github.com/telerik) -* [:link:](keyboardjs/keyboardjs.d.ts) [KeyboardJS](https://github.com/RobertWHurst/KeyboardJS) by [Vincent Bortone](https://github.com/vbortone), [David Asmuth](https://github.com/piranha771) -* [: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) -* [:link:](knockout/knockout.d.ts) [Knockout](http://knockoutjs.com) by [Boris Yankov](https://github.com/borisyankov), [Igor Oleinikov](https://github.com/Igorbek), [Clément Bourgeois](https://github.com/moonpyk) -* [:link:](knockout.deferred.updates/knockout.deferred.updates.d.ts) [Knockout Deferred Updates](https://github.com/mbest/knockout-deferred-updates) by [Sebastián Galiano](https://github.com/sgaliano) -* [:link:](knockout/tests/jasmine.extensions.d.ts) [Knockout specs](http://knockoutjs.com) by [Boris Yankov](https://github.com/borisyankov), [Igor Oleinikov](https://github.com/Igorbek), [Clément Bourgeois](https://github.com/moonpyk) -* [:link:](knockout.validation/knockout.validation.d.ts) [Knockout Validation](https://github.com/ericmbarnard/Knockout-Validation) by [Dan Ludwig](https://github.com/danludwig) -* [:link:](knockout.viewmodel/knockout.viewmodel.d.ts) [Knockout Viewmodel](http://coderenaissance.github.com/knockout.viewmodel) by [Oisin Grehan](https://github.com/oising) -* [:link:](knockout.amd.helpers/knockout-amd-helpers.d.ts) [knockout-amd-helpers](https://github.com/rniemeyer/knockout-amd-helpers) by [David Sichau](https://github.com/DavidSichau) -* [:link:](knockout.editables/ko.editables.d.ts) [knockout-editables](http://romanych.github.com/ko.editables) by [Boris Yankov](https://github.com/borisyankov) -* [:link:](knockout.es5/knockout.es5.d.ts) [Knockout-ES5](https://github.com/SteveSanderson/knockout-es5) by [Sebastián Galiano](https://github.com/sgaliano) -* [:link:](knockout-paging/knockout-paging.d.ts) [knockout-paging](https://github.com/ErikSchierboom/knockout-paging) by [Erik Schierboom](https://github.com/ErikSchierboom) -* [:link:](knockout.postbox/knockout-postbox.d.ts) [knockout-postbox](https://github.com/rniemeyer/knockout-postbox) by [Judah Gabriel Himango](https://debuggerdotbreak.wordpress.com) -* [:link:](knockout-pre-rendered/knockout-pre-rendered.d.ts) [knockout-pre-rendered](https://github.com/ErikSchierboom/knockout-pre-rendered) by [Erik Schierboom](https://github.com/ErikSchierboom) -* [:link:](knockout.projections/knockout.projections.d.ts) [knockout-projections](https://github.com/stevesanderson/knockout-projections) by [John Reilly](https://github.com/johnnyreilly) -* [:link:](knockout-secure-binding/knockout-secure-binding.d.ts) [knockout-secure-binding](https://github.com/brianmhunt/knockout-secure-binding) by [Pine Mizune](https://github.com/pine613) -* [:link:](knockout-transformations/knockout-transformations.d.ts) [knockout-transformations](https://github.com/One-com/knockout-transformations) by [John Reilly](https://github.com/johnnyreilly), [Wim Looman](https://github.com/Nemo157) -* [:link:](knockout.mapper/knockout.mapper.d.ts) [Knockout.Mapper](https://github.com/LucasLorentz/knockout.mapper) by [Brandon Meyer](https://github.com/BMeyerKC) -* [:link:](knockout.mapping/knockout.mapping.d.ts) [Knockout.Mapping](https://github.com/SteveSanderson/knockout.mapping) by [Boris Yankov](https://github.com/borisyankov) -* [:link:](knockout.punches/knockout.punches.d.ts) [knockout.punches](https://github.com/mbest/knockout.punches) by [Stephen Lautier](https://github.com/johnnyreilly) -* [:link:](knockout.rx/knockout.rx.d.ts) [knockout.rx](https://github.com/Igorbek/knockout.rx) by [Igor Oleinikov](https://github.com/Igorbek) -* [:link:](knockstrap/knockstrap.d.ts) [Knockstrap](http://faulknercs.github.io/Knockstrap) by [Adam Pluciński](https://github.com/adaskothebeast) -* [:link:](knockout.kogrid/ko-grid.d.ts) [ko-grid](http://knockout-contrib.github.io/KoGrid) by [huer12](https://github.com/huer12) -* [:link:](ko.plus/ko.plus.d.ts) [ko.plus](https://github.com/stevegreatrex/ko.plus) by [Howard Richards](https://github.com/conficient) -* [:link:](koa-compose/koa-compose.d.ts) [koa](https://github.com/koajs/compose) by [jKey Lu](https://github.com/jkeylu) -* [:link:](koa/koa.d.ts) [Koa 2.x](http://koajs.com) by [DavidCai1993](https://github.com/DavidCai1993) -* [:link:](koa-bodyparser/koa-bodyparser.d.ts) [koa-bodyparser v3.x](https://github.com/koajs/bodyparser) by [Jerry Chin](https://github.com/hellopao) -* [:link:](koa-favicon/koa-favicon.d.ts) [koa-favicon v2.x](https://github.com/koajs/favicon) by [Jerry Chin](https://github.com/hellopao) -* [:link:](koa-json/koa-json.d.ts) [koa-json v2.x](https://github.com/koajs/json) by [Alex Friedman](https://github.com/brooklyndev) -* [:link:](koa-router/koa-router.d.ts) [koa-router v7.x](https://github.com/alexmingoia/koa-router) by [Jerry Chin](https://github.com/hellopao) -* [:link:](koa-static/koa-static.d.ts) [koa-static v2.x](https://github.com/koajs/static) by [Jerry Chin](https://github.com/hellopao) -* [:link:](kolite/kolite.d.ts) [KoLite](https://github.com/CodeSeven/kolite) by [Boris Yankov](https://github.com/borisyankov) -* [:link:](kolite/knockout.activity.d.ts) [KoLite](https://github.com/CodeSeven/kolite) by [Boris Yankov](https://github.com/borisyankov) -* [:link:](kolite/knockout.command.d.ts) [KoLite](https://github.com/CodeSeven/kolite) by [Boris Yankov](https://github.com/borisyankov) -* [:link:](kolite/knockout.dirtyFlag.d.ts) [KoLite](https://github.com/CodeSeven/kolite) by [Boris Yankov](https://github.com/borisyankov) -* [:link:](konami.js/konami.d.ts) [Konami-js](https://github.com/snaptortoise/konami-js) by [Matthieu Mourisson](https://github.com/mareek) -* [:link:](kue/kue.d.ts) [kue 0.9.x](https://github.com/Automattic/kue) by [Nicholas Penree](http://github.com/drudge) -* [:link:](kuromoji/kuromoji.d.ts) [kuromoji.js](https://github.com/takuyaa/kuromoji.js) by [MIZUSHIMA Junki](https://github.com/mzsm) -* [:link:](ladda/ladda.d.ts) [Ladda](https://github.com/hakimel/Ladda) by [Danil Flores](https://github.com/dflor003), [Michael Lee](https://github.com/leemicw) -* [:link:](lls/lls.d.ts) [LargeLocalStorage](https://github.com/tantaman/LargeLocalStorage) by [Borislav Zhivkov](https://github.com/borislavjivkov) -* [:link:](later/later.d.ts) [LaterJS](http://bunkat.github.io/later) by [Jason D Dryhurst-Smith](http://jasonds.co.uk) -* [:link:](latinize/latinize.d.ts) [latinize](https://github.com/dundalek/latinize) by [Giedrius Grabauskas](https://github.com/GiedriusGrabauskas) -* [:link:](lazy.js/lazy.js.d.ts) [Lazy.js](https://github.com/dtao/lazy.js) by [Bart van der Schoor](https://github.com/Bartvds) -* [:link:](lazypipe/lazypipe.d.ts) [lazypipe](https://github.com/OverZealous/lazypipe) by [Thomas Corbière](https://github.com/tomc974) -* [:link:](leaflet-curve/leaflet-curve.d.ts) [leaflet-curve](https://github.com/onikiienko/Leaflet.curve) by [Onikiienko](https://github.com/onikiienko) -* [:link:](leaflet-draw/leaflet-draw.d.ts) [leaflet-draw](https://github.com/Leaflet/Leaflet.draw) by [Matt Guest](https://github.com/matt-guest) -* [:link:](leaflet.awesome-markers/leaflet.awesome-markers.d.ts) [Leaflet.awesome-markers plugin](https://github.com/lvoogdt/Leaflet.awesome-markers) by [Egor Komarov](https://github.com/Odrin) -* [:link:](leaflet-editable/leaflet-editable.d.ts) [Leaflet.Editable](https://github.com/yohanboniface/Leaflet.Editable) by [Dominic Alie](https://github.com/dalie) -* [:link:](leaflet.fullscreen/leaflet.fullscreen.d.ts) [Leaflet.fullscreen](https://github.com/brunob/leaflet.fullscreen) by [William Comartin](https://github.com/wcomartin) -* [: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:](leaflet-markercluster/leaflet-markercluster.d.ts) [Leaflet.markercluster](https://github.com/Leaflet/Leaflet.markercluster) by [Robert Imig](https://github.com/rimig) -* [: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), [Florian Wagner](https://github.com/flqw), [Gabor Szmetanko](https://github.com/szmeti) -* [:link:](logrotate-stream/logrotate-stream.d.ts) [logrotate-stream](https://github.com/dstokes/logrotate-stream) by [Rogier Schouten](https://github.com/rogierschouten) -* [:link:](lokijs/lokijs.d.ts) [lokijs](https://github.com/techfort/LokiJS) by [TeamworkGuy2](https://github.com/TeamworkGuy2) -* [:link:](lolex/lolex.d.ts) [lolex](https://github.com/sinonjs/lolex) by [Wim Looman](https://github.com/Nemo157) -* [: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) -* [:link:](lower-case-first/lower-case-first.d.ts) [lower-case-first](https://github.com/blakeembrey/lower-case-first) by [Sam Saint-Pettersen](https://github.com/stpettersens) -* [:link:](lru-cache/lru-cache.d.ts) [lru-cache](https://github.com/isaacs/node-lru-cache) by [Bart van der Schoor](https://github.com/Bartvds) -* [:link:](lscache/lscache.d.ts) [lscache](https://github.com/pamelafox/lscache) by [Chris Martinez](https://github.com/Chris-Martinezz) -* [:link:](luaparse/luaparse.d.ts) [luaparse](https://github.com/oxyc/luaparse) by [Sam Saint-Pettersen](https://github.com/stpettersens) -* [:link:](lunr/lunr.d.ts) [lunr.js](https://github.com/olivernn/lunr.js) by [Sebastian Lenz](https://github.com/sebastian-lenz) -* [:link:](lz-string/lz-string.d.ts) [lz-string](https://github.com/pieroxy/lz-string) by [Roman Nikitin](https://github.com/M0ns1gn0r) -* [:link:](magic-number/magic-number.d.ts) [magic-number](https://github.com/stpettersens/node-magic-number) by [Sam Saint-Pettersen](https://github.com/stpettersens) -* [:link:](magicsuggest/magicsuggest.d.ts) [MagicSuggest](http://nicolasbize.com/magicsuggest) by [Leonardo Chaia](http://github.com/leonardochaia) -* [:link:](mailcheck/mailcheck.d.ts) [Mailcheck](https://github.com/mailcheck/mailcheck) by [Paulo Cesar](http://github.com/pocesar) -* [:link:](maildev/maildev.d.ts) [maildev](https://github.com/djfarrelly/maildev) by [Cyril Schumacher](https://github.com/cyrilschumacher) -* [:link:](mailparser/mailparser.d.ts) [mailparser](https://www.npmjs.com/package/mailparser) by [Peter Snider](https://github.com/psnider) -* [:link:](main-bower-files/main-bower-files.d.ts) [main-bower-files](https://github.com/ck86/main-bower-files) by [Keita Kagurazaka](https://github.com/k-kagurazaka) -* [:link:](maker.js/makerjs.d.ts) [Maker.js](https://github.com/Microsoft/maker.js) by [Dan Marshall](https://github.com/danmarshall) -* [:link:](mandrill-api/mandrill-api.d.ts) [Mandrill API 1.x](http://mandrill.com) by [Paulo Cesar](https://github.com/pocesar) -* [:link:](mapbox/mapbox.d.ts) [Mapbox](https://www.mapbox.com/mapbox.js) by [Maxime Fabre](https://github.com/anahkiasen) -* [:link:](mapsjs/mapsjs.d.ts) [Mapsjs](https://github.com/mapsjs) by [Matthew James Davis](https://github.com/davismj) -* [:link:](maquette/maquette.d.ts) [maquette](http://maquettejs.org) by [Johan Gorter](https://github.com/johan-gorter) -* [: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:](ngwysiwyg/ngwysiwyg.d.ts) [Marked](https://github.com/psergus/ngWYSIWYG) by [Patrick Mac Kay](https://github.com/patrick-mackay) -* [:link:](marked/marked.d.ts) [Marked](https://github.com/chjj/marked) by [William Orr](https://github.com/worr) -* [: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), [Oliver Herrmann](https://github.com/herrmanno) -* [:link:](materialize-css/materialize-css.d.ts) [materialize-css](http://materializecss.com) by [Erik Lieben](https://github.com/eriklieben), [Leon Yu](https://github.com/leonyu) -* [: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), [David Asmuth](https://github.com/piranha771) -* [: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), [Tom X. Tobin](http://tomxtobin.com) -* [: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) -* [:link:](mess/mess.d.ts) [mess](https://github.com/bobrik/node-mess) by [Wim Looman](https://github.com/Nemo157) -* [:link:](messenger/messenger.d.ts) [Messenger.js](https://github.com/HubSpot/messenger) by [Derek Cicerone](https://github.com/derekcicerone) -* [:link:](meteor/meteor.d.ts) [Meteor](http://www.meteor.com) by [Dave Allen](https://github.com/fullflavedave) -* [:link:](meteor-roles/meteor-roles.d.ts) [Meteor Roles](https://github.com/alanning/meteor-roles) by [Robbie Van Gorkom](https://github.com/vangorra) -* [:link:](meteor-publish-composite/meteor-publish-composite.d.ts) [meteor-publish-composite](https://github.com/englue/meteor-publish-composite) by [Robert Van Gorkom](https://github.com/vangorra) -* [:link:](node-mysql-wrapper/my-meteor.d.ts) [meteorjs for node-mysql-wrapper which helps in development](https://github.com/nodets/node-mysql-wrapper) by [Makis Maropoulos](https://github.com/kataras) -* [:link:](method-override/method-override.d.ts) [method-override](https://github.com/expressjs/method-override) by [Santi Albo](https://github.com/santialbo) -* [:link:](metismenu/metismenu.d.ts) [metisMenu](http://github.com/onokumus/metisMenu) by [onokums](https://github.com/onokumus) -* [:link:](microgears/microgears.d.ts) [microgears](http://github.com/marcusdb/microgears) by [Marcus David Bronstein](https://github.com/marcusdb) -* [:link:](micromatch/micromatch.d.ts) [micromatch](https://github.com/jonschlinkert/micromatch) by [glen-84](https://github.com/glen-84) -* [:link:](microsoft-ajax/microsoft.ajax.d.ts) [Microsoft ASP.NET Ajax client side library](http://msdn.microsoft.com/en-us/library/ee341002(v=vs.100).aspx) by [Patrick Magee](https://github.com/pjmagee) -* [:link:](xrm/xrm.d.ts) [Microsoft Dynamics xRM API](http://www.microsoft.com/en-us/download/details.aspx?id=44567) by [David Berry](https://github.com/6ix4our), [Matt Ngan](https://github.com/mattngan), [Markus Mauch](https://github.com/markusmauch) -* [:link:](xrm/xrm-6.d.ts) [Microsoft Dynamics xRM API v6](http://msdn.microsoft.com/en-us/library/gg328255.aspx) by [David Berry](https://github.com/6ix4our) -* [:link:](jquery-validation-unobtrusive/jquery-validation-unobtrusive.d.ts) [Microsoft jQuery Unobtrusive Validation](http://aspnetwebstack.codeplex.com) by [Matt Brooks](https://github.com/EnableSoftware) -* [:link:](microsoft-live-connect/microsoft-live-connect.d.ts) [Microsoft Live Connect](http://msdn.microsoft.com/en-us/library/live/hh243643.aspx) by [John Vilk](https://github.com/jvilk) -* [:link:](xrm/parature.d.ts) [Microsoft Parature extentions to Xrm.Page - available for CRM Online Only](http://msdn.microsoft.com/en-us/library/gg328255.aspx) by [David Berry](https://github.com/6ix4our) -* [:link:](azure-mobile-services-client/AzureMobileServicesClient.d.ts) [Microsoft Windows AzureMobile Service](http://www.windowsazure.com/en-us/develop/mobile) by [Morosinotto Daniele](https://github.com/dmorosinotto) -* [:link:](bingmaps/Microsoft.Maps.d.ts) [Microsoft.Maps](http://msdn.microsoft.com/en-us/library/gg427611.aspx) by [Eric Todd](https://github.com/ericrtodd) -* [:link:](bingmaps/Microsoft.Maps.AdvancedShapes.d.ts) [Microsoft.Maps.AdvancedShapes](http://msdn.microsoft.com/en-us/library/hh921952.aspx) by [Eric Todd](https://github.com/ericrtodd) -* [:link:](bingmaps/Microsoft.Maps.Directions.d.ts) [Microsoft.Maps.Directions](http://msdn.microsoft.com/en-us/library/hh312813.aspx) by [Eric Todd](https://github.com/ericrtodd) -* [:link:](bingmaps/Microsoft.Maps.Search.d.ts) [Microsoft.Maps.Search](http://msdn.microsoft.com/en-us/library/hh868061.aspx) by [Eric Todd](https://github.com/ericrtodd) -* [:link:](bingmaps/Microsoft.Maps.Themes.BingTheme.d.ts) [Microsoft.Maps.Themes](http://msdn.microsoft.com/en-us/library/hh868061.aspx) by [Eric Todd](https://github.com/ericrtodd) -* [: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) -* [:link:](minimist/minimist.d.ts) [minimist](https://github.com/substack/minimist) by [Bart van der Schoor](https://github.com/Bartvds), [Necroskillz](https://github.com/Necroskillz) -* [:link:](mithril/mithril.d.ts) [Mithril](http://lhorie.github.io/mithril) by [Leo Horie](https://github.com/lhorie), [Chris Bowdon](https://github.com/cbowdon) -* [:link:](mixpanel/mixpanel.d.ts) [Mixpanel](https://mixpanel.com) by [Knut Eirik Leira Hjelle](https://github.com/hjellek) -* [: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) -* [:link:](mocha/mocha-node.d.ts) [mocha](http://mochajs.org) by [Vadim Macagon](https://github.com/enlight), [vvakame](https://github.com/vvakame) -* [:link:](mocha/mocha.d.ts) [mocha](http://mochajs.org) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid), [otiai10](https://github.com/otiai10), [jt000](https://github.com/jt000), [Vadim Macagon](https://github.com/enlight) -* [:link:](mocha-phantomjs/mocha-phantomjs.d.ts) [mocha-phantomjs](http://metaskills.net/mocha-phantomjs) by [Erik Schierboom](https://github.com/ErikSchierboom) -* [:link:](mock-fs/mock-fs.d.ts) [mock-fs](https://github.com/tschaub/mock-fs) by [Wim Looman](https://github.com/Nemo157), [Qubo](https://github.com/tkqubo) -* [:link:](mockery/mockery.d.ts) [mockery](https://github.com/mfncooper/mockery) by [jt000](https://github.com/jt000) -* [:link:](modernizr/modernizr.d.ts) [Modernizr](http://modernizr.com) by [Boris Yankov](https://github.com/borisyankov), [Theodore Brown](https://github.com/theodorejb), [Leon Yu](https://github.com/leonyu) -* [:link:](moment-timezone/moment-timezone.d.ts) [moment-timezone.js](http://momentjs.com/timezone) by [Michel Salib](https://github.com/michelsalib) -* [:link:](moment/moment-node.d.ts) [Moment.js](https://github.com/timrwood/moment) by [Michael Lakerveld](https://github.com/Lakerfield), [Aaron King](https://github.com/kingdango), [Hiroki Horiuchi](https://github.com/horiuchi), [Dick van den Brink](https://github.com/DickvdBrink), [Adi Dahiya](https://github.com/adidahiya), [Matt Brooks](https://github.com/EnableSoftware), [Gal Talmor](https://github.com/galtalmor) -* [:link:](moment/moment.d.ts) [Moment.js](https://github.com/timrwood/moment) by [Michael Lakerveld](https://github.com/Lakerfield), [Aaron King](https://github.com/kingdango), [Hiroki Horiuchi](https://github.com/horiuchi), [Dick van den Brink](https://github.com/DickvdBrink), [Adi Dahiya](https://github.com/adidahiya), [Matt Brooks](https://github.com/EnableSoftware) -* [:link:](moment-range/moment-range.d.ts) [Moment.js](https://github.com/gf3/moment-range) by [Bart van den Burg](https://github.com/Burgov), [Wilgert Velinga](https://github.com/wilgert) -* [:link:](mongodb/mongodb.d.ts) [MongoDB](https://github.com/mongodb/node-mongodb-native/tree/2.1) by [Federico Caselli](https://github.com/CaselIT) -* [:link:](mongoose/mongoose.d.ts) [Mongoose](http://mongoosejs.com) by [simonxca](https://github.com/simonxca), [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:](mongoose-promise/mongoose-promise.d.ts) [mongoose-promise](http://mongoosejs.com/docs/api.html#promise-js) by [simonxca](https://github.com/simonxca) -* [: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) -* [:link:](mousetrap/mousetrap.d.ts) [Mousetrap 1.5.x](http://craig.is/killing/mice) by [Dániel Tar](https://github.com/qcz) -* [:link:](moviedb/moviedb.d.ts) [MovieDB](https://github.com/danzajdband/moviedb) by [Basarat Ali Syed](https://github.com/basarat) -* [: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:](mqtt/mqtt.d.ts) [MQTT](https://github.com/mqttjs/MQTT.js) by [Pekka Leppänen](https://github.com/PekkaPLeppanen) -* [: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), [Vitor Buzinaro](https://github.com/buzinas) -* [:link:](mu2/mu2.d.ts) [mu2](http://github.com/raycmorgan/mu) by [Jeff Goddard](https://github.com/jedigo) -* [:link:](multer/multer.d.ts) [multer](https://github.com/expressjs/multer) by [jt000](https://github.com/jt000), [vilicvane](https://vilic.github.io), [David Broder-Rodgers](https://github.com/DavidBR-SW) -* [:link:](multiplexjs/multiplexjs.d.ts) [Multiplex.js](http://github.com/multiplex/multiplex.js) by [Kamyar Nazeri](http://github.com/KamyarNazeri) -* [:link:](mustache/mustache.d.ts) [Mustache](https://github.com/janl/mustache.js) by [Mark Ashley Bell](https://github.com/markashleybell) -* [:link:](mz/mz.d.ts) [mz](https://github.com/normalize/mz) by [Thomas Hickman](https://github.com/ThomasHickman) -* [:link:](nanoajax/nanoajax.d.ts) [nanoajax](https://github.com/yanatan16/nanoajax) by [Nathan Cahill](https://github.com/nathancahill) -* [:link:](natural/natural.d.ts) [Natural](https://github.com/NaturalNode/natural) by [Dylan R. E. Moonfire](https://github.com/dmoonfire) -* [:link:](natural-sort/natural-sort.d.ts) [NaturalSort](https://github.com/studio-b12/natural-sort) by [Antonio Morales](https://github.com/a-morales) -* [:link:](navigation/navigation.d.ts) [Navigation](http://grahammendick.github.io/navigation) by [Graham Mendick](https://github.com/grahammendick) -* [:link:](nconf/nconf.d.ts) [nconf](https://github.com/flatiron/nconf) by [Jeff Goddard](https://github.com/jedigo), [Jean-Martin Thibault](https://github.com/jmthibault) -* [:link:](ncp/ncp.d.ts) [ncp](https://github.com/AvianFlu/ncp) by [Bart van der Schoor](https://github.com/bartvds) -* [:link:](nedb/nedb.d.ts) [NeDB](https://github.com/louischatriot/nedb) by [Stefan Steinhart](https://github.com/reppners) -* [:link:](needle/needle.d.ts) [needle](https://github.com/tomas/needle) by [San Chen](https://github.com/bigsan) -* [:link:](netmask/netmask.d.ts) [Netmask](https://github.com/rs/node-netmask) by [Matt Frantz](https://github.com/mhfrantz) -* [:link:](nexpect/nexpect.d.ts) [nexpect](https://github.com/nodejitsu/nexpect) by [vvakame](http://github.com/vvakame) -* [:link:](ng-command/ng-command.d.ts) [ng-command](https://github.com/stephenlautier/ng-command) by [Stephen Lautier](https://github.com/stephenlautier) -* [:link:](ng-facebook/ng-facebook.d.ts) [ng-facebook](https://github.com/GoDisco/ngFacebook) by [Crevil](https://github.com/Crevil) -* [:link:](ng-flow/ng-flow.d.ts) [ng-flow](https://github.com/flowjs/ng-flow) by [Ryan McNamara](https://github.com/ryan10132) -* [:link:](ng-grid/ng-grid.d.ts) [ng-grid](http://angular-ui.github.io/ng-grid) by [Ken Smith](https://github.com/smithkl42), [Roland Zwaga](https://github.com/rolandzwaga), [Kent Cooper](https://github.com/kentcooper) -* [:link:](angular-idle/angular-idle.d.ts) [ng-idle](http://hackedbychinese.github.io/ng-idle) by [mthamil](https://github.com/mthamil) -* [:link:](ng-notify/ng-notify.d.ts) [ng-notify](https://github.com/matowens/ng-notify) by [Nick Zamosenchuk](https://github.com/nzamosenchuk) -* [:link:](ng-table/ng-table.d.ts) [ng-table](https://github.com/esvit/ng-table) by [Christian Crowhurst](https://github.com/christianacca) -* [: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/datepicker.d.ts) [ngCordova datepicker plugin](https://github.com/VitaliiBlagodir/cordova-plugin-datepicker) by [Jacques Kang](https://www.linkedin.com/in/jacqueskang) -* [:link:](ng-cordova/app-version.d.ts) [ngCordova datepicker plugin](https://github.com/driftyco/ng-cordova) by [Jacques Kang](https://www.linkedin.com/in/jacqueskang) -* [:link:](ng-cordova/deviceMotion.d.ts) [ngCordova device motion plugin](https://github.com/driftyco/ng-cordova) by [Michel Vidailhet](https://github.com/mvidailhet), [Kapil Sachdeva](https://github.com/ksachdeva) -* [:link:](ng-cordova/deviceOrientation.d.ts) [ngCordova device orientation plugin](https://github.com/driftyco/ng-cordova) by [Michel Vidailhet](https://github.com/mvidailhet), [Kapil Sachdeva](https://github.com/ksachdeva) -* [:link:](ng-cordova/device.d.ts) [ngCordova device plugin](https://github.com/driftyco/ng-cordova) by [Kapil Sachdeva](https://github.com/ksachdeva) -* [:link:](ng-cordova/dialogs.d.ts) [ngCordova dialogs plugin](https://github.com/driftyco/ng-cordova) by [Michel Vidailhet](https://github.com/mvidailhet), [Kapil Sachdeva](https://github.com/ksachdeva) -* [:link:](ng-cordova/emailComposer.d.ts) [ngCordova emailComposer plugin](https://github.com/driftyco/ng-cordova) by [Kapil Sachdeva](https://github.com/ksachdeva) -* [:link:](ng-cordova/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:](ngstorage/ngstorage.d.ts) [ngstorage](https://github.com/gsklee/ngStorage) by [Jakub Pistek](https://github.com/kubiq) -* [:link:](nightmare/nightmare.d.ts) [Nightmare](https://github.com/segmentio/nightmare) by [horiuchi](https://github.com/horiuchi) -* [:link:](noble/noble.d.ts) [noble](https://github.com/sandeepmistry/noble) by [Seon-Wook Park](https://github.com/swook), [Hans Bakker](https://github.com/wind-rider), [Shantanu Bhadoria](https://github.com/shantanubhadoria) -* [:link:](nock/nock.d.ts) [nock](https://github.com/pgte/nock) by [bonnici](https://github.com/bonnici) -* [:link:](node-imap/imap.d.ts) [node imap](https://github.com/mscdex/node-imap) by [Steve Fenton](https://github.com/Steve-Fenton) -* [:link:](oauth2-server/oauth2-server.d.ts) [Node OAuth2 Server](https://github.com/thomseddon/node-oauth2-server) by [Robbie Van Gorkom](https://github.com/vangorra) -* [:link:](node-sass/node-sass.d.ts) [Node Sass](https://github.com/sass/node-sass) by [Asana](https://asana.com) -* [:link:](acl/acl.d.ts) [node_acl](https://github.com/optimalbits/node_acl) by [Qubo](https://github.com/tkQubo) -* [:link:](mdns/mdns.d.ts) [node_mdns](https://github.com/agnat/node_mdns) by [Stefan Steinhart](https://github.com/reppners) -* [:link:](node_redis/node_redis.d.ts) [node_redis](https://github.com/mranney/node_redis) by [Boris Yankov](https://github.com/borisyankov) -* [: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:](asana/asana.d.ts) [node-asana](https://github.com/Asana/node-asana) by [Qubo](https://github.com/tkqubo) -* [: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) -* [:link:](node-calendar/node-calendar.d.ts) [node-calendar](https://www.npmjs.com/package/node-calendar) by [Luzian Zagadinow](https://github.com/luzianz) -* [: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) -* [:link:](node-gcm/node-gcm.d.ts) [node-gcm](https://www.npmjs.org/package/node-gcm) by [Hiroki Horiuchi](https://github.com/horiuchi) -* [:link:](node-getopt/node-getopt.d.ts) [node-getopt](https://github.com/jiangmiao/node-getopt) by [Karl.M.Cauchy](https://github.com/kcauchy) -* [:link:](node-git/node-git.d.ts) [node-git](https://github.com/christkv/node-git) by [vvakame](https://github.com/vvakame) -* [:link:](node-int64/node-int64.d.ts) [node-int64](https://github.com/broofa/node-int64) by [Benno Dreissig](https://github.com/x3cion) -* [:link:](ip/ip.d.ts) [node-ip](https://github.com/indutny/node-ip) by [Peter Harris](https://github.com/codeanimal) -* [:link:](node-jsfl-runner/node-jsfl-runner.d.ts) [node-jsfl-runner](https://www.npmjs.com/package/node-jsfl-runner) by [Michael Randolph](https://github.com/mrand01) -* [:link:](multiparty/multiparty.d.ts) [node-multiparty](https://github.com/andrewrk/node-multiparty) by [Ken Fukuyama](https://github.com/kenfdev) -* [:link:](mysql/mysql.d.ts) [node-mysql](https://github.com/felixge/node-mysql) by [William Johnston](https://github.com/wjohnsto) -* [:link:](node-mysql-wrapper/node-mysql-wrapper.d.ts) [node-mysql-wrapper](https://github.com/nodets/node-mysql-wrapper) by [Makis Maropoulos](https://github.com/kataras) -* [:link:](node-notifier/node-notifier.d.ts) [node-notifier](https://github.com/mikaelbr/node-notifier) by [Qubo](https://github.com/tkQubo) -* [:link:](node-persist/node-persist.d.ts) [node-persist](https://github.com/simonlast/node-persist) by [Spencer Williams](http://spencerwi.com) -* [:link:](node-polyglot/node-polyglot.d.ts) [node-polyglot](https://github.com/airbnb/polyglot.js) by [Tim Jackson-Kiely](https://github.com/timjk) -* [:link:](progress/progress.d.ts) [node-progress](https://github.com/tj/node-progress) by [Sebastian Lenz](https://github.com/sebastian-lenz) -* [:link:](promptly/promptly.d.ts) [node-promptly](https://github.com/IndigoUnited/node-promptly) by [Dan Spencer](https://github.com/danrspencer) -* [:link:](radius/radius.d.ts) [node-radius](https://github.com/retailnext/node-radius) by [Peter Harris](https://github.com/codeanimal) -* [:link:](rsync/rsync.d.ts) [node-rsync](https://github.com/mattijs/node-rsync) by [Philipp Stucki](https://github.com/philippstucki) -* [:link:](node-sass-middleware/node-sass-middleware.d.ts) [node-sass-middleware](https://github.com/sass/node-sass-middleware) by [Pascal Garber](http://www.jumplink.eu) -* [:link:](node-schedule/node-schedule.d.ts) [node-schedule](https://github.com/tejasmanohar/node-schedule) by [Cyril Schumacher](https://github.com/cyrilschumacher) -* [:link:](node-slack/node-slack.d.ts) [node-slack](https://github.com/xoxco/node-slack) by [Qubo](https://github.com/tkQubo) -* [:link:](node-snap7/node-snap7.d.ts) [node-snap7](https://github.com/mathiask88/node-snap7) by [Heilingbrunner](https://github.com/heilingbrunner) -* [:link:](srp/srp.d.ts) [node-srp](https://github.com/mozilla/node-srp) by [Pat Smuk](https://github.com/Patman64) -* [:link:](stack-trace/stack-trace.d.ts) [node-stack-trace](https://github.com/felixge/node-stack-trace) by [Exceptionless](https://github.com/exceptionless) -* [:link:](node-uuid/node-uuid-global.d.ts) [node-uuid.js](https://github.com/broofa/node-uuid) by [Jeff May](https://github.com/jeffmay) -* [:link:](node-uuid/node-uuid-cjs.d.ts) [node-uuid.js](https://github.com/broofa/node-uuid) by [Jeff May](https://github.com/jeffmay) -* [:link:](node-uuid/node-uuid-base.d.ts) [node-uuid.js](https://github.com/broofa/node-uuid) by [Jeff May](https://github.com/jeffmay) -* [:link:](node-uuid/node-uuid.d.ts) [node-uuid.js](https://github.com/broofa/node-uuid) by [Jeff May](https://github.com/jeffmay) -* [:link:](node-validator/node-validator.d.ts) [node-validator](https://www.npmjs.com/package/node-validator) by [Ken Gorab](https://github.com/kengorab) -* [:link:](node-webkit/node-webkit.d.ts) [node-webkit](https://github.com/rogerwang/node-webkit) by [Pedro Casaubon](https://github.com/xperiments) -* [:link:](xml2js/xml2js.d.ts) [node-xml2js](https://github.com/Leonidas-from-XIV/node-xml2js) by [Michel Salib](https://github.com/michelsalib), [Jason McNeil](https://github.com/jasonrm), [Christopher Currens](https://github.com/ccurrens) -* [:link:](_debugger/_debugger.d.ts) [Node.js debugger API](http://nodejs.org) by [Basarat Ali Syed](https://github.com/basarat) -* [:link:](http-status-codes/http-status-codes.d.ts) [Node.JS package http-status-codes](https://github.com/prettymuchbryce/node-http-status) by [Josh McCullough](https://github.com/JoshMcCullough) -* [: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/DefinitelyTyped/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-types.d.ts) [Nodemailer](https://github.com/andris9/Nodemailer) by [Rogier Schouten](https://github.com/rogierschouten) -* [:link:](nodemailer/nodemailer.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) -* [:link:](nodemailer-pickup-transport/nodemailer-pickup-transport.d.ts) [nodemailer-pickup-transport](https://www.npmjs.com/package/nodemailer-pickup-transport) by [Peter Snider](https://github.com/psnider) -* [:link:](nodemailer-smtp-pool/nodemailer-smtp-pool.d.ts) [nodemailer-smtp-pool](https://github.com/andris9/nodemailer-smtp-pool) by [Rogier Schouten](https://github.com/rogierschouten) -* [:link:](nodemailer-smtp-transport/nodemailer-smtp-transport.d.ts) [nodemailer-smtp-transport](https://github.com/andris9/nodemailer-smtp-transport) by [Rogier Schouten](https://github.com/rogierschouten) -* [:link:](nodeunit/nodeunit.d.ts) [nodeunit](https://github.com/caolan/nodeunit) by [Jeff Goddard](https://github.com/jedigo) -* [:link:](noisejs/noisejs.d.ts) [noisejs](https://github.com/xixixao/noisejs) by [Atsushi Izumihara](https://github.com/izmhr) -* [: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:](notie/notie.d.ts) [notie.js](https://github.com/jaredreich/notie.js) by [Mateus Demboski](https://github.com/mateusdemboski) -* [: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:](nouislider/nouislider.d.ts) [nouislider](https://github.com/leongersen/noUiSlider) by [Patrick Davies](https://github.com/bleuarg) -* [:link:](wnumb/wnumb.d.ts) [nouislider](https://github.com/leongersen/wnumb) by [Corey Jepperson](https://github.com/acoreyj) -* [:link:](noVNC/noVNC.d.ts) [noVNC](https://github.com/kanaka/noVNC) by [Ken Smith](https://github.com/smithkl42) -* [:link:](npm/npm.d.ts) [npm](https://github.com/npm/npm) by [Maxime LUCE](https://github.com/SomaticIT) -* [:link:](nprogress/NProgress.d.ts) [NProgress](https://github.com/rstacruz/nprogress) by [Judah Gabriel Himango](http://debuggerdotbreak.wordpress.com) -* [:link:](numbro/numbro.d.ts) [Numbro.js](https://github.com/foretagsplatsen/numbro) by [Vincent Bortone](https://github.com/vbortone) -* [:link:](numeraljs/numeraljs.d.ts) [Numeral.js](https://github.com/adamwdraper/Numeral-js) by [Vincent Bortone](https://github.com/vbortone) -* [:link:](nunjucks/nunjucks.d.ts) [nunjucks](http://mozilla.github.io/nunjucks) by [Ruben Slabbert](https://github.com/RubenSlabbert) -* [:link:](nvd3/nvd3.d.ts) [nvd3](https://github.com/novus/nvd3) by [Peter Mitchell](https://github.com/PjMitchell) -* [:link:](obelisk.js/obelisk.js.d.ts) [obelisk.js](https://github.com/nosir/obelisk.js) by [Brian Drupieski](https://github.com/bdrupieski) -* [:link:](object-assign/object-assign.d.ts) [object-assign](https://github.com/sindresorhus/object-assign) by [Christopher Brown](https://github.com/chbrown) -* [:link:](object-hash/object-hash.d.ts) [object-hash](https://github.com/puleos/object-hash) by [Michael Zabka](https://github.com/misak113) -* [:link:](object-path/object-path.d.ts) [objectPath v0.9.x](https://github.com/mariocasciaro/object-path) by [Paulo Cesar](https://github.com/pocesar) -* [:link:](oblo-util/oblo-util.d.ts) [oblo-util](https://github.com/Oblosys/oblo-util) by [Martijn Schrage](https://github.com/Oblosys) -* [:link:](oboe/oboe.d.ts) [oboe](https://github.com/jimhigson/oboe.js) by [Jared Klopper](https://github.com/optical) -* [: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:](oidc-token-manager/oidc-token-manager.d.ts) [oidc-token-manager](https://github.com/IdentityModel/oidc-token-manager) by [Sławomir Rosiek](https://github.com/rosieks) -* [:link:](on-finished/on-finished.d.ts) [on-finished](https://github.com/jshttp/on-finished) by [Honza Dvorsky](http://github.com/czechboy0) -* [:link:](once/once.d.ts) [once](https://github.com/isaacs/once) by [Denis Sokolov](https://github.com/denis-sokolov) -* [:link:](onoff/onoff.d.ts) [onoff](https://github.com/fivdi/onoff) by [Marcel Ernst](https://github.com/marcel-ernst) -* [:link:](onsenui/onsenui.d.ts) [Onsen UI](http://onsen.io) by [Fran Dios](https://github.com/frankdiox) -* [:link:](open/open.d.ts) [open](https://github.com/jjrdn/node-open) by [Bart van der Schoor](https://github.com/Bartvds) -* [:link:](deep-extend/deep-extend.d.ts) [open](https://github.com/unclechu/node-deep-extend) by [rhysd](https://github.com/rhysd) -* [:link:](OpenJsCad/openjscad.d.ts) [OpenJsCad.js](https://github.com/joostn/OpenJsCad) by [Dan Marshall](https://github.com/danmarshall) -* [:link:](openlayers/openlayers.d.ts) [OpenLayers](http://openlayers.org) by [Wouter Goedhart](https://github.com/woutergd) -* [:link:](openpgp/openpgp.d.ts) [openpgpjs](http://openpgpjs.org) by [Guillaume Lacasa](https://blog.lacasa.fr) -* [: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), [Christopher Brown](https://github.com/chbrown) -* [:link:](ora/ora.d.ts) [ora](https://github.com/sindresorhus/ora) by [Basarat Ali Syed](https://github.com/basarat) -* [:link:](oracledb/oracledb.d.ts) [oracledb](https://github.com/oracle/node-oracledb) by [Richard Natal](https://github.com/Bigous) -* [: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:](osmtogeojson/osmtogeojson.d.ts) [osmtogeojson](https://github.com/tyrasd/osmtogeojson.git) by [Qubo](https://github.com/tkqubo) -* [: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:](HubSpot-pace/HubSpot-pace.d.ts) [pace](https://github.com/HubSpot/pace) by [Borislav Zhivkov](https://github.com/borislavjivkov) -* [: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:](parse-glob/parse-glob.d.ts) [parse-glob](https://github.com/jonschlinkert/parse-glob) by [glen-84](https://github.com/glen-84) -* [:link:](parse-torrent/parse-torrent.d.ts) [parse-torrent](https://github.com/feross/parse-torrent) by [Bazyli Brzóska](https://invent.life) -* [:link:](parse5/parse5.d.ts) [parse5](https://github.com/inikulin/parse5) by [Nico Jansen](https://github.com/nicojs) -* [: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-facebook/passport-facebook.d.ts) [passport-facebook](https://github.com/jaredhanson/passport-facebook) by [James Roland Cabresos](https://github.com/staticfunction) -* [:link:](passport-google-oauth/passport-google-oauth.d.ts) [passport-facebook](https://github.com/jaredhanson/passport-facebook) by [James Roland Cabresos](https://github.com/staticfunction) -* [:link:](passport-twitter/passport-twitter.d.ts) [passport-facebook](https://github.com/jaredhanson/passport-facebook) by [James Roland Cabresos](https://github.com/staticfunction) -* [:link:](passport-facebook-token/passport-facebook-token.d.ts) [passport-facebook-token](https://github.com/drudge/passport-facebook-token) by [Ray Martone](https://github.com/rmartone) -* [:link:](passport-http-bearer/passport-http-bearer.d.ts) [passport-http-bearer](https://github.com/jaredhanson/passport-http-bearer) by [Isman Usoh](https://github.com/isman-usoh) -* [:link:](passport-jwt/passport-jwt.d.ts) [passport-jwt](https://github.com/themikenicholson/passport-jwt) by [TANAKA Koichi](https://github.com/mugeso) -* [:link:](passport-local/passport-local.d.ts) [passport-local](https://github.com/jaredhanson/passport-local) by [Maxime LUCE](https://github.com/SomaticIT) -* [:link:](password-hash/password-hash.d.ts) [password-hash 1.2.x](https://github.com/davidwood/node-password-hash) by [TANAKA Koichi](https://github.com/mugeso) -* [:link:](path-case/path-case.d.ts) [path-case](https://github.com/blakeembrey/path-case) by [Sam Saint-Pettersen](https://github.com/stpettersens) -* [:link:](path-exists/path-exists.d.ts) [path-exists](https://github.com/sindresorhus/path-exists) by [Shogo Iwano](https://github.com/shiwano) -* [:link:](path-parse/path-parse.d.ts) [path-parse](https://github.com/jbgutierrez/path-parse) by [Dan Chao](http://dchao.co) -* [:link:](path-to-regexp/path-to-regexp.d.ts) [path-to-regexp](https://github.com/pillarjs/path-to-regexp) by [xica](https://github.com/xica) -* [:link:](pathjs/pathjs.d.ts) [Pathjs](https://github.com/mtrpcic/pathjs) by [Lokesh Peta](https://github.com/lokeshpeta) -* [:link:](pathwatcher/pathwatcher.d.ts) [pathwatcher](https://github.com/atom/node-pathwatcher) by [vvakame](https://github.com/vvakame) -* [:link:](PayPal-Cordova-Plugin/PayPal-Cordova-Plugin.d.ts) [PayPal-Cordova-Plugin](https://github.com/paypal/PayPal-Cordova-Plugin) by [Justin Unterreiner](https://github.com/Justin-Credible) -* [:link:](pdf/pdf.d.ts) [PDF.js](https://github.com/mozilla/pdf.js) by [Josh Baldwin](https://github.com/jbaldwin) -* [:link:](pdfkit/pdfkit.d.ts) [Pdfkit](http://pdfkit.org) by [Eric Hillah](https://github.com/erichillah) -* [:link:](pebblekitjs/pebblekitjs.d.ts) [PebbleKit JS](https://developer.pebble.com/docs/js/Pebble) by [Makoto Kawasaki](https://github.com/makotokw) -* [:link:](peerjs/peerjs.d.ts) [PeerJS](http://peerjs.com) by [Toshiya Nakakura](https://github.com/nakakura) -* [:link:](pegjs/pegjs.d.ts) [PEG.js](http://pegjs.org) by [vvakame](https://github.com/vvakame), [Tobias Kahlert](https://github.com/SrTobi) -* [:link:](persona/persona.d.ts) [Persona](http://www.mozilla.org/en-US/persona) by [James Frasca](https://github.com/Nycto) -* [:link:](pg/pg.d.ts) [pg](https://github.com/brianc/node-postgres) by [Phips Peter](http://pspeter3.com) -* [:link:](pg-promise/pg-promise.d.ts) [pg-promise](https://github.com/vitaly-t/pg-promise) by [vvakame](https://github.com/vvakame) -* [:link:](pgwmodal/pgwmodal.d.ts) [PgwModal](http://pgwjs.com/pgwmodal) by [Pine Mizune](https://github.com/pine613) -* [:link:](phantomcss/phantomcss.d.ts) [PhantomCSS](https://github.com/Huddle/PhantomCSS) by [Amaury Bauzac](https://github.com/abauzac) -* [:link:](phantom/phantom.d.ts) [PhantomJS bridge for NodeJS](https://github.com/sgentle/phantomjs-node) by [horiuchi](https://github.com/horiuchi), [Random](https://github.com/llRandom) -* [:link:](phantomjs/phantomjs.d.ts) [PhantomJS v1.9.0 API](https://github.com/ariya/phantomjs/wiki/API-Reference) by [Jed Hunsaker](https://github.com/jedhunsaker), [Mike Keesey](https://github.com/keesey) -* [:link:](phonegap/phonegap.d.ts) [PhoneGap](http://phonegap.com) by [Boris Yankov](https://github.com/borisyankov), [Dick van den Brink](https://github.com/DickvdBrink) -* [:link:](phonegap-nfc/phonegap-nfc.d.ts) [Phonegap NFC Plugin](https://github.com/chariotsolutions/phonegap-nfc) by [Michael Desigaud](https://github.com/michaeldesigaud) -* [:link:](phonegap-facebook-plugin/phonegap-facebook-plugin.d.ts) [phonegap-facebook-plugin](https://github.com/Wizcorp/phonegap-facebook-plugin) by [Justin Unterreiner](https://github.com/Justin-Credible) -* [:link:](phonegap-plugin-push/phonegap-plugin-push.d.ts) [phonegap-plugin-push](https://github.com/phonegap/phonegap-plugin-push) by [Frederico Galvão](https://github.com/fredgalvao) -* [:link:](urbanairship-cordova/urbanairship-cordova.d.ts) [phonegap-ua-push](https://github.com/urbanairship/phonegap-ua-push) by [Justin Unterreiner](https://github.com/Justin-Credible) -* [:link:](photonui/photonui.d.ts) [PhotonUI](https://github.com/wanadev/PhotonUI) by [Florent Poujol](https://github.com/florentpoujol) -* [:link:](photoswipe/photoswipe.d.ts) [PhotoSwipe](http://photoswipe.com) by [Xiaohan Zhang](https://github.com/hellochar) -* [:link:](physijs/physijs.d.ts) [Physijs](http://chandlerprall.github.io/Physijs) by [Satoru Kimura](https://github.com/gyohk) -* [:link:](pi-spi/pi-spi.d.ts) [pi-spi](https://github.com/natevw/pi-spi) by [Marcel Ernst](https://github.com/marcel-ernst) -* [:link:](pickadate/pickadate.d.ts) [pickadate.js](https://github.com/amsul/pickadate.js) by [Theodore Brown](https://github.com/theodorejb) -* [:link:](pify/pify.d.ts) [pify](https://github.com/sindresorhus/pify) by [Sam Verschueren](https://github.com/samverschueren) -* [: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:](pinterest-sdk/pinterest-sdk.d.ts) [pinterest-sdk](https://assets.pinterest.com/sdk/sdk.js) by [Adam Burmister](https://github.com/adamburmister) -* [: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 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) -* [:link:](power-assert/power-assert.d.ts) [power-assert](https://github.com/twada/power-assert) by [vvakame](https://github.com/vvakame) -* [:link:](power-assert-formatter/power-assert-formatter.d.ts) [power-assert-formatter](https://github.com/twada/power-assert-formatter) by [vvakame](https://github.com/vvakame) -* [:link:](precise/precise.d.ts) [precise](https://www.npmjs.org/package/precise) by [Peter Harris](https://github.com/codeanimal) -* [:link:](precond/precond.d.ts) [precond](https://github.com/MathieuTurcotte/node-precond) by [Oliver Schneider](https://github.com/olsio) -* [:link:](preloadjs/preloadjs.d.ts) [PreloadJS](http://www.createjs.com/#!/PreloadJS) by [Pedro Ferreira](https://bitbucket.org/drk4) -* [:link:](prelude-ls/prelude-ls.d.ts) [prelude.ls](http://www.preludels.com) by [Aya Morisawa](https://github.com/AyaMorisawa) -* [:link:](prettyjson/prettyjson.d.ts) [prettyjson](https://github.com/rafeca/prettyjson) by [Wael BEN ZID EL GUEBSI](https://github.com/benzid-wael) -* [:link:](meteor-prime8consulting-oauth2/meteor-prime8consulting-oauth2.d.ts) [prime8consulting:meteor-oauth2](https://github.com/prime-8-consulting/meteor-oauth2) by [Robbie Van Gorkom](https://github.com/vangorra) -* [:link:](prismjs/prism.d.ts) [prism](http://prismjs.com) by [Erik Lieben](https://github.com/eriklieben) -* [:link:](progressjs/progress.d.ts) [ProgressJs](http://usablica.github.io/progress.js) by [Shunsuke Ohtani](https://github.com/zaneli) -* [:link:](project-oxford/project-oxford.d.ts) [project-oxford](https://github.com/felixrieseberg/project-oxford) by [Scott Southwood](https://github.com/scsouthw) -* [:link:](promise/promise.d.ts) [promise](https://www.promisejs.org) by [Manuel Rueda](https://github.com/ManRueda) -* [:link:](promise-pg/promise-pg.d.ts) [promise-pg](https://bitbucket.org/lplabs/promise-pg) by [Chris Charabaruk](http://github.com/coldacid) -* [:link:](promise-pool/promise-pool.d.ts) [promise-pool](https://github.com/vilic/promise-pool) by [VILIC VANE](https://github.com/vilic) -* [:link:](promises-a-plus/promises-a-plus.d.ts) [promises-a-plus](http://promisesaplus.com) by [Igor Oleinikov](https://github.com/Igorbek) -* [:link:](promisify-supertest/promisify-supertest.d.ts) [promisify-supertest](https://www.npmjs.com/package/promisify-supertest) by [Leo Liang](https://github.com/aleung) -* [:link:](protobufjs/protobufjs.d.ts) [ProtoBuf.js](https://github.com/dcodeIO/ProtoBuf.js) by [Panu Horsmalahti](https://github.com/panuhorsmalahti) -* [:link:](protractor-helpers/protractor-helpers.d.ts) [protractor-helpers](https://github.com/wix/protractor-helpers) by [John Cant](https://github.com/johncant) -* [: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) -* [:link:](pure-render-decorator/pure-render-decorator.d.ts) [pure-render-decorator](https://github.com/felixgirault/pure-render-decorator) by [Sean Kelley](https://github.com/seansfkelley) -* [:link:](purl/purl.d.ts) [Purl](https://github.com/allmarkedup/purl) by [Daniel Ferreira Monteiro Alves](https://github.com/danfma) -* [:link:](pusher-js/pusher-js.d.ts) [pusher-js](https://github.com/pusher/pusher-js) by [Qubo](https://github.com/tkqubo) -* [:link:](q/Q.d.ts) [Q](https://github.com/kriskowal/q) by [Barrie Nemetchek](https://github.com/bnemetchek), [Andrew Gaspar](https://github.com/AndrewGaspar), [John Reilly](https://github.com/johnnyreilly) -* [:link:](q-io/Q-io.d.ts) [Q-io](https://github.com/kriskowal/q-io) by [Bart van der Schoor](https://github.com/Bartvds) -* [:link:](q-retry/q-retry.d.ts) [q-retry](https://github.com/vilic/q-retry) by [VILIC VANE](https://github.com/vilic) -* [: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:](quill/quill.d.ts) [Quill](http://quilljs.com) by [Sumit](https://github.com/sumitkm) -* [: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) -* [:link:](rabbit.js/rabbit.js.d.ts) [rabbit.js](https://github.com/squaremo/rabbit.js) by [Wonshik Kim](https://github.com/wokim) -* [:link:](ractive/ractive.d.ts) [Ractive](http://ractivejs.org) by [Han Lin Yap](http://yap.nu) -* [:link:](radium/radium.d.ts) [radium](https://github.com/formidablelabs/radium) by [Alex Gorbatchev](https://github.com/alexgorbatchev), [Philipp Holzer](https://github.com/nupplaphil) -* [:link:](random-js/random-js.d.ts) [random-js](https://github.com/ckknight/random-js) by [Gustavo Di Pietro](https://github.com/pistacchio) -* [:link:](random-string/random-string.d.ts) [random-string](https://github.com/valiton/node-random-string) by [Sam Saint-Pettersen](https://github.com/stpettersens) -* [:link:](rangy/rangy.d.ts) [Rangy](https://github.com/timdown/rangy) by [Rudolph Gottesheim](http://www.midnight-design.at) -* [: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), [Benjamin Pannell](http://github.com/spartan563) -* [: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-notification-system/react-notification-system.d.ts) [React Notification System](https://www.npmjs.com/package/react-notification-system) by [Giedrius Grabauskas](https://github.com/GiedriusGrabauskas), [Deividas Bakanas](https://github.com/DeividasBakanas) -* [:link:](rc-select/rc-select.d.ts) [React Select](https://github.com/react-component/select) by [Denis Tirilis](https://github.com/DenisTirilis) -* [:link:](react-bootstrap/react-bootstrap.d.ts) [react-bootstrap](https://github.com/react-bootstrap/react-bootstrap) by [Walker Burgin](https://github.com/walkerburgin), [Vincent Siao](https://github.com/vsiao) -* [:link:](react-bootstrap-table/react-bootstrap-table.d.ts) [react-bootstrap-table](https://github.com/AllenFang/react-bootstrap-table) by [Frank Laub](https://github.com/flaub) -* [:link:](react-cropper/react-cropper.d.ts) [react-cropper](https://github.com/roadmanfong/react-cropper) by [Stepan Mikhaylyuk](https://github.com/stepancar) -* [:link:](react-datagrid/react-datagrid.d.ts) [react-datagrid](https://github.com/zippyui/react-datagrid.git) by [Stephen Jelfs](https://github.com/stephenjelfs) -* [:link:](react-day-picker/react-day-picker.d.ts) [react-day-picker](https://github.com/gpbl/react-day-picker) by [Giampaolo Bellavite](https://github.com/gpbl), [Jason Killian](https://github.com/jkillian) -* [:link:](react-dropzone/react-dropzone.d.ts) [react-dropzone](https://github.com/paramaggarwal/react-dropzone) by [Mathieu Larouche Dube](https://github.com/matdube) -* [:link:](react-fa/react-fa.d.ts) [react-fa](https://github.com/andreypopp/react-fa) by [Frank Laub](https://github.com/flaub) -* [:link:](react-helmet/react-helmet.d.ts) [react-helmet](https://github.com/nfl/react-helmet) by [Evan Bremer](https://github.com/evanbb) -* [:link:](react-holder/react-holder.d.ts) [react-holder](https://github.com/Moeriki/react-holder) by [Isman Usoh](https://github.com/isman-usoh) -* [: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-motion/react-motion.d.ts) [react-motion](https://github.com/chenglou/react-motion) by [Stepan Mikhaylyuk](https://github.com/stepancar) -* [:link:](react-native/react-native.d.ts) [react-native](https://github.com/facebook/react-native) by [Bruno Grieder](https://github.com/bgrieder) -* [:link:](react-props-decorators/react-props-decorators.d.ts) [react-props-decorators](https://github.com/popkirby/react-props-decorators) by [Qubo](https://github.com/tkqubo) -* [:link:](react-redux/react-redux.d.ts) [react-redux](https://github.com/rackt/react-redux) by [Qubo](https://github.com/tkqubo), [Sean Kelley](https://github.com/seansfkelley) -* [:link:](react-router/react-router.d.ts) [react-router](https://github.com/rackt/react-router) by [Sergey Buturlakin](https://github.com/sergey-buturlakin), [Yuichi Murata](https://github.com/mrk21), [Václav Ostrožlík](https://github.com/vasek17), [Nathan Brown](https://github.com/ngbrown) -* [:link:](react-router-bootstrap/react-router-bootstrap.d.ts) [react-router-bootstrap](https://github.com/react-bootstrap/react-router-bootstrap) by [Vincent Lesierse](https://github.com/vlesierse) -* [:link:](react-router-redux/react-router-redux.d.ts) [react-router-redux](https://github.com/rackt/react-router-redux) by [Isman Usoh](http://github.com/isman-usoh), [Noah Shipley](https://github.com/noah79), [Dimitri Rosenberg](https://github.com/rosendi) -* [:link:](redux-immutable-state-invariant/redux-immutable-state-invariant.d.ts) [react-router-redux](https://github.com/leoasis/redux-immutable-state-invariant) by [Remo H. Jansen](https://github.com/remojansen) -* [:link:](react-select/react-select.d.ts) [react-select](https://github.com/JedWatson/react-select) by [ESQUIBET Hugo](https://github.com/Hesquibet), [Gilad Gray](https://github.com/giladgray) -* [:link:](react-spinkit/react-spinkit.d.ts) [react-spinkit](https://github.com/KyleAMathews/react-spinkit) by [Qubo](https://github.com/tkqubo) -* [:link:](react-swf/react-swf.d.ts) [react-swf](https://github.com/syranide/react-swf) by [Stepan Mikhaylyuk](https://github.com/stepancar) -* [:link:](react-swipeable-views/react-swipeable-views.d.ts) [react-swipeable-views](https://github.com/oliviertassinari/react-swipeable-views) by [Michael Ledin](https://github.com/mxl) -* [:link:](react-tabs/react-tabs.d.ts) [react-tabs](https://github.com/reactjs/react-tabs) by [Yuu Igarashi](https://github.com/yu-i9) -* [:link:](react-tagcloud/react-tagcloud.d.ts) [react-tagcloud](https://github.com/madox2/react-tagcloud) by [wassname](https://github.com/wassname) -* [:link:](react-tap-event-plugin/react-tap-event-plugin.d.ts) [react-tap-event-plugin](https://github.com/zilverline/react-tap-event-plugin) by [Michael Ledin](https://github.com/mxl) -* [:link:](react-widgets/react-widgets.d.ts) [react-widgets](https://github.com/jquense/react-widgets) by [Rogier Schouten](https://github.com/rogierschouten) -* [:link:](read/read.d.ts) [read](https://github.com/isaacs/read) by [Tim JK](https://github.com/timjk) -* [:link:](readdir-stream/readdir-stream.d.ts) [readdir-stream](https://github.com/logicalparadox/readdir-stream) by [Bart van der Schoor](https://github.com/Bartvds) -* [:link:](rebass/rebass.d.ts) [Rebass](https://github.com/jxnblk/rebass) by [rhysd](https://rhysd.github.io) -* [:link:](recursive-readdir/recursive-readdir.d.ts) [recursive-readdir](https://github.com/jergason/recursive-readdir) by [Elisée Maurer](https://github.com/elisee) -* [:link:](redis/redis.d.ts) [redis](https://github.com/mranney/node_redis) by [Carlos Ballesteros Velasco](https://github.com/soywiz), [Peter Harris](https://github.com/CodeAnimal), [TANAKA Koichi](https://github.com/MugeSo) -* [:link:](redlock/redlock.d.ts) [Redlock](https://github.com/mike-marcacci/node-redlock) by [Ilya Mochalov](https://github.com/chrootsu) -* [:link:](redux/redux.d.ts) [Redux](https://github.com/rackt/redux) by [William Buchwalter](https://github.com/wbuchwalter), [Vincent Prouillet](https://github.com/Keats) -* [:link:](redux-action-utils/redux-action-utils.d.ts) [redux-action-utils](https://github.com/insin/redux-action-utils) by [Qubo](https://github.com/tkqubo) -* [:link:](redux-actions/redux-actions.d.ts) [redux-actions](https://github.com/acdlite/redux-actions) by [Jack Hsu](https://github.com/jaysoo) -* [:link:](redux-debounced/redux-debounced.d.ts) [redux-debounced](https://github.com/ryanseddon/redux-debounced) by [Sean Kelley](https://github.com/seansfkelley) -* [:link:](redux-devtools/redux-devtools.d.ts) [redux-devtools](https://github.com/gaearon/redux-devtools) by [Petryshyn Sergii](https://github.com/mc-petry) -* [:link:](redux-devtools-dock-monitor/redux-devtools-dock-monitor.d.ts) [redux-devtools-dock-monitor](https://github.com/gaearon/redux-devtools-dock-monitor) by [Petryshyn Sergii](https://github.com/mc-petry) -* [:link:](redux-devtools-log-monitor/redux-devtools-log-monitor.d.ts) [redux-devtools-log-monitor](https://github.com/gaearon/redux-devtools-log-monitor) by [Petryshyn Sergii](https://github.com/mc-petry) -* [:link:](redux-form/redux-form.d.ts) [redux-form](https://github.com/erikras/redux-form) by [Daniel Lytkin](https://github.com/aikoven) -* [:link:](react-scroll/react-scroll.d.ts) [redux-immutable](https://github.com/fisshy/react-scroll) by [Pedro Pereira](https://github.com/oizie) -* [:link:](redux-immutable/redux-immutable.d.ts) [redux-immutable](https://github.com/gajus/redux-immutable) by [Pedro Pereira](https://github.com/oizie) -* [:link:](redux-logger/redux-logger.d.ts) [redux-logger](https://github.com/fcomb/redux-logger) by [Alexander Rusakov](https://github.com/arusakov) -* [:link:](redux-promise/redux-promise.d.ts) [redux-promise](https://github.com/acdlite/redux-promise) by [Rogelio Morrell Caballero](https://github.com/molekilla) -* [:link:](redux-router/redux-router.d.ts) [redux-router](https://github.com/rackt/redux-router) by [Stepan Mikhaylyuk](http://github.com/stepancar) -* [:link:](redux-saga/redux-saga.d.ts) [redux-saga](https://github.com/yelouafi/redux-saga) by [Daniel Lytkin](https://github.com/aikoven), [Dimitri Rosenberg](https://github.com/rosendi) -* [:link:](redux-thunk/redux-thunk.d.ts) [redux-thunk](https://github.com/gaearon/redux-thunk) by [Qubo](https://github.com/tkqubo) -* [: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:](reflux/reflux.d.ts) [RefluxJS](https://github.com/reflux/refluxjs) by [Maurice de Beijer](https://github.com/mauricedb) -* [:link:](relateurl/relateurl.d.ts) [relateurl](https://github.com/stevenvachon/relateurl) by [Tanguy Krotoff](https://github.com/tkrotoff) -* [:link:](replace-ext/replace-ext.d.ts) [replace-ext](https://github.com/wearefractal/replace-ext) by [Deividas Bakanas](https://github.com/DeividasBakanas) -* [: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), [Christopher Currens](https://github.com/ccurrens) -* [: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), [Joe Skeen](http://github.com/joeskeen) -* [:link:](requirejs/require.d.ts) [RequireJS](http://requirejs.org) by [Josh Baldwin](https://github.com/jbaldwin) -* [:link:](reselect/reselect.d.ts) [reselect](https://github.com/rackt/reselect) by [Ian Ker-Seymer](https://github.com/ianks) -* [:link:](resemblejs/resemblejs.d.ts) [Resemble.js](http://huddle.github.io/Resemble.js) by [Tim Perry](https://github.com/pimterry) -* [:link:](resolve-from/resolve-from.d.ts) [resolve-from](https://github.com/sindresorhus/resolve-from) by [unional](https://github.com/unional) -* [:link:](response-time/response-time.d.ts) [response-time](https://github.com/expressjs/response-time) by [Uros Smolnik](https://github.com/urossmolnik) -* [:link:](rest-io/rest-io.d.ts) [rest-io](https://github.com/EnoF/rest-io) by [Andy Tang](https://github.com/EnoF), [Stefan Schacherl](https://github.com/TheBay0r) -* [:link:](rest/rest.d.ts) [rest.js](https://github.com/cujojs/rest) by [Wim Looman](https://github.com/Nemo157) -* [:link:](restangular/restangular.d.ts) [Restangular](https://github.com/mgonto/restangular) by [Boris Yankov](https://github.com/borisyankov) -* [:link:](restful.js/restful.js.d.ts) [restful.js](https://github.com/marmelab/restful.js) by [Qubo](https://github.com/tkqubo) -* [:link:](rethinkdb/rethinkdb.d.ts) [Rethinkdb](http://rethinkdb.com) by [Sean Hess](https://seanhess.github.io) -* [:link:](reveal/reveal.d.ts) [Reveal](https://github.com/hakimel/reveal.js) by [grapswiz](https://github.com/grapswiz) -* [:link:](rewire/rewire.d.ts) [rewire](https://github.com/jhnns/rewire) by [Borislav Zhivkov](https://github.com/borislavjivkov) -* [: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-api-nodejs/riot-api-nodejs.d.ts) [Riot Games API](https://developer.riotgames.com) by [Luca Laissue](https://github.com/zafixlrp) -* [: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:](router5/router5.d.ts) [router5](https://github.com/router5/router5) by [Matthew Dahl](https://github.com/sandersky) -* [: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) -* [:link:](rx-dom/rx-dom.d.ts) [RxJS](https://github.com/Reactive-Extensions/RxJS-DOM) by [oliver Weichhold](https://github.com/oliverw) -* [:link:](rx/rx.aggregates.d.ts) [RxJS-Aggregates](http://rx.codeplex.com) by [Carl de Billy](http://carl.debilly.net), [Igor Oleinikov](https://github.com/Igorbek) -* [:link:](rx/rx.all.d.ts) [RxJS-All](http://rx.codeplex.com) by [Carl de Billy](http://carl.debilly.net), [Igor Oleinikov](https://github.com/Igorbek) -* [:link:](rx/rx.async.d.ts) [RxJS-Async](http://rx.codeplex.com) by [zoetrope](https://github.com/zoetrope), [Igor Oleinikov](https://github.com/Igorbek) -* [:link:](rx/rx.backpressure.d.ts) [RxJS-BackPressure](http://rx.codeplex.com) by [Igor Oleinikov](https://github.com/Igorbek) -* [:link:](rx/rx.binding.d.ts) [RxJS-Binding](http://rx.codeplex.com) by [Carl de Billy](http://carl.debilly.net), [Igor Oleinikov](https://github.com/Igorbek) -* [:link:](rx/rx.coincidence.d.ts) [RxJS-Coincidence](http://rx.codeplex.com) by [Carl de Billy](http://carl.debilly.net), [Igor Oleinikov](https://github.com/Igorbek) -* [:link:](rx/rx.experimental.d.ts) [RxJS-Experimental](https://github.com/Reactive-Extensions/RxJS) by [Igor Oleinikov](https://github.com/Igorbek) -* [:link:](rx/rx.joinpatterns.d.ts) [RxJS-Join](http://rx.codeplex.com) by [Igor Oleinikov](https://github.com/Igorbek) -* [:link:](rx-jquery/rx.jquery.d.ts) [RxJS-jQuery](https://github.com/Reactive-Extensions/RxJS-jQuery) by [Igor Oleinikov](https://github.com/Igorbek) -* [:link:](rx/rx.lite.d.ts) [RxJS-Lite](http://rx.codeplex.com) by [gsino](http://www.codeplex.com/site/users/view/gsino), [Igor Oleinikov](https://github.com/Igorbek) -* [:link:](rx/rx.testing.d.ts) [RxJS-Testing](https://github.com/Reactive-Extensions/RxJS) by [Igor Oleinikov](https://github.com/Igorbek) -* [: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:](safari-extension/safari-extension.d.ts) [Safari extension development](https://developer.apple.com/library/safari/documentation/Tools/Conceptual/SafariExtensionGuide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40009977-CH1-SW1) by [Luuk](https://github.com/luukd) -* [:link:](safari-extension/safari-extension-content.d.ts) [Safari extension development (content-scripts)](https://developer.apple.com/library/safari/documentation/Tools/Conceptual/SafariExtensionGuide/InjectingScripts/InjectingScripts.html#//apple_ref/doc/uid/TP40009977-CH6-SW1) by [Luuk](https://github.com/luukd) -* [: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:](sat/sat.d.ts) [sat.js](https://github.com/jriecken/sat-js) by [Hou Chunlei](https://github.com/omni360) -* [: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:](microsoft-sdk-soap/microsoft-sdk-soap.d.ts) [Sdk.Soap.js](https://code.msdn.microsoft.com/SdkSoapjs-9b51b99a) by [Markus Mauch](https://github.com/markusmauch) -* [: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) -* [:link:](select2/select2.d.ts) [Select2](http://ivaynberg.github.com/select2) by [Boris Yankov](https://github.com/borisyankov) -* [:link:](selectize/selectize.d.ts) [Selectize](https://github.com/brianreavis/selectize.js) by [Adi Dahiya](https://github.com/adidahiya) -* [:link:](selenium-webdriver/selenium-webdriver.d.ts) [Selenium WebDriverJS](https://code.google.com/p/selenium) by [Bill Armstrong](https://github.com/BillArmstrong), [Yuki Kokubun](https://github.com/Kuniwak) -* [:link:](semaphore/semaphore.d.ts) [semaphore](https://github.com/abrkn/semaphore.js) by [Matt Frantz](https://github.com/mhfrantz) -* [:link:](semver/semver.d.ts) [semver](https://github.com/npm/node-semver) by [Bart van der Schoor](https://github.com/Bartvds) -* [:link:](sendgrid/sendgrid.d.ts) [sendgrid](https://github.com/sendgrid/sendgrid-nodejs) by [Maxime LUCE](https://github.com/SomaticIT) -* [:link:](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:](serve-index/serve-index.d.ts) [serve-index](https://github.com/expressjs/serve-index) by [Tanguy Krotoff](https://github.com/tkrotoff) -* [:link:](serve-static/serve-static.d.ts) [serve-static](https://github.com/expressjs/serve-static) by [Uros Smolnik](https://github.com/urossmolnik) -* [:link:](ss-utils/ss-utils.d.ts) [ServiceStack Utils](https://servicestack.net) by [Demis Bellot](https://github.com/mythz) -* [: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](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/shouldjs/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), [Giedrius Grabauskas](https://github.com/GiedriusGrabauskas) -* [: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.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) -* [:link:](sinon-stub-promise/sinon-stub-promise.d.ts) [sinon-stub-promise](https://github.com/substantial/sinon-stub-promise) by [Thiago Temple](https://github.com/vintem) -* [:link:](sipml/sipml.d.ts) [SIPml5](http://sipml5.org) by [A. Groenenboom](https://github.com/chookies) -* [:link:](sjcl/sjcl.d.ts) [sjcl](http://crypto.stanford.edu/sjcl) by [Eugene Chernyshov](https://github.com/Evgenus) -* [:link:](ski/ski.d.ts) [ski](https://github.com/jden/ski) by [Aya Morisawa](https://github.com/AyaMorisawa) -* [:link:](skyway/skyway.d.ts) [SkyWay](http://nttcom.github.io/skyway) by [Toshiya Nakakura](https://github.com/nakakura) -* [:link:](slate-irc/slate-irc.d.ts) [slate-irc](https://github.com/slate/slate-irc) by [Elisée MAURER](https://github.com/elisee) -* [:link:](slickgrid/SlickGrid.d.ts) [SlickGrid](https://github.com/mleibman/SlickGrid) by [Josh Baldwin](https://github.com/jbaldwin) -* [:link:](slickgrid/slick.autotooltips.d.ts) [SlickGrid AutoToolTips Plugin](https://github.com/mleibman/SlickGrid) by [Ryo Iwamoto](https://github.com/ryiwamoto) -* [:link:](slickgrid/slick.headerbuttons.d.ts) [SlickGrid HeaderButtons Plugin](https://github.com/mleibman/SlickGrid) by [Derek Cicerone](https://github.com/derekcicerone) -* [:link:](slickgrid/slick.rowselectionmodel.d.ts) [SlickGrid RowSelectionModel Plugin](https://github.com/mleibman/SlickGrid) by [Derek Cicerone](https://github.com/derekcicerone) -* [:link:](slideout/slideout.d.ts) [Slideout](https://github.com/mango/slideout) by [Markus Peloso](https://github.com/ToastHawaii) -* [:link:](smoothie/smoothie.d.ts) [Smoothie Charts](https://github.com/joewalnes/smoothie) by [Drew Noakes](https://drewnoakes.com), [Mike H. Hawley](https://github.com/mikehhawley) -* [:link:](smtpapi/smtpapi.d.ts) [smtpapi-nodejs](https://github.com/sendgrid/smtpapi-nodejs) by [Antonio Morales](https://github.com/a-morales) -* [:link:](snake-case/snake-case.d.ts) [snake-case](https://github.com/blakeembrey/snake-case) by [Sam Saint-Pettersen](https://github.com/stpettersens) -* [:link:](snapsvg/snapsvg.d.ts) [Snap-SVG](https://github.com/adobe-webplatform/Snap.svg) by [Lars Klein](https://github.com/lhk), [Mattanja Kern](https://github.com/mattanja) -* [:link:](soap/soap.d.ts) [soap](https://www.npmjs.com/package/soap) by [Nicole Wang](https://github.com/nicoleWjie) -* [:link:](cordova-plugin-x-socialsharing/cordova-plugin-x-socialsharing.d.ts) [SocialSharing-PhoneGap-Plugin](https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin) by [Markus Wagner](https://github.com/Ritzlgrmft) -* [:link:](socket.io/socket.io.d.ts) [socket.io](http://socket.io) by [PROGRE](https://github.com/progre), [Damian Connolly](https://github.com/divillysausages), [Florent Poujol](https://github.com/florentpoujol) -* [:link:](socket.io-client/socket.io-client.d.ts) [socket.io-client](http://socket.io) by [PROGRE](https://github.com/progre), [Damian Connolly](https://github.com/divillysausages), [Florent Poujol](https://github.com/florentpoujol) -* [:link:](socket.io-redis/socket.io-redis.d.ts) [socket.io-redis](https://github.com/socketio/socket.io-redis) by [Philipp Holzer](https://github.com/nupplaphil) -* [:link:](socket.io.users/socket.io.users.d.ts) [socket.io.users](https://github.com/nodets/socket.io.users) by [Makis Maropoulos](https://github.com/kataras) -* [:link:](socketty/socketty.d.ts) [Socketty](https://www.npmjs.com/package/socketty) by [Nax](https://github.com/Nax) -* [:link:](sockjs/sockjs.d.ts) [SockJS 0.3.x](https://github.com/sockjs/sockjs-client) by [Emil Ivanov](https://github.com/vladev) -* [: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) -* [:link:](space-pen/space-pen.d.ts) [SpacePen](https://github.com/atom/space-pen) by [vvakame](https://github.com/vvakame) -* [:link:](speakeasy/speakeasy.d.ts) [speakeasy](https://github.com/markbao/speakeasy) by [Lucas Woo](https://github.com/legendecas) -* [:link:](spectrum/spectrum.d.ts) [spectrum](https://github.com/bgrins/spectrum) by [Mordechai Zuber](https://github.com/M-Zuber) -* [:link:](spin/spin.d.ts) [Spin.js](http://fgnass.github.com/spin.js) by [Boris Yankov](https://github.com/borisyankov), [Theodore Brown](https://github.com/theodorejb) -* [:link:](split/split.d.ts) [split](https://github.com/dominictarr/split) by [Marcin Porębski](https://github.com/marcinporebski) -* [:link:](spotify-web-api-js/spotify-web-api-js.d.ts) [spotify-web-api-js](https://github.com/JMPerez/spotify-web-api-js) by [Niels Kristian Hansen Skovmand](https://github.com/skovmand) -* [: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) -* [:link:](stack-mapper/stack-mapper.d.ts) [stack-mapper](https://github.com/thlorenz/stack-mapper) by [Rogier Schouten](https://github.com/rogierschouten) -* [:link:](stacktrace-js/stacktrace-js.d.ts) [stacktrace.js](https://github.com/stacktracejs/stacktrace.js) by [Exceptionless](https://github.com/exceptionless) -* [:link:](stampit/stampit.d.ts) [stampit](https://github.com/stampit-org/stampit) by [Vasyl Boroviak](https://github.com/koresar) -* [:link:](stamplay-js-sdk/stamplay-js-sdk.d.ts) [stamplay-js-sdk](https://github.com/Stamplay/stamplay-js-sdk) by [Riderman de Sousa Barbosa](https://github.com/ridermansb) -* [:link:](static-eval/static-eval.d.ts) [static-eval](https://github.com/substack/static-eval) by [Ben Liddicott](https://github.com/benliddicott/DefinitelyTyped) -* [: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-meter/stream-meter.d.ts) [stream-meter](https://github.com/brycebaril/node-stream-meter) by [TANAKA Koichi](https://github.com/mugeso) -* [:link:](stream-series/stream-series.d.ts) [stream-series](https://github.com/rschmukler/stream-series) by [Keita Kagurazaka](https://github.com/k-kagurazaka) -* [:link:](stream-to-array/stream-to-array.d.ts) [stream-to-array](https://github.com/stream-utils/stream-to-array) by [Bart van der Schoor](https://github.com/Bartvds) -* [:link:](streamjs/streamjs.d.ts) [streamjs](http://winterbe.github.io/streamjs) by [Bence Eros](https://github.com/erosb) -* [: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:](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), [Peter Harris](https://github.com/codeanimal) -* [:link:](strophe/strophe.d.ts) [Strophe.js](http://strophe.im/strophejs) by [David Deutsch](https://github.com/DavidKDeutsch) -* [:link:](stylus/stylus.d.ts) [stylus](https://github.com/LearnBoost/stylus) by [Maxime LUCE](https://github.com/SomaticIT) -* [:link:](sugar/sugar.d.ts) [Sugar](http://sugarjs.com) by [Josh Baldwin](https://github.com/jbaldwin) -* [: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-2.3.9.d.ts) [svg-pan-zoom](https://github.com/ariutta/svg-pan-zoom) by [Chintan Shah](https://github.com/Promact) -* [:link:](svg-pan-zoom/svg-pan-zoom.d.ts) [svg-pan-zoom](https://github.com/ariutta/svg-pan-zoom) by [César Vidril](https://github.com/Yimiprod) -* [: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) -* [:link:](svg2png/svg2png.d.ts) [svg2png node package](https://github.com/domenic/svg2png) by [hans windhoff](https://github.com/hansrwindhoff) -* [:link:](svgjs.draggable/svgjs.draggable.d.ts) [svgjs.draggable](http://www.svgjs.com) by [Luigi Trabacchin](https://github.com/LiFeleSs) -* [:link:](swag/swag.d.ts) [swag](https://github.com/elving/swag) by [Shogo Iwano](https://github.com/shiwano) -* [:link:](swaggerize-express/swaggerize-express.d.ts) [swaggerize-express 4.x](https://github.com/krakenjs/swaggerize-express) by [TANAKA Koichi](https://github.com/mugeso) -* [: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) -* [:link:](swiper/swiper.d.ts) [Swiper](https://github.com/nolimits4web/Swiper) by [Sebastián Galiano](https://github.com/sgaliano), [Luca Trazzi](https://github.com/lucax88x) -* [:link:](swipeview/swipeview.d.ts) [SwipeView](http://cubiq.org/swipeview) by [Boris Yankov](https://github.com/borisyankov) -* [:link:](switchery/switchery.d.ts) [switchery](https://github.com/abpetkov/switchery) by [Bruno Grieder](https://github.com/bgrieder), [Clayton Lautier](https://github.com/claylaut) -* [:link:](swiz/swiz.d.ts) [swiz](https://github.com/racker/node-swiz) by [Jeff Goddard](https://github.com/jedigo) -* [: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), [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:](facebook-js-sdk/facebook-js-sdk.d.ts) [the Facebook Javascript SDK](https://developers.facebook.com/docs/javascript) by [Amrit Kahlon](https://github.com/amritk) -* [:link:](facebook-pixel/facebook-pixel.d.ts) [the Facebook Pixel Tag API](https://developers.facebook.com/docs/ads-for-websites/tag-api) by [Noctis Hsu](https://github.com/noctishsu) -* [:link:](spotify-api/spotify-api.d.ts) [The Spotify Web API](https://developer.spotify.com/web-api) by [Niels Kristian Hansen Skovmand](https://github.com/skovmand) -* [:link:](threejs/three-FirstPersonControls.d.ts) [three.js](http://mrdoob.github.com/three.js) by [Poul Kjeldager Sørensen](https://github.com/s093294) -* [:link:](threejs/three-canvasrenderer.d.ts) [three.js (CanvasRenderer.js)](https://github.com/mrdoob/three.js/blob/master/examples/js/renderers/CanvasRenderer.js) by [Satoru Kimura](https://github.com/gyohk) -* [: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) -* [:link:](threejs/three-orthographictrackballcontrols.d.ts) [three.js (OrthographicTrackballControls.js)](https://github.com/mrdoob/three.js/blob/master/examples/js/controls/OrthographicTrackballControls.js) by [Stefan Profanter](https://github.com/pro) -* [:link:](threejs/three-projector.d.ts) [three.js (Projector.js)](https://github.com/mrdoob/three.js/blob/master/examples/js/renderers/Projector.js) by [Satoru Kimura](https://github.com/gyohk) -* [:link:](threejs/three-renderpass.d.ts) [three.js (RenderPass.js)](https://github.com/mrdoob/three.js/blob/r68/examples/js/postprocessing/RenderPass.js) by [Satoru Kimura](https://github.com/gyohk) -* [:link:](threejs/three-shaderpass.d.ts) [three.js (ShaderPass.js)](https://github.com/mrdoob/three.js/blob/r68/examples/js/postprocessing/ShaderPass.js) by [Satoru Kimura](https://github.com/gyohk) -* [:link:](threejs/three-trackballcontrols.d.ts) [three.js (TrackballControls.js)](https://github.com/mrdoob/three.js/blob/master/examples/js/controls/TrackballControls.js) by [Satoru Kimura](https://github.com/gyohk) -* [: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 r75](http://mrdoob.github.com/three.js) by [Kon](http://phyzkit.net), [Satoru Kimura](https://github.com/gyohk), [Florent Poujol](https://github.com/florentpoujol), [SereznoKot](https://github.com/SereznoKot) -* [:link:](thrift/thrift.d.ts) [thrift](https://www.npmjs.com/package/thrift) by [Zachary Collins](https://github.com/corps) -* [:link:](through/through.d.ts) [through](https://github.com/dominictarr/through) by [Andrew Gaspar](https://github.com/AndrewGaspar) -* [:link:](through2/through2.d.ts) [through2 v](https://github.com/rvagg/through2) by [Bart van der Schoor](https://github.com/Bartvds), [jedmao](https://github.com/jedmao), [Georgios Valotasios](https://github.com/valotas) -* [: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) -* [:link:](tv4/tv4.d.ts) [Tiny Validator tv4](https://github.com/geraintluff/tv4) by [Bart van der Schoor](https://github.com/Bartvds), [Peter Snider](https://github.com/psnider) -* [:link:](tinycolor/tinycolor.d.ts) [tinycolor](https://github.com/bgrins/TinyColor) by [Mordechai Zuber](https://github.com/M-Zuber) -* [:link:](titanium/titanium.d.ts) [Titanium Mobile](http://www.appcelerator.com) by [Craig Younkins](https://github.com/cyounkins) -* [:link:](title-case/title-case.d.ts) [title-case](https://github.com/blakeembrey/title-case) by [Sam Saint-Pettersen](https://github.com/stpettersens) -* [:link:](tmp/tmp.d.ts) [tmp](https://www.npmjs.com/package/tmp) by [Jared Klopper](https://github.com/optical) -* [:link:](to-title-case-gouch/to-title-case-gouch.d.ts) [to-title-case](https://github.com/gouch/to-title-case) by [Sam Saint-Pettersen](https://github.com/stpettersens) -* [:link:](toastr/toastr.d.ts) [Toastr](https://github.com/CodeSeven/toastr) by [Boris Yankov](https://github.com/borisyankov) -* [: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:](traverse/traverse.d.ts) [traverse](https://github.com/substack/js-traverse) by [newclear](https://github.com/newclear) -* [: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) -* [:link:](twitter/twitter.d.ts) [Twitter for Websites](https://dev.twitter.com/web) by [Chitoku](https://github.com/chitoku-k) -* [:link:](jquery.bootstrap.wizard/jquery.bootstrap.wizard.d.ts) [twitter-bootstrap-wizard](https://github.com/VinceG/twitter-bootstrap-wizard) by [Blake Niemyjski](https://github.com/niemyjski) -* [:link:](twitter-text/twitter-text.d.ts) [twitter-text](https://github.com/twitter/twitter-text) by [rhysd](https://rhysd.github.io) -* [:link:](twix/twix.d.ts) [twix.js](https://github.com/icambron/twix.js) by [j3ko](https://github.com/j3ko) -* [:link:](type-check/type-check.d.ts) [type-check](https://github.com/gkz/type-check) by [Hans Windhoff](https://github.com/hansrwindhoff) -* [:link:](type-detect/type-detect.d.ts) [type-detect](https://github.com/chaijs/type-detect) by [Bart van der Schoor](https://github.com/Bartvds) -* [:link:](type-name/type-name.d.ts) [type-name](https://github.com/twada/type-name) by [OKUNOKENTARO](https://github.com/armorik83) -* [:link:](typeahead/typeahead.d.ts) [typeahead.js](http://twitter.github.io/typeahead.js) by [Ivaylo Gochkov](https://github.com/igochkov), [Gidon Junge](https://github.com/gjunge) -* [:link:](webfontloader/webfontloader.d.ts) [typekit-webfontloader](https://github.com/typekit/webfontloader) by [doskallemaskin](https://github.com/doskallemaskin) -* [:link:](typescript-services/typescriptServices.d.ts) [TypeScript API](http://www.typescriptlang.org) by [Microsoft TypeScript](http://typescriptlang.org) -* [:link:](typescript/typescript.d.ts) [TypeScript API](http://www.typescriptlang.org) by [Microsoft TypeScript](http://typescriptlang.org) -* [:link:](typescript-deferred/typescript-deferred.d.ts) [typescript-deferred](https://github.com/DirtyHairy/typescript-deferred) by [Christian Speckner](https://github.com/DirtyHairy) -* [:link:](meteor-persistent-session/meteor-persistent-session.d.ts) [u2622:persistent-session](https://github.com/okgrow/meteor-persistent-session) by [Robbie Van Gorkom](https://github.com/vangorra) -* [:link:](ua-parser-js/ua-parser-js.d.ts) [ua-parser-js](https://github.com/faisalman/ua-parser-js) by [Viktor Miroshnikov](https://github.com/superduper), [Lucas Woo](https://github.com/legendecas) -* [:link:](unity-webapi/unity-webapi.d.ts) [Ubuntu Unity Web API](https://launchpad.net/libunity-webapps) by [John Vrbanac](https://github.com/jmvrbanac) -* [:link:](uglify-js/uglify-js.d.ts) [UglifyJS 2](https://github.com/mishoo/UglifyJS2) by [Tanguy Krotoff](https://github.com/tkrotoff) -* [: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:](ui-select/ui-select.d.ts) [ui-select](https://github.com/angular-ui/ui-select) by [Niko Kovačič](https://github.com/nkovacic) -* [:link:](uikit/uikit.d.ts) [uikit](http://getuikit.org) by [Giovanni Silva](https://github.com/giovannicandido) -* [:link:](umbraco/umbraco-resources.d.ts) [Umbraco](https://github.com/umbraco) by [DeCareSystemsIreland](https://github.com/DeCareSystemsIreland) -* [:link:](umbraco/umbraco-services.d.ts) [Umbraco](https://github.com/umbraco) by [DeCareSystemsIreland](https://github.com/DeCareSystemsIreland) -* [:link:](umbraco/umbraco.d.ts) [Umbraco](https://github.com/umbraco) by [DeCareSystemsIreland](https://github.com/DeCareSystemsIreland) -* [:link:](umzug/umzug.d.ts) [Umzug](https://github.com/sequelize/umzug) by [Ivan Drinchev](https://github.com/drinchev) -* [:link:](underscore/underscore.d.ts) [Underscore](http://underscorejs.org) by [Boris Yankov](https://github.com/borisyankov), [Josh Baldwin](https://github.com/jbaldwin), [Christopher Currens](https://github.com/ccurrens) -* [: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) -* [:link:](undertaker/undertaker.d.ts) [undertaker](https://github.com/phated/undertaker) by [Qubo](https://github.com/tkqubo) -* [: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) -* [:link:](upper-case/upper-case.d.ts) [upper-case](https://github.com/blakeembrey/upper-case) by [Sam Saint-Pettersen](https://github.com/stpettersens) -* [:link:](upper-case-first/upper-case-first.d.ts) [upper-case-first](https://github.com/blakeembrey/upper-case-first) by [Sam Saint-Pettersen](https://github.com/stpettersens) -* [:link:](uri-templates/uri-templates.d.ts) [uri-templates](https://github.com/geraintluff/uri-templates) by [Bart van der Schoor](https://github.com/Bartvds) -* [:link:](urijs/URIjs.d.ts) [URI.js](https://github.com/medialize/URI.js) by [RodneyJT](https://github.com/RodneyJT), [Brian Surowiec](https://github.com/xt0rted) -* [:link:](js-url/js-url.d.ts) [url](https://github.com/websanova/js-url) by [MIZUNE Pine](https://github.com/pine613) -* [:link:](url-template/url-template.d.ts) [url-template](https://github.com/bramstein/url-template) by [Marcin Porębski](https://github.com/marcinporebski) -* [: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:](username/username.d.ts) [username](https://www.npmjs.com/package/username) by [Klaus Reimer](https://github.com/kayahr) -* [:link:](utils-merge/utils-merge.d.ts) [utils-merge](https://github.com/jaredhanson/utils-merge) by [Ilya Mochalov](https://github.com/chrootsu) -* [:link:](uuid-1345/uuid-1345.d.ts) [uuid-1345](https://github.com/scravy/uuid-1345) by [TANAKA Koichi](https://github.com/mugeso) -* [:link:](uuid/UUID.d.ts) [UUID.js](https://github.com/LiosK/UUID.js) by [Jason Jarrett](https://github.com/staxmanade) -* [:link:](valerie/valerie.d.ts) [valerie](https://github.com/davewatts/valerie) by [Howard Richards](https://github.com/conficient) -* [:link:](validator/validator.d.ts) [validator.js](https://github.com/chriso/validator.js) by [tgfjt](https://github.com/tgfjt), [Ilya Mochalov](https://github.com/chrootsu) -* [:link:](vec3/vec3.d.ts) [Vec3 Librairy](https://www.npmjs.com/package/vec3) by [Xavier Stouder](https://github.com/xstoudi) -* [: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) -* [:link:](videojs/videojs.d.ts) [Video.js](https://github.com/zencoder/video-js) by [Vincent Bortone](https://github.com/vbortone) -* [:link:](vimeo/froogaloop.d.ts) [Vimeo](http://developer.vimeo.com/player/js-api) by [Daz Wilkin](https://github.com/DazWilkin) -* [:link:](vinyl/vinyl.d.ts) [vinyl](https://github.com/wearefractal/vinyl) by [vvakame](https://github.com/vvakame), [jedmao](https://github.com/jedmao) -* [:link:](vinyl-buffer/vinyl-buffer.d.ts) [vinyl-buffer](https://github.com/hughsk/vinyl-buffer) by [Qubo](https://github.com/tkQubo) -* [:link:](vinyl-fs/vinyl-fs.d.ts) [vinyl-fs](https://github.com/wearefractal/vinyl-fs) by [vvakame](https://github.com/vvakame) -* [:link:](vinyl-paths/vinyl-paths.d.ts) [vinyl-paths](https://github.com/sindresorhus/vinyl-paths) by [Qubo](https://github.com/tkQubo) -* [: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-resource/vue-resource.d.ts) [vue-resoure](https://github.com/vuejs/vue-resource) by [kaorun343](https://github.com/kaorun343) -* [: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:](w2ui/w2ui.d.ts) [w2ui](http://w2ui.com) by [Valentin Robert](https://github.com/Ptival) -* [:link:](wake_on_lan/wake_on_lan.d.ts) [wake_on_lan](https://github.com/agnat/node_wake_on_lan) by [Tobias Kahlert](https://github.com/SrTobi) -* [:link:](wampy/wampy.d.ts) [wampy.js](https://github.com/KSDaemon/wampy.js) by [Konstantin Burkalev](https://github.com/KSDaemon) -* [:link:](watch/watch.d.ts) [watch](https://github.com/mikeal/watch) by [Carlos Ballesteros Velasco](https://github.com/soywiz) -* [:link:](jquery.watermark/jquery.watermark.d.ts) [Watermark plugin for jQuery](http://jquery-watermark.googlecode.com) by [Anwar Javed](https://github.com/anwarjaved) -* [:link:](webaudioapi/waa.d.ts) [Web Audio API](http://www.w3.org/TR/webaudio) by [Baruch Berger](https://github.com/bbss), [Kon](http://phyzkit.net), [kubosho](https://github.com/kubosho) -* [: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), [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) -* [:link:](webpack/webpack-env.d.ts) [webpack (module API)](https://github.com/webpack/webpack) by [use-strict](https://github.com/use-strict) -* [:link:](webrtc/MediaStream.d.ts) [WebRTC](http://dev.w3.org/2011/webrtc) by [Ken Smith](https://github.com/smithkl42) -* [:link:](websocket/websocket.d.ts) [websocket](https://github.com/Worlize/WebSocket-Node) by [Paul Loyd](https://github.com/loyd) -* [:link:](websql/websql.d.ts) [websql](http://www.w3.org/TR/webdatabase) by [TeamworkGuy2](https://github.com/TeamworkGuy2) -* [:link:](webtorrent/webtorrent.d.ts) [WebTorrent](https://webtorrent.io) by [Bazyli Brzóska](https://invent.life) -* [:link:](webvr-api/webvr-api.d.ts) [WebVR API](http://mozvr.github.io/webvr-spec/webvr.html) by [Toshiya Nakakura](https://github.com/nakakura) -* [:link:](when/when.d.ts) [When](https://github.com/cujojs/when) by [Derek Cicerone](https://github.com/derekcicerone), [Wim Looman](https://github.com/Nemo157) -* [:link:](which/which.d.ts) [which](https://github.com/isaacs/node-which) by [vvakame](https://github.com/vvakame) -* [:link:](jquery.window/jquery.window.d.ts) [Window plugin for jQuery](http://fstoke.me/jquery/window) by [Ryan Graham](https://github.com/ryan-codingintrigue) -* [:link:](windows-1251/windows-1251.d.ts) [windows-1251](https://github.com/mathiasbynens/windows-1251) by [RomanGolovanov](https://github.com/RomanGolovanov) -* [:link:](windows-service/windows-service.d.ts) [windows-service](https://bitbucket.org/stephenwvickers/node-windows-service) by [Rogier Schouten](https://github.com/rogierschouten) -* [:link:](winjs/winjs.d.ts) [WinJS](http://try.buildwinjs.com) by [TypeScript samples](https://www.typescriptlang.org), [Adam Hewitt](https://github.com/adamhewitt627), [Craig Treasure](https://github.com/craigktreasure), [Jeff Fisher](https://github.com/xirzec) -* [:link:](winreg/winreg.d.ts) [Winreg](https://github.com/fresc81/node-winreg) by [RX14](https://github.com/RX14) -* [: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:](wiredep/wiredep.d.ts) [Wiredep v3.0.x](https://github.com/taptapship/wiredep) by [Abraão Alves](http://abraaoalves.github.io) -* [: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) -* [:link:](xdomain/xdomain.d.ts) [xdomain](http://jpillora.com/xdomain) by [Dan Chao](http://dchao.co) -* [:link:](jsfl/xJSFL.d.ts) [xJSFL](http://www.xjsfl.com) by [soywiz](https://github.com/soywiz) -* [:link:](xlsx/xlsx.d.ts) [xlsx](https://github.com/SheetJS/js-xlsx) by [themauveavenger](https://github.com/themauveavenger) -* [: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:](xmldom/xmldom.d.ts) [xmldom](https://github.com/jindw/xmldom.git) by [Qubo](https://github.com/tkqubo) -* [:link:](xmltojson/xmltojson.d.ts) [xmltojson](https://github.com/metatribal/xmlToJSON) by [Travis Crowe](https://github.com/traviscrowe) -* [: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), [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) -* [:link:](yargs/yargs.d.ts) [yargs](https://github.com/chevex/yargs) by [Martin Poelstra](https://github.com/poelstra) -* [:link:](ydn-db/ydn-db.d.ts) [YDN-DB version 1](http://dev.yathit.com/ydn-db/index.html) by [Kyaw Tun](https://github.com/yathit), [Gabriel Monteagudo](https://github.com/gabrielmaldi) -* [:link:](yeoman-generator/yeoman-generator.d.ts) [yeoman-generator](https://github.com/yeoman/generator) by [Kentaro Okuno](http://github.com/armorik83) -* [:link:](yfiles/yfiles.d.ts) [yFiles for HTML](http://www.yworks.com/products/yfiles-for-html) by [yWorks GmbH](http://www.yworks.com) -* [:link:](yosay/yosay.d.ts) [yosay](https://github.com/yeoman/yosay) by [Kentaro Okuno](http://github.com/armorik83) -* [:link:](youtube/youtube.d.ts) [YouTube](https://developers.google.com/youtube) by [Daz Wilkin](https://github.com/DazWilkin), [Ian Obermiller](http://ianobermiller.com) -* [: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 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) -* [:link:](viewporter/viewporter.d.ts) [Zynga Viewporter](https://github.com/zynga/viewporter) by [Boris Yankov](https://github.com/borisyankov) - diff --git a/README.md b/README.md index 23bb52f13c..3028c233d0 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,9 @@ Add to your `tsconfig.json`: Create `types/foo/index.d.ts` containing declarations for the module "foo". You should now be able import from `"foo"` in your code and it will route to the new type definition. Then build *and* run the code to make sure your type definition actually corresponds to what happens at runtime. -Once you've tested your definitions with real code, make a PR contributing the definition by copying `types/foo` to `DefinitelyTyped/foo` and adding a `tsconfig.json` and `foo-tests.ts`. +Once you've tested your definitions with real code, make a [PR](#make-a-pull-request) +then follow the instructions to [edit an existing package](#edit-an-existing-package) or +[create a new package](#create-a-new-package). ### Make a pull request @@ -83,7 +85,7 @@ First, [fork](https://guides.github.com/activities/forking/) this repository, in #### Edit an existing package -* `cd my-package-to-edit` +* `cd types/my-package-to-edit` * Make changes. Remember to edit tests. * You may also want to add yourself to "Definitions by" section of the package header. - Do this by adding your name to the end of the line, as in `// Definitions by: Alice , Bob `. @@ -110,15 +112,14 @@ Your package should have this structure: | tsconfig.json | This allows you to run `tsc` within the package. | | tslint.json | Enables linting. | -Generate these by running `npm run new-package -- --name my-package-name --template module`. -(Other templates are `module-class`, `module-function`, `module-plugin`, `global`, `global-plugin`, and `global-modifying-module`. -This just wraps [dts-gen](https://github.com/Microsoft/dts-gen), so it supports all options from that.) +Generate these by running `npm install -g dts-gen` and `dts-gen --dt --name my-package-name --template module`. +See all options at [dts-gen](https://github.com/Microsoft/dts-gen). You may edit the `tsconfig.json` to add new files, to add `"target": "es6"` (needed for async functions), to add to `"lib"`, or to add the `"jsx"` compiler option. DefinitelyTyped members routinely monitor for new PRs, though keep in mind that the number of other PRs may slow things down. -For a good example package, see [base64-js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/base64-js). +For a good example package, see [base64-js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/base64-js). #### Common mistakes @@ -154,22 +155,24 @@ If a package was never on DefinitelyTyped, it does not need to be added to `notN #### Lint -To lint a package, just add a `tslint.json` to that package containing `{ "extends": "../tslint.json" }`. All new packages must be linted. +To lint a package, just add a `tslint.json` to that package containing `{ "extends": "dtslint/dt.json" }`. All new packages must be linted. If a `tslint.json` turns rules off, this is because that hasn't been fixed yet. For example: -```json +```js { - "extends": "../tslint.json", + "extends": "dtslint/dt.json", "rules": { // This package uses the Function type, and it will take effort to fix. - "forbidden-types": false + "ban-types": false } } ``` -(To indicate that a lint rule truly does not apply, use `// tslint:disable:rule-name` or better, `//tslint:disable-next-line:rule-name`.) +(To indicate that a lint rule truly does not apply, use `// tslint:disable rule-name` or better, `//tslint:disable-next-line rule-name`.) + +Test by running `npm run lint package-name` where `package-name` is the name of your package. +This script uses [dtslint](https://github.com/Microsoft/dtslint). -Test the linter by running `npm run lint -- package-name`. Do not use a globally installed tslint. ## FAQ @@ -183,15 +186,10 @@ This usually happens within an hour of changes being merged. If the module you're referencing is an external module (uses `export`), use an import. If the module you're referencing is an ambient module (uses `declare module`, or just declares globals), use ``. -#### What do I do about older versions of typings? - -Currently we don't support this, though it is [planned](https://github.com/Microsoft/types-publisher/issues/3). -If you're adding a new major version of a library, you can copy `index.d.ts` to `foo-v2.3.d.ts` and edit `index.d.ts` to be the new version. - #### I notice some packages having a `package.json` here. Usually you won't need this. When publishing a package we will normally automatically create a `package.json` for it. -A `package.json` may be included for the sake of specifying dependencies. Here's an [example](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/pikaday/package.json). +A `package.json` may be included for the sake of specifying dependencies. Here's an [example](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/pikaday/package.json). We do not allow other fields, such as `"description"`, to be defined manually. Also, if you need to reference an older version of typings, you must do that by adding `"dependencies": { "@types/foo": "x.y.z" }` to the package.json. @@ -213,7 +211,7 @@ If default imports work in your environment, consider turning on the [`--allowSy Do not change the type definition if it is accurate. For an NPM package, `export =` is accurate if `node -p 'require("foo")'` is the export, and `export default` is accurate if `node -p 'require("foo").default'` is the export. -#### I want to use features from TypeScript 2.1. +#### I want to use features from TypeScript 2.1 or above. Then you will have to add a comment to the last line of your definition header (after `// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped`): `// TypeScript Version: 2.1`. @@ -231,7 +229,7 @@ Before making your change, please create a new subfolder with the current versio 1. Update the relative paths in `tsconfig.json` as well as `tslint.json`. 2. Add path mapping rules to ensure that tests are running against the intended version. -For example [history v2 `tsconfig.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/history/v2/tsconfig.json) looks like: +For example [history v2 `tsconfig.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/history/v2/tsconfig.json) looks like: ```json { @@ -250,11 +248,20 @@ For example [history v2 `tsconfig.json`](https://github.com/DefinitelyTyped/Defi ``` Please note that unless upgrading something backwards-compatible like `node`, all packages depending of the updated package need a path mapping to it, as well as packages depending on *those*. -For example, `react-router` depends on `history@2`, so [react-router `tsconfig.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/react-router/tsconfig.json) has a path mapping to `"history": [ "history/v2" ]`; -transitively `react-router-bootstrap` (which depends on `react-router`) also adds a path mapping in its [tsconfig.json](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/react-router-bootstrap/tsconfig.json). +For example, `react-router` depends on `history@2`, so [react-router `tsconfig.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-router/tsconfig.json) has a path mapping to `"history": [ "history/v2" ]`; +transitively `react-router-bootstrap` (which depends on `react-router`) also adds a path mapping in its [tsconfig.json](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-router-bootstrap/tsconfig.json). Also, `/// ` will not work with path mapping, so dependencies must use `import`. +#### What about scoped packages? + +Types for a scoped package `@foo/bar` should go in `types/foo__bar`. Note the double underscore. + + +#### The file history in GitHub looks incomplete. + +GitHub doesn't [support](http://stackoverflow.com/questions/5646174/how-to-make-github-follow-directory-history-after-renames) file history for renamed files. Use [`git log --follow`](https://www.git-scm.com/docs/git-log) instead. + ## License diff --git a/ably/index.d.ts b/ably/index.d.ts deleted file mode 100644 index a6ea5785ac..0000000000 --- a/ably/index.d.ts +++ /dev/null @@ -1,473 +0,0 @@ -// Type definitions for Ably Realtime and Rest client library 0.9 -// Project: https://www.ably.io/ -// Definitions by: Ably -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare namespace ablyLib { - namespace ChannelState { - type INITIALIZED = 'initialized'; - type ATTACHING = 'attaching'; - type ATTACHED = "attached"; - type DETACHING = "detaching"; - type DETACHED = "detached"; - type SUSPENDED = "suspended"; - type FAILED = "failed"; - } - type ChannelState = ChannelState.FAILED | ChannelState.INITIALIZED | ChannelState.SUSPENDED | ChannelState.ATTACHED | ChannelState.ATTACHING | ChannelState.DETACHED | ChannelState.DETACHING; - - namespace ConnectionState { - type INITIALIZED = "initialized"; - type CONNECTING = "connecting"; - type CONNECTED = "connected"; - type DISCONNECTED = "disconnected"; - type SUSPENDED = "suspended"; - type CLOSING = "closing"; - type CLOSED = "closed"; - type FAILED = "failed"; - } - type ConnectionState = ConnectionState.INITIALIZED | ConnectionState.CONNECTED | ConnectionState.CONNECTING | ConnectionState.DISCONNECTED | - ConnectionState.SUSPENDED | ConnectionState.CLOSED | ConnectionState.CLOSING | ConnectionState.FAILED; - - namespace ConnectionEvent { - type INITIALIZED = "initialized"; - type CONNECTING = "connecting"; - type CONNECTED = "connected"; - type DISCONNECTED = "disconnected"; - type SUSPENDED = "suspended"; - type CLOSING = "closing"; - type CLOSED = "closed"; - type FAILED = "failed"; - type UPDATE = "update"; - } - type ConnectionEvent = ConnectionEvent.INITIALIZED | ConnectionEvent.CONNECTED | ConnectionEvent.CONNECTING | ConnectionEvent.DISCONNECTED | - ConnectionEvent.SUSPENDED | ConnectionEvent.CLOSED | ConnectionEvent.CLOSING | ConnectionEvent.FAILED | ConnectionEvent.UPDATE; - - namespace PresenceAction { - type ABSENT = "absent"; - type PRESENT = "present"; - type ENTER = "enter"; - type LEAVE = "leave"; - type UPDATE = "update"; - } - type PresenceAction = PresenceAction.ABSENT | PresenceAction.PRESENT | PresenceAction.ENTER | PresenceAction.LEAVE | PresenceAction.UPDATE; - - namespace StatsIntervalGranularity { - type MINUTE = "minute"; - type HOUR = "hour"; - type DAY = "day"; - type MONTH = "month"; - } - type StatsIntervalGranularity = StatsIntervalGranularity.MINUTE | StatsIntervalGranularity.HOUR | StatsIntervalGranularity.DAY | StatsIntervalGranularity.MONTH; - - namespace HTTPMethods { - type POST = "POST"; - type GET = "GET"; - } - type HTTPMethods = HTTPMethods.GET | HTTPMethods.POST; - - // Interfaces - interface ClientOptions extends AuthOptions { - /** - * When true will automatically connect to Ably when library is instanced. This is true by default - */ - autoConnect?: boolean; - - /** - * Optional clientId that can be used to specify the identity for this client. In most cases - * it is preferable to instead specift a clientId in the token issued to this client. - */ - clientId?: string; - - defaultTokenParams?: TokenParams; - - /** - * When true, messages published on channels by this client will be echoed back to this client. - * This is true by default - */ - echoMessages?: boolean; - - /** - * Use this only if you have been provided a dedicated environment by Ably - */ - environment?: string; - - /** - * Logger configuration - */ - log?: LogInfo; - port?: number; - - /** - * When true, messages will be queued whilst the connection is disconnected. True by default. - */ - queueMessages?: boolean; - - restHost?: string; - realtimeHost?: string; - fallbackHosts?: string[]; - - /** - * Can be used to explicitly recover a connection. - * See https://www.ably.io/documentation/realtime/connection#connection-state-recovery - */ - recover?: standardCallback | string; - - /** - * Use a non-secure connection connection. By default, a TLS connection is used to connect to Ably - */ - tls?: boolean; - tlsPort?: number; - - /** - * When true, the more efficient MsgPack binary encoding is used. - * When false, JSON text encoding is used. - */ - useBinaryProtocol?: boolean; - } - - interface AuthOptions { - /** - * A function which is called when a new token is required. - * The role of the callback is to either generate a signed TokenRequest which may then be submitted automatically - * by the library to the Ably REST API requestToken; or to provide a valid token in as a TokenDetails object. - **/ - authCallback?: (data: TokenParams, callback: (error: ErrorInfo | string, tokenRequestOrDetails: TokenDetails | TokenRequest | string) => void) => void; - authHeaders?: { [index: string]: string }; - authMethod?: HTTPMethods; - authParams?: { [index: string]: string }; - - /** - * A URL that the library may use to obtain a token string (in plain text format), or a signed TokenRequest or TokenDetails (in JSON format). - **/ - authUrl?: string; - key?: string; - queryTime?: boolean; - token?: TokenDetails | string; - tokenDetails?: TokenDetails; - useTokenAuth?: boolean; - } - - interface TokenParams { - capability?: string; - clientId?: string; - nonce?: string; - timestamp?: number; - ttl?: number; - } - - interface CipherParams { - algorithm: string; - key: any; - keyLength: number; - mode: string; - } - - interface ErrorInfo { - code: number; - message: string; - statusCode: number; - } - - interface StatsMessageCount { - count: number; - data: number; - } - - interface StatsMessageTypes { - all: StatsMessageCount; - messages: StatsMessageCount; - presence: StatsMessageCount; - } - - interface StatsRequestCount { - failed: number; - refused: number; - succeeded: number; - } - - interface StatsResourceCount { - mean: number; - min: number; - opened: number; - peak: number; - refused: number; - } - - interface StatsConnectionTypes { - all: StatsResourceCount; - plain: StatsResourceCount; - tls: StatsResourceCount; - } - - interface StatsMessageTraffic { - all: StatsMessageTypes; - realtime: StatsMessageTypes; - rest: StatsMessageTypes; - webhook: StatsMessageTypes; - } - - interface TokenDetails { - capability: string; - clientId?: string; - expires: number; - issued: number; - token: string; - } - - interface TokenRequest { - capability: string; - clientId?: string; - keyName: string; - mac: string; - nonce: string; - timestamp: number; - ttl?: number; - } - - interface ChannelOptions { - cipher: any; - } - - interface RestPresenceHistoryParams { - start?: number; - end?: number; - direction?: string; - limit?: number; - } - - interface RestPresenceParams { - limit?: number; - clientId?: string; - connectionId?: string; - } - - interface RealtimePresenceParams { - waitForSync?: boolean; - clientId?: string; - connectionId?: string; - } - - interface RealtimePresenceHistoryParams { - start?: number; - end?: number; - direction?: string; - limit?: number; - untilAttach?: boolean; - } - - interface LogInfo { - /** - * A number controlling the verbosity of the output. Valid values are: 0 (no logs), 1 (errors only), - * 2 (errors plus connection and channel state changes), 3 (high-level debug output), and 4 (full debug output). - **/ - level?: number; - - /** - * A function to handle each line of log output. If handler is not specified, console.log is used. - **/ - handler?: (...args: any[]) => void; - } - - interface ChannelEvent { - state: ChannelState; - } - - interface ChannelStateChange { - current: ChannelState; - previous: ChannelState; - reason?: ErrorInfo; - resumed: boolean; - } - - interface ConnectionStateChange { - current: ConnectionState; - previous: ConnectionState; - reason?: ErrorInfo; - retryIn?: number; - } - - // Common Listeners - type paginatedResultCallback = (error: ErrorInfo, results: PaginatedResult ) => void; - type standardCallback = (error: ErrorInfo, results: any) => void; - type messageCallback = (message: T) => void; - type errorCallback = (error: ErrorInfo) => void; - type channelEventCallback = (channelEvent: ChannelEvent, changeStateChange: ChannelStateChange) => void; - type connectionEventCallback = (connectionEvent: ConnectionEvent, connectionStateChange: ConnectionStateChange) => void; - type timeCallback = (error: ErrorInfo, time: number) => void; - type realtimePresenceGetCallback = (error: ErrorInfo, messages: PresenceMessage[]) => void; - type tokenDetailsCallback = (error: ErrorInfo, Results: TokenDetails) => void; - type tokenRequestCallback = (error: ErrorInfo, Results: TokenRequest) => void; - type fromEncoded = (JsonObject: any, channelOptions?: ChannelOptions) => T; - type fromEncodedArray = (JsonArray: any[], channelOptions?: ChannelOptions) => T[]; - - // Internal Classes - class EventEmitter { - on: (eventOrCallback: string | T, callback?: T) => void; - once: (eventOrCallback: string | T, callback?: T) => void; - off: (eventOrCallback?: string | T, callback?: T) => void; - } - - // Classes - class Auth { - clientId: string; - authorize: (tokenParams?: TokenParams | tokenDetailsCallback, authOptions?: AuthOptions | tokenDetailsCallback, callback?: tokenDetailsCallback) => void; - createTokenRequest: (tokenParams?: TokenParams | tokenRequestCallback, authOptions?: AuthOptions | tokenRequestCallback, callback?: tokenRequestCallback) => void; - requestToken: (TokenParams?: TokenParams | tokenDetailsCallback, authOptions?: AuthOptions | tokenDetailsCallback, callback?: tokenDetailsCallback) => void; - } - - class Presence { - get: (params: RestPresenceParams | paginatedResultCallback, callback?: paginatedResultCallback) => void; - history: (params: RestPresenceHistoryParams | paginatedResultCallback, callback?: paginatedResultCallback) => void; - } - - class RealtimePresence { - syncComplete: () => boolean; - get: (Params: realtimePresenceGetCallback | RealtimePresenceParams, callback?: realtimePresenceGetCallback) => void; - history: (ParamsOrCallback: RealtimePresenceHistoryParams | paginatedResultCallback, callback?: paginatedResultCallback) => void; - subscribe: (presenceOrCallback: PresenceAction | messageCallback, listener?: messageCallback) => void; - unsubscribe: (presence?: PresenceAction, listener?: messageCallback) => void; - enter: (data?: errorCallback | any, callback?: errorCallback) => void; - update: (data?: errorCallback | any, callback?: errorCallback) => void; - leave: (data?: errorCallback | any, callback?: errorCallback) => void; - enterClient: (clientId: string, data?: errorCallback | any, callback?: errorCallback) => void; - updateClient: (clientId: string, data?: errorCallback | any, callback?: errorCallback) => void; - leaveClient: (clientId: string, data?: errorCallback | any, callback?: errorCallback) => void; - } - - class Channel { - name: string; - presence: Presence; - history: (paramsOrCallback?: RestPresenceHistoryParams | paginatedResultCallback, callback?: paginatedResultCallback) => void; - publish: (messagesOrName: any, messagedataOrCallback?: errorCallback | any, callback?: errorCallback) => void; - } - - class RealtimeChannel extends EventEmitter { - name: string; - errorReason: ErrorInfo; - state: ChannelState; - presence: RealtimePresence; - attach: (callback?: standardCallback) => void; - detach: (callback?: standardCallback) => void; - history: (paramsOrCallback?: RealtimePresenceHistoryParams | paginatedResultCallback, callback?: paginatedResultCallback) => void; - subscribe: (eventOrCallback: messageCallback | string, listener?: messageCallback) => void; - unsubscribe: (eventOrCallback?: messageCallback | string, listener?: messageCallback) => void; - publish: (messagesOrName: any, messageDataOrCallback?: errorCallback | any, callback?: errorCallback) => void; - setOptions: (options: any, callback?: errorCallback) => void; - } - - class Channels { - get: (name: string, channelOptions?: ChannelOptions) => T; - release: (name: string) => void; - } - - class Message { - constructor(); - static fromEncoded: fromEncoded; - static fromEncodedArray: fromEncodedArray; - clientId: string; - connectionId: string; - data: any; - encoding: string; - extras: any; - id: string; - name: string; - timestamp: number; - } - - interface MessageStatic { - fromEncoded: fromEncoded; - fromEncodedArray: fromEncodedArray; - } - - class PresenceMessage { - constructor(); - static fromEncoded: fromEncoded; - static fromEncodedArray: fromEncodedArray; - action: PresenceAction; - clientId: string; - connectionId: string; - data: any; - encoding: string; - id: string; - timestamp: number; - } - - interface PresenceMessageStatic { - fromEncoded: fromEncoded; - fromEncodedArray: fromEncodedArray; - } - - interface Crypto { - generateRandomKey: (callback: (error: ErrorInfo, key: string) => void) => void; - } - - class Connection extends EventEmitter { - errorReason: ErrorInfo; - id: string; - key: string; - recoveryKey: string; - serial: number; - state: ConnectionState; - close: () => void; - connect: () => void; - ping: (callback?: (error: ErrorInfo, responseTime: number ) => void ) => void; - } - - class Stats { - all: StatsMessageTypes; - apiRequests: StatsRequestCount; - channels: StatsResourceCount; - connections: StatsConnectionTypes; - inbound: StatsMessageTraffic; - intervalId: string; - outbound: StatsMessageTraffic; - persisted: StatsMessageTypes; - tokenRequests: StatsRequestCount; - } - - class PaginatedResult { - items: T[]; - first: (results: paginatedResultCallback) => void; - next: (results: paginatedResultCallback) => void; - current: (results: paginatedResultCallback) => void; - hasNext: () => boolean; - isLast: () => boolean; - } - - class HttpPaginatedResponse extends PaginatedResult { - items: string[]; - statusCode: number; - success: boolean; - errorCode: number; - errorMessage: string; - headers: any; - } -} - -export declare class Rest { - constructor(options: ablyLib.ClientOptions | string); - static Crypto: ablyLib.Crypto; - static Message: ablyLib.MessageStatic; - static PresenceMessage: ablyLib.PresenceMessageStatic; - auth: ablyLib.Auth; - channels: ablyLib.Channels; - request: (method: string, path: string, params?: any, body?: any[] | any, headers?: any, callback?: (error: ablyLib.ErrorInfo, response: ablyLib.HttpPaginatedResponse) => void) => void; - stats: (paramsOrCallback?: ablyLib.paginatedResultCallback | any, callback?: ablyLib.paginatedResultCallback) => void; - time: (paramsOrCallback?: ablyLib.timeCallback | any, callback?: ablyLib.timeCallback) => void; -} - -export declare class Realtime { - constructor(options: ablyLib.ClientOptions | string); - static Crypto: ablyLib.Crypto; - static Message: ablyLib.MessageStatic; - static PresenceMessage: ablyLib.PresenceMessageStatic; - auth: ablyLib.Auth; - channels: ablyLib.Channels; - clientId: string; - connection: ablyLib.Connection; - request: (method: string, path: string, params?: any, body?: any[] | any, headers?: any, callback?: (error: ablyLib.ErrorInfo, response: ablyLib.HttpPaginatedResponse) => void) => void; - stats: (paramsOrCallback?: ablyLib.paginatedResultCallback | any, callback?: ablyLib.paginatedResultCallback) => void; - close: () => void; - connect: () => void; - time: (paramsOrCallback?: ablyLib.timeCallback | any, callback?: ablyLib.timeCallback) => void; -} diff --git a/ably/tslint.json b/ably/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/ably/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/abs/tslint.json b/abs/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/abs/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/accepts/index.d.ts b/accepts/index.d.ts deleted file mode 100644 index a12dcaf5c9..0000000000 --- a/accepts/index.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -// Type definitions for accepts 1.3 -// Project: https://github.com/jshttp/accepts -// Definitions by: Stefan Reichel -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare namespace accepts { - export interface Headers { - [key: string]: string | string[]; - } - - export interface Accepts { - /** - * Return the first accepted charset. If nothing in `charsets` is accepted, then `false` is returned. - */ - charset(charsets: string[]): string | false; - charset(...charsets: string[]): string | false; - - /** - * Return the charsets that the request accepts, in the order of the client's preference (most preferred first). - */ - charsets(): string[]; - - /** - * Return the first accepted encoding. If nothing in `encodings` is accepted, then `false` is returned. - */ - encoding(encodings: string[]): string | false; - encoding(...encodings: string[]): string | false; - - /** - * Return the encodings that the request accepts, in the order of the client's preference (most preferred first). - */ - encodings(): string[]; - - /** - * Return the first accepted language. If nothing in `languages` is accepted, then `false` is returned. - */ - language(languages: string[]): string | false; - language(...languages: string[]): string | false; - - /** - * Return the languages that the request accepts, in the order of the client's preference (most preferred first). - */ - languages(): string[]; - - /** - * Return the first accepted type (and it is returned as the same text as what appears in the `types` array). If nothing in `types` is accepted, then `false` is returned. - * - * The `types` array can contain full MIME types or file extensions. Any value that is not a full MIME types is passed to `require('mime-types').lookup`. - */ - type(types: string[]): string | false; - type(...types: string[]): string | false; - - /** - * Return the types that the request accepts, in the order of the client's preference (most preferred first). - */ - types(): string[]; - } -} - -declare function accepts(req: { headers: accepts.Headers }): accepts.Accepts; - -export = accepts; diff --git a/accepts/tslint.json b/accepts/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/accepts/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/accounting/tslint.json b/accounting/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/accounting/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/acorn/index.d.ts b/acorn/index.d.ts deleted file mode 100644 index 441deb29c3..0000000000 --- a/acorn/index.d.ts +++ /dev/null @@ -1,261 +0,0 @@ -// Type definitions for Acorn v4.0.3 -// Project: https://github.com/marijnh/acorn -// Definitions by: RReverser , e-cloud -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -export as namespace acorn; -export = acorn; -import * as ESTree from 'estree'; - -declare namespace acorn { - interface PlainObject { - [name: string]: any; - } - - interface PluginsObject { - [name: string]: (p: Parser, config: any) => void; - } - - interface Options { - ecmaVersion?: 3 | 5 | 6 | 7 | 8 | 2015 | 2016 | 2017; - sourceType?: 'script' | 'module'; - onInsertedSemicolon?: (lastTokEnd: number, lastTokEndLoc?: ESTree.Position) => void; - onTrailingComma?: (lastTokEnd: number, lastTokEndLoc?: ESTree.Position) => void; - allowReserved?: boolean; - allowReturnOutsideFunction?: boolean; - allowImportExportEverywhere?: boolean; - allowHashBang?: boolean; - locations?: boolean; - onToken?: ((token: Token) => any) | Token[]; - onComment?: (( - isBlock: boolean, text: string, start: number, end: number, startLoc?: ESTree.Position, - endLoc?: ESTree.Position - ) => void) | Comment[]; - ranges?: boolean; - program?: ESTree.Program; - sourceFile?: string; - directSourceFile?: string; - preserveParens?: boolean; - plugins?: PlainObject; - } - - class Parser { - constructor(options: Options, input: string, startPos?: number); - - parse(): ESTree.Program; - } - - const plugins: PluginsObject; - - const defaultOptions: Options; - - class Position implements ESTree.Position { - line: number; - column: number; - - constructor(line: number, col: number); - - offset(n: number): Position; - } - - class SourceLocation implements ESTree.SourceLocation { - start: Position; - end: Position; - source?: string; - - constructor(p: Parser, start: Position, end: Position); - } - - function getLineInfo(input: string, offset: number): ESTree.Position; - - class Node { - type: string; - start: number; - end: number; - loc?: ESTree.SourceLocation; - sourceFile?: string; - range?: [number, number]; - - constructor(parser: Parser, pos: number, loc: number); - } - - interface TokeTypeConfig { - keyword: string; - beforeExpr?: boolean; - startsExpr?: boolean; - isLoop?: boolean; - isAssign?: boolean; - prefix?: boolean; - postfix?: boolean; - binop?: number; - } - - class TokenType { - label: string; - keyword: string; - beforeExpr: boolean; - startsExpr: boolean; - isLoop: boolean; - isAssign: boolean; - prefix: boolean; - postfix: boolean; - binop: number; - updateContext: (prevType: TokenType) => void; - - constructor(label: string, conf?: TokeTypeConfig); - } - - const tokTypes: { - num: TokenType; - regexp: TokenType; - string: TokenType; - name: TokenType; - eof: TokenType; - bracketL: TokenType; - bracketR: TokenType; - braceL: TokenType; - braceR: TokenType; - parenL: TokenType; - parenR: TokenType; - comma: TokenType; - semi: TokenType; - colon: TokenType; - dot: TokenType; - question: TokenType; - arrow: TokenType; - template: TokenType; - ellipsis: TokenType; - backQuote: TokenType; - dollarBraceL: TokenType; - eq: TokenType; - assign: TokenType; - incDec: TokenType; - prefix: TokenType; - logicalOR: TokenType; - logicalAND: TokenType; - bitwiseOR: TokenType; - bitwiseXOR: TokenType; - bitwiseAND: TokenType; - equality: TokenType; - relational: TokenType; - bitShift: TokenType; - plusMin: TokenType; - modulo: TokenType; - star: TokenType; - slash: TokenType; - starstar: TokenType; - _break: TokenType; - _case: TokenType; - _catch: TokenType; - _continue: TokenType; - _debugger: TokenType; - _default: TokenType; - _do: TokenType; - _else: TokenType; - _finally: TokenType; - _for: TokenType; - _function: TokenType; - _if: TokenType; - _return: TokenType; - _switch: TokenType; - _throw: TokenType; - _try: TokenType; - _var: TokenType; - _const: TokenType; - _while: TokenType; - _with: TokenType; - _new: TokenType; - _this: TokenType; - _super: TokenType; - _class: TokenType; - _extends: TokenType; - _export: TokenType; - _import: TokenType; - _null: TokenType; - _true: TokenType; - _false: TokenType; - _in: TokenType; - _instanceof: TokenType; - _typeof: TokenType; - _void: TokenType; - _delete: TokenType; - } - - class TokContext { - constructor(token: string, isExpr: boolean, preserveSpace: boolean, override: (p: Parser) => void); - } - - const tokContexts: { - b_stat: TokContext; - b_expr: TokContext; - b_tmpl: TokContext; - p_stat: TokContext; - p_expr: TokContext; - q_tmpl: TokContext; - f_expr: TokContext; - }; - - function isIdentifierStart(code: number, astral?: boolean): boolean; - - function isIdentifierChar(code: number, astral?: boolean): boolean; - - interface AbstractToken { - start: number; - end: number; - loc?: SourceLocation; - range?: [number, number]; - } - - interface Comment extends AbstractToken { - type: string; - value: string; - } - - class Token { - constructor(p: Parser); - } - - interface Token extends AbstractToken { - type: TokenType; - value: any; - } - - function isNewLine(code: number): boolean; - - const lineBreak: RegExp; - - const lineBreakG: RegExp; - - const version: string; - - interface IParse { - (input: string, options?: Options): ESTree.Program; - } - - const parse: IParse; - - function parseExpressionAt(input: string, pos?: number, options?: Options): ESTree.Expression; - - interface ITokenizer { - getToken() : Token, - [Symbol.iterator](): Iterator - } - - function tokenizer(input: string, options: Options): ITokenizer; - - let parse_dammit: IParse | undefined; - let LooseParser: ILooseParserClass | undefined; - let pluginsLoose: PluginsObject | undefined; - - interface ILooseParserClass { - new (input: string, options?: Options): ILooseParser - } - - interface ILooseParser { - - } - - function addLooseExports(parse: IParse, parser: ILooseParserClass, plugins: PluginsObject): void; -} diff --git a/adal/index.d.ts b/adal/index.d.ts deleted file mode 100644 index 18ca3d8079..0000000000 --- a/adal/index.d.ts +++ /dev/null @@ -1,174 +0,0 @@ -// Type definitions for ADAL.JS 1.0.13 -// Project: https://github.com/AzureAD/azure-activedirectory-library-for-js -// Definitions by: mmaitre314 -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare var AuthenticationContext: adal.AuthenticationContextStatic; -declare var Logging: adal.Logging; - -declare module 'adal' { - export = { AuthenticationContext, Logging }; -} - -declare namespace adal { - - interface Config { - tenant?: string; - clientId: string; - redirectUri?: string; - instance?: string; - endpoints?: any; // If you need to send CORS api requests. - popUp?: boolean; - localLoginUrl?: string; - displayCall?: (urlNavigate: string) => any; - postLogoutRedirectUri?: string; // redirect url after succesful logout operation - cacheLocation?: string; - anonymousEndpoints?: string[]; - expireOffsetSeconds?: number; - correlationId?: string; - loginResource?: string; - resource?: string; - extraQueryParameter?: string; - } - - interface User { - userName: string; - profile: any; - } - - interface RequestInfo { - valid: boolean; - parameters: any; - stateMatch: boolean; - stateResponse: string; - requestType: string; - } - - interface Logging { - log: (message: string) => void; - level: LoggingLevel; - } - - enum LoggingLevel { - ERROR = 0, - WARNING = 1, - INFO = 2, - VERBOSE = 3 - } - - interface AuthenticationContextStatic { - new (config: Config): AuthenticationContext; - } - - interface AuthenticationContext { - - instance: string; - config: Config; - - /** - * Gets initial Idtoken for the app backend - * Saves the resulting Idtoken in localStorage. - */ - login(): void; - - /** - * Indicates whether login is in progress now or not. - */ - loginInProgress(): boolean; - - /** - * Gets token for the specified resource from local storage cache - * @param {string} resource A URI that identifies the resource for which the token is valid. - * @returns {string} token if exists and not expired or null - */ - getCachedToken(resource: string): string; - - /** - * Retrieves and parse idToken from localstorage - * @returns {User} user object - */ - getCachedUser(): User; - - registerCallback(expectedState: string, resource: string, callback: (message: string, token: string) => any): void; - - /** - * Acquire token from cache if not expired and available. Acquires token from iframe if expired. - * @param {string} resource ResourceUri identifying the target resource - * @param {requestCallback} callback - */ - acquireToken(resource: string, callback: (message: string, token: string) => any): void; - - /** - * Redirect the Browser to Azure AD Authorization endpoint - * @param {string} urlNavigate The authorization request url - */ - promptUser(urlNavigate: string): void; - - /** - * Clear cache items. - */ - clearCache(): void; - - /** - * Clear cache items for a resource. - */ - clearCacheForResource(resource: string): void; - - /** - * Logout user will redirect page to logout endpoint. - * After logout, it will redirect to post_logout page if provided. - */ - logOut(): void; - - /** - * Gets a user profile - * @param {requestCallback} callback - The callback that handles the response. - */ - getUser(callback: (message: string, user?: User) => any): void; - - /** - * Checks if hash contains access token or id token or error_description - * @param {string} hash - Hash passed from redirect page - * @returns {Boolean} - */ - isCallback(hash: string): boolean; - - /** - * Gets login error - * @returns {string} error message related to login - */ - getLoginError(): string; - - /** - * Gets requestInfo from given hash. - * @returns {RequestInfo} for appropriate hash. - */ - getRequestInfo(hash: string): RequestInfo; - - /** - * Saves token from hash that is received from redirect. - */ - saveTokenFromHash(requestInfo: RequestInfo): void; - - /** - * Gets resource for given endpoint if mapping is provided with config. - * @param {string} endpoint - API endpoint - * @returns {string} resource for this API endpoint - */ - getResourceForEndpoint(endpoint: string): string; - - /** - * Handles redirection after login operation. - * Gets access token from url and saves token to the (local/session) storage - * or saves error in case unsuccessful login. - */ - handleWindowCallback(): void; - - log(level: number, message: string, error: any): void; - error(message: string, error: any): void; - warn(message: string): void; - info(message: string): void; - verbose(message: string): void; - } - -} diff --git a/alt/index.d.ts b/alt/index.d.ts deleted file mode 100644 index 00e171484b..0000000000 --- a/alt/index.d.ts +++ /dev/null @@ -1,167 +0,0 @@ -// Type definitions for Alt 0.16.10 -// Project: https://github.com/goatslacker/alt -// Definitions by: Michael Shearer -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 - -/// - -declare namespace AltJS { - - interface StoreReduce { - action:any; - data: any; - } - - export interface StoreModel { - //Actions - bindAction?( action:Action, handler:ActionHandler):void; - bindActions?(actions:ActionsClass):void; - - //Methods/Listeners - exportPublicMethods?(exportConfig:any):void; - bindListeners?(config:{[methodName:string]:Action | Actions}):void; - exportAsync?(source:Source):void; - registerAsync?(datasource:Source):void; - - //state - setState?(state:S):void; - setState?(stateFn:(currentState:S, nextState:S) => S):void; - getState?():S; - waitFor?(store:AltStore):void; - - //events - onSerialize?(fn:(data:any) => any):void; - onDeserialize?(fn:(data:any) => any):void; - on?(event:AltJS.lifeCycleEvents, callback:() => any):void; - emitChange?():void; - waitFor?(storeOrStores:AltStore | Array>):void; - otherwise?(data:any, action:AltJS.Action):void; - observe?(alt:Alt):any; - reduce?(state:any, config:StoreReduce):Object; - preventDefault?():void; - afterEach?(payload:Object, state:Object):void; - beforeEach?(payload:Object, state:Object):void; - // TODO: Embed dispatcher interface in def - dispatcher?:any; - - //instance - getInstance?():AltJS.AltStore; - alt?:Alt; - displayName?:string; - } - - export type Source = {[name:string]: () => SourceModel}; - - export interface SourceModel { - local(state:any, ...args: any[]):any; - remote(state:any, ...args: any[]):Promise; - shouldFetch?(fetchFn:(...args:Array) => boolean):void; - loading?:(args:any) => void; - success?:(state:S) => void; - error?:(args:any) => void; - interceptResponse?(response:any, action:Action, ...args:Array):any; - } - - export interface AltStore { - getState():S; - listen(handler:(state:S) => any):() => void; - unlisten(handler:(state:S) => any):void; - emitChange():void; - } - - export enum lifeCycleEvents { - bootstrap, - snapshot, - init, - rollback, - error - } - - export type Actions = {[action:string]:Action}; - - export interface Action { - ( args:T):void; - defer(data:any):void; - } - - export interface ActionsClass { - generateActions?( ...action:Array):void; - dispatch( ...payload:Array):void; - actions?:Actions; - } - - type StateTransform = (store:StoreModel) => AltJS.AltStore; - - interface AltConfig { - dispatcher?:any; - serialize?:(serializeFn:(data:Object) => string) => void; - deserialize?:(deserializeFn:(serialData:string) => Object) => void; - storeTransforms?:Array; - batchingFunction?:(callback:( ...data:Array) => any) => void; - } - - class Alt { - constructor(config?:AltConfig); - actions:Actions; - bootstrap(jsonData:string):void; - takeSnapshot( ...storeNames:Array):string; - flush():Object; - recycle( ...stores:Array>):void; - rollback():void; - dispatch(action?:AltJS.Action, data?:Object, details?:any):void; - - //Actions methods - addActions(actionsName:string, ActionsClass: ActionsClassConstructor):void; - createActions(ActionsClass: ActionsClassConstructor, exportObj?: Object):T; - createActions(ActionsClass: ActionsClassConstructor, exportObj?: Object, ...constructorArgs:Array):T; - generateActions( ...actions:Array):T; - getActions(actionsName:string):AltJS.Actions; - - //Stores methods - addStore(name:string, store:StoreModel, saveStore?:boolean):void; - createStore(store:StoreModel, name?:string):AltJS.AltStore; - getStore(name:string):AltJS.AltStore; - } - - export interface AltFactory { - new(config?:AltConfig):Alt; - } - - type ActionsClassConstructor = new (alt:Alt) => AltJS.ActionsClass; - - type ActionHandler = ( ...data:Array) => any; - type ExportConfig = {[key:string]:(...args:Array) => any}; -} - -declare module "alt/utils/chromeDebug" { - function chromeDebug(alt:AltJS.Alt):void; - export = chromeDebug; -} - -declare module "alt/AltContainer" { - - import React = require("react"); - - interface ContainerProps { - store?:AltJS.AltStore; - stores?:Array>; - inject?:{[key:string]:any}; - actions?:{[key:string]:Object}; - render?:(...props:Array) => React.ReactElement; - flux?:AltJS.Alt; - transform?:(store:AltJS.AltStore, actions:any) => any; - shouldComponentUpdate?:(props:any) => boolean; - component?:React.Component; - } - - type AltContainer = React.ReactElement; - var AltContainer:React.ComponentClass; - - export = AltContainer; -} - -declare module "alt" { - var alt:AltJS.AltFactory; - export = alt; -} diff --git a/amplify-deferred/tslint.json b/amplify-deferred/tslint.json deleted file mode 100644 index f05741c59b..0000000000 --- a/amplify-deferred/tslint.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "../tslint.json", - "rules": { - "forbidden-types": false - } -} diff --git a/amplify/index.d.ts b/amplify/index.d.ts deleted file mode 100644 index 1e62e57a01..0000000000 --- a/amplify/index.d.ts +++ /dev/null @@ -1,179 +0,0 @@ -// Type definitions for AmplifyJs 1.1 -// Project: http://amplifyjs.com/ -// Definitions by: Jonas Eriksson -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -declare namespace amplify { - interface RequestSettings { - resourceId: string; - data?: any; - success?: (...args: any[]) => void; - error?: (...args: any[]) => void; - } - - type Decoder = - ( - data?: any, - status?: string, - xhr?: JQueryXHR, - success?: (...args: any[]) => void, - error?: (...args: any[]) => void - ) => void; - - interface Decoders { - [decoderName: string]: Decoder; - jsSend: Decoder; - } - - interface AjaxSettings extends JQueryAjaxSettings { - cache?: any; - dataMap?: {} | ((data: any) => {}); - decoder?: any /* string or amplifyDecoder */; - } - - interface Request { - - /*** - * Request a resource. - * resourceId: Identifier string for the resource. - * data: A set of key/value pairs of data to be sent to the resource. - * callback: A function to invoke if the resource is retrieved successfully. - */ - (resourceId: string, hash?: any, callback?: Function): void; - - /*** - * Request a resource. - * settings: A set of key/value pairs of settings for the request. - * resourceId: Identifier string for the resource. - * data (optional): Data associated with the request. - * success (optional): Function to invoke on success. - * error (optional): Function to invoke on error. - */ - (settings: RequestSettings): any; - - /*** - * Define a resource. - * resourceId: Identifier string for the resource. - * requestType: The type of data retrieval method from the server. See the request types sections for more information. - * settings: A set of key/value pairs that relate to the server communication technology. The following settings are available: - * Any settings found in jQuery.ajax(). - * cache: See the cache section for more details. - * decoder: See the decoder section for more details. - */ - define(resourceId: string, requestType: string, settings?: AjaxSettings): void; - - /*** - * Define a custom request. - * resourceId: Identifier string for the resource. - * resource: Function to handle requests. Receives a hash with the following properties: - * resourceId: Identifier string for the resource. - * data: Data provided by the user. - * success: Callback to invoke on success. - * error: Callback to invoke on error. - */ - define(resourceId: string, resource: (settings: RequestSettings) => void): void; - - decoders: Decoders; - cache: any; - } - - interface Subscribe { - /*** - * Subscribe to a message. - * topic: Name of the message to subscribe to. - * callback: Function to invoke when the message is published. - * [priority]: Priority relative to other subscriptions for the same message. Lower values have higher priority. Default is 10. - */ - (topic: string, callback: Function, priority?: number): void; - /*** - * Subscribe to a message. - * topic: Name of the message to subscribe to. - * context: What this will be when the callback is invoked. - * callback: Function to invoke when the message is published. - * [priority]: Priority relative to other subscriptions for the same message. Lower values have higher priority. Default is 10. - */ - (topic: string, context: any, callback: Function, priority?: number): void; - } - interface StorageTypeStore { - /*** - * Stores a value for a given key using the default storage type. - * - * key: Identifier for the value being stored. - * value: The value to store. The value can be anything that can be serialized as JSON. - * [options]: A set of key/value pairs that relate to settings for storing the value. - */ - (key: string, value: any, options?: any): void; - - /*** - * Gets a stored value based on the key. - */ - (key: string): any; - - /*** - * Gets a hash of all stored values. - */ - (): any; - } - - interface Store extends StorageTypeStore { - - /*** - * IE 8+, Firefox 3.5+, Safari 4+, Chrome, Opera 10.5+, iPhone 2+, Android 2+ - */ - localStorage: StorageTypeStore; - - /*** - * IE 8+, Firefox 2+, Safari 4+, Chrome, Opera 10.5+, iPhone 2+, Android 2+ - */ - sessionStorage: StorageTypeStore; - - /*** - * Firefox 2+ - */ - globalStorage: StorageTypeStore; - - /*** - * IE 5 - 7 - */ - userData: StorageTypeStore; - - /*** - * An in-memory store is provided as a fallback if none of the other storage types are available. - */ - memory: StorageTypeStore; - - - } - - interface Static { - - subscribe: Subscribe; - - /*** - * Remove a subscription. - * topic: The topic being unsubscribed from. - * callback: The callback that was originally subscribed. - */ - unsubscribe(topic: string, callback: Function): void; - - /*** - * Publish a message. - * topic: The name of the message to publish. - * Any additional parameters will be passed to the subscriptions. - * amplify.publish returns a boolean indicating whether any subscriptions returned false. - * The return value is true if none of the subscriptions returned false, and false otherwise. - * Note that only one subscription can return false because doing so will prevent additional subscriptions from being invoked. - */ - publish(topic: string, ...args: any[]): boolean; - - store: Store; - - request: Request; - } -} - -declare var amplify: amplify.Static; -export = amplify; -export as namespace amplify; diff --git a/amplify/tslint.json b/amplify/tslint.json deleted file mode 100644 index fe03bea79d..0000000000 --- a/amplify/tslint.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../tslint.json", - "rules": { - "forbidden-types": false, - "unified-signatures": false - } -} diff --git a/amqplib/tslint.json b/amqplib/tslint.json deleted file mode 100644 index 105f5736e6..0000000000 --- a/amqplib/tslint.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "../tslint.json", - "rules": { - "no-empty-interface": false - } -} diff --git a/angular-file-saver/index.d.ts b/angular-file-saver/index.d.ts deleted file mode 100644 index 7e1fb90b16..0000000000 --- a/angular-file-saver/index.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -// Type definitions for angular-file-saver 1.1 -// Project: https://github.com/alferov/angular-file-saver -// Definitions by: Donald Nairn -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -declare namespace angular { - /** - * A core Angular factory proving FileSaver functionality. - */ - interface FileSaver { - /** - * Immediately starts saving a file - * @param data: a Blob instance; - * @param filename: a String custom filename (an extension is optional); - * @param disableAutoBOM : (optional) Boolean Disable automatically provided Unicode text encoding hints; - */ - saveAs(blob: Blob, fileName: string, disableBOM?: boolean): void; - } -} \ No newline at end of file diff --git a/angular-formly/index.d.ts b/angular-formly/index.d.ts deleted file mode 100644 index aed12f5360..0000000000 --- a/angular-formly/index.d.ts +++ /dev/null @@ -1,637 +0,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/DefinitelyTyped/DefinitelyTyped - -/// - -declare module 'AngularFormly' { - export = AngularFormly; -} - -declare module 'angular-formly' { - var angularFormlyDefaultExport: string; - export = angularFormlyDefaultExport; -} - -declare namespace AngularFormly { - - interface IFieldArray extends Array { - - } - - interface IFieldGroup { - data?: { - [key: string]: any; - }; - className?: string; - elementAttributes?: string; - fieldGroup?: IFieldArray; - form?: Object; - hide?: boolean; - hideExpression?: string | IExpressionFunction; - key?: string | number; - model?: string | { - [key: string]: any; - }; - options?: IFormOptionsAPI; - templateOptions?: ITemplateOptions; - wrapper?: string | string[]; - } - - - interface IFormOptionsAPI { - data?: { - [key: string]: any; - }; - fieldTransform?: Function; - formState?: Object; - removeChromeAutoComplete?: boolean; - resetModel?: Function; - templateManipulators?: ITemplateManipulators; - updateInitialValue?: Function; - wrapper?: string | string[]; - } - - - /** - * see http://docs.angular-formly.com/docs/formly-expressions#expressionproperties-validators--messages - */ - interface IExpressionFunction { - ($viewValue: any, $modelValue: any, scope: ITemplateScope): any; - } - - - interface IModelOptions { - updateOn?: string; - debounce?: number; - allowInvalid?: boolean; - getterSetter?: string; - timezone?: string; - } - - - interface ITemplateManipulator { - (template: string | HTMLElement, options: Object, scope: ITemplateScope): string | HTMLElement; - } - - - interface ITemplateManipulators { - preWrapper?: ITemplateManipulator[]; - postWrapper?: ITemplateManipulator[]; - } - - interface ISelectOption { - name: string; - value?: string; - group?: string; - } - - /** - * see http://docs.angular-formly.com/docs/ngmodelattrstemplatemanipulator - */ - interface ITemplateOptions { - - // both attribute or regular attribute - disabled?: boolean; - maxlength?: number; - minlength?: number; - pattern?: string; - required?: boolean; - - //attribute only - max?: number; - min?: number; - placeholder?: number | string; - tabindex?: number; - type?: string; - - //expression types - 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 - - } - - - /** - * see http://docs.angular-formly.com/docs/field-configuration-object#validators-object - */ - interface IValidator { - expression: string | IExpressionFunction; - message?: string | IExpressionFunction; - } - - - /** - * An object which has at least two properties called expression and listener. The watch.expression - * is added to the formly-form directive's scope (to allow it to run even when hide is true). You - * can specify a type ($watchCollection or $watchGroup) via the watcher.type property (defaults to - * $watch) and whether you want it to be a deep watch via the watcher.deep property (defaults to false). - * - * see http://docs.angular-formly.com/docs/field-configuration-object#watcher-objectarray-of-watches - */ - interface IWatcher { - deep?: boolean; //Defaults to false - expression?: string | { (field: string, scope: ITemplateScope): boolean }; - listener: (field: string, newValue: any, oldValue: any, scope: ITemplateScope, stopWatching: Function) => void; - type?: string; //Defaults to $watch but can be set to $watchCollection or $watchGroup - } - - - // see http://docs.angular-formly.com/docs/field-configuration-object - interface IFieldConfigurationObject { - - - /** - * Added in 6.18.0 - * - * Demo - * see http://angular-formly.com/#/example/other/unique-value-async-validation - */ - asyncValidators?: { - [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 - * field, and anything else you have in your injector. - * - * see http://docs.angular-formly.com/docs/field-configuration-object#controller-controller-name-as-string--controller-f - */ - controller?: string | Function; - - - /** - * This is reserved for the developer. You have our guarantee to be able to use this and not worry about - * future versions of formly overriding your usage and preventing you from upgrading :-) - * - * see http://docs.angular-formly.com/docs/field-configuration-object#data-object - */ - data?: { - [key: string]: any; - }; - - - /** - * Use defaultValue to initialize it the model. If this is provided and the value of the - * model at compile-time is undefined, then the value of the model will be assigned to defaultValue. - * - * see http://docs.angular-formly.com/docs/field-configuration-object#defaultvalue-any - */ - defaultValue?: any; - - - /** - * You can specify your own class that will be applied to the formly-field directive (or ng-form of - * a fieldGroup). - * - * see http://docs.angular-formly.com/docs/field-configuration-object#classname-string - */ - className?: string; - - - elementAttributes?: { - [key: string]: string; - }; - - - /** - * An object where the key is a property to be set on the main field config and the value is an - * expression used to assign that property. The value is a formly expressions. The returned value is - * wrapped in $q.when so you can return a promise from your function :-) - * - * see http://docs.angular-formly.com/docs/field-configuration-object#expressionproperties-object - */ - expressionProperties?: { - [key: string]: string | IExpressionFunction | IValidator; - }; - - - /** - * Uses ng-if. Whether to hide the field. Defaults to false. If you wish this to be conditional, use - * hideExpression. See below. - * - * see http://docs.angular-formly.com/docs/field-configuration-object#hide-boolean - */ - hide?: boolean; - - - /** - * This is similar to expressionProperties with a slight difference. You should (hopefully) never - * notice the difference with the most common use case. This is available due to limitations with - * expressionProperties and ng-if not working together very nicely. - * - * see http://docs.angular-formly.com/docs/field-configuration-object#hideexpression-string--function - */ - hideExpression?: string | IExpressionFunction; - - - /** - * This allows you to specify the id of your field (which will be used for its name as well unless - * a name is provided). Note, you can also override the id generation code using the formlyConfig - * extra called getFieldId. - * - * AVOID THIS - * If you don't have to do this, don't. Specifying IDs makes it harder to re-use things and it's - * just extra work. Part of the beauty that angular-formly provides is the fact that you don't need - * to concern yourself with making sure that this is unique. - * - * see http://docs.angular-formly.com/docs/field-configuration-object#id-string - */ - id?: string; - - - initialValue?: any; - - - /** - * Can be set instead of type or template to use a custom html template form field. Works - * just like a directive templateUrl and uses the $templateCache - * - * see http://docs.angular-formly.com/docs/field-configuration-object#key-string - */ - key?: string | number; - - - /** - * This allows you to specify a link function. It is invoked after your template has finished compiling. - * You are passed the normal arguments for a normal link function. - * - * see http://docs.angular-formly.com/docs/field-configuration-object#link-link-function - */ - link?: ng.IDirectiveLinkFn; - - - /** - * By default, the model passed to the formly-field directive is the same as the model passed to the - * formly-form. However, if the field has a model specified, then it is used for that field (and that - * field only). In addition, a deep watch is added to the formly-field directive's scope to run the - * expressionProperties when the specified model changes. - * - * Note, the formly-form directive will allow you to specify a string which is an (almost) formly - * expression which allows you to define the model as relative to the scope of the form. - * - * see http://docs.angular-formly.com/docs/field-configuration-object#model-object--string - */ - model?: string | { - [key: string]: any; - }; - - - /** - * Allows you to take advantage of ng-model-options directive. Formly's built-in templateManipulator (see - * below) will add this attribute to your ng-model element automatically if this property exists. Note, - * if you use the getter/setter option, formly's templateManipulator will change the value of ng-model - * to options.value which is a getterSetter that formly adds to field options. - * - * see http://docs.angular-formly.com/docs/field-configuration-object#modeloptions - */ - modelOptions?: IModelOptions; - - - /** - * If you wish to, you can specify a specific name for your ng-model. This is useful if you're posting - * the form to a server using techniques of yester-year. - * - * AVOID THIS - * If you don't have to do this, don't. It's just extra work. Part of the beauty that angular-formly - * provides is the fact that you don't need to concern yourself with stuff like this. - * - * see http://docs.angular-formly.com/docs/field-configuration-object#name-string - */ - name?: string; - - - /** - * This is used by ngModelAttrsTemplateManipulator to automatically add attributes to the ng-model element - * of field templates. You will likely not use this often. This object is a little complex, but extremely - * powerful. It's best to explain this api via an example. For more information, see the guide on ngModelAttrs. - * - * see http://docs.angular-formly.com/docs/field-configuration-object#ngmodelattrs-object - */ - ngModelAttrs?: { - attribute?: any; - 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; - }; - - - /** - * Used to tell angular-formly to not attempt to add the formControl property to your object. This is useful - * for things like validation, but not necessary if your "field" doesn't use ng-model (if it's just a horizontal - * line for example). Defaults to undefined. - * - * see http://docs.angular-formly.com/docs/field-configuration-object#noformcontrol-boolean - */ - noFormControl?: boolean; - - - /** - * Allows you to specify extra types to get options from. Duplicate options are overridden in later priority - * (index 1 will override index 0 properties). Also, these are applied after the type's defaultOptions and - * hence will override any duplicates of those properties as well. - * - * see http://docs.angular-formly.com/docs/field-configuration-object#optionstypes-string--array-of-strings - */ - optionsTypes?: string | string[]; - - - /** - * Can be set instead of type or templateUrl to use a custom html - * template form field. Recommended to be used with one-liners mostly - * (like a directive), or if you're using webpack with the ability to require templates :-) - * - * If a function is passed, it is invoked with the field configuration object and can return - * either a string for the template or a promise that resolves to a string. - * - * see http://docs.angular-formly.com/docs/field-configuration-object#template-string--function - */ - template?: string | { (fieldConfiguration: IFieldConfigurationObject): string | ng.IPromise }; - - - /** - * Allows you to specify custom template manipulators for this specific field. (use defaultOptions in a - * type configuration if you want it to apply to all fields of a certain type). - * - * see http://docs.angular-formly.com/docs/field-configuration-object#templatemanipulator-object-of-arrays-of-functions - */ - templateManipulators?: ITemplateManipulators; - - - /** - * This is reserved for the templates. Any template-specific options go in here. Look at your specific - * template implementation to know the options required for this. - * - * see http://docs.angular-formly.com/docs/field-configuration-object#templateoptions-object - */ - templateOptions?: ITemplateOptions; - - - /** - * Can be set instead of type or template to use a custom html template form field. Works - * just like a directive templateUrl and uses the $templateCache - * - * see http://docs.angular-formly.com/docs/field-configuration-object#templateurl-string--function - */ - templateUrl?: string | { (fieldConfiguration: IFieldConfigurationObject): string | ng.IPromise }; - - - /** - * The type of field to be rendered. This is the recommended method - * for defining fields. Types must be pre-defined using formlyConfig. - * - * see http://docs.angular-formly.com/docs/field-configuration-object#type-string - */ - type?: string; - - - /** - * An object with a few useful properties mostly handy when used in combination with ng-messages - */ - validation?: { - - /** - * This is set by angular-formly. This is a boolean indicating whether an error message should be shown. Because - * you generally only want to show error messages when the user has interacted with a specific field, this value - * is set to true based on this rule: field invalid && (field touched || validation.show) (with slight difference - * for pre-angular 1.3 because it doesn't have touched support). - */ - errorExistsAndShouldBeVisible?: boolean; - - - /** - * A map of Formly Expressions mapped to message names. This is really useful when you're using ng-messages - * like in this example. - */ - messages?: { - [key: string]: IExpressionFunction | string; - } - - - /** - * A boolean you as the developer can set to specify to force options.validation.errorExistsAndShouldBeVisible - * to be set to true when there are $errors. This is useful when you're trying to call the user's attention to - * some fields for some reason. - */ - show?: boolean; - - }; - - - /** - * An object where the keys are the name of the validator and the values are Formly Expressions; - * - * Async Validation - * All function validators can return true/false/Promise. A validator passes if it returns true or a promise - * that is resolved. A validator fails if it returns false or a promise that is rejected. - * - * see http://docs.angular-formly.com/docs/field-configuration-object#validators-object - */ - validators?: { - [key: string]: string | IExpressionFunction | IValidator; - }; - - - /** - * This is a getter/setter function for the value that your field is representing. Useful when using getterSetter: true - * in the modelOptions (in fact, if you don't disable the ngModelAttrsTemplateManipulator that comes built-in with formly, - * it will automagically change your field's ng-model attribute to use options.value. - * - * see http://docs.angular-formly.com/docs/field-configuration-object#value-gettersetter-function - */ - value?(): any; //Getter - value?(val: any): void; //Setter - - - /** - * An object which has at least two properties called expression and listener. The watch.expression is added - * to the formly-form directive's scope (to allow it to run even when hide is true). You can specify a type - * ($watchCollection or $watchGroup) via the watcher.type property (defaults to $watch) and whether you want - * it to be a deep watch via the watcher.deep property (defaults to false). - * - * see http://docs.angular-formly.com/docs/field-configuration-object#watcher-objectarray-of-watches - */ - watcher?: IWatcher | IWatcher[]; - - - /** - * This makes reference to setWrapper in formlyConfig. It is expected to be the name of the wrapper. If - * given an array, the formly field template will be wrapped by the first wrapper, then the second, then - * the third, etc. You can also specify these as part of a type (which is the recommended approach). - * Specifying this property will override the wrappers for the type for this field. - * - * http://docs.angular-formly.com/docs/field-configuration-object#wrapper-string--array-of-strings - */ - wrapper?: string | string[]; - - - //ALL PROPERTIES BELOW ARE ADDED (So you should not be setting them yourself.) - - - /** - * This is the NgModelController for the field. It provides you with awesome stuff like $errors :-) - * - * see http://docs.angular-formly.com/docs/field-configuration-object#formcontrol-ngmodelcontroller - */ - formControl?: ng.IFormController | ng.IFormController[]; - - - /** - * Will reset the field's model and the field control to the last initialValue. This is used by the - * formly-form's options.resetModel function. - * - * see http://docs.angular-formly.com/docs/field-configuration-object#resetmodel-function - */ - resetModel?: () => void; - - - /** - * It is not likely that you'll ever want to invoke this function. It simply runs the expressionProperties expressions. - * It is used internally and you shouldn't have to use it, but you can if you want to, and any breaking changes to the - * way it works will result in a major version change, so you can rely on its api. - * - * see http://docs.angular-formly.com/docs/field-configuration-object#runexpressions-function - */ - runExpressions?: () => void; - - - /** - * Will reset the field's initialValue to the current state of the model. Useful if you load the model asynchronously. - * Invoke this when the model gets set. This is used by the formly-form's options.updateInitialValue function. - * - * see http://docs.angular-formly.com/docs/field-configuration-object#updateinitialvalue-function - */ - updateInitialValue?: () => void; - - } - - /** - * - * - * see http://docs.angular-formly.com/docs/custom-templates#section-formlyconfig-settype-options - */ - interface ITypeOptions { - apiCheck?: { [key: string]: Function }; - apiCheckFunction?: string; //'throw' or 'warn - apiCheckInstance?: any; - apiCheckOptions?: Object; - defaultOptions?: IFieldConfigurationObject | Function; - controller?: Function | string | any[]; - data?: { - [key: string]: any; - }; - extends?: string; - link?: ng.IDirectiveLinkFn; - overwriteOk?: boolean; - name: string; - template?: Function | string; - templateUrl?: Function | string; - validateOptions?: Function; - wrapper?: string | string[]; - } - - interface IWrapperOptions { - apiCheck?: { [key: string]: Function }; - apiCheckFunction?: string; //'throw' or 'warn - apiCheckInstance?: any; - apiCheckOptions?: Object; - overwriteOk?: boolean; - name?: string; - template?: string; - templateUrl?: string; - types?: string[]; - 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 { - formControl: ng.IFormController | ng.IFormController[]; - templateOptions: ITemplateOptions; - validation: Object; - } - - /** - * see http://docs.angular-formly.com/docs/custom-templates#templates-scope - */ - interface ITemplateScope { - options: ITemplateScopeOptions; - //Shortcut to options.formControl - fc: ng.IFormController | ng.IFormController[]; - //all the fields for the form - 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. - formState: Object; - //The id of the field. You shouldn't have to use this. - id: string; - //The index of the field the form is on (in ng-repeat) - index: number; - //the model of the form (or the model specified by the field if it was specified). - model?: string | { - [key: string]: any; - }; - //Shortcut to options.validation.errorExistsAndShouldBeVisible - showError: boolean; - //Shortcut to options.templateOptions - to: ITemplateOptions; - } - - /** - * see http://docs.angular-formly.com/docs/formlyvalidationmessages#addtemplateoptionvaluemessage - */ - interface IValidationMessages { - addTemplateOptionValueMessage(name: string, prop: string, prefix: string, suffix: string, alternate: string): void; - addStringMessage(name: string, string: string): void; - messages: { [key: string]: ($viewValue: any, $modelValue: any, scope: ITemplateScope) => string }; - } - -} diff --git a/angular-gettext/angular-gettext-tests.ts b/angular-gettext/angular-gettext-tests.ts deleted file mode 100644 index d7c330c3eb..0000000000 --- a/angular-gettext/angular-gettext-tests.ts +++ /dev/null @@ -1,61 +0,0 @@ - - -namespace angular_gettext_tests { - - - // Configuring angular-gettext - // https://angular-gettext.rocketeer.be/dev-guide/configure/ - //Setting the language - angular.module('myApp').run(function (gettextCatalog: angular.gettext.gettextCatalog) { - gettextCatalog.setCurrentLanguage('nl'); - }); - - //Highlighting untranslated strings - angular.module('myApp').run(function (gettextCatalog: angular.gettext.gettextCatalog) { - gettextCatalog.debug = true; - }); - - - // Marking strings in JavaScript code as translatable. - // https://angular-gettext.rocketeer.be/dev-guide/annotate-js/ - angular.module("myApp").controller("helloController", function (gettext: angular.gettext.gettextFunction) { - var myString = gettext("Hello"); - }); - - //Translating directly in JavaScript. - angular.module("myApp").controller("helloController", function (gettextCatalog: angular.gettext.gettextCatalog) { - var translated: string = gettextCatalog.getString("Hello"); - }); - - angular.module("myApp").controller("helloController", function (gettextCatalog: angular.gettext.gettextCatalog) { - var myString2: string = gettextCatalog.getPlural(3, "Bird", "Birds"); - }); - - angular.module("myApp").controller("helloController", function (gettextCatalog: angular.gettext.gettextCatalog) { - var translated: string = gettextCatalog.getString("Hello {{name}}", { name: "Ruben" }); - }); - - // Setting strings manually - // https://angular-gettext.rocketeer.be/dev-guide/manual-setstrings/ - - angular.module("myApp").run(function (gettextCatalog: angular.gettext.gettextCatalog) { - // Load the strings automatically during initialization. - gettextCatalog.setStrings("nl", { - "Hello": "Hallo", - "One boat": ["Een boot", "{{$count}} boats"] - }); - }); - - - interface helloControllerScope extends ng.IScope { - switchLanguage: (lang: string) => void; - } - // Lazy-loading languages - // https://angular-gettext.rocketeer.be/dev-guide/lazy-loading/ - angular.module("myApp").controller("helloController", function ($scope: helloControllerScope, gettextCatalog: angular.gettext.gettextCatalog) { - $scope.switchLanguage = function (lang: string) { - gettextCatalog.setCurrentLanguage(lang); - gettextCatalog.loadRemote("/languages/" + lang + ".json"); - }; - }); -} diff --git a/angular-gridster/index.d.ts b/angular-gridster/index.d.ts deleted file mode 100644 index fc0e990d41..0000000000 --- a/angular-gridster/index.d.ts +++ /dev/null @@ -1,145 +0,0 @@ -// Type definitions for angular-gridster (gridster module) 0.13 -// Project: https://github.com/ManifestWebDesign/angular-gridster -// Definitions by: Joao Monteiro -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -import * as angular from "angular"; - -export default "gridster"; - -declare module "angular" { - - export namespace gridster { - - interface GridsterConfig { - - // number of columns in the grid - columns?: number; - // whether to push other items out of the way - - // whether to push other items out of the way - pushing?: boolean; - - // whether to automatically float items up so they stack - floating?: boolean; - - // whether or not to have items switch places instead of push down if they are the same size - swapping?: boolean; - - // width of the grid. "auto" will expand the grid to its parent container - width?: string; - - // width of grid columns. "auto" will divide the width of the grid evenly among the columns - colWidth?: string; - - // height of grid rows. 'match' will make it the same as the column width, a numeric value will be interpreted as pixels, - // '/2' is half the column width, '*5' is five times the column width, etc. - rowHeight?: string; - - // margins in between grid items - margins?: number[]; - - // whether to set the outer margin - outerMargin?: boolean; - - // toggle mobile view - isMobile?: boolean; - - // width threshold to toggle mobile mode - mobileBreakPoint?: number; - - // whether or not to toggle mobile mode when screen width is less than mobileBreakPoint - mobileModeEnabled?: boolean; - - // minimum amount of columns the grid can scale down to - minColumns?: number; - - // minimum amount of rows to show if the grid is empty - minRows?: number; - - // maximum amount of rows in the grid - maxRows?: number; - - // default width of an item in columns - defaultSizeX?: number; - - // default height of an item in rows - defaultSizeY?: number; - - // minimum column width of an item - minSizeX?: number; - - // maximum column width of an item - maxSizeX?: number; - - // minumum row height of an item - minSizeY?: number; - - // maximum row height of an item - maxSizeY?: number; - - saveGridItemCalculatedHeightInMobile?: boolean; - // grid item height in mobile display. true- to use the calculated height by sizeY given - - // options to pass to resizable handler - resizable?: { - - // whether the items are resizable - enabled?: boolean; - - // location of the resize handles - // e.g // ['s', 'e', 'n', 'w', 'se', 'ne', 'sw', 'nw'] - handles?: string[]; - - // optional callback fired when drag is started - start?(event: angular.IAngularEvent, $element: angular.IAugmentedJQuery, options: any): void; - - // optional callback fired when item is resized - resize?(event: angular.IAngularEvent, $element: angular.IAugmentedJQuery, options: any): void; - - // optional callback fired when item is finished dragging - stop?(event: angular.IAngularEvent, $element: angular.IAugmentedJQuery, options: any): void; - }; - - // options to pass to draggable handler - draggable?: { - - // whether the items are resizable - enabled?: boolean; - - // Distance in pixels from the edge of the viewport after which the viewport should scroll, relative to pointer - scrollSensitivity?: number; - - // Speed at which the window should scroll once the mouse pointer gets within scrollSensitivity distance - scrollSpeed?: number; - - // optional selector for drag handle - handle?: string; - - // optional callback fired when drag is started - start?(event: angular.IAngularEvent, $element: angular.IAugmentedJQuery, options: any): void; - - // optional callback fired when item is moved, - drag?(event: angular.IAngularEvent, $element: angular.IAugmentedJQuery, options: any): void; - - // optional callback fired when item is finished dragging - stop?(event: angular.IAngularEvent, $element: angular.IAugmentedJQuery, options: any): void; - }; - } - - interface StandardGridsterItem { - - // width of the item expressed in terms of number of columns it will occupy - sizeX: number; - - // height of the item expressed in terms of number of rows it will occupy - sizeY: number; - - // starting row where the item will be placed - row: number; - - // starting column where the item will be placed - col: number; - } - } -} diff --git a/angular-gridster/tslint.json b/angular-gridster/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/angular-gridster/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/angular-hotkeys/index.d.ts b/angular-hotkeys/index.d.ts deleted file mode 100644 index f37171c416..0000000000 --- a/angular-hotkeys/index.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -// Type definitions for angular-hotkeys -// Project: https://github.com/chieffancypants/angular-hotkeys -// Definitions by: Jason Zhao , Stefan Steinhart -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -import * as ng from 'angular'; - -declare module 'angular' { - export namespace hotkeys { - - interface HotkeysProvider { - template: string; - templateTitle: string; - includeCheatSheet: boolean; - cheatSheetHotkey: string; - cheatSheetDescription: string; - - add(combo: string | string[], callback: (event: Event, hotkey?: Hotkey) => void, action?: string, allowIn?: Array, persistent?: boolean): ng.hotkeys.Hotkey; - - add(combo: string | string[], description: string, callback: (event: Event, hotkey?: Hotkey) => void, action?: string, allowIn?: Array, persistent?: boolean): ng.hotkeys.Hotkey; - - add(hotkeyObj: ng.hotkeys.Hotkey): ng.hotkeys.Hotkey; - - bindTo(scope: ng.IScope): ng.hotkeys.HotkeysProviderChained; - - del(combo: string | string[]): void; - - del(hotkeyObj: ng.hotkeys.Hotkey): void; - - get(combo: string | string[]): ng.hotkeys.Hotkey; - - toggleCheatSheet(): void; - - purgeHotkeys(): void; - } - - interface HotkeysProviderChained { - add(combo: string | string[], description: string, callback: (event: Event, hotkeys: ng.hotkeys.Hotkey) => void): HotkeysProviderChained; - - add(hotkeyObj: ng.hotkeys.Hotkey): HotkeysProviderChained; - } - - interface Hotkey { - combo: string | string[]; - description?: string; - callback: (event: Event, hotkey: ng.hotkeys.Hotkey) => void; - action?: string; - allowIn?: Array; - persistent?: boolean; - } - } -} diff --git a/angular-material/angular-material-tests.ts b/angular-material/angular-material-tests.ts deleted file mode 100644 index f9195ec999..0000000000 --- a/angular-material/angular-material-tests.ts +++ /dev/null @@ -1,237 +0,0 @@ - - -var myApp = angular.module('testModule', ['ngMaterial']); - -myApp.config(( - $mdThemingProvider: ng.material.IThemingProvider, - $mdIconProvider: ng.material.IIconProvider, - $mdProgressCircularProvider: ng.material.IProgressCircularProvider) => { - - $mdThemingProvider.alwaysWatchTheme(true); - var neonRedMap: ng.material.IPalette = $mdThemingProvider.extendPalette('red', { - '500': 'ff0000' - }); - // Register the new color palette map with the name neonRed - $mdThemingProvider.definePalette('neonRed', neonRedMap); - // Use that theme for the primary intentions - $mdThemingProvider.theme('default') - .primaryPalette('neonRed') - .accentPalette('blue') - .backgroundPalette('grey') - .warnPalette('red') - .dark(true); - - var browserColors: ng.material.IBrowserColors = { - theme: 'default', - palette: 'neonRed', - hue: '500' - }; - $mdThemingProvider.enableBrowserColor(browserColors); - - // Disable theming generation at runtime - $mdThemingProvider.disableTheming(); - - $mdIconProvider - .defaultIconSet('my/app/icons.svg') // Register a default set of SVG icons - .iconSet('social', 'my/app/social.svg') // Register a named icon set of SVGs - .icon('android', 'my/app/android.svg') // Register a specific icon (by name) - .icon('work:chair', 'my/app/chair.svg'); // Register icon in a specific set - - // Example of changing the default progress options. - $mdProgressCircularProvider.configure({ - progressSize: 100, - strokeWidth: 20, - duration: 800 - }); -}); - -myApp.controller('BottomSheetController', ($scope: ng.IScope, $mdBottomSheet: ng.material.IBottomSheetService) => { - $scope['openBottomSheet'] = () => { - $mdBottomSheet.show({ - template: 'Hello!', - clickOutsideToClose: true, - disableBackdrop: true, - disableParentScroll: false, - parent: () => {} - }); - }; - $scope['hideBottomSheet'] = $mdBottomSheet.hide.bind($mdBottomSheet, 'hide'); - $scope['cancelBottomSheet'] = $mdBottomSheet.cancel.bind($mdBottomSheet, 'cancel'); -}); - -myApp.controller('ColorController', ($scope: ng.IScope, $mdColor: ng.material.IColorService) => { - var colorExpression : ng.material.IColorExpression; - var element : Element; - - colorExpression = { color: '#FFFFFF' } - - element = new Element(); - - $scope['applyThemeColors'] = () => { - $mdColor.applyThemeColors(element, colorExpression); - }; - $scope['getThemeColor'] = () => { - $mdColor.getThemeColor('default-neonRed') - }; - $scope['hasTheme'] = () => { - $mdColor.hasTheme(); - }; -}); - -myApp.controller('DialogController', ($scope: ng.IScope, $mdDialog: ng.material.IDialogService) => { - $scope['openDialog'] = () => { - $mdDialog.show({ - template: 'Hello!' - }); - }; - $scope['alertDialog'] = () => { - $mdDialog.show($mdDialog.alert().textContent('Alert!')); - }; - $scope['alertDialog'] = () => { - $mdDialog.show($mdDialog.alert().htmlContent('Alert!')); - }; - $scope['confirmDialog'] = () => { - $mdDialog.show($mdDialog.confirm().textContent('Confirm!')); - }; - $scope['confirmDialog'] = () => { - $mdDialog.show($mdDialog.confirm().htmlContent('Confirm!')); - }; - $scope['promptDialog'] = () => { - $mdDialog.show($mdDialog.prompt().textContent('Prompt!')); - }; - $scope['promptDialog'] = () => { - $mdDialog.show($mdDialog.prompt().htmlContent('Prompt!')); - }; - $scope['promptDialog'] = () => { - $mdDialog.show($mdDialog.prompt().cancel('Prompt "Cancel" button text')); - }; - $scope['promptDialog'] = () => { - $mdDialog.show($mdDialog.prompt().placeholder('Prompt input placeholder text')); - }; - $scope['promptDialog'] = () => { - $mdDialog.show($mdDialog.prompt().initialValue('Buddy')); - }; - $scope['prerenderedDialog'] = () => { - $mdDialog.show({ - template: 'Hello!', - contentElement: '#myDialog', - clickOutsideToClose: true - }); - }; - $scope['hideDialog'] = $mdDialog.hide.bind($mdDialog, 'hide'); - $scope['cancelDialog'] = $mdDialog.cancel.bind($mdDialog, 'cancel'); -}); - -class IconDirective implements ng.IDirective { - - private $mdIcon: ng.material.IIcon; - constructor($mdIcon: ng.material.IIcon) { - this.$mdIcon = $mdIcon; - } - - public link($scope: ng.IScope, $elm: ng.IAugmentedJQuery) { - this.$mdIcon('android').then((iconEl: Element) => $elm.append(iconEl)); - this.$mdIcon('work:chair').then((iconEl: Element) => $elm.append(iconEl)); - // Load and cache the external SVG using a URL - this.$mdIcon('img/icons/android.svg').then((iconEl: Element) => { - $elm.append(iconEl); - }); - } -} -myApp.directive('icon-directive', ($mdIcon: ng.material.IIcon) => new IconDirective($mdIcon)); - -myApp.controller('MediaController', ($scope: ng.IScope, $mdMedia: ng.material.IMedia) => { - $scope.$watch(() => $mdMedia('lg'), (big: boolean) => { - $scope['bigScreen'] = big; - }); - $scope['screenIsSmall'] = $mdMedia('sm'); - $scope['customQuery'] = $mdMedia('(min-width: 1234px)'); - $scope['anotherCustom'] = $mdMedia('max-width: 300px'); -}); - -myApp.controller('SidenavController', ($scope: ng.IScope, $mdSidenav: ng.material.ISidenavService) => { - var componentId = 'left'; - $scope['toggle'] = () => $mdSidenav(componentId).toggle(); - $scope['open'] = () => $mdSidenav(componentId).open(); - $scope['close'] = () => $mdSidenav(componentId).close(); - $scope['isOpen'] = $mdSidenav(componentId).isOpen(); - $scope['isLockedOpen'] = $mdSidenav(componentId).isLockedOpen(); - - $scope['asyncLookup'] = $mdSidenav(componentId, true).then((instance) => { - instance.toggle(); - instance.open(); - instance.close(); - instance.isOpen(); - instance.isLockedOpen(); - }); - - $scope['onClose'] = $mdSidenav(componentId).onClose(() => {}); -}); - -myApp.controller('ToastController', ($scope: ng.IScope, $mdToast: ng.material.IToastService) => { - $scope['openToast'] = () => { - $mdToast.show($mdToast.simple().textContent('Hello!')); - $mdToast.updateTextContent('New Content'); - } - - $scope['customToast'] = () => { - var options = { - hideDelay: 3000, - position: 'top right', - controller : 'ToastCtrl', - templateUrl : 'toast-template.html', - toastClass: 'my-class' - }; - - $mdToast.show(options); - } -}); - -myApp.controller('PanelController', ($scope: ng.IScope, $mdPanel: ng.material.IPanelService) => { - $scope['createPanel'] = () => { - var config = { - id: 'myPanel', - template: '

Hello!

', - hasBackdrop: true, - disableParentScroll: true, - zIndex: 150 - }; - - $mdPanel.create(config); - - var panelRef = $mdPanel.create(config); - panelRef.open() - .then((ref: ng.material.IPanelRef) => { - ref.addClass('foo'); - ref.removeClass('bar'); - ref.close(); - }) - .finally(() => { - panelRef = undefined; - }); - }; - - $scope['openPanel'] = () => { - $mdPanel.open({ - template: '

Hello!

', - hasBackdrop: true, - disableParentScroll: true, - zIndex: 150 - }) - .then((panelRef: ng.material.IPanelRef) => { - panelRef.addClass('foo'); - panelRef.removeClass('bar'); - panelRef.close(); - }); - }; - - $scope['newPanelPosition'] = () => { - $mdPanel.newPanelPosition().absolute().center(); - $mdPanel.newPanelPosition().relativeTo('.demo-menu-open-button').addPanelPosition("ALIGN_START", "BELOW"); - }; - - $scope['newPanelAnimation'] = () => { - $mdPanel.newPanelAnimation().openFrom('.some-target'); - $mdPanel.newPanelAnimation().openFrom({top: 0, left: 0}); - }; -}); diff --git a/angular-material/index.d.ts b/angular-material/index.d.ts deleted file mode 100644 index 0e27fe3b60..0000000000 --- a/angular-material/index.d.ts +++ /dev/null @@ -1,455 +0,0 @@ -// Type definitions for Angular Material (angular.material module) 1.1 -// Project: https://github.com/angular/material -// Definitions by: Blake Bigelow , Peter Hajdu , Davide Donadello -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -import * as angular from 'angular'; - -declare var _: string; -export = _; - -declare module 'angular' { - export namespace material { - interface IBottomSheetOptions { - templateUrl?: string; - template?: string; - scope?: angular.IScope; // default: new child scope - preserveScope?: boolean; // default: false - controller?: string | Function; - locals?: { [index: string]: any }; - clickOutsideToClose?: boolean; - disableBackdrop?: boolean; - escapeToClose?: boolean; - resolve?: { [index: string]: () => angular.IPromise }; - controllerAs?: string; - parent?: Function | string | Object; // default: root node - disableParentScroll?: boolean; // default: true - } - - interface IBottomSheetService { - show(options: IBottomSheetOptions): angular.IPromise; - hide(response?: any): void; - cancel(response?: any): void; - } - - interface IPresetDialog { - title(title: string): T; - textContent(textContent: string): T; - htmlContent(htmlContent: string): T; - ok(ok: string): T; - theme(theme: string): T; - templateUrl(templateUrl?: string): T; - template(template?: string): T; - targetEvent(targetEvent?: MouseEvent): T; - scope(scope?: angular.IScope): T; // default: new child scope - preserveScope(preserveScope?: boolean): T; // default: false - disableParentScroll(disableParentScroll?: boolean): T; // default: true - hasBackdrop(hasBackdrop?: boolean): T; // default: true - clickOutsideToClose(clickOutsideToClose?: boolean): T; // default: false - escapeToClose(escapeToClose?: boolean): T; // default: true - focusOnOpen(focusOnOpen?: boolean): T; // default: true - controller(controller?: string | Function): T; - locals(locals?: { [index: string]: any }): T; - bindToController(bindToController?: boolean): T; // default: false - resolve(resolve?: { [index: string]: () => angular.IPromise }): T; - controllerAs(controllerAs?: string): T; - parent(parent?: string | Element | JQuery): T; // default: root node - onComplete(onComplete?: Function): T; - ariaLabel(ariaLabel: string): T; - } - - interface IAlertDialog extends IPresetDialog { - } - - interface IConfirmDialog extends IPresetDialog { - cancel(cancel: string): IConfirmDialog; - } - - interface IPromptDialog extends IPresetDialog { - cancel(cancel: string): IPromptDialog; - placeholder(placeholder: string): IPromptDialog; - initialValue(initialValue: string): IPromptDialog; - } - - interface IColorExpression { - [cssPropertyName: string]: string; - } - - interface IColorService { - applyThemeColors(element: Element | JQuery, colorExpression: IColorExpression): void; - getThemeColor(expression: string): string; - hasTheme(): boolean; - } - - interface IDialogOptions { - templateUrl?: string; - template?: string; - contentElement?: string | Element; - autoWrap?: boolean; // default: true - targetEvent?: MouseEvent; - openFrom?: any; - closeTo?: any; - scope?: angular.IScope; // default: new child scope - preserveScope?: boolean; // default: false - disableParentScroll?: boolean; // default: true - hasBackdrop?: boolean; // default: true - clickOutsideToClose?: boolean; // default: false - escapeToClose?: boolean; // default: true - focusOnOpen?: boolean; // default: true - controller?: string | Function; - locals?: { [index: string]: any }; - bindToController?: boolean; // default: false - resolve?: { [index: string]: () => angular.IPromise } - controllerAs?: string; - parent?: string | Element | JQuery; // default: root node - onShowing?: Function; - onComplete?: Function; - onRemoving?: Function; - skipHide?: boolean; - multiple?: boolean; - fullscreen?: boolean; // default: false - } - - interface IDialogService { - show(dialog: IDialogOptions | IAlertDialog | IConfirmDialog | IPromptDialog): angular.IPromise; - confirm(): IConfirmDialog; - alert(): IAlertDialog; - prompt(): IPromptDialog; - hide(response?: any): angular.IPromise; - cancel(response?: any): void; - } - - interface IIcon { - (id: string): angular.IPromise; // id is a unique ID or URL - } - - interface IIconProvider { - icon(id: string, url: string, viewBoxSize?: number): IIconProvider; // viewBoxSize default: 24 - iconSet(id: string, url: string, viewBoxSize?: number): IIconProvider; // viewBoxSize default: 24 - defaultIconSet(url: string, viewBoxSize?: number): IIconProvider; // viewBoxSize default: 24 - defaultViewBoxSize(viewBoxSize: number): IIconProvider; // default: 24 - defaultFontSet(name: string): IIconProvider; - } - - interface IMedia { - (media: string): boolean; - } - - interface ISidenavObject { - toggle(): angular.IPromise; - open(): angular.IPromise; - close(): angular.IPromise; - isOpen(): boolean; - isLockedOpen(): boolean; - onClose(onClose: Function): void; - } - - interface ISidenavService { - (component: string, enableWait: boolean): angular.IPromise; - (component: string): ISidenavObject; - } - - interface IToastPreset { - textContent(content: string): T; - action(action: string): T; - highlightAction(highlightAction: boolean): T; - highlightClass(highlightClass: string): T; - capsule(capsule: boolean): T; - theme(theme: string): T; - hideDelay(delay: number | false): T; - position(position: string): T; - parent(parent?: string | Element | JQuery): T; // default: root node - toastClass(toastClass: string): T; - } - - interface ISimpleToastPreset extends IToastPreset { - } - - interface IToastOptions { - templateUrl?: string; - template?: string; - autoWrap?: boolean; - scope?: angular.IScope; // default: new child scope - preserveScope?: boolean; // default: false - hideDelay?: number | false; // default (ms): 3000 - position?: string; // any combination of 'bottom'/'left'/'top'/'right'/'fit'; default: 'bottom left' - toastClass?: string; - controller?: string | Function; - locals?: { [index: string]: any }; - bindToController?: boolean; // default: false - resolve?: { [index: string]: () => angular.IPromise } - controllerAs?: string; - parent?: string | Element | JQuery; // default: root node - } - - interface IToastService { - show(optionsOrPreset: IToastOptions | IToastPreset): angular.IPromise; - showSimple(content: string): angular.IPromise; - simple(): ISimpleToastPreset; - build(): IToastPreset; - updateContent(newContent: string): void; - updateTextContent(newContent: string): void; - hide(response?: any): void; - cancel(response?: any): void; - } - - interface IPalette { - 0?: string; - 50?: string; - 100?: string; - 200?: string; - 300?: string; - 400?: string; - 500?: string; - 600?: string; - 700?: string; - 800?: string; - 900?: string; - A100?: string; - A200?: string; - A400?: string; - A700?: string; - contrastDefaultColor?: string; - contrastDarkColors?: string | string[]; - contrastLightColors?: string | string[]; - } - - interface IThemeHues { - default?: string; - 'hue-1'?: string; - 'hue-2'?: string; - 'hue-3'?: string; - } - - interface IThemePalette { - name: string; - hues: IThemeHues; - } - - interface IBrowserColors { - theme: string; - palette: string; - hue: string; - } - - interface IThemeColors { - accent: IThemePalette; - background: IThemePalette; - primary: IThemePalette; - warn: IThemePalette; - } - - interface IThemeGrayScalePalette { - 1: string; - 2: string; - 3: string; - 4: string; - name: string; - } - - interface ITheme { - name: string; - isDark: boolean; - colors: IThemeColors; - foregroundPalette: IThemeGrayScalePalette; - foregroundShadow: string; - accentPalette(name: string, hues?: IThemeHues): ITheme; - primaryPalette(name: string, hues?: IThemeHues): ITheme; - warnPalette(name: string, hues?: IThemeHues): ITheme; - backgroundPalette(name: string, hues?: IThemeHues): ITheme; - dark(isDark?: boolean): ITheme; - } - - interface IThemeConfig { - disableTheming: boolean; - generateOnDemand: boolean; - nonce: string; - defaultTheme: string; - alwaysWatchTheme: boolean; - registeredStyles: Array; - } - - interface IThemingProvider { - alwaysWatchTheme(alwaysWatch: boolean): void; - definePalette(name: string, palette: IPalette): IThemingProvider; - enableBrowserColor(browserColors: IBrowserColors): Function; - extendPalette(name: string, palette: IPalette): IPalette; - registerStyles(styles: String): void; - setDefaultTheme(theme: string): void; - setNonce(nonce: string): void; - theme(name: string, inheritFrom?: string): ITheme; - generateThemesOnDemand(onDemand: boolean): void; - disableTheming(isDisabled?: boolean): void; - configuration(): IThemeConfig; - } - - interface IDateLocaleProvider { - months: string[]; - shortMonths: string[]; - days: string[]; - shortDays: string[]; - dates: string[]; - firstDayOfWeek: number; - parseDate(dateString: string): Date; - formatDate(date: Date): string; - monthHeaderFormatter(date: Date): string; - weekNumberFormatter(weekNumber: number): string; - msgCalendar: string; - msgOpenCalendar: string; - } - - interface IMenuService { - hide(response?: any, options?: any): angular.IPromise; - } - - interface IColorPalette { - red: IPalette; - pink: IPalette; - 'deep-purple': IPalette; - indigo: IPalette; - blue: IPalette; - 'light-blue': IPalette; - cyan: IPalette; - teal: IPalette; - green: IPalette; - 'light-green': IPalette; - lime: IPalette; - yellow: IPalette; - amber: IPalette; - orange: IPalette; - 'deep-orange': IPalette; - brown: IPalette; - grey: IPalette; - 'blue-grey': IPalette; - } - - interface IPanelConfig { - id?: string; - template?: string; - templateUrl?: string; - controller?: string | Function; - controllerAs?: string; - bindToController?: boolean; // default: true - locals?: { [index: string]: any }; - resolve?: { [index: string]: () => angular.IPromise } - attachTo?: string | JQuery | Element; - propagateContainerEvents?: boolean; - panelClass?: string; - zIndex?: number; // default: 80 - position?: IPanelPosition; - clickOutsideToClose?: boolean; // default: false - escapeToClose?: boolean; // default: false - trapFocus?: boolean; // default: false - focusOnOpen?: boolean; // default: true - fullscreen?: boolean; // default: false - animation?: IPanelAnimation; - hasBackdrop?: boolean; // default: false - disableParentScroll?: boolean; // default: false - onDomAdded?: Function; - onOpenComplete?: Function; - onRemoving?: Function; - onDomRemoved?: Function; - origin?: string | JQuery | Element; - onCloseSuccess?: ((panel: IPanelRef, closeReason: string) => any); - } - - interface IPanelRef { - id: string; - config: IPanelConfig; - isAttached: boolean; - panelContainer: JQuery; - panelEl: JQuery; - open(): angular.IPromise; - close(): angular.IPromise; - attach(): angular.IPromise; - detach(): angular.IPromise; - show(): angular.IPromise; - hide(): angular.IPromise; - destroy(): void; - addClass(newClass: string): void; - removeClass(oldClass: string): void; - toggleClass(toggleClass: string): void; - updatePosition(position: IPanelPosition): void; - registerInterceptor(type: string, callback: () => angular.IPromise): IPanelRef; - removeInterceptor(type: string, callback: () => angular.IPromise): IPanelRef; - removeAllInterceptors(type?: string): IPanelRef; - } - - interface IPanelPosition { - absolute(): IPanelPosition; - relativeTo(someElement: string | JQuery | Element): IPanelPosition; - top(top?: string): IPanelPosition; // default: '0' - bottom(bottom?: string): IPanelPosition; // default: '0' - start(start?: string): IPanelPosition; // default: '0' - end(end?: string): IPanelPosition; // default: '0' - left(left?: string): IPanelPosition; // default: '0' - right(right?: string): IPanelPosition; // default: '0' - centerHorizontally(): IPanelPosition; - centerVertically(): IPanelPosition; - center(): IPanelPosition; - addPanelPosition(xPosition: string, yPosition: string): IPanelPosition; - withOffsetX(offsetX: string | ((panel: IPanelPosition) => string)): IPanelPosition; - withOffsetY(offsetY: string | ((panel: IPanelPosition) => string)): IPanelPosition; - } - - interface IPanelAnimation { - openFrom(from: string | Element | Event | { top: number, left: number }): IPanelAnimation; - closeTo(to: string | Element | { top: number, left: number }): IPanelAnimation; - withAnimation(cssClass: string | { open: string, close: string }): IPanelAnimation; - } - - interface IPanelService { - create(opt_config: IPanelConfig): IPanelRef; - open(opt_config: IPanelConfig): angular.IPromise; - newPanelPosition(): IPanelPosition; - newPanelAnimation(): IPanelAnimation; - xPosition: { - CENTER: string, - ALIGN_START: string, - ALIGN_END: string, - OFFSET_START: string, - OFFSET_END: string, - }; - yPosition: { - CENTER: string, - ALIGN_TOPS: string, - ALIGN_BOTTOMS: string, - ABOVE: string, - BELOW: string, - }; - animation: { - SLIDE: string, - SCALE: string, - FADE: string, - }; - interceptorTypes: { - CLOSE: string, - }; - closeReasons: { - CLICK_OUTSIDE: string, - ESCAPE: string, - }; - absPosition: { - TOP: string, - RIGHT: string, - BOTTOM: string, - LEFT: string, - }; - } - - interface IProgressCircularConfig { - progressSize?: number; - strokeWidth?: number; - duration?: number; - easeFn?: Function; - durationIndeterminate?: number; - startIndeterminate?: number; - endIndeterminate?: number; - easeFnIndeterminate?: Function; - } - - interface IProgressCircularProvider { - configure(options: IProgressCircularConfig): void; - } - } -} diff --git a/angular-oauth2/index.d.ts b/angular-oauth2/index.d.ts deleted file mode 100644 index e6b9592874..0000000000 --- a/angular-oauth2/index.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Type definitions for angular-oauth2 4.1 -// Project: https://github.com/oauthjs/angular-oauth2 -// Definitions by: Antério Vieira -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -import * as angular from 'angular'; - -declare module 'angular' { - export namespace oauth2 { - interface OAuthConfig { - baseUrl: string; - clientId: string; - clientSecret?: string; - grantPath?: string; - revokePath?: string; - } - - interface OAuthProvider { - configure(params: OAuthConfig): OAuthConfig; - } - - interface Data { - username: string; - password: string; - } - - interface OAuth { - isAuthenticated(): boolean; - getAccessToken(data: Data, options?: any): angular.IPromise; - getRefreshToken(data?: Data, options?: any): angular.IPromise; - revokeToken(data?: Data, options?: any): angular.IPromise; - } - - interface OAuthTokenConfig { - name: string; - options: any; - } - - interface OAuthTokenOptions { - secure: boolean; - } - - interface OAuthTokenProvider { - configure(params: OAuthTokenConfig): OAuthTokenConfig; - } - - } -} - diff --git a/angular-oauth2/tsconfig.json b/angular-oauth2/tsconfig.json deleted file mode 100644 index 717721bf79..0000000000 --- a/angular-oauth2/tsconfig.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "target": "es6", - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "angular-oauth2-tests.ts" - ] -} diff --git a/angular-oauth2/tslint.json b/angular-oauth2/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/angular-oauth2/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/angular-promise-tracker/index.d.ts b/angular-promise-tracker/index.d.ts deleted file mode 100644 index c00f36e77c..0000000000 --- a/angular-promise-tracker/index.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -// Type definitions for angular-promise-tracker 2.2.2 -// Project: https://github.com/ajoslin/angular-promise-tracker -// Definitions by: Rufus Linke -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -import * as angular from 'angular'; - -declare module 'angular' { - export namespace promisetracker { - interface PromiseTrackerOptions { - activationDelay: number; - minDuration: number; - } - - interface PromiseTracker { - active(): boolean; - tracking(): boolean; - trackingCount(): number; - addPromise(promise: angular.IPromise): angular.IDeferred; - createPromise(): angular.IDeferred; - cancel(): void; - } - - interface PromiseTrackerService { - (options?: PromiseTrackerOptions): PromiseTracker; - } - } -} diff --git a/angular-signalr-hub/angular-signalr-hub-tests.ts b/angular-signalr-hub/angular-signalr-hub-tests.ts deleted file mode 100644 index 771e49cdff..0000000000 --- a/angular-signalr-hub/angular-signalr-hub-tests.ts +++ /dev/null @@ -1,74 +0,0 @@ -angular - .module('app', ['SignalR']) - .factory('Employees', ngSignalrTest.EmployeesFactory); - -namespace ngSignalrTest { - export class EmployeesFactory { - static $inject = ['$rootScope', 'Hub', '$timeout']; - private hub: ngSignalr.Hub; - public all: Array; - - constructor($rootScope: ng.IRootScopeService, Hub: ngSignalr.HubFactory, $timeout: ng.ITimeoutService) { - // declaring the hub connection - this.hub = new Hub('employee', { - // client-side methods - listeners: { - 'lockEmployee': (id: number) => { - var employee = this.find(id); - employee.Locked = true; - $rootScope.$apply(); - }, - 'unlockEmployee': (id: number) => { - var employee = this.find(id); - employee.Locked = false; - $rootScope.$apply(); - } - }, - - // server-side methods - methods: ['lock', 'unlock'], - - // query params sent on initial connection - queryParams:{ - 'token': 'exampletoken' - }, - - // handle connection error - errorHandler: (message: string) => { - console.error(message); - }, - - stateChanged: (state: SignalR.StateChanged) => { - // your code here - } - }); - } - - private find(id: number) { - for (var i = 0; i < this.all.length; i++) { - if (this.all[i].Id === id) return this.all[i]; - } - - return null; - } - - public edit = (employee: Employee) => { - employee.Edit = true; - this.hub.invoke('lock', employee.Id); - }; - - public done = (employee: Employee) => { - employee.Edit = false; - this.hub.invoke('unlock', employee.Id); - } - } - - interface Employee { - Id: number; - Name: string; - Email: string; - Salary: number; - Edit: boolean; - Locked: boolean; - } -} diff --git a/angular-spinner/angular-spinner-tests.ts b/angular-spinner/angular-spinner-tests.ts deleted file mode 100644 index c8d9e42479..0000000000 --- a/angular-spinner/angular-spinner-tests.ts +++ /dev/null @@ -1,12 +0,0 @@ -/// - -var myApp = angular.module('testModule'); - -namespace AngularSpinnerTest { - var app = angular.module("angularSpinnerTest", ["angular-spinner"]); - - app.config(['usSpinnerService', function(usSpinnerService: ISpinnerService) { - usSpinnerService.spin('key1'); - usSpinnerService.stop('key2'); - }]); -} diff --git a/angular-translate/index.d.ts b/angular-translate/index.d.ts deleted file mode 100644 index 3b911ba313..0000000000 --- a/angular-translate/index.d.ts +++ /dev/null @@ -1,123 +0,0 @@ -// Type definitions for Angular Translate (pascalprecht.translate module) 2.4 -// Project: https://github.com/PascalPrecht/angular-translate -// Definitions by: Michel Salib -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -import * as angular from 'angular'; - -declare module 'angular' { - export namespace translate { - - interface ITranslationTable { - [key: string]: string | ITranslationTable; - } - - interface ILanguageKeyAlias { - [key: string]: string; - } - - interface IStorage { - get(name: string): string; - put(name: string, value: string): void; - } - - interface IStaticFilesLoaderOptions { - prefix: string; - suffix: string; - key?: string; - } - - interface IPartialLoader { - addPart(name: string, priority?: number): T; - deletePart(name: string): T; - isPartAvailable(name: string): boolean; - } - - interface ITranslatePartialLoaderService extends IPartialLoader { - getRegisteredParts(): Array; - isPartLoaded(name: string, lang: string): boolean; - } - - interface ITranslatePartialLoaderProvider extends angular.IServiceProvider, IPartialLoader { - setPart(lang: string, part: string, table: ITranslationTable): ITranslatePartialLoaderProvider; - } - - interface ITranslateService { - (translationId: string, interpolateParams?: any, interpolationId?: string): angular.IPromise; - (translationId: string[], interpolateParams?: any, interpolationId?: string): angular.IPromise<{ [key: string]: string }>; - cloakClassName(): string; - cloakClassName(name: string): ITranslateProvider; - fallbackLanguage(langKey?: string): string; - fallbackLanguage(langKey?: string[]): string; - instant(translationId: string, interpolateParams?: any, interpolationId?: string, forceLanguage?: string, sanitizeStrategy?: string): string; - instant(translationId: string[], interpolateParams?: any, interpolationId?: string, forceLanguage?: string, sanitizeStrategy?: string): { [key: string]: string }; - isPostCompilingEnabled(): boolean; - preferredLanguage(langKey?: string): string; - proposedLanguage(): string; - refresh(langKey?: string): angular.IPromise; - storage(): IStorage; - storageKey(): string; - use(): string; - use(key: string): angular.IPromise; - useFallbackLanguage(langKey?: string): void; - versionInfo(): string; - loaderCache(): any; - isReady(): boolean; - onReady(): angular.IPromise; - resolveClientLocale(): string; - } - - interface ITranslateProvider extends angular.IServiceProvider { - translations(key?: string): ITranslationTable; - translations(key: string, translationTable: ITranslationTable): ITranslateProvider; - cloakClassName(): string; - cloakClassName(name: string): ITranslateProvider; - addInterpolation(factory: any): ITranslateProvider; - useMessageFormatInterpolation(): ITranslateProvider; - useInterpolation(factory: string): ITranslateProvider; - useSanitizeValueStrategy(value: string): ITranslateProvider; - preferredLanguage(): ITranslateProvider; - preferredLanguage(language: string): ITranslateProvider; - translationNotFoundIndicator(indicator: string): ITranslateProvider; - translationNotFoundIndicatorLeft(): string; - translationNotFoundIndicatorLeft(indicator: string): ITranslateProvider; - translationNotFoundIndicatorRight(): string; - translationNotFoundIndicatorRight(indicator: string): ITranslateProvider; - fallbackLanguage(): ITranslateProvider; - fallbackLanguage(language: string): ITranslateProvider; - fallbackLanguage(languages: string[]): ITranslateProvider; - forceAsyncReload(value: boolean): ITranslateProvider; - use(): string; - use(key: string): ITranslateProvider; - storageKey(): string; - storageKey(key: string): void; // JeroMiya - the library should probably return ITranslateProvider but it doesn't here - uniformLanguageTag(options: string | Object): ITranslateProvider; - useUrlLoader(url: string): ITranslateProvider; - useStaticFilesLoader(options: IStaticFilesLoaderOptions | { files: IStaticFilesLoaderOptions[] }): ITranslateProvider; - useLoader(loaderFactory: string, options?: any): ITranslateProvider; - useLocalStorage(): ITranslateProvider; - useCookieStorage(): ITranslateProvider; - useStorage(storageFactory: any): ITranslateProvider; - storagePrefix(): string; - storagePrefix(prefix: string): ITranslateProvider; - useMissingTranslationHandlerLog(): ITranslateProvider; - useMissingTranslationHandler(factory: string): ITranslateProvider; - usePostCompiling(value: boolean): ITranslateProvider; - directivePriority(): number; - directivePriority(priority: number): ITranslateProvider; - determinePreferredLanguage(fn?: () => void): ITranslateProvider; - registerAvailableLanguageKeys(): string[]; - registerAvailableLanguageKeys(languageKeys: string[], aliases?: ILanguageKeyAlias): ITranslateProvider; - useLoaderCache(cache?: any): ITranslateProvider; - resolveClientLocale(): string; - } - } - - interface IFilterService { - (name: 'translate'): { - (translationId: string, interpolateParams?: any, interpolation?: string): string; - }; - } -} diff --git a/angular-ui-bootstrap/index.d.ts b/angular-ui-bootstrap/index.d.ts deleted file mode 100644 index bc80d96b5a..0000000000 --- a/angular-ui-bootstrap/index.d.ts +++ /dev/null @@ -1,918 +0,0 @@ -// Type definitions for Angular UI Bootstrap 0.13.3 -// Project: https://github.com/angular-ui/bootstrap -// Definitions by: Brian Surowiec , Ryan Southgate -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -import * as angular from 'angular'; - -export type IAccordionConfig = angular.ui.bootstrap.IAccordionConfig; -export type IButtonConfig = angular.ui.bootstrap.IButtonConfig; -export type IDatepickerConfig = angular.ui.bootstrap.IDatepickerConfig; -export type IDatepickerPopupConfig = angular.ui.bootstrap.IDatepickerPopupConfig; -export type IDropdownConfig = angular.ui.bootstrap.IDropdownConfig; -export type IModalProvider = angular.ui.bootstrap.IModalProvider; -export type IModalService = angular.ui.bootstrap.IModalService; -export type IModalServiceInstance = angular.ui.bootstrap.IModalServiceInstance; -export type IModalScope = angular.ui.bootstrap.IModalScope; -export type IModalSettings = angular.ui.bootstrap.IModalSettings; -export type IModalStackService = angular.ui.bootstrap.IModalStackService; -export type IModalStackedMapKeyValuePair = angular.ui.bootstrap.IModalStackedMapKeyValuePair; -export type IPaginationConfig = angular.ui.bootstrap.IPaginationConfig; -export type IPagerConfig = angular.ui.bootstrap.IPagerConfig; -export type IPositionCoordinates = angular.ui.bootstrap.IPositionCoordinates; -export type IPositionService = angular.ui.bootstrap.IPositionService; -export type IProgressConfig = angular.ui.bootstrap.IProgressConfig; -export type IRatingConfig = angular.ui.bootstrap.IRatingConfig; -export type ITimepickerConfig = angular.ui.bootstrap.ITimepickerConfig; -export type ITooltipOptions = angular.ui.bootstrap.ITooltipOptions; -export type ITooltipProvider = angular.ui.bootstrap.ITooltipProvider; -export type ITransitionService = angular.ui.bootstrap.ITransitionService; -export type ITransitionServiceOptions = angular.ui.bootstrap.ITransitionServiceOptions; - -declare module 'angular' { - export namespace ui.bootstrap { - - interface IAccordionConfig { - /** - * Controls whether expanding an item will cause the other items to close. - * - * @default true - */ - closeOthers?: boolean; - } - - interface IButtonConfig { - /** - * @default: 'active' - */ - activeClass?: string; - - /** - * @default: 'Click' - */ - toggleEvent?: string; - } - - interface IDropdownConfigNgOptions extends angular.INgModelOptions { - allowInvalid?: boolean; - timezone?: string; - } - - interface IDatepickerConfig { - /** - * Format of day in month. - * - * @default 'dd' - */ - formatDay?: string; - - /** - * Format of month in year. - * - * @default 'MMM' - */ - formatMonth?: string; - - /** - * Format of year in year range. - * - * @default 'yyyy' - */ - formatYear?: string; - - /** - * Format of day in week header. - * - * @default 'EEE' - */ - formatDayHeader?: string; - - /** - * Format of title when selecting day. - * - * @default 'MMM yyyy' - */ - formatDayTitle?: string; - - /** - * Format of title when selecting month. - * - * @default 'yyyy' - */ - formatMonthTitle?: string; - - /** - * Current mode of the datepicker (day|month|year). Can be used to initialize datepicker to specific mode. - * - * @default 'day' - */ - datepickerMode?: string; - - /** - * Set a lower limit for mode. - * - * @default 'day' - */ - minMode?: string; - - /** - * Set an upper limit for mode. - * - * @default 'year' - */ - maxMode?: string; - - /** - * Whether to display week numbers. - * - * @default true - */ - showWeeks?: boolean; - - /** - * Starting day of the week from 0-6 where 0=Sunday and 6=Saturday. - * - * @default 0 - */ - startingDay?: number; - - /** - * Number of years displayed in year selection. - * - * @default 20 - */ - yearRange?: number; - - /** - * Defines the minimum available date. - * - * @default null - */ - minDate?: any; - - /** - * Defines the maximum available date. - * - * @default null - */ - maxDate?: any; - - /** - * Defines the initial date, when no model value is specified. - * - * @default null - */ - initDate?: any; - - /** - * An option to disable or enable shortcut's event propagation - * - * @default false - */ - shortcutPropagation?: boolean; - - /** - * The number of columns displayed in month selection. - * - * @default 3 - */ - monthColumns?: number; - - /** - * The number of columns displayed in year selection. - * - * @default 5 - */ - yearColumns?: number; - - /** - * The number of rows displayed in year selection - * - * @default 4 - */ - yearRows?: number; - - /** - * All supported angular ngModelOptions plus some - * - * @default {} - */ - ngModelOptions?: IDropdownConfigNgOptions - } - - interface IDatepickerPopupConfig { - - /** - * A list of alternate formats acceptable for manual entry. - * - * @default [] - */ - altInputFormats?: string[]; - - /** - * The format for displayed dates. - * - * @default 'yyyy-MM-dd' - */ - datepickerPopup?: string; - - /** - * Allows overriding of default template of the popup. - * - * @default 'template/datepicker/popup.html' - */ - datepickerPopupTemplateUrl?: string; - - /** - * Allows overriding of default template of the datepicker used in popup. - * - * @default 'template/datepicker/popup.html' - */ - datepickerTemplateUrl?: string; - - /** - * Allows overriding of the default format for html5 date inputs. - */ - html5Types?: { - date?: string; - 'datetime-local'?: string; - month?: string; - }; - - /** - * The text to display for the current day button. - * - * @default 'Today' - */ - currentText?: string; - - /** - * The text to display for the clear button. - * - * @default 'Clear' - */ - clearText?: string; - - /** - * The text to display for the close button. - * - * @default 'Done' - */ - closeText?: string; - - /** - * Whether to close calendar when a date is chosen. - * - * @default true - */ - closeOnDateSelection?: boolean; - - /** - * Append the datepicker popup element to `body`, rather than inserting after `datepicker-popup`. - * - * @default false - */ - appendToBody?: boolean; - - /** - * Whether to display a button bar underneath the datepicker. - * - * @default true - */ - showButtonBar?: boolean; - - /** - * Whether to focus the datepicker popup upon opening. - * - * @default true - */ - onOpenFocus?: boolean; - - /** - * Passing in 'auto' separated by a space before the placement will enable auto positioning, e.g: "auto bottom-left". The popup will attempt to position where it fits in the closest scrollable ancestor. - * - * @default 'auto bottom-left' - */ - placement?: string; - } - - interface IDropdownConfig { - /** - * @default: 'uib-dropdown-open' - */ - appendToOpenClass?: string; - - /** - * @default: 'open' - */ - openClass?: string; - } - - interface IModalProvider { - /** - * Default options all modals will use. - */ - options: IModalSettings; - } - - interface IModalService { - /** - * @param {IModalSettings} options - * @returns {IModalServiceInstance} - */ - open(options: IModalSettings): IModalServiceInstance; - } - - interface IModalServiceInstance { - /** - * A method that can be used to close a modal, passing a result. If `preventDefault` is called on the `modal.closing` event then the modal will remain open. - */ - close(result?: any): void; - - /** - * A method that can be used to dismiss a modal, passing a reason. If `preventDefault` is called on the `modal.closing` event then the modal will remain open. - */ - dismiss(reason?: any): void; - - /** - * A promise that is resolved when a modal is closed and rejected when a modal is dismissed. - */ - result: angular.IPromise; - - /** - * A promise that is resolved when a modal gets opened after downloading content's template and resolving all variables. - */ - opened: angular.IPromise; - - /** - * A promise that is resolved when a modal is rendered. - */ - rendered: angular.IPromise; - - /** - * A promise that is resolved when a modal is closed and the animation completes. - */ - closed: angular.IPromise; - } - - interface IModalScope extends angular.IScope { - /** - * Dismiss the dialog without assigning a value to the promise output. If `preventDefault` is called on the `modal.closing` event then the modal will remain open. - * - * @returns true if the modal was closed; otherwise false - */ - $dismiss(reason?: any): boolean; - - /** - * Close the dialog resolving the promise to the given value. If `preventDefault` is called on the `modal.closing` event then the modal will remain open. - * - * @returns true if the modal was closed; otherwise false - */ - $close(result?: any): boolean; - } - - interface IModalSettings { - /** - * a path to a template representing modal's content - */ - templateUrl?: string | (() => string); - - /** - * inline template representing the modal's content - */ - template?: string; - - /** - * a scope instance to be used for the modal's content (actually the $modal service is going to create a child scope of a provided scope). - * Defaults to `$rootScope`. - */ - scope?: angular.IScope | IModalScope; - - /** - * a controller for a modal instance - it can initialize scope used by modal. - * A controller can be injected with `$modalInstance` - * If value is an array, it must be in Inline Array Annotation format for injection (strings followed by factory method) - */ - controller?: string | Function | Array; - - /** - * an alternative to the controller-as syntax, matching the API of directive definitions. - * Requires the controller option to be provided as well - */ - controllerAs?: string; - - /** - * When used with controllerAs and set to true, it will bind the controller properties onto the $scope directly. - * - * @default false - */ - bindToController?: boolean; - - /** - * members that will be resolved and passed to the controller as locals; it is equivalent of the `resolve` property for AngularJS routes - * If property value is an array, it must be in Inline Array Annotation format for injection (strings followed by factory method) - */ - resolve?: { [key: string]: string | Function | Array | Object }; - - /** - * Set to false to disable animations on new modal/backdrop. Does not toggle animations for modals/backdrops that are already displayed. - * - * @default true - */ - animation?: boolean; - - /** - * controls the presence of a backdrop - * Allowed values: - * - true (default) - * - false (no backdrop) - * - 'static' backdrop is present but modal window is not closed when clicking outside of the modal window - * - * @default true - */ - backdrop?: boolean | string; - - /** - * indicates whether the dialog should be closable by hitting the ESC key - * - * @default true - */ - keyboard?: boolean; - - /** - * additional CSS class(es) to be added to a modal backdrop template - */ - backdropClass?: string; - - /** - * additional CSS class(es) to be added to a modal window template - */ - windowClass?: string; - - /** - * Optional suffix of modal window class. The value used is appended to the `modal-` class, i.e. a value of `sm` gives `modal-sm`. - */ - size?: string; - - /** - * a path to a template overriding modal's window template - */ - windowTemplateUrl?: string; - - /** - * The class added to the body element when the modal is opened. - * - * @default 'model-open' - */ - openedClass?: string; - - /** - * CSS class(es) to be added to the top modal window. - */ - windowTopClass?: string; - - /** - * Appends the modal to a specific element. - * - * @default 'body' - */ - appendTo?: angular.IAugmentedJQuery; - - /** - * A string reference to the component to be rendered that is registered with Angular's compiler. If using a directive, the directive must have `restrict: 'E'` and a template or templateUrl set. - * - * It supports these bindings: - * - `close` - A method that can be used to close a modal, passing a result. The result must be passed in this format: `{$value: myResult}` - * - `dismiss` - A method that can be used to dismiss a modal, passing a result. The result must be passed in this format: `{$value: myRejectedResult}` - * - `modalInstance` - The modal instance. This is the same `$uibModalInstance` injectable found when using `controller`. - * - `resolve` - An object of the modal resolve values. See [UI Router resolves] for details. - */ - component?: string; - - /** - * Sets the `aria-describedby` property on the modal. - * The string should be an id (without the leading '#') pointing to the element that describes your modal. - * @type {string} - * @memberOf IModalSettings - */ - ariaDescribedBy?: string; - - /** - * Sets the `aria-labelledby` property on the modal. - * The string should be an id (without the leading '#') pointing to the element that labels your modal. - * @type {string} - * @memberOf IModalSettings - */ - ariaLabelledBy?: string; - } - - interface IModalStackService { - /** - * Opens a new modal instance. - */ - open(modalInstance: IModalServiceInstance, modal: any): void; - - /** - * Closes a modal instance with an optional result. - */ - close(modalInstance: IModalServiceInstance, result?: any): void; - - /** - * Dismisses a modal instance with an optional reason. - */ - dismiss(modalInstance: IModalServiceInstance, reason?: any): void; - - /** - * Dismiss all open modal instances with an optional reason that will be passed to each instance. - */ - dismissAll(reason?: any): void; - - /** - * Gets the topmost modal instance that is open. - */ - getTop(): IModalStackedMapKeyValuePair; - } - - interface IModalStackedMapKeyValuePair { - key: IModalServiceInstance; - value: any; - } - - - interface IPaginationConfig { - /** - * Total number of items in all pages. - */ - totalItems?: number; - - /** - * Maximum number of items per page. A value less than one indicates all items on one page. - * - * @default 10 - */ - itemsPerPage?: number; - - /** - * Limit number for pagination size. - * - * @default: null - */ - maxSize?: number; - - /** - * An optional expression assigned the total number of pages to display. - * - * @default angular.noop - */ - numPages?: number; - - /** - * Whether to keep current page in the middle of the visible ones. - * - * @default true - */ - rotate?: boolean; - - /** - * Whether to display Previous / Next buttons. - * - * @default true - */ - directionLinks?: boolean; - - /** - * Text for Previous button. - * - * @default 'Previous' - */ - previousText?: string; - - /** - * Text for Next button. - * - * @default 'Next' - */ - nextText?: string; - - /** - * Whether to display First / Last buttons. - * - * @default false - */ - boundaryLinks?: boolean; - - /** - * Whether to always display the first and last page numbers. If max-size is smaller than the number of pages, then the first and last page numbers are still shown with ellipses in-between as necessary. NOTE: max-size refers to the center of the range. This option may add up to 2 more numbers on each side of the displayed range for the end value and what would be an ellipsis but is replaced by a number because it is sequential. - * - * @default false - */ - boundaryLinkNumbers?: boolean; - - /** - * Text for First button. - * - * @default 'First' - */ - firstText?: string; - - /** - * Text for Last button. - * - * @default 'Last' - */ - lastText?: string; - - /** - * Override the template for the component with a custom provided template. - * - * @default 'template/pagination/pagination.html' - */ - templateUrl?: string; - - /** - * Also displays ellipses when rotate is true and max-size is smaller than the number of pages. - * - * @default false - */ - forceEllipses?: boolean; - } - - interface IPagerConfig { - /** - * Whether to align each link to the sides. - * - * @default true - */ - align?: boolean; - - /** - * Maximum number of items per page. A value less than one indicates all items on one page. - * - * @default 10 - */ - itemsPerPage?: number; - - /** - * Text for Previous button. - * - * @default '« Previous' - */ - previousText?: string; - - /** - * Text for Next button. - * - * @default 'Next »' - */ - nextText?: string; - } - - - interface IPositionCoordinates { - width?: number; - height?: number; - top?: number; - left?: number; - } - - interface IPositionService { - /** - * Provides a read-only equivalent of jQuery's position function. - */ - position(element: JQuery): IPositionCoordinates; - - /** - * Provides a read-only equivalent of jQuery's offset function. - */ - offset(element: JQuery): IPositionCoordinates; - } - - - interface IProgressConfig { - /** - * Whether bars use transitions to achieve the width change. - * - * @default: true - */ - animate?: boolean; - - /** - * A number that specifies the total value of bars that is required. - * - * @default: 100 - */ - max?: number; - } - - - interface IRatingConfig { - /** - * Changes the number of icons. - * - * @default: 5 - */ - max?: number; - - /** - * A variable used in the template to specify the state for selected icons. - * - * @default: null - */ - stateOn?: string; - - /** - * A variable used in the template to specify the state for unselected icons. - * - * @default: null - */ - stateOff?: string; - - /** - * An array of strings defining titles for all icons. - * - * @default: ["one", "two", "three", "four", "five"] - */ - titles?: Array; - } - - - interface ITimepickerConfig { - /** - * Number of hours to increase or decrease when using a button. - * - * @default 1 - */ - hourStep?: number; - - /** - * Number of minutes to increase or decrease when using a button. - * - * @default 1 - */ - minuteStep?: number; - - /** - * Number of seconds to increase or decrease when using a button. - * - * @default 1 - */ - secondStep?: number; - - /** - * Whether to display 12H or 24H mode. - * - * @default true - */ - showMeridian?: boolean; - - /** - * Meridian labels based on locale. To override you must supply an array like ['AM', 'PM']. - * - * @default null - */ - meridians?: Array; - - /** - * Whether the user can type inside the hours & minutes input. - * - * @default false - */ - readonlyInput?: boolean; - - /** - * Whether the user can scroll inside the hours & minutes input to increase or decrease it's values. - * - * @default true - */ - mousewheel?: boolean; - - /** - * Whether the user can use up/down arrowkeys inside the hours & minutes input to increase or decrease it's values. - * - * @default true - */ - arrowkeys?: boolean; - - /** - * Shows spinner arrows above and below the inputs. - * - * @default true - */ - showSpinners?: boolean; - - /** - * Show seconds input. - * - * @default false - */ - showSeconds?: boolean; - - /** - * Add the ability to override the template used on the component. - * - * @default 'uib/template/timepicker/timepicker.html' - */ - templateUrl?: string; - } - - - interface ITooltipOptions { - /** - * Where to place it? Defaults to 'top', but also accepts 'right', 'bottom', or 'left'. - * - * @default 'top' - */ - placement?: string; - - /** - * Should the modal fade in and out? - * - * @default true - */ - animation?: boolean; - - /** - * Popup delay in milliseconds until it opens. - * - * @default 0 - */ - popupDelay?: number; - - /** - * For how long should the tooltip remain open after the close trigger event? - * - * @default 0 - */ - popupCloseDelay?: number; - - /** - * Should the tooltip be appended to `$body` instead of the parent element? - * - * @default false - */ - appendToBody?: boolean; - - /** - * What should trigger a show of the tooltip? Supports a space separated list of event names. - * - * @default 'mouseenter' for tooltip, 'click' for popover - */ - trigger?: string; - - /** - * Should an expression on the scope be used to load the content? - * - * @default false - */ - useContentExp?: boolean; - } - - interface ITooltipProvider { - /** - * Provide a set of defaults for certain tooltip and popover attributes. - */ - options(value: ITooltipOptions): void; - - /** - * Extends the default trigger mappings with mappings of your own. E.g. `{ 'openTrigger': 'closeTrigger' }`. - */ - setTriggers(triggers: Object): void; - } - - - /** - * WARNING: $transition is now deprecated. Use $animate from ngAnimate instead. - */ - interface ITransitionService { - /** - * The browser specific animation event name. - */ - animationEndEventName: string; - - /** - * The browser specific transition event name. - */ - transitionEndEventName: string; - - /** - * Provides a consistent interface to trigger CSS 3 transitions and to be informed when they complete. - * - * @param element The DOMElement that will be animated - * @param trigger The thing that will cause the transition to start: - * - As a string, it represents the css class to be added to the element. - * - As an object, it represents a hash of style attributes to be applied to the element. - * - As a function, it represents a function to be called that will cause the transition to occur. - * @param options Optional settings for the transition. - * - * @return A promise that is resolved when the transition finishes. - */ - (element: angular.IAugmentedJQuery, trigger: any, options?: ITransitionServiceOptions): angular.IPromise; - } - - interface ITransitionServiceOptions { - animation?: boolean; - } - } -} diff --git a/angular/index.d.ts b/angular/index.d.ts deleted file mode 100644 index 5d47751844..0000000000 --- a/angular/index.d.ts +++ /dev/null @@ -1,2062 +0,0 @@ -// Type definitions for Angular JS 1.6 -// Project: http://angularjs.org -// Definitions by: Diego Vilar , Georgii Dolzhykov -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -declare var angular: angular.IAngularStatic; - -// Support for painless dependency injection -declare global { - interface Function { - $inject?: ReadonlyArray; - } -} - -export as namespace angular; -export as namespace ng; - -// Support AMD require -export = angular; - -import ng = angular; - -/////////////////////////////////////////////////////////////////////////////// -// ng module (angular.js) -/////////////////////////////////////////////////////////////////////////////// -declare namespace angular { - - type Injectable = T | Array; - - // not directly implemented, but ensures that constructed class implements $get - interface IServiceProviderClass { - new (...args: any[]): IServiceProvider; - } - - interface IServiceProviderFactory { - (...args: any[]): IServiceProvider; - } - - // All service providers extend this interface - interface IServiceProvider { - $get: any; - } - - interface IAngularBootstrapConfig { - strictDi?: boolean; - } - - /////////////////////////////////////////////////////////////////////////// - // AngularStatic - // see http://docs.angularjs.org/api - /////////////////////////////////////////////////////////////////////////// - interface IAngularStatic { - bind(context: any, fn: Function, ...args: any[]): Function; - - /** - * Use this function to manually start up angular application. - * - * @param element DOM element which is the root of angular application. - * @param modules An array of modules to load into the application. - * Each item in the array should be the name of a predefined module or a (DI annotated) - * function that will be invoked by the injector as a config block. - * @param config an object for defining configuration options for the application. The following keys are supported: - * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. - */ - bootstrap(element: string|Element|JQuery|Document, modules?: Array, config?: IAngularBootstrapConfig): auto.IInjectorService; - - /** - * Creates a deep copy of source, which should be an object or an array. - * - * - If no destination is supplied, a copy of the object or array is created. - * - If a destination is provided, all of its elements (for array) or properties (for objects) are deleted and then all elements/properties from the source are copied to it. - * - If source is not an object or array (inc. null and undefined), source is returned. - * - If source is identical to 'destination' an exception will be thrown. - * - * @param source The source that will be used to make a copy. Can be any type, including primitives, null, and undefined. - * @param destination Destination into which the source is copied. If provided, must be of the same type as source. - */ - copy(source: T, destination?: T): T; - - /** - * Wraps a raw DOM element or HTML string as a jQuery element. - * - * If jQuery is available, angular.element is an alias for the jQuery function. If jQuery is not available, angular.element delegates to Angular's built-in subset of jQuery, called "jQuery lite" or "jqLite." - */ - element: JQueryStatic; - equals(value1: any, value2: any): boolean; - extend(destination: any, ...sources: any[]): any; - - /** - * Invokes the iterator function once for each item in obj collection, which can be either an object or an array. The iterator function is invoked with iterator(value, key), where value is the value of an object property or an array element and key is the object property key or array element index. Specifying a context for the function is optional. - * - * It is worth noting that .forEach does not iterate over inherited properties because it filters using the hasOwnProperty method. - * - * @param obj Object to iterate over. - * @param iterator Iterator function. - * @param context Object to become context (this) for the iterator function. - */ - forEach(obj: T[], iterator: (value: T, key: number, obj: T[]) => void, context?: any): T[]; - /** - * Invokes the iterator function once for each item in obj collection, which can be either an object or an array. The iterator function is invoked with iterator(value, key), where value is the value of an object property or an array element and key is the object property key or array element index. Specifying a context for the function is optional. - * - * It is worth noting that .forEach does not iterate over inherited properties because it filters using the hasOwnProperty method. - * - * @param obj Object to iterate over. - * @param iterator Iterator function. - * @param context Object to become context (this) for the iterator function. - */ - forEach(obj: { [index: string]: T; }, iterator: (value: T, key: string, obj: { [index: string]: T; }) => void, context?: any): { [index: string]: T; }; - /** - * Invokes the iterator function once for each item in obj collection, which can be either an object or an array. The iterator function is invoked with iterator(value, key), where value is the value of an object property or an array element and key is the object property key or array element index. Specifying a context for the function is optional. - * - * It is worth noting that .forEach does not iterate over inherited properties because it filters using the hasOwnProperty method. - * - * @param obj Object to iterate over. - * @param iterator Iterator function. - * @param context Object to become context (this) for the iterator function. - */ - forEach(obj: any, iterator: (value: any, key: any, obj: any) => void, context?: any): any; - - fromJson(json: string): any; - identity(arg?: T): T; - injector(modules?: any[], strictDi?: boolean): auto.IInjectorService; - isArray(value: any): value is any[]; - isDate(value: any): value is Date; - isDefined(value: any): boolean; - isElement(value: any): boolean; - isFunction(value: any): value is Function; - isNumber(value: any): value is number; - isObject(value: any): value is Object; - isObject(value: any): value is T; - isString(value: any): value is string; - isUndefined(value: any): boolean; - lowercase(str: string): string; - - /** - * Deeply extends the destination object dst by copying own enumerable properties from the src object(s) to dst. You can specify multiple src objects. If you want to preserve original objects, you can do so by passing an empty object as the target: var object = angular.merge({}, object1, object2). - * - * Unlike extend(), merge() recursively descends into object properties of source objects, performing a deep copy. - * - * @param dst Destination object. - * @param src Source object(s). - */ - merge(dst: any, ...src: any[]): any; - - /** - * The angular.module is a global place for creating, registering and retrieving Angular modules. All modules (angular core or 3rd party) that should be available to an application must be registered using this mechanism. - * - * When passed two or more arguments, a new module is created. If passed only one argument, an existing module (the name passed as the first argument to module) is retrieved. - * - * @param name The name of the module to create or retrieve. - * @param requires The names of modules this module depends on. If specified then new module is being created. If unspecified then the module is being retrieved for further configuration. - * @param configFn Optional configuration function for the module. - */ - module( - name: string, - requires?: string[], - configFn?: Function): IModule; - - noop(...args: any[]): void; - reloadWithDebugInfo(): void; - toJson(obj: any, pretty?: boolean | number): string; - uppercase(str: string): string; - version: { - full: string; - major: number; - minor: number; - 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; - } - - /////////////////////////////////////////////////////////////////////////// - // Module - // see http://docs.angularjs.org/api/angular.Module - /////////////////////////////////////////////////////////////////////////// - interface 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. - * - * @param configFn Execute this function on module load. Useful for service configuration. - */ - config(configFn: Function): IModule; - /** - * Use this method to register work which needs to be performed on module loading. - * - * @param inlineAnnotatedFunction Execute this function on module load. Useful for service configuration. - */ - config(inlineAnnotatedFunction: any[]): IModule; - config(object: Object): IModule; - /** - * Register a constant service, such as a string, a number, an array, an object or a function, with the $injector. Unlike value it can be injected into a module configuration function (see config) and it cannot be overridden by an Angular decorator. - * - * @param name The name of the constant. - * @param value The constant value. - */ - constant(name: string, value: T): IModule; - constant(object: Object): IModule; - /** - * The $controller service is used by Angular to create new controllers. - * - * This provider allows controller registration via the register method. - * - * @param name Controller name, or an object map of controllers where the keys are the names and the values are the constructors. - * @param controllerConstructor Controller constructor fn (optionally decorated with DI annotations in the array notation). - */ - controller(name: string, controllerConstructor: Injectable): IModule; - controller(object: {[name: string]: Injectable}): IModule; - /** - * Register a new directive with the compiler. - * - * @param name Name of the directive in camel-case (i.e. ngBind which will match as ng-bind) - * @param directiveFactory An injectable directive factory function. - */ - directive(name: string, directiveFactory: Injectable): IModule; - directive(object: {[directiveName: string]: Injectable}): IModule; - /** - * Register a service factory, which will be called to return the service instance. This is short for registering a service where its provider consists of only a $get property, which is the given service factory function. You should use $provide.factory(getFn) if you do not need to configure your service in a provider. - * - * @param name The name of the instance. - * @param $getFn The $getFn for the instance creation. Internally this is a short hand for $provide.provider(name, {$get: $getFn}). - */ - factory(name: string, $getFn: Injectable): IModule; - factory(object: {[name: string]: Injectable}): IModule; - filter(name: string, filterFactoryFunction: Injectable): IModule; - filter(object: {[name: string]: Injectable}): IModule; - provider(name: string, serviceProviderFactory: IServiceProviderFactory): IModule; - provider(name: string, serviceProviderConstructor: IServiceProviderClass): IModule; - provider(name: string, inlineAnnotatedConstructor: any[]): IModule; - provider(name: string, providerObject: IServiceProvider): IModule; - provider(object: Object): IModule; - /** - * Run blocks are the closest thing in Angular to the main method. A run block is the code which needs to run to kickstart the application. It is executed after all of the service have been configured and the injector has been created. Run blocks typically contain code which is hard to unit-test, and for this reason should be declared in isolated modules, so that they can be ignored in the unit-tests. - */ - run(initializationFunction: Injectable): IModule; - /** - * Register a service constructor, which will be invoked with new to create the service instance. This is short for registering a service where its provider's $get property is a factory function that returns an instance instantiated by the injector from the service constructor function. - * - * @param name The name of the instance. - * @param serviceConstructor An injectable class (constructor function) that will be instantiated. - */ - service(name: string, serviceConstructor: Injectable): IModule; - service(object: {[name: string]: Injectable}): IModule; - /** - * Register a value service with the $injector, such as a string, a number, an array, an object or a function. This is short for registering a service where its provider's $get property is a factory function that takes no arguments and returns the value service. - - Value services are similar to constant services, except that they cannot be injected into a module configuration function (see config) but they can be overridden by an Angular decorator. - * - * @param name The name of the instance. - * @param value The value. - */ - value(name: string, value: T): IModule; - value(object: Object): IModule; - - /** - * Register a service decorator with the $injector. A service decorator intercepts the creation of a service, allowing it to override or modify the behaviour of the service. The object returned by the decorator may be the original service, or a new service object which replaces or wraps and delegates to the original service. - * @param name The name of the service to decorate - * @param decorator This function will be invoked when the service needs to be instantiated and should return the decorated service instance. The function is called using the injector.invoke method and is therefore fully injectable. Local injection arguments: $delegate - The original service instance, which can be monkey patched, configured, decorated or delegated to. - */ - decorator(name: string, decorator: Injectable): IModule; - - // Properties - name: string; - requires: string[]; - } - - /////////////////////////////////////////////////////////////////////////// - // Attributes - // see http://docs.angularjs.org/api/ng.$compile.directive.Attributes - /////////////////////////////////////////////////////////////////////////// - interface IAttributes { - /** - * this is necessary to be able to access the scoped attributes. it's not very elegant - * because you have to use attrs['foo'] instead of attrs.foo but I don't know of a better way - * this should really be limited to return string but it creates this problem: http://stackoverflow.com/q/17201854/165656 - */ - [name: string]: any; - - /** - * Converts an attribute name (e.g. dash/colon/underscore-delimited string, optionally prefixed with x- or data-) to its normalized, camelCase form. - * - * Also there is special case for Moz prefix starting with upper case letter. - * - * For further information check out the guide on @see https://docs.angularjs.org/guide/directive#matching-directives - */ - $normalize(name: string): string; - - /** - * Adds the CSS class value specified by the classVal parameter to the - * element. If animations are enabled then an animation will be triggered - * for the class addition. - */ - $addClass(classVal: string): void; - - /** - * Removes the CSS class value specified by the classVal parameter from the - * element. If animations are enabled then an animation will be triggered for - * the class removal. - */ - $removeClass(classVal: string): void; - - /** - * Adds and removes the appropriate CSS class values to the element based on the difference between - * the new and old CSS class values (specified as newClasses and oldClasses). - */ - $updateClass(newClasses: string, oldClasses: string): void; - - /** - * Set DOM element attribute value. - */ - $set(key: string, value: any): void; - - /** - * Observes an interpolated attribute. - * The observer function will be invoked once during the next $digest - * following compilation. The observer is then invoked whenever the - * interpolated value changes. - */ - $observe(name: string, fn: (value?: T) => any): Function; - - /** - * A map of DOM element attribute names to the normalized name. This is needed - * to do reverse lookup from normalized name back to actual name. - */ - $attr: Object; - } - - /** - * form.FormController - type in module ng - * see https://docs.angularjs.org/api/ng/type/form.FormController - */ - interface IFormController { - - /** - * Indexer which should return ng.INgModelController for most properties but cannot because of "All named properties must be assignable to string indexer type" constraint - see https://github.com/Microsoft/TypeScript/issues/272 - */ - [name: string]: any; - - $pristine: boolean; - $dirty: boolean; - $valid: boolean; - $invalid: boolean; - $submitted: boolean; - $error: any; - $name: string; - $pending: any; - $addControl(control: INgModelController | IFormController): void; - $removeControl(control: INgModelController | IFormController): void; - $setValidity(validationErrorKey: string, isValid: boolean, control: INgModelController | IFormController): void; - $setDirty(): void; - $setPristine(): void; - $commitViewValue(): void; - $rollbackViewValue(): void; - $setSubmitted(): void; - $setUntouched(): void; - } - - /////////////////////////////////////////////////////////////////////////// - // NgModelController - // see http://docs.angularjs.org/api/ng.directive:ngModel.NgModelController - /////////////////////////////////////////////////////////////////////////// - interface INgModelController { - $render(): void; - $setValidity(validationErrorKey: string, isValid: boolean): void; - // Documentation states viewValue and modelValue to be a string but other - // types do work and it's common to use them. - $setViewValue(value: any, trigger?: string): void; - $setPristine(): void; - $setDirty(): void; - $validate(): void; - $setTouched(): void; - $setUntouched(): void; - $rollbackViewValue(): void; - $commitViewValue(): void; - $isEmpty(value: any): boolean; - - $viewValue: any; - - $modelValue: any; - - $parsers: IModelParser[]; - $formatters: IModelFormatter[]; - $viewChangeListeners: IModelViewChangeListener[]; - $error: any; - $name: string; - - $touched: boolean; - $untouched: boolean; - - $validators: IModelValidators; - $asyncValidators: IAsyncModelValidators; - - $pending: any; - $pristine: boolean; - $dirty: boolean; - $valid: boolean; - $invalid: boolean; - } - - // Allows tuning how model updates are done. - // https://docs.angularjs.org/api/ng/directive/ngModelOptions - interface INgModelOptions { - updateOn?: string; - debounce?: any; - allowInvalid?: boolean; - getterSetter?: boolean; - timezone?: string; - } - - interface IModelValidators { - /** - * viewValue is any because it can be an object that is called in the view like $viewValue.name:$viewValue.subName - */ - [index: string]: (modelValue: any, viewValue: any) => boolean; - } - - interface IAsyncModelValidators { - [index: string]: (modelValue: any, viewValue: any) => IPromise; - } - - interface IModelParser { - (value: any): any; - } - - interface IModelFormatter { - (value: any): any; - } - - interface IModelViewChangeListener { - (): void; - } - - /** - * $rootScope - $rootScopeProvider - service in module ng - * see https://docs.angularjs.org/api/ng/type/$rootScope.Scope and https://docs.angularjs.org/api/ng/service/$rootScope - */ - interface IRootScopeService { - [index: string]: any; - - $apply(): any; - $apply(exp: string): any; - $apply(exp: (scope: IScope) => any): any; - - $applyAsync(): any; - $applyAsync(exp: string): any; - $applyAsync(exp: (scope: IScope) => any): any; - - /** - * Dispatches an event name downwards to all child scopes (and their children) notifying the registered $rootScope.Scope listeners. - * - * The event life cycle starts at the scope on which $broadcast was called. All listeners listening for name event on this scope get notified. Afterwards, the event propagates to all direct and indirect scopes of the current scope and calls all registered listeners along the way. The event cannot be canceled. - * - * Any exception emitted from the listeners will be passed onto the $exceptionHandler service. - * - * @param name Event name to broadcast. - * @param args Optional one or more arguments which will be passed onto the event listeners. - */ - $broadcast(name: string, ...args: any[]): IAngularEvent; - $destroy(): void; - $digest(): void; - /** - * Dispatches an event name upwards through the scope hierarchy notifying the registered $rootScope.Scope listeners. - * - * The event life cycle starts at the scope on which $emit was called. All listeners listening for name event on this scope get notified. Afterwards, the event traverses upwards toward the root scope and calls all registered listeners along the way. The event will stop propagating if one of the listeners cancels it. - * - * Any exception emitted from the listeners will be passed onto the $exceptionHandler service. - * - * @param name Event name to emit. - * @param args Optional one or more arguments which will be passed onto the event listeners. - */ - $emit(name: string, ...args: any[]): IAngularEvent; - - $eval(): any; - $eval(expression: string, locals?: Object): any; - $eval(expression: (scope: IScope) => any, locals?: Object): any; - - $evalAsync(): void; - $evalAsync(expression: string): void; - $evalAsync(expression: (scope: IScope) => any): void; - - // Defaults to false by the implementation checking strategy - $new(isolate?: boolean, parent?: IScope): IScope; - - /** - * Listens on events of a given type. See $emit for discussion of event life cycle. - * - * The event listener function format is: function(event, args...). - * - * @param name Event name to listen on. - * @param listener Function to call when the event is emitted. - */ - $on(name: string, listener: (event: IAngularEvent, ...args: any[]) => any): () => void; - - $watch(watchExpression: string, listener?: string, objectEquality?: boolean): () => void; - $watch(watchExpression: string, listener?: (newValue: T, oldValue: T, scope: IScope) => any, objectEquality?: boolean): () => void; - $watch(watchExpression: (scope: IScope) => any, listener?: string, objectEquality?: boolean): () => void; - $watch(watchExpression: (scope: IScope) => T, listener?: (newValue: T, oldValue: T, scope: IScope) => any, objectEquality?: boolean): () => void; - - $watchCollection(watchExpression: string, listener: (newValue: T, oldValue: T, scope: IScope) => any): () => void; - $watchCollection(watchExpression: (scope: IScope) => T, listener: (newValue: T, oldValue: T, scope: IScope) => any): () => void; - - $watchGroup(watchExpressions: any[], listener: (newValue: any, oldValue: any, scope: IScope) => any): () => void; - $watchGroup(watchExpressions: Array<{ (scope: IScope): any }>, listener: (newValue: any, oldValue: any, scope: IScope) => any): () => void; - - $parent: IScope; - $root: IRootScopeService; - $id: number; - - // Hidden members - $$isolateBindings: any; - $$phase: any; - } - - interface IScope extends IRootScopeService { } - - /** - * $scope for ngRepeat directive. - * see https://docs.angularjs.org/api/ng/directive/ngRepeat - */ - interface IRepeatScope extends IScope { - - /** - * iterator offset of the repeated element (0..length-1). - */ - $index: number; - - /** - * true if the repeated element is first in the iterator. - */ - $first: boolean; - - /** - * true if the repeated element is between the first and last in the iterator. - */ - $middle: boolean; - - /** - * true if the repeated element is last in the iterator. - */ - $last: boolean; - - /** - * true if the iterator position $index is even (otherwise false). - */ - $even: boolean; - - /** - * true if the iterator position $index is odd (otherwise false). - */ - $odd: boolean; - - } - - interface IAngularEvent { - /** - * the scope on which the event was $emit-ed or $broadcast-ed. - */ - targetScope: IScope; - /** - * the scope that is currently handling the event. Once the event propagates through the scope hierarchy, this property is set to null. - */ - currentScope: IScope; - /** - * name of the event. - */ - name: string; - /** - * calling stopPropagation function will cancel further event propagation (available only for events that were $emit-ed). - */ - stopPropagation?(): void; - /** - * calling preventDefault sets defaultPrevented flag to true. - */ - preventDefault(): void; - /** - * true if preventDefault was called. - */ - defaultPrevented: boolean; - } - - /////////////////////////////////////////////////////////////////////////// - // WindowService - // see http://docs.angularjs.org/api/ng.$window - /////////////////////////////////////////////////////////////////////////// - interface IWindowService extends Window { - [key: string]: any; - } - - /////////////////////////////////////////////////////////////////////////// - // TimeoutService - // see http://docs.angularjs.org/api/ng.$timeout - /////////////////////////////////////////////////////////////////////////// - interface ITimeoutService { - (delay?: number, invokeApply?: boolean): IPromise; - (fn: (...args: any[]) => T, delay?: number, invokeApply?: boolean, ...args: any[]): IPromise; - cancel(promise?: IPromise): boolean; - } - - /////////////////////////////////////////////////////////////////////////// - // IntervalService - // see http://docs.angularjs.org/api/ng.$interval - /////////////////////////////////////////////////////////////////////////// - interface IIntervalService { - (func: Function, delay: number, count?: number, invokeApply?: boolean, ...args: any[]): IPromise; - cancel(promise: IPromise): boolean; - } - - /** - * $filter - $filterProvider - service in module ng - * - * Filters are used for formatting data displayed to the user. - * - * see https://docs.angularjs.org/api/ng/service/$filter - */ - interface IFilterService { - (name: 'filter'): IFilterFilter; - (name: 'currency'): IFilterCurrency; - (name: 'number'): IFilterNumber; - (name: 'date'): IFilterDate; - (name: 'json'): IFilterJson; - (name: 'lowercase'): IFilterLowercase; - (name: 'uppercase'): IFilterUppercase; - (name: 'limitTo'): IFilterLimitTo; - (name: 'orderBy'): IFilterOrderBy; - /** - * Usage: - * $filter(name); - * - * @param name Name of the filter function to retrieve - */ - (name: string): T; - } - - interface IFilterFilter { - (array: T[], expression: string | IFilterFilterPatternObject | IFilterFilterPredicateFunc, comparator?: IFilterFilterComparatorFunc|boolean): T[]; - } - - interface IFilterFilterPatternObject { - [name: string]: any; - } - - interface IFilterFilterPredicateFunc { - (value: T, index: number, array: T[]): boolean; - } - - interface IFilterFilterComparatorFunc { - (actual: T, expected: T): boolean; - } - - interface IFilterOrderByItem { - value: any; - type: string; - index: any; - } - - interface IFilterOrderByComparatorFunc { - (left: IFilterOrderByItem, right: IFilterOrderByItem): -1 | 0 | 1; - } - - interface IFilterCurrency { - /** - * Formats a number as a currency (ie $1,234.56). When no currency symbol is provided, default symbol for current locale is used. - * @param amount Input to filter. - * @param symbol Currency symbol or identifier to be displayed. - * @param fractionSize Number of decimal places to round the amount to, defaults to default max fraction size for current locale - * @return Formatted number - */ - (amount: number, symbol?: string, fractionSize?: number): string; - } - - interface IFilterNumber { - /** - * Formats a number as text. - * @param number Number to format. - * @param fractionSize Number of decimal places to round the number to. If this is not provided then the fraction size is computed from the current locale's number formatting pattern. In the case of the default locale, it will be 3. - * @return Number rounded to decimalPlaces and places a “,” after each third digit. - */ - (value: number|string, fractionSize?: number|string): string; - } - - interface IFilterDate { - /** - * Formats date to a string based on the requested format. - * - * @param date Date to format either as Date object, milliseconds (string or number) or various ISO 8601 datetime string formats (e.g. yyyy-MM-ddTHH:mm:ss.sssZ and its shorter versions like yyyy-MM-ddTHH:mmZ, yyyy-MM-dd or yyyyMMddTHHmmssZ). If no timezone is specified in the string input, the time is considered to be in the local timezone. - * @param format Formatting rules (see Description). If not specified, mediumDate is used. - * @param timezone Timezone to be used for formatting. It understands UTC/GMT and the continental US time zone abbreviations, but for general use, use a time zone offset, for example, '+0430' (4 hours, 30 minutes east of the Greenwich meridian) If not specified, the timezone of the browser will be used. - * @return Formatted string or the input if input is not recognized as date/millis. - */ - (date: Date | number | string, format?: string, timezone?: string): string; - } - - interface IFilterJson { - /** - * Allows you to convert a JavaScript object into JSON string. - * @param object Any JavaScript object (including arrays and primitive types) to filter. - * @param spacing The number of spaces to use per indentation, defaults to 2. - * @return JSON string. - */ - (object: any, spacing?: number): string; - } - - interface IFilterLowercase { - /** - * Converts string to lowercase. - */ - (value: string): string; - } - - interface IFilterUppercase { - /** - * Converts string to uppercase. - */ - (value: string): string; - } - - interface IFilterLimitTo { - /** - * Creates a new array containing only a specified number of elements. The elements are taken from either the beginning or the end of the source array, string or number, as specified by the value and sign (positive or negative) of limit. - * @param input Source array to be limited. - * @param limit The length of the returned array. If the limit number is positive, limit number of items from the beginning of the source array/string are copied. If the number is negative, limit number of items from the end of the source array are copied. The limit will be trimmed if it exceeds array.length. If limit is undefined, the input will be returned unchanged. - * @param begin Index at which to begin limitation. As a negative index, begin indicates an offset from the end of input. Defaults to 0. - * @return A new sub-array of length limit or less if input array had less than limit elements. - */ - (input: T[], limit: string|number, begin?: string|number): T[]; - /** - * Creates a new string containing only a specified number of elements. The elements are taken from either the beginning or the end of the source string or number, as specified by the value and sign (positive or negative) of limit. If a number is used as input, it is converted to a string. - * @param input Source string or number to be limited. - * @param limit The length of the returned string. If the limit number is positive, limit number of items from the beginning of the source string are copied. If the number is negative, limit number of items from the end of the source string are copied. The limit will be trimmed if it exceeds input.length. If limit is undefined, the input will be returned unchanged. - * @param begin Index at which to begin limitation. As a negative index, begin indicates an offset from the end of input. Defaults to 0. - * @return A new substring of length limit or less if input had less than limit elements. - */ - (input: string|number, limit: string|number, begin?: string|number): string; - } - - interface IFilterOrderBy { - /** - * Orders a specified array by the expression predicate. It is ordered alphabetically for strings and numerically for numbers. Note: if you notice numbers are not being sorted as expected, make sure they are actually being saved as numbers and not strings. - * @param array The array to sort. - * @param expression A predicate to be used by the comparator to determine the order of elements. - * @param reverse Reverse the order of the array. - * @param comparator Function used to determine the relative order of value pairs. - * @return An array containing the items from the specified collection, ordered by a comparator function based on the values computed using the expression predicate. - */ - (array: T[], expression: string|((value: T) => any)|Array<((value: T) => any)|string>, reverse?: boolean, comparator?: IFilterOrderByComparatorFunc): T[]; - } - - /** - * $filterProvider - $filter - provider in module ng - * - * Filters are just functions which transform input to an output. However filters need to be Dependency Injected. To achieve this a filter definition consists of a factory function which is annotated with dependencies and is responsible for creating a filter function. - * - * see https://docs.angularjs.org/api/ng/provider/$filterProvider - */ - interface IFilterProvider extends IServiceProvider { - /** - * register(name); - * - * @param name Name of the filter function, or an object map of filters where the keys are the filter names and the values are the filter factories. Note: Filter names must be valid angular Expressions identifiers, such as uppercase or orderBy. Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace your filters, then you can use capitalization (myappSubsectionFilterx) or underscores (myapp_subsection_filterx). - */ - register(name: string | {}): IServiceProvider; - } - - /////////////////////////////////////////////////////////////////////////// - // LocaleService - // see http://docs.angularjs.org/api/ng.$locale - /////////////////////////////////////////////////////////////////////////// - interface ILocaleService { - id: string; - - // These are not documented - // Check angular's i18n files for exemples - NUMBER_FORMATS: ILocaleNumberFormatDescriptor; - DATETIME_FORMATS: ILocaleDateTimeFormatDescriptor; - pluralCat: (num: any) => string; - } - - interface ILocaleNumberFormatDescriptor { - DECIMAL_SEP: string; - GROUP_SEP: string; - PATTERNS: ILocaleNumberPatternDescriptor[]; - CURRENCY_SYM: string; - } - - interface ILocaleNumberPatternDescriptor { - minInt: number; - minFrac: number; - maxFrac: number; - posPre: string; - posSuf: string; - negPre: string; - negSuf: string; - gSize: number; - lgSize: number; - } - - interface ILocaleDateTimeFormatDescriptor { - MONTH: string[]; - SHORTMONTH: string[]; - DAY: string[]; - SHORTDAY: string[]; - AMPMS: string[]; - medium: string; - short: string; - fullDate: string; - longDate: string; - mediumDate: string; - shortDate: string; - mediumTime: string; - shortTime: string; - } - - /////////////////////////////////////////////////////////////////////////// - // LogService - // see http://docs.angularjs.org/api/ng.$log - // see http://docs.angularjs.org/api/ng.$logProvider - /////////////////////////////////////////////////////////////////////////// - interface ILogService { - debug: ILogCall; - error: ILogCall; - info: ILogCall; - log: ILogCall; - warn: ILogCall; - } - - interface ILogProvider extends IServiceProvider { - debugEnabled(): boolean; - debugEnabled(enabled: boolean): ILogProvider; - } - - // We define this as separate interface so we can reopen it later for - // the ngMock module. - interface ILogCall { - (...args: any[]): void; - } - - /////////////////////////////////////////////////////////////////////////// - // ParseService - // see http://docs.angularjs.org/api/ng.$parse - // see http://docs.angularjs.org/api/ng.$parseProvider - /////////////////////////////////////////////////////////////////////////// - interface IParseService { - (expression: string, interceptorFn?: (value: any, scope: IScope, locals: any) => any, expensiveChecks?: boolean): ICompiledExpression; - } - - interface IParseProvider { - logPromiseWarnings(): boolean; - logPromiseWarnings(value: boolean): IParseProvider; - - unwrapPromises(): boolean; - unwrapPromises(value: boolean): IParseProvider; - - /** - * Configure $parse service to add literal values that will be present as literal at expressions. - * - * @param literalName Token for the literal value. The literal name value must be a valid literal name. - * @param literalValue Value for this literal. All literal values must be primitives or `undefined`. - **/ - addLiteral(literalName: string, literalValue: any): void; - - /** - * Allows defining the set of characters that are allowed in Angular expressions. The function identifierStart will get called to know if a given character is a valid character to be the first character for an identifier. The function identifierContinue will get called to know if a given character is a valid character to be a follow-up identifier character. The functions identifierStart and identifierContinue will receive as arguments the single character to be identifier and the character code point. These arguments will be string and numeric. Keep in mind that the string parameter can be two characters long depending on the character representation. It is expected for the function to return true or false, whether that character is allowed or not. - * Since this function will be called extensivelly, keep the implementation of these functions fast, as the performance of these functions have a direct impact on the expressions parsing speed. - * - * @param identifierStart The function that will decide whether the given character is a valid identifier start character. - * @param identifierContinue The function that will decide whether the given character is a valid identifier continue character. - **/ - setIdentifierFns(identifierStart?: (character: string, codePoint: number) => boolean, - identifierContinue?: (character: string, codePoint: number) => boolean): void; - } - - interface ICompiledExpression { - (context: any, locals?: any): any; - - literal: boolean; - constant: boolean; - - // If value is not provided, undefined is gonna be used since the implementation - // does not check the parameter. Let's force a value for consistency. If consumer - // whants to undefine it, pass the undefined value explicitly. - assign(context: any, value: any): any; - } - - /** - * $location - $locationProvider - service in module ng - * see https://docs.angularjs.org/api/ng/service/$location - */ - interface ILocationService { - absUrl(): string; - - /** - * Returns the hash fragment - */ - hash(): string; - - /** - * Changes the hash fragment and returns `$location` - */ - hash(newHash: string|null): ILocationService; - - host(): string; - - /** - * Return path of current url - */ - path(): string; - - /** - * Change path when called with parameter and return $location. - * Note: Path should always begin with forward slash (/), this method will add the forward slash if it is missing. - * - * @param path New path - */ - path(path: string): ILocationService; - - port(): number; - protocol(): string; - replace(): ILocationService; - - /** - * Return search part (as object) of current url - */ - search(): any; - - /** - * Change search part when called with parameter and return $location. - * - * @param search When called with a single argument the method acts as a setter, setting the search component of $location to the specified value. - * - * If the argument is a hash object containing an array of values, these values will be encoded as duplicate search parameters in the url. - */ - search(search: any): ILocationService; - - /** - * Change search part when called with parameter and return $location. - * - * @param search New search params - * @param paramValue If search is a string or a Number, then paramValue will override only a single search property. If paramValue is null, the property specified via the first argument will be deleted. If paramValue is an array, it will override the property of the search component of $location specified via the first argument. If paramValue is true, the property specified via the first argument will be added with no value nor trailing equal sign. - */ - search(search: string, paramValue: string|number|null|string[]|boolean): ILocationService; - - state(): any; - state(state: any): ILocationService; - url(): string; - url(url: string): ILocationService; - } - - interface ILocationProvider extends IServiceProvider { - hashPrefix(): string; - hashPrefix(prefix: string): ILocationProvider; - html5Mode(): boolean; - - // Documentation states that parameter is string, but - // implementation tests it as boolean, which makes more sense - // since this is a toggler - html5Mode(active: boolean): ILocationProvider; - html5Mode(mode: { enabled?: boolean; requireBase?: boolean; rewriteLinks?: boolean; }): ILocationProvider; - } - - /////////////////////////////////////////////////////////////////////////// - // DocumentService - // see http://docs.angularjs.org/api/ng.$document - /////////////////////////////////////////////////////////////////////////// - interface IDocumentService extends JQuery { - // Must return intersection type for index signature compatibility with JQuery - [index: number]: HTMLElement & Document; - } - - /////////////////////////////////////////////////////////////////////////// - // ExceptionHandlerService - // see http://docs.angularjs.org/api/ng.$exceptionHandler - /////////////////////////////////////////////////////////////////////////// - interface IExceptionHandlerService { - (exception: Error, cause?: string): void; - } - - /////////////////////////////////////////////////////////////////////////// - // RootElementService - // see http://docs.angularjs.org/api/ng.$rootElement - /////////////////////////////////////////////////////////////////////////// - interface IRootElementService extends JQuery {} - - interface IQResolveReject { - (): void; - (value: T): void; - } - /** - * $q - service in module ng - * A promise/deferred implementation inspired by Kris Kowal's Q. - * See http://docs.angularjs.org/api/ng/service/$q - */ - interface IQService { - new (resolver: (resolve: IQResolveReject, reject: IQResolveReject) => any): IPromise; - (resolver: (resolve: IQResolveReject, reject: IQResolveReject) => any): IPromise; - - /** - * Combines multiple promises into a single promise that is resolved when all of the input promises are resolved. - * - * Returns a single promise that will be resolved with an array of values, each value corresponding to the promise at the same index in the promises array. If any of the promises is resolved with a rejection, this resulting promise will be rejected with the same rejection value. - * - * @param promises An array of promises. - */ - all(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise , T5 | IPromise, T6 | IPromise, T7 | IPromise, T8 | IPromise, T9 | IPromise, T10 | IPromise]): IPromise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; - all(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise , T5 | IPromise, T6 | IPromise, T7 | IPromise, T8 | IPromise, T9 | IPromise]): IPromise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; - all(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise , T5 | IPromise, T6 | IPromise, T7 | IPromise, T8 | IPromise]): IPromise<[T1, T2, T3, T4, T5, T6, T7, T8]>; - all(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise , T5 | IPromise, T6 | IPromise, T7 | IPromise]): IPromise<[T1, T2, T3, T4, T5, T6, T7]>; - all(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise , T5 | IPromise, T6 | IPromise]): IPromise<[T1, T2, T3, T4, T5, T6]>; - all(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise , T5 | IPromise]): IPromise<[T1, T2, T3, T4, T5]>; - all(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise ]): IPromise<[T1, T2, T3, T4]>; - all(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise]): IPromise<[T1, T2, T3]>; - all(values: [T1 | IPromise, T2 | IPromise]): IPromise<[T1, T2]>; - all(promises: Array>): IPromise; - /** - * Combines multiple promises into a single promise that is resolved when all of the input promises are resolved. - * - * Returns a single promise that will be resolved with a hash of values, each value corresponding to the promise at the same key in the promises hash. If any of the promises is resolved with a rejection, this resulting promise will be rejected with the same rejection value. - * - * @param promises A hash of promises. - */ - all(promises: { [id: string]: IPromise; }): IPromise<{ [id: string]: any; }>; - all(promises: { [id: string]: IPromise; }): IPromise; - /** - * Creates a Deferred object which represents a task which will finish in the future. - */ - defer(): IDeferred; - /** - * Creates a promise that is resolved as rejected with the specified reason. This api should be used to forward rejection in a chain of promises. If you are dealing with the last promise in a promise chain, you don't need to worry about it. - * - * When comparing deferreds/promises to the familiar behavior of try/catch/throw, think of reject as the throw keyword in JavaScript. This also means that if you "catch" an error via a promise error callback and you want to forward the error to the promise derived from the current promise, you have to "rethrow" the error by returning a rejection constructed via reject. - * - * @param reason Constant, message, exception or an object representing the rejection reason. - */ - reject(reason?: any): IPromise; - /** - * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. This is useful when you are dealing with an object that might or might not be a promise, or if the promise comes from a source that can't be trusted. - * - * @param value Value or a promise - */ - resolve(value: IPromise|T): IPromise; - resolve(value: IPromise|T2): IPromise; - /** - * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. This is useful when you are dealing with an object that might or might not be a promise, or if the promise comes from a source that can't be trusted. - */ - resolve(): IPromise; - /** - * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. This is useful when you are dealing with an object that might or might not be a promise, or if the promise comes from a source that can't be trusted. - * - * @param value Value or a promise - */ - when(value: IPromise|T): IPromise; - when(value: IPromise|T2): IPromise; - when(value: IPromise|T, successCallback: (promiseValue: T) => IPromise|TResult): IPromise; - when(value: T, successCallback: (promiseValue: T) => IPromise|TResult, errorCallback: null | undefined | ((reason: any) => any), notifyCallback?: (state: any) => any): IPromise; - when(value: IPromise, successCallback: (promiseValue: T) => IPromise|TResult, errorCallback: (reason: any) => TResult2 | IPromise, notifyCallback?: (state: any) => any): IPromise; - /** - * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. This is useful when you are dealing with an object that might or might not be a promise, or if the promise comes from a source that can't be trusted. - */ - when(): IPromise; - } - - interface IQProvider { - /** - * Retrieves or overrides whether to generate an error when a rejected promise is not handled. - * This feature is enabled by default. - * - * @returns {boolean} Current value - */ - errorOnUnhandledRejections(): boolean; - - /** - * Retrieves or overrides whether to generate an error when a rejected promise is not handled. - * This feature is enabled by default. - * - * @param {boolean} value Whether to generate an error when a rejected promise is not handled. - * @returns {ng.IQProvider} Self for chaining otherwise. - */ - errorOnUnhandledRejections(value: boolean): IQProvider; - } - - interface IPromise { - /** - * Regardless of when the promise was or will be resolved or rejected, then calls one of the success or error callbacks asynchronously as soon as the result is available. The callbacks are called with a single argument: the result or rejection reason. Additionally, the notify callback may be called zero or more times to provide a progress indication, before the promise is resolved or rejected. - * The successCallBack may return IPromise for when a $q.reject() needs to be returned - * This method returns a new promise which is resolved or rejected via the return value of the successCallback, errorCallback. It also notifies via the return value of the notifyCallback method. The promise can not be resolved or rejected from the notifyCallback method. - */ - then(successCallback: (promiseValue: T) => IPromise|TResult, errorCallback?: null | undefined, notifyCallback?: (state: any) => any): IPromise; - then(successCallback: (promiseValue: T) => IPromise|TResult2, errorCallback?: null | undefined, notifyCallback?: (state: any) => any): IPromise; - - then(successCallback: (promiseValue: T) => IPromise|TResult, errorCallback: (reason: any) => IPromise|TCatch, notifyCallback?: (state: any) => any): IPromise; - then(successCallback: (promiseValue: T) => IPromise|TResult2, errorCallback: (reason: any) => IPromise|TCatch2, notifyCallback?: (state: any) => any): IPromise; - - /** - * Shorthand for promise.then(null, errorCallback) - */ - catch(onRejected: (reason: any) => IPromise|TCatch): IPromise; - catch(onRejected: (reason: any) => IPromise|TCatch2): IPromise; - - /** - * Allows you to observe either the fulfillment or rejection of a promise, but to do so without modifying the final value. This is useful to release resources or do some clean-up that needs to be done whether the promise was rejected or resolved. See the full specification for more information. - * - * Because finally is a reserved word in JavaScript and reserved keywords are not supported as property names by ES3, you'll need to invoke the method like promise['finally'](callback) to make your code IE8 and Android 2.x compatible. - */ - finally(finallyCallback: () => any): IPromise; - } - - interface IDeferred { - resolve(value?: T|IPromise): void; - reject(reason?: any): void; - notify(state?: any): void; - promise: IPromise; - } - - /////////////////////////////////////////////////////////////////////////// - // AnchorScrollService - // see http://docs.angularjs.org/api/ng.$anchorScroll - /////////////////////////////////////////////////////////////////////////// - interface IAnchorScrollService { - (): void; - (hash: string): void; - yOffset: any; - } - - interface IAnchorScrollProvider extends IServiceProvider { - disableAutoScrolling(): void; - } - - /** - * $cacheFactory - service in module ng - * - * Factory that constructs Cache objects and gives access to them. - * - * see https://docs.angularjs.org/api/ng/service/$cacheFactory - */ - interface ICacheFactoryService { - /** - * Factory that constructs Cache objects and gives access to them. - * - * @param cacheId Name or id of the newly created cache. - * @param optionsMap Options object that specifies the cache behavior. Properties: - * - * capacity — turns the cache into LRU cache. - */ - (cacheId: string, optionsMap?: { capacity?: number; }): ICacheObject; - - /** - * Get information about all the caches that have been created. - * @returns key-value map of cacheId to the result of calling cache#info - */ - info(): any; - - /** - * Get access to a cache object by the cacheId used when it was created. - * - * @param cacheId Name or id of a cache to access. - */ - get(cacheId: string): ICacheObject; - } - - /** - * $cacheFactory.Cache - type in module ng - * - * A cache object used to store and retrieve data, primarily used by $http and the script directive to cache templates and other data. - * - * see https://docs.angularjs.org/api/ng/type/$cacheFactory.Cache - */ - interface ICacheObject { - /** - * Retrieve information regarding a particular Cache. - */ - info(): { - /** - * the id of the cache instance - */ - id: string; - - /** - * the number of entries kept in the cache instance - */ - size: number; - - // ...: any additional properties from the options object when creating the cache. - }; - - /** - * Inserts a named entry into the Cache object to be retrieved later, and incrementing the size of the cache if the key was not already present in the cache. If behaving like an LRU cache, it will also remove stale entries from the set. - * - * It will not insert undefined values into the cache. - * - * @param key the key under which the cached data is stored. - * @param value the value to store alongside the key. If it is undefined, the key will not be stored. - */ - put(key: string, value?: T): T; - - /** - * Retrieves named data stored in the Cache object. - * - * @param key the key of the data to be retrieved - */ - get(key: string): T; - - /** - * Removes an entry from the Cache object. - * - * @param key the key of the entry to be removed - */ - remove(key: string): void; - - /** - * Clears the cache object of any entries. - */ - removeAll(): void; - - /** - * Destroys the Cache object entirely, removing it from the $cacheFactory set. - */ - destroy(): void; - } - - /////////////////////////////////////////////////////////////////////////// - // CompileService - // see http://docs.angularjs.org/api/ng.$compile - // see http://docs.angularjs.org/api/ng.$compileProvider - /////////////////////////////////////////////////////////////////////////// - interface ICompileService { - (element: string | Element | JQuery, transclude?: ITranscludeFunction, maxPriority?: number): ITemplateLinkingFunction; - } - - interface ICompileProvider extends IServiceProvider { - directive(name: string, directiveFactory: Injectable): ICompileProvider; - directive(object: {[directiveName: string]: Injectable}): ICompileProvider; - - component(name: string, options: IComponentOptions): ICompileProvider; - - aHrefSanitizationWhitelist(): RegExp; - aHrefSanitizationWhitelist(regexp: RegExp): ICompileProvider; - - imgSrcSanitizationWhitelist(): RegExp; - imgSrcSanitizationWhitelist(regexp: RegExp): ICompileProvider; - - debugInfoEnabled(): boolean; - debugInfoEnabled(enabled: boolean): ICompileProvider; - - /** - * Call this method to enable/disable whether directive controllers are assigned bindings before calling the controller's constructor. - * If enabled (true), the compiler assigns the value of each of the bindings to the properties of the controller object before the constructor of this object is called. - * If disabled (false), the compiler calls the constructor first before assigning bindings. - * Defaults to false. - * See: https://docs.angularjs.org/api/ng/provider/$compileProvider#preAssignBindingsEnabled - */ - preAssignBindingsEnabled(): boolean; - preAssignBindingsEnabled(enabled: boolean): ICompileProvider; - - /** - * Sets the number of times $onChanges hooks can trigger new changes before giving up and assuming that the model is unstable. - * Increasing the TTL could have performance implications, so you should not change it without proper justification. - * Default: 10. - * See: https://docs.angularjs.org/api/ng/provider/$compileProvider#onChangesTtl - */ - onChangesTtl(): number; - onChangesTtl(limit: number): ICompileProvider; - - /** - * It indicates to the compiler whether or not directives on comments should be compiled. - * It results in a compilation performance gain since the compiler doesn't have to check comments when looking for directives. - * Defaults to true. - * See: https://docs.angularjs.org/api/ng/provider/$compileProvider#commentDirectivesEnabled - */ - commentDirectivesEnabled(): boolean; - commentDirectivesEnabled(enabled: boolean): ICompileProvider; - - /** - * It indicates to the compiler whether or not directives on element classes should be compiled. - * It results in a compilation performance gain since the compiler doesn't have to check element classes when looking for directives. - * Defaults to true. - * See: https://docs.angularjs.org/api/ng/provider/$compileProvider#cssClassDirectivesEnabled - */ - cssClassDirectivesEnabled(): boolean; - cssClassDirectivesEnabled(enabled: boolean): ICompileProvider; - } - - interface ICloneAttachFunction { - // Let's hint but not force cloneAttachFn's signature - (clonedElement?: JQuery, scope?: IScope): any; - } - - // This corresponds to the "publicLinkFn" returned by $compile. - interface ITemplateLinkingFunction { - (scope: IScope, cloneAttachFn?: ICloneAttachFunction, options?: ITemplateLinkingFunctionOptions): JQuery; - } - - interface ITemplateLinkingFunctionOptions { - parentBoundTranscludeFn?: ITranscludeFunction; - transcludeControllers?: { - [controller: string]: { instance: IController } - }; - futureParentElement?: JQuery; - } - - /** - * This corresponds to $transclude passed to controllers and to the transclude function passed to link functions. - * https://docs.angularjs.org/api/ng/service/$compile#-controller- - * http://teropa.info/blog/2015/06/09/transclusion.html - */ - interface ITranscludeFunction { - // If the scope is provided, then the cloneAttachFn must be as well. - (scope: IScope, cloneAttachFn: ICloneAttachFunction, futureParentElement?: JQuery, slotName?: string): JQuery; - // If one argument is provided, then it's assumed to be the cloneAttachFn. - (cloneAttachFn?: ICloneAttachFunction, futureParentElement?: JQuery, slotName?: string): JQuery; - - /** - * Returns true if the specified slot contains content (i.e. one or more DOM nodes) - */ - isSlotFilled(slotName: string): boolean; - } - - /////////////////////////////////////////////////////////////////////////// - // ControllerService - // see http://docs.angularjs.org/api/ng.$controller - // see http://docs.angularjs.org/api/ng.$controllerProvider - /////////////////////////////////////////////////////////////////////////// - - /** - * The minimal local definitions required by $controller(ctrl, locals) calls. - */ - interface IControllerLocals { - $scope: ng.IScope; - $element: JQuery; - } - - interface IControllerService { - // Although the documentation doesn't state this, locals are optional - (controllerConstructor: new (...args: any[]) => T, locals?: any, later?: boolean, ident?: string): T; - (controllerConstructor: Function, locals?: IControllerLocals, later?: boolean, ident?: string): T; - (controllerConstructor: Function, locals?: any, later?: boolean, ident?: string): T; - (controllerName: string, locals?: any, later?: boolean, ident?: string): T; - } - - interface IControllerProvider extends IServiceProvider { - register(name: string, controllerConstructor: Function): void; - register(name: string, dependencyAnnotatedConstructor: any[]): void; - allowGlobals(): void; - } - - /** - * xhrFactory - * Replace or decorate this service to create your own custom XMLHttpRequest objects. - * see https://docs.angularjs.org/api/ng/service/$xhrFactory - */ - interface IXhrFactory { - (method: string, url: string): T; - } - - /** - * HttpService - * see http://docs.angularjs.org/api/ng/service/$http - */ - interface IHttpService { - /** - * Object describing the request to be made and how it should be processed. - */ - (config: IRequestConfig): IHttpPromise; - - /** - * Shortcut method to perform GET request. - * - * @param url Relative or absolute URL specifying the destination of the request - * @param config Optional configuration object - */ - get(url: string, config?: IRequestShortcutConfig): IHttpPromise; - - /** - * Shortcut method to perform DELETE request. - * - * @param url Relative or absolute URL specifying the destination of the request - * @param config Optional configuration object - */ - delete(url: string, config?: IRequestShortcutConfig): IHttpPromise; - - /** - * Shortcut method to perform HEAD request. - * - * @param url Relative or absolute URL specifying the destination of the request - * @param config Optional configuration object - */ - head(url: string, config?: IRequestShortcutConfig): IHttpPromise; - - /** - * Shortcut method to perform JSONP request. - * - * @param url Relative or absolute URL specifying the destination of the request - * @param config Optional configuration object - */ - jsonp(url: string, config?: IRequestShortcutConfig): IHttpPromise; - - /** - * Shortcut method to perform POST request. - * - * @param url Relative or absolute URL specifying the destination of the request - * @param data Request content - * @param config Optional configuration object - */ - post(url: string, data: any, config?: IRequestShortcutConfig): IHttpPromise; - - /** - * Shortcut method to perform PUT request. - * - * @param url Relative or absolute URL specifying the destination of the request - * @param data Request content - * @param config Optional configuration object - */ - put(url: string, data: any, config?: IRequestShortcutConfig): IHttpPromise; - - /** - * Shortcut method to perform PATCH request. - * - * @param url Relative or absolute URL specifying the destination of the request - * @param data Request content - * @param config Optional configuration object - */ - patch(url: string, data: any, config?: IRequestShortcutConfig): IHttpPromise; - - /** - * Runtime equivalent of the $httpProvider.defaults property. Allows configuration of default headers, withCredentials as well as request and response transformations. - */ - defaults: IHttpProviderDefaults; - - /** - * Array of config objects for currently pending requests. This is primarily meant to be used for debugging purposes. - */ - pendingRequests: IRequestConfig[]; - } - - /** - * Object describing the request to be made and how it should be processed. - * see http://docs.angularjs.org/api/ng/service/$http#usage - */ - interface IRequestShortcutConfig extends IHttpProviderDefaults { - /** - * {Object.} - * Map of strings or objects which will be turned to ?key1=value1&key2=value2 after the url. If the value is not a string, it will be JSONified. - */ - params?: any; - - /** - * {string|Object} - * Data to be sent as the request message data. - */ - data?: any; - - /** - * Timeout in milliseconds, or promise that should abort the request when resolved. - */ - timeout?: number|IPromise; - - /** - * See [XMLHttpRequest.responseType]https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest#xmlhttprequest-responsetype - */ - responseType?: string; - } - - /** - * Object describing the request to be made and how it should be processed. - * see http://docs.angularjs.org/api/ng/service/$http#usage - */ - interface IRequestConfig extends IRequestShortcutConfig { - /** - * HTTP method (e.g. 'GET', 'POST', etc) - */ - method: string; - /** - * Absolute or relative URL of the resource that is being requested. - */ - url: string; - /** - * Event listeners to be bound to the XMLHttpRequest object. - * To bind events to the XMLHttpRequest upload object, use uploadEventHandlers. The handler will be called in the context of a $apply block. - */ - eventHandlers?: { [type: string]: EventListenerOrEventListenerObject }; - /** - * Event listeners to be bound to the XMLHttpRequest upload object. - * To bind events to the XMLHttpRequest object, use eventHandlers. The handler will be called in the context of a $apply block. - */ - uploadEventHandlers?: { [type: string]: EventListenerOrEventListenerObject }; - } - - interface IHttpHeadersGetter { - (): { [name: string]: string; }; - (headerName: string): string; - } - - interface IHttpPromiseCallback { - (data: T, status: number, headers: IHttpHeadersGetter, config: IRequestConfig): void; - } - - interface IHttpPromiseCallbackArg { - data?: T; - status?: number; - headers?: IHttpHeadersGetter; - config?: IRequestConfig; - statusText?: string; - } - - interface IHttpPromise extends IPromise> { - } - - // See the jsdoc for transformData() at https://github.com/angular/angular.js/blob/master/src/ng/http.js#L228 - interface IHttpRequestTransformer { - (data: any, headersGetter: IHttpHeadersGetter): any; - } - - // The definition of fields are the same as IHttpPromiseCallbackArg - interface IHttpResponseTransformer { - (data: any, headersGetter: IHttpHeadersGetter, status: number): any; - } - - interface HttpHeaderType { - [requestType: string]: string|((config: IRequestConfig) => string); - } - - interface IHttpRequestConfigHeaders { - [requestType: string]: any; - common?: any; - get?: any; - post?: any; - put?: any; - patch?: any; - } - - /** - * Object that controls the defaults for $http provider. Not all fields of IRequestShortcutConfig can be configured - * via defaults and the docs do not say which. The following is based on the inspection of the source code. - * https://docs.angularjs.org/api/ng/service/$http#defaults - * https://docs.angularjs.org/api/ng/service/$http#usage - * https://docs.angularjs.org/api/ng/provider/$httpProvider The properties section - */ - interface IHttpProviderDefaults { - /** - * {boolean|Cache} - * If true, a default $http cache will be used to cache the GET request, otherwise if a cache instance built with $cacheFactory, this cache will be used for caching. - */ - cache?: any; - - /** - * Transform function or an array of such functions. The transform function takes the http request body and - * headers and returns its transformed (typically serialized) version. - * @see {@link https://docs.angularjs.org/api/ng/service/$http#transforming-requests-and-responses} - */ - transformRequest?: IHttpRequestTransformer |IHttpRequestTransformer[]; - - /** - * Transform function or an array of such functions. The transform function takes the http response body and - * headers and returns its transformed (typically deserialized) version. - */ - transformResponse?: IHttpResponseTransformer | IHttpResponseTransformer[]; - - /** - * Map of strings or functions which return strings representing HTTP headers to send to the server. If the - * return value of a function is null, the header will not be sent. - * The key of the map is the request verb in lower case. The "common" key applies to all requests. - * @see {@link https://docs.angularjs.org/api/ng/service/$http#setting-http-headers} - */ - headers?: IHttpRequestConfigHeaders; - - /** Name of HTTP header to populate with the XSRF token. */ - xsrfHeaderName?: string; - - /** Name of cookie containing the XSRF token. */ - xsrfCookieName?: string; - - /** - * whether to to set the withCredentials flag on the XHR object. See [requests with credentials]https://developer.mozilla.org/en/http_access_control#section_5 for more information. - */ - withCredentials?: boolean; - - /** - * A function used to the prepare string representation of request parameters (specified as an object). If - * specified as string, it is interpreted as a function registered with the $injector. Defaults to - * $httpParamSerializer. - */ - paramSerializer?: string | ((obj: any) => string); - } - - interface IHttpInterceptor { - request?: (config: IRequestConfig) => IRequestConfig|IPromise; - requestError?: (rejection: any) => any; - response?: (response: IHttpPromiseCallbackArg) => IPromise>|IHttpPromiseCallbackArg; - responseError?: (rejection: any) => any; - } - - interface IHttpInterceptorFactory { - (...args: any[]): IHttpInterceptor; - } - - interface IHttpProvider extends IServiceProvider { - defaults: IHttpProviderDefaults; - - /** - * Register service factories (names or implementations) for interceptors which are called before and after - * each request. - */ - interceptors: Array>; - useApplyAsync(): boolean; - useApplyAsync(value: boolean): IHttpProvider; - - /** - * - * @param {boolean=} value If true, `$http` will return a normal promise without the `success` and `error` methods. - * @returns {boolean|Object} If a value is specified, returns the $httpProvider for chaining. - * otherwise, returns the current configured value. - */ - useLegacyPromiseExtensions(value: boolean): boolean | IHttpProvider; - } - - /////////////////////////////////////////////////////////////////////////// - // HttpBackendService - // see http://docs.angularjs.org/api/ng.$httpBackend - // You should never need to use this service directly. - /////////////////////////////////////////////////////////////////////////// - interface IHttpBackendService { - // XXX Perhaps define callback signature in the future - (method: string, url: string, post?: any, callback?: Function, headers?: any, timeout?: number, withCredentials?: boolean): void; - } - - /////////////////////////////////////////////////////////////////////////// - // InterpolateService - // see http://docs.angularjs.org/api/ng.$interpolate - // see http://docs.angularjs.org/api/ng.$interpolateProvider - /////////////////////////////////////////////////////////////////////////// - interface IInterpolateService { - (text: string, mustHaveExpression?: boolean, trustedContext?: string, allOrNothing?: boolean): IInterpolationFunction; - endSymbol(): string; - startSymbol(): string; - } - - interface IInterpolationFunction { - (context: any): string; - } - - interface IInterpolateProvider extends IServiceProvider { - startSymbol(): string; - startSymbol(value: string): IInterpolateProvider; - endSymbol(): string; - endSymbol(value: string): IInterpolateProvider; - } - - /////////////////////////////////////////////////////////////////////////// - // TemplateCacheService - // see http://docs.angularjs.org/api/ng.$templateCache - /////////////////////////////////////////////////////////////////////////// - interface ITemplateCacheService extends ICacheObject {} - - /////////////////////////////////////////////////////////////////////////// - // SCEService - // see http://docs.angularjs.org/api/ng.$sce - /////////////////////////////////////////////////////////////////////////// - interface ISCEService { - getTrusted(type: string, mayBeTrusted: any): any; - getTrustedCss(value: any): any; - getTrustedHtml(value: any): any; - getTrustedJs(value: any): any; - getTrustedResourceUrl(value: any): any; - getTrustedUrl(value: any): any; - parse(type: string, expression: string): (context: any, locals: any) => any; - parseAsCss(expression: string): (context: any, locals: any) => any; - parseAsHtml(expression: string): (context: any, locals: any) => any; - parseAsJs(expression: string): (context: any, locals: any) => any; - parseAsResourceUrl(expression: string): (context: any, locals: any) => any; - parseAsUrl(expression: string): (context: any, locals: any) => any; - trustAs(type: string, value: any): any; - trustAsHtml(value: any): any; - trustAsJs(value: any): any; - trustAsResourceUrl(value: any): any; - trustAsUrl(value: any): any; - isEnabled(): boolean; - } - - /////////////////////////////////////////////////////////////////////////// - // SCEProvider - // see http://docs.angularjs.org/api/ng.$sceProvider - /////////////////////////////////////////////////////////////////////////// - interface ISCEProvider extends IServiceProvider { - enabled(value: boolean): void; - } - - /////////////////////////////////////////////////////////////////////////// - // SCEDelegateService - // see http://docs.angularjs.org/api/ng.$sceDelegate - /////////////////////////////////////////////////////////////////////////// - interface ISCEDelegateService { - getTrusted(type: string, mayBeTrusted: any): any; - trustAs(type: string, value: any): any; - valueOf(value: any): any; - } - - /////////////////////////////////////////////////////////////////////////// - // SCEDelegateProvider - // see http://docs.angularjs.org/api/ng.$sceDelegateProvider - /////////////////////////////////////////////////////////////////////////// - interface ISCEDelegateProvider extends IServiceProvider { - resourceUrlBlacklist(): any[]; - resourceUrlBlacklist(blacklist: any[]): void; - resourceUrlWhitelist(): any[]; - resourceUrlWhitelist(whitelist: any[]): void; - } - - /** - * $templateRequest service - * see http://docs.angularjs.org/api/ng/service/$templateRequest - */ - interface ITemplateRequestService { - /** - * Downloads a template using $http and, upon success, stores the - * contents inside of $templateCache. - * - * If the HTTP request fails or the response data of the HTTP request is - * empty then a $compile error will be thrown (unless - * {ignoreRequestError} is set to true). - * - * @param tpl The template URL. - * @param ignoreRequestError Whether or not to ignore the exception - * when the request fails or the template is - * empty. - * - * @return A promise whose value is the template content. - */ - (tpl: string, ignoreRequestError?: boolean): IPromise; - /** - * total amount of pending template requests being downloaded. - * @type {number} - */ - 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/ - /////////////////////////////////////////////////////////////////////////// - /** - * 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. - * Use the array form to define dependencies (necessary if strictDi is enabled and you require dependency injection) - */ - controller?: string | Injectable; - /** - * An identifier name for a reference to the controller. If present, the controller will be published to its scope under - * the specified name. If not present, this will default to '$ctrl'. - */ - 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 - * Use the array form to define dependencies (necessary if strictDi is enabled and you require dependency injection) - */ - template?: string | Injectable<(...args: any[]) => string>; - /** - * 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 - * Use the array form to define dependencies (necessary if strictDi is enabled and you require dependency injection) - */ - templateUrl?: string | Injectable<(...args: any[]) => string>; - /** - * Define DOM attribute binding to component properties. Component properties are always bound to the component - * controller and not to the scope. - */ - bindings?: {[boundProperty: string]: string}; - /** - * Whether transclusion is enabled. Disabled by default. - */ - transclude?: boolean | {[slot: string]: string}; - /** - * Requires the controllers of other directives and binds them to this component's controller. - * The object keys specify the property names under which the required controllers (object values) will be bound. - * Note that the required controllers will not be available during the instantiation of the controller, - * but they are guaranteed to be available just before the $onInit method is executed! - */ - require?: {[controller: string]: string}; - } - - type IControllerConstructor = - (new (...args: any[]) => IController) | - // Instead of classes, plain functions are often used as controller constructors, especially in examples. - ((...args: any[]) => (void | IController)); - - /** - * Directive controllers have a well-defined lifecycle. Each controller can implement "lifecycle hooks". These are methods that - * will be called by Angular at certain points in the life cycle of the directive. - * https://docs.angularjs.org/api/ng/service/$compile#life-cycle-hooks - * https://docs.angularjs.org/guide/component - */ - interface IController { - /** - * Called on each controller after all the controllers on an element have been constructed and had their bindings - * initialized (and before the pre & post linking functions for the directives on this element). This is a good - * place to put initialization code for your controller. - */ - $onInit?(): void; - /** - * Called on each turn of the digest cycle. Provides an opportunity to detect and act on changes. - * Any actions that you wish to take in response to the changes that you detect must be invoked from this hook; - * implementing this has no effect on when `$onChanges` is called. For example, this hook could be useful if you wish - * to perform a deep equality check, or to check a `Dat`e object, changes to which would not be detected by Angular's - * change detector and thus not trigger `$onChanges`. This hook is invoked with no arguments; if detecting changes, - * you must store the previous value(s) for comparison to the current values. - */ - $doCheck?(): void; - /** - * Called whenever one-way bindings are updated. The onChangesObj is a hash whose keys are the names of the bound - * properties that have changed, and the values are an {@link IChangesObject} object of the form - * { currentValue, previousValue, isFirstChange() }. Use this hook to trigger updates within a component such as - * cloning the bound value to prevent accidental mutation of the outer value. - */ - $onChanges?(onChangesObj: IOnChangesObject): void; - /** - * Called on a controller when its containing scope is destroyed. Use this hook for releasing external resources, - * watches and event handlers. - */ - $onDestroy?(): void; - /** - * Called after this controller's element and its children have been linked. Similar to the post-link function this - * hook can be used to set up DOM event handlers and do direct DOM manipulation. Note that child elements that contain - * templateUrl directives will not have been compiled and linked since they are waiting for their template to load - * asynchronously and their own compilation and linking has been suspended until that occurs. This hook can be considered - * analogous to the ngAfterViewInit and ngAfterContentInit hooks in Angular 2. Since the compilation process is rather - * different in Angular 1 there is no direct mapping and care should be taken when upgrading. - */ - $postLink?(): void; - } - - interface IOnChangesObject { - [property: string]: IChangesObject; - } - - interface IChangesObject { - currentValue: T; - previousValue: T; - isFirstChange(): boolean; - } - - /////////////////////////////////////////////////////////////////////////// - // Directive - // see http://docs.angularjs.org/api/ng.$compileProvider#directive - // and http://docs.angularjs.org/guide/directive - /////////////////////////////////////////////////////////////////////////// - - interface IDirectiveFactory { - (...args: any[]): IDirective | IDirectiveLinkFn; - } - - interface IDirectiveLinkFn { - ( - scope: IScope, - instanceElement: JQuery, - instanceAttributes: IAttributes, - controller?: IController | IController[] | {[key: string]: IController}, - transclude?: ITranscludeFunction - ): void; - } - - interface IDirectivePrePost { - pre?: IDirectiveLinkFn; - post?: IDirectiveLinkFn; - } - - interface IDirectiveCompileFn { - ( - templateElement: JQuery, - templateAttributes: IAttributes, - /** - * @deprecated - * Note: The transclude function that is passed to the compile function is deprecated, - * as it e.g. does not know about the right outer scope. Please use the transclude function - * that is passed to the link function instead. - */ - transclude: ITranscludeFunction - ): void | IDirectiveLinkFn | IDirectivePrePost; - } - - interface IDirective { - compile?: IDirectiveCompileFn; - controller?: string | Injectable; - controllerAs?: string; - /** - * Deprecation warning: although bindings for non-ES6 class controllers are currently bound to this before - * the controller constructor is called, this use is now deprecated. Please place initialization code that - * relies upon bindings inside a $onInit method on the controller, instead. - */ - bindToController?: boolean | {[boundProperty: string]: string}; - link?: IDirectiveLinkFn | IDirectivePrePost; - multiElement?: boolean; - priority?: number; - /** - * @deprecated - */ - replace?: boolean; - require?: string | string[] | {[controller: string]: string}; - restrict?: string; - scope?: boolean | {[boundProperty: string]: string}; - template?: string | ((tElement: JQuery, tAttrs: IAttributes) => string); - templateNamespace?: string; - templateUrl?: string | ((tElement: JQuery, tAttrs: IAttributes) => string); - terminal?: boolean; - transclude?: boolean | 'element' | {[slot: string]: string}; - } - - /** - * These interfaces are kept for compatibility with older versions of these type definitions. - * Actually, Angular doesn't create a special subclass of jQuery objects. It extends jQuery.prototype - * like jQuery plugins do, that's why all jQuery objects have these Angular-specific methods, not - * only those returned from angular.element. - * See: http://docs.angularjs.org/api/angular.element - */ - interface IAugmentedJQueryStatic extends JQueryStatic {} - interface IAugmentedJQuery extends JQuery {} - - /** - * Same as IController. Keeping it for compatibility with older versions of these type definitions. - */ - interface IComponentController extends IController {} - - /////////////////////////////////////////////////////////////////////////// - // AUTO module (angular.js) - /////////////////////////////////////////////////////////////////////////// - export namespace auto { - - /////////////////////////////////////////////////////////////////////// - // InjectorService - // see http://docs.angularjs.org/api/AUTO.$injector - /////////////////////////////////////////////////////////////////////// - interface IInjectorService { - annotate(fn: Function, strictDi?: boolean): string[]; - annotate(inlineAnnotatedFunction: any[]): string[]; - get(name: string, caller?: string): T; - get(name: '$anchorScroll'): IAnchorScrollService; - get(name: '$cacheFactory'): ICacheFactoryService; - get(name: '$compile'): ICompileService; - get(name: '$controller'): IControllerService; - get(name: '$document'): IDocumentService; - get(name: '$exceptionHandler'): IExceptionHandlerService; - get(name: '$filter'): IFilterService; - get(name: '$http'): IHttpService; - get(name: '$httpBackend'): IHttpBackendService; - get(name: '$httpParamSerializer'): IHttpParamSerializer; - get(name: '$httpParamSerializerJQLike'): IHttpParamSerializer; - get(name: '$interpolate'): IInterpolateService; - get(name: '$interval'): IIntervalService; - get(name: '$locale'): ILocaleService; - get(name: '$location'): ILocationService; - get(name: '$log'): ILogService; - get(name: '$parse'): IParseService; - get(name: '$q'): IQService; - get(name: '$rootElement'): IRootElementService; - get(name: '$rootScope'): IRootScopeService; - get(name: '$sce'): ISCEService; - get(name: '$sceDelegate'): ISCEDelegateService; - get(name: '$templateCache'): ITemplateCacheService; - get(name: '$templateRequest'): ITemplateRequestService; - get(name: '$timeout'): ITimeoutService; - get(name: '$window'): IWindowService; - get(name: '$xhrFactory'): IXhrFactory; - has(name: string): boolean; - instantiate(typeConstructor: Function, locals?: any): T; - invoke(inlineAnnotatedFunction: any[]): any; - invoke(func: Function, context?: any, locals?: any): any; - strictDi: boolean; - } - - /////////////////////////////////////////////////////////////////////// - // ProvideService - // see http://docs.angularjs.org/api/AUTO.$provide - /////////////////////////////////////////////////////////////////////// - interface IProvideService { - // Documentation says it returns the registered instance, but actual - // implementation does not return anything. - // constant(name: string, value: any): any; - /** - * Register a constant service, such as a string, a number, an array, an object or a function, with the $injector. Unlike value it can be injected into a module configuration function (see config) and it cannot be overridden by an Angular decorator. - * - * @param name The name of the constant. - * @param value The constant value. - */ - constant(name: string, value: any): void; - - /** - * Register a service decorator with the $injector. A service decorator intercepts the creation of a service, allowing it to override or modify the behaviour of the service. The object returned by the decorator may be the original service, or a new service object which replaces or wraps and delegates to the original service. - * - * @param name The name of the service to decorate. - * @param decorator This function will be invoked when the service needs to be instantiated and should return the decorated service instance. The function is called using the injector.invoke method and is therefore fully injectable. Local injection arguments: - * - * $delegate - The original service instance, which can be monkey patched, configured, decorated or delegated to. - */ - decorator(name: string, decorator: Function): void; - /** - * Register a service decorator with the $injector. A service decorator intercepts the creation of a service, allowing it to override or modify the behaviour of the service. The object returned by the decorator may be the original service, or a new service object which replaces or wraps and delegates to the original service. - * - * @param name The name of the service to decorate. - * @param inlineAnnotatedFunction This function will be invoked when the service needs to be instantiated and should return the decorated service instance. The function is called using the injector.invoke method and is therefore fully injectable. Local injection arguments: - * - * $delegate - The original service instance, which can be monkey patched, configured, decorated or delegated to. - */ - decorator(name: string, inlineAnnotatedFunction: any[]): void; - factory(name: string, serviceFactoryFunction: Function): IServiceProvider; - factory(name: string, inlineAnnotatedFunction: any[]): IServiceProvider; - provider(name: string, provider: IServiceProvider): IServiceProvider; - provider(name: string, serviceProviderConstructor: Function): IServiceProvider; - service(name: string, constructor: Function): IServiceProvider; - service(name: string, inlineAnnotatedFunction: any[]): IServiceProvider; - value(name: string, value: any): IServiceProvider; - } - - } - - /** - * $http params serializer that converts objects to strings - * see https://docs.angularjs.org/api/ng/service/$httpParamSerializer - */ - interface IHttpParamSerializer { - (obj: Object): string; - } -} - -declare global { - interface JQuery { - // TODO: events, how to define? - // $destroy - - find(element: any): JQuery; - find(obj: JQuery): JQuery; - controller(name?: string): any; - injector(): ng.auto.IInjectorService; - /** It's declared generic for custom scope interfaces */ - scope(): T; - isolateScope(): T; - - inheritedData(key: string, value: any): JQuery; - inheritedData(obj: { [key: string]: any; }): JQuery; - inheritedData(key?: string): any; - } -} diff --git a/angular/tslint.json b/angular/tslint.json deleted file mode 100644 index 7ba374959e..0000000000 --- a/angular/tslint.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "extends": "../tslint.json", - "rules": { - "class-name": true, - "curly": true, - "max-line-length": false, - "no-consecutive-blank-lines": true, - "no-shadowed-variable": true, - "quotemark": [ - true, - "single" - ], - "align": true, - "callable-types": false, - "forbidden-types": false, - "indent": [ - true, - "spaces" - ], - "interface-name": false, - "linebreak-style": [ - true, - "LF" - ], - "no-empty-interface": false, - "unified-signatures": false, - "variable-name": [ - true, - "check-format" - ], - "void-return": false - } -} diff --git a/animation-frame/animation-frame-tests.ts b/animation-frame/animation-frame-tests.ts deleted file mode 100644 index 2e0486f6ab..0000000000 --- a/animation-frame/animation-frame-tests.ts +++ /dev/null @@ -1,8 +0,0 @@ -namespace AnimationFrameTests { - var animation = new AnimationFrame(); - function frame() { - animation.request(frame); - } - - animation.request(frame); -} diff --git a/anydb-sql-migrations/index.d.ts b/anydb-sql-migrations/index.d.ts deleted file mode 100644 index a72271ebb5..0000000000 --- a/anydb-sql-migrations/index.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -// Type definitions for anydb-sql-migrations -// Project: https://github.com/spion/anydb-sql-migrations -// Definitions by: Gorgi Kosev -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -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 declare function create(db: AnydbSql, tasks: any): { - run: () => Promise; - migrateTo: (target?: string) => Promise; - check: (f: (m: { - type: string; - items: MigrationTask[]; - }) => any) => Promise; -}; diff --git a/anydb-sql/anydb-sql-tests.ts b/anydb-sql/anydb-sql-tests.ts deleted file mode 100644 index 745431d857..0000000000 --- a/anydb-sql/anydb-sql-tests.ts +++ /dev/null @@ -1,70 +0,0 @@ - -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/index.d.ts b/anydb-sql/index.d.ts deleted file mode 100644 index 367ade6ff9..0000000000 --- a/anydb-sql/index.d.ts +++ /dev/null @@ -1,193 +0,0 @@ -// Type definitions for anydb-sql -// Project: https://github.com/doxout/anydb-sql -// Definitions by: Gorgi Kosev -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - - -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; } - -declare namespace 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; - } -} - -declare function anydbSQL(config: Object): anydbSQL.AnydbSql; - -export = anydbSQL; diff --git a/anydb-sql/tsconfig.json b/anydb-sql/tsconfig.json deleted file mode 100644 index 92f2bff729..0000000000 --- a/anydb-sql/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "anydb-sql-tests.ts" - ] -} \ No newline at end of file diff --git a/apex.js/tslint.json b/apex.js/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/apex.js/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/applicationinsights-js/applicationinsights-js-tests.ts b/applicationinsights-js/applicationinsights-js-tests.ts deleted file mode 100644 index 06a7d06bc5..0000000000 --- a/applicationinsights-js/applicationinsights-js-tests.ts +++ /dev/null @@ -1,163 +0,0 @@ -// More samples on: https://github.com/Microsoft/ApplicationInsights-JS/blob/master/API-reference.md - -var config: Microsoft.ApplicationInsights.IConfig = { - instrumentationKey: "", - endpointUrl: "endpointUrl", - emitLineDelimitedJson: false, - accountId: "accountId", - sessionRenewalMs: 30, - sessionExpirationMs: 24 * 60 * 60 * 1000, - maxBatchSizeInBytes: 100 * 1024, - maxBatchInterval: 15, - enableDebug: false, - disableTelemetry: false, - verboseLogging: false, - diagnosticLogInterval: 10, - samplingPercentage: 100, - autoTrackPageVisitTime: true, - disableExceptionTracking: false, - disableAjaxTracking: false, - overridePageViewDuration: false, - maxAjaxCallsPerView: -1, - disableDataLossAnalysis: true, - disableCorrelationHeaders: true, - disableFlushOnBeforeUnload: false, - enableSessionStorageBuffer: false, - cookieDomain: "", - isCookieUseDisabled: true, - isRetryDisabled: true, - isPerfAnalyzerEnabled: true, - isStorageUseDisabled: true -}; - -var appInsights: Microsoft.ApplicationInsights.IAppInsights = { - config: config, - context: null, - queue: null, - - startTrackPage(name?: string) { return null; }, - stopTrackPage(name?: string, url?: string, properties?: { [name: string]: string; }, measurements?: { [name: string]: number; }) { return null; }, - trackPageView(name?: string, url?: string, properties?: { [name: string]: string; }, measurements?: { [name: string]: number; }, duration?: number) { return null; }, - startTrackEvent(name: string) { return null; }, - stopTrackEvent(name: string, properties?: { [name: string]: string; }, measurements?: { [name: string]: number; }) { return null; }, - trackEvent(name: string, properties?: { [name: string]: string; }, measurements?: { [name: string]: number; }) { return null; }, - trackDependency(id: string, method: string, absoluteUrl: string, pathName: string, totalTime: number, success: boolean, resultCode: number) { return null; }, - trackException(exception: Error, handledAt?: string, properties?: { [name: string]: string; }, measurements?: { [name: string]: number; }, severityLevel?: AI.SeverityLevel) { return null; }, - trackMetric(name: string, average: number, sampleCount?: number, min?: number, max?: number, properties?: { [name: string]: string; }) { return null; }, - trackTrace(message: string, properties?: { [name: string]: string; }) { return null; }, - flush() { return null; }, - setAuthenticatedUserContext(authenticatedUserId: string, accountId?: string) { return null; }, - clearAuthenticatedUserContext() { return null; }, - _onerror(message: string, url: string, lineNumber: number, columnNumber: number, error: Error) { return null; } -}; - -// trackPageView -appInsights.trackPageView("page1"); -appInsights.trackPageView("page2", "http://example.com", null, null, 1000); - -// startTrackPage -appInsights.startTrackPage("page"); - -// stopTrackPage -appInsights.stopTrackPage("page"); -appInsights.stopTrackPage("page", "http://example.com", null, null); - -// trackEvent -appInsights.trackEvent("page1"); -appInsights.trackEvent("page1", null, null); - -// trackMetric -appInsights.trackMetric("page1", 999); -appInsights.trackMetric("page1", 999, 1, 1, 2, null); - -// trackException -appInsights.trackException(new Error("sample error")); -appInsights.trackException(new Error("sample error"), "handledAt", null, null); - -// trackTrace -appInsights.trackTrace("message"); -appInsights.trackTrace("message", null); - -// trackDependency -appInsights.trackDependency("id", "POST", "http://example.com/test/abc", "/test/abc", null, true, null); - -// flush -appInsights.flush(); - -// setAuthenticatedUserContext -appInsights.setAuthenticatedUserContext("userId"); -appInsights.setAuthenticatedUserContext("userId", "accountId"); - -// set config dynamically -appInsights.config.instrumentationKey = ""; - - -// TelementryContext -var context: Microsoft.ApplicationInsights.ITelemetryContext = appInsights.context; - -context.application.ver = "v0.0.0"; -context.application.build = "1.1.1"; - -context.device.type = "sampleDevice"; -context.device.locale = "en-US"; - -context.user.id = "userId"; -context.user.authenticatedId = "authId"; - -context.session.id = "sessionId"; -context.session.isFirst = true; - -context.location.ip = "127.0.0.1"; - -context.operation.id = "1"; -context.operation.syntheticSource = "testAgent"; - -// track -var data = new Microsoft.Telemetry.Base(); -var envelope = new Microsoft.ApplicationInsights.Telemetry.Common.Envelope(data, "name"); - -context.track(envelope); - -context.addTelemetryInitializer((envelope) => false); - -// track event -var eventObj = new Microsoft.ApplicationInsights.Telemetry.Event("test", null, null); -var eventData = new Microsoft.ApplicationInsights.Telemetry.Common.Data(Microsoft.ApplicationInsights.Telemetry.Event.dataType, eventObj); -var eventEnvelope = new Microsoft.ApplicationInsights.Telemetry.Common.Envelope(eventData, Microsoft.ApplicationInsights.Telemetry.Event.envelopeType); -context.track(eventEnvelope); - -// track exception -var exceptionObj = new Microsoft.ApplicationInsights.Telemetry.Exception(new Error(), "handledAt", null, null, AI.SeverityLevel.Critical); -var exceptionData = new Microsoft.ApplicationInsights.Telemetry.Common.Data(Microsoft.ApplicationInsights.Telemetry.Exception.dataType, exceptionObj); -var exceptionEnvelope = new Microsoft.ApplicationInsights.Telemetry.Common.Envelope(exceptionData, Microsoft.ApplicationInsights.Telemetry.Exception.envelopeType); -context.track(exceptionEnvelope); - -// track metric -var metricObj = new Microsoft.ApplicationInsights.Telemetry.Metric("name", 1234, 1, 0, 100, null); -var metricData = new Microsoft.ApplicationInsights.Telemetry.Common.Data(Microsoft.ApplicationInsights.Telemetry.Metric.dataType, metricObj); -var metricEnvelope = new Microsoft.ApplicationInsights.Telemetry.Common.Envelope(metricData, Microsoft.ApplicationInsights.Telemetry.Metric.envelopeType); -context.track(metricEnvelope); - -// track page view -var pageViewObj = new Microsoft.ApplicationInsights.Telemetry.PageView("page name", "url", 999, null, null); -var pageViewData = new Microsoft.ApplicationInsights.Telemetry.Common.Data(Microsoft.ApplicationInsights.Telemetry.PageView.dataType, pageViewObj); -var pageViewEnvelope = new Microsoft.ApplicationInsights.Telemetry.Common.Envelope(pageViewData, Microsoft.ApplicationInsights.Telemetry.PageView.envelopeType); -context.track(pageViewEnvelope); - -// track page view performance -var pageViewPerfObj = new Microsoft.ApplicationInsights.Telemetry.PageViewPerformance("page name", "url", 999, null, null); -var pageViewPerfData = new Microsoft.ApplicationInsights.Telemetry.Common.Data(Microsoft.ApplicationInsights.Telemetry.PageViewPerformance.dataType, pageViewPerfObj); -var pageViewPerfEnvelope = new Microsoft.ApplicationInsights.Telemetry.Common.Envelope(pageViewPerfData, Microsoft.ApplicationInsights.Telemetry.PageViewPerformance.envelopeType); -context.track(pageViewPerfEnvelope); - -// track remote dependency -var remoteDepObj = new Microsoft.ApplicationInsights.Telemetry.RemoteDependencyData("id", "url", "command", 1, true, 1234, "GET"); -var remoteDepData = new Microsoft.ApplicationInsights.Telemetry.Common.Data(Microsoft.ApplicationInsights.Telemetry.RemoteDependencyData.dataType, remoteDepObj); -var remoteDepEnvelope = new Microsoft.ApplicationInsights.Telemetry.Common.Envelope(remoteDepData, Microsoft.ApplicationInsights.Telemetry.RemoteDependencyData.envelopeType); -context.track(pageViewPerfEnvelope); - -// track trace -var traceObj = new Microsoft.ApplicationInsights.Telemetry.Trace("message", null); -var traceData = new Microsoft.ApplicationInsights.Telemetry.Common.Data(Microsoft.ApplicationInsights.Telemetry.Trace.dataType, traceObj); -var traceEnvelope = new Microsoft.ApplicationInsights.Telemetry.Common.Envelope(traceData, Microsoft.ApplicationInsights.Telemetry.Trace.envelopeType); -context.track(traceEnvelope); \ No newline at end of file diff --git a/applicationinsights-js/index.d.ts b/applicationinsights-js/index.d.ts deleted file mode 100644 index c032919618..0000000000 --- a/applicationinsights-js/index.d.ts +++ /dev/null @@ -1,800 +0,0 @@ -// Type definitions for ApplicationInsights-JS 1.0 -// Project: https://github.com/Microsoft/ApplicationInsights-JS -// Definitions by: Kamil Szostak -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare module AI { - enum SeverityLevel { - Verbose = 0, - Information = 1, - Warning = 2, - Error = 3, - Critical = 4, - } - - enum DependencyKind { - SQL = 0, - Http = 1, - Other = 2, - } - - enum DependencySourceType { - Undefined = 0, - Aic = 1, - Apmc = 2, - } - - class StackFrame { - level: number; - method: string; - assembly: string; - fileName: string; - line: number; - constructor(); - } - - class ExceptionDetails { - id: number; - outerId: number; - typeName: string; - message: string; - hasFullStack: boolean; - stack: string; - parsedStack: StackFrame[]; - constructor(); - } - - enum DataPointType { - Measurement = 0, - Aggregation = 1, - } - - class DataPoint { - name: string; - kind: AI.DataPointType; - value: number; - count: number; - min: number; - max: number; - stdDev: number; - constructor(); - } - - class EventData extends Microsoft.Telemetry.Domain { - ver: number; - name: string; - properties: any; - measurements: any; - constructor(); - } - - class PageViewData extends AI.EventData { - ver: number; - url: string; - name: string; - duration: string; - referrer: string; - referrerData: string; - properties: any; - measurements: any; - constructor(); - } - - class PageViewPerfData extends AI.PageViewData { - ver: number; - url: string; - perfTotal: string; - name: string; - duration: string; - networkConnect: string; - referrer: string; - sentRequest: string; - referrerData: string; - receivedResponse: string; - domProcessing: string; - properties: any; - measurements: any; - constructor(); - } - - class RemoteDependencyData extends Microsoft.Telemetry.Domain { - ver: number; - name: string; - id: string; - resultCode: string; - kind: AI.DataPointType; - value: number; - count: number; - min: number; - max: number; - stdDev: number; - dependencyKind: AI.DependencyKind; - success: boolean; - async: boolean; - dependencySource: AI.DependencySourceType; - commandName: string; - dependencyTypeName: string; - properties: any; - constructor(); - } - - class MessageData extends Microsoft.Telemetry.Domain { - ver: number; - message: string; - severityLevel: AI.SeverityLevel; - properties: any; - constructor(); - } -} - -declare module Microsoft.ApplicationInsights.Context { - interface IApplication { - /** - * The application version. - */ - ver: string; - /** - * The application build version. - */ - build: string; - } - - interface IDevice { - /** - * The type for the current device. - */ - type: string; - /** - * A device unique ID. - */ - id: string; - /** - * The device OEM for the current device. - */ - oemName: string; - /** - * The device model for the current device. - */ - model: string; - /** - * The IANA interface type for the internet connected network adapter. - */ - network: number; - /** - * The application screen resolution. - */ - resolution: string; - /** - * The current display language of the operating system. - */ - locale: string; - /** - * The IP address. - */ - ip: string; - /** - * The device language. - */ - language: string; - /** - * The OS name. - */ - os: string; - /** - * The OS version. - */ - osversion: string; - } - - interface ILocation { - /** - * Client IP address for reverse lookup - */ - ip: string; - } - - interface IInternal { - /** - * The SDK version used to create this telemetry item. - */ - sdkVersion: string; - /** - * The SDK agent version. - */ - agentVersion: string; - } - - interface ISample { - /** - * Sample rate - */ - sampleRate: number; - } - - interface ISession { - /** - * The session ID. - */ - id: string; - /** - * The true if this is the first session - */ - isFirst: boolean; - /** - * The date at which this guid was genereated. - * Per the spec the ID will be regenerated if more than acquisitionSpan milliseconds ellapse from this time. - */ - acquisitionDate: number; - /** - * The date at which this session ID was last reported. - * This value should be updated whenever telemetry is sent using this ID. - * Per the spec the ID will be regenerated if more than renewalSpan milliseconds elapse from this time with no activity. - */ - renewalDate: number; - } - - interface IOperation { - /** - * Operation id - */ - id: string; - /** - * Operation name - */ - name: string; - /** - * Parent operation id - */ - parentId: string; - /** - * Root operation id - */ - rootId: string; - /** - * Synthetic source of the operation - */ - syntheticSource: string; - } - - interface IUser { - /** - * The telemetry configuration. - */ - config: any; - /** - * The user ID. - */ - id: string; - /** - * Authenticated user id - */ - authenticatedId: string; - /** - * The account ID. - */ - accountId: string; - /** - * The account acquisition date. - */ - accountAcquisitionDate: string; - /** - * The user agent string. - */ - agent: string; - /** - * The store region. - */ - storeRegion: string; - } -} - -declare module Microsoft.Telemetry { - class Domain { - constructor(); - } - - class Base { - baseType: string; - constructor(); - } - - class Data extends Microsoft.Telemetry.Base { - baseType: string; - baseData: TDomain; - constructor(); - } -} - -declare module Microsoft.ApplicationInsights.Telemetry { - - class Event implements Microsoft.ApplicationInsights.ISerializable { - static envelopeType: string; - static dataType: string; - ver: number; - name: string; - properties: any; - measurements: any; - aiDataContract: { - ver: Microsoft.ApplicationInsights.FieldType; - name: Microsoft.ApplicationInsights.FieldType; - properties: Microsoft.ApplicationInsights.FieldType; - measurements: Microsoft.ApplicationInsights.FieldType; - }; - /** - * Constructs a new instance of the EventTelemetry object - */ - constructor(name: string, properties?: any, measurements?: any); - } - - class Exception implements Microsoft.ApplicationInsights.ISerializable { - static envelopeType: string; - static dataType: string; - ver: number; - handledAt: string; - exceptions: AI.ExceptionDetails[]; - severityLevel: AI.SeverityLevel; - problemId: string; - crashThreadId: number; - properties: any; - measurements: any; - aiDataContract: { - ver: Microsoft.ApplicationInsights.FieldType; - handledAt: Microsoft.ApplicationInsights.FieldType; - exceptions: Microsoft.ApplicationInsights.FieldType; - severityLevel: Microsoft.ApplicationInsights.FieldType; - properties: Microsoft.ApplicationInsights.FieldType; - measurements: Microsoft.ApplicationInsights.FieldType; - }; - /** - * Constructs a new isntance of the ExceptionTelemetry object - */ - constructor(exception: Error, handledAt?: string, properties?: any, measurements?: any, severityLevel?: AI.SeverityLevel); - /** - * Creates a simple exception with 1 stack frame. Useful for manual constracting of exception. - */ - static CreateSimpleException(message: string, typeName: string, assembly: string, fileName: string, details: string, line: number, handledAt?: string): Telemetry.Exception; - } - - class Metric implements Microsoft.ApplicationInsights.ISerializable { - static envelopeType: string; - static dataType: string; - ver: number; - metrics: AI.DataPoint[]; - properties: any; - aiDataContract: { - ver: Microsoft.ApplicationInsights.FieldType; - metrics: Microsoft.ApplicationInsights.FieldType; - properties: Microsoft.ApplicationInsights.FieldType; - }; - /** - * Constructs a new instance of the MetricTelemetry object - */ - constructor(name: string, value: number, count?: number, min?: number, max?: number, properties?: any); - } - - class PageView extends AI.PageViewData implements Microsoft.ApplicationInsights.ISerializable { - static envelopeType: string; - static dataType: string; - aiDataContract: { - ver: Microsoft.ApplicationInsights.FieldType; - name: Microsoft.ApplicationInsights.FieldType; - url: Microsoft.ApplicationInsights.FieldType; - duration: Microsoft.ApplicationInsights.FieldType; - properties: Microsoft.ApplicationInsights.FieldType; - measurements: Microsoft.ApplicationInsights.FieldType; - }; - /** - * Constructs a new instance of the PageEventTelemetry object - */ - constructor(name?: string, url?: string, durationMs?: number, properties?: any, measurements?: any); - } - - class PageViewPerformance extends AI.PageViewPerfData implements Microsoft.ApplicationInsights.ISerializable { - static envelopeType: string; - static dataType: string; - aiDataContract: { - ver: Microsoft.ApplicationInsights.FieldType; - name: Microsoft.ApplicationInsights.FieldType; - url: Microsoft.ApplicationInsights.FieldType; - duration: Microsoft.ApplicationInsights.FieldType; - perfTotal: Microsoft.ApplicationInsights.FieldType; - networkConnect: Microsoft.ApplicationInsights.FieldType; - sentRequest: Microsoft.ApplicationInsights.FieldType; - receivedResponse: Microsoft.ApplicationInsights.FieldType; - domProcessing: Microsoft.ApplicationInsights.FieldType; - properties: Microsoft.ApplicationInsights.FieldType; - measurements: Microsoft.ApplicationInsights.FieldType; - }; - /** - * Field indicating whether this instance of PageViewPerformance is valid and should be sent - */ - private isValid; - /** - * Indicates whether this instance of PageViewPerformance is valid and should be sent - */ - getIsValid(): boolean; - private durationMs; - /** - * Gets the total duration (PLT) in milliseconds. Check getIsValid() before using this method. - */ - getDurationMs(): number; - /** - * Constructs a new instance of the PageEventTelemetry object - */ - constructor(name: string, url: string, unused: number, properties?: any, measurements?: any); - static getPerformanceTiming(): PerformanceTiming; - /** - * Returns true is window performance timing API is supported, false otherwise. - */ - static isPerformanceTimingSupported(): PerformanceTiming; - /** - * As page loads different parts of performance timing numbers get set. When all of them are set we can report it. - * Returns true if ready, false otherwise. - */ - static isPerformanceTimingDataReady(): boolean; - static getDuration(start: any, end: any): number; - } - - class RemoteDependencyData extends AI.RemoteDependencyData implements Microsoft.ApplicationInsights.ISerializable { - static envelopeType: string; - static dataType: string; - aiDataContract: { - id: Microsoft.ApplicationInsights.FieldType; - ver: Microsoft.ApplicationInsights.FieldType; - name: Microsoft.ApplicationInsights.FieldType; - kind: Microsoft.ApplicationInsights.FieldType; - value: Microsoft.ApplicationInsights.FieldType; - count: Microsoft.ApplicationInsights.FieldType; - min: Microsoft.ApplicationInsights.FieldType; - max: Microsoft.ApplicationInsights.FieldType; - stdDev: Microsoft.ApplicationInsights.FieldType; - dependencyKind: Microsoft.ApplicationInsights.FieldType; - success: Microsoft.ApplicationInsights.FieldType; - async: Microsoft.ApplicationInsights.FieldType; - dependencySource: Microsoft.ApplicationInsights.FieldType; - commandName: Microsoft.ApplicationInsights.FieldType; - dependencyTypeName: Microsoft.ApplicationInsights.FieldType; - properties: Microsoft.ApplicationInsights.FieldType; - resultCode: Microsoft.ApplicationInsights.FieldType; - }; - /** - * Constructs a new instance of the RemoteDependencyData object - */ - constructor(id: string, absoluteUrl: string, commandName: string, value: number, success: boolean, resultCode: number, method?: string); - private formatDependencyName(method, absoluteUrl); - } - - class Trace extends AI.MessageData implements Microsoft.ApplicationInsights.ISerializable { - static envelopeType: string; - static dataType: string; - aiDataContract: { - ver: Microsoft.ApplicationInsights.FieldType; - message: Microsoft.ApplicationInsights.FieldType; - severityLevel: Microsoft.ApplicationInsights.FieldType; - measurements: Microsoft.ApplicationInsights.FieldType; - properties: Microsoft.ApplicationInsights.FieldType; - }; - /** - * Constructs a new instance of the MetricTelemetry object - */ - constructor(message: string, properties?: any); - } -} - -declare module Microsoft.ApplicationInsights.Telemetry.Common { - class Base extends Microsoft.Telemetry.Base implements Microsoft.ApplicationInsights.ISerializable { - /** - * The data contract for serializing this object. - */ - aiDataContract: {}; - } - - class Data extends Microsoft.Telemetry.Data implements Microsoft.ApplicationInsights.ISerializable { - /** - * The data contract for serializing this object. - */ - aiDataContract: { - baseType: FieldType; - baseData: FieldType; - }; - /** - * Constructs a new instance of telemetry data. - */ - constructor(type: string, data: TDomain); - } - - class Envelope implements IEnvelope { - ver: number; - name: string; - time: string; - sampleRate: number; - seq: string; - iKey: string; - flags: number; - deviceId: string; - os: string; - osVer: string; - appId: string; - appVer: string; - userId: string; - tags: any; - data: Base; - - /** - * The data contract for serializing this object. - */ - aiDataContract: any; - /** - * Constructs a new instance of telemetry data. - */ - constructor(data: Microsoft.Telemetry.Base, name: string); - } - - class DataSanitizer { - static sanitizeKeyAndAddUniqueness(key: any, map: any): any; - static sanitizeKey(name: any): any; - static sanitizeString(value: any): any; - static sanitizeUrl(url: any): any; - static sanitizeMessage(message: any): any; - static sanitizeException(exception: any): any; - static sanitizeProperties(properties: any): any; - static sanitizeMeasurements(measurements: any): any; - static padNumber(num: any): string; - } -} - -declare module Microsoft.ApplicationInsights { - interface IConfig { - instrumentationKey?: string; - endpointUrl?: string; - emitLineDelimitedJson?: boolean; - accountId?: string; - sessionRenewalMs?: number; - sessionExpirationMs?: number; - maxBatchSizeInBytes?: number; - maxBatchInterval?: number; - enableDebug?: boolean; - disableExceptionTracking?: boolean; - disableTelemetry?: boolean; - verboseLogging?: boolean; - diagnosticLogInterval?: number; - samplingPercentage?: number; - autoTrackPageVisitTime?: boolean; - disableAjaxTracking?: boolean; - overridePageViewDuration?: boolean; - maxAjaxCallsPerView?: number; - disableDataLossAnalysis?: boolean; - disableCorrelationHeaders?: boolean; - disableFlushOnBeforeUnload?: boolean; - enableSessionStorageBuffer?: boolean; - isCookieUseDisabled?: boolean; - cookieDomain?: string; - isRetryDisabled?: boolean; - isPerfAnalyzerEnabled?: boolean; - url?: string; - isStorageUseDisabled?: boolean; - } - - /** - * Enum is used in aiDataContract to describe how fields are serialized. - * For instance: (Fieldtype.Required | FieldType.Array) will mark the field as required and indicate it's an array - */ - enum FieldType { - Default = 0, - Required = 1, - Array = 2, - Hidden = 4, - } - - interface ISerializable { - /** - * The set of fields for a serializeable object. - * This defines the serialization order and a value of true/false - * for each field defines whether the field is required or not. - */ - aiDataContract: any; - } - - interface IEnvelope extends ISerializable { - ver: number; - name: string; - time: string; - sampleRate: number; - seq: string; - iKey: string; - flags: number; - deviceId: string; - os: string; - osVer: string; - appId: string; - appVer: string; - userId: string; - tags: { - [name: string]: any; - }; - } - - interface ITelemetryContext { - /** - * The object describing a component tracked by this object. - */ - application: Context.IApplication; - /** - * The object describing a device tracked by this object. - */ - device: Context.IDevice; - /** - * The object describing internal settings. - */ - internal: Context.IInternal; - /** - * The object describing a location tracked by this object. - */ - location: Context.ILocation; - /** - * The object describing a operation tracked by this object. - */ - operation: Context.IOperation; - /** - * The object describing sampling settings. - */ - sample: Context.ISample; - /** - * The object describing a user tracked by this object. - */ - user: Context.IUser; - /** - * The object describing a session tracked by this object. - */ - session: Context.ISession; - /** - * Adds telemetry initializer to the collection. Telemetry initializers will be called one by one - * before telemetry item is pushed for sending and in the order they were added. - */ - addTelemetryInitializer(telemetryInitializer: (envelope: Microsoft.ApplicationInsights.IEnvelope) => boolean): any; - /** - * Tracks telemetry object. - */ - track(envelope: Microsoft.ApplicationInsights.IEnvelope): any; - } - - interface IAppInsights { - config: IConfig; - context: ITelemetryContext; - queue: Array<() => void>; - /** - * Starts timing how long the user views a page or other item. Call this when the page opens. - * This method doesn't send any telemetry. Call {@link stopTrackTelemetry} to log the page when it closes. - * @param name A string that idenfities this item, unique within this HTML document. Defaults to the document title. - */ - startTrackPage(name?: string): any; - /** - * Logs how long a page or other item was visible, after {@link startTrackPage}. Call this when the page closes. - * @param name The string you used as the name in startTrackPage. Defaults to the document title. - * @param url String - a relative or absolute URL that identifies the page or other item. Defaults to the window location. - * @param properties map[string, string] - additional data used to filter pages and metrics in the portal. Defaults to empty. - * @param measurements map[string, number] - metrics associated with this page, displayed in Metrics Explorer on the portal. Defaults to empty. - */ - stopTrackPage(name?: string, url?: string, properties?: { - [name: string]: string; - }, measurements?: { - [name: string]: number; - }): any; - /** - * Logs that a page or other item was viewed. - * @param name The string you used as the name in startTrackPage. Defaults to the document title. - * @param url String - a relative or absolute URL that identifies the page or other item. Defaults to the window location. - * @param properties map[string, string] - additional data used to filter pages and metrics in the portal. Defaults to empty. - * @param measurements map[string, number] - metrics associated with this page, displayed in Metrics Explorer on the portal. Defaults to empty. - * @param duration number - the number of milliseconds it took to load the page. Defaults to undefined. If set to default value, page load time is calculated internally. - */ - trackPageView(name?: string, url?: string, properties?: { - [name: string]: string; - }, measurements?: { - [name: string]: number; - }, duration?: number): any; - /** - * Start timing an extended event. Call {@link stopTrackEvent} to log the event when it ends. - * @param name A string that identifies this event uniquely within the document. - */ - startTrackEvent(name: string): any; - /** - * Log an extended event that you started timing with {@link startTrackEvent}. - * @param name The string you used to identify this event in startTrackEvent. - * @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty. - * @param measurements map[string, number] - metrics associated with this event, displayed in Metrics Explorer on the portal. Defaults to empty. - */ - stopTrackEvent(name: string, properties?: { - [name: string]: string; - }, measurements?: { - [name: string]: number; - }): any; - /** - * Log a user action or other occurrence. - * @param name A string to identify this event in the portal. - * @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty. - * @param measurements map[string, number] - metrics associated with this event, displayed in Metrics Explorer on the portal. Defaults to empty. - */ - trackEvent(name: string, properties?: { - [name: string]: string; - }, measurements?: { - [name: string]: number; - }): any; - /** - * Log a dependency call - * @param id unique id, this is used by the backend o correlate server requests. Use Util.newId() to generate a unique Id. - * @param method represents request verb (GET, POST, etc.) - * @param absoluteUrl absolute url used to make the dependency request - * @param pathName the path part of the absolute url - * @param totalTime total request time - * @param success indicates if the request was sessessful - * @param resultCode response code returned by the dependency request - */ - trackDependency(id: string, method: string, absoluteUrl: string, pathName: string, totalTime: number, success: boolean, resultCode: number): any; - /** - * Log an exception you have caught. - * @param exception An Error from a catch clause, or the string error message. - * @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty. - * @param measurements map[string, number] - metrics associated with this event, displayed in Metrics Explorer on the portal. Defaults to empty. - * @param severityLevel AI.SeverityLevel - severity level - */ - trackException(exception: Error, handledAt?: string, properties?: { - [name: string]: string; - }, measurements?: { - [name: string]: number; - }, severityLevel?: AI.SeverityLevel): any; - /** - * Log a numeric value that is not associated with a specific event. Typically used to send regular reports of performance indicators. - * To send a single measurement, use just the first two parameters. If you take measurements very frequently, you can reduce the - * telemetry bandwidth by aggregating multiple measurements and sending the resulting average at intervals. - * @param name A string that identifies the metric. - * @param average Number representing either a single measurement, or the average of several measurements. - * @param sampleCount The number of measurements represented by the average. Defaults to 1. - * @param min The smallest measurement in the sample. Defaults to the average. - * @param max The largest measurement in the sample. Defaults to the average. - */ - trackMetric(name: string, average: number, sampleCount?: number, min?: number, max?: number, properties?: { - [name: string]: string; - }): any; - /** - * Log a diagnostic message. - * @param message A message string - * @param properties map[string, string] - additional data used to filter traces in the portal. Defaults to empty. - */ - trackTrace(message: string, properties?: { - [name: string]: string; - }): any; - /** - * Immediately send all queued telemetry. - */ - flush(): any; - /** - * Sets the autheticated user id and the account id in this session. - * User auth id and account id should be of type string. They should not contain commas, semi-colons, equal signs, spaces, or vertical-bars. - * - * @param authenticatedUserId {string} - The authenticated user id. A unique and persistent string that represents each authenticated user in the service. - * @param accountId {string} - An optional string to represent the account associated with the authenticated user. - */ - setAuthenticatedUserContext(authenticatedUserId: string, accountId?: string): any; - /** - * Clears the authenticated user id and the account id from the user context. - */ - clearAuthenticatedUserContext(): any; - downloadAndSetup?(config: Microsoft.ApplicationInsights.IConfig): any; - /** - * The custom error handler for Application Insights - * @param {string} message - The error message - * @param {string} url - The url where the error was raised - * @param {number} lineNumber - The line number where the error was raised - * @param {number} columnNumber - The column number for the line where the error was raised - * @param {Error} error - The Error object - */ - _onerror(message: string, url: string, lineNumber: number, columnNumber: number, error: Error): any; - } -} - -declare module 'applicationinsights-js' { - export let AppInsights: Microsoft.ApplicationInsights.IAppInsights; -} - -declare var appInsights: Microsoft.ApplicationInsights.IAppInsights; \ No newline at end of file diff --git a/applicationinsights-js/tslint.json b/applicationinsights-js/tslint.json deleted file mode 100644 index 119a5839d0..0000000000 --- a/applicationinsights-js/tslint.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "../tslint.json", - "rules": { - "interface-name": [ false ], - "no-internal-module": false, - "no-single-declare-module": false - } -} \ No newline at end of file diff --git a/arcgis-js-api/arcgis-js-api-tests.ts b/arcgis-js-api/arcgis-js-api-tests.ts deleted file mode 100644 index 0624c88672..0000000000 --- a/arcgis-js-api/arcgis-js-api-tests.ts +++ /dev/null @@ -1,30 +0,0 @@ -import Map = require("esri/Map"); -import MapView = require("esri/views/MapView"); -import Point = require("esri/geometry/Point"); - -export = MapController; - -class MapController { - map: Map; - - constructor(public mapDiv: string) { - } - - start() { - let point = new Point({ - latitude: 37.75, - longitude: -122.45 - }); - - this.map = new Map({ - basemap: "topo" - }); - - let view = new MapView({ - center: point, - container: this.mapDiv, - map: this.map, - zoom: 13 - }); - } -} diff --git a/arcgis-js-api/index.d.ts b/arcgis-js-api/index.d.ts deleted file mode 100644 index 87df41a8d8..0000000000 --- a/arcgis-js-api/index.d.ts +++ /dev/null @@ -1,8417 +0,0 @@ -// Type definitions for ArcGIS API for JavaScript 4.2 -// Project: http://js.arcgis.com -// Definitions by: Esri -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -interface HashMap { - [index: string]: T; -} - -interface IPromise { - always(callback?: (valueOrError: T) => IPromise | U | void): IPromise; - cancel?(reason?: U, strict?: boolean): U; - isCanceled?(): boolean; - isFulfilled(): boolean; - isRejected(): boolean; - isResolved(): boolean; - otherwise(errback?: (reason: any) => IPromise | U | void): IPromise; - then(callback?: (value: T) => IPromise | U | void, errback?: (reason: any) => IPromise | U | void, progback?: (update: any) => IPromise | U | void): IPromise; -} - -interface IHandle { - remove(): void; -} - -declare namespace JSX { - interface IntrinsicElements { - [elementName: string]: any; - } - - interface Element {} -} - -declare namespace __esri { - export class Accessor { - destroyed: boolean; - initialized: boolean; - declaredClass: string; - destroy(): void; - get(propertyName: string): T; - get(propertyName: string): any; - set(propertyName: string, value: T): this; - set(props: HashMap): this; - protected notifyChange(propertyName: string): void; - protected _get(propertyName: string): any; - protected _get(propertyName: string): T; - protected _set(propertyName: string, value: T): this; - } - - export interface Text { - type: string; - text: string; - } - - export interface Media { - type: string; - mediaInfos: any[]; - } - - export interface Fields { - type: string; - fieldInfos: any[]; - } - - export interface Attachments { - type: string; - } - - export interface WatchHandle { - remove(): void; - } - - export interface PausableWatchHandle { - remove(): void; - pause(): void; - resume(): void; - } - - export interface AttributeParamValue { - attributeName: string; - parameterName: string; - value: string; - } - - export interface ExternalRenderer { - setup(): void; - render(): void; - } - - export interface RenderContext { - gl: any; - camera: any; - sunLight: any; - - resetWebGLState(): void; - bindRenderTarget(): void; - } - - export interface RenderCamera { - viewMatrix: any; - viewInverseTransposeMatrix: any; - projectionMatrix: any; - eye: any; - center: any; - up: any; - near: number; - far: number; - fovX: number; - fovY: number; - } - - export interface SunLight { - direction: any; - diffuse: any; - ambient: any; - } - - export interface ColorAndIntensity { - color: any; - intensity: number; - } - - export interface LocatorSource { - categories: string[]; - countryCode: string; - localSearchOptions: any; - locationToAddressDistance: number; - searchTemplate: string; - locator: Locator; - singleLineFieldName: string; - } - - export interface FeatureLayerSource { - displayField: string; - exactMatch: boolean; - featureLayer: FeatureLayer; - searchFields: string[]; - searchQueryParams: any; - suggestQueryParams: any; - suggestionTemplate: string; - } - - export interface SearchViewModelLocatorSource { - categories: string[]; - countryCode: string; - localSearchOptions: any; - locationToAddressDistance: number; - searchTemplate: string; - locator: Locator; - singleLineFieldName: string; - } - - export interface SearchViewModelFeatureLayerSource { - displayField: string; - exactMatch: boolean; - featureLayer: FeatureLayer; - searchFields: string[]; - searchQueryParams: any; - suggestQueryParams: any; - suggestionTemplate: string; - } - - export type GetHeader = (headerName: string) => string; - - export type WatchCallback = (newValue: any, oldValue: any, propertyName: string, target: Accessor) => void; - - export type ItemCallback = (item: any, index: number) => void; - - export type ItemTestCallback = (item: any, index: number) => boolean; - - export type ItemMapCallback = (item: any, index: number) => any; - - export type ItemReduceCallback = (previousValue: any, currentValue: any, index: number) => any; - - export type ItemCompareCallback = (firstItem: any, secondItem: any) => number; - - export type EventAttachedCallback = (target: any, propName: string, obj: Accessor, eventName: string) => void; - - export type HandlerCallback = (authorizeParams: any, authorizeUrl: string, oAuthInfo: OAuthInfo, resourceUrl: string, serverInfo: ServerInfo) => void; - - export type EasingFunction = (t: number, duration: number) => number; - - export interface PromisedWatchHandle extends IPromise { - remove(): void; - } - - export interface GroundQueryElevationOptions { - returnSampleInfo?: boolean; - noDataValue?: number; - } - - export interface PopupTemplateFieldInfos { - fieldName: string; - format: PopupTemplateFieldInfosFormat; - isEditable: boolean; - label: string; - stringFieldOption: string; - tooltip: string; - visible: boolean; - } - - export interface PopupTemplateFieldInfosFormat { - dateFormat: string; - digitSeparator: boolean; - places: number; - } - - export interface WebMapSourceVersion { - major: number; - minor: number; - } - - export interface WebSceneSaveAsOptions { - folder?: PortalFolder; - ignoreUnsupported?: boolean; - } - - export interface WebSceneSaveOptions { - ignoreUnsupported?: boolean; - } - - export interface WebSceneSourceVersion { - major: number; - minor: number; - } - - export interface WebSceneUpdateFromOptions { - environmentExcluded?: boolean; - viewpointExcluded?: boolean; - } - - export interface IdentityManagerBaseGenerateTokenOptions { - serverUrl: string; - token: string; - ssl: boolean; - } - - export interface IdentityManagerBaseGetCredentialOptions { - error: Error; - oAuthPopupConfirmation: boolean; - retry: boolean; - token: string; - } - - export interface IdentityManagerBaseOAuthSignInOptions { - error: Error; - oAuthPopupConfirmation: boolean; - token: string; - } - - export interface IdentityManagerBaseRegisterTokenProperties { - expires: number; - server: string; - ssl: boolean; - token: string; - useId: string; - } - - export interface IdentityManagerBaseSetProtocolErrorHandlerHandlerFunction { - resourceUrl: string; - serverInfo: ServerInfo; - } - - export interface IdentityManagerBaseSetRedirectionHandlerHandlerFunction { - resourceUrl: string; - returnUrlParamName: string; - serverInfo: ServerInfo; - signInPage: string; - } - - export interface IdentityManagerBaseSignInOptions { - error: Error; - } - - export interface ElevationLayerQueryElevationOptions { - demResolution?: number | string; - returnSampleInfo?: boolean; - noDataValue?: number; - } - - export interface CSVLayerElevationInfo { - mode: string; - offset?: number; - } - - export interface FeatureLayerElevationInfo { - mode: string; - offset?: number; - } - - export interface GraphicsLayerElevationInfo { - mode: string; - offset?: number; - } - - export interface LayerFromArcGISServerUrlParams { - url: string; - properties?: any; - } - - export interface LayerFromPortalItemParams { - portalItem: PortalItem; - } - - export interface SceneLayerElevationInfo { - mode: string; - offset?: number; - } - - export interface VectorTileLayerCurrentStyleInfo { - serviceUrl: string; - styleUrl: string; - spriteUrl: string; - glyphsUrl: string; - style: any; - layerDefinition: any; - } - - export interface CodedValueDomainCodedValues { - name: string; - code: string | number; - } - - export interface LabelClassLabelExpressionInfo { - value: string; - } - - export interface PixelBlockAddDataPlaneData { - pixels: number[][]; - statistics: any[]; - } - - export interface PixelBlockStatistics { - maxValue: number; - minValue: number; - noDataValue: number; - } - - export interface PortalFeaturedGroups { - owner: string; - title: string; - } - - export interface PortalItemFetchRelatedItemsParams { - relationshipType: string; - direction?: string; - } - - export interface PortalItemUpdateParams { - data: string | any; - } - - export interface PortalUserAddItemParams { - item: PortalItem; - data?: string | any; - folder?: PortalFolder; - } - - export interface PortalUserFetchItemsParams { - folder: PortalFolder; - num: number; - start: number; - } - - export interface ClassBreaksRendererClassBreakInfos { - minValue: number; - maxValue: number; - symbol: Symbol; - label: string; - } - - export interface ClassBreaksRendererLegendOptions { - title: string; - } - - export interface UniqueValueRendererLegendOptions { - title: string; - } - - export interface UniqueValueRendererUniqueValueInfos { - value: string; - symbol: Symbol; - label: string; - } - - export interface PointCloudClassBreaksRendererColorClassBreakInfos { - minValue: number; - maxValue: number; - color: Color; - label: string; - } - - export interface PointCloudStretchRendererStops { - value: number; - label: string; - color: Color; - } - - export interface PointCloudUniqueValueRendererColorUniqueValueInfos { - values: number[]; - color: Color; - label: string; - } - - export interface FillSymbol3DLayerOutline { - color: Color | string; - size: number | string; - } - - export interface IconSymbol3DLayerOutline { - color: Color | string; - size: number | string; - } - - export interface IconSymbol3DLayerResource { - primitive?: string; - href?: string; - } - - export interface ObjectSymbol3DLayerResource { - primitive?: string; - href?: string; - } - - export interface Symbol3DStyleOrigin { - styleName: string; - styleUrl: string; - name: string; - } - - export interface TextSymbol3DLayerFont { - family: string; - weight: string; - style: string; - } - - export interface GeometryServiceFromGeoCoordinateStringParams { - strings: string[]; - sr: SpatialReference | string; - conversionType: string; - conversionMode?: string; - } - - export interface GeometryServiceToGeoCoordinateStringParams { - sr: SpatialReference | string; - coordinates: number[][]; - conversionType: string; - conversionMode?: string; - numOfDigits?: number; - rounding?: boolean; - addSpaces?: boolean; - } - - export interface LocatorAddressToLocationsParams { - address: any; - categories: string[]; - countryCode: string; - distance: number; - forStorage: boolean; - location: Point; - magicKey: string; - maxLocations: number; - outFields: string[]; - searchExtent: Extent; - } - - export interface LocatorAddressesToLocationsParams { - addresses: any[]; - countryCode: string; - categories: string[]; - } - - export interface LocatorSuggestLocationsParams { - categories: string[]; - distance: number; - location: Point; - text: string; - } - - export interface ClosestFacilityParametersAttributeParameterValues { - attributeName: string; - parameterName: string; - value: string; - } - - export interface PrintTemplateExportOptions { - width: number; - height: number; - dpi: number; - } - - export interface PrintTemplateLayoutOptions { - titleText: string; - authorText: string; - copyrightText: string; - scalebarUnit: string; - legendLayers: LegendLayer[]; - customTextElements: any[]; - } - - export interface ProjectParametersTransformation { - wkid: number; - } - - export interface QueryQuantizationParameters { - extent: Extent; - mode: string; - originPosition: string; - tolerance: number; - } - - export interface MapViewConstraints { - lods?: LOD[]; - minScale?: number; - maxScale?: number; - minZoom?: number; - maxZoom?: number; - snapToZoom?: boolean; - rotationEnabled?: boolean; - effectiveLODs?: number; - effectiveMinZoom?: number; - effectiveMaxZoom?: number; - effectiveMinScale?: number; - effectiveMaxScale?: number; - } - - export interface MapViewGoToOptions { - animate?: boolean; - duration?: number; - easing?: string | Function; - } - - export interface MapViewHitTestScreenPoint { - x: number; - y: number; - } - - export interface SceneViewConstraintsProperties { - altitude?: SceneViewConstraintsAltitudeProperties; - clipDistance?: SceneViewConstraintsClipDistanceProperties; - collision?: SceneViewConstraintsCollision; - tilt?: SceneViewConstraintsTiltProperties; - } - export interface SceneViewConstraints extends Accessor { - altitude: SceneViewConstraintsAltitude; - clipDistance: SceneViewConstraintsClipDistance; - collision: SceneViewConstraintsCollision; - tilt: SceneViewConstraintsTilt; - } - - export interface SceneViewConstraintsAltitudeProperties { - min?: number; - max?: number; - } - export interface SceneViewConstraintsAltitude extends Accessor { - min: number; - max: number; - } - - export interface SceneViewConstraintsClipDistanceProperties { - near?: number; - far?: number; - mode?: string; - } - export interface SceneViewConstraintsClipDistance extends Accessor { - near: number; - far: number; - mode: string; - } - - export interface SceneViewConstraintsCollision { - enabled: boolean; - } - - export interface SceneViewConstraintsTiltProperties { - max?: number; - mode?: string; - } - export interface SceneViewConstraintsTilt extends Accessor { - max: number; - mode: string; - } - - export interface SceneViewEnvironmentProperties { - lighting?: SceneViewEnvironmentLightingProperties; - atmosphereEnabled?: boolean; - atmosphere?: SceneViewEnvironmentAtmosphereProperties; - starsEnabled?: boolean; - } - export interface SceneViewEnvironment extends Accessor { - lighting: SceneViewEnvironmentLighting; - atmosphereEnabled: boolean; - atmosphere: SceneViewEnvironmentAtmosphere; - starsEnabled: boolean; - } - - export interface SceneViewEnvironmentAtmosphereProperties { - quality?: string; - } - export interface SceneViewEnvironmentAtmosphere extends Accessor { - quality: string; - } - - export interface SceneViewEnvironmentLightingProperties { - date?: Date; - directShadowsEnabled?: boolean; - ambientOcclusionEnabled?: boolean; - cameraTrackingEnabled?: boolean; - } - export interface SceneViewEnvironmentLighting extends Accessor { - date: Date; - directShadowsEnabled: boolean; - ambientOcclusionEnabled: boolean; - cameraTrackingEnabled: boolean; - } - - export interface SceneViewGoToOptions { - animate?: boolean; - speedFactor?: number; - duration?: number; - maxDuration?: number; - easing?: string | EasingFunction; - } - - export interface SceneViewHitTestScreenPoint { - x: number; - y: number; - } - - export interface ViewPadding { - left: number; - top: number; - right: number; - bottom: number; - } - - export interface ImageryLayerViewPixelData { - extent: Extent; - pixelBlock: PixelBlock; - } - - export interface SlideApplyToOptions { - animate: boolean; - speedFactor?: number; - duration?: number; - maxDuration?: number; - easing?: string | EasingFunction; - } - - export interface SlideCreateFromOptions { - screenshot: SlideCreateFromOptionsScreenshot; - } - - export interface SlideCreateFromOptionsScreenshot { - format: string; - quality: number; - width: number; - height: number; - } - - export interface SlideDescriptionProperties { - text?: string; - } - export interface SlideDescription extends Accessor { - text: string; - } - - export interface SlideThumbnailProperties { - url?: string; - } - export interface SlideThumbnail extends Accessor { - url: string; - } - - export interface SlideTitleProperties { - text?: string; - } - export interface SlideTitle extends Accessor { - text: string; - } - - export interface SlideUpdateFromOptions { - screenshot: SlideUpdateFromOptionsScreenshot; - } - - export interface SlideUpdateFromOptionsScreenshot { - format: string; - quality: number; - width: number; - height: number; - } - - export interface SlideVisibleLayers extends Collection { - id: string; - } - - export interface ColorSliderValues { - color: Color; - value: number; - label: string; - } - - export interface LegendLayerInfos { - title: string; - layer: Layer; - } - - export interface PopupDockOptions { - breakpoint: any | boolean; - buttonEnabled: boolean; - position: string | Function; - } - - export interface PopupOpenOptions { - title?: string; - content?: string; - location?: Geometry; - features?: Graphic[]; - promises?: IPromise[]; - updateLocationEnabled?: boolean; - } - - export interface SearchSources extends Collection { - autoNavigate: boolean; - resultGraphicEnabled: boolean; - resultSymbol: Symbol; - popupEnabled: boolean; - suggestionsEnabled: boolean; - popup: Popup; - maxResults: number; - maxSuggestions: number; - minSuggestCharacters: number; - name: string; - outFields: string[]; - placeholder: string; - prefix: string; - searchExtent: Extent[]; - popupOpenOnSelect: boolean; - suffix: string; - withinViewEnabled: boolean; - zoomScale: number; - } - - export interface SearchViewModelSources { - autoNavigate: boolean; - resultGraphicEnabled: boolean; - resultSymbol: Symbol; - popupEnabled: boolean; - suggestionsEnabled: boolean; - popup: Popup; - maxResults: number; - maxSuggestions: number; - minSuggestCharacters: number; - name: string; - outFields: string[]; - placeholder: string; - prefix: string; - searchExtent: Extent[]; - popupOpenOnSelect: boolean; - suffix: string; - withinViewEnabled: boolean; - zoomScale: number; - } - - export interface ArcGISDynamicMapServiceGetExportImageParametersOptions { - extent: Extent; - width: number; - height: number; - rotation?: number; - } - - export interface SceneServiceVersion { - major: number; - minor: number; - versionString: string; - } - - export interface BreakpointsOwnerBreakpoints { - xsmall: number; - small: number; - medium: number; - large: number; - } - - export interface configRequest { - corsDetection: boolean; - corsDetectionTimeout: number; - corsEnabledServers: Array; - forceProxy: boolean; - httpsDomains: string[]; - maxUrlLength: number; - proxyUrl: string; - timeout: number; - useCors: string | boolean; - proxyRules: configRequestProxyRules[]; - } - - export interface configRequestCorsEnabledServers { - host: string; - withCredentials: boolean; - } - - export interface configRequestProxyRules { - proxyUrl: string; - urlPrefix: string; - } - - export interface requestEsriRequestOptions { - callbackParamName?: string; - query?: any; - responseType?: string; - headers?: any; - timeout?: number; - method?: string; - useProxy?: boolean; - cacheBust?: boolean; - allowImageDataAccess?: boolean; - } - - export interface urlUtilsAddProxyRuleRule { - proxyUrl: string; - urlPrefix: string; - } - - export interface decoratorsPropertyPropertyMetadata { - dependsOn?: string[]; - type?: Function; - cast?: Function; - readOnly?: boolean; - aliasOf?: string; - } - - export interface colorCreateContinuousRendererParams { - layer: FeatureLayer | SceneLayer; - field: string; - normalizationField?: string; - basemap?: string | Basemap; - theme?: string; - colorScheme?: any; - legendOptions?: colorCreateContinuousRendererParamsLegendOptions; - statistics?: any; - minValue?: number; - maxValue?: number; - defaultSymbolEnabled?: boolean; - view?: SceneView; - symbolType?: string; - } - - export interface colorCreateContinuousRendererParamsLegendOptions { - title: string; - } - - export interface colorCreateVisualVariableParams { - layer: FeatureLayer | SceneLayer; - field: string; - normalizationField?: string; - basemap?: string | Basemap; - theme?: string; - colorScheme?: any; - legendOptions?: colorCreateVisualVariableParamsLegendOptions; - statistics?: any; - minValue?: number; - maxValue?: number; - view?: SceneView; - worldScale?: boolean; - } - - export interface colorCreateVisualVariableParamsLegendOptions { - title: string; - } - - export interface locationCreateRendererParams { - layer: FeatureLayer | SceneLayer; - basemap?: string | Basemap; - locationScheme?: any | any | any; - view?: SceneView; - symbolType?: string; - } - - export interface sizeCreateContinuousRendererParams { - layer: FeatureLayer | SceneLayer; - field: string; - normalizationField?: string; - basemap?: string | Basemap; - sizeScheme?: any | any | any; - legendOptions?: sizeCreateContinuousRendererParamsLegendOptions; - statistics?: any; - minValue?: number; - maxValue?: number; - defaultSymbolEnabled?: boolean; - view?: SceneView; - symbolType?: string; - } - - export interface sizeCreateContinuousRendererParamsLegendOptions { - title: string; - } - - export interface sizeCreateVisualVariableParams { - layer: FeatureLayer | SceneLayer; - field: string; - normalizationField?: string; - basemap?: string | Basemap; - sizeScheme?: any | any | any; - legendOptions?: sizeCreateVisualVariableParamsLegendOptions; - statistics?: any; - minValue?: number; - maxValue?: number; - view?: SceneView; - worldScale?: boolean; - } - - export interface sizeCreateVisualVariableParamsLegendOptions { - title: string; - } - - export interface univariateColorSizeCreateContinuousRendererParams { - layer: FeatureLayer | SceneLayer; - basemap?: string | Basemap; - field: string; - normalizationField?: string; - statistics?: any; - minValue?: number; - maxValue?: number; - defaultSymbolEnabled?: boolean; - colorOptions?: univariateColorSizeCreateContinuousRendererParamsColorOptions; - sizeOptions?: univariateColorSizeCreateContinuousRendererParamsSizeOptions; - view?: SceneView; - symbolType?: string; - } - - export interface univariateColorSizeCreateContinuousRendererParamsColorOptions { - theme?: string; - colorScheme?: any; - legendOptions?: univariateColorSizeCreateContinuousRendererParamsColorOptionsLegendOptions; - } - - export interface univariateColorSizeCreateContinuousRendererParamsColorOptionsLegendOptions { - title: string; - } - - export interface univariateColorSizeCreateContinuousRendererParamsSizeOptions { - sizeScheme?: any | any | any; - legendOptions?: univariateColorSizeCreateContinuousRendererParamsSizeOptionsLegendOptions; - } - - export interface univariateColorSizeCreateContinuousRendererParamsSizeOptionsLegendOptions { - title: string; - } - - export interface univariateColorSizeCreateVisualVariablesParams { - layer: FeatureLayer | SceneLayer; - basemap?: string | Basemap; - field: string; - normalizationField?: string; - statistics?: any; - minValue?: number; - maxValue?: number; - colorOptions?: univariateColorSizeCreateVisualVariablesParamsColorOptions; - sizeOptions?: univariateColorSizeCreateVisualVariablesParamsSizeOptions; - view?: SceneView; - worldScale?: boolean; - } - - export interface univariateColorSizeCreateVisualVariablesParamsColorOptions { - theme?: string; - colorScheme?: any; - legendOptions?: univariateColorSizeCreateVisualVariablesParamsColorOptionsLegendOptions; - } - - export interface univariateColorSizeCreateVisualVariablesParamsColorOptionsLegendOptions { - title: string; - } - - export interface univariateColorSizeCreateVisualVariablesParamsSizeOptions { - sizeScheme?: any | any | any; - legendOptions?: univariateColorSizeCreateVisualVariablesParamsSizeOptionsLegendOptions; - } - - export interface univariateColorSizeCreateVisualVariablesParamsSizeOptionsLegendOptions { - title: string; - } - - export interface classBreaksClassBreaksParams { - layer: FeatureLayer | SceneLayer; - field?: string; - normalizationField?: string; - classificationMethod?: string; - standardDeviationInterval?: number; - minValue?: number; - maxValue?: number; - numClasses?: number; - } - - export interface histogramHistogramParams { - layer: FeatureLayer | SceneLayer; - field?: string; - normalizationField?: string; - classificationMethod?: string; - standardDeviationInterval?: number; - minValue?: number; - maxValue?: number; - numBins?: number; - } - - export interface summaryStatisticsSummaryStatisticsParams { - layer: FeatureLayer | SceneLayer; - field?: string; - normalizationField?: string; - features?: Graphic[]; - minValue?: number; - maxValue?: number; - } - - export interface colorGetSchemesParams { - basemap: string | Basemap; - geometryType: string; - theme: string; - view?: SceneView; - worldScale?: boolean; - } - - export interface locationGetSchemesParams { - basemap: string | Basemap; - geometryType: string; - view?: SceneView; - worldScale?: boolean; - } - - export interface sizeGetSchemesParams { - basemap: string | Basemap; - geometryType: string; - view?: SceneView; - worldScale?: boolean; - } - - interface Evented { - emit(type: string, event: any): IHandle; - on(name: string, callback: Function): IHandle; - } - - interface EventedConstructor { - new(): Evented; - - - hasEventListener(type: string): boolean; - on(type: string, listener: Function): any; - } - - export const Evented: EventedConstructor; - - interface Basemap extends Accessor, Loadable, JSONSupport { - baseLayers: Collection; - id: string; - loaded: boolean; - portalItem: PortalItem; - referenceLayers: Collection; - thumbnailUrl: string; - title: string; - - clone(): Basemap; - } - - interface BasemapConstructor { - new(properties?: BasemapProperties): Basemap; - - - fromId(id: string): Basemap; - - fromJSON(json: any): Basemap; - } - - export const Basemap: BasemapConstructor; - - interface BasemapProperties extends LoadableProperties { - baseLayers?: Collection; - id?: string; - loaded?: boolean; - portalItem?: PortalItemProperties; - referenceLayers?: Collection; - thumbnailUrl?: string; - title?: string; - } - - interface Camera extends Accessor, JSONSupport { - fov: number; - heading: number; - position: Point; - tilt: number; - - clone(): Camera; - } - - interface CameraConstructor { - new(properties?: CameraProperties): Camera; - - fromJSON(json: any): Camera; - } - - export const Camera: CameraConstructor; - - interface CameraProperties { - fov?: number; - heading?: number; - position?: PointProperties; - tilt?: number; - } - - interface Color { - a: number; - b: number; - g: number; - r: number; - - clone(): Color; - setColor(color: string | number[] | any): Color; - toCss(includeAlpha?: boolean): string; - toHex(): string; - toJSON(): any; - toRgb(): number[]; - toRgba(): number[]; - } - - interface ColorConstructor { - - blendColors(start: Color, end: Color, weight: number, obj?: Color): Color; - new(color: string | number[] | any): Color; - fromArray(a: number, obj?: Color): Color; - fromHex(color: string, obj?: Color): Color; - fromJSON(json: any): Color; - fromRgb(color: string, obj?: Color): Color; - fromString(str: string, obj?: Color): Color; - } - - export const Color: ColorConstructor; - - interface Graphic extends Accessor, JSONSupport { - attributes: any; - geometry: Geometry; - layer: FeatureLayer | GraphicsLayer; - popupTemplate: PopupTemplate; - symbol: Symbol; - visible: boolean; - - clone(): Graphic; - getAttribute(name: string): any; - getEffectivePopupTemplate(): PopupTemplate; - setAttribute(name: string, newValue: any): void; - } - - interface GraphicConstructor { - new(properties?: GraphicProperties): Graphic; - - fromJSON(json: any): Graphic; - } - - export const Graphic: GraphicConstructor; - - interface GraphicProperties { - attributes?: any; - geometry?: GeometryProperties; - layer?: FeatureLayer | GraphicsLayer; - popupTemplate?: PopupTemplateProperties; - symbol?: SymbolProperties; - visible?: boolean; - } - - interface Ground extends Accessor { - layers: Collection; - - clone(): Ground; - queryElevation(geometry: Point | Multipoint | Polyline, options?: GroundQueryElevationOptions): IPromise; - } - - interface GroundConstructor { - new(properties?: GroundProperties): Ground; - } - - export const Ground: GroundConstructor; - - interface GroundProperties { - layers?: Collection; - } - - interface Map extends Accessor, LayersMixin { - allLayers: Collection; - basemap: Basemap; - ground: Ground; - } - - interface MapConstructor { - new(properties?: MapProperties): Map; - } - - export const Map: MapConstructor; - - interface MapProperties extends LayersMixinProperties { - allLayers?: Collection; - basemap?: BasemapProperties; - ground?: GroundProperties; - } - - interface PopupTemplate extends Accessor, JSONSupport { - actions: Collection; - content: string; - fieldInfos: PopupTemplateFieldInfos[]; - overwriteActions: boolean; - title: string; - - clone(): PopupTemplate; - } - - interface PopupTemplateConstructor { - new(properties?: PopupTemplateProperties): PopupTemplate; - - fromJSON(json: any): PopupTemplate; - } - - export const PopupTemplate: PopupTemplateConstructor; - - interface PopupTemplateProperties { - actions?: Collection; - content?: string | any[] | Function; - fieldInfos?: PopupTemplateFieldInfos[]; - overwriteActions?: boolean; - title?: string | Function; - } - - interface Viewpoint extends Accessor, JSONSupport { - camera: Camera; - rotation: number; - scale: number; - targetGeometry: Geometry; - - clone(): Viewpoint; - } - - interface ViewpointConstructor { - new(properties?: ViewpointProperties): Viewpoint; - - fromJSON(json: any): Viewpoint; - } - - export const Viewpoint: ViewpointConstructor; - - interface ViewpointProperties { - camera?: CameraProperties; - rotation?: number; - scale?: number; - targetGeometry?: GeometryProperties; - } - - interface WebMap extends Map, corePromise { - applicationProperties: any; - bookmarks: any[]; - initialViewProperties: InitialViewProperties; - loaded: boolean; - loadError: Error; - loadStatus: string; - portalItem: PortalItem; - presentation: any; - sourceVersion: WebMapSourceVersion; - tables: any[]; - widgets: any; - - load(): IPromise; - } - - interface WebMapConstructor { - new(properties?: WebMapProperties): WebMap; - } - - export const WebMap: WebMapConstructor; - - interface WebMapProperties extends MapProperties { - applicationProperties?: any; - bookmarks?: any[]; - initialViewProperties?: InitialViewPropertiesProperties; - loaded?: boolean; - loadError?: Error; - loadStatus?: string; - portalItem?: PortalItemProperties; - presentation?: any; - sourceVersion?: WebMapSourceVersion; - tables?: any[]; - widgets?: any; - } - - interface WebScene extends Map, corePromise { - clippingArea: Extent; - clippingEnabled: boolean; - initialViewProperties: websceneInitialViewProperties; - loaded: boolean; - loadError: Error; - loadStatus: string; - portalItem: PortalItem; - presentation: Presentation; - sourceVersion: WebSceneSourceVersion; - - load(): IPromise; - save(options?: WebSceneSaveOptions): IPromise; - saveAs(portalItem: PortalItem, options?: WebSceneSaveAsOptions): IPromise; - toJSON(): any; - updateFrom(view: SceneView, options?: WebSceneUpdateFromOptions): void; - } - - interface WebSceneConstructor { - new(properties?: WebSceneProperties): WebScene; - - - fromJSON(json: any): any; - } - - export const WebScene: WebSceneConstructor; - - interface WebSceneProperties extends MapProperties { - clippingArea?: ExtentProperties; - clippingEnabled?: boolean; - initialViewProperties?: websceneInitialViewPropertiesProperties; - loaded?: boolean; - loadError?: Error; - loadStatus?: string; - portalItem?: PortalItemProperties; - presentation?: PresentationProperties; - sourceVersion?: WebSceneSourceVersion; - } - - - - interface Collection extends Accessor, Evented { - length: number; - - add(item: any, index?: number): void; - addMany(items: any[] | Collection, index?: number): void; - clone(): Collection; - concat(value: any[] | Collection): Collection; - every(callback: ItemTestCallback): boolean; - filter(callback: ItemTestCallback): Collection; - find(callback: ItemTestCallback): any; - findIndex(callback: ItemTestCallback): number; - flatten(callback: ItemCallback): Collection; - forEach(callback: ItemCallback): void; - getItemAt(index: number): any; - includes(searchElement: any): boolean; - indexOf(searchElement: any, fromIndex?: number): number; - join(separator?: string): string; - lastIndexOf(searchElement: any, fromIndex?: number): number; - map(callback: ItemMapCallback): Collection; - pop(): any; - push(item: any): number; - reduce(callback: ItemReduceCallback): any; - reduceRight(callback: ItemReduceCallback, initialValue?: any): any; - remove(item: any): void; - removeAll(): void; - removeAt(index: number): any; - removeMany(items: any[] | Collection): any; - reorder(item: any, index: number): any; - reverse(): Collection; - shift(): any; - slice(begin?: number, end?: number): Collection; - some(callback: ItemCallback): boolean; - sort(compareFunction?: ItemCompareCallback): void; - splice(start: number, deleteCount: number, items: any): any[]; - toArray(): any[]; - unshift(items: any): number; - } - - interface CollectionConstructor { - new(properties?: CollectionProperties): Collection; - - - isCollection(value: any): boolean; - ofType(type: any): any; - } - - export const Collection: CollectionConstructor; - - interface CollectionProperties { - length?: number; - } - - interface Connection { - broadcast(methodName: string, data?: any, buffers?: any[]): IPromise[]; - close(): void; - invoke(methodName: string, data?: any, buffers?: any[]): IPromise; - } - - interface ConnectionConstructor { - new(client: any, id: number): Connection; - } - - export const Connection: ConnectionConstructor; - - interface Circle extends Polygon { - center: Point | number[]; - geodesic: boolean; - numberOfPoints: number; - radius: number; - radiusUnit: string; - } - - interface CircleConstructor { - new(properties?: CircleProperties): Circle; - - fromJSON(json: any): Circle; - } - - export const Circle: CircleConstructor; - - interface CircleProperties extends PolygonProperties { - center?: Point | number[]; - geodesic?: boolean; - numberOfPoints?: number; - radius?: number; - radiusUnit?: string; - } - - interface Extent extends Geometry { - center: Point; - height: number; - mmax: number; - mmin: number; - width: number; - xmax: number; - xmin: number; - ymax: number; - ymin: number; - zmax: number; - zmin: number; - - centerAt(point: Point): Extent; - contains(geometry: Point | Extent): boolean; - equals(extent: Extent): boolean; - expand(factor: number): Extent; - intersection(extent: Extent): Extent; - intersects(geometry: Geometry): boolean; - offset(dx: number, dy: number, dz: number): Extent; - union(extent: Extent): Extent; - } - - interface ExtentConstructor { - new(properties?: ExtentProperties): Extent; - - fromJSON(json: any): Extent; - } - - export const Extent: ExtentConstructor; - - interface ExtentProperties extends GeometryProperties { - center?: PointProperties; - height?: number; - mmax?: number; - mmin?: number; - width?: number; - xmax?: number; - xmin?: number; - ymax?: number; - ymin?: number; - zmax?: number; - zmin?: number; - } - - interface Geometry extends Accessor, JSONSupport { - cache: any; - extent: Extent; - hasM: boolean; - hasZ: boolean; - spatialReference: SpatialReference; - type: string; - - clone(): Geometry; - } - - interface GeometryConstructor { - new(properties?: GeometryProperties): Geometry; - - fromJSON(json: any): Geometry; - } - - export const Geometry: GeometryConstructor; - - interface GeometryProperties { - cache?: any; - extent?: ExtentProperties; - hasM?: boolean; - hasZ?: boolean; - spatialReference?: SpatialReferenceProperties; - type?: string; - } - - interface Multipoint extends Geometry { - points: number[][]; - - addPoint(point: Point | number[]): Multipoint; - getPoint(index: number): Point; - removePoint(index: number): Point; - setPoint(index: number, point: Point): Multipoint; - } - - interface MultipointConstructor { - new(properties?: MultipointProperties): Multipoint; - - fromJSON(json: any): Multipoint; - } - - export const Multipoint: MultipointConstructor; - - interface MultipointProperties extends GeometryProperties { - points?: number[][]; - } - - interface Point extends Geometry { - latitude: number; - longitude: number; - m: number; - x: number; - y: number; - z: number; - - copy(other: Point): void; - distance(other: Point): number; - equals(point: Point): boolean; - } - - interface PointConstructor { - new(properties?: PointProperties): Point; - - fromJSON(json: any): Point; - } - - export const Point: PointConstructor; - - interface PointProperties extends GeometryProperties { - latitude?: number; - longitude?: number; - m?: number; - x?: number; - y?: number; - z?: number; - } - - interface Polygon extends Geometry { - centroid: Point; - isSelfIntersecting: boolean; - rings: number[][][]; - - addRing(ring: Point[] | number[][]): Polygon; - contains(point: Point): boolean; - getPoint(ringIndex: number, pointIndex: number): Point; - insertPoint(ringIndex: number, pointIndex: number, point: Point): Polygon; - isClockwise(ring: Point[] | number[][]): boolean; - removePoint(ringIndex: number, pointIndex: number): Point[]; - removeRing(index: number): Point[]; - setPoint(ringIndex: number, pointIndex: number, point: Point): Polygon; - } - - interface PolygonConstructor { - new(properties?: PolygonProperties): Polygon; - - fromJSON(json: any): Polygon; - } - - export const Polygon: PolygonConstructor; - - interface PolygonProperties extends GeometryProperties { - centroid?: PointProperties; - isSelfIntersecting?: boolean; - rings?: number[][][]; - } - - interface Polyline extends Geometry { - paths: number[][][]; - - addPath(points: number[][]): Polyline; - getPoint(pathIndex: number, pointIndex: number): Point; - insertPoint(pathIndex: number, pointIndex: number, point: Point): Polyline; - removePath(index: number): Point[]; - removePoint(pathIndex: number, pointIndex: number): Point; - setPoint(pathIndex: number, pointIndex: number, point: Point): Polyline; - } - - interface PolylineConstructor { - new(properties?: PolylineProperties): Polyline; - - fromJSON(json: any): Polyline; - } - - export const Polyline: PolylineConstructor; - - interface PolylineProperties extends GeometryProperties { - paths?: number[][][]; - } - - interface ScreenPoint extends Accessor { - x: number; - y: number; - } - - interface ScreenPointConstructor { - new(properties?: ScreenPointProperties): ScreenPoint; - } - - export const ScreenPoint: ScreenPointConstructor; - - interface ScreenPointProperties { - x?: number; - y?: number; - } - - interface SpatialReference extends Accessor, JSONSupport { - isGeographic: boolean; - isWebMercator: boolean; - isWGS84: boolean; - isWrappable: boolean; - WebMercator: SpatialReference; - WGS84: SpatialReference; - wkid: number; - wkt: string; - - clone(): SpatialReference; - equals(spatialReference: SpatialReference): boolean; - } - - interface SpatialReferenceConstructor { - new(properties?: SpatialReferenceProperties): SpatialReference; - - fromJSON(json: any): SpatialReference; - } - - export const SpatialReference: SpatialReferenceConstructor; - - interface SpatialReferenceProperties { - isGeographic?: boolean; - isWebMercator?: boolean; - isWGS84?: boolean; - isWrappable?: boolean; - WebMercator?: SpatialReferenceProperties; - WGS84?: SpatialReferenceProperties; - wkid?: number; - wkt?: string; - } - - interface Credential extends Accessor { - expires: number; - isAdmin: boolean; - oAuthState: any; - server: string; - ssl: boolean; - token: string; - userId: string; - - destroy(): void; - refreshToken(): void; - } - - interface CredentialConstructor { - new(properties?: CredentialProperties): Credential; - } - - export const Credential: CredentialConstructor; - - interface CredentialProperties { - expires?: number; - isAdmin?: boolean; - oAuthState?: any; - server?: string; - ssl?: boolean; - token?: string; - userId?: string; - } - - interface IdentityManagerBase extends Evented { - tokenValidity: number; - - checkSignInStatus(resUrl: string): IPromise; - destroyCredentials(): void; - findCredential(url: string, userId?: string): Credential; - findOAuthInfo(url: string): OAuthInfo; - findServerInfo(url: string): ServerInfo; - generateToken(serverInfo: ServerInfo, userInfo: any, options?: IdentityManagerBaseGenerateTokenOptions): IPromise; - getCredential(url: string, options?: IdentityManagerBaseGetCredentialOptions): IPromise; - initialize(json: any): any; - isBusy(): boolean; - oAuthSignIn(resUrl: string, serverInfo: ServerInfo, oAuthInfo: OAuthInfo, options?: IdentityManagerBaseOAuthSignInOptions): IPromise; - registerOAuthInfos(oAuthInfos: OAuthInfo[]): void; - registerServers(serverInfos: ServerInfo[]): void; - registerToken(properties: IdentityManagerBaseRegisterTokenProperties): void; - setProtocolErrorHandler(handlerFunction: IdentityManagerBaseSetProtocolErrorHandlerHandlerFunction): void; - setRedirectionHandler(handlerFunction: IdentityManagerBaseSetRedirectionHandlerHandlerFunction): void; - signIn(url: string, serverInfo: ServerInfo, options?: IdentityManagerBaseSignInOptions): IPromise; - toJSON(): any; - } - - interface IdentityManagerBaseConstructor { - new(): IdentityManagerBase; - } - - export const IdentityManagerBase: IdentityManagerBaseConstructor; - - interface IdentityManager extends IdentityManagerBase { - dialog: any; - - setOAuthRedirectionHandler(handlerFunction: HandlerCallback): void; - setOAuthResponseHash(hash: string): void; - } - - interface IdentityManagerConstructor { - new(): IdentityManager; - } - - export const IdentityManager: IdentityManagerConstructor; - - interface OAuthInfo { - appId: string; - authNamespace: string; - expiration: number; - locale: string; - minTimeUntilExpiration: number; - popup: boolean; - popupCallbackUrl: string; - popupWindowFeatures: string; - portalUrl: string; - showSocialLogins: boolean; - - toJSON(): any; - } - - interface OAuthInfoConstructor { - new(properties?: any): OAuthInfo; - } - - export const OAuthInfo: OAuthInfoConstructor; - - interface ServerInfo { - adminTokenServiceUrl: string; - currentVersion: number; - server: string; - shortLivedTokenValidity: number; - tokenServiceUrl: string; - - toJSON(): any; - } - - interface ServerInfoConstructor { - new(properties?: any): ServerInfo; - } - - export const ServerInfo: ServerInfoConstructor; - - interface ElevationLayer extends Layer, ArcGISMapService, ArcGISCachedService, PortalLayer, TiledLayer { - url: string; - - fetchTile(level: number, row: number, column: number, noDataValue?: number): IPromise; - queryElevation(geometry: Point | Multipoint | Polyline, options?: ElevationLayerQueryElevationOptions): IPromise; - } - - interface ElevationLayerConstructor { - new(properties?: ElevationLayerProperties): ElevationLayer; - - fromJSON(json: any): ElevationLayer; - } - - export const ElevationLayer: ElevationLayerConstructor; - - interface ElevationLayerProperties extends LayerProperties, ArcGISMapServiceProperties, ArcGISCachedServiceProperties, PortalLayerProperties, TiledLayerProperties { - url?: string; - } - - interface ImageryLayer extends Layer, ArcGISImageService, ScaleRangeLayer { - pixelFilter: Function; - popupEnabled: boolean; - portalItem: PortalItem; - token: string; - - redraw(): void; - } - - interface ImageryLayerConstructor { - new(properties?: ImageryLayerProperties): ImageryLayer; - - fromJSON(json: any): ImageryLayer; - } - - export const ImageryLayer: ImageryLayerConstructor; - - interface ImageryLayerProperties extends LayerProperties, ArcGISImageServiceProperties, ScaleRangeLayerProperties { - pixelFilter?: Function; - popupEnabled?: boolean; - portalItem?: PortalItemProperties; - token?: string; - } - - interface MapImageLayer extends Layer, ArcGISMapService, ArcGISDynamicMapService, DynamicLayer { - } - - interface MapImageLayerConstructor { - new(properties?: MapImageLayerProperties): MapImageLayer; - - fromJSON(json: any): MapImageLayer; - } - - export const MapImageLayer: MapImageLayerConstructor; - - interface MapImageLayerProperties extends LayerProperties, ArcGISMapServiceProperties, ArcGISDynamicMapServiceProperties, DynamicLayerProperties { - - } - - interface TileLayer extends Layer, ArcGISMapService, ArcGISCachedService, PortalLayer, TiledLayer { - attributionDataUrl: string; - hasAttributionData: boolean; - legendEnabled: boolean; - tileServers: string[]; - url: string; - } - - interface TileLayerConstructor { - new(properties?: TileLayerProperties): TileLayer; - - fromJSON(json: any): TileLayer; - } - - export const TileLayer: TileLayerConstructor; - - interface TileLayerProperties extends LayerProperties, ArcGISMapServiceProperties, ArcGISCachedServiceProperties, PortalLayerProperties, TiledLayerProperties { - attributionDataUrl?: string; - hasAttributionData?: boolean; - legendEnabled?: boolean; - tileServers?: string[]; - url?: string; - } - - interface CSVLayer extends Layer { - copyright: string; - delimiter: string; - elevationInfo: CSVLayerElevationInfo; - fields: Field[]; - labelingInfo: LabelClass[]; - labelsVisible: boolean; - latitudeField: string; - legendEnabled: boolean; - longitudeField: string; - maxScale: number; - minScale: number; - outFields: string[]; - popupEnabled: boolean; - popupTemplate: PopupTemplate; - renderer: Renderer; - url: string; - } - - interface CSVLayerConstructor { - new(properties?: CSVLayerProperties): CSVLayer; - } - - export const CSVLayer: CSVLayerConstructor; - - interface CSVLayerProperties extends LayerProperties { - copyright?: string; - delimiter?: string; - elevationInfo?: CSVLayerElevationInfo; - fields?: FieldProperties[]; - labelingInfo?: LabelClassProperties[]; - labelsVisible?: boolean; - latitudeField?: string; - legendEnabled?: boolean; - longitudeField?: string; - maxScale?: number; - minScale?: number; - outFields?: string[]; - popupEnabled?: boolean; - popupTemplate?: PopupTemplateProperties; - renderer?: RendererProperties; - url?: string; - } - - interface FeatureLayer extends Layer, PortalLayer, ScaleRangeLayer { - copyright: string; - definitionExpression: string; - elevationInfo: FeatureLayerElevationInfo; - fields: Field[]; - geometryType: string; - hasAttachments: boolean; - hasM: boolean; - hasZ: boolean; - labelingInfo: LabelClass[]; - labelsVisible: boolean; - layerId: number; - legendEnabled: boolean; - objectIdField: string; - outFields: string[]; - popupEnabled: boolean; - popupTemplate: PopupTemplate; - renderer: Renderer; - returnM: boolean; - returnZ: boolean; - source: Collection; - spatialReference: SpatialReference; - token: string; - url: string; - version: number; - - createQuery(): Query; - queryExtent(params?: Query): IPromise; - queryFeatureCount(params?: Query): IPromise; - queryFeatures(params?: Query): IPromise; - queryObjectIds(params?: Query): IPromise; - } - - interface FeatureLayerConstructor { - new(properties?: FeatureLayerProperties): FeatureLayer; - - fromJSON(json: any): FeatureLayer; - } - - export const FeatureLayer: FeatureLayerConstructor; - - interface FeatureLayerProperties extends LayerProperties, PortalLayerProperties, ScaleRangeLayerProperties { - copyright?: string; - definitionExpression?: string; - elevationInfo?: FeatureLayerElevationInfo; - fields?: FieldProperties[]; - geometryType?: string; - hasAttachments?: boolean; - hasM?: boolean; - hasZ?: boolean; - labelingInfo?: LabelClassProperties[]; - labelsVisible?: boolean; - layerId?: number; - legendEnabled?: boolean; - objectIdField?: string; - outFields?: string[]; - popupEnabled?: boolean; - popupTemplate?: PopupTemplateProperties; - renderer?: RendererProperties; - returnM?: boolean; - returnZ?: boolean; - source?: Collection; - spatialReference?: SpatialReferenceProperties; - token?: string; - url?: string; - version?: number; - } - - interface GraphicsLayer extends Layer, ScaleRangeLayer { - elevationInfo: GraphicsLayerElevationInfo; - graphics: Collection; - - add(graphic: Graphic): void; - addMany(graphics: Graphic[]): void; - remove(graphic: Graphic): void; - removeAll(): void; - removeMany(graphics: Graphic[]): void; - } - - interface GraphicsLayerConstructor { - new(properties?: GraphicsLayerProperties): GraphicsLayer; - } - - export const GraphicsLayer: GraphicsLayerConstructor; - - interface GraphicsLayerProperties extends LayerProperties, ScaleRangeLayerProperties { - elevationInfo?: GraphicsLayerElevationInfo; - graphics?: Collection; - } - - interface GroupLayer extends Layer, LayersMixin, JSONSupport, PortalLayer { - visibilityMode: string; - } - - interface GroupLayerConstructor { - new(properties?: GroupLayerProperties): GroupLayer; - - fromJSON(json: any): GroupLayer; - } - - export const GroupLayer: GroupLayerConstructor; - - interface GroupLayerProperties extends LayerProperties, LayersMixinProperties, PortalLayerProperties { - visibilityMode?: string; - } - - interface IntegratedMeshLayer extends Layer, SceneService, PortalLayer { - } - - interface IntegratedMeshLayerConstructor { - new(properties?: IntegratedMeshLayerProperties): IntegratedMeshLayer; - - fromJSON(json: any): IntegratedMeshLayer; - } - - export const IntegratedMeshLayer: IntegratedMeshLayerConstructor; - - interface IntegratedMeshLayerProperties extends LayerProperties, SceneServiceProperties, PortalLayerProperties { - - } - - interface Layer extends Accessor, Loadable, Evented { - fullExtent: Extent; - id: string; - listMode: string; - loaded: boolean; - opacity: number; - title: string; - type: string; - visible: boolean; - - fetchAttributionData(): IPromise; - } - - interface LayerConstructor { - new(properties?: LayerProperties): Layer; - - - fromArcGISServerUrl(params: LayerFromArcGISServerUrlParams): IPromise; - fromPortalItem(params: LayerFromPortalItemParams): IPromise; - } - - export const Layer: LayerConstructor; - - interface LayerProperties extends LoadableProperties { - fullExtent?: ExtentProperties; - id?: string; - listMode?: string; - loaded?: boolean; - opacity?: number; - title?: string; - type?: string; - visible?: boolean; - } - - interface OpenStreetMapLayer extends WebTileLayer { - } - - interface OpenStreetMapLayerConstructor { - new(properties?: OpenStreetMapLayerProperties): OpenStreetMapLayer; - - fromJSON(json: any): OpenStreetMapLayer; - } - - export const OpenStreetMapLayer: OpenStreetMapLayerConstructor; - - interface OpenStreetMapLayerProperties extends WebTileLayerProperties { - - } - - interface PointCloudLayer extends Layer, SceneService, PortalLayer { - fields: Field[]; - renderer: PointCloudRenderer; - } - - interface PointCloudLayerConstructor { - new(properties?: PointCloudLayerProperties): PointCloudLayer; - - fromJSON(json: any): PointCloudLayer; - } - - export const PointCloudLayer: PointCloudLayerConstructor; - - interface PointCloudLayerProperties extends LayerProperties, SceneServiceProperties, PortalLayerProperties { - fields?: FieldProperties[]; - renderer?: PointCloudRendererProperties; - } - - interface SceneLayer extends Layer, SceneService, PortalLayer { - elevationInfo: SceneLayerElevationInfo; - fields: Field[]; - geometryType: string; - labelingInfo: LabelClass[]; - labelsVisible: boolean; - legendEnabled: boolean; - objectIdField: string; - popupEnabled: boolean; - popupTemplate: PopupTemplate; - renderer: Renderer; - - getFieldUsageInfo(fieldName: string): any; - queryExtent(params?: Query): IPromise; - queryFeatureCount(params?: Query): IPromise; - queryFeatures(params?: Query): IPromise; - queryObjectIds(params?: Query): IPromise; - } - - interface SceneLayerConstructor { - new(properties?: SceneLayerProperties): SceneLayer; - - fromJSON(json: any): SceneLayer; - } - - export const SceneLayer: SceneLayerConstructor; - - interface SceneLayerProperties extends LayerProperties, SceneServiceProperties, PortalLayerProperties { - elevationInfo?: SceneLayerElevationInfo; - fields?: FieldProperties[]; - geometryType?: string; - labelingInfo?: LabelClassProperties[]; - labelsVisible?: boolean; - legendEnabled?: boolean; - objectIdField?: string; - popupEnabled?: boolean; - popupTemplate?: PopupTemplateProperties; - renderer?: RendererProperties; - } - - interface StreamLayer extends FeatureLayer { - geometryDefinition: Extent; - maximumTrackPoints: number; - purgeOptions: any; - } - - interface StreamLayerConstructor { - new(properties?: StreamLayerProperties): StreamLayer; - - fromJSON(json: any): StreamLayer; - } - - export const StreamLayer: StreamLayerConstructor; - - interface StreamLayerProperties extends FeatureLayerProperties { - geometryDefinition?: ExtentProperties; - maximumTrackPoints?: number; - purgeOptions?: any; - } - - interface UnknownLayer extends Layer { - } - - interface UnknownLayerConstructor { - new(properties?: UnknownLayerProperties): UnknownLayer; - } - - export const UnknownLayer: UnknownLayerConstructor; - - interface UnknownLayerProperties extends LayerProperties { - - } - - interface UnsupportedLayer extends Layer { - } - - interface UnsupportedLayerConstructor { - new(properties?: UnsupportedLayerProperties): UnsupportedLayer; - } - - export const UnsupportedLayer: UnsupportedLayerConstructor; - - interface UnsupportedLayerProperties extends LayerProperties { - - } - - interface VectorTileLayer extends Layer, PortalLayer, ScaleRangeLayer, TiledLayer { - attributionDataUrl: string; - currentStyleInfo: VectorTileLayerCurrentStyleInfo; - spatialReference: SpatialReference; - token: string; - url: string; - } - - interface VectorTileLayerConstructor { - new(properties?: VectorTileLayerProperties): VectorTileLayer; - - fromJSON(json: any): VectorTileLayer; - } - - export const VectorTileLayer: VectorTileLayerConstructor; - - interface VectorTileLayerProperties extends LayerProperties, PortalLayerProperties, ScaleRangeLayerProperties, TiledLayerProperties { - attributionDataUrl?: string; - currentStyleInfo?: VectorTileLayerCurrentStyleInfo; - spatialReference?: SpatialReferenceProperties; - token?: string; - url?: string | any; - } - - interface WebTileLayer extends Layer, TiledLayer, ScaleRangeLayer { - copyright: string; - spatialReference: SpatialReference; - subDomains: string[]; - tileServers: string[]; - urlTemplate: string; - } - - interface WebTileLayerConstructor { - new(properties?: WebTileLayerProperties): WebTileLayer; - - fromJSON(json: any): WebTileLayer; - } - - export const WebTileLayer: WebTileLayerConstructor; - - interface WebTileLayerProperties extends LayerProperties, TiledLayerProperties, ScaleRangeLayerProperties { - copyright?: string; - spatialReference?: SpatialReferenceProperties; - subDomains?: string[]; - tileServers?: string[]; - urlTemplate?: string; - } - - interface CodedValueDomain extends Domain { - codedValues: CodedValueDomainCodedValues[]; - } - - interface CodedValueDomainConstructor { - new(properties?: any): CodedValueDomain; - - getName(code: string | number): string; - } - - export const CodedValueDomain: CodedValueDomainConstructor; - - interface DimensionalDefinition { - dimensionName: string; - isSlice: boolean; - values: any[]; - variableName: string; - - toJSON(): any; - } - - interface DimensionalDefinitionConstructor { - new(properties?: any): DimensionalDefinition; - } - - export const DimensionalDefinition: DimensionalDefinitionConstructor; - - interface Domain { - name: string; - type: string; - - toJSON(): any; - } - - interface DomainConstructor { - new(): Domain; - } - - export const Domain: DomainConstructor; - - interface Field extends JSONSupport { - alias: string; - domain: Domain; - editable: boolean; - length: number; - name: string; - nullable: boolean; - type: string; - } - - interface FieldConstructor { - new(properties?: FieldProperties): Field; - - fromJSON(json: any): Field; - } - - export const Field: FieldConstructor; - - interface FieldProperties { - alias?: string; - domain?: Domain; - editable?: boolean; - length?: number; - name?: string; - nullable?: boolean; - type?: string; - } - - interface ImageParameters { - dpi: number; - extent: Extent; - format: string; - height: number; - imageSpatialReference: SpatialReference; - layerDefinitions: string[]; - layerIds: number[]; - layerOption: string; - transparent: boolean; - width: number; - - toJSON(): any; - } - - interface ImageParametersConstructor { - new(properties?: any): ImageParameters; - } - - export const ImageParameters: ImageParametersConstructor; - - interface InheritedDomain extends Domain { - } - - interface InheritedDomainConstructor { - new(): InheritedDomain; - } - - export const InheritedDomain: InheritedDomainConstructor; - - interface LabelClass extends Accessor, JSONSupport { - labelExpression: string; - labelExpressionInfo: LabelClassLabelExpressionInfo; - labelPlacement: string; - maxScale: number; - minScale: number; - symbol: TextSymbol | LabelSymbol3D; - useCodedValues: boolean; - where: string; - } - - interface LabelClassConstructor { - new(properties?: LabelClassProperties): LabelClass; - - fromJSON(json: any): LabelClass; - } - - export const LabelClass: LabelClassConstructor; - - interface LabelClassProperties { - labelExpression?: string; - labelExpressionInfo?: LabelClassLabelExpressionInfo; - labelPlacement?: string; - maxScale?: number; - minScale?: number; - symbol?: TextSymbol | LabelSymbol3D; - useCodedValues?: boolean; - where?: string; - } - - interface LOD extends Accessor, JSONSupport { - level: number; - levelValue: string; - resolution: number; - scale: number; - } - - interface LODConstructor { - new(properties?: LODProperties): LOD; - - fromJSON(json: any): LOD; - } - - export const LOD: LODConstructor; - - interface LODProperties { - level?: number; - levelValue?: string; - resolution?: number; - scale?: number; - } - - interface MapImage extends Accessor, JSONSupport { - extent: Extent; - height: number; - href: number; - opacity: number; - scale: number; - visible: boolean; - width: number; - } - - interface MapImageConstructor { - new(properties?: MapImageProperties): MapImage; - - fromJSON(json: any): MapImage; - } - - export const MapImage: MapImageConstructor; - - interface MapImageProperties { - extent?: ExtentProperties; - height?: number; - href?: number; - opacity?: number; - scale?: number; - visible?: boolean; - width?: number; - } - - interface MosaicRule extends JSONSupport { - ascending: boolean; - lockRasterIds: number[]; - method: string; - multidimensionalDefinition: DimensionalDefinition[]; - objectIds: number[]; - operation: string; - sortField: string; - sortValue: string; - viewpoint: Point; - where: string; - } - - interface MosaicRuleConstructor { - new(properties?: MosaicRuleProperties): MosaicRule; - - fromJSON(json: any): MosaicRule; - } - - export const MosaicRule: MosaicRuleConstructor; - - interface MosaicRuleProperties { - ascending?: boolean; - lockRasterIds?: number[]; - method?: string; - multidimensionalDefinition?: DimensionalDefinition[]; - objectIds?: number[]; - operation?: string; - sortField?: string; - sortValue?: string; - viewpoint?: PointProperties; - where?: string; - } - - interface PixelBlock { - height: number; - mask: number[]; - pixels: number[][]; - pixelType: string; - statistics: PixelBlockStatistics[]; - width: number; - - addData(planeData: PixelBlockAddDataPlaneData): void; - getAsRGBA(): number[]; - getAsRGBAFloat(): number[]; - getPlaneCount(): number; - } - - interface PixelBlockConstructor { - new(properties?: any): PixelBlock; - } - - export const PixelBlock: PixelBlockConstructor; - - interface RangeDomain extends Domain { - maxValue: number; - minValue: number; - } - - interface RangeDomainConstructor { - new(): RangeDomain; - } - - export const RangeDomain: RangeDomainConstructor; - - interface RasterFunction extends JSONSupport { - functionArguments: any; - functionName: string; - outputPixelType: string; - variableName: any; - } - - interface RasterFunctionConstructor { - new(properties?: RasterFunctionProperties): RasterFunction; - - fromJSON(json: any): RasterFunction; - } - - export const RasterFunction: RasterFunctionConstructor; - - interface RasterFunctionProperties { - functionArguments?: any; - functionName?: string; - outputPixelType?: string; - variableName?: any; - } - - interface Sublayer extends Accessor { - definitionExpression: string; - id: number; - labelingInfo: LabelClass[]; - labelsVisible: boolean; - layer: MapImageLayer; - maxScale: number; - minScale: number; - opacity: number; - popupTemplate: PopupTemplate; - renderer: Renderer; - source: any | any; - sublayers: Collection; - title: string; - url: string; - visible: boolean; - - clone(): Sublayer; - createQuery(): Query; - queryFeatures(params?: Query): IPromise; - } - - interface SublayerConstructor { - new(properties?: SublayerProperties): Sublayer; - } - - export const Sublayer: SublayerConstructor; - - interface SublayerProperties { - definitionExpression?: string; - id?: number; - labelingInfo?: LabelClassProperties[]; - labelsVisible?: boolean; - layer?: MapImageLayerProperties; - maxScale?: number; - minScale?: number; - opacity?: number; - popupTemplate?: PopupTemplateProperties; - renderer?: RendererProperties; - source?: any | any; - sublayers?: Collection; - title?: string; - url?: string; - visible?: boolean; - } - - interface TileInfo extends Accessor, JSONSupport { - dpi: number; - format: string; - lods: LOD[]; - origin: Point; - size: number[]; - spatialReference: SpatialReference; - } - - interface TileInfoConstructor { - new(properties?: TileInfoProperties): TileInfo; - - fromJSON(json: any): TileInfo; - } - - export const TileInfo: TileInfoConstructor; - - interface TileInfoProperties { - dpi?: number; - format?: string; - lods?: LODProperties[]; - origin?: PointProperties; - size?: number[]; - spatialReference?: SpatialReferenceProperties; - } - - interface Portal extends Accessor, Loadable { - access: string; - allSSL: boolean; - authMode: string; - authorizedCrossOriginDomains: string[]; - bingKey: string; - canListApps: boolean; - canListData: boolean; - canListPreProvisionedItems: boolean; - canProvisionDirectPurchase: boolean; - canSearchPublic: boolean; - canShareBingPublic: boolean; - canSharePublic: boolean; - canSignInArcGIS: boolean; - canSignInIDP: boolean; - colorSetsGroupQuery: string; - commentsEnabled: boolean; - created: Date; - culture: string; - customBaseUrl: string; - defaultBasemap: Basemap; - defaultExtent: Extent; - description: string; - featuredGroups: PortalFeaturedGroups[]; - featuredItemsGroupQuery: string; - galleryTemplatesGroupQuery: string; - homePageFeaturedContent: string; - homePageFeaturedContentCount: number; - httpPort: number; - httpsPort: number; - id: string; - ipCntryCode: string; - isOrganization: boolean; - isPortal: boolean; - layerTemplatesGroupQuery: string; - loaded: boolean; - maxTokenExpirationMinutes: number; - modified: Date; - name: string; - portalHostname: string; - portalMode: string; - portalProperties: any; - region: string; - restUrl: string; - rotatorPanels: any[]; - showHomePageDescription: boolean; - supportsHostedServices: boolean; - symbolSetsGroupQuery: string; - templatesGroupQuery: string; - thumbnailUrl: string; - units: string; - url: string; - urlKey: string; - user: PortalUser; - useStandardizedQuery: boolean; - - fetchBasemaps(): IPromise; - fetchFeaturedGroups(): IPromise; - queryGroups(queryParams: PortalQueryParams): IPromise; - queryItems(queryParams: PortalQueryParams): IPromise; - queryUsers(queryParams: PortalQueryParams): IPromise; - } - - interface PortalConstructor { - new(properties?: PortalProperties): Portal; - - - getDefault(): Portal; - } - - export const Portal: PortalConstructor; - - interface PortalProperties extends LoadableProperties { - access?: string; - allSSL?: boolean; - authMode?: string; - authorizedCrossOriginDomains?: string[]; - bingKey?: string; - canListApps?: boolean; - canListData?: boolean; - canListPreProvisionedItems?: boolean; - canProvisionDirectPurchase?: boolean; - canSearchPublic?: boolean; - canShareBingPublic?: boolean; - canSharePublic?: boolean; - canSignInArcGIS?: boolean; - canSignInIDP?: boolean; - colorSetsGroupQuery?: string; - commentsEnabled?: boolean; - created?: Date; - culture?: string; - customBaseUrl?: string; - defaultBasemap?: BasemapProperties; - defaultExtent?: ExtentProperties; - description?: string; - featuredGroups?: PortalFeaturedGroups[]; - featuredItemsGroupQuery?: string; - galleryTemplatesGroupQuery?: string; - homePageFeaturedContent?: string; - homePageFeaturedContentCount?: number; - httpPort?: number; - httpsPort?: number; - id?: string; - ipCntryCode?: string; - isOrganization?: boolean; - isPortal?: boolean; - layerTemplatesGroupQuery?: string; - loaded?: boolean; - maxTokenExpirationMinutes?: number; - modified?: Date; - name?: string; - portalHostname?: string; - portalMode?: string; - portalProperties?: any; - region?: string; - restUrl?: string; - rotatorPanels?: any[]; - showHomePageDescription?: boolean; - supportsHostedServices?: boolean; - symbolSetsGroupQuery?: string; - templatesGroupQuery?: string; - thumbnailUrl?: string; - units?: string; - url?: string; - urlKey?: string; - user?: PortalUserProperties; - useStandardizedQuery?: boolean; - } - - interface PortalFolder extends Accessor { - created: Date; - id: string; - portal: Portal; - title: string; - url: string; - } - - interface PortalFolderConstructor { - new(properties?: PortalFolderProperties): PortalFolder; - } - - export const PortalFolder: PortalFolderConstructor; - - interface PortalFolderProperties { - created?: Date; - id?: string; - portal?: PortalProperties; - title?: string; - url?: string; - } - - interface PortalGroup extends Accessor { - access: string; - created: Date; - description: string; - id: string; - isInvitationOnly: boolean; - modified: Date; - owner: string; - portal: Portal; - snippet: string; - tags: string[]; - title: string; - url: string; - - fetchMembers(): IPromise; - queryItems(queryParams?: PortalQueryParams): IPromise; - } - - interface PortalGroupConstructor { - new(properties?: PortalGroupProperties): PortalGroup; - } - - export const PortalGroup: PortalGroupConstructor; - - interface PortalGroupProperties { - access?: string; - created?: Date; - description?: string; - id?: string; - isInvitationOnly?: boolean; - modified?: Date; - owner?: string; - portal?: PortalProperties; - snippet?: string; - tags?: string[]; - title?: string; - url?: string; - } - - interface PortalItem extends Accessor, Loadable, JSONSupport { - access: string; - accessInformation: string; - avgRating: number; - created: Date; - culture: string; - description: string; - extent: Extent; - id: string; - isLayer: boolean; - itemControl: string; - itemUrl: string; - licenseInfo: string; - loaded: boolean; - modified: Date; - name: string; - numComments: number; - numRatings: number; - numViews: number; - owner: string; - portal: Portal; - size: number; - snippet: string; - tags: string[]; - thumbnailUrl: string; - title: string; - type: string; - typeKeywords: string[]; - url: string; - - addRating(rating: number | PortalRating): IPromise; - deleteRating(): IPromise; - fetchData(responseType?: string): IPromise; - fetchRating(): IPromise; - fetchRelatedItems(params: PortalItemFetchRelatedItemsParams): IPromise; - update(params?: PortalItemUpdateParams): IPromise; - } - - interface PortalItemConstructor { - new(properties?: PortalItemProperties): PortalItem; - - fromJSON(json: any): PortalItem; - } - - export const PortalItem: PortalItemConstructor; - - interface PortalItemProperties extends LoadableProperties { - access?: string; - accessInformation?: string; - avgRating?: number; - created?: Date; - culture?: string; - description?: string; - extent?: ExtentProperties; - id?: string; - isLayer?: boolean; - itemControl?: string; - itemUrl?: string; - licenseInfo?: string; - loaded?: boolean; - modified?: Date; - name?: string; - numComments?: number; - numRatings?: number; - numViews?: number; - owner?: string; - portal?: PortalProperties; - size?: number; - snippet?: string; - tags?: string[]; - thumbnailUrl?: string; - title?: string; - type?: string; - typeKeywords?: string[]; - url?: string; - } - - interface PortalRating extends Accessor { - created: Date; - rating: number; - } - - interface PortalRatingConstructor { - new(properties?: PortalRatingProperties): PortalRating; - } - - export const PortalRating: PortalRatingConstructor; - - interface PortalRatingProperties { - created?: Date; - rating?: number; - } - - interface PortalQueryParams extends Accessor { - extent: Extent; - num: number; - query: string; - sortField: string; - sortOrder: string; - start: number; - - clone(): PortalQueryParams; - } - - interface PortalQueryParamsConstructor { - new(properties?: PortalQueryParamsProperties): PortalQueryParams; - } - - export const PortalQueryParams: PortalQueryParamsConstructor; - - interface PortalQueryParamsProperties { - extent?: ExtentProperties; - num?: number; - query?: string; - sortField?: string; - sortOrder?: string; - start?: number; - } - - interface PortalQueryResult extends Accessor { - nextQueryParams: PortalQueryParams; - queryParams: PortalQueryParams; - results: any[]; - total: number; - } - - interface PortalQueryResultConstructor { - new(properties?: PortalQueryResultProperties): PortalQueryResult; - } - - export const PortalQueryResult: PortalQueryResultConstructor; - - interface PortalQueryResultProperties { - nextQueryParams?: PortalQueryParamsProperties; - queryParams?: PortalQueryParamsProperties; - results?: any[]; - total?: number; - } - - interface PortalUser extends Accessor { - access: string; - created: Date; - culture: string; - description: string; - email: string; - fullName: string; - modified: Date; - orgId: string; - portal: Portal; - preferredView: string; - region: string; - role: string; - roleId: string; - thumbnailUrl: string; - userContentUrl: string; - username: string; - - addItem(params: PortalUserAddItemParams): IPromise; - deleteItem(item: PortalItem): IPromise; - fetchFolders(): IPromise; - fetchGroups(): IPromise; - fetchItems(params: PortalUserFetchItemsParams): IPromise; - queryFavorites(queryParams?: PortalQueryParams): IPromise; - } - - interface PortalUserConstructor { - new(properties?: PortalUserProperties): PortalUser; - } - - export const PortalUser: PortalUserConstructor; - - interface PortalUserProperties { - access?: string; - created?: Date; - culture?: string; - description?: string; - email?: string; - fullName?: string; - modified?: Date; - orgId?: string; - portal?: PortalProperties; - preferredView?: string; - region?: string; - role?: string; - roleId?: string; - thumbnailUrl?: string; - userContentUrl?: string; - username?: string; - } - - interface ClassBreaksRenderer extends Renderer, VisualVariablesMixin { - backgroundFillSymbol: FillSymbol; - classBreakInfos: ClassBreaksRendererClassBreakInfos[]; - defaultSymbol: Symbol; - field: string; - isMaxInclusive: boolean; - legendOptions: ClassBreaksRendererLegendOptions; - normalizationField: string; - normalizationTotal: number; - normalizationType: string; - type: string; - valueExpression: string; - valueExpressionTitle: string; - - addClassBreakInfo(min: number | any, max: number, symbol: Symbol): void; - clone(): ClassBreaksRenderer; - getClassBreakInfo(graphic: Graphic): any; - removeClassBreakInfo(min: number, max: number): void; - } - - interface ClassBreaksRendererConstructor { - new(properties?: ClassBreaksRendererProperties): ClassBreaksRenderer; - - fromJSON(json: any): ClassBreaksRenderer; - } - - export const ClassBreaksRenderer: ClassBreaksRendererConstructor; - - interface ClassBreaksRendererProperties extends RendererProperties, VisualVariablesMixinProperties { - backgroundFillSymbol?: FillSymbolProperties; - classBreakInfos?: ClassBreaksRendererClassBreakInfos[]; - defaultSymbol?: SymbolProperties; - field?: string | Function; - isMaxInclusive?: boolean; - legendOptions?: ClassBreaksRendererLegendOptions; - normalizationField?: string; - normalizationTotal?: number; - normalizationType?: string; - type?: string; - valueExpression?: string; - valueExpressionTitle?: string; - } - - interface Renderer extends Accessor, JSONSupport { - authoringInfo: any; - } - - interface RendererConstructor { - new(properties?: RendererProperties): Renderer; - - fromJSON(json: any): Renderer; - } - - export const Renderer: RendererConstructor; - - interface RendererProperties { - authoringInfo?: any; - } - - interface SimpleRenderer extends Renderer, VisualVariablesMixin { - label: string; - symbol: Symbol; - type: string; - - clone(): SimpleRenderer; - } - - interface SimpleRendererConstructor { - new(properties?: SimpleRendererProperties): SimpleRenderer; - - fromJSON(json: any): SimpleRenderer; - } - - export const SimpleRenderer: SimpleRendererConstructor; - - interface SimpleRendererProperties extends RendererProperties, VisualVariablesMixinProperties { - label?: string; - symbol?: SymbolProperties; - type?: string; - } - - interface UniqueValueRenderer extends Renderer, VisualVariablesMixin { - defaultLabel: string; - defaultSymbol: Symbol; - field: string; - field2: string; - field3: string; - fieldDelimiter: string; - legendOptions: UniqueValueRendererLegendOptions; - type: string; - uniqueValueInfos: UniqueValueRendererUniqueValueInfos[]; - valueExpression: string; - valueExpressionTitle: string; - - addUniqueValueInfo(valueOrInfo: string | any, symbol: Symbol): void; - clone(): UniqueValueRenderer; - getUniqueValueInfo(graphic: Graphic): any; - removeUniqueValueInfo(value: string): void; - } - - interface UniqueValueRendererConstructor { - new(properties?: UniqueValueRendererProperties): UniqueValueRenderer; - - fromJSON(json: any): UniqueValueRenderer; - } - - export const UniqueValueRenderer: UniqueValueRendererConstructor; - - interface UniqueValueRendererProperties extends RendererProperties, VisualVariablesMixinProperties { - defaultLabel?: string; - defaultSymbol?: SymbolProperties; - field?: string | Function; - field2?: string; - field3?: string; - fieldDelimiter?: string; - legendOptions?: UniqueValueRendererLegendOptions; - type?: string; - uniqueValueInfos?: UniqueValueRendererUniqueValueInfos[]; - valueExpression?: string; - valueExpressionTitle?: string; - } - - interface PointCloudRenderer extends Accessor, JSONSupport { - pointsPerInch: number; - } - - interface PointCloudRendererConstructor { - new(properties?: PointCloudRendererProperties): PointCloudRenderer; - - fromJSON(json: any): PointCloudRenderer; - } - - export const PointCloudRenderer: PointCloudRendererConstructor; - - interface PointCloudRendererProperties { - pointsPerInch?: number; - } - - interface PointCloudClassBreaksRenderer extends PointCloudRenderer { - colorClassBreakInfos: PointCloudClassBreaksRendererColorClassBreakInfos[]; - field: string; - fieldTransformType: string; - type: string; - } - - interface PointCloudClassBreaksRendererConstructor { - new(properties?: PointCloudClassBreaksRendererProperties): PointCloudClassBreaksRenderer; - - fromJSON(json: any): PointCloudClassBreaksRenderer; - } - - export const PointCloudClassBreaksRenderer: PointCloudClassBreaksRendererConstructor; - - interface PointCloudClassBreaksRendererProperties extends PointCloudRendererProperties { - colorClassBreakInfos?: PointCloudClassBreaksRendererColorClassBreakInfos[]; - field?: string; - fieldTransformType?: string; - type?: string; - } - - interface PointCloudRGBRenderer extends PointCloudRenderer { - field: string; - type: string; - } - - interface PointCloudRGBRendererConstructor { - new(properties?: PointCloudRGBRendererProperties): PointCloudRGBRenderer; - - fromJSON(json: any): PointCloudRGBRenderer; - } - - export const PointCloudRGBRenderer: PointCloudRGBRendererConstructor; - - interface PointCloudRGBRendererProperties extends PointCloudRendererProperties { - field?: string; - type?: string; - } - - interface PointCloudStretchRenderer extends PointCloudRenderer { - field: string; - fieldTransformType: string; - stops: PointCloudStretchRendererStops[]; - type: string; - } - - interface PointCloudStretchRendererConstructor { - new(properties?: PointCloudStretchRendererProperties): PointCloudStretchRenderer; - - fromJSON(json: any): PointCloudStretchRenderer; - } - - export const PointCloudStretchRenderer: PointCloudStretchRendererConstructor; - - interface PointCloudStretchRendererProperties extends PointCloudRendererProperties { - field?: string; - fieldTransformType?: string; - stops?: PointCloudStretchRendererStops[]; - type?: string; - } - - interface PointCloudUniqueValueRenderer extends PointCloudRenderer { - colorUniqueValueInfos: PointCloudUniqueValueRendererColorUniqueValueInfos[]; - field: string; - fieldTransformType: string; - type: string; - } - - interface PointCloudUniqueValueRendererConstructor { - new(properties?: PointCloudUniqueValueRendererProperties): PointCloudUniqueValueRenderer; - - fromJSON(json: any): PointCloudUniqueValueRenderer; - } - - export const PointCloudUniqueValueRenderer: PointCloudUniqueValueRendererConstructor; - - interface PointCloudUniqueValueRendererProperties extends PointCloudRendererProperties { - colorUniqueValueInfos?: PointCloudUniqueValueRendererColorUniqueValueInfos[]; - field?: string; - fieldTransformType?: string; - type?: string; - } - - interface ExtrudeSymbol3DLayer extends Symbol3DLayer { - size: number; - - clone(): ExtrudeSymbol3DLayer; - } - - interface ExtrudeSymbol3DLayerConstructor { - new(properties?: ExtrudeSymbol3DLayerProperties): ExtrudeSymbol3DLayer; - - fromJSON(json: any): ExtrudeSymbol3DLayer; - } - - export const ExtrudeSymbol3DLayer: ExtrudeSymbol3DLayerConstructor; - - interface ExtrudeSymbol3DLayerProperties extends Symbol3DLayerProperties { - size?: number; - } - - interface FillSymbol extends Symbol { - outline: SimpleLineSymbol; - } - - interface FillSymbolConstructor { - new(properties?: FillSymbolProperties): FillSymbol; - - fromJSON(json: any): FillSymbol; - } - - export const FillSymbol: FillSymbolConstructor; - - interface FillSymbolProperties extends SymbolProperties { - outline?: SimpleLineSymbolProperties; - } - - interface FillSymbol3DLayer extends Symbol3DLayer { - outline: FillSymbol3DLayerOutline; - - clone(): FillSymbol3DLayer; - } - - interface FillSymbol3DLayerConstructor { - new(properties?: FillSymbol3DLayerProperties): FillSymbol3DLayer; - - fromJSON(json: any): FillSymbol3DLayer; - } - - export const FillSymbol3DLayer: FillSymbol3DLayerConstructor; - - interface FillSymbol3DLayerProperties extends Symbol3DLayerProperties { - outline?: FillSymbol3DLayerOutline; - } - - interface Font extends Accessor, JSONSupport { - clone(): Font; - } - - interface FontConstructor { - new(properties?: FontProperties): Font; - - fromJSON(json: any): Font; - } - - export const Font: FontConstructor; - - interface FontProperties { - - } - - interface IconSymbol3DLayer extends Symbol3DLayer { - anchor: string; - outline: IconSymbol3DLayerOutline; - resource: IconSymbol3DLayerResource; - size: number | string; - - clone(): IconSymbol3DLayer; - } - - interface IconSymbol3DLayerConstructor { - new(properties?: IconSymbol3DLayerProperties): IconSymbol3DLayer; - - fromJSON(json: any): IconSymbol3DLayer; - } - - export const IconSymbol3DLayer: IconSymbol3DLayerConstructor; - - interface IconSymbol3DLayerProperties extends Symbol3DLayerProperties { - anchor?: string; - outline?: IconSymbol3DLayerOutline; - resource?: IconSymbol3DLayerResource; - size?: number | string; - } - - interface LabelSymbol3D extends Symbol3D { - clone(): LabelSymbol3D; - } - - interface LabelSymbol3DConstructor { - new(properties?: LabelSymbol3DProperties): LabelSymbol3D; - - fromJSON(json: any): LabelSymbol3D; - } - - export const LabelSymbol3D: LabelSymbol3DConstructor; - - interface LabelSymbol3DProperties extends Symbol3DProperties { - - } - - interface LineSymbol extends Symbol { - color: Color; - width: number; - } - - interface LineSymbolConstructor { - new(properties?: LineSymbolProperties): LineSymbol; - - fromJSON(json: any): LineSymbol; - } - - export const LineSymbol: LineSymbolConstructor; - - interface LineSymbolProperties extends SymbolProperties { - color?: Color; - width?: number; - } - - interface LineSymbol3D extends Symbol3D { - clone(): LineSymbol3D; - } - - interface LineSymbol3DConstructor { - new(properties?: LineSymbol3DProperties): LineSymbol3D; - - fromJSON(json: any): LineSymbol3D; - } - - export const LineSymbol3D: LineSymbol3DConstructor; - - interface LineSymbol3DProperties extends Symbol3DProperties { - - } - - interface LineSymbol3DLayer extends Symbol3DLayer { - size: number | string; - - clone(): LineSymbol3DLayer; - } - - interface LineSymbol3DLayerConstructor { - new(properties?: LineSymbol3DLayerProperties): LineSymbol3DLayer; - - fromJSON(json: any): LineSymbol3DLayer; - } - - export const LineSymbol3DLayer: LineSymbol3DLayerConstructor; - - interface LineSymbol3DLayerProperties extends Symbol3DLayerProperties { - size?: number | string; - } - - interface MarkerSymbol extends Symbol { - angle: number; - xoffset: number; - yoffset: number; - } - - interface MarkerSymbolConstructor { - new(properties?: MarkerSymbolProperties): MarkerSymbol; - - fromJSON(json: any): MarkerSymbol; - } - - export const MarkerSymbol: MarkerSymbolConstructor; - - interface MarkerSymbolProperties extends SymbolProperties { - angle?: number; - xoffset?: number; - yoffset?: number; - } - - interface MeshSymbol3D extends Symbol3D { - clone(): MeshSymbol3D; - } - - interface MeshSymbol3DConstructor { - new(properties?: MeshSymbol3DProperties): MeshSymbol3D; - - fromJSON(json: any): MeshSymbol3D; - } - - export const MeshSymbol3D: MeshSymbol3DConstructor; - - interface MeshSymbol3DProperties extends Symbol3DProperties { - - } - - interface ObjectSymbol3DLayer extends Symbol3DLayer { - anchor: string; - depth: number; - heading: number; - height: number; - resource: ObjectSymbol3DLayerResource; - width: number; - - clone(): ObjectSymbol3DLayer; - } - - interface ObjectSymbol3DLayerConstructor { - new(properties?: ObjectSymbol3DLayerProperties): ObjectSymbol3DLayer; - - fromJSON(json: any): ObjectSymbol3DLayer; - } - - export const ObjectSymbol3DLayer: ObjectSymbol3DLayerConstructor; - - interface ObjectSymbol3DLayerProperties extends Symbol3DLayerProperties { - anchor?: string; - depth?: number; - heading?: number; - height?: number; - resource?: ObjectSymbol3DLayerResource; - width?: number; - } - - interface PictureFillSymbol extends FillSymbol { - height: number; - url: string; - width: number; - xoffset: number; - xscale: number; - yoffset: number; - yscale: number; - } - - interface PictureFillSymbolConstructor { - new(properties?: PictureFillSymbolProperties): PictureFillSymbol; - - fromJSON(json: any): PictureFillSymbol; - } - - export const PictureFillSymbol: PictureFillSymbolConstructor; - - interface PictureFillSymbolProperties extends FillSymbolProperties { - height?: number; - url?: string; - width?: number; - xoffset?: number; - xscale?: number; - yoffset?: number; - yscale?: number; - } - - interface PictureMarkerSymbol extends MarkerSymbol { - height: number; - url: string; - width: number; - - clone(): PictureMarkerSymbol; - } - - interface PictureMarkerSymbolConstructor { - new(properties?: PictureMarkerSymbolProperties): PictureMarkerSymbol; - - fromJSON(json: any): PictureMarkerSymbol; - } - - export const PictureMarkerSymbol: PictureMarkerSymbolConstructor; - - interface PictureMarkerSymbolProperties extends MarkerSymbolProperties { - height?: number; - url?: string; - width?: number; - } - - interface PathSymbol3DLayer extends Symbol3DLayer { - size: number; - - clone(): PathSymbol3DLayer; - } - - interface PathSymbol3DLayerConstructor { - new(properties?: PathSymbol3DLayerProperties): PathSymbol3DLayer; - - fromJSON(json: any): PathSymbol3DLayer; - } - - export const PathSymbol3DLayer: PathSymbol3DLayerConstructor; - - interface PathSymbol3DLayerProperties extends Symbol3DLayerProperties { - size?: number; - } - - interface PointSymbol3D extends Symbol3D { - clone(): PointSymbol3D; - } - - interface PointSymbol3DConstructor { - new(properties?: PointSymbol3DProperties): PointSymbol3D; - - fromJSON(json: any): PointSymbol3D; - } - - export const PointSymbol3D: PointSymbol3DConstructor; - - interface PointSymbol3DProperties extends Symbol3DProperties { - - } - - interface PolygonSymbol3D extends Symbol3D { - clone(): PolygonSymbol3D; - } - - interface PolygonSymbol3DConstructor { - new(properties?: PolygonSymbol3DProperties): PolygonSymbol3D; - - fromJSON(json: any): PolygonSymbol3D; - } - - export const PolygonSymbol3D: PolygonSymbol3DConstructor; - - interface PolygonSymbol3DProperties extends Symbol3DProperties { - - } - - interface SimpleFillSymbol extends FillSymbol { - color: Color; - style: string; - - clone(): SimpleFillSymbol; - } - - interface SimpleFillSymbolConstructor { - new(properties?: SimpleFillSymbolProperties): SimpleFillSymbol; - - fromJSON(json: any): SimpleFillSymbol; - } - - export const SimpleFillSymbol: SimpleFillSymbolConstructor; - - interface SimpleFillSymbolProperties extends FillSymbolProperties { - color?: Color; - style?: string; - } - - interface SimpleLineSymbol extends LineSymbol { - cap: string; - join: string; - miterLimit: number; - style: string; - - clone(): SimpleLineSymbol; - } - - interface SimpleLineSymbolConstructor { - new(properties?: SimpleLineSymbolProperties): SimpleLineSymbol; - - fromJSON(json: any): SimpleLineSymbol; - } - - export const SimpleLineSymbol: SimpleLineSymbolConstructor; - - interface SimpleLineSymbolProperties extends LineSymbolProperties { - cap?: string; - join?: string; - miterLimit?: number; - style?: string; - } - - interface SimpleMarkerSymbol extends MarkerSymbol { - color: Color; - outline: SimpleLineSymbol; - path: string; - size: number; - style: string; - - clone(): SimpleMarkerSymbol; - } - - interface SimpleMarkerSymbolConstructor { - new(properties?: SimpleMarkerSymbolProperties): SimpleMarkerSymbol; - - fromJSON(json: any): SimpleMarkerSymbol; - } - - export const SimpleMarkerSymbol: SimpleMarkerSymbolConstructor; - - interface SimpleMarkerSymbolProperties extends MarkerSymbolProperties { - color?: Color; - outline?: SimpleLineSymbolProperties; - path?: string; - size?: number; - style?: string; - } - - interface Symbol extends Accessor, JSONSupport { - type: string; - } - - interface SymbolConstructor { - new(properties?: SymbolProperties): Symbol; - - fromJSON(json: any): Symbol; - } - - export const Symbol: SymbolConstructor; - - interface SymbolProperties { - type?: string; - } - - interface Symbol3D extends Symbol { - styleOrigin: Symbol3DStyleOrigin; - symbolLayers: Collection; - } - - interface Symbol3DConstructor { - new(properties?: Symbol3DProperties): Symbol3D; - - fromJSON(json: any): Symbol3D; - } - - export const Symbol3D: Symbol3DConstructor; - - interface Symbol3DProperties extends SymbolProperties { - styleOrigin?: Symbol3DStyleOrigin; - symbolLayers?: Collection; - } - - interface Symbol3DLayer extends Accessor, JSONSupport { - material: any; - type: string; - } - - interface Symbol3DLayerConstructor { - new(properties?: Symbol3DLayerProperties): Symbol3DLayer; - - fromJSON(json: any): Symbol3DLayer; - } - - export const Symbol3DLayer: Symbol3DLayerConstructor; - - interface Symbol3DLayerProperties { - material?: any; - type?: string; - } - - interface TextSymbol extends Symbol { - angle: number; - backgroundColor: Color; - borderLineColor: Color; - borderLineSize: number; - color: Color; - font: Font; - haloColor: Color; - haloSize: number; - horizontalAlignment: string; - kerning: boolean; - rotated: boolean; - text: string; - verticalAlignment: string; - xoffset: number; - yoffset: number; - - clone(): TextSymbol; - } - - interface TextSymbolConstructor { - new(properties?: TextSymbolProperties): TextSymbol; - - fromJSON(json: any): TextSymbol; - } - - export const TextSymbol: TextSymbolConstructor; - - interface TextSymbolProperties extends SymbolProperties { - angle?: number; - backgroundColor?: Color; - borderLineColor?: Color; - borderLineSize?: number; - color?: Color; - font?: FontProperties; - haloColor?: Color; - haloSize?: number; - horizontalAlignment?: string; - kerning?: boolean; - rotated?: boolean; - text?: string; - verticalAlignment?: string; - xoffset?: number; - yoffset?: number; - } - - interface TextSymbol3DLayer extends Symbol3DLayer { - font: TextSymbol3DLayerFont; - size: number | string; - text: string; - - clone(): TextSymbol3DLayer; - } - - interface TextSymbol3DLayerConstructor { - new(properties?: TextSymbol3DLayerProperties): TextSymbol3DLayer; - - fromJSON(json: any): TextSymbol3DLayer; - } - - export const TextSymbol3DLayer: TextSymbol3DLayerConstructor; - - interface TextSymbol3DLayerProperties extends Symbol3DLayerProperties { - font?: TextSymbol3DLayerFont; - size?: number | string; - text?: string; - } - - interface WebStyleSymbol extends Symbol { - name: string; - portal: Portal; - styleName: string; - styleUrl: string; - - clone(): WebStyleSymbol; - fetchSymbol(): IPromise; - } - - interface WebStyleSymbolConstructor { - new(properties?: WebStyleSymbolProperties): WebStyleSymbol; - - fromJSON(json: any): WebStyleSymbol; - } - - export const WebStyleSymbol: WebStyleSymbolConstructor; - - interface WebStyleSymbolProperties extends SymbolProperties { - name?: string; - portal?: PortalProperties; - styleName?: string; - styleUrl?: string; - } - - interface ClosestFacilityTask extends Task { - solve(params: ClosestFacilityParameters, requestOptions?: any): IPromise; - } - - interface ClosestFacilityTaskConstructor { - new(properties?: ClosestFacilityTaskProperties): ClosestFacilityTask; - } - - export const ClosestFacilityTask: ClosestFacilityTaskConstructor; - - interface ClosestFacilityTaskProperties extends TaskProperties { - - } - - interface FindTask extends Task { - gdbVersion: string; - - execute(params: FindParameters, requestOptions?: any): IPromise; - } - - interface FindTaskConstructor { - new(properties?: FindTaskProperties): FindTask; - } - - export const FindTask: FindTaskConstructor; - - interface FindTaskProperties extends TaskProperties { - gdbVersion?: string; - } - - interface GeometryService extends Task { - areasAndLengths(areasAndLengthsParameters: AreasAndLengthsParameters, requestOptions?: any): IPromise; - autoComplete(polygons: Polygon[], polylines: Polyline[], requestOptions?: any): IPromise; - buffer(bufferParameters: BufferParameters, requestOptions?: any): IPromise; - convexHull(geometries: Geometry[], requestOptions?: any): IPromise; - cut(geometries: Geometry[], cutter: Polyline, requestOptions?: any): IPromise; - densify(densifyParameters: DensifyParameters, requestOptions?: any): IPromise; - difference(geometries: Geometry[], geometry: Geometry, requestOptions?: any): IPromise; - distance(params: DistanceParameters, requestOptions?: any): IPromise; - fromGeoCoordinateString(params: GeometryServiceFromGeoCoordinateStringParams, requestOptions?: any): IPromise; - generalize(params: GeneralizeParameters, requestOptions?: any): IPromise; - intersect(geometries: Geometry[], intersector: Geometry, requestOptions?: any): IPromise; - labelPoints(polygons: Polygon[], requestOptions?: any): IPromise; - lengths(params: LengthsParameters, requestOptions?: any): IPromise; - offset(params: OffsetParameters, requestOptions?: any): IPromise; - project(params: ProjectParameters, requestOptions?: any): IPromise; - relation(params: RelationParameters, requestOptions?: any): IPromise; - reshape(targetGeometry: Geometry, reshaper: Geometry, requestOptions?: any): IPromise; - simplify(geometries: Geometry[], requestOptions?: any): IPromise; - toGeoCoordinateString(params: GeometryServiceToGeoCoordinateStringParams, requestOptions?: any): IPromise; - trimExtend(params: TrimExtendParameters, requestOptions?: any): IPromise; - union(geometries: Geometry[], requestOptions?: any): IPromise; - } - - interface GeometryServiceConstructor { - new(properties?: GeometryServiceProperties): GeometryService; - } - - export const GeometryService: GeometryServiceConstructor; - - interface GeometryServiceProperties extends TaskProperties { - - } - - interface Geoprocessor extends Task { - outSpatialReference: SpatialReference; - processSpatialReference: SpatialReference; - updateDelay: number; - - cancelJob(jobId: string, requestOptions?: any): IPromise; - cancelJobStatusUpdates(jobId: string): void; - checkJobStatus(jobId: string, requestOptions?: any): IPromise; - execute(params: any, requestOptions?: any): IPromise; - getResultData(jobId: string, resultName: string, requestOptions?: any): IPromise; - getResultImage(jobId: string, resultName: string, imageParams: ImageParameters, requestOptions?: any): IPromise; - getResultMapImageLayer(jobId: string): MapImageLayer; - submitJob(params: any, requestOptions?: any): IPromise; - } - - interface GeoprocessorConstructor { - new(properties?: GeoprocessorProperties): Geoprocessor; - } - - export const Geoprocessor: GeoprocessorConstructor; - - interface GeoprocessorProperties extends TaskProperties { - outSpatialReference?: SpatialReferenceProperties; - processSpatialReference?: SpatialReferenceProperties; - updateDelay?: number; - } - - interface IdentifyTask extends Task { - gdbVersion: string; - - execute(params: IdentifyParameters, requestOptions?: any): IPromise; - } - - interface IdentifyTaskConstructor { - new(properties?: IdentifyTaskProperties): IdentifyTask; - } - - export const IdentifyTask: IdentifyTaskConstructor; - - interface IdentifyTaskProperties extends TaskProperties { - gdbVersion?: string; - } - - interface ImageServiceIdentifyTask extends Task { - execute(params: ImageServiceIdentifyParameters, requestOptions?: any): IPromise; - } - - interface ImageServiceIdentifyTaskConstructor { - new(properties?: ImageServiceIdentifyTaskProperties): ImageServiceIdentifyTask; - } - - export const ImageServiceIdentifyTask: ImageServiceIdentifyTaskConstructor; - - interface ImageServiceIdentifyTaskProperties extends TaskProperties { - - } - - interface Locator extends Task { - categories: string[]; - countryCode: string; - outSpatialReference: SpatialReference; - - addressesToLocations(params: LocatorAddressesToLocationsParams, requestOptions?: any): IPromise; - addressToLocations(params: LocatorAddressToLocationsParams, requestOptions?: any): IPromise; - locationToAddress(location: Point, distance?: number, requestOptions?: any): IPromise; - suggestLocations(params: LocatorSuggestLocationsParams, requestOptions?: any): IPromise; - } - - interface LocatorConstructor { - new(properties?: LocatorProperties): Locator; - } - - export const Locator: LocatorConstructor; - - interface LocatorProperties extends TaskProperties { - categories?: string[]; - countryCode?: string; - outSpatialReference?: SpatialReferenceProperties; - } - - interface QueryTask extends Task { - gdbVersion: string; - - execute(params: Query, requestOptions?: any): IPromise; - executeForCount(params: Query, requestOptions?: any): IPromise; - executeForExtent(params: Query, requestOptions?: any): IPromise; - executeForIds(params: Query, requestOptions?: any): IPromise; - executeRelationshipQuery(params: RelationshipQuery, requestOptions?: any): IPromise; - } - - interface QueryTaskConstructor { - new(properties?: QueryTaskProperties): QueryTask; - } - - export const QueryTask: QueryTaskConstructor; - - interface QueryTaskProperties extends TaskProperties { - gdbVersion?: string; - } - - interface PrintTask extends Task { - mode: string; - updateDelay: number; - - execute(params: PrintParameters, requestOptions?: any): IPromise; - } - - interface PrintTaskConstructor { - new(properties?: PrintTaskProperties): PrintTask; - } - - export const PrintTask: PrintTaskConstructor; - - interface PrintTaskProperties extends TaskProperties { - mode?: string; - updateDelay?: number; - } - - interface RouteTask extends Task { - solve(params: RouteParameters, requestOptions?: any): IPromise; - } - - interface RouteTaskConstructor { - new(properties?: RouteTaskProperties): RouteTask; - } - - export const RouteTask: RouteTaskConstructor; - - interface RouteTaskProperties extends TaskProperties { - - } - - interface ServiceAreaTask extends Task { - solve(params: ServiceAreaParameters, requestOptions?: any): IPromise; - } - - interface ServiceAreaTaskConstructor { - new(properties?: ServiceAreaTaskProperties): ServiceAreaTask; - } - - export const ServiceAreaTask: ServiceAreaTaskConstructor; - - interface ServiceAreaTaskProperties extends TaskProperties { - - } - - interface Task extends Accessor { - requestOptions: any; - url: string; - } - - interface TaskConstructor { - new(properties?: TaskProperties): Task; - } - - export const Task: TaskConstructor; - - interface TaskProperties { - requestOptions?: any; - url?: string; - } - - interface AddressCandidate extends Accessor, JSONSupport { - address: string; - attributes: any; - extent: Extent; - location: Point; - score: number; - } - - interface AddressCandidateConstructor { - new(properties?: AddressCandidateProperties): AddressCandidate; - - fromJSON(json: any): AddressCandidate; - } - - export const AddressCandidate: AddressCandidateConstructor; - - interface AddressCandidateProperties { - address?: string; - attributes?: any; - extent?: ExtentProperties; - location?: PointProperties; - score?: number; - } - - interface AreasAndLengthsParameters extends Accessor { - areaUnit: string; - calculationType: string; - lengthUnit: string; - polygons: Polygon[]; - - toJSON(): any; - } - - interface AreasAndLengthsParametersConstructor { - new(properties?: AreasAndLengthsParametersProperties): AreasAndLengthsParameters; - } - - export const AreasAndLengthsParameters: AreasAndLengthsParametersConstructor; - - interface AreasAndLengthsParametersProperties { - areaUnit?: string; - calculationType?: string; - lengthUnit?: string; - polygons?: PolygonProperties[]; - } - - interface BufferParameters extends Accessor { - bufferSpatialReference: SpatialReference; - distances: number[]; - geodesic: boolean; - geometries: Geometry[]; - outSpatialReference: SpatialReference; - unionResults: boolean; - unit: string; - - toJSON(): any; - } - - interface BufferParametersConstructor { - new(properties?: BufferParametersProperties): BufferParameters; - } - - export const BufferParameters: BufferParametersConstructor; - - interface BufferParametersProperties { - bufferSpatialReference?: SpatialReferenceProperties; - distances?: number[]; - geodesic?: boolean; - geometries?: GeometryProperties[]; - outSpatialReference?: SpatialReferenceProperties; - unionResults?: boolean; - unit?: string; - } - - interface ClosestFacilityParameters extends Accessor { - accumulateAttributes: string[]; - attributeParameterValues: ClosestFacilityParametersAttributeParameterValues[]; - defaultCutoff: number; - defaultTargetFacilityCount: number; - directionsLanguage: string; - directionsLengthUnits: string; - directionsOutputType: string; - directionsStyleName: string; - directionsTimeAttribute: string; - doNotLocateOnRestrictedElements: boolean; - facilities: DataLayer | FeatureSet; - impedanceAttribute: string; - incidents: DataLayer | FeatureSet; - outputGeometryPrecision: number; - outputGeometryPrecisionUnits: string; - outputLines: string; - outSpatialReference: SpatialReference; - pointBarriers: DataLayer | FeatureSet; - polygonBarriers: DataLayer | FeatureSet; - polylineBarriers: DataLayer | FeatureSet; - restrictionAttributes: string[]; - restrictUTurns: string; - returnDirections: boolean; - returnFacilities: boolean; - returnIncidents: boolean; - returnPointBarriers: boolean; - returnPolygonBarriers: boolean; - returnPolylineBarriers: boolean; - returnRoutes: boolean; - timeOfDay: Date; - timeOfDayUsage: string; - travelDirection: string; - useHierarchy: boolean; - - toJSON(): any; - } - - interface ClosestFacilityParametersConstructor { - new(properties?: ClosestFacilityParametersProperties): ClosestFacilityParameters; - } - - export const ClosestFacilityParameters: ClosestFacilityParametersConstructor; - - interface ClosestFacilityParametersProperties { - accumulateAttributes?: string[]; - attributeParameterValues?: ClosestFacilityParametersAttributeParameterValues[]; - defaultCutoff?: number; - defaultTargetFacilityCount?: number; - directionsLanguage?: string; - directionsLengthUnits?: string; - directionsOutputType?: string; - directionsStyleName?: string; - directionsTimeAttribute?: string; - doNotLocateOnRestrictedElements?: boolean; - facilities?: DataLayer | FeatureSet; - impedanceAttribute?: string; - incidents?: DataLayer | FeatureSet; - outputGeometryPrecision?: number; - outputGeometryPrecisionUnits?: string; - outputLines?: string; - outSpatialReference?: SpatialReference | string; - pointBarriers?: DataLayer | FeatureSet; - polygonBarriers?: DataLayer | FeatureSet; - polylineBarriers?: DataLayer | FeatureSet; - restrictionAttributes?: string[]; - restrictUTurns?: string; - returnDirections?: boolean; - returnFacilities?: boolean; - returnIncidents?: boolean; - returnPointBarriers?: boolean; - returnPolygonBarriers?: boolean; - returnPolylineBarriers?: boolean; - returnRoutes?: boolean; - timeOfDay?: Date; - timeOfDayUsage?: string; - travelDirection?: string; - useHierarchy?: boolean; - } - - interface ClosestFacilitySolveResult extends Accessor, JSONSupport { - directions: DirectionsFeatureSet; - facilities: Point[]; - incidents: Point[]; - messages: NAMessage[]; - pointBarriers: Point[]; - polygonBarriers: Polygon[]; - polylineBarriers: Polyline[]; - routes: Graphic[]; - } - - interface ClosestFacilitySolveResultConstructor { - new(properties?: ClosestFacilitySolveResultProperties): ClosestFacilitySolveResult; - - fromJSON(json: any): ClosestFacilitySolveResult; - } - - export const ClosestFacilitySolveResult: ClosestFacilitySolveResultConstructor; - - interface ClosestFacilitySolveResultProperties { - directions?: DirectionsFeatureSetProperties; - facilities?: PointProperties[]; - incidents?: PointProperties[]; - messages?: NAMessageProperties[]; - pointBarriers?: PointProperties[]; - polygonBarriers?: PolygonProperties[]; - polylineBarriers?: PolylineProperties[]; - routes?: GraphicProperties[]; - } - - interface DataFile extends Accessor, JSONSupport { - itemId: string; - url: string; - } - - interface DataFileConstructor { - new(properties?: DataFileProperties): DataFile; - - fromJSON(json: any): DataFile; - } - - export const DataFile: DataFileConstructor; - - interface DataFileProperties { - itemId?: string; - url?: string; - } - - interface DataLayer extends Accessor { - geometry: Geometry; - name: string; - spatialRelationship: string; - where: string; - - toJSON(): any; - } - - interface DataLayerConstructor { - new(properties?: DataLayerProperties): DataLayer; - } - - export const DataLayer: DataLayerConstructor; - - interface DataLayerProperties { - geometry?: GeometryProperties; - name?: string; - spatialRelationship?: string; - where?: string; - } - - interface supportDate extends Accessor, JSONSupport { - date: Date; - format: string; - } - - interface supportDateConstructor { - new(properties?: supportDateProperties): supportDate; - - fromJSON(json: any): supportDate; - } - - export const supportDate: supportDateConstructor; - - interface supportDateProperties { - date?: Date; - format?: string; - } - - interface DensifyParameters extends Accessor { - geodesic: boolean; - geometries: Geometry[]; - lengthUnit: string; - maxSegmentLength: number; - - toJSON(): any; - } - - interface DensifyParametersConstructor { - new(properties?: DensifyParametersProperties): DensifyParameters; - } - - export const DensifyParameters: DensifyParametersConstructor; - - interface DensifyParametersProperties { - geodesic?: boolean; - geometries?: GeometryProperties[]; - lengthUnit?: string; - maxSegmentLength?: number; - } - - interface DirectionsFeatureSet extends FeatureSet, Accessor { - extent: Extent; - mergedGeometry: Polyline; - routeId: string; - routeName: string; - strings: any[]; - totalDriveTime: number; - totalLength: number; - totalTime: number; - } - - interface DirectionsFeatureSetConstructor { - new(properties?: DirectionsFeatureSetProperties): DirectionsFeatureSet; - - fromJSON(json: any): DirectionsFeatureSet; - } - - export const DirectionsFeatureSet: DirectionsFeatureSetConstructor; - - interface DirectionsFeatureSetProperties extends FeatureSetProperties { - extent?: ExtentProperties; - mergedGeometry?: PolylineProperties; - routeId?: string; - routeName?: string; - strings?: any[]; - totalDriveTime?: number; - totalLength?: number; - totalTime?: number; - } - - interface DistanceParameters extends Accessor { - distanceUnit: string; - geodesic: boolean; - geometry1: Geometry[]; - geometry2: Geometry[]; - - toJSON(): any; - } - - interface DistanceParametersConstructor { - new(properties?: DistanceParametersProperties): DistanceParameters; - } - - export const DistanceParameters: DistanceParametersConstructor; - - interface DistanceParametersProperties { - distanceUnit?: string; - geodesic?: boolean; - geometry1?: GeometryProperties[]; - geometry2?: GeometryProperties[]; - } - - interface FeatureSet extends Accessor, JSONSupport { - displayFieldName: string; - exceededTransferLimit: boolean; - features: Graphic[]; - fields: Field[]; - geometryType: string; - spatialReference: SpatialReference; - } - - interface FeatureSetConstructor { - new(properties?: FeatureSetProperties): FeatureSet; - - fromJSON(json: any): FeatureSet; - } - - export const FeatureSet: FeatureSetConstructor; - - interface FeatureSetProperties { - displayFieldName?: string; - exceededTransferLimit?: boolean; - features?: GraphicProperties[]; - fields?: FieldProperties[]; - geometryType?: string; - spatialReference?: SpatialReferenceProperties; - } - - interface FindParameters extends Accessor { - contains: boolean; - geometryPrecision: number; - layerIds: number[]; - maxAllowableOffset: number; - outSpatialReference: SpatialReference; - returnGeometry: boolean; - searchFields: string[]; - searchText: string; - - toJSON(): any; - } - - interface FindParametersConstructor { - new(properties?: FindParametersProperties): FindParameters; - } - - export const FindParameters: FindParametersConstructor; - - interface FindParametersProperties { - contains?: boolean; - geometryPrecision?: number; - layerIds?: number[]; - maxAllowableOffset?: number; - outSpatialReference?: SpatialReferenceProperties; - returnGeometry?: boolean; - searchFields?: string[]; - searchText?: string; - } - - interface FindResult extends Accessor, JSONSupport { - displayFieldName: string; - feature: Graphic; - foundFieldName: string; - layerId: number; - layerName: string; - } - - interface FindResultConstructor { - new(properties?: FindResultProperties): FindResult; - - fromJSON(json: any): FindResult; - } - - export const FindResult: FindResultConstructor; - - interface FindResultProperties { - displayFieldName?: string; - feature?: GraphicProperties; - foundFieldName?: string; - layerId?: number; - layerName?: string; - } - - interface GeneralizeParameters extends Accessor { - deviationUnit: string; - geometries: Geometry[]; - maxDeviation: number; - - toJSON(): any; - } - - interface GeneralizeParametersConstructor { - new(properties?: GeneralizeParametersProperties): GeneralizeParameters; - } - - export const GeneralizeParameters: GeneralizeParametersConstructor; - - interface GeneralizeParametersProperties { - deviationUnit?: string; - geometries?: GeometryProperties[]; - maxDeviation?: number; - } - - interface GPMessage extends Accessor, JSONSupport { - description: string; - type: string; - } - - interface GPMessageConstructor { - new(properties?: GPMessageProperties): GPMessage; - - fromJSON(json: any): GPMessage; - } - - export const GPMessage: GPMessageConstructor; - - interface GPMessageProperties { - description?: string; - type?: string; - } - - interface IdentifyParameters extends Accessor { - dpi: number; - geometry: Geometry; - geometryPrecision: number; - height: number; - layerIds: number[]; - layerOption: string; - mapExtent: Extent; - maxAllowableOffset: number; - returnGeometry: boolean; - spatialReference: SpatialReference; - tolerance: number; - width: number; - - toJSON(): any; - } - - interface IdentifyParametersConstructor { - new(properties?: IdentifyParametersProperties): IdentifyParameters; - } - - export const IdentifyParameters: IdentifyParametersConstructor; - - interface IdentifyParametersProperties { - dpi?: number; - geometry?: GeometryProperties; - geometryPrecision?: number; - height?: number; - layerIds?: number[]; - layerOption?: string; - mapExtent?: ExtentProperties; - maxAllowableOffset?: number; - returnGeometry?: boolean; - spatialReference?: SpatialReferenceProperties; - tolerance?: number; - width?: number; - } - - interface IdentifyResult extends Accessor, JSONSupport { - displayFieldName: string; - feature: Graphic; - layerId: number; - layerName: string; - } - - interface IdentifyResultConstructor { - new(properties?: IdentifyResultProperties): IdentifyResult; - - fromJSON(json: any): IdentifyResult; - } - - export const IdentifyResult: IdentifyResultConstructor; - - interface IdentifyResultProperties { - displayFieldName?: string; - feature?: GraphicProperties; - layerId?: number; - layerName?: string; - } - - interface ImageServiceIdentifyParameters extends Accessor { - geometry: Point | Polygon; - mosaicRule: MosaicRule; - noData: string | number; - pixelSize: Symbol; - pixelSizeX: number; - pixelSizeY: number; - renderingRule: RasterFunction; - returnCatalogItems: boolean; - returnGeometry: boolean; - - toJSON(): any; - } - - interface ImageServiceIdentifyParametersConstructor { - new(properties?: ImageServiceIdentifyParametersProperties): ImageServiceIdentifyParameters; - } - - export const ImageServiceIdentifyParameters: ImageServiceIdentifyParametersConstructor; - - interface ImageServiceIdentifyParametersProperties { - geometry?: Point | Polygon; - mosaicRule?: MosaicRuleProperties; - noData?: string | number; - pixelSize?: SymbolProperties; - pixelSizeX?: number; - pixelSizeY?: number; - renderingRule?: RasterFunctionProperties; - returnCatalogItems?: boolean; - returnGeometry?: boolean; - } - - interface ImageServiceIdentifyResult extends Accessor, JSONSupport { - catalogItems: FeatureSet; - catalogItemVisibilities: number[]; - location: Point; - name: string; - objectId: number; - properties: any; - value: string; - } - - interface ImageServiceIdentifyResultConstructor { - new(properties?: ImageServiceIdentifyResultProperties): ImageServiceIdentifyResult; - - fromJSON(json: any): ImageServiceIdentifyResult; - } - - export const ImageServiceIdentifyResult: ImageServiceIdentifyResultConstructor; - - interface ImageServiceIdentifyResultProperties { - catalogItems?: FeatureSetProperties; - catalogItemVisibilities?: number[]; - location?: PointProperties; - name?: string; - objectId?: number; - properties?: any; - value?: string; - } - - interface JobInfo extends Accessor, JSONSupport { - jobId: string; - jobStatus: string; - messages: GPMessage[]; - } - - interface JobInfoConstructor { - new(properties?: JobInfoProperties): JobInfo; - - fromJSON(json: any): JobInfo; - } - - export const JobInfo: JobInfoConstructor; - - interface JobInfoProperties { - jobId?: string; - jobStatus?: string; - messages?: GPMessageProperties[]; - } - - interface LegendLayer extends Accessor { - layerId: string; - subLayerIds: string[]; - title: string; - } - - interface LegendLayerConstructor { - new(properties?: LegendLayerProperties): LegendLayer; - } - - export const LegendLayer: LegendLayerConstructor; - - interface LegendLayerProperties { - layerId?: string; - subLayerIds?: string[]; - title?: string; - } - - interface LengthsParameters extends Accessor { - calculationType: string; - geodesic: boolean; - lengthUnit: number | string; - polylines: Polyline[]; - - toJSON(): any; - } - - interface LengthsParametersConstructor { - new(properties?: LengthsParametersProperties): LengthsParameters; - } - - export const LengthsParameters: LengthsParametersConstructor; - - interface LengthsParametersProperties { - calculationType?: string; - geodesic?: boolean; - lengthUnit?: number | string; - polylines?: PolylineProperties[]; - } - - interface LinearUnit extends Accessor, JSONSupport { - distance: number; - units: string; - } - - interface LinearUnitConstructor { - new(properties?: LinearUnitProperties): LinearUnit; - - fromJSON(json: any): LinearUnit; - } - - export const LinearUnit: LinearUnitConstructor; - - interface LinearUnitProperties { - distance?: number; - units?: string; - } - - interface NAMessage extends Accessor, JSONSupport { - description: string; - type: any; - } - - interface NAMessageConstructor { - new(properties?: NAMessageProperties): NAMessage; - - fromJSON(json: any): NAMessage; - } - - export const NAMessage: NAMessageConstructor; - - interface NAMessageProperties { - description?: string; - type?: any; - } - - interface OffsetParameters extends Accessor { - bevelRatio: number; - geometries: Geometry[]; - offsetDistance: number; - offsetHow: string; - offsetUnit: string; - - toJSON(): any; - } - - interface OffsetParametersConstructor { - new(properties?: OffsetParametersProperties): OffsetParameters; - } - - export const OffsetParameters: OffsetParametersConstructor; - - interface OffsetParametersProperties { - bevelRatio?: number; - geometries?: GeometryProperties[]; - offsetDistance?: number; - offsetHow?: string; - offsetUnit?: string; - } - - interface ParameterValue extends Accessor, JSONSupport { - dataType: string; - value: any; - } - - interface ParameterValueConstructor { - new(properties?: ParameterValueProperties): ParameterValue; - - fromJSON(json: any): ParameterValue; - } - - export const ParameterValue: ParameterValueConstructor; - - interface ParameterValueProperties { - dataType?: string; - value?: any; - } - - interface PrintParameters extends Accessor { - extraParameters: any; - outSpatialReference: SpatialReference; - template: PrintTemplate; - view: MapView; - } - - interface PrintParametersConstructor { - new(properties?: PrintParametersProperties): PrintParameters; - } - - export const PrintParameters: PrintParametersConstructor; - - interface PrintParametersProperties { - extraParameters?: any; - outSpatialReference?: SpatialReferenceProperties; - template?: PrintTemplateProperties; - view?: MapViewProperties; - } - - interface PrintTemplate extends Accessor { - attributionVisible: boolean; - exportOptions: PrintTemplateExportOptions; - format: string; - layout: string; - layoutOptions: PrintTemplateLayoutOptions; - outScale: number; - preserveScale: boolean; - showLabels: boolean; - } - - interface PrintTemplateConstructor { - new(properties?: PrintTemplateProperties): PrintTemplate; - } - - export const PrintTemplate: PrintTemplateConstructor; - - interface PrintTemplateProperties { - attributionVisible?: boolean; - exportOptions?: PrintTemplateExportOptions; - format?: string; - layout?: string; - layoutOptions?: PrintTemplateLayoutOptions; - outScale?: number; - preserveScale?: boolean; - showLabels?: boolean; - } - - interface ProjectParameters extends Accessor { - geometries: Geometry[]; - outSR: SpatialReference; - transformation: ProjectParametersTransformation; - transformForward: boolean; - - toJSON(): any; - } - - interface ProjectParametersConstructor { - new(properties?: ProjectParametersProperties): ProjectParameters; - } - - export const ProjectParameters: ProjectParametersConstructor; - - interface ProjectParametersProperties { - geometries?: GeometryProperties[]; - outSR?: SpatialReferenceProperties; - transformation?: ProjectParametersTransformation; - transformForward?: boolean; - } - - interface Query extends Accessor { - distance: number; - geometry: Geometry; - geometryPrecision: number; - groupByFieldsForStatistics: string[]; - maxAllowableOffset: number; - multipatchOption: string; - num: number; - objectIds: number[]; - orderByFields: string[]; - outFields: string[]; - outSpatialReference: SpatialReference; - outStatistics: StatisticDefinition[]; - pixelSize: Symbol; - quantizationParameters: QueryQuantizationParameters; - relationParam: string; - returnDistinctValues: boolean; - returnGeometry: boolean; - returnZ: boolean; - spatialRelationship: string; - start: number; - text: string; - units: string; - where: string; - - toJSON(): any; - } - - interface QueryConstructor { - new(properties?: QueryProperties): Query; - } - - export const Query: QueryConstructor; - - interface QueryProperties { - distance?: number; - geometry?: GeometryProperties; - geometryPrecision?: number; - groupByFieldsForStatistics?: string[]; - maxAllowableOffset?: number; - multipatchOption?: string; - num?: number; - objectIds?: number[]; - orderByFields?: string[]; - outFields?: string[]; - outSpatialReference?: SpatialReferenceProperties; - outStatistics?: StatisticDefinitionProperties[]; - pixelSize?: SymbolProperties; - quantizationParameters?: QueryQuantizationParameters; - relationParam?: string; - returnDistinctValues?: boolean; - returnGeometry?: boolean; - returnZ?: boolean; - spatialRelationship?: string; - start?: number; - text?: string; - units?: string; - where?: string; - } - - interface RasterData extends Accessor, JSONSupport { - format: string; - itemId: string; - url: string; - } - - interface RasterDataConstructor { - new(properties?: RasterDataProperties): RasterData; - - fromJSON(json: any): RasterData; - } - - export const RasterData: RasterDataConstructor; - - interface RasterDataProperties { - format?: string; - itemId?: string; - url?: string; - } - - interface RelationParameters extends Accessor { - geometries1: Geometry[]; - geometries2: Geometry[]; - relation: string; - relationParam: string; - - toJSON(): any; - } - - interface RelationParametersConstructor { - new(properties?: RelationParametersProperties): RelationParameters; - } - - export const RelationParameters: RelationParametersConstructor; - - interface RelationParametersProperties { - geometries1?: GeometryProperties[]; - geometries2?: GeometryProperties[]; - relation?: string; - relationParam?: string; - } - - interface RelationshipQuery extends Accessor { - definitionExpression: string; - geometryPrecision: number; - maxAllowableOffset: number; - objectIds: number[]; - outFields: string[]; - outSpatialReference: SpatialReference; - relationshipId: number; - returnGeometry: boolean; - - toJSON(): any; - } - - interface RelationshipQueryConstructor { - new(properties?: RelationshipQueryProperties): RelationshipQuery; - } - - export const RelationshipQuery: RelationshipQueryConstructor; - - interface RelationshipQueryProperties { - definitionExpression?: string; - geometryPrecision?: number; - maxAllowableOffset?: number; - objectIds?: number[]; - outFields?: string[]; - outSpatialReference?: SpatialReferenceProperties; - relationshipId?: number; - returnGeometry?: boolean; - } - - interface RouteParameters extends Accessor { - accumulateAttributes: string[]; - attributeParameterValues: AttributeParamValue; - barriers: DataLayer | FeatureSet; - directionsLanguage: string; - directionsLengthUnits: string; - directionsOutputType: string; - directionsStyleName: string; - directionsTimeAttribute: string; - doNotLocateOnRestrictedElements: boolean; - findBestSequence: boolean; - ignoreInvalidLocations: boolean; - impedanceAttribute: string; - outputGeometryPrecision: number; - outputGeometryPrecisionUnits: string; - outputLines: string; - outSpatialReference: SpatialReference; - polygonBarriers: DataLayer | FeatureSet; - polylineBarriers: DataLayer | FeatureSet; - preserveFirstStop: boolean; - preserveLastStop: boolean; - restrictionAttributes: string[]; - restrictUTurns: string; - returnBarriers: boolean; - returnDirections: boolean; - returnPolygonBarriers: boolean; - returnPolylineBarriers: boolean; - returnRoutes: boolean; - returnStops: boolean; - returnZ: boolean; - startTime: Date; - startTimeIsUTC: boolean; - stops: DataLayer | FeatureSet; - useHierarchy: boolean; - useTimeWindows: boolean; - - toJSON(): any; - } - - interface RouteParametersConstructor { - new(properties?: RouteParametersProperties): RouteParameters; - } - - export const RouteParameters: RouteParametersConstructor; - - interface RouteParametersProperties { - accumulateAttributes?: string[]; - attributeParameterValues?: AttributeParamValue; - barriers?: DataLayer | FeatureSet; - directionsLanguage?: string; - directionsLengthUnits?: string; - directionsOutputType?: string; - directionsStyleName?: string; - directionsTimeAttribute?: string; - doNotLocateOnRestrictedElements?: boolean; - findBestSequence?: boolean; - ignoreInvalidLocations?: boolean; - impedanceAttribute?: string; - outputGeometryPrecision?: number; - outputGeometryPrecisionUnits?: string; - outputLines?: string; - outSpatialReference?: SpatialReferenceProperties; - polygonBarriers?: DataLayer | FeatureSet; - polylineBarriers?: DataLayer | FeatureSet; - preserveFirstStop?: boolean; - preserveLastStop?: boolean; - restrictionAttributes?: string[]; - restrictUTurns?: string; - returnBarriers?: boolean; - returnDirections?: boolean; - returnPolygonBarriers?: boolean; - returnPolylineBarriers?: boolean; - returnRoutes?: boolean; - returnStops?: boolean; - returnZ?: boolean; - startTime?: Date; - startTimeIsUTC?: boolean; - stops?: DataLayer | FeatureSet; - useHierarchy?: boolean; - useTimeWindows?: boolean; - } - - interface RouteResult extends Accessor, JSONSupport { - directions: DirectionsFeatureSet; - route: Graphic; - routeName: string; - stops: Graphic[]; - } - - interface RouteResultConstructor { - new(properties?: RouteResultProperties): RouteResult; - - fromJSON(json: any): RouteResult; - } - - export const RouteResult: RouteResultConstructor; - - interface RouteResultProperties { - directions?: DirectionsFeatureSetProperties; - route?: GraphicProperties; - routeName?: string; - stops?: GraphicProperties[]; - } - - interface ServiceAreaParameters extends Accessor { - accumulateAttributes: string[]; - attributeParameterValues: any[]; - defaultBreaks: number[]; - doNotLocateOnRestrictedElements: boolean; - excludeSourcesFromPolygons: string[]; - facilities: DataLayer | FeatureSet; - impedanceAttribute: string; - mergeSimilarPolygonRanges: boolean; - outputGeometryPrecision: number; - outputGeometryPrecisionUnits: string; - outputLines: string; - outputPolygons: string; - outSpatialReference: SpatialReference; - overlapLines: boolean; - overlapPolygons: boolean; - pointBarriers: DataLayer | FeatureSet; - polygonBarriers: DataLayer | FeatureSet; - polylineBarriers: DataLayer | FeatureSet; - restrictionAttributes: string[]; - restrictUTurns: string; - returnFacilities: boolean; - returnPointBarriers: boolean; - returnPolygonBarriers: boolean; - returnPolylineBarriers: boolean; - splitLinesAtBreaks: boolean; - splitPolygonsAtBreaks: boolean; - timeOfDay: Date; - travelDirection: string; - trimOuterPolygon: boolean; - trimPolygonDistance: number; - trimPolygonDistanceUnits: string; - useHierarchy: boolean; - - toJSON(): any; - } - - interface ServiceAreaParametersConstructor { - new(properties?: ServiceAreaParametersProperties): ServiceAreaParameters; - } - - export const ServiceAreaParameters: ServiceAreaParametersConstructor; - - interface ServiceAreaParametersProperties { - accumulateAttributes?: string[]; - attributeParameterValues?: any[]; - defaultBreaks?: number[]; - doNotLocateOnRestrictedElements?: boolean; - excludeSourcesFromPolygons?: string[]; - facilities?: DataLayer | FeatureSet; - impedanceAttribute?: string; - mergeSimilarPolygonRanges?: boolean; - outputGeometryPrecision?: number; - outputGeometryPrecisionUnits?: string; - outputLines?: string; - outputPolygons?: string; - outSpatialReference?: SpatialReferenceProperties; - overlapLines?: boolean; - overlapPolygons?: boolean; - pointBarriers?: DataLayer | FeatureSet; - polygonBarriers?: DataLayer | FeatureSet; - polylineBarriers?: DataLayer | FeatureSet; - restrictionAttributes?: string[]; - restrictUTurns?: string; - returnFacilities?: boolean; - returnPointBarriers?: boolean; - returnPolygonBarriers?: boolean; - returnPolylineBarriers?: boolean; - splitLinesAtBreaks?: boolean; - splitPolygonsAtBreaks?: boolean; - timeOfDay?: Date; - travelDirection?: string; - trimOuterPolygon?: boolean; - trimPolygonDistance?: number; - trimPolygonDistanceUnits?: string; - useHierarchy?: boolean; - } - - interface ServiceAreaSolveResult extends Accessor, JSONSupport { - facilities: Point[]; - messages: NAMessage[]; - pointBarriers: Point[]; - polygonBarriers: Polygon[]; - polylineBarriers: Polyline[]; - serviceAreaPolygons: Graphic[]; - serviceAreaPolylines: Graphic[]; - } - - interface ServiceAreaSolveResultConstructor { - new(properties?: ServiceAreaSolveResultProperties): ServiceAreaSolveResult; - - fromJSON(json: any): ServiceAreaSolveResult; - } - - export const ServiceAreaSolveResult: ServiceAreaSolveResultConstructor; - - interface ServiceAreaSolveResultProperties { - facilities?: PointProperties[]; - messages?: NAMessageProperties[]; - pointBarriers?: PointProperties[]; - polygonBarriers?: PolygonProperties[]; - polylineBarriers?: PolylineProperties[]; - serviceAreaPolygons?: GraphicProperties[]; - serviceAreaPolylines?: GraphicProperties[]; - } - - interface StatisticDefinition extends Accessor { - onStatisticField: string; - outStatisticFieldName: string; - statisticType: string; - - toJSON(): any; - } - - interface StatisticDefinitionConstructor { - new(properties?: StatisticDefinitionProperties): StatisticDefinition; - } - - export const StatisticDefinition: StatisticDefinitionConstructor; - - interface StatisticDefinitionProperties { - onStatisticField?: string; - outStatisticFieldName?: string; - statisticType?: string; - } - - interface TrimExtendParameters extends Accessor { - extendHow: string; - polylines: Polyline[]; - trimExtendTo: Polyline; - - toJSON(): any; - } - - interface TrimExtendParametersConstructor { - new(properties?: TrimExtendParametersProperties): TrimExtendParameters; - } - - export const TrimExtendParameters: TrimExtendParametersConstructor; - - interface TrimExtendParametersProperties { - extendHow?: string; - polylines?: PolylineProperties[]; - trimExtendTo?: PolylineProperties; - } - - interface MapView extends View { - center: Point; - constraints: MapViewConstraints; - extent: Extent; - resizeAlign: string; - rotation: number; - scale: number; - viewpoint: Viewpoint; - zoom: number; - - goTo(target: number[] | Geometry | Geometry[] | Graphic | Graphic[] | Viewpoint | any, options?: MapViewGoToOptions): IPromise; - hitTest(screenPoint: MapViewHitTestScreenPoint): IPromise; - on(type: string | string[], modifiersOrHandler: string[] | Function, handler?: Function): any; - toMap(screenPoint: ScreenPoint, mapPoint?: Point): Point; - toScreen(point: Point, screenPoint?: ScreenPoint): ScreenPoint; - } - - interface MapViewConstructor { - new(properties?: MapViewProperties): MapView; - } - - export const MapView: MapViewConstructor; - - interface MapViewProperties extends ViewProperties { - center?: PointProperties; - constraints?: MapViewConstraints; - extent?: ExtentProperties; - resizeAlign?: string; - rotation?: number; - scale?: number; - viewpoint?: ViewpointProperties; - zoom?: number; - } - - interface SceneView extends View { - camera: Camera; - center: Point; - clippingArea: Extent; - constraints: SceneViewConstraints; - environment: SceneViewEnvironment; - extent: Extent; - qualityProfile: string; - scale: number; - viewingMode: string; - viewpoint: Viewpoint; - zoom: number; - - goTo(target: number[] | Geometry | Geometry[] | Graphic | Graphic[] | Viewpoint | Camera | any, options?: SceneViewGoToOptions): IPromise; - hitTest(screenPoint: SceneViewHitTestScreenPoint): IPromise; - on(type: string | string[], modifiersOrHandler: string[] | Function, handler?: Function): any; - toMap(screenPoint: ScreenPoint, mapPoint?: Point): Point; - toScreen(point: Point, screenPoint?: ScreenPoint): ScreenPoint; - } - - interface SceneViewConstructor { - new(properties?: SceneViewProperties): SceneView; - } - - export const SceneView: SceneViewConstructor; - - interface SceneViewProperties extends ViewProperties { - camera?: CameraProperties; - center?: PointProperties; - clippingArea?: ExtentProperties; - constraints?: SceneViewConstraintsProperties; - environment?: SceneViewEnvironmentProperties; - extent?: ExtentProperties; - qualityProfile?: string; - scale?: number; - viewingMode?: string; - viewpoint?: ViewpointProperties; - zoom?: number; - } - - interface View extends Accessor, corePromise, Evented, BreakpointsOwner, DOMContainer { - allLayerViews: Collection; - animation: ViewAnimation; - graphics: Collection; - interacting: boolean; - layerViews: Collection; - map: Map; - padding: ViewPadding; - ready: boolean; - spatialReference: SpatialReference; - stationary: boolean; - type: string; - updating: boolean; - - whenLayerView(layer: Layer): IPromise; - } - - interface ViewConstructor { - new(properties?: ViewProperties): View; - } - - export const View: ViewConstructor; - - interface ViewProperties extends BreakpointsOwnerProperties, DOMContainerProperties { - allLayerViews?: Collection; - animation?: ViewAnimationProperties; - graphics?: Collection; - interacting?: boolean; - layerViews?: Collection; - map?: MapProperties; - padding?: ViewPadding; - ready?: boolean; - spatialReference?: SpatialReferenceProperties; - stationary?: boolean; - type?: string; - updating?: boolean; - } - - interface ViewAnimation extends Accessor, corePromise { - state: string; - target: Viewpoint; - - finish(): void; - stop(): void; - } - - interface ViewAnimationConstructor { - new(properties?: ViewAnimationProperties): ViewAnimation; - } - - export const ViewAnimation: ViewAnimationConstructor; - - interface ViewAnimationProperties { - state?: string; - target?: ViewpointProperties; - } - - interface LayerView extends Accessor, corePromise { - layer: Layer; - suspended: boolean; - updating: boolean; - visible: boolean; - } - - interface LayerViewConstructor { - new(properties?: LayerViewProperties): LayerView; - } - - export const LayerView: LayerViewConstructor; - - interface LayerViewProperties { - layer?: LayerProperties; - suspended?: boolean; - updating?: boolean; - visible?: boolean; - } - - interface FeatureLayerView extends LayerView { - queryExtent(params?: Query): IPromise; - queryFeatureCount(params?: Query): IPromise; - queryFeatures(params?: Query): IPromise; - queryObjectIds(params?: Query): IPromise; - } - - interface FeatureLayerViewConstructor { - new(properties?: FeatureLayerViewProperties): FeatureLayerView; - } - - export const FeatureLayerView: FeatureLayerViewConstructor; - - interface FeatureLayerViewProperties extends LayerViewProperties { - - } - - interface GraphicsLayerView extends LayerView { - queryGraphics(): IPromise; - } - - interface GraphicsLayerViewConstructor { - new(properties?: GraphicsLayerViewProperties): GraphicsLayerView; - } - - export const GraphicsLayerView: GraphicsLayerViewConstructor; - - interface GraphicsLayerViewProperties extends LayerViewProperties { - - } - - interface ImageryLayerView extends LayerView { - pixelData: ImageryLayerViewPixelData; - } - - interface ImageryLayerViewConstructor { - new(properties?: ImageryLayerViewProperties): ImageryLayerView; - } - - export const ImageryLayerView: ImageryLayerViewConstructor; - - interface ImageryLayerViewProperties extends LayerViewProperties { - pixelData?: ImageryLayerViewPixelData; - } - - interface UI extends Accessor { - container: any; - height: number; - padding: any; - view: SceneView | MapView; - width: number; - - add(component: any | any[], position?: string | any): void; - empty(position?: string): void; - move(component: any | any[], position?: string): void; - remove(component: any | any[]): void; - } - - interface UIConstructor { - new(properties?: UIProperties): UI; - } - - export const UI: UIConstructor; - - interface UIProperties { - container?: any; - height?: number; - padding?: any | number; - view?: SceneView | MapView; - width?: number; - } - - interface DefaultUI extends UI { - components: string[]; - } - - interface DefaultUIConstructor { - new(properties?: DefaultUIProperties): DefaultUI; - } - - export const DefaultUI: DefaultUIConstructor; - - interface DefaultUIProperties extends UIProperties { - components?: string[]; - } - - interface InitialViewProperties extends Accessor, corePromise { - spatialReference: SpatialReference; - viewpoint: Viewpoint; - - clone(): InitialViewProperties; - } - - interface InitialViewPropertiesConstructor { - new(properties?: InitialViewPropertiesProperties): InitialViewProperties; - } - - export const InitialViewProperties: InitialViewPropertiesConstructor; - - interface InitialViewPropertiesProperties { - spatialReference?: SpatialReferenceProperties; - viewpoint?: ViewpointProperties; - } - - interface Environment extends Accessor { - lighting: Lighting; - - clone(): Environment; - } - - interface EnvironmentConstructor { - new(properties?: EnvironmentProperties): Environment; - } - - export const Environment: EnvironmentConstructor; - - interface EnvironmentProperties { - lighting?: LightingProperties; - } - - interface websceneInitialViewProperties extends Accessor, corePromise { - environment: Environment; - spatialReference: SpatialReference; - viewingMode: string; - viewpoint: Viewpoint; - - clone(): websceneInitialViewProperties; - } - - interface websceneInitialViewPropertiesConstructor { - new(properties?: websceneInitialViewPropertiesProperties): websceneInitialViewProperties; - } - - export const websceneInitialViewProperties: websceneInitialViewPropertiesConstructor; - - interface websceneInitialViewPropertiesProperties { - environment?: EnvironmentProperties; - spatialReference?: SpatialReferenceProperties; - viewingMode?: string; - viewpoint?: ViewpointProperties; - } - - interface Lighting extends Accessor, corePromise { - date: Date; - directShadowsEnabled: boolean; - displayUTCOffset: number; - - clone(): Lighting; - } - - interface LightingConstructor { - new(properties?: LightingProperties): Lighting; - } - - export const Lighting: LightingConstructor; - - interface LightingProperties { - date?: Date; - directShadowsEnabled?: boolean; - displayUTCOffset?: number; - } - - interface Presentation extends Accessor { - slides: Collection; - - clone(): Presentation; - } - - interface PresentationConstructor { - new(properties?: PresentationProperties): Presentation; - } - - export const Presentation: PresentationConstructor; - - interface PresentationProperties { - slides?: Collection; - } - - interface Slide extends Accessor { - basemap: Basemap; - description: SlideDescription; - environment: Environment; - id: string; - thumbnail: SlideThumbnail; - title: SlideTitle; - viewpoint: Viewpoint; - visibleLayers: SlideVisibleLayers; - - applyTo(view: SceneView, options?: SlideApplyToOptions): void; - clone(): Slide; - updateFrom(view: SceneView, options?: SlideUpdateFromOptions): IPromise; - } - - interface SlideConstructor { - new(properties?: SlideProperties): Slide; - - - createFrom(view: SceneView, options?: SlideCreateFromOptions): IPromise; - } - - export const Slide: SlideConstructor; - - interface SlideProperties { - basemap?: Basemap | string; - description?: SlideDescriptionProperties; - environment?: EnvironmentProperties; - id?: string; - thumbnail?: SlideThumbnailProperties; - title?: SlideTitleProperties; - viewpoint?: ViewpointProperties; - visibleLayers?: SlideVisibleLayers; - } - - interface Attribution extends Accessor { - view: SceneView | MapView; - viewModel: AttributionViewModel; - } - - interface AttributionConstructor { - new(properties?: AttributionProperties): Attribution; - } - - export const Attribution: AttributionConstructor; - - interface AttributionProperties { - view?: SceneView | MapView; - viewModel?: AttributionViewModel; - } - - interface BasemapToggle extends Accessor, Evented { - activeBasemap: Basemap; - nextBasemap: Basemap; - titleVisible: boolean; - view: SceneView | MapView; - viewModel: BasemapToggleViewModel; - - toggle(): void; - } - - interface BasemapToggleConstructor { - new(properties?: BasemapToggleProperties): BasemapToggle; - } - - export const BasemapToggle: BasemapToggleConstructor; - - interface BasemapToggleProperties { - activeBasemap?: BasemapProperties; - nextBasemap?: Basemap | string; - titleVisible?: boolean; - view?: SceneView | MapView; - viewModel?: BasemapToggleViewModelProperties; - } - - interface ColorSlider extends Accessor { - handlesVisible: boolean; - histogram: any; - histogramVisible: boolean; - histogramWidth: number; - labelsVisible: boolean; - maxValue: number; - minValue: number; - numHandles: number; - statistics: any; - statisticsVisible: boolean; - syncedHandles: boolean; - ticksVisible: boolean; - values: ColorSliderValues[]; - visualVariable: any; - } - - interface ColorSliderConstructor { - new(properties?: ColorSliderProperties): ColorSlider; - } - - export const ColorSlider: ColorSliderConstructor; - - interface ColorSliderProperties { - handlesVisible?: boolean; - histogram?: any; - histogramVisible?: boolean; - histogramWidth?: number; - labelsVisible?: boolean; - maxValue?: number; - minValue?: number; - numHandles?: number; - statistics?: any; - statisticsVisible?: boolean; - syncedHandles?: boolean; - ticksVisible?: boolean; - values?: ColorSliderValues[]; - visualVariable?: any; - } - - interface Compass extends Accessor { - view: SceneView | MapView; - viewModel: CompassViewModel; - - reset(): void; - } - - interface CompassConstructor { - new(properties?: CompassProperties): Compass; - } - - export const Compass: CompassConstructor; - - interface CompassProperties { - view?: SceneView | MapView; - viewModel?: CompassViewModelProperties; - } - - interface Home extends Accessor, Evented { - view: MapView | SceneView; - viewModel: HomeViewModel; - viewpoint: Viewpoint; - - go(): void; - } - - interface HomeConstructor { - new(properties?: HomeProperties): Home; - } - - export const Home: HomeConstructor; - - interface HomeProperties { - view?: MapView | SceneView; - viewModel?: HomeViewModelProperties; - viewpoint?: ViewpointProperties; - } - - interface LayerList extends Widget { - createActionsFunction: Function; - view: SceneView | MapView; - viewModel: LayerListViewModel; - - render(): any; - } - - interface LayerListConstructor { - new(properties?: LayerListProperties): LayerList; - } - - export const LayerList: LayerListConstructor; - - interface LayerListProperties extends WidgetProperties { - createActionsFunction?: Function; - view?: SceneView | MapView; - viewModel?: LayerListViewModelProperties; - } - - interface Legend extends Accessor { - layerInfos: LegendLayerInfos[]; - view: SceneView | MapView; - } - - interface LegendConstructor { - new(properties?: LegendProperties): Legend; - } - - export const Legend: LegendConstructor; - - interface LegendProperties { - layerInfos?: LegendLayerInfos[]; - view?: SceneView | MapView; - } - - interface Locate extends Accessor, Evented { - geolocationOptions: any; - goToLocationEnabled: boolean; - graphic: Graphic; - view: MapView | SceneView; - viewModel: LocateViewModel; - - locate(): IPromise; - } - - interface LocateConstructor { - new(properties?: LocateProperties): Locate; - } - - export const Locate: LocateConstructor; - - interface LocateProperties { - geolocationOptions?: any; - goToLocationEnabled?: boolean; - graphic?: GraphicProperties; - view?: MapView | SceneView; - viewModel?: LocateViewModelProperties; - } - - interface NavigationToggle extends Accessor { - layout: string; - view: SceneView; - viewModel: NavigationToggleViewModel; - - toggle(): void; - } - - interface NavigationToggleConstructor { - new(properties?: NavigationToggleProperties): NavigationToggle; - } - - export const NavigationToggle: NavigationToggleConstructor; - - interface NavigationToggleProperties { - layout?: string; - view?: SceneViewProperties; - viewModel?: NavigationToggleViewModelProperties; - } - - interface Popup extends Accessor, Evented { - actions: Collection; - content: string; - currentDockPosition: string; - dockEnabled: boolean; - dockOptions: PopupDockOptions; - featureCount: number; - features: Graphic[]; - location: Point; - promises: IPromise[]; - rendered: boolean; - selectedFeature: Graphic; - selectedFeatureIndex: number; - title: string; - view: MapView | SceneView; - viewModel: PopupViewModel; - - clear(): void; - close(): void; - next(): PopupViewModel; - open(options?: PopupOpenOptions): void; - previous(): PopupViewModel; - reposition(): void; - triggerAction(actionIndex: number): void; - } - - interface PopupConstructor { - new(properties?: PopupProperties): Popup; - } - - export const Popup: PopupConstructor; - - interface PopupProperties { - actions?: Collection; - content?: string | any; - currentDockPosition?: string; - dockEnabled?: boolean; - dockOptions?: PopupDockOptions; - featureCount?: number; - features?: GraphicProperties[]; - location?: PointProperties; - promises?: IPromise[]; - rendered?: boolean; - selectedFeature?: GraphicProperties; - selectedFeatureIndex?: number; - title?: string; - view?: MapView | SceneView; - viewModel?: PopupViewModelProperties; - } - - interface Print extends Widget { - printServiceUrl: string; - view: MapView; - viewModel: PrintViewModel; - - render(): any; - } - - interface PrintConstructor { - new(properties?: PrintProperties): Print; - } - - export const Print: PrintConstructor; - - interface PrintProperties extends WidgetProperties { - printServiceUrl?: string; - view?: MapViewProperties; - viewModel?: PrintViewModelProperties; - } - - interface Search extends Accessor, Evented { - activeSource: FeatureLayer | Locator; - activeSourceIndex: number; - allPlaceholder: string; - autoSelect: boolean; - defaultSource: any; - maxResults: number; - maxSuggestions: number; - minSuggestCharacters: number; - popupEnabled: boolean; - popupOpenOnSelect: boolean; - popupTemplate: PopupTemplate; - resultGraphic: Graphic; - resultGraphicEnabled: boolean; - results: any[]; - searchAllEnabled: boolean; - searchTerm: string; - selectedResult: any; - sources: SearchSources; - suggestions: any[]; - suggestionsEnabled: boolean; - view: MapView | SceneView; - viewModel: SearchViewModel; - - clear(): void; - search(searchTerm?: string | Geometry | any | number[][]): IPromise; - suggest(value?: string): IPromise; - } - - interface SearchConstructor { - new(properties?: SearchProperties): Search; - } - - export const Search: SearchConstructor; - - interface SearchProperties { - activeSource?: FeatureLayer | Locator; - activeSourceIndex?: number; - allPlaceholder?: string; - autoSelect?: boolean; - defaultSource?: any; - maxResults?: number; - maxSuggestions?: number; - minSuggestCharacters?: number; - popupEnabled?: boolean; - popupOpenOnSelect?: boolean; - popupTemplate?: PopupTemplateProperties; - resultGraphic?: GraphicProperties; - resultGraphicEnabled?: boolean; - results?: any[]; - searchAllEnabled?: boolean; - searchTerm?: string; - selectedResult?: any; - sources?: SearchSources; - suggestions?: any[]; - suggestionsEnabled?: boolean; - view?: MapView | SceneView; - viewModel?: SearchViewModelProperties; - } - - interface SizeSlider extends Accessor { - handlesVisible: boolean; - histogram: any; - histogramVisible: boolean; - histogramWidth: number; - labelsVisible: boolean; - maxSize: number; - maxValue: number; - minSize: number; - minValue: number; - statistics: any; - statisticsVisible: boolean; - ticksVisible: boolean; - values: number[]; - visualVariable: any; - } - - interface SizeSliderConstructor { - new(properties?: SizeSliderProperties): SizeSlider; - } - - export const SizeSlider: SizeSliderConstructor; - - interface SizeSliderProperties { - handlesVisible?: boolean; - histogram?: any; - histogramVisible?: boolean; - histogramWidth?: number; - labelsVisible?: boolean; - maxSize?: number; - maxValue?: number; - minSize?: number; - minValue?: number; - statistics?: any; - statisticsVisible?: boolean; - ticksVisible?: boolean; - values?: number[]; - visualVariable?: any; - } - - interface Track extends Accessor { - geolocationOptions: any; - goToLocationEnabled: boolean; - graphic: Graphic; - tracking: boolean; - view: MapView | SceneView; - viewModel: TrackViewModel; - - start(): void; - stop(): void; - } - - interface TrackConstructor { - new(properties?: TrackProperties): Track; - } - - export const Track: TrackConstructor; - - interface TrackProperties { - geolocationOptions?: any; - goToLocationEnabled?: boolean; - graphic?: GraphicProperties; - tracking?: boolean; - view?: MapView | SceneView; - viewModel?: TrackViewModelProperties; - } - - interface UnivariateColorSizeSlider extends Accessor { - handlesVisible: boolean; - histogram: any; - histogramVisible: boolean; - histogramWidth: number; - labelsVisible: boolean; - maxSize: number; - maxValue: number; - minSize: number; - minValue: number; - statistics: any; - statisticsVisible: boolean; - ticksVisible: boolean; - values: number[]; - visualVariables: any[]; - } - - interface UnivariateColorSizeSliderConstructor { - new(properties?: UnivariateColorSizeSliderProperties): UnivariateColorSizeSlider; - } - - export const UnivariateColorSizeSlider: UnivariateColorSizeSliderConstructor; - - interface UnivariateColorSizeSliderProperties { - handlesVisible?: boolean; - histogram?: any; - histogramVisible?: boolean; - histogramWidth?: number; - labelsVisible?: boolean; - maxSize?: number; - maxValue?: number; - minSize?: number; - minValue?: number; - statistics?: any; - statisticsVisible?: boolean; - ticksVisible?: boolean; - values?: number[]; - visualVariables?: any[]; - } - - interface Widget extends Accessor, Evented { - container: string; - destroyed: boolean; - id: string; - - destroy(): void; - postInitialize(): void; - scheduleRender(): void; - startup(): void; - } - - interface WidgetConstructor { - new(properties?: WidgetProperties): Widget; - } - - export const Widget: WidgetConstructor; - - interface WidgetProperties { - container?: string; - destroyed?: boolean; - id?: string; - } - - interface Zoom extends Accessor { - view: SceneView | MapView; - viewModel: ZoomViewModel; - - zoomIn(): void; - zoomOut(): void; - } - - interface ZoomConstructor { - new(properties?: ZoomProperties): Zoom; - } - - export const Zoom: ZoomConstructor; - - interface ZoomProperties { - view?: SceneView | MapView; - viewModel?: ZoomViewModelProperties; - } - - interface AttributionViewModel { - attributionText: string; - itemDelimiter: string; - state: string; - view: SceneView | MapView; - } - - interface AttributionViewModelConstructor { - new(properties?: any): AttributionViewModel; - } - - export const AttributionViewModel: AttributionViewModelConstructor; - - interface BasemapToggleViewModel extends Accessor, Evented { - activeBasemap: Basemap; - nextBasemap: Basemap; - state: string; - view: SceneView | MapView; - - toggle(): void; - } - - interface BasemapToggleViewModelConstructor { - new(properties?: BasemapToggleViewModelProperties): BasemapToggleViewModel; - } - - export const BasemapToggleViewModel: BasemapToggleViewModelConstructor; - - interface BasemapToggleViewModelProperties { - activeBasemap?: BasemapProperties; - nextBasemap?: Basemap | string; - state?: string; - view?: SceneView | MapView; - } - - interface CompassViewModel extends Accessor { - state: string; - view: SceneView | MapView; - - reset(): void; - } - - interface CompassViewModelConstructor { - new(properties?: CompassViewModelProperties): CompassViewModel; - } - - export const CompassViewModel: CompassViewModelConstructor; - - interface CompassViewModelProperties { - state?: string; - view?: SceneView | MapView; - } - - interface HomeViewModel extends Accessor, Evented { - state: string; - view: MapView | SceneView; - viewpoint: Viewpoint; - - go(): void; - } - - interface HomeViewModelConstructor { - new(properties?: HomeViewModelProperties): HomeViewModel; - } - - export const HomeViewModel: HomeViewModelConstructor; - - interface HomeViewModelProperties { - state?: string; - view?: MapView | SceneView; - viewpoint?: ViewpointProperties; - } - - interface LayerListViewModel extends Accessor { - createActionsFunction: Function; - operationalItems: Collection; - state: string; - view: SceneView | MapView; - - triggerAction(actionIndex: number): void; - } - - interface LayerListViewModelConstructor { - new(properties?: LayerListViewModelProperties): LayerListViewModel; - } - - export const LayerListViewModel: LayerListViewModelConstructor; - - interface LayerListViewModelProperties { - createActionsFunction?: Function; - operationalItems?: Collection; - state?: string; - view?: SceneView | MapView; - } - - interface LocateViewModel extends Accessor, Evented, GeolocationPositioning { - state: string; - - locate(): IPromise; - } - - interface LocateViewModelConstructor { - new(properties?: LocateViewModelProperties): LocateViewModel; - } - - export const LocateViewModel: LocateViewModelConstructor; - - interface LocateViewModelProperties extends GeolocationPositioningProperties { - state?: string; - } - - interface NavigationToggleViewModel extends Accessor { - navigationMode: string; - state: string; - view: SceneView; - - toggle(): void; - } - - interface NavigationToggleViewModelConstructor { - new(properties?: NavigationToggleViewModelProperties): NavigationToggleViewModel; - } - - export const NavigationToggleViewModel: NavigationToggleViewModelConstructor; - - interface NavigationToggleViewModelProperties { - navigationMode?: string; - state?: string; - view?: SceneViewProperties; - } - - interface PrintViewModel extends Accessor { - printServiceUrl: string; - updateDelay: number; - view: MapView; - - print(printTemplate: PrintTemplate): IPromise; - } - - interface PrintViewModelConstructor { - new(properties?: PrintViewModelProperties): PrintViewModel; - } - - export const PrintViewModel: PrintViewModelConstructor; - - interface PrintViewModelProperties { - printServiceUrl?: string; - updateDelay?: number; - view?: MapViewProperties; - } - - interface PopupViewModel extends Accessor, Evented { - actions: Collection; - content: string; - featureCount: number; - features: Graphic[]; - location: Point; - pendingPromisesCount: number; - promises: IPromise[]; - selectedFeature: Graphic; - selectedFeatureIndex: number; - state: string; - title: string; - view: MapView | SceneView; - - clear(): void; - next(): PopupViewModel; - previous(): PopupViewModel; - triggerAction(actionIndex: number): void; - } - - interface PopupViewModelConstructor { - new(properties?: PopupViewModelProperties): PopupViewModel; - } - - export const PopupViewModel: PopupViewModelConstructor; - - interface PopupViewModelProperties { - actions?: Collection; - content?: string | any; - featureCount?: number; - features?: GraphicProperties[]; - location?: PointProperties; - pendingPromisesCount?: number; - promises?: IPromise[]; - selectedFeature?: GraphicProperties; - selectedFeatureIndex?: number; - state?: string; - title?: string; - view?: MapView | SceneView; - } - - interface SearchViewModel extends Accessor, Evented { - activeSource: FeatureLayer | Locator; - activeSourceIndex: number; - allPlaceholder: string; - autoSelect: boolean; - defaultSource: any; - maxInputLength: number; - maxResults: number; - maxSuggestions: number; - minSuggestCharacters: number; - placeholder: string; - popupEnabled: boolean; - popupOpenOnSelect: boolean; - popupTemplate: PopupTemplate; - resultGraphic: Graphic; - resultGraphicEnabled: boolean; - results: any[]; - searchAllEnabled: boolean; - searchTerm: string; - selectedResult: any; - sources: SearchViewModelSources[]; - suggestionDelay: number; - suggestions: any[]; - suggestionsEnabled: boolean; - view: MapView | SceneView; - - cancelSuggest(): void; - clear(): void; - search(searchTerm?: string | Geometry | any | number[][]): IPromise; - suggest(value?: string): IPromise; - } - - interface SearchViewModelConstructor { - new(properties?: SearchViewModelProperties): SearchViewModel; - } - - export const SearchViewModel: SearchViewModelConstructor; - - interface SearchViewModelProperties { - activeSource?: FeatureLayer | Locator; - activeSourceIndex?: number; - allPlaceholder?: string; - autoSelect?: boolean; - defaultSource?: any; - maxInputLength?: number; - maxResults?: number; - maxSuggestions?: number; - minSuggestCharacters?: number; - placeholder?: string; - popupEnabled?: boolean; - popupOpenOnSelect?: boolean; - popupTemplate?: PopupTemplateProperties; - resultGraphic?: GraphicProperties; - resultGraphicEnabled?: boolean; - results?: any[]; - searchAllEnabled?: boolean; - searchTerm?: string; - selectedResult?: any; - sources?: SearchViewModelSources[]; - suggestionDelay?: number; - suggestions?: any[]; - suggestionsEnabled?: boolean; - view?: MapView | SceneView; - } - - interface TrackViewModel extends Accessor, Evented, GeolocationPositioning { - state: string; - tracking: boolean; - - start(): void; - stop(): void; - } - - interface TrackViewModelConstructor { - new(properties?: TrackViewModelProperties): TrackViewModel; - } - - export const TrackViewModel: TrackViewModelConstructor; - - interface TrackViewModelProperties extends GeolocationPositioningProperties { - state?: string; - tracking?: boolean; - } - - interface ZoomViewModel extends Accessor { - canZoomIn: boolean; - canZoomOut: boolean; - state: string; - view: SceneView | MapView; - - zoomIn(): void; - zoomOut(): void; - } - - interface ZoomViewModelConstructor { - new(properties?: ZoomViewModelProperties): ZoomViewModel; - } - - export const ZoomViewModel: ZoomViewModelConstructor; - - interface ZoomViewModelProperties { - canZoomIn?: boolean; - canZoomOut?: boolean; - state?: string; - view?: SceneView | MapView; - } - - interface JSONSupport { - toJSON(): any; - } - - interface JSONSupportConstructor { - new(): JSONSupport; - - - fromJSON(json: any): any; - } - - export const JSONSupport: JSONSupportConstructor; - - interface Loadable { - loadError: Error; - loadStatus: string; - loadWarnings: any[]; - - always(callbackOrErrback?: Function): IPromise; - cancelLoad(): void; - isFulfilled(): boolean; - isRejected(): boolean; - isResolved(): boolean; - load(): IPromise; - otherwise(errback?: Function): IPromise; - then(callback?: Function, errback?: Function, progback?: Function): IPromise; - } - - interface LoadableConstructor { - new(): Loadable; - } - - export const Loadable: LoadableConstructor; - - interface LoadableProperties { - loadError?: Error; - loadStatus?: string; - loadWarnings?: any[]; - } - - interface corePromise { - always(callbackOrErrback?: Function): IPromise; - isFulfilled(): boolean; - isRejected(): boolean; - isResolved(): boolean; - otherwise(errback?: Function): IPromise; - then(callback?: Function, errback?: Function, progback?: Function): IPromise; - } - - interface corePromiseConstructor { - new(): corePromise; - } - - export const corePromise: corePromiseConstructor; - - interface DynamicLayer { - portalItem: PortalItem; - url: string; - - getImageUrl(extent: Extent, width: number, height: number, callback: Function): string; - } - - interface DynamicLayerConstructor { - new(): DynamicLayer; - } - - export const DynamicLayer: DynamicLayerConstructor; - - interface DynamicLayerProperties { - portalItem?: PortalItem; - url?: string; - } - - interface TiledLayer { - tileInfo: TileInfo; - - getTileUrl(level: number, row: number, col: number): string; - } - - interface TiledLayerConstructor { - new(properties?: TiledLayerProperties): TiledLayer; - - fromJSON(json: any): TiledLayer; - } - - export const TiledLayer: TiledLayerConstructor; - - interface TiledLayerProperties { - tileInfo?: TileInfoProperties; - } - - interface ArcGISCachedService { - maxScale: number; - minScale: number; - tileInfo: TileInfo; - - fromJSON(json: any): any; - toJSON(): any; - } - - interface ArcGISCachedServiceConstructor { - new(properties?: ArcGISCachedServiceProperties): ArcGISCachedService; - - fromJSON(json: any): ArcGISCachedService; - } - - export const ArcGISCachedService: ArcGISCachedServiceConstructor; - - interface ArcGISCachedServiceProperties { - maxScale?: number; - minScale?: number; - tileInfo?: TileInfoProperties; - } - - interface ArcGISDynamicMapService { - allSublayers: Collection; - dpi: number; - gdbVersion: string; - imageFormat: string; - imageTransparency: boolean; - sublayers: Collection; - - createServiceSublayers(): Collection; - findSublayerById(id: number): Sublayer; - getExportImageParameters(options: ArcGISDynamicMapServiceGetExportImageParametersOptions): any; - } - - interface ArcGISDynamicMapServiceConstructor { - new(): ArcGISDynamicMapService; - } - - export const ArcGISDynamicMapService: ArcGISDynamicMapServiceConstructor; - - interface ArcGISDynamicMapServiceProperties { - allSublayers?: Collection; - dpi?: number; - gdbVersion?: string; - imageFormat?: string; - imageTransparency?: boolean; - sublayers?: Collection; - } - - interface ArcGISImageService { - compressionQuality: number; - compressionTolerance: number; - copyright: string; - definitionExpression: string; - domainFields: Field[]; - fields: Field[]; - format: string; - fullExtent: Extent; - hasMultidimensions: boolean; - hasRasterAttributeTable: boolean; - mosaicRule: MosaicRule; - multidimensionalInfo: any; - pixelType: string; - popupTemplate: PopupTemplate; - rasterAttributeTable: any; - rasterAttributeTableFieldPrefix: string; - rasterFields: Field[]; - renderingRule: RasterFunction; - spatialReference: SpatialReference; - url: string; - version: number; - - fromJSON(json: any): any; - toJSON(): any; - } - - interface ArcGISImageServiceConstructor { - new(properties?: ArcGISImageServiceProperties): ArcGISImageService; - - fromJSON(json: any): ArcGISImageService; - } - - export const ArcGISImageService: ArcGISImageServiceConstructor; - - interface ArcGISImageServiceProperties { - compressionQuality?: number; - compressionTolerance?: number; - copyright?: string; - definitionExpression?: string; - domainFields?: FieldProperties[]; - fields?: FieldProperties[]; - format?: string; - fullExtent?: ExtentProperties; - hasMultidimensions?: boolean; - hasRasterAttributeTable?: boolean; - mosaicRule?: MosaicRuleProperties; - multidimensionalInfo?: any; - pixelType?: string; - popupTemplate?: PopupTemplateProperties; - rasterAttributeTable?: any; - rasterAttributeTableFieldPrefix?: string; - rasterFields?: FieldProperties[]; - renderingRule?: RasterFunctionProperties; - spatialReference?: SpatialReferenceProperties; - url?: string; - version?: number; - } - - interface ArcGISMapService { - copyright: string; - fullExtent: Extent; - spatialReference: SpatialReference; - token: string; - } - - interface ArcGISMapServiceConstructor { - new(properties?: ArcGISMapServiceProperties): ArcGISMapService; - - fromJSON(json: any): ArcGISMapService; - } - - export const ArcGISMapService: ArcGISMapServiceConstructor; - - interface ArcGISMapServiceProperties { - copyright?: string; - fullExtent?: ExtentProperties; - spatialReference?: SpatialReferenceProperties; - token?: string; - } - - interface PortalLayer { - portalItem: PortalItem; - } - - interface PortalLayerConstructor { - new(properties?: PortalLayerProperties): PortalLayer; - - fromJSON(json: any): PortalLayer; - } - - export const PortalLayer: PortalLayerConstructor; - - interface PortalLayerProperties { - portalItem?: PortalItemProperties; - } - - interface ScaleRangeLayer { - maxScale: number; - minScale: number; - } - - interface ScaleRangeLayerConstructor { - new(): ScaleRangeLayer; - } - - export const ScaleRangeLayer: ScaleRangeLayerConstructor; - - interface ScaleRangeLayerProperties { - maxScale?: number; - minScale?: number; - } - - interface SceneService { - copyright: string; - layerId: number; - spatialReference: SpatialReference; - token: string; - url: string; - version: SceneServiceVersion; - } - - interface SceneServiceConstructor { - new(properties?: SceneServiceProperties): SceneService; - - fromJSON(json: any): SceneService; - } - - export const SceneService: SceneServiceConstructor; - - interface SceneServiceProperties { - copyright?: string; - layerId?: number; - spatialReference?: SpatialReferenceProperties; - token?: string; - url?: string; - version?: SceneServiceVersion; - } - - interface VisualVariablesMixin { - visualVariables: any[]; - } - - interface VisualVariablesMixinConstructor { - new(): VisualVariablesMixin; - } - - export const VisualVariablesMixin: VisualVariablesMixinConstructor; - - interface VisualVariablesMixinProperties { - visualVariables?: any[]; - } - - interface LayersMixin { - layers: Collection; - - add(layers: Layer, index?: number): void; - addMany(layers: Layer[], index?: number): void; - findLayerById(layerId: string): Layer; - remove(layer: Layer): Layer; - removeAll(): Layer[]; - removeMany(layers: Layer[]): Layer[]; - reorder(layer: Layer, index: number): Layer; - } - - interface LayersMixinConstructor { - new(): LayersMixin; - } - - export const LayersMixin: LayersMixinConstructor; - - interface LayersMixinProperties { - layers?: Collection; - } - - interface BreakpointsOwner { - breakpoints: BreakpointsOwnerBreakpoints; - heightBreakpoint: string; - orientation: string; - widthBreakpoint: string; - } - - interface BreakpointsOwnerConstructor { - new(): BreakpointsOwner; - } - - export const BreakpointsOwner: BreakpointsOwnerConstructor; - - interface BreakpointsOwnerProperties { - breakpoints?: BreakpointsOwnerBreakpoints; - heightBreakpoint?: string; - orientation?: string; - widthBreakpoint?: string; - } - - interface DOMContainer { - container: string; - height: number; - popup: Popup; - resizing: boolean; - size: number[]; - suspended: boolean; - ui: DefaultUI; - width: number; - } - - interface DOMContainerConstructor { - new(): DOMContainer; - } - - export const DOMContainer: DOMContainerConstructor; - - interface DOMContainerProperties { - container?: string; - height?: number; - popup?: Popup; - resizing?: boolean; - size?: number[]; - suspended?: boolean; - ui?: DefaultUI; - width?: number; - } - - interface GeolocationPositioning { - geolocationOptions: any; - goToLocationEnabled: boolean; - graphic: Graphic; - view: MapView | SceneView; - } - - interface GeolocationPositioningConstructor { - new(): GeolocationPositioning; - } - - export const GeolocationPositioning: GeolocationPositioningConstructor; - - interface GeolocationPositioningProperties { - geolocationOptions?: any; - goToLocationEnabled?: boolean; - graphic?: Graphic; - view?: MapView | SceneView; - } - - interface config { - geometryServiceUrl: string; - portalUrl: string; - request: configRequest; - } - - export const config: config; - - interface kernel { - version: string; - } - - export const kernel: kernel; - - interface request { - esriRequest(url: string, options?: requestEsriRequestOptions): IPromise; - } - - const __requestMapped: request; - export const request: typeof __requestMapped.esriRequest; - - - interface lang { - clone(elem: any): any; - } - - export const lang: lang; - - interface promiseUtils { - eachAlways(promises: IPromise[]): IPromise[]; - reject(error?: any): IPromise; - resolve(value?: any): IPromise; - } - - export const promiseUtils: promiseUtils; - - interface urlUtils { - addProxyRule(rule: urlUtilsAddProxyRuleRule): number; - getProxyRule(url: string): any; - urlToObject(url: string): any; - } - - export const urlUtils: urlUtils; - - interface watchUtils { - init(obj: Accessor, propertyName: string | string[], callback: WatchCallback): WatchHandle; - on(obj: Accessor, propertyName: string, eventName: string, eventHandler: Function, attachedHandler?: EventAttachedCallback, detachedHandler?: EventAttachedCallback): WatchHandle; - once(obj: Accessor, propertyName: string, callback?: WatchCallback): PromisedWatchHandle; - pausable(obj: Accessor, propertyName: string, callback?: WatchCallback): PausableWatchHandle; - watch(obj: Accessor, propertyName: string, callback: WatchCallback): WatchHandle; - when(obj: Accessor, propertyName: string, callback: WatchCallback): WatchHandle; - whenDefined(obj: Accessor, propertyName: string, callback: WatchCallback): WatchHandle; - whenDefinedOnce(obj: Accessor, propertyName: string, callback?: WatchCallback): PromisedWatchHandle; - whenFalse(obj: Accessor, propertyName: string, callback: WatchCallback): WatchHandle; - whenFalseOnce(obj: Accessor, propertyName: string, callback?: WatchCallback): PromisedWatchHandle; - whenNot(obj: Accessor, propertyName: string, callback: WatchCallback): WatchHandle; - whenNotOnce(obj: Accessor, propertyName: string, callback?: WatchCallback): PromisedWatchHandle; - whenOnce(obj: Accessor, propertyName: string, callback?: WatchCallback): PromisedWatchHandle; - whenTrue(obj: Accessor, propertyName: string, callback: WatchCallback): WatchHandle; - whenTrueOnce(obj: Accessor, propertyName: string, callback?: WatchCallback): PromisedWatchHandle; - whenUndefined(obj: Accessor, propertyName: string, callback: WatchCallback): WatchHandle; - whenUndefinedOnce(obj: Accessor, propertyName: string, callback?: WatchCallback): PromisedWatchHandle; - } - - export const watchUtils: watchUtils; - - interface decorators { - aliasOf(propertyName: string): Function; - cast(propertyName: string): Function; - cast(classFunction: Function): void; - declared(baseClass: T, ...mixinClasses: any[]): T; - property(propertyMetadata?: decoratorsPropertyPropertyMetadata): Function; - subclass(declaredClass?: string): Function; - } - - export const decorators: decorators; - - interface workers { - open(client: any, modulePath: string): IPromise; - } - - export const workers: workers; - - interface geometryEngine { - buffer(geometry: Geometry | Geometry[], distance: number | number[], unit: string | number, unionResults?: boolean): Polygon | Polygon[]; - clip(geometry: Geometry, envelope: Extent): Geometry; - contains(geometry1: Geometry, geometry2: Geometry): boolean; - convexHull(geometry: Geometry, merge?: boolean): Geometry | Geometry[]; - crosses(geometry1: Geometry, geometry2: Geometry): boolean; - cut(geometry: Geometry, cutter: Polyline): Geometry[]; - densify(geometry: Geometry, maxSegmentLength: number, maxSegmentLengthUnit: string | number): Geometry; - difference(inputGeometry: Geometry | Geometry[], subtractor: Geometry): Geometry | Geometry[]; - disjoint(geometry1: Geometry, geometry2: Geometry): boolean; - distance(geometry1: Geometry, geometry2: Geometry, distanceUnit: string | number): number; - equals(geometry1: Geometry, geometry2: Geometry): boolean; - extendedSpatialReferenceInfo(spatialReference: SpatialReference): any; - flipHorizontal(geometry: Geometry, flipOrigin?: Point): Geometry; - flipVertical(geometry: Geometry, flipOrigin?: Point): Geometry; - generalize(geometry: Geometry, maxDeviation: number, removeDegenerateParts?: boolean, maxDeviationUnit?: string | number): Geometry; - geodesicArea(geometry: Polygon, unit: string | number): number; - geodesicBuffer(geometry: Geometry | Geometry[], distance: number | number[], unit: string | number, unionResults?: boolean): Polygon | Polygon[]; - geodesicDensify(geometry: Polyline | Polygon, maxSegmentLength: number, maxSegmentLengthUnit: string | number): Geometry; - geodesicLength(geometry: Geometry, unit: string | number): number; - intersect(geometry: Geometry | Geometry[], intersector: Geometry): Geometry | Geometry[]; - intersects(geometry1: Geometry, geometry2: Geometry): boolean; - isSimple(geometry: Geometry): boolean; - nearestCoordinate(geometry: Geometry, inputPoint: Point): any; - nearestVertex(geometry: Geometry, inputPoint: Point): any; - nearestVertices(geometry: Geometry, inputPoint: Point, searchRadius: number, maxVertexCountToReturn: number): any[]; - offset(geometry: Geometry | Geometry[], offsetDistance: number, offsetUnit: string | number, joinType: string, bevelRatio?: number, flattenError?: number): Geometry | Geometry[]; - overlaps(geometry1: Geometry, geometry2: Geometry): boolean; - planarArea(geometry: Polygon, unit: string | number): number; - planarLength(geometry: Geometry, unit: string | number): number; - relate(geometry1: Geometry, geometry2: Geometry, relation: string): boolean; - rotate(geometry: Geometry, angle: number, rotationOrigin?: Point): Geometry; - simplify(geometry: Geometry): Geometry; - symmetricDifference(leftGeometry: Geometry | Geometry[], rightGeometry: Geometry): Geometry | Geometry[]; - touches(geometry1: Geometry, geometry2: Geometry): boolean; - union(geometries: Geometry[]): Geometry; - within(geometry1: Geometry, geometry2: Geometry): boolean; - } - - export const geometryEngine: geometryEngine; - - interface geometryEngineAsync { - buffer(geometry: Geometry | Geometry[], distance: number | number[], unit: string | number, unionResults?: boolean): IPromise; - clip(geometry: Geometry, envelope: Extent): IPromise; - contains(geometry1: Geometry, geometry2: Geometry): IPromise; - convexHull(geometry: Geometry, merge?: boolean): IPromise; - crosses(geometry1: Geometry, geometry2: Geometry): IPromise; - cut(geometry: Geometry, cutter: Polyline): IPromise; - densify(geometry: Geometry, maxSegmentLength: number, maxSegmentLengthUnit: string | number): IPromise; - difference(inputGeometry: Geometry | Geometry[], subtractor: Geometry): IPromise; - disjoint(geometry1: Geometry, geometry2: Geometry): IPromise; - distance(geometry1: Geometry, geometry2: Geometry, distanceUnit: string | number): IPromise; - equals(geometry1: Geometry, geometry2: Geometry): IPromise; - extendedSpatialReferenceInfo(spatialReference: SpatialReference): IPromise; - flipHorizontal(geometry: Geometry, flipOrigin?: Point): IPromise; - flipVertical(geometry: Geometry, flipOrigin?: Point): IPromise; - generalize(geometry: Geometry, maxDeviation: number, removeDegenerateParts?: boolean, maxDeviationUnit?: string | number): IPromise; - geodesicArea(geometry: Polygon, unit: string | number): IPromise; - geodesicBuffer(geometry: Geometry | Geometry[], distance: number | number[], unit: string | number, unionResults?: boolean): IPromise; - geodesicDensify(geometry: Polyline | Polygon, maxSegmentLength: number, maxSegmentLengthUnit: string | number): IPromise; - geodesicLength(geometry: Geometry, unit: string | number): IPromise; - intersect(geometry: Geometry | Geometry[], intersector: Geometry): IPromise; - intersects(geometry1: Geometry, geometry2: Geometry): IPromise; - isSimple(geometry: Geometry): IPromise; - nearestCoordinate(geometry: Geometry, inputPoint: Point): IPromise; - nearestVertex(geometry: Geometry, inputPoint: Point): IPromise; - nearestVertices(geometry: Geometry, inputPoint: Point, searchRadius: number, maxVertexCountToReturn: number): IPromise; - offset(geometry: Geometry | Geometry[], offsetDistance: number, offsetUnit: string | number, joinType: string, bevelRatio?: number, flattenError?: number): IPromise; - overlaps(geometry1: Geometry, geometry2: Geometry): IPromise; - planarArea(geometry: Polygon, unit: string | number): IPromise; - planarLength(geometry: Geometry, unit: string | number): IPromise; - relate(geometry1: Geometry, geometry2: Geometry, relation: string): IPromise; - rotate(geometry: Geometry, angle: number, rotationOrigin?: Point): IPromise; - simplify(geometry: Geometry): IPromise; - symmetricDifference(leftGeometry: Geometry | Geometry[], rightGeometry: Geometry): IPromise; - touches(geometry1: Geometry, geometry2: Geometry): IPromise; - union(geometries: Geometry[]): IPromise; - within(geometry1: Geometry, geometry2: Geometry): IPromise; - } - - export const geometryEngineAsync: geometryEngineAsync; - - interface jsonUtils { - fromJSON(json: any): Geometry; - getJsonType(geometry: Geometry): string; - } - - export const jsonUtils: jsonUtils; - - interface webMercatorUtils { - canProject(source: SpatialReference | any, target: SpatialReference | any): boolean; - geographicToWebMercator(geometry: Geometry): Geometry; - lngLatToXY(long: number, lat: number): number[]; - project(geometry: Geometry, spatialReference: SpatialReference | any): Geometry; - webMercatorToGeographic(geometry: Geometry): Geometry; - xyToLngLat(x: number, y: number): number[]; - } - - export const webMercatorUtils: webMercatorUtils; - - interface color { - createContinuousRenderer(params: colorCreateContinuousRendererParams): IPromise; - createVisualVariable(params: colorCreateVisualVariableParams): IPromise; - } - - export const color: color; - - interface location { - createRenderer(params: locationCreateRendererParams): IPromise; - } - - export const location: location; - - interface size { - createContinuousRenderer(params: sizeCreateContinuousRendererParams): IPromise; - createVisualVariable(params: sizeCreateVisualVariableParams): IPromise; - } - - export const size: size; - - interface univariateColorSize { - createContinuousRenderer(params: univariateColorSizeCreateContinuousRendererParams): IPromise; - createVisualVariables(params: univariateColorSizeCreateVisualVariablesParams): IPromise; - } - - export const univariateColorSize: univariateColorSize; - - interface classBreaks { - classBreaks(params: classBreaksClassBreaksParams): IPromise; - } - - export const classBreaks: classBreaks; - - interface histogram { - histogram(params: histogramHistogramParams): IPromise; - } - - export const histogram: histogram; - - interface summaryStatistics { - summaryStatistics(params: summaryStatisticsSummaryStatisticsParams): IPromise; - } - - export const summaryStatistics: summaryStatistics; - - interface symbologyColor { - cloneScheme(scheme: any): any; - flipColors(scheme: any): any; - getSchemes(params: colorGetSchemesParams): any; - getThemes(basemap?: string | Basemap): any[]; - } - - export const symbologyColor: symbologyColor; - - interface symbologyLocation { - cloneScheme(scheme: any | any | any): any | any | any; - getSchemes(params: locationGetSchemesParams): any; - } - - export const symbologyLocation: symbologyLocation; - - interface symbologySize { - cloneScheme(scheme: any | any | any): any; - getSchemes(params: sizeGetSchemesParams): any; - } - - export const symbologySize: symbologySize; - - interface supportJsonUtils { - fromJSON(json: any): Renderer; - } - - export const supportJsonUtils: supportJsonUtils; - - interface Action { - className: string; - id: string; - image: string; - title: string; - visible: boolean; - } - - export const Action: Action; - - interface symbolsSupportJsonUtils { - fromJSON(json: any): Symbol; - } - - export const symbolsSupportJsonUtils: symbolsSupportJsonUtils; - - interface externalRenderers { - add(view: SceneView, renderer: any): void; - fromRenderCoordinates(view: SceneView, srcCoordinates: number[], srcStart: number, destCoordinates: number[], destStart: number, destSpatialReference: SpatialReference, count: number): number[]; - remove(view: SceneView, renderer: any): void; - renderCoordinateTransformAt(view: SceneView, origin: number[], srcSpatialReference: SpatialReference, dest: number[]): number[]; - requestRender(view: SceneView): void; - toRenderCoordinates(view: SceneView, srcCoordinates: number[], srcStart: number, srcSpatialReference: SpatialReference, destCoordinates: number[], destStart: number, count: number): number[]; - } - - export const externalRenderers: externalRenderers; - - interface widget { - accessibleHandler(): Function; - join(...classNames: string[]): string; - jsxFactory(selector: string, properties?: any, children?: any): any; - renderable(propertyName?: string | string[]): Function; - vmEvent(eventNames: string | string[]): Function; - } - - export const widget: widget; - - interface ListItem { - actionsOpen: boolean; - actionsSections: Collection; - children: Collection; - error: Error; - open: boolean; - title: string; - updating: boolean; - visibilityMode: string; - visible: boolean; - visibleAtCurrentScale: boolean; - } - - export const ListItem: ListItem; -} - -declare module "esri" { - export import Text = __esri.Text; - - export import Media = __esri.Media; - - export import Fields = __esri.Fields; - - export import Attachments = __esri.Attachments; - - export import WatchHandle = __esri.WatchHandle; - - export import PausableWatchHandle = __esri.PausableWatchHandle; - - export import AttributeParamValue = __esri.AttributeParamValue; - - export import ExternalRenderer = __esri.ExternalRenderer; - - export import RenderContext = __esri.RenderContext; - - export import RenderCamera = __esri.RenderCamera; - - export import SunLight = __esri.SunLight; - - export import ColorAndIntensity = __esri.ColorAndIntensity; - - export import LocatorSource = __esri.LocatorSource; - - export import FeatureLayerSource = __esri.FeatureLayerSource; - - export import SearchViewModelLocatorSource = __esri.SearchViewModelLocatorSource; - - export import SearchViewModelFeatureLayerSource = __esri.SearchViewModelFeatureLayerSource; - - export import GetHeader = __esri.GetHeader; - - export import WatchCallback = __esri.WatchCallback; - - export import ItemCallback = __esri.ItemCallback; - - export import ItemTestCallback = __esri.ItemTestCallback; - - export import ItemMapCallback = __esri.ItemMapCallback; - - export import ItemReduceCallback = __esri.ItemReduceCallback; - - export import ItemCompareCallback = __esri.ItemCompareCallback; - - export import EventAttachedCallback = __esri.EventAttachedCallback; - - export import HandlerCallback = __esri.HandlerCallback; - - export import EasingFunction = __esri.EasingFunction; - - export import PromisedWatchHandle = __esri.PromisedWatchHandle; - - export import GroundQueryElevationOptions = __esri.GroundQueryElevationOptions; - - export import PopupTemplateFieldInfos = __esri.PopupTemplateFieldInfos; - - export import PopupTemplateFieldInfosFormat = __esri.PopupTemplateFieldInfosFormat; - - export import WebMapSourceVersion = __esri.WebMapSourceVersion; - - export import WebSceneSaveAsOptions = __esri.WebSceneSaveAsOptions; - - export import WebSceneSaveOptions = __esri.WebSceneSaveOptions; - - export import WebSceneSourceVersion = __esri.WebSceneSourceVersion; - - export import WebSceneUpdateFromOptions = __esri.WebSceneUpdateFromOptions; - - export import IdentityManagerBaseGenerateTokenOptions = __esri.IdentityManagerBaseGenerateTokenOptions; - - export import IdentityManagerBaseGetCredentialOptions = __esri.IdentityManagerBaseGetCredentialOptions; - - export import IdentityManagerBaseOAuthSignInOptions = __esri.IdentityManagerBaseOAuthSignInOptions; - - export import IdentityManagerBaseRegisterTokenProperties = __esri.IdentityManagerBaseRegisterTokenProperties; - - export import IdentityManagerBaseSetProtocolErrorHandlerHandlerFunction = __esri.IdentityManagerBaseSetProtocolErrorHandlerHandlerFunction; - - export import IdentityManagerBaseSetRedirectionHandlerHandlerFunction = __esri.IdentityManagerBaseSetRedirectionHandlerHandlerFunction; - - export import IdentityManagerBaseSignInOptions = __esri.IdentityManagerBaseSignInOptions; - - export import ElevationLayerQueryElevationOptions = __esri.ElevationLayerQueryElevationOptions; - - export import CSVLayerElevationInfo = __esri.CSVLayerElevationInfo; - - export import FeatureLayerElevationInfo = __esri.FeatureLayerElevationInfo; - - export import GraphicsLayerElevationInfo = __esri.GraphicsLayerElevationInfo; - - export import LayerFromArcGISServerUrlParams = __esri.LayerFromArcGISServerUrlParams; - - export import LayerFromPortalItemParams = __esri.LayerFromPortalItemParams; - - export import SceneLayerElevationInfo = __esri.SceneLayerElevationInfo; - - export import VectorTileLayerCurrentStyleInfo = __esri.VectorTileLayerCurrentStyleInfo; - - export import CodedValueDomainCodedValues = __esri.CodedValueDomainCodedValues; - - export import LabelClassLabelExpressionInfo = __esri.LabelClassLabelExpressionInfo; - - export import PixelBlockAddDataPlaneData = __esri.PixelBlockAddDataPlaneData; - - export import PixelBlockStatistics = __esri.PixelBlockStatistics; - - export import PortalFeaturedGroups = __esri.PortalFeaturedGroups; - - export import PortalItemFetchRelatedItemsParams = __esri.PortalItemFetchRelatedItemsParams; - - export import PortalItemUpdateParams = __esri.PortalItemUpdateParams; - - export import PortalUserAddItemParams = __esri.PortalUserAddItemParams; - - export import PortalUserFetchItemsParams = __esri.PortalUserFetchItemsParams; - - export import ClassBreaksRendererClassBreakInfos = __esri.ClassBreaksRendererClassBreakInfos; - - export import ClassBreaksRendererLegendOptions = __esri.ClassBreaksRendererLegendOptions; - - export import UniqueValueRendererLegendOptions = __esri.UniqueValueRendererLegendOptions; - - export import UniqueValueRendererUniqueValueInfos = __esri.UniqueValueRendererUniqueValueInfos; - - export import PointCloudClassBreaksRendererColorClassBreakInfos = __esri.PointCloudClassBreaksRendererColorClassBreakInfos; - - export import PointCloudStretchRendererStops = __esri.PointCloudStretchRendererStops; - - export import PointCloudUniqueValueRendererColorUniqueValueInfos = __esri.PointCloudUniqueValueRendererColorUniqueValueInfos; - - export import FillSymbol3DLayerOutline = __esri.FillSymbol3DLayerOutline; - - export import IconSymbol3DLayerOutline = __esri.IconSymbol3DLayerOutline; - - export import IconSymbol3DLayerResource = __esri.IconSymbol3DLayerResource; - - export import ObjectSymbol3DLayerResource = __esri.ObjectSymbol3DLayerResource; - - export import Symbol3DStyleOrigin = __esri.Symbol3DStyleOrigin; - - export import TextSymbol3DLayerFont = __esri.TextSymbol3DLayerFont; - - export import GeometryServiceFromGeoCoordinateStringParams = __esri.GeometryServiceFromGeoCoordinateStringParams; - - export import GeometryServiceToGeoCoordinateStringParams = __esri.GeometryServiceToGeoCoordinateStringParams; - - export import LocatorAddressToLocationsParams = __esri.LocatorAddressToLocationsParams; - - export import LocatorAddressesToLocationsParams = __esri.LocatorAddressesToLocationsParams; - - export import LocatorSuggestLocationsParams = __esri.LocatorSuggestLocationsParams; - - export import ClosestFacilityParametersAttributeParameterValues = __esri.ClosestFacilityParametersAttributeParameterValues; - - export import PrintTemplateExportOptions = __esri.PrintTemplateExportOptions; - - export import PrintTemplateLayoutOptions = __esri.PrintTemplateLayoutOptions; - - export import ProjectParametersTransformation = __esri.ProjectParametersTransformation; - - export import QueryQuantizationParameters = __esri.QueryQuantizationParameters; - - export import MapViewConstraints = __esri.MapViewConstraints; - - export import MapViewGoToOptions = __esri.MapViewGoToOptions; - - export import MapViewHitTestScreenPoint = __esri.MapViewHitTestScreenPoint; - - export import SceneViewConstraintsProperties = __esri.SceneViewConstraintsProperties; - export import SceneViewConstraints = __esri.SceneViewConstraints; - - export import SceneViewConstraintsAltitudeProperties = __esri.SceneViewConstraintsAltitudeProperties; - export import SceneViewConstraintsAltitude = __esri.SceneViewConstraintsAltitude; - - export import SceneViewConstraintsClipDistanceProperties = __esri.SceneViewConstraintsClipDistanceProperties; - export import SceneViewConstraintsClipDistance = __esri.SceneViewConstraintsClipDistance; - - export import SceneViewConstraintsCollision = __esri.SceneViewConstraintsCollision; - - export import SceneViewConstraintsTiltProperties = __esri.SceneViewConstraintsTiltProperties; - export import SceneViewConstraintsTilt = __esri.SceneViewConstraintsTilt; - - export import SceneViewEnvironmentProperties = __esri.SceneViewEnvironmentProperties; - export import SceneViewEnvironment = __esri.SceneViewEnvironment; - - export import SceneViewEnvironmentAtmosphereProperties = __esri.SceneViewEnvironmentAtmosphereProperties; - export import SceneViewEnvironmentAtmosphere = __esri.SceneViewEnvironmentAtmosphere; - - export import SceneViewEnvironmentLightingProperties = __esri.SceneViewEnvironmentLightingProperties; - export import SceneViewEnvironmentLighting = __esri.SceneViewEnvironmentLighting; - - export import SceneViewGoToOptions = __esri.SceneViewGoToOptions; - - export import SceneViewHitTestScreenPoint = __esri.SceneViewHitTestScreenPoint; - - export import ViewPadding = __esri.ViewPadding; - - export import ImageryLayerViewPixelData = __esri.ImageryLayerViewPixelData; - - export import SlideApplyToOptions = __esri.SlideApplyToOptions; - - export import SlideCreateFromOptions = __esri.SlideCreateFromOptions; - - export import SlideCreateFromOptionsScreenshot = __esri.SlideCreateFromOptionsScreenshot; - - export import SlideDescriptionProperties = __esri.SlideDescriptionProperties; - export import SlideDescription = __esri.SlideDescription; - - export import SlideThumbnailProperties = __esri.SlideThumbnailProperties; - export import SlideThumbnail = __esri.SlideThumbnail; - - export import SlideTitleProperties = __esri.SlideTitleProperties; - export import SlideTitle = __esri.SlideTitle; - - export import SlideUpdateFromOptions = __esri.SlideUpdateFromOptions; - - export import SlideUpdateFromOptionsScreenshot = __esri.SlideUpdateFromOptionsScreenshot; - - export import SlideVisibleLayers = __esri.SlideVisibleLayers; - - export import ColorSliderValues = __esri.ColorSliderValues; - - export import LegendLayerInfos = __esri.LegendLayerInfos; - - export import PopupDockOptions = __esri.PopupDockOptions; - - export import PopupOpenOptions = __esri.PopupOpenOptions; - - export import SearchSources = __esri.SearchSources; - - export import SearchViewModelSources = __esri.SearchViewModelSources; - - export import ArcGISDynamicMapServiceGetExportImageParametersOptions = __esri.ArcGISDynamicMapServiceGetExportImageParametersOptions; - - export import SceneServiceVersion = __esri.SceneServiceVersion; - - export import BreakpointsOwnerBreakpoints = __esri.BreakpointsOwnerBreakpoints; - - export import configRequest = __esri.configRequest; - - export import configRequestCorsEnabledServers = __esri.configRequestCorsEnabledServers; - - export import configRequestProxyRules = __esri.configRequestProxyRules; - - export import requestEsriRequestOptions = __esri.requestEsriRequestOptions; - - export import urlUtilsAddProxyRuleRule = __esri.urlUtilsAddProxyRuleRule; - - export import decoratorsPropertyPropertyMetadata = __esri.decoratorsPropertyPropertyMetadata; - - export import colorCreateContinuousRendererParams = __esri.colorCreateContinuousRendererParams; - - export import colorCreateContinuousRendererParamsLegendOptions = __esri.colorCreateContinuousRendererParamsLegendOptions; - - export import colorCreateVisualVariableParams = __esri.colorCreateVisualVariableParams; - - export import colorCreateVisualVariableParamsLegendOptions = __esri.colorCreateVisualVariableParamsLegendOptions; - - export import locationCreateRendererParams = __esri.locationCreateRendererParams; - - export import sizeCreateContinuousRendererParams = __esri.sizeCreateContinuousRendererParams; - - export import sizeCreateContinuousRendererParamsLegendOptions = __esri.sizeCreateContinuousRendererParamsLegendOptions; - - export import sizeCreateVisualVariableParams = __esri.sizeCreateVisualVariableParams; - - export import sizeCreateVisualVariableParamsLegendOptions = __esri.sizeCreateVisualVariableParamsLegendOptions; - - export import univariateColorSizeCreateContinuousRendererParams = __esri.univariateColorSizeCreateContinuousRendererParams; - - export import univariateColorSizeCreateContinuousRendererParamsColorOptions = __esri.univariateColorSizeCreateContinuousRendererParamsColorOptions; - - export import univariateColorSizeCreateContinuousRendererParamsColorOptionsLegendOptions = __esri.univariateColorSizeCreateContinuousRendererParamsColorOptionsLegendOptions; - - export import univariateColorSizeCreateContinuousRendererParamsSizeOptions = __esri.univariateColorSizeCreateContinuousRendererParamsSizeOptions; - - export import univariateColorSizeCreateContinuousRendererParamsSizeOptionsLegendOptions = __esri.univariateColorSizeCreateContinuousRendererParamsSizeOptionsLegendOptions; - - export import univariateColorSizeCreateVisualVariablesParams = __esri.univariateColorSizeCreateVisualVariablesParams; - - export import univariateColorSizeCreateVisualVariablesParamsColorOptions = __esri.univariateColorSizeCreateVisualVariablesParamsColorOptions; - - export import univariateColorSizeCreateVisualVariablesParamsColorOptionsLegendOptions = __esri.univariateColorSizeCreateVisualVariablesParamsColorOptionsLegendOptions; - - export import univariateColorSizeCreateVisualVariablesParamsSizeOptions = __esri.univariateColorSizeCreateVisualVariablesParamsSizeOptions; - - export import univariateColorSizeCreateVisualVariablesParamsSizeOptionsLegendOptions = __esri.univariateColorSizeCreateVisualVariablesParamsSizeOptionsLegendOptions; - - export import classBreaksClassBreaksParams = __esri.classBreaksClassBreaksParams; - - export import histogramHistogramParams = __esri.histogramHistogramParams; - - export import summaryStatisticsSummaryStatisticsParams = __esri.summaryStatisticsSummaryStatisticsParams; - - export import colorGetSchemesParams = __esri.colorGetSchemesParams; - - export import locationGetSchemesParams = __esri.locationGetSchemesParams; - - export import sizeGetSchemesParams = __esri.sizeGetSchemesParams; -} - -declare module "esri/core/Evented" { - import Evented = __esri.Evented; - export = Evented; -} - -declare module "esri/Basemap" { - import Basemap = __esri.Basemap; - export = Basemap; -} - -declare module "esri/Camera" { - import Camera = __esri.Camera; - export = Camera; -} - -declare module "esri/Color" { - import Color = __esri.Color; - export = Color; -} - -declare module "esri/Graphic" { - import Graphic = __esri.Graphic; - export = Graphic; -} - -declare module "esri/Ground" { - import Ground = __esri.Ground; - export = Ground; -} - -declare module "esri/Map" { - import Map = __esri.Map; - export = Map; -} - -declare module "esri/PopupTemplate" { - import PopupTemplate = __esri.PopupTemplate; - export = PopupTemplate; -} - -declare module "esri/Viewpoint" { - import Viewpoint = __esri.Viewpoint; - export = Viewpoint; -} - -declare module "esri/WebMap" { - import WebMap = __esri.WebMap; - export = WebMap; -} - -declare module "esri/WebScene" { - import WebScene = __esri.WebScene; - export = WebScene; -} - -declare module "esri/core/Accessor" { - import Accessor = __esri.Accessor; - export = Accessor; -} - -declare module "esri/core/Collection" { - import Collection = __esri.Collection; - export = Collection; -} - -declare module "esri/core/workers/Connection" { - import Connection = __esri.Connection; - export = Connection; -} - -declare module "esri/geometry/Circle" { - import Circle = __esri.Circle; - export = Circle; -} - -declare module "esri/geometry/Extent" { - import Extent = __esri.Extent; - export = Extent; -} - -declare module "esri/geometry/Geometry" { - import Geometry = __esri.Geometry; - export = Geometry; -} - -declare module "esri/geometry/Multipoint" { - import Multipoint = __esri.Multipoint; - export = Multipoint; -} - -declare module "esri/geometry/Point" { - import Point = __esri.Point; - export = Point; -} - -declare module "esri/geometry/Polygon" { - import Polygon = __esri.Polygon; - export = Polygon; -} - -declare module "esri/geometry/Polyline" { - import Polyline = __esri.Polyline; - export = Polyline; -} - -declare module "esri/geometry/ScreenPoint" { - import ScreenPoint = __esri.ScreenPoint; - export = ScreenPoint; -} - -declare module "esri/geometry/SpatialReference" { - import SpatialReference = __esri.SpatialReference; - export = SpatialReference; -} - -declare module "esri/identity/Credential" { - import Credential = __esri.Credential; - export = Credential; -} - -declare module "esri/identity/IdentityManagerBase" { - import IdentityManagerBase = __esri.IdentityManagerBase; - export = IdentityManagerBase; -} - -declare module "esri/identity/IdentityManager" { - const IdentityManager: __esri.IdentityManager; - export = IdentityManager; -} - -declare module "esri/identity/OAuthInfo" { - import OAuthInfo = __esri.OAuthInfo; - export = OAuthInfo; -} - -declare module "esri/identity/ServerInfo" { - import ServerInfo = __esri.ServerInfo; - export = ServerInfo; -} - -declare module "esri/layers/ElevationLayer" { - import ElevationLayer = __esri.ElevationLayer; - export = ElevationLayer; -} - -declare module "esri/layers/ImageryLayer" { - import ImageryLayer = __esri.ImageryLayer; - export = ImageryLayer; -} - -declare module "esri/layers/MapImageLayer" { - import MapImageLayer = __esri.MapImageLayer; - export = MapImageLayer; -} - -declare module "esri/layers/TileLayer" { - import TileLayer = __esri.TileLayer; - export = TileLayer; -} - -declare module "esri/layers/CSVLayer" { - import CSVLayer = __esri.CSVLayer; - export = CSVLayer; -} - -declare module "esri/layers/FeatureLayer" { - import FeatureLayer = __esri.FeatureLayer; - export = FeatureLayer; -} - -declare module "esri/layers/GraphicsLayer" { - import GraphicsLayer = __esri.GraphicsLayer; - export = GraphicsLayer; -} - -declare module "esri/layers/GroupLayer" { - import GroupLayer = __esri.GroupLayer; - export = GroupLayer; -} - -declare module "esri/layers/IntegratedMeshLayer" { - import IntegratedMeshLayer = __esri.IntegratedMeshLayer; - export = IntegratedMeshLayer; -} - -declare module "esri/layers/Layer" { - import Layer = __esri.Layer; - export = Layer; -} - -declare module "esri/layers/OpenStreetMapLayer" { - import OpenStreetMapLayer = __esri.OpenStreetMapLayer; - export = OpenStreetMapLayer; -} - -declare module "esri/layers/PointCloudLayer" { - import PointCloudLayer = __esri.PointCloudLayer; - export = PointCloudLayer; -} - -declare module "esri/layers/SceneLayer" { - import SceneLayer = __esri.SceneLayer; - export = SceneLayer; -} - -declare module "esri/layers/StreamLayer" { - import StreamLayer = __esri.StreamLayer; - export = StreamLayer; -} - -declare module "esri/layers/UnknownLayer" { - import UnknownLayer = __esri.UnknownLayer; - export = UnknownLayer; -} - -declare module "esri/layers/UnsupportedLayer" { - import UnsupportedLayer = __esri.UnsupportedLayer; - export = UnsupportedLayer; -} - -declare module "esri/layers/VectorTileLayer" { - import VectorTileLayer = __esri.VectorTileLayer; - export = VectorTileLayer; -} - -declare module "esri/layers/WebTileLayer" { - import WebTileLayer = __esri.WebTileLayer; - export = WebTileLayer; -} - -declare module "esri/layers/support/CodedValueDomain" { - import CodedValueDomain = __esri.CodedValueDomain; - export = CodedValueDomain; -} - -declare module "esri/layers/support/DimensionalDefinition" { - import DimensionalDefinition = __esri.DimensionalDefinition; - export = DimensionalDefinition; -} - -declare module "esri/layers/support/Domain" { - import Domain = __esri.Domain; - export = Domain; -} - -declare module "esri/layers/support/Field" { - import Field = __esri.Field; - export = Field; -} - -declare module "esri/layers/support/ImageParameters" { - import ImageParameters = __esri.ImageParameters; - export = ImageParameters; -} - -declare module "esri/layers/support/InheritedDomain" { - import InheritedDomain = __esri.InheritedDomain; - export = InheritedDomain; -} - -declare module "esri/layers/support/LabelClass" { - import LabelClass = __esri.LabelClass; - export = LabelClass; -} - -declare module "esri/layers/support/LOD" { - import LOD = __esri.LOD; - export = LOD; -} - -declare module "esri/layers/support/MapImage" { - import MapImage = __esri.MapImage; - export = MapImage; -} - -declare module "esri/layers/support/MosaicRule" { - import MosaicRule = __esri.MosaicRule; - export = MosaicRule; -} - -declare module "esri/layers/support/PixelBlock" { - import PixelBlock = __esri.PixelBlock; - export = PixelBlock; -} - -declare module "esri/layers/support/RangeDomain" { - import RangeDomain = __esri.RangeDomain; - export = RangeDomain; -} - -declare module "esri/layers/support/RasterFunction" { - import RasterFunction = __esri.RasterFunction; - export = RasterFunction; -} - -declare module "esri/layers/support/Sublayer" { - import Sublayer = __esri.Sublayer; - export = Sublayer; -} - -declare module "esri/layers/support/TileInfo" { - import TileInfo = __esri.TileInfo; - export = TileInfo; -} - -declare module "esri/portal/Portal" { - import Portal = __esri.Portal; - export = Portal; -} - -declare module "esri/portal/PortalFolder" { - import PortalFolder = __esri.PortalFolder; - export = PortalFolder; -} - -declare module "esri/portal/PortalGroup" { - import PortalGroup = __esri.PortalGroup; - export = PortalGroup; -} - -declare module "esri/portal/PortalItem" { - import PortalItem = __esri.PortalItem; - export = PortalItem; -} - -declare module "esri/portal/PortalRating" { - import PortalRating = __esri.PortalRating; - export = PortalRating; -} - -declare module "esri/portal/PortalQueryParams" { - import PortalQueryParams = __esri.PortalQueryParams; - export = PortalQueryParams; -} - -declare module "esri/portal/PortalQueryResult" { - import PortalQueryResult = __esri.PortalQueryResult; - export = PortalQueryResult; -} - -declare module "esri/portal/PortalUser" { - import PortalUser = __esri.PortalUser; - export = PortalUser; -} - -declare module "esri/renderers/ClassBreaksRenderer" { - import ClassBreaksRenderer = __esri.ClassBreaksRenderer; - export = ClassBreaksRenderer; -} - -declare module "esri/renderers/Renderer" { - import Renderer = __esri.Renderer; - export = Renderer; -} - -declare module "esri/renderers/SimpleRenderer" { - import SimpleRenderer = __esri.SimpleRenderer; - export = SimpleRenderer; -} - -declare module "esri/renderers/UniqueValueRenderer" { - import UniqueValueRenderer = __esri.UniqueValueRenderer; - export = UniqueValueRenderer; -} - -declare module "esri/renderers/PointCloudRenderer" { - import PointCloudRenderer = __esri.PointCloudRenderer; - export = PointCloudRenderer; -} - -declare module "esri/renderers/PointCloudClassBreaksRenderer" { - import PointCloudClassBreaksRenderer = __esri.PointCloudClassBreaksRenderer; - export = PointCloudClassBreaksRenderer; -} - -declare module "esri/renderers/PointCloudRGBRenderer" { - import PointCloudRGBRenderer = __esri.PointCloudRGBRenderer; - export = PointCloudRGBRenderer; -} - -declare module "esri/renderers/PointCloudStretchRenderer" { - import PointCloudStretchRenderer = __esri.PointCloudStretchRenderer; - export = PointCloudStretchRenderer; -} - -declare module "esri/renderers/PointCloudUniqueValueRenderer" { - import PointCloudUniqueValueRenderer = __esri.PointCloudUniqueValueRenderer; - export = PointCloudUniqueValueRenderer; -} - -declare module "esri/symbols/ExtrudeSymbol3DLayer" { - import ExtrudeSymbol3DLayer = __esri.ExtrudeSymbol3DLayer; - export = ExtrudeSymbol3DLayer; -} - -declare module "esri/symbols/FillSymbol" { - import FillSymbol = __esri.FillSymbol; - export = FillSymbol; -} - -declare module "esri/symbols/FillSymbol3DLayer" { - import FillSymbol3DLayer = __esri.FillSymbol3DLayer; - export = FillSymbol3DLayer; -} - -declare module "esri/symbols/Font" { - import Font = __esri.Font; - export = Font; -} - -declare module "esri/symbols/IconSymbol3DLayer" { - import IconSymbol3DLayer = __esri.IconSymbol3DLayer; - export = IconSymbol3DLayer; -} - -declare module "esri/symbols/LabelSymbol3D" { - import LabelSymbol3D = __esri.LabelSymbol3D; - export = LabelSymbol3D; -} - -declare module "esri/symbols/LineSymbol" { - import LineSymbol = __esri.LineSymbol; - export = LineSymbol; -} - -declare module "esri/symbols/LineSymbol3D" { - import LineSymbol3D = __esri.LineSymbol3D; - export = LineSymbol3D; -} - -declare module "esri/symbols/LineSymbol3DLayer" { - import LineSymbol3DLayer = __esri.LineSymbol3DLayer; - export = LineSymbol3DLayer; -} - -declare module "esri/symbols/MarkerSymbol" { - import MarkerSymbol = __esri.MarkerSymbol; - export = MarkerSymbol; -} - -declare module "esri/symbols/MeshSymbol3D" { - import MeshSymbol3D = __esri.MeshSymbol3D; - export = MeshSymbol3D; -} - -declare module "esri/symbols/ObjectSymbol3DLayer" { - import ObjectSymbol3DLayer = __esri.ObjectSymbol3DLayer; - export = ObjectSymbol3DLayer; -} - -declare module "esri/symbols/PictureFillSymbol" { - import PictureFillSymbol = __esri.PictureFillSymbol; - export = PictureFillSymbol; -} - -declare module "esri/symbols/PictureMarkerSymbol" { - import PictureMarkerSymbol = __esri.PictureMarkerSymbol; - export = PictureMarkerSymbol; -} - -declare module "esri/symbols/PathSymbol3DLayer" { - import PathSymbol3DLayer = __esri.PathSymbol3DLayer; - export = PathSymbol3DLayer; -} - -declare module "esri/symbols/PointSymbol3D" { - import PointSymbol3D = __esri.PointSymbol3D; - export = PointSymbol3D; -} - -declare module "esri/symbols/PolygonSymbol3D" { - import PolygonSymbol3D = __esri.PolygonSymbol3D; - export = PolygonSymbol3D; -} - -declare module "esri/symbols/SimpleFillSymbol" { - import SimpleFillSymbol = __esri.SimpleFillSymbol; - export = SimpleFillSymbol; -} - -declare module "esri/symbols/SimpleLineSymbol" { - import SimpleLineSymbol = __esri.SimpleLineSymbol; - export = SimpleLineSymbol; -} - -declare module "esri/symbols/SimpleMarkerSymbol" { - import SimpleMarkerSymbol = __esri.SimpleMarkerSymbol; - export = SimpleMarkerSymbol; -} - -declare module "esri/symbols/Symbol" { - import Symbol = __esri.Symbol; - export = Symbol; -} - -declare module "esri/symbols/Symbol3D" { - import Symbol3D = __esri.Symbol3D; - export = Symbol3D; -} - -declare module "esri/symbols/Symbol3DLayer" { - import Symbol3DLayer = __esri.Symbol3DLayer; - export = Symbol3DLayer; -} - -declare module "esri/symbols/TextSymbol" { - import TextSymbol = __esri.TextSymbol; - export = TextSymbol; -} - -declare module "esri/symbols/TextSymbol3DLayer" { - import TextSymbol3DLayer = __esri.TextSymbol3DLayer; - export = TextSymbol3DLayer; -} - -declare module "esri/symbols/WebStyleSymbol" { - import WebStyleSymbol = __esri.WebStyleSymbol; - export = WebStyleSymbol; -} - -declare module "esri/tasks/ClosestFacilityTask" { - import ClosestFacilityTask = __esri.ClosestFacilityTask; - export = ClosestFacilityTask; -} - -declare module "esri/tasks/FindTask" { - import FindTask = __esri.FindTask; - export = FindTask; -} - -declare module "esri/tasks/GeometryService" { - import GeometryService = __esri.GeometryService; - export = GeometryService; -} - -declare module "esri/tasks/Geoprocessor" { - import Geoprocessor = __esri.Geoprocessor; - export = Geoprocessor; -} - -declare module "esri/tasks/IdentifyTask" { - import IdentifyTask = __esri.IdentifyTask; - export = IdentifyTask; -} - -declare module "esri/tasks/ImageServiceIdentifyTask" { - import ImageServiceIdentifyTask = __esri.ImageServiceIdentifyTask; - export = ImageServiceIdentifyTask; -} - -declare module "esri/tasks/Locator" { - import Locator = __esri.Locator; - export = Locator; -} - -declare module "esri/tasks/QueryTask" { - import QueryTask = __esri.QueryTask; - export = QueryTask; -} - -declare module "esri/tasks/PrintTask" { - import PrintTask = __esri.PrintTask; - export = PrintTask; -} - -declare module "esri/tasks/RouteTask" { - import RouteTask = __esri.RouteTask; - export = RouteTask; -} - -declare module "esri/tasks/ServiceAreaTask" { - import ServiceAreaTask = __esri.ServiceAreaTask; - export = ServiceAreaTask; -} - -declare module "esri/tasks/Task" { - import Task = __esri.Task; - export = Task; -} - -declare module "esri/tasks/support/AddressCandidate" { - import AddressCandidate = __esri.AddressCandidate; - export = AddressCandidate; -} - -declare module "esri/tasks/support/AreasAndLengthsParameters" { - import AreasAndLengthsParameters = __esri.AreasAndLengthsParameters; - export = AreasAndLengthsParameters; -} - -declare module "esri/tasks/support/BufferParameters" { - import BufferParameters = __esri.BufferParameters; - export = BufferParameters; -} - -declare module "esri/tasks/support/ClosestFacilityParameters" { - import ClosestFacilityParameters = __esri.ClosestFacilityParameters; - export = ClosestFacilityParameters; -} - -declare module "esri/tasks/support/ClosestFacilitySolveResult" { - import ClosestFacilitySolveResult = __esri.ClosestFacilitySolveResult; - export = ClosestFacilitySolveResult; -} - -declare module "esri/tasks/support/DataFile" { - import DataFile = __esri.DataFile; - export = DataFile; -} - -declare module "esri/tasks/support/DataLayer" { - import DataLayer = __esri.DataLayer; - export = DataLayer; -} - -declare module "esri/tasks/support/Date" { - import supportDate = __esri.supportDate; - export = supportDate; -} - -declare module "esri/tasks/support/DensifyParameters" { - import DensifyParameters = __esri.DensifyParameters; - export = DensifyParameters; -} - -declare module "esri/tasks/support/DirectionsFeatureSet" { - import DirectionsFeatureSet = __esri.DirectionsFeatureSet; - export = DirectionsFeatureSet; -} - -declare module "esri/tasks/support/DistanceParameters" { - import DistanceParameters = __esri.DistanceParameters; - export = DistanceParameters; -} - -declare module "esri/tasks/support/FeatureSet" { - import FeatureSet = __esri.FeatureSet; - export = FeatureSet; -} - -declare module "esri/tasks/support/FindParameters" { - import FindParameters = __esri.FindParameters; - export = FindParameters; -} - -declare module "esri/tasks/support/FindResult" { - import FindResult = __esri.FindResult; - export = FindResult; -} - -declare module "esri/tasks/support/GeneralizeParameters" { - import GeneralizeParameters = __esri.GeneralizeParameters; - export = GeneralizeParameters; -} - -declare module "esri/tasks/support/GPMessage" { - import GPMessage = __esri.GPMessage; - export = GPMessage; -} - -declare module "esri/tasks/support/IdentifyParameters" { - import IdentifyParameters = __esri.IdentifyParameters; - export = IdentifyParameters; -} - -declare module "esri/tasks/support/IdentifyResult" { - import IdentifyResult = __esri.IdentifyResult; - export = IdentifyResult; -} - -declare module "esri/tasks/support/ImageServiceIdentifyParameters" { - import ImageServiceIdentifyParameters = __esri.ImageServiceIdentifyParameters; - export = ImageServiceIdentifyParameters; -} - -declare module "esri/tasks/support/ImageServiceIdentifyResult" { - import ImageServiceIdentifyResult = __esri.ImageServiceIdentifyResult; - export = ImageServiceIdentifyResult; -} - -declare module "esri/tasks/support/JobInfo" { - import JobInfo = __esri.JobInfo; - export = JobInfo; -} - -declare module "esri/tasks/support/LegendLayer" { - import LegendLayer = __esri.LegendLayer; - export = LegendLayer; -} - -declare module "esri/tasks/support/LengthsParameters" { - import LengthsParameters = __esri.LengthsParameters; - export = LengthsParameters; -} - -declare module "esri/tasks/support/LinearUnit" { - import LinearUnit = __esri.LinearUnit; - export = LinearUnit; -} - -declare module "esri/tasks/support/NAMessage" { - import NAMessage = __esri.NAMessage; - export = NAMessage; -} - -declare module "esri/tasks/support/OffsetParameters" { - import OffsetParameters = __esri.OffsetParameters; - export = OffsetParameters; -} - -declare module "esri/tasks/support/ParameterValue" { - import ParameterValue = __esri.ParameterValue; - export = ParameterValue; -} - -declare module "esri/tasks/support/PrintParameters" { - import PrintParameters = __esri.PrintParameters; - export = PrintParameters; -} - -declare module "esri/tasks/support/PrintTemplate" { - import PrintTemplate = __esri.PrintTemplate; - export = PrintTemplate; -} - -declare module "esri/tasks/support/ProjectParameters" { - import ProjectParameters = __esri.ProjectParameters; - export = ProjectParameters; -} - -declare module "esri/tasks/support/Query" { - import Query = __esri.Query; - export = Query; -} - -declare module "esri/tasks/support/RasterData" { - import RasterData = __esri.RasterData; - export = RasterData; -} - -declare module "esri/tasks/support/RelationParameters" { - import RelationParameters = __esri.RelationParameters; - export = RelationParameters; -} - -declare module "esri/tasks/support/RelationshipQuery" { - import RelationshipQuery = __esri.RelationshipQuery; - export = RelationshipQuery; -} - -declare module "esri/tasks/support/RouteParameters" { - import RouteParameters = __esri.RouteParameters; - export = RouteParameters; -} - -declare module "esri/tasks/support/RouteResult" { - import RouteResult = __esri.RouteResult; - export = RouteResult; -} - -declare module "esri/tasks/support/ServiceAreaParameters" { - import ServiceAreaParameters = __esri.ServiceAreaParameters; - export = ServiceAreaParameters; -} - -declare module "esri/tasks/support/ServiceAreaSolveResult" { - import ServiceAreaSolveResult = __esri.ServiceAreaSolveResult; - export = ServiceAreaSolveResult; -} - -declare module "esri/tasks/support/StatisticDefinition" { - import StatisticDefinition = __esri.StatisticDefinition; - export = StatisticDefinition; -} - -declare module "esri/tasks/support/TrimExtendParameters" { - import TrimExtendParameters = __esri.TrimExtendParameters; - export = TrimExtendParameters; -} - -declare module "esri/views/MapView" { - import MapView = __esri.MapView; - export = MapView; -} - -declare module "esri/views/SceneView" { - import SceneView = __esri.SceneView; - export = SceneView; -} - -declare module "esri/views/View" { - import View = __esri.View; - export = View; -} - -declare module "esri/views/ViewAnimation" { - import ViewAnimation = __esri.ViewAnimation; - export = ViewAnimation; -} - -declare module "esri/views/layers/LayerView" { - import LayerView = __esri.LayerView; - export = LayerView; -} - -declare module "esri/views/layers/FeatureLayerView" { - import FeatureLayerView = __esri.FeatureLayerView; - export = FeatureLayerView; -} - -declare module "esri/views/layers/GraphicsLayerView" { - import GraphicsLayerView = __esri.GraphicsLayerView; - export = GraphicsLayerView; -} - -declare module "esri/views/layers/ImageryLayerView" { - import ImageryLayerView = __esri.ImageryLayerView; - export = ImageryLayerView; -} - -declare module "esri/views/ui/UI" { - import UI = __esri.UI; - export = UI; -} - -declare module "esri/views/ui/DefaultUI" { - import DefaultUI = __esri.DefaultUI; - export = DefaultUI; -} - -declare module "esri/webmap/InitialViewProperties" { - import InitialViewProperties = __esri.InitialViewProperties; - export = InitialViewProperties; -} - -declare module "esri/webscene/Environment" { - import Environment = __esri.Environment; - export = Environment; -} - -declare module "esri/webscene/InitialViewProperties" { - import websceneInitialViewProperties = __esri.websceneInitialViewProperties; - export = websceneInitialViewProperties; -} - -declare module "esri/webscene/Lighting" { - import Lighting = __esri.Lighting; - export = Lighting; -} - -declare module "esri/webscene/Presentation" { - import Presentation = __esri.Presentation; - export = Presentation; -} - -declare module "esri/webscene/Slide" { - import Slide = __esri.Slide; - export = Slide; -} - -declare module "esri/widgets/Attribution" { - import Attribution = __esri.Attribution; - export = Attribution; -} - -declare module "esri/widgets/BasemapToggle" { - import BasemapToggle = __esri.BasemapToggle; - export = BasemapToggle; -} - -declare module "esri/widgets/ColorSlider" { - import ColorSlider = __esri.ColorSlider; - export = ColorSlider; -} - -declare module "esri/widgets/Compass" { - import Compass = __esri.Compass; - export = Compass; -} - -declare module "esri/widgets/Home" { - import Home = __esri.Home; - export = Home; -} - -declare module "esri/widgets/LayerList" { - import LayerList = __esri.LayerList; - export = LayerList; -} - -declare module "esri/widgets/Legend" { - import Legend = __esri.Legend; - export = Legend; -} - -declare module "esri/widgets/Locate" { - import Locate = __esri.Locate; - export = Locate; -} - -declare module "esri/widgets/NavigationToggle" { - import NavigationToggle = __esri.NavigationToggle; - export = NavigationToggle; -} - -declare module "esri/widgets/Popup" { - import Popup = __esri.Popup; - export = Popup; -} - -declare module "esri/widgets/Print" { - import Print = __esri.Print; - export = Print; -} - -declare module "esri/widgets/Search" { - import Search = __esri.Search; - export = Search; -} - -declare module "esri/widgets/SizeSlider" { - import SizeSlider = __esri.SizeSlider; - export = SizeSlider; -} - -declare module "esri/widgets/Track" { - import Track = __esri.Track; - export = Track; -} - -declare module "esri/widgets/UnivariateColorSizeSlider" { - import UnivariateColorSizeSlider = __esri.UnivariateColorSizeSlider; - export = UnivariateColorSizeSlider; -} - -declare module "esri/widgets/Widget" { - import Widget = __esri.Widget; - export = Widget; -} - -declare module "esri/widgets/Zoom" { - import Zoom = __esri.Zoom; - export = Zoom; -} - -declare module "esri/widgets/Attribution/AttributionViewModel" { - import AttributionViewModel = __esri.AttributionViewModel; - export = AttributionViewModel; -} - -declare module "esri/widgets/BasemapToggle/BasemapToggleViewModel" { - import BasemapToggleViewModel = __esri.BasemapToggleViewModel; - export = BasemapToggleViewModel; -} - -declare module "esri/widgets/Compass/CompassViewModel" { - import CompassViewModel = __esri.CompassViewModel; - export = CompassViewModel; -} - -declare module "esri/widgets/Home/HomeViewModel" { - import HomeViewModel = __esri.HomeViewModel; - export = HomeViewModel; -} - -declare module "esri/widgets/LayerList/LayerListViewModel" { - import LayerListViewModel = __esri.LayerListViewModel; - export = LayerListViewModel; -} - -declare module "esri/widgets/Locate/LocateViewModel" { - import LocateViewModel = __esri.LocateViewModel; - export = LocateViewModel; -} - -declare module "esri/widgets/NavigationToggle/NavigationToggleViewModel" { - import NavigationToggleViewModel = __esri.NavigationToggleViewModel; - export = NavigationToggleViewModel; -} - -declare module "esri/widgets/Print/PrintViewModel" { - import PrintViewModel = __esri.PrintViewModel; - export = PrintViewModel; -} - -declare module "esri/widgets/Popup/PopupViewModel" { - import PopupViewModel = __esri.PopupViewModel; - export = PopupViewModel; -} - -declare module "esri/widgets/Search/SearchViewModel" { - import SearchViewModel = __esri.SearchViewModel; - export = SearchViewModel; -} - -declare module "esri/widgets/Track/TrackViewModel" { - import TrackViewModel = __esri.TrackViewModel; - export = TrackViewModel; -} - -declare module "esri/widgets/Zoom/ZoomViewModel" { - import ZoomViewModel = __esri.ZoomViewModel; - export = ZoomViewModel; -} - -declare module "esri/core/JSONSupport" { - import JSONSupport = __esri.JSONSupport; - export = JSONSupport; -} - -declare module "esri/core/Loadable" { - import Loadable = __esri.Loadable; - export = Loadable; -} - -declare module "esri/core/Promise" { - import corePromise = __esri.corePromise; - export = corePromise; -} - -declare module "esri/layers/DynamicLayer" { - import DynamicLayer = __esri.DynamicLayer; - export = DynamicLayer; -} - -declare module "esri/layers/TiledLayer" { - import TiledLayer = __esri.TiledLayer; - export = TiledLayer; -} - -declare module "esri/layers/mixins/ArcGISCachedService" { - import ArcGISCachedService = __esri.ArcGISCachedService; - export = ArcGISCachedService; -} - -declare module "esri/layers/mixins/ArcGISDynamicMapService" { - import ArcGISDynamicMapService = __esri.ArcGISDynamicMapService; - export = ArcGISDynamicMapService; -} - -declare module "esri/layers/mixins/ArcGISImageService" { - import ArcGISImageService = __esri.ArcGISImageService; - export = ArcGISImageService; -} - -declare module "esri/layers/mixins/ArcGISMapService" { - import ArcGISMapService = __esri.ArcGISMapService; - export = ArcGISMapService; -} - -declare module "esri/layers/mixins/PortalLayer" { - import PortalLayer = __esri.PortalLayer; - export = PortalLayer; -} - -declare module "esri/layers/mixins/ScaleRangeLayer" { - import ScaleRangeLayer = __esri.ScaleRangeLayer; - export = ScaleRangeLayer; -} - -declare module "esri/layers/mixins/SceneService" { - import SceneService = __esri.SceneService; - export = SceneService; -} - -declare module "esri/renderers/VisualVariablesMixin" { - import VisualVariablesMixin = __esri.VisualVariablesMixin; - export = VisualVariablesMixin; -} - -declare module "esri/support/LayersMixin" { - import LayersMixin = __esri.LayersMixin; - export = LayersMixin; -} - -declare module "esri/views/BreakpointsOwner" { - import BreakpointsOwner = __esri.BreakpointsOwner; - export = BreakpointsOwner; -} - -declare module "esri/views/DOMContainer" { - import DOMContainer = __esri.DOMContainer; - export = DOMContainer; -} - -declare module "esri/widgets/support/GeolocationPositioning" { - import GeolocationPositioning = __esri.GeolocationPositioning; - export = GeolocationPositioning; -} - -declare module "esri/config" { - import config = __esri.config; - export = config; -} - -declare module "esri/kernel" { - import kernel = __esri.kernel; - export = kernel; -} - -declare module "esri/request" { - import request = __esri.request; - export = request; -} - -declare module "esri/core/lang" { - import lang = __esri.lang; - export = lang; -} - -declare module "esri/core/promiseUtils" { - import promiseUtils = __esri.promiseUtils; - export = promiseUtils; -} - -declare module "esri/core/urlUtils" { - import urlUtils = __esri.urlUtils; - export = urlUtils; -} - -declare module "esri/core/watchUtils" { - import watchUtils = __esri.watchUtils; - export = watchUtils; -} - -declare module "esri/core/accessorSupport/decorators" { - import decorators = __esri.decorators; - export = decorators; -} - -declare module "esri/core/workers" { - import workers = __esri.workers; - export = workers; -} - -declare module "esri/geometry/geometryEngine" { - import geometryEngine = __esri.geometryEngine; - export = geometryEngine; -} - -declare module "esri/geometry/geometryEngineAsync" { - import geometryEngineAsync = __esri.geometryEngineAsync; - export = geometryEngineAsync; -} - -declare module "esri/geometry/support/jsonUtils" { - import jsonUtils = __esri.jsonUtils; - export = jsonUtils; -} - -declare module "esri/geometry/support/webMercatorUtils" { - import webMercatorUtils = __esri.webMercatorUtils; - export = webMercatorUtils; -} - -declare module "esri/renderers/smartMapping/creators/color" { - import color = __esri.color; - export = color; -} - -declare module "esri/renderers/smartMapping/creators/location" { - import location = __esri.location; - export = location; -} - -declare module "esri/renderers/smartMapping/creators/size" { - import size = __esri.size; - export = size; -} - -declare module "esri/renderers/smartMapping/creators/univariateColorSize" { - import univariateColorSize = __esri.univariateColorSize; - export = univariateColorSize; -} - -declare module "esri/renderers/smartMapping/statistics/classBreaks" { - import classBreaks = __esri.classBreaks; - export = classBreaks; -} - -declare module "esri/renderers/smartMapping/statistics/histogram" { - import histogram = __esri.histogram; - export = histogram; -} - -declare module "esri/renderers/smartMapping/statistics/summaryStatistics" { - import summaryStatistics = __esri.summaryStatistics; - export = summaryStatistics; -} - -declare module "esri/renderers/smartMapping/symbology/color" { - import symbologyColor = __esri.symbologyColor; - export = symbologyColor; -} - -declare module "esri/renderers/smartMapping/symbology/location" { - import symbologyLocation = __esri.symbologyLocation; - export = symbologyLocation; -} - -declare module "esri/renderers/smartMapping/symbology/size" { - import symbologySize = __esri.symbologySize; - export = symbologySize; -} - -declare module "esri/renderers/support/jsonUtils" { - import supportJsonUtils = __esri.supportJsonUtils; - export = supportJsonUtils; -} - -declare module "esri/support/Action" { - import Action = __esri.Action; - export = Action; -} - -declare module "esri/symbols/support/jsonUtils" { - import symbolsSupportJsonUtils = __esri.symbolsSupportJsonUtils; - export = symbolsSupportJsonUtils; -} - -declare module "esri/views/3d/externalRenderers" { - import externalRenderers = __esri.externalRenderers; - export = externalRenderers; -} - -declare module "esri/widgets/support/widget" { - import widget = __esri.widget; - export = widget; -} - -declare module "esri/widgets/LayerList/ListItem" { - import ListItem = __esri.ListItem; - export = ListItem; -} diff --git a/arcgis-js-api/v3/arcgis-js-api-tests.ts b/arcgis-js-api/v3/arcgis-js-api-tests.ts deleted file mode 100644 index ee6c5105fd..0000000000 --- a/arcgis-js-api/v3/arcgis-js-api-tests.ts +++ /dev/null @@ -1,23 +0,0 @@ -import esri = require("esri"); -import Map = require("esri/map"); -import Point = require("esri/geometry/Point"); - -export = MapController; - -class MapController { - map: Map; - - constructor(public mapDiv: string) { - } - - start() { - let point = new Point(-122.45, 37.75); // long, lat - - let mapOptions: esri.MapOptions = {}; - mapOptions.basemap = "topo"; - mapOptions.center = point; - mapOptions.zoom = 13; - - this.map = new Map(this.mapDiv, mapOptions); - } -} diff --git a/arcgis-rest-api/index.d.ts b/arcgis-rest-api/index.d.ts deleted file mode 100644 index 65a02a4367..0000000000 --- a/arcgis-rest-api/index.d.ts +++ /dev/null @@ -1,220 +0,0 @@ -// Type definitions for arcgis-to-geojson-utils 10.4 -// Project: http://resources.arcgis.com/en/help/arcgis-rest-api/ -// Definitions by: Jeff Jacobson -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export interface Feature { - geometry: Geometry; - attributes: any; -} - -export interface Field { - name: string; - type: string; - alias?: string; - length?: number; -} - -export interface FeatureSet extends HasZM { - objectIdFieldName?: string; // optional - globalIdFieldName?: string; // optional - displayFieldName?: string; // optional - geometryType?: esriGeometryType; // for feature layers only - spatialReference?: SpatialReference; // for feature layers only. - fields?: Field[]; - features: Feature[]; -} - -export type Position2D = [number, number]; -export type Position = Position2D | [number, number, number] | [number, number, number, number]; - -export interface CircularArc { - "c": [Position, Position2D]; -} - -export interface Arc { - "a": [ - Position, // End point: x, y, , - Position2D, // Center point: center_x, center_y - number, // minor - number, // clockwise - number, // rotation - number, // axis - number // ratio - ]; -} - -export type ElipticArc = Arc; - -export interface OldCircularArc { - "a": [ - Position, // End point: x, y, , - Position2D, // Center point: center_x, center_y - number, // minor - number // clockwise - ]; -} - -export interface BezierCurve { - "b": [ - Position, - Position2D, - Position2D - ]; -} - -export type JsonCurve = CircularArc | Arc | OldCircularArc | BezierCurve; - - -export interface SpatialReferenceWkid { - wkid?: number; - latestWkid?: number; - vcsWkid?: number; - latestVcsWkid?: number; -} - -export interface SpatialReferenceWkt { - wkt?: string; - latestWkt?: string; -} - -export type SpatialReference = SpatialReferenceWkt | SpatialReferenceWkid; - -export interface Geometry { - spatialReference?: SpatialReference; -} - -export interface HasZM { - hasZ?: boolean; - hasM?: boolean; -} - -export interface Point extends Geometry { - x: number; - y: number; - z?: number; - m?: number; -} - -export interface Polyline extends HasZM, Geometry { - paths: Position[][]; -} - -export interface PolylineWithCurves extends HasZM, Geometry { - curvePaths: Array>; -} - -export interface Polygon extends HasZM, Geometry { - rings: Position[][]; -} - -export interface PolygonWithCurves extends HasZM, Geometry { - curveRings: Array>; -} - -export interface Multipoint extends HasZM, Geometry { - points: Position[]; -} - -export interface Envelope extends Geometry { - xmin: number; - xmax: number; - ymin: number; - ymax: number; - - zmin?: number; - zmax?: number; - - mmin?: number; - mmax?: number; -} - -export type esriGeometryType = "esriGeometryPoint" | "esriGeometryMultipoint" | "esriGeometryPolyline" | "esriGeometryPolygon" | "esriGeometryEnvelope"; - - -export type Color = [number, number, number, number]; -export type SimpleMarkerSymbolStyle = "esriSMSCircle" | "esriSMSCross" | "esriSMSDiamond" | "esriSMSSquare" | "esriSMSX" | "esriSMSTriangle"; -export type SimpleLineSymbolStyle = "esriSLSDash" | "esriSLSDashDot" | "esriSLSDashDotDot" | "esriSLSDot" | "esriSLSNull" | "esriSLSSolid"; -export type SimpleFillSymbolStyle = - "esriSFSBackwardDiagonal" | "esriSFSCross" | "esriSFSDiagonalCross" | "esriSFSForwardDiagonal" | "esriSFSHorizontal" | "esriSFSNull" | "esriSFSSolid" | "esriSFSVertical"; -export type SymbolType = "esriSLS" | "esriSMS" | "esriSFS" | "esriPMS" | "esriPFS" | "esriTS"; - -export interface Symbol { - "type": SymbolType; - "style"?: string; -} - -export interface SimpleLineSymbol extends Symbol { - "type": "esriSLS"; - "style"?: SimpleLineSymbolStyle; - "color"?: Color; - "width"?: number; -} - -export interface MarkerSymbol extends Symbol { - "angle"?: number; - "xoffset"?: number; - "yoffset"?: number; -} - -export interface SimpleMarkerSymbol extends MarkerSymbol { - "type": "esriSMS"; - "style"?: SimpleMarkerSymbolStyle; - "color"?: Color; - "size"?: number; - "outline"?: SimpleLineSymbol; -} - -export interface SimpleFillSymbol extends Symbol { - "type": "esriSFS"; - "style"?: SimpleFillSymbolStyle; - "color"?: Color; - "outline"?: SimpleLineSymbol; // if outline has been specified -} - -export interface PictureSourced { - "url"?: string; // Relative URL for static layers and full URL for dynamic layers. Access relative URL using http:////images/ - "imageData"?: string; // ""; - "contentType"?: string; - "width"?: number; - "height"?: number; - "angle"?: number; - "xoffset"?: number; - "yoffset"?: number; - -} - -export interface PictureMarkerSymbol extends MarkerSymbol, PictureSourced { - "type": "esriPMS"; -} - -export interface PictureFillSymbol extends Symbol, PictureSourced { - "type": "esriPFS"; - "outline"?: SimpleLineSymbol; // if outline has been specified - "xscale"?: number; - "yscale"?: number; -} - -export interface Font { - "family"?: string; // ""; - "size"?: number; // ; - "style"?: "italic" | "normal" | "oblique"; - "weight"?: "bold" | "bolder" | "lighter" | "normal"; - "decoration"?: "line-through" | "underline" | "none"; -} - -export interface TextSymbol extends MarkerSymbol { - "type": "esriTS"; - "color"?: Color; - "backgroundColor"?: Color; - "borderLineSize"?: number; // ; - "borderLineColor"?: Color; - "haloSize"?: number; // ; - "haloColor"?: Color; - "verticalAlignment"?: "baseline" | "top" | "middle" | "bottom"; - "horizontalAlignment"?: "left" | "right" | "center" | "justify"; - "rightToLeft"?: boolean; - "kerning"?: boolean; - "font"?: Font; - "text"?: string; // only applicable when specified as a client-side graphic. -} \ No newline at end of file diff --git a/arcgis-rest-api/tslint.json b/arcgis-rest-api/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/arcgis-rest-api/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/arcgis-to-geojson-utils/index.d.ts b/arcgis-to-geojson-utils/index.d.ts deleted file mode 100644 index 94a86022a3..0000000000 --- a/arcgis-to-geojson-utils/index.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -// Type definitions for arcgis-to-geojson-utils 1.0 -// Project: https://github.com/Esri/arcgis-to-geojson-utils -// Definitions by: Jeff Jacobson -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -import * as ArcGis from "arcgis-rest-api"; - -/** - * Converts an ArcGIS geometry into a GeoJSON geometry. - */ -export function arcgisToGeoJSON(arcgis: T): GeoJSON.GeometryObject; - -/** - * Converts a GeoJSON geometry into a ArcGIS geometry. - */ -export function geojsonToArcGIS(geojson: GeoJSON.GeometryObject): ArcGis.Geometry; \ No newline at end of file diff --git a/arcgis-to-geojson-utils/tslint.json b/arcgis-to-geojson-utils/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/arcgis-to-geojson-utils/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/archiver/archiver-tests.ts b/archiver/archiver-tests.ts deleted file mode 100644 index d79b29f079..0000000000 --- a/archiver/archiver-tests.ts +++ /dev/null @@ -1,22 +0,0 @@ - -/// - -import Archiver = require('archiver'); -import FS = require('fs'); - -var archiver = Archiver.create('zip'); - -var writeStream = FS.createWriteStream('./archiver.d.ts'); -var readStream = FS.createReadStream('./archiver.d.ts'); - -archiver.pipe(writeStream); -archiver.append(readStream, {name: 'archiver.d.ts'}); -archiver.finalize(); - -archiver.directory('./path', './someOtherPath'); -archiver.directory('./path', { name: "testName"} ); - -archiver.directory('./', "", {}); -archiver.directory('./', {name: 'test'}, {}); - -archiver.bulk({ mappaing: {} }); \ No newline at end of file diff --git a/archiver/index.d.ts b/archiver/index.d.ts deleted file mode 100644 index 665624143e..0000000000 --- a/archiver/index.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -// Type definitions for archiver v0.15.0 -// Project: https://github.com/archiverjs/node-archiver -// Definitions by: Esri -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/* =================== USAGE =================== - - import Archiver = require('archiver); - var archiver = Archiver.create('zip'); - archiver.pipe(FS.createWriteStream('xxx')); - archiver.append(FS.createReadStream('xxx')); - archiver.finalize(); - - =============================================== */ - -/// - -import * as FS from 'fs'; -import * as STREAM from 'stream'; - - -declare function archiver(format: string, options?: archiver.Options): archiver.Archiver; - -declare namespace archiver { - - export function create(format: string, options?: Options): Archiver; - - - export interface nameInterface { - name?: string; - } - - export interface Archiver extends STREAM.Transform { - append(source: STREAM.Readable | Buffer | string, name: nameInterface): void; - - directory(dirpath: string, destpath: nameInterface | string): void; - directory(dirpath: string, destpath: nameInterface | string, data: any | Function): void; - - bulk(mappings: any): void; - finalize(): void; - } - - export interface Options { - - } -} - -export = archiver; diff --git a/array-find-index/tslint.json b/array-find-index/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/array-find-index/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/array-uniq/array-uniq-tests.ts b/array-uniq/array-uniq-tests.ts deleted file mode 100644 index 8674d2508c..0000000000 --- a/array-uniq/array-uniq-tests.ts +++ /dev/null @@ -1,5 +0,0 @@ -import arrayUniq = require("array-uniq"); - -arrayUniq([1, 1, 2, 3, 3]); - -arrayUniq(["foo", "foo", "bar", "foo"]); \ No newline at end of file diff --git a/array-uniq/index.d.ts b/array-uniq/index.d.ts deleted file mode 100644 index 25d97c0a94..0000000000 --- a/array-uniq/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -// Type definitions for array-uniq 1.0 -// Project: https://github.com/sindresorhus/array-uniq -// Definitions by: Daniel Rosenwasser -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare function arrayUniq(arr: T[]): T[]; - -export = arrayUniq; \ No newline at end of file diff --git a/array-uniq/tslint.json b/array-uniq/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/array-uniq/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/artyom.js/index.d.ts b/artyom.js/index.d.ts deleted file mode 100644 index 0b0f253827..0000000000 --- a/artyom.js/index.d.ts +++ /dev/null @@ -1,513 +0,0 @@ -// Type definitions for artyom.js 1.0 -// Project: https://github.com/sdkcarlos/artyom.js -// Definitions by: Sema García (José Manuel García) -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/** - * Extension of Window interface - */ -interface ArtyomWindow extends Window { - webkitSpeechRecognition: any; - SpeechRecognition: any; - SpeechSynthesisUtterance: any; -} - -interface SpeechRecognition extends EventTarget { - grammars: SpeechGrammarList; - lang: string; - continuous: boolean; - interimResults: boolean; - maxAlternatives: number; - serviceURI: string; - start(): void; - stop(): void; - abort(): void; - onaudiostart: (ev: Event) => any; - onsoundstart: (ev: Event) => any; - onspeechstart: (ev: Event) => any; - onspeechend: (ev: Event) => any; - onsoundend: (ev: Event) => any; - onresult: (ev: SpeechRecognitionEvent) => any; - onnomatch: (ev: SpeechRecognitionEvent) => any; - onerror: (ev: SpeechRecognitionError) => any; - onstart: (ev: Event) => any; - onend: (ev: Event) => any; -} - -interface SpeechRecognitionStatic { - prototype: SpeechRecognition; - new (): SpeechRecognition; -} - -declare var SpeechRecognition: SpeechRecognitionStatic; -declare var webkitSpeechRecognition: SpeechRecognitionStatic; - -interface SpeechRecognitionError extends Event { - error: string; - message: string; -} - -interface SpeechRecognitionAlternative { - transcript: string; - confidence: number; -} - -interface SpeechRecognitionResult { - length: number; - item(index: number): SpeechRecognitionAlternative; - [index: number]: SpeechRecognitionAlternative; - isFinal: boolean; -} - -interface SpeechRecognitionResultList { - length: number; - item(index: number): SpeechRecognitionResult; - [index: number]: SpeechRecognitionResult; -} - -interface SpeechRecognitionEvent extends Event { - resultIndex: number; - results: SpeechRecognitionResultList; - interpretation: any; - emma: Document; -} - -interface SpeechGrammar { - src: string; - weight: number; -} - -interface SpeechGrammarStatic { - prototype: SpeechGrammar; - new (): SpeechGrammar; -} - -declare var SpeechGrammar: SpeechGrammarStatic; -declare var webkitSpeechGrammar: SpeechGrammarStatic; - -interface SpeechGrammarList { - length: number; - item(index: number): SpeechGrammar; - [index: number]: SpeechGrammar; - addFromURI(src: string, weight: number): void; - addFromString(string: string, weight: number): void; -} - -interface SpeechGrammarListStatic { - prototype: SpeechGrammarList; - new (): SpeechGrammarList; -} - -declare var SpeechGrammarList: SpeechGrammarListStatic; -declare var webkitSpeechGrammarList: SpeechGrammarListStatic; - -interface SpeechSynthesis extends EventTarget { - pending: boolean; - speaking: boolean; - paused: boolean; - - onvoiceschanged: (ev: Event) => any; - speak(utterance: SpeechSynthesisUtterance): void; - cancel(): void; - pause(): void; - resume(): void; - getVoices(): SpeechSynthesisVoice[]; -} - -interface SpeechSynthesisGetter { - speechSynthesis: SpeechSynthesis; -} - -declare var speechSynthesis: SpeechSynthesis; - -interface SpeechSynthesisUtterance extends EventTarget { - text: string; - lang: string; - voice: SpeechSynthesisVoice; - volume: number; - rate: number; - pitch: number; - - onstart: (ev: SpeechSynthesisEvent) => any; - onend: (ev: SpeechSynthesisEvent) => any; - onerror: (ev: SpeechSynthesisErrorEvent) => any; - onpause: (ev: SpeechSynthesisEvent) => any; - onresume: (ev: SpeechSynthesisEvent) => any; - onmark: (ev: SpeechSynthesisEvent) => any; - onboundary: (ev: SpeechSynthesisEvent) => any; -} - -interface SpeechSynthesisUtteranceStatic { - prototype: SpeechSynthesisUtterance; - new (text?: string): SpeechSynthesisUtterance; -} - -declare var SpeechSynthesisUtterance: SpeechSynthesisUtteranceStatic; - -interface SpeechSynthesisEvent extends Event { - utterance: SpeechSynthesisUtterance; - charIndex: number; - elapsedTime: number; - name: string; -} - -interface SpeechSynthesisErrorEvent extends SpeechSynthesisEvent { - error: string; -} - -interface SpeechSynthesisVoice { - voiceURI: string; - name: string; - lang: string; - localService: boolean; - default: boolean; -} - -declare namespace Artyom { - - interface ArtyomDevice { - isChrome(): boolean; - isMobile(): boolean; - } - - interface ArtyomBrowserVoiceObject { - default: boolean; - lang: string; - localService: false; - name: string; - voiceURI: string; - } - - interface ArtyomConfigProperties { - /** Set the default language of artyom with this property */ - lang?: string; - recognizing?: boolean; - /** Choose if should listen one command and then stops, or listening forever */ - continuous?: boolean; - /** Moderates the speed with which Artyom talks (0 ~ 1) */ - speed?: number; - /** Adjust the volume of the voice of artyom */ - volume?: number; - /** If listen is equal to true the voice recognition will be started otherwise this property can be ignored */ - listen: boolean; - /** Recognition mode: normal, quick, remote */ - mode?: string; - /** Displays all the grammars recognized in the console */ - debug: boolean; - helpers?: { - redirectRecognizedTextOutput: any; - remoteProcessorHandler: any; - lastSay: any; - }; - /** Set a keyword that allows your command to be executed immediately when you say this word (Useful in noisy environments) */ - executionKeyword?: string; - /** Set a keyword that allows to enable the command recognition automatically if this word is recognized while artyom is paused (artyom.dontObey) */ - obeyKeyword?: string; - speaking?: boolean; - obeying?: boolean; - soundex?: boolean; - } - - interface ArtyomCommand { - /** Triggers of the command */ - indexes: string[]; - /** Logic to execute when the command is triggered */ - action: (i: number, wildcard?: string, full?: string) => void; - /** Description of the command */ - description?: string; - /** Flag to specify is a command is either normal or smart */ - smart?: boolean; - } - - interface ArtyomFlags { - restartRecognition: boolean; - } - - interface ArtyomRecognizer { - lang: string; - continuous: boolean; - interimResults: boolean; - start(): void; - stop(): void; - onstart(): void; - onresult(event: any): void; - onerror(event: any): void; - onend(): void; - } - - export interface ArtyomJS { - /** - * Contains some basic information that artyom needs to know as the type of device and browser - * @see http://ourcodeworld.com/projects/projects-documentation/6/read-doc/artyom-device/artyom-js - */ - device: ArtyomDevice; - - /** - * Object which provides the speech interface, and set some of its attributes and event handlers - */ - artyomWSR: ArtyomRecognizer; - - /** - * Artyom can return inmediately the voices available in your browser. - * @see http://ourcodeworld.com/projects/projects-documentation/14/read-doc/artyom-getvoices/artyom-js - * @returns {Array} - */ - getVoices(): SpeechSynthesisVoice[]; - - /** - * Returns an array with all the available commands for artyom. - * @see http://ourcodeworld.com/projects/projects-documentation/10/read-doc/artyom-getavailablecommands/artyom-js - * @returns {Array} - */ - getAvailableCommands(): ArtyomCommand[]; - - /** - * Set up artyom for the application. This function will set the default language used by artyom - * or notice the user if artyom is not supported in the actual browser. - * @see http://ourcodeworld.com/projects/projects-documentation/15/read-doc/artyom-initialize/artyom-js - * @param {ArtyomConfigProperties} config - * @returns {Boolean} - */ - initialize(config: ArtyomConfigProperties): boolean; - - /** - * Force artyom to stop listen even if is in continuos mode. - * @see http://ourcodeworld.com/projects/projects-documentation/9/read-doc/artyom-fatality/artyom-js - * @returns {Boolean} - */ - fatality(): boolean; - - /** - * Add dinamically commands to artyom using. You can even add commands while artyom is active. - * @see http://ourcodeworld.com/projects/projects-documentation/4/read-doc/artyom-addcommands/artyom-js - * @param {ArtyomCommand | Array[ArtyomCommand]} newCommand - * @returns {Boolean} - */ - addCommands(newCommand: ArtyomCommand | ArtyomCommand[]): boolean; - - /** - * Remove the commands of artyom with indexes that matches with the given text. - * @see http://ourcodeworld.com/projects/projects-documentation/19/read-doc/artyom-removecommands/artyom-js - * @param {string} identifier - * @returns {Array} - */ - removeCommands(identifier: string): number[]; - - /** - * Removes all the added commands of artyom. - * @see http://ourcodeworld.com/projects/projects-documentation/7/read-doc/artyom-emptycommands/artyom-js - * @returns {Array} - */ - emptyCommands(): ArtyomCommand[]; - - /** - * Stops the actual and pendings messages that artyom have to say. - * @see http://ourcodeworld.com/projects/projects-documentation/23/read-doc/artyom-shutup/artyom-js - */ - shutUp(): void; - - /** - * Returns an object with the actual properties of artyom. - * @see http://ourcodeworld.com/projects/projects-documentation/12/read-doc/artyom-getproperties/artyom-js - * @returns {ArtyomConfigProperties} - */ - getProperties(): ArtyomConfigProperties; - - /** - * Create a listener when an artyom action is called. - * @see http://ourcodeworld.com/projects/projects-documentation/24/read-doc/artyom-when/artyom-js - */ - when(event: any, action: any): any; - - /** - * Returns the code language of artyom according to initialize function. - * @see http://ourcodeworld.com/projects/projects-documentation/11/read-doc/artyom-getlanguage/artyom-js - * @returns {String} Language - */ - getLanguage(): string; - - /** - * Talks a text according to the given parameters (private function). - * @param {String} text Text to be spoken - * @param {Int} actualChunk Number of chunk of the - * @param {Int} totalChunks - * @param {any} callbacks - */ - artyomTalk(text: any, actualChunk: any, totalChunks: any, callbacks: any): any; - - /** - * Splits a string into an array of strings with a limited size (chunk_length). - * @param {String} input text to split into chunks - * @param {Integer} chunk_length limit of characters in every chunk - */ - splitStringByChunks(input: any, chunk_length: any): string[]; - - /** - * Process the given text into chunks and execute the private function artyom_talk. - * @param {String} message Text to be spoken - * @param {Object} callbacks { onStart, onEnd } - * @see http://ourcodeworld.com/projects/projects-documentation/20/read-doc/artyom-say/artyom-js - */ - say(message: any, callbacks: any): void; - - /** - * Repeats the last sentence that artyom said. Useful in noisy environments. - * @param {Boolean} returnObject If set to true, an object with the text and the timestamp when was executed will be returned. - * @see http://ourcodeworld.com/projects/projects-documentation/25/read-doc/artyom-repeatlastsay/artyom-js - */ - repeatLastSay(returnObject: any): void; - - /** - * Verify if the browser supports speechSynthesis. - * @see http://ourcodeworld.com/projects/projects-documentation/40/read-doc/artyom-speechsupported/artyom-js - * @returns {Boolean} - */ - speechSupported(): boolean; - - /** - * Verify if the browser supports webkitSpeechRecognition. - * @see http://ourcodeworld.com/projects/projects-documentation/39/read-doc/artyom-recognizingsupported/artyom-js - * @returns {Boolean} - */ - recognizingSupported(): boolean; - - /** - * Simulate a voice command via JS. - * @see http://ourcodeworld.com/projects/projects-documentation/22/read-doc/artyom-simulateinstruction/artyom-js - * @param {string} sentence - * @returns {Boolean} - */ - simulateInstruction(sentence: string): boolean; - - /** - * Returns an object with data of the matched element. - * @param {string} voiceCommand - * @returns {Object | Function}. There is a result field when the function should return a boolean value. - */ - artyomExecute(voiceCommand: string): any; - - /** - * Displays a message in the console if the artyom propery DEBUG is set to true. - * @param {string} error The error to be debugged - * @param {string} traceLevel Error level: { error | warn | info } - * @see http://ourcodeworld.com/projects/projects-documentation/38/read-doc/artyom-debug/artyom-js - */ - debug(stringEvent: string, traceLevel: string): void; - - /** - * Allows to retrieve the recognized spoken text of artyom and do something with it everytime something is recognized. - * @param {Function} action - * @returns {Boolean} - */ - redirectRecognizedTextOutput(action: () => void): boolean; - - /** - * Says a random quote and returns it's object. - * @param data - */ - sayRandom(data: any): any; - - /** - * Artyom provide an easy way to create a dictation for your user. Just create an instance and start and stop when you want. - */ - newDictation(settings: any): any; - - /** - * A voice prompt will be executed. - */ - newPrompt(config: any): any; - - /** - * Artyom awaits for orders when this function is executed. If artyom gets a first parameter the instance will be stopped. - */ - artyomHey(): any; - - /** - * This function will return the webkitSpeechRecognition object used by artyom retrieve it only to debug on it or get some - * values, do not make changes directly. - */ - getNativeApi(): any; - - /** - * This function returns a boolean according to the SpeechRecognition status if artyom is listening, will return true. - * Note: This is not a feature of SpeechRecognition, therefore this value hangs on the fiability of the onStart and onEnd - * events of the SpeechRecognition - * @returns {Boolean} - */ - isRecognizing(): boolean; - - /** - * This function returns a boolean according to the speechSynthesis status if artyom is speaking, will return true. - * Note: This is not a feature of speechSynthesis, therefore this value hangs on the fiability of the onStart and onEnd - * events of the speechSynthesis. - * @returns {Boolean} - */ - isSpeaking(): boolean; - - /** - * The SpeechSynthesisUtterance objects are stored in the artyom_garbage_collector variable to prevent the wrong behaviour - * of artyom.say. Use this method to clear all spoken SpeechSynthesisUtterance unused objects. - * @returns {Boolean} - */ - clearGarbageCollection(): any; - - /** - * Returns the SpeechSynthesisUtterance garbageobjects. - */ - getGarbageCollection(): any; - - /** - * Pause the processing of commands. Artyom still listening in the background and it can be resumed after a couple of seconds. - * @returns {Boolean} - */ - dontObey(): any; - - /** - * Allow artyom to obey commands again. - * @returns {Boolean} - */ - obey(): any; - - /** - * A boolean to check if artyom is obeying commands or not. - * @returns {Boolean} - */ - isObeying(): boolean; - - /** - * Process the recognized text if artyom is active in remote mode. - * @returns {Boolean} - */ - remoteProcessorService(action: any): any; - - /** - * Returns a string with the actual version of Artyom script. - * @returns {String} - */ - getVersion(): string; - - /** - * Add commands like an artisan. If you use artyom for simple - * tasks then probably you don't like to write a lot to achieve it. - * Use the artisan syntax to write less, but with the same accuracy. - * @disclaimer Not a promise-based implementation, just syntax. - * @returns {Object} - */ - on(indexes: any, smart: any): any; - } - - /** - * ArtyomBuilder bla, bla... - */ - export class ArtyomBuilder { - /** - * Method to bla, bla, bla... - */ - static getInstance(): ArtyomJS - } - -} - -// tslint:disable-next-line:export-just-namespace -export = Artyom; -export as namespace Artyom; diff --git a/artyom.js/tslint.json b/artyom.js/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/artyom.js/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/assert-plus/index.d.ts b/assert-plus/index.d.ts deleted file mode 100644 index 5de187cb85..0000000000 --- a/assert-plus/index.d.ts +++ /dev/null @@ -1,357 +0,0 @@ -// Type definitions for assert-plus 1.0 -// Project: https://github.com/mcavage/node-assert-plus#readme -// Definitions by: Костя Третяк -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -import {Stream} from 'stream'; - -export function array(arr: any[], message ?: string): void; - -export function bool(bool: boolean, message ?: string): void; - -export function buffer(buffer: Buffer, message ?: string): void; - -export function func(func: any, message ?: string): void; - -export function number(number: number, message ?: string): void; - -export function finite(finite: number, message ?: string): void; - -export function object(obj: any, message ?: string): void; - -export function string(str: string, message ?: string): void; - -export function stream(stream: Stream, message ?: string): void; - -export function date(date: Date, message ?: string): void; - -export function regexp(regexp: RegExp, message ?: string): void; - -export function uuid(uuid: string, message ?: string): void; - -export function arrayOfArray(arr: any[][], message ?: string): void; - -export function arrayOfBool(arr: boolean[], message ?: string): void; - -export function arrayOfBuffer(arr: Buffer[], message ?: string): void; - -export function arrayOfFunc(arr: any[], message ?: string): void; - -export function arrayOfNumber(arr: number[], message ?: string): void; - -export function arrayOfFinite(arr: number[], message ?: string): void; - -export function arrayOfObject(arr: any[], message ?: string): void; - -export function arrayOfString(arr: string[], message ?: string): void; - -export function arrayOfStream(arr: Stream[], message ?: string): void; - -export function arrayOfDate(arr: Date[], message ?: string): void; - -export function arrayOfRegexp(arr: RegExp[], message ?: string): void; - -export function arrayOfUuid(arr: string[], message ?: string): void; - -export function optionalArray(arr: any[] | undefined, message ?: string): void; - -export function optionalBool(bool: boolean | undefined, message ?: string): void; - -export function optionalBuffer(buffer: Buffer | undefined, message ?: string): void; - -export function optionalFunc(options: any, message ?: string): void; - -export function optionalNumber(options: number | undefined, message ?: string): void; - -export function optionalFinite(options: number | undefined, message ?: string): void; - -export function optionalObject(options: any, message ?: string): void; - -export function optionalString(options: string | undefined, message ?: string): void; - -export function optionalStream(options: Stream | undefined, message ?: string): void; - -export function optionalDate(options: Date | undefined, message ?: string): void; - -export function optionalRegexp(options: RegExp | undefined, message ?: string): void; - -export function optionalUuid(options: string | undefined, message ?: string): void; - -export function optionalArrayOfArray(arr: any[][] | undefined, message ?: string): void; - -export function optionalArrayOfBool(arr: boolean[] | undefined, message ?: string): void; - -export function optionalArrayOfBuffer(arr: Buffer[] | undefined, message ?: string): void; - -export function optionalArrayOfFunc(arr: any[] | undefined, message ?: string): void; - -export function optionalArrayOfNumber(arr: number[] | undefined, message ?: string): void; - -export function optionalArrayOfFinite(arr: number[] | undefined, message ?: string): void; - -export function optionalArrayOfObject(arr: any[] | undefined, message ?: string): void; - -export function optionalArrayOfString(arr: string[] | undefined, message ?: string): void; - -export function optionalArrayOfStream(arr: Stream[] | undefined, message ?: string): void; - -export function optionalArrayOfDate(arr: Date[] | undefined, message ?: string): void; - -export function optionalArrayOfRegexp(arr: RegExp[] | undefined, message ?: string): void; - -export function optionalArrayOfUuid(arr: string[] | undefined, message ?: string): void; - -export function AssertionError(options: any, message ?: string): void; - -/** - * Throws an `AssertionError`. If `message` is falsy, the error message is set - * as the values of `actual` and `expected` separated by the provided `operator`. - * Otherwise, the error message is the value of `message`. - * - * ```js - * const assert = require('assert'); - * - * assert.fail(1, 2, undefined, '>'); - * // AssertionError: 1 > 2 - * - * assert.fail(1, 2, 'whoops', '>'); - * // AssertionError: whoops - * ``` - */ -export function fail(actual: any, expected: any, message: any, operator: any): void; - - -/** - * Tests if `value` is truthy. It is equivalent to `assert.equal(!!value, true, message)`. - * - * If `value` is not truthy, an `AssertionError` is thrown with a `message` property - * set equal to the value of the `message` parameter. - * If the `message` parameter is `undefined`, a default error message is assigned. - * - * ```js - * const assert = require('assert'); - * - * assert.ok(true); - * // OK - * assert.ok(1); - * // OK - * assert.ok(false); - * // throws "AssertionError: false == true" - * assert.ok(0); - * // throws "AssertionError: 0 == true" - * assert.ok(false, 'it\'s false'); - * // throws "AssertionError: it's false" - * ``` - */ -export function ok(options: any, message ?: string): void; - -/** - * Tests shallow, coercive equality between the actual and expected parameters - * using the equal comparison operator ( `==` ). - * - * ```js - * const assert = require('assert'); - * - * assert.equal(1, 1); - * // OK, 1 == 1 - * assert.equal(1, '1'); - * // OK, 1 == '1' - * - * assert.equal(1, 2); - * // AssertionError: 1 == 2 - * assert.equal({a: {b: 1}}, {a: {b: 1}}); - * //AssertionError: { a: { b: 1 } } == { a: { b: 1 } } - * ``` - * - * If the values are not equal, an `AssertionError` is thrown with - * a `message` property set equal to the value of the `message` parameter. - * If the `message` parameter is undefined, a default error message is assigned. - */ -export function equal(actual: any, expected: any, message ?: string): void; - -/** - * Tests shallow, coercive inequality with the not equal comparison operator ( `!=` ). - * - * ```js - * const assert = require('assert'); - * - * assert.notEqual(1, 2); - * // OK - * - * assert.notEqual(1, 1); - * // AssertionError: 1 != 1 - * - * assert.notEqual(1, '1'); - * // AssertionError: 1 != '1' - * ``` - * - * If the values are equal, an `AssertionError` is thrown with - * a `message` property set equal to the value of the `message` parameter. - * If the `message` parameter is undefined, a default error message is assigned. - */ -export function notEqual(actual: any, expected: any, message ?: string): void; - -/** - * Tests for deep equality between the `actual` and `expected` parameters. - * Primitive values are compared with the equal comparison operator ( `==` ). - * - * Only enumerable "own" properties are considered. - * The `deepEqual()` implementation does not test object prototypes, attached symbols, - * or non-enumerable properties. This can lead to some potentially surprising results. - * For example, the following example does not throw an `AssertionError` because - * the properties on the Error object are non-enumerable: - * - * ```js - * // WARNING: This does not throw an AssertionError! - * assert.deepEqual(Error('a'), Error('b')); - * ``` - * - * "Deep" equality means that the enumerable "own" properties of child objects are evaluated also. - * - * If the values are not equal, an `AssertionError` is thrown with a `message` property - * set equal to the value of the `message` parameter. If the `message` parameter is undefined, - * a default error message is assigned. - */ -export function deepEqual(actual: T, expected: T, message ?: string): void; - -/** - * Tests for any deep inequality. Opposite of `assert.deepEqual()`. - * - * ```js - * const assert = require('assert'); - * - * const obj1 = { a : { b : 1 } }; - * const obj2 = { a : { b : 2 } }; - * const obj3 = { a : { b : 1 } }; - * const obj4 = Object.create(obj1); - * - * assert.notDeepEqual(obj1, obj1); - * // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } } - * - * assert.notDeepEqual(obj1, obj2); - * // OK, obj1 and obj2 are not deeply equal - * - * assert.notDeepEqual(obj1, obj3); - * // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } } - * - * assert.notDeepEqual(obj1, obj4); - * // OK, obj1 and obj2 are not deeply equal - * ``` - * - * If the values are deeply equal, an `AssertionError` is thrown with - * a `message` property set equal to the value of the `message` parameter. - * If the `message` parameter is undefined, a default error message is assigned. - */ -export function notDeepEqual(actual: any, expected: any, message ?: string): void; - -/** - * Tests strict equality as determined by the strict equality operator ( `===` ). - * - * ```js - * const assert = require('assert'); - * - * assert.strictEqual(1, 2); - * // AssertionError: 1 === 2 - * - * assert.strictEqual(1, 1); - * // OK - * - * assert.strictEqual(1, '1'); - * // AssertionError: 1 === '1' - * ``` - * - * If the values are not strictly equal, an `AssertionError` is thrown with - * a `message` property set equal to the value of the `message` parameter. - * If the `message` parameter is undefined, a default error message is assigned. - */ -export function strictEqual(actual: T, expected: T, message ?: string): void; - -/** - * Tests strict inequality as determined by the strict not equal operator ( `!==` ). - * - * ```js - * const assert = require('assert'); - * - * assert.notStrictEqual(1, 2); - * // OK - * - * assert.notStrictEqual(1, 1); - * // AssertionError: 1 !== 1 - * - * assert.notStrictEqual(1, '1'); - * // OK - * ``` - * - * If the values are strictly equal, an `AssertionError` is thrown with a `message` property - * set equal to the value of the `message` parameter. If the `message` parameter is undefined, - * a default error message is assigned. - */ -export function notStrictEqual(actual: any, expected: any, message ?: string): void; - -export function throws(block: any, error ?: any, message ?: string): void; - -/** - * Asserts that the function `block` does not throw an error. See `assert.throws()` for more details. - * - * When `assert.doesNotThrow()` is called, it will immediately call the `block` function. - * - * If an error is thrown and it is the same type as that specified by the `error` parameter, - * then an `AssertionError` is thrown. If the error is of a different type, - * or if the `error` parameter is undefined, the error is propagated back to the caller. - * - * The following, for instance, will throw the TypeError because there is no matching error type in the assertion: - * ```js - * assert.doesNotThrow( - * () => { - * throw new TypeError('Wrong value'); - * }, - * SyntaxError - * ); - * ``` - * - * However, the following will result in an `AssertionError` with the message 'Got unwanted exception (TypeError)..': - * ```js - * assert.doesNotThrow( - * () => { - * throw new TypeError('Wrong value'); - * }, - * TypeError - * ); - * ``` - * - * If an `AssertionError` is thrown and a value is provided for the `message` parameter, - * the value of `message` will be appended to the `AssertionError` message: - * ```js - * assert.doesNotThrow( - * () => { - * throw new TypeError('Wrong value'); - * }, - * TypeError, - * 'Whoops' - * ); - * // Throws: AssertionError: Got unwanted exception (TypeError). Whoops - * ``` - */ -export function doesNotThrow(block: any, error ?: any, message ?: string): void; - -/** - * Throws `value` if `value` is truthy. This is useful when testing the `error` argument in callbacks. - * ```js - * const assert = require('assert'); - * - * assert.ifError(0); - * // OK - * assert.ifError(1); - * // Throws 1 - * assert.ifError('error'); - * // Throws 'error' - * assert.ifError(new Error()); - * // Throws Error - * ``` - */ -export function ifError(value: any): void; - - -export as namespace AssertPlus; diff --git a/assert-plus/tslint.json b/assert-plus/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/assert-plus/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/async/index.d.ts b/async/index.d.ts deleted file mode 100644 index e3fbe7e512..0000000000 --- a/async/index.d.ts +++ /dev/null @@ -1,229 +0,0 @@ -// Type definitions for Async 2.0.1 -// Project: https://github.com/caolan/async -// Definitions by: Boris Yankov , Arseniy Maximov , Joe Herman , Angus Fenying , Pascal Martin -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -interface Dictionary { [key: string]: T; } - -interface ErrorCallback { (err?: T): void; } -interface AsyncWaterfallCallback { (err: E, ...args: any[]): void; } -interface AsyncBooleanResultCallback { (err: E, truthValue: boolean): void; } -interface AsyncResultCallback { (err: E, result: T): void; } -interface AsyncResultArrayCallback { (err: E, results: T[]): void; } -interface AsyncResultObjectCallback { (err: E, results: Dictionary): void; } - -interface AsyncFunction { (callback: (err?: E, result?: T) => void): void; } -interface AsyncIterator { (item: T, callback: ErrorCallback): void; } -interface AsyncForEachOfIterator { (item: T, key: number|string, callback: ErrorCallback): void; } -interface AsyncResultIterator { (item: T, callback: AsyncResultCallback): void; } -interface AsyncMemoIterator { (memo: R, item: T, callback: AsyncResultCallback): void; } -interface AsyncBooleanIterator { (item: T, callback: AsyncBooleanResultCallback): void; } - -interface AsyncWorker { (task: T, callback: ErrorCallback): void; } -interface AsyncVoidFunction { (callback: ErrorCallback): void; } - -interface AsyncQueue { - length(): number; - started: boolean; - running(): number; - idle(): boolean; - concurrency: number; - push(task: T, callback?: ErrorCallback): void; - push(task: T, callback?: AsyncResultCallback): void; - push(task: T[], callback?: ErrorCallback): void; - unshift(task: T, callback?: ErrorCallback): void; - unshift(task: T[], callback?: ErrorCallback): void; - saturated: () => any; - empty: () => any; - drain: () => any; - paused: boolean; - pause(): void - resume(): void; - kill(): void; - workersList(): { - data: T, - callback: Function - }[]; - error(error: Error, data: any): void; - unsaturated(): void; - buffer: number; -} - -interface AsyncPriorityQueue { - length(): number; - concurrency: number; - started: boolean; - paused: boolean; - push(task: T, priority: number, callback?: AsyncResultArrayCallback): void; - push(task: T[], priority: number, callback?: AsyncResultArrayCallback): void; - saturated: () => any; - empty: () => any; - drain: () => any; - running(): number; - idle(): boolean; - pause(): void; - resume(): void; - kill(): void; - workersList(): { - data: T, - priority: number, - callback: Function - }[]; - error(error: Error, data: any): void; - unsaturated(): void; - buffer: number; -} - -interface AsyncCargo { - length(): number; - payload: number; - push(task: any, callback? : Function): void; - push(task: any[], callback? : Function): void; - saturated(): void; - empty(): void; - drain(): void; - idle(): boolean; - pause(): void; - resume(): void; - kill(): void; -} - -interface Async { - - // Collections - each(arr: T[], iterator: AsyncIterator, callback?: ErrorCallback): void; - each(arr: Dictionary, iterator: AsyncIterator, callback?: ErrorCallback): void; - eachSeries: typeof async.each; - eachLimit(arr: T[], limit: number, iterator: AsyncIterator, callback?: ErrorCallback): void; - eachLimit(arr: Dictionary, limit: number, iterator: AsyncIterator, callback?: ErrorCallback): void; - forEach: typeof async.each; - forEachSeries: typeof async.each; - forEachLimit: typeof async.eachLimit; - forEachOf(obj: T[], iterator: AsyncForEachOfIterator, callback?: ErrorCallback): void; - forEachOf(obj: Dictionary, iterator: AsyncForEachOfIterator, callback?: ErrorCallback): void; - forEachOfSeries: typeof async.forEachOf; - forEachOfLimit(obj: T[], limit: number, iterator: AsyncForEachOfIterator, callback?: ErrorCallback): void; - forEachOfLimit(obj: Dictionary, limit: number, iterator: AsyncForEachOfIterator, callback?: ErrorCallback): void; - eachOf: typeof async.forEachOf; - eachOfSeries: typeof async.forEachOf; - eachOfLimit: typeof async.forEachOfLimit; - map(arr: T[], iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; - map(arr: Dictionary, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; - mapSeries: typeof async.map; - mapLimit(arr: T[], limit: number, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; - mapLimit(arr: Dictionary, limit: number, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; - mapValuesLimit(obj: Dictionary, limit: number, iteratee: (value: T, key: string, callback: AsyncResultCallback) => void, callback: AsyncResultObjectCallback): void; - mapValues(obj: Dictionary, iteratee: (value: T, key: string, callback: AsyncResultCallback) => void, callback: AsyncResultObjectCallback): void; - mapValuesSeries: typeof async.mapValues; - filter(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): void; - filter(arr: Dictionary, iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): void; - filterSeries: typeof async.filter; - filterLimit(arr: T[], limit: number, iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): void; - filterLimit(arr: Dictionary, limit: number, iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): void; - select: typeof async.filter; - selectSeries: typeof async.filter; - selectLimit: typeof async.filterLimit; - reject: typeof async.filter; - rejectSeries: typeof async.filter; - rejectLimit: typeof async.filterLimit; - reduce(arr: T[], memo: R, iterator: AsyncMemoIterator, callback?: AsyncResultCallback): void; - inject: typeof async.reduce; - foldl: typeof async.reduce; - reduceRight: typeof async.reduce; - foldr: typeof async.reduce; - detect(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncResultCallback): void; - detect(arr: Dictionary, iterator: AsyncBooleanIterator, callback?: AsyncResultCallback): void; - detectSeries: typeof async.detect; - detectLimit(arr: T[], limit: number, iterator: AsyncBooleanIterator, callback?: AsyncResultCallback): void; - detectLimit(arr: Dictionary, limit: number, iterator: AsyncBooleanIterator, callback?: AsyncResultCallback): void; - find: typeof async.detect; - findSeries: typeof async.detect; - findLimit: typeof async.detectLimit; - sortBy(arr: T[], iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; - some(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncBooleanResultCallback): void; - some(arr: Dictionary, iterator: AsyncBooleanIterator, callback?: AsyncBooleanResultCallback): void; - someSeries: typeof async.some; - someLimit(arr: T[], limit: number, iterator: AsyncBooleanIterator, callback?: AsyncBooleanResultCallback): void; - someLimit(arr: Dictionary, limit: number, iterator: AsyncBooleanIterator, callback?: AsyncBooleanResultCallback): void; - any: typeof async.some; - anySeries: typeof async.someSeries; - anyLimit: typeof async.someLimit; - every(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncBooleanResultCallback): void; - every(arr: Dictionary, iterator: AsyncBooleanIterator, callback?: AsyncBooleanResultCallback): void; - everySeries: typeof async.every; - everyLimit(arr: T[], limit: number, iterator: AsyncBooleanIterator, callback?: AsyncBooleanResultCallback): void; - everyLimit(arr: Dictionary, limit: number, iterator: AsyncBooleanIterator, callback?: AsyncBooleanResultCallback): void; - all: typeof async.every; - allSeries: typeof async.every; - allLimit: typeof async.everyLimit; - - concat(arr: T[], iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; - concat(arr: Dictionary, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; - concatSeries: typeof async.concat; - - // Control Flow - series(tasks: AsyncFunction[], callback?: AsyncResultArrayCallback): void; - series(tasks: Dictionary>, callback?: AsyncResultObjectCallback): void; - parallel(tasks: Array>, callback?: AsyncResultArrayCallback): void; - parallel(tasks: Dictionary>, callback?: AsyncResultObjectCallback): void; - parallelLimit(tasks: Array>, limit: number, callback?: AsyncResultArrayCallback): void; - parallelLimit(tasks: Dictionary>, limit: number, callback?: AsyncResultObjectCallback): void; - whilst(test: () => boolean, fn: AsyncVoidFunction, callback: ErrorCallback): void; - doWhilst(fn: AsyncVoidFunction, test: () => boolean, callback: ErrorCallback): void; - until(test: () => boolean, fn: AsyncVoidFunction, callback: ErrorCallback): void; - doUntil(fn: AsyncVoidFunction, test: () => boolean, callback: ErrorCallback): void; - during(test: (testCallback : AsyncBooleanResultCallback) => void, fn: AsyncVoidFunction, callback: ErrorCallback): void; - doDuring(fn: AsyncVoidFunction, test: (testCallback: AsyncBooleanResultCallback) => void, callback: ErrorCallback): void; - forever(next: (next : ErrorCallback) => void, errBack: ErrorCallback) : void; - waterfall(tasks: Function[], callback?: AsyncResultCallback): void; - compose(...fns: Function[]): Function; - seq(...fns: Function[]): Function; - applyEach(fns: Function[], argsAndCallback: any[]): void; // applyEach(fns, args..., callback). TS does not support ... for a middle argument. Callback is optional. - applyEachSeries(fns: Function[], argsAndCallback: any[]): void; // applyEachSeries(fns, args..., callback). TS does not support ... for a middle argument. Callback is optional. - queue(worker: AsyncWorker, concurrency?: number): AsyncQueue; - queue(worker: AsyncResultIterator, concurrency?: number): AsyncQueue; - priorityQueue(worker: AsyncWorker, concurrency: number): AsyncPriorityQueue; - cargo(worker : (tasks: any[], callback : ErrorCallback) => void, payload? : number) : AsyncCargo; - auto(tasks: any, concurrency?: number, callback?: AsyncResultCallback): void; - autoInject(tasks: any, callback?: AsyncResultCallback): void; - retry(opts: number, task: (callback : AsyncResultCallback, results: any) => void, callback: AsyncResultCallback): void; - retry(opts: { times: number, interval: number|((retryCount: number) => number) }, task: (callback: AsyncResultCallback, results : any) => void, callback: AsyncResultCallback): void; - retryable(opts: number | {times: number, interval: number}, task: AsyncFunction): AsyncFunction; - apply(fn: Function, ...arguments: any[]): AsyncFunction; - nextTick(callback: Function, ...args: any[]): void; - setImmediate: typeof async.nextTick; - - reflect(fn: AsyncFunction) : (callback: (err: void, result: {error?: Error, value?: T}) => void) => void; - reflectAll(tasks: AsyncFunction[]): ((callback: (err: void, result: {error?: Error, value?: T}) => void) => void)[]; - - timeout(fn: AsyncFunction, milliseconds: number, info?: any): AsyncFunction; - timeout(fn: AsyncResultIterator, milliseconds: number, info?: any): AsyncResultIterator; - - times (n: number, iterator: AsyncResultIterator, callback: AsyncResultArrayCallback): void; - timesSeries(n: number, iterator: AsyncResultIterator, callback: AsyncResultArrayCallback): void; - timesLimit(n: number, limit: number, iterator: AsyncResultIterator, callback: AsyncResultArrayCallback): void; - - transform(arr: T[], iteratee: (acc: R[], item: T, key: string, callback: (error?: E) => void) => void): void; - transform(arr: T[], acc: R[], iteratee: (acc: R[], item: T, key: string, callback: (error?: E) => void) => void): void; - transform(arr: {[key: string] : T}, iteratee: (acc: {[key: string] : R}, item: T, key: string, callback: (error?: E) => void) => void): void; - transform(arr: {[key: string] : T}, acc: {[key: string] : R}, iteratee: (acc: {[key: string] : R}, item: T, key: string, callback: (error?: E) => void) => void): void; - - race(tasks: (AsyncFunction)[], callback: AsyncResultCallback) : void; - - // Utils - memoize(fn: Function, hasher?: Function): Function; - unmemoize(fn: Function): Function; - ensureAsync(fn: (... argsAndCallback: any[]) => void): Function; - constant(...values: any[]): Function; - asyncify(fn: Function): Function; - wrapSync(fn: Function): Function; - log(fn: Function, ...arguments: any[]): void; - dir(fn: Function, ...arguments: any[]): void; -} - -declare var async: Async; - -declare module "async" { - export = async; -} - diff --git a/async/test/explicit.ts b/async/test/explicit.ts deleted file mode 100644 index 80343cf6b1..0000000000 --- a/async/test/explicit.ts +++ /dev/null @@ -1,44 +0,0 @@ - - -interface StringCallback { (err: Error, result: string): void; } -interface AsyncStringGetter { (callback: StringCallback): void; } - -var taskArray: AsyncStringGetter[] = [ - function (callback) { - setTimeout(function () { - callback(null, 'one'); - }, 200); - }, - function (callback) { - setTimeout(function () { - callback(null, 'two'); - }, 100); - }, -]; - -async.series(taskArray, function (err, results) { console.log(results[0].match(/o/)) }); -async.parallel(taskArray, function (err, results) { console.log(results[0].match(/o/)) }); -async.parallelLimit(taskArray, 3, function (err, results) { console.log(results[0].match(/o/)) }); - - -interface Lookup { [key: string]: T; } -interface NumberCallback { (err: Error, result: number): void; } -interface AsyncNumberGetter { (callback: NumberCallback): void; } - -var taskDict: Lookup = { - one: function(callback){ - setTimeout(function(){ - callback(null, 1); - }, 200); - }, - two: function(callback){ - setTimeout(function(){ - callback(null, 2); - }, 100); - } -} - -async.series(taskDict, function(err, results) { console.log(results['one'].toFixed(1)) }); -async.parallel(taskDict, function(err, results) { console.log(results['one'].toFixed(1)) }); -async.parallelLimit(taskDict, 3, function(err, results) { console.log(results['one'].toFixed(1)) }); - diff --git a/async/test/index.ts b/async/test/index.ts deleted file mode 100644 index 8c6be303e4..0000000000 --- a/async/test/index.ts +++ /dev/null @@ -1,839 +0,0 @@ -/// - -import fs = require("fs"); -import process = require("process"); - -declare var path: { - exists: (path: string, callback?: (err: Error, exists: boolean) => any) => void; -}; - -function funcStringCbErrBoolean(v:string, cb:(err:Error,res:boolean) => void) {} -function callback() { } - -async.map(['file1', 'file2', 'file3'], fs.stat, function (err:Error, results:Array) { }); -async.mapSeries(['file1', 'file2', 'file3'], fs.stat, function (err:Error, results:Array) { }); -async.mapLimit(['file1', 'file2', 'file3'], 2, fs.stat, function (err:Error, results:Array) { }); - -async.filter(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,results:Array) { }); -async.filterSeries(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,results:Array) { }); -async.filterLimit(['file1', 'file2', 'file3'], 2, funcStringCbErrBoolean, function (err:Error,results:Array) { }); -async.select(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,results:Array) { }); -async.selectSeries(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,results:Array) { }); -async.selectLimit(['file1', 'file2', 'file3'], 2, funcStringCbErrBoolean, function (err:Error,results:Array) { }); - -async.reject(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,results:Array) { }); -async.rejectSeries(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,results:Array) { }); -async.rejectLimit(['file1', 'file2', 'file3'], 2, funcStringCbErrBoolean, function (err:Error,results:Array) { }); - -async.parallel([ - function () { }, - function () { } -], callback); - -async.series([ - function () { }, - function () { } -]); - -var data: any[] = []; -function asyncProcess(item: any, callback: (err: Error, result: any) => void) { } -async.map(data, asyncProcess, function (err, results) { - console.log(results); -}); - -var openFiles = ['file1', 'file2']; -var openFilesObj = { - file1: "fileOne", - file2: "fileTwo" -} - -var saveFile = function (file:string,cb:(err:Error)=>void) { } -async.each(openFiles, saveFile, function (err:Error) { }); -async.eachSeries(openFiles, saveFile, function (err:Error) { }); - -var documents: any, requestApi: any; -async.eachLimit(documents, 20, requestApi, function (err) { }); - -// forEachOf* functions. May accept array or object. -function forEachOfIterator(item: string, key: string, forEachOfIteratorCallback: any) { - console.log("ForEach: item=" + item + ", key=" + key); - forEachOfIteratorCallback(); -} -async.forEachOf(openFiles, forEachOfIterator, function (err) { }); -async.forEachOf(openFilesObj, forEachOfIterator, function (err) { }); -async.forEachOfSeries(openFiles, forEachOfIterator, function (err) { }); -async.forEachOfSeries(openFilesObj, forEachOfIterator, function (err) { }); -async.forEachOfLimit(openFiles, 2, forEachOfIterator, function (err) { }); -async.forEachOfLimit(openFilesObj, 2, forEachOfIterator, function (err) { }); - -var numArray = [1, 2, 3]; -function reducer(memo: any, item: any, callback: any) { - process.nextTick(function () { - callback(null, memo + item) - }); -} -async.reduce(numArray, 0, reducer, function (err, result) { }); -async.inject(numArray, 0, reducer, function (err, result) { }); -async.foldl(numArray, 0, reducer, function (err, result) { }); -async.reduceRight(numArray, 0, reducer, function (err, result) { }); -async.foldr(numArray, 0, reducer, function (err, result) { }); - -async.detect(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err: Error,result:string) { }); -async.detectSeries(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err,result) { }); -async.detectLimit(['file1', 'file2', 'file3'], 2, funcStringCbErrBoolean, function (err,result) { }); - -async.sortBy(['file1', 'file2', 'file3'], function (file, callback) { - fs.stat(file, function (err, stats) { - callback(err, stats.mtime); - }); -}, function (err, results) { }); - -async.some(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,result:boolean) { }); -async.someLimit(['file1', 'file2', 'file3'], 2, funcStringCbErrBoolean, function (err:Error,result:boolean) { }); -async.any(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,result:boolean) { }); - -async.every(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,result:boolean) { }); -async.everyLimit(['file1', 'file2', 'file3'], 2, funcStringCbErrBoolean, function (err:Error,result:boolean) { }); -async.all(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,result:boolean) { }); - -async.concat(['dir1', 'dir2', 'dir3'], fs.readdir, function (err, files) { }); -async.concatSeries(['dir1', 'dir2', 'dir3'], fs.readdir, function (err, files) { }); - - -// Control Flow // - -async.series([ - function (callback) { - callback(undefined, 'one'); - }, - function (callback) { - callback(undefined, 'two'); - }, -], -function (err, results) { }); - -async.series([ - function (callback) { - callback(undefined, 'one'); - }, - function (callback) { - callback(undefined, 'two'); - }, -], -function (err, results) { }); - -async.series({ - one: function (callback) { - setTimeout(function () { - callback(undefined, 1); - }, 200); - }, - two: function (callback) { - setTimeout(function () { - callback(undefined, 2); - }, 100); - }, -}, -function (err, results) { }); - -async.series({ - one: function (callback) { - setTimeout(function () { - callback(undefined, 1); - }, 200); - }, - two: function (callback) { - setTimeout(function () { - callback(undefined, 2); - }, 100); - }, -}, -function (err, results) { }); - -async.times(5, function(n, next) { - next(undefined as any, n) -}, function(err, results) { - console.log(results) -}) - -async.timesSeries(5, function(n, next) { - next(undefined as any, n) -}, function(err, results) { - console.log(results) -}) - -async.parallel([ - function (callback) { - setTimeout(function () { - callback(undefined, 'one'); - }, 200); - }, - function (callback) { - setTimeout(function () { - callback(undefined, 'two'); - }, 100); - }, -], -function (err, results) { }); - -async.parallel([ - function (callback) { - setTimeout(function () { - callback(undefined, 'one'); - }, 200); - }, - function (callback) { - setTimeout(function () { - callback(undefined, 'two'); - }, 100); - }, -], -function (err, results) { }); - - -async.parallel({ - one: function (callback) { - setTimeout(function () { - callback(undefined, 1); - }, 200); - }, - two: function (callback) { - setTimeout(function () { - callback(undefined, 2); - }, 100); - }, -}, -function (err, results) { }); - -async.parallel({ - one: function (callback) { - setTimeout(function () { - callback(undefined, 1); - }, 200); - }, - two: function (callback) { - setTimeout(function () { - callback(undefined, 2); - }, 100); - }, -}, - function (err, results) { }); - -async.parallelLimit({ - one: function (callback) { - setTimeout(function () { - callback(undefined, 1); - }, 200); - }, - two: function (callback) { - setTimeout(function () { - callback(undefined, 2); - }, 100); - }, -}, - 2, - function (err, results) { } -); - - -function whileFn(callback: any) { - count++; - setTimeout(callback, 1000); -} - -function whileTest() { return count < 5; } -var count = 0; -async.whilst(whileTest, whileFn, function (err) { }); -async.until(whileTest, whileFn, function (err) { }); -async.doWhilst(whileFn, whileTest, function (err) { }); -async.doUntil(whileFn, whileTest, function (err) { }); - -async.during(function (testCallback) { testCallback(new Error(), false); }, function (callback) { callback() }, function (error) { console.log(error) }); -async.doDuring(function (callback) { callback() }, function (testCallback) { testCallback(new Error(), false); }, function (error) { console.log(error) }); -async.forever(function (errBack) { - errBack(new Error("Not going on forever.")); -}, - function (error) { - console.log(error); - } -); - -async.waterfall([ - function (callback: any) { - callback(null, 'one', 'two'); - }, - function (arg1: any, arg2: any, callback: any) { - callback(null, 'three'); - }, - function (arg1: any, callback: any) { - callback(null, 'done'); - } -], function (err, result) { }); - - -var q = async.queue(function (task: any, callback: () => void) { - console.log('hello ' + task.name); - callback(); -}, 2); - - -q.drain = function () { - console.log('all items have been processed'); -} - -q.push({ name: 'foo' }); - -q.push({ name: 'bar' }, function (err) { - console.log('finished processing bar'); -}); - -q.push([{ name: 'baz' }, { name: 'bay' }, { name: 'bax' }], function (err) { - console.log('finished processing bar'); -}); - -q.unshift({ name: 'foo' }); - -q.unshift({ name: 'bar' }, function (err) { - console.log('finished processing bar'); -}); - -q.unshift([{ name: 'baz' }, { name: 'bay' }, { name: 'bax' }], function (err) { - console.log('finished processing bar'); -}); - -var qLength : number = q.length(); -var qStarted : boolean = q.started; -var qPaused : boolean = q.paused; -var qProcessingCount : number = q.running(); -var qIsIdle : boolean = q.idle(); - -q.saturated = function() { - console.log('queue is saturated.'); -} - -q.empty = function() { - console.log('queue is empty.'); -} - -q.drain = function() { - console.log('queue was drained.'); -} - -q.pause(); -q.resume(); -q.kill(); - -// tests for strongly typed tasks -var q2 = async.queue(function (task: string, callback: () => void) { - console.log('Task: ' + task); - callback(); -}, 1); - -q2.push('task1'); - -q2.push('task2', function (error) { - console.log('Finished tasks'); -}); - -q2.push(['task3', 'task4', 'task5'], function (error) { - console.log('Finished tasks'); -}); - -q2.unshift('task1'); - -q2.unshift('task2', function (error) { - console.log('Finished tasks'); -}); - -q2.unshift(['task3', 'task4', 'task5'], function (error) { - console.log('Finished tasks'); -}); - - -var aq = async.queue(function (level: number, callback: (error : Error, newLevel: number) => void) { - console.log('hello ' + level); - callback(null, level+1); -}); - -aq.push(1, function (err : Error, newLevel : number) { - console.log('finished processing bar' + newLevel); -}); - -// create a cargo object with payload 2 -var cargo = async.cargo(function (tasks, callback) { - for (var i = 0; i < tasks.length; i++) { - console.log('hello ' + tasks[i].name); - } - callback(); -}, 2); - - -// add some items -cargo.push({ name: 'foo' }, function (err: Error) { - console.log('finished processing foo'); -}); -cargo.push({ name: 'bar' }, function (err: Error) { - console.log('finished processing bar'); -}); -cargo.push({ name: 'baz' }, function (err: Error) { - console.log('finished processing baz'); -}); - -var filename = ''; -async.auto({ - get_data: function (callback: any) { }, - make_folder: function (callback: any) { }, - //arrays with different types are not accepted by TypeScript. - write_file: ['get_data', 'make_folder', function (callback: any) { - callback(null, filename); - }], - //arrays with different types are not accepted by TypeScript. - email_link: ['write_file', function (callback: any, results: any) { }] -}); - -async.retry(3, function (callback, results) { }, function (err, result) { }); -async.retry({ times: 3, interval: 200 }, function (callback, results) { }, function (err, result) { }); -async.retry({ times: 3, interval: (retryCount) => { return 200 * retryCount; } }, function (callback, results) { }, function (err, result) { }); - - -async.parallel([ - function (callback: ( err:Error, val:string ) => void ) { }, - function (callback) { } -], -function (err:Error,results:Array) { - async.series([ - function (callback) { }, - function email_link(callback) { } - ]); -}); - -async.parallel([ - async.apply(fs.writeFile, 'testfile1', 'test1'), - async.apply(fs.writeFile, 'testfile2', 'test2'), -]); - - -async.parallel([ - function (callback) { - fs.writeFile('testfile1', 'test1', callback); - }, - function (callback) { - fs.writeFile('testfile2', 'test2', callback); - }, -]); - -var call_order: string[] = []; -async.nextTick(function () { - call_order.push('two'); -}); -call_order.push('one'); - -var slow_fn = function (name: string, callback: any) { - callback(null, 123); -}; -var fn = async.memoize(slow_fn); -fn('some name', function () {}); -async.unmemoize(fn); -async.ensureAsync(function () { }); -async.constant(42); -async.asyncify(function () { }); - -async.log(function (name: any, callback: any) { - setTimeout(function () { - callback(null, 'hello ' + name); - }, 0); -}, "world" - ); - -async.dir(function (name: string, callback: any) { - setTimeout(function () { - callback(null, { hello: name }); - }, 1000); -}, "world"); - -// each - -async.each({ - "a": 1, - "b": 2 -}, function(val: number, next: ErrorCallback): void { - - setTimeout(function(): void { - - console.log(`async.each: ${val}`); - - next(); - - }, 500); - -}, function(err?: Error): void { - - console.log("async.each: done."); - -}); - -async.eachSeries({ - "a": 1, - "b": 2 -}, function(val: number, next: ErrorCallback): void { - - setTimeout(function(): void { - - console.log(`async.eachSeries: ${val}`); - - next(); - - }, 500); - -}, function(err?: Error): void { - - console.log("async.eachSeries: done."); - -}); - -async.eachLimit({ - "a": 1, - "b": 2, - "c": 3, - "d": 4, - "e": 5, - "f": 6 -}, 2, function(val: number, next: ErrorCallback): void { - - setTimeout(function(): void { - - console.log(`async.eachLimit: ${val}`); - - next(); - - }, 500); - -}, function(err?: Error): void { - - console.log("async.eachLimit: done."); - -}); - -// forEachOf/eachOf - -async.eachOf({ - "a": 1, - "b": 2 -}, function(val: number, key: string, next: ErrorCallback): void { - - setTimeout(function(): void { - - console.log(`async.forEachOf/eachOf: ${key} = ${val}`); - - next(); - - }, 500); - -}, function(err?: Error): void { - - console.log("async.forEachOf/eachOf: done."); - -}); - -async.forEachOfSeries({ - "a": 1, - "b": 2 -}, function(val: number, key: string, next: ErrorCallback): void { - - setTimeout(function(): void { - - console.log(`async.forEachOfSeries: ${key} = ${val}`); - - next(); - - }, 500); - -}, function(err?: Error): void { - - console.log("async.forEachOfSeries: done."); - -}); - -async.forEachOfLimit({ - "a": 1, - "b": 2, - "c": 3, - "d": 4, - "e": 5, - "f": 6 -}, 2, function(val: number, key: string, next: ErrorCallback): void { - - setTimeout(function(): void { - - console.log(`async.forEachOfLimit: ${key} = ${val}`); - - next(); - - }, 500); - -}, function(err?: Error): void { - - console.log("async.forEachOfLimit: done."); - -}); - -// map - -async.map({ - "a": 1, - "b": 2, - "c": 3 -}, function(val: number, next: AsyncResultCallback): void { - - setTimeout(function(): void { - - console.log(`async.map: ${val}`); - - next(undefined as any, val.toString()); - - }, 500); - -}, function(err: Error, results: string[]): void { - - console.log("async.map: done with results", results); - -}); - -async.mapSeries({ - "a": 1, - "b": 2, - "c": 3 -}, function(val: number, next: AsyncResultCallback): void { - - setTimeout(function(): void { - - console.log(`async.mapSeries: ${val}`); - - next(undefined as any, val.toString()); - - }, 500); - -}, function(err: Error, results: string[]): void { - - console.log("async.mapSeries: done with results", results); - -}); - -async.mapLimit({ - "a": 1, - "b": 2, - "c": 3, - "d": 4, - "e": 5, - "f": 6 -}, 2, function(val: number, next: AsyncResultCallback): void { - - setTimeout(function(): void { - - console.log(`async.mapLimit: ${val}`); - - next(undefined as any, val.toString()); - - }, 500); - -}, function(err: Error, results: string[]): void { - - console.log("async.mapLimit: done with results", results); - -}); - -// mapValues - -async.mapValues({ - "a": 1, - "b": 2, - "c": 3 -}, function(val: number, key: string, next: AsyncResultCallback): void { - - setTimeout(function(): void { - - console.log(`async.mapValues: ${key} = ${val}`); - - next(undefined as any, val.toString()); - - }, 500); - -}, function(err: Error, results: Dictionary): void { - - console.log("async.mapValues: done with results", results); - -}); - -async.mapValuesSeries({ - "a": 1, - "b": 2, - "c": 3 -}, function(val: number, key: string, next: AsyncResultCallback): void { - - setTimeout(function(): void { - - console.log(`async.mapValuesSeries: ${key} = ${val}`); - - next(undefined as any, val.toString()); - - }, 500); - -}, function(err: Error, results: Dictionary): void { - - console.log("async.mapValuesSeries: done with results", results); - -}); - -// filter/select/reject - -async.filter({ - "a": 1, - "b": 2, - "c": 3 -}, function(val: number, next: AsyncBooleanResultCallback): void { - - setTimeout(function(): void { - - console.log(`async.filter/select: ${val}`); - - next(undefined as any, val % 2 === 0); - - }, 500); - -}, function(err: Error, results: number[]): void { - - console.log("async.filter/select: done with results", results); - -}); - -async.reject({ - "a": 1, - "b": 2, - "c": 3 -}, function(val: number, next: AsyncBooleanResultCallback): void { - - setTimeout(function(): void { - - console.log(`async.reject: ${val}`); - - next(undefined as any, val % 2 === 0); - - }, 500); - -}, function(err: Error, results: number[]): void { - - console.log("async.reject: done with results", results); - -}); - -// concat - -async.concat({ - "a": "1", - "b": "2", - "c": "3" -}, function(item: string, next: AsyncResultCallback): void { - - console.log(`async.concat: ${item}`); - - next(undefined as any, [item, item, item]); - -}, function(err: Error, results: string[]) { - - console.log("async.concat: done with results", results); - -}); - -// detect/find - -async.detect({ - "a": 1, - "b": 2, - "c": 3 -}, function(item: number, next: AsyncBooleanResultCallback): void { - - console.log(`async.detect/find: ${item}`); - - next(undefined as any, item > 1); - -}, function(err: Error, result: number) { - - if (err) { - - console.log(err); - - } else { - - console.log("async.detect/find: done with result", result); - } - -}); - -// every/all - -async.every({ - "a": 1, - "b": 2, - "c": 3 -}, function(item: number, next: AsyncBooleanResultCallback): void { - - console.log(`async.every/all: ${item}`); - - next(undefined as any, item > 0); - -}, function(err: Error, result: boolean) { - - console.log("async.every/all: done with result", result); - -}); - -// some/any - -async.some({ - "a": 1, - "b": 2, - "c": 3 -}, function(item: number, next: AsyncBooleanResultCallback): void { - - console.log(`async.some/any: ${item}`); - - next(undefined as any, item > 2); - -}, function(err: Error, result: boolean) { - - console.log("async.some/any: done with result", result); - -}); - -// timeout - -function myFunction1(foo : any, callback: (err : Error, result : any) => void ) : void { - console.log(`async.timeout 1 ${foo}`); - return callback(null, foo); -} -var wrapped1 = async.timeout(myFunction1, 1000); -wrapped1({ bar: 'bar' }, function(err : Error, data : any) { - console.log(`async.timeout 1 end ${data}`); -}); - - -function myFunction2(callback: (err : Error, result : any) => void ) : void { - console.log(`async.timeout 2`); - return callback(null, { bar: 'bar' }); -} - -var wrapped2 = async.timeout(myFunction2, 1000); -wrapped2( function(err : Error, data : any) { - console.log(`async.timeout 2 end ${data}`); -}); - -function myFunction3(callback: (err : Error, result : any) => void ) : void { - console.log(`async.timeout 3`); - return callback(null, { bar: 'bar' }); -} - -var wrapped3 = async.timeout(myFunction3, 1000, { bar: 'bar' }); -wrapped3( function(err : Error, data : any) { - console.log(`async.timeout 3 end ${data}`); -}); - diff --git a/async/tsconfig.json b/async/tsconfig.json deleted file mode 100644 index 851293fccf..0000000000 --- a/async/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "test/index.ts", - "test/explicit.ts" - ] -} \ No newline at end of file diff --git a/atom/index.d.ts b/atom/index.d.ts deleted file mode 100644 index 7c984bd812..0000000000 --- a/atom/index.d.ts +++ /dev/null @@ -1,1922 +0,0 @@ -// Type definitions for Atom -// Project: https://atom.io/ -// Definitions by: vvakame -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// -/// -/// -/// -/// -/// -/// - -// Policy: this definition file only declare element related to `atom`. -// if js file include to another npm package (e.g. "space-pen", "mixto" and "emissary"). -// you should create a separate file. - -// API documentation : https://atom.io/docs/api/v0.106.0/api/docs/README.md.html - -interface Window { - atom: AtomCore.IAtom; - measure(description:string, fn:Function):any; // return fn result - profile(description:string, fn:Function):any; // return fn result -} - -declare namespace AtomCore { - - // https://atom.io/docs/v0.84.0/advanced/view-system - interface IWorkspaceViewStatic { - new ():IWorkspaceView; - version: number; - configDefaults:any; - content():any; - } - - interface Decoration { - destroy(): void; - } - - /** - * Represents a buffer annotation that remains logically stationary even as the buffer changes. This is used - * to represent cursors, folds, snippet targets, misspelled words, any anything else that needs to track a - * logical location in the buffer over time. - */ - interface Marker { - /** - * Destroys the marker, causing it to emit the 'destroyed' event. Once destroyed, a marker cannot be - * restored by undo/redo operations. - */ - destroy(): void; - - /** - * Gets the screen range of the display marker. - */ - getScreenRange(): Range; - } - - interface IWorkspaceView extends View { - // Delegator.includeInto(WorkspaceView); - - // delegate to model property's property - fullScreen:boolean; - - // delegate to model property's method - open(uri:string, options:any):Q.Promise; - openSync(uri:string, options?:any):any; - saveActivePaneItem():any; - saveActivePaneItemAs():any; - saveAll():void; - destroyActivePaneItem():any; - destroyActivePane():any; - increaseFontSize():void; - decreaseFontSize():void; - - // own property & methods - initialize(model:IWorkspace):any; - initialize(view:View, args:any):void; // do not use - model:IWorkspace; - panes: IPaneContainerView; - getModel():IWorkspace; - installShellCommands():any; - handleFocus():any; - afterAttach(onDom?:any):any; - confirmClose():boolean; - updateTitle():any; - setTitle(title:string):any; - getEditorViews():any[]; // atom.EditorView - prependToTop(element:any):any; - appendToTop(element:any):any; - prependToBottom(element:any):any; - appendToBottom(element:any):any; - prependToLeft(element:any):any; - appendToLeft(element:any):any; - prependToRight(element:any):any; - appendToRight(element:any):any; - getActivePaneView():IPaneView; - getActiveView():View; - focusPreviousPaneView():any; - focusNextPaneView():any; - focusPaneViewAbove():any; - focusPaneViewBelow():any; - focusPaneViewOnLeft():any; - focusPaneViewOnRight():any; - eachPaneView(callback:(paneView:IPaneView)=>any):{ off():any; }; - getPaneViews():IPaneView[]; - eachEditorView(callback:(editorView:any /* EditorView */)=>any):{ off():any; }; - beforeRemove():any; - - command(eventName:string, handler:Function):any; - command(eventName:string, selector:Function, handler:Function):any; - command(eventName:string, options:any, handler:Function):any; - command(eventName:string, selector:Function, options:any, handler:Function):any; - - statusBar:StatusBar.IStatusBarView; - } - - interface IPanes { - // TBD - } - - interface IPaneView { - // TBD - } - - interface IPaneContainerView { - // TBD - } - - interface ITreeView { - // TBD - } - - interface IGutterViewStatic { - new(): IGutterView; - content():any; - } - - interface IGutterView extends View { - firstScreenRow:any; - lastScreenRow:any; - initialize():void; - initialize(view:View, args:any):void; // do not use - afterAttach(onDom?:any):any; - beforeRemove():any; - handleMouseEvents(e:JQueryMouseEventObject):any; - getEditorView():any; /* EditorView */ - getEditor():IEditor; - getLineNumberElements():HTMLCollection; - getLineNumberElementsForClass(klass:string):NodeList; - getLineNumberElement(bufferRow:number):NodeList; - addClassToAllLines(klass:string):boolean; - removeClassFromAllLines(klass:string):boolean; - addClassToLine(bufferRow:number, klass:string):boolean; - removeClassFromLine(bufferRow:number, klass:string):boolean; - updateLineNumbers(changes:any[], startScreenRow?:number, endScreenRow?:number):any; - prependLineElements(lineElements:any):void; - appendLineElements(lineElements:any):void; - removeLineElements(numberOfElements:number):void; - buildLineElements(startScreenRow:any, endScreenRow:any):any; - buildLineElementsHtml(startScreenRow:any, endScreenRow:any):any; - updateFoldableClasses(changes:any[]):any; - removeLineHighlights():void; - addLineHighlight(row:number, emptySelection?:boolean):any; - highlightLines():boolean; - } - - interface ICommandRegistry { - add(target: string, commandName: Object, callback?: (event: any) => void): any; // selector:'atom-editor'|'atom-workspace' - findCommands(params: Object): Object[]; - dispatch(selector: any, name:string): void; - } - - interface ICommandPanel { - // TBD - } - - interface IDisplayBufferStatic { - new(_arg?:any):IDisplayBuffer; - } - - interface IDisplayBuffer /* extends Theorist.Model */ { - // Serializable.includeInto(Editor); - - constructor:IDisplayBufferStatic; - - verticalScrollMargin:number; - horizontalScrollMargin:number; - - declaredPropertyValues:any; - tokenizedBuffer: ITokenizedBuffer; - buffer: TextBuffer.ITextBuffer; - charWidthsByScope:any; - markers:{ [index:number]:IDisplayBufferMarker; }; - foldsByMarkerId:any; - maxLineLength:number; - screenLines:ITokenizedLine[]; - rowMap:any; // return type are RowMap - longestScreenRow:number; - subscriptions:Emissary.ISubscription[]; - subscriptionsByObject:any; // return type are WeakMap - behaviors:any; - subscriptionCounts:any; - eventHandlersByEventName:any; - pendingChangeEvent:any; - - softWrap:boolean; - - serializeParams():{id:number; softWrap:boolean; editorWidthInChars: number; scrollTop: number; scrollLeft: number; tokenizedBuffer: any; }; - deserializeParams(params:any):any; - copy():IDisplayBuffer; - updateAllScreenLines():any; - emitChanged(eventProperties:any, refreshMarkers?:boolean):any; - updateWrappedScreenLines():any; - setVisible(visible:any):any; - getVerticalScrollMargin():number; - setVerticalScrollMargin(verticalScrollMargin:number):number; - getHorizontalScrollMargin():number; - setHorizontalScrollMargin(horizontalScrollMargin:number):number; - getHeight():any; - setHeight(height:any):any; - getWidth():any; - setWidth(newWidth:any):any; - getScrollTop():number; - setScrollTop(scrollTop:number):number; - getScrollBottom():number; - setScrollBottom(scrollBottom:number):number; - getScrollLeft():number; - setScrollLeft(scrollLeft:number):number; - getScrollRight():number; - setScrollRight(scrollRight:number):number; - getLineHeight():any; - setLineHeight(lineHeight:any):any; - getDefaultCharWidth():any; - setDefaultCharWidth(defaultCharWidth:any):any; - getScopedCharWidth(scopeNames:any, char:any):any; - getScopedCharWidths(scopeNames:any):any; - setScopedCharWidth(scopeNames:any, char:any, width:any):any; - setScopedCharWidths(scopeNames:any, charWidths:any):any; - clearScopedCharWidths():any; - getScrollHeight():number; - getScrollWidth():number; - getVisibleRowRange():number[]; - intersectsVisibleRowRange(startRow:any, endRow:any):any; - selectionIntersectsVisibleRowRange(selection:any):any; - scrollToScreenRange(screenRange:any):any; - scrollToScreenPosition(screenPosition:any):any; - scrollToBufferPosition(bufferPosition:any):any; - pixelRectForScreenRange(screenRange:TextBuffer.IRange):any; - getTabLength():number; - setTabLength(tabLength:number):any; - setSoftWrap(softWrap:boolean):boolean; - getSoftWrap():boolean; - setEditorWidthInChars(editorWidthInChars:number):any; - getEditorWidthInChars():number; - getSoftWrapColumn():number; - lineForRow(row:number):any; - linesForRows(startRow:number, endRow:number):any; - getLines():any[]; - indentLevelForLine(line:any):any; - bufferRowsForScreenRows(startScreenRow:any, endScreenRow:any):any; - createFold(startRow:number, endRow:number):IFold; - isFoldedAtBufferRow(bufferRow:number):boolean; - isFoldedAtScreenRow(screenRow:number):boolean; - destroyFoldWithId(id:number):any; - unfoldBufferRow(bufferRow:number):any[]; - largestFoldStartingAtBufferRow(bufferRow:number):any; - foldsStartingAtBufferRow(bufferRow:number):any; - largestFoldStartingAtScreenRow(screenRow:any):any; - largestFoldContainingBufferRow(bufferRow:any):any; - outermostFoldsInBufferRowRange(startRow:any, endRow:any):any[]; - foldsContainingBufferRow(bufferRow:any):any[]; - screenRowForBufferRow(bufferRow:number):number; - lastScreenRowForBufferRow(bufferRow:number):number; - bufferRowForScreenRow(screenRow:number):number; - - screenRangeForBufferRange(bufferRange:TextBuffer.IPoint[]):TextBuffer.IRange; - - screenRangeForBufferRange(bufferRange:TextBuffer.IRange):TextBuffer.IRange; - - screenRangeForBufferRange(bufferRange:{start: TextBuffer.IPoint; end: TextBuffer.IPoint}):TextBuffer.IRange; - screenRangeForBufferRange(bufferRange:{start: number[]; end: TextBuffer.IPoint}):TextBuffer.IRange; - screenRangeForBufferRange(bufferRange:{start: {row:number; col:number;}; end: TextBuffer.IPoint}):TextBuffer.IRange; - - screenRangeForBufferRange(bufferRange:{start: TextBuffer.IPoint; end: number[]}):TextBuffer.IRange; - screenRangeForBufferRange(bufferRange:{start: number[]; end: number[]}):TextBuffer.IRange; - screenRangeForBufferRange(bufferRange:{start: {row:number; col:number;}; end: number[]}):TextBuffer.IRange; - - screenRangeForBufferRange(bufferRange:{start: TextBuffer.IPoint; end: {row:number; col:number;}}):TextBuffer.IRange; - screenRangeForBufferRange(bufferRange:{start: number[]; end: {row:number; col:number;}}):TextBuffer.IRange; - screenRangeForBufferRange(bufferRange:{start: {row:number; col:number;}; end: {row:number; col:number;}}):TextBuffer.IRange; - - bufferRangeForScreenRange(screenRange:TextBuffer.IPoint[]):TextBuffer.IRange; - - bufferRangeForScreenRange(screenRange:TextBuffer.IRange):TextBuffer.IRange; - - bufferRangeForScreenRange(screenRange:{start: TextBuffer.IPoint; end: TextBuffer.IPoint}):TextBuffer.IRange; - bufferRangeForScreenRange(screenRange:{start: number[]; end: TextBuffer.IPoint}):TextBuffer.IRange; - bufferRangeForScreenRange(screenRange:{start: {row:number; col:number;}; end: TextBuffer.IPoint}):TextBuffer.IRange; - - bufferRangeForScreenRange(screenRange:{start: TextBuffer.IPoint; end: number[]}):TextBuffer.IRange; - bufferRangeForScreenRange(screenRange:{start: number[]; end: number[]}):TextBuffer.IRange; - bufferRangeForScreenRange(screenRange:{start: {row:number; col:number;}; end: number[]}):TextBuffer.IRange; - - bufferRangeForScreenRange(screenRange:{start: TextBuffer.IPoint; end: {row:number; col:number;}}):TextBuffer.IRange; - bufferRangeForScreenRange(screenRange:{start: number[]; end: {row:number; col:number;}}):TextBuffer.IRange; - bufferRangeForScreenRange(screenRange:{start: {row:number; col:number;}; end: {row:number; col:number;}}):TextBuffer.IRange; - - pixelRangeForScreenRange(screenRange:TextBuffer.IPoint[], clip?:boolean):TextBuffer.IRange; - - pixelRangeForScreenRange(screenRange:TextBuffer.IRange, clip?:boolean):TextBuffer.IRange; - - pixelRangeForScreenRange(screenRange:{start: TextBuffer.IPoint; end: TextBuffer.IPoint}, clip?:boolean):TextBuffer.IRange; - pixelRangeForScreenRange(screenRange:{start: number[]; end: TextBuffer.IPoint}, clip?:boolean):TextBuffer.IRange; - pixelRangeForScreenRange(screenRange:{start: {row:number; col:number;}; end: TextBuffer.IPoint}, clip?:boolean):TextBuffer.IRange; - - pixelRangeForScreenRange(screenRange:{start: TextBuffer.IPoint; end: number[]}, clip?:boolean):TextBuffer.IRange; - pixelRangeForScreenRange(screenRange:{start: number[]; end: number[]}, clip?:boolean):TextBuffer.IRange; - pixelRangeForScreenRange(screenRange:{start: {row:number; col:number;}; end: number[]}, clip?:boolean):TextBuffer.IRange; - - pixelRangeForScreenRange(screenRange:{start: TextBuffer.IPoint; end: {row:number; col:number;}}, clip?:boolean):TextBuffer.IRange; - pixelRangeForScreenRange(screenRange:{start: number[]; end: {row:number; col:number;}}, clip?:boolean):TextBuffer.IRange; - pixelRangeForScreenRange(screenRange:{start: {row:number; col:number;}; end: {row:number; col:number;}}, clip?:boolean):TextBuffer.IRange; - - pixelPositionForScreenPosition(screenPosition:TextBuffer.IPoint, clip?:boolean):TextBuffer.IPoint; - pixelPositionForScreenPosition(screenPosition:number[], clip?:boolean):TextBuffer.IPoint; - pixelPositionForScreenPosition(screenPosition:{row:number; col:number;}, clip?:boolean):TextBuffer.IPoint; - - screenPositionForPixelPosition(pixelPosition:any):TextBuffer.IPoint; - - pixelPositionForBufferPosition(bufferPosition:any):any; - getLineCount():number; - getLastRow():number; - getMaxLineLength():number; - screenPositionForBufferPosition(bufferPosition:any, options:any):any; - bufferPositionForScreenPosition(bufferPosition:any, options:any):any; - scopesForBufferPosition(bufferPosition:any):any; - bufferRangeForScopeAtPosition(selector:any, position:any):any; - tokenForBufferPosition(bufferPosition:any):any; - getGrammar():IGrammar; - setGrammar(grammar:IGrammar):any; - reloadGrammar():any; - clipScreenPosition(screenPosition:any, options:any):any; - findWrapColumn(line:any, softWrapColumn:any):any; - rangeForAllLines():TextBuffer.IRange; - getMarker(id:number):IDisplayBufferMarker; - getMarkers():IDisplayBufferMarker[]; - getMarkerCount():number; - markScreenRange(range:TextBuffer.IRange, ...args:any[]):IDisplayBufferMarker; - markBufferRange(range:TextBuffer.IRange, options?:any):IDisplayBufferMarker; - markScreenPosition(screenPosition:TextBuffer.IPoint, options?:any):IDisplayBufferMarker; - markBufferPosition(bufferPosition:TextBuffer.IPoint, options?:any):IDisplayBufferMarker; - destroyMarker(id:number):any; - findMarker(params?:any):IDisplayBufferMarker; - findMarkers(params?:any):IDisplayBufferMarker[]; - translateToBufferMarkerParams(params?:any):any; - findFoldMarker(attributes:any):IMarker; - findFoldMarkers(attributes:any):IMarker[]; - getFoldMarkerAttributes(attributes?:any):any; - pauseMarkerObservers():any; - resumeMarkerObservers():any; - refreshMarkerScreenPositions():any; - destroy():any; - logLines(start:number, end:number):any[]; - handleTokenizedBufferChange(tokenizedBufferChange:any):any; - updateScreenLines(startBufferRow:any, endBufferRow:any, bufferDelta?:number, options?:any):any; - buildScreenLines(startBufferRow:any, endBufferRow:any):any; - findMaxLineLength(startScreenRow:any, endScreenRow:any, newScreenLines:any):any; - handleBufferMarkersUpdated():any; - handleBufferMarkerCreated(marker:any):any; - createFoldForMarker(maker:any):IFold; - foldForMarker(marker:any):any; - } - - interface IViewRegistry { - getView(selector:any):any; - } - - interface ICursorStatic { - new (arg:{editor:IEditor; marker:IDisplayBufferMarker; id: number;}):ICursor; - } - - interface ScopeDescriptor { - scopes: string[]; - } - - interface ICursor /* extends Theorist.Model */ { - getScopeDescriptor(): ScopeDescriptor; - screenPosition:any; - bufferPosition:any; - goalColumn:any; - visible:boolean; - needsAutoscroll:boolean; - - editor:IEditor; - marker:IDisplayBufferMarker; - id: number; - - destroy():any; - changePosition(options:any, fn:Function):any; - getPixelRect():any; - setScreenPosition(screenPosition:any, options?:any):any; - getScreenPosition():TextBuffer.IPoint; - getScreenRange():TextBuffer.IRange; - setBufferPosition(bufferPosition:any, options?:any):any; - getBufferPosition():TextBuffer.IPoint; - autoscroll():any; - updateVisibility():any; - setVisible(visible:boolean):any; - isVisible():boolean; - wordRegExp(arg?:any):any; - isLastCursor():boolean; - isSurroundedByWhitespace():boolean; - isBetweenWordAndNonWord():boolean; - isInsideWord():boolean; - clearAutoscroll():void; - clearSelection():void; - getScreenRow():number; - getScreenColumn():number; - getBufferRow():number; - getBufferColumn():number; - getCurrentBufferLine():string; - moveUp(rowCount:number, arg?:any):any; - moveDown(rowCount:number, arg?:any):any; - moveLeft(arg?:any):any; - moveRight(arg?:any):any; - moveToTop():any; - moveToBottom():void; - moveToBeginningOfScreenLine():void; - moveToBeginningOfLine():void; - moveToFirstCharacterOfLine():void; - moveToEndOfScreenLine():void; - moveToEndOfLine():void; - moveToBeginningOfWord():void; - moveToEndOfWord():void; - moveToBeginningOfNextWord():void; - moveToPreviousWordBoundary():void; - moveToNextWordBoundary():void; - getBeginningOfCurrentWordBufferPosition(options?:any):TextBuffer.IPoint; - getPreviousWordBoundaryBufferPosition(options?:any):TextBuffer.IPoint; - getMoveNextWordBoundaryBufferPosition(options?:any):TextBuffer.IPoint; - getEndOfCurrentWordBufferPosition(options?:any):TextBuffer.IPoint; - getBeginningOfNextWordBufferPosition(options?:any):TextBuffer.IPoint; - getCurrentWordBufferRange(options?:any):TextBuffer.IPoint; - getCurrentLineBufferRange(options?:any):TextBuffer.IPoint; - getCurrentParagraphBufferRange():any; - getCurrentWordPrefix():string; - isAtBeginningOfLine():boolean; - getIndentLevel():number; - isAtEndOfLine():boolean; - getScopes():string[]; - hasPrecedingCharactersOnLine():boolean; - getMarker(): Marker; - } - - interface ILanguageMode { - // TBD - } - - interface ISelection { - // https://atom.io/docs/api/v1.7.3/Selection - - // Event Subscription - onDidChangeRange(callback: (event: { - oldBufferRange: TextBuffer.IRange; - oldScreenRange: TextBuffer.IRange; - newBufferRange: TextBuffer.IRange; - newScreenRange: TextBuffer.IRange; - selection: ISelection; - }) => {}): Disposable; - onDidDestroy(callback: () => {}): Disposable; - - // Managing the selection range - getScreenRange(): TextBuffer.IRange; - setScreenRange(screenRange: TextBuffer.IRange, options?: { - preserveFolds?: boolean; - autoscroll?: boolean; - }): void; - getBufferRange(): TextBuffer.IRange; - setBufferRange(bufferRange: TextBuffer.IRange, options?: { - preserveFolds?: boolean; - autoscroll?: boolean; - }): void; - getBufferRowRange(): [number]; - - // Info about the selection - isEmpty(): boolean; - isReversed(): boolean; - isSingleScreenLine(): boolean; - getText(): string; - intersectsBufferRange(bufferRange: TextBuffer.IRange): boolean; - intersectsWith(otherSelection: ISelection): boolean; - - // Modifying the selected range - clear(options?: {autoscroll?: boolean}): void; - selectToScreenPosition(position: any): void; - selectToBufferPosition(position: any): void; - selectRight(columnCount?: number): void; - selectLeft(columnCount?: number): void; - selectUp(rowCount: number): void; - selectDown(rowCount: number): void; - selectToTop(): void; - selectToBottom(): void; - selectAll(): void; - selectToBeginningOfLine(): void; - selectToFirstCharacterOfLine(): void; - selectToEndOfLine(): void; - selectToEndOfBufferLine(): void; - selectToBeginningOfWord(): void; - selectToEndOfWord(): void; - selectToBeginningOfNextWord(): void; - selectToPreviousWordBoundary(): void; - selectToNextWordBoundary(): void; - selectToPreviousSubwordBoundary(): void; - selectToNextSubwordBoundary(): void; - selectToBeginningOfNextParagraph(): void; - selectToBeginningOfPreviousParagraph(): void; - selectWord(): TextBuffer.IRange; - expandOverWord(): void; - selectLine(row?: number): void; - expandOverLine(): void; - - // Modifying the selected text - insertText(text: string, options?: { - select: boolean; - autoIndent: boolean; - autoIndentNewline: boolean; - autoDecreaseIndent: boolean; - normalizeLineEndings?: boolean; - undo?: 'skip'; - }): void; - backspace(): void; - deleteToPreviousWordBoundary(): void; - deleteToNextWordBoundary(): void; - deleteToBeginningOfWord(): void; - deleteToBeginningOfLine(): void; - delete(): void; - deleteToEndOfLine(): void; - deleteToEndOfWord(): void; - deleteToBeginningOfSubword(): void; - deleteToEndOfSubword(): void; - deleteSelectedText(): void; - deleteLine(): void; - joinLines(): void; - outdentSelectedRows(): void; - autoIndentSelectedRows(): void; - toggleLineComments(): void; - cutToEndOfLine(): void; - cutToEndOfBufferLine(): void; - cut(maintainClipboard?: boolean, fullLine?: boolean): void; - copy(maintainClipboard?: boolean, fullLine?: boolean): void; - fold(): void; - indentSelectedRows(): void; - - // Managing multiple selections - addSelectionBelow(): void; - addSelectionAbove(): void; - merge(otherSelection: ISelection, options?: { - preserveFolds?: boolean; - autoscroll?: boolean; - }): void; - - // Comparing to other selections - compare(otherSelection: ISelection): any; - } - - interface IDecorationParams { - id?: number; - class: string; - type: any /* string or string[] */; - } - - interface IDecorationStatic { - isType(decorationParams:IDecorationParams, type:any /* string or string[] */):boolean; - new (marker:IDisplayBufferMarker, displayBuffer:IDisplayBuffer, params: IDecorationParams): IDecoration; - } - - interface IDecoration extends Emissary.IEmitter { - marker: IDisplayBufferMarker; - displayBuffer: IDisplayBuffer; - params: IDecorationParams - id: number; - flashQueue: any[]; - isDestroyed: boolean; - - destroy():void; - update(newParams:IDecorationParams):void; - getMarker():IDisplayBufferMarker; - getParams():IDecorationParams; - isType(type:string):boolean; - matchesPattern(decorationPattern:{[key:string]:IDecorationParams;}):boolean; - flash(klass:string, duration?:number):void; - consumeNextFlash():any; - } - - interface IEditor { - // Serializable.includeInto(Editor); - // Delegator.includeInto(Editor); - - deserializing:boolean; - callDisplayBufferCreatedHook:boolean; - registerEditor:boolean; - buffer:TextBuffer.ITextBuffer; - languageMode: ILanguageMode; - cursors:ICursor[]; - selections: ISelection[]; - suppressSelectionMerging:boolean; - updateBatchDepth: number; - selectionFlashDuration: number; - softTabs: boolean; - displayBuffer: IDisplayBuffer; - - id:number; - behaviors:any; - declaredPropertyValues: any; - eventHandlersByEventName: any; - eventHandlersByNamespace: any; - lastOpened: number; - subscriptionCounts: any; - subscriptionsByObject: any; /* WeakMap */ - subscriptions: Emissary.ISubscription[]; - destroy():void; - - mini: any; - - serializeParams():{id:number; softTabs:boolean; scrollTop:number; scrollLeft:number; displayBuffer:any;}; - deserializeParams(params:any):any; - subscribeToBuffer():void; - subscribeToDisplayBuffer():void; - getViewClass():any; // return type are EditorView - destroyed():void; - isDestroyed():boolean; - copy():IEditor; - getTitle():string; - getLongTitle():string; - setVisible(visible:boolean):void; - setMini(mini:any):void; - setScrollTop(scrollTop:any):void; - getScrollTop():number; - setScrollLeft(scrollLeft:any):void; - getScrollLeft():number; - setEditorWidthInChars(editorWidthInChars:any):void; - getSoftWrapColumn():number; - getSoftTabs():boolean; - setSoftTabs(softTabs:boolean):void; - getSoftWrap():boolean; - setSoftWrap(softWrap:any):void; - getTabText():string; - getTabLength():number; - setTabLength(tabLength:any):void; - usesSoftTabs():boolean; - clipBufferPosition(bufferPosition:any):void; - clipBufferRange(range:any):void; - indentationForBufferRow(bufferRow:any):void; - setIndentationForBufferRow(bufferRow:any, newLevel:any, _arg:any):void; - indentLevelForLine(line:any):number; - buildIndentString(number:any):string; - save():void; - saveAs(filePath:any):void; - copyPathToClipboard():void; - getPath():string; - getText():string; - setText(text:any):void; - getTextInRange(range:any):any; - getLineCount():number; - getBuffer():TextBuffer.ITextBuffer; - getURI():string; - isBufferRowBlank(bufferRow:any):boolean; - isBufferRowCommented(bufferRow:any):void; - nextNonBlankBufferRow(bufferRow:any):void; - getEofBufferPosition():TextBuffer.IPoint; - getLastBufferRow():number; - bufferRangeForBufferRow(row:any, options:any):TextBuffer.IRange; - lineForBufferRow(row:number):string; - lineLengthForBufferRow(row:number):number; - scan():any; - scanInBufferRange():any; - backwardsScanInBufferRange():any; - isModified():boolean; - isEmpty():boolean; - shouldPromptToSave():boolean; - screenPositionForBufferPosition(bufferPosition:any, options?:any):TextBuffer.IPoint; - bufferPositionForScreenPosition(screenPosition:any, options?:any):TextBuffer.IPoint; - screenRangeForBufferRange(bufferRange:any):TextBuffer.IRange; - bufferRangeForScreenRange(screenRange:any):TextBuffer.IRange; - clipScreenPosition(screenPosition:any, options:any):TextBuffer.IRange; - lineForScreenRow(row:any):ITokenizedLine; - linesForScreenRows(start?:any, end?:any):ITokenizedLine[]; - getScreenLineCount():number; - getMaxScreenLineLength():number; - getLastScreenRow():number; - bufferRowsForScreenRows(startRow:any, endRow:any):any[]; - bufferRowForScreenRow(row:any):number; - scopesForBufferPosition(bufferPosition:any):string[]; - bufferRangeForScopeAtCursor(selector:string):any; - tokenForBufferPosition(bufferPosition:any):IToken; - getCursorScopes():string[]; - logCursorScope():void; - insertText(text:string, options?:any):TextBuffer.IRange[]; - insertNewline():TextBuffer.IRange[]; - insertNewlineBelow():TextBuffer.IRange[]; - insertNewlineAbove():any; - indent(options?:any):any; - backspace():any[]; - // deprecated backspaceToBeginningOfWord():any[]; - // deprecated backspaceToBeginningOfLine():any[]; - deleteToBeginningOfWord():any[]; - deleteToBeginningOfLine():any[]; - delete():any[]; - deleteToEndOfLine():any[]; - deleteToEndOfWord():any[]; - deleteLine():TextBuffer.IRange[]; - indentSelectedRows():TextBuffer.IRange[][]; - outdentSelectedRows():TextBuffer.IRange[][]; - toggleLineCommentsInSelection():TextBuffer.IRange[]; - autoIndentSelectedRows():TextBuffer.IRange[][]; - normalizeTabsInBufferRange(bufferRange:any):any; - cutToEndOfLine():boolean[]; - cutSelectedText():boolean[]; - copySelectedText():boolean[]; - pasteText(options?:any):TextBuffer.IRange[]; - undo():any[]; - redo():any[]; - foldCurrentRow():any; - unfoldCurrentRow():any[]; - foldSelectedLines():any[]; - foldAll():any[]; - unfoldAll():any[]; - foldAllAtIndentLevel(level:any):any; - foldBufferRow(bufferRow:any):any; - unfoldBufferRow(bufferRow:any):any; - isFoldableAtBufferRow(bufferRow:any):boolean; - isFoldableAtScreenRow(screenRow:any):boolean; - createFold(startRow:any, endRow:any):IFold; - destroyFoldWithId(id:any):any; - destroyFoldsIntersectingBufferRange(bufferRange:any):any; - toggleFoldAtBufferRow(bufferRow:any):any; - isFoldedAtCursorRow():boolean; - isFoldedAtBufferRow(bufferRow:any):boolean; - isFoldedAtScreenRow(screenRow:any):boolean; - largestFoldContainingBufferRow(bufferRow:any):boolean; - largestFoldStartingAtScreenRow(screenRow:any):any; - outermostFoldsInBufferRowRange(startRow:any, endRow:any):any[]; - moveLineUp():ISelection[]; - moveLineDown():ISelection[]; - duplicateLines():any[][]; - // duprecated duplicateLine():any[][]; - mutateSelectedText(fn:(selection:ISelection)=>any):any; - replaceSelectedText(options:any, fn:(selection:string)=>any):any; - decorationsForScreenRowRange(startScreenRow:any, endScreenRow:any):{[id:number]: IDecoration[]}; - decorateMarker(marker:IDisplayBufferMarker, decorationParams: {type:string; class: string;}):IDecoration; - decorationForId(id:number):IDecoration; - getMarker(id:number):IDisplayBufferMarker; - getMarkers():IDisplayBufferMarker[]; - findMarkers(...args:any[]):IDisplayBufferMarker[]; - markScreenRange(...args:any[]):IDisplayBufferMarker; - markBufferRange(...args:any[]):IDisplayBufferMarker; - markScreenPosition(...args:any[]):IDisplayBufferMarker; - markBufferPosition(...args:any[]):IDisplayBufferMarker; - destroyMarker(...args:any[]):boolean; - getMarkerCount():number; - hasMultipleCursors():boolean; - getCursors():ICursor[]; - getCursor():ICursor; - addCursorAtScreenPosition(screenPosition:any):ICursor; - addCursorAtBufferPosition(bufferPosition:any):ICursor; - addCursor(marker:any):ICursor; - removeCursor(cursor:any):ICursor[]; - addSelection(marker:any, options:any):ISelection; - addSelectionForBufferRange(bufferRange:any, options:any):ISelection; - setSelectedBufferRange(bufferRange:any, options:any):any; - setSelectedBufferRanges(bufferRanges:any, options:any):any; - removeSelection(selection:ISelection):any; - clearSelections():boolean; - consolidateSelections():boolean; - selectionScreenRangeChanged(selection:any):void; - getSelections():ISelection[]; - getSelection(index?:number):ISelection; - getLastSelection():ISelection; - getSelectionsOrderedByBufferPosition():ISelection[]; - getLastSelectionInBuffer():ISelection; - selectionIntersectsBufferRange(bufferRange:any):any; - setCursorScreenPosition(position:TextBuffer.IPoint, options?:any):any; - getCursorScreenPosition():TextBuffer.IPoint; - getCursorScreenRow():number; - setCursorBufferPosition(position:any, options?:any):any; - getCursorBufferPosition():TextBuffer.IPoint; - getSelectedScreenRange():TextBuffer.IRange; - getSelectedBufferRange():TextBuffer.IRange; - getSelectedBufferRanges():TextBuffer.IRange[]; - getSelectedText():string; - getTextInBufferRange(range:TextBuffer.IRange):string; - setTextInBufferRange(range:TextBuffer.IRange | any[], text:string):any; - getCurrentParagraphBufferRange():TextBuffer.IRange; - getWordUnderCursor(options?:any):string; - moveCursorUp(lineCount?:number):void; - moveCursorDown(lineCount?:number):void; - moveCursorLeft():void; - moveCursorRight():void; - moveCursorToTop():void; - moveCursorToBottom():void; - moveCursorToBeginningOfScreenLine():void; - moveCursorToBeginningOfLine():void; - moveCursorToFirstCharacterOfLine():void; - moveCursorToEndOfScreenLine():void; - moveCursorToEndOfLine():void; - moveCursorToBeginningOfWord():void; - moveCursorToEndOfWord():void; - moveCursorToBeginningOfNextWord():void; - moveCursorToPreviousWordBoundary():void; - moveCursorToNextWordBoundary():void; - moveCursorToBeginningOfNextParagraph():void; - moveCursorToBeginningOfPreviousParagraph():void; - moveToBottom():void; - scrollToCursorPosition(options:any):any; - pageUp():void; - pageDown():void; - selectPageUp():void; - selectPageDown():void; - getRowsPerPage():number; - moveCursors(fn:(cursor:ICursor)=>any):any; - cursorMoved(event:any):void; - selectToScreenPosition(position:TextBuffer.IPoint):any; - selectRight():ISelection[]; - selectLeft():ISelection[]; - selectUp(rowCount?:number):ISelection[]; - selectDown(rowCount?:number):ISelection[]; - selectToTop():ISelection[]; - selectAll():ISelection[]; - selectToBottom():ISelection[]; - selectToBeginningOfLine():ISelection[]; - selectToFirstCharacterOfLine():ISelection[]; - selectToEndOfLine():ISelection[]; - selectToPreviousWordBoundary():ISelection[]; - selectToNextWordBoundary():ISelection[]; - selectLine():ISelection[]; - selectLinesContainingCursors():ISelection[]; - addSelectionBelow():ISelection[]; - addSelectionAbove():ISelection[]; - splitSelectionsIntoLines():any[]; - transpose():TextBuffer.IRange[]; - upperCase():boolean[]; - lowerCase():boolean[]; - joinLines():any[]; - selectToBeginningOfWord():ISelection[]; - selectToEndOfWord():ISelection[]; - selectToBeginningOfNextWord():ISelection[]; - selectWord():ISelection[]; - selectToBeginningOfNextParagraph():ISelection[]; - selectToBeginningOfPreviousParagraph():ISelection[]; - selectMarker(marker:any):any; - mergeCursors():number[]; - expandSelectionsForward():any; - expandSelectionsBackward(fn:(selection:ISelection)=>any):ISelection[]; - finalizeSelections():boolean[]; - mergeIntersectingSelections():any; - preserveCursorPositionOnBufferReload():Emissary.ISubscription; - getGrammar(): IGrammar; - setGrammar(grammer:IGrammar):void; - reloadGrammar():any; - shouldAutoIndent():boolean; - shouldShowInvisibles():boolean; - updateInvisibles():void; - transact(fn:Function):any; - beginTransaction():ITransaction; - commitTransaction():any; - abortTransaction():any[]; - inspect():string; - logScreenLines(start:number, end:number):any[]; - handleTokenization():void; - handleGrammarChange():void; - handleMarkerCreated(marker:any):any; - getSelectionMarkerAttributes():{type: string; editorId: number; invalidate: string; }; - getVerticalScrollMargin():number; - setVerticalScrollMargin(verticalScrollMargin:number):void; - getHorizontalScrollMargin():number; - setHorizontalScrollMargin(horizontalScrollMargin:number):void; - getLineHeightInPixels():number; - setLineHeightInPixels(lineHeightInPixels:number):void; - batchCharacterMeasurement(fn:Function):void; - getScopedCharWidth(scopeNames:any, char:any):any; - setScopedCharWidth(scopeNames:any, char:any, width:any):any; - getScopedCharWidths(scopeNames:any):any; - clearScopedCharWidths():any; - getDefaultCharWidth():number; - setDefaultCharWidth(defaultCharWidth:number):void; - setHeight(height:number):void; - getHeight():number; - getClientHeight():number; - setWidth(width:number):void; - getWidth():number; - getScrollTop():number; - setScrollTop(scrollTop:number):void; - getScrollBottom():number; - setScrollBottom(scrollBottom:number):void; - getScrollLeft():number; - setScrollLeft(scrollLeft:number):void; - getScrollRight():number; - setScrollRight(scrollRight:number):void; - getScrollHeight():number; - getScrollWidth():number; - getVisibleRowRange():number; - intersectsVisibleRowRange(startRow:any, endRow:any):any; - selectionIntersectsVisibleRowRange(selection:any):any; - pixelPositionForScreenPosition(screenPosition:any):any; - pixelPositionForBufferPosition(bufferPosition:any):any; - screenPositionForPixelPosition(pixelPosition:any):any; - pixelRectForScreenRange(screenRange:any):any; - scrollToScreenRange(screenRange:any, options:any):any; - scrollToScreenPosition(screenPosition:any, options:any):any; - scrollToBufferPosition(bufferPosition:any, options:any):any; - horizontallyScrollable():any; - verticallyScrollable():any; - getHorizontalScrollbarHeight():any; - setHorizontalScrollbarHeight(height:any):any; - getVerticalScrollbarWidth():any; - setVerticalScrollbarWidth(width:any):any; - // deprecated joinLine():any; - - onDidChange(callback: Function): Disposable; - onDidDestroy(callback: Function): Disposable; - onDidStopChanging(callback: Function): Disposable; - onDidChangeCursorPosition(callback: Function): Disposable; - onDidSave(callback: (event: { path: string }) => void): Disposable; - - decorateMarker(marker: Marker, options: any): Decoration; - getLastCursor(): ICursor; - } - - interface IGrammar { - bundledPackage: boolean; - emitter: any; - fileTypes: [string]; - firstLineRegex: any; - foldingStopMarker: any; - includedGrammarScopes: [any]; - initialRule: any; - injectionSelector: any; - injections: any; - maxTokensPerLine: Number; - name: string; - packageName: string; - path: string; - rawPatterns: [any]; - rawRepository: any; - registration: Disposable; - registry: any; - repository: Object; - scopeName: string; - tokenizeLines: (text: string) => any; - // TBD - - } - - interface IGrammars { - grammarForScopeName(scope: string): IGrammar; - } - - interface IPane /* extends Theorist.Model */ { - itemForURI: (uri:string)=>IEditor; - items:any[]; - activeItem:any; - - serializeParams():any; - deserializeParams(params:any):any; - getViewClass():any; // return type are PaneView - isActive():boolean; - isDestroyed():boolean; - focus():void; - blur():void; - activate():void; - getPanes():IPane[]; - getItems():any[]; - getActiveItem():any; - getActiveEditor():any; - itemAtIndex(index:number):any; - activateNextItem():any; - activatePreviousItem():any; - getActiveItemIndex():number; - activateItemAtIndex(index:number):any; - activateItem(item:any):any; - addItem(item:any, index:number):any; - addItems(items:any[], index:number):any[]; - removeItem(item:any, destroying:any):void; - moveItem(item:any, newIndex:number):void; - moveItemToPane(item:any, pane:IPane, index:number):void; - destroyActiveItem():boolean; // always return false - destroyItem(item:any):boolean; - destroyItems():any[]; - destroyInactiveItems():any[]; - destroy():void; - destroyed():any[]; - promptToSaveItem(item:any):boolean; - saveActiveItem():void; - saveActiveItemAs():void; - saveItem(item:any, nextAction:Function):void; - saveItemAs(item:any, nextAction:Function):void; - saveItems():any[]; - activateItemForURI(uri:any):any; - copyActiveItem():void; - splitLeft(params:any):IPane; - splitRight(params:any):IPane; - splitUp(params:any):IPane; - splitDown(params:any):IPane; - split(orientation:string, side:string, params:any):IPane; - findLeftmostSibling():IPane; - findOrCreateRightmostSibling():IPane; - } - - // https://atom.io/docs/v0.84.0/advanced/serialization - interface ISerializationStatic { - deserialize(data:ISerializationInfo):T; - new (data:T): ISerialization; - } - - interface ISerialization { - serialize():ISerializationInfo; - } - - interface ISerializationInfo { - deserializer: string; - } - - interface IBrowserWindow { - getPosition():number[]; - getSize():number[]; - } - - interface IAtomWindowDimentions { - x:number; - y:number; - width:number; - height:number; - } - - interface IProjectStatic { - pathForRepositoryUrl(repoUrl:string):string; - - new (arg?:{path:any; buffers:any[];}):IProject; - } - - interface IProject /* extends Theorist.Model */ { - // Serializable.includeInto(Project); - - path:string; - /** deprecated */ - rootDirectory?:PathWatcher.IDirectory; - rootDirectories:PathWatcher.IDirectory[]; - - serializeParams():any; - deserializeParams(params:any):any; - destroyed():any; - destroyRepo():any; - destroyUnretainedBuffers():any; - getRepo():IGit; - getPath():string; - setPath(projectPath:string):any; - getRootDirectory():PathWatcher.IDirectory; - resolve(uri:string):string; - relativize(fullPath:string):string; - contains(pathToCheck:string):boolean; - open(filePath:string, options?:any):Q.Promise; - openSync(filePath:string, options?:any):IEditor; - getBuffers():TextBuffer.ITextBuffer; - isPathModified(filePath:string):boolean; - findBufferForPath(filePath:string):TextBuffer.ITextBuffer; - bufferForPathSync(filePath:string):TextBuffer.ITextBuffer; - bufferForPath(filePath:string):Q.Promise; - bufferForId(id:any):TextBuffer.ITextBuffer; - buildBufferSync(absoluteFilePath:string):TextBuffer.ITextBuffer; - buildBuffer(absoluteFilePath:string):Q.Promise; - addBuffer(buffer:TextBuffer.ITextBuffer, options?:any):any; - addBufferAtIndex(buffer:TextBuffer.ITextBuffer, index:number, options?:any):any; - scan(regex:any, options:any, iterator:any):Q.Promise; - replace(regex:any, replacementText:any, filePaths:any, iterator:any):Q.Promise; - buildEditorForBuffer(buffer:any, editorOptions:any):IEditor; - eachBuffer(...args:any[]):any; - - onDidChangePaths(callback: Function): Disposable; - } - - interface IWorkspaceStatic { - new():IWorkspace; - } - - interface IWorkspacePanelOptions{ - item:any; - visible?:boolean; - priority?:number; - } - - interface Panel{ - getItem():any; - getPriority():any; - isVisible():boolean; - show():void; - hide():void; - } - - interface IWorkspace { - addBottomPanel(options:IWorkspacePanelOptions):Panel; - addLeftPanel(options:IWorkspacePanelOptions):Panel; - addRightPanel(options:IWorkspacePanelOptions):Panel; - addTopPanel(options:IWorkspacePanelOptions):Panel; - addModalPanel(options:IWorkspacePanelOptions):Panel; - addOpener(opener: Function): any; - - deserializeParams(params:any):any; - serializeParams():{paneContainer:any;fullScreen:boolean;}; - eachEditor(callback: Function): void; - getTextEditors():IEditor[]; - open(uri:string, options:any):Q.Promise; - openLicense():void; - openSync(uri:string, options:any):any; - openUriInPane(uri: string, pane: any, options: any): Q.Promise; - observeTextEditors(callback: Function): Disposable; - reopenItemSync():any; - registerOpener(opener:(urlToOpen:string)=>any):void; - unregisterOpener(opener:Function):void; - getOpeners():any; - getActivePane(): IPane; - getActivePaneItem(): IPane; - getActiveTextEditor(): IEditor; - getPanes():any; - saveAll():void; - activateNextPane():any; - activatePreviousPane():any; - paneForURI: (uri:string) => IPane; - saveActivePaneItem():any; - saveActivePaneItemAs():any; - destroyActivePaneItem():any; - destroyActivePane():any; - getActiveEditor():IEditor; - increaseFontSize():void; - decreaseFontSize():void; - resetFontSize():void; - itemOpened(item:any):void; - onPaneItemDestroyed(item:any):void; - destroyed():void; - isTextEditor(object: any): boolean; - - onDidChangeActivePaneItem(item:any):Disposable; - } - - interface IAtomSettings { - appVersion: string; - bootstrapScript: string; - devMode: boolean; - initialPath: string; - pathToOpen: string; - resourcePath: string; - shellLoadTime: number; - windowState:string; - } - - interface IAtomState { - mode:string; - packageStates:any; - project:any; - syntax:any; - version:number; - windowDimensions:any; - workspace:any; - } - - interface IDeserializerManager { - deserializers:Function; - add:Function; - remove:Function; - deserialize:Function; - get:Function; - } - - interface IConfig { - get(keyPath:string):any; - // TBD - } - - interface IKeymapManager { - defaultTarget:HTMLElement; - // TBD - } - - interface IPackage { - mainModulePath: string; - mainModule: any; - enable(): void; - disable(): void; - isTheme(): boolean; - getType(): string; - getStylesheetType(): string; - load(): IPackage; - reset(): void; - activate(): Q.Promise; - activateNow(): void; - // TBD - } - - interface IPackageManager extends Emissary.IEmitter { - packageDirPaths:string[]; - loadedPackages:any; - activePackages:any; - packageStates:any; - packageActivators:any[]; - - getApmPath():string; - getPackageDirPaths():string; - getPackageState(name:string):any; - setPackageState(name:string, state:any):void; - enablePackage(name:string):any; - disablePackage(name:string):any; - activate():void; - registerPackageActivator(activator:any, types:any):void; - activatePackages(packages:any):void; - activatePackage(name:string):Q.Promise; - deactivatePackages():void; - deactivatePackage(name:string):void; - getActivePackages():any; - getActivePackage(name:string):any; - isPackageActive(name:string):boolean; - unobserveDisabledPackages():void; - observeDisabledPackages():void; - loadPackages():void; - loadPackage(nameOrPath:string):void; - unloadPackages():void; - unloadPackage(name:string):void; - getLoadedPackage(name:string):any; - isPackageLoaded(name:string):boolean; - getLoadedPackages():any; - getLoadedPackagesForTypes(types:any):any[]; - resolvePackagePath(name:string):string; - isPackageDisabled(name:string):boolean; - hasAtomEngine(packagePath:string):boolean; - isBundledPackage(name:string):boolean; - getPackageDependencies():any; - getAvailablePackagePaths():any[]; - getAvailablePackageNames():any[]; - getAvailablePackageMetadata():any[]; - } - - interface INotifications { - addInfo: Function; - addError: Function; - addSuccess: Function; - addWarning: Function; - } - - interface IThemeManager { - // TBD - } - - interface IContextMenuManager { - // TBD - } - - interface IMenuManager { - // TBD - } - - interface IClipboard { - write(text:string, metadata?:any):any; - read():string; - } - - interface ISyntax { - // TBD - } - - interface IWindowEventHandler { - // TBD - } - - interface IAtomStatic extends ISerializationStatic { - version: number; - loadSettings: IAtomSettings; - - /* Load or create the Atom environment in the given mode */ - loadOrCreate(mode:'editor'):IAtom; - /* Load or create the Atom environment in the given mode */ - loadOrCreate(mode:'spec'):IAtom; - /* Load or create the Atom environment in the given mode */ - loadOrCreate(mode:string):IAtom; - - loadState(mode:any):void; - getStatePath(mode:any):string; - getConfigDirPath():string; - getStorageDirPath():string; - getLoadSettings():IAtomSettings; - getCurrentWindow():IBrowserWindow; - getVersion():string; - isReleasedVersion():boolean; - - new(state:IAtomState):IAtom; - } - - class Disposable { - constructor(disposalAction:any) - dispose():void - } - - // https://atom.io/docs/api/v0.106.0/api/classes/Atom.html - /* Global Atom class : instance members */ - interface IAtom { - constructor:IAtomStatic; - - state:IAtomState; - mode:string; - deserializers:IDeserializerManager; - config: IConfig; - commands: ICommandRegistry; - grammars: IGrammars; - keymaps: IKeymapManager; - keymap: IKeymapManager; - packages: IPackageManager; - themes: IThemeManager; - contextManu: IContextMenuManager; - menu: IMenuManager; - notifications: INotifications; // https://github.com/atom/notifications - clipboard:IClipboard; - syntax:ISyntax; - views: IViewRegistry; - windowEventHandler: IWindowEventHandler; - - // really exists? start - subscribe:Function; - unsubscribe:Function; - loadTime:number; - workspaceViewParentSelector:string; - - project: IProject; - workspaceView: IWorkspaceView; - workspace: IWorkspace; - // really exists? end - - initialize:Function; - // registerRepresentationClass:Function; - // registerRepresentationClasses:Function; - setBodyPlatformClass:Function; - getCurrentWindow():IBrowserWindow; - getWindowDimensions:Function; - setWindowDimensions:Function; - restoreWindowDimensions:Function; - storeWindowDimensions:Function; - getLoadSettings:Function; - deserializeProject: Function; - deserializeWorkspaceView:Function; - deserializePackageStates:Function; - deserializeEditorWindow:Function; - startEditorWindow:Function; - unloadEditorWindow:Function; - loadThemes:Function; - watchThemes:Function; - open:Function; - confirm:Function; - showSaveDialog:Function; - showSaveDialogSync:Function; - openDevTools:Function; - toggleDevTools:Function; - executeJavaScriptInDevTools:Function; - reload:Function; - focus:Function; - show:Function; - hide:Function; - setSize:Function; - setPosition:Function; - center:Function; - displayWindow:Function; - close:Function; - exit:Function; - inDevMode:Function; - inSpecMode:Function; - toggleFullScreen:Function; - setFullScreen:Function; - isFullScreen:Function; - getVersion:Function; - isReleasedVersion:Function; - getGitHubAuthTokenName:Function; - setGitHubAuthToken:Function; - getGitHubAuthToken:Function; - getConfigDirPath:Function; - saveSync:Function; - getWindowLoadTime():number; - crashMainProcess:Function; - crashRenderProcess:Function; - beep:Function; - getUserInitScriptPath:Function; - requireUserInitScript:Function; - requireWithGlobals:Function; - - services: any; // TODO: New services api - } - - interface IBufferedNodeProcessStatic { - new (arg:any):IBufferedNodeProcess; - } - - interface IBufferedNodeProcess extends IBufferedProcess { - } - - interface IBufferedProcessStatic { - new (arg:any):IBufferedProcess; - } - - interface IBufferedProcess { - process:Function; - killed:boolean; - - bufferStream:Function; - kill:Function; - } - - interface IGitStatic { - new(path:any, options:any):IGit; - } - - interface IGit { - } - - interface ITokenizedBuffer { - // TBD - } - - interface ITokenizedLine { - // TBD - } - - interface IToken { - // TBD - } - - interface IFoldStatic { - new (displayBuffer:IDisplayBuffer, marker:IMarker):IFold; - // TBD - } - - interface IFold { - id:number; - displayBuffer:IDisplayBuffer; - marker:IMarker; - - // TBD - } - - interface IDisplayBufferMarkerStatic { - new (_arg:{bufferMarker:IMarker; displayBuffer: IDisplayBuffer}):IDisplayBufferMarker; - } - - interface IDisplayBufferMarker extends Emissary.IEmitter, Emissary.ISubscriber { - constructor:IDisplayBufferMarkerStatic; - - id: number; - - bufferMarkerSubscription:any; - oldHeadBufferPosition:TextBuffer.IPoint; - oldHeadScreenPosition:TextBuffer.IPoint; - oldTailBufferPosition:TextBuffer.IPoint; - oldTailScreenPosition:TextBuffer.IPoint; - wasValid:boolean; - - bufferMarker: IMarker; - displayBuffer: IDisplayBuffer; - globalPauseCount:number; - globalQueuedEvents:any; - - subscriptions:Emissary.ISubscription[]; - subscriptionsByObject:any; // WeakMap - - copy(attributes?:any /* maybe IMarker */):IDisplayBufferMarker; - getScreenRange():TextBuffer.IRange; - setScreenRange(screenRange:any, options:any):any; - getBufferRange():TextBuffer.IRange; - setBufferRange(bufferRange:any, options:any):any; - getPixelRange():any; - getHeadScreenPosition():TextBuffer.IPoint; - setHeadScreenPosition(screenPosition:any, options:any):any; - getHeadBufferPosition():TextBuffer.IPoint; - setHeadBufferPosition(bufferPosition:any):any; - getTailScreenPosition():TextBuffer.IPoint; - setTailScreenPosition(screenPosition:any, options:any):any; - getTailBufferPosition():TextBuffer.IPoint; - setTailBufferPosition(bufferPosition:any):any; - plantTail():boolean; - clearTail():boolean; - hasTail():boolean; - isReversed():boolean; - isValid():boolean; - isDestroyed():boolean; - getAttributes():any; - setAttributes(attributes:any):any; - matchesAttributes(attributes:any):any; - destroy():any; - isEqual(other:IDisplayBufferMarker):boolean; - compare(other:IDisplayBufferMarker):boolean; - inspect():string; - destroyed():any; - notifyObservers(_arg:any):any; - } - - interface ITransaction { - // TBD - } - - interface IMarker extends Emissary.IEmitter { - // Serializable.includeInto(Editor); - // Delegator.includeInto(Editor); - - // TBD - } - - interface ITaskStatic { - new(taskPath:any):ITask; - } - - interface ITask { - // TBD - } -} - -declare var atom:AtomCore.IAtom; - -declare module "atom" { - import spacePen = require("space-pen"); - - var $:typeof spacePen.$; - var $$:typeof spacePen.$$; - var $$$:typeof spacePen.$$$; - - var BufferedNodeProcess:AtomCore.IBufferedNodeProcessStatic; - var BufferedProcess:AtomCore.IBufferedProcessStatic; - var Git:AtomCore.IGitStatic; - var Point:TextBuffer.IPointStatic; - var Range:TextBuffer.IRangeStatic; - - class View extends spacePen.View implements Emissary.ISubscriber { - // Subscriber.includeInto(spacePen.View); - - // inherit from Subscriber - subscribeWith(eventEmitter:any, methodName:string, args:any):any; - - addSubscription(subscription:any):any; - - subscribe(eventEmitterOrSubscription:any, ...args:any[]):any; - - subscribeToCommand(eventEmitter:any, ...args:any[]):any; - - unsubscribe(object?:any):any; - } - - class EditorView extends View { - static characterWidthCache:any; - static configDefaults:any; - static nextEditorId:number; - - static content(params:any):void; - - static classes(_arg?:{mini?:any}):string; - - vScrollMargin:number; - hScrollMargin:number; - lineHeight:any; - charWidth:any; - charHeight:any; - cursorViews:any[]; - selectionViews:any[]; - lineCache:any[]; - isFocused:any; - editor:AtomCore.IEditor; - attached:any; - lineOverdraw:number; - pendingChanges:any[]; - newCursors:any[]; - newSelections:any[]; - redrawOnReattach:any; - bottomPaddingInLines:number; - active:boolean; - - id:number; - - gutter:AtomCore.IGutterView; - overlayer:JQuery; - scrollView:JQuery; - renderedLines:JQuery; - underlayer:JQuery; - hiddenInput:JQuery; - verticalScrollbar:JQuery; - verticalScrollbarContent:JQuery; - - constructor(editor:AtomCore.IEditor); - - initialize(editorOrOptions:AtomCore.IEditor):void; // return type are same as editor method. - initialize(editorOrOptions?:{editor: AtomCore.IEditor; mini:any; placeholderText:any}):void; - - initialize(editorOrOptions:{}):void; // compatible for spacePen.View - - bindKeys():void; - - getEditor():AtomCore.IEditor; - - getText():string; - - setText(text:string):void; - - insertText(text:string, options?:any):TextBuffer.IRange[]; - - setHeightInLines(heightInLines:number):number; - - setWidthInChars(widthInChars:number):number; - - pageDown():void; - - pageUp():void; - - getPageRows():number; - - setShowInvisibles(showInvisibles:boolean):void; - - setInvisibles(invisibles:{ eol:string; space: string; tab: string; cr: string; }):void; - - setShowIndentGuide(showIndentGuide:boolean):void; - - setPlaceholderText(placeholderText:string):void; - - getPlaceholderText():string; - - checkoutHead():boolean; - - configure():Emissary.ISubscription; - - handleEvents():void; - - handleInputEvents():void; - - bringHiddenInputIntoView():JQuery; - - selectOnMousemoveUntilMouseup():any; - - afterAttach(onDom:any):any; - - edit(editor:AtomCore.IEditor):any; - - getModel():AtomCore.IEditor; - - setModel(editor:AtomCore.IEditor):any; - - showBufferConflictAlert(editor:AtomCore.IEditor):any; - - scrollTop(scrollTop:number, options?:any):any; - - scrollBottom(scrollBottom?:number):any; - - scrollLeft(scrollLeft?:number):number; - - scrollRight(scrollRight?:number):any; - - scrollToBottom():any; - - scrollToCursorPosition():any; - - scrollToBufferPosition(bufferPosition:any, options:any):any; - - scrollToScreenPosition(screenPosition:any, options:any):any; - - scrollToPixelPosition(pixelPosition:any, options:any):any; - - highlightFoldsContainingBufferRange(bufferRange:any):any; - - saveScrollPositionForEditor():any; - - toggleSoftTabs():any; - - toggleSoftWrap():any; - - calculateWidthInChars():number; - - calculateHeightInLines():number; - - getScrollbarWidth():number; - - setSoftWrap(softWrap:boolean):any; - - setFontSize(fontSize:number):any; - - getFontSize():number; - - setFontFamily(fontFamily?:string):any; - - getFontFamily():string; - - setLineHeight(lineHeight:number):any; - - redraw():any; - - splitLeft():any; - - splitRight():any; - - splitUp():any; - - splitDown():any; - - getPane():any; // return type are PaneView - - remove(selector:any, keepData:any):any; - - beforeRemove():any; - - getCursorView(index?:number):any; // return type are CursorView - - getCursorViews():any[]; // return type are CursorView[] - - addCursorView(cursor:any, options:any):any; // return type are CursorView - - removeCursorView(cursorView:any):any; - - getSelectionView(index?:number):any; // return type are SelectionView - - getSelectionViews():any[]; // return type are SelectionView[] - - addSelectionView(selection:any):any; - - removeSelectionView(selectionView:any):any; - - removeAllCursorAndSelectionViews():any[]; - - appendToLinesView(view:any):any; - - scrollVertically(pixelPosition:any, _arg:any):any; - - scrollHorizontally(pixelPosition:any):any; - - calculateDimensions():number; - - recalculateDimensions():any; - - updateLayerDimensions():any; - - isHidden():boolean; - - clearRenderedLines():void; - - resetDisplay():any; - - requestDisplayUpdate():any; - - updateDisplay(options?:any):any; - - updateCursorViews():any; - - shouldUpdateCursor(cursorView:any):any; - - updateSelectionViews():any[]; - - shouldUpdateSelection(selectionView:any):any; - - syncCursorAnimations():any[]; - - autoscroll(suppressAutoscroll?:any):any[]; - - updatePlaceholderText():any; - - updateRenderedLines(scrollViewWidth:any):any; - - computeSurroundingEmptyLineChanges(change:any):any; - - computeIntactRanges(renderFrom:any, renderTo:any):any; - - truncateIntactRanges(intactRanges:any, renderFrom:any, renderTo:any):any; - - clearDirtyRanges(intactRanges:any):any; - - clearLine(lineElement:any):any; - - fillDirtyRanges(intactRanges:any, renderFrom:any, renderTo:any):any; - - updatePaddingOfRenderedLines():any; - - getFirstVisibleScreenRow():number; - - getLastVisibleScreenRow():number; - - isScreenRowVisible():boolean; - - handleScreenLinesChange(change:any):any; - - buildLineElementForScreenRow(screenRow:any):any; - - buildLineElementsForScreenRows(startRow:any, endRow:any):any; - - htmlForScreenRows(startRow:any, endRow:any):any; - - htmlForScreenLine(screenLine:any, screenRow:any):any; - - buildIndentation(screenRow:any, editor:any):any; - - buildHtmlEndOfLineInvisibles(screenLine:any):any; - - getEndOfLineInvisibles(screenLine:any):any; - - lineElementForScreenRow(screenRow:any):any; - - toggleLineCommentsInSelection():any; - - pixelPositionForBufferPosition(position:any):any; - - pixelPositionForScreenPosition(position:any):any; - - positionLeftForLineAndColumn(lineElement:any, screenRow:any, screenColumn:any):any; - - measureToColumn(lineElement:any, tokenizedLine:any, screenColumn:any):any; - - getCharacterWidthCache(scopes:any, char:any):any; - - setCharacterWidthCache(scopes:any, char:any, val:any):any; - - clearCharacterWidthCache():any; - - pixelOffsetForScreenPosition(position:any):any; - - screenPositionFromMouseEvent(e:any):any; - - highlightCursorLine():any; - - copyPathToClipboard():any; - - buildLineHtml(_arg:any):any; - - updateScopeStack(line:any, scopeStack:any, desiredScopes:any):any; - - pushScope(line:any, scopeStack:any, scope:any):any; - - popScope(line:any, scopeStack:any):any; - - buildEmptyLineHtml(showIndentGuide:any, eolInvisibles:any, htmlEolInvisibles:any, indentation:any, editor:any, mini:any):any; - - replaceSelectedText(replaceFn:(str:string)=>string):any; - - consolidateSelections(e:any):any; - - logCursorScope():any; - - logScreenLines(start:any, end:any):any; - - logRenderedLines():any; - } - - class ScrollView extends View { - // TBD - } - - interface ISelectListItem { - /** e.g. application:about */ - eventName:string; - /** e.g. Application: About */ - eventDescription:string; - } - - class SelectListView extends View { - static content():any; - - maxItems:number; - scheduleTimeout:any; - inputThrottle:number; - cancelling:boolean; - items:any[]; - list:JQuery; - filterEditorView: JQuery; - - previouslyFocusedElement:JQuery; - - initialize():any; - - schedulePopulateList():number; - - setItems(items:any[]):any; - - setError(message?:string):any; - - setLoading(message?:string):any; - - getFilterQuery():string; - - populateList():any; - - getEmptyMessage(itemCount?:any, filteredItemCount?:any):string; - - setMaxItems(maxItems:number):void; - - selectPreviousItemView():any; - - selectNextItemView():any; - - selectItemView(view:any):any; - - scrollToItemView(view:any):any; - - getSelectedItemView():any; - - getSelectedItem():any; - - confirmSelection():any; - - viewForItem(item:any):JQuery|string|HTMLElement|View; // You must override this method! - confirmed(item:any):any; // You must override this method! - getFilterKey():any; - - focusFilterEditor():any; - - storeFocusedElement():any; - - restoreFocus():any; - - cancelled():any; - - cancel():any; - } - - - - var WorkspaceView:AtomCore.IWorkspaceViewStatic; - - var Task:AtomCore.ITaskStatic; - var Workspace:AtomCore.IWorkspaceStatic; -} diff --git a/atom/tsconfig.json b/atom/tsconfig.json deleted file mode 100644 index 3bb8fe9761..0000000000 --- a/atom/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "api-docs.d.ts", - "atom-tests.ts" - ] -} \ No newline at end of file diff --git a/auth0-lock/package.json b/auth0-lock/package.json deleted file mode 100644 index 2d730992af..0000000000 --- a/auth0-lock/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "dependencies": { - "@types/auth0-js": "latest" - } -} diff --git a/auth0.widget/package.json b/auth0.widget/package.json deleted file mode 100644 index 2d730992af..0000000000 --- a/auth0.widget/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "dependencies": { - "@types/auth0-js": "latest" - } -} diff --git a/autobahn/index.d.ts b/autobahn/index.d.ts deleted file mode 100644 index e93d3c065f..0000000000 --- a/autobahn/index.d.ts +++ /dev/null @@ -1,267 +0,0 @@ -// Type definitions for AutobahnJS v0.9.6 -// Project: http://autobahn.ws/js/ -// Definitions by: Elad Zelingher , Andy Hawkins -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -export = autobahn; - -declare namespace autobahn { - - export class Session { - id: number; - realm: string; - isOpen: boolean; - features: any; - caller_disclose_me: boolean; - publisher_disclose_me: boolean; - subscriptions: ISubscription[][]; - registrations: IRegistration[]; - - constructor(transport: ITransport, defer: DeferFactory, challenge: OnChallengeHandler); - - join(realm: string, authmethods: string[], authid: string): void; - - leave(reason: string, message: string): void; - - call(procedure: string, args?: any[], kwargs?: any, options?: ICallOptions): When.Promise; - - publish(topic: string, args?: any[], kwargs?: any, options?: IPublishOptions): When.Promise; - - subscribe(topic: string, handler: SubscribeHandler, options?: ISubscribeOptions): When.Promise; - - register(procedure: string, endpoint: RegisterEndpoint, options?: IRegisterOptions): When.Promise; - - unsubscribe(subscription: ISubscription): When.Promise; - - unregister(registration: IRegistration): When.Promise; - - prefix(prefix: string, uri: string): void; - - resolve(curie: string): string; - - onjoin: (roleFeatures: any) => void; - onleave: (reason: string, details: any) => void; - } - - interface IInvocation { - caller?: number; - progress?: (args : any[], kwargs : any) => void; - procedure: string; - } - - class Invocation implements IInvocation { - constructor(caller?: number, progress?: boolean, procedure?: string); - - procedure: string; - } - - interface IEvent { - publication: number; - publisher?: number; - topic: string; - } - - class Event implements IEvent { - constructor(publication?: number, publisher?: string, topic?: string); - - publication: number; - topic: string; - } - - interface IResult { - args: any[]; - kwargs: any; - } - - class Result implements IResult { - constructor(args?: any[], kwargs?: any); - - args: any[]; - kwargs: any; - } - - interface IError { - error: string; - args: any[]; - kwargs: any; - } - - class Error implements IError { - constructor(error?: string, args?: any[], kwargs?: any); - - error: string; - args: any[]; - kwargs: any; - } - - type SubscribeHandler = (args?: any[], kwargs?: any, details?: IEvent) => void; - - interface ISubscription { - topic: string; - handler: SubscribeHandler; - options: ISubscribeOptions; - session: Session; - id: number; - active: boolean; - unsubscribe(): When.Promise; - } - - class Subscription implements ISubscription { - constructor(topic? : string, handler?: SubscribeHandler, options?: ISubscribeOptions, session?: Session, id?: number); - - handler: SubscribeHandler; - - unsubscribe(): When.Promise; - - topic: string; - options: ISubscribeOptions; - session: Session; - id: number; - active: boolean; - } - - type RegisterEndpoint = (args?: any[], kwargs?: any, details?: IInvocation) => void; - - interface IRegistration { - procedure: string; - endpoint: RegisterEndpoint; - options: IRegisterOptions; - session: Session; - id: number; - active: boolean; - unregister(): When.Promise; - } - - class Registration implements IRegistration { - constructor(procedure?: string, endpoint?: RegisterEndpoint, options?: IRegisterOptions, session?: Session, id?: number); - - endpoint: RegisterEndpoint; - - unregister(): When.Promise; - - procedure: string; - options: IRegisterOptions; - session: Session; - id: number; - active: boolean; - } - - interface IPublication { - id: number; - } - - class Publication implements IPublication { - constructor(id: number); - - id: number; - } - - interface ICallOptions { - timeout?: number; - receive_progress?: boolean; - disclose_me?: boolean; - } - - interface IPublishOptions { - acknowledge?: boolean; - exclude?: number[]; - eligible?: number[]; - disclose_me?: Boolean; - } - - interface ISubscribeOptions { - match?: string; - } - - interface IRegisterOptions { - disclose_caller?: boolean; - } - - export class Connection { - constructor(options?: IConnectionOptions); - - open(): void; - - close(reason?: string, message?: string): void; - - onopen: (session: Session, details: any) => void; - onclose: (reason: string, details: any) => boolean; - } - - interface ITransportDefinition { - url?: string; - protocols?: string[]; - type: string; - } - - type DeferFactory = () => When.Promise; - - type OnChallengeHandler = (session: Session, method: string, extra: any) => When.Promise; - - interface IConnectionOptions { - use_es6_promises?: boolean; - // use explicit deferred factory, e.g. jQuery.Deferred or Q.defer - use_deferred?: DeferFactory; - transports?: ITransportDefinition[]; - retry_if_unreachable?: boolean; - max_retries?: number; - initial_retry_delay?: number; - max_retry_delay?: number; - retry_delay_growth?: number; - retry_delay_jitter?: number; - url?: string; - protocols?: string[]; - onchallenge?: OnChallengeHandler; - realm?: string; - authmethods?: string[]; - authid?: string; - } - - interface ICloseEventDetails { - wasClean: boolean; - reason: string; - code: number; - } - - interface ITransport { - onopen: () => void; - onmessage: (message: any[]) => void; - onclose: (details: ICloseEventDetails) => void; - - send(message: any[]): void; - close(errorCode: number, reason?: string): void; - } - - interface ITransportFactory { - // constructor(options: any); - type: string; - create(): ITransport; - } - - interface ITransports { - register(name: string, factory: any): void; - isRegistered(name: string): boolean; - get(name: string): any; - list(): string[]; - } - - interface ILog { - debug(...args: any[]): void; - } - - interface IUtil { - assert(condition: boolean, message: string): void; - } - - interface IAuthCra { - derive_key(secret: string, salt: string, iterations: number, keylen: number): string; - sign(key: string, challenge: string): string; - } - - var util: IUtil; - var log: ILog; - var transports: ITransports; - var auth_cra: IAuthCra; -} diff --git a/autoprefixer/index.d.ts b/autoprefixer/index.d.ts deleted file mode 100644 index 0a01c34d9a..0000000000 --- a/autoprefixer/index.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Type definitions for autoprefixer 6.7 -// Project: https://github.com/postcss/autoprefixer -// Definitions by: Armando Meziat -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -import { Plugin, Transformer as PostcssTransformer } from 'postcss'; - -declare namespace autoprefixer { - - export interface Options { - browsers?: string[]; - env?: string; - cascade?: boolean; - add?: boolean; - remove?: boolean; - supports?: boolean; - flexbox?: boolean | 'no-2009'; - grid?: boolean; - stats?: any; - } - - export interface Transformer extends PostcssTransformer { - info(): string; - } - - export interface Autoprefixer extends Plugin { - (opts?: Options): Transformer; - } -} - -declare const autoprefixer: autoprefixer.Autoprefixer; -export = autoprefixer; diff --git a/autoprefixer/tslint.json b/autoprefixer/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/autoprefixer/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/awesomplete/awesomplete-tests.ts b/awesomplete/awesomplete-tests.ts deleted file mode 100644 index 11abfdcba0..0000000000 --- a/awesomplete/awesomplete-tests.ts +++ /dev/null @@ -1,55 +0,0 @@ -var input = document.getElementById("myinput"); -new Awesomplete(input, {list: "#mylist"}); - -new Awesomplete(input, {list: document.querySelector("#mylist")}); - -new Awesomplete(input, { - list: ["Ada", "Java", "JavaScript", "LOLCODE", "Node.js", "Ruby on Rails"] -}); - -var awesomplete = new Awesomplete(input); -awesomplete.list = ["Ada", "Java", "JavaScript", "LOLCODE", "Node.js", "Ruby on Rails"]; - -new Awesomplete(input, { - list: [ - { label: "Belarus", value: "BY" }, - { label: "China", value: "CN" }, - { label: "United States", value: "US" } - ] -}); - -// Same with arrays: -new Awesomplete(input, { - list: [ - [ "Belarus", "BY" ], - [ "China", "CN" ], - [ "United States", "US" ] - ] -}); - -new Awesomplete('input[type="email"]', { - list: ["aol.com", "att.net", "comcast.net", "facebook.com", "gmail.com", "gmx.com", "googlemail.com", "google.com", "hotmail.com", "hotmail.co.uk", "mac.com", "me.com", "mail.com", "msn.com", "live.com", "sbcglobal.net", "verizon.net", "yahoo.com", "yahoo.co.uk"], - data: function (text: string, input: any) { - return input.slice(0, input.indexOf("@")) + "@" + text; - }, - filter: Awesomplete.FILTER_STARTSWITH -}); - -new Awesomplete('input[data-multiple]', { - filter: function(text: string, input: any) { - return Awesomplete.FILTER_CONTAINS(text, input.match(/[^,]*$/)[0]); - }, - - replace: function(text: string) { - var before = this.input.value.match(/^.+,\s*|/)[0]; - this.input.value = before + text + ", "; - } -}); - -var ajax = new XMLHttpRequest(); -ajax.open("GET", "https://restcountries.eu/rest/v1/lang/fr", true); -ajax.onload = function() { - var list = JSON.parse(ajax.responseText).map(function(i: any) { return i.name; }); - new Awesomplete(document.querySelector("#ajax-example input"),{ list: list }); -}; -ajax.send(); \ No newline at end of file diff --git a/awesomplete/index.d.ts b/awesomplete/index.d.ts deleted file mode 100644 index d39389f008..0000000000 --- a/awesomplete/index.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Type definitions for Awesomplete v1.1.0 -// Project: https://leaverou.github.io/awesomplete/ -// Definitions by: webbiesdk , Ben Dixon -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare class Awesomplete { - constructor(input: Element | HTMLElement | string, o?: AwesompleteOptions); - static all: Array; - static $$: (expr: string | NodeSelector, con?: any) => NodeList; - static ITEM: (text: string, input: string) => HTMLElement; - static $: { - (expr: string|Element, con?: NodeSelector): string | Element; - regExpEscape: (s: { replace: (arg0: RegExp, arg1: string) => void }) => any; - create: (tag: string, o: any) => HTMLElement; - fire: (target: EventTarget, type: string, properties: any) => any; - siblingIndex: (el: Element) => number; - }; - static FILTER_STARTSWITH: (text: string, input: string) => boolean; - static FILTER_CONTAINS: (text: string, input: string) => boolean; - static SORT_BYLENGTH: (a: number | any[], b: number | any[]) => number; - static REPLACE: (text: any) => void; - next: () => void; - container: HTMLElement; - select: (selected?: HTMLElement, originalTarget?: HTMLElement) => void; - previous: () => void; - index: number; - opened: number; - list: string | string[] | Element | { label: string, value: any }[] | [string, string][]; - input: HTMLElement | string; - goto: (i: number) => void; - ul: HTMLElement; - close: () => void; - evaluate: () => void; - selected: boolean; - open: () => void; - status: HTMLElement; -} - -interface AwesompleteOptions { - list?: string | string[] | Element | { label: string, value: any }[] | [string, string][]; - minChars?: Number; - maxItems?: Number; - autoFirst?: boolean; - data?: Function; - filter?: Function; - sort?: Function; - item?: Function; - replace?: Function; -} diff --git a/aws-lambda/aws-lambda-tests.ts b/aws-lambda/aws-lambda-tests.ts deleted file mode 100644 index fb09beda8a..0000000000 --- a/aws-lambda/aws-lambda-tests.ts +++ /dev/null @@ -1,115 +0,0 @@ -/// - -var str: string = "any string"; -var date: Date = new Date(); -var anyObj: any = { abc: 123 }; -var num: number = 5; -var error: Error = new Error(); -var b: boolean = true; -var apiGwEvt: AWSLambda.APIGatewayEvent; -var clientCtx: AWSLambda.ClientContext; -var clientContextEnv: AWSLambda.ClientContextEnv; -var clientContextClient: AWSLambda.ClientContextClient; -var context: AWSLambda.Context; -var identity: AWSLambda.CognitoIdentity; -var proxyResult: AWSLambda.ProxyResult; - -/* API Gateway Event */ -str = apiGwEvt.body; -str = apiGwEvt.headers["example"]; -str = apiGwEvt.httpMethod; -b = apiGwEvt.isBase64Encoded; -str = apiGwEvt.path; -str = apiGwEvt.pathParameters["example"]; -str = apiGwEvt.queryStringParameters["example"]; -str = apiGwEvt.stageVariables["example"]; -str = apiGwEvt.requestContext.accountId; -str = apiGwEvt.requestContext.apiId; -str = apiGwEvt.requestContext.httpMethod; -str = apiGwEvt.requestContext.identity.accessKey; -str = apiGwEvt.requestContext.identity.accountId; -str = apiGwEvt.requestContext.identity.apiKey; -str = apiGwEvt.requestContext.identity.caller; -str = apiGwEvt.requestContext.identity.cognitoAuthenticationProvider; -str = apiGwEvt.requestContext.identity.cognitoAuthenticationType; -str = apiGwEvt.requestContext.identity.cognitoIdentityId; -str = apiGwEvt.requestContext.identity.cognitoIdentityPoolId; -str = apiGwEvt.requestContext.identity.sourceIp; -str = apiGwEvt.requestContext.identity.user; -str = apiGwEvt.requestContext.identity.userAgent; -str = apiGwEvt.requestContext.identity.userArn; -str = apiGwEvt.requestContext.stage; -str = apiGwEvt.requestContext.requestId; -str = apiGwEvt.requestContext.resourceId; -str = apiGwEvt.requestContext.resourcePath; -str = apiGwEvt.resource; - -/* Lambda Proxy Result */ -num = proxyResult.statusCode; -str = proxyResult.headers["example"]; -str = proxyResult.body - -/* Context */ -b = context.callbackWaitsForEmptyEventLoop; -str = context.functionName; -str = context.functionVersion; -str = context.invokedFunctionArn; -num = context.memoryLimitInMB; -str = context.awsRequestId; -str = context.logGroupName; -str = context.logStreamName; -identity = context.identity; -clientCtx = context.clientContext; - -/* CognitoIdentity */ -str = identity.cognitoIdentityId; -str = identity.cognitoIdentityPoolId; - -/* ClientContext */ -clientContextClient = clientCtx.client; -anyObj = clientCtx.Custom; -clientContextEnv = clientCtx.env; - -/* ClientContextEnv */ -str = clientContextEnv.locale; -str = clientContextEnv.make; -str = clientContextEnv.model; -str = clientContextEnv.platform; -str = clientContextEnv.platformVersion; - -/* ClientContextClient */ -str = clientContextClient.appPackageName; -str = clientContextClient.appTitle; -str = clientContextClient.appVersionCode; -str = clientContextClient.appVersionName; -str = clientContextClient.installationId; - -/* Callback */ -function callback(cb: AWSLambda.Callback) { - cb(); - cb(null); - cb(error); - cb(null, anyObj); -} - -/* Proxy Callback */ -function proxyCallback(cb: AWSLambda.ProxyCallback) { - cb(); - cb(null); - cb(error); - cb(null, proxyResult); -} - -/* Compatibility functions */ -context.done(); -context.done(error); -context.done(error, anyObj); -context.succeed(str); -context.succeed(anyObj); -context.succeed(str, anyObj); -context.fail(error); -context.fail(str); - -/* Handler */ -let handler: AWSLambda.Handler = (event: any, context: AWSLambda.Context, cb: AWSLambda.Callback) => {}; -let proxyHandler: AWSLambda.ProxyHandler = (event: AWSLambda.APIGatewayEvent, context: AWSLambda.Context, cb: AWSLambda.ProxyCallback) => {}; diff --git a/aws-lambda/index.d.ts b/aws-lambda/index.d.ts deleted file mode 100644 index e8b70db7bd..0000000000 --- a/aws-lambda/index.d.ts +++ /dev/null @@ -1,126 +0,0 @@ -// Type definitions for AWS Lambda -// Project: http://docs.aws.amazon.com/lambda -// Definitions by: James Darbyshire , Michael Skarum , Stef Heyenrath , Toby Hede , Rich Buggy -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -// API Gateway "event" -interface APIGatewayEvent { - body: string | null; - headers: { [name: string]: string }; - httpMethod: string; - isBase64Encoded: boolean; - path: string; - pathParameters: { [name: string]: string } | null; - queryStringParameters: { [name: string]: string } | null; - stageVariables: { [name: string]: string } | null; - requestContext: { - accountId: string; - apiId: string; - httpMethod: string; - identity: { - accessKey: string | null; - accountId: string | null; - apiKey: string | null; - caller: string | null; - cognitoAuthenticationProvider: string | null; - cognitoAuthenticationType: string | null; - cognitoIdentityId: string | null; - cognitoIdentityPoolId: string | null; - sourceIp: string; - user: string | null; - userAgent: string | null; - userArn: string | null; - }, - stage: string; - requestId: string; - resourceId: string; - resourcePath: string; - }; - resource: string; -} - -// Context -// http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-context.html -interface Context { - // Properties - callbackWaitsForEmptyEventLoop: boolean; - functionName: string; - functionVersion: string; - invokedFunctionArn: string; - memoryLimitInMB: number; - awsRequestId: string; - logGroupName: string; - logStreamName: string; - identity?: CognitoIdentity; - clientContext?: ClientContext; - - // Functions - getRemainingTimeInMillis(): number; - - // Functions for compatibility with earlier Node.js Runtime v0.10.42 - // For more details see http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-using-old-runtime.html#nodejs-prog-model-oldruntime-context-methods - done(error?: Error, result?: any): void; - fail(error: Error): void; - fail(message: string): void; - succeed(message: string): void; - succeed(object: any): void; - succeed(message: string, object: any): void; -} - -interface CognitoIdentity { - cognitoIdentityId: string; - cognitoIdentityPoolId: string; -} - -interface ClientContext { - client: ClientContextClient; - Custom?: any; - env: ClientContextEnv; -} - -interface ClientContextClient { - installationId: string; - appTitle: string; - appVersionName: string; - appVersionCode: string; - appPackageName: string; -} - -interface ClientContextEnv { - platformVersion: string; - platform: string; - make: string; - model: string; - locale: string; -} - -interface ProxyResult { - statusCode: number; - headers?: { - [header: string]: string; - }, - body: string; -} - -/** - * AWS Lambda handler function. - * http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-handler.html - * - * @param event – event data. - * @param context – runtime information of the Lambda function that is executing. - * @param callback – optional callback to return information to the caller, otherwise return value is null. - */ -export type Handler = (event: any, context: Context, callback?: Callback) => void; -export type ProxyHandler = (event: APIGatewayEvent, context: Context, callback?: ProxyCallback) => void; - -/** - * Optional callback parameter. - * http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-handler.html - * - * @param error – an optional parameter that you can use to provide results of the failed Lambda function execution. - * @param result – an optional parameter that you can use to provide the result of a successful function execution. The result provided must be JSON.stringify compatible. - */ -export type Callback = (error?: Error, result?: any) => void; -export type ProxyCallback = (error?: Error, result?: ProxyResult) => void; - -export as namespace AWSLambda; diff --git a/aws-sdk/aws-sdk-tests.ts b/aws-sdk/aws-sdk-tests.ts deleted file mode 100644 index 5188a3e725..0000000000 --- a/aws-sdk/aws-sdk-tests.ts +++ /dev/null @@ -1,422 +0,0 @@ - -import AWS = require('aws-sdk'); - -var str: string; - -var creds: AWS.Credentials; - -creds = new AWS.Credentials(str, str); -creds = new AWS.Credentials(str, str, str); -str = creds.accessKeyId; - - -/* - * ECS - */ -var ecs:AWS.ECS - -ecs = new AWS.ECS(); -ecs = new AWS.ECS({apiVersion: '2012-11-05'}); - -ecs.describeClusters({ - clusters: ['STRING_VALUE', 'STRING_VALUE'] - }, - function(err, data) { - if (err) console.log(err, err.stack); // an error occurred - else console.log(data); // successful response - }); - -ecs.describeTasks({ - cluster: 'STRING_VALUE', - tasks: ['STRING_VALUE', 'STRING_VALUE'] - }, - function(err, data) { - if (err) console.log(err, err.stack); // an error occurred - else console.log(data); // successful response - }); - - -/* - * 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 - }); - - var dynamoDBDocClient:AWS.DynamoDB.DocumentClient; -dynamoDBDocClient = new AWS.DynamoDB.DocumentClient(); -dynamoDBDocClient = new AWS.DynamoDB.DocumentClient({}); -dynamoDBDocClient.createSet([1, 2, 3], { validate: true }); -dynamoDBDocClient.get( - { - TableName: 'TABLE_NAME', - Key: { userId: 'abc123', email: 'abc123@abc123.com' } - }, - function(err, data) { - if (err) console.log(err, err.stack); // an error occurred - else console.log(data); // successful response - } -); -dynamoDBDocClient.put( - { - TableName: 'TABLE_NAME', - Item: { - userId: 'abc123', - email: 'abc123@abc123.com', - firstName: 'Matt', - lastName: 'Forrester the ' + new Date().getTime() - } - }, - function(err, data) { - if (err) console.log(err, err.stack); // an error occurred - else console.log(data); // successful response - } -); -dynamoDBDocClient.delete( - { - TableName: 'TABLE_NAME', - Key: { - userId: 'abc123', - email: 'abc123@abc123.com' - } - }, - function(err, data) { - if (err) console.log(err, err.stack); // an error occurred - else console.log(data); // successful response - } -); -dynamoDBDocClient.update( - { - TableName: 'TABLE_NAME', - Key: { - userId: 'abc123', - email: 'abc123@abc123.com' - }, - AttributeUpdates: { - thingsWithWheels: { - Action: 'PUT', - Value: dynamoDBDocClient.createSet( - [ - 'SkateBoard', - 'Skates', - 'Mountain Bike', - 'Evolve Electric Skateboard' - ], - { validate: true } - ) - }, - age: { - Action: 'PUT', - Value: 35 - } - } - }, - function(err, data) { - if (err) console.log(err, err.stack); // an error occurred - else console.log(data); // successful response - } -); -dynamoDBDocClient.scan( - { - TableName: 'TABLE_NAME', - KeyConditions: { - age: { - ComparisonOperator: 'EQ', - AttributeValueList: [35] - } - } - }, - function(err, data) { - if (err) console.log(err, err.stack); // an error occurred - else console.log(data); // successful response - } -); -dynamoDBDocClient.query( - { - TableName: 'TABLE_NAME', - KeyConditions: { - userId: { - ComparisonOperator: 'EQ', - AttributeValueList: ['abc123'] - } - } - }, - function(err, data) { - if (err) console.log(err, err.stack); // an error occurred - else console.log(data); // successful response - } -); - -var kinesis = new AWS.Kinesis(); - -var putRecordParam = { - Data: new Buffer('...') || 'STRING_VALUE', /* required */ - PartitionKey: 'STRING_VALUE', /* required */ - StreamName: 'STRING_VALUE', /* required */ - ExplicitHashKey: 'STRING_VALUE', - SequenceNumberForOrdering: 'STRING_VALUE' -}; -kinesis.putRecord(putRecordParam, function(err, data) { - if (err) console.log(err, err.stack); // an error occurred - else console.log(data); // successful response -}); - -var putRecordParams = { - Records: [ /* required */ - { - Data: new Buffer('...') || 'STRING_VALUE', /* required */ - PartitionKey: 'STRING_VALUE', /* required */ - ExplicitHashKey: 'STRING_VALUE' - }, - /* more items */ - ], - StreamName: 'STRING_VALUE' /* required */ -}; -kinesis.putRecords(putRecordParams, function(err, data) { - if (err) console.log(err, err.stack); // an error occurred - else console.log(data); // successful response -}); - -var increaseStreamRetentionPeriodParams = { - RetentionPeriodHours: 0, /* required */ - StreamName: 'STRING_VALUE' /* required */ -}; -kinesis.increaseStreamRetentionPeriod(increaseStreamRetentionPeriodParams, 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/index.d.ts b/aws-sdk/index.d.ts deleted file mode 100644 index fbee8f926c..0000000000 --- a/aws-sdk/index.d.ts +++ /dev/null @@ -1,2606 +0,0 @@ -// Type definitions for aws-sdk -// Project: https://github.com/aws/aws-sdk-js -// Definitions by: midknight41 , Casper Skydt -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -// Imported from: https://github.com/soywiz/typescript-node-definitions/aws-sdk.d.ts - -/// - -export declare var config: ClientConfig; - -export declare function Config(json: any): void; - -export declare class Credentials { - constructor(accessKeyId: string, secretAccessKey: string, sessionToken?: string); - accessKeyId: string; -} - -export class EnvironmentCredentials extends Credentials { - constructor(profile: string); -} - -export module CognitoIdentity { - export interface CognitoIdentityCredentialsParams { - IdentityPoolId?: string; - AccountId?: string; - Logins?: { [k: string]: any }; - - RoleArn?: string; - RoleSessionName?: string; - WebIdentityToken?: string; - ProviderId?: string; - Policy?: string; - DurationSeconds?: number; - - IdentityId?: string; - } -} - -export class CognitoIdentityCredentials extends Credentials { - constructor(params: CognitoIdentity.CognitoIdentityCredentialsParams); -} - -export interface Logger { - write?: (chunk: any, encoding?: string, callback?: () => void) => void; - log?: (...messages: any[]) => void; -} - -export interface HttpOptions { - proxy?: string; - agent?: any; - timeout?: number; - xhrAsync?: boolean; - xhrWithCredentials?: boolean; -} - -export declare class Endpoint { - constructor(endpoint: string); - - host: string; - hostname: string; - href: string; - port: number; - protocol: string; -} - -interface AwsError extends Error { - stack: string; -} - -export interface RetryDelayOption { - base?: number; - customBackoff?: (retryCount: number) => number; -} - -export interface Ebs { - SnapshotId?: string; - VolumeSize?: number; - VolumeType?: string; - DeleteOnTermination?: boolean; - Iops?: number; - Encrypted?: boolean; -} - -export interface BlockDeviceMapping { - VirtualName?: string; - DeviceName: string; - Ebs?: Ebs; - NoDevice?: boolean; -} - -export interface InstanceMonitoring { - SpotPrice?: string; - Enabled?: boolean; -} - -export interface Filter { - Name?: string; - Values?: boolean; -} - -export interface StepAdjustment { - scalingAdjustment: number; - metricIntervalLowerBound?: number; - metricIntervalUpperBound?: number; -} - -export interface Tags { - resourceId?: string; - resourceType?: string; - key: string; - value?: string; - propagateAtLaunch?: boolean; -} - -export interface Services { - autoscaling?: any; - cloudformation?: any; - cloudfront?: any; - cloudsearch?: any; - cloudsearchdomain?: any; - cloudtrail?: any; - cloudwatch?: any; - cloudwatchlogs?: any; - cognitoidentity?: any; - cognitosync?: any; - datapipeline?: any; - directconnect?: any; - dynamodb?: any; - ec2?: any; - ecs?: any; - elasticache?: any; - elasticbeanstalk?: any; - elastictranscoder?: any; - elb?: any; - emr?: any; - glacier?: any; - httpOptions?: HttpOptions; - iam?: any; - importexport?: any; - kinesis?: any; - opsworks?: any; - rds?: any; - redshift?: any; - route53?: any; - route53domains?: any; - s3?: any; - ses?: any; - simpledb?: any; - sns?: any; - sqs?: any; - storagegateway?: any; - sts?: any; - support?: any; - swf?: any; -} - -export interface ClientConfigPartial extends Services { - credentials?: Credentials; - region?: string; - computeChecksums?: boolean; - convertResponseTypes?: boolean; - logger?: Logger; - maxRedirects?: number; - maxRetries?: number; - paramValidation?: boolean; - s3ForcePathStyle?: boolean; - apiVersion?: any; - apiVersions?: Services; - signatureVersion?: string; - sslEnabled?: boolean; - systemClockOffset?: number; -} - -export interface ClientConfig extends ClientConfigPartial { - update?: (options: ClientConfigPartial, allUnknownKeys?: boolean) => void; - getCredentials?: (callback: (err?: any) => void) => void; - loadFromPath?: (path: string) => void; - credentials: Credentials; - region: string; -} - -export declare class CloudFormation { - constructor(options?: CloudFormation.Options); - endpoint: Endpoint; - - cancelUpdateStack(params: CloudFormation.CancelUpdateStackParams, callback: (err: AwsError, data: any) => void): void; - continueUpdateRollback(params: CloudFormation.ContinueUpdateRollbackParams, callback: (err: AwsError, data: any) => void): void; - createChangeSet(params: CloudFormation.CreateChangeSetParams, callback: (err: AwsError, data: any) => void): void; - createStack(params: CloudFormation.CreateStackParams, callback: (err: AwsError, data: any) => void): void; - deleteChangeSet(params: CloudFormation.DeleteChangeSetParams, callback: (err: AwsError, data: any) => void): void; - deleteStack(params: CloudFormation.DeleteStackParams, callback: (err: AwsError, data: any) => void): void; - describeAccountLimits(params: CloudFormation.DescribeAccountLimitsParams, callback: (err: AwsError, data: any) => void): void; - describeChangeSet(params: CloudFormation.DescribeChangeSetParams, callback: (err: AwsError, data: any) => void): void; - describeStackEvents(params: CloudFormation.DescribeStackEventsParams, callback: (err: AwsError, data: any) => void): void; - describeStackResource(params: CloudFormation.DescribeStackResourceParams, callback: (err: AwsError, data: any) => void): void; - describeStackResources(params: CloudFormation.DescribeStackResourcesParams, callback: (err: AwsError, data: any) => void): void; - describeStacks(params: CloudFormation.DescribeStacksParams, callback: (err: AwsError, data: any) => void): void; - estimateTemplateCost(params: CloudFormation.EstimateTemplateCostParams, callback: (err: AwsError, data: any) => void): void; - executeChangeSet(params: CloudFormation.ExecuteChangeSetParams, callback: (err: AwsError, data: any) => void): void; - getStackPolicy(params: CloudFormation.GetStackPolicyParams, callback: (err: AwsError, data: any) => void): void; - getTemplate(params: CloudFormation.GetTemplateParams, callback: (err: AwsError, data: any) => void): void; - getTemplateSummary(params: CloudFormation.GetTemplateSummaryParams, callback: (err: AwsError, data: any) => void): void; - listChangeSets(params: CloudFormation.ListChangeSetsParams, callback: (err: AwsError, data: any) => void): void; - listStackResources(params: CloudFormation.ListStackResourcesParams, callback: (err: AwsError, data: any) => void): void; - listStacks(params: CloudFormation.ListStacksParams, callback: (err: AwsError, data: any) => void): void; - setStackPolicy(params: CloudFormation.SetStackPolicyParams, callback: (err: AwsError, data: any) => void): void; - signalResource(params: CloudFormation.SignalResourceParams, callback: (err: AwsError, data: any) => void): void; - updateStack(params: CloudFormation.UpdateStackParams, callback: (err: AwsError, data: any) => void): void; - validateTemplate(params: CloudFormation.ValidateTemplateParams, callback: (err: AwsError, data: any) => void): void; - waitFor(state: string, params: CloudFormation.WaitForParams, callback: (err: AwsError, data: any) => void): void; -} - -export declare class Lambda { - constructor(options?: any); - endpoint: Endpoint; - - addPermission(params: Lambda.AddPermissionParams, callback: (err: AwsError, data: any) => void): void; - createAlias(params: Lambda.CreateAliasParams, callback: (err: AwsError, data: any) => void): void; - createEventSourceMapping(params: Lambda.CreateEventSourceMappingParams, callback: (err: AwsError, data: any) => void): void; - createFunction(params: Lambda.CreateFunctionParams, callback: (err: AwsError, data: any) => void): void; - deleteAlias(params: Lambda.DeleteAliasParams, callback: (err: AwsError, data: any) => void): void; - deleteEventSourceMapping(params: Lambda.DeleteEventSourceMappingParams, callback: (err: AwsError, data: any) => void): void; - deleteFunction(params: Lambda.DeleteFunctionParams, callback: (err: AwsError, data: any) => void): void; - getAlias(params: Lambda.GetAliasParams, callback: (err: AwsError, data: any) => void): void; - getEventSourceMapping(params: Lambda.GetEventSourceMappingParams, callback: (err: AwsError, data: any) => void): void; - getFunction(params: Lambda.GetFunctionParams, callback: (err: AwsError, data: any) => void): void; - getFunctionConfiguration(params: Lambda.GetFunctionConfigurationParams, callback: (err: AwsError, data: any) => void): void; - getPolicy(params: Lambda.GetPolicyParams, callback: (err: AwsError, data: any) => void): void; - invoke(params: Lambda.InvokeParams, callback: (err: AwsError, data: any) => void): void; - listAliases(params: Lambda.ListAliasesParams, callback: (err: AwsError, data: any) => void): void; - listEventSourceMappings(params: Lambda.ListEventSourceMappingsParams, callback: (err: AwsError, data: any) => void): void; - listFunctions(params: Lambda.ListFunctionsParams, callback: (err: AwsError, data: any) => void): void; - listVersionsByFunction(params: Lambda.ListVersionsByFunctionParams, callback: (err: AwsError, data: any) => void): void; - publishVersion(params: Lambda.PublishVersionParams, callback: (err: AwsError, data: any) => void): void; - removePermission(params: Lambda.RemovePermissionParams, callback: (err: AwsError, data: any) => void): void; - updateAlias(params: Lambda.UpdateAliasParams, callback: (err: AwsError, data: any) => void): void; - updateEventSourceMapping(params: Lambda.UpdateEventSourceMappingParams, callback: (err: AwsError, data: any) => void): void; - updateFunctionCode(params: Lambda.UpdateFunctionCodeParams, callback: (err: AwsError, data: any) => void): void; - updateFunctionConfiguration(params: Lambda.UpdateFunctionConfigurationParams, callback: (err: AwsError, data: any) => void): void; -} - -export class AutoScaling { - constructor(options?: any); - endpoint: Endpoint; - - attachInstances(params: AutoScaling.AttachInstancesParams, callback: (err: AwsError, data: any) => void): void; - attachLoadBalancers(params: AutoScaling.AttachLoadBalancersParams, callback: (err: AwsError, data: any) => void): void; - attachLoadBalancerTargetGroups(param: AutoScaling.AttachLoadBalancerTargetGroupsParams, callback: (err: AwsError, data: any) => void): void; - completeLifecycleAction(param: AutoScaling.CompleteLifecycleActionParams, callback: (err: AwsError, data: any) => void): void; - createAutoScalingGroup(param: AutoScaling.CreateAutoScalingGroupParams, callback: (err: AwsError, data: any) => void): void; - createLaunchConfiguration(param: AutoScaling.CreateLaunchConfigurationParams, callback: (err: AwsError, data: any) => void): void; - createOrUpdateTags(param: AutoScaling.CreateOrUpdateTagsParams, callback: (err: AwsError, data: any) => void): void; - deleteAutoScalingGroup(param: AutoScaling.DeleteAutoScalingGroupParams, callback: (err: AwsError, data: any) => void): void; - deleteLaunchConfiguration(param: AutoScaling.DeleteLaunchConfigurationParams, callback: (err: AwsError, data: any) => void): void; - deleteLifecycleHook(param: AutoScaling.DeleteLifecycleHookParams, callback: (err: AwsError, data: any) => void): void; - deleteNotificationConfiguration(param: AutoScaling.DeleteNotificationConfigurationParams, callback: (err: AwsError, data: any) => void): void; - deletePolicy(param: AutoScaling.DeletePolicyParams, callback: (err: AwsError, data: any) => void): void; - deleteScheduledAction(param: AutoScaling.DeleteScheduledActionParams, callback: (err: AwsError, data: any) => void): void; - deleteTags(param: AutoScaling.DeleteTagsParams, callback: (err: AwsError, data: any) => void): void; - describeAccountLimits(callback: (err: AwsError, data: any) => void): void; - describeAdjustmentTypes(callback: (err: AwsError, data: any) => void): void; - describeAutoScalingGroups(param: AutoScaling.DescribeAutoScalingGroupsParams, callback: (err: AwsError, data: any) => void): void; - describeAutoScalingInstances(param: AutoScaling.DescribeAutoScalingInstancesParams, callback: (err: AwsError, data: any) => void): void; - describeAutoScalingNotificationTypes(callback: (err: AwsError, data: any) => void): void; - describeLaunchConfigurations(param: AutoScaling.DescribeLaunchConfigurationsParams, callback: (err: AwsError, data: any) => void): void; - describeLifecycleHooks(param: AutoScaling.DescribeLifecycleHooksParams, callback: (err: AwsError, data: any) => void): void; - describeLifecycleHookTypes(callback: (err: AwsError, data: any) => void): void; - describeLoadBalancers(param: AutoScaling.DescribeLoadBalancersParams, callback: (err: AwsError, data: any) => void): void; - describeLoadBalancerTargetGroups(param: AutoScaling.DescribeLoadBalancerTargetGroupsParams, callback: (err: AwsError, data: any) => void): void; - describeMetricCollectionTypes(callback: (err: AwsError, data: any) => void): void; - describeNotificationConfigurations(param: AutoScaling.DescribeNotificationConfigurationsParams, callback: (err: AwsError, data: any) => void): void; - describePolicies(param: AutoScaling.DescribePoliciesParams, callback: (err: AwsError, data: any) => void): void; - describeScalingActivities(param: AutoScaling.DescribeScalingActivitiesParams, callback: (err: AwsError, data: any) => void): void; - describeScalingProcessTypes(callback: (err: AwsError, data: any) => void): void; - describeScheduledActions(param: AutoScaling.DescribeScheduledActionsParams, callback: (err: AwsError, data: any) => void): void; - describeTags(param: AutoScaling.DescribeTagsParams, callback: (err: AwsError, data: any) => void): void; - describeTerminationPolicyTypes(callback: (err: AwsError, data: any) => void): void; - detachInstances(param: AutoScaling.DetachInstancesParams, callback: (err: AwsError, data: any) => void): void; - detachLoadBalancers(param: AutoScaling.DetachLoadBalancersParams, callback: (err: AwsError, data: any) => void): void; - detachLoadBalancerTargetGroups(param: AutoScaling.DetachLoadBalancerTargetGroupsParams, callback: (err: AwsError, data: any) => void): void; - disableMetricsCollection(param: AutoScaling.DisableMetricsCollectionParams, callback: (err: AwsError, data: any) => void): void; - enableMetricsCollection(param: AutoScaling.EnableMetricsCollectionParams, callback: (err: AwsError, data: any) => void): void; - enterStandby(param: AutoScaling.EnterStandbyParams, callback: (err: AwsError, data: any) => void): void; - executePolicy(param: AutoScaling.ExecutePolicyParams, callback: (err: AwsError, data: any) => void): void; - exitStandby(param: AutoScaling.ExitStandbyParams, callback: (err: AwsError, data: any) => void): void; - putLifecycleHook(param: AutoScaling.PutLifecycleHookParams, callback: (err: AwsError, data: any) => void): void; - putNotificationConfiguration(param: AutoScaling.PutNotificationConfigurationParams, callback: (err: AwsError, data: any) => void): void; - putScalingPolicy(param: AutoScaling.PutScalingPolicyParams, callback: (err: AwsError, data: any) => void): void; - putScheduledUpdateGroupAction(param: AutoScaling.PutScheduledUpdateGroupActionParams, callback: (err: AwsError, data: any) => void): void; - recordLifecycleActionHeartbeat(params: AutoScaling.RecordLifecycleActionHeartbeatParams, callback: (err: AwsError, data: any) => void): void; - resumeProcesses(params: AutoScaling.ResumeProcessesParams, callback: (err: AwsError, data: any) => void): void; - setDesiredCapacity(params: AutoScaling.SetDesiredCapacityParams, callback: (err: AwsError, data: any) => void): void; - setInstanceHealth(params: AutoScaling.SetInstanceHealthParams, callback: (err: AwsError, data: any) => void): void; - setInstanceProtection(params: AutoScaling.SetInstanceProtectionParams, callback: (err: AwsError, data: any) => void): void; - suspendProcesses(params: AutoScaling.SuspendProcessesParams, callback: (err: AwsError, data: any) => void): void; - terminateInstanceInAutoScalingGroup(params: AutoScaling.TerminateInstanceInAutoScalingGroupParams, callback: (err: AwsError, data: any) => void): void; - updateAutoScalingGroup(params: AutoScaling.UpdateAutoScalingGroupParams, callback: (err: AwsError, data: any) => void): void; - } - -export class SQS { - constructor(options?: any); - endpoint: Endpoint; - - addPermission(params: SQS.AddPermissionParams, callback: (err: AwsError, data: any) => void): void; - changeMessageVisibility(params: SQS.ChangeMessageVisibilityParams, callback: (err: AwsError, data: any) => void): void; - changeMessageVisibilityBatch(params: SQS.ChangeMessageVisibilityBatchParams, callback: (err: AwsError, data: SQS.ChangeMessageVisibilityBatchResponse) => void): void; - createQueue(params: SQS.CreateQueueParams, callback: (err: AwsError, data: SQS.CreateQueueResult) => void): void; - deleteMessage(params: SQS.DeleteMessageParams, callback: (err: AwsError, data: any) => void): void; - deleteMessageBatch(params: SQS.DeleteMessageBatchParams, callback: (err: AwsError, data: SQS.DeleteMessageBatchResult) => void): void; - deleteQueue(params: { QueueUrl: string; }, callback: (err: AwsError, data: any) => void): void; - getQueueAttributes(params: SQS.GetQueueAttributesParams, callback: (err: AwsError, data: SQS.GetQueueAttributesResult) => void): void; - getQueueUrl(params: SQS.GetQueueUrlParams, callback: (err: AwsError, data: { QueueUrl: string; }) => void): void; - listDeadLetterSourceQueues(params: { QueueUrl: string }, callback: (err: AwsError, data: { queueUrls: string[] }) => void): void; - listQueues(params: { QueueNamePrefix?: string }, callback: (err: AwsError, data: { QueueUrls: string[] }) => void): void; - purgeQueue(params: { QueueUrl: string }, callback: (err: AwsError, data: any) => void): void; - receiveMessage(params: SQS.ReceiveMessageParams, callback: (err: AwsError, data: SQS.ReceiveMessageResult) => void): void; - removePermission(params: { QueueUrl: string, Label: string }, callback: (err: AwsError, data: any) => void): void; - sendMessage(params: SQS.SendMessageParams, callback: (err: AwsError, data: SQS.SendMessageResult) => void): void; - sendMessageBatch(params: SQS.SendMessageBatchParams, callback: (err: AwsError, data: SQS.SendMessageBatchResult) => void): void; - setQueueAttributes(params: SQS.SetQueueAttributesParams, callback: (err: AwsError, data: any) => void): void; -} - -export declare class SES { - constructor(options?: any); - endpoint: Endpoint; - - sendEmail(params: any, callback: (err: any, data: SES.SendEmailResult) => void): void; -} - -export declare class SNS { - constructor(options?: any); - endpoint: Endpoint; - - publish(request: Sns.PublishRequest, callback: (err: any, data: any) => void): void; -} - -export class Kinesis { - constructor(options?: any); - endpoint: Endpoint; - - putRecord(params: KINESIS.PutRecordParams, callback: (error: Error, data: KINESIS.PutRecordResult) => void): void; - putRecords(params: KINESIS.PutRecordsParams, callback: (error: Error, data: KINESIS.PutRecordsResult) => void): void; - increaseStreamRetentionPeriod(params: KINESIS.IncreaseStreamRetentionPeriodParams, callback: (error: Error, data: any) => void): void; - } - - export module KINESIS { - export interface Record { - Data: Buffer | string | Blob; - PartitionKey: string; - ExplicitHashKey?: string; - } - - export interface RecordResult { - SequenceNumber: string; - ShardId: string; - ErrorCode: string; - ErrorMessage: string; - } - - export interface PutRecordParams extends Record { - StreamName: string; - SequenceNumberForOrdering?: string; - } - - export interface PutRecordResult { - ShardId: string; - SequenceNumber: string; - } - - export interface PutRecordsParams { - StreamName: string; - Records: Record[]; - } - - export interface PutRecordsResult { - FailedRecordCount: number; - Records: RecordResult[] - } - - export interface IncreaseStreamRetentionPeriodParams { - RetentionPeriodHours: number; - StreamName: string; - } - } - - -export declare class SWF { - constructor(options?: any); - endpoint: Endpoint; - - countClosedWorkflowExecutions(params: any, callback: (err: any, data: any) => void): void; - countOpenWorkflowExecutions(params: any, callback: (err: any, data: any) => void): void; - countPendingActivityTasks(params: any, callback: (err: any, data: any) => void): void; - countPendingDecisionTasks(params: any, callback: (err: any, data: any) => void): void; - deprecateActivityType(params: any, callback: (err: any, data: any) => void): void; - deprecateDomain(params: any, callback: (err: any, data: any) => void): void; - deprecateWorkflowType(params: any, callback: (err: any, data: any) => void): void; - describeActivityType(params: any, callback: (err: any, data: any) => void): void; - describeDomain(params: any, callback: (err: any, data: any) => void): void; - describeWorkflowExecution(params: any, callback: (err: any, data: any) => void): void; - describeWorkflowType(params: any, callback: (err: any, data: any) => void): void; - getWorkflowExecutionHistory(params: any, callback: (err: any, data: any) => void): void; - listActivityTypes(params: any, callback: (err: any, data: any) => void): void; - listClosedWorkflowExecutions(params: any, callback: (err: any, data: any) => void): void; - listDomains(params: any, callback: (err: any, data: any) => void): void; - listOpenWorkflowExecutions(params: any, callback: (err: any, data: any) => void): void; - listWorkflowTypes(params: any, callback: (err: any, data: any) => void): void; - pollForActivityTask(params: any, callback: (err: any, data: Swf.ActivityTask) => void): void; - pollForDecisionTask(params: any, callback: (err: any, data: Swf.DecisionTask) => void): void; - recordActivityTaskHeartbeat(params: any, callback: (err: any, data: any) => void): void; - registerActivityType(params: any, callback: (err: any, data: any) => void): void; - registerDomain(params: any, callback: (err: any, data: any) => void): void; - registerWorkflowType(params: any, callback: (err: any, data: any) => void): void; - requestCancelWorkflowExecution(params: any, callback: (err: any, data: any) => void): void; - respondActivityTaskCanceled(params: Swf.RespondActivityTaskCanceledRequest, callback: (err: any, data: any) => void): void; - respondActivityTaskCompleted(params: Swf.RespondActivityTaskCompletedRequest, callback: (err: any, data: any) => void): void; - respondActivityTaskFailed(params: Swf.RespondActivityTaskFailedRequest, callback: (err: any, data: any) => void): void; - respondDecisionTaskCompleted(params: Swf.RespondDecisionTaskCompletedRequest, callback: (err: any, data: any) => void): void; - signalWorkflowExecution(params: any, callback: (err: any, data: any) => void): void; - startWorkflowExecution(params: any, callback: (err: any, data: Swf.StartWorkflowExecutionResult) => void): void; - terminateWorkflowExecution(params: any, callback: (err: any, data: any) => void): void; - -} - -export declare class S3 { - constructor(options?: any); - endpoint: Endpoint; - - getObject(params: s3.GetObjectRequest, callback?: (err: Error, data: any) => void): any; - putObject(params: s3.PutObjectRequest, callback?: (err: Error, data: any) => void): any; - copyObject(params: s3.CopyObjectRequest, callback?: (err: Error, data: any) => void): any; - deleteObject(params: s3.DeleteObjectRequest, callback: (err: Error, data: any) => void): void; - headObject(params: s3.HeadObjectRequest, callback: (err: Error, data: any) => void): void; - getSignedUrl(operation: string, params: any): string; - getSignedUrl(operation: string, params: any, callback: (err: Error, url: string) => void): void; - upload(params?: s3.PutObjectRequest, options?: s3.UploadOptions, callback?: (err: Error, data: any) => void): void; - listObjects(params: s3.ListObjectRequest, callback: (err: Error, data: s3.ListObjectResponse) => void): void; - listObjectsV2(params: s3.ListObjectV2Request, callback: (err: Error, data: s3.ListObjectV2Response) => void): void; - waitFor(state: string, params: s3.HeadObjectRequest, callback: (err: Error, data: any) => void): void; - - createMultipartUpload(params: any, callback: (err: Error, data: any) => void): void; - uploadPart(params: any, callback: (err: Error, data: any) => void): void; - listParts(params: any, callback: (err: Error, data: any) => void): void; - completeMultipartUpload(params: any, callback: (err: Error, data: any) => void): void; - } - - -export class STS { - constructor(options?: any); - endpoint: Endpoint; - /** - * Returns a set of temporary security credentials (consisting of an access key ID, a secret access key, and a security token) that you can use to access AWS resources that you might not normally have access to. - */ - assumeRole(params: sts.AssumeRoleParams, callback: (err: any, data: any) => void): void; - /** - * Returns a set of temporary security credentials for users who have been authenticated via a SAML authentication response. - */ - assumeRoleWithSAML(params: sts.AssumeRoleWithSAMLParams, callback: (err: any, data: any) => void): void; - - /** - * Returns a set of temporary security credentials for users who have been authenticated in a mobile or web application with a web identity provider, such as Amazon Cognito, Login with Amazon, Facebook, Google, or any OpenID Connect-compatible identity provider. - */ - assumeRoleWithWebIdentity(params: sts.AssumeRoleWithWebIdentityParams, callback: (err: any, data: any) => void): void; - - /** - * Creates a credentials object from STS response data containing credentials information. - */ - credentialsFrom(params: sts.CredentialsFromParams, callback: (err: any, data: any) => void): void; - - /** - * Decodes additional information about the authorization status of a request from an encoded message returned in response to an AWS request. - */ - decodeAuthorizationMessage(params: sts.DecodeAuthorizationMessageParams, callback: (err: any, data: any) => void): void; - - /** - * Returns details about the IAM identity whose credentials are used to call the API. - */ - getCallerIdentity(params: {}, callback: (err: any, data: any) => void): void; - - /** - * Returns a set of temporary security credentials (consisting of an access key ID, a secret access key, and a security token) for a federated user. - */ - getFederationToken(params: sts.GetFederationTokenParams, callback: (err: any, data: any) => void): void; - - /** - * Returns a set of temporary credentials for an AWS account or IAM user. - */ - getSessionToken(params: sts.GetSessionTokenParams, callback: (err: any, data: any) => void): void; - -} - -export declare class ECS { - constructor(options?: any); - endpoint: Endpoint; - /** - * Runs and maintains a desired number of tasks from a specified task definition. If the number of tasks running in a service drops below desiredCount, Amazon ECS spawns another instantiation of the task in the specified cluster. To update an existing service, see UpdateService. - */ - createService(params: ecs.CreateServicesParams, callback: (err: any, data: any) => void): void; - /** - * Describes one or more of your clusters. - */ - describeClusters(params: ecs.DescribeClustersParams, callback: (err: any, data: any) => void): void; - /** - * Describes the specified services running in your cluster. - */ - describeServices(params: ecs.DescribeServicesParams, callback: (err: any, data: any) => void): void; - /** - * Describes a specified task or tasks. - */ - describeTasks(params: ecs.DescribeTasksParams, callback: (err: any, data: any) => void): void; - /** - * Describes a task definition. You can specify a family and revision to find information about a specific task definition, or you can simply specify the family to find the latest ACTIVE revision in that family. - */ - describeTaskDefinition(params: ecs.DescribeTaskDefinitionParams, callback: (err: any, data: any) => void): void; - /** - * Registers a new task definition from the supplied family and containerDefinitions. Optionally, you can add data volumes to your containers with the volumes parameter. For more information about task definition parameters and defaults, see Amazon ECS Task Definitions in the Amazon EC2 Container Service Developer Guide. - */ - registerTaskDefinition(params: ecs.RegisterTaskDefinitionParams, callback: (err: any, data: any) => void): void; - /** - * Modifies the desired count, deployment configuration, or task definition used in a service. - */ - updateService(params: ecs.UpdateServiceParams, callback: (err: any, data: any) => void): void; -} - -export declare class DynamoDB { - constructor(options?: any); - endpoint: Endpoint; - createTable(params: any, next: (err: any, data: any) => void): void; - deleteTable(params: any, next: (err: any, data: any) => void): void; -} - -// ========================================================== - -export declare module DynamoDB { - - interface _DDBDC_Generic { - TableName: string; - ExpressionAttributeNames?: { [someKey: string]: string }; - ReturnConsumedCapacity?: "INDEXES" | "TOTAL" | "NONE"; - } - - type _DDBDC_ComparisonOperator = "EQ" | "NE" | "IN" | "LE" | "LT" | "GE" | "GT" | "BETWEEN" | "NOT_NULL" | "NULL" | "CONTAINS" | "NOT_CONTAINS" | "BEGINS_WITH" - type _DDBDC_Keys = { [someKey: string]: any }; - type _DDBDC_KeyComparison = { - [someKey: string]: { - AttributeValueList: any[]; - ComparisonOperator: _DDBDC_ComparisonOperator; - } - }; - - interface _DDBDC_Reader extends _DDBDC_Generic { - ConsistentRead?: boolean; - ProjectionExpression?: string; - AttributesToGet?: string[]; - } - - interface _DDBDC_Writer extends _DDBDC_Generic { - ExpressionAttributeValues?: _DDBDC_Keys; - ReturnItemCollectionMetrics?: "SIZE" | "NONE"; - ReturnValues?: "NONE" | "ALL_OLD" | "UPDATED_OLD" | "ALL_NEW" | "UPDATED_NEW"; - ConditionExpression?: string; - ConditionalOperator?: "AND" | "OR"; - Expected?: { - [someKey: string]: { - AttributeValueList?: any[]; - ComparisonOperator?: _DDBDC_ComparisonOperator; - Exists: boolean; - Value?: any; - } - } - } - - interface UpdateParam extends _DDBDC_Writer { - Key: _DDBDC_Keys; - UpdateExpression?: string; - AttributeUpdates?: { - [someKey: string]: { - Action: "PUT" | "ADD" | "DELETE"; - Value: any - } - } - } - - interface QueryParam extends _DDBDC_Reader { - ConditionalOperator?: "AND" | "OR"; - ExclusiveStartKey?: _DDBDC_Keys; - ExpressionAttributeValues?: _DDBDC_Keys; - FilterExpression?: string; - IndexName?: string; - KeyConditionExpression?: string; - KeyConditions?: _DDBDC_KeyComparison; - Limit?: number; - QueryFilter?: _DDBDC_KeyComparison; - ScanIndexForward?: boolean; - Select?: "ALL_ATTRIBUTES" | "ALL_PROJECTED_ATTRIBUTES" | "SPECIFIC_ATTRIBUTES" | "COUNT"; - } - - interface ScanParam extends QueryParam { - Segment?: number; - ScanFilter?: _DDBDC_KeyComparison; - TotalSegments?: number; - } - - interface GetParam extends _DDBDC_Reader { - Key: _DDBDC_Keys; - } - - interface PutParam extends _DDBDC_Writer { - Item: _DDBDC_Keys; - } - - interface DeleteParam extends _DDBDC_Writer { - Key: _DDBDC_Keys; - } - - export class DocumentClient { - constructor(options?: any); - get(params: GetParam, next: (err: any, data: any) => void): void; - put(params: PutParam, next: (err: any, data: any) => void): void; - delete(params: DeleteParam, next: (err: any, data: any) => void): void; - query(params: QueryParam, next: (err: any, data: any) => void): void; - scan(params: ScanParam, next: (err: any, data: any) => void): void; - update(params: UpdateParam, next: (err: any, data: any) => void): void; - createSet(list: any[], options?: { validate?: boolean }): { values: any[], type: string }; - batchGet(params: any, next: (err: any, data: any) => void): void; - batchWrite(params: any, next: (err: any, data: any) => void): void; - } - -} - -// =========================================================== - -export module CloudFormation { - export interface CancelUpdateStackParams { - StackName: string; - } - - export interface ContinueUpdateRollbackParams { - StackName: string; - } - - export interface CreateChangeSetParams { - StackName: string; - TemplateBody?: string; // specify either TemplateBody or TemplateURL - TemplateURL?: string; // specify either TemplateBody or TemplateURL - UsePreviousTemplate?: boolean; - Parameters?: CloudFormation.Parameter[]; - Capabilities?: string[]; // CAPABILITY_IAM | CAPABILITY_NAMED_IAM - ResourceTypes?: string[]; - NotificationARNs?: string[]; - Tags?: CloudFormation.Tag[]; - ChangeSetName: string; - ClientToken?: string; - Description?: string; - } - - export interface CreateStackParams { - StackName: string; - TemplateBody?: string; // specify either TemplateBody or TemplateURL - TemplateURL?: string; // specify either TemplateBody or TemplateURL - Parameters?: CloudFormation.Parameter[]; - DisableRollback?: boolean; // cannot specify both DisableRollback and OnFailure - TimeoutInMinutes?: number; - NotificationARNs?: string[]; - Capabilities?: string[]; - ResourceTypes?: string[]; - OnFailure?: string[]; // cannot specify both DisableRollback and OnFailure - // DO_NOTHING | ROLLBACK | DELETE - StackPolicyBody?: string; // cannot specify both StackPolicyBody and StackPolicyURL - StackPolicyURL?: string; // cannot specify both StackPolicyBody and StackPolicyURL - Tags?: CloudFormation.Tag[]; - } - - export interface DeleteChangeSetParams { - ChangeSetName: string; - StackName?: string; - } - - export interface DeleteStackParams { - StackName: string; - RetainResources?: string[]; - } - - export interface DescribeAccountLimitsParams { - NextToken?: string; - } - - export interface DescribeChangeSetParams { - ChangeSetName: string; - StackName?: string; - NextToken?: string; - } - - export interface DescribeStackEventsParams { - StackName?: string; - NextToken?: string; - } - - export interface DescribeStackResourceParams { - StackName: string; - LogicalResourceId: string; - } - - export interface DescribeStackResourcesParams { - StackName?: string; // must specify either StackName or PhysicalResourceId - LogicalResourceId?: string; - PhysicalResourceId?: string; // must specify either StackName or PhysicalResourceId - } - - export interface DescribeStacksParams { - StackName?: string; - NextToken?: string; - } - - export interface EstimateTemplateCostParams { - TemplateBody?: string; // must specify either TemplateBody or TemplateURL - // if both are passed, only TemplateBody is used - TemplateURL?: string; // must specify either TemplateBody or TemplateURL - Parameters?: CloudFormation.Parameter[]; - } - - export interface ExecuteChangeSetParams { - ChangeSetName: string; - StackName?: string; - } - - export interface GetStackPolicyParams { - StackName: string; - } - - export interface GetTemplateParams { - StackName: string; - } - - export interface GetTemplateSummaryParams { - // must specify one of the three - TemplateBody?: string; - TemplateURL?: string; - StackName?: string; - } - - export interface ListChangeSetsParams { - StackName: string; - NextToken?: string; - } - - export interface ListStackResourcesParams { - StackName: string; - NextToken?: string; - } - - export interface ListStacksParams { - NextToken?: string; - StackStatusFilter?: string[]; - } - - export interface SetStackPolicyParams { - StackName: string; - StackPolicyBody?: string; // cannot set both StackPolicyBody and StackPolicyURL - StackPolicyURL?: string; // cannot set both StackPolicyBody and StackPolicyURL - } - - export interface SignalResourceParams { - StackName: string; - LogicalResourceId: string; - UniqueId: string; - Status: string; // SUCCESS | FAILURE - } - - export interface UpdateStackParams { - StackName: string; - TemplateBody?: string; // specify either TemplateBody or TemplateURL, not both - TemplateURL?: string; // specify either TemplateBody or TemplateURL, not both - UsePreviousTemplate?: boolean; - StackPolicyDuringUpdateBody?: string; // cannot set both StackPolicyDuringUpdateBody and StackPolicyDuringUpdateURL - StackPolicyDuringUpdateURL?: string; // cannot set both StackPolicyDuringUpdateBody and StackPolicyDuringUpdateURL - Parameters?: CloudFormation.Parameter[]; - Capabilities?: string[]; // CAPABILITY_IAM | CAPABILITY_NAMED_IAM - ResourceTypes?: string[]; - StackPolicyBody?: string; // cannot set both StackPolicyBody and StackPolicyURL - StackPolicyURL?: string; // cannot set both StackPolicyBody and StackPolicyURL - NotificationARNs?: string[]; - Tags?: CloudFormation.Tag[]; - } - - export interface ValidateTemplateParams { - TemplateBody?: string; // must pass either TemplateBody or TemplateURL - // if both are specified, only TemplateBody is used - TemplateURL?: string; // must pass either TemplateBody or TemplateURL - } - - export interface WaitForParams { - StackName: string; - NextToken?: string; - } - - export interface Options { - params?: any; - endpoint?: string; - accessKeyId?: string; - secretAccessKey?: string; - sessionToken?: any; - credentials?: any; - credentialProvider?: any; - region?: string; - maxRetries?: number; - maxRedirects?: number; - sslEnabled?: boolean; - paramValidation?: any; - computeChecksums?: boolean; - convertResponseTypes?: boolean; - correctClockSkew?: boolean; - s3ForcePathStyle?: boolean; - s3BucketEndpoint?: boolean; - s3DisableBodySigning?: boolean; - retryDelayOptions?: any; - httpOptions?: any; - apiVersion?: any; - apiVersions?: any; - logger?: any; - systemClockOffset?: number; - signatureVersion?: string; - signatureCache?: boolean; - } - - export interface Parameter { - ParameterKey: string; - ParameterValue: string; - UsePreviousValue?: boolean; // if you specify true, do not specify ParameterValue - } - - export interface Tag { - Key: string; - Value: string; - } -} - -// =========================================================== - -export declare module Lambda { - export interface AddPermissionParams { - Action: string; - FunctionName: string; - Principal: string; - StatementId: string; - Qualifier?: string; - SourceAccount?: string; - SourceArn?: string; - } - - export interface CreateAliasParams { - FunctionName: string; - FunctionVersion: string; - Name: string; - Description?: string; - } - export interface CreateEventSourceMappingParams { - EventSourceArn: string; - FunctionName: string; - StartingPosition: string; /* TRIM_HORIZON | LATEST */ - BatchSize?: number; - Enabled?: boolean - } - - export interface CreateFunctionParams { - Code: { - S3Bucket?: string; - S3Key?: string; - S3ObjectVersion?: string; - ZipFile?: any; // new Buffer('...') || string; - }, - FunctionName: string; - Handler: string; - Role: string; - Runtime: string; /* 'nodejs | java8 | python2.7', */ - Description?: string; - MemorySize?: number; - Publish?: boolean; - Timeout?: number; - VpcConfig?: { - SecurityGroupIds?: string[]; - SubnetIds?: string[]; - } - } - - export interface DeleteAliasParams { - FunctionName: string; - Name: string; - } - - export interface DeleteEventSourceMappingParams { - UUID: string; - } - - export interface DeleteFunctionParams { - FunctionName: string; - Qualifier?: string; - } - export interface GetAliasParams { - FunctionName: string; - Name: string; - } - - export interface GetEventSourceMappingParams { - UUID: string; - } - - export interface GetFunctionParams { - FunctionName: string; - Qualifier?: string; - } - - export interface GetFunctionConfigurationParams { - FunctionName: string; - Qualifier?: string; - } - - export interface GetPolicyParams { - FunctionName: string; - Qualifier?: string; - } - - export interface InvokeParams { - FunctionName: string; - ClientContext?: string; - InvocationType?: string;/* 'Event | RequestResponse | DryRun' */ - LogType?: string; /* 'None | Tail' */ - Payload?: any; /* new Buffer('...') || string */ - Qualifier?: string; - } - - export interface ListAliasesParams { - FunctionName: string; - FunctionVersion?: string; - Marker?: string; - MaxItems?: number - } - - export interface ListEventSourceMappingsParams { - EventSourceArn?: string; - FunctionName?: string; - Marker?: string; - MaxItems?: number - } - - export interface ListFunctionsParams { - Marker?: string; - MaxItems?: number - } - - export interface ListVersionsByFunctionParams { - FunctionName: string; - Marker?: string; - MaxItems?: number - } - - export interface PublishVersionParams { - FunctionName: string; - CodeSha256?: string; - Description?: string; - } - - export interface RemovePermissionParams { - FunctionName: string; - StatementId: string; - Qualifier?: string; - } - - export interface UpdateAliasParams { - FunctionName: string; - Name: string; - Description?: string; - FunctionVersion?: string; - } - - export interface UpdateEventSourceMappingParams { - UUID: string; - BatchSize?: number; - Enabled?: boolean; - FunctionName?: string; - } - - export interface UpdateFunctionCodeParams { - FunctionName: string; - Publish?: boolean; - S3Bucket?: string; - S3Key?: string; - S3ObjectVersion?: string; - ZipFile?: any; /* new Buffer('...') || string; */ - - } - - export interface UpdateFunctionConfigurationParams { - FunctionName: string; - Description?: string; - Handler?: string; - MemorySize?: number; - Role?: string; - Timeout?: number; - VpcConfig?: { - SecurityGroupIds?: string[]; - SubnetIds?: string[]; - } - } -} - -export module AutoScaling { - export interface AutoScalingOptions { - 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; - s3DisableBodySigning?: boolean; - retryDelayOptions?: RetryDelayOption; - httpOptions?: HttpOptions; - apiVersion?: string; - apiVersions?: { [serviceName: string]: string }; - logger?: Logger; - systemClockOffset?: number; - signatureVersion?: string; - signatureCache?: boolean; - } - - export interface AttachInstancesParams { - AutoScalingGroupName: string; - InstanceIds: string[]; - } - - export interface AttachLoadBalancersParams { - AutoScalingGroupName: string; - LoadBalancerNames: string[]; - } - - export interface AttachLoadBalancerTargetGroupsParams { - AutoScalingGroupName: string; - TargetGroupARNs: string[]; - } - - export interface CompleteLifecycleActionParams { - AutoScalingGroupName: string; - LifecycleActionResult: string; - LifecycleHookName: string; - lifecycleActionToken?: string; - InstanceId?: string; - } - - export interface CreateAutoScalingGroupParams { - AutoScalingGroupName: string; - MinSize: number; - MaxSize: number; - LaunchConfigurationName?: string; - InstanceId?: string; - DesiredCapacity?: number; - DefaultCooldown?: number; - AvailabilityZones?: string[]; - LoadBalancerNames?: string[]; - TargetGroupARNs?: string[]; - HealthCheckType?: string; - HealthCheckGracePeriod?: number; - PlacementGroup?: string; - VPCZoneIdentifier?: string; - TerminationPolicies?: string; - NewInstancesProtectedFromScaleIn?: boolean; - Tags?: Tags; - } - - export interface CreateLaunchConfigurationParams { - LaunchConfigurationName: string; - AssociatePublicIpAddress?: boolean; - ImageId?: string; - KeyName?: string; - SecurityGroups?: string[]; - ClassicLinkVPCId?: string; - ClassicLinkVPCSecurityGroups?: string[]; - UserData?: string; - InstanceId?: string; - InstanceType?: string; - KernelId?: string; - RamdiskId?: string; - BlockDeviceMappings?: BlockDeviceMapping[]; - InstanceMonitoring?: InstanceMonitoring; - SpotPrice?: string; - IamInstanceProfile?: string; - EbsOptimized?: boolean; - PlacementTenancy?: string; - } - - export interface CreateOrUpdateTagsParams { - Tags: Tags[]; - } - - export interface DeleteAutoScalingGroupParams { - AutoScalingGroupName: string; - ForceDelete?: boolean; - } - - export interface DeleteLaunchConfigurationParams { - LaunchConfigurationName: string; - } - - export interface DeleteLifecycleHookParams { - AutoScalingGroupName: string; - LifecycleHookName: string; - } - - export interface DeleteNotificationConfigurationParams { - AutoScalingGroupName: string; - TopicARN: string; - } - - export interface DeletePolicyParams { - PolicyName: string; - AutoScalingGroupName?: string; - } - - export interface DeleteScheduledActionParams { - AutoScalingGroupName: string; - ScheduledActionName: string; - } - - export interface DeleteTagsParams { - Tags: Tags[]; - } - - export interface DescribeAutoScalingGroupsParams { - AutoScalingGroupName?: string; - NextToken?: string; - MaxRecords?: number; - } - - export interface DescribeAutoScalingInstancesParams { - InstanceIds?: string[]; - NextToken?: string; - MaxRecords?: number; - } - - export interface DescribeLaunchConfigurationsParams { - LaunchConfigurationNames?: string[]; - NextToken?: string; - MaxRecords?: number; - } - - export interface DescribeLifecycleHooksParams { - AutoScalingGroupName: string; - LifecycleHookNames?: string[]; - } - - export interface DescribeLoadBalancersParams { - AutoScalingGroupName: string; - NextToken?: string; - MaxRecords?: number; - } - - export interface DescribeLoadBalancerTargetGroupsParams { - AutoScalingGroupName: string; - NextToken?: string; - MaxRecords?: number; - } - - export interface DescribeNotificationConfigurationsParams { - AutoScalingGroupName?: string; - NextToken?: string; - MaxRecords?: number; - } - - export interface DescribePoliciesParams { - AutoScalingGroupName?: string; - PolicyNames?: string[]; - PolicyTypes?: string[]; - NextToken?: string; - MaxRecords?: number; - } - - export interface DescribeScalingActivitiesParams { - AutoScalingGroupName?: string; - ActivityIds?: string[]; - NextToken?: string; - MaxRecords?: number; - } - - export interface DescribeScheduledActionsParams { - AutoScalingGroupName?: string; - ScheduledActionNames?: string[]; - StartTime?: Date; - EndTime?: Date; - NextToken?: string; - MaxRecords?: number; - } - - export interface DescribeTagsParams { - Filters?: Filter[]; - NextToken?: string; - MaxRecords?: number; - } - - export interface DetachInstancesParams { - AutoScalingGroupName: string; - ShouldDecrementDesiredCapacity: boolean; - InstanceIds?: string[]; - } - - export interface DetachLoadBalancersParams { - AutoScalingGroupName: string; - LoadBalancerNames: string; - } - - export interface DetachLoadBalancerTargetGroupsParams { - AutoScalingGroupName: string; - TargetGroupARNs: string[]; - } - - export interface DisableMetricsCollectionParams { - AutoScalingGroupName: string; - Metrics?: string[]; - } - - export interface EnableMetricsCollectionParams { - AutoScalingGroupName: string; - Granularity: string; - Metrics?: string[]; - } - - export interface EnterStandbyParams { - AutoScalingGroupName: string; - ShouldDecrementDesiredCapacity: boolean; - InstanceIds?: string[]; - } - - export interface ExecutePolicyParams { - PolicyName: string; - AutoScalingGroupName?: string; - HonorCooldown?: boolean; - MetricValue?: number; - BreachThreshold?: number; - } - - export interface ExitStandbyParams { - AutoScalingGroupName: string; - InstanceIds?: string[]; - } - - export interface PutLifecycleHookParams { - AutoScalingGroupName: string; - LifecycleHookName: string; - LifecycleTransition?: string; - RoleARN?: string; - NotificationTargetARN?: string; - NotificationMetadata?: string; - HeartbeatTimeout?: number; - DefaultResult?: string; - } - - export interface PutNotificationConfigurationParams { - AutoScalingGroupName: string; - NotificationTypes: string[]; - TopicARN: string; - } - - export interface PutScalingPolicyParams { - AutoScalingGroupName: string; - AdjustmentType: string; - PolicyName: string; - PolicyType?: string; - MinAdjustmentStep?: number; - MinAdjustmentMagnitude?: number; - ScalingAdjustment?: number; - Cooldown?: number; - MetricAggregationType?: string; - StepAdjustments?: StepAdjustment[]; - EstimatedInstanceWarmup: number; - } - - export interface PutScheduledUpdateGroupActionParams { - AutoScalingGroupName: string; - ScheduledActionName: string; - Time?: Date; - StartTime?: Date; - EndTime?: Date; - Recurrence?: string; - MinSize?: number; - MaxSize?: number; - DesiredCapacity?: number; - } - - export interface RecordLifecycleActionHeartbeatParams { - AutoScalingGroupName: string; - LifecycleHookName: string; - LifecycleActionToken?: string; - InstanceId?: string; - } - - export interface ResumeProcessesParams { - AutoScalingGroupName: string; - ScalingProcesses?: string[]; - } - - export interface SetDesiredCapacityParams { - AutoScalingGroupName: string; - DesiredCapacity: number; - HonorCooldown?: boolean; - } - - export interface SetInstanceHealthParams { - HealthStatus: string; - InstanceId: string; - ShouldRespectGracePeriod?: boolean; - } - - export interface SetInstanceProtectionParams { - AutoScalingGroupName: string; - InstanceIds: string[]; - ProtectedFromScaleIn: boolean; - } - - export interface SuspendProcessesParams { - AutoScalingGroupName: string; - ScalingProcesses?: string[]; - } - - export interface TerminateInstanceInAutoScalingGroupParams { - InstanceId: string; - ShouldDecrementDesiredCapacity: boolean; - } - - export interface UpdateAutoScalingGroupParams { - AutoScalingGroupName: string; - LaunchConfigurationName: string; - MinSize: number; - MaxSize: number; - DesiredCapacity: number; - DefaultCooldown: number; - AvailabilityZones: string[]; - HealthCheckType: string; - HealthCheckGracePeriod: number; - PlacementGroup: string; - VPCZoneIdentifier: string; - TerminationPolicies: string[]; - NewInstancesProtectedFromScaleIn?: boolean; - } -} - -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 SendMessageParams { - QueueUrl?: string; - MessageBody: string; - DelaySeconds?: number; - MessageAttributes?: { [name: string]: MessageAttribute; } - } - - export interface ReceiveMessageParams { - QueueUrl: string; - MaxNumberOfMessages?: number; - VisibilityTimeout?: number; - AttributeNames?: string[]; - MessageAttributeNames?: string[]; - WaitTimeSeconds?: number; - } - - export interface DeleteMessageBatchParams { - QueueUrl: string; - Entries: DeleteMessageBatchRequestEntry[]; - } - - export interface DeleteMessageBatchRequestEntry { - Id: string; - ReceiptHandle: string; - } - - export interface DeleteMessageParams { - QueueUrl: string; - ReceiptHandle: string; - } - - export interface SendMessageBatchParams { - QueueUrl: string; - Entries: SendMessageBatchRequestEntry[]; - } - - export interface SendMessageBatchRequestEntry { - Id: string; - MessageBody: string; - DelaySeconds?: number; - MessageAttributes?: { [name: string]: MessageAttribute; } - } - - export interface CreateQueueParams { - QueueName: string; - Attributes: QueueAttributes; - } - - 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 interface ReceiveMessageResult { - Messages: Message[]; - } - - export interface Message { - MessageId: string; - ReceiptHandle: string; - MD5OfBody: string; - Body: string; - Attributes: { [name: string]: any }; - MD5OfMessageAttributes: string; - MessageAttributes: { [name: string]: MessageAttribute; } - } - - 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 interface DeleteMessageBatchResultEntry { - Id: string; - } - - export interface BatchResultErrorEntry { - Id: string; - Code: string; - Message?: string; - SenderFault: boolean; - } - - export interface SendMessageBatchResult { - Successful: SendMessageBatchResultEntry[]; - Failed: BatchResultErrorEntry[]; - } - - export interface SendMessageBatchResultEntry { - Id: string; - MessageId: string; - MD5OfMessageBody: string; - MD5OfMessageAttributes: string; - } - - export interface CreateQueueResult { - QueueUrl: string; - } - - export interface SetQueueAttributesParams { - QueueUrl: string; - Attributes: QueueAttributes; - } - -} - -export declare module SES { - - export interface Client { - config: ClientConfig; - - sendEmail(params: any, callback: (err: any, data: SendEmailResult) => void): void; - } - - export interface SendEmailRequest { - Source: string; - Destination: Destination; - Message: Message; - ReplyToAddresses: string[]; - ReturnPath: string; - } - - export class Destination { - ToAddresses: string[]; - CcAddresses: string[]; - BccAddresses: string[]; - } - - export class Message { - Subject: Content; - Body: Body; - } - - export class Content { - Data: string; - Charset: string; - } - - export class Body { - Text: Content; - Html: Content; - } - - export class SendEmailResult { - MessageId: string; - } - -} - -export declare module Swf { - - export interface Client { - //constructor(options?: any); - config: ClientConfig; - - countClosedWorkflowExecutions(params: any, callback: (err: any, data: any) => void): void; - countOpenWorkflowExecutions(params: any, callback: (err: any, data: any) => void): void; - countPendingActivityTasks(params: any, callback: (err: any, data: any) => void): void; - countPendingDecisionTasks(params: any, callback: (err: any, data: any) => void): void; - deprecateActivityType(params: any, callback: (err: any, data: any) => void): void; - deprecateDomain(params: any, callback: (err: any, data: any) => void): void; - deprecateWorkflowType(params: any, callback: (err: any, data: any) => void): void; - describeActivityType(params: any, callback: (err: any, data: any) => void): void; - describeDomain(params: any, callback: (err: any, data: any) => void): void; - describeWorkflowExecution(params: any, callback: (err: any, data: any) => void): void; - describeWorkflowType(params: any, callback: (err: any, data: any) => void): void; - getWorkflowExecutionHistory(params: any, callback: (err: any, data: any) => void): void; - listActivityTypes(params: any, callback: (err: any, data: any) => void): void; - listClosedWorkflowExecutions(params: any, callback: (err: any, data: any) => void): void; - listDomains(params: any, callback: (err: any, data: any) => void): void; - listOpenWorkflowExecutions(params: any, callback: (err: any, data: any) => void): void; - listWorkflowTypes(params: any, callback: (err: any, data: any) => void): void; - pollForActivityTask(params: any, callback: (err: any, data: ActivityTask) => void): void; - pollForDecisionTask(params: any, callback: (err: any, data: DecisionTask) => void): void; - recordActivityTaskHeartbeat(params: any, callback: (err: any, data: any) => void): void; - registerActivityType(params: any, callback: (err: any, data: any) => void): void; - registerDomain(params: any, callback: (err: any, data: any) => void): void; - registerWorkflowType(params: any, callback: (err: any, data: any) => void): void; - requestCancelWorkflowExecution(params: any, callback: (err: any, data: any) => void): void; - respondActivityTaskCanceled(params: RespondActivityTaskCanceledRequest, callback: (err: any, data: any) => void): void; - respondActivityTaskCompleted(params: RespondActivityTaskCompletedRequest, callback: (err: any, data: any) => void): void; - respondActivityTaskFailed(params: RespondActivityTaskFailedRequest, callback: (err: any, data: any) => void): void; - respondDecisionTaskCompleted(params: RespondDecisionTaskCompletedRequest, callback: (err: any, data: any) => void): void; - signalWorkflowExecution(params: any, callback: (err: any, data: any) => void): void; - startWorkflowExecution(params: any, callback: (err: any, data: StartWorkflowExecutionResult) => void): void; - terminateWorkflowExecution(params: any, callback: (err: any, data: any) => void): void; - } - - export interface PollForActivityTaskRequest { - domain?: string; - taskList?: TaskList; - identity?: string; - } - - export interface TaskList { - name?: string; - } - - export interface PollForDecisionTaskRequest { - domain?: string; - taskList?: TaskList; - identity?: string; - nextPageToken?: string; - maximumPageSize?: number; - reverseOrder?: Boolean; - } - - export interface StartWorkflowExecutionRequest { - domain?: string; - workflowId?: string; - workflowType?: WorkflowType; - taskList?: TaskList; - input?: string; - executionStartToCloseTimeout?: string; - tagList?: string[]; - taskStartToCloseTimeout?: string; - childPolicy?: string; - } - - export interface WorkflowType { - name?: string; - version?: string; - } - - export interface RespondDecisionTaskCompletedRequest { - taskToken?: string; - decisions?: Decision[]; - executionContext?: string; - } - - export interface Decision { - decisionType?: string; - scheduleActivityTaskDecisionAttributes?: ScheduleActivityTaskDecisionAttributes; - requestCancelActivityTaskDecisionAttributes?: RequestCancelActivityTaskDecisionAttributes; - completeWorkflowExecutionDecisionAttributes?: CompleteWorkflowExecutionDecisionAttributes; - failWorkflowExecutionDecisionAttributes?: FailWorkflowExecutionDecisionAttributes; - cancelWorkflowExecutionDecisionAttributes?: CancelWorkflowExecutionDecisionAttributes; - continueAsNewWorkflowExecutionDecisionAttributes?: ContinueAsNewWorkflowExecutionDecisionAttributes; - recordMarkerDecisionAttributes?: RecordMarkerDecisionAttributes; - startTimerDecisionAttributes?: StartTimerDecisionAttributes; - cancelTimerDecisionAttributes?: CancelTimerDecisionAttributes; - signalExternalWorkflowExecutionDecisionAttributes?: SignalExternalWorkflowExecutionDecisionAttributes; - requestCancelExternalWorkflowExecutionDecisionAttributes?: RequestCancelExternalWorkflowExecutionDecisionAttributes; - startChildWorkflowExecutionDecisionAttributes?: StartChildWorkflowExecutionDecisionAttributes; - } - - export interface ScheduleActivityTaskDecisionAttributes { - activityType?: ActivityType; - activityId?: string; - control?: string; - input?: string; - scheduleToCloseTimeout?: string; - taskList?: TaskList; - scheduleToStartTimeout?: string; - startToCloseTimeout?: string; - heartbeatTimeout?: string; - } - - export interface ActivityType { - name?: string; - version?: string; - } - - export interface RequestCancelActivityTaskDecisionAttributes { - activityId?: string; - } - - export interface CompleteWorkflowExecutionDecisionAttributes { - result?: string; - } - - export interface FailWorkflowExecutionDecisionAttributes { - reason?: string; - details?: string; - } - - export interface CancelWorkflowExecutionDecisionAttributes { - details?: string; - } - - export interface ContinueAsNewWorkflowExecutionDecisionAttributes { - input?: string; - executionStartToCloseTimeout?: string; - taskList?: TaskList; - taskStartToCloseTimeout?: string; - childPolicy?: string; - tagList?: string[]; - workflowTypeVersion?: string; - } - - export interface RecordMarkerDecisionAttributes { - markerName?: string; - details?: string; - } - - export interface StartTimerDecisionAttributes { - timerId?: string; - control?: string; - startToFireTimeout?: string; - } - - export interface CancelTimerDecisionAttributes { - timerId?: string; - } - - export interface SignalExternalWorkflowExecutionDecisionAttributes { - workflowId?: string; - runId?: string; - signalName?: string; - input?: string; - control?: string; - } - - export interface RequestCancelExternalWorkflowExecutionDecisionAttributes { - workflowId?: string; - runId?: string; - control?: string; - } - - export interface StartChildWorkflowExecutionDecisionAttributes { - workflowType?: WorkflowType; - workflowId?: string; - control?: string; - input?: string; - executionStartToCloseTimeout?: string; - taskList?: TaskList; - taskStartToCloseTimeout?: string; - childPolicy?: string; - tagList?: string[]; - } - - export interface RespondActivityTaskCompletedRequest { - taskToken?: string; - result?: string; - } - - export interface RespondActivityTaskFailedRequest { - taskToken?: string; - reason?: string; - details?: string; - } - - export interface RespondActivityTaskCanceledRequest { - taskToken?: string; - details?: string; - } - - export interface DecisionTask { - taskToken?: string; - startedEventId?: number; - workflowExecution?: WorkflowExecution; - workflowType?: WorkflowType; - events?: HistoryEvent[]; - nextPageToken?: string; - previousStartedEventId?: number; - } - - export interface WorkflowExecution { - workflowId?: string; - runId?: string; - } - - export interface HistoryEvent { - eventTimestamp?: any; - eventType?: string; - eventId?: number; - workflowExecutionStartedEventAttributes?: WorkflowExecutionStartedEventAttributes; - workflowExecutionCompletedEventAttributes?: WorkflowExecutionCompletedEventAttributes; - completeWorkflowExecutionFailedEventAttributes?: CompleteWorkflowExecutionFailedEventAttributes; - workflowExecutionFailedEventAttributes?: WorkflowExecutionFailedEventAttributes; - failWorkflowExecutionFailedEventAttributes?: FailWorkflowExecutionFailedEventAttributes; - workflowExecutionTimedOutEventAttributes?: WorkflowExecutionTimedOutEventAttributes; - workflowExecutionCanceledEventAttributes?: WorkflowExecutionCanceledEventAttributes; - cancelWorkflowExecutionFailedEventAttributes?: CancelWorkflowExecutionFailedEventAttributes; - workflowExecutionContinuedAsNewEventAttributes?: WorkflowExecutionContinuedAsNewEventAttributes; - continueAsNewWorkflowExecutionFailedEventAttributes?: ContinueAsNewWorkflowExecutionFailedEventAttributes; - workflowExecutionTerminatedEventAttributes?: WorkflowExecutionTerminatedEventAttributes; - workflowExecutionCancelRequestedEventAttributes?: WorkflowExecutionCancelRequestedEventAttributes; - decisionTaskScheduledEventAttributes?: DecisionTaskScheduledEventAttributes; - decisionTaskStartedEventAttributes?: DecisionTaskStartedEventAttributes; - decisionTaskCompletedEventAttributes?: DecisionTaskCompletedEventAttributes; - decisionTaskTimedOutEventAttributes?: DecisionTaskTimedOutEventAttributes; - activityTaskScheduledEventAttributes?: ActivityTaskScheduledEventAttributes; - activityTaskStartedEventAttributes?: ActivityTaskStartedEventAttributes; - activityTaskCompletedEventAttributes?: ActivityTaskCompletedEventAttributes; - activityTaskFailedEventAttributes?: ActivityTaskFailedEventAttributes; - activityTaskTimedOutEventAttributes?: ActivityTaskTimedOutEventAttributes; - activityTaskCanceledEventAttributes?: ActivityTaskCanceledEventAttributes; - activityTaskCancelRequestedEventAttributes?: ActivityTaskCancelRequestedEventAttributes; - workflowExecutionSignaledEventAttributes?: WorkflowExecutionSignaledEventAttributes; - markerRecordedEventAttributes?: MarkerRecordedEventAttributes; - timerStartedEventAttributes?: TimerStartedEventAttributes; - timerFiredEventAttributes?: TimerFiredEventAttributes; - timerCanceledEventAttributes?: TimerCanceledEventAttributes; - startChildWorkflowExecutionInitiatedEventAttributes?: StartChildWorkflowExecutionInitiatedEventAttributes; - childWorkflowExecutionStartedEventAttributes?: ChildWorkflowExecutionStartedEventAttributes; - childWorkflowExecutionCompletedEventAttributes?: ChildWorkflowExecutionCompletedEventAttributes; - childWorkflowExecutionFailedEventAttributes?: ChildWorkflowExecutionFailedEventAttributes; - childWorkflowExecutionTimedOutEventAttributes?: ChildWorkflowExecutionTimedOutEventAttributes; - childWorkflowExecutionCanceledEventAttributes?: ChildWorkflowExecutionCanceledEventAttributes; - childWorkflowExecutionTerminatedEventAttributes?: ChildWorkflowExecutionTerminatedEventAttributes; - signalExternalWorkflowExecutionInitiatedEventAttributes?: SignalExternalWorkflowExecutionInitiatedEventAttributes; - externalWorkflowExecutionSignaledEventAttributes?: ExternalWorkflowExecutionSignaledEventAttributes; - signalExternalWorkflowExecutionFailedEventAttributes?: SignalExternalWorkflowExecutionFailedEventAttributes; - externalWorkflowExecutionCancelRequestedEventAttributes?: ExternalWorkflowExecutionCancelRequestedEventAttributes; - requestCancelExternalWorkflowExecutionInitiatedEventAttributes?: RequestCancelExternalWorkflowExecutionInitiatedEventAttributes; - requestCancelExternalWorkflowExecutionFailedEventAttributes?: RequestCancelExternalWorkflowExecutionFailedEventAttributes; - scheduleActivityTaskFailedEventAttributes?: ScheduleActivityTaskFailedEventAttributes; - requestCancelActivityTaskFailedEventAttributes?: RequestCancelActivityTaskFailedEventAttributes; - startTimerFailedEventAttributes?: StartTimerFailedEventAttributes; - cancelTimerFailedEventAttributes?: CancelTimerFailedEventAttributes; - startChildWorkflowExecutionFailedEventAttributes?: StartChildWorkflowExecutionFailedEventAttributes; - } - - export interface WorkflowExecutionStartedEventAttributes { - input?: string; - executionStartToCloseTimeout?: string; - taskStartToCloseTimeout?: string; - childPolicy?: string; - taskList?: TaskList; - workflowType?: WorkflowType; - tagList?: string[]; - continuedExecutionRunId?: string; - parentWorkflowExecution?: WorkflowExecution; - parentInitiatedEventId?: number; - } - - export interface WorkflowExecutionCompletedEventAttributes { - result?: string; - decisionTaskCompletedEventId?: number; - } - - export interface CompleteWorkflowExecutionFailedEventAttributes { - cause?: string; - decisionTaskCompletedEventId?: number; - } - - export interface WorkflowExecutionFailedEventAttributes { - reason?: string; - details?: string; - decisionTaskCompletedEventId?: number; - } - - export interface FailWorkflowExecutionFailedEventAttributes { - cause?: string; - decisionTaskCompletedEventId?: number; - } - - export interface WorkflowExecutionTimedOutEventAttributes { - timeoutType?: string; - childPolicy?: string; - } - - export interface WorkflowExecutionCanceledEventAttributes { - details?: string; - decisionTaskCompletedEventId?: number; - } - - export interface CancelWorkflowExecutionFailedEventAttributes { - cause?: string; - decisionTaskCompletedEventId?: number; - } - - export interface WorkflowExecutionContinuedAsNewEventAttributes { - input?: string; - decisionTaskCompletedEventId?: number; - newExecutionRunId?: string; - executionStartToCloseTimeout?: string; - taskList?: TaskList; - taskStartToCloseTimeout?: string; - childPolicy?: string; - tagList?: string[]; - workflowType?: WorkflowType; - } - - export interface ContinueAsNewWorkflowExecutionFailedEventAttributes { - cause?: string; - decisionTaskCompletedEventId?: number; - } - - export interface WorkflowExecutionTerminatedEventAttributes { - reason?: string; - details?: string; - childPolicy?: string; - cause?: string; - } - - export interface WorkflowExecutionCancelRequestedEventAttributes { - externalWorkflowExecution?: WorkflowExecution; - externalInitiatedEventId?: number; - cause?: string; - } - - export interface DecisionTaskScheduledEventAttributes { - taskList?: TaskList; - startToCloseTimeout?: string; - } - - export interface DecisionTaskStartedEventAttributes { - identity?: string; - scheduledEventId?: number; - } - - export interface DecisionTaskCompletedEventAttributes { - executionContext?: string; - scheduledEventId?: number; - startedEventId?: number; - } - - export interface DecisionTaskTimedOutEventAttributes { - timeoutType?: string; - scheduledEventId?: number; - startedEventId?: number; - } - - export interface ActivityTaskScheduledEventAttributes { - activityType?: ActivityType; - activityId?: string; - input?: string; - control?: string; - scheduleToStartTimeout?: string; - scheduleToCloseTimeout?: string; - startToCloseTimeout?: string; - taskList?: TaskList; - decisionTaskCompletedEventId?: number; - heartbeatTimeout?: string; - } - - export interface ActivityTaskStartedEventAttributes { - identity?: string; - scheduledEventId?: number; - } - - export interface ActivityTaskCompletedEventAttributes { - result?: string; - scheduledEventId?: number; - startedEventId?: number; - } - - export interface ActivityTaskFailedEventAttributes { - reason?: string; - details?: string; - scheduledEventId?: number; - startedEventId?: number; - } - - export interface ActivityTaskTimedOutEventAttributes { - timeoutType?: string; - scheduledEventId?: number; - startedEventId?: number; - details?: string; - } - - export interface ActivityTaskCanceledEventAttributes { - details?: string; - scheduledEventId?: number; - startedEventId?: number; - latestCancelRequestedEventId?: number; - } - - export interface ActivityTaskCancelRequestedEventAttributes { - decisionTaskCompletedEventId?: number; - activityId?: string; - } - - export interface WorkflowExecutionSignaledEventAttributes { - signalName?: string; - input?: string; - externalWorkflowExecution?: WorkflowExecution; - externalInitiatedEventId?: number; - } - - export interface MarkerRecordedEventAttributes { - markerName?: string; - details?: string; - decisionTaskCompletedEventId?: number; - } - - export interface TimerStartedEventAttributes { - timerId?: string; - control?: string; - startToFireTimeout?: string; - decisionTaskCompletedEventId?: number; - } - - export interface TimerFiredEventAttributes { - timerId?: string; - startedEventId?: number; - } - - export interface TimerCanceledEventAttributes { - timerId?: string; - startedEventId?: number; - decisionTaskCompletedEventId?: number; - } - - export interface StartChildWorkflowExecutionInitiatedEventAttributes { - workflowId?: string; - workflowType?: WorkflowType; - control?: string; - input?: string; - executionStartToCloseTimeout?: string; - taskList?: TaskList; - decisionTaskCompletedEventId?: number; - childPolicy?: string; - taskStartToCloseTimeout?: string; - tagList?: string[]; - } - - export interface ChildWorkflowExecutionStartedEventAttributes { - workflowExecution?: WorkflowExecution; - workflowType?: WorkflowType; - initiatedEventId?: number; - } - - export interface ChildWorkflowExecutionCompletedEventAttributes { - workflowExecution?: WorkflowExecution; - workflowType?: WorkflowType; - result?: string; - initiatedEventId?: number; - startedEventId?: number; - } - - export interface ChildWorkflowExecutionFailedEventAttributes { - workflowExecution?: WorkflowExecution; - workflowType?: WorkflowType; - reason?: string; - details?: string; - initiatedEventId?: number; - startedEventId?: number; - } - - export interface ChildWorkflowExecutionTimedOutEventAttributes { - workflowExecution?: WorkflowExecution; - workflowType?: WorkflowType; - timeoutType?: string; - initiatedEventId?: number; - startedEventId?: number; - } - - export interface ChildWorkflowExecutionCanceledEventAttributes { - workflowExecution?: WorkflowExecution; - workflowType?: WorkflowType; - details?: string; - initiatedEventId?: number; - startedEventId?: number; - } - - export interface ChildWorkflowExecutionTerminatedEventAttributes { - workflowExecution?: WorkflowExecution; - workflowType?: WorkflowType; - initiatedEventId?: number; - startedEventId?: number; - } - - export interface SignalExternalWorkflowExecutionInitiatedEventAttributes { - workflowId?: string; - runId?: string; - signalName?: string; - input?: string; - decisionTaskCompletedEventId?: number; - control?: string; - } - - export interface ExternalWorkflowExecutionSignaledEventAttributes { - workflowExecution?: WorkflowExecution; - initiatedEventId?: number; - } - - export interface SignalExternalWorkflowExecutionFailedEventAttributes { - workflowId?: string; - runId?: string; - cause?: string; - initiatedEventId?: number; - decisionTaskCompletedEventId?: number; - control?: string; - } - - export interface ExternalWorkflowExecutionCancelRequestedEventAttributes { - workflowExecution?: WorkflowExecution; - initiatedEventId?: number; - } - - export interface RequestCancelExternalWorkflowExecutionInitiatedEventAttributes { - workflowId?: string; - runId?: string; - decisionTaskCompletedEventId?: number; - control?: string; - } - - export interface RequestCancelExternalWorkflowExecutionFailedEventAttributes { - workflowId?: string; - runId?: string; - cause?: string; - initiatedEventId?: number; - decisionTaskCompletedEventId?: number; - control?: string; - } - - export interface ScheduleActivityTaskFailedEventAttributes { - activityType?: ActivityType; - activityId?: string; - cause?: string; - decisionTaskCompletedEventId?: number; - } - - export interface RequestCancelActivityTaskFailedEventAttributes { - activityId?: string; - cause?: string; - decisionTaskCompletedEventId?: number; - } - - export interface StartTimerFailedEventAttributes { - timerId?: string; - cause?: string; - decisionTaskCompletedEventId?: number; - } - - export interface CancelTimerFailedEventAttributes { - timerId?: string; - cause?: string; - decisionTaskCompletedEventId?: number; - } - - export interface StartChildWorkflowExecutionFailedEventAttributes { - workflowType?: WorkflowType; - cause?: string; - workflowId?: string; - initiatedEventId?: number; - decisionTaskCompletedEventId?: number; - control?: string; - } - - export interface ActivityTask { - taskToken?: string; - activityId?: string; - startedEventId?: number; - workflowExecution?: WorkflowExecution; - activityType?: ActivityType; - input?: string; - } - - export interface PollForActivityTaskResult { - activityTask?: ActivityTask; - } - - export interface PollForDecisionTaskResult { - decisionTask?: DecisionTask; - } - - export interface StartWorkflowExecutionResult { - run?: Run; - } - - export interface Run { - runId?: string; - } - -} - -export declare module Sns { - - export interface Client { - config: ClientConfig; - - publish(params: PublishRequest, callback: (err: any, data: PublishResult) => void): void; - createTopic(params: CreateTopicRequest, callback: (err: any, data: CreateTopicResult) => void): void; - deleteTopic(params: DeleteTopicRequest, callback: (err: any, data: any) => void): void; - } - - export interface PublishRequest { - TopicArn?: string; - TargetArn?: string; - MessageAttributes?: { [name: string]: MessageAttribute; }; - Message?: string; - MessageStructure?: string; - Subject?: string; - } - - export interface MessageAttribute { - DataType: string; - StringValue?: string; - BinaryValue: any; // (Buffer, Typed Array, Blob, String) - } - - export interface PublishResult { - MessageId?: string; - } - - export interface CreateTopicRequest { - Name?: string; - } - - export interface CreateTopicResult { - TopicArn?: string; - } - - export interface DeleteTopicRequest { - TopicArn?: string; - } - -} - -export declare module s3 { - interface Owner { - DisplayName: string; - ID: string; - } - - interface ObjectKeyPrefix { - Prefix: string; - } - - export interface ListObjectContent { - Key: string; - LastModified: Date; - ETag: string; - Size: number; - StorageClass: "STANDARD" | "REDUCED_REDUNDANCY" | "GLACIER"; - Owner?: Owner - } - - // This private interface contains the common parts between v1 and v2 of the API Request and is exposed via V1 and V2 subclasses - interface ListObjectRequestBase { - Bucket: string; - Delimiter?: string; - EncodingType?: 'url'; - MaxKeys?: number; - Prefix?: string; - } - - // This private interface contains the common parts between v1 and v2 of the API Response and is exposed via V1 and V2 subclasses - interface ListObjectResponseBase { - IsTruncated: boolean; - Contents: ListObjectContent[]; - Name: string; - Prefix?: string; - Delimiter?: string; - MaxKeys: number; - CommonPrefixes?: ObjectKeyPrefix[]; - EncodingType?: "url"; - } - - export interface PutObjectRequest { - ACL?: string; - Body?: any; - Bucket: string; - CacheControl?: string; - ContentDisposition?: string; - ContentEncoding?: string; - ContentLanguage?: string; - ContentLength?: string; - ContentMD5?: string; - ContentType?: string; - Expires?: any; - GrantFullControl?: string; - GrantRead?: string; - GrantReadACP?: string; - GrantWriteACP?: string; - Key: string; - Metadata?: { [key: string]: string; }; - ServerSideEncryption?: string; - StorageClass?: string; - WebsiteRedirectLocation?: string; - } - - export interface CopyObjectRequest { - Bucket: string; - CopySource: string; - Key: string; - ACL?: string; - CacheControl?: string; - ContentDisposition?: string; - ContentEncoding?: string; - ContentLanguage?: string; - ContentType?: string; - CopySourceIfMatch?: string; - CopySourceIfModifiedSince?: any; - CopySourceIfNoneMatch?: string; - CopySourceIfUnmodifiedSince?: any; - CopySourceSSECustomerAlgorithm?: string; - CopySourceSSECustomerKey?: any; - CopySourceSSECustomerKeyMD5?: string; - Expires?: any; - GrantFullControl?: string; - GrantRead?: string; - GrantReadACP?: string; - GrantWriteACP?: string; - Metadata?: { [key: string]: string; }; - MetadataDirective?: string; - RequestPayer?: string; - SSECustomerAlgorithm?: string; - SSECustomerKey?: any; - SSECustomerKeyMD5?: string; - SSEKMSKeyId?: string; - ServerSideEncryption?: string; - StorageClass?: string; - WebsiteRedirectLocation?: string; - } - - export interface GetObjectRequest { - Bucket: string; - IfMatch?: string; - IfModifiedSince?: any; - IfNoneMatch?: string; - IfUnmodifiedSince?: any; - Key: string; - Range?: string; - ResponseCacheControl?: string; - ResponseContentDisposition?: string; - ResponseContentEncoding?: string; - ResponseContentLanguage?: string; - ResponseContentType?: string; - ResponseExpires?: any; - VersionId?: string; - } - - export interface DeleteObjectRequest { - Bucket: string; - Key: string; - MFA?: string; - RequestPayer?: string; - VersionId?: string; - } - - export interface HeadObjectRequest { - Bucket: string; - Key: string; - IfMatch?: string; - IfModifiedSince?: Date; - IfNoneMatch?: string; - IfUnmodifiedSince?: Date; - Range?: string; - RequestPayer?: string; - SSECustomerAlgorithm?: string; - SSECustomerKey?: Buffer | string; - SSECustomerKeyMD5?: string; - VersionId?: string; - } - - export interface UploadOptions { - partSize?: number; - queueSize?: number; - } - - export interface ListObjectRequest extends ListObjectRequestBase { - Marker?: string; - } - - export interface ListObjectV2Request extends ListObjectRequestBase { - ContinuationToken?: string; - FetchOwner?: boolean; - StartAfter?: string; - } - - export interface ListObjectResponse extends ListObjectResponseBase { - Marker?: string; - NextMarker?: string; - } - - export interface ListObjectV2Response extends ListObjectResponseBase { - KeyCount: number; - ContinuationToken?: string; - NextContinuationToken?: string; - StartAfter?: string; - } -} - -export declare 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 { - /** - * A list of services to describe. - */ - services: string[]; - /** - * The name of the cluster that hosts the service to describe. If you do not specify a cluster, the default cluster is assumed. - */ - cluster?: string; - } - - export interface DescribeClustersParams { - /** - * A space-separated list of cluster names or full cluster Amazon Resource Name (ARN) entries. If you do not specify a cluster, the default cluster is assumed. - */ - clusters?: string[]; - } - - export interface DescribeTasksParams { - /** - * A space-separated list of task IDs or full Amazon Resource Name (ARN) entries. - */ - tasks: string[]; - /** - * The short name or full Amazon Resource Name (ARN) of the cluster that hosts the task to describe. If you do not specify a cluster, the default cluster is assumed. - */ - cluster?: string; - } - - export interface DescribeTaskDefinitionParams { - /** - * The `family` for the latest `ACTIVE` revision, `family` and `revision` (`family:revision`) for a specific revision in the family, or full Amazon Resource Name (ARN) of the task definition to describe. - */ - 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; - } -} - -export module sts { - export interface AssumeRoleParams { - RoleArn: string; - RoleSessionName: string; - DurationSeconds?: number; - ExternalId?: string; - Policy?: string; - SerialNumber?: string; - TokenCode?: string; - } - - export interface AssumeRoleCallbackData { - Credentials: TemporaryCredentials; - AssumedRoleUser: AssumedRoleUser; - PackedPolicySize: number; - } - - export interface TemporaryCredentials { - AccessKeyId: string; - SecretAccessKey: string; - SessionToken: string; - Expiration: Date; - } - - export interface AssumedRoleUser { - AssumedRoleId: string; - Arn: string; - } - - export interface AssumeRoleWithSAMLParams { - PrincipalArn: string; - RoleArn: string; - SAMLAssertion: string; - DurationSeconds?: number; - Policy?: string; - } - - export interface AssumeRoleWithWebIdentityParams { - RoleArn: string; - RoleSessionName: string; - WebIdentityToken: string; - DurationSeconds?: number; - Policy?: string; - ProviderId?: string; - } - - export interface CredentialsFromParams { - /** - * Data retrieved from a call to AWS.STS.getFederatedToken, getSessionToken(), assumeRole(), or assumeRoleWithWebIdentity(). - */ - Data: any; - /** - * An optional credentials object to fill instead of creating a new object. Useful when modifying an existing credentials object from a refresh call. - */ - Credentials?: Credentials - } - - export interface DecodeAuthorizationMessageParams { - EncodedMessage: string; - } - - export interface GetFederationTokenParams { - Name: string; - DurationSeconds?: number, - Policy?: string - } - - export interface GetSessionTokenParams { - DurationSeconds: number, - SerialNumber: string; - TokenCode: string; - } -} diff --git a/aws-sdk/tsconfig.json b/aws-sdk/tsconfig.json deleted file mode 100644 index 8183276533..0000000000 --- a/aws-sdk/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "aws-sdk-tests.ts" - ] -} \ No newline at end of file diff --git a/aws-serverless-express/index.d.ts b/aws-serverless-express/index.d.ts deleted file mode 100644 index e4601e6ccd..0000000000 --- a/aws-serverless-express/index.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Type definitions for aws-serverless-express -// Project: https://github.com/awslabs/aws-serverless-express -// Definitions by: Ben Speakman -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// -import * as http from 'http'; -import * as lambda from 'aws-lambda'; - -export function createServer( - requestListener: (request: http.IncomingMessage, response: http.ServerResponse) => http.Server, - serverListenCallback?: () => any -): http.Server; - -export function proxy( - server: http.Server, - event: any, - context: lambda.Context -): void; \ No newline at end of file diff --git a/aws-serverless-express/tsconfig.json b/aws-serverless-express/tsconfig.json deleted file mode 100644 index a62cead1a1..0000000000 --- a/aws-serverless-express/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "aws-serverless-express-tests.ts" - ] -} \ No newline at end of file diff --git a/axe-core/axe-core-tests.ts b/axe-core/axe-core-tests.ts deleted file mode 100644 index 2ed759bba5..0000000000 --- a/axe-core/axe-core-tests.ts +++ /dev/null @@ -1,90 +0,0 @@ - -var context:any = document -var $fixture:any = {} - -// axe.a11yCheck config -axe.a11yCheck(context, {}, (results) => { - // axe's results object - console.log(results.passes.length) - console.log(results.violations.length) -}); -// axe.a11yCheck include/exclude -axe.a11yCheck({include: [['#id1'], ['#id2']]}, {}, (results) => { - console.log(results) -}) -axe.a11yCheck({exclude: [$fixture[0]]}, {}, (results) => { - console.log(results) -}) -var tagConfigRunOnly: axe.RunOnly = { - type: 'tag', - values: ['wcag2a'] -} -var tagConfig = { - runOnly: tagConfigRunOnly -} -axe.a11yCheck(context, tagConfig, (results) => { - console.log(results) -}) -var includeExcludeTagsRunOnly: axe.RunOnly = { - type: 'tags', - value: { - include: ['wcag2a', 'wcag2aa'], - exclude: ['experimental'] - } -} -var includeExcludeTagsConfig = { - runOnly: includeExcludeTagsRunOnly -} -axe.a11yCheck(context, includeExcludeTagsConfig, (results) => { - console.log(results) -}) -var someRulesConfig = { - rules: { - "color-contrast": {enabled: 'false'}, - "heading-order": {enabled: 'true'} - } -} -axe.a11yCheck(context, someRulesConfig, (results) => { - console.log(results) -}) - -// axe.configure -var spec: axe.Spec = { - branding: { - brand: 'foo', - application: 'bar' - }, - reporter: 'v1', - checks: [{ - id: 'custom-check', - evaluate: function() { - return true - } - }], - rules: [{ - id: 'custom-rule', - any: ['custom-check'] - }] -} -axe.configure(spec) - -axe.reset() - -axe.getRules(['wcag2aa']) -typeof axe.getRules() === 'object' - -// Plugins -var pluginSrc: axe.AxePlugin = { - id: 'doStuff', - run: (data:any, callback:Function) => { - callback() - }, - commands: [{ - id: 'run-doStuff', - callback: (data:any, callback:Function) => { - axe.plugins['doStuff'].run(data, callback) - } - }] -} -axe.registerPlugin(pluginSrc) -axe.cleanup() diff --git a/axe-core/index.d.ts b/axe-core/index.d.ts deleted file mode 100644 index 98818e75cc..0000000000 --- a/axe-core/index.d.ts +++ /dev/null @@ -1,159 +0,0 @@ -// Type definitions for axe-core 2.0.5 -// Project: https://github.com/dequelabs/axe-core -// Definitions by: Marcy Sutton -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare namespace axe { - - export type ImpactValue = "minor" | "moderate" | "serious" | "critical"; - - export type TagValue = "wcag2a" | "wcag2aa" | "section508" | "best-practice"; - - export type ReporterVersion = "v1" | "v2"; - - export type RunOnlyType = "rule" | "rules" | "tag" | "tags"; - - export interface ElementContext { - node?: Object, - selector?: string, - include?: any[], - exclude?: any[] - } - export interface RunOnly { - type: RunOnlyType, - value?: { - include?: string[], - exclude?: string[] - } - values?: TagValue[] - } - export interface AxeResults { - url: string, - timestamp: string, - passes: Pass[], - violations: Violation[] - } - export interface Pass { - description: string, - help: string, - helpUrl: string, - id: string, - impact: ImpactValue, - tags: TagValue[], - nodes: NodeResult[] - } - export interface Violation { - description: string, - help: string, - helpUrl: string, - id: string, - impact: ImpactValue, - tags: TagValue[], - nodes: NodeResult[] - } - export interface NodeResult { - html: string, - impact: ImpactValue, - target: string[], - any: CheckResult[], - all: CheckResult[], - none: CheckResult[] - } - export interface CheckResult { - id: string, - impact: string, - message: string, - data: any, - relatedNodes?: RelatedNode[] - } - export interface RelatedNode { - target: string[], - html: string - } - export interface Spec { - branding?: { - brand: string, - application: string - }, - reporter?: ReporterVersion, - checks?: Check[], - rules?: Rule[] - } - export interface Check { - id: string, - evaluate: Function, - after?: Function, - options?: any, - matches?: string, - enabled?: boolean - } - export interface Rule { - id: string, - selector?: string, - excludeHidden?: boolean, - enabled?: boolean, - pageLevel?: boolean, - any?: string[], - all?: string[], - none?: string[], - tags?: string[], - matches?: string - } - export interface AxePlugin { - id: string, - run(...args:any[]): any, - commands: { - id: string, - callback(...args:any[]): void - }[], - cleanup?(callback:Function): void - } - - export let plugins: any - - /** - * Starts analysis on the current document and its subframes - * - * @param {Object} context The `Context` specification object @see Context - * @param {Array} options Options passed into rules or checks, temporarily modifyint them. - * @param {Function} callback The function to invoke when analysis is complete. - * @returns {Object} results The aXe results object - */ - export function a11yCheck(context: ElementContext, options: {runOnly?: RunOnly, rules?: Object}, callback: (results:AxeResults) => void): AxeResults - - /** - * Method for configuring the data format used by aXe. Helpful for adding new - * rules, which must be registered with the library to execute. - * @param {Spec} Spec Object with valid `branding`, `reporter`, `checks` and `rules` data - */ - export function configure(spec: Spec): void - - /** - * Searches and returns rules that contain a tag in the list of tags. - * @param {Array} tags Optional array of tags - * @return {Array} Array of rules - */ - export function getRules(tags?: string[]): Object[] - - /** - * Restores the default axe configuration - */ - export function reset(): void - - /** - * Function to register a plugin configuration in document and its subframes - * @param {Object} plugin A plugin configuration object - */ - export function registerPlugin(plugin: AxePlugin): void - - /** - * Function to clean up plugin configuration in document and its subframes - */ - export function cleanup(): void - -} - -// axe is also available as a module -declare module "axe-core" { - export = axe; -} diff --git a/axe-core/tsconfig.json b/axe-core/tsconfig.json deleted file mode 100644 index 5b6183c592..0000000000 --- a/axe-core/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "axe-core-tests.ts" - ] -} \ No newline at end of file diff --git a/azure-mobile-apps/azure-mobile-apps-tests.ts b/azure-mobile-apps/azure-mobile-apps-tests.ts deleted file mode 100644 index d653e0ae95..0000000000 --- a/azure-mobile-apps/azure-mobile-apps-tests.ts +++ /dev/null @@ -1,125 +0,0 @@ - - -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: '' - }, - webhook: { url: 'http://localhost/' } -}); - -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'); - -// ensure the mobile app instance can be correctly mounted as an express router -app.use(mobileApp); - -// 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) {}); - context.next(new Error()); - context.next('An error occurred'); -}); -table.read.use(function () {}); -table.read.use([function () {}, function () {}]); -table.read.use(function () {}, function () {}); -table.use(function () {}).use(function () {}).read(function () {}).use(function () {}); - -table.access = undefined; -table.access = 'authenticated'; -table.read.access = 'anonymous'; -table.update.access = 'disabled'; -table.delete.access = 'authenticated'; -table.insert.access = 'authenticated'; - -table.filters = [function (query, context) { }]; -table.transforms = [function (item, context) { }]; -table.hooks = [function (results, context) { }]; - -table.perUser = true; -table.recordsExpire = { milliseconds: 1, seconds: 1, minutes: 1, hours: 1, days: 1, weeks: 1, months: 1, years: 1 }; -table.webhook = { url: 'http://localhost/' } -table.webhook = true; - -// 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) {}); - -// ApiDefinition, from the static require('azure-mobile-apps').api() -var api2 = mobileApps.api({ - get: function (req, res, next) { } -}); -api2.post = function (req, res, next) {}; - -// 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').includeDeleted().includeTotalCount(); -mobileApps.query.create('table'); - -// Custom SQL query -mobileApp.api.add('query', { authorize: true, get: (req, res, next) => { - req.azureMobile.data.execute({ - sql: "SELECT * FROM TODOITEM WHERE COMPLETE = :complete", - parameters: [ - { name: 'complete', value: 1 } - ] - }).then(x => {}); -}, delete: function () {} }); diff --git a/azure-mobile-apps/index.d.ts b/azure-mobile-apps/index.d.ts deleted file mode 100644 index 53dd5edae3..0000000000 --- a/azure-mobile-apps/index.d.ts +++ /dev/null @@ -1,326 +0,0 @@ -// Type definitions for azure-mobile-apps v2.1.7 -// 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; - api(definition?: Azure.MobileApps.ApiDefinition): Azure.MobileApps.ApiDefinition; - 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 namespace Azure.MobileApps { - // the additional Platforms namespace is required to avoid collisions with the main Express namespace - export module Platforms { - export module Express { - interface MobileApp extends Middleware { - 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 extends TableDefinition { - 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; - access?: AccessType; - } - - 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; - webhook?: Webhook; - } - - 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; - filename?: string; - } - - interface Auth { - secret: string; - validateTokens?: boolean; - } - - interface Logging { - level?: string; - transports?: LoggingTransport[]; - } - - interface LoggingTransport { } - - interface Cors { - exposeHeaders: string; - maxAge?: number; - hostnames: 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(): QueryJs; - includeDeleted(): QueryJs; - 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: ContextData; - tables: (tableName: string) => Data.Table; - user: User; - push: typeof nh; - logger: Logger; - execute(): Thenable; - next(error: string|Error): any; - } - - interface ContextData { - (table: TableDefinition): Data.Table; - execute(q: SqlQueryDefinition): Thenable; - } - - interface SqlQueryDefinition { - sql: string; - parameters?: SqlParameterDefinition[]; - } - - interface SqlParameterDefinition { - name: string; - value: any; - } - - interface TableDefinition { - access?: AccessType; - authorize?: boolean; - autoIncrement?: boolean; - columns?: any; - databaseTableName?: string; - dynamicSchema?: boolean; - maxTop?: number; - name?: string; - pageSize?: number; - schema?: string; - softDelete?: boolean; - userIdColumn?: string; - - filters?: [(query: QueryJs, context: Context) => void | QueryJs]; - transforms?: [(item: any, context: Context) => void | any]; - hooks?: [(results: any, context: Context) => void]; - - perUser?: boolean; - recordsExpire?: Duration; - webhook?: Webhook | boolean; - } - - type AccessType = 'anonymous' | 'authenticated' | 'disabled'; - - interface Duration { - milliseconds?: number; - seconds?: number; - minutes?: number; - hours?: number; - days?: number; - weeks?: number; - months?: number; - years?: number; - } - - interface Webhook { - url: 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 namespace Express { - interface Request { - azureMobile: Azure.MobileApps.Context - } - - interface Response { - results?: any; - } -} diff --git a/azure-mobile-apps/tsconfig.json b/azure-mobile-apps/tsconfig.json deleted file mode 100644 index ae1ae9db7b..0000000000 --- a/azure-mobile-apps/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "azure-mobile-apps-tests.ts" - ] -} \ No newline at end of file diff --git a/b_/tslint.json b/b_/tslint.json deleted file mode 100644 index 2221e40e4a..0000000000 --- a/b_/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } \ No newline at end of file diff --git a/babel-code-frame/index.d.ts b/babel-code-frame/index.d.ts deleted file mode 100644 index ebfde63c4c..0000000000 --- a/babel-code-frame/index.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -// Type definitions for babel-code-frame 6.20 -// Project: https://github.com/babel/babel/tree/master/packages -// Definitions by: Mohsen Azimi -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -interface BabelCodeFrameOptions { - /** Syntax highlight the code as JavaScript for terminals. default: false*/ - highlightCode?: boolean; - /** The number of lines to show above the error. default: 2 */ - linesBelow?: number; - /** The number of lines to show below the error. default: 3 */ - linesAbove?: number; - /** - * Forcibly syntax highlight the code as JavaScript (for non-terminals); - * overrides highlightCode. - * default: false - */ - forceColor?: boolean; -} - -/** - * Generate errors that contain a code frame that point to source locations. - * - * @param rawLines Raw lines to frame - * @param lineNumber Line number (1 indexed) - * @param colNumber Column number - * @param options Additional options - * - * @returns Framed code - */ -declare function codeFrame( - rawLines: string, - lineNumber: number, - colNumber: number, - options?: BabelCodeFrameOptions -): string; - -export = codeFrame; diff --git a/babel-code-frame/tslint.json b/babel-code-frame/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/babel-code-frame/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/babylonjs/babylonjs-tests.ts b/babylonjs/babylonjs-tests.ts deleted file mode 100644 index 8b13789179..0000000000 --- a/babylonjs/babylonjs-tests.ts +++ /dev/null @@ -1 +0,0 @@ - diff --git a/babylonjs/index.d.ts b/babylonjs/index.d.ts deleted file mode 100644 index ad6d1a242f..0000000000 --- a/babylonjs/index.d.ts +++ /dev/null @@ -1,7260 +0,0 @@ -// Type definitions for BabylonJS v2.3 -// Project: http://www.babylonjs.com/ -// Definitions by: David Catuhe -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare namespace 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; - fragmentDepthSupported: boolean; - drawBuffersExtension: any; - } - /** - * 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; - private _webGLVersion; - static audioEngine: AudioEngine; - private _onBlur; - private _onFocus; - private _onFullscreenChange; - private _onPointerLockChange; - private _hardwareScalingLevel; - private _caps; - private _pointerLockRequested; - private _alphaTest; - private _loadingScreen; - 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; - private _maxTextureChannels; - private _activeTexturesCache; - private _currentEffect; - private _compiledEffects; - private _vertexAttribArrays; - private _cachedViewport; - private _cachedVertexBuffers; - private _cachedIndexBuffer; - private _cachedEffectForVertexBuffers; - private _currentRenderTarget; - private _uintIndicesCurrentlySet; - private _workingCanvas; - private _workingContext; - private _bindedRenderFunction; - /** - * @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?: { - antialias?: boolean; - preserveDrawingBuffer?: boolean; - }, adaptToDeviceRatio?: boolean); - webGLVersion: string; - private _prepareWorkingCanvas(); - resetTextureCache(): void; - getGlInfo(): { - vendor: string; - renderer: string; - version: string; - }; - getAspectRatio(camera: Camera, useScreen?: boolean): number; - getRenderWidth(useScreen?: boolean): number; - getRenderHeight(useScreen?: boolean): 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, faceIndex?: number): void; - unBindFramebuffer(texture: WebGLTexture, disableGenerateMipMaps?: boolean): void; - generateMipMapsForCubemap(texture: WebGLTexture): void; - flushFramebuffer(): void; - restoreDefaultFramebuffer(): void; - private _resetVertexBufferBinding(); - createVertexBuffer(vertices: number[] | Float32Array): WebGLBuffer; - createDynamicVertexBuffer(capacity: number): WebGLBuffer; - updateDynamicVertexBuffer(vertexBuffer: WebGLBuffer, vertices: number[] | Float32Array, offset?: number): void; - private _resetIndexBufferBinding(); - createIndexBuffer(indices: number[] | Int32Array): 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; - drawUnIndexed(useTriangles: boolean, 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, reverseSide?: 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; - createRenderTargetCubeTexture(size: number, options?: any): WebGLTexture; - createCubeTexture(rootUrl: string, scene: Scene, files: string[], noMipmap?: boolean): WebGLTexture; - _releaseTexture(texture: WebGLTexture): void; - bindSamplers(effect: Effect): void; - _bindTexture(channel: number, texture: WebGLTexture): void; - setTextureFromPostProcess(channel: number, postProcess: PostProcess): void; - unbindAllTextures(): void; - setTexture(channel: number, texture: BaseTexture): void; - _setAnisotropicLevel(key: number, texture: BaseTexture): void; - readPixels(x: number, y: number, width: number, height: number): Uint8Array; - releaseInternalTexture(texture: WebGLTexture): void; - dispose(): void; - displayLoadingUI(): void; - hideLoadingUI(): void; - loadingScreen: ILoadingScreen; - loadingUIText: string; - loadingUIBackgroundColor: string; - 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; - PointerEvent: any; -} -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; -} -interface HTMLMediaElement { - // crossOrigin: string; -} - -declare namespace 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[]; - private _ranges; - 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; - getAnimationByName(name: string): Animation; - createAnimationRange(name: string, from: number, to: number): void; - deleteAnimationRange(name: string, deleteFrames?: boolean): void; - getAnimationRange(name: string): AnimationRange; - beginAnimation(name: string, loop?: boolean, speedRatio?: number, onAnimationEnd?: () => void): void; - serializeAnimationRanges(): any; - static ParseAnimationRanges(node: Node, parsedNode: any, scene: Scene): void; - } -} - -declare namespace 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; - constantlyUpdateMeshUnderPointer: boolean; - private _onPointerMove; - private _onPointerDown; - private _onPointerUp; - onPointerMove: (evt: PointerEvent, pickInfo: PickingInfo) => void; - onPointerDown: (evt: PointerEvent, pickInfo: PickingInfo) => void; - onPointerUp: (evt: PointerEvent, pickInfo: PickingInfo) => void; - onPointerPick: (evt: PointerEvent, pickInfo: PickingInfo) => void; - cameraToUseForPointers: Camera; - private _pointerX; - private _pointerY; - private _meshUnderPointer; - private _startingPointerPosition; - private _startingPointerTime; - _mirroredCameraPosition: Vector3; - 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[]; - probesEnabled: boolean; - reflectionProbes: ReflectionProbe[]; - 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; - private _pickedMeshName; - /** - * @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; - Animatables: 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; - removeSkeleton(toRemove: Skeleton): number; - removeLight(toRemove: Light): number; - removeCamera(toRemove: Camera): number; - addLight(newLight: Light): void; - addCamera(newCamera: Camera): void; - /** - * Switch active camera - * @param {Camera} newCamera - new active camera - * @param {boolean} attachControl - call attachControl for the new active camera (default: true) - */ - swithActiveCamera(newCamera: Camera, attachControl?: boolean): 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 bone using its id - * @param {string} the bone's id - * @return {BABYLON.Bone|null} the bone or null if not found - */ - getBoneByID(id: string): Bone; - /** - * get a bone using its id - * @param {string} the bone's name - * @return {BABYLON.Bone|null} the bone or null if not found - */ - getBoneByName(name: string): Bone; - /** - * 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 particle system by id - * @param id {number} the particle system id - * @return {BABYLON.ParticleSystem|null} the corresponding system or null if none found. - */ - getParticleSystemByID(id: string): ParticleSystem; - /** - * 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; - freezeMaterials(): void; - unfreezeMaterials(): 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, cameraViewSpace?: boolean): Ray; - createPickingRayInCameraSpace(x: number, y: number, camera: Camera): Ray; - private _internalPick(rayFunction, predicate, fastCheck?); - private _internalPickSprites(ray, predicate?, fastCheck?, camera?); - pick(x: number, y: number, predicate?: (mesh: AbstractMesh) => boolean, fastCheck?: boolean, camera?: Camera): PickingInfo; - pickSprite(x: number, y: number, predicate?: (sprite: Sprite) => boolean, fastCheck?: boolean, camera?: Camera): PickingInfo; - pickWithRay(ray: Ray, predicate: (mesh: Mesh) => boolean, fastCheck?: boolean): PickingInfo; - setPointerOverMesh(mesh: AbstractMesh): void; - getPointerOverMesh(): AbstractMesh; - getPhysicsEngine(): PhysicsEngine; - /** - * Enables physics to the current scene - * @param {BABYLON.Vector3} [gravity] - the scene's gravity for the physics engine - * @param {BABYLON.IPhysicsEnginePlugin} [plugin] - The physics engine to be used. defaults to OimoJS. - * @return {boolean} was the physics engine initialized - */ - enablePhysics(gravity?: Vector3, plugin?: IPhysicsEnginePlugin): boolean; - disablePhysicsEngine(): void; - isPhysicsEnabled(): boolean; - /** - * Sets the gravity of the physics engine (and NOT of the scene) - * @param {BABYLON.Vector3} [gravity] - the new gravity to be used - */ - 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 namespace 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; - skipToNextActiveAction(): void; - then(action: Action): Action; - _getProperty(propertyPath: string): string; - _getEffectiveTarget(target: any, propertyPath: string): any; - } -} - -declare namespace BABYLON { - /** - * ActionEvent is the event beint sent when an action is triggered. - */ - class ActionEvent { - source: any; - pointerX: number; - pointerY: number; - meshUnderPointer: AbstractMesh; - sourceEvent: any; - additionalData: any; - /** - * @constructor - * @param source The mesh or sprite 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: any, 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 source mesh. - * @param source The source sprite that triggered the event - * @param scene Scene associated with the sprite - * @param evt {Event} The original (browser) event - */ - static CreateNewFromSprite(source: Sprite, scene: Scene, 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 _OnPickDownTrigger; - private static _OnPickUpTrigger; - private static _OnLongPressTrigger; - private static _OnPointerOverTrigger; - private static _OnPointerOutTrigger; - private static _OnEveryFrameTrigger; - private static _OnIntersectionEnterTrigger; - private static _OnIntersectionExitTrigger; - private static _OnKeyDownTrigger; - private static _OnKeyUpTrigger; - static NothingTrigger: number; - static OnPickTrigger: number; - static OnLeftPickTrigger: number; - static OnRightPickTrigger: number; - static OnCenterPickTrigger: number; - static OnPickDownTrigger: number; - static OnPickUpTrigger: number; - static OnLongPressTrigger: number; - static OnPointerOverTrigger: number; - static OnPointerOutTrigger: number; - static OnEveryFrameTrigger: number; - static OnIntersectionEnterTrigger: number; - static OnIntersectionExitTrigger: number; - static OnKeyDownTrigger: number; - static OnKeyUpTrigger: number; - static DragMovementThreshold: number; - static LongPressDelay: 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; - static Parse(parsedActions: any, object: AbstractMesh, scene: Scene): void; - } -} - -declare namespace 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 namespace 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 namespace BABYLON { - class InterpolateValueAction extends Action { - propertyPath: string; - value: any; - duration: number; - stopOtherAnimations: boolean; - onInterpolationDone: () => void; - private _target; - private _property; - constructor(triggerOptions: any, target: any, propertyPath: string, value: any, duration?: number, condition?: Condition, stopOtherAnimations?: boolean, onInterpolationDone?: () => void); - _prepare(): void; - execute(): void; - } -} - -declare namespace 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); - getAnimations(): Animation[]; - appendAnimations(target: any, animations: Animation[]): void; - getAnimationByTargetProperty(property: string): Animation; - reset(): void; - goToFrame(frame: number): void; - pause(): void; - restart(): void; - stop(): void; - _animate(delay: number): boolean; - } -} - -declare namespace BABYLON { - class AnimationRange { - name: string; - from: number; - to: number; - constructor(name: string, from: number, to: number); - } - /** - * Composed of a frame, and an action function - */ - class AnimationEvent { - frame: number; - action: () => void; - onlyOnce: boolean; - isDone: boolean; - constructor(frame: number, action: () => void, onlyOnce?: boolean); - } - class Animation { - name: string; - targetProperty: string; - framePerSecond: number; - dataType: number; - loopMode: number; - private _keys; - private _offsetsCache; - private _highLimitsCache; - private _stopped; - _target: any; - private _easingFunction; - private _events; - targetPropertyPath: string[]; - currentFrame: number; - allowMatricesInterpolation: boolean; - private _ranges; - static _PrepareAnimation(name: string, targetProperty: string, framePerSecond: number, totalFrame: number, from: any, to: any, loopMode?: number, easingFunction?: EasingFunction): Animation; - static CreateAndStartAnimation(name: string, node: Node, targetProperty: string, framePerSecond: number, totalFrame: number, from: any, to: any, loopMode?: number, easingFunction?: EasingFunction, onAnimationEnd?: () => void): Animatable; - static CreateMergeAndStartAnimation(name: string, node: Node, targetProperty: string, framePerSecond: number, totalFrame: number, from: any, to: any, loopMode?: number, easingFunction?: EasingFunction, onAnimationEnd?: () => void): Animatable; - constructor(name: string, targetProperty: string, framePerSecond: number, dataType: number, loopMode?: number); - /** - * Add an event to this animation. - */ - addEvent(event: AnimationEvent): void; - /** - * Remove all events found at the given frame - * @param frame - */ - removeEvents(frame: number): void; - createRange(name: string, from: number, to: number): void; - deleteRange(name: string, deleteFrames?: boolean): void; - getRange(name: string): AnimationRange; - reset(): void; - isStopped(): boolean; - getKeys(): any[]; - getHighestFrame(): number; - 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?); - setValue(currentValue: any): void; - goToFrame(frame: number): void; - animate(delay: number, from: number, to: number, loop: boolean, speedRatio: number): boolean; - serialize(): any; - 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; - static Parse(parsedAnimation: any): Animation; - static AppendSerializedAnimations(source: IAnimatable, destination: any): any; - } -} - -declare namespace 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 namespace 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 namespace BABYLON { - class AudioEngine { - private _audioContext; - private _audioContextInitialized; - canUseWebAudio: boolean; - masterGain: GainNode; - private _connectedAnalyser; - WarnedWebAudioUnsupported: boolean; - unlocked: boolean; - onAudioUnlocked: () => any; - audioContext: AudioContext; - constructor(); - private _unlockiOSaudio(); - private _initializeAudioContext(); - dispose(): void; - getGlobalVolume(): number; - setGlobalVolume(newVolume: number): void; - connectToAnalyser(analyser: Analyser): void; - } -} - -declare namespace 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 _streaming; - 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 _streamingSource; - private _soundPanner; - private _soundGain; - private _inputAudioNode; - private _ouputAudioNode; - private _coneInnerAngle; - private _coneOuterAngle; - private _coneOuterGain; - private _scene; - private _connectedMesh; - private _customAttenuationFunction; - private _registerFunc; - private _isOutputConnected; - private _htmlAudioElement; - /** - * 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, streaming - */ - 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); - clone(): Sound; - getAudioBuffer(): AudioBuffer; - static Parse(parsedSound: any, scene: Scene, rootUrl: string, sourceSound?: Sound): Sound; - } -} - -declare namespace BABYLON { - class SoundTrack { - private _outputAudioNode; - private _inputAudioNode; - private _trackConvolver; - private _scene; - id: number; - soundCollection: Array; - private _isMainTrack; - private _connectedAnalyser; - private _options; - private _isInitialized; - constructor(scene: Scene, options?: any); - private _initializeSoundTrackAudioGraph(); - dispose(): void; - AddSound(sound: Sound): void; - RemoveSound(sound: Sound): void; - setVolume(newVolume: number): void; - switchPanningModelToHRTF(): void; - switchPanningModelToEqualPower(): void; - connectToAnalyser(analyser: Analyser): void; - } -} - -declare namespace BABYLON { - class Bone extends Node { - name: string; - children: Bone[]; - animations: Animation[]; - length: number; - private _skeleton; - _matrix: Matrix; - private _restPose; - private _baseMatrix; - private _worldTransform; - private _absoluteTransform; - private _invertedAbsoluteTransform; - private _parent; - constructor(name: string, skeleton: Skeleton, parentBone: Bone, matrix: Matrix, restPose?: Matrix); - getParent(): Bone; - getLocalMatrix(): Matrix; - getBaseMatrix(): Matrix; - getRestPose(): Matrix; - returnToRest(): void; - getWorldMatrix(): Matrix; - getInvertedAbsoluteTransform(): Matrix; - getAbsoluteTransform(): Matrix; - updateMatrix(matrix: Matrix): void; - _updateDifferenceMatrix(rootMatrix?: Matrix): void; - markAsDirty(): void; - copyAnimationRange(source: Bone, rangeName: string, frameOffset: number, rescaleAsRequired?: boolean): boolean; - } -} - -declare namespace BABYLON { - class Skeleton { - name: string; - id: string; - bones: Bone[]; - needInitialSkinMatrix: boolean; - private _scene; - private _isDirty; - private _transformMatrices; - private _meshesWithPoseMatrix; - private _animatables; - private _identity; - private _ranges; - constructor(name: string, id: string, scene: Scene); - getTransformMatrices(mesh: AbstractMesh): Float32Array; - getScene(): Scene; - createAnimationRange(name: string, from: number, to: number): void; - deleteAnimationRange(name: string, deleteFrames?: boolean): void; - getAnimationRange(name: string): AnimationRange; - /** - * note: This is not for a complete retargeting, only between very similar skeleton's with only possible bone length differences - */ - copyAnimationRange(source: Skeleton, name: string, rescaleAsRequired?: boolean): boolean; - returnToRest(): void; - private _getHighestAnimationFrame(); - beginAnimation(name: string, loop?: boolean, speedRatio?: number, onAnimationEnd?: () => void): void; - _markAsDirty(): void; - _registerMeshWithPoseMatrix(mesh: AbstractMesh): void; - _unregisterMeshWithPoseMatrix(mesh: AbstractMesh): void; - _computeTransformMatrices(targetMatrix: Float32Array, initialSkinMatrix: Matrix): void; - prepare(): void; - getAnimatables(): IAnimatable[]; - clone(name: string, id: string): Skeleton; - dispose(): void; - serialize(): any; - static Parse(parsedSkeleton: any, scene: Scene): Skeleton; - } -} - -declare namespace 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; - panningAxis: Vector3; - 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; - serialize(): any; - } -} - -declare namespace 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; - compensateDistortion: 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; - serialize(): any; - static Parse(parsedCamera: any, scene: Scene): Camera; - } -} - -declare namespace 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 namespace 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; - serialize(): any; - } - 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; - serialize(): any; - } -} - -declare namespace 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; - _waitingLockedTargetId: string; - constructor(name: string, position: Vector3, scene: Scene); - _onLostFocus(e: FocusEvent): void; - attachControl(element: HTMLElement, noPreventDefault?: boolean): void; - detachControl(element: HTMLElement): void; - _collideWithWorld(velocity: Vector3): void; - private _onCollisionPositionChange; - _checkInputs(): void; - _decideIfNeedsToMove(): boolean; - _updatePosition(): void; - serialize(): any; - } -} - -declare namespace BABYLON { - class GamepadCamera extends UniversalCamera { - constructor(name: string, position: Vector3, scene: Scene); - } -} - -declare namespace BABYLON { - class AnaglyphFreeCamera extends FreeCamera { - interaxialDistance: number; - 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 namespace 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); - serialize(): any; - } -} - -declare namespace BABYLON { - class TouchCamera extends FreeCamera { - private _offsetX; - private _offsetY; - private _pointerCount; - private _pointerPressed; - private _attachedCanvas; - private _onPointerDown; - private _onPointerUp; - private _onPointerMove; - touchAngularSensibility: number; - touchMoveSensibility: number; - constructor(name: string, position: Vector3, scene: Scene); - _onLostFocus(e: FocusEvent): void; - attachControl(canvas: HTMLCanvasElement, noPreventDefault: boolean): void; - detachControl(canvas: HTMLCanvasElement): void; - _checkInputs(): void; - } -} - -declare namespace BABYLON { - class UniversalCamera extends TouchCamera { - gamepad: Gamepad; - private _gamepads; - gamepadAngularSensibility: number; - gamepadMoveSensibility: number; - constructor(name: string, position: Vector3, scene: Scene); - private _onNewGameConnected(gamepad); - attachControl(canvas: HTMLCanvasElement, noPreventDefault: boolean): void; - detachControl(canvas: HTMLCanvasElement): void; - _checkInputs(): void; - dispose(): void; - } -} - -declare namespace 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 namespace 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[] | Int32Array, indexStart: number, indexEnd: number, decal: number, hasMaterial: boolean): void; - _getResponse(pos: Vector3, vel: Vector3): void; - } -} - -declare namespace 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 namespace 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; - removeMesh(uniqueId: number): void; - getGeometry(id: string): SerializedGeometry; - addGeometry(geometry: SerializedGeometry): void; - removeGeometry(id: string): 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 namespace 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; - pickedSprite: Sprite; - getNormal(useWorldCoordinates?: boolean, useVerticesNormals?: boolean): Vector3; - getTextureCoordinates(): Vector2; - } -} - -declare namespace 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 _rootElement; - _syncPositions: () => void; - 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, rootElement?: HTMLElement): 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 namespace 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 namespace BABYLON { - class BoundingInfo { - minimum: Vector3; - maximum: Vector3; - boundingBox: BoundingBox; - boundingSphere: BoundingSphere; - private _isLocked; - constructor(minimum: Vector3, maximum: Vector3); - isLocked: boolean; - 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 namespace 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 namespace BABYLON { - class Layer { - name: string; - texture: Texture; - isBackground: boolean; - color: Color4; - scale: Vector2; - offset: Vector2; - onDispose: () => void; - alphaBlendingMode: number; - 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 namespace 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 namespace 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; - static Parse(parsedLensFlareSystem: any, scene: Scene, rootUrl: string): LensFlareSystem; - serialize(): any; - } -} - -declare namespace BABYLON { - class DirectionalLight extends Light implements IShadowLight { - direction: Vector3; - position: Vector3; - private _transformedDirection; - transformedPosition: Vector3; - private _worldMatrix; - shadowOrthoScale: number; - autoUpdateExtends: boolean; - private _orthoLeft; - private _orthoRight; - private _orthoTop; - private _orthoBottom; - 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; - needCube(): boolean; - getShadowDirection(faceIndex?: number): Vector3; - computeTransformedPosition(): boolean; - transferToEffect(effect: Effect, directionUniformName: string): void; - _getWorldMatrix(): Matrix; - serialize(): any; - } -} - -declare namespace 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; - serialize(): any; - } -} - -declare namespace BABYLON { - interface IShadowLight { - id: string; - position: Vector3; - transformedPosition: Vector3; - name: string; - computeTransformedPosition(): boolean; - getScene(): Scene; - setShadowProjectionMatrix(matrix: Matrix, viewMatrix: Matrix, renderList: Array): void; - supportsVSM(): boolean; - needRefreshPerFrame(): boolean; - needCube(): boolean; - getShadowDirection(faceIndex?: number): Vector3; - _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; - serialize(): any; - static Parse(parsedLight: any, scene: Scene): Light; - } -} - -declare namespace BABYLON { - class PointLight extends Light implements IShadowLight { - position: Vector3; - private _worldMatrix; - transformedPosition: Vector3; - constructor(name: string, position: Vector3, scene: Scene); - getAbsolutePosition(): Vector3; - computeTransformedPosition(): boolean; - transferToEffect(effect: Effect, positionUniformName: string): void; - needCube(): boolean; - supportsVSM(): boolean; - needRefreshPerFrame(): boolean; - getShadowDirection(faceIndex?: number): Vector3; - setShadowProjectionMatrix(matrix: Matrix, viewMatrix: Matrix, renderList: Array): void; - _getWorldMatrix(): Matrix; - serialize(): any; - } -} - -declare namespace 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; - needCube(): boolean; - supportsVSM(): boolean; - needRefreshPerFrame(): boolean; - getShadowDirection(faceIndex?: number): Vector3; - setDirectionToTarget(target: Vector3): Vector3; - computeTransformedPosition(): boolean; - transferToEffect(effect: Effect, positionUniformName: string, directionUniformName: string): void; - _getWorldMatrix(): Matrix; - serialize(): any; - } -} - -declare namespace 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 namespace BABYLON { - class SIMDVector3 { - static TransformCoordinatesToRefSIMD(vector: Vector3, transformation: Matrix, result: Vector3): void; - static TransformCoordinatesFromFloatsToRefSIMD(x: number, y: number, z: number, transformation: Matrix, result: Vector3): void; - } - class SIMDMatrix { - multiplyToArraySIMD(other: Matrix, result: Matrix, offset?: number): void; - invertToRefSIMD(other: Matrix): Matrix; - static LookAtLHToRefSIMD(eyeRef: Vector3, targetRef: Vector3, upRef: Vector3, result: Matrix): void; - } - class SIMDHelper { - private static _isEnabled; - static IsEnabled: boolean; - static DisableSIMD(): void; - static EnableSIMD(): void; - } -} - -declare namespace 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; - toLinearSpace(): Color3; - toLinearSpaceToRef(convertedColor: Color3): Color3; - toGammaSpace(): Color3; - toGammaSpaceToRef(convertedColor: Color3): Color3; - 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; - static CheckColors4(colors: number[], count: number): number[]; - } - 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[] | Float32Array, offset?: number): Vector2; - static FromArrayToRef(array: number[] | Float32Array, 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[] | Float32Array, 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[] | Float32Array, offset?: number): Vector3; - static FromFloatArray(array: Float32Array, offset?: number): Vector3; - static FromArrayToRef(array: number[] | Float32Array, 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 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 normalized 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; - multiplyInPlace(q1: Quaternion): Quaternion; - length(): number; - normalize(): Quaternion; - toEulerAngles(order?: string): Vector3; - toEulerAnglesToRef(result: Vector3, order?: string): 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; - 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; - 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 RotationAxisToRef(axis: Vector3, angle: number, result: Matrix): void; - 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 Lerp(startValue: Matrix, endValue: Matrix, gradient: number): Matrix; - static LookAtLH(eye: Vector3, target: Vector3, up: Vector3): Matrix; - static LookAtLHToRef(eye: Vector3, target: Vector3, up: 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: Engine): Viewport; - toScreenGlobal(engine: Engine): 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 Tmp { - static Vector2: Vector2[]; - static Vector3: Vector3[]; - static Vector4: Vector4[]; - static Quaternion: Quaternion[]; - static Matrix: Matrix[]; - } -} - -declare namespace BABYLON { - class EffectFallbacks { - private _defines; - private _currentRank; - private _maxRank; - private _mesh; - private _meshRank; - addFallback(rank: number, define: string): void; - addCPUSkinningFallback(rank: number, mesh: BABYLON.AbstractMesh): 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 _dumpShadersName(); - private _prepareEffect(vertexSourceCode, fragmentSourceCode, attributesNames, defines, fallbacks?); - isSupported: boolean; - _bindTexture(channel: string, texture: WebGLTexture): void; - setTexture(channel: string, texture: BaseTexture): void; - setTextureFromPostProcess(channel: string, postProcess: PostProcess): void; - _cacheMatrix(uniformName: any, matrix: any): 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 namespace BABYLON { - class MaterialDefines { - _keys: string[]; - isEqual(other: MaterialDefines): boolean; - cloneTo(other: MaterialDefines): void; - reset(): void; - toString(): string; - } - class Material { - name: string; - private static _TriangleFillMode; - private static _WireFrameFillMode; - private static _PointFillMode; - static TriangleFillMode: number; - static WireFrameFillMode: number; - static PointFillMode: number; - private static _ClockWiseSideOrientation; - private static _CounterClockWiseSideOrientation; - static ClockWiseSideOrientation: number; - static CounterClockWiseSideOrientation: number; - id: string; - checkReadyOnEveryCall: boolean; - checkReadyOnlyOnce: boolean; - state: string; - alpha: number; - backFaceCulling: boolean; - sideOrientation: number; - onCompiled: (effect: Effect) => void; - onError: (effect: Effect, errors: string) => void; - onDispose: () => void; - onBind: (material: Material, mesh: Mesh) => void; - getRenderTargetTextures: () => SmartArray; - alphaMode: number; - disableDepthWrite: boolean; - fogEnabled: 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); - isFrozen: boolean; - freeze(): void; - unfreeze(): void; - 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; - markDirty(): void; - _preBind(): void; - bind(world: Matrix, mesh?: Mesh): void; - bindOnlyWorldMatrix(world: Matrix): void; - unbind(): void; - clone(name: string): Material; - getBindedMeshes(): AbstractMesh[]; - dispose(forceDisposeEffect?: boolean): void; - copyTo(other: Material): void; - serialize(): any; - static ParseMultiMaterial(parsedMultiMaterial: any, scene: Scene): MultiMaterial; - static Parse(parsedMaterial: any, scene: Scene, rootUrl: string): any; - } -} - -declare namespace BABYLON { - class MultiMaterial extends Material { - subMaterials: Material[]; - constructor(name: string, scene: Scene); - getSubMaterial(index: any): Material; - isReady(mesh?: AbstractMesh): boolean; - clone(name: string, cloneChildren?: boolean): MultiMaterial; - serialize(): any; - } -} - -declare namespace 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; - serialize(): any; - static Parse(source: any, scene: Scene, rootUrl: string): ShaderMaterial; - } -} - -declare namespace BABYLON { - class FresnelParameters { - isEnabled: boolean; - leftColor: Color3; - rightColor: Color3; - bias: number; - power: number; - clone(): FresnelParameters; - serialize(): any; - static Parse(parsedFresnelParameters: any): FresnelParameters; - } - class StandardMaterial extends Material { - diffuseTexture: BaseTexture; - ambientTexture: BaseTexture; - opacityTexture: BaseTexture; - reflectionTexture: BaseTexture; - emissiveTexture: BaseTexture; - specularTexture: BaseTexture; - bumpTexture: BaseTexture; - lightmapTexture: BaseTexture; - ambientColor: Color3; - diffuseColor: Color3; - specularColor: Color3; - specularPower: number; - emissiveColor: Color3; - useAlphaFromDiffuseTexture: boolean; - useEmissiveAsIllumination: boolean; - linkEmissiveWithDiffuse: boolean; - useReflectionFresnelFromSpecular: boolean; - useSpecularOverAlpha: boolean; - disableLighting: boolean; - roughness: number; - useLightmapAsShadowmap: boolean; - diffuseFresnelParameters: FresnelParameters; - opacityFresnelParameters: FresnelParameters; - reflectionFresnelParameters: FresnelParameters; - emissiveFresnelParameters: FresnelParameters; - useGlossinessFromSpecularMapAlpha: boolean; - private _renderTargets; - private _worldViewProjectionMatrix; - private _globalAmbientColor; - private _renderId; - private _defines; - private _cachedDefines; - private _useLogarithmicDepth; - constructor(name: string, scene: Scene); - useLogarithmicDepth: boolean; - needAlphaBlending(): boolean; - needAlphaTesting(): boolean; - private _shouldUseAlphaFromDiffuseTexture(); - getAlphaTestTexture(): BaseTexture; - private _checkCache(scene, mesh?, useInstances?); - static PrepareDefinesForLights(scene: Scene, mesh: AbstractMesh, defines: MaterialDefines): boolean; - private static _scaledDiffuse; - private static _scaledSpecular; - static BindLights(scene: Scene, mesh: AbstractMesh, effect: Effect, defines: MaterialDefines): void; - 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; - serialize(): any; - static DiffuseTextureEnabled: boolean; - static AmbientTextureEnabled: boolean; - static OpacityTextureEnabled: boolean; - static ReflectionTextureEnabled: boolean; - static EmissiveTextureEnabled: boolean; - static SpecularTextureEnabled: boolean; - static BumpTextureEnabled: boolean; - static FresnelEnabled: boolean; - static LightmapEnabled: boolean; - static Parse(source: any, scene: Scene, rootUrl: string): StandardMaterial; - } -} - -declare namespace 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; - 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; - scalingDeterminant: number; - numBoneInfluencers: number; - useOctreeForRenderingSelection: boolean; - useOctreeForPicking: boolean; - useOctreeForCollisions: boolean; - layerMask: number; - alwaysSelectAsActiveMesh: boolean; - _physicImpostor: number; - _physicsMass: number; - _physicsFriction: number; - _physicRestitution: number; - onPhysicsCollide: (collidedMesh: AbstractMesh, contact: any) => void; - private _checkCollisions; - ellipsoid: Vector3; - ellipsoidOffset: Vector3; - private _collider; - private _oldPositionForCollisions; - private _diffPositionForCollisions; - private _newPositionForCollisions; - onCollide: (collidedMesh: AbstractMesh) => void; - onCollisionPositionChange: (newPosition: Vector3) => void; - private _meshToBoneReferal; - edgesWidth: number; - edgesColor: Color4; - _edgesRenderer: EdgesRenderer; - private _localWorld; - _worldMatrix: Matrix; - private _rotateYByPI; - private _absolutePosition; - private _collisionsTransformMatrix; - private _collisionsScalingMatrix; - _positions: Vector3[]; - private _isDirty; - _masterMesh: AbstractMesh; - _materialDefines: MaterialDefines; - _boundingInfo: BoundingInfo; - private _pivotMatrix; - _isDisposed: boolean; - _renderId: number; - subMeshes: SubMesh[]; - _submeshesOctree: Octree; - _intersectionsInProgress: AbstractMesh[]; - private _onAfterWorldMatrixUpdate; - private _isWorldMatrixFrozen; - _unIndexed: boolean; - _poseMatrix: Matrix; - _waitingActions: any; - _waitingFreezeWorldMatrix: boolean; - private _skeleton; - _bonesTransformMatrices: Float32Array; - skeleton: Skeleton; - constructor(name: string, scene: Scene); - updatePoseMatrix(matrix: Matrix): void; - getPoseMatrix(): Matrix; - disableEdgesRendering(): void; - enableEdgesRendering(epsilon?: number, checkVerticesInsteadOfIndices?: boolean): void; - isBlocked: boolean; - getLOD(camera: Camera): AbstractMesh; - getTotalVertices(): number; - getIndices(): number[] | Int32Array; - getVerticesData(kind: string): number[] | Float32Array; - 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 namespace 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 namespace 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; - private _extend; - _delayInfo: any; - private _indexBuffer; - _boundingInfo: BoundingInfo; - _delayLoadingFunction: (any: any, geometry: Geometry) => void; - _softwareSkinningRenderId: number; - constructor(id: string, scene: Scene, vertexData?: VertexData, updatable?: boolean, mesh?: Mesh); - extend: { - minimum: Vector3; - maximum: Vector3; - }; - getScene(): Scene; - getEngine(): Engine; - isReady(): boolean; - setAllVerticesData(vertexData: VertexData, updatable?: boolean): void; - setVerticesData(kind: string, data: number[] | Float32Array, updatable?: boolean, stride?: number): void; - updateVerticesDataDirectly(kind: string, data: Float32Array, offset: number): void; - updateVerticesData(kind: string, data: number[] | Float32Array, updateExtends?: boolean): void; - getTotalVertices(): number; - getVerticesData(kind: string, copyWhenShared?: boolean): number[] | Float32Array; - getVertexBuffer(kind: string): VertexBuffer; - getVertexBuffers(): VertexBuffer[]; - isVerticesDataPresent(kind: string): boolean; - getVerticesDataKinds(): string[]; - setIndices(indices: number[] | Int32Array, totalVertices?: number): void; - getTotalIndices(): number; - getIndices(copyWhenShared?: boolean): number[] | Int32Array; - 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; - serialize(): any; - serializeVerticeData(): any; - static ExtractFromMesh(mesh: Mesh, id: string): Geometry; - static RandomId(): string; - static ImportGeometry(parsedGeometry: any, mesh: Mesh): void; - static Parse(parsedVertexData: any, scene: Scene, rootUrl: string): Geometry; - } - namespace 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[] | Int32Array | Float32Array, updatable?: boolean): void; - _regenerateVertexData(): VertexData; - copy(id: string): Geometry; - serialize(): any; - } - 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; - serialize(): any; - static Parse(parsedBox: any, scene: Scene): Box; - } - 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; - serialize(): any; - static Parse(parsedSphere: any, scene: Scene): Geometry.Primitives.Sphere; - } - class Disc extends _Primitive { - radius: number; - tessellation: number; - side: number; - constructor(id: string, scene: Scene, radius: number, tessellation: 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; - serialize(): any; - static Parse(parsedCylinder: any, scene: Scene): Geometry.Primitives.Cylinder; - } - 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; - serialize(): any; - static Parse(parsedTorus: any, scene: Scene): Geometry.Primitives.Torus; - } - 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; - serialize(): any; - static Parse(parsedGround: any, scene: Scene): Geometry.Primitives.Ground; - } - 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; - serialize(): any; - static Parse(parsedPlane: any, scene: Scene): Geometry.Primitives.Plane; - } - 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; - serialize(): any; - static Parse(parsedTorusKnot: any, scene: Scene): Geometry.Primitives.TorusKnot; - } - } -} - -declare namespace BABYLON { - class GroundMesh extends Mesh { - generateOctree: boolean; - private _worldInverse; - private _heightQuads; - _subdivisions: number; - _width: number; - _height: number; - _minX: number; - _maxX: number; - _minZ: number; - _maxZ: number; - constructor(name: string, scene: Scene); - subdivisions: number; - optimize(chunksCount: number, octreeBlocksSize?: number): void; - /** - * Returns a height (y) value in the Worl system : - * the ground altitude at the coordinates (x, z) expressed in the World system. - * Returns the ground y position if (x, z) are outside the ground surface. - * Not pertinent if the ground is rotated. - */ - getHeightAtCoordinates(x: number, z: number): number; - /** - * Returns a normalized vector (Vector3) orthogonal to the ground - * at the ground coordinates (x, z) expressed in the World system. - * Returns Vector3(0, 1, 0) if (x, z) are outside the ground surface. - * Not pertinent if the ground is rotated. - */ - getNormalAtCoordinates(x: number, z: number): Vector3; - /** - * Updates the Vector3 passed a reference with a normalized vector orthogonal to the ground - * at the ground coordinates (x, z) expressed in the World system. - * Doesn't uptade the reference Vector3 if (x, z) are outside the ground surface. - * Not pertinent if the ground is rotated. - */ - getNormalAtCoordinatesToRef(x: number, z: number, ref: Vector3): void; - private _getFacetAt(x, z); - private _computeHeightQuads(); - } -} - -declare namespace 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; - renderingGroupId: number; - getTotalVertices(): number; - sourceMesh: Mesh; - getVerticesData(kind: string, copyWhenShared?: boolean): number[] | Float32Array; - isVerticesDataPresent(kind: string): boolean; - getIndices(): number[] | Int32Array; - _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 namespace 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 namespace 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; - onBeforeDraw: () => 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 {Mesh} mesh - the mesh to be added as LOD level - * @return {Mesh} this mesh (for chaining) - */ - addLODLevel(distance: number, mesh: Mesh): Mesh; - getLODLevelAtDistance(distance: number): Mesh; - /** - * Remove a mesh from the LOD array - * @param {Mesh} mesh - the mesh to be removed. - * @return {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[] | Float32Array; - getVertexBuffer(kind: any): VertexBuffer; - isVerticesDataPresent(kind: string): boolean; - getVerticesDataKinds(): string[]; - getTotalIndices(): number; - getIndices(copyWhenShared?: boolean): number[] | Int32Array; - 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: string, data: number[] | Float32Array, updatable?: boolean, stride?: number): void; - updateVerticesData(kind: string, data: number[] | Float32Array, 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[] | Int32Array, 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; - convertToUnIndexedMesh(): 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 Parse(parsedMesh: any, scene: Scene, rootUrl: string): Mesh; - static CreateRibbon(name: string, pathArray: Vector3[][], closeArray: boolean, closePath: boolean, offset: number, scene: Scene, updatable?: boolean, sideOrientation?: number, instance?: 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 CreateSphere(name: string, segments: number, diameter: number, scene?: Scene, updatable?: boolean, sideOrientation?: number): 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, instance?: LinesMesh): LinesMesh; - static CreateDashedLines(name: string, points: Vector3[], dashSize: number, gapSize: number, dashNb: number, scene: Scene, updatable?: boolean, instance?: LinesMesh): LinesMesh; - static ExtrudeShape(name: string, shape: Vector3[], path: Vector3[], scale: number, rotation: number, cap: number, scene: Scene, updatable?: boolean, sideOrientation?: number, instance?: 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, instance?: Mesh): Mesh; - 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 CreateGround(name: string, width: number, height: number, subdivisions: number, scene: Scene, updatable?: boolean): 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, instance?: Mesh): Mesh; - static CreatePolyhedron(name: string, options: { - type?: number; - size?: number; - sizeX?: number; - sizeY?: number; - sizeZ?: number; - custom?: any; - faceUV?: Vector4[]; - faceColors?: Color4[]; - updatable?: boolean; - sideOrientation?: number; - }, scene: Scene): Mesh; - static CreateIcoSphere(name: string, options: { - radius?: number; - flat?: boolean; - subdivisions?: number; - sideOrientation?: number; - updatable?: boolean; - }, scene: Scene): Mesh; - static CreateDecal(name: string, sourceMesh: AbstractMesh, position: Vector3, normal: Vector3, size: Vector3, angle: number): Mesh; - /** - * @returns original positions used for CPU skinning. Useful for integrating Morphing with skeletons in same mesh. - */ - setPositionsForCPUSkinning(): Float32Array; - /** - * @returns original normals used for CPU skinning. Useful for integrating Morphing with skeletons in same mesh. - */ - setNormalsForCPUSkinning(): Float32Array; - /** - * 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 namespace BABYLON { - interface IGetSetVerticesData { - isVerticesDataPresent(kind: string): boolean; - getVerticesData(kind: string, copyWhenShared?: boolean): number[] | Int32Array | Float32Array; - getIndices(copyWhenShared?: boolean): number[] | Int32Array; - setVerticesData(kind: string, data: number[] | Float32Array, updatable?: boolean): void; - updateVerticesData(kind: string, data: number[] | Float32Array, updateExtends?: boolean, makeItUnique?: boolean): void; - setIndices(indices: number[] | Int32Array): void; - } - class VertexData { - positions: number[] | Float32Array; - normals: number[] | Float32Array; - uvs: number[] | Float32Array; - uvs2: number[] | Float32Array; - uvs3: number[] | Float32Array; - uvs4: number[] | Float32Array; - uvs5: number[] | Float32Array; - uvs6: number[] | Float32Array; - colors: number[] | Float32Array; - matricesIndices: number[] | Float32Array; - matricesWeights: number[] | Float32Array; - matricesIndicesExtra: number[] | Float32Array; - matricesWeightsExtra: number[] | Float32Array; - indices: number[] | Int32Array; - set(data: number[] | Float32Array, 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; - private _mergeElement(source, other); - serialize(): any; - static ExtractFromMesh(mesh: Mesh, copyWhenShared?: boolean): VertexData; - static ExtractFromGeometry(geometry: Geometry, copyWhenShared?: boolean): VertexData; - private static _ExtractFrom(meshOrGeometry, copyWhenShared?); - static CreateRibbon(options: { - pathArray: Vector3[][]; - closeArray?: boolean; - closePath?: boolean; - offset?: number; - sideOrientation?: number; - }): VertexData; - static CreateBox(options: { - size?: number; - width?: number; - height?: number; - depth?: number; - faceUV?: Vector4[]; - faceColors?: Color4[]; - sideOrientation?: number; - }): VertexData; - static CreateSphere(options: { - segments?: number; - diameter?: number; - diameterX?: number; - diameterY?: number; - diameterZ?: number; - arc?: number; - slice?: number; - sideOrientation?: number; - }): VertexData; - static CreateCylinder(options: { - height?: number; - diameterTop?: number; - diameterBottom?: number; - diameter?: number; - tessellation?: number; - subdivisions?: number; - arc?: number; - faceColors?: Color4[]; - faceUV?: Vector4[]; - hasRings?: boolean; - enclose?: boolean; - sideOrientation?: number; - }): VertexData; - static CreateTorus(options: { - diameter?: number; - thickness?: number; - tessellation?: number; - sideOrientation?: number; - }): VertexData; - static CreateLines(options: { - points: Vector3[]; - }): VertexData; - static CreateDashedLines(options: { - points: Vector3[]; - dashSize?: number; - gapSize?: number; - dashNb?: number; - }): VertexData; - static CreateGround(options: { - width?: number; - height?: number; - subdivisions?: number; - }): VertexData; - static CreateTiledGround(options: { - xmin: number; - zmin: number; - xmax: number; - zmax: number; - subdivisions?: { - w: number; - h: number; - }; - precision?: { - w: number; - h: number; - }; - }): VertexData; - static CreateGroundFromHeightMap(options: { - width: number; - height: number; - subdivisions: number; - minHeight: number; - maxHeight: number; - buffer: Uint8Array; - bufferWidth: number; - bufferHeight: number; - }): VertexData; - static CreatePlane(options: { - size?: number; - width?: number; - height?: number; - sideOrientation?: number; - }): VertexData; - static CreateDisc(options: { - radius?: number; - tessellation?: number; - arc?: number; - sideOrientation?: number; - }): VertexData; - static CreateIcoSphere(options: { - radius?: number; - radiusX?: number; - radiusY?: number; - radiusZ?: number; - flat?: boolean; - subdivisions?: number; - sideOrientation?: number; - }): VertexData; - static CreatePolyhedron(options: { - type?: number; - size?: number; - sizeX?: number; - sizeY?: number; - sizeZ?: number; - custom?: any; - faceUV?: Vector4[]; - faceColors?: Color4[]; - flat?: boolean; - sideOrientation?: number; - }): VertexData; - static CreateTorusKnot(options: { - 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); - static ImportVertexData(parsedVertexData: any, geometry: Geometry): void; - } -} - -declare namespace BABYLON { - class MeshBuilder { - 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, options: { - segments?: number; - diameter?: number; - diameterX?: number; - diameterY?: number; - diameterZ?: number; - arc?: number; - slice?: number; - sideOrientation?: number; - updatable?: boolean; - }, scene: any): Mesh; - static CreateDisc(name: string, options: { - radius?: number; - tessellation?: number; - arc?: number; - updatable?: boolean; - sideOrientation?: number; - }, scene: Scene): Mesh; - static CreateIcoSphere(name: string, options: { - radius?: number; - radiusX?: number; - radiusY?: number; - radiusZ?: number; - flat?: boolean; - subdivisions?: number; - sideOrientation?: number; - updatable?: boolean; - }, scene: Scene): Mesh; - static CreateRibbon(name: string, options: { - pathArray: Vector3[][]; - closeArray?: boolean; - closePath?: boolean; - offset?: number; - updatable?: boolean; - sideOrientation?: number; - instance?: Mesh; - }, scene?: Scene): Mesh; - static CreateCylinder(name: string, options: { - height?: number; - diameterTop?: number; - diameterBottom?: number; - diameter?: number; - tessellation?: number; - subdivisions?: number; - arc?: number; - faceColors?: Color4[]; - faceUV?: Vector4[]; - updatable?: boolean; - hasRings?: boolean; - enclose?: boolean; - sideOrientation?: number; - }, scene: any): Mesh; - static CreateTorus(name: string, options: { - diameter?: number; - thickness?: number; - tessellation?: number; - updatable?: boolean; - sideOrientation?: number; - }, scene: any): Mesh; - static CreateTorusKnot(name: string, options: { - radius?: number; - tube?: number; - radialSegments?: number; - tubularSegments?: number; - p?: number; - q?: number; - updatable?: boolean; - sideOrientation?: number; - }, scene: any): Mesh; - static CreateLines(name: string, options: { - points: Vector3[]; - updatable?: boolean; - instance?: LinesMesh; - }, scene: Scene): LinesMesh; - static CreateDashedLines(name: string, options: { - points: Vector3[]; - dashSize?: number; - gapSize?: number; - dashNb?: number; - updatable?: boolean; - instance?: LinesMesh; - }, scene: Scene): LinesMesh; - static ExtrudeShape(name: string, options: { - shape: Vector3[]; - path: Vector3[]; - scale?: number; - rotation?: number; - cap?: number; - updatable?: boolean; - sideOrientation?: number; - instance?: Mesh; - }, scene: Scene): Mesh; - static ExtrudeShapeCustom(name: string, options: { - shape: Vector3[]; - path: Vector3[]; - scaleFunction?:any; - rotationFunction?:any; - ribbonCloseArray?: boolean; - ribbonClosePath?: boolean; - cap?: number; - updatable?: boolean; - sideOrientation?: number; - instance?: Mesh; - }, scene: Scene): Mesh; - static CreateLathe(name: string, options: { - shape: Vector3[]; - radius?: number; - tessellation?: number; - arc?: number; - closed?: boolean; - updatable?: boolean; - sideOrientation?: number; - cap?: number; - }, scene: Scene): Mesh; - static CreatePlane(name: string, options: { - size?: number; - width?: number; - height?: number; - sideOrientation?: number; - updatable?: boolean; - sourcePlane?: Plane; - }, scene: Scene): Mesh; - static CreateGround(name: string, options: { - width?: number; - height?: number; - subdivisions?: number; - updatable?: boolean; - }, scene: any): Mesh; - static CreateTiledGround(name: string, options: { - xmin: number; - zmin: number; - xmax: number; - zmax: number; - subdivisions?: { - w: number; - h: number; - }; - precision?: { - w: number; - h: number; - }; - updatable?: boolean; - }, scene: Scene): Mesh; - static CreateGroundFromHeightMap(name: string, url: string, options: { - width?: number; - height?: number; - subdivisions?: number; - minHeight?: number; - maxHeight?: number; - updatable?: boolean; - onReady?: (mesh: GroundMesh) => void; - }, scene: Scene): GroundMesh; - static CreateTube(name: string, options: { - path: Vector3[]; - radius?: number; - tessellation?: number; - radiusFunction?: { - (i: number, distance: number): number; - }; - cap?: number; - arc?: number; - updatable?: boolean; - sideOrientation?: number; - instance?: Mesh; - }, scene: Scene): Mesh; - static CreatePolyhedron(name: string, options: { - type?: number; - size?: number; - sizeX?: number; - sizeY?: number; - sizeZ?: number; - custom?: any; - faceUV?: Vector4[]; - faceColors?: Color4[]; - flat?: boolean; - updatable?: boolean; - sideOrientation?: number; - }, scene: Scene): Mesh; - static CreateDecal(name: string, sourceMesh: AbstractMesh, options: { - position?: Vector3; - normal?: Vector3; - size?: Vector3; - angle?: number; - }): Mesh; - private static _ExtrudeShapeGeneric(name, shape, curve, scale, rotation, scaleFunction, rotateFunction, rbCA, rbCP, cap, custom, scene, updtbl, side, instance); - } -} - -declare namespace BABYLON.Internals { - class MeshLODLevel { - distance: number; - mesh: Mesh; - constructor(distance: number, mesh: Mesh); - } -} - -declare namespace 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 namespace 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 namespace 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); - IsGlobal: 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[] | Int32Array, engine: any): WebGLBuffer; - canIntersects(ray: Ray): boolean; - intersects(ray: Ray, positions: Vector3[], indices: number[] | Int32Array, 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 namespace BABYLON { - class VertexBuffer { - private _mesh; - private _engine; - private _buffer; - private _data; - private _updatable; - private _kind; - private _strideSize; - constructor(engine: any, data: number[] | Float32Array, kind: string, updatable: boolean, postponeInternalCreation?: boolean, stride?: number); - isUpdatable(): boolean; - getData(): number[] | Float32Array; - getBuffer(): WebGLBuffer; - getStrideSize(): number; - create(data?: number[] | Float32Array): void; - update(data: number[] | Float32Array): 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; - private static _MatricesIndicesExtraKind; - private static _MatricesWeightsExtraKind; - 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; - static MatricesIndicesExtraKind: string; - static MatricesWeightsExtraKind: string; - } -} - -declare namespace 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 namespace 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, particle: Particle) => void; - startPositionFunction: (worldMatrix: Matrix, positionToUpdate: Vector3, particle: Particle) => 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; - serialize(): any; - static Parse(parsedParticleSystem: any, scene: Scene, rootUrl: string): ParticleSystem; - } -} - -declare namespace BABYLON { - class SolidParticle { - idx: number; - color: Color4; - position: Vector3; - rotation: Vector3; - quaternion: Vector4; - scale: Vector3; - uvs: Vector4; - velocity: Vector3; - alive: boolean; - _pos: number; - _model: ModelShape; - shapeId: number; - idxInShape: number; - constructor(particleIndex: number, positionIndex: number, model: ModelShape, shapeId: number, idxInShape: number); - } - class ModelShape { - shapeID: number; - _shape: Vector3[]; - _shapeUV: number[]; - _positionFunction: (particle: SolidParticle, i: number, s: number) => void; - _vertexFunction: (particle: SolidParticle, vertex: Vector3, i: number) => void; - constructor(id: number, shape: Vector3[], shapeUV: number[], posFunction: (particle: SolidParticle, i: number, s: number) => void, vtxFunction: (particle: SolidParticle, vertex: Vector3, i: number) => void); - } -} - -declare namespace BABYLON { - /** - * Full documentation here : http://doc.babylonjs.com/tutorials/Solid_Particle_System - */ - class SolidParticleSystem implements IDisposable { - particles: SolidParticle[]; - nbParticles: number; - billboard: boolean; - counter: number; - name: string; - mesh: Mesh; - vars: any; - pickedParticles: { - idx: number; - faceId: number; - }[]; - private _scene; - private _positions; - private _indices; - private _normals; - private _colors; - private _uvs; - private _positions32; - private _normals32; - private _fixedNormal32; - private _colors32; - private _uvs32; - private _index; - private _updatable; - private _pickable; - private _isVisibilityBoxLocked; - private _alwaysVisible; - private _shapeCounter; - private _copy; - private _shape; - private _shapeUV; - private _color; - private _computeParticleColor; - private _computeParticleTexture; - private _computeParticleRotation; - private _computeParticleVertex; - private _cam_axisZ; - private _cam_axisY; - private _cam_axisX; - private _axisX; - private _axisY; - private _axisZ; - private _camera; - private _particle; - private _fakeCamPos; - private _rotMatrix; - private _invertMatrix; - private _rotated; - private _quaternion; - private _vertex; - private _normal; - private _yaw; - private _pitch; - private _roll; - private _halfroll; - private _halfpitch; - private _halfyaw; - private _sinRoll; - private _cosRoll; - private _sinPitch; - private _cosPitch; - private _sinYaw; - private _cosYaw; - private _w; - /** - * Creates a SPS (Solid Particle System) object. - * @param name the SPS name, this will be the underlying mesh name - * @param updatable (default true) if the SPS must be updatable or immutable - * @param isPickable (default false) if the solid particles must be pickable - */ - constructor(name: string, scene: Scene, options?: { - updatable?: boolean; - isPickable?: boolean; - }); - /** - * Builds the SPS underlying mesh. Returns a standard Mesh. - * If no model shape was added to the SPS, the return mesh is only a single triangular plane. - */ - buildMesh(): Mesh; - private _resetCopy(); - private _meshBuilder(p, shape, positions, meshInd, indices, meshUV, uvs, meshCol, colors, idx, idxInShape, options); - private _posToShape(positions); - private _uvsToShapeUV(uvs); - private _addParticle(idx, idxpos, model, shapeId, idxInShape); - /** - * Adds some particles to the SPS from the model shape. - * Please read the doc : http://doc.babylonjs.com/tutorials/Solid_Particle_System#create-an-immutable-sps - * @param mesh any Mesh object that will be used as a model for the solid particles. - * @param nb the number of particles to be created from this model - * @param positionFunction an optional javascript function to called for each particle on SPS creation - * @param vertexFunction an optional javascript function to called for each vertex of each particle on SPS creation - */ - addShape(mesh: Mesh, nb: number, options?: { - positionFunction?: any; - vertexFunction?: any; - }): number; - private _rebuildParticle(particle); - /** - * Rebuilds the whole mesh and updates the VBO : custom positions and vertices are recomputed if needed. - */ - rebuildMesh(): void; - /** - * Sets all the particles : this method actually really updates the mesh according to the particle positions, rotations, colors, textures, etc. - * This method calls updateParticle() for each particles of the SPS. - * For an animated SPS, it is usually called within the render loop. - * @param start (default 0) the particle index in the particle array where to start to compute the particle property values - * @param end (default nbParticle - 1) the particle index in the particle array where to stop to compute the particle property values - * @param update (default true) if the mesh must be finally updated on this call after all the particle computations. - */ - setParticles(start?: number, end?: number, update?: boolean): void; - private _quaternionRotationYPR(); - private _quaternionToRotationMatrix(); - /** - * Disposes the SPS - */ - dispose(): void; - /** - * Visibilty helper : Recomputes the visible size according to the mesh bounding box - * doc : http://doc.babylonjs.com/tutorials/Solid_Particle_System#sps-visibility - */ - refreshVisibleSize(): void; - /** Visibility helper : Sets the size of a visibility box, this sets the underlying mesh bounding box. - * @param size the size (float) of the visibility box - * note : this doesn't lock the SPS mesh bounding box. - * doc : http://doc.babylonjs.com/tutorials/Solid_Particle_System#sps-visibility - */ - setVisibilityBox(size: number): void; - /** - * True if the SPS is set as always visible - */ - /** - * Sets the SPS as always visible or not - * doc : http://doc.babylonjs.com/tutorials/Solid_Particle_System#sps-visibility - */ - isAlwaysVisible: boolean; - /** - * True if the SPS visibility box is locked. The underlying mesh bounding box is then not updatable any more. - */ - /** - * Sets the SPS visibility box as locked or not. This enables/disables the underlying mesh bounding box updates. - * doc : http://doc.babylonjs.com/tutorials/Solid_Particle_System#sps-visibility - */ - isVisibilityBoxLocked: boolean; - /** - * Tells to setParticle() to compute the particle rotations or not. - * Default value : true. The SPS is faster when it's set to false. - * Note : the particle rotations aren't stored values, so setting computeParticleRotation to false will prevents the particle to rotate. - */ - computeParticleRotation: boolean; - /** - * Tells to setParticle() to compute the particle colors or not. - * Default value : true. The SPS is faster when it's set to false. - * Note : the particle colors are stored values, so setting computeParticleColor to false will keep yet the last colors set. - */ - computeParticleColor: boolean; - /** - * Tells to setParticle() to compute the particle textures or not. - * Default value : true. The SPS is faster when it's set to false. - * Note : the particle textures are stored values, so setting computeParticleTexture to false will keep yet the last colors set. - */ - computeParticleTexture: boolean; - /** - * Tells to setParticle() to call the vertex function for each vertex of each particle, or not. - * Default value : false. The SPS is faster when it's set to false. - * Note : the particle custom vertex positions aren't stored values. - */ - computeParticleVertex: boolean; - /** - * This function does nothing. It may be overwritten to set all the particles first values. - * The SPS doesn't call this function, you may have to call it by your own. - * doc : http://doc.babylonjs.com/tutorials/Solid_Particle_System#particle-management - */ - initParticles(): void; - /** - * This function does nothing. It may be overwritten to recycle a particle. - * The SPS doesn't call this function, you may have to call it by your own. - * doc : http://doc.babylonjs.com/tutorials/Solid_Particle_System#particle-management - */ - recycleParticle(particle: SolidParticle): SolidParticle; - /** - * Updates a particle : this function should be overwritten by the user. - * It is called on each particle by setParticles(). This is the place to code each particle behavior. - * doc : http://doc.babylonjs.com/tutorials/Solid_Particle_System#particle-management - * ex : just set a particle position or velocity and recycle conditions - */ - updateParticle(particle: SolidParticle): SolidParticle; - /** - * Updates a vertex of a particle : it can be overwritten by the user. - * This will be called on each vertex particle by setParticles() if computeParticleVertex is set to true only. - * @param particle the current particle - * @param vertex the current index of the current particle - * @param pt the index of the current vertex in the particle shape - * doc : http://doc.babylonjs.com/tutorials/Solid_Particle_System#update-each-particle-shape - * ex : just set a vertex particle position - */ - updateParticleVertex(particle: SolidParticle, vertex: Vector3, pt: number): Vector3; - /** - * This will be called before any other treatment by setParticles() and will be passed three parameters. - * This does nothing and may be overwritten by the user. - * @param start the particle index in the particle array where to stop to iterate, same than the value passed to setParticle() - * @param stop the particle index in the particle array where to stop to iterate, same than the value passed to setParticle() - * @param update the boolean update value actually passed to setParticles() - */ - beforeUpdateParticles(start?: number, stop?: number, update?: boolean): void; - /** - * This will be called by setParticles() after all the other treatments and just before the actual mesh update. - * This will be passed three parameters. - * This does nothing and may be overwritten by the user. - * @param start the particle index in the particle array where to stop to iterate, same than the value passed to setParticle() - * @param stop the particle index in the particle array where to stop to iterate, same than the value passed to setParticle() - * @param update the boolean update value actually passed to setParticles() - */ - afterUpdateParticles(start?: number, stop?: number, update?: boolean): void; - } -} - -declare namespace BABYLON { - interface IPhysicsEnginePlugin { - name: string; - initialize(iterations?: number): any; - setGravity(gravity: Vector3): void; - getGravity(): Vector3; - 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; - getWorldObject(): any; - getPhysicsBodyOfMesh(mesh: AbstractMesh): any; - } - 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; - _getGravity(): Vector3; - _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; - getPhysicsBodyOfMesh(mesh: AbstractMesh): any; - getPhysicsPluginName(): string; - 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 HeightmapImpostor: number; - static Epsilon: number; - } -} - -declare namespace BABYLON { - class AnaglyphPostProcess extends PostProcess { - constructor(name: string, ratio: number, camera: Camera, samplingMode?: number, engine?: Engine, reusable?: boolean); - } -} - -declare namespace BABYLON { - class BlackAndWhitePostProcess extends PostProcess { - constructor(name: string, ratio: number, camera: Camera, samplingMode?: number, engine?: Engine, reusable?: boolean); - } -} - -declare namespace 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 namespace BABYLON { - class ColorCorrectionPostProcess extends PostProcess { - private _colorTableTexture; - constructor(name: string, colorTableUrl: string, ratio: number, camera: Camera, samplingMode?: number, engine?: Engine, reusable?: boolean); - } -} - -declare namespace 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 namespace BABYLON { - class DisplayPassPostProcess extends PostProcess { - constructor(name: string, ratio: number, camera: Camera, samplingMode?: number, engine?: Engine, reusable?: boolean); - } -} - -declare namespace BABYLON { - class FilterPostProcess extends PostProcess { - kernelMatrix: Matrix; - constructor(name: string, kernelMatrix: Matrix, ratio: number, camera?: Camera, samplingMode?: number, engine?: Engine, reusable?: boolean); - } -} - -declare namespace BABYLON { - class FxaaPostProcess extends PostProcess { - texelWidth: number; - texelHeight: number; - constructor(name: string, ratio: number, camera: Camera, samplingMode?: number, engine?: Engine, reusable?: boolean); - } -} - -declare namespace 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; - /** - * Gaussian blur multiplier. Multiplies the blur effect - * @type {number} - */ - gaussMultiplier: 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 namespace 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 namespace BABYLON { - class PassPostProcess extends PostProcess { - constructor(name: string, ratio: number, camera: Camera, samplingMode?: number, engine?: Engine, reusable?: boolean); - } -} - -declare namespace 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; - private _samplers; - private _fragmentUrl; - private _parameters; - constructor(name: string, fragmentUrl: string, parameters: string[], samplers: string[], ratio: number | any, camera: Camera, samplingMode?: number, engine?: Engine, reusable?: boolean, defines?: string, textureType?: number); - updateEffect(defines?: string): void; - isReusable(): boolean; - activate(camera: Camera, sourceTexture?: WebGLTexture): void; - isSupported: boolean; - apply(): Effect; - dispose(camera?: Camera): void; - } -} - -declare namespace 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, faceIndex?: number, postProcesses?: PostProcess[]): void; - dispose(): void; - } -} - -declare namespace 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 namespace 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.0006 - * @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.975 - * @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.0 - * @type {number} - */ - fallOff: number; - /** - * The base color of the SSAO post-process - * The final result is "base + ssao" between [0, 1] - * @type {number} - */ - base: 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 namespace BABYLON { - class StereoscopicInterlacePostProcess extends PostProcess { - private _stepSize; - constructor(name: string, camB: Camera, postProcessA: PostProcess, isStereoscopicHoriz: boolean, samplingMode?: number); - } -} - -declare namespace 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 namespace 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 namespace 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 namespace BABYLON { - class ReflectionProbe { - name: string; - private _scene; - private _renderTargetTexture; - private _projectionMatrix; - private _viewMatrix; - private _target; - private _add; - private _attachedMesh; - position: Vector3; - constructor(name: string, size: number, scene: Scene, generateMipMaps?: boolean); - refreshRate: number; - getScene(): Scene; - cubeTexture: RenderTargetTexture; - renderList: AbstractMesh[]; - attachToMesh(mesh: AbstractMesh): void; - dispose(): void; - } -} - -declare namespace 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 namespace 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 namespace BABYLON { - class EdgesRenderer { - edgesWidthScalerForOrthographic: number; - edgesWidthScalerForPerspective: number; - 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 namespace 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 namespace BABYLON { - class RenderingGroup { - index: number; - private _scene; - private _opaqueSubMeshes; - private _transparentSubMeshes; - private _alphaTestSubMeshes; - private _activeVertices; - onBeforeTransparentRendering: () => void; - constructor(index: number, scene: Scene); - render(customRenderFunction: (opaqueSubMeshes: SmartArray, transparentSubMeshes: SmartArray, alphaTestSubMeshes: SmartArray) => void): boolean; - prepare(): void; - dispatch(subMesh: SubMesh): void; - } -} - -declare namespace BABYLON { - class RenderingManager { - static MAX_RENDERINGGROUPS: number; - private _scene; - private _renderingGroups; - private _depthBufferAlreadyCleaned; - private _currentIndex; - private _currentActiveMeshes; - private _currentRenderParticles; - private _currentRenderSprites; - constructor(scene: Scene); - private _renderParticles(index, activeMeshes); - private _renderSprites(index); - private _clearDepthBuffer(); - private _renderSpritesAndParticles(); - render(customRenderFunction: (opaqueSubMeshes: SmartArray, transparentSubMeshes: SmartArray, alphaTestSubMeshes: SmartArray) => void, activeMeshes: AbstractMesh[], renderParticles: boolean, renderSprites: boolean): void; - reset(): void; - dispatch(subMesh: SubMesh): void; - } -} - -declare namespace 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[]; - isPickable: boolean; - actionManager: ActionManager; - 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 namespace BABYLON { - class SpriteManager { - name: string; - cellSize: number; - sprites: Sprite[]; - renderingGroupId: number; - layerMask: number; - onDispose: () => void; - fogEnabled: boolean; - isPickable: 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); - intersects(ray: Ray, camera: Camera, predicate?: (sprite: Sprite) => boolean, fastCheck?: boolean): PickingInfo; - render(): void; - dispose(): void; - } -} - -declare namespace BABYLON.Internals { - class AndOrNotEvaluator { - static Eval(query: string, evaluateCallback: (val: any) => boolean): boolean; - private static _HandleParenthesisContent(parenthesisContent, evaluateCallback); - private static _SimplifyNegation(booleanString); - } -} - -declare namespace 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 namespace 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 namespace 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 namespace BABYLON { - class Gamepads { - private babylonGamepads; - private oneGamepadConnected; - private isMonitoring; - private gamepadEventSupported; - private gamepadSupportAvailable; - private _callbackGamepadConnected; - private static gamepadDOMInfo; - constructor(ongamedpadconnected: (gamepad: Gamepad) => void); - 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 namespace BABYLON { - interface ILoadingScreen { - displayLoadingUI: () => void; - hideLoadingUI: () => void; - loadingUIBackgroundColor: string; - loadingUIText: string; - } - class DefaultLoadingScreen implements ILoadingScreen { - private _renderingCanvas; - private _loadingText; - private _loadingDivBackgroundColor; - private _loadingDiv; - private _loadingTextDiv; - constructor(_renderingCanvas: HTMLCanvasElement, _loadingText?: string, _loadingDivBackgroundColor?: string); - displayLoadingUI(): void; - hideLoadingUI(): void; - loadingUIText: string; - loadingUIBackgroundColor: string; - private _resizeLoadingUI; - } -} - -declare namespace 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 namespace BABYLON { - class SceneSerializer { - static Serialize(scene: Scene): any; - static SerializeMesh(toSerialize: any, withParents?: boolean, withChildren?: boolean): any; - } -} - -declare namespace 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 namespace 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 namespace BABYLON { - class Tags { - static EnableFor(obj: any): void; - static DisableFor(obj: any): void; - static HasTags(obj: any): boolean; - static GetTags(obj: any, asString?: boolean): 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 namespace 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 namespace 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 namespace BABYLON { - interface IAnimatable { - animations: Array; - } - interface ISize { - width: number; - height: number; - } - class Tools { - static BaseUrl: string; - static CorsBehavior: any; - static UseFallbackTexture: boolean; - static Instantiate(className: string): any; - static GetConstructorName(obj: any): any; - static ToHex(i: number): string; - static SetImmediate(action: () => void): void; - static IsExponentOfTwo(value: number): boolean; - static GetExponentOfTwo(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 EncodeArrayBufferTobase64(buffer: ArrayBuffer): string; - static ExtractMinAndMaxIndexed(positions: number[] | Float32Array, indices: number[] | Int32Array, indexStart: number, indexCount: number): { - minimum: Vector3; - maximum: Vector3; - }; - static ExtractMinAndMax(positions: number[] | Float32Array, 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: any, 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 FileAsURL(content: string): string; - 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; - } - /** - * 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 namespace 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 namespace BABYLON { - class VRDeviceOrientationFreeCamera extends FreeCamera { - _alpha: number; - _beta: number; - _gamma: number; - private _offsetOrientation; - private _deviceOrientationHandler; - constructor(name: string, position: Vector3, scene: Scene, compensateDistortion?: boolean); - _onOrientationEvent(evt: DeviceOrientationEvent): void; - attachControl(element: HTMLElement, noPreventDefault?: boolean): void; - detachControl(element: HTMLElement): void; - } -} - -declare var HMDVRDevice: any; -declare var PositionSensorVRDevice: any; -declare namespace BABYLON { - class WebVRFreeCamera extends FreeCamera { - _hmdDevice: any; - _sensorDevice: any; - _cacheState: any; - _cacheQuaternion: Quaternion; - _cacheRotation: Vector3; - _vrEnabled: boolean; - constructor(name: string, position: Vector3, scene: Scene, compensateDistortion?: boolean); - private _getWebVRDevices(devices); - _checkInputs(): void; - attachControl(element: HTMLElement, noPreventDefault?: boolean): void; - detachControl(element: HTMLElement): void; - } -} - -declare namespace 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 namespace 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 namespace 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; - forceBackFacesOnly: boolean; - 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; - private _currentFaceIndex; - private _currentFaceIndexCache; - 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; - serialize(): any; - static Parse(parsedShadowGenerator: any, scene: Scene): ShadowGenerator; - } -} - -declare namespace BABYLON.Internals { -} - -declare namespace 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; - 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; - clone(): BaseTexture; - releaseInternalTexture(): void; - dispose(): void; - serialize(): any; - } -} - -declare namespace BABYLON { - class CubeTexture extends BaseTexture { - url: string; - coordinatesMode: number; - private _noMipmap; - private _files; - private _extensions; - private _textureMatrix; - static CreateFromImages(files: string[], scene: Scene, noMipmap?: boolean): CubeTexture; - constructor(rootUrl: string, scene: Scene, extensions?: string[], noMipmap?: boolean, files?: string[]); - clone(): CubeTexture; - delayLoad(): void; - getReflectionTextureMatrix(): Matrix; - static Parse(parsedTexture: any, scene: Scene, rootUrl: string): CubeTexture; - serialize(): any; - } -} - -declare namespace 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 namespace BABYLON { - class MirrorTexture extends RenderTargetTexture { - mirrorPlane: Plane; - private _transformMatrix; - private _mirrorMatrix; - private _savedViewMatrix; - constructor(name: string, size: number, scene: Scene, generateMipMaps?: boolean); - clone(): MirrorTexture; - serialize(): any; - } -} - -declare namespace 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 namespace BABYLON { - class RenderTargetTexture extends Texture { - isCube: boolean; - static _REFRESHRATE_RENDER_ONCE: number; - static _REFRESHRATE_RENDER_ONEVERYFRAME: number; - static _REFRESHRATE_RENDER_ONEVERYTWOFRAMES: number; - static REFRESHRATE_RENDER_ONCE: number; - static REFRESHRATE_RENDER_ONEVERYFRAME: number; - static REFRESHRATE_RENDER_ONEVERYTWOFRAMES: number; - renderList: AbstractMesh[]; - renderParticles: boolean; - renderSprites: boolean; - coordinatesMode: number; - onBeforeRender: (faceIndex: number) => void; - onAfterRender: (faceIndex: number) => 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; - private _textureMatrix; - constructor(name: string, size: any, scene: Scene, generateMipMaps?: boolean, doNotChangeAspectRatio?: boolean, type?: number, isCube?: boolean); - resetRefreshCounter(): void; - refreshRate: number; - _shouldRender(): boolean; - isReady(): boolean; - getRenderSize(): number; - canRescale: boolean; - scale(ratio: number): void; - getReflectionTextureMatrix(): Matrix; - resize(size: any, generateMipMaps?: boolean): void; - render(useCameraPostProcess?: boolean, dumpForDebug?: boolean): void; - renderToTarget(faceIndex: number, currentRenderList: AbstractMesh[], useCameraPostProcess: boolean, dumpForDebug: boolean): void; - clone(): RenderTargetTexture; - serialize(): any; - } -} - -declare namespace 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 INVCUBIC_MODE: number; - static EQUIRECTANGULAR_MODE: number; - static FIXED_EQUIRECTANGULAR_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; - serialize(): any; - static CreateFromBase64String(data: string, name: string, scene: Scene, noMipmap?: boolean, invertY?: boolean, samplingMode?: number, onLoad?: () => void, onError?: () => void): Texture; - static Parse(parsedTexture: any, scene: Scene, rootUrl: string): BaseTexture; - } -} - -declare namespace 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 namespace BABYLON { - class CannonJSPlugin implements IPhysicsEnginePlugin { - private _useDeltaForWorldStep; - private _world; - private _registeredMeshes; - private _physicsMaterials; - private _gravity; - private _fixedTimeStep; - name: string; - constructor(_useDeltaForWorldStep?: boolean); - initialize(iterations?: number): void; - private _checkWithEpsilon(value); - runOneStep(delta: number): void; - setGravity(gravity: Vector3): void; - getGravity(): Vector3; - registerMesh(mesh: AbstractMesh, impostor: number, options?: PhysicsBodyCreationOptions): any; - private _createShape(mesh, impostor); - private _createConvexPolyhedron(rawVerts, rawFaces, mesh); - private _createHeightmap(mesh, pointDepth?); - private _addMaterial(friction, restitution); - private _createRigidBodyFromShape(shape, mesh, options); - 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; - getWorldObject(): any; - getPhysicsBodyOfMesh(mesh: AbstractMesh): any; - } -} - -declare namespace BABYLON { - class OimoJSPlugin implements IPhysicsEnginePlugin { - private _world; - private _registeredMeshes; - name: string; - private _gravity; - private _checkWithEpsilon(value); - initialize(iterations?: number): void; - setGravity(gravity: Vector3): void; - getGravity(): Vector3; - 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; - getWorldObject(): any; - getPhysicsBodyOfMesh(mesh: AbstractMesh): any; - private _getLastShape(body); - runOneStep(time: number): void; - } -} - -declare namespace 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); - isSupported: 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 namespace 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 namespace 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); - isSupported: boolean; - 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; - dispose(): void; - } -} - -declare namespace 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 namespace 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 namespace BABYLON { - class ProceduralTexture extends Texture { - isCube: boolean; - private _size; - _generateMipMaps: boolean; - isEnabled: boolean; - private _doNotChangeAspectRatio; - private _currentRefreshId; - private _refreshRate; - onGenerated: () => void; - 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, isCube?: 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; - } -} diff --git a/babylonjs/tsconfig.json b/babylonjs/tsconfig.json deleted file mode 100644 index 416305ce73..0000000000 --- a/babylonjs/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "babylonjs-tests.ts" - ] -} \ No newline at end of file diff --git a/backbone-associations/backbone-associations-tests.ts b/backbone-associations/backbone-associations-tests.ts deleted file mode 100644 index eebd48895d..0000000000 --- a/backbone-associations/backbone-associations-tests.ts +++ /dev/null @@ -1,79 +0,0 @@ -// borrowed from the Backbone.Associations tutorials -// separated out into modules to avoid namespace clashes - -import * as Backbone from 'backbone'; - -namespace BackboneAssociationsTests { - namespace OneToOne { - class EmployeeWithManager extends Backbone.AssociatedModel { - constructor(options?) { - super(options); - this.relations = [ - { - type: Backbone.One, //nature of the relationship - key: 'manager', // attribute of Employee - relatedModel: 'Employee' //AssociatedModel for attribute key - } - ]; - } - - defaults() { - return { - age: 0, - fname: "", - lname: "", - manager: null - }; - } - } - } - - namespace OneToMany { - class Location extends Backbone.AssociatedModel { - defaults() { - return { - add1: "", - add2: null, - zip: "", - state: "" - }; - } - } - - class Locations extends Backbone.Collection { - comparator = (c: Backbone.Model) => { - return c.get("Number"); - } - } - - class Project extends Backbone.AssociatedModel { - constructor(options?) { - super(options); - this.relations = [ - { - type: Backbone.Many, //nature of the relation - key: 'locations', //attribute of Project - collectionType: Locations, //Collection to be used. - relatedModel: Location //Optional - } - ]; - } - - defaults() { - return { - name: "", - number: 0, - locations: [] - } - } - } - - function reverseAssociationTest() { - var local = new Location({ state: "Hertfordshire" }); - var project = new Project({ name: "The Old Pond Project" }); - local.set("oddRelationTo", project); - var parents = project.parents; - } - } - -} diff --git a/backbone.marionette/backbone.marionette-tests.ts b/backbone.marionette/backbone.marionette-tests.ts deleted file mode 100644 index b5eb9d07c6..0000000000 --- a/backbone.marionette/backbone.marionette-tests.ts +++ /dev/null @@ -1,322 +0,0 @@ -import * as Marionette from 'backbone.marionette'; -import * as Backbone from 'backbone'; - -namespace MarionetteTests { - class DestroyWarn extends Marionette.Behavior { - // you can set default options - // just like you can in your Backbone Models - // they will be overriden if you pass in an option with the same key - defaults = { - "message": "you are destroying!" - }; - - // behaviors have events that are bound to the views DOM - events = { - "click @ui.destroy": "warnBeforeDestroy" - }; - - warnBeforeDestroy() { - alert(this.options.message); - // every Behavior has a hook into the - // view that it is attached to - this.view.destroy(); - } - } - - - Marionette.Behaviors.getBehaviorClass = (options, key) => { - if (key === "DestroyWarn") - return DestroyWarn; - - return undefined; - }; - - class MyRouter extends Marionette.AppRouter { - // "someMethod" must exist at controller.someMethod - appRoutes = { - "some/route": "someMethod" - }; - - /* standard routes can be mixed with appRoutes/Controllers above */ - routes = { - "some/otherRoute": "someOtherMethod" - }; - - someOtherMethod() { - // do something here. - } - - } - - class MyApplication extends Marionette.Application { - initialize(options?: any) { - console.log("initializing application"); - this.layoutView = new AppLayoutView(); - } - - layoutView: AppLayoutView; - mainRegion: Marionette.Region; - - onStart() { - this.mainRegion = new Marionette.Region({ el: '#main' }); - this.layoutView.addRegion('main', this.mainRegion); - this.layoutView.render(); - this.layoutView.showChildView('main', new MyView(new MyModel)); - let view: Backbone.View = this.layoutView.getChildView('main'); - let regions: {[key: string]: Marionette.Region} = this.layoutView.getRegions(); - let prefix: string = this.layoutView.childViewEventPrefix; - let region: Marionette.Region = this.layoutView.removeRegion('main'); - let layout: Marionette.LayoutView = this.layoutView.destroy(); - } - } - - class AppLayoutView extends Marionette.LayoutView { - constructor() { - super({ el: 'body' }); - } - - template() { - return "
"; - } - - initialize(options?: any) { - console.log("initializing layoutview"); - } - } - - class MyModel extends Backbone.Model { - - constructor(options?: any) { - super(options); - } - - getName(): string { - return this.get('name'); - } - - setName(value: string) { - this.set(value); - } - } - - class MyBaseView extends Marionette.View { - - constructor() { - super(); - this.getOption('foo'); - this.triggers = { - 'click .foo': 'bar' - }; - } - - } - - class MyView extends Marionette.ItemView { - behaviors: any; - - constructor(model: MyModel) { - super({ model: model }); - - this.ui = { - destroy: '.destroy' - }; - - this.behaviors = { - DestroyWarn: { - message: 'hello' - } - }; - } - - template() { - return '

' + this.model.getName() + '

'; - } - }; - - - class MainRegion extends Marionette.Region { - constructor() { - super(); - this.el = '#main'; - } - } - - - class MyObject extends Marionette.Object { - name: string; - options: any; - - constructor() { - super(); - this.name = 'Adam'; - - this.options = { - name: 'Foo' - }; - - this.on("before:destroy", () => { - console.log("before:destroy"); - }); - } - - onBeforeDestroy(arg: any) { - console.log("in onBeforeDestroy with arg " + arg); - } - } - - class MyRegion extends Marionette.Region { - constructor() { - super(); - this.el = '#main-nav'; - } - } - - class MyJQueryRegion extends Marionette.Region { - constructor() { - super(); - this.el = $('#main-nav'); - } - } - - class MyHtmlElRegion extends Marionette.Region { - constructor() { - super(); - this.el = document.querySelector("body"); - } - } - - class MyCollectionView extends Marionette.CollectionView { - constructor() { - super(); - this.childView = MyView; - this.childEvents = { - render: function () { - console.log("a childView has been rendered"); - } - }; - - this.childViewOptions = function (model: any, index: any): any { - // do some calculations based on the model - return { - foo: "bar", - childIndex: index - } - }; - - this.childViewOptions = { - foo: "bar" - }; - - this.childViewEventPrefix = "some:prefix"; - - this.on('some:prefix:render', function () { - - }); - - } - } - - export var app: MyApplication; - - function ApplicationTests() { - app = new MyApplication(); - - app.start(); - - var view = new MyView(new MyModel()); - app.mainRegion.show(view); - } - - function ObjectTests() { - var obj = new MyObject(); - console.log(obj.getOption('name')); - obj.destroy("goodbye"); - } - - function RegionManagerTests() { - var rm = new Marionette.RegionManager(); - rm.addRegions({ - contentRegion: { - el: '#content', - regionClass: MainRegion - }, - - navigationRegion: { - el: '#navigation', - regionClass: MainRegion, - - // Options passed to instance of `MyOtherRegion` for - // the `navigationRegion` on `App` - navigationOption: 42, - anotherNavigationOption: 'foo' - }, - - footerRegion: { - regionClass: MainRegion, - someOption: 42, - someValue: 'value' - } - }); - } - - function RegionTests() { - var myView: Marionette.View = new MyView(new MyModel()); - - // render and display the view - app.mainRegion.show(myView); - - // empties the current view - app.mainRegion.empty(); - - myView = new MyView(new MyModel()); - app.mainRegion.show(myView, { preventDestroy: true, forceShow: true, triggerAttach: true, triggerBeforeAttach: false }); - - var hasView: boolean = app.mainRegion.hasView(); - - app.mainRegion.reset(); - - Marionette.Region.prototype.attachHtml = function (view: any): void { - this.$el.empty().append(view.el); - } - - myView = new Marionette.View({ - el: $("#existing-view-stuff") - }); - - app.mainRegion.attachView(myView); - - app.mainRegion.on("empty", function (view: any, region: any, options: any) { - // manipulate the `view` or do something extra - // with the `region` - // you also have access to the `options` that were passed to the Region.show call - }); - - } - - function CollectionViewTests() { - var cv = new MyCollectionView(); - cv.collection.add(new MyModel()); - app.mainRegion.attachView(cv); - cv.addEmptyView(new MyModel, MyView); - cv.proxyChildEvents(new MyView(new MyModel)); - let children: Backbone.ChildViewContainer> = cv.destroyChildren(); - let view: Marionette.CollectionView> = cv.destroy(); - } - - class MyController extends Marionette.Controller { - - } - - function AppRouterTests() { - var myController = new MyController(); - var router = new MyRouter(); - - router.appRoute("/foo", "fooThat"); - - router.processAppRoutes(myController, { - "foo": "doFoo", - "bar/:id": "doBar" - }); - - } -} diff --git a/backbone.marionette/index.d.ts b/backbone.marionette/index.d.ts deleted file mode 100644 index edaab2c2d6..0000000000 --- a/backbone.marionette/index.d.ts +++ /dev/null @@ -1,1517 +0,0 @@ -// Type definitions for Marionette -// Project: https://github.com/marionettejs/ -// Definitions by: Zeeshan Hamid , Natan Vivo , Sven Tschui -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -import * as Backbone from 'backbone'; - -export as namespace Marionette; -export = Marionette; - -// declarations for Backbone.BabySitter and Backbone.Wreqr, different projects but included in MarionetteJS -declare module 'backbone' { - // Backbone.BabySitter - class ChildViewContainer> { - - constructor(initialViews?: any[]); - - add(view: TView, customIndex?: number): void; - findByModel(model: TModel): TView; - findByModelCid(modelCid: string): TView; - findByCustom(index: number): TView; - findByIndex(index: number): TView; - findByCid(cid: string): TView; - remove(view: TView): void; - call(method: any): void; - apply(method: any, args?: any[]): void; - - //mixins from Collection (copied from Backbone's Collection declaration) - - all(iterator: (element: TView, index: number) => boolean, context?: any): boolean; - any(iterator: (element: TView, index: number) => boolean, context?: any): boolean; - contains(value: any): boolean; - detect(iterator: (item: any) => boolean, context?: any): any; - each(iterator: (element: TView, index: number, list?: any) => void, context?: any): any; - every(iterator: (element: TView, index: number) => boolean, context?: any): boolean; - filter(iterator: (element: TView, index: number) => boolean, context?: any): TView[]; - find(iterator: (element: TView, index: number) => boolean, context?: any): TView; - first(): TView; - forEach(iterator: (element: TView, index: number, list?: any) => void, context?: any): void; - include(value: any): boolean; - initial(): TView; - initial(n: number): TView[]; - invoke(methodName: string, args?: any[]): any; - isEmpty(object: any): boolean; - last(): TView; - last(n: number): TView[]; - lastIndexOf(element: TView, fromIndex?: number): number; - map(iterator: (element: TView, index: number, context?: any) => U, context?: any): U[]; - pluck(attribute: string): any[]; - reject(iterator: (element: TView, index: number) => boolean, context?: any): TView[]; - rest(): TView; - rest(n: number): TView[]; - select(iterator: any, context?: any): any[]; - some(iterator: (element: TView, index: number) => boolean, context?: any): boolean; - toArray(): any[]; - without(...values: any[]): TView[]; - } - - // Backbone.Wreqr - namespace Wreqr { - - namespace radio { - - function channel(channelName: string): Channel; - - } - - class Channel { - - constructor(channelName: string); - - vent: Backbone.Wreqr.EventAggregator; - reqres: Backbone.Wreqr.RequestResponse; - commands: Backbone.Wreqr.Commands; - channelName: string; - - reset(): Channel; - connectEvents(hash: string, context: any): Channel; - connectCommands(hash: string, context: any): Channel; - connectRequests(hash: string, context: any): Channel; - - } - - class Handlers extends Backbone.Events { - - constructor(options?: any); - - options: any; - - setHandler(name: string, handler: any, context?: any): void; - hasHandler(name: string): boolean; - getHandler(name: string): Function; - removeHandler(name: string): void; - removeAllHandlers(): void; - } - - class CommandStorage { - - constructor(options?: any); - - getCommands(commandName: string): Commands; - addCommand(commandName: string, args: any): void; - clearCommands(commandName: string): void; - } - - class Commands extends Handlers { - - constructor(options?: any); - - storageType: CommandStorage; - execute(name: string, ...args: any[]): void; - } - - class RequestResponse extends Handlers { - - constructor(options?: any); - - request(...args: any[]): any; - } - - class EventAggregator extends Backbone.Events { - - constructor(options?: any); - } - } -} - -declare namespace Marionette { - - /** - * Retrieve an object's attribute either directly from the object, or - * from the object's this.options, with this.options taking precedence. - */ - function getOption(target: any, optionName: string): any; - - /** - * Trigger an event and a corresponding method on the target object. - * All arguments that are passed to the triggerMethod call are passed along - * to both the event and the method, with the exception of the event name not - * being passed to the corresponding method. - */ - function triggerMethod(name: string, ...args: any[]): any; - - /** - * Invoke triggerMethod on a specific context. - * This is useful when it's not clear that the object has triggerMethod defined. - */ - function triggerMethodOn(ctx: any, name: string, ...args: any[]): any; - - /** - * Monitor a view's state, and after it has been rendered and shown in the DOM, - * trigger a "dom:refresh" event every time it is re-rendered. - */ - function MonitorDOMRefresh(view: Backbone.View): void; - - /** - * This method is used to bind a backbone "entity" (collection/model) to methods on a target object. - * @param target An object that must have a listenTo method from the EventBinder object. - * @param entity The entity (Backbone.Model or Backbone.Collection) to bind the events from. - * @param bindings a hash of { "event:name": "eventHandler" } configuration. Multiple handlers can be separated by a space. A function can be supplied instead of a string handler name. - */ - function bindEntityEvents(target: any, entity: any, bindings: any): void; - - /** - * This method can be used to unbind callbacks from entities' (collection/model) events. It's the opposite of bindEntityEvents - * @param target An object that must have a listenTo method from the EventBinder object. - * @param entity The entity (Backbone.Model or Backbone.Collection) to bind the events from. - * @param bindings a hash of { "event:name": "eventHandler" } configuration. Multiple handlers can be separated by a space. A function can be supplied instead of a string handler name. - */ - function unbindEntityEvents(target: any, entity: any, bindings: any): void; - - class Callbacks { - add(callback: Function, contextOverride: any): void; - run(options: any, context: any): void; - reset(): void; - } - - /** - * A base class which other classes can extend from. Object incorporates many - * backbone conventions and utilities like initialize and Backbone.Events. - */ - class Object extends Backbone.Events { - /** - * Initialize is called immediately after the Object has been instantiated, - * and is invoked with the same arguments that the constructor received. - */ - initialize(options?: any): void; - - /** - * Retrieve an object's attribute either directly from the object, or from - * the object's this.options, with this.options taking precedence. - * @param optionName the name of the option to retrieve. - */ - getOption(optionName: string): any; - - /** - * Objects have a destroy method that unbind the events that are directly - * attached to the instance. Invoking the destroy method will trigger a - * "before:destroy" event and corresponding onBeforeDestroy method call. - * These calls will be passed any arguments destroy was invoked with. - * @param args any arguments to pass to the "before:destory" event and call to - * onBeforeDestroy. - */ - destroy(...args: any[]): void; - } - - /** - * A Controller is an object used in the Marionette Router. Controllers are - * where you store your Router's callbacks. - */ - class Controller extends Backbone.Events { - /** - * @param options Options that should be stored in this options. Can be retreived via - * getOption. - */ - constructor(options?: any); - - /** - * Handles unbinding all of the events that are directly attached to the - * controller instance, as well as those that are bound using the - * EventBinder from the controller. - * - * Invoking the destroy method will trigger the "before:destroy" and - * "destroy" events and the corresponding onBeforeDestory and onDestroy - * method calls. These calls will be passed any arguments destroy was - * invoked with. - */ - destroy(...args: any[]): void; - - /** - * Retrieve an object's attribute either directly from the object, or from - * the object's this.options, with this.options taking precedence. - * @param optionName the name of the option to retrieve. - */ - getOption(optionName: string): any; - - triggerMethod(name: string, ...args: any[]): any; - } - - interface RegionConstructionOptions { - /** - * Specifies the element for the region to manage. This may be - * a selector string, a raw DOM node reference or a jQuery wrapped - * DOM node. - */ - el?: any; - } - - interface RegionShowOptions { - /** - * If you replace the current view with a new view by calling show, by - * default it will automatically destroy the previous view. You can - * prevent this behavior by setting this option to true. - */ - preventDestroy?: boolean; - - /** - * If you re-call show with the same view, by default nothing will happen - * because the view is already in the region. You can force the view to be - * re-shown by setting this option to true. - */ - forceShow?: boolean; - - /** - * Regions that are attached to the document when you execute show are - * special in that the views that they show will also become attached - * to the document. These regions fire a pair of triggerMethods on all - * of the views that are about to be attached � even the nested ones. - * This can cause a performance issue if you're rendering hundreds or - * thousands of views at once. - * If you think these events might be causing some lag in your app, you - * can selectively turn them off with the triggerBeforeAttach - * and triggerAttach properties. - */ - triggerBeforeAttach?: boolean; - - /** - * Regions that are attached to the document when you execute show are - * special in that the views that they show will also become attached - * to the document. These regions fire a pair of triggerMethods on all - * of the views that are about to be attached � even the nested ones. - * This can cause a performance issue if you're rendering hundreds or - * thousands of views at once. - * If you think these events might be causing some lag in your app, you - * can selectively turn them off with the triggerBeforeAttach - * and triggerAttach properties. - */ - triggerAttach?: boolean; - } - - interface RegionEmptyOptions { - /** - * If you would like to prevent the view currently shown in the region - * from being destroyed you can set this option to true to prevent the - * default destroy behavior. - */ - preventDestroy?: boolean; - } - - /** - * Regions provide consistent methods to manage, show and destroy views in - * your applications and layouts. They use a jQuery selector to show your - * views in the correct place. - */ - class Region extends Marionette.Object { - - /** - * Build an instance of a region by passing in a configuration object and - * a default region class to use if none is specified in the config. - * The config object should either be a string as a jQuery DOM selector, - * a Region class directly, or an object literal that specifies a selector, - * a custom regionClass, and any options to be supplied to the region - */ - static buildRegion(regionConfig: any, defaultRegionType: any): Region; - - /** - * You can specify an el for the region to manage at the time the region - * is instantiated. - */ - constructor(options?: RegionConstructionOptions); - - /** - * Contains the element that this region should manage. - */ - el: any; - - /** - * Renders and displays the specified view in this region. - * @param view the view to display. - */ - show(view: Backbone.View, options?: RegionShowOptions): void; - - /** - * Attaches an existing view to a region, without rendering or showing the view, - * and without replacing the HTML content of the region. - */ - attachView(view: Backbone.View, options?: RegionShowOptions): any; - - /** - * Override this method to change how the new view is - * appended to the `$el` that the region is managing - */ - attachHtml(view: Backbone.View): void; - - /** - * A region can be reset at any time. This destroys any existing view - * being displayed, and deletes the cached el. The next time the region - * shows a view, the region's el is queried from the DOM. - */ - reset(): any; - - /** - * If you wish to check whether a region has a view, you can use the hasView function. This will return a boolean value depending whether or not the region is showing a view. - */ - hasView(): boolean; - - /** - * Empties the current view from the region. - */ - empty(options?: RegionEmptyOptions): any; - - /** - * @returns view that this region has. - */ - currentView: Backbone.View; - } - - interface RegionDefaults { - /** - * A selector string indicating which element to assign the region two. - */ - selector?: string; - - /** - * A selector string, a jQuery object, or an HTML node indicating which element - * the region should use. - */ - el?: any; - - /** - * A custom region class. - */ - regionClass?: any; - - /** - * Ordinarily regions enforce the presence of a backing DOM element. In - * some instances it may be desirable to allow regions to be instantiated - * and used without an element, such as when regions defined by a parent - * LayoutView class are used by only some of its subclasses. In these - * instances, the region can be defined with this option set to true, - * suppressing the missing element error and causing show calls to the - * region to be treated as no-ops. - */ - allowMissingEl?: boolean; - } - - /** - * Region managers provide a consistent way to manage a number of Marionette.Region - * objects within an application. The RegionManager is intended to be used by - * other objects, to facilitate the addition, storage, retrieval, and removal of - * regions from that object. - */ - class RegionManager extends Controller { - - /** - * Constructor. - * @param options May contain an optional `regions` option. These regions - * are passed directly into addRegions for this instance. - */ - constructor(options?: any); - - /** - * Adds one or more regions to this RegionManager instance. - * @param regionDefinitions a function returning an object literal with the region definitions. The function will - * be called with the RegionManager instance context and all the arguments passed to addRegions. - * @param defaults Specifies default options that will be applied to every region added. - * @returns an object literal with all the created regions. - */ - addRegions(regionDefinitions: Function, defaults?: RegionDefaults): any; - - /** - * Adds one or more regions to this RegionManager instance. - * @param regionDefinitions an object literal containing region names as keys and region - * definitions as values. - * @param defaults Specifies default options that will be applied to every region added. - * @returns an object literal with all the created regions. - */ - addRegions(regionDefinitions: { [regionName: string]: any }, defaults?: RegionDefaults): any; - - /** - * Adds a region to this RegionManager. - * @param name the region name. - * @param definition the region definition. This may be a selector, object literal - * with various region creation options or an instance of a region object. - */ - addRegion(name: string, definition: any): Region; - - /** - * Gets the region with the specified name from this RegionManager. - */ - get(name: string): Region; - - /** - * Removes the region with the specified name from this RegionManager. - */ - removeRegion(name: string): void; - - /** - * Removes all regions from the RegionManager. - */ - removeRegions(): void; - - /** - * Empties all regions from the RegionManager instance. - */ - emptyRegions(): void; - - /** - * Destroys the RegionManager instance entierly which both destroys and - * removes all regions from the RegionManager instance. - */ - destroy(): void; - - //mixins from Collection (copied from Backbone's Collection declaration) - - /** - * Returns true if all of the values in the list pass the predicate truth test. - * @alias every - */ - all(iterator: (element: Region, index: number) => boolean, context?: any): boolean; - - /** - * Returns true if any of the values in the list pass the predicate truth test. Short-circuits and stops traversing the list if a true element is found. - */ - any(iterator: (element: Region, index: number) => boolean, context?: any): boolean; - - /** - * Returns true if the value is present in the list. - * @alias include - */ - contains(value: any): boolean; - - /** - * Looks through each value in the list, returning the first one that passes a truth test (predicate), or undefined if no value passes the test.The function returns as soon as it finds an acceptable element, and doesn't traverse the entire list. - * @alias find - */ - detect(iterator: (item: any) => boolean, context?: any): any; - - /** - * Iterates over the regions in this instance, yielding each in turn to an - * iterator function. The iterator is bound to the context object, if one - * is passed. - * @alias forEach - */ - each(iterator: (element: Region, index: number, list?: any) => void, context?: any): void; - - /** - * Returns true if all of the values in the list pass the predicate truth test. - * @alias all - */ - every(iterator: (element: Region, index: number) => boolean, context?: any): boolean; - - /** - * Looks through each Region in the collection, returning an array of all - * the values that pass a truth test (predicate). - * @alias select - */ - filter(iterator: (element: Region, index: number) => boolean, context?: any): Region[]; - - /** - * Looks through each Region in this instance, returning the first one that passes a truth test (predicate), or undefined if no value passes the test.The function returns as soon as it finds an acceptable element, and doesn't traverse the entire list. - * @alias detect - */ - find(iterator: (element: Region, index: number) => boolean, context?: any): Region; - - /** - * Returns the first Region of this RegionManager. - */ - first(): Region; - - /** - * Returns the first n Regions of this RegionManager. - */ - first(n: number): Region[]; - - /** - * Iterates over the regions in this instance, yielding each in turn to an - * iterator function. The iterator is bound to the context object, if one - * is passed. - * @alias each - */ - forEach(iterator: (element: Region, index: number, list?: any) => void, context?: any): void; - - /** - * Returns true if the value is present in the list. - * @alias contains - */ - include(value: any): boolean; - - /** - * Returns everything but the last n Regions of this instance. - * @param n if specified determines the number of regions to exclude, - * otherwise only the last element is excluded. - */ - initial(n: number): Region[]; - - /** - * Calls the method named by methodName on each value in the collection. Any extra - * arguments passed to invoke will be forwarded on to the method invocation. - */ - invoke(methodName: string, args?: any[]): any; - - /** - * Returns true if the RegionManager contains no regions. - */ - isEmpty(object: any): boolean; - - /** - * Returns the last element of a collection. - */ - last(): Region; - - /** - * Returns the last n elements of the collection. - */ - last(n: number): Region[]; - - /** - * Returns the index of the last occurrence of element in the collection, or -1 if - * element is not present. - * @param fromIndex if specified starts the search at the given index. - */ - lastIndexOf(element: Region, fromIndex?: number): number; - - /** - * Produces a new array of values by mapping each value in the collection through a - * transformation function (iterator). - * @alias collect - */ - map(iterator: (element: Region, index: number, context?: any) => any[], context?: any): any[]; - - /** - * Pluck an attribute from each model in the collection. Equivalent to - * calling map and returning a single attribute from the iterator. - */ - pluck(attribute: string): any[]; - - /** - * Returns the values in the collection without the elements that the truth test - * (predicate) passes. The opposite of filter. - */ - reject(iterator: (element: Region, index: number) => boolean, context?: any): Region[]; - - /** - * Returns the rest of the elements of the collection. - * Pass an index to return the values of the array from that index onward. If not - * specified the first item in the collection is dropped. - * @alias tail, drop - */ - rest(n: number): Region[]; - - /** - * Looks through each value in the collection, returning an array of all - * the values that pass a truth test (predicate). - * @alias filter - */ - select(iterator: any, context?: any): Region[]; - - /** - * Returns true if any of the values in the list pass the predicate truth test. Short-circuits and stops traversing the list if a true element is found. - * @alias any - */ - some(iterator: (element: Region, index: number) => boolean, context?: any): boolean; - - /** - * Creates an array containing the regions in this instance. - */ - toArray(): Region[]; - - /** - * Returns an array of all the regions in the RegionManager except the ones specified. - */ - without(...values: any[]): Region[]; - } - - /** - * The TemplateCache provides a cache for retrieving templates from script blocks - * in your HTML. This will improve the speed of subsequent calls to get a template. - */ - class TemplateCache { - /** - * To use the TemplateCache, call the get method on TemplateCache directly. Internally, instances of the TemplateCache class will be created and stored but you do not have to manually create these instances yourself. get will return a compiled template function. - */ - static get(templateId: string): any; - - /** - * You can clear one or more, or all items from the cache using the clear - * method. Clearing a template from the cache will force it to re-load - * from the DOM the next time it is retrieved. - * @param the templateId used for loading / caching of the templates to clear. If none specified, all templates will be cleared from the cache. - */ - static clear(...templateId: string[]): void; - - /** - * The default template retrieval is to select the template contents from the - * DOM using jQuery. If you wish to change the way this works, you can - * override this method on the TemplateCache object. - */ - loadTemplate(templateId: string): any; - - /** - * he default template compilation passes the results from loadTemplate to - * the compileTemplate function, which returns an underscore.js compiled - * template function. When overriding compileTemplate remember that it - * must return a function which takes an object of parameters and values - * and returns a formatted HTML string. - */ - compileTemplate(rawTemplate: any): any; - } - - /** - * The Renderer object was extracted from the ItemView rendering process, in - * order to create a consistent and re-usable method of rendering a template - * with or without data. - */ - class Renderer { - /** - * This method returns a string containing the result of applying the - * template using the data object as the context. - * @param template The template to render. If this is a function this is - * treated as a pre-compiled template and does not try to compile it again. This - * allows any view that supports a template parameter to specify a pre-compiled - * template function as the template setting. The template function does not - * have to be any specific template engine. It only needs to be a function - * that returns valid HTML as a string from the data parameter passed to - * the function. - */ - static render(template: any, data: any): string; - } - - /** - * This base view provides some common and core functionality for other views - * to take advantage of. - * Note: The Marionette.View class is not intended to be used directly. It - * exists as a base view for other view classes to be extended from, and to - * provide a common location for behaviors that are shared across all views. - */ - class View extends Backbone.View { - - constructor(options?: Backbone.ViewOptions); - - /** - * Defines behaviors attached to this view. - */ - behaviors: any; - - /** - * Defines `triggers` to forward DOM events to view - * events. `triggers: {"click .foo": "do:foo"}` - */ - triggers:{[key:string]:any}; - - /** - * A configuration hash for models. The left side is the event on - * the model, and the right side is the name of the - * method on the view or a function to handle the event. This property - * can also be a function that returns the hash described above. - */ - modelEvents: any; - - /** - * A configuration hash for collections. The left side is the event on - * the collection, and the right side is the name of the - * method on the view or a function to handle the event. This property - * can also be a function that returns the hash described above. - */ - collectionEvents: any; - - /** - * In several cases you need to access ui elements inside the view to - * retrieve their data or manipulate them. For example you have a certain - * div element you need to show/hide based on some state, or other ui - * element that you wish to set a css class to it. Instead of having - * jQuery selectors hanging around in the view's code you can define a - * ui hash that contains a mapping between the ui element's name and its - * jQuery selector. Afterwards you can simply access it via - * this.ui.elementName. - */ - ui: any; - - /** - * There may be some cases where you need to change the template that is - * used for a view, based on some simple logic such as the value of a - * specific attribute in the view's model. To do this, you can provide a - * getTemplate function on your views and use this to return the template - * that you need. - */ - getTemplate(): any; - - - /** - * Retrieve an object's attribute either directly from the object, or - * from the object's this.options, with this.options taking precedence. - */ - getOption(optionName:string): T; - - mixinTemplateHelpers(target?: any): any; - configureTriggers(): any; - - /** - * View implements a destroy method, which is called by the region managers automatically. As part of the implementation. - */ - destroy(...args: any[]): void; - - /** - * In several cases you need to access ui elements inside the view to - * retrieve their data or manipulate them. For example you have a certain - * div element you need to show/hide based on some state, or other ui - * element that you wish to set a css class to it. Instead of having jQuery - * selectors hanging around in the view's code you can define a ui hash - * that contains a mapping between the ui element's name and its jQuery - * selector. Afterwards you can simply access it via this.ui.elementName. - * This functionality is provided via the bindUIElements method. - * Since View doesn't implement the render method, then if you directly - * extend from View you will need to invoke this method from your render - * method. In ItemView and CompositeView this is already taken care of. - */ - bindUIElements(): any; - - unbindUIElements(): any; - - triggerMethod(name: string, ...args: any[]): any; - - /** - * Called on the view instance when the view has been rendered and - * displayed. This event can be used to react to when a view has been - * shown via a region. A common use case for the onShow method is to - * use it to add children views. - */ - onShow(): void; - - /** - * Triggered just after the view has been destroyed. - */ - onDestroy(): void; - - /** - * When destroying a view, an onBeforeDestroy method will be called, if - * it has been provided, just before the view destroys. It will be passed - * any arguments that destroy was invoked with. - */ - onBeforeDestroy(...args: any[]): void; - - /** - * Called anytime that showing the view in a Region causes it to be - * attached to the document. - */ - onAttach(): void; - - /** - * Triggered right before the view is attached to the document. - */ - onBeforeAttach(): void; - - /** - * Triggered after the view has been rendered, has been shown in the DOM via a Marionette.Region, and has been re-rendered. - * This event / callback is useful for DOM-dependent UI plugins such as jQueryUI or KendoUI. - */ - onDomRefresh(): void; - - /** - * Internal properties extended in Marionette.View. - */ - isDestroyed: boolean; - supportsRenderLifecycle: boolean; - supportsDestroyLifecycle: boolean; - } - - /** - * An ItemView is a view that represents a single item. That item may be - * a Backbone.Model or may be a Backbone.Collection. Whichever it is though, - * it will be treated as a single item. - */ - class ItemView extends View { - - constructor(options?: Backbone.ViewOptions); - - /** - * Item views will serialize a model or collection, by default, by calling - * .toJSON on either the model or collection. If both a model and - * collection are attached to an item view, the model will be used as the - * data source. The results of the data serialization will be passed to - * the template that is rendered. - * - * If you need custom serialization for your data, you can provide a serializeData - * method on your view. It must return a valid JSON object, as if you had - * called .toJSON on a model or collection. - */ - serializeData(): any; - - /** - * Renders the view. It is unwise to override the render method of any - * Marionette view. Instead, you should use the onBeforeRender and - * onRender callbacks to layer in additional functionality to the - * rendering of your view. - */ - render(): ItemView; - - /** - * Triggered before an ItemView is rendered. - */ - onBeforeRender(): void; - - /** - * Triggered after the view has been rendered. You can implement this in - * your view to provide custom code for dealing with the view's el after - * it has been rendered. - */ - onRender(): void; - } - - - interface CollectionViewOptions extends Backbone.ViewOptions { - - /** - * By default the CollectionView will maintain a sorted collection's order - * in the DOM. This behavior can be disabled by specifying {sort: false} - * on initialize. - */ - sort?: boolean; - - /** - * This option is useful when you have performance issues when you - * resort your CollectionView. Without this option, your CollectionView - * will be completely re-rendered, which can be costly if you have a - * large number of elements or if your ChildViews are complex. If this - * option is activated, when you sort your Collection, there will be no - * re-rendering, only the DOM nodes will be reordered. This can be a - * problem if your ChildViews use their collection's index in their - * rendering. In this case, you cannot use this option as you need to - * re-render each ChildView. - * - * If you combine this option with a filter that changes the views that - * are to be displayed, reorderOnSort will be bypassed to render new - * children and remove those that are rejected by the filter. - */ - reorderOnSort?: boolean; - } - - /** - * The CollectionView will loop through all of the models in the specified - * collection, render each of them using a specified childView, then append - * the results of the child view's el to the collection view's el. By - * default the CollectionView will maintain a sorted collection's order in the - * DOM. This behavior can be disabled by specifying {sort: false} on - * initialize. - */ - class CollectionView> extends View { - constructor(options?: CollectionViewOptions); - - /** - * Specify a childView in your collection view definition. This must be a - * Backbone view object definition, not an instance. It can be any - * Backbone.View or be derived from Marionette.ItemView - */ - childView: new (...args:any[]) => TView; - - /** - * There may be scenarios where you need to pass data from your parent - * collection view in to each of the childView instances. To do this, - * provide a childViewOptions definition on your collection view as an - * object literal. This will be passed to the constructor of your childView - * as part of the options. - * - * You can also specify the childViewOptions as a function, if you need to - * calculate the values to return at runtime. The model will be passed - * into the function should you need access to it when calculating - * childViewOptions. The function must return an object, and the attributes of - * the object will be copied to the childView instance's options. - */ - childViewOptions: any; - - /** - * You can customize the event prefix for events that are forwarded through - * the collection view. To do this, set the childViewEventPrefix on the - * collection view. - */ - childViewEventPrefix: string; - - /** - * You can specify a childEvents hash or method which allows you to - * capture all bubbling childEvents without having to manually set bindings. - * The keys of the hash can either be a function or a string that is the - * name of a method on the collection view. - */ - childEvents: any; - - /** - * When a collection has no children, and you need to render a view other than - * the list of childViews, you can specify an emptyView attribute on your collection - * view. - */ - emptyView: any; - - /** - * Similar to childView and childViewOptions, there is an emptyViewOptions - * property that will be passed to the emptyView constructor. It can be - * provided as an object literal or as a function. If emptyViewOptions - * aren't provided the CollectionView will default to passing the - * childViewOptions to the emptyView. - */ - emptyViewOptions: any; - - /** - * The CollectionView uses Backbone.BabySitter to store and manage its - * child views. This allows you to easily access the views within the - * collection view, iterate them, find them by a given indexer such as the - * view's model or collection, and more. - */ - children: Backbone.ChildViewContainer; - - /** - * The render method of the collection view is responsible for rendering the - * entire collection. It loops through each of the children in the collection - * and renders them individually as an childView. - */ - render(): CollectionView; - - /** - * The addChild method is responsible for rendering the childViews and - * adding them to the HTML for the collectionView instance. It is also - * responsible for triggering the events per ChildView. In most cases you - * should not override this method. - */ - addChild(item: any, ChildView: TView, index: Number): void; - - /** Render the child view */ - renderChildView(view: TView, index: Number): void; - - /** - * When a custom view instance needs to be created for the childView that - * represents a child, override the buildChildView method. This method - * takes three parameters and returns a view instance to be used as the - * child view. - */ - buildChildView(child: any, ItemViewType: any, itemViewOptions: any): TView; - - /** - * Remove the child view and destroy it. This function also updates the indices of - * later views in the collection in order to keep the children in sync with the collection. - */ - removeChildView(view: TView): TView; - - /** - * Determines if the view is empty. If you want to control when the empty - * view is rendered, you can override isEmpty. - */ - isEmpty(): boolean; - - /** - * If empty, show the empty view - */ - checkEmpty(): void; - - /** - * Destroy the child views that this collection view - * is holding on to, if any. This returns destroyed children. - */ - destroyChildren(): Backbone.ChildViewContainer; - - /** - * By default the CollectionView will maintain the order of its collection - * in the DOM. However on occasions the view may need to re-render to make - * this possible, for example if you were to change the comparator on the - * collection. By default CollectionView will call render when this happens, - * but there are cases where this may not be suitable. For instance when - * sorting the children in a CompositeView, you want to only render the - * internal collection. - */ - resortView(): void; - - /** - * By default the collection view will append the HTML of each ChildView - * into the element buffer, and then call jQuery's .append once at the end - * to move the HTML into the collection view's el. - * You can override this by specifying an attachHtml method in your view - * definition. - * @param collectionView the instance of the collection view that will receive the HTML. - * @param childView the current child view instance. - * @param index he index of the model that this childView instance represents, - * in the collection that the model came from. This is useful for sorting - * a collection and displaying the sorted list in the correct order on the - * screen. - */ - attachHtml(collectionView: CollectionView, childView: TView, index: number): void; - - /** - * The value returned by this method is the ChildView class that will be - * instantiated when a Model needs to be initially rendered. This method - * also gives you the ability to customize per Model ChildViews. - */ - getChildView(item: M): new (...args:any[]) => TView; - - /** - * If you need the emptyView's class chosen dynamically, specify - * getEmptyView. - */ - getEmptyView(): any; - - /** Serialize a collection by serializing each of its models. */ - serializeCollection(): any; - - /** - * Attaches the content of a given view. - * This method can be overridden to optimize rendering, - * or to render in a non standard way. - * - * For example, using `innerHTML` instead of `$el.html` - * - * @example - * attachElContent: function(html) { - * this.el.innerHTML = html; - * return this; - * } - */ - attachElContent(html: string): ItemView; - - /** - * Reorder DOM after sorting. When your element's rendering - * do not use their index, you can pass reorderOnSort: true - * to only reorder the DOM after a sort instead of rendering - * all the collectionView - */ - reorder(): void; - - /** - * Render and show the emptyView. Similar to addChild method - * but "add:child" events are not fired, and the event from - * emptyView are not forwarded - */ - addEmptyView(child: TModel, EmptyView: new (...args: any[]) => any): void; - - /** - * Handle cleanup and other destroying needs for the collection of views - */ - destroy(): CollectionView; - - /** - * Set up the child view event forwarding. Uses a "childview:" - * prefix in front of all forwarded events. - * @param view it might be ChildView or EmptyView. - */ - proxyChildEvents(view: any): void; - - /** - * Called just prior to rendering the collection view. - */ - onBeforeRender(): void; - - /** - * Triggered after the view has been rendered. You can implement this in - * your view to provide custom code for dealing with the view's el after - * it has been rendered. - */ - onRender(): void; - - /** - * This callback function allows you to know when a child / child view - * instance is about to be added to the collection view. It provides - * access to the view instance for the child that was added. - */ - onBeforeAddChild(childView: TView): void; - - /** - * This callback function allows you to know when a child / child view - * instance has been added to the collection view. It provides access to - * the view instance for the child that was added. - */ - onAddChild(childView: TView): void; - - /** - * This callback function allows you to know when a childView instance is - * about to be removed from the collectionView. It provides access to the - * view instance for the child that was removed. - */ - onBeforeRemoveChild(childView: TView): void; - - /** - * This callback function allows you to know when a child / childView - * instance has been deleted or removed from the collection. - */ - onRemoveChild(childView: TView): void; - } - - /** - * A CompositeView extends from CollectionView to be used as a composite view - * for scenarios where it should represent both a branch and leaf in a tree - * structure, or for scenarios where a collection needs to be rendered within - * a wrapper template. - */ - class CompositeView> extends CollectionView { - - constructor(options?: CollectionViewOptions); - - /** - * Each childView will be rendered using the childView's template. The - * CompositeView's template is rendered and the childView's templates are - * added to this. - */ - childView: new (...args:any[]) => TView; - - /** - * By default the composite view uses the same attachHtml method that the - * collection view provides. This means the view will call jQuery's - * .append to move the HTML contents from the child view instance in to - * the collection view's el. - * This is typically not very useful as a composite view will usually render - * a container DOM element in which the child views should be placed. - * This can be either a string or a function returning a string. - */ - childViewContainer: any; - - /** - * Renders the view. - */ - render(): CompositeView; - - /** - * Invoked before the model has been rendered - */ - onBeforeRenderTemplate(): void; - - /** - * Invoked after the model has been rendered. - */ - onRenderTemplate(): void; - - /** - * Invoked before the collection of models is rendered - */ - onBeforeRenderCollection(): void; - - /** - * Invoked after the collection of models has been rendered - */ - onRenderCollection(): void; - } - - interface LayoutViewOptions extends Backbone.ViewOptions { - /** - * The LayoutView takes an additional parameter where you can pass the regions as option on creation. - */ - regions?:any; - - /** - * This option removes the layoutView from the DOM before destroying the - * children preventing repaints as each option is removed. However, it - * makes it difficult to do close animations for a child view (false by - * default) - */ - destroyImmediate?: boolean; - } - - /** - * A LayoutView is a hybrid of an ItemView and a collection of Region objects. - * They are ideal for rendering application layouts with multiple sub-regions - * managed by specified region managers. - * A layoutView can also act as a composite-view to aggregate multiple views - * and sub-application areas of the screen allowing applications to attach - * multiple region managers to dynamically rendered HTML. - * You can create complex views by nesting layoutView managers within Regions. - */ - class LayoutView extends ItemView { - /** - * If you have the need to replace the Region with a region class of your - * own implementation, you can specify an alternate class to use with this - * property. - */ - regionClass: any; - - /** - * Constructor. - * A hash that can contain a regions hash that allows you to specify regions per - * LayoutView instance. - */ - constructor(options?: LayoutViewOptions); - - /** - * Handle destroying regions, and then destroy the view itself. - */ - destroy(): LayoutView; - - /** - * Regions hash or a method returning the regions hash that maps - * regions/selectors to methods on your View. - **/ - regions(): any; - - /** Adds a region to the layout view. */ - addRegion(name: string, definition: any): Region; - - /** - * Add multiple regions as a {name: definition, name2: def2} object literal. - */ - addRegions(regions: any): any; - - /** Returns a region from the layout view */ - getRegion(name: string): Region; - - /** - * Renders the view. It will use the existing region objects the first - * time it is called. Subsequent calls will destroy the views that the - * regions are showing and then reset the `el` for the regions to the - * newly rendered DOM elements. - */ - render(): LayoutView; - - /** - * Removes the region with the specified name. - * @param name the name of the region to remove. - */ - removeRegion(name: string): Region; - - /** Enable easy overriding of the default `RegionManager` - * for customized region interactions and business specific - * view logic for better control over single regions. - */ - getRegionManager(): RegionManager; - - /** - * Show a view into the region specified by `regionName`. - */ - showChildView(regionName: string, view: any, options?: RegionShowOptions): void; - - /** - * Get the current view that is shown in the region specified by - * `regionName`. - */ - getChildView(regionName: string): Backbone.View; - - /** - * Returns all regions from the layout view. The results contains an - * Object hash that has `string`s as keys and `Region`s as values. - */ - getRegions(): {[key: string]: Region}; - - /** - * You can customize the event prefix for events that are forwarded through - * the layout view with this property. - */ - childViewEventPrefix: string; - } - - interface AppRouterOptions extends Backbone.RouterOptions { - /** - * The appRoutes. - */ - appRoutes?: any; - - /** - * The controller to associate with this router. - */ - controller?: any; - } - - /** - * Reduce the boilerplate code of handling route events and then calling a - * single method on another object. Have your routers configured to call - * the method on your object, directly. - */ - class AppRouter extends Backbone.Router { - - /** - * Configure an AppRouter with appRoutes. The route definition - * is passed on to Backbone's standard routing handlers. This means - * that you define routes like you normally would. However, instead of - * providing a callback method that exists on the router, you provide a - * callback method that exists on the controller, which you specify for - * the router instance (see below.) - */ - constructor(options?: AppRouterOptions); - - /** - * You can specify a controller with the multiple routes at runtime with - * this method. However, In this case the current controller of AppRouter - * will not change. - */ - processAppRoutes(controller: any, appRoutes: any): void; - - /** - * Adds an app route at runtime to this instance. It works the same as the - * built-in router.route() call from Backbone's Router, but has all the - * same semantics and behavior of the appRoutes configuration. - */ - appRoute(route: string, methodName: string): void; - } - - /** - * The Backbone.Marionette.Application object is the hub of your composite - * application. It organizes, initializes and coordinates the various pieces - * of your app. It also provides a starting point for you to call into from - * your HTML script block, or directly from your JavaScript files if you - * prefer to go that route. The Application is meant to be instantiated - * directly, although you can extend it to add your own functionality. - */ - class Application extends Backbone.Events { - - constructor(options?: any); - - /** - * The Event Aggregator is available through this property. It is - * convenient for passively sharing information between pieces of your - * application as events occur. - * Note! To access this application channel from other objects within your - * app you are encouraged to get a handle of the systems through the - * Wreqr API instead of the Application instance itself. - */ - vent: Backbone.Wreqr.EventAggregator; - - /** - * Commands are used to make any component tell another component to - * perform an action without a direct reference to it. - */ - commands: Backbone.Wreqr.Commands; - - /** - * Request Response is a means for any component to request information - * from another component without being tightly coupled. - */ - reqres: Backbone.Wreqr.RequestResponse; - - submodules: any; - - /** Command execution, facilitated by Backbone.Wreqr.Commands */ - execute(...args: any[]): void; - - /** Request/response, facilitated by Backbone.Wreqr.RequestResponse */ - request(...args: any[]): any; - - /** Deprecated! Initializers, you should use events to manage start-up logic. */ - addInitializer(initializer: any): void; - - /** - * Once you have your application configured, you can kick everything off - * by calling this method. - * @param options This parameter will be passed to each of your initializer functions, as well as the initialize events. This allows you to provide extra configuration for various parts of your app throughout the initialization sequence. - */ - start(options?: any): void; - - /** Deprecated! nstead of using the Application as the root of your view tree, you should use a Layout View.*/ - addRegions(regions: any): any; - - /** Deprecated! nstead of using the Application as the root of your view tree, you should use a Layout View.*/ - emptyRegions(): void; - - /** Deprecated! nstead of using the Application as the root of your view tree, you should use a Layout View.*/ - removeRegion(region: Region): void; - - /** Deprecated! nstead of using the Application as the root of your view tree, you should use a Layout View.*/ - getRegion(regionName: string): Region; - - module(moduleNames: any, moduleDefinition: any): Module; - - /** - * Called just before the Application starts and before the initializers are executed. - */ - onBeforeStart(options?: any): void; - - /** - * Called after the Application has started and after the initializers have been executed. - */ - onStart(options?: any): void; - } - - // modules mapped for convenience, but you should probably use TypeScript modules instead - class Module extends Backbone.Events { - - constructor(moduleName: string, app: Application); - - submodules: any; - triggerMethod(name: string, ...args: any[]): any; - - addInitializer(callback: any): void; - addFinalizer(callback: any): void; - start(options?: any): void; - addDefinition(moduleDefinition: any, customArgs: any): any; - } - - /** - * A Behavior is an isolated set of DOM / user interactions that can be mixed - * into any View or another Behavior. Behaviors allow you to blackbox View - * specific interactions into portable logical chunks, keeping your views - * simple and your code DRY. - */ - class Behavior extends Marionette.Object { - constructor(options?: any, view?: any); - - options: any; - - /** - * Behaviors can have their own ui hash, which will be mixed into the ui - * hash of its associated View instance. ui elements defined on either the - * Behavior or the View will be made available within events and triggers. - * They also are attached directly to the Behavior and can be accessed within - * Behavior methods as this.ui. - */ - ui: any; - - /** - * Any triggers you define on the Behavior will be triggered in response to the appropriate event on the view. - */ - triggers: any; - - /** - * modelEvents will respond to the view's model events. - */ - modelEvents: any; - - /** - * collectionEvents will respond to the view's collection events. - */ - collectionEvents: any; - - /** - * The behaviors key allows a behavior to group multiple behaviors - * together. - */ - behaviors: any; - - /** - * defaults can be a hash or function to define the default options for - * your behavior. The default options will be overridden depending on - * what you set as the options per behavior (this works just like a - * backbone.model). - */ - defaults: any; - - /** - * el is a direct proxy of the view's el - */ - el: any; - - /** - * $el is a direct proxy of the view's el cached as a jQuery selector. - */ - $el: JQuery; - - /** A reference to the view instance that the behavior is on. */ - view: any; - - /** - * $ is a direct proxy of the views $ lookup method. - */ - $(selector: any): JQuery; - } - - /** - * Marionette.Behaviors' is a utility class that takes care of glueing your - * behavior instances to their given View. The most important part of this - * class is that you MUST override the class level behaviorsLookup method or - * set the option behaviorClass for things to work properly. - */ - class Behaviors { - /** - * This method defines where your behavior classes are stored. Override this to provide another lookup. - */ - static behaviorsLookup(): any; - - /** - * This method has a default implementation that is simple to override. It - * is responsible for the lookup of single behavior from within the - * Behaviors.behaviorsLookup or elsewhere. Note that it should return the type of the - * class to instantiate, not an instance of that class. - */ - static getBehaviorClass(options: any, key: string): any; - } -} diff --git a/backbone.paginator/backbone.paginator-tests.ts b/backbone.paginator/backbone.paginator-tests.ts deleted file mode 100644 index 28b09d4fc5..0000000000 --- a/backbone.paginator/backbone.paginator-tests.ts +++ /dev/null @@ -1,306 +0,0 @@ -/// - - -import * as Backbone from 'backbone'; - -namespace BackbonePaginatorTests { - - class TestModel extends Backbone.Model{}; - - var makeFetchOptions = >() => { - return { - reset: true, - url: 'example.com', - beforeSend: (jqxhr: JQueryXHR) => {}, - success: (model: TestModel, response: any, options: any) => {}, - error: (collection: TCol, jqxhr: JQueryXHR, options: any) => {}, - parse: '', - }; - }; - - - namespace InitializingWithNoOption { - - class TestCollection extends Backbone.PageableCollection { - constructor(){ - super(); - } - } - - var testCollection = new TestCollection(); - - } - - - - namespace InitializingWithOptions { - - class TestCollection extends Backbone.PageableCollection { - - constructor(models?: TestModel[], - options?: Backbone.PageableInitialOptions){ - super(); - } - - } - - var testCollection1 = new TestCollection(); - - var testCollection2 = new TestCollection([ - new TestModel(), - new TestModel() - ]); - - var testCollection3 = new TestCollection([], {}); - - var testCollection4 = new TestCollection([],{ - comparator: ()=>1, - full: true, - state: {}, - queryParam: {}, - }); - - var testCollection5 = new TestCollection([],{ - state: { - firstPage: 0, - lastPage: 0, - currentPage: 0, - pageSize: 1, - totalPages: 1, - totalRecords: 1, - sortKey: 'id', - order: 1, - }, - queryParam: { - currentPage: 'current_page', - pageSize: 'page_size', - totalPages: 'total_pages', - totalRecords: 'total_records', - sortKey: 'sort_key', - order: 'order', - directions: '', - }, - }); - - var testCollection6 = new TestCollection([ - {}, - {}, - ]); - - } - - - - namespace Fetching { - - class TestCollection extends Backbone.PageableCollection { - constructor(models?: TestModel[], - options?: Backbone.PageableInitialOptions){ - super(); - } - } - - - var testCollection = new TestCollection(); - - var result:JQueryXHR = testCollection.fetch(); - - testCollection.fetch({}); - - testCollection.fetch(makeFetchOptions()); - - } - - - - namespace Paging { - - class TestCollection extends Backbone.PageableCollection { - constructor(models?: TestModel[], - options?: Backbone.PageableInitialOptions){ - super(); - } - } - - var options = makeFetchOptions(); - - var testCollection = new TestCollection(); - - - var result:JQueryXHR|TestCollection = testCollection.getFirstPage(); - - testCollection.getFirstPage(options); - - // 'silent's type is boolean. (structural subtyping) - testCollection.getFirstPage({silent: 'aa'}); - // 'url's type is string. (structural subtyping) - testCollection.getFirstPage({url: true}); - - - result = testCollection.getLastPage(); - - testCollection.getLastPage(options); - - // 'silent's type is boolean. (structural subtyping) - testCollection.getLastPage({silent: 'aa'}); - // 'url's type is string. (structural subtyping) - testCollection.getLastPage({url: true}); - - - result = testCollection.getNextPage(); - - testCollection.getNextPage(options); - - // 'silent's type is boolean. (structural subtyping) - testCollection.getNextPage({silent: 'aa'}); - // 'url's type is string. (structural subtyping) - testCollection.getNextPage({url: true}); - - - result = testCollection.getPage(1); - - testCollection.getPage("1", options); - - // 'silent's type is boolean. (structural subtyping) - testCollection.getPage(1, {silent: 'aa'}); - // 'url's type is string. (structural subtyping) - testCollection.getPage(1, {url: true}); - - - result = testCollection.getPageByOffset(1); - - testCollection.getPageByOffset(1, options); - - // 'silent's type is boolean. (structural subtyping) - testCollection.getPageByOffset(1, {silent: 'aa'}); - // 'url's type is string. (structural subtyping) - testCollection.getPageByOffset(1, {url: true}); - - - result = testCollection.getPreviousPage(); - - testCollection.getPreviousPage(options); - - // 'silent's type is boolean. (structural subtyping) - testCollection.getPreviousPage({silent: 'aa'}); - // 'url's type is string. (structural subtyping) - testCollection.getPreviousPage({url: true}); - - - var hasPage:boolean = testCollection.hasNextPage(); - - hasPage = testCollection.hasPreviousPage(); - - } - - - - - namespace Parse { - - class TestCollection extends Backbone.PageableCollection { - constructor(models?: TestModel[], - options?: Backbone.PageableInitialOptions){ - super(); - } - } - - var testCollection = new TestCollection(); - - var result:any[] = testCollection.parse({}, {}); - - - var resultLinks:any = testCollection.parseLinks({}, {}); - - resultLinks = testCollection.parseLinks({}, { xhr: $.ajax({}) } ); - - - result = testCollection.parseRecords({}, {}); - - - var resultState: Backbone.PageableState = testCollection.parseState( - {}, - { - currentPage: 'current_page', - pageSize: 'page_size', - totalPages: 'total_pages', - totalRecords: 'total_records', - sortKey: 'sort_key', - order: 'order', - directions: '', - }, - { - firstPage: 0, - lastPage: 0, - currentPage: 0, - pageSize: 1, - totalPages: 1, - totalRecords: 1, - sortKey: 'id', - order: 1, - }, - {}); - - } - - - - namespace Setting { - - class TestCollection extends Backbone.PageableCollection { - constructor(models?: TestModel[], - options?: Backbone.PageableInitialOptions){ - super(); - } - } - - var testCollection = new TestCollection(); - - var options = makeFetchOptions(); - - - var result1:JQueryXHR|TestCollection - = testCollection.setPageSize(1, options); - - - var result2:TestCollection - = testCollection.setSorting('id', 1, options); - - - result1 = testCollection.switchMode( - 'server', - {fetch: true, resetState: true} - ); - - } - - - - namespace Syncing { - - class TestCollection extends Backbone.PageableCollection { - constructor(models?: TestModel[], - options?: Backbone.PageableInitialOptions){ - super(); - } - } - - var testCollection = new TestCollection(); - - - var result:JQueryXHR = testCollection.sync('server', new TestModel(), {}); - - result = testCollection.sync('server', testCollection, {}); - - } - - - - namespace Confllict { - - var result:typeof Backbone.PageableCollection - = Backbone.PageableCollection.noConflict(); - - } - -} diff --git a/bardjs/bardjs-tests.ts b/bardjs/bardjs-tests.ts deleted file mode 100644 index 2d312634ca..0000000000 --- a/bardjs/bardjs-tests.ts +++ /dev/null @@ -1,284 +0,0 @@ -/// -/// - -import * as angular from 'angular'; -import 'angular-mocks'; - -namespace bardTests { - var expect = chai.expect, - assert = chai.assert; - - class MyService { - constructor(private $q: angular.IQService) {} - - remoteCall(): angular.IPromise { - return new this.$q((resolve, reject) => { - resolve(['Hello', 'World']); - }); - } - } - - function myService($q: angular.IQService) { - return new MyService($q); - } - namespace myService { - export var $inject = ['$q']; - } - - class MyController { - myProperty: string; - } - - angular - .module('myModule') - .service('myService', myService) - .controller('MyController', MyController); - - /* - * bard.$httpBackend - */ - function test_$httpBackend() { - var myService: MyService; - var $rootScope: angular.IRootScopeService; - - beforeEach(angular.mock.module(bard.$httpBackend, 'myModule')); - - beforeEach(inject(function(_myService_: MyService, _$rootScope_: angular.IRootScopeService) { - myService = _myService_; - $rootScope = _$rootScope_; - })); - - it('should return valid data', function(done) { - myService.remoteCall() - .then(function(data) { - expect(data).to.exist; - }) - .then(done, done); - - $rootScope.$apply; // Because not using bard.$q, must flush the $http and $q queues - }); - } - - /* - * bard.$q - */ - function test_$q() { - var myService: MyService; - - beforeEach(angular.mock.module(bard.$q, bard.$httpBackend, 'myModule')); - - beforeEach(inject(function(_myService_: MyService) { - myService = _myService_; - })); - - it('should return valid data', (done) => { - myService.remoteCall() - .then((data) => { - expect(data).to.exist; - }) - .then(done, done); - - // No need to flush - }); - } - - /* - * bard.addGlobals - */ - function test_addGlobals() { - describe('someting', function() { - var ctx = this; - - it('should work', function() { - var bar = 'bar'; - bard.addGlobals(this, 'foo'); // where `this` is the spec context - bard.addGlobals(this, 'foo', bar); - bard.addGlobals.bind(this)('foo', 'bar'); - bard.addGlobals(ctx, ['foo', 'bar']) // where ctx is the spec context - }); - }) - } - - /* - * bard.appModule - */ - function test_appModule() { - beforeEach(bard.appModule('myModule')); - //// - beforeEach(bard.appModule('myModule', function() {}, {})); - } - - /* - * bard.assertFail - */ - function test_assertFail() { - bard.assertFail('FAIL!'); - } - - /* - * bard.asyncModule - */ - function test_asyncModule() { - beforeEach(bard.asyncModule('myModule')); - //// - beforeEach(bard.asyncModule('myModule', function() {}, {})); - } - - /* - * bard.debugging - */ - function test_debugging() { - console.log( - bard.debugging(true), // should return true - bard.debugging(false), // should return false - bard.debugging(42), // should return true - bard.debugging(''), // should return false - bard.debugging() // should return false - ); - } - - /* - * bard.fakeLogger - */ - function test_fakeLogger() { - beforeEach(angular.mock.module('myModule', bard.fakeLogger)); - //// - beforeEach(bard.appModule('myModule', bard.fakeLogger)); - //// - beforeEach(bard.asyncModule('myModule', bard.fakeLogger)); - } - - /* - * bard.fakeRouteHelperProvider - */ - function test_fakeRouteHelperProvider() { - beforeEach(angular.mock.module('myModule', bard.fakeRouteHelperProvider)); - //// - beforeEach(bard.appModule('myModule', bard.fakeRouteHelperProvider)); - //// - beforeEach(bard.asyncModule('myModule', bard.fakeRouteHelperProvider)); - } - - /* - * bard.fakeRouteProvider - */ - function test_fakeRouteProvider() { - beforeEach(angular.mock.module('myModule', bard.fakeRouteProvider)); - //// - beforeEach(bard.appModule('myModule', bard.fakeRouteProvider)); - //// - beforeEach(bard.asyncModule('myModule', bard.fakeRouteProvider)); - } - - /* - * bard.fakeStateProvider - */ - function test_fakeStateProvider() { - beforeEach(angular.mock.module('myModule', bard.fakeStateProvider)); - //// - beforeEach(bard.appModule('myModule', bard.fakeStateProvider)); - //// - beforeEach(bard.asyncModule('myModule', bard.fakeStateProvider)); - } - - /* - * bard.fakeToastr - */ - function test_fakeToastr() { - beforeEach(angular.mock.module('myModule', bard.fakeToastr)); - //// - beforeEach(bard.appModule('myModule', bard.fakeToastr)); - //// - beforeEach(bard.asyncModule('myModule', bard.fakeToastr)); - } - - /* - * bard.inject - */ - function test_inject() { - beforeEach(() => bard.inject(this, '$controller', '$log', '$q', '$rootScope', 'myService')); - } - - /* - * bard.log - */ - function test_log() { - bard.log('We got the goods'); - } - - /* - * bard.mochaRunnerListener - */ - function test_mochaRunnerListener() { - var runner = mocha.run(); - bard.mochaRunnerListener(runner); - } - - /* - * bard.mockService - */ - function test_mockService() { - var controller: MyController, - myArray = ['This', 'is', 'some', 'mocked', 'data']; - var $controller: angular.IControllerService, - $q: angular.IQService, - $rootScope: angular.IRootScopeService, - myService: MyService; - - beforeEach(function() { - bard.appModule('myModule'); - bard.inject(this, '$controller', '$q', '$rootScope', 'myService'); - - bard.mockService(myService, { - remoteCall: $q.when(myArray), - _default: $q.when([]) - }); - - controller = $controller('MyController'); - $rootScope.$apply(); - }); - } - - /* - * bard.replaceAccentChars - */ - function test_replaceAccentChars() { - console.log(bard.replaceAccentChars('àáâãäåèéêëìíîïòóôõöùúûüýÿ') === 'aaaaaaeeeeeeeeooooouuuuyy'); - } - - /* - * bard.verifyNoOutstandingHttpRequests - */ - function test_verifyNoOutstandingHttpRequests() { - var controller: MyController, - myArray = ['This', 'is', 'some', 'mocked', 'data']; - var $controller: angular.IControllerService, - $q: angular.IQService, - $rootScope: angular.IRootScopeService, - myService: MyService; - - beforeEach(function() { - bard.appModule('myModule'); - bard.inject(this, '$controller', '$q', '$rootScope', 'myService'); - - bard.mockService(myService, { - remoteCall: $q.when(myArray), - _default: $q.when([]) - }); - - controller = $controller('MyController'); - $rootScope.$apply(); - }); - - bard.verifyNoOutstandingHttpRequests(); - } - - /* - * bard.wrapWithDone - */ - function test_wrapWithDone() { - function callback() { console.log('Doing something...'); } - function done() { console.log('...Done'); } - bard.wrapWithDone(callback, done); - } -} diff --git a/base-64/index.d.ts b/base-64/index.d.ts deleted file mode 100644 index ddd10db17b..0000000000 --- a/base-64/index.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Type definitions for base-64 0.1 -// Project: https://github.com/mathiasbynens/base64 -// Definitions by: Dolan Miu -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export const version: string; - -/** - * This function takes a byte string (the input parameter) and encodes it according to base64. - * The input data must be in the form of a string containing only characters - * in the range from U+0000 to U+00FF, each representing a binary byte with values 0x00 to 0xFF. - * The base64.encode() function is designed to be fully compatible - * with btoa() as described in the HTML Standard. - * see: https://html.spec.whatwg.org/multipage/webappapis.html#dom-windowbase64-btoa - */ -export function encode(input: string): string; -/** - * This function takes a base64-encoded string (the input parameter) and decodes it. - * The return value is in the form of a string containing only characters in - * the range from U+0000 to U+00FF, each representing a binary byte with values 0x00 to 0xFF. - * The base64.decode() function is designed to be fully compatible - * with atob() as described in the HTML Standard. - * see: https://html.spec.whatwg.org/multipage/webappapis.html#dom-windowbase64-atob - */ -export function decode(input: string): string; \ No newline at end of file diff --git a/base-64/tslint.json b/base-64/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/base-64/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/base64-js/base64-js-tests.ts b/base64-js/base64-js-tests.ts deleted file mode 100644 index 13c3f705b5..0000000000 --- a/base64-js/base64-js-tests.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as base64js from "base64-js"; - -const length: number = base64js.byteLength(""); -const bytes: Uint8Array = base64js.toByteArray(""); -const decoded: string = base64js.fromByteArray(new Uint8Array(0)); diff --git a/base64-js/tslint.json b/base64-js/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/base64-js/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/big-integer/index.d.ts b/big-integer/index.d.ts deleted file mode 100644 index 452593e950..0000000000 --- a/big-integer/index.d.ts +++ /dev/null @@ -1,226 +0,0 @@ -// Type definitions for BigInteger.js -// Project: https://github.com/peterolson/BigInteger.js -// Definitions by: Ingo Bürk , Roel van Uden -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -interface BigInteger { - /** Returns the absolute value of a bigInt. */ - abs(): BigInteger; - - /** Performs addition */ - add( number: number ): BigInteger; - /** Performs addition */ - add( number: BigInteger ): BigInteger; - /** Performs addition */ - add( number: string ): BigInteger; - - /** Alias for the add method. */ - plus( number: number ): BigInteger; - /** Alias for the add method. */ - plus( number: BigInteger ): BigInteger; - /** Alias for the add method. */ - plus( number: string ): BigInteger; - - /** Alias for the subtract method. */ - minus( number: number ): BigInteger; - /** Alias for the subtract method. */ - minus( number: BigInteger ): BigInteger; - /** Alias for the subtract method. */ - minus( number: string ): BigInteger; - - /** Performs subtraction. */ - subtract( number: number ): BigInteger; - /** Performs subtraction. */ - subtract( number: BigInteger ): BigInteger; - /** Performs subtraction. */ - subtract( number: string ): BigInteger; - - /** Performs multiplication. */ - multiply( number: number ): BigInteger; - /** Performs multiplication. */ - multiply( number: BigInteger ): BigInteger; - /** Performs multiplication. */ - multiply( number: string ): BigInteger; - - /** Alias for the multiply method. */ - times( number: number ): BigInteger; - /** Alias for the multiply method. */ - times( number: BigInteger ): BigInteger; - /** Alias for the multiply method. */ - times( number: string ): BigInteger; - - /** Performs integer division, disregarding the remainder. */ - divide( number: number ): BigInteger; - /** Performs integer division, disregarding the remainder. */ - divide( number: BigInteger ): BigInteger; - /** Performs integer division, disregarding the remainder. */ - divide( number: string ): BigInteger; - - /** Alias for the divide method. */ - over( number: number ): BigInteger; - /** Alias for the divide method. */ - over( number: BigInteger ): BigInteger; - /** Alias for the divide method. */ - over( number: string ): BigInteger; - - /** Performs exponentiation. If the exponent is less than 0, pow returns 0. bigInt.zero.pow(0) returns 1. */ - pow( number: number ): BigInteger; - /** Performs exponentiation. If the exponent is less than 0, pow returns 0. bigInt.zero.pow(0) returns 1. */ - pow( number: BigInteger ): BigInteger; - /** Performs exponentiation. If the exponent is less than 0, pow returns 0. bigInt.zero.pow(0) returns 1. */ - pow( number: string ): BigInteger; - - /** Adds one to the number. */ - next(): BigInteger; - - /** Subtracts one from the number. */ - prev(): BigInteger; - - /** Performs division and returns the remainder, disregarding the quotient. The sign of the remainder will match the sign of the dividend. */ - mod( number: number ): BigInteger; - /** Performs division and returns the remainder, disregarding the quotient. The sign of the remainder will match the sign of the dividend. */ - mod( number: BigInteger ): BigInteger; - /** Performs division and returns the remainder, disregarding the quotient. The sign of the remainder will match the sign of the dividend. */ - mod( number: string ): BigInteger; - - /** Performs division and returns an object with two properties: quotient and remainder. The sign of the remainder will match the sign of the dividend. */ - divmod( number: number ): { quotient: BigInteger; remainder: BigInteger }; - /** Performs division and returns an object with two properties: quotient and remainder. The sign of the remainder will match the sign of the dividend. */ - divmod( number: BigInteger ): { quotient: BigInteger; remainder: BigInteger }; - /** Performs division and returns an object with two properties: quotient and remainder. The sign of the remainder will match the sign of the dividend. */ - divmod( number: string ): { quotient: BigInteger; remainder: BigInteger }; - - /** Checks if the first number is greater than the second. */ - greater( number: number ): boolean; - /** Checks if the first number is greater than the second. */ - greater( number: BigInteger ): boolean; - /** Checks if the first number is greater than the second. */ - greater( number: string ): boolean; - - /** Checks if the first number is greater than or equal to the second. */ - greaterOrEquals( number: number ): boolean; - /** Checks if the first number is greater than or equal to the second. */ - greaterOrEquals( number: BigInteger ): boolean; - /** Checks if the first number is greater than or equal to the second. */ - greaterOrEquals( number: string ): boolean; - - /** Checks if the first number is lesser than the second. */ - lesser( number: number ): boolean; - /** Checks if the first number is lesser than the second. */ - lesser( number: BigInteger ): boolean; - /** Checks if the first number is lesser than the second. */ - lesser( number: string ): boolean; - - /** Checks if the first number is less than or equal to the second. */ - lesserOrEquals( number: number ): boolean; - /** Checks if the first number is less than or equal to the second. */ - lesserOrEquals( number: BigInteger ): boolean; - /** Checks if the first number is less than or equal to the second. */ - lesserOrEquals( number: string ): boolean; - - /** Returns true if the number is even, false otherwise. */ - isEven(): boolean; - - /** Returns true if the number is odd, false otherwise. */ - isOdd(): boolean; - - /** Return true if the number is positive, false otherwise. Returns true for 0 and false for -0. */ - isPositive(): boolean; - - /** Returns true if the number is negative, false otherwise. Returns false for 0 and true for -0. */ - isNegative(): boolean; - - /** - * Performs a comparison between two numbers. If the numbers are equal, it returns 0. - * If the first number is greater, it returns 1. If the first number is lesser, it returns -1. - */ - compare( number: number ): number; - /** - * Performs a comparison between two numbers. If the numbers are equal, it returns 0. - * If the first number is greater, it returns 1. If the first number is lesser, it returns -1. - */ - compare( number: BigInteger ): number; - /** - * Performs a comparison between two numbers. If the numbers are equal, it returns 0. - * If the first number is greater, it returns 1. If the first number is lesser, it returns -1. - */ - compare( number: string ): number; - - /** Performs a comparison between the absolute value of two numbers. */ - compareAbs( number: number ): number; - /** Performs a comparison between the absolute value of two numbers. */ - compareAbs( number: BigInteger ): number; - /** Performs a comparison between the absolute value of two numbers. */ - compareAbs( number: string ): number; - - /** Checks if two numbers are equal. */ - equals( number: number ): boolean; - /** Checks if two numbers are equal. */ - equals( number: BigInteger ): boolean; - /** Checks if two numbers are equal. */ - equals( number: string ): boolean; - - /** Checks if two numbers are not equal. */ - notEquals( number: number ): boolean; - /** Checks if two numbers are not equal. */ - notEquals( number: BigInteger ): boolean; - /** Checks if two numbers are not equal. */ - notEquals( number: string ): boolean; - - /** Performs the bitwise AND operation. */ - and( number: number ): BigInteger; - /** Performs the bitwise AND operation. */ - and( number: BigInteger ): BigInteger; - /** Performs the bitwise AND operation. */ - and( number: string ): BigInteger; - - /** Performs the bitwise NOT operation. */ - not(): BigInteger; - - /** Performs the bitwise OR operation. */ - or( number: number ): BigInteger; - /** Performs the bitwise OR operation. */ - or( number: BigInteger ): BigInteger; - /** Performs the bitwise OR operation. */ - or( number: string ): BigInteger; - - /** Performs the bitwise XOR operation. */ - xor( number: number ): BigInteger; - /** Performs the bitwise XOR operation. */ - xor( number: BigInteger ): BigInteger; - /** Performs the bitwise XOR operation. */ - xor( number: string ): BigInteger; - - /** Converts a bigInt into a native Javascript number. Loses precision for numbers outside the range. */ - toJSNumber(): number; - - /** Converts a bigInt to a string. */ - toString(): string; - - /** Converts a bigInt to a native Javascript number. This override allows you to use native arithmetic operators without explicit conversion. */ - valueOf(): number; -} - -interface BigIntegerStatic { - /** Equivalent to bigInt(1) */ - one: BigInteger; - /** Equivalent to bigInt(0) */ - zero: BigInteger; - /** Equivalent to bigInt(-1) */ - minusOne: BigInteger; - - /** Equivalent to bigInt(0) */ - (): BigInteger; - /** Parse a Javascript number into a bigInt */ - ( number: number ): BigInteger; - /** Parse a string into a bigInt */ - ( string: string, base?: string | number | BigInteger): BigInteger; - /** no-op */ - ( bigInt: BigInteger ): BigInteger; -} - -declare var bigInt: BigIntegerStatic; - -declare module "big-integer" { - export = bigInt; -} diff --git a/bigi/bigi-tests.ts b/bigi/bigi-tests.ts deleted file mode 100644 index 70569bb919..0000000000 --- a/bigi/bigi-tests.ts +++ /dev/null @@ -1,9 +0,0 @@ -import BigInteger = require('bigi'); - -var b1 = BigInteger.fromHex("188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012"); -var b2 = BigInteger.fromHex("07192B95FFC8DA78631011ED6B24CDD573F977A11E794811"); - -var b3 = b1.multiply(b2); - -console.log(b3.toHex()); -// => ae499bfe762edfb416d0ce71447af67ff33d1760cbebd70874be1d7a5564b0439a59808cb1856a91974f7023f72132 \ No newline at end of file diff --git a/bigi/tslint.json b/bigi/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/bigi/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/bignumber.js/bignumber.js-tests.ts b/bignumber.js/bignumber.js-tests.ts deleted file mode 100644 index a375fc60cd..0000000000 --- a/bignumber.js/bignumber.js-tests.ts +++ /dev/null @@ -1,445 +0,0 @@ -var x: BigNumber.BigNumber = new BigNumber(9) -var y = new BigNumber(x) - -BigNumber(435.345) - -new BigNumber('5032485723458348569331745.33434346346912144534543') -new BigNumber('4.321e+4') -new BigNumber('-735.0918e-430') -new BigNumber(Infinity) -new BigNumber(NaN) -new BigNumber('.5') -new BigNumber('+2') -new BigNumber(-10110100.1, 2) -new BigNumber(-0b10110100) -new BigNumber('123412421.234324', 5) -new BigNumber('ff.8', 16) -new BigNumber('0xff.8') - -new BigNumber(9, 2) - -new BigNumber(96517860459076817.4395) - -new BigNumber('blurgh') - -BigNumber.config({ DECIMAL_PLACES: 5 }) -new BigNumber(1.23456789) -new BigNumber(1.23456789, 10) - -BigNumber.config({ DECIMAL_PLACES: 5 }) -var BN = BigNumber.another({ DECIMAL_PLACES: 9 }) - -x = new BigNumber(1) -y = new BN(1) - -x.div(3) -y.div(3) - -BN = BigNumber.another() -BN.config({ DECIMAL_PLACES: 9 }) - -BigNumber.config({ DECIMAL_PLACES: 5 }) -BigNumber.set({ DECIMAL_PLACES: 5 }) -BigNumber.config(5) - -BigNumber.config({ ROUNDING_MODE: 0 }) -BigNumber.config(undefined, BigNumber.ROUND_UP) - -BigNumber.config({ EXPONENTIAL_AT: 2 }) -new BigNumber(12.3) -new BigNumber(123) -new BigNumber(0.123) -new BigNumber(0.0123) - -BigNumber.config({ EXPONENTIAL_AT: [-7, 20] }) -new BigNumber(123456789) -new BigNumber(0.000000123) - -BigNumber.config({ EXPONENTIAL_AT: 1e+9 }) - -BigNumber.config({ EXPONENTIAL_AT: 0 }) - -BigNumber.config({ RANGE: 500 }) -BigNumber.config().RANGE -new BigNumber('9.999e499') -new BigNumber('1e500') -new BigNumber('1e-499') -new BigNumber('1e-500') - -BigNumber.config({ RANGE: [-3, 4] }) -new BigNumber(99999) -new BigNumber(100000) -new BigNumber(0.001) -new BigNumber(0.0001) - -BigNumber.config({ ERRORS: false }) - -BigNumber.config({ CRYPTO: true }) -BigNumber.config().CRYPTO -BigNumber.random() - -BigNumber.config({ MODULO_MODE: BigNumber.EUCLID }) -BigNumber.config({ MODULO_MODE: 9 }) - -BigNumber.config({ POW_PRECISION: 100 }) - -BigNumber.config({ - FORMAT: { - decimalSeparator: '.', - groupSeparator: ',', - groupSize: 3, - secondaryGroupSize: 0, - fractionGroupSeparator: ' ', - fractionGroupSize: 0 - } -}); - -BigNumber.config({ - DECIMAL_PLACES: 40, - ROUNDING_MODE: BigNumber.ROUND_HALF_CEIL, - EXPONENTIAL_AT: [-10, 20], - RANGE: [-500, 500], - ERRORS: true, - CRYPTO: true, - MODULO_MODE: BigNumber.ROUND_FLOOR, - POW_PRECISION: 80, - FORMAT: { - groupSize: 3, - groupSeparator: ' ', - decimalSeparator: ',' - } -}); - -BigNumber.config(40, 7, [-10, 20], 500, 1, 1, 3, 80) - -var obj = BigNumber.config(); -obj.ERRORS -obj.RANGE - -x = new BigNumber('3257869345.0378653') -BigNumber.max(4e9, x, '123456789.9') - -var arr = [12, '13', new BigNumber(14)] -BigNumber.max(arr) - -x = new BigNumber('3257869345.0378653') -BigNumber.min(4e9, x, '123456789.9') - -arr = [2, new BigNumber(-14), '-15.9999', -12] -BigNumber.min(arr) - -BigNumber.config({ DECIMAL_PLACES: 10 }) -BigNumber.random() -BigNumber.random(20) - -BigNumber.config({ ROUNDING_MODE: BigNumber.ROUND_CEIL }) -BigNumber.config({ ROUNDING_MODE: 2 }) - -x = new BigNumber(-0.8) -y = x.absoluteValue() -var z = y.abs() - -x = new BigNumber(1.3) -x.ceil() -y = new BigNumber(-1.8) -y.ceil() - -x = new BigNumber(Infinity) -y = new BigNumber(5) -x.comparedTo(y) -x.comparedTo(x.minus(1)) -y.cmp(NaN) -y.cmp('110', 2) - -x = new BigNumber(123.45) -x.decimalPlaces() -y = new BigNumber('9.9e-101') -y.dp() - -x = new BigNumber(355) -y = new BigNumber(113) -x.dividedBy(y) -x.div(5) -x.div(47, 16) - -x = new BigNumber(5) -y = new BigNumber(3) -x.dividedToIntegerBy(y) -x.divToInt(0.7) -x.divToInt('0.f', 16) - -0 === 1e-324 -x = new BigNumber(0) -x.equals('1e-324') -BigNumber(-0).eq(x) -BigNumber(255).eq('ff', 16) - -y = new BigNumber(NaN) -y.equals(NaN) - -x = new BigNumber(1.8) -x.floor() -y = new BigNumber(-1.3) -y.floor() - -0.1 > (0.3 - 0.2) -x = new BigNumber(0.1) -x.greaterThan(BigNumber(0.3).minus(0.2)) -BigNumber(0).gt(x) -BigNumber(11, 3).gt(11.1, 2) - -x = new BigNumber(0.3).minus(0.2) -x.greaterThanOrEqualTo(0.1) -BigNumber(1).gte(x) -BigNumber(10, 18).gte('i', 36) - -x = new BigNumber(1) -x.isFinite() -y = new BigNumber(Infinity) -y.isFinite() - -x = new BigNumber(1) -x.isInteger() -y = new BigNumber(123.456) -y.isInt() - -x = new BigNumber(NaN) -x.isNaN() -y = new BigNumber('Infinity') -y.isNaN() - -x = new BigNumber(-0) -x.isNegative() -y = new BigNumber(2) -y.isNeg() - -x = new BigNumber(-0) -x.isZero() && x.isNeg() -y = new BigNumber(Infinity) -y.isZero() - -x = new BigNumber(0.3).minus(0.2) -x.lessThan(0.1) -BigNumber(0).lt(x) -BigNumber(11.1, 2).lt(11, 3) - -x = new BigNumber(0.1) -x.lessThanOrEqualTo(BigNumber(0.3).minus(0.2)) -BigNumber(-1).lte(x) -BigNumber(10, 18).lte('i', 36) - -x = new BigNumber(0.3) -x.minus(0.1) -x.sub(0.6, 20) - -x = new BigNumber(1) -x.modulo(0.9) -y = new BigNumber(33) -y.mod('a', 33) - -x = new BigNumber(1.8) -x.negated() -y = new BigNumber(-1.3) -y.neg() - -x = new BigNumber(0.1) -y = x.plus(0.2) -BigNumber(0.7).plus(x).add(y) -x.plus('0.1', 8) - -x = new BigNumber(1.234) -x.precision() -y = new BigNumber(987000) -y.sd() -y.sd(true) - -y = new BigNumber(x) -y.round() -y.round(1) -y.round(2) -y.round(10) -y.round(0, 1) -y.round(0, 6) -y.round(1, 1) -y.round(1, BigNumber.ROUND_HALF_EVEN) -y - -x = new BigNumber(1.23) -x.shift(3) -x.shift(-3) - -x = new BigNumber(16) -x.squareRoot() -y = new BigNumber(3) -y.sqrt() - -x = new BigNumber(0.6) -y = x.times(3) -BigNumber('7e+500').times(y) -x.times('-a', 16) - -BigNumber.config({ DECIMAL_PLACES: 5, ROUNDING_MODE: 4 }) -x = new BigNumber(9876.54321) - -x.toDigits() -x.toDigits(6) -x.toDigits(6, BigNumber.ROUND_UP) -x.toDigits(2) -x.toDigits(2, 1) -x - -y = new BigNumber(45.6) -y.toExponential() -y.toExponential(0) -y.toExponential(1) -y.toExponential(1, 1) -y.toExponential(3) - -y = new BigNumber(3.456) -y.toFixed() -y.toFixed(0) -y.toFixed(2) -y.toFixed(2, 1) -y.toFixed(5) - -var format = { - decimalSeparator: '.', - groupSeparator: ',', - groupSize: 3, - secondaryGroupSize: 0, - fractionGroupSeparator: ' ', - fractionGroupSize: 0 -} -BigNumber.config({ FORMAT: format }) - -x = new BigNumber('123456789.123456789') -x.toFormat() -x.toFormat(1) - -format.groupSeparator = ' ' -format.fractionGroupSize = 5 -x.toFormat() - -BigNumber.config({ - FORMAT: { - decimalSeparator: ',', - groupSeparator: '.', - groupSize: 3, - secondaryGroupSize: 2 - } -}) - -x.toFormat(6) - -x = new BigNumber(1.75) -x.toFraction() - -var pi = new BigNumber('3.14159265358') -pi.toFraction() -pi.toFraction(100000) -pi.toFraction(10000) -pi.toFraction(100) -pi.toFraction(10) -pi.toFraction(1) - -x = new BigNumber('177.7e+457') -y = new BigNumber(235.4325) -z = new BigNumber('0.0098074') - -var str = JSON.stringify([x, y, z]) - -JSON.parse(str, (key, val) => key === '' ? val : new BigNumber(val)) - -x = new BigNumber(456.789) -x.toNumber() -{ +x } - -y = new BigNumber('45987349857634085409857349856430985') -y.toNumber() - -z = new BigNumber(-0) -1 / +z -1 / z.toNumber() - -x = new BigNumber(0.7) -x.toPower(2) -BigNumber(3).pow(-2) - -y = new BigNumber(45.6) -x.toPrecision() -y.toPrecision() -x.toPrecision(1) -y.toPrecision(1) -y.toPrecision(2, 0) -y.toPrecision(2, 1) -x.toPrecision(5) -y.toPrecision(5) - -x = new BigNumber(750000) -x.toString() -BigNumber.config({ EXPONENTIAL_AT: 5 }) -x.toString() - -y = new BigNumber(362.875) -y.toString(2) -y.toString(9) -y.toString(32) - -BigNumber.config({ DECIMAL_PLACES: 4 }); -z = new BigNumber('1.23456789') -z.toString() -z.toString(10) - -x = new BigNumber(123.456) -x.truncated() -y = new BigNumber(-12.3) -y.trunc() - -x = new BigNumber('-0') -x.toString() -x.valueOf() -y = new BigNumber('1.777e+457') -y.valueOf() - -x = new BigNumber(0.123) -x.toExponential() -x.c -x.e -x.s - -z = new BigNumber('-123.4567000e+2') -z.toExponential() -z.c -z.e -z.s - -x = new BigNumber(3) -x instanceof BigNumber -x.isBigNumber - -BN = BigNumber.another(); - -y = new BN(3) -y instanceof BigNumber -y.isBigNumber - -y = new BigNumber(-0) -y.c -y.e -y.s - -try { - // ... -} catch (e) { - if (e instanceof Error && e.name == 'BigNumber Error') { - // ... - } -} - -x = new BigNumber("1.0") -y = new BigNumber("1.1000") -z = x.add(y) - -x = new BigNumber("1.20") -y = new BigNumber("3.45000") -z = x.mul(y) diff --git a/bignumber.js/index.d.ts b/bignumber.js/index.d.ts deleted file mode 100644 index d94be507c7..0000000000 --- a/bignumber.js/index.d.ts +++ /dev/null @@ -1,681 +0,0 @@ -// Type definitions for bignumber.js 4.0 -// Project: https://github.com/MikeMcl/bignumber.js/ -// Definitions by: Viktor Smirnov -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 - -declare var BigNumber: BigNumber.BigNumberStatic; - -export as namespace BigNumber; -export = BigNumber; - -declare namespace BigNumber { - - interface FormatConfig { - - /** - * The decimal separator. - */ - decimalSeparator: string; - - /** - * The grouping separator of the integer part. - */ - groupSeparator: string; - - /** - * The primary grouping size of the integer part. - */ - groupSize: number; - - /** - * The secondary grouping size of the integer part. - */ - secondaryGroupSize: number; - - /** - * The grouping separator of the fraction part. - */ - fractionGroupSeparator: string; - - /** - * The grouping size of the fraction part. - */ - fractionGroupSize: number; - } - - interface BigNumberConfig { - - /** - * The maximum number of decimal places of the results of operations involving division, - * i.e. division, square root and base conversion operations, and power operations with negative exponents. - */ - DECIMAL_PLACES: number; - - /** - * The rounding mode used in the above operations and the default rounding mode of round, `toExponential`, `toFixed`, `toFormat` and `toPrecision`. - */ - ROUNDING_MODE: RoundingMode; - - /** - * The exponent value(s) at which `toString` returns exponential notation. - * - * If a single number is assigned, the value is the exponent magnitude. - * - * If an array of two numbers is assigned then the first number is the negative exponent value at and beneath which exponential notation is used, - * and the second number is the positive exponent value at and above which the same. - */ - EXPONENTIAL_AT: number | number[]; - - /** - * The exponent value(s) beyond which overflow to `Infinity` and underflow to zero occurs. - * - * If a single number is assigned, it is the maximum exponent magnitude: - * values wth a positive exponent of greater magnitude become `Infinity` - * and those with a negative exponent of greater magnitude become zero. - * - * If an array of two numbers is assigned then the first number is the negative exponent limit and the second number is the positive exponent limit. - */ - RANGE: number | number[]; - - /** - * The value that determines whether BigNumber Errors are thrown. - * - * If `ERRORS` is false, no errors will be thrown. - */ - ERRORS: boolean | 0 | 1; - - /** - * The value that determines whether cryptographically-secure pseudo-random number generation is used. - * - * If `CRYPTO` is set to `true` then the `random` method will generate random digits using `crypto.getRandomValues` in browsers that support it, - * or `crypto.randomBytes` if using a version of Node.js that supports it. - * - * If neither function is supported by the host environment then attempting to set `CRYPTO` to `true` will fail, and if `ERRORS` is `true` an exception will be thrown. - * - * If `CRYPTO` is `false` then the source of randomness used will be `Math.random` (which is assumed to generate at least `30` bits of randomness). - */ - CRYPTO: boolean | 0 | 1; - - /** - * The modulo mode used when calculating the modulus: `a mod n`. - * - * The quotient, `q = a / n`, is calculated according to the `ROUNDING_MODE` that corresponds to the chosen `MODULO_MODE`. - * - * The remainder, `r`, is calculated as: `r = a - n * q`. - */ - MODULO_MODE: ModuloMode; - - /** - * The maximum number of significant digits of the result of the power operation (unless a modulus is specified). - * - * If set to `0`, the number of signifcant digits will not be limited. - */ - POW_PRECISION: number; - - /** - * The `FORMAT` object configures the format of the string returned by the toFormat method. - */ - FORMAT: Partial - } - - type NumberLike = number | string | BigNumber; - type RoundingMode = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 - type ModuloMode = RoundingMode | 9 - - interface BigNumberStatic { - - /** - * Returns a new instance of a BigNumber object. - */ - (value: NumberLike, base?: number): BigNumber; - - /** - * Returns a new instance of a BigNumber object. - */ - new (value: NumberLike, base?: number): BigNumber; - - /** - * Returns a new independent BigNumber constructor with configuration as described by obj, or with the default configuration if obj is null or undefined. - */ - another(obj?: Partial): BigNumberStatic; - - /** - * Configures the settings for this particular BigNumber constructor. - * - */ - config(obj?: Partial): BigNumberConfig; - - /** - * Configures the settings for this particular BigNumber constructor. - */ - config( - DECIMAL_PLACES?: number, - ROUNDING_MODE?: RoundingMode, - EXPONENTIAL_AT?: number | number[], - RANGE?: number | number[], - ERRORS?: boolean | 0 | 1, - CRYPTO?: boolean | 0 | 1, - MODULO_MODE?: ModuloMode, - POW_PRECISION?: number - ): BigNumberConfig; - - /** - * Configures the settings for this particular BigNumber constructor. - */ - set(obj?: Partial): BigNumberConfig; - - /** - * Configures the settings for this particular BigNumber constructor. - */ - set( - DECIMAL_PLACES?: number, - ROUNDING_MODE?: RoundingMode, - EXPONENTIAL_AT?: number | number[], - RANGE?: number | number[], - ERRORS?: boolean | 0 | 1, - CRYPTO?: boolean | 0 | 1, - MODULO_MODE?: ModuloMode, - POW_PRECISION?: number - ): BigNumberConfig; - - /** - * Returns a BigNumber whose value is the maximum of `args`. - */ - max(...args: NumberLike[]): BigNumber; - - /** - * Returns a BigNumber whose value is the maximum of `args`. - */ - max(args: NumberLike[]): BigNumber; - - /** - * Returns a BigNumber whose value is the minimum of `args`. - */ - min(...args: NumberLike[]): BigNumber; - - /** - * Returns a BigNumber whose value is the minimum of `args`. - */ - min(args: NumberLike[]): BigNumber; - - /** - * Returns a new BigNumber with a pseudo-random value equal to or greater than `0` and less than `1`. - * - * The return value will have `dp` decimal places (or less if trailing zeros are produced). - * If `dp` is omitted then the number of decimal places will default to the current `DECIMAL_PLACES` setting. - * - * Depending on the value of this BigNumber constructor's `CRYPTO` setting and the support for the `crypto` object in the host environment, - * the random digits of the return value are generated by either - * `Math.random` (fastest), - * `crypto.getRandomValues` (Web Cryptography API in recent browsers) - * or `crypto.randomBytes` (Node.js). - * - * If `CRYPTO` is `true`, i.e. one of the `crypto` methods is to be used, - * the value of a returned BigNumber should be cryptographically-secure and statistically indistinguishable from a random value. - */ - random(dp?: number): BigNumber; - - /** - * Rounds away from zero - */ - ROUND_UP: 0; - - /** - * Rounds towards zero - */ - ROUND_DOWN: 1; - - /** - * Rounds towards `Infinity` - */ - ROUND_CEIL: 2; - - /** - * Rounds towards `-Infinity` - */ - ROUND_FLOOR: 3; - - /** - * Rounds towards nearest neighbour. - * If equidistant, rounds away from zero. - */ - ROUND_HALF_UP: 4; - - /** - * Rounds towards nearest neighbour. - * If equidistant, rounds towards zero. - */ - ROUND_HALF_DOWN: 5; - - /** - * Rounds towards nearest neighbour. - * If equidistant, rounds towards even neighbour. - */ - ROUND_HALF_EVEN: 6; - - /** - * Rounds towards nearest neighbour. - * If equidistant, rounds towards `Infinity`. - */ - ROUND_HALF_CEIL: 7; - - /** - * Rounds towards nearest neighbour. - * If equidistant, rounds towards `-Infinity`. - */ - ROUND_HALF_FLOOR: 8; - - /** - * The remainder is always positive. - * - * Euclidian division: `q = sign(n) * floor(a / abs(n))` - */ - EUCLID: 9; - } - - interface BigNumber { - - /** - * Returns a BigNumber whose value is the absolute value, i.e. the magnitude, of the value of this BigNumber. - */ - absoluteValue(): BigNumber; - - /** - * Returns a BigNumber whose value is the absolute value, i.e. the magnitude, of the value of this BigNumber. - */ - abs(): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber rounded to a whole number in the direction of positive Infinity. - */ - ceil(): BigNumber; - - /** - * Returns - * - * `1` if the value of this BigNumber is greater than the value of `n` - * - * `-1` if the value of this BigNumber is less than the value of `n` - * - * `0` if this BigNumber and `n` have the same value - * - * `null` if the value of either this BigNumber or `n` is `NaN` - */ - comparedTo(n: NumberLike, base?: number): 1 | -1 | 0 | null; - - /** - * Returns - * - * `1` if the value of this BigNumber is greater than the value of `n` - * - * `-1` if the value of this BigNumber is less than the value of `n` - * - * `0` if this BigNumber and `n` have the same value - * - * `null` if the value of either this BigNumber or `n` is `NaN` - */ - cmp(n: NumberLike, base?: number): 1 | -1 | 0 | null; - - /** - * Return the number of decimal places of the value of this BigNumber, or `null` if the value of this BigNumber is `±Infinity` or `NaN`. - */ - decimalPlaces(): number; - - /** - * Return the number of decimal places of the value of this BigNumber, or `null` if the value of this BigNumber is `±Infinity` or `NaN`. - */ - dp(): number; - - /** - * Returns a BigNumber whose value is the value of this BigNumber divided by `n`, rounded according to the current `DECIMAL_PLACES` and `ROUNDING_MODE` configuration. - */ - dividedBy(n: NumberLike, base?: number): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber divided by `n`, rounded according to the current `DECIMAL_PLACES` and `ROUNDING_MODE` configuration. - */ - div(n: NumberLike, base?: number): BigNumber; - - /** - * Return a BigNumber whose value is the integer part of dividing the value of this BigNumber by `n`. - */ - dividedToIntegerBy(n: NumberLike, base?: number): BigNumber; - - /** - * Return a BigNumber whose value is the integer part of dividing the value of this BigNumber by `n`. - */ - divToInt(n: NumberLike, base?: number): BigNumber; - - /** - * Returns `true` if the value of this BigNumber equals the value of `n`, otherwise returns `false`. - * - * As with JavaScript, `NaN` does not equal `NaN`. - */ - equals(n: NumberLike, base?: number): boolean; - - /** - * Returns `true` if the value of this BigNumber equals the value of `n`, otherwise returns `false`. - * - * As with JavaScript, `NaN` does not equal `NaN`. - */ - eq(n: NumberLike, base?: number): boolean; - - /** - * Returns a BigNumber whose value is the value of this BigNumber rounded to a whole number in the direction of negative `Infinity`. - */ - floor(): BigNumber; - - /** - * Returns `true` if the value of this BigNumber is greater than the value of `n`, otherwise returns `false`. - */ - greaterThan(n: NumberLike, base?: number): boolean; - - /** - * Returns `true` if the value of this BigNumber is greater than the value of `n`, otherwise returns `false`. - */ - gt(n: NumberLike, base?: number): boolean; - - /** - * Returns `true` if the value of this BigNumber is greater than or equal to the value of `n`, otherwise returns `false`. - */ - greaterThanOrEqualTo(n: NumberLike, base?: number): boolean; - - /** - * Returns `true` if the value of this BigNumber is greater than or equal to the value of `n`, otherwise returns `false`. - */ - gte(n: NumberLike, base?: number): boolean; - - /** - * Returns `true` if the value of this BigNumber is a finite number, otherwise returns `false`. - * - * The only possible non-finite values of a BigNumber are `NaN`, `Infinity` and `-Infinity`. - */ - isFinite(): boolean; - - /** - * Returns `true` if the value of this BigNumber is a whole number, otherwise returns `false`. - */ - isInteger(): boolean; - - /** - * Returns `true` if the value of this BigNumber is a whole number, otherwise returns `false`. - */ - isInt(): boolean; - - /** - * Returns `true` if the value of this BigNumber is NaN, otherwise returns `false`. - */ - isNaN(): boolean; - - /** - * Returns `true` if the value of this BigNumber is negative, otherwise returns `false`. - */ - isNegative(): boolean; - - /** - * Returns `true` if the value of this BigNumber is negative, otherwise returns `false`. - */ - isNeg(): boolean; - - /** - * Returns `true` if the value of this BigNumber is zero or minus zero, otherwise returns `false`. - */ - isZero(): boolean; - - /** - * Returns `true` if the value of this BigNumber is less than the value of `n`, otherwise returns `false`. - */ - lessThan(n: NumberLike, base?: number): boolean; - - /** - * Returns `true` if the value of this BigNumber is less than the value of `n`, otherwise returns `false`. - */ - lt(n: NumberLike, base?: number): boolean; - - /** - * Returns `true` if the value of this BigNumber is less than or equal to the value of `n`, otherwise returns - */ - lessThanOrEqualTo(n: NumberLike, base?: number): boolean; - - /** - * Returns `true` if the value of this BigNumber is less than or equal to the value of `n`, otherwise returns - */ - lte(n: NumberLike, base?: number): boolean; - - /** - * Returns a BigNumber whose value is the value of this BigNumber minus `n`. - */ - minus(n: NumberLike, base?: number): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber minus `n`. - */ - sub(n: NumberLike, base?: number): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber modulo `n`, i.e. the integer remainder of dividing this BigNumber by `n`. - * - * The value returned, and in particular its sign, is dependent on the value of the `MODULO_MODE` setting of this BigNumber constructor. - * If it is `1` (default value), the result will have the same sign as this BigNumber, - * and it will match that of Javascript's `%` operator (within the limits of double precision) and BigDecimal's `remainder` method. - */ - modulo(n: NumberLike, base?: number): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber modulo `n`, i.e. the integer remainder of dividing this BigNumber by `n`. - * - * The value returned, and in particular its sign, is dependent on the value of the `MODULO_MODE` setting of this BigNumber constructor. - * If it is `1` (default value), the result will have the same sign as this BigNumber, - * and it will match that of Javascript's `%` operator (within the limits of double precision) and BigDecimal's `remainder` method. - */ - mod(n: NumberLike, base?: number): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber negated, i.e. multiplied by `-1`. - */ - negated(): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber negated, i.e. multiplied by `-1`. - */ - neg(): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber plus `n`. - */ - plus(n: NumberLike, base?: number): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber plus `n`. - */ - add(n: NumberLike, base?: number): BigNumber; - - /** - * Returns the number of significant digits of the value of this BigNumber. - * - * If `z` is `true` or `1` then any trailing zeros of the integer part of a number are counted as significant digits, otherwise they are not. - */ - precision(z?: boolean | 0 | 1): number; - - /** - * Returns the number of significant digits of the value of this BigNumber. - * - * If `z` is `true` or `1` then any trailing zeros of the integer part of a number are counted as significant digits, otherwise they are not. - */ - sd(z?: boolean | 0 | 1): number; - - /** - * Returns a BigNumber whose value is the value of this BigNumber rounded by rounding mode `rm` to a maximum of `dp` decimal places. - * - * If `dp` is omitted, or is `null` or `undefined`, the return value is `n` rounded to a whole number. - * - * If `rm` is omitted, or is `null` or `undefined`, `ROUNDING_MODE` is used. - */ - round(dp?: number, rm?: RoundingMode): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber shifted `n` places. - * - * The shift is of the decimal point, i.e. of powers of ten, and is to the left if `n` is negative or to the right if `n` is positive. - */ - shift(n: number): BigNumber; - - /** - * Returns a BigNumber whose value is the square root of the value of this BigNumber, rounded according to the current `DECIMAL_PLACES` and `ROUNDING_MODE` configuration. - * - * The return value will be correctly rounded, i.e. rounded as if the result was first calculated to an infinite number of correct digits before rounding. - */ - squareRoot(): BigNumber; - - /** - * Returns a BigNumber whose value is the square root of the value of this BigNumber, rounded according to the current `DECIMAL_PLACES` and `ROUNDING_MODE` configuration. - * - * The return value will be correctly rounded, i.e. rounded as if the result was first calculated to an infinite number of correct digits before rounding. - */ - sqrt(): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber times `n`. - */ - times(n: NumberLike, base?: number): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber times `n`. - */ - mul(n: NumberLike, base?: number): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber rounded to `sd` significant digits using rounding mode `rm`. - * - * If `sd` is omitted or is `null` or `undefined`, the return value will not be rounded. - * - * If `rm` is omitted or is `null` or `undefined`, ROUNDING_MODE will be used. - */ - toDigits(sd?: number, rm?: RoundingMode): BigNumber; - - /** - * Returns a string representing the value of this BigNumber in exponential notation rounded using rounding mode `rm` to `dp` decimal places, - * i.e with one digit before the decimal point and `dp` digits after it. - * - * If the value of this BigNumber in exponential notation has fewer than `dp` fraction digits, the return value will be appended with zeros accordingly. - * - * If `dp` is omitted, or is `null` or `undefined`, the number of digits after the decimal point defaults to the minimum number of digits necessary to represent the value exactly. - * - * If `rm` is omitted or is `null` or `undefined`, `ROUNDING_MODE` is used. - */ - toExponential(dp?: number, rm?: RoundingMode): string; - - /** - * Returns a string representing the value of this BigNumber in normal (fixed-point) notation rounded to `dp` decimal places using rounding mode `rm`. - * - * If the value of this BigNumber in normal notation has fewer than `dp` fraction digits, the return value will be appended with zeros accordingly. - * - * Unlike `Number.prototype.toFixed`, which returns exponential notation if a number is greater or equal to `10e21`, this method will always return normal notation. - * - * If `dp` is omitted or is `null` or `undefined`, the return value will be unrounded and in normal notation. - * This is also unlike `Number.prototype.toFixed`, which returns the value to zero decimal places. - * It is useful when fixed-point notation is required and the current `EXPONENTIAL_AT` setting causes `toString` to return exponential notation. - * - * If `rm` is omitted or is `null` or `undefined`, `ROUNDING_MODE` is used. - */ - toFixed(dp?: number, rm?: RoundingMode): string; - - /** - * Returns a string representing the value of this BigNumber in normal (fixed-point) notation rounded to `dp` decimal places using rounding mode `rm`, - * and formatted according to the properties of the `FORMAT` object. - * - * If `dp` is omitted or is `null` or `undefined`, then the return value is not rounded to a fixed number of decimal places. - * - * If `rm` is omitted or is `null` or `undefined`, `ROUNDING_MODE` is used. - */ - toFormat(dp?: number, rm?: RoundingMode): string; - - /** - * Returns a string array representing the value of this BigNumber as a simple fraction with an integer numerator and an integer denominator. - * The denominator will be a positive non-zero value less than or equal to `max`. - * - * If a maximum denominator, `max`, is not specified, or is `null` or `undefined`, the denominator will be the lowest value necessary to represent the number exactly. - */ - toFraction(max?: NumberLike): [string, string]; - - /** - * As `valueOf`. - */ - toJSON(): string; - - /** - * Returns the value of this BigNumber as a JavaScript number primitive. - * - * Type coercion with, for example, the unary plus operator will also work, except that a BigNumber with the value minus zero will be converted to positive zero. - */ - toNumber(): number; - - /** - * Returns a BigNumber whose value is the value of this BigNumber raised to the power `n`, and optionally modulo a modulus `m`. - * - * If `n` is negative the result is rounded according to the current `DECIMAL_PLACES` and `ROUNDING_MODE` configuration. - */ - toPower(n: number, m?: NumberLike): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber raised to the power `n`, and optionally modulo a modulus `m`. - * - * If `n` is negative the result is rounded according to the current `DECIMAL_PLACES` and `ROUNDING_MODE` configuration. - */ - pow(n: number, m?: NumberLike): BigNumber; - - /** - * Returns a string representing the value of this BigNumber rounded to `sd` significant digits using rounding mode `rm`. - * - * If `sd` is less than the number of digits necessary to represent the integer part of the value in normal (fixed-point) notation, then exponential notation is used. - * - * If `sd` is omitted, or is `null` or `undefined`, then the return value is the same as `n.toString()`. - * - * If `rm` is omitted or is `null` or `undefined`, `ROUNDING_MODE` is used. - */ - toPrecision(sd?: number, rm?: RoundingMode): string; - - /** - * Returns a string representing the value of this BigNumber in the specified base, or base `10` if `base` is omitted or is `null` or `undefined`. - */ - toString(base?: number): string; - - /** - * Returns a BigNumber whose value is the value of this BigNumber truncated to a whole number. - */ - truncated(): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber truncated to a whole number. - */ - trunc(): BigNumber; - - /** - * As `toString`, but does not accept a base argument and includes the minus sign for negative zero. - */ - valueOf(): string; - - /** - * coefficient - * @description Array of base 1e14 numbers - */ - c: number[] | null; - - /** - * exponent - * @description Integer, -1000000000 to 1000000000 inclusive - */ - e: number | null; - - /** - * sign - */ - s: -1 | 1 | null; - - /** - * type identifier - */ - isBigNumber: true; - } -} \ No newline at end of file diff --git a/bignumber.js/tslint.json b/bignumber.js/tslint.json deleted file mode 100644 index 2221e40e4a..0000000000 --- a/bignumber.js/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } \ No newline at end of file diff --git a/bitcoinjs-lib/bitcoinjs-lib-tests.ts b/bitcoinjs-lib/bitcoinjs-lib-tests.ts deleted file mode 100644 index bdaee3ee83..0000000000 --- a/bitcoinjs-lib/bitcoinjs-lib-tests.ts +++ /dev/null @@ -1,64 +0,0 @@ -/// - -import bigi = require('bigi'); -import bitcoin = require('bitcoinjs-lib'); - -declare var it: any; -declare var describe: any; -declare var assert: any; - -describe('bitcoinjs-lib (basic)', () => { - it('can generate a random bitcoin address', () => { - // for testing only - function rng() { return new Buffer('zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz'); } - - // generate random keyPair - var keyPair = bitcoin.ECPair.makeRandom({ rng }); - var address = keyPair.getAddress(); - - assert.strictEqual(address, '1F5VhMHukdnUES9kfXqzPzMeF1GPHKiF64'); - }); - - it('can generate an address from a SHA256 hash', () => { - var hash = bitcoin.crypto.sha256('correct horse battery staple'); - var d = bigi.fromBuffer(hash); - - var keyPair = new bitcoin.ECPair(d); - var address = keyPair.getAddress(); - - assert.strictEqual(address, '1C7zdTfnkzmr13HfA2vNm5SJYRK6nEKyq8'); - }); - - it('can generate a random keypair for alternative networks', () => { - // for testing only - function rng() { return new Buffer('zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz'); } - - var litecoin = bitcoin.networks.litecoin; - - var keyPair = bitcoin.ECPair.makeRandom({ network: litecoin, rng }); - var wif = keyPair.toWIF(); - var address = keyPair.getAddress(); - - assert.strictEqual(address, 'LZJSxZbjqJ2XVEquqfqHg1RQTDdfST5PTn'); - assert.strictEqual(wif, 'T7A4PUSgTDHecBxW1ZiYFrDNRih2o7M8Gf9xpoCgudPF9gDiNvuS'); - }); - - it('can import an address via WIF', () => { - var keyPair = bitcoin.ECPair.fromWIF('Kxr9tQED9H44gCmp6HAdmemAzU3n84H3dGkuWTKvE23JgHMW8gct'); - var address = keyPair.getAddress(); - - assert.strictEqual(address, '19AAjaTUbRjQCMuVczepkoPswiZRhjtg31'); - }); - - it('can create a Transaction', () => { - var keyPair = bitcoin.ECPair.fromWIF('L1uyy5qTuGrVXrmrsvHWHgVzW9kKdrp27wBC7Vs6nZDTF2BRUVwy'); - var tx = new bitcoin.TransactionBuilder(); - - tx.addInput('aa94ab02c182214f090e99a0d57021caffd0f195a81c24602b1028b130b63e31', 0); - tx.addOutput('1Gokm82v6DmtwKEB8AiVhm82hyFSsEvBDK', 15000); - tx.sign(0, keyPair); - - // tslint:disable-next-line:max-line-length - assert.strictEqual(tx.build().toHex(), '0100000001313eb630b128102b60241ca895f1d0ffca2170d5a0990e094f2182c102ab94aa000000006b483045022100aefbcf847900b01dd3e3debe054d3b6d03d715d50aea8525f5ea3396f168a1fb022013d181d05b15b90111808b22ef4f9ebe701caf2ab48db269691fdf4e9048f4f60121029f50f51d63b345039a290c94bffd3180c99ed659ff6ea6b1242bca47eb93b59fffffffff01983a0000000000001976a914ad618cf4333b3b248f9744e8e81db2964d0ae39788ac00000000'); - }); -}); diff --git a/bitcoinjs-lib/tslint.json b/bitcoinjs-lib/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/bitcoinjs-lib/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/bittorrent-protocol/bittorrent-protocol-tests.ts b/bittorrent-protocol/bittorrent-protocol-tests.ts deleted file mode 100644 index 1d0d17793a..0000000000 --- a/bittorrent-protocol/bittorrent-protocol-tests.ts +++ /dev/null @@ -1,20 +0,0 @@ -import * as Protocol from 'bittorrent-protocol'; -import * as net from 'net'; - -net.createServer(socket => { - var wire = new Protocol(); - - // pipe to and from the protocol - socket.pipe(wire).pipe(socket); - - wire.on('handshake', (infoHash, peerId) => { - // receive a handshake (infoHash and peerId are hex strings) - - // lets emit a handshake of our own as well - wire.handshake('my info hash (hex)', 'my peer id (hex)'); - }); - - wire.on('unchoke', () => { - console.log('peer is no longer choking us: ' + wire.peerChoking); - }); -}).listen(6881); diff --git a/bittorrent-protocol/index.d.ts b/bittorrent-protocol/index.d.ts deleted file mode 100644 index be1a60b179..0000000000 --- a/bittorrent-protocol/index.d.ts +++ /dev/null @@ -1,95 +0,0 @@ -// Type definitions for bittorrent-protocol 2.1 -// Project: https://github.com/feross/bittorrent-protocol#readme -// Definitions by: Tomasz Łaziuk -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -import * as stream from 'stream'; - -declare const BittorrentProtocol: BittorrentProtocol.BittorrentProtocol; - -declare namespace BittorrentProtocol { - export interface BittorrentProtocol { - new (): Wire; - (): Wire; - } - - export interface Extension { - //tslint:disable-next-line:no-misused-new - could use class instead of interface but class is not extendible - constructor(wire: Wire): this; - onHandshake?: () => void; - onExtendedHandshake?: () => void; - onMessage?: () => void; - name: string; - } - - export interface Request { - //tslint:disable-next-line:no-misused-new - could use class instead of interface but class is not extendible - constructor(piece: number, offset: number, length: number, callback: () => void): this; - piece: number; - offset: number; - length: number; - callback: () => void; - } - - export interface Wire extends stream.Duplex { - readonly peerId: string; // remote peer id (hex string) - readonly peerIdBuffer: Buffer; // remote peer id (Buffer) - readonly type: 'webrtc' | 'tcpIncoming' | 'tcpOutgoing' | 'webSeed'; // connection type - readonly amChoking: boolean; // are we choking the peer? - readonly amInterested: boolean; // are we interested in the peer? - readonly peerChoking: boolean; // is the peer choking us? - readonly peerInterested: boolean; // is the peer interested in us? - readonly requests: Request[]; - readonly peerRequests: Request[]; - readonly extendedMapping: { [key: number]: string, }; - readonly peerExtendedMapping: { [key: string]: number, }; - - setKeepAlive(enable: boolean): void; - - setTimeot(ms: number, unref?: boolean): void; - - destroy(): void; - - use(ext: Extension): void; - - handshake(infoHash: string | Buffer, peerId: string | Buffer, extensions?: any): void; - - choke(): void; - - unchoke(): void; - - interested(): void; - - uninterested(): void; - - have(index: number): void; - - // TODO: bitfield can be also a bitfield instance - bitfield(bitfield: Buffer | any): void; - - request(index: number, offset: number, length: number, cb?: (err: Error) => T): T | void; - - piece(index: number, offset: number, buffer: Buffer): void; - - cancel(index: number, offset: number, length: number): void; - - port(port: number): void; - - extend(ext: number | string, obj: any): void; - - // TODO: bitfield is a bitfield instance - on(event: 'bitfield', listener: (bitfield: any) => void): this; - on(event: string | 'keep-alive' | 'choke' | 'unchoke' | 'interested' | 'uninterested' | 'timeout', listener: () => void): this; - on(event: 'upload' | 'have' | 'download' | 'port', listener: (length: number) => void): this; - on(event: 'handshake', listener: (infoHash: string, peerId: string, extensions: Extension[]) => void): this; - on(event: 'request', listener: (index: number, offset: number, length: number, respond: () => void) => void): this; - on(event: 'piece', listener: (index: number, offset: number, buffer: Buffer) => void): this; - on(event: 'cancel', listener: (index: number, offset: number, length: number) => void): this; - on(event: 'extended', listener: (ext: 'handshake' | string, buf: any) => void): void; - on(event: 'unknownmessage', listener: (buffer: Buffer) => void): this; - } -} - -export = BittorrentProtocol; diff --git a/bittorrent-protocol/tslint.json b/bittorrent-protocol/tslint.json deleted file mode 100644 index 3c4a3237e8..0000000000 --- a/bittorrent-protocol/tslint.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "../tslint.json", - "rules": { - "no-misused-new": false - } -} diff --git a/blacklist/tslint.json b/blacklist/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/blacklist/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/blissfuljs/index.d.ts b/blissfuljs/index.d.ts deleted file mode 100644 index 76061c1391..0000000000 --- a/blissfuljs/index.d.ts +++ /dev/null @@ -1,670 +0,0 @@ -// 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 namespace 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"): HTMLQuoteElement; - create(tag: "body"): HTMLBodyElement; - create(tag: "br"): HTMLBRElement; - create(tag: "button"): HTMLButtonElement; - create(tag: "canvas"): HTMLCanvasElement; - create(tag: "datalist"): HTMLDataListElement; - create(tag: "dd"): HTMLElement; - 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): HTMLQuoteElement; - 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): HTMLElement; - 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; - }; - - $: BlissStaticCollection; - } - - 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: MouseEvent) => 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/blob-stream/blob-stream-tests.ts b/blob-stream/blob-stream-tests.ts deleted file mode 100644 index b9174859f9..0000000000 --- a/blob-stream/blob-stream-tests.ts +++ /dev/null @@ -1,7 +0,0 @@ - -/// - -var bl = require('blob-stream'); - -var blob = bl.toBlob(); -var brl = bl.toBlobURL("app/JSON"); diff --git a/bluebird-global/index.d.ts b/bluebird-global/index.d.ts deleted file mode 100644 index e4c4920501..0000000000 --- a/bluebird-global/index.d.ts +++ /dev/null @@ -1,191 +0,0 @@ -// Type definitions for bluebird 3.5 -// Project: https://github.com/petkaantonov/bluebird -// Definitions by: d-ph -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/* - * 1. Why use `bluebird-global` instead of `bluebird`? - * - * If you want to leverage the fact, that bluebird polyfills the global Promise in the browser, then - * you need to tell TypeScript about this. The following declaration file does exactly that. - * - * 2. How to use it? - * - * Add `bluebird-global` to the `types` array in your `tsconfig.json` like this: - * - * { - * "compilerOptions": { - * "types": [ - * "bluebird-global" - * ], - * } - * } - * - * 3. Why so much effort? - * - * If a promise-polyfilling library wants to play nicely with TypeScript, it needs to augment - * the Promise and PromiseConstructor interfaces defined in the standard ts library. - * For various reasons this couldn't be done in The `bluebird` typings. - * - * 4. Contributors: After changing this file please manually test these cases (via altering ./tsconfig.json ): - * a. target es5, no `lib` key - * b. target es6, no `lib` key - * c. target es5, latest "es20xx", e.g. "es2017" - * d. target es6, latest "es20xx", e.g. "es2017" - */ - -import * as Bluebird from "bluebird"; - -declare global { - /* - * Patch all instance method - */ - interface Promise { - all: typeof Bluebird.prototype.all; - any: typeof Bluebird.prototype.any; - asCallback: typeof Bluebird.prototype.asCallback; - bind: typeof Bluebird.prototype.bind; - call: typeof Bluebird.prototype.call; - cancel: typeof Bluebird.prototype.cancel; - // catch: typeof Bluebird.prototype.catch; - caught: typeof Bluebird.prototype.caught; - delay: typeof Bluebird.prototype.delay; - disposer: typeof Bluebird.prototype.disposer; - done: typeof Bluebird.prototype.done; - each: typeof Bluebird.prototype.each; - error: typeof Bluebird.prototype.error; - filter: typeof Bluebird.prototype.filter; - finally: typeof Bluebird.prototype.finally; - get: typeof Bluebird.prototype.get; - isCancelled: typeof Bluebird.prototype.isCancelled; - isFulfilled: typeof Bluebird.prototype.isFulfilled; - isPending: typeof Bluebird.prototype.isPending; - isRejected: typeof Bluebird.prototype.isRejected; - isResolved: typeof Bluebird.prototype.isResolved; - lastly: typeof Bluebird.prototype.lastly; - map: typeof Bluebird.prototype.map; - mapSeries: typeof Bluebird.prototype.mapSeries; - nodeify: typeof Bluebird.prototype.nodeify; - props: typeof Bluebird.prototype.props; - race: typeof Bluebird.prototype.race; - reason: typeof Bluebird.prototype.reason; - reduce: typeof Bluebird.prototype.reduce; - reflect: typeof Bluebird.prototype.reflect; - return: typeof Bluebird.prototype.return; - some: typeof Bluebird.prototype.some; - spread: typeof Bluebird.prototype.spread; - suppressUnhandledRejections: typeof Bluebird.prototype.suppressUnhandledRejections; - tap: typeof Bluebird.prototype.tap; - tapCatch: typeof Bluebird.prototype.tapCatch; - // then: typeof Bluebird.prototype.then; - thenReturn: typeof Bluebird.prototype.thenReturn; - thenThrow: typeof Bluebird.prototype.thenThrow; - throw: typeof Bluebird.prototype.throw; - timeout: typeof Bluebird.prototype.timeout; - toJSON: typeof Bluebird.prototype.toJSON; - toString: typeof Bluebird.prototype.toString; - value: typeof Bluebird.prototype.value; - - /* - * Copy&paste ::then and ::catch from lib.es2015.promise.d.ts, because Bluebird's typings are not - * in line with the standard lib. - * - * This is only needed for es5 target, which doesn't include the lib.es2015.promise.d.ts typings. - * - * @todo Make Bluebird's typings be in line with the standard lib. - */ - then(onfulfilled?: ((value: T) => T | PromiseLike) | undefined | null, onrejected?: ((reason: any) => T | PromiseLike) | undefined | null): Promise; - then(onfulfilled: ((value: T) => T | PromiseLike) | undefined | null, onrejected: (reason: any) => TResult | PromiseLike): Promise; - then(onfulfilled: (value: T) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): Promise; - then(onfulfilled: (value: T) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; - catch(onrejected?: ((reason: any) => T | PromiseLike) | undefined | null): Promise; - catch(onrejected: (reason: any) => TResult | PromiseLike): Promise; - - /* - * TypeScript disallows adding overrides via `catch: typeof Bluebird.prototype.catch`. Copy&paste them then. - * - * @todo Duplication of code is never ideal. See whether there's a better way of achieving this. - */ - catch(predicate: (error: any) => boolean, onReject: (error: any) => T | Bluebird.Thenable | void | Bluebird.Thenable): Bluebird; - catch(predicate: (error: any) => boolean, onReject: (error: any) => U | Bluebird.Thenable): Bluebird; - catch(ErrorClass: new (...args: any[]) => E, onReject: (error: E) => T | Bluebird.Thenable | void | Bluebird.Thenable): Bluebird; - catch(ErrorClass: new (...args: any[]) => E, onReject: (error: E) => U | Bluebird.Thenable): Bluebird; - catch(predicate: Object, onReject: (error: any) => T | Bluebird.Thenable | void | Bluebird.Thenable): Bluebird; - catch(predicate: Object, onReject: (error: any) => U | Bluebird.Thenable): Bluebird; - } - - /* - * Patch all static methods and the constructor - */ - interface PromiseConstructor { - new (callback: (resolve: (thenableOrResult?: T | Bluebird.Thenable) => void, reject: (error?: any) => void, onCancel?: (callback: () => void) => void) => void): Promise; - - // all: typeof Bluebird.all; - any: typeof Bluebird.any; - attempt: typeof Bluebird.attempt; - bind: typeof Bluebird.bind; - cast: typeof Bluebird.cast; - config: typeof Bluebird.config; - coroutine: typeof Bluebird.coroutine; - defer: typeof Bluebird.defer; - delay: typeof Bluebird.delay; - each: typeof Bluebird.each; - filter: typeof Bluebird.filter; - fromCallback: typeof Bluebird.fromCallback; - fromNode: typeof Bluebird.fromNode; - is: typeof Bluebird.is; - join: typeof Bluebird.join; - longStackTraces: typeof Bluebird.longStackTraces; - map: typeof Bluebird.map; - mapSeries: typeof Bluebird.mapSeries; - method: typeof Bluebird.method; - onPossiblyUnhandledRejection: typeof Bluebird.onPossiblyUnhandledRejection; - promisify: typeof Bluebird.promisify; - promisifyAll: typeof Bluebird.promisifyAll; - props: typeof Bluebird.props; - // race: typeof Bluebird.race; - reduce: typeof Bluebird.reduce; - // reject: typeof Bluebird.reject; - // resolve: typeof Bluebird.resolve; - some: typeof Bluebird.some; - try: typeof Bluebird.try; - using: typeof Bluebird.using; - - /* - * Copy&paste from lib.es2015.promise.d.ts, because Bluebird's typings are not in line with the standard lib. - * - * This is only needed for es5 target, which doesn't include the lib.es2015.promise.d.ts typings. - * - * @todo Make Bluebird's typings be in line with the standard lib. - */ - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike]): Promise<[T1, T2, T3, T4, T5]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike ]): Promise<[T1, T2, T3, T4]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>; - all(values: (T | PromiseLike)[]): Promise; - race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise; - race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise; - race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise; - race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise; - race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike]): Promise; - race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike]): Promise; - race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike]): Promise; - race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise; - race(values: [T1 | PromiseLike, T2 | PromiseLike]): Promise; - race(values: (T | PromiseLike)[]): Promise; - reject(reason: any): Promise; - reject(reason: any): Promise; - resolve(value: T | PromiseLike): Promise; - resolve(): Promise; - } - - /* - * Declare the `Promise` variable. This is needed for es5 only and is a no-op for all other targets. - */ - var Promise: PromiseConstructor; -} diff --git a/bluebird-global/tslint.json b/bluebird-global/tslint.json deleted file mode 100644 index b03221674a..0000000000 --- a/bluebird-global/tslint.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../tslint.json", - "rules": { - "max-line-length": false, - "no-empty-interface": false, - "array-type": false, - "unified-signatures": false, - "forbidden-types": false - } -} diff --git a/bluebird-retry/index.d.ts b/bluebird-retry/index.d.ts deleted file mode 100644 index 22c7b1c95e..0000000000 --- a/bluebird-retry/index.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -// Type definitions for bluebird-retry -// Project: https://github.com/jut-io/bluebird-retry -// Definitions by: Pascal Vomhoff -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -import Promise = require('bluebird'); - -declare function retry(func: (param: T) => void, options?: retry.Options): Promise; - -declare namespace retry { - export interface Options { - interval?: number; - backoff?: number; - max_interval?: number; - timeout?: number; - max_tries?: number; - predicate?: any; - } - -} - -export = retry; diff --git a/bluebird/index.d.ts b/bluebird/index.d.ts deleted file mode 100644 index ecacedfd0d..0000000000 --- a/bluebird/index.d.ts +++ /dev/null @@ -1,796 +0,0 @@ -// Type definitions for bluebird 3.5.0 -// Project: https://github.com/petkaantonov/bluebird -// Definitions by: Leonard Hecker -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/*! - * The code following this comment originates from: - * https://github.com/types/npm-bluebird - * - * Note for browser users: use bluebird-global typings instead of this one - * if you want to use Bluebird via the global Promise symbol. - * - * Licensed under: - * The MIT License (MIT) - * - * Copyright (c) 2016 unional - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -declare class Bluebird implements Bluebird.Thenable, Bluebird.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. - * If promise cancellation is enabled, passed in function will receive one more function argument `onCancel` that allows to register an optional cancellation callback. - */ - constructor(callback: (resolve: (thenableOrResult?: R | Bluebird.Thenable) => void, reject: (error?: any) => void, onCancel?: (callback: () => void) => void) => void); - - /** - * Promises/A+ `.then()`. 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) => U1 | Bluebird.Thenable, onReject: (error: any) => U2 | Bluebird.Thenable): Bluebird; - then(onFulfill: (value: R) => U | Bluebird.Thenable, onReject: (error: any) => U | Bluebird.Thenable): Bluebird; - then(onFulfill: (value: R) => U | Bluebird.Thenable): Bluebird; - then(): Bluebird; - - /** - * 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) => R | Bluebird.Thenable | void | Bluebird.Thenable): Bluebird; - caught(onReject?: (error: any) => R | Bluebird.Thenable | void | Bluebird.Thenable): Bluebird; - catch(onReject?: (error: any) => U | Bluebird.Thenable): Bluebird; - caught(onReject?: (error: any) => U | Bluebird.Thenable): Bluebird; - - /** - * 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) => R | Bluebird.Thenable | void | Bluebird.Thenable): Bluebird; - caught(predicate: (error: any) => boolean, onReject: (error: any) => R | Bluebird.Thenable | void | Bluebird.Thenable): Bluebird; - - catch(predicate: (error: any) => boolean, onReject: (error: any) => U | Bluebird.Thenable): Bluebird; - caught(predicate: (error: any) => boolean, onReject: (error: any) => U | Bluebird.Thenable): Bluebird; - - catch(ErrorClass: new (...args: any[]) => E, onReject: (error: E) => R | Bluebird.Thenable | void | Bluebird.Thenable): Bluebird; - caught(ErrorClass: new (...args: any[]) => E, onReject: (error: E) => R | Bluebird.Thenable | void | Bluebird.Thenable): Bluebird; - - catch(ErrorClass: new (...args: any[]) => E, onReject: (error: E) => U | Bluebird.Thenable): Bluebird; - caught(ErrorClass: new (...args: any[]) => E, onReject: (error: E) => U | Bluebird.Thenable): Bluebird; - - catch(predicate: Object, onReject: (error: any) => R | Bluebird.Thenable | void | Bluebird.Thenable): Bluebird; - caught(predicate: Object, onReject: (error: any) => R | Bluebird.Thenable | void | Bluebird.Thenable): Bluebird; - - catch(predicate: Object, onReject: (error: any) => U | Bluebird.Thenable): Bluebird; - caught(predicate: Object, onReject: (error: any) => U | Bluebird.Thenable): Bluebird; - - /** - * 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) => U | Bluebird.Thenable): Bluebird; - - /** - * 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: () => U | Bluebird.Thenable): Bluebird; - - lastly(handler: () => U | Bluebird.Thenable): Bluebird; - - /** - * 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): Bluebird; - - /** - * Like `.then()`, but any unhandled rejection that ends up here will be thrown as an error. - */ - done(onFulfilled?: (value: R) => U | Bluebird.Thenable, onRejected?: (error: any) => U | Bluebird.Thenable): void; - - /** - * Like `.finally()`, but not called for rejections. - */ - tap(onFulFill: (value: R) => Bluebird.Thenable): Bluebird; - tap(onFulfill: (value: R) => U): Bluebird; - - /** - * Like `.catch()` but rethrows the error - */ - tapCatch(onReject: (error?: any) => U | Bluebird.Thenable | void | Bluebird.Thenable): Bluebird; - tapCatch(ErrorClass: new (...args: any[]) => E, onReject: (error: E) => U | Bluebird.Thenable | void | Bluebird.Thenable): Bluebird; - tapCatch(predicate: (error?: any) => boolean, onReject: (error?: any) => U | Bluebird.Thenable | void | Bluebird.Thenable): Bluebird; - - - /** - * Same as calling `Promise.delay(ms, this)`. - */ - delay(ms: number): Bluebird; - - /** - * 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 TimeoutError or the error as the reason. - * - * You may specify a custom error message with the `message` parameter. - */ - timeout(ms: number, message?: string | Error): Bluebird; - - /** - * 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. - * If the `callback` argument is not a function, this method does not do anything. - */ - nodeify(callback: (err: any, value?: R) => void, options?: Bluebird.SpreadOption): this; - nodeify(...sink: any[]): this; - asCallback(callback: (err: any, value?: R) => void, options?: Bluebird.SpreadOption): this; - asCallback(...sink: any[]): this; - - /** - * 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` has been cancelled. - */ - isCancelled(): 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 `.reflect()`. - */ - reflect(): Bluebird>; - reflect(): Bluebird>; - - /** - * This is a convenience method for doing: - * - * - * promise.then(function(obj){ - * return obj[propertyName].call(obj, arg...); - * }); - * - */ - call(propertyName: string, ...args: any[]): Bluebird; - - /** - * This is a convenience method for doing: - * - * - * promise.then(function(obj){ - * return obj[propertyName]; - * }); - * - */ - // TODO: Use "type property type" once it's there - // @see https://github.com/Microsoft/TypeScript/issues/1295 - get(key: string | number): Bluebird; - - /** - * 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(): Bluebird; - thenReturn(): Bluebird; - return(value: U): Bluebird; - thenReturn(value: U): Bluebird; - - /** - * Convenience method for: - * - * - * .then(function() { - * throw reason; - * }); - * - * Same limitations apply as with `.return()`. - * - * Alias `.thenThrow();` for compatibility with earlier ECMAScript version. - */ - throw(reason: Error): Bluebird; - thenThrow(reason: Error): Bluebird; - - /** - * 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. - */ - spread(fulfilledHandler: (...values: W[]) => U | Bluebird.Thenable): Bluebird; - spread(fulfilledHandler: Function): Bluebird; - - /** - * 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(): Bluebird; - - /** - * 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(): Bluebird; - - /** - * 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(): Bluebird; - - /** - * 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): Bluebird; - - /** - * 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(): Bluebird; - - /** - * Same as calling `Bluebird.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) => U | Bluebird.Thenable, options?: Bluebird.ConcurrencyOption): Bluebird; - - /** - * 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) => U | Bluebird.Thenable, initialValue?: U): Bluebird; - - /** - * 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) => boolean | Bluebird.Thenable, options?: Bluebird.ConcurrencyOption): Bluebird; - - /** - * Same as calling ``Bluebird.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 | Bluebird.Thenable): Bluebird; - - /** - * Same as calling ``Bluebird.mapSeries(thisPromise, iterator)``. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. - */ - mapSeries(iterator: (item: R, index: number, arrayLength: number) => U | Bluebird.Thenable): Bluebird; - - /** - * Cancel this `promise`. Will not do anything if this promise is already settled or if the cancellation feature has not been enabled - */ - cancel(): void; - - /** - * Basically sugar for doing: somePromise.catch(function(){}); - * - * Which is needed in case error handlers are attached asynchronously to the promise later, which would otherwise result in premature unhandled rejection reporting. - */ - suppressUnhandledRejections(): 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. - */ - static try(fn: () => R | Bluebird.Thenable): Bluebird; - static attempt(fn: () => R | Bluebird.Thenable): Bluebird; - - /** - * 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(): Bluebird; - static resolve(value: R | Bluebird.Thenable): Bluebird; - - /** - * Create a promise that is rejected with the given `reason`. - */ - static reject(reason: any): Bluebird; - static reject(reason: any): Bluebird; - - /** - * Create a promise with undecided fate and return a `PromiseResolver` to control it. See resolution?: Promise(#promise-resolution). - */ - static defer(): Bluebird.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: R | Bluebird.Thenable): Bluebird; - - /** - * Sugar for `Promise.resolve(undefined).bind(thisArg);`. See `.bind()`. - */ - static bind(thisArg: any): Bluebird; - - /** - * 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 already 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 resolved 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. - */ - static delay(ms: number, value: R | Bluebird.Thenable): Bluebird; - static delay(ms: number): Bluebird; - - /** - * 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, options?: Bluebird.PromisifyOptions): () => Bluebird; - static promisify(func: (arg1: A1, callback: (err: any, result: T) => void) => void, options?: Bluebird.PromisifyOptions): (arg1: A1) => Bluebird; - static promisify(func: (arg1: A1, arg2: A2, callback: (err: any, result: T) => void) => void, options?: Bluebird.PromisifyOptions): (arg1: A1, arg2: A2) => Bluebird; - static promisify(func: (arg1: A1, arg2: A2, arg3: A3, callback: (err: any, result: T) => void) => void, options?: Bluebird.PromisifyOptions): (arg1: A1, arg2: A2, arg3: A3) => Bluebird; - static promisify(func: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, callback: (err: any, result: T) => void) => void, options?: Bluebird.PromisifyOptions): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Bluebird; - static promisify(func: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5, callback: (err: any, result: T) => void) => void, options?: Bluebird.PromisifyOptions): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Bluebird; - static promisify(nodeFunction: Function, options?: Bluebird.PromisifyOptions): 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?: Bluebird.PromisifyAllOptions): Object; - - /** - * Returns a promise that is resolved by a node style callback function. - */ - static fromNode(resolver: (callback: (err: any, result?: any) => void) => void, options?: Bluebird.FromNodeOptions): Bluebird; - static fromNode(resolver: (callback: (err: any, result?: T) => void) => void, options?: Bluebird.FromNodeOptions): Bluebird; - static fromCallback(resolver: (callback: (err: any, result?: any) => void) => void, options?: Bluebird.FromNodeOptions): Bluebird; - static fromCallback(resolver: (callback: (err: any, result?: T) => void) => void, options?: Bluebird.FromNodeOptions): Bluebird; - - /** - * 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; - - /** - * 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 - // array with promises of different types - static all(values: [Bluebird.Thenable | T1, Bluebird.Thenable | T2, Bluebird.Thenable | T3, Bluebird.Thenable | T4, Bluebird.Thenable | T5]): Bluebird<[T1, T2, T3, T4, T5]>; - static all(values: [Bluebird.Thenable | T1, Bluebird.Thenable | T2, Bluebird.Thenable | T3, Bluebird.Thenable | T4]): Bluebird<[T1, T2, T3, T4]>; - static all(values: [Bluebird.Thenable | T1, Bluebird.Thenable | T2, Bluebird.Thenable | T3]): Bluebird<[T1, T2, T3]>; - static all(values: [Bluebird.Thenable | T1, Bluebird.Thenable | T2]): Bluebird<[T1, T2]>; - static all(values: [Bluebird.Thenable | T1]): Bluebird<[T1]>; - // array with values - static all(values: Bluebird.Thenable<(Bluebird.Thenable | R)[]> | (Bluebird.Thenable | R)[]): Bluebird; - - /** - * 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: Bluebird): Bluebird; - // object - static props(object: Object): Bluebird; - - /** - * 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. - */ - static any(values: Bluebird.Thenable<(Bluebird.Thenable | R)[]> | (Bluebird.Thenable | R)[]): Bluebird; - - /** - * 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. - */ - static race(values: Bluebird.Thenable<(Bluebird.Thenable | R)[]> | (Bluebird.Thenable | R)[]): Bluebird; - - /** - * 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: Bluebird.Thenable[]>, count: number): Bluebird; - // promise of array with values - static some(values: Bluebird.Thenable, count: number): Bluebird; - // array with promises of value - static some(values: Bluebird.Thenable[], count: number): Bluebird; - // array with values - static some(values: R[], count: number): Bluebird; - - /** - * Promise.join( - * Promise|any values..., - * function handler - * ) -> Promise - * For coordinating multiple concurrent discrete promises. - * - * Note: In 1.x and 0.x Promise.join used to be a Promise.all that took the values in as arguments instead in an array. This behavior has been deprecated but is still supported partially - when the last argument is an immediate function value the new semantics will apply - */ - static join(arg1: A1 | Bluebird.Thenable, handler: (arg1?: A1) => R | Bluebird.Thenable): Bluebird; - static join(arg1: A1 | Bluebird.Thenable, arg2: A2 | Bluebird.Thenable, handler: (arg1?: A1, arg2?: A2) => R | Bluebird.Thenable): Bluebird; - static join(arg1: A1 | Bluebird.Thenable, arg2: A2 | Bluebird.Thenable, arg3: A3 | Bluebird.Thenable, handler: (arg1?: A1, arg2?: A2, arg3?: A3) => R | Bluebird.Thenable): Bluebird; - static join(arg1: A1 | Bluebird.Thenable, arg2: A2 | Bluebird.Thenable, arg3: A3 | Bluebird.Thenable, arg4: A4 | Bluebird.Thenable, handler: (arg1?: A1, arg2?: A2, arg3?: A3, arg4?: A4) => R | Bluebird.Thenable): Bluebird; - static join(arg1: A1 | Bluebird.Thenable, arg2: A2 | Bluebird.Thenable, arg3: A3 | Bluebird.Thenable, arg4: A4 | Bluebird.Thenable, arg5: A5 | Bluebird.Thenable, handler: (arg1?: A1, arg2?: A2, arg3?: A3, arg4?: A4, arg5?: A5) => R | Bluebird.Thenable): Bluebird; - - // variadic array - /** @deprecated use .all instead */ - static join(...values: (R | Bluebird.Thenable)[]): Bluebird; - - /** - * 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: Bluebird.Thenable[]>, mapper: (item: R, index: number, arrayLength: number) => U | Bluebird.Thenable, options?: Bluebird.ConcurrencyOption): Bluebird; - - // promise of array with values - static map(values: Bluebird.Thenable, mapper: (item: R, index: number, arrayLength: number) => U | Bluebird.Thenable, options?: Bluebird.ConcurrencyOption): Bluebird; - - // array with promises of value - static map(values: Bluebird.Thenable[], mapper: (item: R, index: number, arrayLength: number) => U | Bluebird.Thenable, options?: Bluebird.ConcurrencyOption): Bluebird; - - // array with values - static map(values: R[], mapper: (item: R, index: number, arrayLength: number) => U | Bluebird.Thenable, options?: Bluebird.ConcurrencyOption): Bluebird; - - /** - * 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: Bluebird.Thenable[]>, reducer: (total: U, current: R, index: number, arrayLength: number) => U | Bluebird.Thenable, initialValue?: U): Bluebird; - - // promise of array with values - static reduce(values: Bluebird.Thenable, reducer: (total: U, current: R, index: number, arrayLength: number) => U | Bluebird.Thenable, initialValue?: U): Bluebird; - - // array with promises of value - static reduce(values: Bluebird.Thenable[], reducer: (total: U, current: R, index: number, arrayLength: number) => U | Bluebird.Thenable, initialValue?: U): Bluebird; - - // array with values - static reduce(values: R[], reducer: (total: U, current: R, index: number, arrayLength: number) => U | Bluebird.Thenable, initialValue?: U): Bluebird; - - /** - * 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: Bluebird.Thenable[]>, filterer: (item: R, index: number, arrayLength: number) => boolean | Bluebird.Thenable, option?: Bluebird.ConcurrencyOption): Bluebird; - - // promise of array with values - static filter(values: Bluebird.Thenable, filterer: (item: R, index: number, arrayLength: number) => boolean | Bluebird.Thenable, option?: Bluebird.ConcurrencyOption): Bluebird; - - // array with promises of value - static filter(values: Bluebird.Thenable[], filterer: (item: R, index: number, arrayLength: number) => boolean | Bluebird.Thenable, option?: Bluebird.ConcurrencyOption): Bluebird; - - // array with values - static filter(values: R[], filterer: (item: R, index: number, arrayLength: number) => boolean | Bluebird.Thenable, option?: Bluebird.ConcurrencyOption): Bluebird; - - /** - * 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: Bluebird.Thenable[]>, iterator: (item: R, index: number, arrayLength: number) => U | Bluebird.Thenable): Bluebird; - // array with promises of value - static each(values: Bluebird.Thenable[], iterator: (item: R, index: number, arrayLength: number) => U | Bluebird.Thenable): Bluebird; - // array with values OR promise of array with values - static each(values: R[] | Bluebird.Thenable, iterator: (item: R, index: number, arrayLength: number) => U | Bluebird.Thenable): Bluebird; - - /** - * Given an Iterable(arrays are Iterable), or a promise of an Iterable, which produces promises (or a mix of promises and values), iterate over all the values in the Iterable into an array and iterate over the array serially, in-order. - * - * Returns a promise for an array that contains the values returned by the iterator function in their respective positions. The iterator won't be called for an item until its previous item, and the promise returned by the iterator for that item are fulfilled. This results in a mapSeries kind of utility but it can also be used simply as a side effect iterator similar to Array#forEach. - * - * If any promise in the input array is rejected or any promise returned by the iterator function is rejected, the result will be rejected as well. - */ - static mapSeries(values: (R | Bluebird.Thenable)[] | Bluebird.Thenable<(R | Bluebird.Thenable)[]>, iterator: (item: R, index: number, arrayLength: number) => U | Bluebird.Thenable): Bluebird; - - /** - * A meta method used to specify the disposer method that cleans up a resource when using `Promise.using`. - * - * Returns a Disposer object which encapsulates both the resource as well as the method to clean it up. - * The user can pass this object to `Promise.using` to get access to the resource when it becomes available, - * as well as to ensure its automatically cleaned up. - * - * The second argument passed to a disposer is the result promise of the using block, which you can - * inspect synchronously. - */ - disposer(disposeFn: (arg: R, promise: Bluebird) => void | Bluebird.Thenable): Bluebird.Disposer; - - /** - * In conjunction with `.disposer`, using will make sure that no matter what, the specified disposer - * will be called when the promise returned by the callback passed to using has settled. The disposer is - * necessary because there is no standard interface in node for disposing resources. - */ - static using(disposer: Bluebird.Disposer, executor: (transaction: R) => Bluebird.Thenable): Bluebird; - static using(disposer: Bluebird.Disposer, disposer2: Bluebird.Disposer, executor: (transaction1: R1, transaction2: R2) => Bluebird.Thenable): Bluebird; - static using(disposer: Bluebird.Disposer, disposer2: Bluebird.Disposer, disposer3: Bluebird.Disposer, executor: (transaction1: R1, transaction2: R2, transaction3: R3) => Bluebird.Thenable): Bluebird; - - /** - * 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. - * - * Note: this hook is specific to the bluebird instance its called on, application developers should use global rejection events. - */ - static onPossiblyUnhandledRejection(handler?: (error: Error, promise: Bluebird) => void): void; - - /** - * Configure long stack traces, warnings, monitoring and cancellation. - * Note that even though false is the default here, a development environment might be detected which automatically - * enables long stack traces and warnings. - */ - static config(options: { - /** Enable warnings */ - warnings?: boolean | { - /** Enables all warnings except forgotten return statements. */ - wForgottenReturn: boolean; - }; - /** Enable long stack traces */ - longStackTraces?: boolean; - /** Enable cancellation */ - cancellation?: boolean; - /** Enable monitoring */ - monitoring?: boolean; - }): void; - - /** - * The version number of the library - */ - static version: string; -} - -declare namespace Bluebird { - export interface ConcurrencyOption { - concurrency: number; - } - export interface SpreadOption { - spread: boolean; - } - export interface FromNodeOptions { - multiArgs?: boolean; - } - export interface PromisifyOptions { - context?: any; - multiArgs?: boolean; - } - export interface PromisifyAllOptions extends PromisifyOptions { - 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; - } - - /** - * Represents an error is an explicit promise rejection as opposed to a thrown error. - * For example, if an error is errbacked by a callback API promisified through undefined or undefined - * and is not a typed error, it will be converted to a `OperationalError` which has the original error in - * the `.cause` property. - * - * `OperationalError`s are caught in `.error` handlers. - */ - export class OperationalError extends Error { } - - /** - * Signals that an operation has timed out. Used as a custom cancellation reason in `.timeout`. - */ - export class TimeoutError extends Error { } - - /** - * Signals that an operation has been aborted or cancelled. The default reason used by `.cancel`. - */ - export class CancellationError extends Error {} - - /** - * A collection of errors. `AggregateError` is an array-like object, with numeric indices and a `.length` property. - * It supports all generic array methods such as `.forEach` directly. - * - * `AggregateError`s are caught in `.error` handlers, even if the contained errors are not operational. - * - * `Promise.some` and `Promise.any` use `AggregateError` as rejection reason when they fail. - */ - export class AggregateError extends Error {} - - /** - * returned by `Bluebird.disposer()`. - */ - export class Disposer { - } - - export 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): Thenable; - } - - export interface Resolver { - /** - * Returns a reference to the controlled promise that can be passed to clients. - */ - promise: Bluebird; - - /** - * 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; - - /** - * Reject the underlying promise with `reason` as the rejection reason. - */ - reject(reason: 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; - } - - 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 cancelled at the creation time of this inspection object. - */ - isCancelled(): 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(): R; - - /** - * 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; - } - - /** - * Returns a new independent copy of the Bluebird library. - * - * This method should be used before you use any of the methods which would otherwise alter the global Bluebird object - to avoid polluting global state. - */ - export function getNewLibraryCopy(): typeof Bluebird; - - /** - * 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. - */ - export function noConflict(): typeof Bluebird; - - /** - * 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; -} - -export = Bluebird; diff --git a/bluebird/v1/index.d.ts b/bluebird/v1/index.d.ts deleted file mode 100644 index ab1cd02add..0000000000 --- a/bluebird/v1/index.d.ts +++ /dev/null @@ -1,667 +0,0 @@ -// Type definitions for bluebird 1.0.0 -// Project: https://github.com/petkaantonov/bluebird -// Definitions by: Bart van der Schoor -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -// ES6 model with generics overload was sourced and trans-multiplied from es6-promises.d.ts -// By: Campredon - -// Warning: recommended to use `tsc > v0.9.7` (critical bugs in earlier generic code): -// - https://github.com/DefinitelyTyped/DefinitelyTyped/issues/1563 - -// Note: replicate changes to all overloads in both definition and test file -// Note: keep both static and instance members inline (so similar) - -// TODO fix remaining TODO annotations in both definition and test - -// TODO verify support to have no return statement in handlers to get a Promise (more overloads?) - -declare class Promise implements Promise.Thenable { - /** - * 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) => Promise.Thenable, onReject: (error: any) => Promise.Thenable, onProgress?: (note: any) => any): Promise; - then(onFulfill: (value: R) => Promise.Thenable, onReject?: (error: any) => U, onProgress?: (note: any) => any): Promise; - then(onFulfill: (value: R) => U, onReject: (error: any) => Promise.Thenable, onProgress?: (note: any) => any): Promise; - then(onFulfill?: (value: R) => U, 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: (value: R) => Promise.Thenable): Promise; - finally(handler: (value: R) => R): Promise; - finally(handler: (value: R) => void): Promise; - - lastly(handler: (value: R) => Promise.Thenable): Promise; - lastly(handler: (value: R) => R): Promise; - lastly(handler: (value: R) => void): 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): Promise; - done(onFulfilled: (value: R) => Promise.Thenable, onRejected?: (error: any) => U, onProgress?: (note: any) => any): Promise; - done(onFulfilled: (value: R) => U, onRejected: (error: any) => Promise.Thenable, onProgress?: (note: any) => any): Promise; - done(onFulfilled?: (value: R) => U, onRejected?: (error: any) => U, onProgress?: (note: any) => any): 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): 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(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: 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; - - /** - * 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): Promise; - map(mapper: (item: Q, index: number, arrayLength: number) => U): 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): Promise; - filter(filterer: (item: U, index: number, arrayLength: number) => boolean): 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: () => R | Promise.Thenable, args?: any[], ctx?: any): Promise; - - static attempt(fn: () => R | Promise.Thenable, 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`. - */ - // TODO how to model promisify? - 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): 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. - */ - // 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; - // array with values - static all(values: R[]): 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; - - /** - * 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[]>; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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): Promise; - static map(values: Promise.Thenable[]>, mapper: (item: R, index: number, arrayLength: number) => U): Promise; - - // promise of array with values - static map(values: Promise.Thenable, mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; - static map(values: Promise.Thenable, mapper: (item: R, index: number, arrayLength: number) => U): Promise; - - // array with promises of value - static map(values: Promise.Thenable[], mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; - static map(values: Promise.Thenable[], mapper: (item: R, index: number, arrayLength: number) => U): Promise; - - // array with values - static map(values: R[], mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; - static map(values: R[], mapper: (item: R, index: number, arrayLength: number) => U): 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; - - // 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; - - // 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 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; - - /** - * 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): Promise; - static filter(values: Promise.Thenable[]>, filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; - - // promise of array with values - static filter(values: Promise.Thenable, filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; - static filter(values: Promise.Thenable, filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; - - // array with promises of value - static filter(values: Promise.Thenable[], filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; - static filter(values: Promise.Thenable[], filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; - - // array with values - static filter(values: R[], filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; - static filter(values: R[], filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; -} - -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 Thenable { - then(onFulfilled: (value: R) => Thenable, onRejected: (error: any) => Thenable): Thenable; - then(onFulfilled: (value: R) => Thenable, onRejected?: (error: any) => U): Thenable; - then(onFulfilled: (value: R) => U, onRejected: (error: any) => Thenable): Thenable; - then(onFulfilled?: (value: R) => U, onRejected?: (error: any) => U): Thenable; - } - - 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: R): 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: R, ...values: R[]) => 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(): R; - - /** - * 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` - */ - error(): any; - } -} - -declare module 'bluebird' { - export = Promise; -} diff --git a/blueimp-md5/blueimp-md5-tests.ts b/blueimp-md5/blueimp-md5-tests.ts deleted file mode 100644 index 18edc69b57..0000000000 --- a/blueimp-md5/blueimp-md5-tests.ts +++ /dev/null @@ -1,6 +0,0 @@ - -import blueimp = require('blueimp-md5'); - -function hash(): boolean { - return blueimp.md5('hello world') === '5eb63bbbe01eeed093cb22bb8f5acdc3'; -} diff --git a/blueimp-md5/index.d.ts b/blueimp-md5/index.d.ts deleted file mode 100644 index b51f554e32..0000000000 --- a/blueimp-md5/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -// Type definitions for blueimp-md5 v1.1.0 -// Project: https://github.com/blueimp/JavaScript-MD5 -// Definitions by: Ray Martone -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export declare function md5(value: string, key?: string, raw?: boolean): string; diff --git a/body-parser/index.d.ts b/body-parser/index.d.ts deleted file mode 100644 index c0ce775bb0..0000000000 --- a/body-parser/index.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -// Type definitions for body-parser 1.16 -// Project: https://github.com/expressjs/body-parser -// Definitions by: Santi Albo , Vilic Vane , Jonathan Häberle , Gevik Babakhani , Tomasz Łaziuk -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -import { Request, RequestHandler, Response } from 'express'; - -// for docs go to https://github.com/expressjs/body-parser/tree/1.16.0#body-parser - -// @deprecated -declare function bodyParser(options?: bodyParser.OptionsJson & bodyParser.OptionsText & bodyParser.OptionsUrlencoded): RequestHandler; - -declare namespace bodyParser { - - export interface Options { - inflate?: boolean; - limit?: number | string; - type?: string | ((req: Request) => any); - verify?: (req: Request, res: Response, buf: Buffer, encoding: string) => void; - } - - export interface OptionsJson extends Options { - reviever?: (key: string, value: any) => any; - strict?: boolean; - } - - export interface OptionsText extends Options { - defaultCharset?: string; - } - - export interface OptionsUrlencoded extends Options { - extended?: boolean; - parameterLimit?: number; - } - - export function json(options?: OptionsJson): RequestHandler; - - export function raw(options?: Options): RequestHandler; - - export function text(options?: OptionsText): RequestHandler; - - export function urlencoded(options?: OptionsUrlencoded): RequestHandler; - -} - -export = bodyParser; diff --git a/body-parser/tslint.json b/body-parser/tslint.json deleted file mode 100644 index 9311f348d9..0000000000 --- a/body-parser/tslint.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "../tslint.json", - "rules": { - "max-line-length": false - } -} diff --git a/bookshelf/index.d.ts b/bookshelf/index.d.ts deleted file mode 100644 index 4aa6fd38b5..0000000000 --- a/bookshelf/index.d.ts +++ /dev/null @@ -1,356 +0,0 @@ -// Type definitions for bookshelfjs v0.8.2 -// Project: http://bookshelfjs.org/ -// Definitions by: Andrew Schurman -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 - -import Knex = require('knex'); -import knex = require('knex'); -import BlueBird = require('bluebird'); -import Lodash = require('lodash'); -import createError = require('create-error'); - -interface Bookshelf extends Bookshelf.Events { - VERSION: string; - knex: knex; - Model: typeof Bookshelf.Model; - Collection: typeof Bookshelf.Collection; - - plugin(name: string | string[] | Function, options?: any): Bookshelf; - transaction(callback: (transaction: knex.Transaction) => T): BlueBird; -} - -declare function Bookshelf(knex: knex): Bookshelf; - -declare 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[]): BlueBird; - 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; - - // See https://github.com/tgriesser/bookshelf/blob/0.9.4/src/base/model.js#L178 - // See https://github.com/tgriesser/bookshelf/blob/0.9.4/src/base/model.js#L213 - id: any; - - // See https://github.com/tgriesser/bookshelf/blob/0.9.4/src/base/model.js#L28 - attributes: any; - - constructor(attributes?: any, options?: ModelOptions); - - clear(): T; - 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: Object): Object; - 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): BlueBird; - /** @deprecated use Typescript classes */ - static extend>(prototypeProperties?: any, classProperties?: any): Function; // should return a type - static fetchAll>(): BlueBird>; - /** @deprecated should use `new` objects instead. */ - static forge(attributes?: any, options?: ModelOptions): T; - static where(properties: { [key: string]: any }): T; - static where(key: string, operatorOrValue: string | number | boolean, valueIfOperator?: string | number | boolean): T; - - belongsTo>(target: { new (...args: any[]): R }, foreignKey?: string, foreignKeyTarget?: string): R; - belongsToMany>(target: { new (...args: any[]): R }, table?: string, foreignKey?: string, otherKey?: string): Collection; - count(column?: string, options?: SyncOptions): BlueBird; - destroy(options?: DestroyOptions): BlueBird; - fetch(options?: FetchOptions): BlueBird; - fetchAll(options?: FetchAllOptions): BlueBird>; - hasMany>(target: { new (...args: any[]): R }, foreignKey?: string, foreignKeyTarget?: string): Collection; - hasOne>(target: { new (...args: any[]): R }, foreignKey?: string, foreignKeyTarget?: string): R; - load(relations: string | string[], options?: LoadOptions): BlueBird; - 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; - - // Declaration order matters otherwise TypeScript gets confused between query() and query(...query: string[]) - query(): Knex.QueryBuilder; - query(callback: (qb: Knex.QueryBuilder) => void): T; - query(...query: string[]): T; - query(query: { [key: string]: any }): T; - - refresh(options?: FetchOptions): BlueBird; - resetQuery(): T; - save(key?: string, val?: any, options?: SaveOptions): BlueBird; - save(attrs?: { [key: string]: any }, options?: SaveOptions): BlueBird; - through>(interim: typeof Model, throughForeignKey?: string, otherKey?: string): R; - where(properties: { [key: string]: any }): T; - where(key: string, operatorOrValue: string | number | boolean, valueIfOperator?: string | number | boolean): T; - - // See https://github.com/tgriesser/bookshelf/blob/0.9.4/src/errors.js - // See https://github.com/tgriesser/bookshelf/blob/0.9.4/src/model.js#L1280 - static NotFoundError: createError.Error; - static NoRowsUpdatedError: createError.Error; - static NoRowsDeletedError: createError.Error; - } - - abstract class CollectionBase> extends Events { - // See https://github.com/tgriesser/bookshelf/blob/0.9.4/src/base/collection.js#L573 - length: number; - - // See https://github.com/tgriesser/bookshelf/blob/0.9.4/src/base/collection.js#L21 - constructor(models?: T[], options?: CollectionOptions); - - add(models: T[] | { [key: string]: any }[], options?: CollectionAddOptions): Collection; - at(index: number): T; - clone(): Collection; - fetch(options?: CollectionFetchOptions): BlueBird>; - findWhere(match: { [key: string]: any }): T; - get(id: any): T; - invokeThen(name: string, ...args: any[]): BlueBird; - 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): BlueBird; - 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; - - // See https://github.com/DefinitelyTyped/DefinitelyTyped/blob/1ec3d51/lodash/lodash-3.10.d.ts#L7119 - // See https://github.com/Microsoft/TypeScript/blob/v1.8.10/lib/lib.core.es7.d.ts#L1122 - map(predicate?: Lodash.ListIterator | string, thisArg?: any): U[]; - map(predicate?: Lodash.DictionaryIterator | string, thisArg?: any): U[]; - map(predicate?: string): U[]; - - max(predicate?: Lodash.ListIterator | string, thisArg?: any): T; - max(predicate?: R): T; - min(predicate?: Lodash.ListIterator | string, thisArg?: any): T; - 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 | any[], options?: SyncOptions): BlueBird>; - count(column?: string, options?: SyncOptions): BlueBird; - create(model: { [key: string]: any }, options?: CollectionCreateOptions): BlueBird; - detach(ids: any[], options?: SyncOptions): BlueBird; - detach(options?: SyncOptions): BlueBird; - fetchOne(options?: CollectionFetchOneOptions): BlueBird; - load(relations: string | string[], options?: SyncOptions): BlueBird>; - - // Declaration order matters otherwise TypeScript gets confused between query() and query(...query: string[]) - query(): Knex.QueryBuilder; - query(callback: (qb: Knex.QueryBuilder) => void): Collection; - query(...query: string[]): Collection; - query(query: { [key: string]: any }): Collection; - - resetQuery(): Collection; - through>(interim: typeof Model, throughForeignKey?: string, otherKey?: string): Collection; - updatePivot(attributes: any, options?: PivotOptions): BlueBird; - withPivot(columns: string[]): Collection; - - // See https://github.com/tgriesser/bookshelf/blob/0.9.4/src/collection.js#L389 - static EmptyError: createError.Error; - } - - interface ModelOptions { - tableName?: string; - hasTimestamps?: boolean; - parse?: boolean; - } - - interface LoadOptions extends SyncOptions { - withRelated: (string | WithRelatedQuery)[]; - } - - interface FetchOptions extends SyncOptions { - require?: boolean; - columns?: string | string[]; - withRelated?: (string | WithRelatedQuery)[]; - } - - interface WithRelatedQuery { - [index: string]: (query: Knex.QueryBuilder) => Knex.QueryBuilder; - } - - interface FetchAllOptions extends SyncOptions { - require?: boolean; - } - - interface SaveOptions extends SyncOptions { - method?: string; - defaults?: string; - patch?: boolean; - require?: boolean; - } - - interface DestroyOptions extends SyncOptions { - 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): BlueBird | void; - } - - interface CollectionCreateOptions extends ModelOptions, SyncOptions, CollectionAddOptions, SaveOptions { } -} - -export = Bookshelf; - diff --git a/boom/index.d.ts b/boom/index.d.ts deleted file mode 100644 index e8cfb5722f..0000000000 --- a/boom/index.d.ts +++ /dev/null @@ -1,61 +0,0 @@ -// Type definitions for boom -// Project: http://github.com/hapijs/boom -// Definitions by: Igor Rogatty -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -export = Boom; - -declare namespace Boom { - - export interface BoomError { - data: any; - reformat: () => void; - isBoom: boolean; - isServer: boolean; - message: string; - output: Output; - name: string; - } - - export interface Output { - statusCode: number; - headers: any; - payload: any; - } - - export function wrap(error: Error, statusCode?: number, message?: string): BoomError; - export function create(statusCode: number, message?: string, data?: any): BoomError; - - // 4xx - export function badRequest(message?: string, data?: any): BoomError; - export function unauthorized(message?: string, scheme?: any, attributes?: any): BoomError; - export function forbidden(message?: string, data?: any): BoomError; - export function notFound(message?: string, data?: any): BoomError; - export function methodNotAllowed(message?: string, data?: any): BoomError; - export function notAcceptable(message?: string, data?: any): BoomError; - export function proxyAuthRequired(message?: string, data?: any): BoomError; - export function clientTimeout(message?: string, data?: any): BoomError; - export function conflict(message?: string, data?: any): BoomError; - export function resourceGone(message?: string, data?: any): BoomError; - export function lengthRequired(message?: string, data?: any): BoomError; - export function preconditionFailed(message?: string, data?: any): BoomError; - export function entityTooLarge(message?: string, data?: any): BoomError; - export function uriTooLong(message?: string, data?: any): BoomError; - export function unsupportedMediaType(message?: string, data?: any): BoomError; - export function rangeNotSatisfiable(message?: string, data?: any): BoomError; - export function expectationFailed(message?: string, data?: any): BoomError; - export function badData(message?: string, data?: any): BoomError; - export function locked(message?: string, data?: any): BoomError; - export function preconditionRequired(message?: string, data?: any): BoomError; - export function tooManyRequests(message?: string, data?: any): BoomError; - export function illegal(message?: string, data?: any): BoomError; - - // 5xx - export function badImplementation(message?: string, data?: any): BoomError; - export function notImplemented(message?: string, data?: any): BoomError; - export function badGateway(message?: string, data?: any): BoomError; - export function serverUnavailable(message?: string, data?: any): BoomError; - export function gatewayTimeout(message?: string, data?: any): BoomError; -} diff --git a/bootbox/index.d.ts b/bootbox/index.d.ts deleted file mode 100644 index 40494d5ca5..0000000000 --- a/bootbox/index.d.ts +++ /dev/null @@ -1,106 +0,0 @@ -// Type definitions for Bootbox 4.4.0 -// Project: https://github.com/makeusabrew/bootbox -// Definitions by: Vincent Bortone , Kon Pik , Anup Kattel , Dominik Schroeter , Troy McKinnon -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -/** Bootbox options shared by all modal types */ -interface BootboxBaseOptions { - title?: string | Element; - callback?: (result: boolean | string) => any; - onEscape?: (() => any) | boolean; - show?: boolean; - backdrop?: boolean; - closeButton?: boolean; - animate?: boolean; - className?: string; - size?: string; - buttons?: BootboxButtonMap; // complex object where each key is of type BootboxButton -} - -/** Bootbox options available for custom modals */ -interface BootboxDialogOptions extends BootboxBaseOptions { - message: string | Element; -} - -/** Bootbox options available for alert modals */ -interface BootboxAlertOptions extends BootboxDialogOptions { - callback?: () => any; - buttons?: BootboxAlertButtonMap; -} - -/** Bootbox options available for confirm modals */ -interface BootboxConfirmOptions extends BootboxDialogOptions { - callback: (result: boolean) => any; - buttons?: BootboxConfirmPromptButtonMap; -} - -/** Bootbox options available for prompt modals */ -interface BootboxPromptOptions extends BootboxBaseOptions { - title: string; - value?: string; - inputType?: string; - callback: (result: string) => any; - buttons?: BootboxConfirmPromptButtonMap; -} - -/** Bootbox options available when setting defaults for modals */ -interface BootboxDefaultOptions { - locale?: string; - show?: boolean; - backdrop?: boolean; - closeButton?: boolean; - animate?: boolean; - className?: string; -} - -interface BootboxButton { - label?: string; - className?: string; - callback?: () => any; -} - -interface BootboxButtonMap { - [key: string]: BootboxButton | Function; -} - -/** ButtonMap options for alerts modals */ -interface BootboxAlertButtonMap extends BootboxButtonMap { - ok: BootboxButton | Function; -} - -/** ButtonMap options for confirm and prompt modals */ -interface BootboxConfirmPromptButtonMap extends BootboxButtonMap { - confirm: BootboxButton | Function; - cancel: BootboxButton | Function; -} - -interface BootboxLocaleValues { - OK: string; - CANCEL: string; - CONFIRM: string; -} - -interface BootboxStatic { - alert(message: string, callback?: () => void): JQuery; - alert(options: BootboxAlertOptions): JQuery; - confirm(message: string, callback: (result: boolean) => void): JQuery; - confirm(options: BootboxConfirmOptions): JQuery; - prompt(message: string, callback: (result: string) => void): JQuery; - prompt(options: BootboxPromptOptions): JQuery; - dialog(message: string, callback?: (result: string) => void): JQuery; - dialog(options: BootboxDialogOptions): JQuery; - setDefaults(options: BootboxDefaultOptions): void; - hideAll(): void; - - addLocale(name: string, values: BootboxLocaleValues): void; - removeLocale(name: string): void; - setLocale(name: string): void; -} - -declare var bootbox: BootboxStatic; - -declare module "bootbox" { - export = bootbox; -} diff --git a/bootstrap-validator/tslint.json b/bootstrap-validator/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/bootstrap-validator/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/bootstrap.v3.datetimepicker/index.d.ts b/bootstrap.v3.datetimepicker/index.d.ts deleted file mode 100644 index d8ec008dca..0000000000 --- a/bootstrap.v3.datetimepicker/index.d.ts +++ /dev/null @@ -1,595 +0,0 @@ -// Type definitions for Bootstrap 3 Datepicker 4.17 -// Project: http://eonasdan.github.io/bootstrap-datetimepicker -// Definitions by: Katona Péter -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// based on the previous version created by Jesica N. Fera - -/** - * bootstrap-datetimepicker.js 4.17.45 Copyright (c) 2015 Jonathan Peterson - * Available via the MIT license. - * see: http://eonasdan.github.io/bootstrap-datetimepicker or https://github.com/Eonasdan/bootstrap-datetimepicker for details. - */ - -/// - -import * as moment from "moment"; - -export as namespace BootstrapV3DatetimePicker; - -type InputParser = (input: string | Date | moment.Moment) => moment.Moment; - -export interface Datetimepicker { - /**Clears the datepicker by setting the value to null */ - clear(): void; - /**Returns the component's model current date, a moment object or null if not set. */ - date(): moment.Moment; - /**Takes string, Date, moment, null parameter and sets the components model current moment to it. - * Passing a null value unsets the components model current moment. - * Parsing of the newDate parameter is made using moment library with the options.format and options.useStrict components configuration. - * Throws: - * - TypeError - in case the newDate cannot be parsed - * - * Emits: - * - dp.change - In case newDate is different from current moment - */ - date(date: moment.Moment | Date | string | null): void; - /**Destroys the widget and removes all attached event listeners */ - destroy(): void; - /**Disables the input element, the component is attached to, by adding a disabled="true" attribute to it. If the widget was visible before that call it is hidden. - * Emits: - * - dp.hide - if the widget was visible before that call - */ - disable(): void; - /**Enables the input element, the component is attached to, by removing disabled attribute from it. */ - enable(): void; - /**Hides the widget - * Emits: - * - dp.hide - if the widget was visible before that call - */ - hide(): void; - /**Returns the components current options object. - * Note that the changing the values of the returned object does not change the components actual configuration. */ - options(): DatetimepickerOptions - /**Takes an object variable with option key:value properties and configures the component. Use this to update multiple options on the component. */ - options(options: DatetimepickerOptions): void - /**Shows the widget - * Emits: - * - dp.show - if the widget was hidden before that call - * - dp.change - if the widget is opened for the first time and the useCurrent is set to true or to a granularity value and the input element the component is attached to has an empty value - */ - show(): void; - /**Shows or hides the widget - * Emits: - * - dp.hide - if the widget is hidden after the toggle call - * - dp.show - if the widget is show after the toggle call - * - dp.change - if the widget is opened for the first time and the input element is empty and options.useCurrent != false - */ - toggle(): void; - - //////////////////////////////////////////////////////////////////////////////////////////////////// - //// Below are the getters/setters for the properties of the 'options(): DatetimepickerOptions' //// - //////////////////////////////////////////////////////////////////////////////////////////////////// - - /**Returns the options.allowInputToggle option. */ - allowInputToggle(): boolean; - /**If true, the picker will show on textbox focus and icon click when used in a button group */ - allowInputToggle(value: boolean): void; - /**Returns the current options.calendarWeeks option configuration */ - calendarWeeks(): boolean; - /**Set if the week numbers will appear to the left on the days view */ - calendarWeeks(value: boolean): void; - /**Returns the options.collapse option configuration */ - collapse(): boolean; - /**If set to false the picker will display similar to sideBySide except vertical. */ - collapse(value: boolean): void; - /**Returns the options.daysOfWeekDisabled configuration - * IMPORTANT! Throws exception if not set explicitly https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1459 - */ - daysOfWeekDisabled(): Array; - /**Takes an [ Number:0 to 6 ] and disallow the user to select weekdays that exist in this array. - * This has lower priority over the options.minDate, options.maxDate, options.disabledDates and options.enabledDates configuration settings. - * Emits: - * - dp.change - if the currently selected moment falls in the values passed on the daysOfWeek parameter. - * - dp.error - if the currently selected moment falls in the values passed on the daysOfWeek parameter. - */ - daysOfWeekDisabled(days: Array): void; - /**Returns the options.dayViewHeaderFormat option. */ - dayViewHeaderFormat(): string; - /**Used to customize the header of the day view. */ - dayViewHeaderFormat(value: string): void; - /**Returns a moment with the options.defaultDate option configuration or false if not set */ - defaultDate(): moment.Moment | boolean; - /**Will set the picker's inital date. - * If a boolean:false value is passed the options.defaultDate parameter is cleared. - * Throws: - * - TypeError - if the provided date doesn't pass validation, including disabledDates, enabledDates, minDate, maxDate, and daysOfWeekDisabled - * - TypeError - if the provided date cannot be parsed by momentjs - */ - defaultDate(date: string | Date | moment.Moment | boolean): void; - /**Returns the options.disabledDates option. - * NOTES: probably should be: disabledDates(): boolean | Array; see: DatetimepickerOptions - */ - disabledDates(): boolean | any; - /**Takes an array of values and disallows the user to select those days. - * Setting this takes precedence over options.minDate, options.maxDate configuration. - * Also calling this function removes the configuration of options.enabledDates if such exist. - * Note: These values are matched with Day granularity. - */ - disabledDates(dates: boolean | Array): void; - /**Returns the options.disabledHours option. - * NOTES: probably should be: disabledHours(): boolean | Array; see: DatetimepickerOptions - */ - disabledHours(): boolean | any; - /**Must be in 24 hour format. Will disallow hour selections (much like disabledTimeIntervals) but will affect all days. - * Like en/disabledDates, the en/disabledHours options are mutually exclusive and will reset one of the options back to false. */ - disabledHours(value: boolean | Array): void; - /**Returns the options.disabledTimeIntervals option, or... not exactly - * IMPORTANT! Creates an object from the options.disabledTimeIntervals with the keys being numbers, the values being the moment arrays. - * eg { "0": [, ], "1": [...] } - * https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1498 - */ - disabledTimeIntervals(): boolean | Array>; - /**Disables time selection between the given moments - * eg: [[moment({ h: 0 }), moment({ h: 8 })], [moment({ h: 18 }), moment({ h: 24 })]] - */ - disabledTimeIntervals(value: boolean | Array>): void; - /**Returns the options.enabledDates option - * NOTES: probably should be: enabledDates(): boolean | Array; see: DatetimepickerOptions - */ - enabledDates(): boolean | any; - /**Takes an array of values and allows the user to select only from those days. - * Setting this takes precedence over options.minDate, options.maxDate configuration. - * Also calling this function removes the configuration of options.disabledDates if such exist. - * Note: These values are matched with Day granularity. - */ - enabledDates(dates: boolean | Array): void; - /**Returns the options.enabledHours option. - * NOTES: probably should be: enabledHours(): boolean | Array; see: DatetimepickerOptions - */ - enabledHours(): boolean | any; - /**Must be in 24 hour format. Will allow hour selections (much like enabledTimeIntervals) but will affect all days. - * Like en/disabledDates, the en/disabledHours options are mutually exclusive and will reset one of the options back to false. */ - enabledHours(value: boolean | Array): void; - /**Returns a boolean or array with the options.extraFormats option configuration */ - extraFormats(): boolean | Array; - /**Takes an array of valid input moment format options, or boolean:false */ - extraFormats(formats: boolean | Array): void; - /**Returns the options.focusOnShow option. */ - focusOnShow(): boolean; - /**If false, the textbox will not be given focus when the picker is shown */ - focusOnShow(value: boolean): void; - /**Returns the component's options.format string */ - format(): boolean | string | moment.MomentBuiltinFormat; - /**Takes a moment.js format string and sets the components options.format. - * This is used for displaying and also for parsing input strings either from the input element the component is attached to or the date() function. - * The parameter can also be a boolean:false in which case the format is set to the locale's L LT. - * Note: this is also used to determine if the TimePicker sub component will display the hours in 12 or 24 format. (if "a" or "h" exists in the passed string then a 12 hour mode is set) - * Throws: - * - TypeError - if format is boolean:true - */ - format(format: boolean | string | moment.MomentBuiltinFormat): void; - /**Returns options.icons */ - icons(): Icons; - /**Takes an Object of strings. - * Throws: - * - TypeError - if icons parameter is not an Object - */ - icons(icons: Icons): void; - /**Returns the options.ignoreReadonly option. */ - ignoreReadonly(): boolean; - /**Set this to true to allow the picker to be used even if the input field is readonly. This will not bypass the disabled property */ - ignoreReadonly(value: boolean): void; - /**Returns the options.inline option. */ - inline(): boolean; - /**Used to customize the header of the day view. */ - inline(value: boolean): void; - /**Returns the options.keepInvalid option. */ - keepInvalid(): boolean; - /**If true, invalid dates will not be reverted to a previous selection or changed. */ - keepInvalid(value: boolean): void; - /**Returns a string variable with the currently set options.keyBinds option. */ - keyBinds(): any; - /**Allows for several keyBinding functions to be specified for ease of access or accessibility. For defaults see {@link http://eonasdan.github.io/bootstrap-datetimepicker/Options/#keybinds}. - */ - keyBinds(value: any): void; - /**Returns the currently set locale of the options.locale */ - locale(): string; - /**Takes a string of any valid moment locale e.g. de for German. - * Throws: - * - TypeError - if the locale is not loaded via a separate script or moment-with-locale - */ - locale(newLocale: string): void; - /**Returns the currently set moment of the options.maxDate or false if not set */ - maxDate(): moment.Moment | boolean; - /**Takes a parameter and disallows the user to select a moment that is after that moment. - * If a boolean:false value is passed options.maxDate is cleared and there is no restriction to the maximum moment the user can select. - * Note: If the parameter is before the currently selected moment the currently selected moment changes to maxDate - * Throws: - * - TypeError - if the parameter cannot be parsed using the options.format and options.useStrict configuration settings - * - TypeError - if the parameter is before options.minDate - * - * Emits: - * - dp.change - if the new maxDate is after currently selected moment - * - dp.error - if the new maxDate is after currently selected moment - */ - maxDate(date: moment.Moment | Date | string | boolean): void; - /**Returns the currently set moment of the options.minDate or false if not set */ - minDate(): moment.Moment | boolean; - /**Takes a parameter and disallows the user to select a moment that is before that moment. - * If a boolean:false value is passed the options.minDate parameter is cleared and there is no restriction to the miminum moment the user can select. - * Note: If the parameter is after the currently selected moment the currently selected moment changes to minDate parameter - * Throws: - * - TypeError - if the parameter cannot be parsed using the options.format and options.useStrict configuration settings - * - TypeError - if the parameter is after options.maxDate - * - * Emits: - * - dp.change - if the new minDate is after currently selected moment - * - dp.error - if the new minDate is after currently selected moment - */ - minDate(date: moment.Moment | Date | string | boolean): void; - /**Returns the options.parseInputDate option */ - parseInputDate(): InputParser | undefined; - /**Allows custom input formatting For example: the user can enter "yesterday"" or "30 days ago". - * {@link http://eonasdan.github.io/bootstrap-datetimepicker/Functions/#parseinputdate} - */ - parseInputDate(value: InputParser): void; - /**Returns the options.showClear option. */ - showClear(): boolean; - /**Set if the clear date button will appear on the widget */ - showClear(value: boolean): void; - /**Returns the options.showClose option. */ - showClose(): boolean; - /**If true, an icon will be displayed on the toolbar that will hide the picker */ - showClose(value: boolean): void; - /**Returns the options.showTodayButton option. */ - showTodayButton(): boolean; - /**Set if the Today button will appear on the widget */ - showTodayButton(value: boolean): void; - /**Returns a boolean of the options.sideBySide. */ - sideBySide(): boolean; - /**If sideBySide is true and the time picker is used, both components will display side by side instead of collapsing. */ - sideBySide(value: boolean): void; - /**Returns a number with the options.stepping option configuration */ - stepping(): number; - /**This will be the amount the up/down arrows move the minute value with a time picker. */ - stepping(step: number): void; - /** Returns a string of options.timeZone */ - timeZone(): string | null; - /** Takes a null or a string of a valid timezone. - * Throws: - * - TypeError - if tooltips parameter is not a string or null - */ - timeZone(timeZone: string | null): void; - /**Returns the options.toolbarplacement option. */ - toolbarPlacement(): string; - /**Changes the placement of the toolbar where the today, clear, component switch icon are located. - * See valid values at DatetimepickerOptions.toolbarplacement - * Throws: - * - TypeError - if the parameter is not a valid value - */ - toolbarPlacement(value: string): void; - /**Returns the options.tooltips option */ - tooltips(): Tooltips; - /**Sets the tooltips for icons. - * Throws: - * - TypeError - if tooltips parameter is not an Object - */ - tooltips(value: Tooltips): void; - /**Returns the options.useCurrent option configuration */ - useCurrent(): boolean | string; - /**Takes a boolean or string. - * If a boolean true is passed and the components model moment is not set (either through setDate or through a valid value on the input element the component is attached to) - * then the first time the user opens the datetimepicker widget the value is initialized to the current moment of the action. - * If a false boolean is passed then no initialization happens on the input element. - * You can select the granularity on the initialized moment by passing one of the following strings ("year", "month", "day", "hour", "minute") in the variable. - * If for example you pass "day" to the useCurrent function and the input field is empty the first time the user opens the datetimepicker widget the input text will be - * initialized to the current datetime with day granularity (ie if currentTime = 2014-08-10 13:32:33 the input value will be initialized to 2014-08-10 00:00:00) - * Note: If the options.defaultDate is set or the input element the component is attached to has already a value that takes precedence and the functionality of useCurrent is not triggered! - */ - useCurrent(value: boolean | string): void; - /**Returns the options.useStrict */ - useStrict(): boolean; - /**If useStrict is true, momentjs parsing rules will be stricter when determining if a date is valid or not. */ - useStrict(value: boolean): void; - /**Returns the options.viewDate option. */ - viewDate(): boolean | moment.Moment; - /**This will change the viewDate without changing or setting the selected date. */ - viewDate(value: string | Date | moment.Moment | boolean): void; - /**Returns the options.viewMode. */ - viewMode(): string; - /**Takes a string. See valid values at DatetimepickerOptions.viewMode - * Throws: - * - TypeError - if the parameter is not a string or not a valid value - */ - viewMode(value: string): void; - /**Returns a $(element) variable with the currently set options.widgetParent option. */ - widgetParent(): string | JQuery | null - /**Takes a string or $(element) value. */ - widgetParent(widgetParent: string | JQuery | null): void; - /**Returns the options.widgetPositioning object */ - widgetPositioning(): WidgetPositioningOptions; - /**WidgetPositioning defines where the dropdown with the widget will appear relative to the input element the component is attached to. - * "auto" is the default value for both horizontal and vertical keys and it tries to automatically place the dropdown in a position that is visible to the user. - * Usually you should not override those options unless you have a special need in your layout. - */ - widgetPositioning(value: WidgetPositioningOptions): void; -} - -export interface DatetimepickerOptions { - /**If true, the picker will show on textbox focus and icon click when used in a button group - * @default: false - */ - allowInputToggle?: boolean; - /**Shows the week of the year to the left of first day of the week. - * @default: false - */ - calendarWeeks?: boolean; - /**Using a Bootstraps collapse to switch between date/time pickers. - * @default: true - */ - collapse?: boolean; - /**Disables the section of days of the week, e.g. weekends. - * Accepts: array of numbers from 0-6 - * @default: false - */ - daysOfWeekDisabled?: Array | boolean; - /**Changes the heading of the datepicker when in "days" view. - * @default: "MMMM YYYY" - */ - dayViewHeaderFormat?: string; - /**Will cause the date picker to stay open after a blur event. - * @default: false - */ - debug?: boolean; - /**Sets the picker default date/time. Overrides useCurrent - * @default: false - */ - defaultDate?: boolean | moment.Moment | Date | string; - /**Disables selection of dates in the array, e.g. holidays - * @default: false - * IMPORTANT! The getter returns an Object NOT an Array, with keys being the dates, values being true. - * eg disabledDates = ["2010-10-10"]; -> disabledDated will be { "2010-01-01": true } - * https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1499 - */ - disabledDates?: boolean | Array | any; - /**Will allow or disallow hour selections (much like disabledTimeIntervals) but will affect all days - * @default: false - * IMPORTANT! The getter returns an Object NOT an Array, with keys being the hours, values being true. - * eg disabledHours = [0, 1]; -> disabledHours will be { "0": true, "1": true } - * https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1499 - */ - disabledHours?: boolean | Array | any; - /**Disables time selection between the given moments - * eg: [[moment({ h: 0 }), moment({ h: 8 })], [moment({ h: 18 }), moment({ h: 24 })]] - * @default: false - */ - disabledTimeIntervals?: boolean | Array>; - /**Disables selection of dates NOT in the array, e.g. holidays - * @default: false - * IMPORTANT! The getter returns an Object NOT an Array, with keys being the dates, values being true. - * eg enabledDates = ["2010-10-10"]; -> enabledDated will be { "2010-01-01": true } - * https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1499 - */ - enabledDates?: boolean | Array | any; - /**Will allow or disallow hour selections (much like disabledTimeIntervals) but will affect all days - * @default: false - * IMPORTANT! The getter returns an Object NOT an Array, with keys being the hours, values being true. - * eg enabledHours = [0, 1]; -> enabledHours will be { "0": true, "1": true } - * https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1499 - */ - enabledHours?: boolean | Array; - /**Allows for several input formats to be valid. See: https://github.com/Eonasdan/bootstrap-datetimepicker/pull/666 - * @default: false - */ - extraFormats?: boolean | Array; - /**If false, the textbox will not be given focus when the picker is shown - * @default: true - */ - focusOnShow?: boolean; - /**See momentjs' docs for valid formats. Format also dictates what components are shown, e.g. MM/dd/YYYY will not display the time picker. - * @default: false - */ - format?: boolean | string | moment.MomentBuiltinFormat; - /**Change the default icons for the pickers functions. */ - icons?: Icons; - /**Allow date picker show event to fire even when the associated input element has the readonly="readonly"property. - * @default: false - */ - ignoreReadonly?: boolean; - /**Will display the picker inline without the need of a input field. This will also hide borders and shadows. - * @default: false - */ - inline?: boolean; - /**Allows for custom events to fire on keyboard press. - * eg: keybinds: { - * up: (widget) => console.log(widget), - * "control up": (widget) => console.log(widget) - * } - * The widget parameter is false, if the datepicker is closed. - */ - keyBinds?: { [key: string]: (widget: boolean | JQuery) => void }; - /**Will cause the date picker to not revert or overwrite invalid dates. - * @default: false - */ - keepInvalid?: boolean; - /**Will cause the date picker to stay open after selecting a date if no time components are being used. - * @default: false - */ - keepOpen?: boolean; - /**See momentjs for valid locales. You must include moment-with-locales.js or a local js file. - * @default: moment.locale() - */ - locale?: string; - /**Prevents date/time selections after this date. - * maxDate will override defaultDate and useCurrent if either of these settings are the same day since both options are invalid according to the rules you've selected. - * @default: false - */ - maxDate?: boolean | moment.Moment | Date | string; - /**Prevents date/time selections before this date. - * minDate will override defaultDate and useCurrent if either of these settings are the same day since both options are invalid according to the rules you've selected. - * @default: false - */ - minDate?: boolean | moment.Moment | Date | string; - /**Allows custom input formatting For example: the user can enter "yesterday"" or "30 days ago". - * {@link http://eonasdan.github.io/bootstrap-datetimepicker/Functions/#parseinputdate} - */ - parseInputDate?: InputParser; - /**Show the "Clear" button in the icon toolbar. - * Clicking the "Clear" button will set the calendar to null. - * @default: false - */ - showClear?: boolean; - /**Show the "Close" button in the icon toolbar. - * Clicking the "Close" button will call hide() - * @default: false - */ - showClose?: boolean; - /**Show the "Today" button in the icon toolbar. - * Clicking the "Today" button will set the calendar view and set the date to now. - * @default: false - */ - showTodayButton?: boolean; - /**Shows the picker side by side when using the time and date together. - * @default: false - */ - sideBySide?: boolean; - /**Number of minutes the up/down arrow's will move the minutes value in the time picker - * @default: 1 - */ - stepping?: number; - /** - * Timezone to use, if moment-timezone is loaded. If null or empty string, ignore timezones. - * @default: "" - */ - timeZone?: string | null; - /**Changes the placement of the icon toolbar. - * @default: "default" - */ - toolbarPlacement?: "default" | "top" | "bottom"; - /**This will change the tooltips over each icon to a custom string */ - tooltips?: Tooltips; - /**On show, will set the picker to the current date/time - * @default: true - */ - useCurrent?: boolean; - /**Defines if moment should use strict date parsing when considering a date to be valid - * @default: false - */ - useStrict?: boolean; - /**This will change the viewDate without changing or setting the selected date. - * @default: false - */ - viewDate?: boolean | moment.Moment | Date | string; - /**The default view to display when the picker is shown. - * Note: To limit the picker to selecting, for instance the year and month, use format: MM/YYYY - * @default: "days" - */ - viewMode?: "decades" | "years" | "months" | "days"; - /**On picker show, places the widget at the identifier (string) or jQuery object if the element has css position: "relative" - * @default: null - */ - widgetParent?: string | JQuery | null; - widgetPositioning?: WidgetPositioningOptions; -} - -export interface Icons { - /**default: "glyphicon glyphicon-trash" */ - clear?: string; - /**default: "glyphicon glyphicon-remove" */ - close?: string; - /**default: "glyphicon glyphicon-calendar" */ - date?: string; - /**default: "glyphicon glyphicon-time" */ - down?: string; - /**default: "glyphicon glyphicon-chevron-left" */ - next?: string; - /**default: "glyphicon glyphicon-screenshot" */ - previous?: string; - /**default: "glyphicon glyphicon-chevron-right" */ - time?: string; - /**default: "glyphicon glyphicon-chevron-down" */ - today?: string; - /**default: "glyphicon glyphicon-chevron-up" */ - up?: string; -} - -export interface Tooltips { - today?: string; - clear?: string; - close?: string; - selectMonth?: string; - prevMonth?: string; - nextMonth?: string; - selectYear?: string; - prevYear?: string; - nextYear?: string; - selectDecade?: string; - prevDecade?: string; - nextDecade?: string; - prevCentury?: string; - nextCentury?: string; - selectTime?: string; - pickHour?: string; - incrementHour?: string; - decrementHour?: string; - pickMinute?: string; - incrementMinute?: string; - decrementMinute?: string; - togglePeriod?: string; - pickSecond?: string; - incrementSecond?: string; - decrementSecond?: string; -} - -export interface WidgetPositioningOptions { - horizontal?: "auto" | "left" | "right"; - vertical?: "auto" | "top" | "bottom"; -} - -export interface Event extends JQueryEventObject { - date: moment.Moment; -} - -export interface ChangeEvent extends Event { - /**Previous date. False if the previous date is null. */ - oldDate: moment.Moment | boolean; -} - -export interface UpdateEvent extends JQueryEventObject { - /**Change type as a momentjs format token. e.g. yyyy on year change */ - change: string; - /**New viewDate. */ - viewDate: moment.Moment; -} - -type EventName = "dp.show" | "dp.hide" | "dp.error"; - -declare global { - interface JQuery { - - datetimepicker(options?: DatetimepickerOptions): JQuery; - - data(key: "DateTimePicker"): Datetimepicker; - - on(events: "dp.change", handler: (eventObject: ChangeEvent) => any): JQuery; - on(events: "dp.change", selector: string, handler: (eventobject: ChangeEvent) => any): JQuery; - on(events: "dp.change", selector: string, data: any, handler?: (eventobject: ChangeEvent) => any): JQuery; - - off(events: "dp.change", handler: (eventobject: ChangeEvent) => any): JQuery; - off(events: "dp.change", selector?: string, handler?: (eventobject: ChangeEvent) => any): JQuery; - - on(events: EventName , handler: (eventObject: Event) => any): JQuery; - on(events: EventName, selector: string, handler: (eventobject: Event) => any): JQuery; - on(events: EventName, selector: string, data: any, handler?: (eventobject: Event) => any): JQuery; - - off(events: EventName, handler: (eventobject: Event) => any): JQuery; - off(events: EventName, selector?: string, handler?: (eventobject: Event) => any): JQuery; - - on(events: "dp.update", handler: (eventObject: UpdateEvent) => any): JQuery; - on(events: "dp.update", selector: string, handler: (eventobject: UpdateEvent) => any): JQuery; - on(events: "dp.update", selector: string, data: any, handler?: (eventobject: UpdateEvent) => any): JQuery; - - off(events: "dp.update", handler: (eventobject: UpdateEvent) => any): JQuery; - off(events: "dp.update", selector?: string, handler?: (eventobject: UpdateEvent) => any): JQuery; - } -} diff --git a/bootstrap.v3.datetimepicker/tslint.json b/bootstrap.v3.datetimepicker/tslint.json deleted file mode 100644 index 341858d283..0000000000 --- a/bootstrap.v3.datetimepicker/tslint.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "../tslint.json", - "rules": { - "quotemark": [true, "double", "avoid-escape"] - } -} \ No newline at end of file diff --git a/bootstrap/index.d.ts b/bootstrap/index.d.ts deleted file mode 100644 index 64f84f1d85..0000000000 --- a/bootstrap/index.d.ts +++ /dev/null @@ -1,130 +0,0 @@ -// Type definitions for Bootstrap 3.3.5 -// Project: http://twitter.github.com/bootstrap/ -// Definitions by: Boris Yankov -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - - -/// - -interface ModalOptions { - backdrop?: boolean|string; - keyboard?: boolean; - show?: boolean; - remote?: string; -} - -interface ModalOptionsBackdropString { - backdrop?: string; // for "static" - keyboard?: boolean; - show?: boolean; - remote?: string; -} - -interface ScrollSpyOptions { - offset?: number; - target?: string; -} - -interface TooltipOptions { - animation?: boolean; - html?: boolean; - placement?: string | Function; - selector?: string; - title?: string | Function; - trigger?: string; - template?: string; - delay?: number | Object; - container?: string | boolean; - viewport?: string | Function | Object; -} - -interface PopoverOptions { - animation?: boolean; - html?: boolean; - placement?: string | Function; - selector?: string; - trigger?: string; - title?: string | Function; - template?: string; - content?: any; - delay?: number | Object; - container?: string | boolean; - viewport?: string | Function | Object; -} - -interface CollapseOptions { - parent?: any; - toggle?: boolean; -} - -interface CarouselOptions { - interval?: number; - pause?: string; - wrap?: boolean; - keybord?: boolean; -} - -interface TypeaheadOptions { - source?: any; - items?: number; - minLength?: number; - matcher?: (item: any) => boolean; - sorter?: (items: any[]) => any[]; - updater?: (item: any) => any; - highlighter?: (item: any) => string; -} - -interface AffixOptions { - offset?: number | Function | Object; - target?: any; -} - -interface TransitionEventNames { - end: string; -} - -interface JQuery { - modal(options?: ModalOptions): JQuery; - modal(options?: ModalOptionsBackdropString): JQuery; - modal(command: string): JQuery; - - dropdown(): JQuery; - dropdown(command: string): JQuery; - - scrollspy(command: string): JQuery; - scrollspy(options?: ScrollSpyOptions): JQuery; - - tab(): JQuery; - tab(command: string): JQuery; - - tooltip(options?: TooltipOptions): JQuery; - tooltip(command: string): JQuery; - - popover(options?: PopoverOptions): JQuery; - popover(command: string): JQuery; - - alert(): JQuery; - alert(command: string): JQuery; - - button(): JQuery; - button(command: string): JQuery; - - collapse(options?: CollapseOptions): JQuery; - collapse(command: string): JQuery; - - carousel(options?: CarouselOptions): JQuery; - carousel(command: string): JQuery; - - typeahead(options?: TypeaheadOptions): JQuery; - - affix(options?: AffixOptions): JQuery; - - emulateTransitionEnd(duration: number): JQuery; -} - -interface JQuerySupport { - transition: boolean | TransitionEventNames; -} - -declare module "bootstrap" { -} diff --git a/braintree-web/braintree-web-tests.ts b/braintree-web/braintree-web-tests.ts deleted file mode 100644 index c9aee724c0..0000000000 --- a/braintree-web/braintree-web-tests.ts +++ /dev/null @@ -1,438 +0,0 @@ -let version: string = braintree.VERSION; - -let clientToken: string = "eyJ2ZXJzaW9uIjoyLCJhdXRob3JpemF0aW9uRmluZ2VycHJpbnQiOiI0YjlhYzVmYmI4ZTNkYzQzMmFkZjJhNzBlNjZlMWNjY2M5ODRkYzE4ZTM4YmY4NjYzZTM5NjM3NWZjYmQzY2U5fGNyZWF0ZWRfYXQ9MjAxNi0wOS0wOFQwNTowMzo0MC4xNjk1NTUwMzUrMDAwMFx1MDAyNm1lcmNoYW50X2lkPTM0OHBrOWNnZjNiZ3l3MmJcdTAwMjZwdWJsaWNfa2V5PTJuMjQ3ZHY4OWJxOXZtcHIiLCJjb25maWdVcmwiOiJodHRwczovL2FwaS5zYW5kYm94LmJyYWludHJlZWdhdGV3YXkuY29tOjQ0My9tZXJjaGFudHMvMzQ4cGs5Y2dmM2JneXcyYi9jbGllbnRfYXBpL3YxL2NvbmZpZ3VyYXRpb24iLCJjaGFsbGVuZ2VzIjpbXSwiZW52aXJvbm1lbnQiOiJzYW5kYm94IiwiY2xpZW50QXBpVXJsIjoiaHR0cHM6Ly9hcGkuc2FuZGJveC5icmFpbnRyZWVnYXRld2F5LmNvbTo0NDMvbWVyY2hhbnRzLzM0OHBrOWNnZjNiZ3l3MmIvY2xpZW50X2FwaSIsImFzc2V0c1VybCI6Imh0dHBzOi8vYXNzZXRzLmJyYWludHJlZWdhdGV3YXkuY29tIiwiYXV0aFVybCI6Imh0dHBzOi8vYXV0aC52ZW5tby5zYW5kYm94LmJyYWludHJlZWdhdGV3YXkuY29tIiwiYW5hbHl0aWNzIjp7InVybCI6Imh0dHBzOi8vY2xpZW50LWFuYWx5dGljcy5zYW5kYm94LmJyYWludHJlZWdhdGV3YXkuY29tLzM0OHBrOWNnZjNiZ3l3MmIifSwidGhyZWVEU2VjdXJlRW5hYmxlZCI6dHJ1ZSwicGF5cGFsRW5hYmxlZCI6dHJ1ZSwicGF5cGFsIjp7ImRpc3BsYXlOYW1lIjoiQWNtZSBXaWRnZXRzLCBMdGQuIChTYW5kYm94KSIsImNsaWVudElkIjpudWxsLCJwcml2YWN5VXJsIjoiaHR0cDovL2V4YW1wbGUuY29tL3BwIiwidXNlckFncmVlbWVudFVybCI6Imh0dHA6Ly9leGFtcGxlLmNvbS90b3MiLCJiYXNlVXJsIjoiaHR0cHM6Ly9hc3NldHMuYnJhaW50cmVlZ2F0ZXdheS5jb20iLCJhc3NldHNVcmwiOiJodHRwczovL2NoZWNrb3V0LnBheXBhbC5jb20iLCJkaXJlY3RCYXNlVXJsIjpudWxsLCJhbGxvd0h0dHAiOnRydWUsImVudmlyb25tZW50Tm9OZXR3b3JrIjp0cnVlLCJlbnZpcm9ubWVudCI6Im9mZmxpbmUiLCJ1bnZldHRlZE1lcmNoYW50IjpmYWxzZSwiYnJhaW50cmVlQ2xpZW50SWQiOiJtYXN0ZXJjbGllbnQzIiwiYmlsbGluZ0FncmVlbWVudHNFbmFibGVkIjp0cnVlLCJtZXJjaGFudEFjY291bnRJZCI6ImFjbWV3aWRnZXRzbHRkc2FuZGJveCIsImN1cnJlbmN5SXNvQ29kZSI6IlVTRCJ9LCJjb2luYmFzZUVuYWJsZWQiOmZhbHNlLCJtZXJjaGFudElkIjoiMzQ4cGs5Y2dmM2JneXcyYiIsInZlbm1vIjoib2ZmIn0="; - -braintree.client.create({ - authorization: clientToken -}, function (error: BraintreeError, clientInstance: any) { - - var form: HTMLFormElement = document.getElementById('my-form-id') as HTMLFormElement; - var data: { creditCard: BraintreeWeb.CreditCardInfo } = { - creditCard: { - number: form['cc-number'].value, - cvv: form['cc-cvv'].value, - expirationDate: form['cc-date'].value, - billingAddress: { - postalCode: form['cc-postal'].value - } - } - }; - - clientInstance.request({ - endpoint: 'payment_methods/credit_cards', - method: 'post', - data: data - }, function (requestErr: BraintreeError, response: { creditCards: any[]; }) { - if (requestErr) { throw new Error(requestErr.message); } - - console.log('Got nonce:', response.creditCards[0].nonce); - }); - - braintree.hostedFields.create({ - client: clientInstance, - styles: { - 'input': { - 'font-size': '16pt', - 'color': '#3A3A3A' - }, - - '.number': { - 'font-family': 'monospace' - }, - '.valid': { - 'color': 'green' - } - }, - fields: { - number: { - selector: '#card-number' - }, - cvv: { - selector: '#cvv', - type: 'password' - }, - expirationMonth: { - selector: '#expiration-month', - select: { - options: ["01 - Jan", "02 - Feb", "03 - Mar", "04 - Apr", "05 - May", "06 - Jun", "07 - Jul", "08 - Aug", "09 - Sep", "10 - Oct", "11 - Nov", "12 - Dec"] - } - }, - expirationYear: { - selector: '#expiration-year', - select: true - } - } - }, function (hostedFieldsErr?: BraintreeError, hostedFieldsInstance?: any) { - - if (hostedFieldsErr) { - // Handle error in Hosted Fields creation - console.log(`Error Code: ${error.code}, Type: ${error.type}, Message: ${error.message}, Details: ${error.details}`); - return; - } - - let form = new HTMLFormElement(); - - form.addEventListener('submit', function (event: Event) { - event.preventDefault(); - - hostedFieldsInstance.tokenize(function (tokenizeErr: BraintreeError, payload: BraintreeWeb.HostedFieldsTokenizePayload) { - if (tokenizeErr) { - // Handle error in Hosted Fields tokenization - switch (tokenizeErr.code) { - case 'HOSTED_FIELDS_FIELDS_EMPTY': - console.error('All fields are empty! Please fill out the form.'); - break; - case 'HOSTED_FIELDS_FIELDS_INVALID': - console.error('Some fields are invalid:', tokenizeErr.details.invalidFieldKeys); - break; - case 'HOSTED_FIELDS_FAILED_TOKENIZATION': - console.error('Tokenization failed server side. Is the card valid?'); - break; - case 'HOSTED_FIELDS_TOKENIZATION_NETWORK_ERROR': - console.error('Network error occurred when tokenizing.'); - break; - default: - console.error('Something bad happened!', tokenizeErr); - } - return; - } - - // Put `payload.nonce` into the `payment-method-nonce` input, and then - // submit the form. Alternatively, you could send the nonce to your server - // with AJAX. - (document.querySelector('input[name="payment-method-nonce"]') as HTMLInputElement).value = payload.nonce; - form.submit(); - }); - }, false); - - hostedFieldsInstance.on('focus', function (event: BraintreeWeb.HostedFieldsStateObject) { - console.log(event.emittedBy, 'has been focused'); - }); - - hostedFieldsInstance.teardown(function (teardownErr: BraintreeError) { - if (teardownErr) { - console.error('Could not tear down Hosted Fields!'); - } else { - console.info('Hosted Fields has been torn down!'); - } - }); - - hostedFieldsInstance.tokenize({ - vault: true - }, function (tokenizeErr: BraintreeError, payload: BraintreeWeb.HostedFieldsTokenizePayload) { - if (tokenizeErr) { - console.error(tokenizeErr); - } else { - console.log('Got nonce:', payload.nonce); - } - }); - - hostedFieldsInstance.addClass('number', 'custom-class', function (addClassErr: BraintreeError) { - if (addClassErr) { - console.error(addClassErr); - } - }); - - hostedFieldsInstance.addClass('number', 'custom-class', function (addClassErr: BraintreeError) { - if (addClassErr) { - console.error(addClassErr); - return; - } - - // some time later... - hostedFieldsInstance.removeClass('number', 'custom-class'); - }); - - hostedFieldsInstance.setPlaceholder('number', '4111 1111 1111 1111', function (placeholderErr: BraintreeError) { - if (placeholderErr) { - console.error(placeholderErr); - } - }); - - hostedFieldsInstance.on('cardTypeChange', function (event: BraintreeWeb.HostedFieldsStateObject) { - // Update the placeholder value if there is only one possible card type - if (event.cards.length === 1) { - braintree.hostedFields.setPlaceholder('cvv', event.cards[0].code.name, function (placeholderErr: BraintreeError) { - if (placeholderErr) { - // Handle errors, such as invalid field name - console.error(placeholderErr); - } - }); - } - }); - - hostedFieldsInstance.clear('number', function (clearErr: BraintreeError) { - if (clearErr) { - console.error(clearErr); - } - }); - - hostedFieldsInstance.clear('number'); - hostedFieldsInstance.clear('cvv'); - hostedFieldsInstance.clear('expirationDate'); - - var state = braintree.hostedFields.getState(); - - var formValid = Object.keys(state.fields).every(function (key) { - return state.fields[key].isValid; - }); - }); - - braintree.applePay.create({ client: clientInstance }, function (createErr?: BraintreeError, applePayInstance?: any) { - if (createErr) { - // Handle error in client creation - console.log(`Error Code: ${error.code}, Type: ${error.type}, Message: ${error.message}, Details: ${error.details}`); - - return; - } - - let request = { - countryCode: 'US', - currencyCode: 'USD', - supportedNetworks: ['visa', 'masterCard'], - merchantCapabilities: ['supports3DS'], - total: { label: 'Your Label', amount: '10.00' }, - }; - - var paymentRequest = braintree.applePay.createPaymentRequest(request); - - console.log(paymentRequest); - // { total: { }, countryCode: 'US', currencyCode: 'USD', merchantCapabilities: [ ], supportedNetworks: [ ] } - }); - - braintree.applePay.create({ client: clientInstance }, function (createErr, applePayInstance) { - let request = { - countryCode: 'US', - currencyCode: 'USD', - supportedNetworks: ['visa', 'masterCard'], - merchantCapabilities: ['supports3DS'], - total: { label: 'Your Label', amount: '10.00' }, - }; - - var session = new ApplePaySession(1, request); - - session.onvalidatemerchant = function (event: { validationURL: string }) { - braintree.applePay.performValidation({ - validationURL: event.validationURL - }, function (err, validationData) { - if (err) { - console.error(err); - session.abort(); - return; - } - session.completeMerchantValidation(validationData); - }); - }; - }); - - braintree.applePay.create({ client: clientInstance }, function (createErr, applePayInstance) { - let request = { - countryCode: 'US', - currencyCode: 'USD', - supportedNetworks: ['visa', 'masterCard'], - merchantCapabilities: ['supports3DS'], - total: { label: 'Your Label', amount: '10.00' }, - }; - - var session = new ApplePaySession(1, request); - - session.onpaymentauthorized = function (event) { - braintree.applePay.tokenize({ - token: event.payment.token - }, function (err, tokenizedPayload) { - if (err) { - session.completePayment(ApplePayStatusCodes.STATUS_FAILURE); - return; - } - session.completePayment(ApplePayStatusCodes.STATUS_SUCCESS); - - // Send the tokenizedPayload to your server. - }); - }; - }); - - braintree.paypal.create({ - client: clientInstance - }, function (createErr, paypalInstance) { - if (createErr) { - if (createErr.code === 'PAYPAL_BROWSER_NOT_SUPPORTED') { - console.error('This browser is not supported.'); - } else { - console.error('Error!', createErr); - } - } - - let button = new HTMLButtonElement(); - - button.addEventListener('click', function () { - // Disable the button so that we don't attempt to open multiple popups. - button.setAttribute('disabled', 'disabled'); - - // Because PayPal tokenization opens a popup, this must be called - // as a result of a user action, such as a button click. - paypalInstance.tokenize({ - flow: 'vault' // Required - // Any other tokenization options - }, function (tokenizeErr: BraintreeError, payload: BraintreeWeb.PayPalTokenizePayload) { - button.removeAttribute('disabled'); - - if (tokenizeErr) { - // Handle tokenization errors or premature flow closure - - switch (tokenizeErr.code) { - case 'PAYPAL_POPUP_CLOSED': - console.error('Customer closed PayPal popup.'); - break; - case 'PAYPAL_ACCOUNT_TOKENIZATION_FAILED': - console.error('PayPal tokenization failed. See details:', tokenizeErr.details); - break; - case 'PAYPAL_FLOW_FAILED': - console.error('Unable to initialize PayPal flow. Are your options correct?', tokenizeErr.details); - break; - default: - console.error('Error!', tokenizeErr); - } - } else { - // Submit payload.nonce to your server - } - }); - }); - }); - - braintree.unionpay.create({ client: clientInstance }, function (createErr, unionpayInstance) { - if (createErr) { - console.error(createErr); - return; - } - - unionpayInstance.fetchCapabilities({ - card: { - number: '4111111111111111' - } - }, function (fetchErr: BraintreeError, cardCapabilities: BraintreeWeb.UnionPayFetchCapabilitiesPayload) { - if (fetchErr) { - console.error(fetchErr); - return; - } - - if (cardCapabilities.isUnionPay) { - if (cardCapabilities.unionPay && !cardCapabilities.unionPay.isSupported) { - // Braintree cannot process this UnionPay card. - // Ask the user for a different card. - return; - } - - if (cardCapabilities.isDebit) { - // CVV and expiration date are not required - } else { - // CVV and expiration date are required - } - - // Show mobile phone number field for enrollment - } - }); - - unionpayInstance.enroll({ - card: { - number: '4111111111111111', - expirationMonth: '12', - expirationYear: '2038' - }, - mobile: { - countryCode: '62', - number: '111111111111' - } - }, function (enrollErr: BraintreeError, response: BraintreeWeb.UnionPayEnrollPayload) { - if (enrollErr) { - console.error(enrollErr); - return; - } - - if (response.smsCodeRequired) { - // If smsCodeRequired, wait for SMS auth code from customer - // Then use response.enrollmentId during {@link UnionPay#tokenize} - } else { - // SMS code is not required from the user. - // {@link UnionPay#tokenize} can be called immediately - } - }); - - let enrollResponse: { - enrollmentId: string - }; - - unionpayInstance.tokenize({ - card: { - number: '4111111111111111', - expirationMonth: '12', - expirationYear: '2038', - cvv: '123' - }, - enrollmentId: enrollResponse.enrollmentId, // Returned from enroll - smsCode: '11111' // Received by customer's phone, if SMS enrollment was required. Otherwise it should be omitted - }, function (tokenizeErr: BraintreeError, response: BraintreeWeb.UnionPayTokenizePayload) { - if (tokenizeErr) { - console.error(tokenizeErr); - return; - } - - // Send response.nonce to your server - }); - - unionpayInstance.teardown(function (teardownErr: BraintreeError) { - if (teardownErr) { - console.error('Could not tear down UnionPay.'); - } else { - console.log('UnionPay has been torn down.'); - } - }); - }); -}); - -let existingNonce = "fake-valid-nonce"; -let submitNonceToServer: (nonce: string) => void; - -braintree.threeDSecure.verifyCard({ - nonce: existingNonce, - amount: 123.45, - addFrame: function (err, iframe) { - // Set up your UI and add the iframe. - let my3DSContainer = document.createElement('div'); - my3DSContainer.appendChild(iframe); - document.body.appendChild(my3DSContainer); - }, - removeFrame: function () { - let my3DSContainer = document.createElement('div'); - - // Remove UI that you added in addFrame. - document.body.removeChild(my3DSContainer); - } -}, function (err: BraintreeError, payload: BraintreeWeb.ThreeDSecureVerifyPayload) { - if (err) { - console.error(err); - return; - } - - if (payload.liabilityShifted) { - // Liablity has shifted - submitNonceToServer(payload.nonce); - } else if (payload.liabilityShiftPossible) { - // Liablity may still be shifted - // Decide if you want to submit the nonce - } else { - // Liablity has not shifted and will not shift - // Decide if you want to submit the nonce - } -}); - -braintree.threeDSecure.cancelVerifyCard(function (err: BraintreeError, verifyPayload: BraintreeWeb.ThreeDSecureVerifyPayload) { - if (err) { - // Handle error - console.log(err.message); // No verification payload available - return; - } - - verifyPayload.nonce; // The nonce returned from the 3ds lookup call - verifyPayload.liabilityShifted; // boolean - verifyPayload.liabilityShiftPossible; // boolean -}); \ No newline at end of file diff --git a/braintree-web/index.d.ts b/braintree-web/index.d.ts deleted file mode 100644 index 6d896a5efe..0000000000 --- a/braintree-web/index.d.ts +++ /dev/null @@ -1,1933 +0,0 @@ -// Type definitions for Braintree-web v3.6.1 -// Project: https://github.com/braintree/braintree-web -// Definitions by: Guy Shahine -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/** - * @module braintree-web/american-express - * @description This module is for use with Amex Express Checkout. To accept American Express cards, use Hosted Fields. - */ -declare namespace BraintreeWeb { - export interface AmericanExpress { - /** - * @static - * @function create - * @param {object} options Creation options: - * @param {Client} options.client A {@link Client} instance. - * @param {callback} callback The second argument, `data`, is the {@link AmericanExpress} instance. - * @returns {void} - */ - create: (options: { client: Client }, callback: callback) => void; - - /** - * @description The current version of the SDK, i.e. `3.0.2`. - * @type {string} - */ - VERSION: string; - } - - /** - * @class - * @param {object} options Options - * @description You cannot use this constructor directly. Use {@link module:braintree-web/american-express.create|braintree.american-express.create} instead. - * @classdesc This class allows you use a nonce to interact with American Express Checkout. To accept American Express cards, use Hosted Fields. - */ - export class AmericanExpress { - /** - * @class - * @param {object} options Options - * @description You cannot use this constructor directly. Use {@link module:braintree-web/american-express.create|braintree.american-express.create} instead. - * @classdesc This class allows you use a nonce to interact with American Express Checkout. To accept American Express cards, use Hosted Fields. - */ - constructor(options: any); - - /** - * Gets the rewards balance associated with a Braintree nonce. - * @public - * @param {object} options Request options - * @param {string} options.nonce An existing Braintree nonce. - * @param {callback} callback The second argument, data, is the returned server data. - * @returns {void} - * @example - * var americanExpress = require('braintree-web/american-express'); - * - * americanExpress.create({client: clientInstance}, function (createErr, americanExpressInstance) { - * var options = {nonce: existingBraintreeNonce}; - * americanExpressInstance.getRewardsBalance(options, function (getErr, payload) { - * if (getErr || payload.error) { - * // Handle error - * return; - * } - * - * console.log('Rewards amount: ' + payload.rewardsAmount); - * }); - * }); - */ - public getRewardsBalance(options: { nonce: string }, callback: callback): void; - - /** - * Gets the Express Checkout nonce profile given a nonce from American Express. - * @public - * @param {object} options Request options - * @param {string} options.nonce An existing nonce from American Express (note that this is not a nonce from Braintree). - * @param {callback} callback The second argument, data, is the returned server data. - * @returns {void} - * @example - * var americanExpress = require('braintree-web/american-express'); - * - * americanExpress.create({client: clientInstance}, function (createErr, americanExpressInstance) { - * var options = {nonce: existingAmericanExpressNonce}; - * americanExpressInstance.getExpressCheckoutProfile(options, function (getErr, payload) { - * if (getErr) { - * // Handle error - * return; - * } - * - * console.log('Number of cards: ' + payload.amexExpressCheckoutCards.length); - * }); - * }); - */ - public getExpressCheckoutProfile(options: { nonce: string }, callback: callback): void; - } -} - - -// more info https://developer.apple.com/reference/applepayjs/1916082-applepay_js_data_types/paymentrequest - -// billingContact -// Billing contact information for the user. -// countryCode -//Required.The merchant’s two- letter ISO 3166 country code. -// currencyCode -// Required.The three- letter ISO 4217 currency code for the payment. -// lineItems -//A set of line items that explain recurring payments and additional charges. -// merchantCapabilities -// Required.The payment capabilities supported by the merchant.The value must be one or more of supports3DS, supportsEMV, supportsCredit, or supportsDebit. -// requiredBillingContactFields -// The billing information that is required from the user.The value must be one or more of postalAddress, phone, email, or name. -// requiredShippingContactFields -// The shipping information that is required from the user.The value must be one or more of postalAddress, phone, email, or name. -// shippingContact -// Shipping contact information for the user. -// shippingMethods -//A set of available shipping methods.Totals for all shipping methods must be non- negative to pass validation. -// shippingType -// How the items are to be shipped.This property is optional.If specified, it must be one or more of shipping, delivery, storePickup, or servicePickup.The default value is shipping. -// supportedNetworks -// Required.The payment networks supported by the merchant.The value must be one or more of amex, discover, interac, masterCard, privateLabel, or visa. -// total -// Required.The total amount for the payment.The total must be greater than zero and have a label to pass validation. -interface ApplePayPaymentRequest { - total: { - label: string; - amount: string; - }; - countryCode: string; - currencyCode: string; - supportedNetworks: string[]; - merchantCapabilities: string[]; - - billingContact?: any; - shippingContact?: any; - shippingMethods?: any; - shippingType?: any; - requiredBillingContactFields?: any; - requiredShippingContactFields?: any; -} - -declare enum ApplePayStatusCodes { - // The requested action succeeded. - STATUS_SUCCESS = 1, - // The requested action failed. - STATUS_FAILURE, - // The billing address is not valid. - STATUS_INVALID_BILLING_POSTAL_ADDRESS, - // The shipping address is not valid. - STATUS_INVALID_SHIPPING_POSTAL_ADDRESS, - // The shipping contact information is not valid. - STATUS_INVALID_SHIPPING_CONTACT, - // The required PIN information was not provided. Cards on the China Union Pay payment network may require a PIN to authenticate the transaction. - STATUS_PIN_REQUIRED, - // The PIN information is not valid.Cards on the China Union Pay network may require a PIN. - STATUS_PIN_INCORRECT, - // The maximum number of tries for a PIN has been reached and the user has been locked out. Cards on the China Union Pay network may require a PIN. - STATUS_PIN_LOCKOUT, -} - -interface ApplePayPayload { - merchantIdentifier: string; - domainName: string; - displayName: string; -} - -declare class ApplePaySession { - constructor(version: number, request: ApplePayPaymentRequest); - - canMakePayments(): boolean; - - canMakePaymentsWithActiveCard(merchantIdentifier: string): boolean; - - completeMerchantValidation(merchantSession: any): void; - - abort(): void; - - begin(): void; - - completePayment(status: ApplePayStatusCodes): void; - - completePaymentMethodSelection(newTotal: any, newLineItems: any): void; - - completeShippingContactSelection(status: ApplePayStatusCodes, newShippingMethods: any, newTotal: any, newLineItems: any): void; - - completeShippingMethodSelection(status: ApplePayStatusCodes, newTotal: any, newLineItems: any): void; - - supportsVersion(version: number): boolean; - - oncancel: (event: any) => void; - - onpaymentauthorized: (event: any) => void; - - onpaymentmethodselected: (event: any) => void; - - onshippingcontactselected: (event: any) => void; - - onshippingmethodselected: (event: any) => void; - - onvalidatemerchant: (event: any) => void; -} - -/** - * @module braintree-web/apple-pay - * @description Accept Apple Pay on the Web. *This component is currently in beta and is subject to change.* - */ -declare namespace BraintreeWeb { - export interface ApplePay { - /** - * @static - * @function create - * @param {object} options Creation options: - * @param {Client} options.client A {@link Client} instance. - * @param {callback} callback The second argument, `data`, is the {@link ApplePay} instance. - * @returns {void} - */ - create: (options: { client: Client }, callback: callback) => void; - - /** - * @description The current version of the SDK, i.e. `3.0.2`. - * @type {string} - */ - VERSION: string; - } - - /** - * @class - * @param {object} options Options - * @description You cannot use this constructor directly. Use {@link module:braintree-web/apple-pay.create|braintree.apple-pay.create} instead. - * @classdesc This class represents an Apple Pay component. Instances of this class have methods for validating the merchant server and tokenizing payments. - */ - export class ApplePay { - /** - * @class - * @param {object} options Options - * @description You cannot use this constructor directly. Use {@link module:braintree-web/apple-pay.create|braintree.apple-pay.create} instead. - * @classdesc This class represents an Apple Pay component. Instances of this class have methods for validating the merchant server and tokenizing payments. - */ - constructor(options: any); - - /** - * Merges a payment request with Braintree defaults - * The following properties are assigned to `paymentRequest` if not already defined - * - countryCode - * - currencyCode - * - merchantCapabilities - * - supportedNetworks - * @public - * @param {external:ApplePayPaymentRequest} paymentRequest The payment request details to apply on top of those from Braintree. - * @returns {external:ApplePayPaymentRequest} The decorated `paymentRequest`. - * @example - * var applePay = require('braintree-web/apple-pay'); - * - * applePay.create({client: clientInstance}, function (createErr, applePayInstance) { - * // ... - * var paymentRequest = applePay.createPaymentRequest({ - * total: { - * label: 'My Company', - * amount: '19.99' - * }); - * - * console.log(paymentRequest); - * // { total: { }, countryCode: 'US', currencyCode: 'USD', merchantCapabilities: [ ], supportedNetworks: [ ] } - * - */ - public createPaymentRequest(paymentRequest: ApplePayPaymentRequest): ApplePayPaymentRequest - - /** - * Validates the merchant website, as required by ApplePaySession before payment can be authorized. - * @public - * @param {object} options Options - * @param {string} options.validationURL The validationURL fram an ApplePayValidateMerchantEvent. - * @param {string} [options.displayName] - * - The canonical name for your store. - * - The system may display this name to the user. - * - Use a 128-character or less, UTF-8 string. - * - Do not localize the name. - * @param {string} [options.merchantIdentifier] - * Your Apple merchant identifier. This is the Apple Merchant ID created on the Apple Developer Portal. - * Defaults to the merchant identifier specified in the Braintree Control Panel. - * You can use this field to override the merchant identifier for this transaction. - * @param {callback} callback The second argument, data, is the Apple Pay merchant session object. - * Pass the merchant session to your Apple Pay session's completeMerchantValidation method. - * @returns {void} - * @example - * var applePay = require('braintree-web/apple-pay'); - * - * applePay.create({client: clientInstance}, function (createErr, applePayInstance) { - * var session = new ApplePaySession(1, { - * // This should be the payment request object that - * // contains the information needed to display the payment sheet. - * }); - * - * session.onvalidatemerchant = function (event) { - * applePay.performValidation({ - * validationURL: event.validationURL - * }, function(err, validationData) { - * if (err) { - * console.error(err); - * session.abort(); - * return; - * } - * session.completeMerchantValidation(validationData); - * }); - * }; - * }); - */ - public performValidation(options: { validationURL: string, displayName?: string, merchantIdentifier?: string }, callback: callback): void; - - /** - * Tokenizes an Apple Pay payment. - * @public - * @param {object} options Options - * @param {object} options.token The `payment.token` property of an {@link external:ApplePayPaymentAuthorizedEvent} - * @param {callback} callback The second argument, data, is the tokenized payload. - * @returns {void} - * @example - * var applePay = require('braintree-web/apple-pay'); - * - * applePay.create({client: clientInstance}, function (createErr, applePayInstance) { - * var session = new ApplePaySession(1, { }); - * - * session.onpaymentauthorized = function (event) { - * applePay.tokenize({ - * token: event.payment.token - * }, function (err, tokenizedPayload) { - * if (err) { - * session.completePayment(ApplePaySession.STATUS_FAILURE); - * return; - * } - * session.completePayment(ApplePaySession.STATUS_SUCCESS); - * - * // Send the tokenizedPayload to your server. - * }); - * }; - * }); - */ - public tokenize(options: { token: any }, callback: callback): void; - - } -} - -/** @module braintree-web/client */ -declare namespace BraintreeWeb { - /** - * This object is returned by {@link Client#getConfiguration|getConfiguration}. This information is used extensively by other Braintree modules to properly configure themselves. - * @typedef {object} Client~configuration - * @property {object} client The braintree-web/client parameters. - * @property {string} client.authorization A tokenizationKey or clientToken. - * @property {object} gatewayConfiguration Gateway-supplied configuration. - * @property {object} analyticsMetadata Analytics-specific data. - * @property {string} analyticsMetadata.sessionId Uniquely identifies a browsing session. - * @property {string} analyticsMetadata.sdkVersion The braintree.js version. - * @property {string} analyticsMetadata.merchantAppId Identifies the merchant's web app. - */ - interface ClientAnalyticsMetadata { - sessionId: string; - sdkVersion: string; - merchantAppId: string; - } - - interface Configuration { - client: Client; - gatewayConfiguration: any; - analyticsMetadata: ClientAnalyticsMetadata; - } - - interface CreditCardInfo { - number: string; - cvv: string; - expirationDate: string; - billingAddress: { - postalCode?: string; - } - } - - export interface Client { - authorization: string; - - /** - * @function - * @description This function is the entry point for the braintree.client module. It is used for creating {@link Client} instances that service communication to Braintree servers. - * @param {object} options Object containing all {@link Client} options: - * @param {string} options.authorization A tokenizationKey or clientToken. - * @param {callback} callback The second argument, data, is the {@link Client} instance. - * @returns {void} - * @example - * var createClient = require('braintree-web/client').create; - * - * createClient({ - * authorization: CLIENT_AUTHORIZATION - * }, function (createErr, clientInstance) { - * ... - * }); - * @static - */ - create: (options: { authorization: string }, callback: callback) => void; - - /** - * @description The current version of the SDK, i.e. `3.0.2`. - * @type {string} - */ - VERSION: string; - } - - /** - * @class - * @param {Client~configuration} configuration Options - * @description Do not use this constructor directly. Use {@link module:braintree-web/client.create|braintree.client.create} instead. - * @classdesc This class is required by many other Braintree components. It serves as the base API layer that communicates with our servers. It is also capable of being used to formulate direct calls to our servers, such as direct credit card tokenization. See {@link Client#request}. - */ - export class Client { - /** - * @class - * @param {Client~configuration} configuration Options - * @description Do not use this constructor directly. Use {@link module:braintree-web/client.create|braintree.client.create} instead. - * @classdesc This class is required by many other Braintree components. It serves as the base API layer that communicates with our servers. It is also capable of being used to formulate direct calls to our servers, such as direct credit card tokenization. See {@link Client#request}. - */ - constructor(configuration: Configuration); - - - /** - * Returns a copy of the configuration values. - * @public - * @returns {Client~configuration} configuration - */ - public getConfiguration(): Configuration; - - /** - * Used by other modules to formulate all network requests to the Braintree gateway. It is also capable of being used directly from your own form to tokenize credit card information. However, be sure to satisfy PCI compliance if you use direct card tokenization. - * @public - * @param {object} options Request options: - * @param {string} options.method HTTP method, e.g. "get" or "post" - * @param {string} options.endpoint Endpoint path. e.g. "payment_methods" - * @param {object} options.data Data to send with the request - * @param {number} [options.timeout=60000] Set a timeout (in milliseconds) for the request. - * @param {callback} callback The second argument, data, is the returned server data. - * @example - * Direct Credit Card Tokenization - * var createClient = require('braintree-web/client').create; - * - * createClient({ - * authorization: CLIENT_AUTHORIZATION - * }, function (createErr, clientInstance) { - * var form = document.getElementById('my-form-id'); - * var data = { - * creditCard: { - * number: form['cc-number'].value, - * cvv: form['cc-cvv'].value, - * expirationDate: form['cc-date'].value, - * billingAddress: { - * postalCode: form['cc-postal'].value - * }, - * options: { - * validate: false - * } - * } - * }; - * - * // Warning: For a merchant to be eligible for the easiest level of PCI compliance (SAQ A), - * // payment fields cannot be hosted on your checkout page. - * // For an alternative to the following, use Hosted Fields. - * clientInstance.request({ - * endpoint: 'payment_methods/credit_cards', - * method: 'post', - * data: data - * }, function (requestErr, response) { - * // More detailed example of handling API errors: https://codepen.io/braintree/pen/MbwjdM - * if (requestErr) { throw new Error(requestErr); } - * - * console.log('Got nonce:', response.creditCards[0].nonce); - * }); - * }); - * @returns {void} - */ - public request(options: { method: string, endpoint: string, data: any, timeout?: number }, callback: callback): void; - - } -} - -/** @module braintree-web/data-collector */ -declare namespace BraintreeWeb { - export interface DataCollector { - /** - * @static - * @function create - * @description Creates a DataCollector instance. Requires advanced fraud protection to be enabled in the Braintree gateway. Contact our [support team](mailto:support@braintreepayments.com) to configure your Kount ID. - * @param {object} options Creation options: - * @param {Client} options.client A {@link Client} instance. - * @param {boolean} [options.kount] If true, Kount fraud data collection is enabled. - * @param {boolean} [options.paypal] If true, PayPal fraud data collection is enabled. - * @param {callback} callback The second argument, `data`, is the {@link DataCollector} instance. - * @returns {void} - */ - create: (options: { client: Client, kount: boolean, paypal: boolean }, callback: callback) => void; - - /** - * @description The current version of the SDK, i.e. `3.0.2`. - * @type {string} - */ - VERSION: string; - } - - /** - * @class - * @global - * @name DataCollector - * @description Do not use this constructor directly. Use {@link module:braintree-web/data-collector.create|braintree-web.data-collector.create} instead. - * @classdesc This class is used for advanced fraud integration with PayPal and Kount. Instances of this class have {@link DataCollector#deviceData|deviceData} which is used to correlate user sessions with server transactions. Before using DataCollector, make sure you have enabled advanced fraud protection in the Braintree gateway. To use your own Kount ID, contact our support team ([support@braintreepayments.com](mailto:support@braintreepayments.com) or [877.434.2894](tel:877.434.2894)). - */ - export class DataCollector { - /** - * @class - * @global - * @name DataCollector - * @description Do not use this constructor directly. Use {@link module:braintree-web/data-collector.create|braintree-web.data-collector.create} instead. - * @classdesc This class is used for advanced fraud integration with PayPal and Kount. Instances of this class have {@link DataCollector#deviceData|deviceData} which is used to correlate user sessions with server transactions. - */ - constructor(); - - /** - * @memberof DataCollector - * @name deviceData - * @type string - * @description JSON string to pass with server transactions. - * @instance - */ - deviceData: string; - - /** - * @memberof DataCollector - * @name teardown - * @function - * @description Cleanly remove all event handlers and DOM nodes that were added. - * @param {callback} [callback] Called once teardown is complete. No data is returned if teardown completes successfully. - * @instance - * @returns {void} - */ - teardown(callback?: callback): void; - - } -} - -/** @module braintree-web/hosted-fields */ -declare namespace BraintreeWeb { - /** - * Fields used in {@link module:braintree-web/hosted-fields~fieldOptions fields options} - * @typedef {object} field - * @property {string} selector A CSS selector to find the container where the hosted field will be inserted. - * @property {string} [placeholder] Will be used as the `placeholder` attribute of the input. If `placeholder` is not natively supported by the browser, it will be polyfilled. - * @property {string} [type] Will be used as the `type` attribute of the input. To mask `cvv` input, for instance, `type: "password"` can be used. - * @property {boolean} [formatInput=true] - Enable or disable automatic formatting on this field. - * @property {object|boolean} [select] If truthy, this field becomes a `URL' + - '') : $(''); - // Show add and edit links when hover over. - span.hover(function () { - span.append(options); - $('#deletelink').click(function () { - $('#deletedialog').empty().dialog({ - autoOpen: false, - title: 'Confirm Deletion', - resizable: false, - height: 140, - modal: true, - buttons: { - 'Yes, Delete It!': function () { - chrome.bookmarks.remove(String(bookmarkNode.id)); - span.parent().remove(); - $(this).dialog('destroy'); - }, - Cancel: function () { - $(this).dialog('destroy'); - } - } - }).dialog('open'); - }); - $('#addlink').click(function () { - $('#adddialog').empty().append(edit).dialog({ - autoOpen: false, - closeOnEscape: true, title: 'Add New Bookmark', modal: true, - buttons: { - 'Add': function () { - chrome.bookmarks.create({ - parentId: bookmarkNode.id, - title: $('#title').val(), url: $('#url').val() - }); - $('#bookmarks').empty(); - $(this).dialog('destroy'); - dumpBookmarks(); - }, - 'Cancel': function () { - $(this).dialog('destroy'); - } - } - }).dialog('open'); - }); - $('#editlink').click(function () { - edit.val(anchor.text()); - $('#editdialog').empty().append(edit).dialog({ - autoOpen: false, - closeOnEscape: true, title: 'Edit Title', modal: true, - show: 'slide', buttons: { - 'Save': function () { - chrome.bookmarks.update(String(bookmarkNode.id), { - title: edit.val() - }); - anchor.text(edit.val()); - options.show(); - $(this).dialog('destroy'); - }, - 'Cancel': function () { - $(this).dialog('destroy'); - } - } - }).dialog('open'); - }); - options.fadeIn(); - }, - // unhover - function () { - options.remove(); - }).append(anchor); - } - var li = $(bookmarkNode.title ? '
  • ' : '
    ').append(span); - if (bookmarkNode.children && bookmarkNode.children.length > 0) { - li.append(dumpTreeNodes(bookmarkNode.children, query)); - } - return li; - } - - document.addEventListener('DOMContentLoaded', function () { - dumpBookmarks(); - }); -} - -// https://developer.chrome.com/extensions/examples/api/browserAction/make_page_red/background.js -function pageRedder() { - chrome.browserAction.onClicked.addListener(function (tab) { - // No tabs or host permissions needed! - console.log('Turning ' + tab.url + ' red!'); - chrome.tabs.executeScript({ - code: 'document.body.style.backgroundColor="red"' - }); - }); -} - -// https://developer.chrome.com/extensions/examples/api/browserAction/print/background.js -function printPage() { - chrome.browserAction.onClicked.addListener(function (tab) { - var action_url = "javascript:window.print();"; - chrome.tabs.update(tab.id!, { url: action_url }); - }); -} - -// https://developer.chrome.com/extensions/examples/extensions/catblock/background.js -function catBlock () { - var loldogs: string[]; - chrome.webRequest.onBeforeRequest.addListener( - function(info) { - console.log("Cat intercepted: " + info.url); - // Redirect the lolcal request to a random loldog URL. - var i = Math.round(Math.random() * loldogs.length); - return {redirectUrl: loldogs[i]}; - }, - // filters - { - urls: [ - "https://i.chzbgr.com/*" - ], - types: ["image"] - }, - // extraInfoSpec - ["blocking"]); -} - -// webNavigation.onBeforeNavigate.addListener example similar api to onBeforeRequest but without extra spec -function beforeRedditNavigation() { - chrome.webNavigation.onBeforeNavigate.addListener(function (requestDetails) { - console.log("URL we want to redirect to: " + requestDetails.url); - // NOTE: This will search for top level frames with the value -1. - if (requestDetails.parentFrameId != -1) { - return; - } - - let url = new URL(requestDetails.url); - let splitUrl = url.hostname.split('.'); - //` Note: Does not cover the XX.co.uk type edge case - let host = (splitUrl[(splitUrl.length -1) - 1]); - - if (host === null) { - return; - } else if (host === "reddit") { - alert("Were you trying to go on reddit, during working hours? :(") - return; - } - },{urls: ["http://*/*"], types: ["image"]}); -} - -// contrived settings example -function proxySettings() { - chrome.proxy.settings.get({ incognito: true }, (details) => { - var val = details.value; - var level: string = details.levelOfControl; - var incognito: boolean = details.incognitoSpecific!; - }); - - // bare minimum set call - chrome.proxy.settings.set({ value: 'something' }); - - // add a scope and callback - chrome.proxy.settings.set({ - value: 'something', - scope: 'regular' - }, () => {}); - - chrome.proxy.settings.clear({}); - - // clear with a scope set - chrome.proxy.settings.clear({ scope: 'regular' }); -} - -// https://developer.chrome.com/extensions/examples/api/contentSettings/popup.js -function contentSettings() { - var incognito; - var url; - - function settingChanged() { - var type = this.id; - var setting = this.value; - var pattern = /^file:/.test(url) ? url : url.replace(/\/[^\/]*?$/, '/*'); - console.log(type+' setting for '+pattern+': '+setting); - // HACK: [type] is not recognised by the docserver's sample crawler, so - // mention an explicit - // type: chrome.contentSettings.cookies.set - See http://crbug.com/299634 - chrome.contentSettings[type].set({ - 'primaryPattern': pattern, - 'setting': setting, - 'scope': (incognito ? 'incognito_session_only' : 'regular') - }); - } - - document.addEventListener('DOMContentLoaded', function () { - chrome.tabs.query({active: true, currentWindow: true, url: ['http://*/*', 'https://*/*'] }, function(tabs) { - var current = tabs[0]; - incognito = current.incognito; - url = current.url; - var types = ['cookies', 'images', 'javascript', 'location', 'plugins', - 'popups', 'notifications', 'fullscreen', 'mouselock', - 'microphone', 'camera', 'unsandboxedPlugins', - 'automaticDownloads']; - types.forEach(function(type) { - // HACK: [type] is not recognised by the docserver's sample crawler, so - // mention an explicit - // type: chrome.contentSettings.cookies.get - See http://crbug.com/299634 - chrome.contentSettings[type] && chrome.contentSettings[type].get({ - 'primaryUrl': url, - 'incognito': incognito - }, - function(details) { - var input = document.getElementById(type); - input.disabled = false; - input.value = details.setting; - }); - }); - }); - - var selects = document.querySelectorAll('select'); - for (var i = 0; i < selects.length; i++) { - selects[i].addEventListener('change', settingChanged); - } - }); -} - -// https://developer.chrome.com/extensions/runtime#method-openOptionsPage -function testOptionsPage() { - chrome.runtime.openOptionsPage(); - chrome.runtime.openOptionsPage(function() { - // Do a thing ... - }); -} - -// https://developer.chrome.com/extensions/storage#type-StorageArea -function testStorage() { - function getCallback(loadedData: { [key: string]: any; }) { - var myValue: { x: number } = loadedData["myKey"]; - } - - chrome.storage.sync.get(getCallback); - chrome.storage.sync.get("myKey", getCallback); - chrome.storage.sync.get(["myKey", "myKey2"], getCallback); - chrome.storage.sync.get({ foo: 1, bar: 2 }, getCallback); - chrome.storage.sync.get(null, getCallback); - - function getBytesInUseCallback(bytesInUse: number) { - console.log(bytesInUse); - } - - chrome.storage.sync.getBytesInUse(getBytesInUseCallback); - chrome.storage.sync.getBytesInUse("myKey", getBytesInUseCallback); - chrome.storage.sync.getBytesInUse(["myKey", "myKey2"], getBytesInUseCallback); - chrome.storage.sync.getBytesInUse(null, getBytesInUseCallback); - - function doneCallback() { - console.log("done"); - } - - chrome.storage.sync.set({ foo: 1, bar: 2}); - chrome.storage.sync.set({ foo: 1, bar: 2}, doneCallback); - - chrome.storage.sync.remove("myKey"); - chrome.storage.sync.remove("myKey", doneCallback); - chrome.storage.sync.remove(["myKey", "myKey2"]); - chrome.storage.sync.remove(["myKey", "myKey2"], doneCallback); - - chrome.storage.sync.clear(); - chrome.storage.sync.clear(doneCallback); - - chrome.storage.onChanged.addListener(function (changes) { - var myNewValue: { x: number } = changes["myKey"].newValue; - var myOldValue: { x: number } = changes["myKey"].oldValue; - }); -} diff --git a/chunked-dc/index.d.ts b/chunked-dc/index.d.ts deleted file mode 100644 index ab3acd6901..0000000000 --- a/chunked-dc/index.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -// Type definitions for chunked-dc 0.1 -// Project: https://github.com/saltyrtc/chunked-dc-js -// Definitions by: Danilo Bargen -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -// Interfaces -declare namespace chunkedDc { - - /** common.ts **/ - - interface CommonStatic { - HEADER_LENGTH: number; - } - - /** chunker.ts **/ - - interface Chunker extends IterableIterator { - hasNext: boolean; - next(): IteratorResult; - [Symbol.iterator](): IterableIterator; - } - - interface ChunkerStatic { - new(id: number, message: Uint8Array, chunkSize: number): Chunker; - } - - /** unchunker.ts **/ - - type MessageListener = (message: Uint8Array, context?: any) => void; - - interface Unchunker { - onMessage: MessageListener; - add(chunk: ArrayBuffer, context?: any): void; - gc(maxAge: number): number; - } - - interface UnchunkerStatic { - new(): Unchunker; - } - - /** main.ts **/ - - interface Standalone { - Chunker: ChunkerStatic; - Unchunker: UnchunkerStatic; - } - -} - -// Entry point for the packed ES5 version: -declare var chunkedDc: chunkedDc.Standalone; - -// Entry point for the ES2015 version: -declare var Chunker: chunkedDc.ChunkerStatic; -declare var Unchunker: chunkedDc.UnchunkerStatic; diff --git a/chunked-dc/tslint.json b/chunked-dc/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/chunked-dc/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/clamp-js/index.d.ts b/clamp-js/index.d.ts deleted file mode 100755 index 2e86e544f7..0000000000 --- a/clamp-js/index.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Type definitions for clamp-js 0.7 -// Project: https://github.com/xavi160/Clamp.js -// Definitions by: Sebastiaan de Rooij -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare namespace clamp { - export interface ClampOptions { - clamp?: number|string; - useNativeClamp?: boolean; - splitOnChars?: string[]; - animate?: boolean; - truncationChar?: string; - truncationHTML?: string | null; - } - - export interface ClampResponse { - 'original': string; - 'clamped': string; - } -} - -declare function clamp(element: HTMLElement, options?: clamp.ClampOptions): clamp.ClampResponse; - -export = clamp; -export as namespace clamp; diff --git a/clamp-js/tslint.json b/clamp-js/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/clamp-js/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/cliff/cliff-tests.ts b/cliff/cliff-tests.ts deleted file mode 100644 index 9217d9a38a..0000000000 --- a/cliff/cliff-tests.ts +++ /dev/null @@ -1 +0,0 @@ -/// \ No newline at end of file diff --git a/clipboard/clipboard-tests.ts b/clipboard/clipboard-tests.ts deleted file mode 100644 index 5af2671671..0000000000 --- a/clipboard/clipboard-tests.ts +++ /dev/null @@ -1,28 +0,0 @@ -import * as Clipboard from 'clipboard'; - -var cb1 = new Clipboard('.btn'); -var cb2 = new Clipboard(document.getElementById('id'), { - action: elem => 'copy' -}); -var cb3 = new Clipboard(document.querySelectorAll('query'), { - text: elem => null -}); -var cb4 = new Clipboard('.btn', { - target: elem => null -}); -var cb5 = new Clipboard('.btn', { - action: elem => 'copy', - target: elem => null -}); - -cb1.destroy(); - -cb2.on('success', e => { - console.info('Action:', e.action); - console.info('Text:', e.text); - console.info('Trigger:', e.trigger); - - e.clearSelection(); -}); -cb2.on('error', e => { }); - diff --git a/clipboard/index.d.ts b/clipboard/index.d.ts deleted file mode 100644 index ec03d9bee5..0000000000 --- a/clipboard/index.d.ts +++ /dev/null @@ -1,57 +0,0 @@ -// Type definitions for clipboard.js 1.5 -// Project: https://github.com/zenorocha/clipboard.js -// Definitions by: Andrei Kurosh -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare class Clipboard { - constructor(selector: (string | Element | NodeListOf), options?: Clipboard.Options); - - /** - * Subscribes to events that indicate the result of a copy/cut operation. - * @param type {"success" | "error"} Event type ('success' or 'error'). - * @param handler Callback function. - */ - on(type: "success" | "error", handler: (e: Clipboard.Event) => void): this; - on(type: string, handler: (...args: any[]) => void): this; - - /** - * Clears all event bindings. - */ - destroy(): void; -} - -declare namespace Clipboard { - interface Options { - /** - * 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; - } - - interface Event { - action: string; - text: string; - trigger: Element; - clearSelection(): void; - } -} - -export = Clipboard; - -export as namespace Clipboard; \ No newline at end of file diff --git a/clipboard/tslint.json b/clipboard/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/clipboard/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/clndr/tslint.json b/clndr/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/clndr/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/co-views/index.d.ts b/co-views/index.d.ts deleted file mode 100644 index 5df2238c12..0000000000 --- a/co-views/index.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -// Type definitions for co-views 2.1 -// Project: https://github.com/tj/co-views/ -// Definitions by: devlee , Joshua DeVinney -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare namespace CoViews { - export interface Options { - /** - * default extname - */ - ext?: string; - - /** - * default extname - */ - default?: string; - - /** - * engine map - */ - map?: Object; - - /** - * proxy partials - */ - partials?: Object; - - /** - * cache compiled templates - */ - cache?: boolean; - - /** - * common locals data - */ - locals?: Object; - } -} - -/** - * Pass views `dir` and `opts` to return a render function. - */ -declare function CoViews(dir?: string, opts?: CoViews.Options): (view: string, locals?: Object) => any; -export = CoViews; diff --git a/co-views/tslint.json b/co-views/tslint.json deleted file mode 100644 index f05741c59b..0000000000 --- a/co-views/tslint.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "../tslint.json", - "rules": { - "forbidden-types": false - } -} diff --git a/code/index.d.ts b/code/index.d.ts deleted file mode 100644 index dacd122915..0000000000 --- a/code/index.d.ts +++ /dev/null @@ -1,190 +0,0 @@ -// Type definitions for code 4.0 -// Project: https://github.com/hapijs/code -// Definitions by: Prashant Tiwari -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/** Generates an assertion object. */ -export function expect(value: T | T[], prefix?: string): AssertionChain; -/** Makes the test fail with the given message. */ -export function fail(message: string): void; -/** Returns the total number of assertions created using the expect() method. */ -export function count(): number; -/** Returns an array of the locations where incomplete assertions were declared or null if no incomplete assertions found. */ -export function incomplete(): string[] | null; -/** Returns the filename, line number, and column number of where the error was created. */ -export function thrownAt(error?: Error): CodeError; -/** Configure code. */ -export const settings: Settings; - -type AssertionChain = Assertion & Expectation; - -type Assertion = Grammar & Flags; - -type Expectation = Types & Values; - -interface Grammar { - /** Connecting word. */ - a: AssertionChain; - /** Connecting word. */ - an: AssertionChain; - /** Connecting word. */ - and: AssertionChain; - /** Connecting word. */ - at: AssertionChain; - /** Connecting word. */ - be: AssertionChain; - /** Connecting word. */ - have: AssertionChain; - /** Connecting word. */ - in: AssertionChain; - /** Connecting word. */ - to: AssertionChain; -} - -interface Flags { - /** Inverses the expected result of any assertion */ - not: AssertionChain; - /** - * Requires that inclusion matches appear only once in the provided value. - * Used by include(). - */ - once: AssertionChain; - /** - * Requires that only the provided elements appear in the provided value. - * Used by include(). - */ - only: AssertionChain; - /** - * Allows a partial match when asserting inclusion - * Used by include(). Defaults to false. - */ - part: AssertionChain; - /** - * Performs a comparison using strict equality (===). - * Code defaults to deep comparison. Used by equal() and include(). - */ - shallow: AssertionChain; -} - -interface Types { - /** Asserts that the reference value is an arguments object. */ - arguments(): AssertionChain; - /** Asserts that the reference value is an Array. */ - array(): AssertionChain; - /** Asserts that the reference value is a boolean. */ - boolean(): AssertionChain; - /** Asserts that the reference value is a Buffer. */ - buffer(): AssertionChain; - /** Asserts that the reference value is a Date. */ - date(): AssertionChain; - /** Asserts that the reference value is an error. */ - error(type?: any, message?: string | RegExp): AssertionChain; - /** Asserts that the reference value is a function. */ - function(): AssertionChain; - /** Asserts that the reference value is a number. */ - number(): AssertionChain; - /** Asserts that the reference value is a RegExp. */ - regexp(): AssertionChain; - /** Asserts that the reference value is a string. */ - string(): AssertionChain; - /** Asserts that the reference value is an object (excluding array, buffer, or other native objects). */ - object(): AssertionChain; -} - -interface Values { - /** Asserts that the reference value is true. */ - true(): AssertionChain; - /** Asserts that the reference value is false. */ - false(): AssertionChain; - /** Asserts that the reference value is null. */ - null(): AssertionChain; - /** Asserts that the reference value is undefined. */ - undefined(): AssertionChain; - /** Asserts that the reference value (a string, array, or object) includes the provided values. */ - include(values: string | string[] | T | T[]): AssertionChain; - /** Asserts that the reference value (a string, array, or object) includes the provided values. */ - includes(values: string | string[] | T | T[]): AssertionChain; - /** Asserts that the reference value (a string, array, or object) includes the provided values. */ - contain(values: string | string[] | T | T[]): AssertionChain; - /** Asserts that the reference value (a string, array, or object) includes the provided values. */ - contains(values: string | string[] | T | T[]): AssertionChain; - /** Asserts that the reference value (a string) starts with the provided value. */ - startWith(value: string): AssertionChain; - /** Asserts that the reference value (a string) starts with the provided value. */ - startsWith(value: string): AssertionChain; - /** Asserts that the reference value (a string) ends with the provided value. */ - endWith(value: string): AssertionChain; - /** Asserts that the reference value (a string) ends with the provided value. */ - endsWith(value: string): AssertionChain; - /** Asserts that the reference value exists (not null or undefined). */ - exist(): AssertionChain; - /** Asserts that the reference value exists (not null or undefined). */ - exists(): AssertionChain; - /** Asserts that the reference value has a length property equal to zero or an object with no keys. */ - empty(): AssertionChain; - /** Asserts that the reference value has a length property matching the provided size or an object with the specified number of keys. */ - length(size: number): AssertionChain; - /** Asserts that the reference value equals the provided value. */ - equal(value: T, options?: any): AssertionChain; - /** Asserts that the reference value equals the provided value. */ - equals(value: T, options?: any): AssertionChain; - /** Asserts that the reference value is greater than (>) the provided value. */ - above(value: T): AssertionChain; - /** Asserts that the reference value is greater than (>) the provided value. */ - greaterThan(value: T): AssertionChain; - /** Asserts that the reference value is at least (>=) the provided value. */ - least(value: T): AssertionChain; - /** Asserts that the reference value is at least (>=) the provided value. */ - min(value: T): AssertionChain; - /** Asserts that the reference value is less than (<) the provided value. */ - below(value: T): AssertionChain; - /** Asserts that the reference value is less than (<) the provided value. */ - lessThan(value: T): AssertionChain; - /** Asserts that the reference value is at most (<=) the provided value. */ - most(value: T): AssertionChain; - /** Asserts that the reference value is at most (<=) the provided value. */ - max(value: T): AssertionChain; - /** Asserts that the reference value is within (from <= value <= to) the provided values. */ - within(from: T, to: T): AssertionChain; - /** Asserts that the reference value is within (from <= value <= to) the provided values. */ - range(from: T, to: T): AssertionChain; - /** Asserts that the reference value is between but not equal (from < value < to) the provided values. */ - between(from: T, to: T): AssertionChain; - /** Asserts that the reference value is about the provided value within a delta margin of difference. */ - about(value: number, delta: number): AssertionChain; - /** Asserts that the reference value has the provided instanceof value. */ - instanceof(type: any): AssertionChain; - /** Asserts that the reference value has the provided instanceof value. */ - instanceOf(type: any): AssertionChain; - /** Asserts that the reference value's toString() representation matches the provided regular expression. */ - match(regex: RegExp): AssertionChain; - /** Asserts that the reference value's toString() representation matches the provided regular expression. */ - matches(regex: RegExp): AssertionChain; - /** Asserts that the reference value satisfies the provided validator function. */ - satisfy(validator: (value: T) => boolean): AssertionChain; - /** Asserts that the reference value satisfies the provided validator function. */ - satisfies(validator: (value: T) => boolean): AssertionChain; - /** Asserts that the function reference value throws an exception when called. */ - throw(type?: any, message?: string | RegExp): AssertionChain; - /** Asserts that the function reference value throws an exception when called. */ - throws(type?: any, message?: string | RegExp): AssertionChain; -} - -interface Settings { - /** - * Truncate long assertion error messages for readability? - * Defaults to true. - */ - truncateMessages?: boolean; - /** - * Ignore object prototypes when doing a deep comparison? - * Defaults to false. - */ - comparePrototypes?: boolean; -} - -interface CodeError { - filename: string; - line: string; - column: string; -} diff --git a/code/tslint.json b/code/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/code/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/codependency/codependency-tests.ts b/codependency/codependency-tests.ts deleted file mode 100644 index e0f8a793a6..0000000000 --- a/codependency/codependency-tests.ts +++ /dev/null @@ -1,8 +0,0 @@ -let requirePeer = codependency.register(module), package: any; - requirePeer = codependency.register(module, {index: ["dependencies", "devDependencies"]}); - requirePeer = codependency.get("some-middleware"); - package = requirePeer("some-peer-dependency-package"); - package = requirePeer("some-peer-dependency-package", {optional: true}); - package = requirePeer("some-peer-dependency-package", {dontThrow: true}); - package = requirePeer("some-peer-dependency-package", {optional: true, dontThrow: true}); - package = requirePeer.resolve("peer-package-name"); \ No newline at end of file diff --git a/codependency/index.d.ts b/codependency/index.d.ts deleted file mode 100644 index 2ec424588d..0000000000 --- a/codependency/index.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Type definitions for codependency 0.1 -// Project: https://github.com/Wizcorp/codependency -// Definitions by: Morgan Benton -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -export as namespace codependency; - -interface DependencyInfo { - supportedRange: string|null; - installedVersion: string|null; - isInstalled: boolean|null; - isValid: boolean|null; - pkgPath: string; -} - -interface RequirePeerFunctionOptions { - optional?: boolean; - dontThrow?: boolean; -} - -interface RequirePeerFunction { - (name: string, options?: RequirePeerFunctionOptions): any; - resolve: (name: string) => DependencyInfo; -} - -export function register(baseModule: NodeModule, options?: {index: string[]}): RequirePeerFunction; -export function get(middlewareName: string): RequirePeerFunction; \ No newline at end of file diff --git a/codependency/tslint.json b/codependency/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/codependency/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/coinstring/coinstring-tests.ts b/coinstring/coinstring-tests.ts deleted file mode 100644 index ab11a44fb7..0000000000 --- a/coinstring/coinstring-tests.ts +++ /dev/null @@ -1,69 +0,0 @@ -/// - -import cs = require('coinstring'); - - -var privateKeyHex = "1184cd2cdd640ca42cfc3a091c51d549b2f016d454b2774019c2b2d2e08529fd"; -var privateKeyHexBuf = new Buffer(privateKeyHex, 'hex'); -var version = 0x80; // Bitcoin private key - -console.log(cs.encode(privateKeyHexBuf, version)); -// => 5Hx15HFGyep2CfPxsJKe2fXJsCVn5DEiyoeGGF6JZjGbTRnqfiD - -var hash160 = "3c176e659bea0f29a3e9bf7880c112b1b31b4dc8"; // hash representing uncompressed -var hash160Buf = new Buffer(hash160, 'hex'); -var version = 0x00; // Bitcoin public address - -console.log(cs.encode(hash160Buf, version)); -// => 16UjcYNBG9GTK4uq2f7yYEbuifqCzoLMGS - -var privateKeyHex = "1184cd2cdd640ca42cfc3a091c51d549b2f016d454b2774019c2b2d2e08529fd"; - -// for compressed, append "01" -privateKeyHex += '01'; - -var privateKeyHexBuf = new Buffer(privateKeyHex, 'hex'); -var version = 0x80; // Bitcoin private key - -console.log(cs.encode(privateKeyHexBuf, version)); -// => KwomKti1X3tYJUUMb1TGSM2mrZk1wb1aHisUNHCQXTZq5auC2qc3 - -var hash160 = "3c176e659bea0f29a3e9bf7880c112b1b31b4dc8"; // hash representing uncompressed -var hash160Buf = new Buffer(hash160, 'hex'); -var version = 0x1E; // Dogecoin public address - -console.log(cs.encode(hash160Buf, version)); -// => DAcq9oJpZZAjr56RmF7Y5zmWboZWQ4HAsW - - -var data = "000000000000000000873dff81c02f525623fd1fe5167eac3a55a049de3d314bb42ee227ffed37d50800e8f32e723decf4051aefac8e2c93c9c5b214313817cdb01a1494b917c8436b35"; -var buffer = new Buffer(data, 'hex'); -var versionBuffer = new Buffer('0488ade4', 'hex'); // 0488ade4 is a consant listed in the aforementioned bip32 wiki. - -console.log(cs.encode(buffer, versionBuffer)); -// => xprv9s21ZrQH143K3QTDL4LXw2F7HEK3wJUD2nW2nRk4stbPy6cq3jPPqjiChkVvvNKmPGJxWUtg6LnF5kejMRNNU3TGtRBeJgk33yuGBxrMPHi - - -var privateKeyHex = "1184cd2cdd640ca42cfc3a091c51d549b2f016d454b2774019c2b2d2e08529fd"; -var privateKeyHexBuf = new Buffer(privateKeyHex, 'hex'); -var version = 0x80; // Bitcoin private key - -var toBtcWif = cs.createEncoder(version); - -// later in your program -console.log(toBtcWif(privateKeyHexBuf)); -// => 5Hx15HFGyep2CfPxsJKe2fXJsCVn5DEiyoeGGF6JZjGbTRnqfiD - - -var wif = "5Hx15HFGyep2CfPxsJKe2fXJsCVn5DEiyoeGGF6JZjGbTRnqfiD"; -var version = 0x80; // Bitcoin private key - -var fromBtcWif = cs.createDecoder(version); - - -var hash160 = "3c176e659bea0f29a3e9bf7880c112b1b31b4dc8"; // hash representing uncompressed -var hash160Buf = new Buffer(hash160, 'hex'); -var version = 0x6F; // Bitcoin Testnet Address - -var testnetAddressValidator = cs.createValidator(version); -console.log(testnetAddressValidator("mkzgubTA5Ahi6BPSkE6MN9pEafRutznkMe")); // => true \ No newline at end of file diff --git a/coinstring/tslint.json b/coinstring/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/coinstring/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/color/index.d.ts b/color/index.d.ts deleted file mode 100644 index 83302cc38d..0000000000 --- a/color/index.d.ts +++ /dev/null @@ -1,92 +0,0 @@ -// Type definitions for color 1.0 -// Project: https://www.npmjs.com/package/color -// Definitions by: Karol Janyst -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare namespace Color { - - type ColorParam = string | { [param: string]: number }; - - type ColorModel = "rgb" | "hsl" | "hsv" | "hwb" | "hcg" | "cmyk" | "xyz" | "lab" | "hex" | "gray" | "keyword"; - - interface Color { - (color: ColorParam | Color, model?: ColorModel) : Color; - toString(): string; - toJSON(): any; - string(places?: number): string; - percentString(placse?: number): string; - array(): number[]; - object(): any; - unitArray(): any[]; - unitObject(): any; - round(places?: number): Color; - alpha(alpha: number): Color; - alpha(): number; - red(red: number): Color; - red(): number; - green(green: number): Color; - green(): number; - blue(blue: number): Color; - blue(): number; - hue(hue: number): Color; - hue(): number; - saturationl(saturation: number): Color; - saturationl(): number; - lightness(lightness: number): Color; - lightness(): number; - saturationv(saturationv: number): Color; - saturationv(): number; - value(value: number): Color; - value(): number; - chroma(chroma: number): Color; - chroma(): number; - gray(value: number): Color; - gray(): number; - cyan(cyan: number): Color; - cyan(): number; - magenta(magenta: number): Color; - magenta(): number; - yellow(yellow: number): Color; - yellow(): number; - black(black: number): Color; - black(): number; - x(x: number): Color; - x(): number; - y(y: number): Color; - y(): number; - z(z: number): Color; - z(): number; - l(l: number): Color; - l(): number; - a(a: number): Color; - a(): number; - b(b: number): Color; - b(): number; - keyword(keyword: string): Color; - keyword(): string | undefined; - hex(color: string): Color; - hex(): string; - rgbNumber(): number; - luminosity(): number; - contrast(color: Color): number; - level(color: Color): string; - dark(): boolean; - light(): boolean; - negate(): Color; - lighten(value: number): Color; - darken(value: number): Color; - saturate(value: number): Color; - desaturate(value: number): Color; - whiten(value: number): Color; - blacken(value: number): Color; - greyscale(): Color; - fade(ratio: number): Color; - opaquer(value: number): Color; - rotate(value: number): Color; - mix(color: Color, value?: number): Color; - } -} - -declare const Color: Color.Color; -export = Color; -export as namespace Color; diff --git a/colors/index.d.ts b/colors/index.d.ts deleted file mode 100644 index e087bd0714..0000000000 --- a/colors/index.d.ts +++ /dev/null @@ -1,133 +0,0 @@ -// Type definitions for Colors.js 1.1 -// Project: https://github.com/Marak/colors.js -// Definitions by: Bart van der Schoor , Staffan Eketorp -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -interface Color { - (text: string): string; - - strip: Color; - stripColors: Color; - - black: Color; - red: Color; - green: Color; - yellow: Color; - blue: Color; - magenta: Color; - cyan: Color; - white: Color; - gray: Color; - grey: Color; - - bgBlack: Color; - bgRed: Color; - bgGreen: Color; - bgYellow: Color; - bgBlue: Color; - bgMagenta: Color; - bgCyan: Color; - bgWhite: Color; - - reset: Color; - bold: Color; - dim: Color; - italic: Color; - underline: Color; - inverse: Color; - hidden: Color; - strikethrough: Color; - - rainbow: Color; - zebra: Color; - america: Color; - trap: Color; - random: Color; - zalgo: Color; -} - -export function setTheme(theme: any): void; - -export var enabled: boolean; - -export var strip: Color; -export var stripColors: Color; - -export var black: Color; -export var red: Color; -export var green: Color; -export var yellow: Color; -export var blue: Color; -export var magenta: Color; -export var cyan: Color; -export var white: Color; -export var gray: Color; -export var grey: Color; - -export var bgBlack: Color; -export var bgRed: Color; -export var bgGreen: Color; -export var bgYellow: Color; -export var bgBlue: Color; -export var bgMagenta: Color; -export var bgCyan: Color; -export var bgWhite: Color; - -export var reset: Color; -export var bold: Color; -export var dim: Color; -export var italic: Color; -export var underline: Color; -export var inverse: Color; -export var hidden: Color; -export var strikethrough: Color; - -export var rainbow: Color; -export var zebra: Color; -export var america: Color; -export var trap: Color; -export var random: Color; -export var zalgo: Color; - -declare global { - interface String { - strip: string; - stripColors: string; - - black: string; - red: string; - green: string; - yellow: string; - blue: string; - magenta: string; - cyan: string; - white: string; - gray: string; - grey: string; - - bgBlack: string; - bgRed: string; - bgGreen: string; - bgYellow: string; - bgBlue: string; - bgMagenta: string; - bgCyan: string; - bgWhite: string; - - reset: string; - bold: string; - dim: string; - italic: string; - underline: string; - inverse: string; - hidden: string; - strikethrough: string; - - rainbow: string; - zebra: string; - america: string; - trap: string; - random: string; - zalgo: string; - } -} \ No newline at end of file diff --git a/colors/tslint.json b/colors/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/colors/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/combined-stream/index.d.ts b/combined-stream/index.d.ts deleted file mode 100644 index cada758701..0000000000 --- a/combined-stream/index.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -// Type definitions for combined-stream 1.0 -// Project: https://github.com/felixge/node-combined-stream -// Definitions by: Felix Geisendörfer , Tomek Łaziuk -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -import { Stream } from "stream"; - -declare class CombinedStream extends Stream implements CombinedStream.Options { - readonly writable: boolean; - readonly readable: boolean; - readonly dataSize: number; - maxDataSize: number; - pauseStreams: boolean; - append(stream: NodeJS.ReadableStream | NodeJS.WritableStream | Buffer | string): this; - write(data: any): void; - pause(): void; - resume(): void; - end(): void; - destroy(): void; - - // private properties - _released: boolean; - // @TODO it should be a type of Array<'delayed-stream' instance | Buffer | string> - _streams: Array; - _currentStream: Stream | Buffer | string | null; - _getNext(): void; - _pipeNext(): void; - _handleErrors(stream: NodeJS.EventEmitter): void; - _reset(): void; - _checkDataSize(): void; - _updateDataSize(): void; - _emitError(error: Error): void; - - // events - on(event: "close" | "end" | "resume" | "pause", cb: () => void): this; - on(event: "error", cb: (err: Error) => void): this; - on(event: "data", cb: (data: any) => void): this; - once(event: "close" | "end" | "resume" | "pause", cb: () => void): this; - once(event: "error", cb: (err: Error) => void): this; - once(event: "data", cb: (data: any) => void): this; -} - -declare namespace CombinedStream { - export interface Options { - maxDataSize?: number; - pauseStreams?: boolean; - } - - export function create(options?: Options): CombinedStream; - - export function isStreamLike(stream: any): stream is Stream; -} - -export = CombinedStream; diff --git a/combined-stream/tslint.json b/combined-stream/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/combined-stream/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/commander/index.d.ts b/commander/index.d.ts deleted file mode 100644 index 15a3246710..0000000000 --- a/commander/index.d.ts +++ /dev/null @@ -1,416 +0,0 @@ -// Type definitions for commanderjs 2.3.0 -// Project: https://github.com/visionmedia/commander.js -// Definitions by: Marcelo Dezem , vvakame -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -declare var commander: commander.IExportedCommand; -export = commander; - -declare namespace commander { - interface ICommandStatic { - /** - * Initialize a new `Command`. - * - * @param {String} name - * @api public - */ - new (name?:string):ICommand; - } - - interface ICommand extends NodeJS.EventEmitter { - args: string[]; - _args: { required:boolean; name: string; }[]; - - /** - * Add command `name`. - * - * The `.action()` callback is invoked when the - * command `name` is specified via __ARGV__, - * and the remaining arguments are applied to the - * function for access. - * - * When the `name` is "*" an un-matched command - * will be passed as the first arg, followed by - * the rest of __ARGV__ remaining. - * - * Examples: - * - * program - * .version('0.0.1') - * .option('-C, --chdir ', 'change the working directory') - * .option('-c, --config ', 'set config path. defaults to ./deploy.conf') - * .option('-T, --no-tests', 'ignore test hook') - * - * program - * .command('setup') - * .description('run remote setup commands') - * .action(function(){ - * console.log('setup'); - * }); - * - * program - * .command('exec ') - * .description('run the given remote command') - * .action(function(cmd){ - * console.log('exec "%s"', cmd); - * }); - * - * program - * .command('*') - * .description('deploy the given env') - * .action(function(env){ - * console.log('deploying "%s"', env); - * }); - * - * program.parse(process.argv); - * - * @param {String} name - * @param {String} [desc] - * @param {Mixed} [opts] - * @return {Command} the new command - * @api public - */ - command(name:string, desc?:string, opts?: any):ICommand; - - /** - * Set / get the arguments usage `str`. - */ - arguments(str: string):ICommand; - - /** - * Add an implicit `help [cmd]` subcommand - * which invokes `--help` for the given command. - * - * @api private - */ - addImplicitHelpCommand():void; - - /** - * Parse expected `args`. - * - * For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`. - * - * @param {Array} args - * @return {Command} for chaining - * @api public - */ - parseExpectedArgs(args:string[]):ICommand; - - /** - * Register callback `fn` for the command. - * - * Examples: - * - * program - * .command('help') - * .description('display verbose help') - * .action(function(){ - * // output help here - * }); - * - * @param {Function} fn - * @return {Command} for chaining - * @api public - */ - action(fn:(...args:any[])=>void):ICommand; - - /** - * Define option with `flags`, `description` and optional - * coercion `fn`. - * - * The `flags` string should contain both the short and long flags, - * separated by comma, a pipe or space. The following are all valid - * all will output this way when `--help` is used. - * - * "-p, --pepper" - * "-p|--pepper" - * "-p --pepper" - * - * Examples: - * - * // simple boolean defaulting to false - * program.option('-p, --pepper', 'add pepper'); - * - * --pepper - * program.pepper - * // => Boolean - * - * // simple boolean defaulting to true - * program.option('-C, --no-cheese', 'remove cheese'); - * - * program.cheese - * // => true - * - * --no-cheese - * program.cheese - * // => false - * - * // required argument - * program.option('-C, --chdir ', 'change the working directory'); - * - * --chdir /tmp - * program.chdir - * // => "/tmp" - * - * // optional argument - * program.option('-c, --cheese [type]', 'add cheese [marble]'); - * - * @param {String} flags - * @param {String} description - * @param {Function|Mixed} fn or default - * @param {Mixed} defaultValue - * @return {Command} for chaining - * @api public - */ - option(flags:string, description?:string, fn?:((arg1:any, arg2:any)=>void)|RegExp, defaultValue?:any):ICommand; - option(flags:string, description?:string, defaultValue?:any):ICommand; - - /** - * Allow unknown options on the command line. - * - * @param {Boolean} arg if `true` or omitted, no error will be thrown - * for unknown options. - * @api public - */ - allowUnknownOption(arg?: boolean):ICommand; - - /** - * Parse `argv`, settings options and invoking commands when defined. - * - * @param {Array} argv - * @return {Command} for chaining - * @api public - */ - parse(argv:string[]):ICommand; - - /** - * Execute a sub-command executable. - * - * @param {Array} argv - * @param {Array} args - * @param {Array} unknown - * @api private - */ - executeSubCommand(argv:string[], args:string[], unknown:string[]):any; /* child_process.ChildProcess */ - - /** - * Normalize `args`, splitting joined short flags. For example - * the arg "-abc" is equivalent to "-a -b -c". - * This also normalizes equal sign and splits "--abc=def" into "--abc def". - * - * @param {Array} args - * @return {Array} - * @api private - */ - normalize(args:string[]):string[]; - - /** - * Parse command `args`. - * - * When listener(s) are available those - * callbacks are invoked, otherwise the "*" - * event is emitted and those actions are invoked. - * - * @param {Array} args - * @return {Command} for chaining - * @api private - */ - parseArgs(args:string[], unknown:string[]):ICommand; - - /** - * Return an option matching `arg` if any. - * - * @param {String} arg - * @return {Option} - * @api private - */ - optionFor(arg:string):IOption; - - /** - * Parse options from `argv` returning `argv` - * void of these options. - * - * @param {Array} argv - * @return {Array} - * @api public - */ - parseOptions(argv:string[]): {args:string[]; unknown:string[];}; - - /** - * Return an object containing options as key-value pairs - * - * @return {Object} - * @api public - */ - opts():any; - - /** - * Argument `name` is missing. - * - * @param {String} name - * @api private - */ - missingArgument(name:string):void; - - /** - * `Option` is missing an argument, but received `flag` or nothing. - * - * @param {String} option - * @param {String} flag - * @api private - */ - optionMissingArgument(option:{flags:string;}, flag?:string):void; - - /** - * Unknown option `flag`. - * - * @param {String} flag - * @api private - */ - unknownOption(flag:string):void; - - /** - * Set the program version to `str`. - * - * This method auto-registers the "-V, --version" flag - * which will print the version number when passed. - * - * @param {String} str - * @param {String} flags - * @return {Command} for chaining - * @api public - */ - version(str:string, flags?:string):ICommand; - - /** - * Set the description to `str`. - * - * @param {String} str - * @return {String|Command} - * @api public - */ - description(str:string):ICommand; - description():string; - - /** - * Set an alias for the command - * - * @param {String} alias - * @return {String|Command} - * @api public - */ - alias(alias:string):ICommand; - alias():string; - - /** - * Set / get the command usage `str`. - * - * @param {String} str - * @return {String|Command} - * @api public - */ - usage(str:string):ICommand; - usage():string; - - /** - * Get the name of the command - * - * @param {String} name - * @return {String|Command} - * @api public - */ - name():string; - - /** - * Return the largest option length. - * - * @return {Number} - * @api private - */ - largestOptionLength():number; - - /** - * Return help for options. - * - * @return {String} - * @api private - */ - optionHelp():string; - - /** - * Return command help documentation. - * - * @return {String} - * @api private - */ - commandHelp():string; - - /** - * Return program help documentation. - * - * @return {String} - * @api private - */ - helpInformation():string; - - /** - * Output help information for this command - * - * @api public - */ - outputHelp():void; - - /** - * Output help information and exit. - * - * @api public - */ - help():void; - } - - interface IOptionStatic { - /** - * Initialize a new `Option` with the given `flags` and `description`. - * - * @param {String} flags - * @param {String} description - * @api public - */ - new (flags:string, description?:string):IOption; - } - - interface IOption { - flags:string; - required:boolean; - optional:boolean; - bool:boolean; - short?:string; - long:string; - description:string; - - /** - * Return option name. - * - * @return {String} - * @api private - */ - name():string; - - /** - * Check if `arg` matches the short or long flag. - * - * @param {String} arg - * @return {Boolean} - * @api private - */ - is(arg:string):boolean; - } - - interface IExportedCommand extends ICommand { - Command: commander.ICommandStatic; - Option: commander.IOptionStatic; - [key: string]: any; - } -} diff --git a/comment-json/tslint.json b/comment-json/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/comment-json/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/concat-stream/tslint.json b/concat-stream/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/concat-stream/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/conf/tslint.json b/conf/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/conf/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/configstore/configstore-tests.ts b/configstore/configstore-tests.ts deleted file mode 100644 index 724dbe9a38..0000000000 --- a/configstore/configstore-tests.ts +++ /dev/null @@ -1,18 +0,0 @@ - -import Configstore = require('configstore'); -var cs = new Configstore('foo'); - -var value: any; -var key: string; -var num: number; -var bool: any; -var object: any; - -cs.set(key, value); -value = cs.get(key); -cs.delete(key); - -object = cs.all; -cs.all = object; -num = cs.size; -key = cs.path; diff --git a/configstore/index.d.ts b/configstore/index.d.ts deleted file mode 100644 index 628a4a1d6c..0000000000 --- a/configstore/index.d.ts +++ /dev/null @@ -1,71 +0,0 @@ -// Type definitions for configstore 2.1 -// Project: https://github.com/yeoman/configstore -// Definitions by: ArcticLight -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export = Configstore; - -declare class Configstore { - constructor(packageName: string, defaults?: any, options?: Configstore.ConfigstoreOptions); - - /** - * Get the path to the config file. Can be used to show the user - * where it is, or better, open it for them. - */ - path: string; - - /** - * Get all items as an object or replace the current config with an object. - */ - all: any; - - /** - * Get the item count - */ - size: number; - - /** - * Get an item - * @param key The string key to get - * @return The contents of the config from key $key - */ - get(key: string): any; - - /** - * Set an item - * @param key The string key - * @param val The value to set - */ - set(key: string, val: any): void; - - /** - * Set all key/value pairs declared in $values - * @param values The values object. - */ - set(values: any): void; - - /** - * Determines if a key is present in the config - * @param key The string key to test for - * @return True if the key is present - */ - has(key: string): boolean; - - /** - * Delete an item. - * @param key The key to delete - */ - delete(key: string): void; - - /** - * Clear the config. - * Equivalent to Configstore.all = {}; - */ - clear(): void; - } - -declare namespace Configstore { - export interface ConfigstoreOptions { - globalConfigPath?: boolean; - } -} diff --git a/configstore/tslint.json b/configstore/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/configstore/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/connect-ensure-login/index.d.ts b/connect-ensure-login/index.d.ts deleted file mode 100644 index d542f63a90..0000000000 --- a/connect-ensure-login/index.d.ts +++ /dev/null @@ -1,73 +0,0 @@ -// Type definitions for connect-ensure-login 0.1 -// Project: https://github.com/jaredhanson/connect-ensure-login -// Definitions by: Pavel Puchkov -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -import { RequestHandler } from "express"; - -interface LoggedInOptions { - /** - * URL to redirect to for login, defaults to _/login_ - */ - redirectTo?: string; - /** - * set redirectTo in session, defaults to _true_ - */ - setRedirectTo?: boolean; -} -interface LoggedOutOptions { - /** - * URL to redirect to in logged in, defaults to _/_ - */ - redirectTo?: string; -} - -/** -* Ensure that a user is logged in before proceeding to next route middleware. -* -* This middleware ensures that a user is logged in. If a request is received -* that is unauthenticated, the request will be redirected to a login page (by -* default to `/login`). -* -* Additionally, `returnTo` will be be set in the session to the URL of the -* current request. After authentication, this value can be used to redirect -* the user to the page that was originally requested. -* -* Examples: -* -* app.get('/profile', -* ensureLoggedIn(), -* function(req, res) { ... }); -* -* app.get('/profile', -* ensureLoggedIn('/signin'), -* function(req, res) { ... }); -* -* app.get('/profile', -* ensureLoggedIn({ redirectTo: '/session/new', setReturnTo: false }), -* function(req, res) { ... }); -*/ -export declare function ensureLoggedIn(options?: LoggedInOptions | string): RequestHandler; - -/** -* Ensure that no user is logged in before proceeding to next route middleware. -* -* This middleware ensures that no user is logged in. If a request is received -* that is authenticated, the request will be redirected to another page (by -* default to `/`). -* -* Examples: -* -* app.get('/login', -* ensureLoggedOut(), -* function(req, res) { ... }); -* -* app.get('/login', -* ensureLoggedOut('/home'), -* function(req, res) { ... }); -* -* app.get('/login', -* ensureLoggedOut({ redirectTo: '/home' }), -* function(req, res) { ... }); -*/ -export declare function ensureLoggedOut(options?: LoggedOutOptions | string): RequestHandler; \ No newline at end of file diff --git a/connect-ensure-login/tslint.json b/connect-ensure-login/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/connect-ensure-login/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/content-disposition/index.d.ts b/content-disposition/index.d.ts deleted file mode 100644 index 4d0bbd8d94..0000000000 --- a/content-disposition/index.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -// Type definitions for content-disposition 0.5 -// Project: https://github.com/jshttp/content-disposition -// Definitions by: Stefan Reichel -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare namespace contentDisposition { - export interface ContentDisposition { - type: string; - parameters: any; - } - - export interface Options { - type?: string; - fallback?: string | boolean; - } - - export function parse(contentDispositionHeader: string): ContentDisposition; -} - -declare function contentDisposition(filename?: string, options?: contentDisposition.Options): string; -export = contentDisposition; diff --git a/content-disposition/tslint.json b/content-disposition/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/content-disposition/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/continuation-local-storage/index.d.ts b/continuation-local-storage/index.d.ts deleted file mode 100644 index 131f9c748c..0000000000 --- a/continuation-local-storage/index.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Type definitions for continuation-local-storage v3.2.0 -// Project: https://github.com/othiym23/node-continuation-local-storage -// Definitions by: Jang-Ho Hwang , Kei Son -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -export type Context = any; - -export interface Namespace { - active(): Context; - set(key: string, value: T): T; - get(key: string): any; - run(callback: any): void; - runAndReturn(callback: any): any; - bind(callback: any, context?: Context): any; - bindEmitter(emitter: NodeJS.EventEmitter): any; - createContext(): Context; - name: string; - context: Context; -} -export function createNamespace(name: string): Namespace; -export function getNamespace(name: string): Namespace; -export function destroyNamespace(name: string): void; -export function reset(): void; - -// declare namespace process { -// var namespaces: ContinuationLocalStorage.Namespace[]; -// } diff --git a/continuation-local-storage/tsconfig.json b/continuation-local-storage/tsconfig.json deleted file mode 100644 index b7d515235d..0000000000 --- a/continuation-local-storage/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": false, - "strictNullChecks": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "continuation-local-storage-tests.ts" - ] -} \ No newline at end of file diff --git a/convert-source-map/index.d.ts b/convert-source-map/index.d.ts deleted file mode 100644 index e1577c4070..0000000000 --- a/convert-source-map/index.d.ts +++ /dev/null @@ -1,84 +0,0 @@ -// Type definitions for convert-source-map 1.3 -// Project: https://github.com/thlorenz/convert-source-map -// Definitions by: Andrew Gaspar , Melvin Groenhoff , TeamworkGuy2 -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/** Converts a source-map from/to different formats and allows adding/changing properties. - * (documentation based on project's README file) - */ -export interface SourceMapConverter { - /** The parsed sourcemap object */ - sourcemap: any; - - /** Returns a copy of the underlying source map */ - toObject(): any; - - /** Converts source map to json string. If space is given (optional), this will be passed to JSON.stringify when the JSON string is generated */ - toJSON(space?: string | number): string; - - /** Converts source map to base64 encoded json string */ - toBase64(): string; - - /** Converts source map to an inline comment that can be appended to the source-file. - * By default, the comment is formatted like: //# sourceMappingURL=..., which you would normally see in a JS source file. - * When options.multiline == true, the comment is formatted like: /*# sourceMappingURL=... *\/, which you would find in a CSS source file - */ - toComment(options?: { multiline?: boolean }): string; - - /** Adds given property to the source map. Throws an error if property already exists */ - addProperty(key: string, value: any): SourceMapConverter; - - /** Sets given property to the source map. If property doesn't exist it is added, otherwise its value is updated */ - setProperty(key: string, value: any): SourceMapConverter; - - /** Gets given property of the source map */ - getProperty(key: string): any; -} - - -/** Returns source map converter from given object */ -export function fromObject(obj: any): SourceMapConverter; - -/** Returns source map converter from given json string */ -export function fromJSON(json: string): SourceMapConverter; - -/** Returns source map converter from given base64 encoded json string */ -export function fromBase64(base64: string): SourceMapConverter; - -/** Returns source map converter from given base64 encoded json string prefixed with //# sourceMappingURL=... */ -export function fromComment(comment: string): SourceMapConverter; - -/**Returns source map converter from given filename by parsing //# sourceMappingURL=filename. - * filename must point to a file that is found inside the mapFileDir. Most tools store this file right next to the generated file, i.e. the one containing the source map. - */ -export function fromMapFileComment(comment: string, commentFileDir: string): SourceMapConverter; - -/** Finds last sourcemap comment in file and returns source map converter or returns null if no source map comment was found. - * If largeSource is set to true, an algorithm that does not use regex is applied to find the source map. - * This is faster and especially useful if you're running into "call stack size exceeded" errors with the default algorithm. - * However, it is less accurate and may match content that isn't a source map comment. - */ -export function fromSource(content: string, largeSource?: boolean): SourceMapConverter | null; - -/** Finds last sourcemap comment in file and returns source map converter or returns null if no source map comment was found. - * The sourcemap will be read from the map file found by parsing # sourceMappingURL=file comment. For more info see fromMapFileComment. - */ -export function fromMapFileSource(content: string, commentFileDir: string): SourceMapConverter | null; - -/** Returns src with all source map comments removed */ -export function removeComments(src: string): string; - -/** Returns src with all source map comments pointing to map files removed */ -export function removeMapFileComments(src: string): string; - -/** Returns the regex used to find source map comments */ -export var commentRegex: RegExp; - -/** Returns the regex used to find source map comments pointing to map files */ -export var mapFileCommentRegex: RegExp; - -/** Returns a comment that links to an external source map via file. - * By default, the comment is formatted like: //# sourceMappingURL=..., which you would normally see in a JS source file. - * When options.multiline == true, the comment is formatted like: /*# sourceMappingURL=... *\/, which you would find in a CSS source file. - */ -export function generateMapFileComment(file: string, options?: { multiline?: boolean }): string; \ No newline at end of file diff --git a/convert-source-map/tslint.json b/convert-source-map/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/convert-source-map/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/cookie-signature/tslint.json b/cookie-signature/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/cookie-signature/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/cookie/index.d.ts b/cookie/index.d.ts deleted file mode 100644 index 950796fa22..0000000000 --- a/cookie/index.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -// Type definitions for cookie v0.1.2 -// Project: https://github.com/jshttp/cookie -// Definitions by: Pine Mizune -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -interface CookieSerializeOptions { - encode?: (val: string) => string; - path?: string; - expires?: Date; - maxAge?: number; - domain?: string; - secure?: boolean; - httpOnly?: boolean; -} - -interface CookieParseOptions { - decode?: (val: string) => string; -} - -interface CookieStatic { - serialize(name: string, val: string, options?: CookieSerializeOptions): string; - parse(str: string, options?: CookieParseOptions): { [key: string]: string }; -} - -declare module "cookie" { - var cookie: CookieStatic; - export = cookie; -} diff --git a/cookiejs/index.d.ts b/cookiejs/index.d.ts deleted file mode 100644 index ba7f0ee4f1..0000000000 --- a/cookiejs/index.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -// Type definitions for cookie.js v1.0.0 -// Project: https://github.com/js-coder/cookie.js -// Definitions by: Boltmade -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/** - * Shortcut for cookie.get() - */ - -export = cookie; -export as namespace cookie; - -declare function cookie(key : string, fallback?: string) : string; -declare function cookie(keys : string[], fallback?: string) : string; - -declare namespace cookie { - /** - * Create a cookie. The value will automatically be escaped. - */ - export function set(key : string, value : string, options? : any) : void; - /** - * Set several cookies at once - */ - export function set(obj : any, options? : any) : void; - /** - * Remove cookies - */ - export function remove(key : string) : void; - export function remove(keys : string[]) : void; - export function remove(...args : string[]) : void; - /** - * Remove all cookies - */ - export function empty() : void; - /** - * Retrieve the value of the cookie - */ - export function get(key : string, fallback?: string) : string; - /** - * Retrieve values of several cookies - */ - export function get(keys : string[], fallback?: string) : any; - /** - * Get all currently saved cookies - */ - export function all() : any; - /** - * Test if cookies are enabled - */ - export function enabled() : boolean; -} diff --git a/cookies/index.d.ts b/cookies/index.d.ts deleted file mode 100644 index 390890bb4a..0000000000 --- a/cookies/index.d.ts +++ /dev/null @@ -1,154 +0,0 @@ -// Type definitions for cookies 0.6 -// Project: https://github.com/pillarjs/cookies -// Definitions by: Wang Zishi , jKey Lu -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// -import { IncomingMessage, ServerResponse } from 'http'; -import * as Keygrip from 'keygrip'; - -declare interface Cookies { - secure: boolean; - request: IncomingMessage; - response: ServerResponse; - - /** - * 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?: Cookies.GetOption): 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, opts?: Cookies.SetOption): this; -} - - -declare namespace Cookies { - /** - * for backward-compatibility - */ - export type ICookies = Cookies; - /** - * for backward-compatibility - */ - export type IOptions = SetOption; - - export interface Option { - keys: string[] | Keygrip; - secure?: boolean; - } - - export interface GetOption { - signed: boolean; - } - - export interface SetOption { - /** - * 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; - /** - * "secureProxy" option is deprecated; use "secure" option, provide "secure" to constructor if needed - */ - 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; - } - - export type CookieAttr = SetOption; - - export interface Cookie { - name: string; - value: string; - /** - * "maxage"" is deprecated, use "maxAge" instead - */ - maxage: number; - maxAge: number; - expires: Date; - path: string; - domain: string; - secure: boolean; - httpOnly: boolean; - overwrite: boolean; - - toString(): string; - toHeader(): string; - } -} - -declare interface CookiesFunction { - (request: IncomingMessage, response: ServerResponse, options?: Cookies.Option): Cookies; - /** - * "options" array of key strings is deprecated, provide using options {"keys": keygrip} - */ - // tslint:disable-next-line:unified-signatures - (request: IncomingMessage, response: ServerResponse, options: string[]): Cookies; - /** - * "options" instance of Keygrip is deprecated, provide using options {"keys": keygrip} - */ - // tslint:disable-next-line:unified-signatures - (request: IncomingMessage, response: ServerResponse, options: Keygrip): Cookies; - - new (request: IncomingMessage, response: ServerResponse, options?: Cookies.Option): Cookies; - /** - * "options" array of key strings is deprecated, provide using options {"keys": keygrip} - */ - // tslint:disable-next-line:unified-signatures - new (request: IncomingMessage, response: ServerResponse, options: string[]): Cookies; - /** - * "options" instance of Keygrip is deprecated, provide using options {"keys": keygrip} - */ - // tslint:disable-next-line:unified-signatures - new (request: IncomingMessage, response: ServerResponse, options: Keygrip): Cookies; - - Cookie: { - new (name: string, value?: string, attrs?: Cookies.CookieAttr): Cookies.Cookie; - }; -} - -declare const Cookies: CookiesFunction; - -export = Cookies; diff --git a/cookies/tslint.json b/cookies/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/cookies/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/cordova-plugin-app-version/index.d.ts b/cordova-plugin-app-version/index.d.ts deleted file mode 100644 index e295724474..0000000000 --- a/cordova-plugin-app-version/index.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -// Type definitions for cordova-plugin-app-version v0.1.7 -// Project: https://github.com/whiteoctober/cordova-plugin-app-version -// Definitions by: Markus Wagner -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// -/// - -interface Cordova { - getAppVersion: { - getAppName: () => Q.IPromise & JQueryPromise; - getPackageName: () => Q.IPromise & JQueryPromise; - getVersionCode: () => Q.IPromise & JQueryPromise; - getVersionNumber: () => Q.IPromise & JQueryPromise; - }; -} diff --git a/cordova-plugin-device/cordova-plugin-device-tests.ts b/cordova-plugin-device/cordova-plugin-device-tests.ts deleted file mode 100644 index 450eadb1f0..0000000000 --- a/cordova-plugin-device/cordova-plugin-device-tests.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// - -console.log(JSON.stringify(device)); \ No newline at end of file diff --git a/cordova-plugin-ibeacon/index.d.ts b/cordova-plugin-ibeacon/index.d.ts deleted file mode 100644 index bfbfe607d4..0000000000 --- a/cordova-plugin-ibeacon/index.d.ts +++ /dev/null @@ -1,97 +0,0 @@ -// Type definitions for cordova-plugin-ibeacon v3.3.0 -// Project: https://github.com/petermetz/cordova-plugin-ibeacon -// Definitions by: Markus Wagner -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -interface CordovaPlugins { - locationManager: BeaconPlugin.LocationManager; -} - -declare namespace BeaconPlugin { - /** - * Beacon Plugin. - */ - export interface LocationManager { - delegate: Delegate; - BeaconRegion: BeaconRegion; - Region: Region; - onDomDelegateReady(): Q.Promise; - startMonitoringForRegion(region: Region): Q.Promise; - stopMonitoringForRegion(region: Region): Q.Promise; - requestStateForRegion(region: Region): Q.Promise; - startRangingBeaconsInRegion(region: Region): Q.Promise; - stopRangingBeaconsInRegion(region: Region): Q.Promise; - getAuthorizationStatus(): Q.Promise; - requestWhenInUseAuthorization(): Q.Promise; - requestAlwaysAuthorization(): Q.Promise; - getMonitoredRegions(): Q.Promise; - getRangedRegions(): Q.Promise; - isRangingAvailable(): Q.Promise; - isMonitoringAvailableForClass(region: Region): Q.Promise; - startAdvertising(region: Region, measuredPower: boolean): Q.Promise; - stopAdvertising(): Q.Promise; - isAdvertisingAvailable(): Q.Promise; - isAdvertising(): Q.Promise; - disableDebugLogs(): Q.Promise; - enableDebugNotifications(): Q.Promise; - disableDebugNotifications(): Q.Promise; - enableDebugLogs(): Q.Promise; - isBluetoothEnabled(): Q.Promise; - enableBluetooth(): Q.Promise; - disableBluetooth(): Q.Promise; - appendToDeviceLog(message: string): Q.Promise; - } - - export interface PluginResult { - eventType: string; - region: Region; - beacons: Beacon[]; - authorizationStatus: string; - state: string; - error: string; - } - - export interface Delegate { - didDetermineStateForRegion(pluginResult: PluginResult): void; - didStartMonitoringForRegion(pluginResult: PluginResult): void; - didExitRegion(pluginResult: PluginResult): void; - didEnterRegion(pluginResult: PluginResult): void; - didRangeBeaconsInRegion(pluginResult: PluginResult): void; - peripheralManagerDidStartAdvertising(pluginResult: PluginResult): void; - peripheralManagerDidUpdateState(pluginResult: PluginResult): void; - didChangeAuthorizationStatus(authorizationStatus: string): void; - monitoringDidFailForRegionWithError(pluginResult: PluginResult): void; - } - - export interface Region { - identifier: string; - new (identifier: string): Region; - } - - export interface BeaconRegion extends Region { - uuid: string; - major: string; - minor: string; - notifyEntryStateOnDisplay: boolean; - new (identifier: string, uuid: string, major?: number, minor?: number, notifyEntryStateOnDisplay?: boolean): BeaconRegion; - } - - export interface CircularRegion extends Region { - latitude: number; - longitude: number; - radius: number; - new (identifier: string, latitude: number, longitude: number, radius: number): CircularRegion; - } - - export interface Beacon { - uuid: string; - major: string; - minor: string; - proximity: string; - tx: number; - rssi: number; - accuracy: number; - } -} diff --git a/cordova-plugin-ibeacon/tsconfig.json b/cordova-plugin-ibeacon/tsconfig.json deleted file mode 100644 index 603b991c64..0000000000 --- a/cordova-plugin-ibeacon/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": false, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "cordova-plugin-ibeacon-tests.ts" - ] -} \ No newline at end of file diff --git a/cordova-plugin-splashscreen/cordova-plugin-splashscreen-tests.ts b/cordova-plugin-splashscreen/cordova-plugin-splashscreen-tests.ts deleted file mode 100644 index d24720eb1d..0000000000 --- a/cordova-plugin-splashscreen/cordova-plugin-splashscreen-tests.ts +++ /dev/null @@ -1,4 +0,0 @@ -/// - -navigator.splashscreen.show(); -navigator.splashscreen.hide(); \ No newline at end of file diff --git a/cordova-sqlite-storage/index.d.ts b/cordova-sqlite-storage/index.d.ts deleted file mode 100644 index 76e3aac5a3..0000000000 --- a/cordova-sqlite-storage/index.d.ts +++ /dev/null @@ -1,68 +0,0 @@ -// Type definitions for cordova-sqlite-storage 1.5 -// Project: https://github.com/litehelpers/Cordova-sqlite-storage -// Definitions by: rafw87 -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -interface Window { - sqlitePlugin: SQLitePlugin.SQLite; -} - -declare var sqlitePlugin: SQLitePlugin.SQLite; - -declare namespace SQLitePlugin { - type TransactionFunction = (tx: Transaction) => void; - - type SuccessCallback = () => void; - type DatabaseSuccessCallback = (db: Database) => void; - type StatementSuccessCallback = (results: Results) => void; - type TransactionStatementSuccessCallback = (tx: Transaction, results: Results) => void; - - type ErrorCallback = (err: Error) => void; - type TransactionStatementErrorCallback = (tx: Transaction, err: Error) => boolean | void; - - interface OpenArgs { - name: string; - location?: string; - iosDatabaseLocation?: string; - androidDatabaseImplementation?: number; - androidLockWorkaround?: number; - createFromLocation?: number; - [key: string]: any; - } - interface DeleteArgs { - name: string; - location?: string; - iosDatabaseLocation?: string; - } - - interface Results { - rowsAffected: number; - insertId?: number; - rows: { - length: number; - item(i: number): any; - }; - } - - interface Transaction { - executeSql(statement: string, params?: any[], success?: TransactionStatementSuccessCallback, error?: TransactionStatementErrorCallback): void; - } - - interface Database { - transaction(fn: TransactionFunction, error?: ErrorCallback, success?: SuccessCallback): void; - readTransaction(fn: TransactionFunction, error?: ErrorCallback, success?: SuccessCallback): void; - - executeSql(statement: string, params?: any[], success?: StatementSuccessCallback, error?: ErrorCallback): void; - sqlBatch(sqlStatements: Array, success?: SuccessCallback, error?: ErrorCallback): void; - - close(success?: SuccessCallback, error?: ErrorCallback): void; - } - - interface SQLite { - openDatabase(args: OpenArgs, success?: DatabaseSuccessCallback, error?: ErrorCallback): Database; - deleteDatabase(args: DeleteArgs, success?: SuccessCallback, error?: ErrorCallback): void; - selfTest(success?: SuccessCallback, error?: ErrorCallback): void; - echoTest(ok?: (value: string) => void, error?: (msg: string) => void): void; - } -} - diff --git a/cordova-sqlite-storage/tslint.json b/cordova-sqlite-storage/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/cordova-sqlite-storage/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/core-decorators/index.d.ts b/core-decorators/index.d.ts deleted file mode 100644 index d0a51009eb..0000000000 --- a/core-decorators/index.d.ts +++ /dev/null @@ -1,135 +0,0 @@ -// Type definitions for core-decorators.js 0.10 -// Project: https://github.com/jayphelps/core-decorators.js -// Definitions by: Qubo -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 - -export interface ClassDecorator { - (target: TFunction): TFunction | void; -} - -export interface ParameterDecorator { - (target: Object, propertyKey: string | symbol, parameterIndex: number): void; -} - -export interface PropertyDecorator { - (target: Object, propertyKey: string | symbol): void; -} - -export interface MethodDecorator { - (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor | void; -} - -export interface PropertyOrMethodDecorator extends MethodDecorator, PropertyDecorator { - (target: Object, propertyKey: string | symbol): void; -} - -export interface Deprecate extends MethodDecorator { - (message?: string, option?: DeprecateOption): MethodDecorator; -} - -export interface DeprecateOption { - url: string; -} - -export interface ThrottleOptions { - /** allows to trigger function on the leading. */ - leading?: boolean; - /** allows to trigger function on the trailing edge of the wait interval. */ - trailing?: boolean; -} - -export interface Console { - log(message?: any, ...optionalParams: any[]): void; - time(timerName?: string): void; - timeEnd(timerName?: string): void; -} - -/** - * Forces invocations of this function to always have this refer to the class instance, - * even if the function is passed around or would otherwise lose its this context. e.g. var fn = context.method; - */ -declare var autobind: Function; -/** - * Marks a property or method as not being writable. - */ -declare var readonly: PropertyOrMethodDecorator; -/** - * Checks that the marked method indeed overrides a function with the same signature somewhere on the prototype chain. - */ -declare var override: MethodDecorator; -/** - * Calls console.warn() with a deprecation message. Provide a custom message to override the default one. You can also provide an options hash with a url, for further reading. - */ -declare var deprecate: Deprecate; -/** - * Calls console.warn() with a deprecation message. Provide a custom message to override the default one. You can also provide an options hash with a url, for further reading. - */ -declare var deprecated: Deprecate; -/** - * Creates a new debounced function which will be invoked after wait milliseconds since the time it was invoked. Default timeout is 300 ms. - */ -declare var debounce: (wait: number) => MethodDecorator; -/** - * Creates a new throttled function which will be invoked in every wait milliseconds. Default timeout is 300 ms. - */ -declare var throttle: (wait: number, options?: ThrottleOptions) => MethodDecorator; -/** - * Suppresses any JavaScript console.warn() call while the decorated function is called. (i.e. on the stack) - */ -declare var suppressWarnings: MethodDecorator; -/** - * Marks a property or method as not being enumerable. - */ -declare var nonenumerable: PropertyOrMethodDecorator; -/** - * Marks a property or method as not being writable. - */ -declare var nonconfigurable: PropertyOrMethodDecorator; -/** - * Initial implementation included, likely slow. WIP. - */ -declare var memoize: MethodDecorator; -/** - * Immediately applies the provided function and arguments to the method, allowing you to wrap methods with arbitrary helpers like those provided by lodash. - * The first argument is the function to apply, all further arguments will be passed to that decorating function. - */ -declare var decorate: (func: Function, ...args: any[]) => MethodDecorator; -/** - * Prevents a property initializer from running until the decorated property is actually looked up. - * Useful to prevent excess allocations that might otherwise not be used, but be careful not to over-optimize things. - */ -declare var lazyInitialize: PropertyDecorator; -/** - * Mixes in all property descriptors from the provided Plain Old JavaScript Objects (aka POJOs) as arguments. - * Mixins are applied in the order they are passed, but do not override descriptors already on the class, including those inherited traditionally. - */ -declare var mixin: (...mixins: any[]) => ClassDecorator; -/** - * Mixes in all property descriptors from the provided Plain Old JavaScript Objects (aka POJOs) as arguments. - * Mixins are applied in the order they are passed, but do not override descriptors already on the class, including those inherited traditionally. - */ -declare var mixins: (...mixins: any[]) => ClassDecorator; -/** - * Uses console.time and console.timeEnd to provide function timings with a unique label whose default prefix is ClassName.method. Supply a first argument to override the prefix: - */ -declare var time: (label: string, console?: Console) => MethodDecorator; - -export { -autobind, -readonly, -override, -deprecate, -deprecated, -debounce, -throttle, -suppressWarnings, -nonenumerable, -nonconfigurable, -memoize, -decorate, -lazyInitialize, -mixin, -mixins, -time, -}; diff --git a/core-decorators/tslint.json b/core-decorators/tslint.json deleted file mode 100644 index 0332a8383e..0000000000 --- a/core-decorators/tslint.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../tslint.json", - "rules": { - "callable-types": false, - "forbidden-types": false - } -} diff --git a/core-js/index.d.ts b/core-js/index.d.ts deleted file mode 100644 index a0a10708d9..0000000000 --- a/core-js/index.d.ts +++ /dev/null @@ -1,3070 +0,0 @@ -// Type definitions for core-js v0.9.7 -// Project: https://github.com/zloirock/core-js/ -// Definitions by: Ron Buckton -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/* ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - -declare type PropertyKey = string | number | symbol; - -// ############################################################################################# -// ECMAScript 6: Object & Function -// Modules: es6.object.assign, es6.object.is, es6.object.set-prototype-of, -// es6.object.to-string, es6.function.name and es6.function.has-instance. -// ############################################################################################# - -interface ObjectConstructor { - /** - * Copy the values of all of the enumerable own properties from one or more source objects to a - * target object. Returns the target object. - * @param target The target object to copy to. - * @param source The source object from which to copy properties. - */ - assign(target: T, source: U): T & U; - - /** - * Copy the values of all of the enumerable own properties from one or more source objects to a - * target object. Returns the target object. - * @param target The target object to copy to. - * @param source1 The first source object from which to copy properties. - * @param source2 The second source object from which to copy properties. - */ - assign(target: T, source1: U, source2: V): T & U & V; - - /** - * Copy the values of all of the enumerable own properties from one or more source objects to a - * target object. Returns the target object. - * @param target The target object to copy to. - * @param source1 The first source object from which to copy properties. - * @param source2 The second source object from which to copy properties. - * @param source3 The third source object from which to copy properties. - */ - assign(target: T, source1: U, source2: V, source3: W): T & U & V & W; - - /** - * Copy the values of all of the enumerable own properties from one or more source objects to a - * target object. Returns the target object. - * @param target The target object to copy to. - * @param sources One or more source objects from which to copy properties - */ - assign(target: any, ...sources: any[]): any; - - /** - * Returns true if the values are the same value, false otherwise. - * @param value1 The first value. - * @param value2 The second value. - */ - is(value1: any, value2: any): boolean; - - /** - * Sets the prototype of a specified object o to object proto or null. Returns the object o. - * @param o The object to change its prototype. - * @param proto The value of the new prototype or null. - * @remarks Requires `__proto__` support. - */ - setPrototypeOf(o: any, proto: any): any; -} - -interface Function { - /** - * Returns the name of the function. Function names are read-only and can not be changed. - */ - name: string; - - /** - * Determines if a constructor object recognizes an object as one of the - * constructor’s instances. - * @param value The object to test. - */ - [Symbol.hasInstance](value: any): boolean; -} - -// ############################################################################################# -// ECMAScript 6: Array -// Modules: es6.array.from, es6.array.of, es6.array.copy-within, es6.array.fill, es6.array.find, -// and es6.array.find-index -// ############################################################################################# - -interface Array { - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: T, index: number, obj: Array) => boolean, thisArg?: any): T; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: T) => boolean, thisArg?: any): number; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: T, start?: number, end?: number): T[]; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): T[]; - - [Symbol.unscopables]: any; -} - -interface ArrayConstructor { - /** - * Creates an array from an array-like object. - * @param arrayLike An array-like object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): Array; - - /** - * Creates an array from an iterable object. - * @param iterable An iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(iterable: Iterable, mapfn: (v: T, k: number) => U, thisArg?: any): Array; - - /** - * Creates an array from an array-like object. - * @param arrayLike An array-like object to convert to an array. - */ - from(arrayLike: ArrayLike): Array; - - /** - * Creates an array from an iterable object. - * @param iterable An iterable object to convert to an array. - */ - from(iterable: Iterable): Array; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: T[]): Array; -} - -// ############################################################################################# -// ECMAScript 6: String & RegExp -// Modules: es6.string.from-code-point, es6.string.raw, es6.string.code-point-at, -// es6.string.ends-with, es6.string.includes, es6.string.repeat, -// es6.string.starts-with, and es6.regexp -// ############################################################################################# - -interface String { - /** - * Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point - * value of the UTF-16 encoded code point starting at the string element at position pos in - * the String resulting from converting this object to a String. - * If there is no element at that position, the result is undefined. - * If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos. - */ - codePointAt(pos: number): number; - - /** - * Returns true if searchString appears as a substring of the result of converting this - * object to a String, at one or more positions that are - * greater than or equal to position; otherwise, returns false. - * @param searchString search string - * @param position If position is undefined, 0 is assumed, so as to search all of the String. - */ - includes(searchString: string, position?: number): boolean; - - /** - * Returns true if the sequence of elements of searchString converted to a String is the - * same as the corresponding elements of this object (converted to a String) starting at - * endPosition – length(this). Otherwise returns false. - */ - endsWith(searchString: string, endPosition?: number): boolean; - - /** - * Returns a String value that is made from count copies appended together. If count is 0, - * T is the empty String is returned. - * @param count number of copies to append - */ - repeat(count: number): string; - - /** - * Returns true if the sequence of elements of searchString converted to a String is the - * same as the corresponding elements of this object (converted to a String) starting at - * position. Otherwise returns false. - */ - startsWith(searchString: string, position?: number): boolean; -} - -interface StringConstructor { - /** - * Return the String value whose elements are, in order, the elements in the List elements. - * If length is 0, the empty string is returned. - */ - fromCodePoint(...codePoints: number[]): string; - - /** - * String.raw is intended for use as a tag function of a Tagged Template String. When called - * as such the first argument will be a well formed template call site object and the rest - * parameter will contain the substitution values. - * @param template A well-formed template string call site representation. - * @param substitutions A set of substitution values. - */ - raw(template: TemplateStringsArray, ...substitutions: any[]): string; -} - -interface RegExp { - /** - * Returns a string indicating the flags of the regular expression in question. This field is read-only. - * The characters in this string are sequenced and concatenated in the following order: - * - * - "g" for global - * - "i" for ignoreCase - * - "m" for multiline - * - "u" for unicode - * - "y" for sticky - * - * If no flags are set, the value is the empty string. - */ - flags: string; -} - -// ############################################################################################# -// ECMAScript 6: Number & Math -// Modules: es6.number.constructor, es6.number.statics, and es6.math -// ############################################################################################# - -interface NumberConstructor { - /** - * The value of Number.EPSILON is the difference between 1 and the smallest value greater than 1 - * that is representable as a Number value, which is approximately: - * 2.2204460492503130808472633361816 x 10‍−‍16. - */ - EPSILON: number; - - /** - * Returns true if passed value is finite. - * Unlike the global isFininte, Number.isFinite doesn't forcibly convert the parameter to a - * number. Only finite values of the type number, result in true. - * @param number A numeric value. - */ - isFinite(number: number): boolean; - - /** - * Returns true if the value passed is an integer, false otherwise. - * @param number A numeric value. - */ - isInteger(number: number): boolean; - - /** - * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a - * number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter - * to a number. Only values of the type number, that are also NaN, result in true. - * @param number A numeric value. - */ - isNaN(number: number): boolean; - - /** - * Returns true if the value passed is a safe integer. - * @param number A numeric value. - */ - isSafeInteger(number: number): boolean; - - /** - * The value of the largest integer n such that n and n + 1 are both exactly representable as - * a Number value. - * The value of Number.MIN_SAFE_INTEGER is 9007199254740991 2^53 − 1. - */ - MAX_SAFE_INTEGER: number; - - /** - * The value of the smallest integer n such that n and n − 1 are both exactly representable as - * a Number value. - * The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)). - */ - MIN_SAFE_INTEGER: number; - - /** - * Converts a string to a floating-point number. - * @param string A string that contains a floating-point number. - */ - parseFloat(string: string): number; - - /** - * Converts A string to an integer. - * @param s A string to convert into a number. - * @param radix A value between 2 and 36 that specifies the base of the number in numString. - * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. - * All other strings are considered decimal. - */ - parseInt(string: string, radix?: number): number; -} - -interface Math { - /** - * Returns the number of leading zero bits in the 32-bit binary representation of a number. - * @param x A numeric expression. - */ - clz32(x: number): number; - - /** - * Returns the result of 32-bit multiplication of two numbers. - * @param x First number - * @param y Second number - */ - imul(x: number, y: number): number; - - /** - * Returns the sign of the x, indicating whether x is positive, negative or zero. - * @param x The numeric expression to test - */ - sign(x: number): number; - - /** - * Returns the base 10 logarithm of a number. - * @param x A numeric expression. - */ - log10(x: number): number; - - /** - * Returns the base 2 logarithm of a number. - * @param x A numeric expression. - */ - log2(x: number): number; - - /** - * Returns the natural logarithm of 1 + x. - * @param x A numeric expression. - */ - log1p(x: number): number; - - /** - * Returns the result of (e^x - 1) of x (e raised to the power of x, where e is the base of - * the natural logarithms). - * @param x A numeric expression. - */ - expm1(x: number): number; - - /** - * Returns the hyperbolic cosine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - cosh(x: number): number; - - /** - * Returns the hyperbolic sine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - sinh(x: number): number; - - /** - * Returns the hyperbolic tangent of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - tanh(x: number): number; - - /** - * Returns the inverse hyperbolic cosine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - acosh(x: number): number; - - /** - * Returns the inverse hyperbolic sine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - asinh(x: number): number; - - /** - * Returns the inverse hyperbolic tangent of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - atanh(x: number): number; - - /** - * Returns the square root of the sum of squares of its arguments. - * @param values Values to compute the square root for. - * If no arguments are passed, the result is +0. - * If there is only one argument, the result is the absolute value. - * If any argument is +Infinity or -Infinity, the result is +Infinity. - * If any argument is NaN, the result is NaN. - * If all arguments are either +0 or −0, the result is +0. - */ - hypot(...values: number[]): number; - - /** - * Returns the integral part of the a numeric expression, x, removing any fractional digits. - * If x is already an integer, the result is x. - * @param x A numeric expression. - */ - trunc(x: number): number; - - /** - * Returns the nearest single precision float representation of a number. - * @param x A numeric expression. - */ - fround(x: number): number; - - /** - * Returns an implementation-dependent approximation to the cube root of number. - * @param x A numeric expression. - */ - cbrt(x: number): number; -} - -// ############################################################################################# -// ECMAScript 6: Symbols -// Modules: es6.symbol -// ############################################################################################# - -interface Symbol { - /** Returns a string representation of an object. */ - toString(): string; - - [Symbol.toStringTag]: string; -} - -interface SymbolConstructor { - /** - * A reference to the prototype. - */ - prototype: Symbol; - - /** - * Returns a new unique Symbol value. - * @param description Description of the new Symbol object. - */ - (description?: string|number): symbol; - - /** - * Returns a Symbol object from the global symbol registry matching the given key if found. - * Otherwise, returns a new symbol with this key. - * @param key key to search for. - */ - for(key: string): symbol; - - /** - * Returns a key from the global symbol registry matching the given Symbol if found. - * Otherwise, returns a undefined. - * @param sym Symbol to find the key for. - */ - keyFor(sym: symbol): string; - - // Well-known Symbols - - /** - * A method that determines if a constructor object recognizes an object as one of the - * constructor’s instances. Called by the semantics of the instanceof operator. - */ - hasInstance: symbol; - - /** - * A Boolean value that if true indicates that an object should flatten to its array elements - * by Array.prototype.concat. - */ - isConcatSpreadable: symbol; - - /** - * A method that returns the default iterator for an object. Called by the semantics of the - * for-of statement. - */ - iterator: symbol; - - /** - * A regular expression method that matches the regular expression against a string. Called - * by the String.prototype.match method. - */ - match: symbol; - - /** - * A regular expression method that replaces matched substrings of a string. Called by the - * String.prototype.replace method. - */ - replace: symbol; - - /** - * A regular expression method that returns the index within a string that matches the - * regular expression. Called by the String.prototype.search method. - */ - search: symbol; - - /** - * A function valued property that is the constructor function that is used to create - * derived objects. - */ - species: symbol; - - /** - * A regular expression method that splits a string at the indices that match the regular - * expression. Called by the String.prototype.split method. - */ - split: symbol; - - /** - * A method that converts an object to a corresponding primitive value.Called by the ToPrimitive - * abstract operation. - */ - toPrimitive: symbol; - - /** - * A String value that is used in the creation of the default string description of an object. - * Called by the built-in method Object.prototype.toString. - */ - toStringTag: symbol; - - /** - * An Object whose own property names are property names that are excluded from the with - * environment bindings of the associated objects. - */ - unscopables: symbol; - - /** - * Non-standard. Use simple mode for core-js symbols. See https://github.com/zloirock/core-js/#caveats-when-using-symbol-polyfill - */ - useSimple(): void; - - /** - * Non-standard. Use setter mode for core-js symbols. See https://github.com/zloirock/core-js/#caveats-when-using-symbol-polyfill - */ - userSetter(): void; -} - -declare var Symbol: SymbolConstructor; - -interface Object { - /** - * Determines whether an object has a property with the specified name. - * @param v A property name. - */ - hasOwnProperty(v: PropertyKey): boolean; - - /** - * Determines whether a specified property is enumerable. - * @param v A property name. - */ - propertyIsEnumerable(v: PropertyKey): boolean; -} - -interface ObjectConstructor { - /** - * Returns an array of all symbol properties found directly on object o. - * @param o Object to retrieve the symbols from. - */ - getOwnPropertySymbols(o: any): symbol[]; - - /** - * Gets the own property descriptor of the specified object. - * An own property descriptor is one that is defined directly on the object and is not - * inherited from the object's prototype. - * @param o Object that contains the property. - * @param p Name of the property. - */ - getOwnPropertyDescriptor(o: any, propertyKey: PropertyKey): PropertyDescriptor; - - /** - * Adds a property to an object, or modifies attributes of an existing property. - * @param o Object on which to add or modify the property. This can be a native JavaScript - * object (that is, a user-defined object or a built in object) or a DOM object. - * @param p The property name. - * @param attributes Descriptor for the property. It can be for a data property or an accessor - * property. - */ - defineProperty(o: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): any; -} - -interface Math { - [Symbol.toStringTag]: string; -} - -interface JSON { - [Symbol.toStringTag]: string; -} - -// ############################################################################################# -// ECMAScript 6: Collections -// Modules: es6.map, es6.set, es6.weak-map, and es6.weak-set -// ############################################################################################# - -interface Map { - clear(): void; - delete(key: K): boolean; - forEach(callbackfn: (value: V, index: K, map: Map) => void, thisArg?: any): void; - get(key: K): V; - has(key: K): boolean; - set(key: K, value?: V): Map; - size: number; -} - -interface MapConstructor { - new (): Map; - new (iterable: Iterable<[K, V]>): Map; - prototype: Map; -} - -declare var Map: MapConstructor; - -interface Set { - add(value: T): Set; - clear(): void; - delete(value: T): boolean; - forEach(callbackfn: (value: T, index: T, set: Set) => void, thisArg?: any): void; - has(value: T): boolean; - size: number; -} - -interface SetConstructor { - new (): Set; - new (iterable: Iterable): Set; - prototype: Set; -} - -declare var Set: SetConstructor; - -interface WeakMap { - delete(key: K): boolean; - get(key: K): V; - has(key: K): boolean; - set(key: K, value?: V): WeakMap; -} - -interface WeakMapConstructor { - new (): WeakMap; - new (iterable: Iterable<[K, V]>): WeakMap; - prototype: WeakMap; -} - -declare var WeakMap: WeakMapConstructor; - -interface WeakSet { - add(value: T): WeakSet; - delete(value: T): boolean; - has(value: T): boolean; -} - -interface WeakSetConstructor { - new (): WeakSet; - new (iterable: Iterable): WeakSet; - prototype: WeakSet; -} - -declare var WeakSet: WeakSetConstructor; - -// ############################################################################################# -// ECMAScript 6: Iterators -// Modules: es6.string.iterator, es6.array.iterator, es6.map, es6.set, web.dom.iterable -// ############################################################################################# - -interface IteratorResult { - done: boolean; - value?: T; -} - -interface Iterator { - next(value?: any): IteratorResult; - return?(value?: any): IteratorResult; - throw?(e?: any): IteratorResult; -} - -interface Iterable { - [Symbol.iterator](): Iterator; -} - -interface IterableIterator extends Iterator { - [Symbol.iterator](): IterableIterator; -} - -interface String { - /** Iterator */ - [Symbol.iterator](): IterableIterator; -} - -interface Array { - /** Iterator */ - [Symbol.iterator](): IterableIterator; - - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, T]>; - - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface Map { - entries(): IterableIterator<[K, V]>; - keys(): IterableIterator; - values(): IterableIterator; - [Symbol.iterator](): IterableIterator<[K, V]>; -} - -interface Set { - entries(): IterableIterator<[T, T]>; - keys(): IterableIterator; - values(): IterableIterator; - [Symbol.iterator](): IterableIterator; -} - -interface NodeList { - [Symbol.iterator](): IterableIterator; -} - -interface $for extends IterableIterator { - of(callbackfn: (value: T, key: any) => void, thisArg?: any): void; - array(): T[]; - array(callbackfn: (value: T, key: any) => U, thisArg?: any): U[]; - filter(callbackfn: (value: T, key: any) => boolean, thisArg?: any): $for; - map(callbackfn: (value: T, key: any) => U, thisArg?: any): $for; -} - -declare function $for(iterable: Iterable): $for; - -// ############################################################################################# -// ECMAScript 6: Promises -// Modules: es6.promise -// ############################################################################################# - -interface PromiseLike { - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): PromiseLike; - then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => void): PromiseLike; -} - -/** - * Represents the completion of an asynchronous operation - */ -interface Promise { - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; - then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => void): Promise; - - /** - * Attaches a callback for only the rejection of the Promise. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of the callback. - */ - catch(onrejected?: (reason: any) => T | PromiseLike): Promise; - catch(onrejected?: (reason: any) => void): Promise; -} - -interface PromiseConstructor { - /** - * A reference to the prototype. - */ - prototype: Promise; - - /** - * Creates a new Promise. - * @param executor A callback used to initialize the promise. This callback is passed two arguments: - * a resolve callback used resolve the promise with a value or the result of another promise, - * and a reject callback used to reject the promise with a provided reason or error. - */ - new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike]): Promise<[T1, T2, T3, T4, T5]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike ]): Promise<[T1, T2, T3, T4]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>; - all(values: Iterable>): Promise; - - /** - * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved - * or rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - race(values: Iterable>): Promise; - - /** - * Creates a new rejected promise for the provided reason. - * @param reason The reason the promise was rejected. - * @returns A new rejected Promise. - */ - reject(reason: any): Promise; - - /** - * Creates a new rejected promise for the provided reason. - * @param reason The reason the promise was rejected. - * @returns A new rejected Promise. - */ - reject(reason: any): Promise; - - /** - * Creates a new resolved promise for the provided value. - * @param value A promise. - * @returns A promise whose internal state matches the provided promise. - */ - resolve(value: T | PromiseLike): Promise; - - /** - * Creates a new resolved promise . - * @returns A resolved promise. - */ - resolve(): Promise; -} - -declare var Promise: PromiseConstructor; - -// ############################################################################################# -// ECMAScript 6: Reflect -// Modules: es6.reflect -// ############################################################################################# - -declare namespace Reflect { - function apply(target: Function, thisArgument: any, argumentsList: ArrayLike): any; - function construct(target: Function, argumentsList: ArrayLike, newTarget?: any): any; - function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean; - function deleteProperty(target: any, propertyKey: PropertyKey): boolean; - function enumerate(target: any): IterableIterator; - function get(target: any, propertyKey: PropertyKey, receiver?: any): any; - function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor; - function getPrototypeOf(target: any): any; - function has(target: any, propertyKey: PropertyKey): boolean; - function isExtensible(target: any): boolean; - function ownKeys(target: any): Array; - function preventExtensions(target: any): boolean; - function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean; - function setPrototypeOf(target: any, proto: any): boolean; -} - -// ############################################################################################# -// ECMAScript 7 -// Modules: es7.array.includes, es7.string.at, es7.string.pad-start, es7.string.pad-end, -// es7.object.to-array, es7.object.get-own-property-descriptors, es7.regexp.escape, -// es7.map.to-json, and es7.set.to-json -// ############################################################################################# - -interface Array { - includes(value: T, fromIndex?: number): boolean; -} - -interface String { - at(index: number): string; - padStart(length: number, fillStr?: string): string; - padEnd(length: number, fillStr?: string): string; -} - -interface ObjectConstructor { - values(object: any): any[]; - entries(object: any): [string, any][]; - getOwnPropertyDescriptors(object: any): PropertyDescriptorMap; -} - -interface RegExpConstructor { - escape(str: string): string; -} - -interface Map { - toJSON(): any; -} - -interface Set { - toJSON(): any; -} - -// ############################################################################################# -// Mozilla JavaScript: Array generics -// Modules: js.array.statics -// ############################################################################################# - -interface ArrayConstructor { - /** - * Appends new elements to an array, and returns the new length of the array. - * @param items New elements of the Array. - */ - push(array: ArrayLike, ...items: T[]): number; - /** - * Removes the last element from an array and returns it. - */ - pop(array: ArrayLike): T; - /** - * Combines two or more arrays. - * @param items Additional items to add to the end of array1. - */ - concat(array: ArrayLike, ...items: (T[]| T)[]): T[]; - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. - */ - join(array: ArrayLike, separator?: string): string; - /** - * Reverses the elements in an Array. - */ - reverse(array: ArrayLike): T[]; - /** - * Removes the first element from an array and returns it. - */ - shift(array: ArrayLike): T; - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(array: ArrayLike, start?: number, end?: number): T[]; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(array: ArrayLike, compareFn?: (a: T, b: T) => number): T[]; - - /** - * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. - * @param start The zero-based location in the array from which to start removing elements. - */ - splice(array: ArrayLike, start: number): T[]; - - /** - * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. - * @param start The zero-based location in the array from which to start removing elements. - * @param deleteCount The number of elements to remove. - * @param items Elements to insert into the array in place of the deleted elements. - */ - splice(array: ArrayLike, start: number, deleteCount: number, ...items: T[]): T[]; - - /** - * Inserts new elements at the start of an array. - * @param items Elements to insert at the start of the Array. - */ - unshift(array: ArrayLike, ...items: T[]): number; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. - */ - indexOf(array: ArrayLike, searchElement: T, fromIndex?: number): number; - - /** - * Returns the index of the last occurrence of a specified value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array. - */ - lastIndexOf(array: ArrayLike, earchElement: T, fromIndex?: number): number; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - every(array: ArrayLike, callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - some(array: ArrayLike, callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - forEach(array: ArrayLike, callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void; - - /** - * Calls a defined callback function on each element of an array, and returns an array that contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - map(array: ArrayLike, callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - filter(array: ArrayLike, callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): T[]; - - /** - * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduce(array: ArrayLike, callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduce(array: ArrayLike, callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduceRight(array: ArrayLike, callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduceRight(array: ArrayLike, callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; - - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(array: ArrayLike): IterableIterator<[number, T]>; - - /** - * Returns an list of keys in the array - */ - keys(array: ArrayLike): IterableIterator; - - /** - * Returns an list of values in the array - */ - values(array: ArrayLike): IterableIterator; - - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(array: ArrayLike, predicate: (value: T, index: number, obj: Array) => boolean, thisArg?: any): T; - - /** - * Returns the index of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(array: ArrayLike, predicate: (value: T) => boolean, thisArg?: any): number; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(array: ArrayLike, value: T, start?: number, end?: number): T[]; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(array: ArrayLike, target: number, start: number, end?: number): T[]; - - includes(array: ArrayLike, value: T, fromIndex?: number): boolean; - turn(array: ArrayLike, callbackfn: (memo: U, value: T, index: number, array: Array) => void, memo?: U): U; - turn(array: ArrayLike, callbackfn: (memo: Array, value: T, index: number, array: Array) => void, memo?: Array): Array; -} - -// ############################################################################################# -// Object - https://github.com/zloirock/core-js/#object -// Modules: core.object -// ############################################################################################# - -interface ObjectConstructor { - /** - * Non-standard. - */ - isObject(value: any): boolean; - - /** - * Non-standard. - */ - classof(value: any): string; - - /** - * Non-standard. - */ - define(target: T, mixin: any): T; - - /** - * Non-standard. - */ - make(proto: T, mixin?: any): T; -} - -// ############################################################################################# -// Console - https://github.com/zloirock/core-js/#console -// Modules: core.log -// ############################################################################################# - -interface Log extends Console { - (message?: any, ...optionalParams: any[]): void; - enable(): void; - disable(): void; -} - -/** - * Non-standard. - */ -declare var log: Log; - -// ############################################################################################# -// Dict - https://github.com/zloirock/core-js/#dict -// Modules: core.dict -// ############################################################################################# - -interface Dict { - [key: string]: T; - [key: number]: T; - //[key: symbol]: T; -} - -interface DictConstructor { - prototype: Dict; - - new (value?: Dict): Dict; - new (value?: any): Dict; - (value?: Dict): Dict; - (value?: any): Dict; - - isDict(value: any): boolean; - values(object: Dict): IterableIterator; - keys(object: Dict): IterableIterator; - entries(object: Dict): IterableIterator<[PropertyKey, T]>; - has(object: Dict, key: PropertyKey): boolean; - get(object: Dict, key: PropertyKey): T; - set(object: Dict, key: PropertyKey, value: T): Dict; - forEach(object: Dict, callbackfn: (value: T, key: PropertyKey, dict: Dict) => void, thisArg?: any): void; - map(object: Dict, callbackfn: (value: T, key: PropertyKey, dict: Dict) => U, thisArg?: any): Dict; - mapPairs(object: Dict, callbackfn: (value: T, key: PropertyKey, dict: Dict) => [PropertyKey, U], thisArg?: any): Dict; - filter(object: Dict, callbackfn: (value: T, key: PropertyKey, dict: Dict) => boolean, thisArg?: any): Dict; - some(object: Dict, callbackfn: (value: T, key: PropertyKey, dict: Dict) => boolean, thisArg?: any): boolean; - every(object: Dict, callbackfn: (value: T, key: PropertyKey, dict: Dict) => boolean, thisArg?: any): boolean; - find(object: Dict, callbackfn: (value: T, key: PropertyKey, dict: Dict) => boolean, thisArg?: any): T; - findKey(object: Dict, callbackfn: (value: T, key: PropertyKey, dict: Dict) => boolean, thisArg?: any): PropertyKey; - keyOf(object: Dict, value: T): PropertyKey; - includes(object: Dict, value: T): boolean; - reduce(object: Dict, callbackfn: (previousValue: U, value: T, key: PropertyKey, dict: Dict) => U, initialValue: U): U; - reduce(object: Dict, callbackfn: (previousValue: T, value: T, key: PropertyKey, dict: Dict) => T, initialValue?: T): T; - turn(object: Dict, callbackfn: (memo: Dict, value: T, key: PropertyKey, dict: Dict) => void, memo: Dict): Dict; - turn(object: Dict, callbackfn: (memo: Dict, value: T, key: PropertyKey, dict: Dict) => void, memo?: Dict): Dict; -} - -/** - * Non-standard. - */ -declare var Dict: DictConstructor; - -// ############################################################################################# -// Partial application - https://github.com/zloirock/core-js/#partial-application -// Modules: core.function.part -// ############################################################################################# - -interface Function { - /** - * Non-standard. - */ - part(...args: any[]): any; -} - -// ############################################################################################# -// Date formatting - https://github.com/zloirock/core-js/#date-formatting -// Modules: core.date -// ############################################################################################# - -interface Date { - /** - * Non-standard. - */ - format(template: string, locale?: string): string; - - /** - * Non-standard. - */ - formatUTC(template: string, locale?: string): string; -} - -// ############################################################################################# -// Array - https://github.com/zloirock/core-js/#array -// Modules: core.array.turn -// ############################################################################################# - -interface Array { - /** - * Non-standard. - */ - turn(callbackfn: (memo: U, value: T, index: number, array: Array) => void, memo?: U): U; - - /** - * Non-standard. - */ - turn(callbackfn: (memo: Array, value: T, index: number, array: Array) => void, memo?: Array): Array; -} - -// ############################################################################################# -// Number - https://github.com/zloirock/core-js/#number -// Modules: core.number.iterator -// ############################################################################################# - -interface Number { - /** - * Non-standard. - */ - [Symbol.iterator](): IterableIterator; -} - -// ############################################################################################# -// Escaping characters - https://github.com/zloirock/core-js/#escaping-characters -// Modules: core.string.escape-html -// ############################################################################################# - -interface String { - /** - * Non-standard. - */ - escapeHTML(): string; - - /** - * Non-standard. - */ - unescapeHTML(): string; -} - -// ############################################################################################# -// delay - https://github.com/zloirock/core-js/#delay -// Modules: core.delay -// ############################################################################################# - -declare function delay(msec: number): Promise; - -declare namespace core { - var version: string; - - namespace Reflect { - function apply(target: Function, thisArgument: any, argumentsList: ArrayLike): any; - function construct(target: Function, argumentsList: ArrayLike): any; - function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean; - function deleteProperty(target: any, propertyKey: PropertyKey): boolean; - function enumerate(target: any): IterableIterator; - function get(target: any, propertyKey: PropertyKey, receiver?: any): any; - function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor; - function getPrototypeOf(target: any): any; - function has(target: any, propertyKey: string): boolean; - function has(target: any, propertyKey: symbol): boolean; - function isExtensible(target: any): boolean; - function ownKeys(target: any): Array; - function preventExtensions(target: any): boolean; - function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean; - function setPrototypeOf(target: any, proto: any): boolean; - } - - var Object: { - getPrototypeOf(o: any): any; - getOwnPropertyDescriptor(o: any, p: string): PropertyDescriptor; - getOwnPropertyNames(o: any): string[]; - create(o: any, properties?: PropertyDescriptorMap): any; - defineProperty(o: any, p: string, attributes: PropertyDescriptor): any; - defineProperties(o: any, properties: PropertyDescriptorMap): any; - seal(o: T): T; - freeze(o: T): T; - preventExtensions(o: T): T; - isSealed(o: any): boolean; - isFrozen(o: any): boolean; - isExtensible(o: any): boolean; - keys(o: any): string[]; - assign(target: any, ...sources: any[]): any; - is(value1: any, value2: any): boolean; - setPrototypeOf(o: any, proto: any): any; - getOwnPropertySymbols(o: any): symbol[]; - getOwnPropertyDescriptor(o: any, propertyKey: PropertyKey): PropertyDescriptor; - defineProperty(o: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): any; - values(object: any): any[]; - entries(object: any): any[]; - getOwnPropertyDescriptors(object: any): PropertyDescriptorMap; - isObject(value: any): boolean; - classof(value: any): string; - define(target: T, mixin: any): T; - make(proto: T, mixin?: any): T; - }; - - var Function: { - bind(target: Function, thisArg: any, ...argArray: any[]): any; - part(target: Function, ...args: any[]): any; - }; - - var Array: { - from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): Array; - from(iterable: Iterable, mapfn: (v: T, k: number) => U, thisArg?: any): Array; - from(arrayLike: ArrayLike): Array; - from(iterable: Iterable): Array; - of(...items: T[]): Array; - push(array: ArrayLike, ...items: T[]): number; - pop(array: ArrayLike): T; - concat(array: ArrayLike, ...items: (T[]| T)[]): T[]; - join(array: ArrayLike, separator?: string): string; - reverse(array: ArrayLike): T[]; - shift(array: ArrayLike): T; - slice(array: ArrayLike, start?: number, end?: number): T[]; - sort(array: ArrayLike, compareFn?: (a: T, b: T) => number): T[]; - splice(array: ArrayLike, start: number): T[]; - splice(array: ArrayLike, start: number, deleteCount: number, ...items: T[]): T[]; - unshift(array: ArrayLike, ...items: T[]): number; - indexOf(array: ArrayLike, searchElement: T, fromIndex?: number): number; - lastIndexOf(array: ArrayLike, earchElement: T, fromIndex?: number): number; - every(array: ArrayLike, callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; - some(array: ArrayLike, callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; - forEach(array: ArrayLike, callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void; - map(array: ArrayLike, callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; - filter(array: ArrayLike, callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): T[]; - reduce(array: ArrayLike, callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; - reduce(array: ArrayLike, callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; - reduceRight(array: ArrayLike, callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; - reduceRight(array: ArrayLike, callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; - entries(array: ArrayLike): IterableIterator<[number, T]>; - keys(array: ArrayLike): IterableIterator; - values(array: ArrayLike): IterableIterator; - find(array: ArrayLike, predicate: (value: T, index: number, obj: Array) => boolean, thisArg?: any): T; - findIndex(array: ArrayLike, predicate: (value: T) => boolean, thisArg?: any): number; - fill(array: ArrayLike, value: T, start?: number, end?: number): T[]; - copyWithin(array: ArrayLike, target: number, start: number, end?: number): T[]; - includes(array: ArrayLike, value: T, fromIndex?: number): boolean; - turn(array: ArrayLike, callbackfn: (memo: Array, value: T, index: number, array: Array) => void, memo?: Array): Array; - turn(array: ArrayLike, callbackfn: (memo: U, value: T, index: number, array: Array) => void, memo?: U): U; - }; - - var String: { - codePointAt(text: string, pos: number): number; - includes(text: string, searchString: string, position?: number): boolean; - endsWith(text: string, searchString: string, endPosition?: number): boolean; - repeat(text: string, count: number): string; - fromCodePoint(...codePoints: number[]): string; - raw(template: TemplateStringsArray, ...substitutions: any[]): string; - startsWith(text: string, searchString: string, position?: number): boolean; - at(text: string, index: number): string; - lpad(text: string, length: number, fillStr?: string): string; - rpad(text: string, length: number, fillStr?: string): string; - escapeHTML(text: string): string; - unescapeHTML(text: string): string; - }; - - var Date: { - now(): number; - toISOString(date: Date): string; - format(date: Date, template: string, locale?: string): string; - formatUTC(date: Date, template: string, locale?: string): string; - }; - - var Number: { - EPSILON: number; - isFinite(number: number): boolean; - isInteger(number: number): boolean; - isNaN(number: number): boolean; - isSafeInteger(number: number): boolean; - MAX_SAFE_INTEGER: number; - MIN_SAFE_INTEGER: number; - parseFloat(string: string): number; - parseInt(string: string, radix?: number): number; - clz32(x: number): number; - imul(x: number, y: number): number; - sign(x: number): number; - log10(x: number): number; - log2(x: number): number; - log1p(x: number): number; - expm1(x: number): number; - cosh(x: number): number; - sinh(x: number): number; - tanh(x: number): number; - acosh(x: number): number; - asinh(x: number): number; - atanh(x: number): number; - hypot(...values: number[]): number; - trunc(x: number): number; - fround(x: number): number; - cbrt(x: number): number; - random(lim?: number): number; - }; - - var Math: { - clz32(x: number): number; - imul(x: number, y: number): number; - sign(x: number): number; - log10(x: number): number; - log2(x: number): number; - log1p(x: number): number; - expm1(x: number): number; - cosh(x: number): number; - sinh(x: number): number; - tanh(x: number): number; - acosh(x: number): number; - asinh(x: number): number; - atanh(x: number): number; - hypot(...values: number[]): number; - trunc(x: number): number; - fround(x: number): number; - cbrt(x: number): number; - }; - - var RegExp: { - escape(str: string): string; - }; - - var Map: MapConstructor; - var Set: SetConstructor; - var WeakMap: WeakMapConstructor; - var WeakSet: WeakSetConstructor; - var Promise: PromiseConstructor; - var Symbol: SymbolConstructor; - var Dict: DictConstructor; - var global: any; - var log: Log; - var _: boolean; - - function setTimeout(handler: any, timeout?: any, ...args: any[]): number; - - function setInterval(handler: any, timeout?: any, ...args: any[]): number; - - function setImmediate(expression: any, ...args: any[]): number; - - function clearImmediate(handle: number): void; - - function $for(iterable: Iterable): $for; - - function isIterable(value: any): boolean; - - function getIterator(iterable: Iterable): Iterator; - - interface Locale { - weekdays: string; - months: string; - } - - function addLocale(lang: string, locale: Locale): typeof core; - - function locale(lang?: string): string; - - function delay(msec: number): Promise; -} - -declare module "core-js" { - export = core; -} -declare module "core-js/shim" { - export = core; -} -declare module "core-js/core" { - export = core; -} -declare module "core-js/core/$for" { - import $for = core.$for; - export = $for; -} -declare module "core-js/core/_" { - var _: typeof core._; - export = _; -} -declare module "core-js/core/array" { - var Array: typeof core.Array; - export = Array; -} -declare module "core-js/core/date" { - var Date: typeof core.Date; - export = Date; -} -declare module "core-js/core/delay" { - var delay: typeof core.delay; - export = delay; -} -declare module "core-js/core/dict" { - var Dict: typeof core.Dict; - export = Dict; -} -declare module "core-js/core/function" { - var Function: typeof core.Function; - export = Function; -} -declare module "core-js/core/global" { - var global: typeof core.global; - export = global; -} -declare module "core-js/core/log" { - var log: typeof core.log; - export = log; -} -declare module "core-js/core/number" { - var Number: typeof core.Number; - export = Number; -} -declare module "core-js/core/object" { - var Object: typeof core.Object; - export = Object; -} -declare module "core-js/core/string" { - var String: typeof core.String; - export = String; -} -declare module "core-js/fn/$for" { - import $for = core.$for; - export = $for; -} -declare module "core-js/fn/_" { - var _: typeof core._; - export = _; -} -declare module "core-js/fn/clear-immediate" { - var clearImmediate: typeof core.clearImmediate; - export = clearImmediate; -} -declare module "core-js/fn/delay" { - var delay: typeof core.delay; - export = delay; -} -declare module "core-js/fn/dict" { - var Dict: typeof core.Dict; - export = Dict; -} -declare module "core-js/fn/get-iterator" { - var getIterator: typeof core.getIterator; - export = getIterator; -} -declare module "core-js/fn/global" { - var global: typeof core.global; - export = global; -} -declare module "core-js/fn/is-iterable" { - var isIterable: typeof core.isIterable; - export = isIterable; -} -declare module "core-js/fn/log" { - var log: typeof core.log; - export = log; -} -declare module "core-js/fn/map" { - var Map: typeof core.Map; - export = Map; -} -declare module "core-js/fn/promise" { - var Promise: typeof core.Promise; - export = Promise; -} -declare module "core-js/fn/set" { - var Set: typeof core.Set; - export = Set; -} -declare module "core-js/fn/set-immediate" { - var setImmediate: typeof core.setImmediate; - export = setImmediate; -} -declare module "core-js/fn/set-interval" { - var setInterval: typeof core.setInterval; - export = setInterval; -} -declare module "core-js/fn/set-timeout" { - var setTimeout: typeof core.setTimeout; - export = setTimeout; -} -declare module "core-js/fn/weak-map" { - var WeakMap: typeof core.WeakMap; - export = WeakMap; -} -declare module "core-js/fn/weak-set" { - var WeakSet: typeof core.WeakSet; - export = WeakSet; -} -declare module "core-js/fn/array" { - var Array: typeof core.Array; - export = Array; -} -declare module "core-js/fn/array/concat" { - var concat: typeof core.Array.concat; - export = concat; -} -declare module "core-js/fn/array/copy-within" { - var copyWithin: typeof core.Array.copyWithin; - export = copyWithin; -} -declare module "core-js/fn/array/entries" { - var entries: typeof core.Array.entries; - export = entries; -} -declare module "core-js/fn/array/every" { - var every: typeof core.Array.every; - export = every; -} -declare module "core-js/fn/array/fill" { - var fill: typeof core.Array.fill; - export = fill; -} -declare module "core-js/fn/array/filter" { - var filter: typeof core.Array.filter; - export = filter; -} -declare module "core-js/fn/array/find" { - var find: typeof core.Array.find; - export = find; -} -declare module "core-js/fn/array/find-index" { - var findIndex: typeof core.Array.findIndex; - export = findIndex; -} -declare module "core-js/fn/array/for-each" { - var forEach: typeof core.Array.forEach; - export = forEach; -} -declare module "core-js/fn/array/from" { - var from: typeof core.Array.from; - export = from; -} -declare module "core-js/fn/array/includes" { - var includes: typeof core.Array.includes; - export = includes; -} -declare module "core-js/fn/array/index-of" { - var indexOf: typeof core.Array.indexOf; - export = indexOf; -} -declare module "core-js/fn/array/join" { - var join: typeof core.Array.join; - export = join; -} -declare module "core-js/fn/array/keys" { - var keys: typeof core.Array.keys; - export = keys; -} -declare module "core-js/fn/array/last-index-of" { - var lastIndexOf: typeof core.Array.lastIndexOf; - export = lastIndexOf; -} -declare module "core-js/fn/array/map" { - var map: typeof core.Array.map; - export = map; -} -declare module "core-js/fn/array/of" { - var of: typeof core.Array.of; - export = of; -} -declare module "core-js/fn/array/pop" { - var pop: typeof core.Array.pop; - export = pop; -} -declare module "core-js/fn/array/push" { - var push: typeof core.Array.push; - export = push; -} -declare module "core-js/fn/array/reduce" { - var reduce: typeof core.Array.reduce; - export = reduce; -} -declare module "core-js/fn/array/reduce-right" { - var reduceRight: typeof core.Array.reduceRight; - export = reduceRight; -} -declare module "core-js/fn/array/reverse" { - var reverse: typeof core.Array.reverse; - export = reverse; -} -declare module "core-js/fn/array/shift" { - var shift: typeof core.Array.shift; - export = shift; -} -declare module "core-js/fn/array/slice" { - var slice: typeof core.Array.slice; - export = slice; -} -declare module "core-js/fn/array/some" { - var some: typeof core.Array.some; - export = some; -} -declare module "core-js/fn/array/sort" { - var sort: typeof core.Array.sort; - export = sort; -} -declare module "core-js/fn/array/splice" { - var splice: typeof core.Array.splice; - export = splice; -} -declare module "core-js/fn/array/turn" { - var turn: typeof core.Array.turn; - export = turn; -} -declare module "core-js/fn/array/unshift" { - var unshift: typeof core.Array.unshift; - export = unshift; -} -declare module "core-js/fn/array/values" { - var values: typeof core.Array.values; - export = values; -} -declare module "core-js/fn/date" { - var Date: typeof core.Date; - export = Date; -} -declare module "core-js/fn/date/add-locale" { - var addLocale: typeof core.addLocale; - export = addLocale; -} -declare module "core-js/fn/date/format" { - var format: typeof core.Date.format; - export = format; -} -declare module "core-js/fn/date/formatUTC" { - var formatUTC: typeof core.Date.formatUTC; - export = formatUTC; -} -declare module "core-js/fn/function" { - var Function: typeof core.Function; - export = Function; -} -declare module "core-js/fn/function/has-instance" { - var hasInstance: (value: any) => boolean; - export = hasInstance; -} -declare module "core-js/fn/function/name" -{ -} -declare module "core-js/fn/function/part" { - var part: typeof core.Function.part; - export = part; -} -declare module "core-js/fn/math" { - var Math: typeof core.Math; - export = Math; -} -declare module "core-js/fn/math/acosh" { - var acosh: typeof core.Math.acosh; - export = acosh; -} -declare module "core-js/fn/math/asinh" { - var asinh: typeof core.Math.asinh; - export = asinh; -} -declare module "core-js/fn/math/atanh" { - var atanh: typeof core.Math.atanh; - export = atanh; -} -declare module "core-js/fn/math/cbrt" { - var cbrt: typeof core.Math.cbrt; - export = cbrt; -} -declare module "core-js/fn/math/clz32" { - var clz32: typeof core.Math.clz32; - export = clz32; -} -declare module "core-js/fn/math/cosh" { - var cosh: typeof core.Math.cosh; - export = cosh; -} -declare module "core-js/fn/math/expm1" { - var expm1: typeof core.Math.expm1; - export = expm1; -} -declare module "core-js/fn/math/fround" { - var fround: typeof core.Math.fround; - export = fround; -} -declare module "core-js/fn/math/hypot" { - var hypot: typeof core.Math.hypot; - export = hypot; -} -declare module "core-js/fn/math/imul" { - var imul: typeof core.Math.imul; - export = imul; -} -declare module "core-js/fn/math/log10" { - var log10: typeof core.Math.log10; - export = log10; -} -declare module "core-js/fn/math/log1p" { - var log1p: typeof core.Math.log1p; - export = log1p; -} -declare module "core-js/fn/math/log2" { - var log2: typeof core.Math.log2; - export = log2; -} -declare module "core-js/fn/math/sign" { - var sign: typeof core.Math.sign; - export = sign; -} -declare module "core-js/fn/math/sinh" { - var sinh: typeof core.Math.sinh; - export = sinh; -} -declare module "core-js/fn/math/tanh" { - var tanh: typeof core.Math.tanh; - export = tanh; -} -declare module "core-js/fn/math/trunc" { - var trunc: typeof core.Math.trunc; - export = trunc; -} -declare module "core-js/fn/number" { - var Number: typeof core.Number; - export = Number; -} -declare module "core-js/fn/number/epsilon" { - var EPSILON: typeof core.Number.EPSILON; - export = EPSILON; -} -declare module "core-js/fn/number/is-finite" { - var isFinite: typeof core.Number.isFinite; - export = isFinite; -} -declare module "core-js/fn/number/is-integer" { - var isInteger: typeof core.Number.isInteger; - export = isInteger; -} -declare module "core-js/fn/number/is-nan" { - var isNaN: typeof core.Number.isNaN; - export = isNaN; -} -declare module "core-js/fn/number/is-safe-integer" { - var isSafeInteger: typeof core.Number.isSafeInteger; - export = isSafeInteger; -} -declare module "core-js/fn/number/max-safe-integer" { - var MAX_SAFE_INTEGER: typeof core.Number.MAX_SAFE_INTEGER; - export = MAX_SAFE_INTEGER; -} -declare module "core-js/fn/number/min-safe-integer" { - var MIN_SAFE_INTEGER: typeof core.Number.MIN_SAFE_INTEGER; - export = MIN_SAFE_INTEGER; -} -declare module "core-js/fn/number/parse-float" { - var parseFloat: typeof core.Number.parseFloat; - export = parseFloat; -} -declare module "core-js/fn/number/parse-int" { - var parseInt: typeof core.Number.parseInt; - export = parseInt; -} -declare module "core-js/fn/number/random" { - var random: typeof core.Number.random; - export = random; -} -declare module "core-js/fn/object" { - var Object: typeof core.Object; - export = Object; -} -declare module "core-js/fn/object/assign" { - var assign: typeof core.Object.assign; - export = assign; -} -declare module "core-js/fn/object/classof" { - var classof: typeof core.Object.classof; - export = classof; -} -declare module "core-js/fn/object/create" { - var create: typeof core.Object.create; - export = create; -} -declare module "core-js/fn/object/define" { - var define: typeof core.Object.define; - export = define; -} -declare module "core-js/fn/object/define-properties" { - var defineProperties: typeof core.Object.defineProperties; - export = defineProperties; -} -declare module "core-js/fn/object/define-property" { - var defineProperty: typeof core.Object.defineProperty; - export = defineProperty; -} -declare module "core-js/fn/object/entries" { - var entries: typeof core.Object.entries; - export = entries; -} -declare module "core-js/fn/object/freeze" { - var freeze: typeof core.Object.freeze; - export = freeze; -} -declare module "core-js/fn/object/get-own-property-descriptor" { - var getOwnPropertyDescriptor: typeof core.Object.getOwnPropertyDescriptor; - export = getOwnPropertyDescriptor; -} -declare module "core-js/fn/object/get-own-property-descriptors" { - var getOwnPropertyDescriptors: typeof core.Object.getOwnPropertyDescriptors; - export = getOwnPropertyDescriptors; -} -declare module "core-js/fn/object/get-own-property-names" { - var getOwnPropertyNames: typeof core.Object.getOwnPropertyNames; - export = getOwnPropertyNames; -} -declare module "core-js/fn/object/get-own-property-symbols" { - var getOwnPropertySymbols: typeof core.Object.getOwnPropertySymbols; - export = getOwnPropertySymbols; -} -declare module "core-js/fn/object/get-prototype-of" { - var getPrototypeOf: typeof core.Object.getPrototypeOf; - export = getPrototypeOf; -} -declare module "core-js/fn/object/is" { - var is: typeof core.Object.is; - export = is; -} -declare module "core-js/fn/object/is-extensible" { - var isExtensible: typeof core.Object.isExtensible; - export = isExtensible; -} -declare module "core-js/fn/object/is-frozen" { - var isFrozen: typeof core.Object.isFrozen; - export = isFrozen; -} -declare module "core-js/fn/object/is-object" { - var isObject: typeof core.Object.isObject; - export = isObject; -} -declare module "core-js/fn/object/is-sealed" { - var isSealed: typeof core.Object.isSealed; - export = isSealed; -} -declare module "core-js/fn/object/keys" { - var keys: typeof core.Object.keys; - export = keys; -} -declare module "core-js/fn/object/make" { - var make: typeof core.Object.make; - export = make; -} -declare module "core-js/fn/object/prevent-extensions" { - var preventExtensions: typeof core.Object.preventExtensions; - export = preventExtensions; -} -declare module "core-js/fn/object/seal" { - var seal: typeof core.Object.seal; - export = seal; -} -declare module "core-js/fn/object/set-prototype-of" { - var setPrototypeOf: typeof core.Object.setPrototypeOf; - export = setPrototypeOf; -} -declare module "core-js/fn/object/values" { - var values: typeof core.Object.values; - export = values; -} -declare module "core-js/fn/reflect" { - var Reflect: typeof core.Reflect; - export = Reflect; -} -declare module "core-js/fn/reflect/apply" { - var apply: typeof core.Reflect.apply; - export = apply; -} -declare module "core-js/fn/reflect/construct" { - var construct: typeof core.Reflect.construct; - export = construct; -} -declare module "core-js/fn/reflect/define-property" { - var defineProperty: typeof core.Reflect.defineProperty; - export = defineProperty; -} -declare module "core-js/fn/reflect/delete-property" { - var deleteProperty: typeof core.Reflect.deleteProperty; - export = deleteProperty; -} -declare module "core-js/fn/reflect/enumerate" { - var enumerate: typeof core.Reflect.enumerate; - export = enumerate; -} -declare module "core-js/fn/reflect/get" { - var get: typeof core.Reflect.get; - export = get; -} -declare module "core-js/fn/reflect/get-own-property-descriptor" { - var getOwnPropertyDescriptor: typeof core.Reflect.getOwnPropertyDescriptor; - export = getOwnPropertyDescriptor; -} -declare module "core-js/fn/reflect/get-prototype-of" { - var getPrototypeOf: typeof core.Reflect.getPrototypeOf; - export = getPrototypeOf; -} -declare module "core-js/fn/reflect/has" { - var has: typeof core.Reflect.has; - export = has; -} -declare module "core-js/fn/reflect/is-extensible" { - var isExtensible: typeof core.Reflect.isExtensible; - export = isExtensible; -} -declare module "core-js/fn/reflect/own-keys" { - var ownKeys: typeof core.Reflect.ownKeys; - export = ownKeys; -} -declare module "core-js/fn/reflect/prevent-extensions" { - var preventExtensions: typeof core.Reflect.preventExtensions; - export = preventExtensions; -} -declare module "core-js/fn/reflect/set" { - var set: typeof core.Reflect.set; - export = set; -} -declare module "core-js/fn/reflect/set-prototype-of" { - var setPrototypeOf: typeof core.Reflect.setPrototypeOf; - export = setPrototypeOf; -} -declare module "core-js/fn/regexp" { - var RegExp: typeof core.RegExp; - export = RegExp; -} -declare module "core-js/fn/regexp/escape" { - var escape: typeof core.RegExp.escape; - export = escape; -} -declare module "core-js/fn/string" { - var String: typeof core.String; - export = String; -} -declare module "core-js/fn/string/at" { - var at: typeof core.String.at; - export = at; -} -declare module "core-js/fn/string/code-point-at" { - var codePointAt: typeof core.String.codePointAt; - export = codePointAt; -} -declare module "core-js/fn/string/ends-with" { - var endsWith: typeof core.String.endsWith; - export = endsWith; -} -declare module "core-js/fn/string/escape-html" { - var escapeHTML: typeof core.String.escapeHTML; - export = escapeHTML; -} -declare module "core-js/fn/string/from-code-point" { - var fromCodePoint: typeof core.String.fromCodePoint; - export = fromCodePoint; -} -declare module "core-js/fn/string/includes" { - var includes: typeof core.String.includes; - export = includes; -} -declare module "core-js/fn/string/lpad" { - var lpad: typeof core.String.lpad; - export = lpad; -} -declare module "core-js/fn/string/raw" { - var raw: typeof core.String.raw; - export = raw; -} -declare module "core-js/fn/string/repeat" { - var repeat: typeof core.String.repeat; - export = repeat; -} -declare module "core-js/fn/string/rpad" { - var rpad: typeof core.String.rpad; - export = rpad; -} -declare module "core-js/fn/string/starts-with" { - var startsWith: typeof core.String.startsWith; - export = startsWith; -} -declare module "core-js/fn/string/unescape-html" { - var unescapeHTML: typeof core.String.unescapeHTML; - export = unescapeHTML; -} -declare module "core-js/fn/symbol" { - var Symbol: typeof core.Symbol; - export = Symbol; -} -declare module "core-js/fn/symbol/for" { - var _for: typeof core.Symbol.for; - export = _for; -} -declare module "core-js/fn/symbol/has-instance" { - var hasInstance: typeof core.Symbol.hasInstance; - export = hasInstance; -} -declare module "core-js/fn/symbol/is-concat-spreadable" { - var isConcatSpreadable: typeof core.Symbol.isConcatSpreadable; - export = isConcatSpreadable; -} -declare module "core-js/fn/symbol/iterator" { - var iterator: typeof core.Symbol.iterator; - export = iterator; -} -declare module "core-js/fn/symbol/key-for" { - var keyFor: typeof core.Symbol.keyFor; - export = keyFor; -} -declare module "core-js/fn/symbol/match" { - var match: typeof core.Symbol.match; - export = match; -} -declare module "core-js/fn/symbol/replace" { - var replace: typeof core.Symbol.replace; - export = replace; -} -declare module "core-js/fn/symbol/search" { - var search: typeof core.Symbol.search; - export = search; -} -declare module "core-js/fn/symbol/species" { - var species: typeof core.Symbol.species; - export = species; -} -declare module "core-js/fn/symbol/split" { - var split: typeof core.Symbol.split; - export = split; -} -declare module "core-js/fn/symbol/to-primitive" { - var toPrimitive: typeof core.Symbol.toPrimitive; - export = toPrimitive; -} -declare module "core-js/fn/symbol/to-string-tag" { - var toStringTag: typeof core.Symbol.toStringTag; - export = toStringTag; -} -declare module "core-js/fn/symbol/unscopables" { - var unscopables: typeof core.Symbol.unscopables; - export = unscopables; -} -declare module "core-js/es5" { - export = core; -} -declare module "core-js/es6" { - export = core; -} -declare module "core-js/es6/array" { - var Array: typeof core.Array; - export = Array; -} -declare module "core-js/es6/function" { - var Function: typeof core.Function; - export = Function; -} -declare module "core-js/es6/map" { - var Map: typeof core.Map; - export = Map; -} -declare module "core-js/es6/math" { - var Math: typeof core.Math; - export = Math; -} -declare module "core-js/es6/number" { - var Number: typeof core.Number; - export = Number; -} -declare module "core-js/es6/object" { - var Object: typeof core.Object; - export = Object; -} -declare module "core-js/es6/promise" { - var Promise: typeof core.Promise; - export = Promise; -} -declare module "core-js/es6/reflect" { - var Reflect: typeof core.Reflect; - export = Reflect; -} -declare module "core-js/es6/regexp" { - var RegExp: typeof core.RegExp; - export = RegExp; -} -declare module "core-js/es6/set" { - var Set: typeof core.Set; - export = Set; -} -declare module "core-js/es6/string" { - var String: typeof core.String; - export = String; -} -declare module "core-js/es6/symbol" { - var Symbol: typeof core.Symbol; - export = Symbol; -} -declare module "core-js/es6/weak-map" { - var WeakMap: typeof core.WeakMap; - export = WeakMap; -} -declare module "core-js/es6/weak-set" { - var WeakSet: typeof core.WeakSet; - export = WeakSet; -} -declare module "core-js/es7" { - export = core; -} -declare module "core-js/es7/array" { - var Array: typeof core.Array; - export = Array; -} -declare module "core-js/es7/map" { - var Map: typeof core.Map; - export = Map; -} -declare module "core-js/es7/object" { - var Object: typeof core.Object; - export = Object; -} -declare module "core-js/es7/regexp" { - var RegExp: typeof core.RegExp; - export = RegExp; -} -declare module "core-js/es7/set" { - var Set: typeof core.Set; - export = Set; -} -declare module "core-js/es7/string" { - var String: typeof core.String; - export = String; -} -declare module "core-js/js" { - export = core; -} -declare module "core-js/js/array" { - var Array: typeof core.Array; - export = Array; -} -declare module "core-js/web" { - export = core; -} -declare module "core-js/web/dom" { - export = core; -} -declare module "core-js/web/immediate" { - export = core; -} -declare module "core-js/web/timers" { - export = core; -} -declare module "core-js/library" { - export = core; -} -declare module "core-js/library/shim" { - export = core; -} -declare module "core-js/library/core" { - export = core; -} -declare module "core-js/library/core/$for" { - import $for = core.$for; - export = $for; -} -declare module "core-js/library/core/_" { - var _: typeof core._; - export = _; -} -declare module "core-js/library/core/array" { - var Array: typeof core.Array; - export = Array; -} -declare module "core-js/library/core/date" { - var Date: typeof core.Date; - export = Date; -} -declare module "core-js/library/core/delay" { - var delay: typeof core.delay; - export = delay; -} -declare module "core-js/library/core/dict" { - var Dict: typeof core.Dict; - export = Dict; -} -declare module "core-js/library/core/function" { - var Function: typeof core.Function; - export = Function; -} -declare module "core-js/library/core/global" { - var global: typeof core.global; - export = global; -} -declare module "core-js/library/core/log" { - var log: typeof core.log; - export = log; -} -declare module "core-js/library/core/number" { - var Number: typeof core.Number; - export = Number; -} -declare module "core-js/library/core/object" { - var Object: typeof core.Object; - export = Object; -} -declare module "core-js/library/core/string" { - var String: typeof core.String; - export = String; -} -declare module "core-js/library/fn/$for" { - import $for = core.$for; - export = $for; -} -declare module "core-js/library/fn/_" { - var _: typeof core._; - export = _; -} -declare module "core-js/library/fn/clear-immediate" { - var clearImmediate: typeof core.clearImmediate; - export = clearImmediate; -} -declare module "core-js/library/fn/delay" { - var delay: typeof core.delay; - export = delay; -} -declare module "core-js/library/fn/dict" { - var Dict: typeof core.Dict; - export = Dict; -} -declare module "core-js/library/fn/get-iterator" { - var getIterator: typeof core.getIterator; - export = getIterator; -} -declare module "core-js/library/fn/global" { - var global: typeof core.global; - export = global; -} -declare module "core-js/library/fn/is-iterable" { - var isIterable: typeof core.isIterable; - export = isIterable; -} -declare module "core-js/library/fn/log" { - var log: typeof core.log; - export = log; -} -declare module "core-js/library/fn/map" { - var Map: typeof core.Map; - export = Map; -} -declare module "core-js/library/fn/promise" { - var Promise: typeof core.Promise; - export = Promise; -} -declare module "core-js/library/fn/set" { - var Set: typeof core.Set; - export = Set; -} -declare module "core-js/library/fn/set-immediate" { - var setImmediate: typeof core.setImmediate; - export = setImmediate; -} -declare module "core-js/library/fn/set-interval" { - var setInterval: typeof core.setInterval; - export = setInterval; -} -declare module "core-js/library/fn/set-timeout" { - var setTimeout: typeof core.setTimeout; - export = setTimeout; -} -declare module "core-js/library/fn/weak-map" { - var WeakMap: typeof core.WeakMap; - export = WeakMap; -} -declare module "core-js/library/fn/weak-set" { - var WeakSet: typeof core.WeakSet; - export = WeakSet; -} -declare module "core-js/library/fn/array" { - var Array: typeof core.Array; - export = Array; -} -declare module "core-js/library/fn/array/concat" { - var concat: typeof core.Array.concat; - export = concat; -} -declare module "core-js/library/fn/array/copy-within" { - var copyWithin: typeof core.Array.copyWithin; - export = copyWithin; -} -declare module "core-js/library/fn/array/entries" { - var entries: typeof core.Array.entries; - export = entries; -} -declare module "core-js/library/fn/array/every" { - var every: typeof core.Array.every; - export = every; -} -declare module "core-js/library/fn/array/fill" { - var fill: typeof core.Array.fill; - export = fill; -} -declare module "core-js/library/fn/array/filter" { - var filter: typeof core.Array.filter; - export = filter; -} -declare module "core-js/library/fn/array/find" { - var find: typeof core.Array.find; - export = find; -} -declare module "core-js/library/fn/array/find-index" { - var findIndex: typeof core.Array.findIndex; - export = findIndex; -} -declare module "core-js/library/fn/array/for-each" { - var forEach: typeof core.Array.forEach; - export = forEach; -} -declare module "core-js/library/fn/array/from" { - var from: typeof core.Array.from; - export = from; -} -declare module "core-js/library/fn/array/includes" { - var includes: typeof core.Array.includes; - export = includes; -} -declare module "core-js/library/fn/array/index-of" { - var indexOf: typeof core.Array.indexOf; - export = indexOf; -} -declare module "core-js/library/fn/array/join" { - var join: typeof core.Array.join; - export = join; -} -declare module "core-js/library/fn/array/keys" { - var keys: typeof core.Array.keys; - export = keys; -} -declare module "core-js/library/fn/array/last-index-of" { - var lastIndexOf: typeof core.Array.lastIndexOf; - export = lastIndexOf; -} -declare module "core-js/library/fn/array/map" { - var map: typeof core.Array.map; - export = map; -} -declare module "core-js/library/fn/array/of" { - var of: typeof core.Array.of; - export = of; -} -declare module "core-js/library/fn/array/pop" { - var pop: typeof core.Array.pop; - export = pop; -} -declare module "core-js/library/fn/array/push" { - var push: typeof core.Array.push; - export = push; -} -declare module "core-js/library/fn/array/reduce" { - var reduce: typeof core.Array.reduce; - export = reduce; -} -declare module "core-js/library/fn/array/reduce-right" { - var reduceRight: typeof core.Array.reduceRight; - export = reduceRight; -} -declare module "core-js/library/fn/array/reverse" { - var reverse: typeof core.Array.reverse; - export = reverse; -} -declare module "core-js/library/fn/array/shift" { - var shift: typeof core.Array.shift; - export = shift; -} -declare module "core-js/library/fn/array/slice" { - var slice: typeof core.Array.slice; - export = slice; -} -declare module "core-js/library/fn/array/some" { - var some: typeof core.Array.some; - export = some; -} -declare module "core-js/library/fn/array/sort" { - var sort: typeof core.Array.sort; - export = sort; -} -declare module "core-js/library/fn/array/splice" { - var splice: typeof core.Array.splice; - export = splice; -} -declare module "core-js/library/fn/array/turn" { - var turn: typeof core.Array.turn; - export = turn; -} -declare module "core-js/library/fn/array/unshift" { - var unshift: typeof core.Array.unshift; - export = unshift; -} -declare module "core-js/library/fn/array/values" { - var values: typeof core.Array.values; - export = values; -} -declare module "core-js/library/fn/date" { - var Date: typeof core.Date; - export = Date; -} -declare module "core-js/library/fn/date/add-locale" { - var addLocale: typeof core.addLocale; - export = addLocale; -} -declare module "core-js/library/fn/date/format" { - var format: typeof core.Date.format; - export = format; -} -declare module "core-js/library/fn/date/formatUTC" { - var formatUTC: typeof core.Date.formatUTC; - export = formatUTC; -} -declare module "core-js/library/fn/function" { - var Function: typeof core.Function; - export = Function; -} -declare module "core-js/library/fn/function/has-instance" { - var hasInstance: (value: any) => boolean; - export = hasInstance; -} -declare module "core-js/library/fn/function/name" { -} -declare module "core-js/library/fn/function/part" { - var part: typeof core.Function.part; - export = part; -} -declare module "core-js/library/fn/math" { - var Math: typeof core.Math; - export = Math; -} -declare module "core-js/library/fn/math/acosh" { - var acosh: typeof core.Math.acosh; - export = acosh; -} -declare module "core-js/library/fn/math/asinh" { - var asinh: typeof core.Math.asinh; - export = asinh; -} -declare module "core-js/library/fn/math/atanh" { - var atanh: typeof core.Math.atanh; - export = atanh; -} -declare module "core-js/library/fn/math/cbrt" { - var cbrt: typeof core.Math.cbrt; - export = cbrt; -} -declare module "core-js/library/fn/math/clz32" { - var clz32: typeof core.Math.clz32; - export = clz32; -} -declare module "core-js/library/fn/math/cosh" { - var cosh: typeof core.Math.cosh; - export = cosh; -} -declare module "core-js/library/fn/math/expm1" { - var expm1: typeof core.Math.expm1; - export = expm1; -} -declare module "core-js/library/fn/math/fround" { - var fround: typeof core.Math.fround; - export = fround; -} -declare module "core-js/library/fn/math/hypot" { - var hypot: typeof core.Math.hypot; - export = hypot; -} -declare module "core-js/library/fn/math/imul" { - var imul: typeof core.Math.imul; - export = imul; -} -declare module "core-js/library/fn/math/log10" { - var log10: typeof core.Math.log10; - export = log10; -} -declare module "core-js/library/fn/math/log1p" { - var log1p: typeof core.Math.log1p; - export = log1p; -} -declare module "core-js/library/fn/math/log2" { - var log2: typeof core.Math.log2; - export = log2; -} -declare module "core-js/library/fn/math/sign" { - var sign: typeof core.Math.sign; - export = sign; -} -declare module "core-js/library/fn/math/sinh" { - var sinh: typeof core.Math.sinh; - export = sinh; -} -declare module "core-js/library/fn/math/tanh" { - var tanh: typeof core.Math.tanh; - export = tanh; -} -declare module "core-js/library/fn/math/trunc" { - var trunc: typeof core.Math.trunc; - export = trunc; -} -declare module "core-js/library/fn/number" { - var Number: typeof core.Number; - export = Number; -} -declare module "core-js/library/fn/number/epsilon" { - var EPSILON: typeof core.Number.EPSILON; - export = EPSILON; -} -declare module "core-js/library/fn/number/is-finite" { - var isFinite: typeof core.Number.isFinite; - export = isFinite; -} -declare module "core-js/library/fn/number/is-integer" { - var isInteger: typeof core.Number.isInteger; - export = isInteger; -} -declare module "core-js/library/fn/number/is-nan" { - var isNaN: typeof core.Number.isNaN; - export = isNaN; -} -declare module "core-js/library/fn/number/is-safe-integer" { - var isSafeInteger: typeof core.Number.isSafeInteger; - export = isSafeInteger; -} -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/library/fn/number/min-safe-integer" { - var MIN_SAFE_INTEGER: typeof core.Number.MIN_SAFE_INTEGER; - export = MIN_SAFE_INTEGER; -} -declare module "core-js/library/fn/number/parse-float" { - var parseFloat: typeof core.Number.parseFloat; - export = parseFloat; -} -declare module "core-js/library/fn/number/parse-int" { - var parseInt: typeof core.Number.parseInt; - export = parseInt; -} -declare module "core-js/library/fn/number/random" { - var random: typeof core.Number.random; - export = random; -} -declare module "core-js/library/fn/object" { - var Object: typeof core.Object; - export = Object; -} -declare module "core-js/library/fn/object/assign" { - var assign: typeof core.Object.assign; - export = assign; -} -declare module "core-js/library/fn/object/classof" { - var classof: typeof core.Object.classof; - export = classof; -} -declare module "core-js/library/fn/object/create" { - var create: typeof core.Object.create; - export = create; -} -declare module "core-js/library/fn/object/define" { - var define: typeof core.Object.define; - export = define; -} -declare module "core-js/library/fn/object/define-properties" { - var defineProperties: typeof core.Object.defineProperties; - export = defineProperties; -} -declare module "core-js/library/fn/object/define-property" { - var defineProperty: typeof core.Object.defineProperty; - export = defineProperty; -} -declare module "core-js/library/fn/object/entries" { - var entries: typeof core.Object.entries; - export = entries; -} -declare module "core-js/library/fn/object/freeze" { - var freeze: typeof core.Object.freeze; - export = freeze; -} -declare module "core-js/library/fn/object/get-own-property-descriptor" { - var getOwnPropertyDescriptor: typeof core.Object.getOwnPropertyDescriptor; - export = getOwnPropertyDescriptor; -} -declare module "core-js/library/fn/object/get-own-property-descriptors" { - var getOwnPropertyDescriptors: typeof core.Object.getOwnPropertyDescriptors; - export = getOwnPropertyDescriptors; -} -declare module "core-js/library/fn/object/get-own-property-names" { - var getOwnPropertyNames: typeof core.Object.getOwnPropertyNames; - export = getOwnPropertyNames; -} -declare module "core-js/library/fn/object/get-own-property-symbols" { - var getOwnPropertySymbols: typeof core.Object.getOwnPropertySymbols; - export = getOwnPropertySymbols; -} -declare module "core-js/library/fn/object/get-prototype-of" { - var getPrototypeOf: typeof core.Object.getPrototypeOf; - export = getPrototypeOf; -} -declare module "core-js/library/fn/object/is" { - var is: typeof core.Object.is; - export = is; -} -declare module "core-js/library/fn/object/is-extensible" { - var isExtensible: typeof core.Object.isExtensible; - export = isExtensible; -} -declare module "core-js/library/fn/object/is-frozen" { - var isFrozen: typeof core.Object.isFrozen; - export = isFrozen; -} -declare module "core-js/library/fn/object/is-object" { - var isObject: typeof core.Object.isObject; - export = isObject; -} -declare module "core-js/library/fn/object/is-sealed" { - var isSealed: typeof core.Object.isSealed; - export = isSealed; -} -declare module "core-js/library/fn/object/keys" { - var keys: typeof core.Object.keys; - export = keys; -} -declare module "core-js/library/fn/object/make" { - var make: typeof core.Object.make; - export = make; -} -declare module "core-js/library/fn/object/prevent-extensions" { - var preventExtensions: typeof core.Object.preventExtensions; - export = preventExtensions; -} -declare module "core-js/library/fn/object/seal" { - var seal: typeof core.Object.seal; - export = seal; -} -declare module "core-js/library/fn/object/set-prototype-of" { - var setPrototypeOf: typeof core.Object.setPrototypeOf; - export = setPrototypeOf; -} -declare module "core-js/library/fn/object/values" { - var values: typeof core.Object.values; - export = values; -} -declare module "core-js/library/fn/reflect" { - var Reflect: typeof core.Reflect; - export = Reflect; -} -declare module "core-js/library/fn/reflect/apply" { - var apply: typeof core.Reflect.apply; - export = apply; -} -declare module "core-js/library/fn/reflect/construct" { - var construct: typeof core.Reflect.construct; - export = construct; -} -declare module "core-js/library/fn/reflect/define-property" { - var defineProperty: typeof core.Reflect.defineProperty; - export = defineProperty; -} -declare module "core-js/library/fn/reflect/delete-property" { - var deleteProperty: typeof core.Reflect.deleteProperty; - export = deleteProperty; -} -declare module "core-js/library/fn/reflect/enumerate" { - var enumerate: typeof core.Reflect.enumerate; - export = enumerate; -} -declare module "core-js/library/fn/reflect/get" { - var get: typeof core.Reflect.get; - export = get; -} -declare module "core-js/library/fn/reflect/get-own-property-descriptor" { - var getOwnPropertyDescriptor: typeof core.Reflect.getOwnPropertyDescriptor; - export = getOwnPropertyDescriptor; -} -declare module "core-js/library/fn/reflect/get-prototype-of" { - var getPrototypeOf: typeof core.Reflect.getPrototypeOf; - export = getPrototypeOf; -} -declare module "core-js/library/fn/reflect/has" { - var has: typeof core.Reflect.has; - export = has; -} -declare module "core-js/library/fn/reflect/is-extensible" { - var isExtensible: typeof core.Reflect.isExtensible; - export = isExtensible; -} -declare module "core-js/library/fn/reflect/own-keys" { - var ownKeys: typeof core.Reflect.ownKeys; - export = ownKeys; -} -declare module "core-js/library/fn/reflect/prevent-extensions" { - var preventExtensions: typeof core.Reflect.preventExtensions; - export = preventExtensions; -} -declare module "core-js/library/fn/reflect/set" { - var set: typeof core.Reflect.set; - export = set; -} -declare module "core-js/library/fn/reflect/set-prototype-of" { - var setPrototypeOf: typeof core.Reflect.setPrototypeOf; - export = setPrototypeOf; -} -declare module "core-js/library/fn/regexp" { - var RegExp: typeof core.RegExp; - export = RegExp; -} -declare module "core-js/library/fn/regexp/escape" { - var escape: typeof core.RegExp.escape; - export = escape; -} -declare module "core-js/library/fn/string" { - var String: typeof core.String; - export = String; -} -declare module "core-js/library/fn/string/at" { - var at: typeof core.String.at; - export = at; -} -declare module "core-js/library/fn/string/code-point-at" { - var codePointAt: typeof core.String.codePointAt; - export = codePointAt; -} -declare module "core-js/library/fn/string/ends-with" { - var endsWith: typeof core.String.endsWith; - export = endsWith; -} -declare module "core-js/library/fn/string/escape-html" { - var escapeHTML: typeof core.String.escapeHTML; - export = escapeHTML; -} -declare module "core-js/library/fn/string/from-code-point" { - var fromCodePoint: typeof core.String.fromCodePoint; - export = fromCodePoint; -} -declare module "core-js/library/fn/string/includes" { - var includes: typeof core.String.includes; - export = includes; -} -declare module "core-js/library/fn/string/lpad" { - var lpad: typeof core.String.lpad; - export = lpad; -} -declare module "core-js/library/fn/string/raw" { - var raw: typeof core.String.raw; - export = raw; -} -declare module "core-js/library/fn/string/repeat" { - var repeat: typeof core.String.repeat; - export = repeat; -} -declare module "core-js/library/fn/string/rpad" { - var rpad: typeof core.String.rpad; - export = rpad; -} -declare module "core-js/library/fn/string/starts-with" { - var startsWith: typeof core.String.startsWith; - export = startsWith; -} -declare module "core-js/library/fn/string/unescape-html" { - var unescapeHTML: typeof core.String.unescapeHTML; - export = unescapeHTML; -} -declare module "core-js/library/fn/symbol" { - var Symbol: typeof core.Symbol; - export = Symbol; -} -declare module "core-js/library/fn/symbol/for" { - var _for: typeof core.Symbol.for; - export = _for; -} -declare module "core-js/library/fn/symbol/has-instance" { - var hasInstance: typeof core.Symbol.hasInstance; - export = hasInstance; -} -declare module "core-js/library/fn/symbol/is-concat-spreadable" { - var isConcatSpreadable: typeof core.Symbol.isConcatSpreadable; - export = isConcatSpreadable; -} -declare module "core-js/library/fn/symbol/iterator" { - var iterator: typeof core.Symbol.iterator; - export = iterator; -} -declare module "core-js/library/fn/symbol/key-for" { - var keyFor: typeof core.Symbol.keyFor; - export = keyFor; -} -declare module "core-js/library/fn/symbol/match" { - var match: typeof core.Symbol.match; - export = match; -} -declare module "core-js/library/fn/symbol/replace" { - var replace: typeof core.Symbol.replace; - export = replace; -} -declare module "core-js/library/fn/symbol/search" { - var search: typeof core.Symbol.search; - export = search; -} -declare module "core-js/library/fn/symbol/species" { - var species: typeof core.Symbol.species; - export = species; -} -declare module "core-js/library/fn/symbol/split" { - var split: typeof core.Symbol.split; - export = split; -} -declare module "core-js/library/fn/symbol/to-primitive" { - var toPrimitive: typeof core.Symbol.toPrimitive; - export = toPrimitive; -} -declare module "core-js/library/fn/symbol/to-string-tag" { - var toStringTag: typeof core.Symbol.toStringTag; - export = toStringTag; -} -declare module "core-js/library/fn/symbol/unscopables" { - var unscopables: typeof core.Symbol.unscopables; - export = unscopables; -} -declare module "core-js/library/es5" { - export = core; -} -declare module "core-js/library/es6" { - export = core; -} -declare module "core-js/library/es6/array" { - var Array: typeof core.Array; - export = Array; -} -declare module "core-js/library/es6/function" { - var Function: typeof core.Function; - export = Function; -} -declare module "core-js/library/es6/map" { - var Map: typeof core.Map; - export = Map; -} -declare module "core-js/library/es6/math" { - var Math: typeof core.Math; - export = Math; -} -declare module "core-js/library/es6/number" { - var Number: typeof core.Number; - export = Number; -} -declare module "core-js/library/es6/object" { - var Object: typeof core.Object; - export = Object; -} -declare module "core-js/library/es6/promise" { - var Promise: typeof core.Promise; - export = Promise; -} -declare module "core-js/library/es6/reflect" { - var Reflect: typeof core.Reflect; - export = Reflect; -} -declare module "core-js/library/es6/regexp" { - var RegExp: typeof core.RegExp; - export = RegExp; -} -declare module "core-js/library/es6/set" { - var Set: typeof core.Set; - export = Set; -} -declare module "core-js/library/es6/string" { - var String: typeof core.String; - export = String; -} -declare module "core-js/library/es6/symbol" { - var Symbol: typeof core.Symbol; - export = Symbol; -} -declare module "core-js/library/es6/weak-map" { - var WeakMap: typeof core.WeakMap; - export = WeakMap; -} -declare module "core-js/library/es6/weak-set" { - var WeakSet: typeof core.WeakSet; - export = WeakSet; -} -declare module "core-js/library/es7" { - export = core; -} -declare module "core-js/library/es7/array" { - var Array: typeof core.Array; - export = Array; -} -declare module "core-js/library/es7/map" { - var Map: typeof core.Map; - export = Map; -} -declare module "core-js/library/es7/object" { - var Object: typeof core.Object; - export = Object; -} -declare module "core-js/library/es7/regexp" { - var RegExp: typeof core.RegExp; - export = RegExp; -} -declare module "core-js/library/es7/set" { - var Set: typeof core.Set; - export = Set; -} -declare module "core-js/library/es7/string" { - var String: typeof core.String; - export = String; -} -declare module "core-js/library/js" { - export = core; -} -declare module "core-js/library/js/array" { - var Array: typeof core.Array; - export = Array; -} -declare module "core-js/library/web" { - export = core; -} -declare module "core-js/library/web/dom" { - export = core; -} -declare module "core-js/library/web/immediate" { - export = core; -} -declare module "core-js/library/web/timers" { - export = core; -} diff --git a/core-js/tsconfig.json b/core-js/tsconfig.json deleted file mode 100644 index b37502a626..0000000000 --- a/core-js/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es5", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "core-js-tests.ts" - ] -} \ No newline at end of file diff --git a/cors/index.d.ts b/cors/index.d.ts deleted file mode 100644 index ecad80d187..0000000000 --- a/cors/index.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -// Type definitions for cors 2.8 -// Project: https://github.com/troygoode/node-cors/ -// Definitions by: Mihhail Lapushkin -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - - - - -import express = require('express'); - -type CustomOrigin = ( - requestOrigin: string, - callback: (err: Error, allow?: boolean) => void -) => void; - -declare namespace e { - interface CorsOptions { - origin?: boolean | string | RegExp | string[] | RegExp[] | CustomOrigin; - methods?: string | string[]; - allowedHeaders?: string | string[]; - exposedHeaders?: string | string[]; - credentials?: boolean; - maxAge?: number; - preflightContinue?: boolean; - optionsSuccessStatus?: number; - } -} - -declare function e(options?: e.CorsOptions): express.RequestHandler; -export = e; diff --git a/cpy/index.d.ts b/cpy/index.d.ts deleted file mode 100644 index 039d0b84fb..0000000000 --- a/cpy/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -// Type definitions for cpy 5.0 -// Project: https://github.com/sindresorhus/cpy#readme -// Definitions by: Mohamed Hegazy -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export = cpy; -declare function cpy(src: string | string[], dest: string, opts?: { cwd?: string, parents?: boolean, rename?: (s: string) => string }): Promise; diff --git a/cpy/tslint.json b/cpy/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/cpy/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/crc/tslint.json b/crc/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/crc/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/croppie/index.d.ts b/croppie/index.d.ts deleted file mode 100644 index afd0c0112c..0000000000 --- a/croppie/index.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -// Type definitions for croppie 2.4 -// Project: https://github.com/Foliotek/Croppie -// Definitions by: Connor Peet -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export default class Croppie { - constructor(container: HTMLElement, options?: CroppieOptions); - - bind(options: { - url: string, - points?: number[], - orientation?: number, - zoom?: number, - useCanvas?: boolean, - }): Promise; - - result(options: ResultOptions & { type: 'base64' }): Promise; - result(options: ResultOptions & { type: 'html' }): Promise; - result(options: ResultOptions & { type: 'blob' }): Promise; - result(options: ResultOptions & { type: 'canvas' }): Promise; - result(options?: ResultOptions): Promise; - - rotate(degrees: 90 | 180 | 270 | -90 | -180 | -270): void; - - setZoom(zoom: number): void; - - destroy(): void; -} - - -export type CropType = 'square' | 'circle'; - -export type Format = 'jpeg' | 'png' | 'webp'; - -export interface ResultOptions { - size?: 'viewport' | 'original' | { width: number, height: number }; - format?: Format; - quality?: number; - circle?: boolean; -} - -export interface CroppieOptions { - boundary?: { width: number, height: number }; - customClass?: string; - enableExif?: boolean; - enableOrientation?: boolean; - enableZoom?: boolean; - enforceBoundary?: boolean; - mouseWheelZoom?: boolean; - showZoomer?: boolean; - viewport?: { width: number, height: number, type?: CropType }; -} diff --git a/croppie/tslint.json b/croppie/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/croppie/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/cryptojs/test/md5-tests.ts b/cryptojs/test/md5-tests.ts deleted file mode 100644 index d44496aae5..0000000000 --- a/cryptojs/test/md5-tests.ts +++ /dev/null @@ -1,73 +0,0 @@ -/// - - -YUI.add('algo-md5-test', function (Y) { - var C = CryptoJS; - - Y.Test.Runner.add(new Y.Test.Case({ - name: 'MD5', - - testVector1: function () { - Y.Assert.areEqual('d41d8cd98f00b204e9800998ecf8427e', C.MD5('').toString()); - }, - - testVector2: function () { - Y.Assert.areEqual('0cc175b9c0f1b6a831c399e269772661', C.MD5('a').toString()); - }, - - testVector3: function () { - Y.Assert.areEqual('900150983cd24fb0d6963f7d28e17f72', C.MD5('abc').toString()); - }, - - testVector4: function () { - Y.Assert.areEqual('f96b697d7cb7938d525a2f31aaf161d0', C.MD5('message digest').toString()); - }, - - testVector5: function () { - Y.Assert.areEqual('c3fcd3d76192e4007dfb496cca67e13b', C.MD5('abcdefghijklmnopqrstuvwxyz').toString()); - }, - - testVector6: function () { - Y.Assert.areEqual('d174ab98d277d9f5a5611c2c9f419d9f', C.MD5('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789').toString()); - }, - - testVector7: function () { - Y.Assert.areEqual('57edf4a22be3c955ac49da2e2107b67a', C.MD5('12345678901234567890123456789012345678901234567890123456789012345678901234567890').toString()); - }, - - testUpdateAndLongMessage: function () { - var md5 = C.algo.MD5.create(); - for (var i = 0; i < 100; i++) { - md5.update('12345678901234567890123456789012345678901234567890'); - } - - Y.Assert.areEqual('7d017545e0268a6a12f2b507871d0429', md5.finalize().toString()); - }, - - testClone: function () { - var md5 = C.algo.MD5.create(); - - Y.Assert.areEqual(C.MD5('a').toString(), md5.update('a').clone().finalize().toString()); - Y.Assert.areEqual(C.MD5('ab').toString(), md5.update('b').clone().finalize().toString()); - Y.Assert.areEqual(C.MD5('abc').toString(), md5.update('c').clone().finalize().toString()); - }, - - testInputIntegrity: function () { - var message = C.lib.WordArray.create([0x12345678]); - - var expected = message.toString(); - - C.MD5(message); - - Y.Assert.areEqual(expected, message.toString()); - }, - - testHelper: function () { - Y.Assert.areEqual(C.algo.MD5.create().finalize('').toString(), C.MD5('').toString()); - }, - - testHmacHelper: function () { - Y.Assert.areEqual(C.algo.HMAC.create(C.algo.MD5, C.enc.Hex.parse('0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b')).finalize('Hi There').toString(), C.HmacMD5('Hi There', C.enc.Hex.parse('0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b')).toString()); - } - })); -}, '$Rev$'); diff --git a/csv-parse/csv-parse-tests.ts b/csv-parse/csv-parse-tests.ts deleted file mode 100644 index 21df979d82..0000000000 --- a/csv-parse/csv-parse-tests.ts +++ /dev/null @@ -1,58 +0,0 @@ -import parse = require('csv-parse'); - -function callbackAPITest() { - var input = '#Welcome\n"1","2","3","4"\n"a","b","c","d"'; - parse(input, {comment: '#'}, function(err, output){ - output.should.eql([ [ '1', '2', '3', '4' ], [ 'a', 'b', 'c', 'd' ] ]); - }); -} - -function streamAPITest() { - let output:string[][] = []; - // Create the parser - var parser = parse({delimiter: ':'}); - let record: string[]; - // Use the writable stream api - parser.on('readable', function(){ - while(record = parser.read()){ - output.push(record); - } - }); - // Catch any error - parser.on('error', function(err: any){ - console.log(err.message); - }); - parser.on('finish', function(){ - console.log(output); - }); - // Now that setup is done, write data to the stream - parser.write("root:x:0:0:root:/root:/bin/bash\n"); - parser.write("someone:x:1022:1022:a funny cat:/home/someone:/bin/bash\n"); - // Close the readable stream - parser.end(); -} - -import fs = require('fs'); - -function pipeFunctionTest() { - var transform = require('stream-transform'); - - var output:any = []; - var parser = parse({delimiter: ':'}) - var input = fs.createReadStream('/etc/passwd'); - var transformer = transform(function(record: any[], callback: any){ - setTimeout(function(){ - callback(null, record.join(' ')+'\n'); - }, 500); - }, {parallel: 10}); - input.pipe(parser).pipe(transformer).pipe(process.stdout); -} - -import parseSync = require('csv-parse/lib/sync'); - -function syncApiTest() { - var input = '"key_1","key_2"\n"value 1","value 2"'; - var records = parseSync(input, {columns: true}); - records.should.eql([{ key_1: 'value 1', key_2: 'value 2' }]); -} - diff --git a/csv-parse/index.d.ts b/csv-parse/index.d.ts deleted file mode 100644 index 5cdfe164ef..0000000000 --- a/csv-parse/index.d.ts +++ /dev/null @@ -1,136 +0,0 @@ -// Type definitions for csv-parse 1.1.0 -// Project: https://github.com/wdavidw/node-csv-parse -// Definitions by: David Muller -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -declare module "csv-parse/types" { - interface callbackFn { - (err: any, output: any): void - } - - interface nameCallback { - (line1: any[]): boolean | string[] - } - - interface options { - /*** - * Set the field delimiter. One character only, defaults to comma. - */ - delimiter?: string; - - /*** - * String used to delimit record rows or a special value; special constants are 'auto', 'unix', 'mac', 'windows', 'unicode'; defaults to 'auto' (discovered in source or 'unix' if no source is specified). - */ - rowDelimiter?: string; - /*** - * Optional character surrounding a field, one character only, defaults to double quotes. - */ - quote?: string - - /*** - * Set the escape character, one character only, defaults to double quotes. - */ - escape?: string - - /*** - * List of fields as an array, a user defined callback accepting the first line and returning the column names or true if autodiscovered in the first CSV line, default to null, affect the result data set in the sense that records will be objects instead of arrays. - */ - columns?: any[]|boolean|nameCallback; - - /*** - * Treat all the characters after this one as a comment, default to '' (disabled). - */ - comment?: string - - /*** - * Name of header-record title to name objects by. - */ - objname?: string - - /*** - * Preserve quotes inside unquoted field. - */ - relax?: boolean - - /*** - * Discard inconsistent columns count, default to false. - */ - relax_column_count?: boolean - - /*** - * Dont generate empty values for empty lines. - */ - skip_empty_lines?: boolean - - /*** - * Maximum numer of characters to be contained in the field and line buffers before an exception is raised, used to guard against a wrong delimiter or rowDelimiter, default to 128000 characters. - */ - max_limit_on_data_read?: number - - /*** - * If true, ignore whitespace immediately around the delimiter, defaults to false. Does not remove whitespace in a quoted field. - */ - trim?: boolean - - /*** - * If true, ignore whitespace immediately following the delimiter (i.e. left-trim all fields), defaults to false. Does not remove whitespace in a quoted field. - */ - ltrim?: boolean - - /*** - * If true, ignore whitespace immediately preceding the delimiter (i.e. right-trim all fields), defaults to false. Does not remove whitespace in a quoted field. - */ - rtrim?: boolean - - /*** - * If true, the parser will attempt to convert read data types to native types. - */ - auto_parse?: boolean - - /*** - * If true, the parser will attempt to convert read data types to dates. It requires the "auto_parse" option. - */ - auto_parse_date?: boolean - } - - import * as stream from "stream"; - - interface Parser extends stream.Transform { - __push(line: any): any ; - __write(chars: any, end: any, callback: any): any; - } - - interface ParserConstructor { - new (options: options): Parser; - } - - interface ParserStream extends NodeJS.ReadWriteStream { - read(size?: number): any & string[]; - } - - interface parse { - (input: string, options?: options, callback?: callbackFn): any; - (options: options, callback: callbackFn): any; - (callback: callbackFn): any; - (options?: options): ParserStream; - Parser: ParserConstructor; - } -} - -declare module "csv-parse" { - import { parse as parseIntf } from "csv-parse/types"; - - let parse: parseIntf; - - export = parse; -} - -declare module "csv-parse/lib/sync" { - import { options } from "csv-parse/types"; - - function parse (input: string, options?: options): any; - - export = parse; -} \ No newline at end of file diff --git a/csv-parse/tsconfig.json b/csv-parse/tsconfig.json deleted file mode 100644 index 36611c4d1d..0000000000 --- a/csv-parse/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "csv-parse-tests.ts" - ] -} \ No newline at end of file diff --git a/csv-stringify/index.d.ts b/csv-stringify/index.d.ts deleted file mode 100644 index e65695c059..0000000000 --- a/csv-stringify/index.d.ts +++ /dev/null @@ -1,82 +0,0 @@ -// Type definitions for csv-stringify 1.0 -// Project: https://github.com/wdavidw/node-csv-stringify -// Definitions by: Rogier Schouten -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -declare namespace stringify { - interface StringifyOpts { - /** - * List of fields, applied when transform returns an object. - * Order matters, read the transformer documentation for additionnal information, - * columns are auto discovered when the user write object, see the "header" option on how to print columns names on the first line. - */ - columns?: string[]; - /** - * Set the field delimiter, one character only, defaults to a comma. - */ - delimiter?: string; - /** - * Add the value of "options.rowDelimiter" on the last line, default to true. - */ - eof?: boolean; - /** - * Defaults to the escape read option. - */ - escape?: boolean; - /** - * Display the column names on the first line if the columns option is provided or discovered. - */ - header?: boolean; - /** - * String used to delimit record rows or a special value; - * special values are 'auto', 'unix', 'mac', 'windows', 'unicode'; defaults to 'auto' (discovered in source or 'unix' if no source is specified). - */ - lineBreaks?: string; - /** - * Defaults to the quote read option. - */ - quote?: string; - /** - * Boolean, default to false, quote all the non-empty fields even if not required. - */ - quoted?: boolean; - /** - * Boolean, no default, quote empty fields? If specified, overrides quotedString for empty strings. - */ - quotedEmpty?: boolean; - /** - * Boolean, default to false, quote all fields of type string even if not required. - */ - quotedString?: boolean; - /** - * String used to delimit record rows or a special value; - * special values are 'auto', 'unix', 'mac', 'windows', 'unicode'; defaults to 'auto' (discovered in source or 'unix' if no source is specified). - */ - rowDelimiter?: string; - - } - - interface Stringifier extends NodeJS.ReadWriteStream { - // Stringifier stream takes array of strings or Object - write(line: string[] | any): boolean; - - // repeat declarations from NodeJS.WritableStream to avoid compile error - write(buffer: string | Buffer, cb?: () => void): boolean; - write(str: string, encoding?: string, cb?: () => void): boolean; - } -} - -/** - * Streaming stringifier - */ -declare function stringify(opts?: stringify.StringifyOpts): stringify.Stringifier; - -/** - * Callback version: string in --> callback with string out - */ -declare function stringify(input: any[][], opts: stringify.StringifyOpts, callback: (error: Error | undefined, output: string) => void): void; -declare function stringify(input: any[][], callback: (error: Error | undefined, output: string) => void): void; - -export = stringify; diff --git a/csv-stringify/tslint.json b/csv-stringify/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/csv-stringify/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/cucumber/cucumber-tests.ts b/cucumber/cucumber-tests.ts deleted file mode 100644 index 3eb86b223f..0000000000 --- a/cucumber/cucumber-tests.ts +++ /dev/null @@ -1,134 +0,0 @@ -import * as assert from "power-assert"; -import cucumber = require("cucumber"); - -function StepSample() { - type Callback = cucumber.CallbackStepDefinition; - type Table = cucumber.TableDefinition; - type HookScenario = cucumber.HookScenario; - type Hooks = cucumber.Hooks; - var step = this; - var hook = this; - - hook.setWorldConstructor(function() { - this.visit = function(url: string, callback: Callback) { - callback(null, 'pending'); - } - }) - - hook.Before(function(scenario: HookScenario, callback: Callback){ - scenario.isFailed() && callback.pending(); - }); - - hook.Around(function(scenario: HookScenario, runScenario: (error:string, callback?:Function)=>void) { - scenario.isFailed() && runScenario(null, function(){ - console.log('finish tasks'); - }); - }); - - hook.registerHandler('AfterFeatures', function (event:any, callback:Function) { - 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(null, '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)); - } - }); - - // Type for data_table.js on - // https://github.com/cucumber/cucumber-js/blob/a5fd8251918c278ab2e389226d165cedb44df14a/lib/cucumber/ast/data_table.js - - step.Given(/^a table step with Table raw$/, function(table:Table){ - var expected = [ - ['Cucumber', 'Cucumis sativus'], - ['Burr Gherkin', 'Cucumis anguria'] - ]; - - assert.deepEqual(table.raw(), expected); - }); - - step.Given(/^a table step with Table rows$/, function(table: Table){ - var expected = [ - ['Apricot', '5'], - ['Brocolli', '2'], - ['Cucumber', '10'] - ]; - assert.deepEqual(table.rows(), expected) - }); - - step.Given(/^a table step with Table rowHash$/, function(table:Table){ - var expected = { - 'Cucumber': 'Cucumis sativus', - 'Burr Gherkin': 'Cucumis anguria' - }; - assert.deepEqual(table.rowsHash(), expected) - }); - - step.Given(/^a table step$/, function(table:Table){ - var expected = [ - {'Vegetable': 'Apricot', 'Rating': '5'}, - {'Vegetable': 'Brocolli', 'Rating': '2'}, - {'Vegetable': 'Cucumber', 'Rating': '10'} - ]; - assert.deepEqual(table.hashes(), expected) - }); - - cucumber.defineSupportCode(function(step: cucumber.StepDefinitions){ - step.Given( /^a variable set to (\d+)$/, (x:string) => { - console.log("the number is: " + x); - } ); - }); - cucumber.defineSupportCode(function(step: Hooks){ - step.After((scenario: HookScenario, callback?: Callback) => { - console.log("After"); - callback(); - } ) - }); - - cucumber.defineSupportCode(function(hook: cucumber.Hooks){ - hook.addTransform({ - captureGroupRegexps: ['red|blue|green'], - transformer: (arg: string) => arg, - typeName: 'color' - }); - }); - - cucumber.defineSupportCode(function({After, Given}) { - Given( /^a variable set to (\d+)$/, (x:string) => { - console.log("the number is: " + x); - }); - After((scenario: HookScenario, callback?: Callback) => { - console.log("After"); - callback(); - }); - }); - - let fns : cucumber.SupportCodeConsumer[] = cucumber.getSupportCodeFns() - - cucumber.clearSupportCodeFns(); -} - -function registerListener(): cucumber.EventListener { - let listener = Object.assign(cucumber.Listener(), { - handleBeforeScenarioEvent: (scenario: cucumber.events.ScenarioPayload, callback: () => void) => { - - // do some interesting stuff ... - - callback(); - } - }); - - return listener; -} diff --git a/cucumber/index.d.ts b/cucumber/index.d.ts deleted file mode 100644 index 99f31c5372..0000000000 --- a/cucumber/index.d.ts +++ /dev/null @@ -1,224 +0,0 @@ -// Type definitions for cucumber-js -// Project: https://github.com/cucumber/cucumber-js -// Definitions by: Abraão Alves , Jan Molak -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export = cucumber; - -declare namespace cucumber { - - export interface CallbackStepDefinition{ - pending : () => PromiseLike; - (error?:any, pending?: string):void; - } - - export interface TableDefinition{ - raw: () => Array; - rows: () => Array; - rowsHash: () => {}; - hashes: () => {}; - } - - type StepDefinitionParam = string | CallbackStepDefinition | TableDefinition; - - interface StepDefinitionCode { - (...stepArgs: Array): PromiseLike | 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{ - getKeyword():string; - getName():string; - getDescription():string; - getUri():string; - getLine():number; - getTags():string[]; - getException():Error; - getAttachments():any[]; - attach(data:any, mimeType?:string, callback?:(err?:any) => void):void; - isSuccessful():boolean; - isFailed():boolean; - isPending():boolean; - isUndefined():boolean; - isSkipped():boolean; - } - - interface HookCode { - (scenario: HookScenario, callback?: CallbackStepDefinition): void; - } - - interface AroundCode{ - (scenario: HookScenario, runScenario?: (error:string, callback?:Function)=>void): void; - } - - interface Transform { - captureGroupRegexps: Array; - transformer: (arg: string) => any; - typeName: string; - } - - export interface Hooks { - Before(code: HookCode): void; - After(code: HookCode): void; - Around(code: AroundCode):void; - setDefaultTimeout(time:number): void; - setWorldConstructor(world: () => void): void; - registerHandler(handlerOption:string, code:(event:any, callback:CallbackStepDefinition) =>void): void; - registerListener(listener: EventListener): void; - addTransform(transform: Transform): void; - } - - export class EventListener { - hear(event: events.Event, callback: ()=>void): void; - hasHandlerForEvent(event: events.Event): boolean; - buildHandlerNameForEvent(event: events.Event): string; - getHandlerForEvent(event: events.Event): EventHook; - buildHandlerName(shortName: string): string; - setHandlerForEvent(shortName: string, handler: EventListener): void; - } - - export function Listener(): EventListener; - - export namespace events { - - interface Event { - getName(): string; - getPayloadItem(name: string): EventPayload; - } - - interface EventPayload { - } - - interface FeaturesPayload extends EventPayload { - getFeatures(): any[]; // https://github.com/cucumber/cucumber-js/blob/dc698bf5bc10d591fa7adeec5fa21b2d90dc9679/lib/cucumber/runtime.js#L34 - } - - interface FeaturesResultPayload extends EventPayload { - getDuration(): any; - getScenarioCounts(): any; - getStepCounts(): any; - isSuccessful(): boolean; - } - - interface FeaturePayload extends EventPayload { - getStepKeywordByLines(): any; - getScenarioKeyword(): string; - getKeyword(): string; - getName(): string; - getDescription(): string; - getUri(): string; - getLine(): number; - getTags(): Tag[]; - getScenarios(): ScenarioPayload[]; - getPayloadItem(): FeaturePayload; - } - - interface ScenarioPayload extends EventPayload { - getName(): string; - getKeyword(): string; - getDescription(): string; - getFeature(): FeaturePayload; - getUri(): string; - getUris(): string[]; - getLine(): number; - getLines(): number[]; - getTags(): Tag[]; - getSteps(): any[]; - getPayloadItem(): ScenarioPayload; - } - - interface ScenarioResultPayload extends EventPayload { - getFailureException(): Error; - getScenario(): any; - getStatus(): any; - } - - interface StepPayload extends EventPayload { - isHidden(): boolean; - isOutlineStep(): boolean; - getKeyword(): string; - getName(): string; - hasUri(): boolean; - getUri(): string; - getLine(): number; - getPreviousStep(): any; - hasPreviousStep(): boolean; - getAttachment(): any; - getAttachmentContents(): any; - getDocString(): string; - getDataTable(): any; - hasAttachment(): boolean; - hasDocString(): boolean; - hasDataTable(): boolean; - ensureDataTableIsAttached(): void; - isOutcomeStep(): boolean; - isEventStep(): boolean; - hasOutcomeStepKeyword(): boolean; - hasEventStepKeyword(): boolean; - isRepeatingOutcomeStep(): boolean; - isRepeatingEventStep(): boolean; - hasRepeatStepKeyword(): boolean; - isPrecededByOutcomeStep(): boolean; - isPrecededByEventStep(): boolean; - } - - interface StepResultPayload extends EventPayload { - getAmbiguousStepDefinitions(): any[]; - getAttachments(): any[]; - getDuration(): any; - getFailureException(): Error; - getStep(): any; - getStepDefinition(): any; - getStatus(): any; - hasAttachments(): boolean; - } - - } - - interface Tag { - getName(): string; - getLine(): number; - } - - export interface Scenario { - getKeyword(): string; - getName(): string; - getDescription(): string; - getUri(): string; - getLine(): number; - getTags(): Tag[]; - getException(): Error; - getAttachments(): any[]; - attach(data: any, mimeType?: string, callback?: (err?: any) => void): void; - isSuccessful(): boolean; - isFailed(): boolean; - isPending(): boolean; - isUndefined(): boolean; - isSkipped(): boolean; - } - - interface EventHook { - (event: events.Event, callback?: ()=>void): void; - } - - export interface SupportCodeConsumer { - (stepDefinitions:StepDefinitions & Hooks):void; - } - - export function defineSupportCode(consumer:SupportCodeConsumer): void; - export function getSupportCodeFns(): SupportCodeConsumer[]; - export function clearSupportCodeFns(): void; -} diff --git a/cuid/cuid-tests.ts b/cuid/cuid-tests.ts deleted file mode 100644 index 82defb5fae..0000000000 --- a/cuid/cuid-tests.ts +++ /dev/null @@ -1,4 +0,0 @@ - -import cuid = require('cuid') - -var result: string = cuid(); \ No newline at end of file diff --git a/cuid/index.d.ts b/cuid/index.d.ts deleted file mode 100644 index d7979eefcd..0000000000 --- a/cuid/index.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -// Type definitions for cuid -// Project: https://github.com/ericelliott/cuid -// Definitions by: Dave Keen -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - - -declare function cuid(): string; - -export = cuid diff --git a/currency-formatter/currencies.d.ts b/currency-formatter/currencies.d.ts deleted file mode 100644 index 163bd578de..0000000000 --- a/currency-formatter/currencies.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { currencies } from "./index"; -export = currencies; \ No newline at end of file diff --git a/currency-formatter/tslint.json b/currency-formatter/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/currency-formatter/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/d3-array/index.d.ts b/d3-array/index.d.ts deleted file mode 100644 index d938a8c032..0000000000 --- a/d3-array/index.d.ts +++ /dev/null @@ -1,352 +0,0 @@ -// Type definitions for D3JS d3-array module 1.1 -// Project: https://github.com/d3/d3-array -// Definitions by: Alex Ford , Boris Yankov , Tom Wanzek -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -// Last module patch version validated against: 1.1.0 - -// -------------------------------------------------------------------------- -// Shared Types and Interfaces -// -------------------------------------------------------------------------- - - -/** - * Administrivia: JavaScript primitive types and Date - */ -export type Primitive = number | string | boolean | Date; - -/** - * Administrivia: anything with a valueOf(): number method is comparable, so we allow it in numeric operations - */ -interface Numeric { - valueOf(): number; -} - -// -------------------------------------------------------------------------------------- -// Descriptive Statistics -// -------------------------------------------------------------------------------------- - - -/** - * Return the maximum value in the array of strings using natural order. - */ -export function max(array: string[]): string | undefined; - -/** - * Return the maximum value in the array of numbers using natural order. - */ -export function max(array: T[]): T | undefined; - -/** - * Return the maximum value in the array using natural order and a projection function to map values to strings. - */ -export function max(array: T[], accessor: (datum: T, index: number, array: T[]) => string | undefined | null): string | undefined; - -/** - * Return the maximum value in the array using natural order and a projection function to map values to easily-sorted values. - */ -export function max(array: T[], accessor: (datum: T, index: number, array: T[]) => U | undefined | null): U | undefined; - -/** - * Return the minimum value in the array using natural order. - */ -export function min(array: string[]): string | undefined; - -/** - * Return the minimum value in the array using natural order. - */ -export function min(array: T[]): T | undefined; - -/** - * Return the minimum value in the array using natural order. - */ -export function min(array: T[], accessor: (datum: T, index: number, array: T[]) => string | undefined | null): string | undefined; - -/** - * Return the minimum value in the array using natural order. - */ -export function min(array: T[], accessor: (datum: T, index: number, array: T[]) => U | undefined | null): U | undefined; - - - -/** - * Return the min and max simultaneously. - */ -export function extent(array: string[]): [string, string] | [undefined, undefined]; - -/** - * Return the min and max simultaneously. - */ -export function extent(array: T[]): [T, T] | [undefined, undefined]; - -/** - * Return the min and max simultaneously. - */ -export function extent(array: T[], accessor: (datum: T, index: number, array: T[]) => string | undefined | null): [string, string] | [undefined, undefined]; - -/** - * Return the min and max simultaneously. - */ -export function extent(array: T[], accessor: (datum: T, index: number, array: T[]) => U | undefined | null): [U, U] | [undefined, undefined]; - -/** - * Return the mean of an array of numbers - */ -export function mean(array: Array): number | undefined; -export function mean(array: T[], accessor: (datum: T, index: number, array: T[]) => number | undefined | null): number | undefined; - -/** - * Return the median of an array of numbers - */ -export function median(array: Array): number | undefined; -export function median(array: T[], accessor: (element: T, i: number, array: T[]) => number | undefined | null): number | undefined; - -/** - * Returns the p-quantile of an array of numbers - */ -export function quantile(array: Array, p: number): number | undefined; -export function quantile(array: T[], p: number, accessor: (element: T, i: number, array: T[]) => number | undefined | null): number | undefined; - -/** - * Compute the sum of an array of numbers. - */ -export function sum(array: Array): number; - -/** - * Compute the sum of an array, using the given accessor to convert values to numbers. - */ -export function sum(array: T[], accessor: (datum: T, index: number, array: T[]) => number | undefined | null): number; - -/** - * Compute the standard deviation, defined as the square root of the bias-corrected variance, of the given array of numbers. - */ -export function deviation(array: Array): number | undefined; - -/** - * Compute the standard deviation, defined as the square root of the bias-corrected variance, of the given array, - * using the given accessor to convert values to numbers. - */ -export function deviation(array: T[], accessor: (datum: T, index: number, array: T[]) => number | undefined | null): number | undefined; - -/** - * Compute an unbiased estimator of the population variance of the given array of numbers. - */ -export function variance(array: Array): number | undefined; - -/** - * Compute an unbiased estimator of the population variance of the given array, - * using the given accessor to convert values to numbers. - */ -export function variance(array: T[], accessor: (datum: T, index: number, array: T[]) => number | undefined | null): number | undefined; - - -// -------------------------------------------------------------------------------------- -// Searching Arrays -// -------------------------------------------------------------------------------------- - -export function scan(array: number[], comparator?: (a: number, b: number) => number): number | undefined; -export function scan(array: T[], comparator: (a: T, b: T) => number): number | undefined; - -export function bisectLeft(array: number[], x: number, lo?: number, hi?: number): number; -export function bisectLeft(array: string[], x: string, lo?: number, hi?: number): number; -export function bisectLeft(array: Date[], x: Date, lo?: number, hi?: number): number; - -export function bisectRight(array: number[], x: number, lo?: number, hi?: number): number; -export function bisectRight(array: string[], x: string, lo?: number, hi?: number): number; -export function bisectRight(array: Date[], x: Date, lo?: number, hi?: number): number; - -export var bisect: typeof bisectRight; - -export interface Bisector { - left: (array: T[], x: U, lo?: number, hi?: number) => number; - right: (array: T[], x: U, lo?: number, hi?: number) => number; -} - -export function bisector(comparator: (a: T, b: U) => number): Bisector; -export function bisector(accessor: (x: T) => U): Bisector; - -// NB. this is limited to primitive values due to D3's use of the <, >, and >= operators. Results get weird for object instances. -/** - * Compares two primitive values for sorting (in ascending order). - */ -export function ascending(a: Primitive | undefined, b: Primitive | undefined): number; - -// NB. this is limited to primitive values due to D3's use of the <, >, and >= operators. Results get weird for object instances. -/** - * Compares two primitive values for sorting (in ascending order). - */ -export function descending(a: Primitive | undefined, b: Primitive | undefined): number; - -// -------------------------------------------------------------------------------------- -// Transforming Arrays -// -------------------------------------------------------------------------------------- - -/** - * Returns the Cartesian product of the two arrays a and b. - * For each element i in the specified array a and each element j in the specified array b, in order, - * it creates a two-element array for each pair. - * - * @param a First input array. - * @param b Second input array. - */ -export function cross(a: S[], b: T[]): Array<[S, T]>; - -/** - * Returns the Cartesian product of the two arrays a and b. - * For each element i in the specified array a and each element j in the specified array b, in order, - * invokes the specified reducer function passing the element i and element j. - * - * @param a First input array. - * @param b Second input array. - * @param reducer A reducer function taking as input an element from "a" and "b" and returning a reduced value. - */ -export function cross(a: S[], b: T[], reducer: (a: S, b: T) => U): U[]; - -/** - * Merges the specified arrays into a single array. - */ -export function merge(arrays: T[][]): T[]; - -/** - * For each adjacent pair of elements in the specified array, returns a new array of tuples of elements i and i - 1. - * Returns the empty array if the input array has fewer than two elements. - * - * @param array Array of input elements - */ -export function pairs(array: T[]): Array<[T, T]>; -/** - * For each adjacent pair of elements in the specified array, in order, invokes the specified reducer function passing the element i and element i - 1. - * Returns the resulting array of pair-wise reduced elements. - * Returns the empty array if the input array has fewer than two elements. - * - * @param array Array of input elements - * @param reducer A reducer function taking as input to adjecent elements of the input array and returning a reduced value. - */ -export function pairs(array: T[], reducer: (a: T, b: T) => U): U[]; - -/** - * Given the specified array, return an array corresponding to the list of indices in 'keys'. - */ -export function permute(array: { [key: number]: T }, keys: number[]): T[]; - -/** - * Given the specified object, return an array corresponding to the list of property names in 'keys'. - */ -export function permute(object: { [key: string]: T }, keys: string[]): T[]; - -/** - * Generates a 0-based numeric sequence. The output range does not include 'stop'. - */ -export function range(stop: number): number[]; - -/** - * Generates a numeric sequence starting from the given start and stop values. 'step' defaults to 1. The output range does not include 'stop'. - */ -export function range(start: number, stop: number, step?: number): number[]; - - -/** - * Randomizes the order of the specified array using the Fisher–Yates shuffle. - */ -export function shuffle(array: T[], lo?: number, hi?: number): T[]; - -/** - * Generate an array of approximately count + 1 uniformly-spaced, nicely-rounded values between start and stop (inclusive). - */ -export function ticks(start: number, stop: number, count: number): number[]; - -/** - * Generate an array of with the differences between adjecent ticks, had the same arguments - * been passed to ticks(start, stop, count) - */ -export function tickStep(start: number, stop: number, count: number): number[]; - - -/** - * Transpose a matrix provided in Array of Arrays format. - */ -export function transpose(matrix: T[][]): T[][]; - - -/** - * Returns an array of arrays, where the ith array contains the ith element from each of the argument arrays. - * The returned array is truncated in length to the shortest array in arrays. If arrays contains only a single array, the returned array - * contains one-element arrays. With no arguments, the returned array is empty. - */ -export function zip(...arrays: T[][]): T[][]; - -// -------------------------------------------------------------------------------------- -// Histogram -// -------------------------------------------------------------------------------------- - -export interface Bin extends Array { - x0: Value; - x1: Value; -} - -/** - * Type definition for threshold generator which returns the count of recommended thresholds - */ -export type ThresholdCountGenerator = (values: number[], min?: number, max?: number) => number; - -/** - * Type definition for threshold generator which returns an array of recommended thresholds - */ -export type ThresholdArrayGenerator = (values: Value[], min?: Value, max?: Value) => Value[]; - - - -export interface HistogramGenerator { - (data: Datum[]): Array>; - value(): (d: Datum, i: number, data: Datum[]) => Value; - value(valueAccessor: (d: Datum, i: number, data: Datum[]) => Value): this; - domain(): (values: Value[]) => [Value, Value]; - domain(domain: [Value, Value]): this; - domain(domainAccessor: (values: Value[]) => [Value, Value]): this; - thresholds(): ThresholdCountGenerator | ThresholdArrayGenerator; - /** - * Divide the domain uniformly into approximately count bins. IMPORTANT: This threshold - * setting approach only works, when the materialized values are numbers! - * - * @param count The desired number of uniform bins. - */ - thresholds(count: number): this; - /** - * Set a threshold accessor function, which returns the desired number of bins. - * Divides the domain uniformly into approximately count bins. IMPORTANT: This threshold - * setting approach only works, when the materialized values are numbers! - * - * @param count A function which accepts as arguments the array of materialized values, and - * optionally the domain minimum and maximum. The function calcutates and returns the suggested - * number of bins. - */ - thresholds(count: ThresholdCountGenerator): this; - /** - * Set the array of values to be used as thresholds in determining the bins. - * @param thresholds Array of threshold values used for binning. The elements must - * be of the same type as the materialized values of the histogram. - */ - thresholds(thresholds: Value[]): this; - /** - * Set a threshold accessor function, which returns the array of values to be used as - * thresholds in determining the bins. - * - * @param thresholds A function which accepts as arguments the array of materialized values, and - * optionally the domain minimum and maximum. The function calcutates and returns the array of values to be used as - * thresholds in determining the bins. - */ - thresholds(thresholds: ThresholdArrayGenerator): this; -} - -export function histogram(): HistogramGenerator; -export function histogram(): HistogramGenerator; - -// -------------------------------------------------------------------------------------- -// Histogram Thresholds -// -------------------------------------------------------------------------------------- - -export function thresholdFreedmanDiaconis(values: number[], min: number, max: number): number; // of type ThresholdCountGenerator - -export function thresholdScott(values: number[], min: number, max: number): number; // of type ThresholdCountGenerator - -export function thresholdSturges(values: number[]): number; // of type ThresholdCountGenerator diff --git a/d3-array/tslint.json b/d3-array/tslint.json deleted file mode 100644 index 68d10d72a6..0000000000 --- a/d3-array/tslint.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "../tslint.json", - "rules": { - "unified-signatures": false - } -} diff --git a/d3-axis/index.d.ts b/d3-axis/index.d.ts deleted file mode 100644 index cd8ed94714..0000000000 --- a/d3-axis/index.d.ts +++ /dev/null @@ -1,294 +0,0 @@ -// Type definitions for D3JS d3-axis module 1.0 -// Project: https://github.com/d3/d3-axis/ -// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -// Last module patch version validated against: 1.0.4 - -import { Selection, TransitionLike } from 'd3-selection'; - -// -------------------------------------------------------------------------- -// Shared Types and Interfaces -// -------------------------------------------------------------------------- - - -/** - * A helper interface to describe the minimal contract to be met by a time interval - * which can be passed into the Axis.ticks(...) or Axis.tickArguments(...) methods when - * creating time series axes. Under normal circumstances the argument will be of type - * TimeInterval or CountableTimeInterval as defined in d3-time. - * NB: This helper interface has been created to avoid tight coupling of d3-axis to - * d3-time at the level of definition files. I.e. d3-time is not a - * dependency of d3-axis in the D3 Javascript implementation. This minimal contract - * is based on an analysis of how d3-axis passes a time interval argument into a time scale, - * if a time scale was set using Axis.scale(...). And in turn on how a time scale uses - * the time interval when creating ticks from it. - */ -export interface AxisTimeInterval { - range(start: Date, stop: Date, step?: number): Date[]; -} - -/** - * A helper interface to which a scale passed into axis must conform (at a minimum) - * for axis to use the scale without error - */ -export interface AxisScale { - (x: Domain): number | undefined; - domain(): Domain[]; - range(): number[]; - copy(): this; - bandwidth?(): number; - // TODO: Reconsider the below, note that the compiler does not differentiate the overloads w.r.t. optionality - // ticks?(count?: number): Domain[]; - // ticks?(count?: AxisTimeInterval): Date[]; - // tickFormat?(count?: number, specifier?: string): ((d: number) => string); - // tickFormat?(count?: number | AxisTimeInterval, specifier?: string): ((d: Date) => string); -} - -/** - * A helper type to alias elements which can serve as a container for an axis - */ -export type AxisContainerElement = SVGSVGElement | SVGGElement; - -/** - * Interface defining an axis generator. The generic is the type of the axis domain - */ -export interface Axis { - /** - * Render the axis to the given context. - * - * @param context A selection of SVG containers (either SVG or G elements). - */ - (context: Selection): void; - - /** - * Render the axis to the given context. - * - * @param context A transition defined on SVG containers (either SVG or G elements). - */ - (context: TransitionLike): void; - - /** - * Gets the current scale underlying the axis. - */ - scale>(): A; - - /** - * Sets the scale and returns the axis. - * - * @param scale The scale to be used for axis generation - */ - scale(scale: AxisScale): this; - - /** - * Sets the arguments that will be passed to scale.ticks and scale.tickFormat when the axis is rendered, and returns the axis generator. - * - * @param count Number of ticks that should be rendered - * @param specifier An optional format specifier to customize how the tick values are formatted. - */ - ticks(count: number, specifier?: string): this; - - /** - * Sets the arguments that will be passed to scale.ticks and scale.tickFormat when the axis is rendered, and returns the axis generator. - * Use with a TIME SCALE ONLY. - * - * @param interval A time interval used to generate date-based ticks. This is typically a TimeInterval/CountableTimeInterval as defined - * in d3-time. E.g. as obtained by passing in d3.timeMinute.every(15). - * @param specifier An optional format specifier to customize how the tick values are formatted. - */ - ticks(interval: AxisTimeInterval, specifier?: string): this; - - /** - * Sets the arguments that will be passed to scale.ticks and scale.tickFormat when the axis is rendered, and returns the axis generator. - */ - ticks(arg0: any, ...args: any[]): this; - - /** - * Get an array containing the currently set arguments to be passed into scale.ticks and scale.tickFormat. - */ - tickArguments(): any[]; - - /** - * Sets the arguments that will be passed to scale.ticks and scale.tickFormat when the axis is rendered, and returns the axis generator. - * - * @param args An array containing a single element representing the count, i.e. number of ticks to be rendered. - */ - tickArguments(args: [number]): this; - - /** - * Sets the arguments that will be passed to scale.ticks and scale.tickFormat when the axis is rendered, and returns the axis generator. - * - * @param args An array containing two elements. The first element represents the count, i.e. number of ticks to be rendered. The second - * element is a string representing the format specifier to customize how the tick values are formatted. - */ - tickArguments(args: [number, string]): this; - - /** - * Sets the arguments that will be passed to scale.ticks and scale.tickFormat when the axis is rendered, and returns the axis generator. - * Use with a TIME SCALE ONLY. - * - * @param args An array containing a single element representing a time interval used to generate date-based ticks. - * This is typically a TimeInterval/CountableTimeInterval as defined in d3-time. E.g. as obtained by passing in d3.timeMinute.every(15). - */ - tickArguments(args: [AxisTimeInterval]): this; - - /** - * Sets the arguments that will be passed to scale.ticks and scale.tickFormat when the axis is rendered, and returns the axis generator. - * Use with a TIME SCALE ONLY. - * - * @param args An array containing two elements. The first element represents a time interval used to generate date-based ticks. - * This is typically a TimeInterval/CountableTimeInterval as defined in d3-time. E.g. as obtained by passing in d3.timeMinute.every(15). - * The second element is a string representing the format specifier to customize how the tick values are formatted. - */ - tickArguments(args: [AxisTimeInterval, string]): this; - - /** - * Sets the arguments that will be passed to scale.ticks and scale.tickFormat when the axis is rendered, and returns the axis generator. - * - * @param args An array with arguments suitable for the scale to be used for tick generation - */ - tickArguments(args: any[]): this; - - /** - * Returns the current tick values, which defaults to null. - */ - tickValues(): Domain[] | null; - - /** - * Specified values to be used for ticks rather than using the scale’s automatic tick generator. - * The explicit tick values take precedent over the tick arguments set by axis.tickArguments. - * However, any tick arguments will still be passed to the scale’s tickFormat function if a - * tick format is not also set. - * - * @param values An array with values from the Domain of the scale underlying the axis. - */ - tickValues(values: Domain[]): this; - - /** - * Clears any previously-set explicit tick values and reverts back to the scale’s tick generator. - * - * @param values null - */ - tickValues(values: null): this; - - - /** - * Returns the currently set tick format function, which defaults to null. - */ - tickFormat(): ((domainValue: Domain, index: number) => string) | null; - - /** - * Sets the tick format function and returns the axis. - * - * @param format A function mapping a value from the axis Domain to a formatted string - * for display purposes. When invoked, the format function is also passed a second argument representing the zero-based index - * of the tick label in the array of generated tick labels. - */ - tickFormat(format: (domainValue: Domain, index: number) => string): this; - - /** - * Reset the tick format function. A null format indicates that the scale’s - * default formatter should be used, which is generated by calling scale.tickFormat. - * In this case, the arguments specified by axis.tickArguments - * are likewise passed to scale.tickFormat. - * - * @param format null - */ - tickFormat(format: null): this; - - /** - * Get the current inner tick size, which defaults to 6. - */ - tickSize(): number; - /** - * Set the inner and outer tick size to the specified value and return the axis. - * - * @param size Tick size in pixels (Default is 6). - */ - tickSize(size: number): this; - - /** - * Get the current inner tick size, which defaults to 6. - * The inner tick size controls the length of the tick lines, - * offset from the native position of the axis. - */ - tickSizeInner(): number; - - /** - * Set the inner tick size to the specified value and return the axis. - * The inner tick size controls the length of the tick lines, - * offset from the native position of the axis. - * - * @param size Tick size in pixels (Default is 6). - */ - tickSizeInner(size: number): this; - - /** - * Get the current outer tick size, which defaults to 6. - * The outer tick size controls the length of the square ends of the domain path, - * offset from the native position of the axis. Thus, the “outer ticks” are not actually - * ticks but part of the domain path, and their position is determined by the associated - * scale’s domain extent. Thus, outer ticks may overlap with the first or last inner tick. - * An outer tick size of 0 suppresses the square ends of the domain path, - * instead producing a straight line. - */ - tickSizeOuter(): number; - - /** - * Set the current outer tick size and return the axis. - * The outer tick size controls the length of the square ends of the domain path, - * offset from the native position of the axis. Thus, the “outer ticks” are not actually - * ticks but part of the domain path, and their position is determined by the associated - * scale’s domain extent. Thus, outer ticks may overlap with the first or last inner tick. - * An outer tick size of 0 suppresses the square ends of the domain path, - * instead producing a straight line. - * - * @param size Tick size in pixels (Default is 6). - */ - tickSizeOuter(size: number): this; - - /** - * Get the current padding, which defaults to 3. - */ - tickPadding(): number; - - /** - * Set the current padding and return the axis. - * - * @param padding Padding in pixels (Default is 3). - */ - tickPadding(padding: number): this; - -} - -/** - * Constructs a new top-oriented axis generator for the given scale, with empty tick arguments, - * a tick size of 6 and padding of 3. In this orientation, ticks are drawn above the horizontal domain path. - * - * @param scale The scale to be used for axis generation - */ -export function axisTop(scale: AxisScale): Axis; - -/** - * Constructs a new right-oriented axis generator for the given scale, with empty tick arguments, - * a tick size of 6 and padding of 3. In this orientation, ticks are drawn to the right of the vertical domain path. - * - * @param scale The scale to be used for axis generation - */ -export function axisRight(scale: AxisScale): Axis; - -/** - * Constructs a new bottom-oriented axis generator for the given scale, with empty tick arguments, - * a tick size of 6 and padding of 3. In this orientation, ticks are drawn below the horizontal domain path. - * - * @param scale The scale to be used for axis generation - */ -export function axisBottom(scale: AxisScale): Axis; - -/** - * Constructs a new left-oriented axis generator for the given scale, with empty tick arguments, - * a tick size of 6 and padding of 3. In this orientation, ticks are drawn to the left of the vertical domain path. - * - * @param scale The scale to be used for axis generation - */ -export function axisLeft(scale: AxisScale): Axis; diff --git a/d3-axis/tslint.json b/d3-axis/tslint.json deleted file mode 100644 index 68d10d72a6..0000000000 --- a/d3-axis/tslint.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "../tslint.json", - "rules": { - "unified-signatures": false - } -} diff --git a/d3-brush/index.d.ts b/d3-brush/index.d.ts deleted file mode 100644 index 5c89465bce..0000000000 --- a/d3-brush/index.d.ts +++ /dev/null @@ -1,248 +0,0 @@ -// Type definitions for D3JS d3-brush module 1.0 -// Project: https://github.com/d3/d3-brush/ -// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -// Last module patch version validated against: 1.0.3 - -import { ArrayLike, Selection, TransitionLike, ValueFn } from 'd3-selection'; - -/** - * Type alias for a BrushSelection. For a two-dimensional brush, it must be defined as [[x0, y0], [x1, y1]], - * where x0 is the minimum x-value, y0 is the minimum y-value, x1 is the maximum x-value, and y1 is the maximum y-value. - * For an x-brush, it must be defined as [x0, x1]; for a y-brush, it must be defined as [y0, y1]. - */ -export type BrushSelection = [[number, number], [number, number]] | [number, number]; - -/** - * A D3 brush behavior - * - * The generic refers to the type of the datum for the group element on which brush behavior is defined. - */ -export interface BrushBehavior { - /** - * Applies the brush to the specified group, which must be a selection of SVG G elements. - * This function is typically not invoked directly, and is instead invoked via selection.call. - * - * For details see: {@link https://github.com/d3/d3-brush#_brush} - * - * @param group A D3 selection of SVG G elements. - * @param args Optional arguments to be passed in. - */ - (group: Selection, ...args: any[]): void; - /** - * Clear the active selection of the brush on the specified SVG G element(s) selection. - * - * @param group A D3 selection of SVG G elements. - * @param selection Use null to clear the active brush selection. - */ - move(group: Selection, selection: null): void; - /** - * Sets the active selection of the brush on the specified SVG G element(s) selection - * to the provided array. - * - * @param group A D3 selection of SVG G elements. - * @param selection An array specifying the new active brush selection. For a two-dimensional brush, - * it must be defined as [[x0, y0], [x1, y1]], where x0 is the minimum x-value, y0 is the minimum y-value, - * x1 is the maximum x-value, and y1 is the maximum y-value. For an x-brush, it must be defined as [x0, x1]; - * for a y-brush, it must be defined as [y0, y1]. - */ - move(group: Selection, selection: BrushSelection): void; - /** - * Sets the active selection of the brush on the specified SVG G element(s) selection - * based on the array returned by a value function invoked for each selection element. - * - * @param group A D3 selection of SVG G elements. - * @param selection A selection value function which is evaluated for each selected element, - * in order, being passed the current datum (d), the current index (i), and the current group (nodes), - * with this as the current DOM element. The function returns an array specifying the new active brush selection. - * For a two-dimensional brush, it must be defined as [[x0, y0], [x1, y1]], where x0 is the minimum x-value, y0 is the minimum y-value, - * x1 is the maximum x-value, and y1 is the maximum y-value. For an x-brush, it must be defined as [x0, x1]; - * for a y-brush, it must be defined as [y0, y1]. - */ - move(group: Selection, selection: ValueFn): void; - /** - * Clear the active selection of the brush on the specified SVG G element(s) transition. - * - * @param group A D3 transition on SVG G elements. - * @param selection Use null to clear the active brush selection. - */ - move(group: Selection, selection: null): void; - /** - * Sets the active selection of the brush on the specified SVG G element(s) transition - * to the provided array. - * - * @param group A D3 transition on SVG G elements. - * @param selection An array specifying the new active brush selection. For a two-dimensional brush, - * it must be defined as [[x0, y0], [x1, y1]], where x0 is the minimum x-value, y0 is the minimum y-value, - * x1 is the maximum x-value, and y1 is the maximum y-value. For an x-brush, it must be defined as [x0, x1]; - * for a y-brush, it must be defined as [y0, y1]. - */ - move(group: TransitionLike, selection: BrushSelection): void; - /** - * Sets the active selection of the brush on the specified SVG G element(s) transition - * based on the array returned by a value function invoked for each transitioning element. - * - * @param group A D3 transition on SVG G elements. - * @param selection A selection value function which is evaluated for each selected element, - * in order, being passed the current datum (d), the current index (i), and the current group (nodes), - * with this as the current DOM element. The function returns an array specifying the new active brush selection. - * For a two-dimensional brush, it must be defined as [[x0, y0], [x1, y1]], where x0 is the minimum x-value, y0 is the minimum y-value, - * x1 is the maximum x-value, and y1 is the maximum y-value. For an x-brush, it must be defined as [x0, x1]; - * for a y-brush, it must be defined as [y0, y1]. - */ - move(group: TransitionLike, selection: ValueFn): void; - /** - * Returns the current extent accessor. - */ - extent(): ValueFn; - /** - * Set the brushable extent to the specified array of points and returns this brush. - * - * The brush extent determines the size of the invisible overlay and also constrains the brush selection; - * the brush selection cannot go outside the brush extent. - * - * @param extent array of points [[x0, y0], [x1, y1]], where [x0, y0] is the top-left corner - * and [x1, y1] is the bottom-right corner. - */ - extent(extent: [[number, number], [number, number]]): this; - /** - * Set the brushable extent to the specified array of points returned by the accessor function - * evaluated for each element in the selection/transition and returns this brush. - * - * The brush extent determines the size of the invisible overlay and also constrains the brush selection; - * the brush selection cannot go outside the brush extent. - * - * @param extent An extent accessor function which is evaluated for each selected element, - * in order, being passed the current datum (d), the current index (i), and the current group (nodes), - * with this as the current DOM element. The function returns an array of points [[x0, y0], [x1, y1]], - * where [x0, y0] is the top-left corner and [x1, y1] is the bottom-right corner. - */ - extent(extent: ValueFn): this; - - /** - * Returns the current filter function. - */ - filter(): ValueFn; - /** - * Sets the filter to the specified filter function and returns the brush. - * - * If the filter returns falsey, the initiating event is ignored and no brush gesture is started. - * Thus, the filter determines which input events are ignored. The default filter ignores mousedown events on secondary buttons, - * since those buttons are typically intended for other purposes, such as the context menu. - * - * @param filterFn A filter function which is evaluated for each selected element, - * in order, being passed the current datum (d), the current index (i), and the current group (nodes), - * with this as the current DOM element. The function returns a boolean value. - */ - filter(filterFn: ValueFn): this; - - /** - * Returns the current handle size, which defaults to six. - */ - handleSize(): number; - /** - * Sets the size of the brush handles to the specified number and returns the brush. - * - * This method must be called before applying the brush to a selection; - * changing the handle size does not affect brushes that were previously rendered. - * The default size is 6. - * - * @param size Size of the handle. - */ - handleSize(size: number): this; - - /** - * Returns the first currently-assigned listener matching the specified typenames, if any. - * - * @param typenames The typenames is a string containing one or more typename separated by whitespace. - * Each typename is a type, optionally followed by a period (.) and a name, such as "brush.foo"" and "brush.bar"; - * the name allows multiple listeners to be registered for the same type. The type must be one of the following: - * start (at the start of a brush gesture, such as on mousedown), brush (when the brush moves, such as on mousemove), or - * end (at the end of a brush gesture, such as on mouseup.) - */ - on(typenames: string): ValueFn | undefined; - /** - * Removes the current event listeners for the specified typenames, if any. - * - * @param typenames The typenames is a string containing one or more typename separated by whitespace. - * Each typename is a type, optionally followed by a period (.) and a name, such as "brush.foo"" and "brush.bar"; - * the name allows multiple listeners to be registered for the same type. The type must be one of the following: - * start (at the start of a brush gesture, such as on mousedown), brush (when the brush moves, such as on mousemove), or - * end (at the end of a brush gesture, such as on mouseup.) - * @param listener Use null to remove the listener. - */ - on(typenames: string, listener: null): this; - /** - * Sets the event listener for the specified typenames and returns the brush. - * If an event listener was already registered for the same type and name, - * the existing listener is removed before the new listener is added. - * When a specified event is dispatched, each listener will be invoked with the same context and arguments as selection.on listeners. - * - * @param typenames The typenames is a string containing one or more typename separated by whitespace. - * Each typename is a type, optionally followed by a period (.) and a name, such as "brush.foo"" and "brush.bar"; - * the name allows multiple listeners to be registered for the same type. The type must be one of the following: - * start (at the start of a brush gesture, such as on mousedown), brush (when the brush moves, such as on mousemove), or - * end (at the end of a brush gesture, such as on mouseup.) - * @param listener An event listener function which is evaluated for each selected element, - * in order, being passed the current datum (d), the current index (i), and the current group (nodes), - * with this as the current DOM element. - */ - on(typenames: string, listener: ValueFn): this; - -} - -/** - * Create a new two-dimensional brush. - * - * The generic "Datum" refers to the type of the data of the selected svg:g element to - * which the returned BrushBEhavoir will be applied. - */ -export function brush(): BrushBehavior; -/** - * Creates a new one-dimensional brush along the x-dimension. - * - * The generic "Datum" refers to the type of the data of the selected svg:g element to - * which the returned BrushBEhavoir will be applied. - */ -export function brushX(): BrushBehavior; -/** - * Creates a new one-dimensional brush along the y-dimension. - * - * The generic "Datum" refers to the type of the data of the selected svg:g element to - * which the returned BrushBEhavoir will be applied. - */ -export function brushY(): BrushBehavior; - -/** - * Return the current brush selection for the specified node. Internally, an element’s brush state is stored as element.__brush; - * however, you should use this method rather than accessing it directly. If the given node has no selection, returns null. - * Otherwise, the selection is defined as an array of numbers. - * - * @param node The node for which the brush selection should be returned. - */ -export function brushSelection(node: SVGGElement): BrushSelection | null; - -/** - * D3 brush event - * - * The generic refers to the type of the datum for the group element on which brush was defined. - */ -export interface D3BrushEvent { - /** - * The BrushBehavior associated with the event - */ - target: BrushBehavior; - /** - * The event type for the BrushEvent - */ - type: 'start' | 'brush' | 'end' | string; // Leave failsafe string type for cases like 'brush.foo' - /** - * The current brush selection associated with the event. - */ - selection: BrushSelection; - /** - * The underlying input event, such as mousemove or touchmove. - */ - sourceEvent: any; -} diff --git a/d3-brush/tslint.json b/d3-brush/tslint.json deleted file mode 100644 index 68d10d72a6..0000000000 --- a/d3-brush/tslint.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "../tslint.json", - "rules": { - "unified-signatures": false - } -} diff --git a/d3-chord/tslint.json b/d3-chord/tslint.json deleted file mode 100644 index 68d10d72a6..0000000000 --- a/d3-chord/tslint.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "../tslint.json", - "rules": { - "unified-signatures": false - } -} diff --git a/d3-drag/index.d.ts b/d3-drag/index.d.ts deleted file mode 100644 index d49e0bbc02..0000000000 --- a/d3-drag/index.d.ts +++ /dev/null @@ -1,363 +0,0 @@ -// Type definitions for D3JS d3-drag module 1.0 -// Project: https://github.com/d3/d3-drag/ -// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -// Last module patch version validated against: 1.0.2 - -import { ArrayLike, Selection, ValueFn } from 'd3-selection'; - - -// -------------------------------------------------------------------------- -// Shared Type Definitions and Interfaces -// -------------------------------------------------------------------------- - - -/** - * DraggedElementBaseType serves as an alias for the 'minimal' data type which can be selected - * without 'd3-drag' (and related code in 'd3-selection') trying to use properties internally which would otherwise not - * be supported. - */ -export type DraggedElementBaseType = Element; - - -/** - * Container element type usable for mouse/touch functions - */ -export type DragContainerElement = HTMLElement | SVGSVGElement | SVGGElement; // HTMLElement includes HTMLCanvasElement - -/** - * The subject datum should at a minimum expose x and y properties, so that the relative position - * of the subject and the pointer can be preserved during the drag gesture. - */ -export interface SubjectPosition { - /** - * x-coordinate - */ - x: number; - /** - * y-coordinate - */ - y: number; -} - -/** - * A D3 Drag Behavior - * - * The first generic refers to the type of element to be dragged. - * The second generic refers to the type of the datum of the dragged element. - * The third generic refers to the type of the drag behavior subject. - * - * The subject of a drag gesture represents the thing being dragged. - * It is computed when an initiating input event is received, - * such as a mousedown or touchstart, immediately before the drag gesture starts. - * The subject is then exposed as event.subject on subsequent drag events for this gesture. - * - * The default subject is the datum of the element in the originating selection (see drag) - * that received the initiating input event; if this datum is undefined, - * an object representing the coordinates of the pointer is created. - * When dragging circle elements in SVG, the default subject is thus the datum of the circle being dragged. - * With Canvas, the default subject is the canvas element’s datum (regardless of where on the canvas you click). - * In this case, a custom subject accessor would be more appropriate, - * such as one that picks the closest circle to the mouse within a given search radius. - */ -export interface DragBehavior extends Function { - /** - * Applies the drag behavior to the selected elements. - * This function is typically not invoked directly, and is instead invoked via selection.call. - * - * For details see: {@link https://github.com/d3/d3-drag#_drag} - * - * @param selection A D3 selection of elements. - * @param args Optional arguments to be passed in. - */ - (selection: Selection, ...args: any[]): void; - - /** - * Returns the current container accessor function. - */ - container(): ValueFn; - /** - * Sets the container accessor to the specified function and returns the drag behavior. - * - * The container of a drag gesture determines the coordinate system of subsequent drag events, - * affecting event.x and event.y. The element returned by the container accessor is subsequently - * passed to d3.mouse or d3.touch, as appropriate, to determine the local coordinates of the pointer. - * - * The default container accessor returns the parent node of the element in the originating selection (see drag) - * that received the initiating input event. This is often appropriate when dragging SVG or HTML elements, - * since those elements are typically positioned relative to a parent. For dragging graphical elements with a Canvas, - * however, you may want to redefine the container as the initiating element itself, using "this" in the accessor - * function. - * - * @param accessor A container accessor function which is evaluated for each selected element, - * in order, being passed the current datum (d), the current index (i), and the current group (nodes), - * with this as the current DOM element. The function returns the container element. - */ - container(accessor: ValueFn): this; - /** - * Sets the container accessor to the specified object and returns the drag behavior. - * - * The container of a drag gesture determines the coordinate system of subsequent drag events, - * affecting event.x and event.y. The element returned by the container accessor is subsequently - * passed to d3.mouse or d3.touch, as appropriate, to determine the local coordinates of the pointer. - * - * The default container accessor returns the parent node of the element in the originating selection (see drag) - * that received the initiating input event. This is often appropriate when dragging SVG or HTML elements, - * since those elements are typically positioned relative to a parent. For dragging graphical elements with a Canvas, - * however, you may want to redefine the container as the initiating element itself, such as drag.container(canvas). - * - * @param container Container element for the drag gesture. - */ - container(container: DragContainerElement): this; - - /** - * Returns the current filter function. - */ - filter(): ValueFn; - - /** - * Sets the filter to the specified filter function and returns the drag behavior. - * - * If the filter returns falsey, the initiating event is ignored and no drag gesture is started. - * Thus, the filter determines which input events are ignored. The default filter ignores mousedown events on secondary buttons, - * since those buttons are typically intended for other purposes, such as the context menu. - * - * @param filterFn A filter function which is evaluated for each selected element, - * in order, being passed the current datum (d), the current index (i), and the current group (nodes), - * with this as the current DOM element. The function returns a boolean value. - */ - filter(filterFn: ValueFn): this; - - /** - * Returns the current subject accessor functions. - */ - subject(): ValueFn; - /** - * Sets the subject accessor to the specified function and returns the drag behavior. - * - * The subject of a drag gesture represents the thing being dragged. - * It is computed when an initiating input event is received, - * such as a mousedown or touchstart, immediately before the drag gesture starts. - * The subject is then exposed as event.subject on subsequent drag events for this gesture. - * - * The default subject is the datum of the element in the originating selection (see drag) - * that received the initiating input event; if this datum is undefined, - * an object representing the coordinates of the pointer is created. - * When dragging circle elements in SVG, the default subject is thus the datum of the circle being dragged. - * With Canvas, the default subject is the canvas element’s datum (regardless of where on the canvas you click). - * In this case, a custom subject accessor would be more appropriate, - * such as one that picks the closest circle to the mouse within a given search radius. - * - * - * - * The subject of a drag gesture may not be changed after the gesture starts. - * - * During the evaluation of the subject accessor, d3.event is a beforestart drag event. - * Use event.sourceEvent to access the initiating input event and event.identifier to - * access the touch identifier. The event.x and event.y are relative to the container, - * and are computed using d3.mouse or d3.touch as appropriate. - * - * @param accessor An extent accessor function which is evaluated for each selected element, - * in order, being passed the current datum (d), the current index (i), and the current group (nodes), - * with this as the current DOM element.The returned subject should be an object that exposes x and y properties, - * so that the relative position of the subject and the pointer can be preserved during the drag gesture. - * If the subject is null or undefined, no drag gesture is started for this pointer; - * however, other starting touches may yet start drag gestures. - */ - subject(accessor: ValueFn): this; - - /** - * Return the first currently-assigned listener matching the specified typenames, if any. - * - * @param typenames The typenames is a string containing one or more typename separated by whitespace. - * Each typename is a type, optionally followed by a period (.) and a name, such as "drag.foo"" and "drag.bar"; - * the name allows multiple listeners to be registered for the same type. The type must be one of the following: - * start (after a new pointer becomes active [on mousedown or touchstart]), drag (after an active pointer moves [on mousemove or touchmove], or - * end (after an active pointer becomes inactive [on mouseup, touchend or touchcancel].) - */ - on(typenames: string): ValueFn | undefined; - /** - * Remove the current event listeners for the specified typenames, if any, return the drag behavior. - * - * @param typenames The typenames is a string containing one or more typename separated by whitespace. - * Each typename is a type, optionally followed by a period (.) and a name, such as "drag.foo"" and "drag.bar"; - * the name allows multiple listeners to be registered for the same type. The type must be one of the following: - * start (after a new pointer becomes active [on mousedown or touchstart]), drag (after an active pointer moves [on mousemove or touchmove], or - * end (after an active pointer becomes inactive [on mouseup, touchend or touchcancel].) - * @param listener Use null to remove the listener. - */ - on(typenames: string, listener: null): this; - /** - * Set the event listener for the specified typenames and return the drag behavior. - * If an event listener was already registered for the same type and name, - * the existing listener is removed before the new listener is added. - * When a specified event is dispatched, each listener will be invoked with the same context and arguments as selection.on listeners. - * - * Changes to registered listeners via drag.on during a drag gesture do not affect the current drag gesture. - * Instead, you must use event.on, which also allows you to register temporary event listeners for the current drag gesture. - * Separate events are dispatched for each active pointer during a drag gesture. - * For example, if simultaneously dragging multiple subjects with multiple fingers, a start event is dispatched for each finger, - * even if both fingers start touching simultaneously. - * - * @param typenames The typenames is a string containing one or more typename separated by whitespace. - * Each typename is a type, optionally followed by a period (.) and a name, such as "drag.foo"" and "drag.bar"; - * the name allows multiple listeners to be registered for the same type. The type must be one of the following: - * start (after a new pointer becomes active [on mousedown or touchstart]), drag (after an active pointer moves [on mousemove or touchmove], or - * end (after an active pointer becomes inactive [on mouseup, touchend or touchcancel].) - * @param listener An event listener function which is evaluated for each selected element, - * in order, being passed the current datum (d), the current index (i), and the current group (nodes), - * with this as the current DOM element. - */ - on(typenames: string, listener: ValueFn): this; -} - -/** - * Creates a new drag behavior. The returned behavior, drag, is both an object and a function, and is - * typically applied to selected elements via selection.call. - * - * Use this signature when using the default subject accessor. - * - * The first generic refers to the type of element to be dragged. - * The second generic refers to the type of the datum of the dragged element. - */ -export function drag(): DragBehavior; -/** - * Creates a new drag behavior. The returned behavior, drag, is both an object and a function, and is - * typically applied to selected elements via selection.call. - * - * Use this signature when using a custom subject accessor. - * - * The first generic refers to the type of element to be dragged. - * The second generic refers to the type of the datum of the dragged element. - * The third generic refers to the type of the drag behavior subject. - */ -export function drag(): DragBehavior; - -/** - * D3 Drag event - * - * The first generic refers to the type of element to be dragged. - * The second generic refers to the type of the datum of the dragged element. - * The third generic refers to the type of the drag behavior subject. - */ -export interface D3DragEvent { - /** - * The DragBehavior associated with the event - */ - target: DragBehavior; - /** - * The event type for the DragEvent - */ - type: 'start' | 'drag' | 'end' | string; // Leave failsafe string type for cases like 'drag.foo' - /** - * The drag subject, defined by drag.subject. - */ - subject: Subject; - /** - * The new x-coordinate of the subject, relative to the container - */ - x: number; - /** - * The new y-coordinate of the subject, relative to the container - */ - y: number; - /** - * The change in x-coordinate since the previous drag event. - */ - dx: number; - /** - * The change in y-coordinate since the previous drag event. - */ - dy: number; - /** - * The string “mouse”, or a numeric touch identifier. - */ - identifier: 'mouse' | number; - /** - * The number of currently active drag gestures (on start and end, not including this one). - * - * The event.active field is useful for detecting the first start event and the last end event - * in a sequence of concurrent drag gestures: it is zero when the first drag gesture starts, - * and zero when the last drag gesture ends. - */ - active: number; - /** - * The underlying input event, such as mousemove or touchmove. - */ - sourceEvent: any; - /** - * Return the first currently-assigned listener matching the specified typenames, if any. - * - * Equivalent to drag.on, but only applies to the current drag gesture. Before the drag gesture starts, - * a copy of the current drag event listeners is made. This copy is bound to the current drag gesture - * and modified by event.on. This is useful for temporary listeners that only receive events for the current drag gesture. - * - * @param typenames The typenames is a string containing one or more typename separated by whitespace. - * Each typename is a type, optionally followed by a period (.) and a name, such as "drag.foo"" and "drag.bar"; - * the name allows multiple listeners to be registered for the same type. The type must be one of the following: - * start (after a new pointer becomes active [on mousedown or touchstart]), drag (after an active pointer moves [on mousemove or touchmove], or - * end (after an active pointer becomes inactive [on mouseup, touchend or touchcancel].) - */ - on(typenames: string): ValueFn | undefined; - /** - * Remove the current event listeners for the specified typenames, if any, return the drag behavior. - * - * Equivalent to drag.on, but only applies to the current drag gesture. Before the drag gesture starts, - * a copy of the current drag event listeners is made. This copy is bound to the current drag gesture - * and modified by event.on. This is useful for temporary listeners that only receive events for the current drag gesture. - * - * @param typenames The typenames is a string containing one or more typename separated by whitespace. - * Each typename is a type, optionally followed by a period (.) and a name, such as "drag.foo"" and "drag.bar"; - * the name allows multiple listeners to be registered for the same type. The type must be one of the following: - * start (after a new pointer becomes active [on mousedown or touchstart]), drag (after an active pointer moves [on mousemove or touchmove], or - * end (after an active pointer becomes inactive [on mouseup, touchend or touchcancel].) - * @param listener Use null to remove the listener. - */ - on(typenames: string, listener: null): this; - /** - * Set the event listener for the specified typenames and return the drag behavior. - * If an event listener was already registered for the same type and name, - * the existing listener is removed before the new listener is added. - * When a specified event is dispatched, each listener will be invoked with the same context and arguments as selection.on listeners. - * - * Equivalent to drag.on, but only applies to the current drag gesture. Before the drag gesture starts, - * a copy of the current drag event listeners is made. This copy is bound to the current drag gesture - * and modified by event.on. This is useful for temporary listeners that only receive events for the current drag gesture. - * - * @param typenames The typenames is a string containing one or more typename separated by whitespace. - * Each typename is a type, optionally followed by a period (.) and a name, such as "drag.foo"" and "drag.bar"; - * the name allows multiple listeners to be registered for the same type. The type must be one of the following: - * start (after a new pointer becomes active [on mousedown or touchstart]), drag (after an active pointer moves [on mousemove or touchmove], or - * end (after an active pointer becomes inactive [on mouseup, touchend or touchcancel].) - * @param listener An event listener function which is evaluated for each selected element, - * in order, being passed the current datum (d), the current index (i), and the current group (nodes), - * with this as the current DOM element. - */ - on(typenames: string, listener: ValueFn): this; -} - -/** - * Prevents native drag-and-drop and text selection on the specified window. - * As an alternative to preventing the default action of mousedown events, - * this method prevents undesirable default actions following mousedown. In supported browsers, - * this means capturing dragstart and selectstart events, preventing the associated default actions, - * and immediately stopping their propagation. In browsers that do not support selection events, - * the user-select CSS property is set to none on the document element. - * This method is intended to be called on mousedown, followed by d3.dragEnable on mouseup. - * - * @param window The window for which drag should be disabled. - */ -export function dragDisable(window: Window): void; - -/** - * Allows native drag-and-drop and text selection on the specified window; undoes the effect of d3.dragDisable. - * This method is intended to be called on mouseup, preceded by d3.dragDisable on mousedown. - * If noclick is true, this method also temporarily suppresses click events. - * The suppression of click events expires after a zero-millisecond timeout, - * such that it only suppress the click event that would immediately follow the current mouseup event, if any. - * - * @param window The window for which drag should be (re-)enabled. - * @param noClick An optional flag. If noclick is true, this method also temporarily suppresses click events. - */ -export function dragEnable(window: Window, noClick?: boolean): void; diff --git a/d3-drag/tslint.json b/d3-drag/tslint.json deleted file mode 100644 index 68d10d72a6..0000000000 --- a/d3-drag/tslint.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "../tslint.json", - "rules": { - "unified-signatures": false - } -} diff --git a/d3-dsv/d3-dsv-tests.ts b/d3-dsv/d3-dsv-tests.ts deleted file mode 100644 index a4d958f01b..0000000000 --- a/d3-dsv/d3-dsv-tests.ts +++ /dev/null @@ -1,289 +0,0 @@ -/** - * Typescript definition tests for d3/d3-dsv module - * - * Note: These tests are intended to test the definitions only - * in the sense of typing and call signature consistency. They - * are not intended as functional tests. - */ - -import * as d3Dsv from 'd3-dsv'; - -// ------------------------------------------------------------------------------------------ -// Preperatory Steps -// ------------------------------------------------------------------------------------------ - - -const csvTestString: string = '1997,Ford,E350,2.34\n2000,Mercury,Cougar,2.38'; -const tsvTestString: string = '1997\tFord\tE350\t2.34\n2000\tMercury\tCougar\t2.38'; -const pipedTestString: string = '1997|Ford|E350|2.34\n2000|Mercury|Cougar|2.38'; - -const csvTestStringWithHeader: string = 'Year,Make,Model,Length\n1997,Ford,E350,2.34\n2000,Mercury,Cougar,2.38'; -const tsvTestStringWithHeader: string = 'Year\tMake\tModel\tLength\n1997\tFord\tE350\t2.34\n2000\tMercury\tCougar\t2.38'; -const pipedTestStringWithHeader: string = 'Year|Make|Model|Length\n1997|Ford|E350|2.34\n2000|Mercury|Cougar|2.38'; - -interface ParsedTestObject { - year: Date; - make: string; - model: string; - length: number; -} - -let parseArray: d3Dsv.DSVParsedArray; -let parseMappedArray: d3Dsv.DSVParsedArray; - -let parseRowsArray: string[][]; -let parseRowsMappedArray: ParsedTestObject[]; - - -let columns: string[]; -let num: number; -let date: Date; -let str: string; - -// ------------------------------------------------------------------------------------------ -// Test CSV -// ------------------------------------------------------------------------------------------ - -// csvParse(...) ============================================================================ - -// without row mapper ----------------------------------------------------------------------- - -parseArray = d3Dsv.csvParse(csvTestStringWithHeader); - -columns = parseArray.columns; - -str = parseArray[0]['Year']; -// date = parseArray[0]['Year']; // fails, return value is string - -// with row mapper --------------------------------------------------------------------------- - -parseMappedArray = d3Dsv.csvParse(csvTestStringWithHeader, (rawRow, index, columns) => { - const rr: d3Dsv.DSVRowString = rawRow; - const i: number = index; - const c: string[] = columns; - const pr: ParsedTestObject = { - year: new Date(+rr['Year'], 0, 1), - make: rr['Make'], - model: rr['Model'], - length: +rr['Length'] - }; - return pr; -}); - -columns = parseMappedArray.columns; - -date = parseMappedArray[0].year; -str = parseMappedArray[0].make; -str = parseMappedArray[0].model; -num = parseMappedArray[0].length; - - -// csvParseRows(...) ============================================================================ - -// without row mapper ----------------------------------------------------------------------- - -parseRowsArray = d3Dsv.csvParseRows(csvTestString); - - -str = parseRowsArray[0][0]; // 'Year' of first row -// date = parseRowsArray[0][0]; // fails, return value is string - -// with row mapper --------------------------------------------------------------------------- - -parseRowsMappedArray = d3Dsv.csvParseRows(csvTestString, (rawRow, index) => { - const rr: string[] = rawRow; - const i: number = index; - const pr: ParsedTestObject = { - year: new Date(+rr[0], 0, 1), - make: rr[1], - model: rr[2], - length: +rr[3] - }; - return pr; -}); - -date = parseRowsMappedArray[0].year; -str = parseRowsMappedArray[0].make; -str = parseRowsMappedArray[0].model; -num = parseRowsMappedArray[0].length; - -// csvFormat(...) ============================================================================ - -str = d3Dsv.csvFormat(parseRowsMappedArray); -str = d3Dsv.csvFormat(parseRowsMappedArray, columns); - -// csvFormatRows(...) ======================================================================== - -str = d3Dsv.csvFormatRows(parseRowsMappedArray.map((d, i) => [ - d.year.getFullYear().toString(), - d.make, - d.model, - d.length.toString() -])); - -// ------------------------------------------------------------------------------------------ -// Test TSV -// ------------------------------------------------------------------------------------------ - -// tsvParse(...) ============================================================================ - -// without row mapper ----------------------------------------------------------------------- - -parseArray = d3Dsv.tsvParse(tsvTestStringWithHeader); - -columns = parseArray.columns; - -str = parseArray[0]['Year']; -// date = parseArray[0]['Year']; // fails, return value is string - -// with row mapper --------------------------------------------------------------------------- - -parseMappedArray = d3Dsv.tsvParse(tsvTestStringWithHeader, (rawRow, index, columns) => { - const rr: d3Dsv.DSVRowString = rawRow; - const i: number = index; - const c: string[] = columns; - const pr: ParsedTestObject = { - year: new Date(+rr['Year'], 0, 1), - make: rr['Make'], - model: rr['Model'], - length: +rr['Length'] - }; - return pr; -}); - -columns = parseMappedArray.columns; - -date = parseMappedArray[0].year; -str = parseMappedArray[0].make; -str = parseMappedArray[0].model; -num = parseMappedArray[0].length; - - -// tsvParseRows(...) ============================================================================ - -// without row mapper ----------------------------------------------------------------------- - -parseRowsArray = d3Dsv.tsvParseRows(tsvTestString); - - -str = parseRowsArray[0][0]; // 'Year' of first row -// date = parseRowsArray[0][0]; // fails, return value is string - -// with row mapper --------------------------------------------------------------------------- - -parseRowsMappedArray = d3Dsv.tsvParseRows(tsvTestString, (rawRow, index) => { - const rr: string[] = rawRow; - const i: number = index; - const pr: ParsedTestObject = { - year: new Date(+rr[0], 0, 1), - make: rr[1], - model: rr[2], - length: +rr[3] - }; - return pr; -}); - -date = parseRowsMappedArray[0].year; -str = parseRowsMappedArray[0].make; -str = parseRowsMappedArray[0].model; -num = parseRowsMappedArray[0].length; - -// tsvFormat(...) ============================================================================ - -str = d3Dsv.tsvFormat(parseRowsMappedArray); -str = d3Dsv.tsvFormat(parseRowsMappedArray, columns); - -// tsvFormatRows(...) ======================================================================== - -str = d3Dsv.tsvFormatRows(parseRowsMappedArray.map((d, i) => [ - d.year.getFullYear().toString(), - d.make, - d.model, - d.length.toString() -])); - -// ------------------------------------------------------------------------------------------ -// Test DSV Generalized Parsers and Formatters -// ------------------------------------------------------------------------------------------ - -// Create custom-delimited Parser/Formatter ================================================= - -let dsv: d3Dsv.DSV; -dsv = d3Dsv.dsvFormat('|'); - -// parse(...) ============================================================================ - -// without row mapper ----------------------------------------------------------------------- - -parseArray = dsv.parse(pipedTestStringWithHeader); - -columns = parseArray.columns; - -str = parseArray[0]['Year']; -// date = parseArray[0]['Year']; // fails, return value is string - -// with row mapper --------------------------------------------------------------------------- - -parseMappedArray = dsv.parse(pipedTestStringWithHeader, (rawRow, index, columns) => { - const rr: d3Dsv.DSVRowString = rawRow; - const i: number = index; - const c: string[] = columns; - const pr: ParsedTestObject = { - year: new Date(+rr['Year'], 0, 1), - make: rr['Make'], - model: rr['Model'], - length: +rr['Length'] - }; - return pr; -}); - -columns = parseMappedArray.columns; - -date = parseMappedArray[0].year; -str = parseMappedArray[0].make; -str = parseMappedArray[0].model; -num = parseMappedArray[0].length; - - -// parseRows(...) ============================================================================ - -// without row mapper ----------------------------------------------------------------------- - -parseRowsArray = dsv.parseRows(pipedTestString); - - -str = parseRowsArray[0][0]; // 'Year' of first row -// date = parseRowsArray[0][0]; // fails, return value is string - -// with row mapper --------------------------------------------------------------------------- - -parseRowsMappedArray = dsv.parseRows(pipedTestString, (rawRow, index) => { - const rr: string[] = rawRow; - const i: number = index; - const pr: ParsedTestObject = { - year: new Date(+rr[0], 0, 1), - make: rr[1], - model: rr[2], - length: +rr[3] - }; - return pr; -}); - -date = parseRowsMappedArray[0].year; -str = parseRowsMappedArray[0].make; -str = parseRowsMappedArray[0].model; -num = parseRowsMappedArray[0].length; - -// format(...) ============================================================================ - -str = dsv.format(parseRowsMappedArray); -str = dsv.format(parseRowsMappedArray, columns); - -// formatRows(...) ======================================================================== - -str = dsv.formatRows(parseRowsMappedArray.map((d, i) => [ - d.year.getFullYear().toString(), - d.make, - d.model, - d.length.toString() -])); diff --git a/d3-dsv/v0/d3-dsv-tests.ts b/d3-dsv/v0/d3-dsv-tests.ts deleted file mode 100644 index 587d4d5a55..0000000000 --- a/d3-dsv/v0/d3-dsv-tests.ts +++ /dev/null @@ -1,8 +0,0 @@ - - -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/v0/index.d.ts b/d3-dsv/v0/index.d.ts deleted file mode 100644 index 82ccd0f87f..0000000000 --- a/d3-dsv/v0/index.d.ts +++ /dev/null @@ -1,79 +0,0 @@ -// Type definitions for d3-dsv 0.4 -// Project: https://www.npmjs.com/package/d3-dsv -// Definitions by: Jason Swearingen -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/** A parser and formatter for DSV (CSV and TSV) files. Extracted from D3. */ -declare var loader: ( - /** the symbol used to seperate cells in the row.*/ - delimiter: string, - /** example: "text/plain" */ - encoding?: string) => D3Dsv; - -export = loader; -export as namespace d3_dsv; - -/** A parser and formatter for DSV (CSV and TSV) files. Extracted from D3. */ -interface 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"} ] - */ - 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. - */ - 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. - */ - 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. - */ - formatRows(rows: any[]): string; -} diff --git a/d3-dsv/v0/tslint.json b/d3-dsv/v0/tslint.json deleted file mode 100644 index af53769b6b..0000000000 --- a/d3-dsv/v0/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../../tslint.json" } diff --git a/d3-ease/index.d.ts b/d3-ease/index.d.ts deleted file mode 100644 index 704b55e5e0..0000000000 --- a/d3-ease/index.d.ts +++ /dev/null @@ -1,324 +0,0 @@ -// Type definitions for D3JS d3-ease module 1.0 -// Project: https://github.com/d3/d3-ease/ -// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -// Last module patch version validated against: 1.0.1 - -// -------------------------------------------------------------------------- -// Easing Functions -// -------------------------------------------------------------------------- - -/** - * Linear easing; the identity function; linear(t) returns t. - * - * @param normalizedTime Normalized time typically in the range [0, 1] - */ -export function easeLinear(normalizedTime: number): number; - -/** - * Symmetric quadratic easing; scales quadIn for t in [0, 0.5] and quadOut for t in [0.5, 1]. Also equivalent to poly.exponent(2). - * - * @param normalizedTime Normalized time typically in the range [0, 1] - */ -export function easeQuad(normalizedTime: number): number; - -/** - * Quadratic easing; equivalent to polyIn.exponent(2). - * - * @param normalizedTime Normalized time typically in the range [0, 1] - */ -export function easeQuadIn(normalizedTime: number): number; - -/** - * Reverse quadratic easing; equivalent to 1 - quadIn(1 - t). Also equivalent to polyOut.exponent(2). - * - * @param normalizedTime Normalized time typically in the range [0, 1] - */ -export function easeQuadOut(normalizedTime: number): number; - -/** - * Symmetric quadratic easing; scales quadIn for t in [0, 0.5] and quadOut for t in [0.5, 1]. Also equivalent to poly.exponent(2). - * - * @param normalizedTime Normalized time typically in the range [0, 1] - */ -export function easeQuadInOut(normalizedTime: number): number; - -/** - * Symmetric cubic easing; scales cubicIn for t in [0, 0.5] and cubicOut for t in [0.5, 1]. Also equivalent to poly.exponent(3). - * - * @param normalizedTime Normalized time typically in the range [0, 1] - */ -export function easeCubic(normalizedTime: number): number; - -/** - * Cubic easing; equivalent to polyIn.exponent(3). - * - * @param normalizedTime Normalized time typically in the range [0, 1] - */ -export function easeCubicIn(normalizedTime: number): number; - -/** - * Reverse cubic easing; equivalent to 1 - cubicIn(1 - t). Also equivalent to polyOut.exponent(3). - * - * @param normalizedTime Normalized time typically in the range [0, 1] - */ -export function easeCubicOut(normalizedTime: number): number; - -/** - * Symmetric cubic easing; scales cubicIn for t in [0, 0.5] and cubicOut for t in [0.5, 1]. Also equivalent to poly.exponent(3). - * - * @param normalizedTime Normalized time typically in the range [0, 1] - */ -export function easeCubicInOut(normalizedTime: number): number; - -/** - * Polynomial easing function factory - */ -export interface PolynomialEasingFactory { - /** - * Calculate eased time. - * @param normalizedTime Normalized time typically in the range [0, 1] - */ - (normalizedTime: number): number; - /** - * Returns a new polynomial easing with the specified exponent e. - * If the exponent is not specified, it defaults to 3, equivalent to cubic. - * - * @param e Exponent for polynomial easing. - */ - exponent(e: number): PolynomialEasingFactory; -} - -/** - * Symmetric polynomial easing/easing factory; scales polyIn for t in [0, 0.5] and polyOut for t in [0.5, 1]. - * If the exponent is not specified, it defaults to 3, equivalent to cubic. - */ -export var easePoly: PolynomialEasingFactory; -/** - * Polynomial easing/easing factory; raises t to the specified exponent. - * If the exponent is not specified, it defaults to 3, equivalent to cubicIn. - */ -export var easePolyIn: PolynomialEasingFactory; - -/** - * Reverse polynomial easing/easing factory; equivalent to 1 - polyIn(1 - t). - * If the exponent is not specified, it defaults to 3, equivalent to cubicOut. - */ -export var easePolyOut: PolynomialEasingFactory; - -/** - * Symmetric polynomial easing/easing factory; scales polyIn for t in [0, 0.5] and polyOut for t in [0.5, 1]. - * If the exponent is not specified, it defaults to 3, equivalent to cubic. - */ -export var easePolyInOut: PolynomialEasingFactory; - - -/** - * Symmetric sinusoidal easing; scales sinIn for t in [0, 0.5] and sinOut for t in [0.5, 1]. - * - * @param normalizedTime Normalized time typically in the range [0, 1] - */ -export function easeSin(normalizedTime: number): number; - -/** - * Sinusoidal easing; returns sin(t). - * - * @param normalizedTime Normalized time typically in the range [0, 1] - */ -export function easeSinIn(normalizedTime: number): number; - -/** - * Reverse sinusoidal easing; equivalent to 1 - sinIn(1 - t). - * - * @param normalizedTime Normalized time typically in the range [0, 1] - */ -export function easeSinOut(normalizedTime: number): number; - -/** - * Symmetric sinusoidal easing; scales sinIn for t in [0, 0.5] and sinOut for t in [0.5, 1]. - * - * @param normalizedTime Normalized time typically in the range [0, 1] - */ -export function easeSinInOut(normalizedTime: number): number; - -/** - * Symmetric exponential easing; scales expIn for t in [0, 0.5] and expOut for t in [0.5, 1]. - * - * @param normalizedTime Normalized time typically in the range [0, 1] - */ -export function easeExp(normalizedTime: number): number; - -/** - * Exponential easing; raises 2 to the exponent 10 * (t - 1). - * - * @param normalizedTime Normalized time typically in the range [0, 1] - */ -export function easeExpIn(normalizedTime: number): number; - -/** - * Reverse exponential easing; equivalent to 1 - expIn(1 - t). - * - * @param normalizedTime Normalized time typically in the range [0, 1] - */ -export function easeExpOut(normalizedTime: number): number; - -/** - * Symmetric exponential easing; scales expIn for t in [0, 0.5] and expOut for t in [0.5, 1]. - * - * @param normalizedTime Normalized time typically in the range [0, 1] - */ -export function easeExpInOut(normalizedTime: number): number; - -/** - * Symmetric circular easing; scales circleIn for t in [0, 0.5] and circleOut for t in [0.5, 1]. - * - * @param normalizedTime Normalized time typically in the range [0, 1] - */ -export function easeCircle(normalizedTime: number): number; - -/** - * Circular easing. - * - * @param normalizedTime Normalized time typically in the range [0, 1] - */ -export function easeCircleIn(normalizedTime: number): number; - -/** - * Reverse circular easing; equivalent to 1 - circleIn(1 - t). - * - * @param normalizedTime Normalized time typically in the range [0, 1] - */ -export function easeCircleOut(normalizedTime: number): number; - -/** - * Symmetric circular easing; scales circleIn for t in [0, 0.5] and circleOut for t in [0.5, 1]. - * - * @param normalizedTime Normalized time typically in the range [0, 1] - */ -export function easeCircleInOut(normalizedTime: number): number; - -/** - * Reverse bounce easing; equivalent to 1 - bounceIn(1 - t). - * - * @param normalizedTime Normalized time typically in the range [0, 1] - */ -export function easeBounce(normalizedTime: number): number; - -/** - * Bounce easing, like a rubber ball. - * - * @param normalizedTime Normalized time typically in the range [0, 1] - */ -export function easeBounceIn(normalizedTime: number): number; - -/** - * Reverse bounce easing; equivalent to 1 - bounceIn(1 - t). - * - * @param normalizedTime Normalized time typically in the range [0, 1] - */ -export function easeBounceOut(normalizedTime: number): number; - -/** - * Symmetric bounce easing; scales bounceIn for t in [0, 0.5] and bounceOut for t in [0.5, 1]. - * - * @param normalizedTime Normalized time typically in the range [0, 1] - */ -export function easeBounceInOut(normalizedTime: number): number; - - -/** - * Anticipatory easing function factory - */ -export interface BackEasingFactory { - /** - * Calculate eased time. - * @param normalizedTime Normalized time typically in the range [0, 1] - */ - (normalizedTime: number): number; - /** - * Returns a new back easing with the specified overshoot s. - * The degree of overshoot is configurable; if not specified, it defaults to 1.70158. - * - * @param s Overshoot parameter - */ - overshoot(s: number): BackEasingFactory; -} - -/** - * Symmetric anticipatory easing; scales backIn for t in [0, 0.5] and backOut for t in [0.5, 1]. - * The degree of overshoot is configurable; it not specified, it defaults to 1.70158. - */ -export var easeBack: BackEasingFactory; - -/** - * Anticipatory easing, like a dancer bending his knees before jumping off the floor. - * The degree of overshoot is configurable; it not specified, it defaults to 1.70158. - */ -export var easeBackIn: BackEasingFactory; - -/** - * Reverse anticipatory easing; equivalent to 1 - backIn(1 - t). - * The degree of overshoot is configurable; it not specified, it defaults to 1.70158. - */ -export var easeBackOut: BackEasingFactory; - -/** - * Symmetric anticipatory easing; scales backIn for t in [0, 0.5] and backOut for t in [0.5, 1]. - * The degree of overshoot is configurable; it not specified, it defaults to 1.70158. - */ -export var easeBackInOut: BackEasingFactory; - - -/** - * Elastic easing function factory - */ -export interface ElasticEasingFactory { - /** - * Calculate eased time. - * @param normalizedTime Normalized time typically in the range [0, 1] - */ - (normalizedTime: number): number; - /** - * Returns a new elastic easing with the specified amplitude a. - * Defaults to 1,if not specified. - * - * @param a Amplitude for elastic easing. - */ - amplitude(a: number): ElasticEasingFactory; - /** - * Returns a new elastic easing with the specified amplitude a. - * Defaults to 0.3,if not specified. - * - * @param p Period for elastic easing. - */ - period(p: number): ElasticEasingFactory; -} - -/** - * Reverse elastic easing; equivalent to 1 - elasticIn(1 - t). - * The amplitude and period of the oscillation are configurable; - * if not specified, they default to 1 and 0.3, respectively. - */ -export var easeElastic: ElasticEasingFactory; - -/** - * Elastic easing, like a rubber band. - * The amplitude and period of the oscillation are configurable; - * if not specified, they default to 1 and 0.3, respectively. - */ -export var easeElasticIn: ElasticEasingFactory; - -/** - * Reverse elastic easing; equivalent to 1 - elasticIn(1 - t). - * The amplitude and period of the oscillation are configurable; - * if not specified, they default to 1 and 0.3, respectively. - */ -export var easeElasticOut: ElasticEasingFactory; - -/** - * Symmetric elastic easing; scales elasticIn for t in [0, 0.5] and elasticOut for t in [0.5, 1]. - * The amplitude and period of the oscillation are configurable; - * if not specified, they default to 1 and 0.3, respectively. - */ -export var easeElasticInOut: ElasticEasingFactory; diff --git a/d3-ease/tslint.json b/d3-ease/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/d3-ease/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/d3-force/index.d.ts b/d3-force/index.d.ts deleted file mode 100644 index 6faa27449a..0000000000 --- a/d3-force/index.d.ts +++ /dev/null @@ -1,1077 +0,0 @@ -// Type definitions for D3JS d3-force module 1.0 -// Project: https://github.com/d3/d3-force/ -// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - - -// Last module patch version validated against: 1.0.4 - -// ----------------------------------------------------------------------- -// Force Simulation -// ----------------------------------------------------------------------- - -/** - * The base data structure for the datum of a Simulation Node. - * The optional properties contained in this data structure are internally assigned - * by the Simulation upon (re-)initialization. - * - * When defining a data type to use for node data, it should be an extension of this interface - * and respect the already "earmarked" properties used by the simulation. - * - * IMPORTANT: Prior to initialization, the following properties are optional: index, x, y, vx, and vy. - * After initialization they will be defined. The optional properties fx and fy are ONLY defined, - * if the node's position has been fixed. - */ -export interface SimulationNodeDatum { - /** - * Node’s zero-based index into nodes array. This property is set during the initialization process of a simulation. - */ - index?: number; - /** - * Node’s current x-position - */ - x?: number; - /** - * Node’s current y-position - */ - y?: number; - /** - * Node’s current x-velocity - */ - vx?: number; - /** - * Node’s current y-velocity - */ - vy?: number; - /** - * Node’s fixed x-position (if position was fixed) - */ - fx?: number | null; - /** - * Node’s fixed y-position (if position was fixed) - */ - fy?: number | null; -} - -/** - * The base data structure for the datum of a Simulation Link, as used by ForceLink. - * The optional properties contained in this data structure are internally assigned - * by when initializating with ForceLink.links(...) - * - * - * IMPORTANT: The source and target properties may be internally mutated in type during the - * ForceLink initialization process (possibly being changed from a node index in the nodes array, - * or a node id string to the simulation node object which was mapped in using the current - * ForceLink.id(...) accessor function.) - */ -export interface SimulationLinkDatum { - /** - * Link’s source node. - * For convenience, a link’s source property may be initialized using numeric or string identifiers rather than object references; see link.id. - * After initialization, the source property represents the source node object. - */ - source: NodeDatum | string | number; - /** - * Link’s source link - * For convenience, a link’s target property may be initialized using numeric or string identifiers rather than object references; see link.id. - * After initialization, the target property represents the source node object. - */ - target: NodeDatum | string | number; - /** - * The zero-based index into the links array. Internally generated when calling ForceLink.links(...) - */ - index?: number; -} - -/** - * A Force Simulation - * - * The first generic refers to the type of the datum associated with a node in the simulation. - * The second generic refers to the type of the datum associated with a link in the simulation, if applicable. - * - */ -export interface Simulation | undefined> { - /** - * Restart the simulation’s internal timer and return the simulation. - * In conjunction with simulation.alphaTarget or simulation.alpha, this method can be used to “reheat” the simulation during interaction, - * such as when dragging a node, or to resume the simulation after temporarily pausing it with simulation.stop. - */ - restart(): this; - - /** - * Stop the simulation’s internal timer, if it is running, and return the simulation. If the timer is already stopped, this method does nothing. - * This method is useful for running the simulation manually; see simulation.tick. - */ - stop(): this; - - /** - * Increments the current alpha by (alphaTarget - alpha) × alphaDecay; then invokes each registered force, passing the new alpha; - * then decrements each node’s velocity by velocity × velocityDecay; lastly increments each node’s position by velocity. - * This method does not dispatch events; events are only dispatched by the internal timer when the simulation is started automatically upon - * creation or by calling simulation.restart. The natural number of ticks when the simulation is started is - * ⌈log(alphaMin) / log(1 - alphaDecay)⌉; by default, this is 300. - */ - tick(): void; - - /** - * Returns the simulation’s array of nodes as specified to the constructor. - */ - nodes(): NodeDatum[]; - /** - * Set the simulation’s nodes to the specified array of objects, initialize their positions and velocities if necessary, - * and then re-initialize any bound forces; Returns the simulation. - * - * Each node must be an object. The following properties are assigned by the simulation: - * - index (the node’s zero-based index into nodes) - * - x (the node’s current x-position) - * - y (the node’s current y-position) - * - vx (the node’s current x-velocity) - * - vy (the node’s current y-velocity) - * - * The position [x,y] and velocity [vx,vy] may be subsequently modified by forces and by the simulation. - * If either vx or vy is NaN, the velocity is initialized to [0,0]. If either x or y is NaN, the position is initialized in a phyllotaxis arrangement, - * so chosen to ensure a deterministic, uniform distribution around the origin. - * - * To fix a node in a given position, you may specify two additional properties: - * - fx (the node’s fixed x-position) - * - fy (the node’s fixed y-position) - * - * At the end of each tick, after the application of any forces, a node with a defined node.fx has node.x reset to this value and node.vx set to zero; - * likewise, a node with a defined node.fy has node.y reset to this value and node.vy set to zero. - * To unfix a node that was previously fixed, set node.fx and node.fy to null, or delete these properties. - * - * If the specified array of nodes is modified, such as when nodes are added to or removed from the simulation, - * this method must be called again with the new (or changed) array to notify the simulation and bound forces of the change; - * the simulation does not make a defensive copy of the specified array. - */ - nodes(nodesData: NodeDatum[]): this; - - /** - * Return the current alpha of the simulation, which defaults to 1. - */ - alpha(): number; - /** - * Set the current alpha to the specified number in the range [0,1] and return this simulation. - * The default is 1. - * - * @param alpha Current alpha of simulation. - */ - alpha(alpha: number): this; - - /** - * Return the current minimum alpha value, which defaults to 0.001. - */ - alphaMin(): number; - /** - * Set the minimum alpha to the specified number in the range [0,1] and return this simulation. - * The default is 0.001. The simulation’s internal timer stops when the current alpha is less than the minimum alpha. - * The default alpha decay rate of ~0.0228 corresponds to 300 iterations. - * - * @param min Minimum alpha of simulation. - */ - alphaMin(min: number): this; - - /** - * Return the current alpha decay rate, which defaults to 0.0228… = 1 - pow(0.001, 1 / 300) where 0.001 is the default minimum alpha. - */ - alphaDecay(): number; - /** - * Set the alpha decay rate to the specified number in the range [0,1] and return this simulation. - * The default is 0.0228… = 1 - pow(0.001, 1 / 300) where 0.001 is the default minimum alpha. - * - * The alpha decay rate determines how quickly the current alpha interpolates towards the desired target alpha; - * since the default target alpha is zero, by default this controls how quickly the simulation cools. - * Higher decay rates cause the simulation to stabilize more quickly, but risk getting stuck in a local minimum; - * lower values cause the simulation to take longer to run, but typically converge on a better layout. - * To have the simulation run forever at the current alpha, set the decay rate to zero; - * alternatively, set a target alpha greater than the minimum alpha. - * - * @param decay Alpha decay rate. - */ - alphaDecay(decay: number): this; - - /** - * Returns the current target alpha value, which defaults to 0. - */ - alphaTarget(): number; - /** - * Set the current target alpha to the specified number in the range [0,1] and return this simulation. - * The default is 0. - * - * @param target Alpha target value. - */ - alphaTarget(target: number): this; - - /** - * Return the current target alpha value, which defaults to 0.4. - */ - velocityDecay(): number; - /** - * Set the velocity decay factor to the specified number in the range [0,1] and return this simulation. - * The default is 0.4. - * - * The decay factor is akin to atmospheric friction; after the application of any forces during a tick, - * each node’s velocity is multiplied by 1 - decay. As with lowering the alpha decay rate, - * less velocity decay may converge on a better solution, but risks numerical instabilities and oscillation. - * - * @param decay Velocity Decay. - */ - velocityDecay(decay: number): this; - - /** - * Return the force with the specified name, or undefined if there is no such force. - * (By default, new simulations have no forces.) - * - * Given that it is in general not known, what type of force has been registered under - * a specified name, use the generic to cast the result to the appropriate type, if known. - * - * @param name Name of the registered force. - */ - force>(name: string): F| undefined; - /** - * Remove a previously registered force. - * - * @param name Name of the registered force. - * @param force Use null to remove force. - */ - force(name: string, force: null): this; - /** - * Assign the force for the specified name and return this simulation. - * (By default, new simulations have no forces.) - * - * @param name Name to register the force under. - * @param force A force to use with the simulation. - */ - force(name: string, force: Force): this; - - /** - * Return the node closest to the position [x,y] with the given search radius. - * If radius is not specified, it defaults to infinity. - * If there is no node within the search area, returns undefined. - * - * @param x x-coordinate - * @param y y-coordinate - * @param radius Optional search radius. Defaults to infinity. - */ - find(x: number, y: number, radius?: number): NodeDatum | undefined; - - /** - * Return the first currently-assigned listener matching the specified typenames, if any. - * - * @param typenames The typenames is a string containing one or more typename separated by whitespace. Each typename is a type, - * optionally followed by a period (.) and a name, such as "tick.foo" and "tick.bar"; the name allows multiple listeners to be registered for the same type. - * The type must be one of the following: "tick" (after each tick of the simulation’s internal timer) or - * "end" (after the simulation’s timer stops when alpha < alphaMin). - */ - on(typenames: 'tick' | 'end' | string): ((this: Simulation) => void) | undefined; - /** - * Remove the current event listeners for the specified typenames, if any, return the simulation. - * - * @param typenames The typenames is a string containing one or more typename separated by whitespace. Each typename is a type, - * optionally followed by a period (.) and a name, such as "tick.foo" and "tick.bar"; the name allows multiple listeners to be registered for the same type. - * The type must be one of the following: "tick" (after each tick of the simulation’s internal timer) or - * "end" (after the simulation’s timer stops when alpha < alphaMin). - * @param listener Use null to remove the listener. - */ - on(typenames: 'tick' | 'end' | string, listener: null): this; - /** - * Set the event listener for the specified typenames and return this simulation. - * If an event listener was already registered for the same type and name, - * the existing listener is removed before the new listener is added. - * When a specified event is dispatched, each listener will be invoked with the this context as the simulation. - * - * The type must be one of the following: - * - tick [after each tick of the simulation’s internal timer] - * - end [after the simulation’s timer stops when alpha < alphaMin] - * - * Note that tick events are not dispatched when simulation.tick is called manually; - * events are only dispatched by the internal timer and are intended for interactive rendering of the simulation. - * To affect the simulation, register forces instead of modifying nodes’ positions or velocities inside a tick event listener. - * - * @param typenames The typenames is a string containing one or more typename separated by whitespace. Each typename is a type, - * optionally followed by a period (.) and a name, such as "tick.foo" and "tick.bar"; the name allows multiple listeners to be registered for the same type. - * The type must be one of the following: "tick" (after each tick of the simulation’s internal timer) or - * "end" (after the simulation’s timer stops when alpha < alphaMin). - * @param listener An event listener function which is invoked with the this context of the simulation. - */ - on(typenames: 'tick' | 'end' | string, listener: (this: this) => void): this; -} - -/** - * Create a new simulation with the specified array of nodes and no forces. - * If nodes is not specified, it defaults to the empty array. - * The simulator starts automatically; use simulation.on to listen for tick events as the simulation runs. - * If you wish to run the simulation manually instead, call simulation.stop, and then call simulation.tick as desired. - * - * Use this signature, when creating a simulation WITHOUT link force(s). - * - * The generic refers to the type of the data for a node. - * - * @param nodesData Optional array of nodes data, defaults to empty array. - */ -export function forceSimulation(nodesData?: NodeDatum[]): Simulation; -/** - * Create a new simulation with the specified array of nodes and no forces. - * If nodes is not specified, it defaults to the empty array. - * The simulator starts automatically; use simulation.on to listen for tick events as the simulation runs. - * If you wish to run the simulation manually instead, call simulation.stop, and then call simulation.tick as desired. - * - * Use this signature, when creating a simulation WITH link force(s). - * - * The first generic refers to the type of data for a node. - * The second generic refers to the type of data for a link. - * - * @param nodesData Optional array of nodes data, defaults to empty array. - */ -export function forceSimulation>(nodesData?: NodeDatum[]): Simulation; - -// ---------------------------------------------------------------------- -// Forces -// ---------------------------------------------------------------------- - -/** - * A force is simply a function that modifies nodes’ positions or velocities; in this context, a force can apply a classical physical force such as electrical charge or gravity, - * or it can resolve a geometric constraint, such as keeping nodes within a bounding box or keeping linked nodes a fixed distance apart. - * - * Forces typically read the node’s current position [x,y] and then add to (or subtract from) the node’s velocity [vx,vy]. - * However, forces may also “peek ahead” to the anticipated next position of the node, [x + vx,y + vy]; this is necessary for resolving geometric constraints through iterative relaxation. - * Forces may also modify the position directly, which is sometimes useful to avoid adding energy to the simulation, such as when recentering the simulation in the viewport. - * - * Forces may optionally implement force.initialize to receive the simulation’s array of nodes. - */ -export interface Force | undefined> { - /** - * Apply this force, optionally observing the specified alpha. - * Typically, the force is applied to the array of nodes previously passed to force.initialize, - * however, some forces may apply to a subset of nodes, or behave differently. - * For example, d3.forceLink applies to the source and target of each link. - */ - (alpha: number): void; - /** - * Assign the array of nodes to this force. This method is called when a force is bound to a simulation via simulation.force - * and when the simulation’s nodes change via simulation.nodes. - * - * A force may perform necessary work during initialization, such as evaluating per-node parameters, to avoid repeatedly performing work during each application of the force. - */ - initialize?(nodes: NodeDatum[]): void; -} - - -// Centering ------------------------------------------------------------ - -/** - * The centering force translates nodes uniformly so that the mean position of all nodes - * (the center of mass if all nodes have equal weight) is at the given position [x,y]. - * This force modifies the positions of nodes on each application; it does not modify velocities, - * as doing so would typically cause the nodes to overshoot and oscillate around the desired center. - * This force helps keeps nodes in the center of the viewport, and unlike the positioning force, - * it does not distort their relative positions. - * - * The generic refers to the type of data for a node. - */ -export interface ForceCenter extends Force { - /** - * Assign the array of nodes to this force. This method is called when a force is bound to a simulation via simulation.force - * and when the simulation’s nodes change via simulation.nodes. - * - * A force may perform necessary work during initialization, such as evaluating per-node parameters, to avoid repeatedly performing work during each application of the force. - */ - initialize(nodes: NodeDatum[]): void; - - /** - * Return the current x-coordinate of the centering position, which defaults to zero. - */ - x(): number; - /** - * Set the x-coordinate of the centering position. - * - * @param x x-coordinate. - */ - x(x: number): this; - - /** - * Return the current y-coordinate of the centering position, which defaults to zero. - */ - y(): number; - /** - * Set the y-coordinate of the centering position. - * - * @param y y-coordinate. - */ - y(y: number): this; -} - -/** - * Create a new centering force with the specified x- and y- coordinates. - * If x and y are not specified, they default to [0,0]. - * - * The centering force translates nodes uniformly so that the mean position of all nodes - * (the center of mass if all nodes have equal weight) is at the given position [x,y]. - * This force modifies the positions of nodes on each application; it does not modify velocities, - * as doing so would typically cause the nodes to overshoot and oscillate around the desired center. - * This force helps keeps nodes in the center of the viewport, and unlike the positioning force, - * it does not distort their relative positions. - * - * The generic refers to the type of data for a node. - * - * @param x An optional x-coordinate for the centering position, defaults to 0. - * @param y An optional y-coordinate for the centering position, defaults to 0. - */ -export function forceCenter(x?: number, y?: number): ForceCenter; - -// Collision ------------------------------------------------------------ - -/** - * The collision force treats nodes as circles with a given radius, rather than points, and prevents nodes from overlapping. - * More formally, two nodes a and b are separated so that the distance between a and b is at least radius(a) + radius(b). - * To reduce jitter, this is by default a “soft” constraint with a configurable strength and iteration count. - * - * The generic refers to the type of data for a node. - */ -export interface ForceCollide extends Force { - /** - * Assign the array of nodes to this force. This method is called when a force is bound to a simulation via simulation.force - * and when the simulation’s nodes change via simulation.nodes. - * - * A force may perform necessary work during initialization, such as evaluating per-node parameters, to avoid repeatedly performing work during each application of the force. - */ - initialize(nodes: NodeDatum[]): void; - - /** - * Returns the current radius accessor function. - */ - radius(): (node: NodeDatum, i: number, nodes: NodeDatum[]) => number; - /** - * Set the radius used in collision detection to a constant number for each node. - * - * The constant is internally wrapped into a radius accessor function. - * - * The radius accessor is invoked for each node in the simulation, being passed the node, its zero-based index and the complete array of nodes. - * The resulting number is then stored internally, such that the radius of each node is only recomputed - * when the force is initialized or when this method is called with a new radius, and not on every application of the force. - * - * @param radius A constant radius for each node. - */ - radius(radius: number): this; - /** - * Set the radius accessor function determining the radius for each node in collision detection. - * - * The radius accessor is invoked for each node in the simulation, being passed the node, its zero-based index and the complete array of nodes. - * The resulting number is then stored internally, such that the radius of each node is only recomputed - * when the force is initialized or when this method is called with a new radius, and not on every application of the force. - * - * @param radius A radius accessor function which is invoked for each node in the simulation, being passed the node, its zero-based index and the complete array of nodes. - * The function returns a radius. - */ - radius(radius: (node: NodeDatum, i: number, nodes: NodeDatum[]) => number): this; - - /** - * Return the current strength, which defaults to 0.7. - */ - strength(): number; - /** - * Set the force strength to the specified number in the range [0,1] and return this force. - * The default strength is 0.7. - * - * Overlapping nodes are resolved through iterative relaxation. - * For each node, the other nodes that are anticipated to overlap at the next tick (using the anticipated positions [x + vx,y + vy]) are determined; - * the node’s velocity is then modified to push the node out of each overlapping node. - * The change in velocity is dampened by the force’s strength such that the resolution of simultaneous overlaps can be blended together to find a stable solution. - * - * @param strength Strength. - */ - strength(strength: number): this; - - /** - * Return the current iteration count which defaults to 1. - */ - iterations(): number; - /** - * Sets the number of iterations per application to the specified number and return this force. - * - * Increasing the number of iterations greatly increases the rigidity of the constraint and avoids partial overlap of nodes, - * but also increases the runtime cost to evaluate the force. - * - * @param iterations Number of iterations. - */ - iterations(iterations: number): this; -} - -/** - * Creates a new circle collision force with the default radius one for all nodes. - * - * The collision force treats nodes as circles with a given radius, rather than points, and prevents nodes from overlapping. - * More formally, two nodes a and b are separated so that the distance between a and b is at least radius(a) + radius(b). - * To reduce jitter, this is by default a “soft” constraint with a configurable strength and iteration count. - * - * The generic refers to the type of data for a node. - */ -export function forceCollide(): ForceCollide; -/** - * Create a new circle collision force with the specified constant radius for all nodes. - * - * The collision force treats nodes as circles with a given radius, rather than points, and prevents nodes from overlapping. - * More formally, two nodes a and b are separated so that the distance between a and b is at least radius(a) + radius(b). - * To reduce jitter, this is by default a “soft” constraint with a configurable strength and iteration count. - * - * The generic refers to the type of data for a node. - * - * @param radius A constant radius for each node. - */ -export function forceCollide(radius: number): ForceCollide; -/** - * Creates a new circle collision force with the specified radius accessor function. - * - * The collision force treats nodes as circles with a given radius, rather than points, and prevents nodes from overlapping. - * More formally, two nodes a and b are separated so that the distance between a and b is at least radius(a) + radius(b). - * To reduce jitter, this is by default a “soft” constraint with a configurable strength and iteration count. - * - * The radius accessor is invoked for each node in the simulation, being passed the node, its zero-based index and the complete array of nodes. - * The resulting number is then stored internally, such that the radius of each node is only recomputed - * when the force is initialized or when this method is called with a new radius, and not on every application of the force. - * - * @param radius A radius accessor function which is invoked for each node in the simulation, being passed the node, its zero-based index and the complete array of nodes. - * The function returns a radius. - */ -export function forceCollide(radius: (node: NodeDatum, i: number, nodes: NodeDatum[]) => number): ForceCollide; - -// Link ---------------------------------------------------------------- - -/** - * The link force pushes linked nodes together or apart according to the desired link distance. - * The strength of the force is proportional to the difference between the linked nodes’ distance and the target distance, similar to a spring force. - * - * The first generic refers to the type of data for a node. - * The second generic refers to the type of data for a link. - */ -export interface ForceLink> extends Force { - /** - * Assign the array of nodes to this force. This method is called when a force is bound to a simulation via simulation.force - * and when the simulation’s nodes change via simulation.nodes. - * - * A force may perform necessary work during initialization, such as evaluating per-node parameters, to avoid repeatedly performing work during each application of the force. - */ - initialize(nodes: NodeDatum[]): void; - - /** - * Return the current array of links, which defaults to the empty array. - * - */ - links(): LinkDatum[]; - /** - * Set the array of links associated with this force, recompute the distance and strength parameters for each link, and return this force. - * - * Each link is an object with the following properties: - * * source - the link’s source node; see simulation.nodes - * * target - the link’s target node; see simulation.nodes - * * index - the zero-based index into links, assigned by this method - * - * For convenience, a link’s source and target properties may be initialized using numeric or string identifiers rather than object references; see link.id. - * If the specified array of links is modified, such as when links are added to or removed from the simulation, - * this method must be called again with the new (or changed) array to notify the force of the change; - * the force does not make a defensive copy of the specified array. - * - * @param links An array of link data. - */ - links(links: LinkDatum[]): this; - - /** - * Return the current node id accessor, which defaults to the numeric node.index. - */ - id(): (node: NodeDatum, i: number, nodesData: NodeDatum[]) => (string | number); - /** - * Set the node id accessor to the specified function and return this force. - * - * The default id accessor allows each link’s source and target to be specified as a zero-based index - * into the nodes array. - * - * The id accessor is invoked for each node whenever the force is initialized, - * as when the nodes or links change, being passed the node, the zero-based index of the node in the node array, and the node array. - * - * @param id A node id accessor function which is invoked for each node in the simulation, - * being passed the node, the zero-based index of the node in the node array, and the node array. It returns a string to represent the node id which can be used - * for matching link source and link target strings during the ForceLink initialization. - */ - id(id: (node: NodeDatum, i: number, nodesData: NodeDatum[]) => string): this; - - /** - * Return the current distance accessor, which defaults to implying a default distance of 30. - */ - distance(): (link: LinkDatum, i: number, links: LinkDatum[]) => number; - /** - * Set the distance accessor to use the specified constant number for all links, - * re-evaluates the distance accessor for each link, and returns this force. - * - * The constant is internally wrapped into a distance accessor function. - * - * The distance accessor is invoked for each link, being passed the link, its zero-based index and the complete array of links. - * The resulting number is then stored internally, such that the distance of each link is only recomputed when the force is initialized or - * when this method is called with a new distance, and not on every application of the force. - * - * @param distance The constant distance to be used for all links. - */ - distance(distance: number): this; - /** - * Set the distance accessor to use the specified function, - * re-evaluates the distance accessor for each link, and returns this force. - * - * The distance accessor is invoked for each link, being passed the link, its zero-based index and the complete array of links. - * The resulting number is then stored internally, such that the distance of each link is only recomputed when the force is initialized or - * when this method is called with a new distance, and not on every application of the force. - * - * @param distance A distance accessor function which is invoked for each link being passed the link, - * its zero-based index and the complete array of links. It returns the distance. - */ - distance(distance: (link: LinkDatum, i: number, links: LinkDatum[]) => number): this; - - /** - * Return the current strength accessor. - * For details regarding the default behavior see: {@link https://github.com/d3/d3-force#link_strength} - */ - strength(): (link: LinkDatum, i: number, links: LinkDatum[]) => number; - /** - * Set the strenght accessor to use the specified constant number for all links, - * re-evaluates the strength accessor for each link, and returns this force. - * - * The constant is internally wrapped into a strength accessor function. - * - * The strength accessor is invoked for each link, being passed the link, its zero-based index and the complete array of links. - * The resulting number is then stored internally, such that the strength of each link is only recomputed - * when the force is initialized or when this method is called with a new strength, and not on every application of the force. - * - * @param strength The constant strength to be used for all links. - */ - strength(strength: number): this; - /** - * Set the strenght accessor to use the specified function, - * re-evaluates the strength accessor for each link, and returns this force. - * - * The strength accessor is invoked for each link, being passed the link, its zero-based index and the complete array of links. - * The resulting number is then stored internally, such that the strength of each link is only recomputed - * when the force is initialized or when this method is called with a new strength, and not on every application of the force. - * - * @param strength A distance accessor function which is invoked for each link being passed the link, - * its zero-based index and the complete array of links. It returns the strength. - */ - strength(strength: (link: LinkDatum, i: number, links: LinkDatum[]) => number): this; - - /** - * Return the current iteration count which defaults to 1. - */ - iterations(): number; - /** - * Sets the number of iterations per application to the specified number and return this force. - * - * Increasing the number of iterations greatly increases the rigidity of the constraint and is useful for complex structures such as lattices, - * but also increases the runtime cost to evaluate the force. - * - * @param iterations Number of iterations. - */ - iterations(iterations: number): this; - -} - -/** - * Creates a new link force with the defaulting links to an empty array. - * - * The link force pushes linked nodes together or apart according to the desired link distance. - * The strength of the force is proportional to the difference between the linked nodes’ distance and the target distance, similar to a spring force. - * - * The first generic refers to the type of data for a node. - * The second generic refers to the type of data for a link. - */ -export function forceLink>(): ForceLink; -/** - * Creates a new link force with the specified links array. - * - * The link force pushes linked nodes together or apart according to the desired link distance. - * The strength of the force is proportional to the difference between the linked nodes’ distance and the target distance, similar to a spring force. - * - * The first generic refers to the type of data for a node. - * The second generic refers to the type of data for a link. - * - * @param links An array of link data. - */ -export function forceLink>(links: LinksDatum[]): ForceLink; - -// Many Body ---------------------------------------------------------------- - -/** - * The many-body (or n-body) force applies mutually amongst all nodes. It can be used to simulate gravity (attraction) if the strength is positive, - * or electrostatic charge (repulsion) if the strength is negative. This implementation uses quadtrees and the Barnes–Hut approximation to greatly - * improve performance; the accuracy can be customized using the theta parameter. - * - * Unlike links, which only affect two linked nodes, the charge force is global: every node affects every other node, even if they are on disconnected subgraphs. - * - * The generic refers to the type of data for a node. - */ -export interface ForceManyBody extends Force { - /** - * Assign the array of nodes to this force. This method is called when a force is bound to a simulation via simulation.force - * and when the simulation’s nodes change via simulation.nodes. - * - * A force may perform necessary work during initialization, such as evaluating per-node parameters, to avoid repeatedly performing work during each application of the force. - */ - initialize(nodes: NodeDatum[]): void; - - /** - * Return the current strength accessor. - * - * For details regarding the default behavior see: {@link https://github.com/d3/d3-force#manyBody_strength} - */ - strength(): (d: NodeDatum, i: number, data: NodeDatum[]) => number; - /** - * Set the strength accessor to the specified constant strength for all nodes, re-evaluates the strength accessor for each node, and - * returns this force. - * - * A positive value causes nodes to attract each other, similar to gravity, while a negative value causes nodes to repel each other, - * similar to electrostatic charge. - * - * The default represents a constant value of -30. - * - * The constant is internally wrapped into a strength accessor function. - * - * The strength accessor is invoked for each node in the simulation, being passed the node, its zero-based index and the complete array of nodes. - * The resulting number is then stored internally, such that the strength of each node is only recomputed when the force is initialized or - * when this method is called with a new strength, and not on every application of the force. - * - * @param strength The constant strength to be used for all nodes. - */ - strength(strength: number): this; - /** - * Set the strength accessor to the specified function, re-evaluates the strength accessor for each node, and - * returns this force. - * - * A positive value causes nodes to attract each other, similar to gravity, while a negative value causes nodes to repel each other, - * similar to electrostatic charge. - * - * The default represents a constant value of -30. - * - * The strength accessor is invoked for each node in the simulation, being passed the node, its zero-based index and the complete array of nodes. - * The resulting number is then stored internally, such that the strength of each node is only recomputed when the force is initialized or - * when this method is called with a new strength, and not on every application of the force. - * - * @param strength A strength accessor function which is invoked for each node in the simulation, being passed the node, its zero-based index and the complete array of nodes. - * The function returns the strength. - */ - strength(strength: (d: NodeDatum, i: number, data: NodeDatum[]) => number): this; - - /** - * Return the current value of the Barnes–Hut approximation criterion , which defaults to 0.9 - */ - theta(): number; - /** - * Set the Barnes–Hut approximation criterion to the specified number and returns this force. - * - * To accelerate computation, this force implements the Barnes–Hut approximation which takes O(n log n) per application - * where n is the number of nodes. For each application, a quadtree stores the current node positions; - * then for each node, the combined force of all other nodes on the given node is computed. - * For a cluster of nodes that is far away, the charge force can be approximated by treating the cluster as a single, larger node. - * The theta parameter determines the accuracy of the approximation: - * if the ratio w / l of the width w of the quadtree cell to the distance l from the node to the cell’s center of mass is less than theta, - * all nodes in the given cell are treated as a single node rather than individually. - * - * The default value is 0.9. - * - * @param theta Value for the theta parameter. - */ - theta(theta: number): this; - - /** - * Returns the current minimum distance over which this force is considered, which defaults to 1. - */ - distanceMin(): number; - /** - * Sets the minimum distance between nodes over which this force is considered. - * - * A minimum distance establishes an upper bound on the strength of the force between two nearby nodes, avoiding instability. - * In particular, it avoids an infinitely-strong force if two nodes are exactly coincident; in this case, the direction of the force is random. - * - * The default value is 1. - * - * @param distance The minimum distance between nodes over which this force is considered. - */ - distanceMin(distance: number): this; - - /** - * Returns the current maximum distance over which this force is considered, which defaults to infinity. - */ - distanceMax(): number; - /** - * Sets the maximum distance between nodes over which this force is considered. - * - * Specifying a finite maximum distance improves performance and produces a more localized layout. - * - * The default value is infinity. - * - * @param distance The maximum distance between nodes over which this force is considered. - */ - distanceMax(distance: number): this; -} - -/** - * Creates a new many-body force with the default parameters. - * - * The many-body (or n-body) force applies mutually amongst all nodes. It can be used to simulate gravity (attraction) if the strength is positive, - * or electrostatic charge (repulsion) if the strength is negative. This implementation uses quadtrees and the Barnes–Hut approximation to greatly - * improve performance; the accuracy can be customized using the theta parameter. - * - * Unlike links, which only affect two linked nodes, the charge force is global: every node affects every other node, even if they are on disconnected subgraphs. - * - * The generic refers to the type of data for a node. - */ -export function forceManyBody(): ForceManyBody; - -// Positioning ---------------------------------------------------------------- - -/** - * The x-positioning force pushes nodes towards a desired position along the given dimension with a configurable strength. - * The strength of the force is proportional to the one-dimensional distance between the node’s position and the target position. - * While this force can be used to position individual nodes, it is intended primarily for global forces that apply to all (or most) nodes. - * - * The generic refers to the type of data for a node. - */ -export interface ForceX extends Force { - /** - * Assign the array of nodes to this force. This method is called when a force is bound to a simulation via simulation.force - * and when the simulation’s nodes change via simulation.nodes. - * - * A force may perform necessary work during initialization, such as evaluating per-node parameters, to avoid repeatedly performing work during each application of the force. - */ - initialize(nodes: NodeDatum[]): void; - - /** - * Returns the current strength accessor, which defaults to a constant strength for all nodes of 0.1. - */ - strength(): (d: NodeDatum, i: number, data: NodeDatum[]) => number; - /** - * Set the strength accessor to the specified constant strength for all nodes, re-evaluates the strength accessor for each node, and returns this force. - * - * The strength determines how much to increment the node’s x-velocity: (x - node.x) × strength. - * - * For example, a value of 0.1 indicates that the node should move a tenth of the way from its current x-position to the target x-position with each application. - * Higher values moves nodes more quickly to the target position, often at the expense of other forces or constraints. - * - * A value outside the range [0,1] is not recommended. - * - * The constant is internally wrapped into a strength accessor function. - * - * The strength accessor is invoked for each node in the simulation, being passed the node, its zero-based index and the complete array of nodes. - * The resulting number is then stored internally, such that the strength of each node is only recomputed when the force is initialized or - * when this method is called with a new strength, and not on every application of the force. - * - * @param strength Constant value of strength to be used for all nodes. - */ - strength(strength: number): this; - /** - * Set the strength accessor to the specified function, re-evaluates the strength accessor for each node, and returns this force. - * - * The strength determines how much to increment the node’s x-velocity: (x - node.x) × strength. - * - * For example, a value of 0.1 indicates that the node should move a tenth of the way from its current x-position to the target x-position with each application. - * Higher values moves nodes more quickly to the target position, often at the expense of other forces or constraints. - * - * A value outside the range [0,1] is not recommended. - * - * The strength accessor is invoked for each node in the simulation, being passed the node, its zero-based index and the complete array of nodes. - * The resulting number is then stored internally, such that the strength of each node is only recomputed when the force is initialized or - * when this method is called with a new strength, and not on every application of the force. - * - * @param strength A strength accessor function which is invoked for each node in the simulation, being passed the node, its zero-based index and the complete array of nodes. - * The function returns the strength. - */ - strength(strength: (d: NodeDatum, i: number, data: NodeDatum[]) => number): this; - - /** - * Return the current x-accessor, which defaults to a function returning 0 for all nodes. - */ - x(): (d: NodeDatum, i: number, data: NodeDatum[]) => number; - /** - * Set the x-coordinate accessor to the specified number, re-evaluates the x-accessor for each node, - * and returns this force. - * - * The constant is internally wrapped into an x-coordinate accessor function. - * - * The x-accessor is invoked for each node in the simulation, being passed the node, its zero-based index and the complete array of nodes. - * The resulting number is then stored internally, such that the target x-coordinate of each node is only recomputed when the force is initialized or - * when this method is called with a new x, and not on every application of the force. - * - * @param x Constant x-coordinate to be used for all nodes. - */ - x(x: number): this; - /** - * Set the x-coordinate accessor to the specified function, re-evaluates the x-accessor for each node, - * and returns this force. - * - * The x-accessor is invoked for each node in the simulation, being passed the node, its zero-based index and the complete array of nodes. - * The resulting number is then stored internally, such that the target x-coordinate of each node is only recomputed when the force is initialized or - * when this method is called with a new x, and not on every application of the force. - * - * @param x A x-coordinate accessor function which is invoked for each node in the simulation, being passed the node, its zero-based index and the complete array of nodes. - * The function returns the x-coordinate. - */ - x(x: (d: NodeDatum, i: number, data: NodeDatum[]) => number): this; -} - -/** - * Create a new positioning force along the x-axis towards the given position x which is defaulted to a constant 0 for all nodes. - * - * The x-positioning force pushes nodes towards a desired position along the given dimension with a configurable strength. - * The strength of the force is proportional to the one-dimensional distance between the node’s position and the target position. - * While this force can be used to position individual nodes, it is intended primarily for global forces that apply to all (or most) nodes. - * - * The generic refers to the type of data for a node. - */ -export function forceX(): ForceX; -/** - * Create a new positioning force along the x-axis towards the given position x which is constant for all nodes. - * - * The x-positioning force pushes nodes towards a desired position along the given dimension with a configurable strength. - * The strength of the force is proportional to the one-dimensional distance between the node’s position and the target position. - * While this force can be used to position individual nodes, it is intended primarily for global forces that apply to all (or most) nodes. - * - * The generic refers to the type of data for a node. - * - * @param x Constant x-coordinate to be used for all nodes. - */ -export function forceX(x: number): ForceX; -/** - * Create a new positioning force along the x-axis towards the position x given by evaluating the specified x-coordinate accessor - * for each node. - * - * The x-positioning force pushes nodes towards a desired position along the given dimension with a configurable strength. - * The strength of the force is proportional to the one-dimensional distance between the node’s position and the target position. - * While this force can be used to position individual nodes, it is intended primarily for global forces that apply to all (or most) nodes. - * - * The generic refers to the type of data for a node. - * - * @param x A x-coordinate accessor function which is invoked for each node in the simulation, being passed the node and its zero-based index. - * The function returns the x-coordinate. - */ -export function forceX(x: (d: NodeDatum, i: number, data: NodeDatum[]) => number): ForceX; - -/** - * The y-positioning force pushes nodes towards a desired position along the given dimension with a configurable strength. - * The strength of the force is proportional to the one-dimensional distance between the node’s position and the target position. - * While this force can be used to position individual nodes, it is intended primarily for global forces that apply to all (or most) nodes. - * - * The generic refers to the type of data for a node. - */ -export interface ForceY extends Force { - /** - * Assign the array of nodes to this force. This method is called when a force is bound to a simulation via simulation.force - * and when the simulation’s nodes change via simulation.nodes. - * - * A force may perform necessary work during initialization, such as evaluating per-node parameters, to avoid repeatedly performing work during each application of the force. - */ - initialize(nodes: NodeDatum[]): void; - - /** - * Returns the current strength accessor, which defaults to a constant strength for all nodes of 0.1. - */ - strength(): (d: NodeDatum, i: number, data: NodeDatum[]) => number; - /** - * Set the strength accessor to the specified constant strength for all nodes, re-evaluates the strength accessor for each node, and returns this force. - * - * The strength determines how much to increment the node’s y-velocity: (y - node.y) × strength. - * - * For example, a value of 0.1 indicates that the node should move a tenth of the way from its current y-position to the target y-position with each application. - * Higher values moves nodes more quickly to the target position, often at the expense of other forces or constraints. - * - * A value outside the range [0,1] is not recommended. - * - * The constant is internally wrapped into a strength accessor function. - * - * The strength accessor is invoked for each node in the simulation, being passed the node, its zero-based index and the complete array of nodes. - * The resulting number is then stored internally, such that the strength of each node is only recomputed when the force is initialized or - * when this method is called with a new strength, and not on every application of the force. - * - * @param strength Constant value of strength to be used for all nodes. - */ - strength(strength: number): this; - /** - * Set the strength accessor to the specified function, re-evaluates the strength accessor for each node, and returns this force. - * - * The strength determines how much to increment the node’s y-velocity: (y - node.y) × strength. - * - * For example, a value of 0.1 indicates that the node should move a tenth of the way from its current y-position to the target y-position with each application. - * Higher values moves nodes more quickly to the target position, often at the expense of other forces or constraints. - * - * A value outside the range [0,1] is not recommended. - * - * The strength accessor is invoked for each node in the simulation, being passed the node, its zero-based index and the complete array of nodes. - * The resulting number is then stored internally, such that the strength of each node is only recomputed when the force is initialized or - * when this method is called with a new strength, and not on every application of the force. - * - * @param strength A strength accessor function which is invoked for each node in the simulation, being passed the node, its zero-based index and the complete array of nodes. - * The function returns the strength. - */ - strength(strength: (d: NodeDatum, i: number, data: NodeDatum[]) => number): this; - - /** - * Return the current y-accessor, which defaults to a function returning 0 for all nodes. - */ - y(): (d: NodeDatum, i: number, data: NodeDatum[]) => number; - /** - * Set the y-coordinate accessor to the specified number, re-evaluates the y-accessor for each node, - * and returns this force. - * - * The constant is internally wrapped into a y-coordinate accessor function. - * - * The y-accessor is invoked for each node in the simulation, being passed the node, its zero-based index and the complete array of nodes. - * The resulting number is then stored internally, such that the target y-coordinate of each node is only recomputed when the force is initialized or - * when this method is called with a new y, and not on every application of the force. - * - * @param y Constant y-coordinate to be used for all nodes. - */ - y(y: number): this; - /** - * Set the y-coordinate accessor to the specified function, re-evaluates the y-accessor for each node, - * and returns this force. - * - * The y-accessor is invoked for each node in the simulation, being passed the node, its zero-based index and the complete array of nodes. - * The resulting number is then stored internally, such that the target y-coordinate of each node is only recomputed when the force is initialized or - * when this method is called with a new y, and not on every application of the force. - * - * @param y A y-coordinate accessor function which is invoked for each node in the simulation, being passed the node, its zero-based index and the complete array of nodes. - * The function returns the y-coordinate. - */ - y(y: (d: NodeDatum, i: number, data: NodeDatum[]) => number): this; -} - -/** - * Create a new positioning force along the y-axis towards the given position y which is defaulted to a constant 0 for all nodes. - * - * The y-positioning force pushes nodes towards a desired position along the given dimension with a configurable strength. - * The strength of the force is proportional to the one-dimensional distance between the node’s position and the target position. - * While this force can be used to position individual nodes, it is intended primarily for global forces that apply to all (or most) nodes. - * - * The generic refers to the type of data for a node. - */ -export function forceY(): ForceY; -/** - * Create a new positioning force along the y-axis towards the given position y which is constant for all nodes. - * - * The y-positioning force pushes nodes towards a desired position along the given dimension with a configurable strength. - * The strength of the force is proportional to the one-dimensional distance between the node’s position and the target position. - * While this force can be used to position individual nodes, it is intended primarily for global forces that apply to all (or most) nodes. - * - * The generic refers to the type of data for a node. - * - * @param y Constant y-coordinate to be used for all nodes. - */ -export function forceY(y: number): ForceY; -/** - * Create a new positioning force along the y-axis towards the position y given by evaluating the specified y-coordinate accessor - * for each node. - * - * The y-positioning force pushes nodes towards a desired position along the given dimension with a configurable strength. - * The strength of the force is proportional to the one-dimensional distance between the node’s position and the target position. - * While this force can be used to position individual nodes, it is intended primarily for global forces that apply to all (or most) nodes. - * - * The generic refers to the type of data for a node. - * - * @param y A y-coordinate accessor function which is invoked for each node in the simulation, being passed the node and its zero-based index. - * The function returns the y-coordinate. - */ -export function forceY(y: (d: NodeDatum, i: number, data: NodeDatum[]) => number): ForceY; diff --git a/d3-force/tslint.json b/d3-force/tslint.json deleted file mode 100644 index 68d10d72a6..0000000000 --- a/d3-force/tslint.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "../tslint.json", - "rules": { - "unified-signatures": false - } -} diff --git a/d3-geo/index.d.ts b/d3-geo/index.d.ts deleted file mode 100644 index dfc58a5f9e..0000000000 --- a/d3-geo/index.d.ts +++ /dev/null @@ -1,1533 +0,0 @@ -// Type definitions for D3JS d3-geo module 1.6 -// Project: https://github.com/d3/d3-geo/ -// Definitions by: Hugues Stefanski , Tom Wanzek , Alex Ford , Boris Yankov -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -// Last module patch version validated against: 1.6.1 - -// ---------------------------------------------------------------------- -// Shared Interfaces and Types -// ---------------------------------------------------------------------- - -/** - * A basic geometry for a sphere, which is supported by d3-geo - * beyond the GeoJSON geometries. - */ -export interface GeoSphere { - /** - * Sphere geometry type - */ - type: 'Sphere'; -} - -/** - * Type Alias for GeoJSON Geometry Object and GeoSphere additional - * geometry supported by d3-geo - */ -export type GeoGeometryObjects = GeoJSON.GeometryObject | GeoSphere; - -/** - * A GeoJSON-style GeometryCollection which supports GeoJSON geometry objects - * and additionally GeoSphere - */ -export interface ExtendedGeometryCollection { - type: string; - bbox?: number[]; - crs?: GeoJSON.CoordinateReferenceSystem; - geometries: GeometryType[]; -} - -/** - * A GeoJSON-style Feature which support features built on GeoJSON GeometryObjects - * or GeoSphere - */ -export interface ExtendedFeature extends GeoJSON.GeoJsonObject { - geometry: GeometryType; - properties: Properties; - id?: string; -} - -/** - * A GeoJSON-style FeatureCollection which supports GeoJSON features - * and features built on GeoSphere - */ -export interface ExtendedFeatureCollection> extends GeoJSON.GeoJsonObject { - features: FeatureType[]; -} - -/** - * Type Alias for permissible objects which can be used with d3-geo - * methods - */ -export type GeoPermissibleObjects = GeoGeometryObjects | ExtendedGeometryCollection - | ExtendedFeature | ExtendedFeatureCollection>; - -// ---------------------------------------------------------------------- -// Spherical Math -// ---------------------------------------------------------------------- - -/** - * Returns the spherical area of the specified feature in steradians. - * This is the spherical equivalent of path.area. - * - * @param object A geographic feature supported by d3-geo (An extension of GeoJSON feature). - */ -export function geoArea(object: ExtendedFeature): number; -/** - * Returns the spherical area of the specified feature collection in steradians. - * This is the spherical equivalent of path.area. - * - * @param object A geographic feature collection supported by d3-geo (An extension of GeoJSON feature). - */ -export function geoArea(object: ExtendedFeatureCollection>): number; -/** - * Returns the spherical area of the specified GeoJson Geometry Object or GeoSphere object in steradians. - * This is the spherical equivalent of path.area. - * - * @param object A GeoJson Geometry Object or GeoSphere object supported by d3-geo (An extension of GeoJSON). - */ -export function geoArea(object: GeoGeometryObjects): number; -/** - * Returns the spherical area of the specified geographic geometry collection in steradians. - * This is the spherical equivalent of path.area. - * - * @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). - */ -export function geoArea(object: ExtendedGeometryCollection): number; - -/** - * Returns the spherical bounding box for the specified feature. The bounding box is represented by a two-dimensional array: [[left, bottom], [right, top]], - * where left is the minimum longitude, bottom is the minimum latitude, right is maximum longitude, and top is the maximum latitude. All coordinates are given in degrees. - * (Note that in projected planar coordinates, the minimum latitude is typically the maximum y-value, and the maximum latitude is typically the minimum y-value.) - * This is the spherical equivalent of path.bounds. - * - * @param object A geographic feature supported by d3-geo (An extension of GeoJSON feature). - */ -export function geoBounds(object: ExtendedFeature): [[number, number], [number, number]]; -/** - * Returns the spherical bounding box for the specified feature collection. The bounding box is represented by a two-dimensional array: [[left, bottom], [right, top]], - * where left is the minimum longitude, bottom is the minimum latitude, right is maximum longitude, and top is the maximum latitude. All coordinates are given in degrees. - * (Note that in projected planar coordinates, the minimum latitude is typically the maximum y-value, and the maximum latitude is typically the minimum y-value.) - * This is the spherical equivalent of path.bounds. - * - * @param object A geographic feature collection supported by d3-geo (An extension of GeoJSON feature). - */ -export function geoBounds(object: ExtendedFeatureCollection>): [[number, number], [number, number]]; -/** - * Returns the spherical bounding box for the specified GeoJson Geometry Object or GeoSphere object. The bounding box is represented by a two-dimensional array: [[left, bottom], [right, top]], - * where left is the minimum longitude, bottom is the minimum latitude, right is maximum longitude, and top is the maximum latitude. All coordinates are given in degrees. - * (Note that in projected planar coordinates, the minimum latitude is typically the maximum y-value, and the maximum latitude is typically the minimum y-value.) - * This is the spherical equivalent of path.bounds. - * - * @param object A GeoJson Geometry Object or GeoSphere object supported by d3-geo (An extension of GeoJSON). - */ -export function geoBounds(object: GeoGeometryObjects): [[number, number], [number, number]]; -/** - * Returns the spherical bounding box for the specified geometry collection. The bounding box is represented by a two-dimensional array: [[left, bottom], [right, top]], - * where left is the minimum longitude, bottom is the minimum latitude, right is maximum longitude, and top is the maximum latitude. All coordinates are given in degrees. - * (Note that in projected planar coordinates, the minimum latitude is typically the maximum y-value, and the maximum latitude is typically the minimum y-value.) - * This is the spherical equivalent of path.bounds. - * - * @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). - */ -export function geoBounds(object: ExtendedGeometryCollection): [[number, number], [number, number]]; - -/** - * Returns the spherical centroid of the specified feature in steradians. - * This is the spherical equivalent of path.centroid. - * - * @param object A geographic feature supported by d3-geo (An extension of GeoJSON feature). - */ -export function geoCentroid(object: ExtendedFeature): [number, number]; -/** - * Returns the spherical centroid of the specified feature collection in steradians. - * This is the spherical equivalent of path.centroid. - * - * @param object A geographic feature collection supported by d3-geo (An extension of GeoJSON feature). - */ -export function geoCentroid(object: ExtendedFeatureCollection>): [number, number]; -/** - * Returns the spherical centroid of the specified GeoJson Geometry Object or GeoSphere object in steradians. - * This is the spherical equivalent of path.centroid. - * - * @param object A GeoJson Geometry Object or GeoSphere object supported by d3-geo (An extension of GeoJSON). - */ -export function geoCentroid(object: GeoGeometryObjects): [number, number]; -/** - * Returns the spherical centroid of the specified geographic geometry collection in steradians. - * This is the spherical equivalent of path.centroid. - * - * @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). - */ -export function geoCentroid(object: ExtendedGeometryCollection): [number, number]; - -/** - * Returns true if and only if the specified GeoJSON object contains the specified point, or false if the object does not contain the point. - * The point must be specified as a two-element array [longitude, latitude] in degrees. For Point and MultiPoint geometries, an exact test is used; - * for a Sphere, true is always returned; for other geometries, an epsilon threshold is applied. - * - * @param object A geographic feature supported by d3-geo (An extension of GeoJSON feature). - * @param point Point specified as a two-element array [longitude, latitude] in degrees. - */ -export function geoContains(object: ExtendedFeature, point: [number, number]): boolean; -/** - * Returns true if and only if the specified GeoJSON object contains the specified point, or false if the object does not contain the point. - * The point must be specified as a two-element array [longitude, latitude] in degrees. For Point and MultiPoint geometries, an exact test is used; - * for a Sphere, true is always returned; for other geometries, an epsilon threshold is applied. - * - * @param object A geographic feature collection supported by d3-geo (An extension of GeoJSON feature). - * @param point Point specified as a two-element array [longitude, latitude] in degrees. - */ -export function geoContains(object: ExtendedFeatureCollection>, point: [number, number]): boolean; -/** - * Returns true if and only if the specified GeoJSON object contains the specified point, or false if the object does not contain the point. - * The point must be specified as a two-element array [longitude, latitude] in degrees. For Point and MultiPoint geometries, an exact test is used; - * for a Sphere, true is always returned; for other geometries, an epsilon threshold is applied. - * - * @param object A GeoJson Geometry Object or GeoSphere object supported by d3-geo (An extension of GeoJSON). - * @param point Point specified as a two-element array [longitude, latitude] in degrees. - */ -export function geoContains(object: GeoGeometryObjects, point: [number, number]): boolean; -/** - * Returns true if and only if the specified GeoJSON object contains the specified point, or false if the object does not contain the point. - * The point must be specified as a two-element array [longitude, latitude] in degrees. For Point and MultiPoint geometries, an exact test is used; - * for a Sphere, true is always returned; for other geometries, an epsilon threshold is applied. - * - * @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). - * @param point Point specified as a two-element array [longitude, latitude] in degrees. - */ -export function geoContains(object: ExtendedGeometryCollection, point: [number, number]): boolean; - -/** - * Returns the great-arc distance in radians between the two points a and b. - * Each point must be specified as a two-element array [longitude, latitude] in degrees. - * - * @param a Point specified as a two-element array [longitude, latitude] in degrees. - * @param b Point specified as a two-element array [longitude, latitude] in degrees. - */ -export function geoDistance(a: [number, number], b: [number, number]): number; - -/** - * Returns the great-arc length of the specified feature in radians. For polygons, returns the perimeter of the exterior ring plus that of any interior rings. - * This is the spherical equivalent of path.measure. - * - * @param object A geographic feature supported by d3-geo (An extension of GeoJSON feature). - */ -export function geoLength(object: ExtendedFeature): number; -/** - * Returns the great-arc length of the specified feature collection in radians. For polygons, returns the perimeter of the exterior ring plus that of any interior rings. - * This is the spherical equivalent of path.measure. - * - * @param object A geographic feature collection supported by d3-geo (An extension of GeoJSON feature). - */ -export function geoLength(object: ExtendedFeatureCollection>): number; -/** - * Returns the great-arc length of the specified GeoJson Geometry Object or GeoSphere object in radians. For polygons, returns the perimeter of the exterior ring plus that of any interior rings. - * This is the spherical equivalent of path.measure. - * - * @param object A GeoJson Geometry Object or GeoSphere object supported by d3-geo (An extension of GeoJSON). - */ -export function geoLength(object: GeoGeometryObjects): number; -/** - * Returns the great-arc length of the specified geographic geometry collection in radians For polygons, returns the perimeter of the exterior ring plus that of any interior rings. - * This is the spherical equivalent of path.measure.. - * - * @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). - */ -export function geoLength(object: ExtendedGeometryCollection): number; - -/** - * Returns an interpolator function given two points a and b. - * Each point must be specified as a two-element array [longitude, latitude] in degrees. - * - * @param a Point specified as a two-element array [longitude, latitude] in degrees. - * @param b Point specified as a two-element array [longitude, latitude] in degrees. - */ -export function geoInterpolate(a: [number, number], b: [number, number]): (t: number) => [number, number]; - -/** - * A Geo Rotation - */ -export interface GeoRotation { - /** - * Returns a new array [longitude, latitude] in degrees representing the rotated point of the given point. - * - * @param point The point must be specified as a two-element array [longitude, latitude] in degrees. - */ - (point: [number, number]): [number, number]; - - /** - * Returns a new array [longitude, latitude] in degrees representing the point of the given rotated point; the inverse of rotation. - * - * @param point The rotated point must be specified as a two-element array [longitude, latitude] in degrees. - */ - invert(point: [number, number]): [number, number]; -} - -/** - * Returns a rotation function for the given angles. - * - * @param angles A two- or three-element array of numbers [lambda, phi, gamma] specifying the rotation angles in degrees about each spherical axis. - * (These correspond to yaw, pitch and roll.) If the rotation angle gamma is omitted, it defaults to 0. - */ -export function geoRotation(angles: [number, number] | [number, number, number]): GeoRotation; - - -// ---------------------------------------------------------------------- -// Spherical Shapes -// ---------------------------------------------------------------------- - -// geoCircle ============================================================ - -/** - * A new circle generator - * - * The first generic corresponds to the "this"-context within which the geo circle generator will be invoked. - * - * The second generic corresponds to the type of the Datum which will be passed into the geo circle generator. - */ -export interface GeoCircleGenerator { - /** - * Returns a new GeoJSON geometry object of type “Polygon” approximating a circle on the surface of a sphere, - * with the current center, radius and precision. Any arguments are passed to the accessors. - */ - (this: This, d?: Datum, ...args: any[]): GeoJSON.Polygon; - - /** - * Returns the current center accessor, which defaults to a function returning [0, 0]. - */ - center(): ((this: This, d: Datum, ...args: any[]) => [number, number]); - /** - * Sets the circle center to the specified point [longitude, latitude] in degrees, and returns this circle generator. - * - * @param center Center point specified as [longitude, latitude] in degrees. - */ - center(center: [number, number]): this; - /** - * Sets the circle center to the specified center point accessor function, and returns this circle generator. - * - * @param center An accessor function which will be invoked whenever a circle is generated, being passed any arguments passed to the circle generator. - * It returns the center point specified as [longitude, latitude] in degrees. - */ - center(center: ((this: This, d: Datum, ...args: any[]) => [number, number])): this; - - /** - * Returns the current radius accessor, which defaults to a function returning 90. - */ - radius(): ((this: This, d: Datum, ...args: any[]) => number); - /** - * Sets the circle radius to the specified angle in degrees, and returns this circle generator. - * - * @param radius Circle radius as the specified angle in degrees. - */ - radius(radius: number): this; - /** - * Sets the circle radius to the specified radius accessor function, and returns this circle generator. - * - * @param radius An accessor function which will be invoked whenever a circle is generated, being passed any arguments passed to the circle generator. - * It returns the radius as the specified angle in degrees. - */ - radius(radius: ((this: This, d: Datum, ...args: any[]) => number)): this; - - /** - * Returns the current precision accessor, which defaults to a function returning 6. - */ - precision(): ((this: This, d: Datum, ...args: any[]) => number); - /** - * Sets the circle precision to the specified angle in degrees, and returns this circle generator. - * - * Small circles do not follow great arcs and thus the generated polygon is only an approximation. - * Specifying a smaller precision angle improves the accuracy of the approximate polygon, but also increase the cost to generate and render it. - * - * @param precision Precision as specified angle in degrees. - */ - precision(precision: number): this; - /** - * Sets the circle precision to the precision accessor function, and returns this circle generator. - * - * Small circles do not follow great arcs and thus the generated polygon is only an approximation. - * Specifying a smaller precision angle improves the accuracy of the approximate polygon, but also increase the cost to generate and render it. - * - * @param precision An accessor function which will be invoked whenever a circle is generated, being passed any arguments passed to the circle generator. - * It returns the precision as the specified angle in degrees. - */ - precision(precision: (this: This, d: Datum, ...args: any[]) => number): this; -} - -/** - * Returns a new geo circle generator - */ -export function geoCircle(): GeoCircleGenerator; -/** - * Returns a new geo circle generator - * - * The generic corresponds to the data type of the first argument passed into the geo circle generator and its accessor functions. - */ -export function geoCircle(): GeoCircleGenerator; -/** - * Returns a new geo circle generator - * - * The first generic corresponds to the "this" context within which the geo circle generator and its accessors will be invoked. - * - * The second generic corresponds to the data type of the first argument passed into the geo circle generator and its accessor functions. - */ -export function geoCircle(): GeoCircleGenerator; - -// geoGraticule ============================================================ - -/** - * A Feature generator for graticules: a uniform grid of meridians and parallels for showing projection distortion. - * The default graticule has meridians and parallels every 10° between ±80° latitude; for the polar regions, there are meridians every 90°. - */ -export interface GeoGraticuleGenerator { - /** - * Returns a GeoJSON MultiLineString geometry object representing all meridians and parallels for this graticule. - */ - (): GeoJSON.MultiLineString; - - /** - * Returns an array of GeoJSON LineString geometry objects, one for each meridian or parallel for this graticule. - */ - lines(): GeoJSON.LineString[]; - - /** - * Returns a GeoJSON Polygon geometry object representing the outline of this graticule, i.e. along the meridians and parallels defining its extent. - */ - outline(): GeoJSON.Polygon; - - /** - * Returns the current minor extent, which defaults to ⟨⟨-180°, -80° - ε⟩, ⟨180°, 80° + ε⟩⟩. - */ - extent(): [[number, number], [number, number]]; - /** - * Sets the major and minor extents of this graticule. - * - * @param extent Extent to use for major and minor extent of graticule. - */ - extent(extent: [[number, number], [number, number]]): this; - - /** - * Returns the current major extent, which defaults to ⟨⟨-180°, -90° + ε⟩, ⟨180°, 90° - ε⟩⟩. - */ - extentMajor(): [[number, number], [number, number]]; - /** - * Sets the major extent of this graticule. - * - * @param extent Major extent of graticule. - */ - extentMajor(extent: [[number, number], [number, number]]): this; - - /** - * Returns the current minor extent, which defaults to ⟨⟨-180°, -80° - ε⟩, ⟨180°, 80° + ε⟩⟩. - */ - extentMinor(): [[number, number], [number, number]]; - /** - * Sets the minor extent of this graticule. - * - * @param extent Minor extent of graticule. - */ - extentMinor(extent: [[number, number], [number, number]]): this; - - /** - * Returns the current minor step, which defaults to ⟨10°, 10°⟩. - */ - step(): [number, number]; - /** - * Sets the major and minor step for this graticule - * - * @param step Major and minor step to use for this graticule. - */ - step(step: [number, number]): this; - - /** - * Returns the current major step, which defaults to ⟨90°, 360°⟩. - */ - stepMajor(): [number, number]; - /** - * Sets the major step for this graticule. - * - * @param step Major step. - */ - stepMajor(step: [number, number]): this; - - /** - * Returns the current major step, which defaults to ⟨10°, 10°⟩. - */ - stepMinor(): [number, number]; - /** - * Sets the minor step for this graticule. - * - * @param step Minor step. - */ - stepMinor(step: [number, number]): this; - - /** - * Returns the current precision, which defaults to 2.5°. - */ - precision(): number; - /** - * Sets the precision for this graticule, in degrees. - * - * @param angle Precision in degrees. - */ - precision(angle: number): this; -} - -/** - * Constructs a feature generator for creating graticules: a uniform grid of meridians and parallels for showing projection distortion. - * The default graticule has meridians and parallels every 10° between ±80° latitude; for the polar regions, there are meridians every 90°. - */ -export function geoGraticule(): GeoGraticuleGenerator; - -/** - * A convenience method for directly generating the default 10° global graticule as a GeoJSON MultiLineString geometry object. - */ -export function geoGraticule10(): GeoJSON.MultiLineString; - -// ---------------------------------------------------------------------- -// Projections -// ---------------------------------------------------------------------- - -/** - * A D3 geo stream. D3 transforms geometry using a sequence of function calls, rather than materializing intermediate representations, to minimize overhead. - * Streams must implement several methods to receive input geometry. Streams are inherently stateful; the meaning of a point depends on whether the point is inside of a line, - * and likewise a line is distinguished from a ring by a polygon. Despite the name “stream”, these method calls are currently synchronous. - */ -export interface GeoStream { - /** - * Indicates the end of a line or ring. Within a polygon, indicates the end of a ring. - * Unlike GeoJSON, the redundant closing coordinate of a ring is not indicated via point, and instead is implied via lineEnd within a polygon. - */ - lineEnd(): void; - - /** - * Indicates the start of a line or ring. Within a polygon, indicates the start of a ring. The first ring of a polygon is the exterior ring, and is typically clockwise. - * Any subsequent rings indicate holes in the polygon, and are typically counterclockwise. - */ - lineStart(): void; - - /** - * Indicates a point with the specified coordinates x and y (and optionally z). The coordinate system is unspecified and implementation-dependent; - * for example, projection streams require spherical coordinates in degrees as input. Outside the context of a polygon or line, - * a point indicates a point geometry object (Point or MultiPoint). Within a line or polygon ring, the point indicates a control point. - * - * @param x x-coordinate of point. - * @param y y-coordinate of point. - * @param z Optional z-coordinate of point. - */ - point(x: number, y: number, z?: number): void; - - /** - * Indicates the end of a polygon. - */ - polygonEnd(): void; - - /** - * Indicates the start of a polygon. The first line of a polygon indicates the exterior ring, and any subsequent lines indicate interior holes. - */ - polygonStart(): void; - - /** - * Indicates the sphere (the globe; the unit sphere centered at ⟨0,0,0⟩). - */ - sphere?(): void; -} - - - -// geoStream(...) ======================================================= - -/** - * Streams the specified GeoJSON object to the specified projection stream. While both features and geometry objects are supported as input, - * the stream interface only describes the geometry, and thus additional feature properties are not visible to streams. - * - * @param object - * @param stream A projection stream. - */ -export function geoStream(object: ExtendedFeature, stream: GeoStream): void; - -/** - * Streams the specified GeoJSON object to the specified projection stream. While both features and geometry objects are supported as input, - * the stream interface only describes the geometry, and thus additional feature properties are not visible to streams. - * - * @param object - * @param stream A projection stream. - */ -export function geoStream(object: ExtendedFeatureCollection>, stream: GeoStream): void; - -/** - * Streams the specified GeoJSON object to the specified projection stream. While both features and geometry objects are supported as input, - * the stream interface only describes the geometry, and thus additional feature properties are not visible to streams. - * - * @param object - * @param stream A projection stream. - */ -export function geoStream(object: GeoGeometryObjects, stream: GeoStream): void; - -/** - * Streams the specified GeoJSON object to the specified projection stream. While both features and geometry objects are supported as input, - * the stream interface only describes the geometry, and thus additional feature properties are not visible to streams. - * - * @param object - * @param stream A projection stream. - */ -export function geoStream(object: ExtendedGeometryCollection, stream: GeoStream): void; - - - -// ---------------------------------------------------------------------- -// Projections -// ---------------------------------------------------------------------- - - - - -/** - * Raw projections are point transformation functions that are used to implement custom projections; they typically passed to d3.geoProjection or d3.geoProjectionMutator. - * They are exposed here to facilitate the derivation of related projections. - * Raw projections take spherical coordinates [lambda, phi] in radians (not degrees!) and return a point [x, y], typically in the unit square centered around the origin. - */ -export interface GeoRawProjection { - /** - * Projects the specified point [lambda, phi] in radians, returning a new point [x, y] in unitless coordinates. - * @param lambda Spherical lambda coordinate in radians. - * @param phi Spherical phi coordinate in radians. - */ - (lambda: number, phi: number): [number, number]; - - /** - * Inverts the projected point [x, y] in unitless coordinates, returning an unprojected point in spherical coordinates [lambda, phi] in radians. - * @param x x-coordinate (unitless). - * @param y y-coordinate (unitless). - */ - invert?(x: number, y: number): [number, number]; -} - -/** - * An object implementing a stream method - */ -export interface GeoStreamWrapper { - /** - * Returns a projection stream for the specified output stream. Any input geometry is projected before being streamed to the output stream. - * A typical projection involves several geometry transformations: the input geometry is first converted to radians, rotated on three axes, - * clipped to the small circle or cut along the antimeridian, and lastly projected to the plane with adaptive resampling, scale and translation. - * - * @param stream An input stream - */ - stream(stream: GeoStream): GeoStream; -} - -/** - * A Geographic Projection to transform spherical polygonal geometry to planar polygonal geometry. - * D3 provides implementations of several classes of standard projections: - * - * - Azimuthal - * - Composite - * - Conic - * - Cylindrical - * - * For many more projections, see d3-geo-projection. You can implement custom projections using d3.geoProjection or d3.geoProjectionMutator. - */ -export interface GeoProjection extends GeoStreamWrapper { - /** - * Returns a new array [x, y] (typically in pixels) representing the projected point of the given point. - * The point must be specified as a two-element array [longitude, latitude] in degrees. - * May return null if the specified point has no defined projected position, such as when the point is outside the clipping bounds of the projection. - * - * @param point A point specified as a two-dimensional array [longitude, latitude] in degrees. - */ - (point: [number, number]): [number, number] | null; - - /** - * Returns the current center of the projection, which defaults to ⟨0°,0°⟩. - */ - center(): [number, number]; - /** - * Sets the projection’s center to the specified center, - * a two-element array of longitude and latitude in degrees and returns the projection. - * The default is ⟨0°,0°⟩. - * - * @param point A point specified as a two-dimensional array [longitude, latitude] in degrees. - */ - center(point: [number, number]): this; - - /** - * Returns the current clip angle which defaults to null. - * - * null switches to antimeridian cutting rather than small-circle clipping. - */ - clipAngle(): number | null; - /** - * Switches to antimeridian cutting rather than small-circle clipping. - * - * @param angle Set to null to switch to antimeridian cutting. - */ - clipAngle(angle: null): this; - /** - * Sets the projection’s clipping circle radius to the specified angle in degrees and returns the projection. - * Small-circle clipping is independent of viewport clipping via projection.clipExtent. - * - * @param angle Angle in degrees. - */ - clipAngle(angle: number): this; - - /** - * Returns the current viewport clip extent which defaults to null. - */ - clipExtent(): [[number, number], [number, number]] | null; - /** - * Sets the clip extent to null and returns the projection. - * With a clip extent of null, no viewport clipping is performed. - * - * Viewport clipping is independent of small-circle clipping via projection.clipAngle. - * - * @param extent Set to null to disable viewport clipping. - */ - clipExtent(extent: null): this; - /** - * Sets the projection’s viewport clip extent to the specified bounds in pixels and returns the projection. - * The extent bounds are specified as an array [[x₀, y₀], [x₁, y₁]], where x₀ is the left-side of the viewport, y₀ is the top, x₁ is the right and y₁ is the bottom. - * - * Viewport clipping is independent of small-circle clipping via projection.clipAngle. - * - * @param extent The extent bounds are specified as an array [[x₀, y₀], [x₁, y₁]], where x₀ is the left-side of the viewport, y₀ is the top, x₁ is the right and y₁ is the bottom. - */ - clipExtent(extent: [[number, number], [number, number]]): this; - - /** - * Sets the projection’s scale and translate to fit the specified geographic feature in the center of the given extent. - * Returns the projection. - * - * Any clip extent is ignored when determining the new scale and translate. The precision used to compute the bounding box of the given object is computed at an effective scale of 150. - * - * @param extent The extent, specified as an array [[x₀, y₀], [x₁, y₁]], where x₀ is the left side of the bounding box, y₀ is the top, x₁ is the right and y₁ is the bottom. - * @param object A geographic feature supported by d3-geo (An extension of GeoJSON feature). - */ - fitExtent(extent: [[number, number], [number, number]], object: ExtendedFeature): this; - /** - * Sets the projection’s scale and translate to fit the specified geographic feature collection in the center of the given extent. - * Returns the projection. - * - * Any clip extent is ignored when determining the new scale and translate. The precision used to compute the bounding box of the given object is computed at an effective scale of 150. - * - * @param extent The extent, specified as an array [[x₀, y₀], [x₁, y₁]], where x₀ is the left side of the bounding box, y₀ is the top, x₁ is the right and y₁ is the bottom. - * @param object A geographic feature collection supported by d3-geo (An extension of GeoJSON feature collection). - */ - fitExtent(extent: [[number, number], [number, number]], object: ExtendedFeatureCollection>): this; - /** - * Sets the projection’s scale and translate to fit the specified geographic geometry object in the center of the given extent. - * Returns the projection. - * - * Any clip extent is ignored when determining the new scale and translate. The precision used to compute the bounding box of the given object is computed at an effective scale of 150. - * - * @param extent The extent, specified as an array [[x₀, y₀], [x₁, y₁]], where x₀ is the left side of the bounding box, y₀ is the top, x₁ is the right and y₁ is the bottom. - * @param object A GeoJson Geometry Object or GeoSphere object supported by d3-geo (An extension of GeoJSON). - */ - fitExtent(extent: [[number, number], [number, number]], object: GeoGeometryObjects): this; - /** - * Sets the projection’s scale and translate to fit the specified geographic geometry collection in the center of the given extent. - * Returns the projection. - * - * Any clip extent is ignored when determining the new scale and translate. The precision used to compute the bounding box of the given object is computed at an effective scale of 150. - * - * @param extent The extent, specified as an array [[x₀, y₀], [x₁, y₁]], where x₀ is the left side of the bounding box, y₀ is the top, x₁ is the right and y₁ is the bottom. - * @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). - */ - fitExtent(extent: [[number, number], [number, number]], object: ExtendedGeometryCollection): this; - - - /** - * Sets the projection’s scale and translate to fit the specified geographic feature in the center of an extent with the given size and top-left corner of [0, 0]. - * Returns the projection. - * - * Any clip extent is ignored when determining the new scale and translate. The precision used to compute the bounding box of the given object is computed at an effective scale of 150. - * - * @param size The size of the extent, specified as an array [width, height]. - * @param object A geographic feature supported by d3-geo (An extension of GeoJSON feature). - */ - fitSize(size: [number, number], object: ExtendedFeature): this; - /** - * Sets the projection’s scale and translate to fit the specified geographic feature collection in the center of an extent with the given size and top-left corner of [0, 0]. - * Returns the projection. - * - * Any clip extent is ignored when determining the new scale and translate. The precision used to compute the bounding box of the given object is computed at an effective scale of 150. - * - * @param size The size of the extent, specified as an array [width, height]. - * @param object A geographic feature collection supported by d3-geo (An extension of GeoJSON feature collection). - */ - fitSize(size: [number, number], object: ExtendedFeatureCollection>): this; - /** - * Sets the projection’s scale and translate to fit the specified geographic geometry object in the center of an extent with the given size and top-left corner of [0, 0]. - * Returns the projection. - * - * Any clip extent is ignored when determining the new scale and translate. The precision used to compute the bounding box of the given object is computed at an effective scale of 150. - * - * @param size The size of the extent, specified as an array [width, height]. - * @param object A GeoJson Geometry Object or GeoSphere object supported by d3-geo (An extension of GeoJSON). - */ - fitSize(size: [number, number], object: GeoGeometryObjects): this; - /** - * Sets the projection’s scale and translate to fit the specified geographic geometry collection in the center of an extent with the given size and top-left corner of [0, 0]. - * Returns the projection. - * - * Any clip extent is ignored when determining the new scale and translate. The precision used to compute the bounding box of the given object is computed at an effective scale of 150. - * - * @param size The size of the extent, specified as an array [width, height]. - * @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). - */ - fitSize(size: [number, number], object: ExtendedGeometryCollection): this; - - /** - * Returns a new array [longitude, latitude] in degrees representing the unprojected point of the given projected point. - * May return null if the specified point has no defined projected position, such as when the point is outside the clipping bounds of the projection. - * - * @param point The projected point, specified as a two-element array [x, y] (typically in pixels). - */ - invert?(point: [number, number]): [number, number] | null; - - /** - * Returns the projection’s current resampling precision which defaults to square root of 0.5. - * This value corresponds to the Douglas–Peucker distance. - */ - precision(): number; - /** - * Sets the threshold for the projection’s adaptive resampling to the specified value in pixels and returns the projection. - * This value corresponds to the Douglas–Peucker distance. - * - * @param precision A numeric value in pixels to use as the threshold for the projection’s adaptive resampling. - */ - precision(precision: number): this; - - /** - * Returns the current rotation [lambda, phi, gamma] specifying the rotation angles in degrees about each spherical axis. - * (These correspond to yaw, pitch and roll.) which defaults [0, 0, 0]. - */ - rotate(): [number, number, number]; - /** - * Sets the projection’s three-axis rotation to the specified angles, which must be a two- or three-element array of numbers. - * - * @param angles A two- or three-element array of numbers [lambda, phi, gamma] specifying the rotation angles in degrees about each spherical axis. - * (These correspond to yaw, pitch and roll.) If the rotation angle gamma is omitted, it defaults to 0. - */ - rotate(angles: [number, number] | [number, number, number]): this; - - /** - * Returns the current scale factor; the default scale is projection-specific. - * - * The scale factor corresponds linearly to the distance between projected points; however, absolute scale factors are not equivalent across projections. - */ - scale(): number; - /** - * Sets the projection’s scale factor to the specified value and returns the projection. - * The scale factor corresponds linearly to the distance between projected points; however, absolute scale factors are not equivalent across projections. - * - * @param scale Scale factor to be used for the projection; the default scale is projection-specific. - */ - scale(scale: number): this; - - /** - * Returns the current translation offset which defaults to [480, 250] and places ⟨0°,0°⟩ at the center of a 960×500 area. - * The translation offset determines the pixel coordinates of the projection’s center. - */ - translate(): [number, number]; - /** - * Sets the projection’s translation offset to the specified two-element array [tx, ty] and returns the projection. - * The translation offset determines the pixel coordinates of the projection’s center. The default translation offset places ⟨0°,0°⟩ at the center of a 960×500 area. - * - * @param point A two-element array [tx, ty] specifying the translation offset. The default translation offset of defaults to [480, 250] places ⟨0°,0°⟩ at the center of a 960×500 area. - */ - translate(point: [number, number]): this; -} - -/** - * A Conic Projection - */ -export interface GeoConicProjection extends GeoProjection { - - /** - * Return the standard parallels for the conic projection in degrees. - */ - parallels(): [number, number]; - /** - * Set the standard parallels for the conic projection in degrees and return the projection. - * - * @param value A two-dimensional array representing the standard parallels in degrees. - */ - parallels(value: [number, number]): this; - -} - - -// geoPath ============================================================== - -/** - * A minimal rendering context for a GeoPath generator. The minimum implemented - * methods are a subset of the CanvasRenderingContext2D API. - * - * For reference to the CanvasRenderingContext2D see https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D - */ -export interface GeoContext { - - /** - * Adds an arc to the path with center point (x, y) and radius r starting at startAngle and ending at endAngle. - * The arc is drawn in clockwise directio by default. - * - * @param x x-coordinate of arc center point. - * @param y y-coordinate of arc center point. - * @param radius Radius of arc. - * @param startAngle The starting angle of the arc, measured clockwise from the positive x axis and expressed in radians. - * @param endAngle The end angle of the arc, measured clockwise from the positive x axis and expressed in radians. - * @param anticlockwise Optional boolean flag, if true the arc is drawn counter-clockwise between the two angles. - */ - arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; - - /** - * Start a new path by emptying the list of sub-paths. - */ - beginPath(): void; - - /** - * Causes the point of the pen to move back to the start of the current sub-path. - * It tries to draw a straight line from the current point to the start. - * If the shape has already been closed or has only one point, this function does nothing. - */ - closePath(): void; - - /** - * Connects the last point in the sub-path to the x, y coordinates with a straight line (but does not actually draw it). - * - * @param x The x-coordinate for the end of the line. - * @param y The y-coordinate for the end of the line. - */ - lineTo(x: number, y: number): void; - - /** - * Move the starting point of a new sub-path to the (x, y) coordinates. - * - * @param x The x-coordinate for the new starting point. - * @param y The y-coordinate for the new starting point. - */ - moveTo(x: number, y: number): void; -} - -/** - * A Geo Path generator - * - * The first generic corresponds to the "this"-context within which the geo path generator will be invoked. - * This could be e.g. the DOMElement bound to "this" when using selection.attr("d", ...) with the path generator. - * - * The second generic corresponds to the type of the DatumObject which will be passed into the geo path generator for rendering. - */ -export interface GeoPath { - - /** - * Renders the given object, which may be any GeoJSON feature or geometry object: - * - * + Point - a single position. - * + MultiPoint - an array of positions. - * + LineString - an array of positions forming a continuous line. - * + MultiLineString - an array of arrays of positions forming several lines. - * + Polygon - an array of arrays of positions forming a polygon (possibly with holes). - * + MultiPolygon - a multidimensional array of positions forming multiple polygons. - * + GeometryCollection - an array of geometry objects. - * + Feature - a feature containing one of the above geometry objects. - * + FeatureCollection - an array of feature objects. - * - * The type Sphere is also supported, which is useful for rendering the outline of the globe; a sphere has no coordinates. - * - * - * Any additional arguments are passed along to the pointRadius accessor. - * - * If the rendering context is null, the function returns an SVG Path string, otherwise the function renders to the current context. - * - * Separate path elements are typically slower than a single path element. However, distinct path elements are useful for styling and interation (e.g., click or mouseover). - * Canvas rendering (see path.context) is typically faster than SVG, but requires more effort to implement styling and interaction. - * - * The first generic type of the GeoPath generator used, must correspond to the "this" context bound to the function upon invocation. - * - * @param object An object to be rendered. - */ - (this: This, object: DatumObject, ...args: any[]): string | undefined; - - /** - * Returns the projected planar area (typically in square pixels) for the specified GeoJSON object. - * Point, MultiPoint, LineString and MultiLineString geometries have zero area. For Polygon and MultiPolygon geometries, - * this method first computes the area of the exterior ring, and then subtracts the area of any interior holes. - * This method observes any clipping performed by the projection; see projection.clipAngle and projection.clipExtent. This is the planar equivalent of d3.geoArea. - * - * @param object An object for which the area is to be calculated. - */ - area(object: DatumObject): number; - - /** - * Returns the projected planar bounding box (typically in pixels) for the specified GeoJSON object. - * The bounding box is represented by a two-dimensional array: [[x₀, y₀], [x₁, y₁]], where x₀ is the minimum x-coordinate, y₀ is the minimum y-coordinate, - * x₁ is maximum x-coordinate, and y₁ is the maximum y-coordinate. - * - * This is handy for, say, zooming in to a particular feature. (Note that in projected planar coordinates, - * the minimum latitude is typically the maximum y-value, and the maximum latitude is typically the minimum y-value.) - * This method observes any clipping performed by the projection; see projection.clipAngle and projection.clipExtent. This is the planar equivalent of d3.geoBounds. - * - * @param object An object for which the bounds are to be calculated. - */ - bounds(object: DatumObject): [[number, number], [number, number]]; - - /** - * Returns the projected planar centroid (typically in pixels) for the specified GeoJSON object. - * This is handy for, say, labeling state or county boundaries, or displaying a symbol map. - * For example, a noncontiguous cartogram might scale each state around its centroid. - * This method observes any clipping performed by the projection; see projection.clipAngle and projection.clipExtent. This is the planar equivalent of d3.geoCentroid. - * - * @param object An object for which the centroid is to be calculated. - */ - centroid(object: DatumObject): [number, number]; - - /** - * Returns the projected planar length (typically in pixels) for the specified GeoJSON object. - * Point and MultiPoint geometries have zero length. For Polygon and MultiPolygon geometries, this method computes the summed length of all rings. - * - * This method observes any clipping performed by the projection; see projection.clipAngle and projection.clipExtent. This is the planar equivalent of d3.geoLength. - * - * @param object An object for which the measure is to be calculated. - */ - measure(object: DatumObject): number; - - /** - * Returns the current render context which defaults to null. - * - * Use the generic to cast the return type of the rendering context, if it is known for a specific application. - */ - context(): C; - - /** - * Set the current rendering context to null and return the path generator. - * The path generator will return an SVG path string; - * - * @param context Null to remove the current rendering context, if any. - */ - context(context: null): this; - - /** - * Set the current rendering context and return the path generator. - * The path generator will render to the specified context. - * - * @param context Rendering context to be used by the path generator. - * The context must at least implement GeoContext, a subset of the CanvasRenderingContext2D API. - */ - context(context: GeoContext): this; - - /** - * Get the current projection. The generic parameter can be used to cast the result to the - * correct, known type of the projection, e.g. GeoProjection or GeoConicProjection. Otherwise, - * the return type defaults to the minimum type requirement for a projection which - * can be passed into a GeoPath. - * - * Use the generic to cast the return type of the projection, if it is known for a specific application. - */ - projection

    (): P; - - /** - * Set the projection to the identity projection. - * - * @param projection Use null to set the identity projection. - */ - projection(projection: null): this; - - /** - * Set the current projection to be used with the geo path generator. - * - * The given projection is typically one of D3’s built-in geographic projections; - * however, any object that exposes a projection.stream function can be used, enabling the use of custom projections. - * See D3’s transforms for more examples of arbitrary geometric transformations. - * - * @param projection A projection. - */ - projection(projection: GeoProjection): this; - - /** - * Set the projection to be used with the geo path generator to a custom projection. - * Custom projections must minimally contain a stream method. - * - * The given projection is typically one of D3’s built-in geographic projections; - * however, any object that exposes a projection.stream function can be used, enabling the use of custom projections. - * See D3’s transforms for more examples of arbitrary geometric transformations. - * - * @param projection A wrapper object exposing, at a minimum a "stream" method to be used for custom projections. - */ - projection(projection: GeoStreamWrapper): this; - - /** - * Returns the current radius or radius accessor used to determine the radius for the display of Point and MultiPoint geometries. - * The default is a constant radius of 4.5. - */ - pointRadius(): ((this: This, object: DatumObject, ...args: any[]) => number) | number; - - /** - * Sets the radius used to display Point and MultiPoint geometries to the specified number and return the geo path generator. - * - * @param value Fixed radius value. - */ - pointRadius(value: number): this; - - /** - * Sets the radius used to display Point and MultiPoint geometries to use the specified radius accessor function. - * - * While the radius is commonly specified as a number constant, it may also be specified as a function which is computed per feature, - * being passed the any arguments passed to the path generator. For example, if your GeoJSON data has additional properties, - * you might access those properties inside the radius function to vary the point size; - * alternatively, you could d3.symbol and a projection for greater flexibility. - * - * @param value A value accessor function for the radius which is evaluated for each path to be rendered. - * The value accessor function is invoked within the "this" context in which the path generator is used. - * It is passed the object to be rendered, and any additional arguments which have been passed into the call to the render function of the path generator. - */ - pointRadius(value: (this: This, object: DatumObject, ...args: any[]) => number): this; - -} - -/** - * Creates a new geographic path generator. - * - * The default projection is the null projection. The null projection represents the identity transformation, i.e. - * the input geometry is not projected and is instead rendered directly in raw coordinates. - * This can be useful for fast rendering of pre-projected geometry, or for fast rendering of the equirectangular projection. - * - * The default context is null, which implies that the path generator will return an SVG path string. - * - * @param projection An (optional) current projection to be used. Typically this is one of D3’s built-in geographic projections; - * however, any object that exposes a projection.stream function can be used, enabling the use of custom projections. - * See D3’s transforms for more examples of arbitrary geometric transformations. Setting the projection to "null" uses the identity projection. The default value is "null", the identity projection. - * @param context An (optional) rendering context to be used. If a context is provided, it must at least implement the interface described by GeoContext, a subset of the CanvasRenderingContext2D API. - * Setting the context to "null" means that the path generator will return an SVG path string representing the to be rendered object. The default is "null". - */ -export function geoPath(projection?: GeoProjection | GeoStreamWrapper | null, context?: GeoContext | null): GeoPath; -/** - * Creates a new geographic path generator with the default settings. - * - * The default projection is the null projection. The null projection represents the identity transformation: - * the input geometry is not projected and is instead rendered directly in raw coordinates. - * This can be useful for fast rendering of pre-projected geometry, or for fast rendering of the equirectangular projection. - * - * The default context is null, which implies that the path generator will return an SVG path string. - * - * The generic corresponds to the type of the DatumObject which will be passed into the geo path generator for rendering - * - * @param projection An (optional) current projection to be used. Typically this is one of D3’s built-in geographic projections; - * however, any object that exposes a projection.stream function can be used, enabling the use of custom projections. - * See D3’s transforms for more examples of arbitrary geometric transformations. Setting the projection to "null" uses the identity projection. The default value is "null", the identity projection. - * @param context An (optional) rendering context to be used. If a context is provided, it must at least implement the interface described by GeoContext, a subset of the CanvasRenderingContext2D API. - * Setting the context to "null" means that the path generator will return an SVG path string representing the to be rendered object. The default is "null". - */ -export function geoPath(projection?: GeoProjection | GeoStreamWrapper | null, context?: GeoContext | null): GeoPath; -/** - * Creates a new geographic path generator with the default settings. - * - * The default projection is the null projection. The null projection represents the identity transformation: - * the input geometry is not projected and is instead rendered directly in raw coordinates. - * This can be useful for fast rendering of pre-projected geometry, or for fast rendering of the equirectangular projection. - * - * The default context is null, which implies that the path generator will return an SVG path string. - * - * The first generic corresponds to the "this"-context within which the geo path generator will be invoked. - * This could be e.g. the DOMElement bound to "this" when using selection.attr("d", ...) with the path generator. - * - * The second generic corresponds to the type of the DatumObject which will be passed into the geo path generator for rendering. - * - * @param projection An (optional) current projection to be used. Typically this is one of D3’s built-in geographic projections; - * however, any object that exposes a projection.stream function can be used, enabling the use of custom projections. - * See D3’s transforms for more examples of arbitrary geometric transformations. Setting the projection to "null" uses the identity projection. The default value is "null", the identity projection. - * @param context An (optional) rendering context to be used. If a context is provided, it must at least implement the interface described by GeoContext, a subset of the CanvasRenderingContext2D API. - * Setting the context to "null" means that the path generator will return an SVG path string representing the to be rendered object. The default is "null". - */ -export function geoPath(projection?: GeoProjection | GeoStreamWrapper | null, context?: GeoContext | null): GeoPath; - - - - -// geoProjection ========================================================== - -/** - * Constructs a new projection from the specified raw projection, project. - * The project function takes the longitude and latitude of a given point in radians, - * often referred to as lambda (λ) and phi (φ), and returns a two-element array [x, y] representing its unit projection. - * The project function does not need to scale or translate the point, as these are applied automatically by projection.scale, projection.translate, and projection.center. - * Likewise, the project function does not need to perform any spherical rotation, as projection.rotate is applied prior to projection. - * - * If the project function exposes an invert method, the returned projection will also expose projection.invert. - */ -export function geoProjection(project: GeoRawProjection): GeoProjection; - -// geoProjectionMutator ==================================================== - -/** - * Constructs a new projection from the specified raw projection factory and returns a mutate function to call whenever the raw projection changes. - * The factory must return a raw projection. The returned mutate function returns the wrapped projection. - * - * When creating a mutable projection, the mutate function is typically not exposed. - */ -export function geoProjectionMutator(factory: (...args: any[]) => GeoRawProjection): () => GeoProjection; - -// Pre-Defined Projections and Raw Projections ============================= - -// Azimuthal Projections --------------------------------------------------- - -/** - * The azimuthal equal-area projection. - */ -export function geoAzimuthalEqualArea(): GeoProjection; - -/** - * The raw azimuthal equal-area projection. - */ -export function geoAzimuthalEqualAreaRaw(): GeoRawProjection; - -/** - * The azimuthal equidistant projection. - */ -export function geoAzimuthalEquidistant(): GeoProjection; -/** - * The raw azimuthal equidistant projection. - */ -export function geoAzimuthalEquidistantRaw(): GeoRawProjection; - -/** - * The gnomonic projection. - */ -export function geoGnomonic(): GeoProjection; - -/** - * The raw gnomonic projection. - */ -export function geoGnomonicRaw(): GeoRawProjection; - -/** - * The orthographic projection. - */ -export function geoOrthographic(): GeoProjection; - -/** - * The raw orthographic projection. - */ -export function geoOrthographicRaw(): GeoRawProjection; - -/** - * The stereographic projection. - */ -export function geoStereographic(): GeoProjection; -/** - * The raw stereographic projection. - */ -export function geoStereographicRaw(): GeoRawProjection; - -// Composite Projections --------------------------------------------------- - -/** - * A U.S.-centric composite projection of three d3.geoConicEqualArea projections: d3.geoAlbers is used for the lower forty-eight states, - * and separate conic equal-area projections are used for Alaska and Hawaii. Note that the scale for Alaska is diminished: it is projected at 0.35× its true relative area. - * - * Composite consist of several projections that are composed into a single display. The constituent projections have fixed clip, center and rotation, - * and thus composite projections do not support projection.center, projection.rotate, projection.clipAngle, or projection.clipExtent. - */ -export function geoAlbersUsa(): GeoProjection; - -// Conic Projections ------------------------------------------------------- - -/** - * The Albers’ equal area-conic projection. This is a U.S.-centric configuration of d3.geoConicEqualArea. - */ -export function geoAlbers(): GeoConicProjection; - -/** - * The conic conformal projection. The parallels default to [30°, 30°] resulting in flat top. - */ -export function geoConicConformal(): GeoConicProjection; - -/** - * The raw conic conformal projection. - */ -export function geoConicConformalRaw(phi0: number, phi1: number): GeoRawProjection; - -/** - * The Albers’ equal-area conic projection. - */ -export function geoConicEqualArea(): GeoConicProjection; - -/** - * The raw Albers’ equal-area conic projection. - */ -export function geoConicEqualAreaRaw(phi0: number, phi1: number): GeoRawProjection; - -/** - * The conic equidistant projection. - */ -export function geoConicEquidistant(): GeoConicProjection; - -/** - * The raw conic equidistant projection. - */ -export function geoConicEquidistantRaw(phi0: number, phi1: number): GeoRawProjection; - -// Cylindrical Projections ------------------------------------------------ - -/** - * The equirectangular (plate carrée) projection. - */ -export function geoEquirectangular(): GeoProjection; - -/** - * The raw equirectangular (plate carrée) projection. - */ -export function geoEquirectangularRaw(): GeoRawProjection; - -/** - * The spherical Mercator projection. - * Defines a default projection.clipExtent such that the world is projected to a square, clipped to approximately ±85° latitude. - */ -export function geoMercator(): GeoProjection; -/** - * The raw spherical Mercator projection. - */ -export function geoMercatorRaw(): GeoRawProjection; - -/** - * The transverse spherical Mercator projection. - * Defines a default projection.clipExtent such that the world is projected to a square, clipped to approximately ±85° latitude. - */ -export function geoTransverseMercator(): GeoProjection; - -/** - * The raw transverse spherical Mercator projection. - */ -export function geoTransverseMercatorRaw(): GeoRawProjection; - -// ---------------------------------------------------------------------- -// Projection Transforms -// ---------------------------------------------------------------------- - -// geoTransform(...) ==================================================== - -/** - * A Prototype interface which serves as a template for the implementation of a geometric transform using geoTransform(...) - * It serves as a reference for the custom methods which can be passed into geoTransform as argument to crete a generalized - * transform projection. - */ -export interface GeoTransformPrototype { - /** - * Indicates the end of a line or ring. Within a polygon, indicates the end of a ring. - * Unlike GeoJSON, the redundant closing coordinate of a ring is not indicated via point, and instead is implied via lineEnd within a polygon. - */ - lineEnd?(this: this & { stream: GeoStream }): void; - /** - * Indicates the start of a line or ring. Within a polygon, indicates the start of a ring. The first ring of a polygon is the exterior ring, and is typically clockwise. - * Any subsequent rings indicate holes in the polygon, and are typically counterclockwise. - */ - lineStart?(this: this & { stream: GeoStream }): void; - /** - * Indicates a point with the specified coordinates x and y (and optionally z). The coordinate system is unspecified and implementation-dependent; - * for example, projection streams require spherical coordinates in degrees as input. Outside the context of a polygon or line, - * a point indicates a point geometry object (Point or MultiPoint). Within a line or polygon ring, the point indicates a control point. - * - * @param x x-coordinate of point. - * @param y y-coordinate of point. - * @param z Optional z-coordinate of point. - */ - point?(this: this & { stream: GeoStream }, x: number, y: number, z?: number): void; - /** - * Indicates the end of a polygon. - */ - polygonEnd?(this: this & { stream: GeoStream }): void; - /** - * Indicates the start of a polygon. The first line of a polygon indicates the exterior ring, and any subsequent lines indicate interior holes. - */ - polygonStart?(this: this & { stream: GeoStream }): void; - /** - * Indicates the sphere (the globe; the unit sphere centered at ⟨0,0,0⟩). - */ - sphere?(this: this & { stream: GeoStream }): void; -} - -// TODO: Review whether GeoStreamWrapper should be included into return value union type, i.e. ({ stream: (s: GeoStream) => (T & GeoStream & GeoStreamWrapper)})? -// It probably should be omitted for purposes of this API. The stream method added to (T & GeoStream) is more of a private member used internally to -// implement the Transform factory - -/** - * Defines an arbitrary transform using the methods defined on the specified methods object. - * Any undefined methods will use pass-through methods that propagate inputs to the output stream. - * - * @param methods An object with custom method implementations, which are used to create a transform projection. - */ -export function geoTransform(methods: T): { stream: (s: GeoStream) => (T & GeoStream) }; - -// geoIdentity() ================================================================= - -/** - * Geo Identity Transform - */ -export interface GeoIdentityTranform extends GeoStreamWrapper { - - /** - * Returns the current viewport clip extent which defaults to null. - */ - clipExtent(): [[number, number], [number, number]] | null; - /** - * Sets the clip extent to null and returns the projection. - * With a clip extent of null, no viewport clipping is performed. - * - * Viewport clipping is independent of small-circle clipping via projection.clipAngle. - * - * @param extent Set to null to disable viewport clipping. - */ - clipExtent(extent: null): this; - /** - * Sets the projection’s viewport clip extent to the specified bounds in pixels and returns the projection. - * The extent bounds are specified as an array [[x₀, y₀], [x₁, y₁]], where x₀ is the left-side of the viewport, y₀ is the top, x₁ is the right and y₁ is the bottom. - * - * Viewport clipping is independent of small-circle clipping via projection.clipAngle. - * - * @param extent The extent bounds are specified as an array [[x₀, y₀], [x₁, y₁]], where x₀ is the left-side of the viewport, y₀ is the top, x₁ is the right and y₁ is the bottom. - */ - clipExtent(extent: [[number, number], [number, number]]): this; - - /** - * Sets the projection’s scale and translate to fit the specified geographic feature in the center of the given extent. - * Returns the projection. - * - * Any clip extent is ignored when determining the new scale and translate. The precision used to compute the bounding box of the given object is computed at an effective scale of 150. - * - * @param extent The extent, specified as an array [[x₀, y₀], [x₁, y₁]], where x₀ is the left side of the bounding box, y₀ is the top, x₁ is the right and y₁ is the bottom. - * @param object A geographic feature supported by d3-geo (An extension of GeoJSON feature). - */ - fitExtent(extent: [[number, number], [number, number]], object: ExtendedFeature): this; - /** - * Sets the projection’s scale and translate to fit the specified geographic feature collection in the center of the given extent. - * Returns the projection. - * - * Any clip extent is ignored when determining the new scale and translate. The precision used to compute the bounding box of the given object is computed at an effective scale of 150. - * - * @param extent The extent, specified as an array [[x₀, y₀], [x₁, y₁]], where x₀ is the left side of the bounding box, y₀ is the top, x₁ is the right and y₁ is the bottom. - * @param object A geographic feature collection supported by d3-geo (An extension of GeoJSON feature collection). - */ - fitExtent(extent: [[number, number], [number, number]], object: ExtendedFeatureCollection>): this; - /** - * Sets the projection’s scale and translate to fit the specified geographic geometry object in the center of the given extent. - * Returns the projection. - * - * Any clip extent is ignored when determining the new scale and translate. The precision used to compute the bounding box of the given object is computed at an effective scale of 150. - * - * @param extent The extent, specified as an array [[x₀, y₀], [x₁, y₁]], where x₀ is the left side of the bounding box, y₀ is the top, x₁ is the right and y₁ is the bottom. - * @param object A GeoJson Geometry Object or GeoSphere object supported by d3-geo (An extension of GeoJSON). - */ - fitExtent(extent: [[number, number], [number, number]], object: GeoGeometryObjects): this; - /** - * Sets the projection’s scale and translate to fit the specified geographic geometry collection in the center of the given extent. - * Returns the projection. - * - * Any clip extent is ignored when determining the new scale and translate. The precision used to compute the bounding box of the given object is computed at an effective scale of 150. - * - * @param extent The extent, specified as an array [[x₀, y₀], [x₁, y₁]], where x₀ is the left side of the bounding box, y₀ is the top, x₁ is the right and y₁ is the bottom. - * @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). - */ - fitExtent(extent: [[number, number], [number, number]], object: ExtendedGeometryCollection): this; - - - /** - * Sets the projection’s scale and translate to fit the specified geographic feature in the center of an extent with the given size and top-left corner of [0, 0]. - * Returns the projection. - * - * Any clip extent is ignored when determining the new scale and translate. The precision used to compute the bounding box of the given object is computed at an effective scale of 150. - * - * @param size The size of the extent, specified as an array [width, height]. - * @param object A geographic feature supported by d3-geo (An extension of GeoJSON feature). - */ - fitSize(size: [number, number], object: ExtendedFeature): this; - /** - * Sets the projection’s scale and translate to fit the specified geographic feature collection in the center of an extent with the given size and top-left corner of [0, 0]. - * Returns the projection. - * - * Any clip extent is ignored when determining the new scale and translate. The precision used to compute the bounding box of the given object is computed at an effective scale of 150. - * - * @param size The size of the extent, specified as an array [width, height]. - * @param object A geographic feature collection supported by d3-geo (An extension of GeoJSON feature collection). - */ - fitSize(size: [number, number], object: ExtendedFeatureCollection>): this; - /** - * Sets the projection’s scale and translate to fit the specified geographic geometry object in the center of an extent with the given size and top-left corner of [0, 0]. - * Returns the projection. - * - * Any clip extent is ignored when determining the new scale and translate. The precision used to compute the bounding box of the given object is computed at an effective scale of 150. - * - * @param size The size of the extent, specified as an array [width, height]. - * @param object A GeoJson Geometry Object or GeoSphere object supported by d3-geo (An extension of GeoJSON). - */ - fitSize(size: [number, number], object: GeoGeometryObjects): this; - /** - * Sets the projection’s scale and translate to fit the specified geographic geometry collection in the center of an extent with the given size and top-left corner of [0, 0]. - * Returns the projection. - * - * Any clip extent is ignored when determining the new scale and translate. The precision used to compute the bounding box of the given object is computed at an effective scale of 150. - * - * @param size The size of the extent, specified as an array [width, height]. - * @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). - */ - fitSize(size: [number, number], object: ExtendedGeometryCollection): this; - - /** - * Returns true if x-reflection is enabled, which defaults to false. - */ - reflectX(): boolean; - /** - * Sets whether or not the x-dimension is reflected (negated) in the output. - * - * @param reflect true = reflect x-dimension, false = do not reflect x-dimension. - */ - reflectX(reflect: boolean): this; - - /** - * Returns true if y-reflection is enabled, which defaults to false. - */ - reflectY(): boolean; - /** - * Sets whether or not the y-dimension is reflected (negated) in the output. - * - * This is especially useful for transforming from standard spatial reference systems, - * which treat positive y as pointing up, to display coordinate systems such as Canvas and SVG, - * which treat positive y as pointing down. - * - * @param reflect true = reflect y-dimension, false = do not reflect y-dimension. - */ - reflectY(reflect: boolean): this; - - /** - * Returns the current scale factor. - * - * The scale factor corresponds linearly to the distance between projected points; however, absolute scale factors are not equivalent across projections. - */ - scale(): number; - /** - * Sets the projection’s scale factor to the specified value and returns the projection. - * The scale factor corresponds linearly to the distance between projected points; however, absolute scale factors are not equivalent across projections. - * - * @param scale Scale factor to be used for the projection. - */ - scale(scale: number): this; - - /** - * Returns the current translation offset. - * The translation offset determines the pixel coordinates of the projection’s center. - */ - translate(): [number, number]; - /** - * Sets the projection’s translation offset to the specified two-element array [tx, ty] and returns the projection. - * The translation offset determines the pixel coordinates of the projection’s center. - * - * @param point A two-element array [tx, ty] specifying the translation offset. - */ - translate(point: [number, number]): this; -} - -/** - * Returns the identity transform which can be used to scale, translate and clip planar geometry. - */ -export function geoIdentity(): GeoIdentityTranform; diff --git a/d3-geo/tslint.json b/d3-geo/tslint.json deleted file mode 100644 index 6a00563639..0000000000 --- a/d3-geo/tslint.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../tslint.json", - "rules": { - "unified-signatures": false, - "max-line-length": [false, 200] - } -} diff --git a/d3-scale/index.d.ts b/d3-scale/index.d.ts deleted file mode 100644 index 2ba9eeec8a..0000000000 --- a/d3-scale/index.d.ts +++ /dev/null @@ -1,1855 +0,0 @@ -// Type definitions for D3JS d3-scale module 1.0 -// Project: https://github.com/d3/d3-scale/ -// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -// Last module patch version validated against: 1.0.4 - -import { CountableTimeInterval, TimeInterval } from 'd3-time'; - -// ------------------------------------------------------------------------------- -// Shared Types and Interfaces -// ------------------------------------------------------------------------------- - -/** - * An Interpolator factory returns an interpolator function. - * - * The first generic correponds to the data type of the interpolation boundaries. - * The second generic corresponds to the data type of the return type of the interpolator. - */ -// This is a base interface to be extended, hence the suppression of the warning -// tslint:disable-next-line:callable-types -export interface InterpolatorFactory { - /** - * Construct a new interpolator function, based on the provided interpolation boundaries. - * - * @param a Start boundary of the interpolation interval. - * @param b End boundary of the interpolation interval. - */ - (a: T, b: T): ((t: number) => U); -} - -/** - * A helper interface for a continuous scale defined over a numeric domain. - */ -export interface ScaleContinuousNumeric { - - /** - * Given a value from the domain, returns the corresponding value from the range, subject to interpolation, if any. - * - * If the given value is outside the domain, and clamping is not enabled, the mapping may be extrapolated such that the returned value is outside the range. - * - * Note: The interpolation function applied by the scale may change the output type from the range type as part of the interpolation. - * - * @param value A numeric value from the domain. - */ - (value: number | { valueOf(): number }): Output; - - /** - * Given a value from the range, returns the corresponding value from the domain. Inversion is useful for interaction, - * say to determine the data value corresponding to the position of the mouse. - * - * If the given value is outside the range, and clamping is not enabled, the mapping may be extrapolated such that the returned value is outside the domain. - * - * IMPORTANT: This method is only supported if the range is numeric. If the range is not numeric, returns NaN. - * - * For a valid value y in the range, continuous(continuous.invert(y)) approximately equals y; - * similarly, for a valid value x in the domain, continuous.invert(continuous(x)) approximately equals x. - * The scale and its inverse may not be exact due to the limitations of floating point precision. - * - * @param value A numeric value from the range. - */ - invert(value: number | { valueOf(): number }): number; - - /** - * Returns a copy of the scale’s current domain. - */ - domain(): number[]; - /** - * Sets the scale’s domain to the specified array of numbers. The array must contain two or more elements. - * If the elements in the given array are not numbers, they will be coerced to numbers - * - * Although continuous scales typically have two values each in their domain and range, specifying more than two values produces a piecewise scale. - * - * Internally, a piecewise scale performs a binary search for the range interpolator corresponding to the given domain value. - * Thus, the domain must be in ascending or descending order. If the domain and range have different lengths N and M, only the first min(N,M) elements in each are observed. - * - * @param domain Array of numeric domain values. - */ - domain(domain: Array): this; - - /** - * Returns a copy of the scale’s current range. - */ - range(): Range[]; - /** - * Sets the scale’s range to the specified array of values. - * - * The array must contain two or more elements. Unlike the domain, elements in the given array need not be numbers; - * any value that is supported by the underlying interpolator will work, though note that numeric ranges are required for invert. - * - * @param range Array of range values. - */ - range(range: Range[]): this; - - /** - * Sets the scale’s range to the specified array of values while also setting the scale’s interpolator to interpolateRound. - * - * The rounding interpolator is sometimes useful for avoiding antialiasing artifacts, - * though also consider the shape-rendering “crispEdges” styles. Note that this interpolator can only be used with numeric ranges. - * - * The array must contain two or more elements. Unlike the domain, elements in the given array need not be numbers; - * any value that is supported by the underlying interpolator will work, though note that numeric ranges are required for invert. - * - * @param range Array of range values. - */ - rangeRound(range: Array): this; - - /** - * Returns whether or not the scale currently clamps values to within the range. - */ - clamp(): boolean; - /** - * Enables or disables clamping, respectively. If clamping is disabled and the scale is passed a value outside the domain, - * the scale may return a value outside the range through extrapolation. - * - * If clamping is enabled, the return value of the scale is always within the scale’s range. Clamping similarly applies to the "invert" method. - * - * @param clamp A flag to enable (true) or disable (false) clamping. - */ - clamp(clamp: boolean): this; - - /** - * Returns approximately count representative values from the scale’s domain. - * - * If count is not specified, it defaults to 10. - * - * The returned tick values are uniformly spaced, have human-readable values (such as multiples of powers of 10), - * and are guaranteed to be within the extent of the domain. Ticks are often used to display reference lines, or tick marks, in conjunction with the visualized data. - * The specified count is only a hint; the scale may return more or fewer values depending on the domain. See also d3-array’s ticks. - * - * @param count Optional approximate number of ticks to be returned. If count is not specified, it defaults to 10. - */ - ticks(count?: number): number[]; - - /** - * Returns a number format function suitable for displaying a tick value, automatically computing the appropriate precision based on the fixed interval between tick values. - * The specified count should have the same value as the count that is used to generate the tick values. - * - * @param count Approximate number of ticks to be used when calculating precision for the number format function. - * @param specifier An optional valid format specifier string which allows a custom format where the precision of the format is automatically set by the scale as appropriate for the tick interval. - * If specifier uses the format type "s", the scale will return a SI-prefix format based on the largest value in the domain. - * If the specifier already specifies a precision, this method is equivalent to locale.format. - */ - tickFormat(count?: number, specifier?: string): ((d: number | { valueOf(): number }) => string); - - /** - * Extends the domain so that it starts and ends on nice round values. - * This method typically modifies the scale’s domain, and may only extend the bounds to the nearest round value. - * An optional tick count argument allows greater control over the step size used to extend the bounds, - * guaranteeing that the returned ticks will exactly cover the domain. - * Nicing is useful if the domain is computed from data, say using extent, and may be irregular. - * For example, for a domain of [0.201479…, 0.996679…], a nice domain might be [0.2, 1.0]. - * If the domain has more than two values, nicing the domain only affects the first and last value. - * - * Nicing a scale only modifies the current domain; it does not automatically nice domains that are subsequently set using continuous.domain. - * You must re-nice the scale after setting the new domain, if desired. - * - * @param count An optional number of ticks expexted to be used. - */ - nice(count?: number): this; - - /** - * Returns an exact copy of this scale. Changes to this scale will not affect the returned scale, and vice versa. - */ - copy(): this; - -} - -// ------------------------------------------------------------------------------- -// Linear Scale Factory -// ------------------------------------------------------------------------------- - -/** - * A linear continuous scale defined over a numeric domain. - * - * Continuous scales map a continuous, quantitative input domain to a continuous output range. - * Each range value y can be expressed as a function of the domain value x: y = mx + b. - * - * If the range is also numeric, the mapping may be inverted. - * - * Note that the data types of the range and output of the scale must be compatible with the interpolator applied by the scale. - * - * The first generic corresponds to the data type of the range elements. - * - * The second generic corresponds to the data type of the output elements generated by the scale. - * - * If range element and output element type differ, the interpolator factory used with the scale must match this behaviour and - * convert the interpolated range element to a corresponding output element. - */ -export interface ScaleLinear extends ScaleContinuousNumeric { - - /** - * Returns the scale’s current interpolator factory, which defaults to interpolate. - */ - interpolate(): InterpolatorFactory; - - /** - * Sets the scale’s range interpolator factory. This interpolator factory is used to create interpolators for each adjacent pair of values from the range; - * these interpolators then map a normalized domain parameter t in [0, 1] to the corresponding value in the range. - * - * Note: the default interpolator may reuse return values. For example, if the range values are objects, then the value interpolator always returns the same object, modifying it in-place. - * If the scale is used to set an attribute or style, this is typically acceptable (and desirable for performance); - * however, if you need to store the scale’s return value, you must specify your own interpolator or make a copy as appropriate. - * - * As part of the interpolation process the interpotaled value from the range may be converted to a corresponding output value. - * - * @param interpolate An interpolation factory. The generics for Range and Output of the scale must correpond to the interpolation factory applied to the scale. - */ - interpolate(interpolate: InterpolatorFactory): this; - /** - * Sets the scale’s range interpolator factory. This interpolator factory is used to create interpolators for each adjacent pair of values from the range; - * these interpolators then map a normalized domain parameter t in [0, 1] to the corresponding value in the range. - * - * Note: the default interpolator may reuse return values. For example, if the range values are objects, then the value interpolator always returns the same object, modifying it in-place. - * If the scale is used to set an attribute or style, this is typically acceptable (and desirable for performance); - * however, if you need to store the scale’s return value, you must specify your own interpolator or make a copy as appropriate. - * - * As part of the interpolation process the interpotaled value from the range may be converted to a corresponding output value. - * - * The generic "NewOutput" can be used to change the scale to have a different output element type corresponding to the new interpolation factory. - * - * @param interpolate An interpolation factory. The generics for Range and Output of the scale must correpond to the interpolation factory applied to the scale. - */ - interpolate(interpolate: InterpolatorFactory): ScaleLinear; - -} - -/** - * Constructs a new continuous linear scale with the unit domain [0, 1], the unit range [0, 1], the default interpolator and clamping disabled. - * - * The scale will have range and output of data type number. - */ -export function scaleLinear(): ScaleLinear; -/** - * Constructs a new continuous linear scale with the unit domain [0, 1], the default interpolator and clamping disabled. - * - * The generic correponds to the data type of the range and output elements to be used. - * - * As range type and output type are the same, the interpolator factory used with the scale must match this behaviour. - * The range must be set in accordance with the range element type. - * - * The interpolator factory may be set using the interpolate(...) method of the scale. - */ -export function scaleLinear(): ScaleLinear; -/** - * Constructs a new continuous linear scale with the unit domain [0, 1], the default interpolator and clamping disabled. - * - * The first generic corresponds to the data type of the range elements. - * The second generic corresponds to the data type of the output elements generated by the scale. - * - * If range element and output element type differ, the interpolator factory used with the scale must match this behaviour and - * convert the interpolated range element to a corresponding output element. - * - * The range must be set in accordance with the range element type. - * - * The interpolator factory may be set using the interpolate(...) method of the scale. - */ -export function scaleLinear(): ScaleLinear; - -// ------------------------------------------------------------------------------- -// Power Scale Factories -// ------------------------------------------------------------------------------- - -/** - * A continuous power scale defined over a numeric domain. - * - * Continuous scales map a continuous, quantitative input domain to a continuous output range. - * - * Each range value y can be expressed as a function of the domain value x: y = mx^k + b, where k is the exponent value. - * Power scales also support negative domain values, in which case the input value and the resulting output value are multiplied by -1. - * - * If the range is also numeric, the mapping may be inverted. - * - * Note that the data types of the range and output of the scale must be compatible with the interpolator applied by the scale. - * - * The first generic corresponds to the data type of the range elements. - * - * The second generic corresponds to the data type of the output elements generated by the scale. - * - * If range element and output element type differ, the interpolator factory used with the scale must match this behaviour and - * convert the interpolated range element to a corresponding output element. - */ -export interface ScalePower extends ScaleContinuousNumeric { - - /** - * Returns the scale’s current interpolator factory, which defaults to interpolate. - */ - interpolate(): InterpolatorFactory; - - /** - * Sets the scale’s range interpolator factory. This interpolator factory is used to create interpolators for each adjacent pair of values from the range; - * these interpolators then map a normalized domain parameter t in [0, 1] to the corresponding value in the range. - * - * Note: the default interpolator may reuse return values. For example, if the range values are objects, then the value interpolator always returns the same object, modifying it in-place. - * If the scale is used to set an attribute or style, this is typically acceptable (and desirable for performance); - * however, if you need to store the scale’s return value, you must specify your own interpolator or make a copy as appropriate. - * - * As part of the interpolation process the interpotaled value from the range may be converted to a corresponding output value. - * - * @param interpolate An interpolation factory. The generics for Range and Output of the scale must correpond to the interpolation factory applied to the scale. - */ - interpolate(interpolate: InterpolatorFactory): this; - /** - * Sets the scale’s range interpolator factory. This interpolator factory is used to create interpolators for each adjacent pair of values from the range; - * these interpolators then map a normalized domain parameter t in [0, 1] to the corresponding value in the range. - * - * Note: the default interpolator may reuse return values. For example, if the range values are objects, then the value interpolator always returns the same object, modifying it in-place. - * If the scale is used to set an attribute or style, this is typically acceptable (and desirable for performance); - * however, if you need to store the scale’s return value, you must specify your own interpolator or make a copy as appropriate. - * - * As part of the interpolation process the interpotaled value from the range may be converted to a corresponding output value. - * - * The generic "NewOutput" can be used to change the scale to have a different output element type corresponding to the new interpolation factory. - * - * @param interpolate An interpolation factory. The generics for Range and Output of the scale must correpond to the interpolation factory applied to the scale. - */ - interpolate(interpolate: InterpolatorFactory): ScalePower; - - /** - * If exponent is not specified, returns the current exponent, which defaults to 1. - * (Note that this is effectively a linear scale until you set a different exponent.) - */ - exponent(): number; - /** - * Sets the current exponent to the given numeric value. - * (Note that this is effectively a linear scale until you set a different exponent.) - */ - exponent(exponent: number): this; -} - -/** - * Constructs a new continuous power scale with the unit domain [0, 1], the unit range [0, 1], the exponent 1, the default interpolator and clamping disabled. - * (Note that this is effectively a linear scale until you set a different exponent.) - * - * The scale will have range and output of data type number. - */ -export function scalePow(): ScalePower; -/** - * Constructs a new continuous power scale with the unit domain [0, 1], the exponent 1, the default interpolator and clamping disabled. - * (Note that this is effectively a linear scale until you set a different exponent.) - * - * The generic correponds to the data type of the range and output elements to be used. - * - * As range type and output type are the same, the interpolator factory used with the scale must match this behaviour. - * - * The range must be set in accordance with the range element type. - * - * The interpolator factory may be set using the interpolate(...) method of the scale. - */ -export function scalePow(): ScalePower; -/** - * Constructs a new continuous power scale with the unit domain [0, 1], the exponent 1, the default interpolator and clamping disabled. - * (Note that this is effectively a linear scale until you set a different exponent.) - * - * The first generic corresponds to the data type of the range elements. - * The second generic corresponds to the data type of the output elements generated by the scale. - * - * If range element and output element type differ, the interpolator factory used with the scale must match this behaviour and - * convert the interpolated range element to a corresponding output element. - * - * The range must be set in accordance with the range element type. - * - * The interpolator factory may be set using the interpolate(...) method of the scale. - */ -export function scalePow(): ScalePower; - -/** - * Constructs a new continuous power scale with the unit domain [0, 1], the unit range [0, 1], the exponent 0.5, the default interpolator and clamping disabled. - * This is a convenience method equivalent to d3.scalePow().exponent(0.5). - * - * The scale will have range and output of data type number. - */ -export function scaleSqrt(): ScalePower; -/** - * Constructs a new continuous power scale with the unit domain [0, 1], the exponent 0.5, the default interpolator and clamping disabled. - * This is a convenience method equivalent to d3.scalePow().exponent(0.5). - * - * The generic correponds to the data type of the range and output elements to be used. - * - * As range type and output type are the same, the interpolator factory used with the scale must match this behaviour. - * - * The range must be set in accordance with the range element type. - * - * The interpolator factory may be set using the interpolate(...) method of the scale. - */ -export function scaleSqrt(): ScalePower; -/** - * Constructs a new continuous power scale with the unit domain [0, 1], the exponent 0.5, the default interpolator and clamping disabled. - * This is a convenience method equivalent to d3.scalePow().exponent(0.5). - * - * The first generic corresponds to the data type of the range elements. - * The second generic corresponds to the data type of the output elements generated by the scale. - * - * If range element and output element type differ, the interpolator factory used with the scale must match this behaviour and - * convert the interpolated range element to a corresponding output element. - * - * The range must be set in accordance with the range element type. - * - * The interpolator factory may be set using the interpolate(...) method of the scale. - */ -export function scaleSqrt(): ScalePower; - -// ------------------------------------------------------------------------------- -// Logarithmic Scale Factory -// ------------------------------------------------------------------------------- - -/** - * A continuous logarithmic scale defined over a numeric domain. - * - * Continuous scales map a continuous, quantitative input domain to a continuous output range. - * - * The mapping to the range value y can be expressed as a function of the domain value x: y = m log(x) + b. - * - * As log(0) = -∞, a log scale domain must be strictly-positive or strictly-negative; the domain must not include or cross zero. - * A log scale with a positive domain has a well-defined behavior for positive values, and a log scale with a negative domain has a well-defined behavior for negative values. - * (For a negative domain, input and output values are implicitly multiplied by -1.) - * The behavior of the scale is undefined if you pass a negative value to a log scale with a positive domain or vice versa. - * - * If the range is also numeric, the mapping may be inverted. - * - * Note that the data types of the range and output of the scale must be compatible with the interpolator applied by the scale. - * - * The first generic corresponds to the data type of the range elements. - * - * The second generic corresponds to the data type of the output elements generated by the scale. - * - * If range element and output element type differ, the interpolator factory used with the scale must match this behaviour and - * convert the interpolated range element to a corresponding output element. - */ -export interface ScaleLogarithmic extends ScaleContinuousNumeric { - - /** - * Returns a copy of the scale’s current domain. - */ - domain(): number[]; - /** - * Sets the scale’s domain to the specified array of numbers. The array must contain two or more elements. - * If the elements in the given array are not numbers, they will be coerced to numbers - * - * As log(0) = -∞, a log scale domain must be strictly-positive or strictly-negative; the domain must not include or cross zero. - * A log scale with a positive domain has a well-defined behavior for positive values, and a log scale with a negative domain has a well-defined behavior for negative values. - * (For a negative domain, input and output values are implicitly multiplied by -1.) - * The behavior of the scale is undefined if you pass a negative value to a log scale with a positive domain or vice versa. - * - * Although continuous scales typically have two values each in their domain and range, specifying more than two values produces a piecewise scale. - * - * Internally, a piecewise scale performs a binary search for the range interpolator corresponding to the given domain value. - * Thus, the domain must be in ascending or descending order. If the domain and range have different lengths N and M, only the first min(N,M) elements in each are observed. - * - * @param domain Array of numeric domain values. - */ - domain(domain: Array): this; - - /** - * Returns the scale’s current interpolator factory, which defaults to interpolate. - */ - interpolate(): InterpolatorFactory; - - /** - * Sets the scale’s range interpolator factory. This interpolator factory is used to create interpolators for each adjacent pair of values from the range; - * these interpolators then map a normalized domain parameter t in [0, 1] to the corresponding value in the range. - * - * Note: the default interpolator may reuse return values. For example, if the range values are objects, then the value interpolator always returns the same object, modifying it in-place. - * If the scale is used to set an attribute or style, this is typically acceptable (and desirable for performance); - * however, if you need to store the scale’s return value, you must specify your own interpolator or make a copy as appropriate. - * - * As part of the interpolation process the interpotaled value from the range may be converted to a corresponding output value. - * - * @param interpolate An interpolation factory. The generics for Range and Output of the scale must correpond to the interpolation factory applied to the scale. - */ - interpolate(interpolate: InterpolatorFactory): this; - /** - * Sets the scale’s range interpolator factory. This interpolator factory is used to create interpolators for each adjacent pair of values from the range; - * these interpolators then map a normalized domain parameter t in [0, 1] to the corresponding value in the range. - * - * Note: the default interpolator may reuse return values. For example, if the range values are objects, then the value interpolator always returns the same object, modifying it in-place. - * If the scale is used to set an attribute or style, this is typically acceptable (and desirable for performance); - * however, if you need to store the scale’s return value, you must specify your own interpolator or make a copy as appropriate. - * - * As part of the interpolation process the interpotaled value from the range may be converted to a corresponding output value. - * - * The generic "NewOutput" can be used to change the scale to have a different output element type corresponding to the new interpolation factory. - * - * @param interpolate An interpolation factory. The generics for Range and Output of the scale must correpond to the interpolation factory applied to the scale. - */ - interpolate(interpolate: InterpolatorFactory): ScaleLogarithmic; - - /** - * Returns approximately count representative values from the scale’s domain. - * - * If count is not specified, it defaults to 10. - * - * If the base is an integer, the returned ticks are uniformly spaced within each integer power of base; otherwise, one tick per power of base is returned. - * The returned ticks are guaranteed to be within the extent of the domain. If the orders of magnitude in the domain is greater than count, then at most one tick per power is returned. - * Otherwise, the tick values are unfiltered, but note that you can use log.tickFormat to filter the display of tick labels. - * - * @param count Optional approximate number of ticks to be returned. If count is not specified, it defaults to 10. - */ - ticks(count?: number): number[]; - - /** - * Returns a number format function suitable for displaying a tick value, automatically computing the appropriate precision based on the fixed interval between tick values. - * - * The specified count typically has the same value as the count that is used to generate the tick values. - * If there are too many ticks, the formatter may return the empty string for some of the tick labels; - * however, note that the ticks are still shown. - * To disable filtering, specify a count of Infinity. When specifying a count, you may also provide a format specifier or format function. - * For example, to get a tick formatter that will display 20 ticks of a currency, say log.tickFormat(20, "$,f"). - * If the specifier does not have a defined precision, the precision will be set automatically by the scale, returning the appropriate format. - * This provides a convenient way of specifying a format whose precision will be automatically set by the scale. - * - * @param count Approximate number of ticks to be used when calculating precision for the number format function. - * @param specifier An optional valid format specifier string which allows a custom format where the precision of the format is automatically set by the scale as appropriate for the tick interval. - * For example, to get a tick formatter that will display 20 ticks of a currency, say log.tickFormat(20, "$,f"). - * If the specifier does not have a defined precision, the precision will be set automatically by the scale, returning the appropriate format. - * This provides a convenient way of specifying a format whose precision will be automatically set by the scale. - */ - tickFormat(count?: number, specifier?: string): ((d: number | { valueOf(): number }) => string); - - /** - * Extends the domain to integer powers of base. For example, for a domain of [0.201479…, 0.996679…], and base 10, the nice domain is [0.1, 1]. - * If the domain has more than two values, nicing the domain only affects the first and last value. - * - * Nicing a scale only modifies the current domain; it does not automatically nice domains that are subsequently set using continuous.domain. - * You must re-nice the scale after setting the new domain, if desired. - */ - nice(): this; - - /** - * Returns the current base, which defaults to 10. - */ - base(): number; - /** - * Sets the base for this logarithmic scale to the specified value. - */ - base(base: number): this; -} - -/** - * Constructs a new continuous logarithmic scale with the domain [1, 10], the unit range [0, 1], the base 10, the default interpolator and clamping disabled. - * - * The scale will have range and output of data type number. - */ -export function scaleLog(): ScaleLogarithmic; -/** - * Constructs a new continuous logarithmic scale with the domain [1, 10], the base 10, the default interpolator and clamping disabled. - * - * The generic correponds to the data type of the range and output elements to be used. - * - * As range type and output type are the same, the interpolator factory used with the scale must match this behaviour. - * - * The range must be set in accordance with the range element type. - * - * The interpolator factory may be set using the interpolate(...) method of the scale. - */ -export function scaleLog(): ScaleLogarithmic; -/** - * Constructs a new continuous logarithmic scale with the domain [1, 10], the base 10, the default interpolator and clamping disabled. - * - * The first generic corresponds to the data type of the range elements. - * The second generic corresponds to the data type of the output elements generated by the scale. - * - * If range element and output element type differ, the interpolator factory used with the scale must match this behaviour and - * convert the interpolated range element to a corresponding output element. - * - * The range must be set in accordance with the range element type. - * - * The interpolator factory may be set using the interpolate(...) method of the scale. - */ -export function scaleLog(): ScaleLogarithmic; - -// ------------------------------------------------------------------------------- -// Identity Scale Factory -// ------------------------------------------------------------------------------- - -/** - * Identity scales are a special case of linear scales where the domain and range are identical; the scale and its invert method are thus the identity function. - * These scales are occasionally useful when working with pixel coordinates, say in conjunction with an axis or brush. - */ -export interface ScaleIdentity { - - /** - * Given a value from the domain, returns the corresponding value from the range, subject to interpolation, if any. - * - * If the given value is outside the domain, and clamping is not enabled, the mapping may be extrapolated such that the returned value is outside the range. - * - * Note: The interpolation function applied by the scale may change the output type from the range type as part of the interpolation. - * - * @param value A numeric value from the domain. - */ - (value: number | { valueOf(): number }): number; - - /** - * Given a value from the range, returns the corresponding value from the domain. Inversion is useful for interaction, - * say to determine the data value corresponding to the position of the mouse. - * - * If the given value is outside the range, and clamping is not enabled, the mapping may be extrapolated such that the returned value is outside the domain. - * - * IMPORTANT: This method is only supported if the range is numeric. If the range is not numeric, returns NaN. - * - * For a valid value y in the range, continuous(continuous.invert(y)) approximately equals y; - * similarly, for a valid value x in the domain, continuous.invert(continuous(x)) approximately equals x. - * The scale and its inverse may not be exact due to the limitations of floating point precision. - * - * @param value A numeric value from the range. - */ - invert(value: number | { valueOf(): number }): number; - - /** - * Returns a copy of the scale’s current domain. - */ - domain(): number[]; - /** - * Sets the scale’s domain to the specified array of numbers. The array must contain two or more elements. - * If the elements in the given array are not numbers, they will be coerced to numbers - * - * Although continuous scales typically have two values each in their domain and range, specifying more than two values produces a piecewise scale. - * - * Internally, a piecewise scale performs a binary search for the range interpolator corresponding to the given domain value. - * Thus, the domain must be in ascending or descending order. If the domain and range have different lengths N and M, only the first min(N,M) elements in each are observed. - * - * @param domain Array of numeric domain values. - */ - domain(domain: Array): this; - - /** - * Returns a copy of the scale’s current range. - */ - range(): number[]; - /** - * Sets the scale’s range to the specified array of values. - * - * The array must contain two or more elements. Unlike the domain, elements in the given array need not be numbers; - * any value that is supported by the underlying interpolator will work, though note that numeric ranges are required for invert. - * - * @param range Array of range values. - */ - range(range: Array): this; - - /** - * Returns approximately count representative values from the scale’s domain. - * - * If count is not specified, it defaults to 10. - * - * The returned tick values are uniformly spaced, have human-readable values (such as multiples of powers of 10), - * and are guaranteed to be within the extent of the domain. Ticks are often used to display reference lines, or tick marks, in conjunction with the visualized data. - * The specified count is only a hint; the scale may return more or fewer values depending on the domain. See also d3-array’s ticks. - * - * @param count Optional approximate number of ticks to be returned. If count is not specified, it defaults to 10. - */ - ticks(count?: number): number[]; - - /** - * Returns a number format function suitable for displaying a tick value, automatically computing the appropriate precision based on the fixed interval between tick values. - * The specified count should have the same value as the count that is used to generate the tick values. - * - * @param count Approximate number of ticks to be used when calculating precision for the number format function. - * @param specifier An optional valid format specifier string which allows a custom format where the precision of the format is automatically set by the scale as appropriate for the tick interval. - * If specifier uses the format type "s", the scale will return a SI-prefix format based on the largest value in the domain. - * If the specifier already specifies a precision, this method is equivalent to locale.format. - */ - tickFormat(count?: number, specifier?: string): ((d: number | { valueOf(): number }) => string); - - /** - * Extends the domain so that it starts and ends on nice round values. - * This method typically modifies the scale’s domain, and may only extend the bounds to the nearest round value. - * An optional tick count argument allows greater control over the step size used to extend the bounds, - * guaranteeing that the returned ticks will exactly cover the domain. - * Nicing is useful if the domain is computed from data, say using extent, and may be irregular. - * For example, for a domain of [0.201479…, 0.996679…], a nice domain might be [0.2, 1.0]. - * If the domain has more than two values, nicing the domain only affects the first and last value. - * - * Nicing a scale only modifies the current domain; it does not automatically nice domains that are subsequently set using continuous.domain. - * You must re-nice the scale after setting the new domain, if desired. - * - * @param count An optional number of ticks expexted to be used. - */ - nice(count?: number): this; - - /** - * Returns an exact copy of this scale. Changes to this scale will not affect the returned scale, and vice versa. - */ - copy(): ScaleIdentity; -} - -/** - * Constructs a new identity scale with the unit domain [0, 1] and the unit range [0, 1]. - */ -export function scaleIdentity(): ScaleIdentity; - - -// ------------------------------------------------------------------------------- -// Time Scale Factories -// ------------------------------------------------------------------------------- - -/** - * A linear scale defined over a temporal domain. - * - * Time scales implement ticks based on calendar intervals, taking the pain out of generating axes for temporal domains. - * - * If the range is numeric, the mapping may be inverted to return a date. - * - * Note that the data types of the range and output of the scale must be compatible with the interpolator applied by the scale. - * - * The first generic corresponds to the data type of the range elements. - * - * The second generic corresponds to the data type of the output elements generated by the scale. - * - * If range element and output element type differ, the interpolator factory used with the scale must match this behaviour and - * convert the interpolated range element to a corresponding output element. - */ -export interface ScaleTime { - - /** - * Given a value from the domain, returns the corresponding value from the range, subject to interpolation, if any. - * - * If the given value is outside the domain, and clamping is not enabled, the mapping may be extrapolated such that the returned value is outside the range. - * - * Note: The interpolation function applied by the scale may change the output type from the range type as part of the interpolation. - * - * @param value A temporal value from the domain. If the value is not a Date, it will be coerced to Date. - */ - (value: Date | number | { valueOf(): number }): Output; - - /** - * Given a value from the range, returns the corresponding value from the domain. Inversion is useful for interaction, - * say to determine the data value corresponding to the position of the mouse. - * - * If the given value is outside the range, and clamping is not enabled, the mapping may be extrapolated such that the returned value is outside the domain. - * - * IMPORTANT: This method is only supported if the range is numeric. If the range is not numeric, returns Invalid Date. - * - * For a valid value y in the range, time(time.invert(y)) equals y; similarly, for a valid value x in the domain, time.invert(time(x)) equals x. - * The invert method is useful for interaction, say to determine the value in the domain that corresponds to the pixel location under the mouse. - * - * @param value A numeric value from the range. - */ - invert(value: number | { valueOf(): number }): Date; - - /** - * Returns a copy of the scale’s current domain. - */ - domain(): Date[]; - - /** - * Sets the scale’s domain to the specified array of temporal domain values. The array must contain two or more elements. - * If the elements in the given array are not dates, they will be coerced to dates. - * - * Although continuous scales typically have two values each in their domain and range, specifying more than two values produces a piecewise scale. - * - * Internally, a piecewise scale performs a binary search for the range interpolator corresponding to the given domain value. - * Thus, the domain must be in ascending or descending order. If the domain and range have different lengths N and M, only the first min(N,M) elements in each are observed. - * - * @param domain Array of temporal domain values. Numeric values will be coerced to dates. - */ - domain(domain: Array): this; - - /** - * Returns a copy of the scale’s current range. - */ - range(): Range[]; - /** - * Sets the scale’s range to the specified array of values. - * - * The array must contain two or more elements. Unlike the domain, elements in the given array need not be temporal domain values; - * any value that is supported by the underlying interpolator will work, though note that numeric ranges are required for invert. - * - * @param range Array of range values. - */ - range(range: Range[]): this; - - /** - * Sets the scale’s range to the specified array of values while also setting the scale’s interpolator to interpolateRound. - * - * The rounding interpolator is sometimes useful for avoiding antialiasing artifacts, - * though also consider the shape-rendering “crispEdges” styles. Note that this interpolator can only be used with numeric ranges. - * - * The array must contain two or more elements. Unlike the domain, elements in the given array need not be temporal domain values; - * any value that is supported by the underlying interpolator will work, though note that numeric ranges are required for invert. - * - * @param range Array of range values. - */ - rangeRound(range: Array): this; - - /** - * Returns whether or not the scale currently clamps values to within the range. - */ - clamp(): boolean; - /** - * Enables or disables clamping, respectively. If clamping is disabled and the scale is passed a value outside the domain, - * the scale may return a value outside the range through extrapolation. - * - * If clamping is enabled, the return value of the scale is always within the scale’s range. Clamping similarly applies to the "invert" method. - * - * @param clamp A flag to enable (true) or disable (false) clamping. - */ - clamp(clamp: boolean): this; - - /** - * Returns the scale’s current interpolator factory, which defaults to interpolate. - */ - interpolate(): InterpolatorFactory; - - /** - * Sets the scale’s range interpolator factory. This interpolator factory is used to create interpolators for each adjacent pair of values from the range; - * these interpolators then map a normalized domain parameter t in [0, 1] to the corresponding value in the range. - * - * Note: the default interpolator may reuse return values. For example, if the range values are objects, then the value interpolator always returns the same object, modifying it in-place. - * If the scale is used to set an attribute or style, this is typically acceptable (and desirable for performance); - * however, if you need to store the scale’s return value, you must specify your own interpolator or make a copy as appropriate. - * - * As part of the interpolation process the interpotaled value from the range may be converted to a corresponding output value. - * - * @param interpolate An interpolation factory. The generics for Range and Output of the scale must correpond to the interpolation factory applied to the scale. - */ - interpolate(interpolate: InterpolatorFactory): this; - /** - * Sets the scale’s range interpolator factory. This interpolator factory is used to create interpolators for each adjacent pair of values from the range; - * these interpolators then map a normalized domain parameter t in [0, 1] to the corresponding value in the range. - * - * Note: the default interpolator may reuse return values. For example, if the range values are objects, then the value interpolator always returns the same object, modifying it in-place. - * If the scale is used to set an attribute or style, this is typically acceptable (and desirable for performance); - * however, if you need to store the scale’s return value, you must specify your own interpolator or make a copy as appropriate. - * - * As part of the interpolation process the interpotaled value from the range may be converted to a corresponding output value. - * - * The generic "NewOutput" can be used to change the scale to have a different output element type corresponding to the new interpolation factory. - * - * @param interpolate An interpolation factory. The generics for Range and Output of the scale must correpond to the interpolation factory applied to the scale. - */ - interpolate(interpolate: InterpolatorFactory): ScaleTime; - - /** - * Returns representative dates from the scale’s domain. The returned tick values are uniformly-spaced (mostly), - * have sensible values (such as every day at midnight), and are guaranteed to be within the extent of the domain. - * Ticks are often used to display reference lines, or tick marks, in conjunction with the visualized data. - * - * Without specifying a count or time interval to control the number of ticks returned, a default count of 10 is used. - * The specified count is only a hint; the scale may return more or fewer values depending on the domain. - */ - ticks(): Date[]; - /** - * Returns representative dates from the scale’s domain. The returned tick values are uniformly-spaced (mostly), - * have sensible values (such as every day at midnight), and are guaranteed to be within the extent of the domain. - * Ticks are often used to display reference lines, or tick marks, in conjunction with the visualized data. - * - * The specified count controls the number of ticks to be returned. The specified count is only a hint; - * the scale may return more or fewer values depending on the domain. - * - * @param count Expected number of ticks. - */ - ticks(count: number): Date[]; - /** - * Returns representative dates from the scale’s domain. The returned tick values are uniformly-spaced (mostly), - * have sensible values (such as every day at midnight), and are guaranteed to be within the extent of the domain. - * Ticks are often used to display reference lines, or tick marks, in conjunction with the visualized data. - * - * The specified time interval controls the ticks generated and returned. To prune the generated ticks for a given time interval, - * use interval.every(...) or interval.filter(...). - * - * @param interval A time interval to specify the expected ticks. - */ - ticks(interval: TimeInterval): Date[]; - - /** - * Returns a time format function suitable for displaying tick values. - * - * The default multi-scale time format chooses a human-readable representation based on the specified date as follows: - * - * - %Y - for year boundaries, such as 2011. - * - %B - for month boundaries, such as February. - * - %b %d - for week boundaries, such as Feb 06. - * - %a %d - for day boundaries, such as Mon 07. - * - %I %p - for hour boundaries, such as 01 AM. - * - %I:%M - for minute boundaries, such as 01:23. - * - :%S - for second boundaries, such as :45. - * - .%L - milliseconds for all other times, such as .012. - * - * Although somewhat unusual, this default behavior has the benefit of providing both local and global context: - * for example, formatting a sequence of ticks as [11 PM, Mon 07, 01 AM] reveals information about hours, dates, and day simultaneously, - * rather than just the hours [11 PM, 12 AM, 01 AM]. - */ - tickFormat(): ((d: Date) => string); - /** - * Returns a time format function suitable for displaying tick values. - * - * The specified count is currently ignored, but is accepted for consistency with other scales such as continuous.tickFormat. - * - * @param count Expected number of ticks. (Currently ignored) - * @param specifier An optional valid date format specifier string (see d3-time-format). - */ - tickFormat(count: number, specifier?: string): ((d: Date) => string); - /** - * Returns a time format function suitable for displaying tick values. - * - * The specified time interval is currently ignored, but is accepted for consistency with other scales such as continuous.tickFormat. - * - * @param interval A time interval to specify the expected ticks. (Currently ignored) - * @param specifier An optional valid date format specifier string (see d3-time-format). - */ - tickFormat(interval: TimeInterval, specifier?: string): ((d: Date) => string); - - /** - * Extends the domain so that it starts and ends on nice round values. - * This method typically modifies the scale’s domain, and may only extend the bounds to the nearest round value. - * - * Nicing is useful if the domain is computed from data, say using extent, and may be irregular. - * For example, for a domain of [2009-07-13T00:02, 2009-07-13T23:48], the nice domain is [2009-07-13, 2009-07-14]. - * If the domain has more than two values, nicing the domain only affects the first and last value. - */ - nice(): this; - /** - * Extends the domain so that it starts and ends on nice round values. - * This method typically modifies the scale’s domain, and may only extend the bounds to the nearest round value. - * - * A tick count argument allows greater control over the step size used to extend the bounds, guaranteeing that the returned ticks will exactly cover the domain. - * - * Nicing is useful if the domain is computed from data, say using extent, and may be irregular. - * For example, for a domain of [2009-07-13T00:02, 2009-07-13T23:48], the nice domain is [2009-07-13, 2009-07-14]. - * If the domain has more than two values, nicing the domain only affects the first and last value. - * - * @param count Expected number of ticks. - */ - nice(count: number): this; - /** - * Extends the domain so that it starts and ends on nice round values. - * This method typically modifies the scale’s domain, and may only extend the bounds to the nearest round value. - * - * a time interval may be specified to explicitly set the ticks. If an interval is specified, an optional step may also be specified to skip some ticks. - * For example, time.nice(d3.timeSecond, 10) will extend the domain to an even ten seconds (0, 10, 20, etc.). - * - * Nicing is useful if the domain is computed from data, say using extent, and may be irregular. - * For example, for a domain of [2009-07-13T00:02, 2009-07-13T23:48], the nice domain is [2009-07-13, 2009-07-14]. - * If the domain has more than two values, nicing the domain only affects the first and last value. - * - * @param interval A time interval to specify the expected ticks. - * @param step An optional step number to be applied to the time interval when considering ticks. - */ - nice(interval: CountableTimeInterval, step?: number): this; - - /** - * Returns an exact copy of this scale. Changes to this scale will not affect the returned scale, and vice versa. - */ - copy(): this; -} - -/** - * Constructs a new time scale using local time with the domain [2000-01-01, 2000-01-02], the unit range [0, 1], the default interpolator and clamping disabled. - * - * The scale will have range and output of data type number. - */ -export function scaleTime(): ScaleTime; -/** - * Constructs a new time scale using local time with the domain [2000-01-01, 2000-01-02], the default interpolator and clamping disabled. - * - * The generic correponds to the data type of the range and output elements to be used. - * - * As range type and output type are the same, the interpolator factory used with the scale must match this behaviour. - * - * The range must be set in accordance with the range element type. - * - * The interpolator factory may be set using the interpolate(...) method of the scale. - */ -export function scaleTime(): ScaleTime; -/** - * Constructs a new time scale using local time with the domain [2000-01-01, 2000-01-02], the default interpolator and clamping disabled. - * - * The first generic corresponds to the data type of the range elements. - * The second generic corresponds to the data type of the output elements generated by the scale. - * - * If range element and output element type differ, the interpolator factory used with the scale must match this behaviour and - * convert the interpolated range element to a corresponding output element. - * - * The range must be set in accordance with the range element type. - * - * The interpolator factory may be set using the interpolate(...) method of the scale. - */ -export function scaleTime(): ScaleTime; - -/** - * Constructs a new time scale using Coordinated Universal Time (UTC) with the domain [2000-01-01, 2000-01-02], the unit range [0, 1], the default interpolator and clamping disabled. - * - * The scale will have range and output of data type number. - */ -export function scaleUtc(): ScaleTime; -/** - * Constructs a new time scale using Coordinated Universal Time (UTC) with the domain [2000-01-01, 2000-01-02], the default interpolator and clamping disabled. - * - * The generic correponds to the data type of the range and output elements to be used. - * - * As range type and output type are the same, the interpolator factory used with the scale must match this behaviour. - * - * The range must be set in accordance with the range element type. - * - * The interpolator factory may be set using the interpolate(...) method of the scale. - */ -export function scaleUtc(): ScaleTime; -/** - * Constructs a new time scale using Coordinated Universal Time (UTC) with the domain [2000-01-01, 2000-01-02], the default interpolator and clamping disabled. - * - * The first generic corresponds to the data type of the range elements. - * The second generic corresponds to the data type of the output elements generated by the scale. - * - * If range element and output element type differ, the interpolator factory used with the scale must match this behaviour and - * convert the interpolated range element to a corresponding output element. - * - * The range must be set in accordance with the range element type. - * - * The interpolator factory may be set using the interpolate(...) method of the scale. - */ -export function scaleUtc(): ScaleTime; - -// ------------------------------------------------------------------------------- -// Sequential Scale Factory -// ------------------------------------------------------------------------------- - -/** - * Sequential scales are similar to continuous scales in that they map a continuous, - * numeric input domain to a continuous output range. However, unlike continuous scales, - * the output range of a sequential scale is fixed by its interpolator and not configurable. - * - * The generic corresponds to the data type of the output of the interpolator underlying the scale. - */ -export interface ScaleSequential { - - /** - * Given a value from the domain, returns the corresponding value from the output range, subject to interpolation. - * - * If the given value is outside the domain, and clamping is not enabled, the mapping may be extrapolated such that the returned value is outside the range. - * - * @param value A numeric value from the domain. - */ - (value: number | { valueOf(): number }): Output; - - /** - * Returns a copy of the scale’s current domain. - */ - domain(): [number, number]; - /** - * Sets the scale’s domain to the specified array of numbers. The array must contain exactly two elements. - * If the elements in the given array are not numbers, they will be coerced to numbers - * - * @param domain A two-element array of numeric domain values. - */ - domain(domain: [number | { valueOf(): number }, number | { valueOf(): number }]): this; - - /** - * Returns whether or not the scale currently clamps values to within the range. - */ - clamp(): boolean; - /** - * Enables or disables clamping, respectively. If clamping is disabled and the scale is passed a value outside the domain, - * the scale may return a value outside the range through extrapolation. - * - * If clamping is enabled, the return value of the scale is always within the scale’s range. Clamping similarly applies to the "invert" method. - * - * @param clamp A flag to enable (true) or disable (false) clamping. - */ - clamp(clamp: boolean): this; - - /** - * Returns the current interpolator underlying the scale. - */ - interpolator(): ((t: number) => Output); - /** - * Sets the scale’s interpolator to the specified function. - * - * @param interpolator An interpolator function mapping a value from the [0, 1] interval to an output value. - */ - interpolator(interpolator: ((t: number) => Output)): this; - /** - * Sets the scale’s interpolator to the specified function. - * - * The generic corresponds to a the new output type of the scale. The output type of the scale is determined by the output type of the interpolator function. - * - * @param interpolator An interpolator function mapping a value from the [0, 1] interval to an output value. - */ - interpolator(interpolator: ((t: number) => NewOutput)): ScaleSequential; - - /** - * Returns an exact copy of this scale. Changes to this scale will not affect the returned scale, and vice versa. - */ - copy(): ScaleSequential; -} - -/** - * Constructs a new sequential scale with the given interpolator function. When the scale is applied, the interpolator will be invoked with a value typically in the range [0, 1], - * where 0 represents the start of the domain, and 1 represents the end of the domain. - * - * The generic corresponds to the data type of the output of the interpolator underlying the scale. - * - * @param interpolator The interpolator function to be used with the scale. - */ -export function scaleSequential(interpolator: ((t: number) => Output)): ScaleSequential; - -// ------------------------------------------------------------------------------- -// Color Interpolators for Sequential Scale Factory -// ------------------------------------------------------------------------------- - -/** - * Given a number t in the range [0,1], returns the corresponding color from the “viridis” perceptually-uniform color scheme designed by van der Walt, Smith and Firing for matplotlib, - * represented as an RGB string. - * - * @param t A number in the interval [0, 1]. - */ -export function interpolateViridis(t: number): string; - -/** - * Given a number t in the range [0,1], returns the corresponding color from the “inferno” perceptually-uniform color scheme designed by van der Walt and Smith for matplotlib, - * represented as an RGB string. - * - * @param t A number in the interval [0, 1]. - */ -export function interpolateInferno(t: number): string; - -/** - * Given a number t in the range [0,1], returns the corresponding color from the “magma” perceptually-uniform color scheme designed by van der Walt and Smith for matplotlib, - * represented as an RGB string. - * - * @param t A number in the interval [0, 1]. - */ -export function interpolateMagma(t: number): string; - -/** - * Given a number t in the range [0,1], returns the corresponding color from the “plasma” perceptually-uniform color scheme designed by van der Walt and Smith for matplotlib, - * represented as an RGB string. - * - * @param t A number in the interval [0, 1]. - */ -export function interpolatePlasma(t: number): string; - -/** - * Given a number t in the range [0,1], returns the corresponding color from a 180° rotation of Niccoli’s perceptual rainbow, represented as an RGB string. - * - * @param t A number in the interval [0, 1]. - */ -export function interpolateWarm(t: number): string; - -/** - * Given a number t in the range [0,1], returns the corresponding color from Niccoli’s perceptual rainbow, represented as an RGB string. - * - * @param t A number in the interval [0, 1]. - */ -export function interpolateCool(t: number): string; - -/** - * Given a number t in the range [0,1], returns the corresponding color from d3.interpolateWarm scale from [0.0, 0.5] followed by the d3.interpolateCool scale from [0.5, 1.0], - * thus implementing the cyclical less-angry rainbow color scheme. - * - * @param t A number in the interval [0, 1]. - */ -export function interpolateRainbow(t: number): string; - -/** - * Given a number t in the range [0,1], returns the corresponding color from Green’s default Cubehelix represented as an RGB string. - * - * @param t A number in the interval [0, 1]. - */ -export function interpolateCubehelixDefault(t: number): string; - -// ------------------------------------------------------------------------------- -// Quantize Scale Factory -// ------------------------------------------------------------------------------- - -/** - * Quantize scales are similar to linear scales, except they use a discrete rather than continuous range. - * The continuous input domain is divided into uniform segments based on the number of values in (i.e., the cardinality of) the output range. - * - * Each range value y can be expressed as a quantized linear function of the domain value x: y = m round(x) + b. - * - * The generic corresponds to the data type of the range elements. - */ -export interface ScaleQuantize { - /** - * Given a value in the input domain, returns the corresponding value in the output range. - */ - (value: number | { valueOf(): number }): Range; - /** - * Returns the extent of values in the domain [x0, x1] for the corresponding value in the range: the inverse of quantize. - * This method is useful for interaction, say to determine the value in the domain that corresponds to the pixel location under the mouse. - * - * If an invalid range value is entered, returns [NaN, NaN]. - * - * @param value A value from the range. - */ - invertExtent(value: Range): [number, number]; - - /** - * Returns the scale’s current domain. - */ - domain(): [number, number]; - - /** - * Sets the scale’s domain to the specified two-element array of numbers. - * If the elements in the given array are not numbers, they will be coerced to numbers. - * - * @param domain A two-element array of numeric values defining the domain. - */ - domain(domain: [number | { valueOf(): number }, number | { valueOf(): number }]): this; - - /** - * Returns the scale’s current range. - */ - range(): Range[]; - /** - * Sets the scale’s range to the specified array of values. The array may contain any number of discrete values. - * - * @param range Array of range values. - */ - range(range: Range[]): this; - - /** - * Returns approximately count representative values from the scale’s domain. - * - * If count is not specified, it defaults to 10. - * - * The returned tick values are uniformly spaced, have human-readable values (such as multiples of powers of 10), - * and are guaranteed to be within the extent of the domain. Ticks are often used to display reference lines, or tick marks, in conjunction with the visualized data. - * The specified count is only a hint; the scale may return more or fewer values depending on the domain. See also d3-array’s ticks. - * - * @param count Optional approximate number of ticks to be returned. If count is not specified, it defaults to 10. - */ - ticks(count?: number): number[]; - - /** - * Returns a number format function suitable for displaying a tick value, automatically computing the appropriate precision based on the fixed interval between tick values. - * The specified count should have the same value as the count that is used to generate the tick values. - * - * @param count Approximate number of ticks to be used when calculating precision for the number format function. - * @param specifier An optional valid format specifier string which allows a custom format where the precision of the format is automatically set by the scale as appropriate for the tick interval. - * If specifier uses the format type "s", the scale will return a SI-prefix format based on the largest value in the domain. - * If the specifier already specifies a precision, this method is equivalent to locale.format. - */ - tickFormat(count?: number, specifier?: string): ((d: number | { valueOf(): number }) => string); - - /** - * Extends the domain so that it starts and ends on nice round values. - * This method typically modifies the scale’s domain, and may only extend the bounds to the nearest round value. - * - * Nicing is useful if the domain is computed from data, say using extent, and may be irregular. - * For example, for a domain of [0.201479…, 0.996679…], a nice domain might be [0.2, 1.0]. - * - * Nicing a scale only modifies the current domain; it does not automatically nice domains that are subsequently set using continuous.domain. - * You must re-nice the scale after setting the new domain, if desired. - * - * @param count An optional number of ticks expexted to be used. - */ - nice(count?: number): this; - - /** - * Returns an exact copy of this scale. Changes to this scale will not affect the returned scale, and vice versa. - */ - copy(): this; -} - -/** - * Constructs a new quantize scale with the unit domain [0, 1] and the unit range [0, 1]. - * Thus, the default quantize scale is equivalent to the Math.round function. - */ -export function scaleQuantize(): ScaleQuantize; - -/** - * Constructs a new quantize scale with the unit domain [0, 1]. - * - * The range must be set corresponding to the type of the range elements. - * - * The generic corresponds to the data type of the range elements. - */ -export function scaleQuantize(): ScaleQuantize; - -// ------------------------------------------------------------------------------- -// Quantile Scale Factory -// ------------------------------------------------------------------------------- - -/** - * Quantile scales map a sampled input domain to a discrete range. - * The domain is considered continuous and thus the scale will accept any reasonable input value; - * however, the domain is specified as a discrete set of sample values. - * The number of values in (the cardinality of) the output range determines the number of quantiles that will be computed from the domain. - * To compute the quantiles, the domain is sorted, and treated as a population of discrete values; see d3-array’s quantile. - * - * The generic correponds to the data type of range elements. - */ -export interface ScaleQuantile { - - /** - * Given a value in the input domain, returns the corresponding value in the output range. - * - * @param value A numeric value in the input domain. - */ - (value: number | { valueOf(): number }): Range; - - /** - * Returns the extent of values in the domain [x0, x1] for the corresponding value in the range: the inverse of quantile. - * This method is useful for interaction, say to determine the value in the domain that corresponds to the pixel location under the mouse. - * - * @param value A value from the range. - */ - invertExtent(value: Range): [number, number]; - - /** - * Returns the scale’s current domain. - */ - domain(): number[]; - /** - * Sets the domain of the quantile scale to the specified set of discrete numeric values. - * The array must not be empty, and must contain at least one numeric value; NaN, null and undefined values are ignored and not considered part of the sample population. - * - * If the elements in the given array are not numbers, they will be coerced to numbers. A copy of the input array is sorted and stored internally. - * - * @param domain Array of domain values. - */ - domain(domain: Array): this; - - /** - * Returns the current range. - */ - range(): Range[]; - /** - * Sets the discrete values in the range. The array must not be empty. - * The number of values in (the cardinality, or length, of) the range array determines the number of quantiles that are computed. - * - * For example, to compute quartiles, range must be an array of four elements such as [0, 1, 2, 3]. - * - * @param range Array of range values. - */ - range(range: Range[]): this; - - /** - * Returns the quantile thresholds. If the range contains n discrete values, the returned array will contain n - 1 thresholds. - * Values less than the first threshold are considered in the first quantile; - * values greater than or equal to the first threshold but less than the second threshold are in the second quantile, and so on. - * Internally, the thresholds array is used with bisect to find the output quantile associated with the given input value. - */ - quantiles(): number[]; - - /** - * Returns an exact copy of this scale. Changes to this scale will not affect the returned scale, and vice versa. - */ - copy(): this; -} - -/** - * Constructs a new quantile scale with an empty domain and an empty range. - * The quantile scale is invalid until both a domain and range are specified. - */ -export function scaleQuantile(): ScaleQuantile; - -/** - * Constructs a new quantile scale with an empty domain and an empty range. - * The quantile scale is invalid until both a domain and range are specified. - * - * The generic correponds to the data type of range elements. - */ -export function scaleQuantile(): ScaleQuantile; - -// ------------------------------------------------------------------------------- -// Threshold Scale Factory -// ------------------------------------------------------------------------------- - -/** - * Threshold scales are similar to quantize scales, except they allow you to map arbitrary subsets of the domain to discrete values in the range. - * The input domain is still continuous, and divided into slices based on a set of threshold values. - * - * If the number of values in the scale’s range is N+1, the number of values in the scale’s domain must be N. - * If there are fewer than N elements in the domain, the additional values in the range are ignored. - * If there are more than N elements in the domain, the scale may return undefined for some inputs. - * - * The first generic corresponds to the data type of domain values. - * The second generic corresponds to the data type of range values. - */ -export interface ScaleThreshold { - /** - * Given a value in the input domain, returns the corresponding value in the output range. - * - * @param value A domain value. - */ - (value: Domain): Range; - - /** - * Returns the extent of values in the domain [x0, x1] for the corresponding value in the range, representing the inverse mapping from range to domain. - * This method is useful for interaction, say to determine the value in the domain that corresponds to the pixel location under the mouse. - * - * @param value A range value. - */ - invertExtent(value: Range): [Domain | undefined, Domain | undefined]; - - /** - * Returns the scale’s current domain. - */ - domain(): Domain[]; - /** - * Sets the scale’s domain to the specified array of values. The values must be in sorted ascending order, or the behavior of the scale is undefined. - * The values are typically numbers, but any naturally ordered values (such as strings) will work; a threshold scale can be used to encode any type that is ordered. - * If the number of values in the scale’s range is N+1, the number of values in the scale’s domain must be N. - * If there are fewer than N elements in the domain, the additional values in the range are ignored. - * If there are more than N elements in the domain, the scale may return undefined for some inputs. - * - * @param domain Array of domain values. - */ - domain(domain: Domain[]): this; - - /** - * Returns the scale’s current range. - */ - range(): Range[]; - /** - * Sets the scale’s range to the specified array of values. If the number of values in the scale’s domain is N, the number of values in the scale’s range must be N+1. - * If there are fewer than N+1 elements in the range, the scale may return undefined for some inputs. - * If there are more than N+1 elements in the range, the additional values are ignored. - * - * @param range Array of range values. - */ - range(range: Range[]): this; - - /** - * Returns an exact copy of this scale. Changes to this scale will not affect the returned scale, and vice versa. - */ - copy(): this; -} - -/** - * Constructs a new threshold scale with the default domain [0.5] and the default range [0, 1]. - * Thus, the default threshold scale is equivalent to the Math.round function for numbers; for example threshold(0.49) returns 0, and threshold(0.51) returns 1. - */ -export function scaleThreshold(): ScaleThreshold; -/** - * Constructs a new threshold scale. The domain and range must be set corresponding to the type of the corresponding generic. - * - * The first generic corresponds to the data type of domain values. - * The second generic corresponds to the data type of range values. - */ -export function scaleThreshold(): ScaleThreshold; - -// ------------------------------------------------------------------------------- -// Ordinal Scale Factory -// ------------------------------------------------------------------------------- - -/** - * Unlike continuous scales, ordinal scales have a discrete domain and range. For example, an ordinal scale might map a set of named categories to a set of colors, - * or determine the horizontal positions of columns in a column chart. - * - * The first element in the domain will be mapped to the first element in range, the second domain value to the second range value, and so on. - * If there are fewer elements in the range than in the domain, the scale will reuse values from the start of the range. - * - * The first generic corresponds to the data type of domain values. - * The second generic corresponds to the data type of range values. - */ -export interface ScaleOrdinal { - /** - * Given a value in the input domain, returns the corresponding value in the output range. - * If the given value is not in the scale’s domain, returns the unknown; or, if the unknown value is implicit (the default), - * then the value is implicitly added to the domain and the next-available value in the range is assigned to value, - * such that this and subsequent invocations of the scale given the same input value return the same output value. - * - * @param x A value from the domain. - */ - (x: Domain): Range; - - /** - * Returns the scale's current domain. - */ - domain(): Domain[]; - /** - * Sets the domain to the specified array of values. - * - * The first element in domain will be mapped to the first element in the range, - * the second domain value to the second range value, and so on. - * - * Domain values are stored internally in a map from stringified value to index; the resulting index is then used to retrieve a value from the range. - * Thus, an ordinal scale’s values must be coercible to a string, and the stringified version of the domain value uniquely identifies the corresponding range value. - * - * Setting the domain on an ordinal scale is optional if the unknown value is implicit (the default). - * In this case, the domain will be inferred implicitly from usage by assigning each unique value passed to the scale a new value from the range. - * Note that an explicit domain is recommended to ensure deterministic behavior, as inferring the domain from usage will be dependent on ordering. - * - * @param domain Array of domain values. - */ - domain(domain: Domain[]): this; - - /** - * Returns the scale's current range. - */ - range(): Range[]; - /** - * Sets the range of the ordinal scale to the specified array of values. - * - * The first element in the domain will be mapped to the first element in range, the second domain value to the second range value, and so on. - * - * If there are fewer elements in the range than in the domain, the scale will reuse values from the start of the range. - * - * @param range Array of range values. - */ - range(range: Range[]): this; - - /** - * Returns the current unknown value, which defaults to "implicit". - */ - unknown(): Range | { name: 'implicit' }; - /** - * Sets the output value of the scale for unknown input values and returns this scale. - * The implicit value enables implicit domain construction. scaleImplicit can be used as a convenience to set the implicit value. - * - * @param value Unknown value to be used or scaleImplicit to set implicit scale generation. - */ - unknown(value: Range | { name: 'implicit' }): this; - - /** - * Returns an exact copy of this ordinal scale. Changes to this scale will not affect the returned scale, and vice versa. - */ - copy(): this; -} - -/** - * Constructs a new ordinal scale with an empty domain and the specified range. - * If a range is not specified, it defaults to the empty array; an ordinal scale always returns undefined until a non-empty range is defined. - * - * By default, the domain is configured to generate implicitly, if the scale is invoked with an unknown value. - * See the "unknown(...)" method of the scale to change this behavior. - * - * The generic corresponds to the data type of range elements. - * - * @parm range An optional array of range values to initialize the scale with. - */ -export function scaleOrdinal(range?: Range[]): ScaleOrdinal; -/** - * Constructs a new ordinal scale with an empty domain and the specified range. - * If a range is not specified, it defaults to the empty array; an ordinal scale always returns undefined until a non-empty range is defined. - * - * By default, the domain is configured to generate implicitly, if the scale is invoked with an unknown value. - * See the "unknown(...)" method of the scale to change this behavior. - * - * The first generic corresponds to the data type of domain elements. - * The second generic corresponds to the data type of range elements. - * - * @parm range An optional array of range values to initialize the scale with. - */ -export function scaleOrdinal(range?: Range[]): ScaleOrdinal; - -/** - * A special value for ordinal.unknown that enables implicit domain construction: unknown values are implicitly added to the domain. - */ -export const scaleImplicit: { name: 'implicit' }; - - -// ------------------------------------------------------------------------------- -// Band Scale Factory -// ------------------------------------------------------------------------------- - -/** - * Band scales are like ordinal scales except the output range is continuous and numeric. - * Discrete output values are automatically computed by the scale by dividing the continuous range into uniform bands. - * Band scales are typically used for bar charts with an ordinal or categorical dimension. - * The unknown value of a band scale is effectively undefined: they do not allow implicit domain construction. - * - * The generic corresponds to the data type of domain elements. - */ -export interface ScaleBand { - /** - * Given a value in the input domain, returns the start of the corresponding band derived from the output range. - * If the given value is not in the scale’s domain, returns undefined. - * - * @param x A value from the domain. - */ - (x: Domain): number | undefined; - - /** - * Returns to scale's current domain - */ - domain(): Domain[]; - /** - * Sets the domain to the specified array of values. The first element in domain will be mapped to the first band, the second domain value to the second band, and so on. - * Domain values are stored internally in a map from stringified value to index; the resulting index is then used to determine the band. - * Thus, a band scale’s values must be coercible to a string, and the stringified version of the domain value uniquely identifies the corresponding band. - * - * @param domain Array of domain values. - */ - domain(domain: Domain[]): this; - - /** - * Returns the scale’s current range, which defaults to [0, 1]. - */ - range(): [number, number]; - /** - * Sets the scale’s range to the specified two-element array of numbers. If the elements in the given array are not numbers, they will be coerced to numbers. - * The default range is [0, 1]. - * - * @param range A two-element array of numeric values. - */ - range(range: [number | { valueOf(): number }, number | { valueOf(): number }]): this; - - /** - * Sets the scale’s range to the specified two-element array of numbers while also enabling rounding. - * If the elements in the given array are not numbers, they will be coerced to numbers. - * - * Rounding is sometimes useful for avoiding antialiasing artifacts, though also consider the shape-rendering “crispEdges” styles. - * - * @param range A two-element array of numeric values. - */ - rangeRound(range: [number | { valueOf(): number }, number | { valueOf(): number }]): this; - - /** - * Returns the current rounding status for the scale: enabled (= true) or disabled (= false). - */ - round(): boolean; - /** - * Enables or disables rounding accordingly. If rounding is enabled, the start and stop of each band will be integers. - * Rounding is sometimes useful for avoiding antialiasing artifacts, though also consider the shape-rendering “crispEdges” styles. - * Note that if the width of the domain is not a multiple of the cardinality of the range, there may be leftover unused space, even without padding! - * Use band.align to specify how the leftover space is distributed. - * - * @param round Enable rounding (= true), disable rounding (= false). - */ - round(round: boolean): this; - - /** - * Returns the current inner padding which defaults to 0. - */ - paddingInner(): number; - /** - * Sets the inner padding to the specified value which must be in the range [0, 1]. - * The inner padding determines the ratio of the range that is reserved for blank space between bands. - * - * The default setting is 0. - * - * @param padding Value for inner padding in [0, 1] interval. - */ - paddingInner(padding: number): this; - - /** - * Returns the current outer padding which defaults to 0. - */ - paddingOuter(): number; - /** - * Sets the outer padding to the specified value which must be in the range [0, 1]. - * The outer padding determines the ratio of the range that is reserved for blank space before the first band and after the last band. - * - * The default setting is 0. - * - * @param padding Value for outer padding in [0, 1] interval. - */ - paddingOuter(padding: number): this; - - /** - * Returns the inner padding. - */ - padding(): number; - /** - * A convenience method for setting the inner and outer padding to the same padding value. - * - * @param padding Value for inner and outer padding in [0, 1] interval. - */ - padding(padding: number): this; - - /** - * Returns the current alignment which defaults to 0.5. - */ - align(): number; - /** - * Sets the alignment to the specified value which must be in the range [0, 1]. - * - * The default is 0.5. - * - * The alignment determines how any leftover unused space in the range is distributed. - * A value of 0.5 indicates that the leftover space should be equally distributed before the first band and after the last band; - * i.e., the bands should be centered within the range. A value of 0 or 1 may be used to shift the bands to one side, say to position them adjacent to an axis. - * - * @param align Value for alignment setting in [0, 1] interval. - */ - align(align: number): this; - - /** - * Returns the width of each band. - */ - bandwidth(): number; - - /** - * Returns the distance between the starts of adjacent bands. - */ - step(): number; - - /** - * Returns an exact copy of this scale. Changes to this scale will not affect the returned scale, and vice versa. - */ - copy(): this; -} - -/** - * Constructs a new band scale with the empty domain, the unit range [0, 1], no padding, no rounding and center alignment. - */ -export function scaleBand(): ScaleBand; -/** - * Constructs a new band scale with the empty domain, the unit range [0, 1], no padding, no rounding and center alignment. - * - * The generic correponds to the data type of domain elements. - */ -export function scaleBand(): ScaleBand; - -// ------------------------------------------------------------------------------- -// Point Scale Factory -// ------------------------------------------------------------------------------- - -/** - * Point scales are a variant of band scales with the bandwidth fixed to zero. - * Point scales are typically used for scatterplots with an ordinal or categorical dimension. - * The unknown value of a point scale is always undefined: they do not allow implicit domain construction. - * - * The generic corresponds to the data type of domain elements. - */ -export interface ScalePoint { - /** - * Given a value in the input domain, returns the corresponding point derived from the output range. - * If the given value is not in the scale’s domain, returns undefined. - * - * @param x A value from the domain. - */ - (x: Domain): number | undefined; - - /** - * Returns the scale's current domain. - */ - domain(): Domain[]; - /** - * Sets the domain to the specified array of values. The first element in domain will be mapped to the first point, the second domain value to the second point, and so on. - * Domain values are stored internally in a map from stringified value to index; the resulting index is then used to determine the point. - * Thus, a point scale’s values must be coercible to a string, and the stringified version of the domain value uniquely identifies the corresponding point. - * - * @param domain Array of domain values. - */ - domain(domain: Domain[]): this; - - /** - * Returns the scale’s current range, which defaults to [0, 1]. - */ - range(): [number, number]; - /** - * Sets the scale’s range to the specified two-element array of numbers. - * If the elements in the given array are not numbers, they will be coerced to numbers. - * The default range is [0, 1]. - * - * @param range A two-element array of numeric values. - */ - range(range: [number | { valueOf(): number }, number | { valueOf(): number }]): this; - - /** - * Sets the scale’s range to the specified two-element array of numbers while also enabling rounding. - * If the elements in the given array are not numbers, they will be coerced to numbers. - * - * Rounding is sometimes useful for avoiding antialiasing artifacts, though also consider the shape-rendering “crispEdges” styles. - * - * @param range A two-element array of numeric values. - */ - rangeRound(range: [number | { valueOf(): number }, number | { valueOf(): number }]): this; - - /** - * Returns the current rounding status for the scale: enabled (= true) or disabled (= false). - */ - round(): boolean; - /** - * Enables or disables rounding accordingly. If rounding is enabled, the position of each point will be integers. - * Rounding is sometimes useful for avoiding antialiasing artifacts, though also consider the shape-rendering “crispEdges” styles. - * Note that if the width of the domain is not a multiple of the cardinality of the range, there may be leftover unused space, even without padding! - * Use point.align to specify how the leftover space is distributed. - * - * @param round Enable rounding (= true), disable rounding (= false). - */ - round(round: boolean): this; - - /** - * Returns the current outer padding which defaults to 0. - * The outer padding determines the ratio of the range that is reserved for blank space - * before the first point and after the last point. - * - */ - padding(): number; - /** - * Sets the outer padding to the specified value which must be in the range [0, 1]. - * The outer padding determines the ratio of the range that is reserved for blank space - * before the first point and after the last point. - * - * The default is 0. - * - * @param padding Value for outer padding in [0, 1] interval. - */ - padding(padding: number): this; - - /** - * Returns the current alignment which defaults to 0.5. - */ - align(): number; - /** - * Sets the alignment to the specified value which must be in the range [0, 1]. - * - * The alignment determines how any leftover unused space in the range is distributed. - * A value of 0.5 indicates that the leftover space should be equally distributed before the first point and after the last point; - * i.e., the points should be centered within the range. A value of 0 or 1 may be used to shift the points to one side, say to position them adjacent to an axis. - * - * The default value is 0.5. - * - * @param align Value for alignment setting in [0, 1] interval. - */ - align(align: number): this; - - /** - * Return 0. - */ - bandwidth(): number; - - /** - * Returns the distance between the starts of adjacent points. - */ - step(): number; - - /** - * Returns an exact copy of this scale. Changes to this scale will not affect the returned scale, and vice versa. - */ - copy(): this; -} - -/** - * Constructs a new point scale with the empty domain, the unit range [0, 1], no padding, no rounding and center alignment. - */ -export function scalePoint(): ScalePoint; -/** - * Constructs a new point scale with the empty domain, the unit range [0, 1], no padding, no rounding and center alignment. - * - * The generic corresponds to the data type of domain elements. - */ -export function scalePoint(): ScalePoint; - - -// ------------------------------------------------------------------------------- -// Categorical Color Schemas for Ordinal Scales -// ------------------------------------------------------------------------------- - -/** - * An array of ten categorical colors represented as RGB hexadecimal strings. - */ -export const schemeCategory10: string[]; - -/** - * An array of twenty categorical colors represented as RGB hexadecimal strings. - */ -export const schemeCategory20: string[]; - -/** - * An array of twenty categorical colors represented as RGB hexadecimal strings. - */ -export const schemeCategory20b: string[]; - -/** - * An array of twenty categorical colors represented as RGB hexadecimal strings. - * This color scale includes color specifications and designs developed by Cynthia Brewer (colorbrewer2.org). - */ -export const schemeCategory20c: string[]; diff --git a/d3-scale/tslint.json b/d3-scale/tslint.json deleted file mode 100644 index 68d10d72a6..0000000000 --- a/d3-scale/tslint.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "../tslint.json", - "rules": { - "unified-signatures": false - } -} diff --git a/d3-selection-multi/index.d.ts b/d3-selection-multi/index.d.ts deleted file mode 100644 index 30268ad3aa..0000000000 --- a/d3-selection-multi/index.d.ts +++ /dev/null @@ -1,119 +0,0 @@ -// Type definitions for D3JS d3-selection-multi module 1.0 -// Project: https://github.com/d3/d3-selection-multi/ -// Definitions by: Alex Ford , Boris Yankov -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -// Last module patch version validated against: 1.0.0 - -import {Selection, BaseType, ArrayLike, ValueFn} from 'd3-selection'; -import {Transition} from 'd3-transition'; - - -/** - * An object mapping attribute (or style or property) names to value accessors - * - * The first generic corresponds to type of the selected element(s). - * - * The second generic corresponds to the type of the data on the selected element. - */ -// Retained ValueMap as type as it works better with IDE support for its intended purpose. It is not meant to be extended. So type is o.k. -// tslint:disable-next-line:interface-over-type-literal -export type ValueMap = { [key: string]: number | string | boolean | null | ValueFn }; - -declare module 'd3-selection' { - /** - * A D3 Selection of elements. - * - * The first generic "GElement" refers to the type of the selected element(s). - * The second generic "Datum" refers to the type of the datum of a selected element(s). - * The third generic "PElement" refers to the type of the parent element(s) in the D3 selection. - * The fourth generic "PDatum" refers to the type of the datum of the parent element(s). - */ - export interface Selection { - /** - * Set multiple attributes on the given selection. Attribute values may be constant or derived from each node and its bound data. - * - * @param attrs An object used as a map of attribute names to set - */ - attrs(attrs: ValueMap): this; - - /** - * Derive a map of attributes to be set on the selection. - * - * @param attrs A function that returns an object of attribute names and values to set. - */ - attrs(attrs: ValueFn>): this; - - /** - * Set multiple CSS style properties on the given selection. Style properties may be constant or derived from each node and its bound data. - * - * @param style An object used as a map of style properties to set. - * @param priority The CSS priority (either "important" or undefined). - */ - styles(style: ValueMap, priority?: 'important'): this; - - /** - * Derive a map of style properties to be set on the selection. - * - * @param style A function that returns an object of style properties and the values to be set. - * @param priority The CSS priority (either "important" or undefined) - */ - styles(style: ValueFn>, priority?: 'important'): this; - - /** - * Set multiple object properties directly on the selection's node(s). Property values may be constants or derived from each node and its bound data. - * - * @param props An object used as a map of object properties to be set. - */ - properties(props: ValueMap): this; - - /** - * Derive a map of object properties to be set on the selection's node(s). - * - * @param props A function that returns an object of properties and their values. - */ - properties(props: ValueFn>): this; - } -} - -declare module 'd3-transition' { - /** - * A D3 Transition. - * - * The first generic "GElement" refers to the type of the selected element(s) in the Transition. - * The second generic "Datum" refers to the type of the datum of a selected element(s) in the Transition. - * The third generic "PElement" refers to the type of the parent element(s) in the D3 selection in the Transition. - * The fourth generic "PDatum" refers to the type of the datum of the parent element(s) in the Transition. - */ - export interface Transition { - /** - * Set multiple attribute values. The transition will animate from the present value to the new value. Attribute values may be constant or derived from each node and its bound data. - * - * @param attrs An object used as a map of attributes and their values. - */ - attrs(attrs: ValueMap): this; - - /** - * Derive a map of attribute values to set. - * - * @param attrs A function returning a map of attributes and their values. - */ - attrs(attrs: ValueFn>): this; - - /** - * Set multiple style properties. The transition will animate from the present value to the new value. Attribute values may be constant or derived from each node and its bound data. - * - * @param style A map of style properties and their values - * @param priority The CSS priority (either "important" or undefined) - */ - styles(style: ValueMap, priority?: 'important'): this; - - /** - * Derive a map of style properties to be set. - * - * @param style A function returning a map of style properties and their values - * @param priority The CSS priority (either "important" or undefined) - */ - styles(style: ValueFn>, priority?: 'important'): this; - } -} diff --git a/d3-selection-multi/tslint.json b/d3-selection-multi/tslint.json deleted file mode 100644 index 68d10d72a6..0000000000 --- a/d3-selection-multi/tslint.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "../tslint.json", - "rules": { - "unified-signatures": false - } -} diff --git a/d3-selection/index.d.ts b/d3-selection/index.d.ts deleted file mode 100644 index 49cd141dfa..0000000000 --- a/d3-selection/index.d.ts +++ /dev/null @@ -1,1127 +0,0 @@ -// Type definitions for D3JS d3-selection module 1.0 -// Project: https://github.com/d3/d3-selection/ -// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -// Last module patch version validated against: 1.0.2 - -// -------------------------------------------------------------------------- -// Shared Type Definitions and Interfaces -// -------------------------------------------------------------------------- - -/** - * BaseType serves as an alias for the 'minimal' data type which can be selected - * without 'd3-selection' trying to use properties internally which would otherwise not - * be supported. - */ -export type BaseType = Element | EnterElement | Document | Window | null; - -/** - * A helper interface which covers arguments like NodeListOf or HTMLCollectionOf - * argument types - */ -export interface ArrayLike { - length: number; - item(index: number): T; - [index: number]: T; -} - -/** - * An interface describing the element type of the Enter Selection group elements - * created when invoking selection.enter(). - */ -export interface EnterElement { - ownerDocument: Document; - namespaceURI: string; - appendChild(newChild: Node): Node; - insertBefore(newChild: Node, refChild: Node): Node; - querySelector(selectors: string): Element; - querySelectorAll(selectors: string): NodeListOf; -} - -/** - * Container element type usable for mouse/touch functions - */ -export type ContainerElement = HTMLElement | SVGSVGElement | SVGGElement; - - -/** - * Interface for optional parameters map, when dispatching custom events - * on a selection - */ -export interface CustomEventParameters { - /** - * If true, the event is dispatched to ancestors in reverse tree order - */ - bubbles: boolean; - /** - * If true, event.preventDefault is allowed - */ - cancelable: boolean; - /** - * Any custom data associated with the event - */ - detail: any; -} - -/** - * Callback type for selections and transitions - */ -export type ValueFn = (this: T, datum: Datum, index: number, groups: T[] | ArrayLike) => Result; - - -/** - * TransitionLike is a helper interface to represent a quasi-Transition, without specifying the full Transition interface in this file. - * For example, whereever d3-zoom allows a Transition to be passed in as an argument, it internally immediately invokes its `selection()` - * method to retrieve the underlying Selection object before proceeding. - * d3-brush uses a subset of Transition methods internally. - * The use of this interface instead of the full imported Transition interface is [referred] to achieve - * two things: - * (1) the d3-transition module may not be required by a projects use case, - * (2) it avoids possible complications from 'module augmentation' from d3-transition to Selection. - */ -export interface TransitionLike { - selection(): Selection; - on(type: string, listener: null): TransitionLike; - on(type: string, listener: ValueFn): TransitionLike; - tween(name: string, tweenFn: null): TransitionLike; - tween(name: string, tweenFn: ValueFn void)>): TransitionLike; -} - - - -// -------------------------------------------------------------------------- -// All Selection related interfaces and function -// -------------------------------------------------------------------------- - -/** - * Select the first element that matches the specified selector string. If no elements match the selector, returns an empty selection. - * If multiple elements match the selector, only the first matching element (in document order) will be selected. - * - * The first generic "GElement" refers to the type of element to be selected. The second generic "OldDatum" refers to the type of the - * datum, on the selected element. This is useful when re-selecting an element with a previously set, know datum type. - * - * @param selector CSS selector string - */ -export function select(selector: string): Selection; -/** - * Select the specified node element. - * - * The first generic "GElement" refers to the type of element to be selected. The second generic "OldDatum" refers to the type of the - * datum, on the selected element. This is useful when re-selecting an element with a previously set, know datum type. - * - * @param node An element to be selected - */ -export function select(node: GElement): Selection; - -/** - * Create an empty selection. - */ -export function selectAll(): Selection; -/** - * Create an empty selection. - */ -export function selectAll(selector: null): Selection; -/** - * Create an empty selection. - */ -export function selectAll(selector: undefined): Selection; -/** - * Select all elements that match the specified selector string. The elements will be selected in document order (top-to-bottom). - * If no elements in the document match the selector, returns an empty selection. - * - * The first generic "GElement" refers to the type of element to be selected. The second generic "OldDatum" refers to the type of the - * datum, of a selected element. This is useful when re-selecting elements with a previously set, know datum type. - * - * @param selector CSS selector string - */ -export function selectAll(selector: string): Selection; -/** - * Select the specified array of nodes. - * - * The first generic "GElement" refers to the type of element to be selected. The second generic "OldDatum" refers to the type of the - * datum, of a selected element. This is useful when re-selecting elements with a previously set, know datum type. - * - * @param nodes An Array of nodes - */ -export function selectAll(nodes: GElement[]): Selection; -/** - * Select the specified nodes. This signature allows the selection of nodes contained in a NodeList, HTMLCollection or similar data structure. - * - * The first generic "GElement" refers to the type of element to be selected. The second generic "OldDatum" refers to the type of the - * datum, of a selected element. This is useful when re-selecting elements with a previously set, know datum type. - * - * @param nodes An Array-like collection of nodes - */ -export function selectAll(nodes: ArrayLike): Selection; - - -/** - * A D3 Selection of elements. - * - * The first generic "GElement" refers to the type of the selected element(s). - * The second generic "Datum" refers to the type of the datum of a selected element(s). - * The third generic "PElement" refers to the type of the parent element(s) in the D3 selection. - * The fourth generic "PDatum" refers to the type of the datum of the parent element(s). - */ -interface Selection { - - // Sub-selection ------------------------- - - /** - * For each selected element, select the first descendant element that matches the specified selector string. - * If no element matches the specified selector for the current element, the element at the current index will - * be null in the returned selection. If multiple elements match the selector, only the first matching element - * in document order is selected. Selection.select does not affect grouping: it preserves the existing group - * structure and indexes, and propagates data (if any) to selected children. - * - * If the current element has associated data, this data is propagated to the - * corresponding selected element. - * - * The generic represents the type of the descendant element to be selected. - * - * @param selector CSS selector string - */ - select(selector: string): Selection; - /** - * Create an empty sub-selection. Selection.select does not affect grouping: it preserves the existing group - * structure and indexes. - */ - select(selector: null): Selection; - /** - * For each selected element, select the descendant element returned by the selector function. - * If no element is returned by the selector function for the current element, the element at the - * current index will be null in the returned selection. Selection.select does not affect grouping: - * it preserves the existing group structure and indexes, and propagates data (if any) to selected children. - * - * If the current element has associated data, this data is propagated to the - * corresponding selected element. - * - * The generic represents the type of the descendant element to be selected. - * - * @param selector A selector function, which is evaluated for each selected element, in order, being passed the current datum (d), - * the current index (i), and the current group (nodes), with this as the current DOM element. - * It must return an element, or null if there is no matching element. - */ - select(selector: ValueFn): Selection; - - /** - * Create an empty sub-selection. Selection.selectAll does affect grouping: The elements in the returned - * selection are grouped by their corresponding parent node in this selection, the group at the current index will be empty. - */ - selectAll(): Selection; - /** - * Create an empty sub-selection. Selection.selectAll does affect grouping: The elements in the returned - * selection are grouped by their corresponding parent node in this selection, the group at the current index will be empty. - */ - selectAll(selector: null): Selection; - /** - * Create an empty sub-selection. Selection.selectAll does affect grouping: The elements in the returned - * selection are grouped by their corresponding parent node in this selection, the group at the current index will be empty. - */ - selectAll(selector: undefined): Selection; - /** - * For each selected element, selects the descendant elements that match the specified selector string. The elements in the returned - * selection are grouped by their corresponding parent node in this selection. If no element matches the specified selector - * for the current element, the group at the current index will be empty. Selection.selectAll does affect grouping: each selected descendant - * is grouped by the parent element in the originating selection. - * - * The selected elements do not inherit data from this selection; use selection.data to propagate data to children. - * - * The first generic "DescElement" refers to the type of descendant element to be selected. The second generic "OldDatum" refers to the type of the - * datum, of a selected element. This is useful when re-selecting elements with a previously set, know datum type. - * - * @param selector CSS selector string - */ - selectAll(selector: string): Selection; - - /** - * For each selected element, selects the descendant elements returned by the selector function. The elements in the returned - * selection are grouped by their corresponding parent node in this selection. If no element matches the specified selector - * for the current element, the group at the current index will be empty. Selection.selectAll does affect grouping: each selected descendant - * is grouped by the parent element in the originating selection. - * - * The selected elements do not inherit data from this selection; use selection.data to propagate data to children. - * - * The first generic "DescElement" refers to the type of descendant element to be selected. The second generic "OldDatum" refers to the type of the - * datum, of a selected element. This is useful when re-selecting elements with a previously set, know datum type. - * - * @param selector A selector function which is evaluated for each selected element, in order, being passed the current datum (d), - * the current index (i), and the current group (nodes), with this as the current DOM element. It must return an array of elements - * (or a pseudo-array, such as a NodeList), or the empty array if there are no matching elements. - */ - selectAll(selector: ValueFn>): Selection; - - // Modifying ------------------------------- - - /** - * Return the current value of the specified attribute for the first (non-null) element in the selection. - * This is generally useful only if you know that the selection contains exactly one element. - * - * @param name Name of the attribute - */ - attr(name: string): string; - /** - * Clear the attribute with the specified name for the selected elements and returns this selection. - * - * @param name Name of the attribute - * @param value null,to clear the attribute - */ - attr(name: string, value: null): this; - /** - * Sets the value of the attribute with the specified name for the selected elements and returns this selection. - * All elements are given the same attribute value. - * - * @param name Name of the attribute - * @param value Constant value for the attribute - */ - attr(name: string, value: string | number | boolean): this; - /** - * Sets the value of the attribute with the specified name for the selected elements and returns this selection. - * The value for the individual selected elements is determined by the value function. - * - * @param name Name of the attribute - * @param value A value function which is evaluated for each selected element, in order, being passed the current datum (d), - * the current index (i), and the current group (nodes), with this as the current DOM element. A null value will clear the attribute. - */ - attr(name: string, value: ValueFn): this; - - /** - * Returns true if and only if the first (non-null) selected element has the specified classes. - * This is generally useful only if you know the selection contains exactly one element. - * - * @param name A string of space-separated class names. - */ - classed(names: string): boolean; - /** - * Assigns or unassigns the specified CSS class names on the selected elements by setting - * the class attribute or modifying the classList property and returns this selection. - * If the constant value is truthy, then all elements are assigned the specified classes; otherwise, the classes are unassigned. - * - * @param names A string of space-separated class names. - * @param value A boolean flag (true = assign / false = unassign) - */ - classed(names: string, value: boolean): this; - /** - * Assigns or unassigns the specified CSS class names on the selected elements by setting - * the class attribute or modifying the classList property and returns this selection. - * The assign/unassign status for the individual selected elements is determined by the boolean return - * value of the value function. - * - * @param names A string of space-separated class names. - * @param value A value function which is evaluated for each selected element, in order, - * being passed the current datum (d), the current index (i), and the current group (nodes), with this as the current DOM element. - * The function’s return value is then used to assign or unassign classes on each element. - */ - classed(names: string, value: ValueFn): this; - - /** - * Returns the current computed value of the specified style for the first (non-null) element in the selection. - * This is generally useful only if you know that the selection contains exactly one element. - * The computed value may be different than the previously-set value, particularly if it was set using a - * shorthand property (such as the font style, which is shorthand for font-size, font-face, etc.). - * - * @param name Name of the style - */ - style(name: string): string; - /** - * Clear the style with the specified name for the selected elements and returns this selection. - * - * @param name Name of the style - * @param value null,to clear the style - */ - style(name: string, value: null): this; - /** - * Sets the value of the style with the specified name for the selected elements and returns this selection. - * All elements are given the same style value. - * - * @param name Name of the style - * @param value Constant value for the style - * @param priority An optional priority flag, either null or the string important (without the exclamation point) - */ - style(name: string, value: string | number | boolean, priority?: null | 'important'): this; - /** - * Sets the value of the style with the specified name for the selected elements and returns this selection. - * The value for the individual selected elements is determined by the value function. - * - * @param name Name of the style - * @param value A value function which is evaluated for each selected element, in order, being passed the current datum (d), - * the current index (i), and the current group (nodes), with this as the current DOM element. A null value will clear the style. - * @param priority An optional priority flag, either null or the string important (without the exclamation point) - */ - style(name: string, value: ValueFn, priority?: null | 'important'): this; - - /** - * Return the current value of the specified property for the first (non-null) element in the selection. - * This is generally useful only if you know that the selection contains exactly one element. - * - * @param name Name of the property - */ - property(name: string): any; - /** - * Look up a local variable on the first node of this selection. Note that this is not equivalent to `local.get(selection.node())` in that it will not look up locals set on the parent node(s). - * - * @param name The `d3.local` variable to look up. - */ - property(name: Local): T | undefined; - /** - * Sets the value of the property with the specified name for the selected elements and returns this selection. - * The value for the individual selected elements is determined by the value function. - * - * Some HTML elements have special properties that are not addressable using attributes or styles, - * such as a form field’s text value and a checkbox’s checked boolean. Use this method to get or set these properties. - * - * @param name Name of the property - * @param value A value function which is evaluated for each selected element, in order, being passed the current datum (d), - * the current index (i), and the current group (nodes), with this as the current DOM element. A null value will clear the property. - */ - property(name: string, value: ValueFn): this; - /** - * Clears the property with the specified name for the selected elements and returns this selection. - * - * @param name Name of the property - * @param value null,to clear the property - */ - property(name: string, value: null): this; - /** - * Sets the value of the property with the specified name for the selected elements and returns this selection. - * All elements are given the same property value. - * - * @param name Name of the property - * @param value Constant value for the property - */ - property(name: string, value: any): this; - /** - * Store a value in a `d3.local` variable. - * This is equivalent to `selection.each(function (d, i, g) { name.set(this, value.call(this, d, i, g)); })` but more concise. - * - * @param name A `d3.local` variable - * @param value A callback that returns the value to store - */ - property(name: Local, value: ValueFn): this; - /** - * Store a value in a `d3.local` variable for each node in the selection. - * This is equivalent to `selection.each(function () { name.set(this, value); })` but more concise. - * - * @param name A `d3.local` variable - * @param value A callback that returns the value to store - */ - property(name: Local, value: T): this; - - /** - * Returns the text content for the first (non-null) element in the selection. - * This is generally useful only if you know the selection contains exactly one element. - */ - text(): string; - /** - * Clear the text content of the selected elements and return the selection. - */ - text(value: null): this; - /** - * Sets the text content to the specified value on all selected elements, replacing any existing child elements. - * All elements are given the same text content. - * - * @param value Text content value for the elements. - */ - text(value: string | number | boolean): this; - /** - * Sets the text content to the specified value on all selected elements, replacing any existing child elements. - * All elements are given the same text content. - * - * @param value A value unction which is evaluated for each selected element, in order, being passed the current datum (d), - * the current index (i), and the current group (nodes), with this as the current DOM element. - * The function’s return value is then used to set each element’s text content. A null value will clear the content. - */ - text(value: ValueFn): this; - - /** - * Returns a string representation of the inner HTML for the first (non-null) element in the selection. - * This is generally useful only if you know the selection contains exactly one element. - */ - html(): string; - /** - * Clear the html content of the selected elements and return the selection. - */ - html(value: null): this; - /** - * Sets the inner HTML to the specified value on all selected elements, replacing any existing child elements. - * All elements are given the same inner HTML - * - * @param value String representation of inner HTML. - */ - html(value: string): this; - /** - * Sets the inner HTML to the specified value on all selected elements, replacing any existing child elements. - * The inner HTML is determined for each individual element using a value function. - * - * @param value A value function which is evaluated for each selected element, in order, being passed the current - * datum (d), the current index (i), and the current group (nodes), with this as the current DOM element. - * The function’s return value is then used to set each element’s inner HTML. A null value will clear the content. - */ - html(value: ValueFn): this; - - /** - * Appends a new element of the specified type (tag name) as the last child of each selected element, or the next - * following sibling in the update selection if this is an enter selection. - * (The enter behavior allows you to insert elements into the DOM in an order consistent with bound data; - * however, the slower selection.order may still be required if updating elements change order.) - * - * This method returns a new selection containing the appended elements. - * Each new element inherits the data of the current elements, if any. - * - * The generic refers to the type of the child element to be appended. - * - * @param type A string representing the tag name. The specified name may have a namespace prefix, such as svg:text - * to specify a text attribute in the SVG namespace. If no namespace is specified, the namespace will be inherited - * from the parent element; or, if the name is one of the known prefixes, the corresponding namespace will be used - * (for example, svg implies svg:svg) - */ - append(type: string): Selection; - /** - * Appends a new element of the type provided by the element creator function as the last child of each selected element, - * or the next following sibling in the update selection if this is an enter selection. - * (The enter behavior allows you to insert elements into the DOM in an order consistent with bound data; - * however, the slower selection.order may still be required if updating elements change order.) - * - * This method returns a new selection containing the appended elements. - * Each new element inherits the data of the current elements, if any. - * - * The generic refers to the type of the child element to be appended. - * - * @param type A creator function which is evaluated for each selected element, in order, being passed the current datum (d), - * the current index (i), and the current group (nodes), with this as the current DOM element. This function should return - * an element to be appended. (The function typically creates a new element, but it may instead return an existing element.) - */ - append(type: ValueFn): Selection; - - /** - * Inserts a new element of the specified type (tag name) before the element matching the specified "before" - * selector string for each selected element. - * - * This method returns a new selection containing the appended elements. - * Each new element inherits the data of the current elements, if any. - * - * The generic refers to the type of the child element to be appended. - * - * @param type One of: - * * A string representing the tag name for the element type to be inserted. The specified name may have a namespace prefix, - * such as svg:text to specify a text attribute in the SVG namespace. If no namespace is specified, the namespace will be inherited - * from the parent element; or, if the name is one of the known prefixes, the corresponding namespace will be used - * (for example, svg implies svg:svg) - * * A creator function which is evaluated for each selected element, in order, being passed the current datum (d), - * the current index (i), and the current group (nodes), with this as the current DOM element. This function should return - * an element to be inserted. (The function typically creates a new element, but it may instead return an existing element.) - * @param before One of: - * * A CSS selector string for the element before which the insertion should occur. - * * A child selector function which is evaluated for each selected element, in order, being passed the current datum (d), - * the current index (i), and the current group (nodes), with this as the current DOM element. This function should return the child element - * before which the element should be inserted. - */ - insert( - type: string | ValueFn, - before?: string | ValueFn - ): Selection; - - /** - * Removes the selected elements from the document. - * Returns this selection (the removed elements) which are now detached from the DOM. - */ - remove(): this; - - /** - * Returns a new selection merging this selection with the specified other selection. - * The returned selection has the same number of groups and the same parents as this selection. - * Any missing (null) elements in this selection are filled with the corresponding element, - * if present (not null), from the specified selection. (If the other selection has additional groups or parents, - * they are ignored.) - * - * This method is commonly used to merge the enter and update selections after a data-join. - * After modifying the entering and updating elements separately, you can merge the two selections and - * perform operations on both without duplicate code. - * - * This method is not intended for concatenating arbitrary selections, however: if both this selection - * and the specified other selection have (non-null) elements at the same index, this selection’s element - * is returned in the merge and the other selection’s element is ignored. - * - * @param other Selection to be merged. - */ - merge(other: Selection): Selection; - - /** - * Filters the selection, returning a new selection that contains only the elements for - * which the specified filter is true. - * - * The returned filtered selection preserves the parents of this selection, but like array.filter, - * it does not preserve indexes as some elements may be removed; use selection.select to preserve the index, if needed. - * - * @param selector A CSS selector string to match when filtering. - */ - filter(selector: string): Selection; - /** - * Filters the selection, returning a new selection that contains only the elements for - * which the specified filter is true. - * - * The returned filtered selection preserves the parents of this selection, but like array.filter, - * it does not preserve indexes as some elements may be removed; use selection.select to preserve the index, if needed. - * - * The generic refers to the type of element which will be selected after applying the filter, i.e. if the element types - * contained in a pre-filter selection are narrowed to a subset as part of the filtering. - * - * @param selector A CSS selector string to match when filtering. - */ - filter(selector: string): Selection; - /** - * Filter the selection, returning a new selection that contains only the elements for - * which the specified filter is true. - * - * The returned filtered selection preserves the parents of this selection, but like array.filter, - * it does not preserve indexes as some elements may be removed; use selection.select to preserve the index, if needed. - * - * @param selector A value function which is evaluated for each selected element, in order, being passed the current datum (d), - * the current index (i), and the current group (nodes), with this as the current DOM element. This function should return true - * for an element to be included, and false otherwise. - */ - filter(selector: ValueFn): Selection; - /** - * Filter the selection, returning a new selection that contains only the elements for - * which the specified filter is true. - * - * The returned filtered selection preserves the parents of this selection, but like array.filter, - * it does not preserve indexes as some elements may be removed; use selection.select to preserve the index, if needed. - * - * @param selector A value function which is evaluated for each selected element, in order, being passed the current datum (d), - * the current index (i), and the current group (nodes), with this as the current DOM element. This function should return true - * for an element to be included, and false otherwise. - */ - filter(selector: ValueFn): Selection; - - /** - * Return a new selection that contains a copy of each group in this selection sorted according - * to the compare function. After sorting, re-inserts elements to match the resulting order (per selection.order). - * - * Note that sorting is not guaranteed to be stable; however, it is guaranteed to have the same - * behavior as your browser’s built-in sort method on arrays. - * - * @param comparator An optional comparator function, which defaults to "ascending". The function is passed - * two elements’ data a and b to compare. It should return either a negative, positive, or zero value. - * If negative, then a should be before b; if positive, then a should be after b; otherwise, a and b are - * considered equal and the order is arbitrary. - */ - sort(comparator?: (a: Datum, b: Datum) => number): this; - - /** - * Re-insert elements into the document such that the document order of each group matches the selection order. - * This is equivalent to calling selection.sort if the data is already sorted, but much faster. - */ - order(): this; - - /** - * Re-insert each selected element, in order, as the last child of its parent. - */ - raise(): this; - - /** - * Re-insert each selected element, in order, as the first child of its parent. - */ - lower(): this; - - - // Data Join --------------------------------- - - /** - * Returns the bound datum for the first (non-null) element in the selection. - * This is generally useful only if you know the selection contains exactly one element. - */ - datum(): Datum; - /** - * Delete the bound data for each element in the selection. - */ - datum(value: null): Selection; - /** - * Sets the element’s bound data using the specified value function on all selected elements. - * Unlike selection.data, this method does not compute a join and does not affect - * indexes or the enter and exit selections. - * - * The generic refers to the type of the new datum to be used for the selected elements. - * - * @param value A value function which is evaluated for each selected element, in order, - * being passed the current datum (d), the current index (i), and the current group (nodes), - * with this as the current DOM element. The function is then used to set each element’s new data. - * A null value will delete the bound data. - */ - datum(value: ValueFn): Selection; - /** - * Sets the element’s bound data to the specified value on all selected elements. - * Unlike selection.data, this method does not compute a join and does not affect - * indexes or the enter and exit selections. - * - * The generic refers to the type of the new datum to be used for the selected elements. - * - * @param value A value object to be used as the datum for each element. - */ - datum(value: NewDatum): Selection; - - /** - * Returns the array of data for the selected elements. - */ - data(): Datum[]; - /** - * Joins the specified array of data with the selected elements, returning a new selection that it represents - * the update selection: the elements successfully bound to data. Also defines the enter and exit selections on - * the returned selection, which can be used to add or remove elements to correspond to the new data. - * - * The data is specified for each group in the selection. If the selection has multiple groups - * (such as d3.selectAll followed by selection.selectAll), then data should typically be specified as a function. - * - * If a key function is not specified, then the first datum in data is assigned to the first selected element, - * the second datum to the second selected element, and so on. - * A key function may be specified to control which datum is assigned to which element, replacing the default join-by-index. - * - * The update and enter selections are returned in data order, while the exit selection preserves the selection - * order prior to the join. If a key function is specified, the order of elements in the selection may not match - * their order in the document; use selection.order or selection.sort as needed. - * - * This method cannot be used to clear bound data; use selection.datum instead. - * - * For details see: {@link https://github.com/d3/d3-selection#joining-data } - * - * The generic refers to the type of the new datum to be used for the selected elements. - * - * @param data The specified data is an array of arbitrary values (e.g., numbers or objects). - * @param key An optional key function which is evaluated for each selected element, in order, being passed the - * current datum (d), the current index (i), and the current group (nodes), with this as the current DOM element. - * The key function is then also evaluated for each new datum in data, being passed the current datum (d), - * the current index (i), and the group’s new data, with this as the group’s parent DOM element. - * The datum for a given key is assigned to the element with the matching key. If multiple elements have the same key, - * the duplicate elements are put into the exit selection; if multiple data have the same key, the duplicate data are put into the enter selection. - */ - data(data: NewDatum[], key?: ValueFn): Selection; - /** - * Joins the data returned by the specified value function with the selected elements, returning a new selection that it represents - * the update selection: the elements successfully bound to data. Also defines the enter and exit selections on - * the returned selection, which can be used to add or remove elements to correspond to the new data. - * - * The data is specified for each group in the selection. - * - * If a key function is not specified, then the first datum in data is assigned to the first selected element, - * the second datum to the second selected element, and so on. - * A key function may be specified to control which datum is assigned to which element, replacing the default join-by-index. - * - * The update and enter selections are returned in data order, while the exit selection preserves the selection - * order prior to the join. If a key function is specified, the order of elements in the selection may not match - * their order in the document; use selection.order or selection.sort as needed. - * - * This method cannot be used to clear bound data; use selection.datum instead. - * - * For details see: {@link https://github.com/d3/d3-selection#joining-data } - * - * The generic refers to the type of the new datum to be used for the selected elements. - * - * @param data A value function which will be evaluated for each group in order, being passed the group’s parent datum - * (d, which may be undefined), the group index (i), and the selection’s parent nodes (nodes), - * with this as the group’s parent element. The function returns an array of values for each group. - * @param key An optional key function which is evaluated for each selected element, in order, being passed the - * current datum (d), the current index (i), and the current group (nodes), with this as the current DOM element. - * The key function is then also evaluated for each new datum in data, being passed the current datum (d), - * the current index (i), and the group’s new data, with this as the group’s parent DOM element. - * The datum for a given key is assigned to the element with the matching key. If multiple elements have the same key, - * the duplicate elements are put into the exit selection; if multiple data have the same key, the duplicate data are put into the enter selection. - */ - data(data: ValueFn, key?: ValueFn): Selection; - - /** - * Return the enter selection: placeholder nodes for each datum that had no corresponding DOM element - * in the selection. The enter selection is determined by selection.data, and is empty on a selection that - * is not joined to data. - */ - enter(): Selection; - - /** - * Return the exit selection: existing DOM elements in the selection for which no new datum was found. - * The exit selection is determined by the previous selection.data, and is thus empty until the selection is - * joined to data. If the exit selection is retrieved more than once after a data join, subsequent calls return - * the empty selection. - * - * IMPORTANT: The generic refers to the type of the old datum associated with the exit selection elements. - * Ensure you set the generic to the correct type, if you need to access the data on the exit selection in - * follow-up steps, e.g. to set styles as part of an exit transition before removing them. - */ - exit(): Selection; - - // Event Handling ------------------- - - /** - * Return the currently-assigned listener for the specified event typename on the first (non-null) selected element, - * if any, If multiple typenames are specified, the first matching listener is returned. - * - * @param typenames The typenames is a string event type, such as click, mouseover, or submit; any DOM event type supported by your browser may be used. - * The type may be optionally followed by a period (.) and a name; the optional name allows multiple callbacks to be registered - * to receive events of the same type, such as click.foo and click.bar. To specify multiple typenames, separate typenames with spaces, - * such as "input change"" or "click.foo click.bar". - */ - on(typenames: string): ValueFn | undefined; - /** - * Remove a listener for the specified event type names. To remove all listeners for a given name, - * pass null as the listener and ".foo" as the typename, where foo is the name; to remove all listeners with no name, specify "." as the typename. - * - * @param typenames The typenames is a string event type, such as click, mouseover, or submit; any DOM event type supported by your browser may be used. - * The type may be optionally followed by a period (.) and a name; the optional name allows multiple callbacks to be registered - * to receive events of the same type, such as click.foo and click.bar. To specify multiple typenames, separate typenames with spaces, - * such as "input change"" or "click.foo click.bar". - * @param listener null to indicate removal of listener - */ - on(typenames: string, listener: null): this; - /** - * Add an event listener for the specified event type names. If an event listener was previously registered for the same typename - * on a selected element, the old listener is removed before the new listener is added. - * - * When a specified event is dispatched on a selected node, the specified listener will be evaluated for each selected element. - * - * An optional capture flag may be specified which corresponds to the W3C useCapture flag: - * “After initiating capture, all events of the specified type will be dispatched to the registered EventListener before being - * dispatched to any EventTargets beneath them in the tree. Events which are bubbling upward through the tree will not - * trigger an EventListener designated to use capture.” - * - * @param typenames The typenames is a string event type, such as click, mouseover, or submit; any DOM event type supported by your browser may be used. - * The type may be optionally followed by a period (.) and a name; the optional name allows multiple callbacks to be registered - * to receive events of the same type, such as click.foo and click.bar. To specify multiple typenames, separate typenames with spaces, - * such as "input change"" or "click.foo click.bar". - * @param listener A listener function which will be evaluated for each selected element, being passed the current datum (d), the current index (i), - * and the current group (nodes), with this as the current DOM element. Listeners always see the latest datum for their element, - * but the index is a property of the selection and is fixed when the listener is assigned; to update the index, re-assign the listener. - * To access the current event within a listener, use d3.event. - * @param capture An optional capture flag which corresponds to the W3C useCapture flag. - */ - on(typenames: string, listener: ValueFn, capture?: boolean): this; - - /** - * Dispatches a custom event of the specified type to each selected element, in order. - * An optional parameters map may be specified to set additional properties of the event. - * - * @param type Name of event to dispatch - * @param parameters An optional value map with custom event parameters - */ - dispatch(type: string, parameters?: CustomEventParameters): this; - /** - * Dispatches a custom event of the specified type to each selected element, in order. - * An optional value function returning a parameters map for each element in the selection may be specified to set additional properties of the event. - * - * @param type Name of event to dispatch - * @param parameters A value function which is evaluated for each selected element, in order, - * being passed the current datum (d), the current index (i), and the current group (nodes), - * with this as the current DOM element. It must return the parameters map for the current element. - */ - dispatch(type: string, parameters?: ValueFn): this; - - // Control Flow ---------------------- - - /** - * Invoke the specified function for each selected element, passing in the current datum (d), - * the current index (i), and the current group (nodes), with this of the current DOM element. - * This method can be used to invoke arbitrary code for each selected element, and is useful for creating a context to access parent and child data simultaneously. - * - * @param func A function which is invoked for each selected element, - * being passed the current datum (d), the current index (i), and the current group (nodes), with this of the current DOM element. - */ - each(func: ValueFn): this; - - /** - * Invoke the specified function exactly once, passing in this selection along with any optional arguments. - * Returns this selection. - * - * @param func A function which is passed this selection as the first argument along with any optional arguments. - * @param args List of optional arguments to be passed to the callback function. - */ - call(func: (selection: Selection, ...args: any[]) => void, ...args: any[]): this; - - /** - * Return true if this selection contains no (non-null) elements. - */ - empty(): boolean; - - /** - * Return the first (non-null) element in this selection. If the selection is empty, returns null. - */ - node(): GElement | null; - - /** - * Return an array of all (non-null) elements in this selection. - */ - nodes(): GElement[]; - - /** - * Returns the total number of elements in this selection. - */ - size(): number; - - -} - -/** - * Selects the root element, document.documentElement. This function can also be used to test for selections - * (instanceof d3.selection) or to extend the selection prototype. - */ -type SelectionFn = () => Selection; - -/** - * Selects the root element, document.documentElement. This function can also be used to test for selections - * (instanceof d3.selection) or to extend the selection prototype. - */ -export var selection: SelectionFn; - - -// --------------------------------------------------------------------------- -// on.js event and customEvent related -// --------------------------------------------------------------------------- - -/** - * A D3 Base Event - */ -interface BaseEvent { - /** - * Event type - */ - type: string; - /** - * The prior value of d3.event, allowing custom events to retain a reference to the originating native event. - */ - sourceEvent?: any; // Could be of all sorts of types, too general: BaseEvent | Event | MouseEvent | TouchEvent | ... | OwnCustomEventType; -} - -/** - * The current event, if any. This is set during the invocation of an event listener, and is reset after the listener terminates. - * Use this to access standard event fields such as event.timeStamp and methods such as event.preventDefault. - * While you can use the native event.pageX and event.pageY, it is often more convenient to transform the event position to - * the local coordinate system of the container that received the event using d3.mouse, d3.touch or d3.touches. - * - * If you use Babel, Webpack, or another ES6-to-ES5 bundler, be aware that the value of d3.event changes during an event! - * An import of d3.event must be a live binding, so you may need to configure the bundler to import from D3’s ES6 modules - * rather than from the generated UMD bundle; not all bundlers observe jsnext:main. - * Also beware of conflicts with the window.event global. - */ -export var event: any; // Could be of all sorts of types, too general: BaseEvent | Event | MouseEvent | TouchEvent | ... | OwnCustomEventType; - -/** - * Invokes the specified listener, using the specified "that" as "this" context and passing the specified arguments, if any. - * During the invocation, d3.event is set to the specified event; after the listener returns (or throws an error), - * d3.event is restored to its previous value. - * In addition, sets event.sourceEvent to the prior value of d3.event, allowing custom events to retain a reference to the originating native event. - * Returns the value returned by the listener. - * - * The first generic "Context" refers to the "this" context type in which the listener will be invoked. - * The second generic "Result" specifies the return type of the listener. - * - * @param event The event to which d3.event will be set during the listener invocation. - * @param listener The event listener function to be invoked. This function will be invoked with the "this" context, provided - * by the "that" argument of customEvent(...). It will be passed all optional arguments passed to customEvent(...). The function returns - * a value corresponding to the type of the second generic type. - * @param that The "this"" context which will be used for the invocation of listener. - * @param args A list of optional arguments, which will be passed to listener. - */ -export function customEvent(event: BaseEvent, listener: (this: Context, ...args: any[]) => Result, that: Context, ...args: any[]): Result; - -// --------------------------------------------------------------------------- -// mouse.js related -// --------------------------------------------------------------------------- - -/** - * Get (x, y)-coordinates of the current event relative to the specified container element. - * The container may be an HTML or SVG container element, such as a G element or an SVG element. - * The coordinates are returned as a two-element array of numbers [x, y]. - * - * @param container Container element relative to which coordinates are calculated. - */ -export function mouse(container: ContainerElement): [number, number]; - -// --------------------------------------------------------------------------- -// touch.js and touches.js related -// --------------------------------------------------------------------------- - -/** - * Returns the x and y coordinates of the touch with the specified identifier associated - * with the current event relative to the specified container. - * The container may be an HTML or SVG container element, such as a G element or an SVG element. - * The coordinates are returned as a two-element array of numbers [x, y] or null if there is no touch with - * the specified identifier in touches, returns null; this can be useful for ignoring touchmove events - * where the only some touches have moved. - * - * If touches is not specified, it defaults to the current event’s changedTouches property. - * - * @param container Container element relative to which coordinates are calculated. - * @param identifier Touch Identifier associated with the current event. - */ -export function touch(container: ContainerElement, identifier: number): [number, number] | null; - -/** - * Return the x and y coordinates of the touch with the specified identifier associated - * with the current event relative to the specified container. - * The container may be an HTML or SVG container element, such as a G element or an SVG element. - * The coordinates are returned as a two-element array of numbers [x, y] or null if there is no touch with - * the specified identifier in touches, returns null; this can be useful for ignoring touchmove events - * where the only some touches have moved. - * - * If touches is not specified, it defaults to the current event’s changedTouches property. - * - * @param container Container element relative to which coordinates are calculated. - * @param touches TouchList to be used when identifying the touch. - * @param identifier Touch Identifier associated with the current event. - */ -export function touch(container: ContainerElement, touches: TouchList, identifier: number): [number, number] | null; - -/** - * Return the x and y coordinates of the touches associated with the current event relative to the specified container. - * The container may be an HTML or SVG container element, such as a G element or an SVG element. - * The coordinates are returned as an array of two-element arrays of numbers [[x1, y1], [x2, y2], …]. - * - * If touches is not specified, it defaults to the current event’s touches property. - * - * @param container Container element relative to which coordinates are calculated. - * @param touches TouchList to be used. - */ -export function touches(container: ContainerElement, touches?: TouchList): Array<[number, number]>; - -// --------------------------------------------------------------------------- -// local.js related -// --------------------------------------------------------------------------- - - -export interface Local { - /** - * Retrieves a local variable stored on the node (or one of its parents). - * - * @param node A node element. - */ - get(node: Element): T | undefined; - /** - * Deletes the value associated with the given node. Values stored on ancestors are not affected, meaning that child nodes will still see inherited values. - * - * This function returns true if there was a value stored directly on the node, and false otherwise. - * - * @param node A node element. - */ - remove(node: Element): boolean; - /** - * Store a value for this local variable. Calling `.get()` on children of this node will also retrieve the variable's value. - * - * @param node A node element. - * @param value Value to store locally - */ - set(node: Element, value: T): Element; - /** - * Obtain a string with the internally assigned property name for the local - * which is used to store the value on a node - */ - toString(): string; -} - -/** - * Obtain a new local variable - * - * The generic refers to the type of the variable to store locally. - */ -export function local(): Local; - -// --------------------------------------------------------------------------- -// namespace.js related -// --------------------------------------------------------------------------- - -/** - * Interface for object literal containing local name with related fully qualified namespace - */ -export interface NamespaceLocalObject { - /** - * Fully qualified namespace - */ - space: string; - /** - * Name of the local to be namespaced. - */ - local: string; -} - -/** - * Obtain an object with properties of fully qualified namespace string and - * name of local by parsing a shorthand string "prefix:local". If the prefix - * does not exist in the "namespaces" object provided by d3-selection, then - * the local name is returned as a simple string. - * - * @param prefixedLocal A string composed of the namespace prefix and local - * name separated by colon, e.g. "svg:text". - */ -export function namespace(prefixedLocal: string): NamespaceLocalObject | string; - - -// --------------------------------------------------------------------------- -// namespaces.js related -// --------------------------------------------------------------------------- - -/** - * Interface for maps of namespace prefixes to corresponding fully qualified namespace strings - */ -export interface NamespaceMap { [prefix: string]: string; } - -/** - * Map of namespace prefixes to corresponding fully qualified namespace strings - */ -export var namespaces: NamespaceMap; - - -// --------------------------------------------------------------------------- -// window.js related -// --------------------------------------------------------------------------- - -/** - * Returns the owner window for the specified node. If node is a node, returns the owner document’s default view; - * if node is a document, returns its default view; otherwise returns the node. - * - * @param DOMNode A DOM element - */ -export function window(DOMNode: Window | Document | Element): Window; - - -// --------------------------------------------------------------------------- -// creator.js and matcher.js Complex helper closure generating functions -// for explicit bound-context dependent use -// --------------------------------------------------------------------------- - - -/** - * Given the specified element name, returns a function which creates an element of the given name, - * assuming that "this" is the parent element. - * - * The generic refers to the type of the new element to be returned by the creator function. - * - * @param name Tag name of the element to be added. See "namespace" for details on supported namespace prefixes, - * such as for SVG elements. - */ -export function creator(name: string): (this: BaseType) => NewGElement; - -/** - * Given the specified selector, returns a function which returns true if "this" element matches the specified selector. - * - * @param selector A CSS selector string. - */ -export function matcher(selector: string): (this: BaseType) => boolean; - -// ---------------------------------------------------------------------------- -// selector.js and selectorAll.js related functions -// ---------------------------------------------------------------------------- - -/** - * Given the specified selector, returns a function which returns the first descendant of "this" element - * that matches the specified selector. - * - * The generic refers to the type of the returned descendant element. - * - * @param selector A CSS selector string. - */ -export function selector(selector: string): (this: BaseType) => DescElement; - -/** - * Given the specified selector, returns a function which returns all descendants of "this" element that match the specified selector. - * - * The generic refers to the type of the returned descendant element. - * - * @param selector A CSS selector string. - */ -export function selectorAll(selector: string): (this: BaseType) => NodeListOf; diff --git a/d3-selection/tslint.json b/d3-selection/tslint.json deleted file mode 100644 index 68d10d72a6..0000000000 --- a/d3-selection/tslint.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "../tslint.json", - "rules": { - "unified-signatures": false - } -} diff --git a/d3-shape/index.d.ts b/d3-shape/index.d.ts deleted file mode 100644 index 367a9dee2b..0000000000 --- a/d3-shape/index.d.ts +++ /dev/null @@ -1,2331 +0,0 @@ -// Type definitions for D3JS d3-shape module 1.0 -// Project: https://github.com/d3/d3-shape/ -// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -// Last module patch version validated against: 1.0.4 - -import { Path } from 'd3-path'; - -// ----------------------------------------------------------------------------------- -// Arc Generator -// ----------------------------------------------------------------------------------- - -/** - * Interface corresponding to the minimum data type assumed by the accessor functions of the Arc generator - */ -export interface DefaultArcObject { - /** - * Inner radius of arc. - */ - innerRadius: number; - /** - * Outer radius of arc. - */ - outerRadius: number; - /** - * Start angle of arc. The angle is specified in radians, with 0 at -y (12 o’clock) and positive angles proceeding clockwise. - */ - startAngle: number; - /** - * End angle of arc. The angle is specified in radians, with 0 at -y (12 o’clock) and positive angles proceeding clockwise. - */ - endAngle: number; - /** - * Pad angle of arcin radians. - */ - padAngle: number; -} - -/** - * The arc generator produces a circular or annular sector, as in a pie or donut chart. - * - * If the difference between the start and end angles (the angular span) is greater than τ, the arc generator will produce a complete circle or annulus. - * If it is less than τ, arcs may have rounded corners and angular padding. Arcs are always centered at ⟨0,0⟩; use a transform (see: SVG, Canvas) to move the arc to a different position. - * - * See also the pie generator, which computes the necessary angles to represent an array of data as a pie or donut chart; these angles can then be passed to an arc generator. - * - * The first generic corresponds to the type of the "this" context within which the arc generator and its accessor functions will be invoked. - * - * The second generic corresponds to the datum type for which the arc is to be generated. - */ -export interface Arc { - /** - * Generates an arc for the given arguments. - * - * IMPORTANT: If the rendering context of the arc generator is null, - * then the arc is returned as a path data string. - * - * The "this" context within which this function is invoked, will be the context within which the accessor methods of the generator are invoked. - * All arguments passed into this function, will be passed to the accessor functions of the generator. - * - * @param d The datum for which the arc is to be generated. - */ - (this: This, d: Datum, ...args: any[]): string | null; - /** - * Generates an arc for the given arguments. - * - * IMPORTANT: If the arc generator has been configured with a rendering context, - * then the arc is rendered to this context as a sequence of path method calls and this function returns void. - * - * The "this" context within which this function is invoked, will be the context within which the accessor methods of the generator are invoked. - * All arguments passed into this function, will be passed to the accessor functions of the generator. - * - * @param d The datum for which the arc is to be generated. - */ - (this: This, d: Datum, ...args: any[]): void; - - /** - * Computes the midpoint [x, y] of the center line of the arc that would be generated by the given arguments. - * - * To be consistent with the generated arc, the accessors must be deterministic, i.e., return the same value given the same arguments. - * The midpoint is defined as (startAngle + endAngle) / 2 and (innerRadius + outerRadius) / 2. - * - * Note that this is not the geometric center of the arc, which may be outside the arc; - * this method is merely a convenience for positioning labels. - * - * The method is invoked in the same "this" context as the generator was invoked in and - * receives the same arguments that are passed into the arc generator. - * - * @param d The datum for which the arc is to be generated. - */ - centroid(d: Datum, ...args: any[]): [number, number]; - - /** - * Returns the current inner radius accessor, which defaults to a function returning the innerRadius property - * of the first argument passed into it. - */ - innerRadius(): (this: This, d: Datum, ...args: any[]) => number; - /** - * Sets the inner radius to the specified number and returns this arc generator. - * - * Specifying the inner radius as a function is useful for constructing a stacked polar bar chart, often in conjunction with a sqrt scale. - * More commonly, a constant inner radius is used for a donut or pie chart. If the outer radius is smaller than the inner radius, the inner and outer radii are swapped. - * A negative value is treated as zero. - * - * @param radius Constant radius. - */ - innerRadius(radius: number): this; - /** - * Sets the inner radius to the specified function and returns this arc generator. - * - * Specifying the inner radius as a function is useful for constructing a stacked polar bar chart, often in conjunction with a sqrt scale. - * More commonly, a constant inner radius is used for a donut or pie chart. If the outer radius is smaller than the inner radius, the inner and outer radii are swapped. - * A negative value is treated as zero. - * - * @param radius An accessor function returning a number to be used as a radius. The accessor function is invoked in the same "this" context as the generator was invoked in and - * receives the same arguments that were passed into the arc generator. - */ - innerRadius(radius: (this: This, d: Datum, ...args: any[]) => number): this; - - /** - * Returns the current outer radius accessor, which defaults to a function returning the outerRadius property - * of the first argument passed into it. - */ - outerRadius(): (this: This, d: Datum, ...args: any[]) => number; - /** - * Sets the outer radius to the specified number and returns this arc generator. - * - * Specifying the outer radius as a function is useful for constructing a coxcomb or polar bar chart, - * often in conjunction with a sqrt scale. More commonly, a constant outer radius is used for a pie or donut chart. - * If the outer radius is smaller than the inner radius, the inner and outer radii are swapped. - * A negative value is treated as zero. - * - * @param radius Constant radius. - */ - outerRadius(radius: number): this; - /** - * Sets the outer radius to the specified function and returns this arc generator. - * - * Specifying the outer radius as a function is useful for constructing a coxcomb or polar bar chart, - * often in conjunction with a sqrt scale. More commonly, a constant outer radius is used for a pie or donut chart. - * If the outer radius is smaller than the inner radius, the inner and outer radii are swapped. - * A negative value is treated as zero. - * - * @param radius An accessor function returning a number to be used as a radius. The accessor function is invoked in the same "this" context as the generator was invoked in and - * receives the same arguments that were passed into the arc generator. - */ - outerRadius(radius: (this: This, d: Datum, ...args: any[]) => number): this; - - /** - * Returns the current corner radius accessor, which defaults to a function returning a constant value of zero. - */ - cornerRadius(): (this: This, d: Datum, ...args: any[]) => number; - /** - * Sets the corner radius to the specified number and returns this arc generator. - * - * If the corner radius is greater than zero, the corners of the arc are rounded using circles of the given radius. - * For a circular sector, the two outer corners are rounded; for an annular sector, all four corners are rounded. - * - * The corner radius may not be larger than (outerRadius - innerRadius) / 2. - * In addition, for arcs whose angular span is less than π, the corner radius may be reduced as two adjacent rounded corners intersect. - * This is occurs more often with the inner corners. - * - * @param radius Constant radius. - */ - cornerRadius(radius: number): this; - /** - * Sets the corner radius to the specified function and returns this arc generator. - * - * The corner radius may not be larger than (outerRadius - innerRadius) / 2. - * In addition, for arcs whose angular span is less than π, the corner radius may be reduced as two adjacent rounded corners intersect. - * This is occurs more often with the inner corners. - * - * @param radius An accessor function returning a number to be used as a radius. The accessor function is invoked in the same "this" context as the generator was invoked in and - * receives the same arguments that were passed into the arc generator. - */ - cornerRadius(radius: (this: This, d: Datum, ...args: any[]) => number): this; - - /** - * Returns the current start angle accessor, which defaults to a function returning the startAngle property - * of the first argument passed into it. - */ - startAngle(): (this: This, d: Datum, ...args: any[]) => number; - /** - * Sets the start angle to the specified number and returns this arc generator. - * - * The angle is specified in radians, with 0 at -y (12 o’clock) and positive angles proceeding clockwise. - * If |endAngle - startAngle| ≥ τ, a complete circle or annulus is generated rather than a sector. - * - * @param angle Constant angle in radians. - */ - startAngle(angle: number): this; - /** - * Sets the start angle to the specified function and returns this arc generator. - * - * The angle is specified in radians, with 0 at -y (12 o’clock) and positive angles proceeding clockwise. - * If |endAngle - startAngle| ≥ τ, a complete circle or annulus is generated rather than a sector. - * - * @param angle An accessor function returning a number in radians to be used as an angle. The accessor function is invoked in the same "this" context as the generator was invoked in and - * receives the same arguments that were passed into the arc generator. - */ - startAngle(angle: (this: This, d: Datum, ...args: any[]) => number): this; - - /** - * Returns the current end angle accessor, which defaults to a function returning the endAngle property - * of the first argument passed into it. - */ - endAngle(): (this: This, d: Datum, ...args: any[]) => number; - /** - * Sets the end angle to the specified number and returns this arc generator. - * - * The angle is specified in radians, with 0 at -y (12 o’clock) and positive angles proceeding clockwise. - * If |endAngle - startAngle| ≥ τ, a complete circle or annulus is generated rather than a sector. - * - * @param angle Constant angle in radians. - */ - endAngle(angle: number): this; - /** - * Sets the end angle to the specified function and returns this arc generator. - * - * The angle is specified in radians, with 0 at -y (12 o’clock) and positive angles proceeding clockwise. - * If |endAngle - startAngle| ≥ τ, a complete circle or annulus is generated rather than a sector. - * - * @param angle An accessor function returning a number in radians to be used as an angle. The accessor function is invoked in the same "this" context as the generator was invoked in and - * receives the same arguments that were passed into the arc generator. - */ - endAngle(angle: (this: This, d: Datum, ...args: any[]) => number): this; - - /** - * Returns the current pad angle accessor, which defaults to a function returning the padAngle property - * of the first argument passed into it, or false if no data are passed in or the property is not defined. - */ - padAngle(): (this: This, d: Datum, ...args: any[]) => number; - /** - * Sets the pad angle to the specified number and returns this arc generator. - * - * The pad angle is converted to a fixed linear distance separating adjacent arcs, defined as padRadius * padAngle. This distance is subtracted equally from the start and end of the arc. - * If the arc forms a complete circle or annulus, as when |endAngle - startAngle| ≥ τ, the pad angle is ignored. If the inner radius or angular span is small relative to the pad angle, - * it may not be possible to maintain parallel edges between adjacent arcs. In this case, the inner edge of the arc may collapse to a point, similar to a circular sector. - * For this reason, padding is typically only applied to annular sectors (i.e., when innerRadius is positive). - * - * The recommended minimum inner radius when using padding is outerRadius * padAngle / sin(θ), where θ is the angular span of the smallest arc before padding. - * For example, if the outer radius is 200 pixels and the pad angle is 0.02 radians, a reasonable θ is 0.04 radians, and a reasonable inner radius is 100 pixels. - * - * Often, the pad angle is not set directly on the arc generator, but is instead computed by the pie generator so as to ensure that the area of padded arcs is proportional to their value; - * see pie.padAngle. See the pie padding animation for illustration. - * If you apply a constant pad angle to the arc generator directly, it tends to subtract disproportionately from smaller arcs, introducing distortion. - * - * @param angle Constant angle in radians. - */ - padAngle(angle: number): this; - /** - * Sets the pad angle to the specified function and returns this arc generator. - * - * The pad angle is converted to a fixed linear distance separating adjacent arcs, defined as padRadius * padAngle. This distance is subtracted equally from the start and end of the arc. - * If the arc forms a complete circle or annulus, as when |endAngle - startAngle| ≥ τ, the pad angle is ignored. If the inner radius or angular span is small relative to the pad angle, - * it may not be possible to maintain parallel edges between adjacent arcs. In this case, the inner edge of the arc may collapse to a point, similar to a circular sector. - * For this reason, padding is typically only applied to annular sectors (i.e., when innerRadius is positive). - * - * The recommended minimum inner radius when using padding is outerRadius * padAngle / sin(θ), where θ is the angular span of the smallest arc before padding. - * For example, if the outer radius is 200 pixels and the pad angle is 0.02 radians, a reasonable θ is 0.04 radians, and a reasonable inner radius is 100 pixels. - * - * Often, the pad angle is not set directly on the arc generator, but is instead computed by the pie generator so as to ensure that the area of padded arcs is proportional to their value; - * see pie.padAngle. See the pie padding animation for illustration. - * If you apply a constant pad angle to the arc generator directly, it tends to subtract disproportionately from smaller arcs, introducing distortion. - * - * @param angle An accessor function returning a number in radians to be used as an angle. The accessor function is invoked in the same "this" context as the generator was invoked in and - * receives the same arguments that were passed into the arc generator. - */ - padAngle(angle: (this: This, d: Datum, ...args: any[]) => number): this; - - /** - * Returns the current pad radius accessor, which defaults to null, indicating that the pad radius should be automatically computed as sqrt(innerRadius * innerRadius + outerRadius * outerRadius). - */ - padRadius(): ((this: This, d: Datum, ...args: any[]) => number) | null; - /** - * Sets the pad radius to null indicating that the pad radius should be automatically computed as sqrt(innerRadius * innerRadius + outerRadius * outerRadius), and returns this arc generator. - * - * The pad radius determines the fixed linear distance separating adjacent arcs, defined as padRadius * padAngle. - * - * @param radius null to set automatic pad radius calculation. - */ - padRadius(radius: null): this; - /** - * Sets the pad radius to the specified number, and returns this arc generator. - * - * The pad radius determines the fixed linear distance separating adjacent arcs, defined as padRadius * padAngle. - * - * @param radius A constant radius. - */ - padRadius(radius: number): this; - - /* - * Sets the pad radius to the specified function, and returns this arc generator. - * - * @param radius An accessor function returning a number to be used as a radius. The accessor function is invoked in the same "this" context as the generator was invoked in and - * receives the same arguments that were passed into the arc generator. - */ - padRadius(radius: (this: This, d: Datum, ...args: any[]) => number): this; - - /** - * Returns the current rendering context, which defaults to null. - */ - context(): CanvasRenderingContext2D | null; - /** - * Sets the rendering context and returns this arc generator. - * - * If the context is not null, then the generated arc is rendered to this context as a sequence of path method calls. - * - * @param context The rendering context. - */ - context(context: CanvasRenderingContext2D): this; - /** - * Sets the rendering context to null and returns this arc generator. - * - * A path data string representing the generated arc will be returned when the generator is invoked with data. - * - * @param context null, to remove rendering context. - */ - context(context: null): this; -} - -/** - * Constructs a new arc generator with the default settings. - * - * Ensure that the accessors used with the arc generator correspond to the arguments passed into them, - * or set them to constants as appropriate. - */ -export function arc(): Arc; -/** - * Constructs a new arc generator with the default settings. - * - * Ensure that the accessors used with the arc generator correspond to the arguments passed into them, - * or set them to constants as appropriate. - * - * The generic corresponds to the datum type representing a arc. - */ -export function arc(): Arc; -/** - * Constructs a new arc generator with the default settings. - * - * Ensure that the accessors used with the arc generator correspond to the arguments passed into them, - * or set them to constants as appropriate. - * - * The first generic corresponds to the type of the "this" context within which the arc generator and its accessor functions will be invoked. - * - * The second generic corresponds to the datum type representing a arc. - */ -export function arc(): Arc; - -// ----------------------------------------------------------------------------------- -// Pie Generator -// ----------------------------------------------------------------------------------- - -/** - * Element of the Arc Datums Array created by invoking the Pie generator. - * - * The generic refers to the data type of an element in the input array passed into the Pie generator. - */ -export interface PieArcDatum { - /** - * The input datum; the corresponding element in the input data array of the Pie generator - */ - data: T; - /** - * The numeric value of the arc. - */ - value: number; - /** - * The zero-based sorted index of the arc. - */ - index: number; - /** - * The start angle of the arc. - * If the pie generator was configured to be used for the arc generator, - * then the units are in radians with 0 at -y (12 o’clock) and positive angles proceeding clockwise. - */ - startAngle: number; - /** - * The end angle of the arc. - * If the pie generator was configured to be used for the arc generator, - * then the units are in radians with 0 at -y (12 o’clock) and positive angles proceeding clockwise. - */ - endAngle: number; - /** - * The pad angle of the arc. If the pie generator was configured to be used for the arc generator, than the units are in radians. - */ - padAngle: number; -} - -/** - * The pie generator does not produce a shape directly, but instead computes the necessary angles to represent a tabular dataset as a pie or donut chart; - * these angles can then be passed to an arc generator. - * - * The first generic corresponds to the type of the "this" context within which the pie generator and its accessor functions will be invoked. - * - * The second generic refers to the data type of an element in the input array passed into the Pie generator. - */ -export interface Pie { - /** - * Generates a pie for the given array of data, returning an array of objects representing each datum’s arc angles. - * Any additional arguments are arbitrary; they are simply propagated to the pie generator’s accessor functions along with the this object. - * The length of the returned array is the same as data, and each element i in the returned array corresponds to the element i in the input data. - * - * This representation is designed to work with the arc generator’s default startAngle, endAngle and padAngle accessors. - * The angular units are arbitrary, but if you plan to use the pie generator in conjunction with an arc generator, - * you should specify angles in radians, with 0 at -y (12 o’clock) and positive angles proceeding clockwise. - * - * @param data Array of data elements. - */ - (this: This, data: Datum[], ...args: any[]): Array>; - - /** - * Returns the current value accessor, which defaults to a function returning the first argument passed into it. - * The default value accessor assumes that the input data are numbers, or that they are coercible to numbers using valueOf. - * - */ - value(): (d: Datum, i: number, data: Datum[]) => number; - /** - * Sets the value accessor to use the specified constant number and returns this pie generator. - * - * @param value Constant value to be used. - */ - value(value: number): this; - /** - * Sets the value accessor to use the specified function and returns this pie generator. - * - * When a pie is generated, the value accessor will be invoked for each element in the input data array. - * The default value accessor assumes that the input data are numbers, or that they are coercible to numbers using valueOf. - * If your data are not simply numbers, then you should specify an accessor that returns the corresponding numeric value for a given datum. - * - * - * @param value A value accessor function, which is invoked for each element in the input data array, being passed the element d, the index i, and the array data as three arguments. - * It returns a numeric value. - */ - value(value: (d: Datum, i: number, data: Datum[]) => number): this; - - /** - * Returns the current data comparator, which defaults to null. - */ - sort(): ((a: Datum, b: Datum) => number) | null; - /** - * Sets the data comparator to the specified function and returns this pie generator. - * - * If both the data comparator and the value comparator are null, then arcs are positioned in the original input order. - * Otherwise, the data is sorted according to the data comparator, and the resulting order is used. Setting the data comparator implicitly sets the value comparator to null. - * - * Sorting does not affect the order of the generated arc array which is always in the same order as the input data array; it merely affects the computed angles of each arc. - * The first arc starts at the start angle and the last arc ends at the end angle. - * - * @param comparator A compare function takes two arguments a and b, each elements from the input data array. - * If the arc for a should be before the arc for b, then the comparator must return a number less than zero; - * if the arc for a should be after the arc for b, then the comparator must return a number greater than zero; - * returning zero means that the relative order of a and b is unspecified. - */ - sort(comparator: (a: Datum, b: Datum) => number): this; - /** - * Sets the data comparator to null and returns this pie generator. - * - * If both the data comparator and the value comparator are null, then arcs are positioned in the original input order. - * - * @param comparator null, to set the pie generator to use the original input order or use the sortValues comparator, if any. - */ - sort(comparator: null): this; - - /** - * Returns the current value comparator, which defaults to descending value. - */ - sortValues(): ((a: number, b: number) => number) | null; - /** - * Sets the value comparator to the specified function and returns this pie generator. - * - * If both the data comparator and the value comparator are null, then arcs are positioned in the original input order. - * Otherwise, the data is sorted according to the data comparator, and the resulting order is used. - * Setting the value comparator implicitly sets the data comparator to null. - * - * Sorting does not affect the order of the generated arc array which is always in the same order as the input data array; - * it merely affects the computed angles of each arc. The first arc starts at the start angle and the last arc ends at the end angle. - * - * @param comparator The value comparator takes two arguments a and b which are values derived from the input data array using the value accessor, not the data elements. - * If the arc for a should be before the arc for b, then the comparator must return a number less than zero; - * if the arc for a should be after the arc for b, then the comparator must return a number greater than zero; returning zero means that the relative order of a and b is unspecified. - * - */ - sortValues(comparator: (a: number, b: number) => number): this; - /** - * Sets the value comparator to null and returns this pie generator. - * - * If both the data comparator and the value comparator are null, then arcs are positioned in the original input order. - * - * @param comparator null, to set the pie generator to use the original input order or use the data comparator, if any. - */ - sortValues(comparator: null): this; - - /** - * Returns the current start angle accessor, which defaults to a function returning a constant zero. - */ - startAngle(): (this: This, data: Datum[], ...args: any[]) => number; - /** - * Sets the overall start angle of the pie to the specified number and returns this pie generator. - * - * The default start angle is zero. - * - * The start angle here means the overall start angle of the pie, i.e., the start angle of the first arc. - * The start angle accessor is invoked once, being passed the same arguments and this context as the pie generator. - * The units of angle are arbitrary, but if you plan to use the pie generator in conjunction with an arc generator, - * you should specify an angle in radians, with 0 at -y (12 o’clock) and positive angles proceeding clockwise. - * - * @param angle A constant angle. - */ - startAngle(angle: number): this; - /** - * Sets the overall start angle of the pie to the specified function and returns this pie generator. - * - * The default start angle is zero. - * - * The start angle here means the overall start angle of the pie, i.e., the start angle of the first arc. - * The start angle accessor is invoked once, being passed the same arguments and this context as the pie generator. - * The units of angle are arbitrary, but if you plan to use the pie generator in conjunction with an arc generator, - * you should specify an angle in radians, with 0 at -y (12 o’clock) and positive angles proceeding clockwise. - * - * @param angle An angle accessor function, which is invoked once, being passed the same arguments and this context as the pie generator. - */ - startAngle(angle: (this: This, data: Datum[], ...args: any[]) => number): this; - - /** - * Returns the current end angle accessor, which defaults to a function returning a constant 2*pi. - */ - endAngle(): (this: This, data: Datum[], ...args: any[]) => number; - /** - * Sets the overall end angle of the pie to the specified number and returns this pie generator. - * - * The default end angle is 2*pi. - * - * The end angle here means the overall end angle of the pie, i.e., the end angle of the last arc. - * The units of angle are arbitrary, but if you plan to use the pie generator in conjunction with an arc generator, - * you should specify an angle in radians, with 0 at -y (12 o’clock) and positive angles proceeding clockwise. - * - * The value of the end angle is constrained to startAngle ± τ, such that |endAngle - startAngle| ≤ τ. - * - * @param angle A constant angle. - */ - endAngle(angle: number): this; - /** - * Sets the overall end angle of the pie to the specified function and returns this pie generator. - * - * The default end angle is 2*pi. - * - * The end angle here means the overall end angle of the pie, i.e., the end angle of the last arc. - * The end angle accessor is invoked once, being passed the same arguments and this context as the pie generator. - * The units of angle are arbitrary, but if you plan to use the pie generator in conjunction with an arc generator, - * you should specify an angle in radians, with 0 at -y (12 o’clock) and positive angles proceeding clockwise. - * - * The value of the end angle is constrained to startAngle ± τ, such that |endAngle - startAngle| ≤ τ. - * - * @param angle An angle accessor function, which is invoked once, being passed the same arguments and this context as the pie generator. - */ - endAngle(angle: (this: This, data: Datum[], ...args: any[]) => number): this; - - /** - * Returns the current pad angle accessor, which defaults to a function returning a constant zero. - */ - padAngle(): (this: This, data: Datum[], ...args: any[]) => number; - /** - * Sets the pad angle to the specified number and returns this pie generator. - * - * The pad angle here means the angular separation between each adjacent arc. - * The total amount of padding reserved is the specified angle times the number of elements in the input data array, and at most |endAngle - startAngle|; - * the remaining space is then divided proportionally by value such that the relative area of each arc is preserved. - * The units of angle are arbitrary, but if you plan to use the pie generator in conjunction with an arc generator, you should specify an angle in radians. - * - * @param angle A constant angle. - */ - padAngle(angle: number): this; - /** - * Sets the pad angle to the specified function and returns this pie generator. - * - * The pad angle here means the angular separation between each adjacent arc. - * The total amount of padding reserved is the specified angle times the number of elements in the input data array, and at most |endAngle - startAngle|; - * the remaining space is then divided proportionally by value such that the relative area of each arc is preserved. - * The pad angle accessor is invoked once, being passed the same arguments and this context as the pie generator. - * The units of angle are arbitrary, but if you plan to use the pie generator in conjunction with an arc generator, you should specify an angle in radians. - * - * @param angle An angle accessor function, which is invoked once, being passed the same arguments and this context as the pie generator. - */ - padAngle(angle: (this: This, data: Datum[], ...args: any[]) => number): this; -} - -/** - * Constructs a new pie generator with the default settings. - * - * Ensure that the accessors used with the pie generator correspond to the arguments passed into them, - * or set them to constants as appropriate. - */ -export function pie(): Pie; -/** - * Constructs a new pie generator with the default settings. - * - * Ensure that the accessors used with the pie generator correspond to the arguments passed into them, - * or set them to constants as appropriate. - * - * The generic refers to the data type of an element in the input array passed into the Pie generator. - */ -export function pie(): Pie; -/** - * Constructs a new pie generator with the default settings. - * - * Ensure that the accessors used with the pie generator correspond to the arguments passed into them, - * or set them to constants as appropriate. - * - * The first generic corresponds to the type of the "this" context within which the pie generator and its accessor functions will be invoked. - * - * The second generic refers to the data type of an element in the input array passed into the Pie generator. - */ -export function pie(): Pie; - -// ----------------------------------------------------------------------------------- -// Line Generators -// ----------------------------------------------------------------------------------- - -/** - * The line generator produces a spline or polyline, as in a line chart. - * Lines also appear in many other visualization types, such as the links in hierarchical edge bundling. - * - * The generic refers to the data type of an element in the input array passed into the line generator. - */ -export interface Line { - /** - * Generates a line for the given array of data. Depending on this line generator’s associated curve, - * the given input data may need to be sorted by x-value before being passed to the line generator. - * - * IMPORTANT: If the rendering context of the line generator is null, - * then the line is returned as a path data string. - * - * @param data Array of data elements. - */ - (data: Datum[]): string | null; - /** - * Generates a line for the given array of data. Depending on this line generator’s associated curve, - * the given input data may need to be sorted by x-value before being passed to the line generator. - * - * IMPORTANT: If the line generator has been configured with a rendering context, - * then the line is rendered to this context as a sequence of path method calls and this function returns void. - * - * @param data Array of data elements. - */ - (data: Datum[]): void; - - /** - * Returns the current x-coordinate accessor function, which defaults to a function returning first element of a two-element array of numbers. - */ - x(): (d: Datum, index: number, data: Datum[]) => number; - /** - * Sets the x accessor to the specified number and returns this line generator. - * - * @param x A constant x-coordinate value. - */ - x(x: number): this; - /** - * Sets the x accessor to the specified function and returns this line generator. - * - * When a line is generated, the x accessor will be invoked for each defined element in the input data array. - * - * The default x accessor assumes that the input data are two-element arrays of numbers. If your data are in a different format, or if you wish to transform the data before rendering, - * then you should specify a custom accessor. - * - * @param x A coordinate accessor function which returns the x-coordinate value. The x accessor will be invoked for each defined element in the input data array, - * being passed the element d, the index i, and the array data as three arguments. - */ - x(x: (d: Datum, index: number, data: Datum[]) => number): this; - - /** - * Returns the current y-coordinate accessor function, which defaults to a function returning second element of a two-element array of numbers. - */ - y(): (d: Datum, index: number, data: Datum[]) => number; - /** - * Sets the y accessor to the specified number and returns this line generator. - * - * @param y A constant y-coordinate value. - */ - y(y: number): this; - /** - * Sets the y accessor to the specified function and returns this line generator. - * - * When a line is generated, the y accessor will be invoked for each defined element in the input data array. - * - * The default y accessor assumes that the input data are two-element arrays of numbers. If your data are in a different format, or if you wish to transform the data before rendering, - * then you should specify a custom accessor. - * - * @param y A coordinate accessor function which returns the y-coordinate value. The y accessor will be invoked for each defined element in the input data array, - * being passed the element d, the index i, and the array data as three arguments. - */ - y(y: (d: Datum, index: number, data: Datum[]) => number): this; - - /** - * Returns the current defined accessor, which defaults to a function returning a constant boolean value of true. - */ - defined(): (d: Datum, index: number, data: Datum[]) => boolean; - /** - * Sets the defined accessor to the specified boolean and returns this line generator. - * - * The default accessor for defined returns a constant boolean value of true, thus assumes that the input data is always defined. - * - * When a line is generated, the defined accessor will be invoked for each element in the input data array, - * being passed the element d, the index i, and the array data as three arguments. - * If the given element is defined (i.e., if the defined accessor returns a truthy value for this element), - * the x and y accessors will subsequently be evaluated and the point will be added to the current line segment. - * Otherwise, the element will be skipped, the current line segment will be ended, and a new line segment will be generated for the next defined point. - * As a result, the generated line may have several discrete segments. - * - * Note that if a line segment consists of only a single point, it may appear invisible unless rendered with rounded or square line caps. - * In addition, some curves such as curveCardinalOpen only render a visible segment if it contains multiple points. - * - * @param defined A boolean constant - */ - defined(defined: boolean): this; - /** - * Sets the defined accessor to the specified function and returns this line generator. - * - * The default accessor for defined returns a constant boolean value of true, thus assumes that the input data is always defined. - * - * When a line is generated, the defined accessor will be invoked for each element in the input data array, - * being passed the element d, the index i, and the array data as three arguments. - * If the given element is defined (i.e., if the defined accessor returns a truthy value for this element), - * the x and y accessors will subsequently be evaluated and the point will be added to the current line segment. - * Otherwise, the element will be skipped, the current line segment will be ended, and a new line segment will be generated for the next defined point. - * As a result, the generated line may have several discrete segments. - * - * Note that if a line segment consists of only a single point, it may appear invisible unless rendered with rounded or square line caps. - * In addition, some curves such as curveCardinalOpen only render a visible segment if it contains multiple points. - * - * @param defined An accessor function which returns a boolean value. The accessor will be invoked for each defined element in the input data array, - * being passed the element d, the index i, and the array data as three arguments. - */ - defined(defined: (d: Datum, index: number, data: Datum[]) => boolean): this; - - /** - * Returns the current curve factory, which defaults to curveLinear. - */ - curve(): CurveFactory | CurveFactoryLineOnly; - /** - * Returns the current curve factory, which defaults to curveLinear. - * - * The generic allows to cast the curve factory to a specifc type, if known. - */ - curve(): C; - /** - * Sets the curve factory and returns this line generator. - * - * @param curve A valid curve factory. - */ - curve(curve: CurveFactory | CurveFactoryLineOnly): this; - - /** - * Returns the current rendering context, which defaults to null. - */ - context(): CanvasRenderingContext2D | null; - /** - * Sets the rendering context and returns this line generator. - * - * If the context is not null, then the generated line is rendered to this context as a sequence of path method calls. - * - * @param context The rendering context. - */ - context(context: CanvasRenderingContext2D): this; - /** - * Sets the rendering context to null and returns this line generator. - * - * A path data string representing the generated line will be returned when the generator is invoked with data. - * - * @param context null, to remove rendering context. - */ - context(context: null): this; -} - -/** - * Constructs a new line generator with the default settings. - * - * Ensure that the accessors used with the line generator correspond to the arguments passed into them, - * or set them to constants as appropriate. - */ -export function line(): Line<[number, number]>; -/** - * Constructs a new line generator with the default settings. - * - * Ensure that the accessors used with the line generator correspond to the arguments passed into them, - * or set them to constants as appropriate. - * - * The generic refers to the data type of an element in the input array passed into the line generator. - */ -export function line(): Line; - - -/** - * The radial line generator produces a spline or polyline, as in a line chart. - * - * A radial line generator is equivalent to the standard Cartesian line generator, - * except the x and y accessors are replaced with angle and radius accessors. - * Radial lines are always positioned relative to ⟨0,0⟩; use a transform (see: SVG, Canvas) to change the origin. - * - * The generic refers to the data type of an element in the input array passed into the line generator. - */ -export interface RadialLine { - /** - * Generates a radial line for the given array of data. Depending on this radial line generator’s associated curve, - * the given input data may need to be sorted by x-value before being passed to the line generator. - * - * IMPORTANT: If the rendering context of the radial line generator is null, - * then the radial line is returned as a path data string. - * - * @param data Array of data elements. - */ - (data: Datum[]): string | null; - /** - * Generates a radial line for the given array of data. Depending on this radial line generator’s associated curve, - * the given input data may need to be sorted by x-value before being passed to the radial line generator. - * - * IMPORTANT: If the radial line generator has been configured with a rendering context, - * then the radial line is rendered to this context as a sequence of path method calls and this function returns void. - * - * @param data Array of data elements. - */ - (data: Datum[]): void; - - /** - * Returns the current angle accessor function, which defaults to a function returning first element of a two-element array of numbers. - */ - angle(): (d: Datum, index: number, data: Datum[]) => number; - /** - * Sets the angle accessor to the specified number and returns this radial line generator. - * - * @param angle A constant angle value in radians, with 0 at -y (12 o’clock). - */ - angle(angle: number): this; - /** - * Sets the angle accessor to the specified function and returns this radial line generator. - * - * When a radial line is generated, the angle accessor will be invoked for each defined element in the input data array. - * - * The default angle accessor assumes that the input data are two-element arrays of numbers. If your data are in a different format, or if you wish to transform the data before rendering, - * then you should specify a custom accessor. - * - * @param angle An angle accessor function which returns the angle value in radians, with 0 at -y (12 o’clock). The angle accessor will be invoked for each defined element in the input data array, - * being passed the element d, the index i, and the array data as three arguments. - */ - angle(angle: (d: Datum, index: number, data: Datum[]) => number): this; - - /** - * Returns the current radius accessor function, which defaults to a function returning second element of a two-element array of numbers. - */ - radius(): (d: Datum, index: number, data: Datum[]) => number; - /** - * Sets the radius accessor to the specified number and returns this radial line generator. - * - * @param radius A constant radius value. - */ - radius(radius: number): this; - /** - * Sets the radius accessor to the specified function and returns this radial line generator. - * - * When a radial line is generated, the radius accessor will be invoked for each defined element in the input data array. - * - * The default radius accessor assumes that the input data are two-element arrays of numbers. If your data are in a different format, or if you wish to transform the data before rendering, - * then you should specify a custom accessor. - * - * @param radius A radius accessor function which returns the radius value. The radius accessor will be invoked for each defined element in the input data array, - * being passed the element d, the index i, and the array data as three arguments. - */ - radius(radius: (d: Datum, index: number, data: Datum[]) => number): this; - - /** - * Returns the current defined accessor, which defaults to a function returning a constant boolean value of true. - */ - defined(): (d: Datum, index: number, data: Datum[]) => boolean; - /** - * Sets the defined accessor to the specified boolean and returns this radial line generator. - * - * The default accessor for defined returns a constant boolean value of true, thus assumes that the input data is always defined. - * - * When a radial line is generated, the defined accessor will be invoked for each element in the input data array, - * being passed the element d, the index i, and the array data as three arguments. - * If the given element is defined (i.e., if the defined accessor returns a truthy value for this element), - * the angle and radius accessors will subsequently be evaluated and the point will be added to the current radial line segment. - * Otherwise, the element will be skipped, the current radial line segment will be ended, and a new radial line segment will be generated for the next defined point. - * As a result, the generated radial line may have several discrete segments. - * - * Note that if a radial line segment consists of only a single point, it may appear invisible unless rendered with rounded or square line caps. - * In addition, some curves such as curveCardinalOpen only render a visible segment if it contains multiple points. - * - * @param defined A boolean constant - */ - defined(defined: boolean): this; - /** - * Sets the defined accessor to the specified function and returns this radial line generator. - * - * The default accessor for defined returns a constant boolean value of true, thus assumes that the input data is always defined. - * - * When a radial line is generated, the defined accessor will be invoked for each element in the input data array, - * being passed the element d, the index i, and the array data as three arguments. - * If the given element is defined (i.e., if the defined accessor returns a truthy value for this element), - * the angle and radius accessors will subsequently be evaluated and the point will be added to the current radial line segment. - * Otherwise, the element will be skipped, the current radial line segment will be ended, and a new radial line segment will be generated for the next defined point. - * As a result, the generated radial line may have several discrete segments. - * - * Note that if a radial line segment consists of only a single point, it may appear invisible unless rendered with rounded or square line caps. - * In addition, some curves such as curveCardinalOpen only render a visible segment if it contains multiple points. - * - * @param defined An accessor function which returns a boolean value. The accessor will be invoked for each defined element in the input data array, - * being passed the element d, the index i, and the array data as three arguments. - */ - defined(defined: (d: Datum, index: number, data: Datum[]) => boolean): this; - - /** - * Returns the current curve factory, which defaults to curveLinear. - */ - curve(): CurveFactory | CurveFactoryLineOnly; - /** - * Returns the current curve factory, which defaults to curveLinear. - * - * The generic allows to cast the curve factory to a specifc type, if known. - */ - curve(): C; - /** - * Sets the curve factory and returns this radial line generator. - * - * Note that curveMonotoneX or curveMonotoneY are not recommended for radial lines because they assume that the data is monotonic in x or y, - * which is typically untrue of radial lines. - * - * @param curve A valid curve factory. - */ - curve(curve: CurveFactory | CurveFactoryLineOnly): this; - - /** - * Returns the current rendering context, which defaults to null. - */ - context(): CanvasRenderingContext2D | null; - /** - * Sets the rendering context and returns this radial line generator. - * - * If the context is not null, then the generated radial line is rendered to this context as a sequence of path method calls. - * - * @param context The rendering context. - */ - context(context: CanvasRenderingContext2D): this; - /** - * Sets the rendering context to null and returns this radial line generator. - * - * A path data string representing the generated radial line will be returned when the generator is invoked with data. - * - * @param context null, to remove rendering context. - */ - context(context: null): this; -} - -/** - * Constructs a new radial line generator with the default settings. - * - * Ensure that the accessors used with the radial line generator correspond to the arguments passed into them, - * or set them to constants as appropriate. - */ -export function radialLine(): RadialLine<[number, number]>; -/** - * Constructs a new radial line generator with the default settings. - * - * Ensure that the accessors used with the radial line generator correspond to the arguments passed into them, - * or set them to constants as appropriate. - * - * The generic refers to the data type of an element in the input array passed into the radial line generator. - */ -export function radialLine(): RadialLine; - -// ----------------------------------------------------------------------------------- -// Area Generators -// ----------------------------------------------------------------------------------- - -/** - * The area generator produces an area, as in an area chart. An area is defined by two bounding lines, either splines or polylines. - * Typically, the two lines share the same x-values (x0 = x1), differing only in y-value (y0 and y1); most commonly, y0 is defined as a constant representing zero. - * The first line (the topline) is defined by x1 and y1 and is rendered first; the second line (the baseline) is defined by x0 and y0 and is rendered second, with the points in reverse order. - * With a curveLinear curve, this produces a clockwise polygon. - * - * The generic refers to the data type of an element in the input array passed into the area generator. - */ -export interface Area { - /** - * Generates an area for the given array of data. Depending on this area generator’s associated curve, - * the given input data may need to be sorted by x-value before being passed to the area generator. - * - * IMPORTANT: If the rendering context of the area generator is null, - * then the area is returned as a path data string. - * - * @param data Array of data elements. - */ - (data: Datum[]): string | null; - /** - * Generates an area for the given array of data. Depending on this area generator’s associated curve, - * the given input data may need to be sorted by x-value before being passed to the area generator. - * - * IMPORTANT: If the area generator has been configured with a rendering context, - * then the area is rendered to this context as a sequence of path method calls and this function returns void. - * - * @param data Array of data elements. - */ - (data: Datum[]): void; - - /** - * Returns the current x0 accessor. The default x0 accessor is a function returning the first element of a - * two-element array of numbers. - */ - x(): (d: Datum, index: number, data: Datum[]) => number; - /** - * Sets x0 to a constant number x and x1 to null and returns this area generator. - * - * Setting x1 to null indicates that the previously-computed x0 value should be reused for the x1 value. - * - * @param x A constant value to be used for x0. - */ - x(x: number): this; - /** - * Sets x0 to the specified function x and x1 to null and returns this area generator. - * - * The default x0 accessor assumes that the input data are two-element arrays of numbers and returns the first element. - * If your data are in a different format, or if you wish to transform the data before rendering, then you should specify a custom accessor. - * - * @param x An accessor function returning a value to be used for x0. The accessor will be invoked for each defined element in the input data array, - * being passed the element d, the index i, and the array data as three arguments. - */ - x(x: (d: Datum, index: number, data: Datum[]) => number): this; - - /** - * Returns the current x0 accessor. The default x0 accessor is a function returning the first element of a - * two-element array of numbers. - */ - x0(): (d: Datum, index: number, data: Datum[]) => number; - /** - * Sets x0 to a constant number and returns this area generator. - * - * @param x A constant value. - */ - x0(x: number): this; - /** - * Sets x0 to the specified function and returns this area generator. - * - * The default x0 accessor assumes that the input data are two-element arrays of numbers and returns the first element. - * If your data are in a different format, or if you wish to transform the data before rendering, then you should specify a custom accessor. - * - * @param x An accessor function returning a value to be used for x0. The accessor will be invoked for each defined element in the input data array, - * being passed the element d, the index i, and the array data as three arguments. - */ - x0(x: (d: Datum, index: number, data: Datum[]) => number): this; - - /** - * Returns the current x1 accessor, which defaults to null, indicating that the previously-computed x0 value should be reused for the x1 value. - */ - x1(): ((d: Datum, index: number, data: Datum[]) => number) | null; - /** - * Sets x1 to null and returns this area generator. - * - * Setting x1 to null indicates that the previously-computed x0 value should be reused for the x1 value. - * - * @param x null. - */ - x1(x: null): this; - /** - * Sets x1 to a constant number and returns this area generator. - * - * @param x A constant value. - */ - x1(x: number): this; - /** - * Sets x1 to the specified function and returns this area generator. - * - * The default x1 accessor is null, indicating that the previously-computed x0 value should be reused for the x1 value. - * If your data are in a different format, or if you wish to transform the data before rendering, then you should specify a custom accessor. - * - * @param x An accessor function returning a value to be used for x1. The accessor will be invoked for each defined element in the input data array, - * being passed the element d, the index i, and the array data as three arguments. - */ - x1(x: (d: Datum, index: number, data: Datum[]) => number): this; - - /** - * Returns the current y0 accessor. The default y0 accessor is a function returning a constant value of zero. - */ - y(): (d: Datum, index: number, data: Datum[]) => number; - /** - * Sets y0 to a constant number y and y1 to null and returns this area generator. - * - * Setting y1 to null indicates that the previously-computed y0 value should be reused for the y1 value. - * - * @param y A constant value to be used for y0. - */ - y(y: number): this; - /** - * Sets y0 to the accessor function y and y1 to null and returns this area generator. - * - * The default y0 accessor returns a constant value of zero. - * If your data are in a different format, or if you wish to transform the data before rendering, then you should specify a custom accessor. - * - * @param y An accessor function returning a value to be used for y0. The accessor will be invoked for each defined element in the input data array, - * being passed the element d, the index i, and the array data as three arguments. - */ - y(y: (d: Datum, index: number, data: Datum[]) => number): this; - - /** - * Returns the current y0 accessor. The default y0 accessor is a function a constant value of zero. - */ - y0(): (d: Datum, index: number, data: Datum[]) => number; - /** - * Sets y0 to a constant number and returns this area generator. - * - * @param y A constant value. - */ - y0(y: number): this; - /** - * Sets y0 to the specified function and returns this area generator. - * - * The default y0 accessor is a function which returns a constant value of zero. - * If your data are in a different format, or if you wish to transform the data before rendering, then you should specify a custom accessor. - * - * @param y An accessor function returning a value to be used for y0. The accessor will be invoked for each defined element in the input data array, - * being passed the element d, the index i, and the array data as three arguments. - */ - y0(y: (d: Datum, index: number, data: Datum[]) => number): this; - - /** - * Returns the current y1 accessor or null. The default y1 accessor is a function returning the second element of a - * two-element array of numbers. - * - * If the y1 accessor is null, the previously-computed y0 value is reused for the y1 value. - * - */ - y1(): ((d: Datum, index: number, data: Datum[]) => number) | null; - /** - * Sets y1 to null and returns this area generator. - * - * Setting y1 to null indicates that the previously-computed y0 value should be reused for the y1 value. - * - * @param y null. - */ - y1(y: null): this; - /** - * Sets y1 to a constant number and returns this area generator. - * - * @param y A constant value. - */ - y1(y: number): this; - /** - * Sets y1 to the specified function and returns this area generator. - * - * The default y1 accessor assumes that the input data are two-element arrays of numbers and returns the second element. - * If your data are in a different format, or if you wish to transform the data before rendering, then you should specify a custom accessor. - * - * @param y An accessor function returning a value to be used for y1. The accessor will be invoked for each defined element in the input data array, - * being passed the element d, the index i, and the array data as three arguments. - */ - y1(y: (d: Datum, index: number, data: Datum[]) => number): this; - - /** - * Returns the current defined accessor, which defaults to a function returning a constant boolean value of true. - */ - defined(): (d: Datum, index: number, data: Datum[]) => boolean; - /** - * Sets the defined accessor to the specified boolean and returns this area generator. - * - * The default accessor for defined returns a constant boolean value of true, thus assumes that the input data is always defined. - * When an area is generated, the defined accessor will be invoked for each element in the input data array, being passed the element d, the index i, and the array data as three arguments. - * If the given element is defined (i.e., if the defined accessor returns a truthy value for this element), - * the x0, x1, y0 and y1 accessors will subsequently be evaluated and the point will be added to the current area segment. - * Otherwise, the element will be skipped, the current area segment will be ended, and a new area segment will be generated for the next defined point. - * As a result, the generated area may have several discrete segments. - * - * Note that if an area segment consists of only a single point, it may appear invisible unless rendered with rounded or square line caps. - * In addition, some curves such as curveCardinalOpen only render a visible segment if it contains multiple points - * - * @param defined A boolean constant - */ - defined(defined: boolean): this; - /** - * Sets the defined accessor to the specified function and returns this area generator. - * - * The default accessor for defined returns a constant boolean value of true, thus assumes that the input data is always defined. - * - * The default accessor for defined returns a constant boolean value of true, thus assumes that the input data is always defined. - * When an area is generated, the defined accessor will be invoked for each element in the input data array, - * being passed the element d, the index i, and the array data as three arguments. - * If the given element is defined (i.e., if the defined accessor returns a truthy value for this element), - * the x0, x1, y0 and y1 accessors will subsequently be evaluated and the point will be added to the current area segment. - * Otherwise, the element will be skipped, the current area segment will be ended, and a new area segment will be generated for the next defined point. - * As a result, the generated area may have several discrete segments. - * - * Note that if an area segment consists of only a single point, it may appear invisible unless rendered with rounded or square line caps. - * In addition, some curves such as curveCardinalOpen only render a visible segment if it contains multiple points - * - * @param defined An accessor function which returns a boolean value. The accessor will be invoked for each defined element in the input data array, - * being passed the element d, the index i, and the array data as three arguments. - */ - defined(defined: (d: Datum, index: number, data: Datum[]) => boolean): this; - - /** - * Returns the current curve factory, which defaults to curveLinear. - */ - curve(): CurveFactory; - /** - * Returns the current curve factory, which defaults to curveLinear. - * - * The generic allows to cast the curve factory to a specifc type, if known. - */ - curve(): C; - /** - * Sets the curve factory and returns this area generator. - * - * - * @param curve A valid curve factory. - */ - curve(curve: CurveFactory): this; - - /** - * Returns the current rendering context, which defaults to null. - */ - context(): CanvasRenderingContext2D | null; - /** - * Sets the rendering context and returns this area generator. - * - * If the context is not null, then the generated area is rendered to this context as a sequence of path method calls. - * - * @param context The rendering context. - */ - context(context: CanvasRenderingContext2D): this; - /** - * Sets the rendering context to null and returns this area generator. - * - * A path data string representing the generated area will be returned when the generator is invoked with data. - * - * @param context null, to remove rendering context. - */ - context(context: null): this; - - /** - * Returns a new line generator that has this area generator’s current defined accessor, curve and context. - * The line’s x-accessor is this area’s x0-accessor, and the line’s y-accessor is this area’s y0-accessor. - */ - lineX0(): Line; - /** - * Returns a new line generator that has this area generator’s current defined accessor, curve and context. - * The line’s x-accessor is this area’s x0-accessor, and the line’s y-accessor is this area’s y0-accessor. - */ - lineY0(): Line; - - /** - * Returns a new line generator that has this area generator’s current defined accessor, curve and context. - * The line’s x-accessor is this area’s x1-accessor, and the line’s y-accessor is this area’s y0-accessor. - */ - lineX1(): Line; - /** - * Returns a new line generator that has this area generator’s current defined accessor, curve and context. - * The line’s x-accessor is this area’s x0-accessor, and the line’s y-accessor is this area’s y1-accessor. - */ - lineY1(): Line; -} - -/** - * Constructs a new area generator with the default settings. - * - * Ensure that the accessors used with the area generator correspond to the arguments passed into them, - * or set them to constants as appropriate. - */ -export function area(): Area<[number, number]>; -/** - * Constructs a new area generator with the default settings. - * - * Ensure that the accessors used with the area generator correspond to the arguments passed into them, - * or set them to constants as appropriate. - * - * The generic refers to the data type of an element in the input array passed into the area generator. - */ -export function area(): Area; - -/** - * A radial area generator. - * - * A radial area generator is equivalent to the standard Cartesian area generator, - * except the x and y accessors are replaced with angle and radius accessors. - * Radial areas are always positioned relative to ⟨0,0⟩; use a transform (see: SVG, Canvas) to change the origin. - * - * The generic refers to the data type of an element in the input array passed into the area generator. - */ -export interface RadialArea { - - /** - * Generates a radial area for the given array of data. - * - * IMPORTANT: If the rendering context of the radial area generator is null, - * then the radial area is returned as a path data string. - * - * @param data Array of data elements. - */ - (data: Datum[]): string | null; - /** - * Generates a radial area for the given array of data. - * - * IMPORTANT: If the radial area generator has been configured with a rendering context, - * then the radial area is rendered to this context as a sequence of path method calls and this function returns void. - * - * @param data Array of data elements. - */ - (data: Datum[]): void; - - /** - * Returns the current startAngle accessor. The default startAngle accessor is a function returning the first element of a - * two-element array of numbers. - */ - angle(): (d: Datum, index: number, data: Datum[]) => number; - /** - * Sets startAngle to a constant number angle and endAngle to null and returns this radial area generator. - * - * Setting endAngle to null indicates that the previously-computed startAngle value should be reused for the endAngle value. - * - * @param angle A constant value in radians with 0 at -y (12 o’clock). - */ - angle(angle: number): this; - /** - * Sets startAngle to the specified function angle and endAngle to null and returns this radial area generator. - * - * The default startAngle accessor assumes that the input data are two-element arrays of numbers and returns the first element. - * If your data are in a different format, or if you wish to transform the data before rendering, then you should specify a custom accessor. - * - * @param angle An accessor function returning a value to be used for startAngle in radians with 0 at -y (12 o’clock). - * The accessor will be invoked for each defined element in the input data array, - * being passed the element d, the index i, and the array data as three arguments. - */ - angle(angle: (d: Datum, index: number, data: Datum[]) => number): this; - - /** - * Returns the current startAngle accessor. The default startAngle accessor is a function returning the first element of a - * two-element array of numbers. - */ - startAngle(): (d: Datum, index: number, data: Datum[]) => number; - /** - * Sets startAngle to a constant number and returns this radial area generator. - * - * @param angle A constant value in radians with 0 at -y (12 o’clock). - */ - startAngle(angle: number): this; - /** - * Sets startAngle to the specified function and returns this radial area generator. - * - * The default startAngle accessor assumes that the input data are two-element arrays of numbers and returns the first element. - * If your data are in a different format, or if you wish to transform the data before rendering, then you should specify a custom accessor. - * - * @param angle An accessor function returning a value to be used for startAngle in radians with 0 at -y (12 o’clock). - * The accessor will be invoked for each defined element in the input data array, - * being passed the element d, the index i, and the array data as three arguments. - */ - startAngle(angle: (d: Datum, index: number, data: Datum[]) => number): this; - - /** - * Returns the current endAngle accessor, which defaults to null, indicating that the previously-computed startAngle value should be reused for the endAngle value. - */ - endAngle(): ((d: Datum, index: number, data: Datum[]) => number) | null; - /** - * Sets endAngle to null and returns this radial area generator. - * - * Setting endAngle to null indicates that the previously-computed startAngle value should be reused for the endAngle value. - * - * @param angle null. - */ - endAngle(angle: null): this; - /** - * Sets endAngle to a constant number and returns this radial area generator. - * - * @param angle A constant value in radians with 0 at -y (12 o’clock). - */ - endAngle(angle: number): this; - /** - * Sets endAngle to the specified function and returns this radial area generator. - * - * The default endAngle accessor is null, indicating that the previously-computed startAngle value should be reused for the endAngle value. - * If your data are in a different format, or if you wish to transform the data before rendering, then you should specify a custom accessor. - * - * @param angle An accessor function returning a value to be used for endAngle in radians with 0 at -y (12 o’clock). - * The accessor will be invoked for each defined element in the input data array, - * being passed the element d, the index i, and the array data as three arguments. - */ - endAngle(angle: (d: Datum, index: number, data: Datum[]) => number): this; - - /** - * Returns the current innerRadius accessor. The default innerRadius accessor is a function returning a constant value of zero. - */ - radius(): (d: Datum, index: number, data: Datum[]) => number; - /** - * Sets innerRadius to a constant number radius and outerRadius to null and returns this radial area generator. - * - * Setting outerRadius to null indicates that the previously-computed innerRadius value should be reused for the outerRadius value. - * - * @param radius A constant value to be used for innerRadius. - */ - radius(radius: number): this; - /** - * Sets innerRadius to the accessor function radius and outerRadius to null and returns this radial area generator. - * - * The default innerRadius accessor returns a constant value of zero. - * If your data are in a different format, or if you wish to transform the data before rendering, then you should specify a custom accessor. - * - * @param radius An accessor function returning a value to be used for innerRadius. The accessor will be invoked for each defined element in the input data array, - * being passed the element d, the index i, and the array data as three arguments. - */ - radius(radius: (d: Datum, index: number, data: Datum[]) => number): this; - - /** - * Returns the current innerRadius accessor. The default innerRadius accessor is a function a constant value of zero. - */ - innerRadius(): (d: Datum, index: number, data: Datum[]) => number; - /** - * Sets innerRadius to a constant number and returns this radial area generator. - * - * @param radius A constant value. - */ - innerRadius(radius: number): this; - /** - * Sets innerRadius to the specified function and returns this radial area generator. - * - * The default innerRadius accessor is a function which returns a constant value of zero. - * If your data are in a different format, or if you wish to transform the data before rendering, then you should specify a custom accessor. - * - * @param radius An accessor function returning a value to be used for innerRadius. The accessor will be invoked for each defined element in the input data array, - * being passed the element d, the index i, and the array data as three arguments. - */ - innerRadius(radius: (d: Datum, index: number, data: Datum[]) => number): this; - - /** - * Returns the current outerRadius accessor or null. The default outerRadius accessor is a function returning the second element of a - * two-element array of numbers. - * - * If the outerRadius accessor is null, the previously-computed innerRadius value is reused for the outerRadius value. - * - */ - outerRadius(): ((d: Datum, index: number, data: Datum[]) => number) | null; - /** - * Sets outerRadius to null and returns this radial area generator. - * - * Setting outerRadius to null indicates that the previously-computed innerRadius value should be reused for the outerRadius value. - * - * @param radius null. - */ - outerRadius(radius: null): this; - /** - * Sets outerRadius to a constant number and returns this radial area generator. - * - * @param radius A constant value. - */ - outerRadius(radius: number): this; - /** - * Sets outerRadius to the specified function and returns this radial area generator. - * - * The default outerRadius accessor assumes that the input data are two-element arrays of numbers and returns the second element. - * If your data are in a different format, or if you wish to transform the data before rendering, then you should specify a custom accessor. - * - * @param radius An accessor function returning a value to be used for outerRadius. The accessor will be invoked for each defined element in the input data array, - * being passed the element d, the index i, and the array data as three arguments. - */ - outerRadius(radius: (d: Datum, index: number, data: Datum[]) => number): this; - - /** - * Returns the current defined accessor, which defaults to a function returning a constant boolean value of true. - */ - defined(): (d: Datum, index: number, data: Datum[]) => boolean; - /** - * Sets the defined accessor to the specified boolean and returns this radial area generator. - * - * The default accessor for defined returns a constant boolean value of true, thus assumes that the input data is always defined. - * - * When a radial area is generated, the defined accessor will be invoked for each element in the input data array, being passed the element d, the index i, and the array data as three arguments. - * If the given element is defined (i.e., if the defined accessor returns a truthy value for this element), - * the startAngle, endAngle, innerRadius and outerRadius accessors will subsequently be evaluated and the point will be added to the current area segment. - * - * Otherwise, the element will be skipped, the current area segment will be ended, and a new area segment will be generated for the next defined point. - * As a result, the generated area may have several discrete segments. - * - * Note that if an area segment consists of only a single point, it may appear invisible unless rendered with rounded or square line caps. - * In addition, some curves such as curveCardinalOpen only render a visible segment if it contains multiple points - * - * @param defined A boolean constant - */ - defined(defined: boolean): this; - /** - * Sets the defined accessor to the specified function and returns this radial area generator. - * - * The default accessor for defined returns a constant boolean value of true, thus assumes that the input data is always defined. - * - * When a radial area is generated, the defined accessor will be invoked for each element in the input data array, being passed the element d, the index i, and the array data as three arguments. - * If the given element is defined (i.e., if the defined accessor returns a truthy value for this element), - * the startAngle, endAngle, innerRadius and outerRadius accessors will subsequently be evaluated and the point will be added to the current area segment. - * - * Otherwise, the element will be skipped, the current area segment will be ended, and a new area segment will be generated for the next defined point. - * As a result, the generated area may have several discrete segments. - * - * Note that if an area segment consists of only a single point, it may appear invisible unless rendered with rounded or square line caps. - * In addition, some curves such as curveCardinalOpen only render a visible segment if it contains multiple points - * - * @param defined An accessor function which returns a boolean value. The accessor will be invoked for each defined element in the input data array, - * being passed the element d, the index i, and the array data as three arguments. - */ - defined(defined: (d: Datum, index: number, data: Datum[]) => boolean): this; - - /** - * Returns the current curve factory, which defaults to curveLinear. - */ - curve(): CurveFactory; - /** - * Returns the current curve factory, which defaults to curveLinear. - * - * The generic allows to cast the curve factory to a specifc type, if known. - */ - curve(): C; - /** - * Sets the curve factory and returns this radial area generator. - * - * Note that curveMonotoneX or curveMonotoneY are not recommended for radial areas because they assume that the data is monotonic in x or y, which is typically untrue of radial areas. - * - * @param curve A valid curve factory. - */ - curve(curve: CurveFactory): this; - - /** - * Returns the current rendering context, which defaults to null. - */ - context(): CanvasRenderingContext2D | null; - /** - * Sets the rendering context and returns this radial area generator. - * - * If the context is not null, then the generated radial area is rendered to this context as a sequence of path method calls. - * - * @param context The rendering context. - */ - context(context: CanvasRenderingContext2D): this; - /** - * Sets the rendering context to null and returns this radial area generator. - * - * A path data string representing the generated radial area will be returned when the generator is invoked with data. - * - * @param context null, to remove rendering context. - */ - context(context: null): this; - - /** - * Returns a new radial line generator that has this radial area generator’s current defined accessor, curve and context. - * The line’s angle accessor is this area’s start angle accessor, and the line’s radius accessor is this area’s inner radius accessor. - */ - lineStartAngle(): RadialLine; - - /** - * Returns a new radial line generator that has this radial area generator’s current defined accessor, curve and context. - * The line’s angle accessor is this area’s start angle accessor, and the line’s radius accessor is this area’s inner radius accessor. - */ - lineInnerRadius(): RadialLine; - - /** - * Returns a new radial line generator that has this radial area generator’s current defined accessor, curve and context. - * The line’s angle accessor is this area’s end angle accessor, and the line’s radius accessor is this area’s inner radius accessor. - */ - lineEndAngle(): RadialLine; - - /** - * Returns a new radial line generator that has this radial area generator’s current defined accessor, curve and context. - * The line’s angle accessor is this area’s start angle accessor, and the line’s radius accessor is this area’s outer radius accessor. - */ - lineOuterRadius(): RadialLine; -} - -/** - * Constructs a new radial area generator with the default settings. - * - * Ensure that the accessors used with the area generator correspond to the arguments passed into them, - * or set them to constants as appropriate. - */ -export function radialArea(): RadialArea<[number, number]>; -/** - * Constructs a new radial area generator with the default settings. - * - * Ensure that the accessors used with the area generator correspond to the arguments passed into them, - * or set them to constants as appropriate. - * - * The generic refers to the data type of an element in the input array passed into the radial area generator. - */ -export function radialArea(): RadialArea; - -// ----------------------------------------------------------------------------------- -// Curve Factories -// ----------------------------------------------------------------------------------- - -/** - * A minimal interface for a curve generator which supports only the rendering of lines. - * Methods for related to the rendering of areas are not implemented in this minimal interface. - * - * While lines are defined as a sequence of two-dimensional [x, y] points, - * there remains the task of transforming this discrete representation into a continuous shape: i.e., how to interpolate between the points. - * A curve generator serves this purpose. - * - * Curves are typically not constructed or used directly, instead being passed to line.curve. - */ -export interface CurveGeneratorLineOnly { - /** - * Indicates the start of a new line segment. Zero or more points will follow. - */ - lineStart(): void; - /** - * Indicates the end of the current line segment. - */ - lineEnd(): void; - /** - * Indicates a new point in the current line segment with the given x- and y-values. - */ - point(x: number, y: number): void; -} - -/** - * A factory for curve generators addressing only lines, but not areas. - */ -// This is a base interface to be extended, hence the suppression of the warning -// tslint:disable-next-line:callable-types -export interface CurveFactoryLineOnly { - /** - * Returns a "lines only" curve generator which renders to the specified context. - * - * @param context A rendering context - */ - (context: CanvasRenderingContext2D | Path): CurveGeneratorLineOnly; -} - -/** - * A minimal interface for a curve generator which supports the rendering of lines and areas. - * - * While lines are defined as a sequence of two-dimensional [x, y] points, - * and areas are similarly defined by a topline and a baseline, - * there remains the task of transforming this discrete representation into a continuous shape: i.e., how to interpolate between the points. - * A curve generator serves this purpose. - * - * Curves are typically not constructed or used directly, instead being passed to line.curve and area.curve. - */ -export interface CurveGenerator extends CurveGeneratorLineOnly { - /** - * Indicates the start of a new area segment. - * Each area segment consists of exactly two line segments: the topline, followed by the baseline, with the baseline points in reverse order. - */ - areaStart(): void; - /** - * Indicates the end of the current area segment. - */ - areaEnd(): void; -} - -/** - * A factory for curve generators addressing both lines and areas. - */ -// This is a base interface to be extended, hence the suppression of the warning -// tslint:disable-next-line:callable-types -export interface CurveFactory { - /** - * Returns a curve generator which renders to the specified context. - * - * @param context A rendering context - */ - (context: CanvasRenderingContext2D | Path): CurveGenerator; -} - -/** - * A curve factory for cubic basis spline generators. - * - * The curve generators produce a cubic basis spline using the specified control points. - * The first and last points are triplicated such that the spline starts at the first point and ends at the last point, - * and is tangent to the line between the first and second points, and to the line between the penultimate and last points. - */ -export var curveBasis: CurveFactory; - -/** - * A curve factory for closed cubic basis spline generators. - * - * The curve generators produce a closed cubic basis spline using the specified control points. - * When a line segment ends, the first three control points are repeated, producing a closed loop with C2 continuity. - */ -export var curveBasisClosed: CurveFactory; - -/** - * A curve factory for open cubic basis spline generators. - * - * The curve generators produce a cubic basis spline using the specified control points. - * Unlike basis, the first and last points are not repeated, and thus the curve typically does not intersect these points. - */ -export var curveBasisOpen: CurveFactory; - -/** - * A curve factory for straightened cubic basis spline generators. - * - * The curve generators produce a straightened cubic basis spline using the specified control points, - * with the spline straightened according to the curve’s beta, which defaults to 0.85. - * This curve is typically used in hierarchical edge bundling to disambiguate connections, - * as proposed by Danny Holten in Hierarchical Edge Bundles: Visualization of Adjacency Relations in Hierarchical Data. - * - * This curve does not implement curve.areaStart and curve.areaEnd; it is intended to work with d3.line, not d3.area. - */ -export interface CurveBundleFactory extends CurveFactoryLineOnly { - /** - * Returns a bundle curve factory with the specified beta in the range [0, 1], representing the bundle strength. - * If beta equals zero, a straight line between the first and last point is produced; if beta equals one, - * a standard basis spline is produced. - * - * @param beta A constant value in the [0, 1] interval. - */ - beta(beta: number): this; -} - -/** - * A curve factory for straightened cubic basis spline generators. - * - * The curve generators produce a straightened cubic basis spline using the specified control points, - * with the spline straightened according to the curve’s beta, which defaults to 0.85. - * This curve is typically used in hierarchical edge bundling to disambiguate connections, - * as proposed by Danny Holten in Hierarchical Edge Bundles: Visualization of Adjacency Relations in Hierarchical Data. - * - * This curve does not implement curve.areaStart and curve.areaEnd; it is intended to work with d3.line, not d3.area. - */ -export var curveBundle: CurveBundleFactory; - - -/** - * A curve factory for cubic cardinal spline generators. - */ -export interface CurveCardinalFactory extends CurveFactory { - /** - * Returns a cardinal curve factory with the specified tension in the range [0, 1]. - * The tension determines the length of the tangents: a tension of one yields all zero tangents, equivalent to curveLinear; a tension of zero produces a uniform Catmull–Rom spline. - * - * @param tension A constant in the [0, 1] interval. - */ - tension(tension: number): this; -} - -/** - * A curve factory for cubic cardinal spline generators. - * - * The curve generators produce a cubic cardinal spline using the specified control points, with one-sided differences used for the first and last piece. - * The default tension is 0. - */ -export var curveCardinal: CurveCardinalFactory; - -/** - * A curve factory for closed cubic cardinal spline generators. - * - * The curve generators produce closed cubic cardinal spline using the specified control points. - * When a line segment ends, the first three control points are repeated, producing a closed loop. - * The default tension is 0. - */ -export var curveCardinalClosed: CurveCardinalFactory; - -/** - * A curve factory for open cubic cardinal spline generators. - * - * The curve generators produce a cubic cardinal spline using the specified control points. - * Unlike curveCardinal, one-sided differences are not used for the first and last piece, - * and thus the curve starts at the second point and ends at the penultimate point. - * The default tension is 0. - */ -export var curveCardinalOpen: CurveCardinalFactory; - -/** - * A curve factory for cubic Catmull–Rom spline generators. - */ -export interface CurveCatmullRomFactory extends CurveFactory { - /** - * Returns a cubic Catmull–Rom curve factory with the specified alpha in the range [0, 1]. - * If alpha is zero, produces a uniform spline, equivalent to curveCardinal with a tension of zero; - * if alpha is one, produces a chordal spline; if alpha is 0.5, produces a centripetal spline. - * Centripetal splines are recommended to avoid self-intersections and overshoot. - * - * @param alpha A constant in the [0, 1] interval. - */ - alpha(alpha: number): this; -} - -/** - * A curve factory for cubic Catmull–Rom spline generators. - * - * The curve generators produce a cubic Catmull–Rom spline using the specified control points and the parameter alpha, - * which defaults to 0.5, as proposed by Yuksel et al. in On the Parameterization of Catmull–Rom Curves, - * with one-sided differences used for the first and last piece. - */ -export var curveCatmullRom: CurveCatmullRomFactory; - -/** - * A curve factory for cubic Catmull–Rom spline generators. - * - * The curve generators produce a closed cubic Catmull–Rom spline using the specified control points and the parameter alpha, - * which defaults to 0.5, as proposed by Yuksel et al. When a line segment ends, - * the first three control points are repeated, producing a closed loop. - */ -export var curveCatmullRomClosed: CurveCatmullRomFactory; - -/** - * A curve factory for cubic Catmull–Rom spline generators. - * - * The curve generators produce a cubic Catmull–Rom spline using the specified control points and the parameter alpha, - * which defaults to 0.5, as proposed by Yuksel et al. Unlike curveCatmullRom, one-sided differences are not used for the first and last piece, - * and thus the curve starts at the second point and ends at the penultimate point. - */ -export var curveCatmullRomOpen: CurveCatmullRomFactory; - - -/** - * A curve factory for polyline generators. - * - * The curve generators produce a polyline through the specified points. - */ -export var curveLinear: CurveFactory; - -/** - * A curve factory for closed polyline generators. - * - * The curve generators produce a closed polyline through the specified points by repeating the first point when the line segment ends. - */ -export var curveLinearClosed: CurveFactory; - -/** - * A curve factory for cubic spline generators preserving monotonicity in y. - * - * The curve generators produce a cubic spline that preserves monotonicity in y, assuming monotonicity in x, as proposed by Steffen in A simple method for monotonic interpolation in one dimension: - * “a smooth curve with continuous first-order derivatives that passes through any given set of data points without spurious oscillations. - * Local extrema can occur only at grid points where they are given by the data, but not in between two adjacent grid points.” - */ -export var curveMonotoneX: CurveFactory; - -/** - * A curve factory for cubic spline generators preserving monotonicity in x. - * - * The curve generators produce a cubic spline that preserves monotonicity in x, assuming monotonicity in y, as proposed by Steffen in A simple method for monotonic interpolation in one dimension: - * “a smooth curve with continuous first-order derivatives that passes through any given set of data points without spurious oscillations. - * Local extrema can occur only at grid points where they are given by the data, but not in between two adjacent grid points.” - */ -export var curveMonotoneY: CurveFactory; - -/** - * A curve factory for natural cubic spline generators. - * - * The curve generators produce a natural cubic spline with the second derivative of the spline set to zero at the endpoints. - */ -export var curveNatural: CurveFactory; - -/** - * A curve factory for step function (midpoint) generators. - * - * The curve generators produce a piecewise constant function (a step function) consisting of alternating horizontal and vertical lines. - * The y-value changes at the midpoint of each pair of adjacent x-values. - */ -export var curveStep: CurveFactory; - -/** - * A curve factory for step function (after) generators. - * - * The curve generators produce a piecewise constant function (a step function) consisting of alternating horizontal and vertical lines. - * The y-value changes after the x-value. - */ -export var curveStepAfter: CurveFactory; - -/** - * A curve factory for step function (before) generators. - * - * The curve generators produce a piecewise constant function (a step function) consisting of alternating horizontal and vertical lines. - * The y-value changes before the x-value. - */ -export var curveStepBefore: CurveFactory; - - -// ----------------------------------------------------------------------------------- -// SYMBOLS -// ----------------------------------------------------------------------------------- - -/** - * A Symbol Type. - * - * Symbol types are typically not used directly, instead being passed to symbol.type. - * However, you can define your own sumbol type implementation should none of the built-in types satisfy your needs using the following interface. - * You can also use this low-level interface with a built-in symbol type as an alternative to the symbol generator - */ -export interface SymbolType { - /** - * Renders this symbol type to the specified context with the specified size in square pixels. The context implements the CanvasPathMethods interface. - * (Note that this is a subset of the CanvasRenderingContext2D interface!) - * - * @param context A rendering context implementing CanvasPathMethods. - * @param size Size of the symbol to draw. - */ - draw(context: CanvasPathMethods, size: number): void; -} - -/** - * A symbol generator. - * - * Symbols provide a categorical shape encoding as is commonly used in scatterplots. Symbols are always centered at ⟨0,0⟩; - * use a transform (see: SVG, Canvas) to move the arc to a different position. - * - * The first generic corresponds to the "this" context within which the symbol generator is invoked. - * The second generic corrsponds to the data type of the datum underlying the symbol. - */ -export interface Symbol { - /** - * Generates a symbol for the given arguments. - * - * IMPORTANT: If the rendering context of the symbol generator is null, - * then the symbol is returned as a path data string. - * - * The "this" context within which this function is invoked, will be the context within which the accessor methods of the generator are invoked. - * All arguments passed into this function, will be passed to the accessor functions of the generator. - * - * For example, with the default settings, no arguments are needed to produce a circle with area 64 square pixels. - * - * @param d The datum for which the symbol is to be generated. - */ - (this: This, d?: Datum, ...args: any[]): string | null; - /** - * Generates an symbol for the given arguments. - * - * IMPORTANT: If the symbol generator has been configured with a rendering context, - * then the symbol is rendered to this context as a sequence of path method calls and this function returns void. - * - * The "this" context within which this function is invoked, will be the context within which the accessor methods of the generator are invoked. - * All arguments passed into this function, will be passed to the accessor functions of the generator. - * - * For example, with the default settings, no arguments are needed to produce a circle with area 64 square pixels. - * - * @param d The datum for which the symbol is to be generated. - */ - (this: This, d?: Datum, ...args: any[]): void; - /** - * Returns the current size accessor, which defaults to a function returning a constant value of 64. - */ - size(): (this: This, d: Datum, ...args: any[]) => number; - /** - * Sets the size to the specified number and returns this symbol generator. - * - * @param size A fixed size (area in square pixels). - */ - size(size: number): this; - /** - * Sets the size to the specified function and returns this symbol generator. - * - * Specifying the size as a function is useful for constructing a scatterplot with a size encoding. - * If you wish to scale the symbol to fit a given bounding box, rather than by area, try SVG’s getBBox. - * - * @param size An accessor function returning a number to be used as a symbol size. The accessor function is invoked in the same "this" context as the generator was invoked in and - * receives the same arguments that were passed into the symbol generator. - */ - size(size: (this: This, d: Datum, ...args: any[]) => number): this; - - /** - * Returns the current symbol type accessor, which defaults to a function returning the circle symbol type. - */ - type(): (this: This, d: Datum, ...args: any[]) => SymbolType; - /** - * Sets the symbol type to the specified symbol type and returns this symbol generator. - * - * - * @param type A constant symbol type. - */ - type(type: SymbolType): this; - /** - * Sets the symbol type to the specified function and returns this symbol generator. - * - * @param type An accessor function returning a symbol type. The accessor function is invoked in the same "this" context as the generator was invoked in and - * receives the same arguments that were passed into the symbol generator. See symbols for the set of built-in symbol types. - * To implement a custom symbol type, return an object that implements symbolType.draw. - */ - type(type: (this: This, d: Datum, ...args: any[]) => SymbolType): this; - - /** - * Returns the current rendering context, which defaults to null. - */ - context(): CanvasRenderingContext2D | null; - /** - * Sets the rendering context and returns this symbol generator. - * - * If the context is not null, then the generated symbol is rendered to this context as a sequence of path method calls. - * - * @param context The rendering context. - */ - context(context: CanvasRenderingContext2D): this; - /** - * Sets the rendering context to null and returns this symbol generator. - * - * A path data string representing the generated symbol will be returned when the generator is invoked with data. - * - * @param context null, to remove rendering context. - */ - context(context: null): this; - -} - -/** - * Constructs a new symbol generator with the default settings. - */ -export function symbol(): Symbol; - -/** - * Constructs a new symbol generator with the default settings. - * - * The generic corrsponds to the data type of the datum underlying the symbol. - */ -export function symbol(): Symbol; - -/** - * Constructs a new symbol generator with the default settings. - * - * The first generic corresponds to the "this" context within which the symbol generator is invoked. - * The second generic corrsponds to the data type of the datum underlying the symbol. - */ -export function symbol(): Symbol; - -/** - * An array containing the set of all built-in symbol types: circle, cross, diamond, square, star, triangle, and wye. - * Useful for constructing the range of an ordinal scale should you wish to use a shape encoding for categorical data. - */ -export var symbols: SymbolType[]; - -/** - * The circle symbol type. - */ -export var symbolCircle: SymbolType; - -/** - * The Greek cross symbol type, with arms of equal length. - */ -export var symbolCross: SymbolType; - -/** - * The rhombus symbol type. - */ -export var symbolDiamond: SymbolType; - -/** - * The square symbol type. - */ -export var symbolSquare: SymbolType; - -/** - * The pentagonal star (pentagram) symbol type. - */ -export var symbolStar: SymbolType; - -/** - * he up-pointing triangle symbol type. - */ -export var symbolTriangle: SymbolType; - -/** - * The Y-shape symbol type. - */ -export var symbolWye: SymbolType; - - -// ----------------------------------------------------------------------------------- -// STACKS -// ----------------------------------------------------------------------------------- - -/** - * Each series point j in a stack chart corresponds to the jth element in the input data. - * Each point is represented as an array [y0, y1] where y0 is the lower value (baseline) and y1 is the upper value (topline); - * the difference between y0 and y1 corresponds to the computed value for this point. - * - * SeriesPoint is a [number, number] two-element Array with added data and index properties - * related to the data element which formed the basis for theSeriesPoint - */ -export interface SeriesPoint extends Array { - /** - * Correponds to y0, the lower value (baseline). - */ - 0: number; - /** - * Correponds to y1, the upper value (topline). - */ - 1: number; - /** - * The data element underlying the series point. - */ - data: Datum; -} - -/** - * The series are determined by the keys accessor; each series i in the returned array corresponds to the ith key. - * Each series is an array of points, where each point j corresponds to the jth element in the input data. - * - * The key for each series is available as series.key, and the index as series.index. - */ -export interface Series extends Array> { - /** - * Key of the series - */ - key: Key; - /** - * Index of the series in the series array returned by stack generator - */ - index: number; -} - -/** - * A stack generator. - * - * Some shape types can be stacked, placing one shape adjacent to another. - * For example, a bar chart of monthly sales might be broken down into a multi-series bar chart by product category, stacking bars vertically. - * This is equivalent to subdividing a bar chart by an ordinal dimension (such as product category) and applying a color encoding. - * - * Stacked charts can show overall value and per-category value simultaneously; however, it is typically harder to compare across categories, as only the bottom layer of the stack is aligned. - * So, chose the stack order carefully, and consider a streamgraph. (See also grouped charts.) - * - * Like the pie generator, the stack generator does not produce a shape directly. Instead it computes positions which you can then pass to an area generator or use directly, say to position bars. - * - * The first generic corresponds to the "this" context in which the stack generator and its accessor functions are invoked. - * - * The second generic corresponds to the data type of an element in the data array passed into the stack generator. - * - * The third generic corresponds to the data type of key used to identify a series. - */ -export interface Stack { - /** - * Generates a stack for the given array of data, returning an array representing each series. - * The resulting array has one element per series. Each series in then typically passed to an area generator to render an area chart, - * or used to construct rectangles for a bar chart. - * - * Any additional arguments are arbitrary; they are simply propagated to the generator’s accessor functions along with the this object. - * - * @param data Array of data elements. - */ - (data: Datum[], ...args: any[]): Array>; - - /** - * Returns the current keys accessor, which defaults to the empty array. - */ - keys(): (this: This, data: Datum[], ...args: any[]) => Key[]; - /** - * Sets the keys accessor to the specified function or array and returns this stack generator. - * - * A series (layer) is generated for each key. Keys are typically strings, but they may be arbitrary values. - * The series’ key is passed to the value accessor, along with each data point, to compute the point’s value. - * - * @param keys An array of keys. - */ - keys(keys: Key[]): this; - /** - * Sets the keys accessor to the specified function or array and returns this stack generator. - * - * A series (layer) is generated for each key. Keys are typically strings, but they may be arbitrary values. - * The series’ key is passed to the value accessor, along with each data point, to compute the point’s value. - * - * @param keys An accessor function returning the array of keys. - * The accessor function is invoked with the "this" context of the Stack generator and passed the same arguments passed into the generator. - */ - keys(keys: (this: This, data: Datum[], ...args: any[]) => Key[]): this; - - /** - * Returns the current value accessor, which defaults to a function return the property corresponding to the relevant key from the data element. - * - * Thus, by default the stack generator assumes that the input data is an array of objects, with each object exposing named properties with numeric values; see stack for an example. - */ - value(): (d: Datum, key: Key, j: number, data: Datum[]) => number; - /** - * Sets the value accessor to the specified number and returns this stack generator. - * - * @param value A constant value. - */ - value(value: number): this; - /** - * Sets the value accessor to the specified function and returns this stack generator. - * - * @param value A value accessor function which returns the numeric value for a given data element and key combination. The accessor function is invoked for each data element and key being passed - * the datum, the key, index of the data element in the input data array, and the complete data array. - */ - value(value: (d: Datum, key: Key, j: number, data: Datum[]) => number): this; - - /** - * Returns the current order acccesor, which defaults to stackOrderNone; this uses the order given by the key accessor. - */ - order(): (series: Series) => number[]; - /** - * Reset the order to use stackOrderNone; this uses the order given by the key accessor. - * - * @param order null to set to the default stackOrderNone. - */ - order(order: null): this; - /** - * Sets the order accessor to the specified array and returns this stack generator. - * - * The stack order is computed prior to the offset; thus, the lower value for all points is zero at the time the order is computed. - * The index attribute for each series is also not set until after the order is computed. - * - * @param order An array of numeric indexes representing the stack order. - */ - order(order: number[]): this; - /** - * Sets the order accessor to the specified function and returns this stack generator. - * - * The stack order is computed prior to the offset; thus, the lower value for all points is zero at the time the order is computed. - * The index attribute for each series is also not set until after the order is computed. - * - * See stack orders for the built-in orders. - * - * @param order A function returning a sort order array. It is passed the generated series array and must return an array of numeric indexes representing the stack order. - */ - order(order: (series: Series) => number[]): this; - - /** - * Returns the current offset acccesor, which defaults to stackOffsetNone; this uses a zero baseline. - */ - offset(): (series: Series, order: number[]) => void; - /** - * Reset the offset to use stackOffsetNone; this uses a zero baseline. - * - * @param offset null to set to the default stackOffsetNone. - */ - offset(offset: null): this; - /** - * Sets the offset accessor to the specified function and returns this stack generator. - * - * @param offset A function which is passed the generated series array and the order index array. - * The offset function is then responsible for updating the lower and upper values in the series array to layout the stack. - */ - offset(offset: (series: Series, order: number[]) => void): this; - -} - -/** - * Constructs a new stack generator with the default settings. - * - * Ensure that the accessors used with the stack generator correspond to the arguments passed into them. - */ -export function stack(): Stack; -/** - * Constructs a new stack generator with the default settings. - * - * Ensure that the accessors used with the stack generator correspond to the arguments passed into them. - * - * The generic corresponds to the data type of an element in the data array passed into the stack generator. - */ -export function stack(): Stack; -/** - * Constructs a new stack generator with the default settings. - * - * Ensure that the accessors used with the stack generator correspond to the arguments passed into them. - * - * The first generic corresponds to the data type of an element in the data array passed into the stack generator. - * - * The second generic corresponds to the data type of key used to identify a series. - */ -export function stack(): Stack; -/** - * Constructs a new stack generator with the default settings. - * - * Ensure that the accessors used with the stack generator correspond to the arguments passed into them. - * - * The first generic corresponds to the "this" context in which the stack generator and its accessor functions are invoked. - * - * The second generic corresponds to the data type of an element in the data array passed into the stack generator. - * - * The third generic corresponds to the data type of key used to identify a series. - */ -export function stack(): Stack; - -/** - * Returns a series order such that the smallest series (according to the sum of values) is at the bottom. - * - * @param series A series generated by a stack generator - */ -export function stackOrderAscending(series: Series): number[]; - -/** - * Returns a series order such that the largest series (according to the sum of values) is at the bottom. - * - * @param series A series generated by a stack generator - */ -export function stackOrderDescending(series: Series): number[]; - -/** - * Returns a series order such that the larger series (according to the sum of values) are on the inside and the smaller series are on the outside. - * This order is recommended for streamgraphs in conjunction with the wiggle offset. See Stacked Graphs—Geometry & Aesthetics by Bryon & Wattenberg for more information. - * - * @param series A series generated by a stack generator - */ -export function stackOrderInsideOut(series: Series): number[]; - -/** - * Returns the given series order [0, 1, … n - 1] where n is the number of elements in series. Thus, the stack order is given by the key accessor. - * - * @param series A series generated by a stack generator - */ -export function stackOrderNone(series: Series): number[]; - -/** - * Returns the reverse of the given series order [n - 1, n - 2, … 0] where n is the number of elements in series. Thus, the stack order is given by the reverse of the key accessor. - * - * @param series A series generated by a stack generator - */ -export function stackOrderReverse(series: Series): number[]; - -/** - * Applies a zero baseline and normalizes the values for each point such that the topline is always one. - * - * @param series A series generated by a stack generator - * @param order An array of numeric indexes representing the stack order. - */ -export function stackOffsetExpand(series: Series, order: number[]): void; - -/** - * Applies a zero baseline. - * - * @param series A series generated by a stack generator - * @param order An array of numeric indexes representing the stack order. - */ -export function stackOffsetNone(series: Series, order: number[]): void; - -/** - * Shifts the baseline down such that the center of the streamgraph is always at zero. - * - * @param series A series generated by a stack generator - * @param order An array of numeric indexes representing the stack order. - */ -export function stackOffsetSilhouette(series: Series, order: number[]): void; - -/** - * Shifts the baseline so as to minimize the weighted wiggle of layers. This offset is recommended for streamgraphs in conjunction with the inside-out order. - * See Stacked Graphs—Geometry & Aesthetics by Bryon & Wattenberg for more information. - * - * @param series A series generated by a stack generator - * @param order An array of numeric indexes representing the stack order. - */ -export function stackOffsetWiggle(series: Series, order: number[]): void; diff --git a/d3-shape/tslint.json b/d3-shape/tslint.json deleted file mode 100644 index 68d10d72a6..0000000000 --- a/d3-shape/tslint.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "../tslint.json", - "rules": { - "unified-signatures": false - } -} diff --git a/d3-transition/index.d.ts b/d3-transition/index.d.ts deleted file mode 100644 index e2e49f6c2a..0000000000 --- a/d3-transition/index.d.ts +++ /dev/null @@ -1,582 +0,0 @@ -// Type definitions for D3JS d3-transition module 1.0 -// Project: https://github.com/d3/d3-transition/ -// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -// Last module patch version validated against: 1.0.3 - -import { ArrayLike, BaseType, Selection, ValueFn } from 'd3-selection'; - -/** - * Extend interface 'Selection' by declaration merging with 'd3-selection' - */ -declare module 'd3-selection' { - /** - * A D3 Selection of elements. - * - * The first generic "GElement" refers to the type of the selected element(s). - * The second generic "Datum" refers to the type of the datum of a selected element(s). - * The third generic "PElement" refers to the type of the parent element(s) in the D3 selection. - * The fourth generic "PDatum" refers to the type of the datum of the parent element(s). - */ - export interface Selection { - /** - * Interrupts the active transition of the specified name on the selected elements, and cancels any pending transitions with the specified name, if any. - * If a name is not specified, null is used. - * - * IMPORTANT: Interrupting a transition on an element has no effect on any transitions on any descendant elements. - * For example, an axis transition consists of multiple independent, synchronized transitions on the descendants of the axis G element - * (the tick lines, the tick labels, the domain path, etc.). To interrupt the axis transition, you must therefore interrupt the descendants. - * - * @param name Name of the transition. - */ - interrupt(name?: string): Transition; - /** - * Returns a new transition on the given selection with the specified name. If a name is not specified, null is used. - * The new transition is only exclusive with other transitions of the same name. - * - * @param name Name of the transition. - */ - transition(name?: string): Transition; - /** - * Returns a new transition on the given selection. - * - * When using a transition instance, the returned transition has the same id and name as the specified transition. - * If a transition with the same id already exists on a selected element, the existing transition is returned for that element. - * Otherwise, the timing of the returned transition is inherited from the existing transition of the same id on the nearest ancestor of each selected element. - * Thus, this method can be used to synchronize a transition across multiple selections, - * or to re-select a transition for specific elements and modify its configuration. - * - * If the specified transition is not found on a selected node or its ancestors (such as if the transition already ended), - * the default timing parameters are used; however, in a future release, this will likely be changed to throw an error. - * - * @param transition A transition instance. - */ - transition(transition: Transition): Transition; - } -} - -/** - * Return the active transition on the specified node with the specified name, if any. - * If no name is specified, null is used. Returns null if there is no such active transition on the specified node. - * This method is useful for creating chained transitions. - * - * The first generic "GElement" refers to the type of element on which the returned active transition was defined. The second generic "Datum" refers to the type of the - * datum, of a selected element on which the transition is defined. The third generic refers to the type of the parent elements in the returned Transition. - * The fourth generic refers to the type of the datum defined on the parent elements in the returned Transition. - * - * @param node Element for which the active transition should be returned. - * @param name Name of the transition. - */ -export function active(node: GElement, name?: string): Transition | null; - -/** - * Interrupts the active transition of the specified name on the specified node, and cancels any pending transitions with the specified name, if any. - * If a name is not specified, null is used. - * - * @param node Element for which the transition should be interrupted. - * @param name Name of the transition to be interrupted. If a name is not specified, null is used. - */ -export function interrupt(node: BaseType, name?: string): void; - -/** - * A D3 Transition. - * - * The first generic "GElement" refers to the type of the selected element(s) in the Transition. - * The second generic "Datum" refers to the type of the datum of a selected element(s) in the Transition. - * The third generic "PElement" refers to the type of the parent element(s) in the D3 selection in the Transition. - * The fourth generic "PDatum" refers to the type of the datum of the parent element(s) in the Transition. - */ -export interface Transition { - - // Sub-selection ------------------------- - - /** - * For each selected element, select the first descendant element that matches the specified selector string, if any, - * and returns a transition on the resulting selection. The new transition has the same id, name and timing as this transition; - * however, if a transition with the same id already exists on a selected element, - * the existing transition is returned for that element. - * - * The generic represents the type of the descendant element to be selected. - * - * @param selector CSS selector string - */ - select(selector: string): Transition; - /** - * For each selected element, select the descendant element returned by the selector function, if any, - * and returns a transition on the resulting selection. The new transition has the same id, name and timing as this transition; - * however, if a transition with the same id already exists on a selected element, - * the existing transition is returned for that element. - * - * The generic represents the type of the descendant element to be selected. - * - * @param selector A selector function, which is evaluated for each selected element, in order, being passed the current datum (d), - * the current index (i), and the current group (nodes), with this as the current DOM element. - * It must return an element, or null if there is no matching element. - */ - select(selector: ValueFn): Transition; - - /** - * For each selected element, select all descendant elements that match the specified selector string, if any, - * and returns a transition on the resulting selection. The new transition has the same id, name and timing as this transition; - * however, if a transition with the same id already exists on a selected element, the existing transition is returned for that element. - * - * The first generic "DescElement" refers to the type of descendant element to be selected. The second generic "OldDatum" refers to the type of the - * datum, of a selected element. This is useful when re-selecting elements with a previously set, know datum type. - * - * @param selector CSS selector string - */ - selectAll(selector: string): Transition; - /** - * For each selected element, select all descendant elements returned by the selector function, if any, - * and returns a transition on the resulting selection. The new transition has the same id, name and timing as this transition; - * however, if a transition with the same id already exists on a selected element, the existing transition is returned for that element. - * - * The first generic "DescElement" refers to the type of descendant element to be selected. The second generic "OldDatum" refers to the type of the - * datum, of a selected element. This is useful when re-selecting elements with a previously set, know datum type. - * - * @param selector A selector function which is evaluated for each selected element, in order, being passed the current datum (d), - * the current index (i), and the current group (nodes), with this as the current DOM element. It must return an array of elements - * (or a pseudo-array, such as a NodeList), or the empty array if there are no matching elements. - */ - selectAll(selector: ValueFn>): Transition; - - /** - * Return the selection corresponding to this transition. - */ - selection(): Selection; - - /** - * Returns a new transition on the same selected elements as this transition, scheduled to start when this transition ends. - * The new transition inherits a reference time equal to this transition’s time plus its delay and duration. - * The new transition also inherits this transition’s name, duration, and easing. - * This method can be used to schedule a sequence of chained transitions. - * - * A delay configured for the new transition will be relative to the previous transition. - */ - transition(): Transition; - - // Modifying ------------------------------- - - /** - * For each selected element, the attribute with the specified name will be cleared at the start of the transition. - * - * @param name Name of the attribute. - * @param value Use null to clear the attribute. - */ - attr(name: string, value: null): this; - /** - * For each selected element, assigns the attribute tween for the attribute with the specified name to the specified target value. - * The starting value of the tween is the attribute’s value when the transition starts. - * The target value is the specified constant value for all elements. - * - * An interpolator is chosen based on the type of the target value, using the following algorithm: - * 1.) If value is a number, use interpolateNumber. - * 2.) If value is a color or a string coercible to a color, use interpolateRgb. - * 3.) Use interpolateString. - * - * To apply a different interpolator, use transition.attrTween. - * - * @param name Name of the attribute. - * @param value Target value for the attribute. - */ - attr(name: string, value: string | number | boolean): this; - /** - * For each selected element, assigns the attribute tween for the attribute with the specified name to the specified target value. - * The starting value of the tween is the attribute’s value when the transition starts. - * The target value is return value of the value function evaluated for the selected element. - * - * An interpolator is chosen based on the type of the target value, using the following algorithm: - * 1.) If value is a number, use interpolateNumber. - * 2.) If value is a color or a string coercible to a color, use interpolateRgb. - * 3.) Use interpolateString. - * - * To apply a different interpolator, use transition.attrTween. - * - * @param name Name of the attribute. - * @param value A value function which is evaluated for each selected element, in order, being passed the current datum (d), - * the current index (i), and the current group (nodes), with this as the current DOM element. - * A null value will clear the attribute at the start of the transition. - */ - attr(name: string, value: ValueFn): this; - - /** - * Return the current interpolator factory for attribute with the specified name, or undefined if no such tween exists. - * - * @param name Name of attribute. - */ - attrTween(name: string): ValueFn string> | undefined; - /** - * Remove the previously-assigned attribute tween of the specified name, if any. - * - * @param name Name of attribute. - * @param factory Use null to remove previously-assigned attribute tween. - */ - attrTween(name: string, factory: null): this; - /** - * Assign the attribute tween for the attribute with the specified name to the specified interpolator factory. - * An interpolator factory is a function that returns an interpolator; when the transition starts, the factory is evaluated for each selected element. - * The returned interpolator will then be invoked for each frame of the transition, in order, - * being passed the eased time t, typically in the range [0, 1]. Lastly, the return value of the interpolator will be used to set the attribute value. - * The interpolator must return a string. - * - * @param name Name of attribute. - * @param factory An interpolator factory which is evaluated for each selected element, in order, being passed the current datum (d), - * the current index (i), and the current group (nodes), with this as the current DOM element. The interpolator factory returns a string interpolator, - * which takes as its argument eased time t, typically in the range [0, 1] and returns the interpolated string. - */ - attrTween(name: string, factory: ValueFn string>): this; - - /** - * For each selected element, the style with the specified name will be cleared at the start of the transition. - * - * @param name Name of the style. - * @param value Use null to clear the style. - */ - style(name: string, value: null): this; - /** - * For each selected element, assigns the style tween for the style with the specified name to the specified target value. - * The starting value of the tween is the style’s value when the transition starts. - * The target value is the specified constant value for all elements. - * - * An interpolator is chosen based on the type of the target value, using the following algorithm: - * 1.) If value is a number, use interpolateNumber. - * 2.) If value is a color or a string coercible to a color, use interpolateRgb. - * 3.) Use interpolateString. - * - * To apply a different interpolator, use transition.attrTween. - * - * @param name Name of the style. - * @param value Target value for the style. - * @param priority An optional priority flag, either null or the string important (without the exclamation point) - */ - style(name: string, value: string | number | boolean, priority?: null | 'important'): this; - /** - * For each selected element, assigns the style tween for the style with the specified name to the specified target value. - * The starting value of the tween is the style's value when the transition starts. - * The target value is return value of the value function evaluated for the selected element. - * - * An interpolator is chosen based on the type of the target value, using the following algorithm: - * 1.) If value is a number, use interpolateNumber. - * 2.) If value is a color or a string coercible to a color, use interpolateRgb. - * 3.) Use interpolateString. - * - * To apply a different interpolator, use transition.attrTween. - * - * @param name Name of the style. - * @param value A value function which is evaluated for each selected element, in order, being passed the current datum (d), - * the current index (i), and the current group (nodes), with this as the current DOM element. - * A null value will clear the style at the start of the transition. - * @param priority An optional priority flag, either null or the string important (without the exclamation point) - */ - style(name: string, value: ValueFn, priority?: null | 'important'): this; - - /** - * Return the current interpolator factory for style with the specified name, or undefined if no such tween exists. - * - * @param name Name of style. - */ - styleTween(name: string): ValueFn string> | undefined; - /** - * Remove the previously-assigned style tween of the specified name, if any. - * - * @param name Name of style. - * @param factory Use null to remove previously-assigned style tween. - */ - styleTween(name: string, factory: null): this; - /** - * Assign the style tween for the style with the specified name to the specified interpolator factory. - * An interpolator factory is a function that returns an interpolator; when the transition starts, the factory is evaluated for each selected element. - * The returned interpolator will then be invoked for each frame of the transition, in order, - * being passed the eased time t, typically in the range [0, 1]. Lastly, the return value of the interpolator will be used to set the style value. - * The interpolator must return a string. - * - * @param name Name of style. - * @param factory An interpolator factory which is evaluated for each selected element, in order, being passed the current datum (d), - * the current index (i), and the current group (nodes), with this as the current DOM element. The interpolator factory returns a string interpolator, - * which takes as its argument eased time t, typically in the range [0, 1] and returns the interpolated string. - * @param priority An optional priority flag, either null or the string important (without the exclamation point) - */ - styleTween(name: string, factory: ValueFn string>, priority?: null | 'important'): this; - - /** - * For each selected element, the text content will be cleared, replacing any existing child elements. - * - * @param value Use null to clear the text content. - */ - text(value: null): this; - /** - * For each selected element, sets the text content to the specified target value when the transition starts. - * To interpolate text rather than to set it on start, use transition.tween (for example) or - * append a replacement element and cross-fade opacity (for example). Text is not interpolated by default because it is usually undesirable. - * - * @param value Value used for text content - */ - text(value: string | number | boolean): this; - /** - * For each selected element, sets the text content returned by the value function for each selected element when the transition starts. - * - * To interpolate text rather than to set it on start, use transition.tween (for example) or - * append a replacement element and cross-fade opacity (for example). Text is not interpolated by default because it is usually undesirable. - * - * @param value A value function which is evaluated for each selected element, in order, being passed the current datum (d), - * the current index (i), and the current group (nodes), with this as the current DOM element. - * A null value will clear the text content at the start of the transition. - */ - text(value: ValueFn): this; - - /** - * Returns the tween with the specified name, or undefined, if no tween was previously assigned to - * that name. - * - * @param name Name of tween. - */ - tween(name: string): ValueFn void> | undefined; - /** - * Removes the tween with the specified name, if a tween was previously assigned to - * that name. - * - * @param name Name of tween. - * @param tweenFn Use null to remove a previously-assigned tween. - */ - tween(name: string, tweenFn: null): this; - /** - * For each selected element, assigns the tween with the specified name with the specified value function. - * The value must be specified as a function that returns a function. - * When the transition starts, the value function is evaluated for each selected element. - * The returned function is then invoked for each frame of the transition, in order, - * being passed the eased time t, typically in the range [0, 1]. - * - * @param name Name of tween. - * @param tweenFn A tween function which is evaluated for each selected element, in order, being passed the current datum (d), - * the current index (i), and the current group (nodes), with this as the current DOM element. The tween function returns a function - * which takes as its argument eased time t, typically in the range [0, 1] and performs the tweening activities for each transition frame. - */ - tween(name: string, tweenFn: ValueFn void>): this; - - /** - * For each selected element, removes the element when the transition ends, as long as the element has no other active or pending transitions. - * If the element has other active or pending transitions, does nothing. - */ - remove(): this; - - /** - * Returns a new transition merging this transition with the specified other transition, - * which must have the same id as this transition. The returned transition has the same number of groups, - * the same parents, the same name and the same id as this transition. - * Any missing (null) elements in this transition are filled with the corresponding element, if present (not null), from the other transition. - * - * @param other The transition to be merged. - */ - merge(other: Transition): Transition; - - /** - * For each selected element, selects only the elements that match the specified filter, and returns a transition on the resulting selection. - * - * The new transition has the same id, name and timing as this transition; however, if a transition with the same id already exists on a selected element, - * the existing transition is returned for that element. - * - * @param filter A CSS selector string. - */ - filter(filter: string): Transition; - /** - * For each selected element, selects only the elements that match the specified filter, and returns a transition on the resulting selection. - * - * The new transition has the same id, name and timing as this transition; however, if a transition with the same id already exists on a selected element, - * the existing transition is returned for that element. - * - * The generic refers to the type of element which will be selected after applying the filter, i.e. if the element types - * contained in a pre-filter selection are narrowed to a subset as part of the filtering. - * - * @param filter A CSS selector string. - */ - filter(filter: string): Transition; - /** - * For each selected element, selects only the elements that match the specified filter, and returns a transition on the resulting selection. - * - * The new transition has the same id, name and timing as this transition; however, if a transition with the same id already exists on a selected element, - * the existing transition is returned for that element. - * - * @param filter A filter function which is evaluated for each selected element, in order, being passed the current datum (d), - * the current index (i), and the current group (nodes), with this as the current DOM element. The filter function returns a boolean indicating, - * whether the selected element matches. - */ - filter(filter: ValueFn): Transition; - /** - * For each selected element, selects only the elements that match the specified filter, and returns a transition on the resulting selection. - * - * The new transition has the same id, name and timing as this transition; however, if a transition with the same id already exists on a selected element, - * the existing transition is returned for that element. - * - * The generic refers to the type of element which will be selected after applying the filter, i.e. if the element types - * contained in a pre-filter selection are narrowed to a subset as part of the filtering. - * - * @param filter A filter function which is evaluated for each selected element, in order, being passed the current datum (d), - * the current index (i), and the current group (nodes), with this as the current DOM element. The filter function returns a boolean indicating, - * whether the selected element matches. - */ - filter(filter: ValueFn): Transition; - - // Event Handling ------------------- - - /** - * Return the currently-assigned listener for the specified event typename on the first (non-null) selected element, if any. - * If multiple typenames are specified, the first matching listener is returned. - * - * @param typenames The typenames is one of the following string event types: start (when the transition starts), end (when the transition ends), - * interrupt (when the transition is interrupted.) Note that these are not native DOM events. The type may be optionally followed by a period (.) and a name; - * the optional name allows multiple callbacks to be registered to receive events of the same type, such as "start.foo"" and "start.bar". - * To specify multiple typenames, separate typenames with spaces, such as "interrupt end"" or "start.foo start.bar". - */ - on(type: string): ValueFn | undefined; - /** - * Remove all listeners for a given name. - * - * @param typenames Name of the event type for which the listener should be removed. To remove all listeners for a given name use ".foo" - * as the typename, where foo is the name; to remove all listeners with no name, specify "." as the typename. - * @param listener Use null to remove listeners. - */ - on(typenames: string, listener: null): this; - /** - * Add a listener to each selected element for the specified event typenames. - * - * When a specified transition event is dispatched on a selected node, the specified listener will be invoked for each transitioning element. - * Listeners always see the latest datum for their element, but the index is a property of the selection and is fixed when the listener is assigned; - * to update the index, re-assign the listener. - * - * @param typenames The typenames is one of the following string event types: start (when the transition starts), end (when the transition ends), - * interrupt (when the transition is interrupted.) Note that these are not native DOM events. The type may be optionally followed by a period (.) and a name; - * the optional name allows multiple callbacks to be registered to receive events of the same type, such as "start.foo"" and "start.bar". - * To specify multiple typenames, separate typenames with spaces, such as "interrupt end"" or "start.foo start.bar". - * @param listener A listener function which will be evaluated for each selected element, being passed the current datum (d), the current index (i), - * and the current group (nodes), with this as the current DOM element. Listeners always see the latest datum for their element, - * but the index is a property of the selection and is fixed when the listener is assigned; to update the index, re-assign the listener. - */ - on(type: string, listener: ValueFn): this; - - // Control Flow ---------------------- - - /** - * Invoke the specified function for each selected element, passing the current datum (d), - * the current index (i), and the current group (nodes), with this of the current DOM element. - * This method can be used to invoke arbitrary code for each selected element, and is useful for creating a context to access parent and child data simultaneously. - * - * @param func A function which is invoked for each selected element, - * being passed the current datum (d), the current index (i), and the current group (nodes), with this of the current DOM element. - */ - each(func: ValueFn): this; - - /** - * Invoke the specified function exactly once, passing in this transition along with any optional arguments. - * Returns this transition. - * - * @param func A function which is passed this transition as the first argument along with any optional arguments. - * @param args List of optional arguments to be passed to the callback function. - */ - call(func: (transition: Transition, ...args: any[]) => any, ...args: any[]): this; - - /** - * Return true if this transition contains no (non-null) elements. - */ - empty(): boolean; - - /** - * Return the first (non-null) element in this transition. If the transition is empty, returns null. - */ - node(): GElement | null; - - /** - * Return an array of all (non-null) elements in this transition. - */ - nodes(): GElement[]; - - /** - * Returns the total number of elements in this transition. - */ - size(): number; - - // Transition Configuration ---------------------- - - /** - * Returns the current value of the delay for the first (non-null) element in the transition. - * This is generally useful only if you know that the transition contains exactly one element. - */ - delay(): number; - /** - * For each selected element, sets the transition delay to the specified value in milliseconds. - * If a delay is not specified, it defaults to zero. - * - * @param milliseconds Number of milliseconds for the delay. - */ - delay(milliseconds: number): this; - /** - * For each selected element, sets the transition delay to the value in milliseconds returned by the - * value function. - * - * @param milliseconds A value function which is evaluated for each selected element, being passed the current datum (d), - * the current index (i), and the current group (nodes), with this of the current DOM element. The return value is a number - * specifying the delay in milliseconds. - */ - delay(milliseconds: ValueFn): this; - - /** - * Returns the current value of the duration for the first (non-null) element in the transition. - * This is generally useful only if you know that the transition contains exactly one element. - */ - duration(): number; - /** - * For each selected element, sets the transition duration to the specified value in milliseconds. - * If a duration is not specified, it defaults to 250ms. - * - * @param duration Number of milliseconds for the duration. - */ - duration(milliseconds: number): this; - /** - * For each selected element, sets the transition duration to the value in milliseconds returned by the - * value function. - * - * @param milliseconds A value function which is evaluated for each selected element, being passed the current datum (d), - * the current index (i), and the current group (nodes), with this of the current DOM element. The return value is a number - * specifying the duration in milliseconds. - */ - duration(milliseconds: ValueFn): this; - - /** - * Returns the current easing function for the first (non-null) element in the transition. - * This is generally useful only if you know that the transition contains exactly one element. - */ - ease(): (normalizedTime: number) => number; - /** - * Specifies the transition easing function for all selected elements. The value must be specified as a function. - * The easing function is invoked for each frame of the animation, being passed the normalized time t in the range [0, 1]; - * it must then return the eased time tʹ which is typically also in the range [0, 1]. - * A good easing function should return 0 if t = 0 and 1 if t = 1. If an easing function is not specified, - * it defaults to d3.easeCubic. - * - * @param easingFn An easing function which is passed the normalized time t in the range [0, 1]; - * it must then return the eased time tʹ which is typically also in the range [0, 1]. - * A good easing function should return 0 if t = 0 and 1 if t = 1. - */ - ease(easingFn: (normalizedTime: number) => number): this; -} - -/** - * Returns a new transition with the specified name. If a name is not specified, null is used. - * The new transition is only exclusive with other transitions of the same name. - * - * The generic "OldDatum" refers to the type of a previously-set datum of the selected HTML element in the Transition. - * - * @param name Name of the transition. - */ -export function transition(name: string): Transition; - -/** - * Returns a new transition from an existing transition. - * - * When using a transition instance, the returned transition has the same id and name as the specified transition. - * - * The generic "OldDatum" refers to the type of a previously-set datum of the selected HTML element in the Transition. - * - * @param transition A transition instance. - */ -export function transition(transition: Transition): Transition; diff --git a/d3-transition/tslint.json b/d3-transition/tslint.json deleted file mode 100644 index 68d10d72a6..0000000000 --- a/d3-transition/tslint.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "../tslint.json", - "rules": { - "unified-signatures": false - } -} diff --git a/d3-zoom/index.d.ts b/d3-zoom/index.d.ts deleted file mode 100644 index 87a55e9b2a..0000000000 --- a/d3-zoom/index.d.ts +++ /dev/null @@ -1,726 +0,0 @@ -// Type definitions for d3JS d3-zoom module 1.1 -// Project: https://github.com/d3/d3-zoom/ -// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -// Last module patch version validated against: 1.1.1 - -import { ArrayLike, Selection, TransitionLike, ValueFn } from 'd3-selection'; -import { ZoomView, ZoomInterpolator } from 'd3-interpolate'; - - -// -------------------------------------------------------------------------- -// Shared Type Definitions and Interfaces -// -------------------------------------------------------------------------- - -/** - * ZoomedElementBaseType serves as an alias for the 'minimal' data type which can be selected - * without 'd3-zoom' (and related code in 'd3-selection') trying to use properties internally which would otherwise not - * be supported. - */ -type ZoomedElementBaseType = Element; - -/** - * Minimal interface for a continuous scale. - * This interface is used as a minimum contract for scale objects - * that can be passed into zoomTransform methods rescaleX and rescaleY - */ -export interface ZoomScale { - domain(): number[]; - domain(domain: number[]): this; - range(): number[]; - range(range: number[]): this; - copy(): ZoomScale; - invert(value: number): number; -} - -// -------------------------------------------------------------------------- -// Zoom Behavior -// -------------------------------------------------------------------------- - -/** - * A D3 Zoom Behavior - * - * The first generic refers to the type of reference element to which the zoom behavior is attached. - * The second generic refers to the type of the datum of the reference element. - */ -export interface ZoomBehavior extends Function { - /** - * Applies this zoom behavior to the specified selection, binding the necessary event listeners to - * allow panning and zooming, and initializing the zoom transform on each selected element to the identity transform if not already defined. This function is typically not invoked directly, - * and is instead invoked via selection.call. - * - * For details see: {@link https://github.com/d3/d3-zoom#_zoom} - * - * @param selection A D3 selection of elements. - * @param args Optional arguments to be passed in. - */ - (selection: Selection, ...args: any[]): void; - /** - * Sets the current zoom transform of the selected elements to the specified transform, - * instantaneously emitting start, zoom and end events. - * - * This method requires that you specify the new zoom transform completely, - * and does not enforce the defined scale extent and translate extent, if any. - * To derive a new transform from the existing transform, and to enforce the scale and translate extents, - * see the convenience methods zoom.translateBy, zoom.scaleBy and zoom.scaleTo. - * - * This function is typically not invoked directly, and is instead invoked via selection.call. - * - * @param selection A D3 selection of elements. - * @param transform A zoom transform object. - */ - transform(selection: Selection, transform: ZoomTransform): void; - /** - * Sets the current zoom transform of the selected elements to the transform returned by the specified - * zoom transform factory function evaluated for each element, instantaneously emitting start, zoom and end events. - * - * This method requires that you specify the new zoom transform completely, - * and does not enforce the defined scale extent and translate extent, if any. - * To derive a new transform from the existing transform, and to enforce the scale and translate extents, - * see the convenience methods zoom.translateBy, zoom.scaleBy and zoom.scaleTo. - * - * This function is typically not invoked directly, and is instead invoked via selection.call. - * - * @param selection A D3 selection of elements. - * @param transform A zoom transform factory function which is evaluated for each selected element, - * in order, being passed the current datum (d), the current index (i), and the current group (nodes), - * with this as the current DOM element. The function returns a zoom transform object. - */ - transform(selection: Selection, transform: ValueFn): void; - /** - * Sets the current zoom transform of the transitioning elements to the specified transform. - * It defines a “zoom” tween to the specified transform using d3.interpolateZoom, - * emitting a start event when the transition starts, zoom events for each tick of the transition, - * and then an end event when the transition ends (or is interrupted). - * - * This method requires that you specify the new zoom transform completely, - * and does not enforce the defined scale extent and translate extent, if any. - * To derive a new transform from the existing transform, and to enforce the scale and translate extents, - * see the convenience methods zoom.translateBy, zoom.scaleBy and zoom.scaleTo. - * - * This function is typically not invoked directly, and is instead invoked via selection.call. - * - * @param transition A D3 transition on elements. - * @param transform A zoom transform object. - */ - transform(transition: TransitionLike, transform: ZoomTransform): void; - /** - * Sets the current zoom transform of the transitioning elements to the transform returned by the specified - * zoom transform factory function evaluated for each element. - * It defines a “zoom” tween to the specified transform using d3.interpolateZoom, - * emitting a start event when the transition starts, zoom events for each tick of the transition, - * and then an end event when the transition ends (or is interrupted). - * - * This method requires that you specify the new zoom transform completely, - * and does not enforce the defined scale extent and translate extent, if any. - * To derive a new transform from the existing transform, and to enforce the scale and translate extents, - * see the convenience methods zoom.translateBy, zoom.scaleBy and zoom.scaleTo. - * - * This function is typically not invoked directly, and is instead invoked via selection.call. - * - * @param transition A D3 transition on elements. - * @param transform A zoom transform factory function which is evaluated for each selected element, - * in order, being passed the current datum (d), the current index (i), and the current group (nodes), - * with this as the current DOM element. The function returns a zoom transform object. - */ - transform(transition: TransitionLike, transform: ValueFn): void; - - /** - * Translates the current zoom transform of the selected elements by x and y, - * such that the new t(x1) = t(x0) + k × x and t(y1) = t(y0) + k × y. - * - * x is provided as a constant for all elements. - * y is provided as a constant for all elements. - * - * @param selection A D3 selection of elements. - * @param x Amount of translation in x-direction. - * @param y Amount of translation in y-direction. - */ - translateBy(selection: Selection, x: number, y: number): void; - /** - * Translates the current zoom transform of the selected elements by x and y, - * such that the new t(x1) = t(x0) + k × x and t(y1) = t(y0) + k × y. - * - * x is provided by a value function evaluated for each element in the selection. - * y is provided as a constant for all elements. - * - * This method is a convenience method for zoom.transform. - * In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExten, and zoom.translateExtent. - * - * @param selection A D3 selection of elements. - * @param x A value function which is evaluated for each selected element, - * in order, being passed the current datum (d), the current index (i), and the current group (nodes), - * with this as the current DOM element.The function returns the amount of translation in x-direction. - * @param y Amount of translation in y-direction. - */ - translateBy(selection: Selection, x: ValueFn, y: number): void; - /** - * Translates the current zoom transform of the selected elements by x and y, - * such that the new t(x1) = t(x0) + k × x and t(y1) = t(y0) + k × y. - * - * x is provided as a constant for all elements. - * y is provided by a value function evaluated for each element in the selection. - * - * This method is a convenience method for zoom.transform. - * In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExten, and zoom.translateExtent. - * - * @param selection A D3 selection of elements. - * @param x Amount of translation in x-direction. - * @param y A value function which is evaluated for each selected element, - * in order, being passed the current datum (d), the current index (i), and the current group (nodes), - * with this as the current DOM element.The function returns the amount of translation in y-direction. - */ - translateBy(selection: Selection, x: number, y: ValueFn): void; - /** - * Translates the current zoom transform of the selected elements by x and y, - * such that the new t(x1) = t(x0) + k × x and t(y1) = t(y0) + k × y. - * - * x is provided by a value function evaluated for each element in the selection. - * y is provided by a value function evaluated for each element in the selection. - * - * This method is a convenience method for zoom.transform. - * In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExten, and zoom.translateExtent. - * - * @param selection A D3 selection of elements. - * @param x A value function which is evaluated for each selected element, - * in order, being passed the current datum (d), the current index (i), and the current group (nodes), - * with this as the current DOM element.The function returns the amount of translation in x-direction. - * @param y A value function which is evaluated for each selected element, - * in order, being passed the current datum (d), the current index (i), and the current group (nodes), - * with this as the current DOM element.The function returns the amount of translation in y-direction. - */ - translateBy(selection: Selection, x: ValueFn, y: ValueFn): void; - /** - * Defines a “zoom” tween translating the current transform for the transitioning elements by x and y, - * such that the new t(x1) = t(x0) + k × x and t(y1) = t(y0) + k × y. - * - * x is provided as a constant for all elements. - * y is provided as a constant for all elements. - * - * This method is a convenience method for zoom.transform. - * In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExten, and zoom.translateExtent. - * - * @param transition A D3 transition on elements. - * @param x Amount of translation in x-direction. - * @param y Amount of translation in y-direction. - */ - translateBy(transition: TransitionLike, x: number, y: number): void; - /** - * Defines a “zoom” tween translating the current transform for the transitioning elements by x and y, - * such that the new t(x1) = t(x0) + k × x and t(y1) = t(y0) + k × y. - * - * x is provided by a value function evaluated for each element in the selection. - * y is provided as a constant for all elements. - * - * This method is a convenience method for zoom.transform. - * In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExten, and zoom.translateExtent. - * - * @param transition A D3 transition on elements. - * @param x A value function which is evaluated for each selected element, - * in order, being passed the current datum (d), the current index (i), and the current group (nodes), - * with this as the current DOM element.The function returns the amount of translation in x-direction. - * @param y Amount of translation in y-direction. - */ - translateBy(transition: TransitionLike, x: ValueFn, y: number): void; - /** - * Defines a “zoom” tween translating the current transform for the transitioning elements by x and y, - * such that the new t(x1) = t(x0) + k × x and t(y1) = t(y0) + k × y. - * - * x is provided as a constant for all elements. - * y is provided by a value function evaluated for each element in the selection. - * - * This method is a convenience method for zoom.transform. - * In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExten, and zoom.translateExtent. - * - * @param transition A D3 transition on elements. - * @param x Amount of translation in x-direction. - * @param y A value function which is evaluated for each selected element, - * in order, being passed the current datum (d), the current index (i), and the current group (nodes), - * with this as the current DOM element.The function returns the amount of translation in y-direction. - */ - translateBy(transition: TransitionLike, x: number, y: ValueFn): void; - /** - * Defines a “zoom” tween translating the current transform for the transitioning elements by x and y, - * such that the new t(x1) = t(x0) + k × x and t(y1) = t(y0) + k × y. - * - * x is provided by a value function evaluated for each element in the selection. - * y is provided by a value function evaluated for each element in the selection. - * - * This method is a convenience method for zoom.transform. - * In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExten, and zoom.translateExtent. - * - * @param transition A D3 transition on elements. - * @param x A value function which is evaluated for each selected element, - * in order, being passed the current datum (d), the current index (i), and the current group (nodes), - * with this as the current DOM element.The function returns the amount of translation in x-direction. - * @param y A value function which is evaluated for each selected element, - * in order, being passed the current datum (d), the current index (i), and the current group (nodes), - * with this as the current DOM element.The function returns the amount of translation in y-direction. - */ - translateBy(transition: TransitionLike, x: ValueFn, y: ValueFn): void; - - /** - * Scales the current zoom transform of the selected elements by k, such that the new k(1) = k(0) × k. - * - * k is provided as a constant for all elements. - * - * This method is a convenience method for zoom.transform. - * In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExten, and zoom.translateExtent. - * - * @param selection A D3 selection of elements. - * @param k Scale factor. - */ - scaleBy(selection: Selection, k: number): void; - /** - * Scales the current zoom transform of the selected elements by k, such that the new k(1) = k(0) × k. - * - * k is provided by a value function evaluated for each element in the selection. - * - * This method is a convenience method for zoom.transform. - * In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExten, and zoom.translateExtent. - * - * @param selection A D3 selection of elements. - * @param k A value function which is evaluated for each selected element, - * in order, being passed the current datum (d), the current index (i), and the current group (nodes), - * with this as the current DOM element.The function returns the scale factor. - */ - scaleBy(selection: Selection, k: ValueFn): void; - /** - * Defines a “zoom” tween translating scaling the current transform of the selected elements by k, such that the new k(1) = k(0) × k. - * - * k is provided as a constant for all elements. - * - * This method is a convenience method for zoom.transform. - * In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExten, and zoom.translateExtent. - * - * @param transition A D3 transition on elements. - * @param k Scale factor. - */ - scaleBy(transition: TransitionLike, k: number): void; - /** - * Defines a “zoom” tween translating scaling the current transform of the selected elements by k, such that the new k(1) = k(0) × k. - * - * k is provided by a value function evaluated for each element in the selection. - * - * This method is a convenience method for zoom.transform. - * In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExten, and zoom.translateExtent. - * - * @param transition A D3 transition on elements. - * @param k A value function which is evaluated for each selected element, - * in order, being passed the current datum (d), the current index (i), and the current group (nodes), - * with this as the current DOM element.The function returns the scale factor. - */ - scaleBy(transition: TransitionLike, k: ValueFn): void; - - /** - * Scales the current zoom transform of the selected elements to k, such that the new k(1) = k. - * - * k is provided as a constant for all elements. - * - * This method is a convenience method for zoom.transform. - * In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExten, and zoom.translateExtent. - * - * @param selection A D3 selection of elements. - * @param k New scale. - */ - scaleTo(selection: Selection, k: number): void; - /** - * Scales the current zoom transform of the selected elements to k, such that the new k(1) = k. - * - * k is provided by a value function evaluated for each element in the selection. - * - * This method is a convenience method for zoom.transform. - * In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExten, and zoom.translateExtent. - * - * @param selection A D3 selection of elements. - * @param k A value function which is evaluated for each selected element, - * in order, being passed the current datum (d), the current index (i), and the current group (nodes), - * with this as the current DOM element.The function returns the new scale. - */ - scaleTo(selection: Selection, k: ValueFn): void; - /** - * Defines a “zoom” tween translating scaling the current transform of the selected elements to k, such that the new k(1) = k. - * - * k is provided as a constant for all elements. - * - * This method is a convenience method for zoom.transform. - * In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExten, and zoom.translateExtent. - * - * @param transition A D3 transition on elements. - * @param k New scale. - */ - scaleTo(transition: TransitionLike, k: number): void; - /** - * Defines a “zoom” tween translating scaling the current transform of the selected elements to k, such that the new k(1) = k. - * - * k is provided by a value function evaluated for each element in the selection. - * - * This method is a convenience method for zoom.transform. - * In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExten, and zoom.translateExtent. - * - * @param transition A D3 transition on elements. - * @param k A value function which is evaluated for each selected element, - * in order, being passed the current datum (d), the current index (i), and the current group (nodes), - * with this as the current DOM element.The function returns the new scale. - */ - scaleTo(transition: TransitionLike, k: ValueFn): void; - - /** - * Returns the current filter function. - */ - filter(): ValueFn; - /** - * Sets the filter to the specified filter function and returns the zoom behavior. - * - * If the filter returns falsey, the initiating event is ignored and no zoom gesture is started. - * Thus, the filter determines which input events are ignored. The default filter ignores mousedown events on secondary buttons, - * since those buttons are typically intended for other purposes, such as the context menu. - * - * @param filterFn A filter function which is evaluated for each selected element, - * in order, being passed the current datum (d), the current index (i), and the current group (nodes), - * with this as the current DOM element. The function returns a boolean value. - */ - filter(filterFn: ValueFn): this; - - /** - * Return the current extent accessor, which defaults to [[0, 0], [width, height]] where width is the client width of the element and height is its client height; - * for SVG elements, the nearest ancestor SVG element’s width and height is used. In this case, - * the owner SVG element must have defined width and height attributes rather than (for example) relying on CSS properties or the viewBox attribute; - * SVG provides no programmatic method for retrieving the initial viewport size. Alternatively, consider using element.getBoundingClientRect. - * (In Firefox, element.clientWidth and element.clientHeight is zero for SVG elements!) - */ - extent(): ValueFn; - /** - * Set the viewport extent to the specified array of points [[x0, y0], [x1, y1]], - * where [x0, y0] is the top-left corner of the viewport and [x1, y1] is the bottom-right corner of the viewport, - * and return this zoom behavior. - * - * The viewport extent affects several functions: the center of the viewport remains fixed during changes by zoom.scaleBy and zoom.scaleTo; - * the viewport center and dimensions affect the path chosen by d3.interpolateZoom; and the viewport extent is needed to enforce the optional translate extent. - * - * @param extent An extent specified as an array of two coordinates. - */ - extent(extent: [[number, number], [number, number]]): this; - /** - * Set the viewport extent to the array of points [[x0, y0], [x1, y1]] returned by the - * extent accessor function, and return this zoom behavior. - * The extent accessor function is evaluated for each element. - * - * [x0, y0] is the top-left corner of the viewport and [x1, y1] is the bottom-right corner of the viewport. - * - * The viewport extent affects several functions: the center of the viewport remains fixed during changes by zoom.scaleBy and zoom.scaleTo; - * the viewport center and dimensions affect the path chosen by d3.interpolateZoom; and the viewport extent is needed to enforce the optional translate extent. - * - * The default is [[0, 0], [width, height]] where width is the client width of the element and height is its client height; - * for SVG elements, the nearest ancestor SVG element’s width and height is used. - * In this case, the owner SVG element must have defined width and height attributes rather than (for example) relying on CSS properties or the viewBox attribute; - * SVG provides no programmatic method for retrieving the initial viewport size. Alternatively, consider using element.getBoundingClientRect. - * (In Firefox, element.clientWidth and element.clientHeight is zero for SVG elements!) - * - * @extent An extent accessor function which is evaluated for each selected element, - * in order, being passed the current datum (d), the current index (i), and the current group (nodes), - * with this as the current DOM element.The function returns the extent array. - */ - extent(extent: ValueFn): this; - - /** - * Return the current scale extent. - */ - scaleExtent(): [number, number]; - /** - * Set the scale extent to the specified array of numbers [k0, k1] where k0 is the minimum allowed scale factor and k1 is the maximum allowed scale factor, - * and return this zoom behavior. - * - * The scale extent restricts zooming in and out. It is enforced on interaction and when using zoom.scaleBy, zoom.scaleTo and zoom.translateBy; - * however, it is not enforced when using zoom.transform to set the transform explicitly. - * - * The default scale extent is [0, infinity]. - * - * If the user tries to zoom by wheeling when already at the corresponding limit of the scale extent, the wheel events will be ignored and not initiate a zoom gesture. - * This allows the user to scroll down past a zoomable area after zooming in, or to scroll up after zooming out. - * If you would prefer to always prevent scrolling on wheel input regardless of the scale extent, register a wheel event listener to prevent the browser default behavior - * - * @param extent A scale extent array of two numbers representing the scale boundaries. - */ - scaleExtent(extent: [number, number]): this; - - /** - * Return the current translate extent. - */ - translateExtent(): [[number, number], [number, number]]; - /** - * Set the translate extent to the specified array of points [[x0, y0], [x1, y1]], where [x0, y0] is the top-left corner of the world and [x1, y1] - * is the bottom-right corner of the world, and return this zoom behavior. - * - * The translate extent restricts panning, and may cause translation on zoom out. It is enforced on interaction and when using zoom.scaleBy, zoom.scaleTo and zoom.translateBy; - * however, it is not enforced when using zoom.transform to set the transform explicitly. - * - * The default scale extent is [[-infinity, infinity], [-infinity, infinity]]. - * - * @param extent A translate extent array, i.e. an array of two arrays, each representing a point. - */ - translateExtent(extent: [[number, number], [number, number]]): this; - - /** - * Get the duration for zoom transitions on double-click and double-tap in milliseconds. - */ - duration(): number; - /** - * Set the duration for zoom transitions on double-click and double-tap to the specified number of milliseconds and returns the zoom behavior. - * - * To disable double-click and double-tap transitions, you can remove the zoom behavior’s dblclick event listener after applying the zoom behavior to the selection. - * - * @param Duration in milliseconds. - */ - duration(duration: number): this; - - /** - * Returns the current interpolation factory, which defaults to d3.interpolateZoom to implement smooth zooming. - */ - interpolate ((t: number) => ZoomView)>(): InterpolationFactory; - - /** - * Sets the interpolation factory for zoom transitions to the specified function. - * Use the default d3.interpolateZoom to implement smooth zooming. - * To apply direct interpolation between two views, try d3.interpolate instead. - * - * Each view is defined as an array of three numbers: cx, cy and width. The first two coordinates cx, cy represent the center of the viewport; - * the last coordinate width represents the size of the viewport. - * - * @param interpolatorFactory An interpolator factory to be used to generate interpolators beetween zooms for transitions. - */ - interpolate(interpolatorFactory: (a: ZoomView, b: ZoomView) => ((t: number) => ZoomView)): this; - - /** - * Return the first currently-assigned listener matching the specified typenames, if any. - * - * @param typenames The typenames is a string containing one or more typename separated by whitespace. - * Each typename is a type, optionally followed by a period (.) and a name, such as "drag.foo"" and "drag.bar"; - * the name allows multiple listeners to be registered for the same type. The type must be one of the following: - * start (after zooming begins [such as mousedown]), zoom (after a change to the zoom transform [such as mousemove], or - * end (after an active pointer becomes inactive [such as on mouseup].) - */ - on(typenames: string): ValueFn | undefined; - /** - * Remove the current event listeners for the specified typenames, if any, return the drag behavior. - * - * @param typenames The typenames is a string containing one or more typename separated by whitespace. - * Each typename is a type, optionally followed by a period (.) and a name, such as "drag.foo"" and "drag.bar"; - * the name allows multiple listeners to be registered for the same type. The type must be one of the following: - * start (after zooming begins [such as mousedown]), zoom (after a change to the zoom transform [such as mousemove], or - * end (after an active pointer becomes inactive [such as on mouseup].) - * @param listener Use null to remove the listener. - */ - on(typenames: string, listener: null): this; - /** - * Set the event listener for the specified typenames and return the zoom behavior. - * If an event listener was already registered for the same type and name, - * the existing listener is removed before the new listener is added. - * When a specified event is dispatched, each listener will be invoked with the same context and arguments as selection.on listeners. - * - * - * @param typenames The typenames is a string containing one or more typename separated by whitespace. - * Each typename is a type, optionally followed by a period (.) and a name, such as "drag.foo"" and "drag.bar"; - * the name allows multiple listeners to be registered for the same type. The type must be one of the following: - * start (after zooming begins [such as mousedown]), zoom (after a change to the zoom transform [such as mousemove], or - * end (after an active pointer becomes inactive [such as on mouseup].) - * @param listener An event listener function which is evaluated for each selected element, - * in order, being passed the current datum (d), the current index (i), and the current group (nodes), - * with this as the current DOM element. - */ - on(typenames: string, listener: ValueFn): this; -} - -/** - * Creates a new zoom behavior. The returned behavior, zoom, is both an object and a function, - * and is typically applied to selected elements via selection.call. - * - * The first generic refers to the type of reference element to which the zoom behavior is attached. - * The second generic refers to the type of the datum of the reference element. - */ -export function zoom(): ZoomBehavior; - -// -------------------------------------------------------------------------- -// Zoom Event -// -------------------------------------------------------------------------- - -/** - * A D3 Zoom Event - * - * The first generic refers to the type of reference element to which the zoom behavior is attached. - * The second generic refers to the type of the datum of the reference element. - */ -export interface D3ZoomEvent { - /** - * The ZoomBehavior associated with the event - */ - target: ZoomBehavior; - /** - * The event type for the zoom event - */ - type: 'start' | 'zoom' | 'end' | string; // Leave failsafe string type for cases like 'zoom.foo' - /** - * The current zoom transform - */ - transform: ZoomTransform; - /** - * The underlying input event, such as mousemove or touchmove. - */ - sourceEvent: any; -} - -// -------------------------------------------------------------------------- -// Zoom Transforms -// -------------------------------------------------------------------------- - -/** - * A zoom transform - * - * The zoom behavior stores the zoom state on the element to which the zoom behavior was applied, not on the zoom behavior itself. - * This is because the zoom behavior can be applied to many elements simultaneously, and each element can be zoomed independently. - * The zoom state can change either on user interaction or programmatically via zoom.transform. - * - * To retrieve the zoom state, use event.transform on the current zoom event within a zoom event listener (see zoom.on), or use d3.zoomTransform for a given node. - * The latter is particularly useful for modifying the zoom state programmatically, - * say to implement buttons for zooming in and out. - * - * For details see {@link https://github.com/d3/d3-zoom#zoom-transforms} - */ -export interface ZoomTransform { - /** - * The translation amount tx along the x-axis. - * This property should be considered read-only; instead of mutating a transform, - * use transform.scale and transform.translate to derive a new transform. - * Also see zoom.scaleBy, zoom.scaleTo and zoom.translateBy for convenience methods on the zoom behavior. - */ - readonly x: number; - - /** - * The translation amount ty along the y-axis - * This property should be considered read-only; instead of mutating a transform, - * use transform.scale and transform.translate to derive a new transform. - * Also see zoom.scaleBy, zoom.scaleTo and zoom.translateBy for convenience methods on the zoom behavior. - */ - readonly y: number; - - /** - * The scale factor k. - * This property should be considered read-only; instead of mutating a transform, - * use transform.scale and transform.translate to derive a new transform. - * Also see zoom.scaleBy, zoom.scaleTo and zoom.translateBy for convenience methods on the zoom behavior. - */ - readonly k: number; - - /** - * Return the transformation of the specified point which is a two-element array of numbers [x, y]. - * The returned point is equal to [x × k + tx, y × k + ty]. - * - * @param point Point coordinates [x, y] - */ - apply(point: [number, number]): [number, number]; - - /** - * Return the transformation of the specified x-coordinate, x × k + tx. - * - * @param x Value of x-coordinate. - */ - applyX(x: number): number; - - /** - * Return the transformation of the specified y-coordinate, y × k + ty. - * - * @param y Value of y-coordinate. - */ - applyY(y: number): number; - - /** - * Return the inverse transformation of the specified point which is a two-element array of numbers [x, y]. - * The returned point is equal to [(x - tx) / k, (y - ty) / k]. - * - * @param point Point coordinates [x, y] - */ - invert(point: [number, number]): [number, number]; - - /** - * Return the inverse transformation of the specified x-coordinate, (x - tx) / k. - * - * @param x Value of x-coordinate. - */ - invertX(x: number): number; - - /** - * Return the inverse transformation of the specified y-coordinate, (y - ty) / k. - * - * @param y Value of y-coordinate. - */ - invertY(y: number): number; - - /** - * Returns a copy of the continuous scale x whose domain is transformed. - * This is implemented by first applying the inverse x-transform on the scale’s range, - * and then applying the inverse scale to compute the corresponding domain - * - * The scale x must use d3.interpolateNumber; do not use continuous.rangeRound as this - * reduces the accuracy of continuous.invert and can lead to an inaccurate rescaled domain. - * This method does not modify the input scale x; x thus represents the untransformed scale, - * while the returned scale represents its transformed view. - * - * @param xScale A continuous scale for x-dimension. - */ - rescaleX(xScale: S): S; - - /** - * Returns a copy of the continuous scale y whose domain is transformed. - * This is implemented by first applying the inverse y-transform on the scale’s range, - * and then applying the inverse scale to compute the corresponding domain - * - * The scale y must use d3.interpolateNumber; do not use continuous.rangeRound as this - * reduces the accuracy of continuous.invert and can lead to an inaccurate rescaled domain. - * This method does not modify the input scale x; x thus represents the untransformed scale, - * while the returned scale represents its transformed view. - * - * @param yScale A continuous scale for y-dimension. - */ - rescaleY(yScale: S): S; - - /** - * Return a transform whose scale k1 is equal to k0 × k, where k0 is this transform’s scale. - * - * @param k A scale factor. - */ - scale(k: number): ZoomTransform; - - /** - * Return a string representing the SVG transform corresponding to this transform. - */ - toString(): string; - - /** - * Return a transform whose translation tx1 and ty1 is equal to tx0 + x and ty0 + y, - * where tx0 and ty0 is this transform’s translation. - * - * @param x Amount of translation in x-direction. - * @param y Amount of translation in y-direction. - */ - translate(x: number, y: number): ZoomTransform; -} - -/** - * Returns the current transform for the specified node. Note that node should typically be a DOM element, and not a selection. - * (A selection may consist of multiple nodes, in different states, and this function only returns a single transform.) If you have a selection, call selection.node first. - * In the context of an event listener, the node is typically the element that received the input event (which should be equal to event.transform), "this". - * Internally, an element’s transform is stored as element.__zoom; however, you should use this method rather than accessing it directly. - * If the given node has no defined transform, returns the identity transformation. - * The returned transform represents a two-dimensional transformation matrix - * - * For details see {@link https://github.com/d3/d3-zoom#zoom-transforms} - * - * @param node An element for which to retrieve its current zoomt transform. - */ -export function zoomTransform(node: ZoomedElementBaseType): ZoomTransform; - -/** - * The identity transform, where k = 1, tx = ty = 0. - */ -export const zoomIdentity: ZoomTransform; diff --git a/d3-zoom/tslint.json b/d3-zoom/tslint.json deleted file mode 100644 index 68d10d72a6..0000000000 --- a/d3-zoom/tslint.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "../tslint.json", - "rules": { - "unified-signatures": false - } -} diff --git a/d3.cloud.layout/d3.cloud.layout-tests.ts b/d3.cloud.layout/d3.cloud.layout-tests.ts deleted file mode 100644 index b2e0349cd4..0000000000 --- a/d3.cloud.layout/d3.cloud.layout-tests.ts +++ /dev/null @@ -1,42 +0,0 @@ -/// - - interface ICompTextSize{ - text:string; - size:number; - x?:number; - y?:number; - rotate?:number; - } - - - var fill = d3.scale.category20(); - d3.layout.cloud().size([300, 300]) - .words([ - "Hello", "world", "normally", "you", "want", "more", "words", - "than", "this"].map(function(d:string) { - return {text: d, size: 10 + Math.random() * 90}; - })) - .padding(5) - .rotate(function() { return ~~(Math.random() * 2) * 90; }) - .font("Impact") - .fontSize(function(d:ICompTextSize) { return d.size; }) - .on("end", draw) - .start(); - function draw(words:ICompTextSize[]) { - d3.select("body").append("svg") - .attr("width", 300) - .attr("height", 300) - .append("g") - .attr("transform", "translate(150,150)") - .selectAll("text") - .data(words) - .enter().append("text") - .style("font-size", function(d:ICompTextSize) { return d.size + "px"; }) - .style("font-family", "Impact") - .style("fill", function(d:ICompTextSize, i:number) { return fill(i); }) - .attr("text-anchor", "middle") - .attr("transform", function(d:ICompTextSize) { - return "translate(" + [d.x, d.y] + ")rotate(" + d.rotate + ")"; - }) - .text(function(d:ICompTextSize) { return d.text; }); - } diff --git a/d3/d3-tests.ts b/d3/d3-tests.ts deleted file mode 100644 index ca4932d27c..0000000000 --- a/d3/d3-tests.ts +++ /dev/null @@ -1,12 +0,0 @@ -import * as d3 from 'd3'; - - -// TODO: complete tests. Note the tests here should be limited to -// testing existence of re-exported members of the -// constituent modules comprising the D3 version 4 standard bundle - -// Ability to access d3-select related properties - -const d: d3.Selection = d3.selection(); - - diff --git a/d3/tslint.json b/d3/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/d3/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/d3/v3/d3-tests.ts b/d3/v3/d3-tests.ts deleted file mode 100644 index 959b85bda5..0000000000 --- a/d3/v3/d3-tests.ts +++ /dev/null @@ -1,2722 +0,0 @@ - - -//Example from http://bl.ocks.org/3887235 -interface TestPieChartData { - population: number; - age: string; -} -function testPieChart() { - var width = 960, - height = 500, - radius = Math.min(width, height) / 2; - - var color = d3.scale.ordinal() - .range(["#98abc5", "#8a89a6", "#7b6888", "#6b486b", "#a05d56", "#d0743c", "#ff8c00"]); - - var arc = d3.svg.arc>() - .outerRadius(radius - 10) - .innerRadius(0); - - var pie = d3.layout.pie() - .sort(null) - .value(function (d) { return d.population; }); - - var svg = d3.select("body").append("svg") - .attr("width", width) - .attr("height", height) - .append("g") - .attr("transform", "translate(" + width / 2 + "," + height / 2 + ")"); - - d3.csv("data.csv", d => ({ population: +d['population'], age: d['age'] }), function (error, data) { - var g = svg.selectAll(".arc") - .data(pie(data)) - .enter().append("g") - .attr("class", "arc"); - - g.append("path") - .attr("d", arc) - .style("fill", function (d) { return color(d.data.age); }); - - g.append("text") - .attr("transform", function (d) { return "translate(" + arc.centroid(d) + ")"; }) - .attr("dy", ".35em") - .style("text-anchor", "middle") - .text(function (d) { return d.data.age; }); - - }); -} - -function testMapConstructor() { - //No arg constructor - var emptyMap: d3.Map = d3.map(); - - //Object constructor - var object:{[key: string]: number } = {a: 1, b: 2, c: 3}; - var objectMap: d3.Map = d3.map(object); - - //Array constructor - var numberArray: number[] = [1, 2, 3] - var numberArrayMap: d3.Map = d3.map(numberArray); - - //Array with keyFn constructor - var objectArray: {key: string}[] = [{key: "v1"}, {key: "v2"}, {key: "v3"}]; - var indexes: number[] = []; - //keyFn with index - var objectArrayMap1: d3.Map<{key: string}> - = d3.map<{key: string}>(objectArray, (o: {key: string}, index: number) => { - indexes.push(index); - return o.key; - }); - //keyFn without index - var objectArrayMap2: d3.Map<{key: string}> - = d3.map<{key: string}>(objectArray, (o: {key: string}) => { - return o.key; - }); - - //Map constructor - var duplicateMap: d3.Map = d3.map(numberArrayMap); -} - -//Example from http://bl.ocks.org/3887051 -interface GroupedData { - State: string; - ages: Array<{ name: string; value: number;}>; -} -function groupedBarChart() { - var margin = { top: 20, right: 20, bottom: 30, left: 40 }, - width = 960 - margin.left - margin.right, - height = 500 - margin.top - margin.bottom; - - var x0 = d3.scale.ordinal() - .rangeRoundBands([0, width], .1); - - var x1 = d3.scale.ordinal(); - - var y = d3.scale.linear() - .range([height, 0]); - - var color = d3.scale.ordinal() - .range(["#98abc5", "#8a89a6", "#7b6888", "#6b486b", "#a05d56", "#d0743c", "#ff8c00"]); - - var xAxis = d3.svg.axis() - .scale(x0) - .orient("bottom"); - - var yAxis = d3.svg.axis() - .scale(y) - .orient("left") - .tickFormat(d3.format(".2s")); - - var svg = d3.select("body").append("svg") - .attr("width", width + margin.left + margin.right) - .attr("height", height + margin.top + margin.bottom) - .append("g") - .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); - - d3.csv("data.csv", function (error: any, data: Array) { - var ageNames = d3.keys(data[0]).filter(function (key) { return key !== "State"; }); - - data.forEach(function (d) { - d.ages = ageNames.map(function (name) { return { name: name, value: +( d)[name] }; }); - }); - - x0.domain(data.map(function (d) { return d.State; })); - x1.domain(ageNames).rangeRoundBands([0, x0.rangeBand()]); - y.domain([0, d3.max(data, function (d) { return d3.max(d.ages, function (d) { return d.value; }); })]); - - svg.append("g") - .attr("class", "x axis") - .attr("transform", "translate(0," + height + ")") - .call(xAxis); - - svg.append("g") - .attr("class", "y axis") - .call(yAxis) - .append("text") - .attr("transform", "rotate(-90)") - .attr("y", 6) - .attr("dy", ".71em") - .style("text-anchor", "end") - .text("Population"); - - var state = svg.selectAll(".state") - .data(data) - .enter().append("g") - .attr("class", "g") - .attr("transform", function (d) { return "translate(" + x0(d.State) + ",0)"; }); - - state.selectAll("rect") - .data(function (d) { return d.ages; }) - .enter().append("rect") - .attr("width", x1.rangeBand()) - .attr("x", function (d) { return x1(d.name); }) - .attr("y", function (d) { return y(d.value); }) - .attr("height", function (d) { return height - y(d.value); }) - .style("fill", function (d) { return color(d.name); }); - - var legend = svg.selectAll(".legend") - .data(ageNames.reverse()) - .enter().append("g") - .attr("class", "legend") - .attr("transform", function (d, i) { return "translate(0," + i * 20 + ")"; }); - - legend.append("rect") - .attr("x", width - 18) - .attr("width", 18) - .attr("height", 18) - .style("fill", color); - - legend.append("text") - .attr("x", width - 24) - .attr("y", 9) - .attr("dy", ".35em") - .style("text-anchor", "end") - .text(function (d) { return d; }); - - }); -} - -//Example from http://bl.ocks.org/3886208 -function stackedBarChart() { - var margin = { top: 20, right: 20, bottom: 30, left: 40 }, - width = 960 - margin.left - margin.right, - height = 500 - margin.top - margin.bottom; - - var x = d3.scale.ordinal() - .rangeRoundBands([0, width], .1); - - var y = d3.scale.linear() - .rangeRound([height, 0]); - - var color = d3.scale.ordinal() - .range(["#98abc5", "#8a89a6", "#7b6888", "#6b486b", "#a05d56", "#d0743c", "#ff8c00"]); - - var xAxis = d3.svg.axis() - .scale(x) - .orient("bottom"); - - var yAxis = d3.svg.axis() - .scale(y) - .orient("left") - .tickFormat(d3.format(".2s")); - - var svg = d3.select("body").append("svg") - .attr("width", width + margin.left + margin.right) - .attr("height", height + margin.top + margin.bottom) - .append("g") - .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); - - d3.csv("data.csv", function (error: any, data: any) { - color.domain(d3.keys(data[0]).filter(function (key) { return key !== "State"; })); - - data.forEach(function (d: any) { - var y0 = 0; - d.ages = color.domain().map(function (name) { return { name: name, y0: y0, y1: y0 += +d[name] }; }); - d.total = d.ages[d.ages.length - 1].y1; - }); - - data.sort(function (a: any, b: any) { return b.total - a.total; }); - - x.domain(data.map(function (d: any) { return d.State; })); - y.domain([0, d3.max(data, function (d: { total: number }) { return d.total; })]); - - svg.append("g") - .attr("class", "x axis") - .attr("transform", "translate(0," + height + ")") - .call(xAxis); - - svg.append("g") - .attr("class", "y axis") - .call(yAxis) - .append("text") - .attr("transform", "rotate(-90)") - .attr("y", 6) - .attr("dy", ".71em") - .style("text-anchor", "end") - .text("Population"); - - var state = svg.selectAll(".state") - .data(data) - .enter().append("g") - .attr("class", "g") - .attr("transform", function (d: any) { return "translate(" + x(d.State) + ",0)"; }); - - state.selectAll("rect") - .data(function (d: any) { return d.ages; }) - .enter().append("rect") - .attr("width", x.rangeBand()) - .attr("y", function (d: any) { return y(d.y1); }) - .attr("height", function (d: any) { return y(d.y0) - y(d.y1); }) - .style("fill", function (d: any) { return color(d.name); }); - - var legend = svg.selectAll(".legend") - .data(color.domain().reverse()) - .enter().append("g") - .attr("class", "legend") - .attr("transform", function (d, i) { return "translate(0," + i * 20 + ")"; }); - - legend.append("rect") - .attr("x", width - 18) - .attr("width", 18) - .attr("height", 18) - .style("fill", color); - - legend.append("text") - .attr("x", width - 24) - .attr("y", 9) - .attr("dy", ".35em") - .style("text-anchor", "end") - .text(function (d) { return d; }); - - }); -} - -// example from http://bl.ocks.org/3886394 -function normalizedBarChart() { - var margin = { top: 20, right: 100, bottom: 30, left: 40 }, - width = 960 - margin.left - margin.right, - height = 500 - margin.top - margin.bottom; - - var x = d3.scale.ordinal() - .rangeRoundBands([0, width], .1); - - var y = d3.scale.linear() - .rangeRound([height, 0]); - - var color = d3.scale.ordinal() - .range(["#98abc5", "#8a89a6", "#7b6888", "#6b486b", "#a05d56", "#d0743c", "#ff8c00"]); - - var xAxis = d3.svg.axis() - .scale(x) - .orient("bottom"); - - var yAxis = d3.svg.axis() - .scale(y) - .orient("left") - .tickFormat(d3.format(".0%")); - - var svg = d3.select("body").append("svg") - .attr("width", width + margin.left + margin.right) - .attr("height", height + margin.top + margin.bottom) - .append("g") - .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); - - d3.csv("data.csv", function (error, data) { - color.domain(d3.keys(data[0]).filter(function (key) { return key !== "State"; })); - - data.forEach(function (d: any) { - var y0 = 0; - d.ages = color.domain().map(function (name) { return { name: name, y0: y0, y1: y0 += +d[name] }; }); - d.ages.forEach(function (d: any) { d.y0 /= y0; d.y1 /= y0; }); - }); - - data.sort(function (a: any, b: any) { return b.ages[0].y1 - a.ages[0].y1; }); - - x.domain(data.map(function (d: any) { return d.State; })); - - svg.append("g") - .attr("class", "x axis") - .attr("transform", "translate(0," + height + ")") - .call(xAxis); - - svg.append("g") - .attr("class", "y axis") - .call(yAxis); - - var state = svg.selectAll(".state") - .data(data) - .enter().append("g") - .attr("class", "state") - .attr("transform", function (d: any) { return "translate(" + x(d.State) + ",0)"; }); - - state.selectAll("rect") - .data(function (d) { return d.ages; }) - .enter().append("rect") - .attr("width", x.rangeBand()) - .attr("y", function (d: any) { return y(d.y1); }) - .attr("height", function (d: any) { return y(d.y0) - y(d.y1); }) - .style("fill", function (d: any) { return color(d.name); }); - - var legend = svg.select(".state:last-child").selectAll(".legend") - .data(function (d: any) { return d.ages; }) - .enter().append("g") - .attr("class", "legend") - .attr("transform", function (d: any) { return "translate(" + x.rangeBand() / 2 + "," + y((d.y0 + d.y1) / 2) + ")"; }); - - legend.append("line") - .attr("x2", 10); - - legend.append("text") - .attr("x", 13) - .attr("dy", ".35em") - .text(function (d: any) { return d.name; }); - - }); -} - -// example from http://bl.ocks.org/3885705 -function sortablebarChart() { - var margin = { top: 20, right: 20, bottom: 30, left: 40 }, - width = 960 - margin.left - margin.right, - height = 500 - margin.top - margin.bottom; - - var formatPercent = d3.format(".0%"); - - var x = d3.scale.ordinal() - .rangeRoundBands([0, width], .1, 1); - - var y = d3.scale.linear() - .range([height, 0]); - - var xAxis = d3.svg.axis() - .scale(x) - .orient("bottom"); - - var yAxis = d3.svg.axis() - .scale(y) - .orient("left") - .tickFormat(formatPercent); - - var svg = d3.select("body").append("svg") - .attr("width", width + margin.left + margin.right) - .attr("height", height + margin.top + margin.bottom) - .append("g") - .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); - - d3.tsv("data.tsv", function (error: any, data: any) { - - data.forEach(function (d: any) { - d.frequency = +d.frequency; - }); - - x.domain(data.map(function (d: any) { return d.letter; })); - y.domain([0, d3.max(data, function (d: any) { return d.frequency; })]); - - svg.append("g") - .attr("class", "x axis") - .attr("transform", "translate(0," + height + ")") - .call(xAxis); - - svg.append("g") - .attr("class", "y axis") - .call(yAxis) - .append("text") - .attr("transform", "rotate(-90)") - .attr("y", 6) - .attr("dy", ".71em") - .style("text-anchor", "end") - .text("Frequency"); - - svg.selectAll(".bar") - .data(data) - .enter().append("rect") - .attr("class", "bar") - .attr("x", function (d: any) { return x(d.letter); }) - .attr("width", x.rangeBand()) - .attr("y", function (d: any) { return y(d.frequency); }) - .attr("height", function (d: any) { return height - y(d.frequency); }); - - d3.select("input").on("change", change); - - var sortTimeout = setTimeout(function () { - d3.select("input").property("checked", true).each(change); - }, 2000); - - function change() { - clearTimeout(sortTimeout); - - var x0 = x.domain(data.sort(this.checked - ? function (a: any, b: any) { return b.frequency - a.frequency; } - : function (a: any, b: any) { return d3.ascending(a.letter, b.letter); }) - .map(function (d: any) { return d.letter; })) - .copy(); - - var transition = svg.transition().duration(750), - delay = function (d: any, i: number) { return i * 50; }; - - transition.selectAll(".bar") - .delay(delay) - .attr("x", function (d: any) { return x0(d.letter); }); - - transition.select(".x.axis") - .call(xAxis) - .selectAll("g") - .delay(delay); - } - }); -} - -//example from http://bl.ocks.org/4063318 -function callenderView() { - var width = 960, - height = 136, - cellSize = 17; // cell size - - var day = d3.time.format("%w"), - week = d3.time.format("%U"), - percent = d3.format(".1%"), - format = d3.time.format("%Y-%m-%d"); - - var color = d3.scale.quantize() - .domain([-.05, .05]) - .range(d3.range(11).map(function (d) { return "q" + d + "-11"; })); - - var svg = d3.select("body").selectAll("svg") - .data(d3.range(1990, 2011)) - .enter().append("svg") - .attr("width", width) - .attr("height", height) - .attr("class", "RdYlGn") - .append("g") - .attr("transform", "translate(" + ((width - cellSize * 53) / 2) + "," + (height - cellSize * 7 - 1) + ")"); - - svg.append("text") - .attr("transform", "translate(-6," + cellSize * 3.5 + ")rotate(-90)") - .style("text-anchor", "middle") - .text(function (d) { return d; }); - - var rect = svg.selectAll(".day") - .data(function (d) { return d3.time.days(new Date(d, 0, 1), new Date(d + 1, 0, 1)); }) - .enter().append("rect") - .attr("class", "day") - .attr("width", cellSize) - .attr("height", cellSize) - .attr("x", function (d) { return parseInt(week(d)) * cellSize; }) - .attr("y", function (d) { return parseInt(day(d)) * cellSize; }) - .datum(format); - - rect.append("title") - .text(function (d) { return d; }); - - svg.selectAll(".month") - .data(function (d) { return d3.time.months(new Date(d, 0, 1), new Date(d + 1, 0, 1)); }) - .enter().append("path") - .attr("class", "month") - .attr("d", monthPath); - - d3.csv("dji.csv", function (error, csv) { - var data = d3.nest() - .key(function (d: any) { return d.Date; }) - .rollup(function (d: any) { return (d[0].Close - d[0].Open) / d[0].Open; }) - .map(csv); - - rect.filter(function (d) { return d in data; }) - .attr("class", function (d) { return "day " + color(data[d]); }) - .select("title") - .text(function (d) { return d + ": " + percent(data[d]); }); - }); - - function monthPath(t0: Date) { - var t1 = new Date(t0.getFullYear(), t0.getMonth() + 1, 0), - d0 = +day(t0), w0 = +week(t0), - d1 = +day(t1), w1 = +week(t1); - return "M" + (w0 + 1) * cellSize + "," + d0 * cellSize - + "H" + w0 * cellSize + "V" + 7 * cellSize - + "H" + w1 * cellSize + "V" + (d1 + 1) * cellSize - + "H" + (w1 + 1) * cellSize + "V" + 0 - + "H" + (w0 + 1) * cellSize + "Z"; - } - - d3.select(self.frameElement).style("height", "2910px"); -} - -// example from http://bl.ocks.org/3883245 -function lineChart() { - var margin = { top: 20, right: 20, bottom: 30, left: 50 }, - width = 960 - margin.left - margin.right, - height = 500 - margin.top - margin.bottom; - - var parseDate = d3.time.format("%d-%b-%y").parse; - - var x = d3.time.scale() - .range([0, width]); - - var y = d3.scale.linear() - .range([height, 0]); - - var xAxis = d3.svg.axis() - .scale(x) - .orient("bottom"); - - var yAxis = d3.svg.axis() - .scale(y) - .orient("left"); - - var line = d3.svg.line<{ date: Date; close: number }>() - .x(function (d) { return x(d.date); }) - .y(function (d) { return y(d.close); }); - - var svg = d3.select("body").append("svg") - .attr("width", width + margin.left + margin.right) - .attr("height", height + margin.top + margin.bottom) - .append("g") - .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); - - d3.tsv("data.tsv", function (error: any, data: any) { - data.forEach(function (d: any) { - d.date = parseDate(d.date); - d.close = +d.close; - }); - - x.domain(d3.extent(data, function (d: any) { return d.date; })); - y.domain(d3.extent(data, function (d: any) { return d.close; })); - - svg.append("g") - .attr("class", "x axis") - .attr("transform", "translate(0," + height + ")") - .call(xAxis); - - svg.append("g") - .attr("class", "y axis") - .call(yAxis) - .append("text") - .attr("transform", "rotate(-90)") - .attr("y", 6) - .attr("dy", ".71em") - .style("text-anchor", "end") - .text("Price ($)"); - - svg.append("path") - .datum(data) - .attr("class", "line") - .attr("d", line); - }); -} - -//example from http://bl.ocks.org/3884914 -function bivariateAreaChart() { - var margin = { top: 20, right: 20, bottom: 30, left: 50 }, - width = 960 - margin.left - margin.right, - height = 500 - margin.top - margin.bottom; - - var parseDate = d3.time.format("%Y%m%d").parse; - - var x = d3.time.scale() - .range([0, width]); - - var y = d3.scale.linear() - .range([height, 0]); - - var xAxis = d3.svg.axis() - .scale(x) - .orient("bottom"); - - var yAxis = d3.svg.axis() - .scale(y) - .orient("left"); - - var area = d3.svg.area<{ date: Date; low: number; high: number }>() - .x(function (d) { return x(d.date); }) - .y0(function (d) { return y(d.low); }) - .y1(function (d) { return y(d.high); }); - - var svg = d3.select("body").append("svg") - .attr("width", width + margin.left + margin.right) - .attr("height", height + margin.top + margin.bottom) - .append("g") - .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); - - d3.tsv("data.tsv", function (error: any, data: any) { - data.forEach(function (d: any) { - d.date = parseDate(d.date); - d.low = +d.low; - d.high = +d.high; - }); - - x.domain(d3.extent(data, function (d: any) { return d.date; })); - y.domain([d3.min(data, function (d: any) { return d.low; }), d3.max(data, function (d: any) { return d.high; })]); - - svg.append("path") - .datum(data) - .attr("class", "area") - .attr("d", area); - - svg.append("g") - .attr("class", "x axis") - .attr("transform", "translate(0," + height + ")") - .call(xAxis); - - svg.append("g") - .attr("class", "y axis") - .call(yAxis) - .append("text") - .attr("transform", "rotate(-90)") - .attr("y", 6) - .attr("dy", ".71em") - .style("text-anchor", "end") - .text("Temperature (ºF)"); - }); -} - -//Example from http://bl.ocks.org/mbostock/1557377 -function dragMultiples() { - var width = 238, - height = 123, - radius = 20; - - var drag = d3.behavior.drag() - .origin(Object) - .on("drag", dragmove); - - var svg = d3.select("body").selectAll("svg") - .data(d3.range(16).map(function () { return { x: width / 2, y: height / 2 }; })) - .enter().append("svg") - .attr("width", width) - .attr("height", height); - - svg.append("circle") - .attr("r", radius) - .attr("cx", function (d) { return d.x; }) - .attr("cy", function (d) { return d.y; }) - .call(drag); - - function dragmove(d: { x: number; y: number }) { - d3.select(this) - .attr("cx", d.x = Math.max(radius, Math.min(width - radius, ( d3.event).x))) - .attr("cy", d.y = Math.max(radius, Math.min(height - radius, ( d3.event).y))); - } -} - -//Example from http://bl.ocks.org/mbostock/3892919 -function panAndZoom() { - var margin = { top: 20, right: 20, bottom: 30, left: 40 }, - width = 960 - margin.left - margin.right, - height = 500 - margin.top - margin.bottom; - - var x = d3.scale.linear() - .domain([-width / 2, width / 2]) - .range([0, width]); - - var y = d3.scale.linear() - .domain([-height / 2, height / 2]) - .range([height, 0]); - - var xAxis = d3.svg.axis() - .scale(x) - .orient("bottom") - .tickSize(-height); - - var yAxis = d3.svg.axis() - .scale(y) - .orient("left") - .ticks(5) - .tickSize(-width); - - var zoom = d3.behavior.zoom() - .x(x) - .y(y) - .scaleExtent([1, 10]) - .on("zoom", zoomed); - - var svg = d3.select("body").append("svg") - .attr("width", width + margin.left + margin.right) - .attr("height", height + margin.top + margin.bottom) - .append("g") - .attr("transform", "translate(" + margin.left + "," + margin.top + ")") - .call(zoom); - - svg.append("rect") - .attr("width", width) - .attr("height", height); - - svg.append("g") - .attr("class", "x axis") - .attr("transform", "translate(0," + height + ")") - .call(xAxis); - - svg.append("g") - .attr("class", "y axis") - .call(yAxis); - - function zoomed() { - svg.select(".x.axis").call(xAxis); - svg.select(".y.axis").call(yAxis); - } -} - -//Example from http://bl.ocks.org/mbostock/1125997 -function chainedTransitions() { - var w = 960, - h = 500, - y = d3.scale.ordinal().domain(d3.range(50)).rangePoints([20, h - 20]), - t = Date.now(); - - var svg = d3.select("body").append("svg:svg") - .attr("width", w) - .attr("height", h); - - var circle = svg.selectAll("circle") - .data(y.domain()) - .enter().append("svg:circle") - .attr("r", 16) - .attr("cx", 20) - .attr("cy", y) - .each(slide(20, w - 20)); - - function slide(x0: number, x1: number) { - t += 50; - return function() { - d3.select(this).transition() - .duration(t - Date.now()) - .attr("cx", x1) - .each("end", slide(x1, x0)); - }; - } -} - -//Example from http://bl.ocks.org/mbostock/4062085 -interface PyramidData { - people: number; - year: number; - age: number; -} -function populationPyramid() { - var margin = { top: 20, right: 40, bottom: 30, left: 20 }, - width = 960 - margin.left - margin.right, - height = 500 - margin.top - margin.bottom, - barWidth = Math.floor(width / 19) - 1; - - var x = d3.scale.linear() - .range([barWidth / 2, width - barWidth / 2]); - - var y = d3.scale.linear() - .range([height, 0]); - - var yAxis = d3.svg.axis() - .scale(y) - .orient("right") - .tickSize(-width) - .tickFormat(function (d) { return Math.round(d / 1e6) + "M"; } ); - - // An SVG element with a bottom-right origin. - var svg = d3.select("body").append("svg") - .attr("width", width + margin.left + margin.right) - .attr("height", height + margin.top + margin.bottom) - .append("g") - .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); - - // A sliding container to hold the bars by birthyear. - var birthyears = svg.append("g") - .attr("class", "birthyears"); - - // A label for the current year. - var title = svg.append("text") - .attr("class", "title") - .attr("dy", ".71em") - .text(2000); - - d3.csv("population.csv", function (error: any, rows: Array) { - - // Convert strings to numbers. - rows.forEach(function (d) { - d.people = +d.people; - d.year = +d.year; - d.age = +d.age; - } ); - - // Compute the extent of the data set in age and years. - var age1 = d3.max(rows, function (d) { return d.age; } ), - year0 = d3.min(rows, function (d) { return d.year; } ), - year1 = d3.max(rows, function (d) { return d.year; } ), - year = year1; - - // Update the scale domains. - x.domain([year1 - age1, year1]); - y.domain([0, d3.max(rows, function (d) { return d.people; } )]); - - // Produce a map from year and birthyear to [male, female]. - var data = d3.nest() - .key(function (d) { return '' + d.year; } ) - .key(function (d) { return '' + (d.year - d.age); } ) - .rollup(function (v) { return v.map(function (d) { return d.people; } ); } ) - .map(rows); - - // Add an axis to show the population values. - svg.append("g") - .attr("class", "y axis") - .attr("transform", "translate(" + width + ",0)") - .call(yAxis) - .selectAll("g") - .filter(function (value) { return !value; } ) - .classed("zero", true); - - // Add labeled rects for each birthyear (so that no enter or exit is required). - var birthyear = birthyears.selectAll(".birthyear") - .data(d3.range(year0 - age1, year1 + 1, 5)) - .enter().append("g") - .attr("class", "birthyear") - .attr("transform", function (birthyear) { return "translate(" + x(birthyear) + ",0)"; } ); - - birthyear.selectAll("rect") - .data(function (birthyear): number[] { return data[year][birthyear] || [0, 0]; } ) - .enter().append("rect") - .attr("x", -barWidth / 2) - .attr("width", barWidth) - .attr("y", y) - .attr("height", function (value) { return height - y(value); } ); - - // Add labels to show birthyear. - birthyear.append("text") - .attr("y", height - 4) - .text(function (birthyear) { return birthyear; } ); - - // Add labels to show age (separate; not animated). - svg.selectAll(".age") - .data(d3.range(0, age1 + 1, 5)) - .enter().append("text") - .attr("class", "age") - .attr("x", function (age) { return x(year - age); } ) - .attr("y", height + 4) - .attr("dy", ".71em") - .text(function (age) { return age; } ); - - // Allow the arrow keys to change the displayed year. - window.focus(); - d3.select(window).on("keydown", function () { - switch (( d3.event).keyCode) { - case 37: year = Math.max(year0, year - 10); break; - case 39: year = Math.min(year1, year + 10); break; - } - update(); - } ); - - function update() { - if (!(year in data)) return; - title.text(year); - - birthyears.transition() - .duration(750) - .attr("transform", "translate(" + (x(year1) - x(year)) + ",0)"); - - birthyear.selectAll("rect") - .data(function (birthyear): number[] { return data[year][birthyear] || [0, 0]; } ) - .transition() - .duration(750) - .attr("y", y) - .attr("height", function (value) { return height - y(value); } ); - } - } ); -} - -//Example from http://bl.ocks.org/MoritzStefaner/1377729 -namespace forcedBasedLabelPlacemant { - interface Node extends d3.layout.force.Node { - label: string; - } - - interface LabelAnchor extends d3.layout.force.Node { - node: Node; - } - - interface LabelAnchorLink extends d3.layout.force.Link { - source: Node; - target: Node; - weight: number; - } - - var w = 960, h = 500; - - var labelDistance = 0; - - var vis = d3.select("body").append("svg:svg").attr("width", w).attr("height", h); - - var nodes: Node[] = []; - var labelAnchors: LabelAnchor[] = []; - var labelAnchorLinks: { source: number; target: number; weight: number }[] = []; - var links: typeof labelAnchorLinks = []; - - for (var i = 0; i < 30; i++) { - var nodeLabel = { - label: "node " + i - }; - nodes.push(nodeLabel); - labelAnchors.push({ - node: nodeLabel - }); - labelAnchors.push({ - node: nodeLabel - }); - }; - - for (var i = 0; i < nodes.length; i++) { - for (var j = 0; j < i; j++) { - if (Math.random() > .95) - links.push({ - source: i, - target: j, - weight: Math.random() - }); - } - labelAnchorLinks.push({ - source: i * 2, - target: i * 2 + 1, - weight: 1 - }); - }; - - var force = d3.layout.force().size([w, h]).nodes(nodes).links(links).gravity(1).linkDistance(50).charge(-3000).linkStrength(function (x) { - return x.weight * 10 - } ); - - - force.start(); - - var force2 = d3.layout.force().nodes(labelAnchors).links(labelAnchorLinks).gravity(0).linkDistance(0).linkStrength(8).charge(-100).size([w, h]); - force2.start(); - - var link = vis.selectAll("line.link").data(links).enter().append("svg:line").attr("class", "link").style("stroke", "#CCC"); - - var node = vis.selectAll("g.node").data(force.nodes()).enter().append("svg:g").attr("class", "node"); - node.append("svg:circle").attr("r", 5).style("fill", "#555").style("stroke", "#FFF").style("stroke-width", 3); - node.call(force.drag); - - - var anchorLink = vis.selectAll("line.anchorLink").data(labelAnchorLinks)//.enter().append("svg:line").attr("class", "anchorLink").style("stroke", "#999"); - - var anchorNode = vis.selectAll("g.anchorNode").data(force2.nodes()).enter().append("svg:g").attr("class", "anchorNode"); - anchorNode.append("svg:circle").attr("r", 0).style("fill", "#FFF"); - anchorNode.append("svg:text").text(function (d, i) { - return i % 2 == 0 ? "" : d.node.label - } ).style("fill", "#555").style("font-family", "Arial").style("font-size", 12); - - var updateLink = function () { - (> this).attr("x1", function (d) { - return d.source.x; - } ).attr("y1", function (d) { - return d.source.y; - } ).attr("x2", function (d) { - return d.target.x; - } ).attr("y2", function (d) { - return d.target.y; - } ); - - } - - var updateNode = function () { - (> this).attr("transform", function (d) { - return "translate(" + d.x + "," + d.y + ")"; - } ); - - } - - force.on("tick", function () { - - force2.start(); - - node.call(updateNode); - - anchorNode.each(function (d, i) { - if (i % 2 == 0) { - d.x = d.node.x; - d.y = d.node.y; - } else { - var b = this.childNodes[1].getBBox(); - - var diffX = d.x - d.node.x; - var diffY = d.y - d.node.y; - - var dist = Math.sqrt(diffX * diffX + diffY * diffY); - - var shiftX = b.width * (diffX - dist) / (dist * 2); - shiftX = Math.max(-b.width, Math.min(0, shiftX)); - var shiftY = 5; - this.childNodes[1].setAttribute("transform", "translate(" + shiftX + "," + shiftY + ")"); - } - } ); - - - anchorNode.call(updateNode); - - link.call(updateLink); - anchorLink.call(updateLink); - - } ); -} - -//Example from http://bl.ocks.org/mbostock/1125997 -namespace forceCollapsable { - interface Node extends d3.layout.force.Node { - id: string; - _children: Node[]; - children?: Node[]; - size: number; - } - - var w = 1280, - h = 800, - node: d3.selection.Update, - link: d3.selection.Update>, - root: any; - - var force = d3.layout.force() - .on("tick", tick) - .charge(function (d) { return d._children ? -d.size / 100 : -30; } ) - .linkDistance(function (d) { return d.target._children ? 80 : 30; } ) - .size([w, h - 160]); - - var vis = d3.select("body").append("svg:svg") - .attr("width", w) - .attr("height", h); - - d3.json("flare.json", function (json) { - root = json; - root.fixed = true; - root.x = w / 2; - root.y = h / 2 - 80; - update(); - } ); - - function update() { - var nodes = flatten(root), - links = d3.layout.tree().links(nodes); - - // Restart the force layout. - force - .nodes(nodes) - .links(links) - .start(); - - // Update the links… - link = vis.selectAll("line.link") - .data(links, function (d) { return d.target.id; } ); - - // Enter any new links. - link.enter().insert("svg:line", ".node") - .attr("class", "link") - .attr("x1", function (d) { return d.source.x; } ) - .attr("y1", function (d) { return d.source.y; } ) - .attr("x2", function (d) { return d.target.x; } ) - .attr("y2", function (d) { return d.target.y; } ); - - // Exit any old links. - link.exit().remove(); - - // Update the nodes… - node = vis.selectAll("circle.node") - .data(nodes, function (d) { return d.id; } ) - .style("fill", color); - - node.transition() - .attr("r", function (d) { return d.children ? 4.5 : Math.sqrt(d.size) / 10; } ); - - // Enter any new nodes. - node.enter().append("svg:circle") - .attr("class", "node") - .attr("cx", function (d) { return d.x; } ) - .attr("cy", function (d) { return d.y; } ) - .attr("r", function (d) { return d.children ? 4.5 : Math.sqrt(d.size) / 10; } ) - .style("fill", color) - .on("click", click) - .call(force.drag); - - // Exit any old nodes. - node.exit().remove(); - } - - function tick() { - link.attr("x1", function (d) { return d.source.x; } ) - .attr("y1", function (d) { return d.source.y; } ) - .attr("x2", function (d) { return d.target.x; } ) - .attr("y2", function (d) { return d.target.y; } ); - - node.attr("cx", function (d) { return d.x; } ) - .attr("cy", function (d) { return d.y; } ); - } - - // Color leaf nodes orange, and packages white or blue. - function color(d: Node) { - return d._children ? "#3182bd" : d.children ? "#c6dbef" : "#fd8d3c"; - } - - // Toggle children on click. - function click(d: Node) { - if (d.children) { - d._children = d.children; - d.children = null; - } else { - d.children = d._children; - d._children = null; - } - update(); - } - - // Returns a list of all nodes under the root. - function flatten(root: Node) { - var nodes: Node[] = [], i = 0; - - function recurse(node: Node) { - if (node.children) node.size = node.children.reduce(function (p, v) { return p + recurse(v); } , 0); - if (!node.id) node.id = String(++i); - nodes.push(node); - return node.size; - } - - root.size = recurse(root); - return nodes; - } -} - -//Example from http://bl.ocks.org/mbostock/3757110 -function azimuthalEquidistant() { - var width = 960, - height = 960; - var topojson: any; - - var projection = d3.geo.azimuthalEquidistant() - .scale(150) - .translate([width / 2, height / 2]) - .clipAngle(180 - 1e-3) - .precision(.1); - - var path = d3.geo.path() - .projection(projection); - - var graticule = d3.geo.graticule(); - - var svg = d3.select("body").append("svg") - .attr("width", width) - .attr("height", height); - - svg.append("defs").append("path") - .datum({ type: "Sphere" }) - .attr("id", "sphere") - .attr("d", path); - - svg.append("use") - .attr("class", "stroke") - .attr("xlink:href", "#sphere"); - - svg.append("use") - .attr("class", "fill") - .attr("xlink:href", "#sphere"); - - svg.append("path") - .datum(graticule) - .attr("class", "graticule") - .attr("d", path); - - d3.json("/mbostock/raw/4090846/world-50m.json", function (error, world) { - svg.insert("path", ".graticule") - .datum(topojson.feature(world, world.objects.land)) - .attr("class", "land") - .attr("d", path); - - svg.insert("path", ".graticule") - .datum(topojson.mesh(world, world.objects.countries, function (a: any, b: any) { return a !== b; } )) - .attr("class", "boundary") - .attr("d", path); - } ); - - d3.select(self.frameElement).style("height", height + "px"); -} - -//Example from http://bl.ocks.org/mbostock/4060366 -function voronoiTesselation() { - var width = 960, - height = 500; - - var vertices = d3.range(100).map(function (d): [number, number] { - return [Math.random() * width, Math.random() * height]; - } ); - - var voronoi = d3.geom.voronoi() - .clipExtent([[0, 0], [width, height]]); - - var svg = d3.select("body").append("svg") - .attr("width", width) - .attr("height", height) - .attr("class", "PiYG") - .on("mousemove", function () { vertices[0] = d3.mouse(this); redraw(); } ); - - var path = >svg.append("g").selectAll("path"); - - svg.selectAll("circle") - .data(vertices.slice(1)) - .enter().append("circle") - .attr("transform", function (d) { return "translate(" + d + ")"; } ) - .attr("r", 2); - - redraw(); - - function redraw() { - path = path.data(voronoi(vertices).map(function (d) { return "M" + d.join("L") + "Z"; } ), String); - path.exit().remove(); - path.enter().append("path").attr("class", function (d, i) { return "q" + (i % 9) + "-9"; } ).attr("d", String); - path.order(); - } -} - -// Example from https://gist.github.com/christophermanning/1734663 -function forceDirectedVoronoi() { - var w = window.innerWidth > 960 ? 960 : (window.innerWidth || 960), - h = window.innerHeight > 500 ? 500 : (window.innerHeight || 500), - radius = 5.25, - simulate = true, - zoomToAdd = true, - color = d3.scale.quantize().domain([10000, 7250]).range(["#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"]) - - var numVertices = (w*h) / 3000; - var vertices = d3.range(numVertices).map(function(i) { - var angle = radius * (i+10); - return {x: angle*Math.cos(angle)+(w/2), y: angle*Math.sin(angle)+(h/2)}; - }); - var d3_geom_voronoi = d3.geom.voronoi<{ x: number; y: number }>() - .x(function(d) { return d.x; }) - .y(function(d) { return d.y; }) - var prevEventScale = 1; - var zoom = d3.behavior.zoom().on("zoom", function(d,i) { - if (zoomToAdd){ - if (( d3.event).scale > prevEventScale) { - var angle = radius * vertices.length; - vertices.push({x: angle*Math.cos(angle)+(w/2), y: angle*Math.sin(angle)+(h/2)}) - } else if (vertices.length > 2 && ( d3.event).scale != prevEventScale) { - vertices.pop(); - } - force.nodes(vertices).start() - } else { - if (( d3.event).scale > prevEventScale) { - radius+= .01 - } else { - radius -= .01 - } - vertices.forEach(function(d, i) { - var angle = radius * (i+10); - vertices[i] = {x: angle*Math.cos(angle)+(w/2), y: angle*Math.sin(angle)+(h/2)}; - }); - force.nodes(vertices).start() - } - prevEventScale = ( d3.event).scale; - }); - - d3.select(window) - .on("keydown", function() { - // shift - if(( d3.event).keyCode == 16) { - zoomToAdd = false - } - - // s - if(( d3.event).keyCode == 83) { - simulate = !simulate - if(simulate) { - force.start() - } else { - force.stop() - } - } - }) - .on("keyup", function() { - zoomToAdd = true - }) - - var svg = d3.select("#chart") - .append("svg") - .attr("width", w) - .attr("height", h) - .call(zoom) - - var force = d3.layout.force() - .charge(-300) - .size([w, h]) - .on("tick", update); - - force.nodes(vertices).start(); - - var circle = > svg.selectAll("circle"); - var path = > svg.selectAll("path"); - var link = > svg.selectAll("line"); - - function update() { - path = path.data(d3_geom_voronoi(vertices)); - path.enter().append("path") - // drag node by dragging cell - .call(d3.behavior.drag() - .on("drag", function(d, i) { - vertices[i] = {x: vertices[i].x + ( d3.event).dx, y: vertices[i].y + ( d3.event).dy} - }) - ) - .style("fill", function(d, i) { return color(0) }) - path.attr("d", function(d) { return "M" + d.join("L") + "Z"; }) - .transition().duration(150).style("fill", function(d, i) { return color(d3.geom.polygon(d).area()) }) - path.exit().remove(); - - circle = circle.data(vertices) - circle.enter().append("circle") - .attr("r", 0) - .transition().duration(1000).attr("r", 5); - circle.attr("cx", function(d) { return d.x; }) - .attr("cy", function(d) { return d.y; }); - circle.exit().transition().attr("r", 0).remove(); - - link = link.data(d3_geom_voronoi.links(vertices)) - link.enter().append("line") - link.attr("x1", function(d) { return d.source.x; }) - .attr("y1", function(d) { return d.source.y; }) - .attr("x2", function(d) { return d.target.x; }) - .attr("y2", function(d) { return d.target.y; }) - - link.exit().remove() - - if(!simulate) force.stop() - } -} - -//Example from http://bl.ocks.org/mbostock/4341156 -function delaunayTesselation() { - var width = 960, - height = 500; - - var vertices = d3.range(100).map(function (d): [number, number] { - return [Math.random() * width, Math.random() * height]; - } ); - - var svg = d3.select("body").append("svg") - .attr("width", width) - .attr("height", height) - .attr("class", "PiYG") - .on("mousemove", function () { vertices[0] = d3.mouse(this); redraw(); } ); - - var path = >svg.append("g").selectAll("path"); - - svg.selectAll("circle") - .data(vertices.slice(1)) - .enter().append("circle") - .attr("transform", function (d) { return "translate(" + d + ")"; } ) - .attr("r", 2); - - redraw(); - - function redraw() { - path = path.data(d3.geom.delaunay(vertices).map(function (d) { return "M" + d.join("L") + "Z"; } ), String); - path.exit().remove(); - path.enter().append("path").attr("class", function (d, i) { return "q" + (i % 9) + "-9"; } ).attr("d", String); - } -} - -//Example from http://bl.ocks.org/mbostock/4343214 -function quadtree() { - var width = 960, - height = 500; - - var data = d3.range(5000).map(function(): [number, number] { - return [Math.random() * width, Math.random() * width]; - }); - - var quadtree = d3.geom.quadtree() - .extent([[-1, -1], [width + 1, height + 1]]) - (data); - - var brush = d3.svg.brush() - .x(d3.scale.identity().domain([0, width])) - .y(d3.scale.identity().domain([0, height])) - .on("brush", brushed) - .extent([[100, 100], [200, 200]]); - - var svg = d3.select("body").append("svg") - .attr("width", width) - .attr("height", height); - - svg.selectAll(".node") - .data(nodes(quadtree)) - .enter().append("rect") - .attr("class", "node") - .attr("x", function (d) { return d.x; } ) - .attr("y", function (d) { return d.y; } ) - .attr("width", function (d) { return d.width; } ) - .attr("height", function (d) { return d.height; } ); - - var point = svg.selectAll(".point") - .data(<{ scanned?: boolean; selected?: boolean; 0: number; 1: number }[]> data) - .enter().append("circle") - .attr("class", "point") - .attr("cx", function (d) { return d[0]; } ) - .attr("cy", function (d) { return d[1]; } ) - .attr("r", 4); - - svg.append("g") - .attr("class", "brush") - .call(brush); - - brushed(); - - function brushed() { - var extent = <[[number, number], [number, number]]> brush.extent(); - point.each(function (d) { d.scanned = d.selected = false; } ); - search(quadtree, extent[0][0], extent[0][1], extent[1][0], extent[1][1]); - point.classed("scanned", function (d) { return d.scanned; } ); - point.classed("selected", function (d) { return d.selected; } ); - } - - // Collapse the quadtree into an array of rectangles. - function nodes(quadtree: d3.geom.quadtree.Quadtree<[number, number]>) { - var nodes: Array<{x: number; y: number; width: number; height: number}> = []; - quadtree.visit(function (node: d3.geom.quadtree.Node<[number, number]>, x1: number, y1: number, x2:number, y2: number) { - nodes.push({ x: x1, y: y1, width: x2 - x1, height: y2 - y1 }); - } ); - return nodes; - } - - // Find the nodes within the specified rectangle. - function search(quadtree: d3.geom.quadtree.Quadtree<{ scanned?: boolean; selected?: boolean; 0: number; 1: number }>, x0: number, y0: number, x3: number, y3: number) { - quadtree.visit(function (node: d3.geom.quadtree.Node<{ scanned?: boolean; selected?: boolean; 0: number; 1: number }>, x1: number, y1: number, x2:number, y2: number) { - var p = node.point; - if (p) { - p.scanned = true; - p.selected = (p[0] >= x0) && (p[0] < x3) && (p[1] >= y0) && (p[1] < y3); - } - return x1 >= x3 || y1 >= y3 || x2 < x0 || y2 < y0; - } ); - } -} - -//Example from http://bl.ocks.org/mbostock/4341699 -function convexHull() { - var width = 960, - height = 500; - - var randomX = d3.random.normal(width / 2, 60), - randomY = d3.random.normal(height / 2, 60), - vertices = d3.range(100).map(function (): [number, number] { return [randomX(), randomY()]; } ); - - var svg = d3.select("body").append("svg") - .attr("width", width) - .attr("height", height) - .on("mousemove", function () { vertices[0] = d3.mouse(this); redraw(); } ) - .on("click", function () { vertices.push(d3.mouse(this)); redraw(); } ); - - svg.append("rect") - .attr("width", width) - .attr("height", height); - - var hull = svg.append("path") - .attr("class", "hull"); - - var circle = > svg.selectAll("circle"); - - redraw(); - - function redraw() { - hull.datum(d3.geom.hull(vertices)).attr("d", function (d) { return "M" + d.join("L") + "Z"; } ); - circle = circle.data(vertices); - circle.enter().append("circle").attr("r", 3); - circle.attr("transform", function (d) { return "translate(" + d + ")"; } ); - } -} - -// example from http://bl.ocks.org/mbostock/1044242 -namespace hierarchicalEdgeBundling { - interface Result extends d3.layout.cluster.Result { - parent: Result; - size: number; - key: string; - } - - var diameter = 960, - radius = diameter / 2, - innerRadius = radius - 120; - - var cluster = d3.layout.cluster() - .size([360, innerRadius]) - .sort(null) - .value(function (d) { return d.size; } ); - - var bundle = d3.layout.bundle(); - - var line = d3.svg.line.radial() - .interpolate("bundle") - .tension(.85) - .radius(function (d) { return d.y; } ) - .angle(function (d) { return d.x / 180 * Math.PI; } ); - - var svg = d3.select("body").append("svg") - .attr("width", diameter) - .attr("height", diameter) - .append("g") - .attr("transform", "translate(" + radius + "," + radius + ")"); - - d3.json("readme-flare-imports.json", function (error, classes) { - var nodes = cluster.nodes(packages.root(classes)), - links = packages.imports(nodes); - - svg.selectAll(".link") - .data(bundle(links)) - .enter().append("path") - .attr("class", "link") - .attr("d", line); - - svg.selectAll(".node") - .data(nodes.filter(function (n) { return !n.children; } )) - .enter().append("g") - .attr("class", "node") - .attr("transform", function (d) { return "rotate(" + (d.x - 90) + ")translate(" + d.y + ")"; } ) - .append("text") - .attr("dx", function (d) { return d.x < 180 ? 8 : -8; } ) - .attr("dy", ".31em") - .attr("text-anchor", function (d) { return d.x < 180 ? "start" : "end"; } ) - .attr("transform", function (d) { return d.x < 180 ? null : "rotate(180)"; } ) - .text(function (d) { return d.key; } ); - } ); - - d3.select(self.frameElement).style("height", diameter + "px"); - - var packages = { - - // Lazily construct the package hierarchy from class names. - root: function (classes: any[]) { - var map: {[key: string]: Result} = {}; - - function find(name: string, data?: any) { - var node: Result = map[name], i: number; - if (!node) { - node = map[name] = data || { name: name, children: [] }; - if (name.length) { - node.parent = find(name.substring(0, i = name.lastIndexOf("."))); - node.parent.children.push(node); - node.key = name.substring(i + 1); - } - } - return node; - } - - classes.forEach(function (d) { - find(d.name, d); - } ); - - return map[""]; - } , - - // Return a list of imports for the given array of nodes. - imports: function (nodes: any[]) { - var map: {[key: string]: Result} = {}, - imports: d3.layout.cluster.Link[] = []; - - // Compute a map from name to node. - nodes.forEach(function (d) { - map[d.name] = d; - } ); - - // For each import, construct a link from the source to target node. - nodes.forEach(function (d) { - if (d.imports) d.imports.forEach(function (i: string) { - imports.push({ source: map[d.name], target: map[i] }); - } ); - } ); - - return imports; - } - }; -} - -// example from http://bl.ocks.org/mbostock/1123639 -function roundedRectangles() { - var mouse = [480, 250], - count = 0; - - var svg = d3.select("body").append("svg:svg") - .attr("width", 960) - .attr("height", 500); - - var g = svg.selectAll("g") - .data(d3.range(25)) - .enter().append("svg:g") - .attr("transform", "translate(" + mouse + ")"); - - g.append("svg:rect") - .attr("rx", 6) - .attr("ry", 6) - .attr("x", -12.5) - .attr("y", -12.5) - .attr("width", 25) - .attr("height", 25) - .attr("transform", function (d, i) { return "scale(" + (1 - d / 25) * 20 + ")"; } ) - .style("fill", d3.scale.category20c()); - - var g0 = g.datum(function (d) { - return { center: [0, 0], angle: 0 }; - } ); - - svg.on("mousemove", function () { - mouse = d3.mouse(this); - } ); - - d3.timer(function () { - count++; - g0.attr("transform", function (d, i) { - d.center[0] += (mouse[0] - d.center[0]) / (i + 5); - d.center[1] += (mouse[1] - d.center[1]) / (i + 5); - d.angle += Math.sin((count + i) / 10) * 7; - return "translate(" + d.center + ")rotate(" + d.angle + ")"; - } ); - return true; - } ); -} - -// example from http://bl.ocks.org/mbostock/4060954 -function streamGraph() { - var n = 20, // number of layers - m = 200, // number of samples per layer - stack = d3.layout.stack().offset("wiggle"), - layers0 = stack(d3.range(n).map(function () { return bumpLayer(m); })), - layers1 = stack(d3.range(n).map(function () { return bumpLayer(m); })); - - var width = 960, - height = 500; - - var x = d3.scale.linear() - .domain([0, m - 1]) - .range([0, width]); - - var y = d3.scale.linear() - .domain([0, d3.max(layers0.concat(layers1), function (layer) { return d3.max(layer, function (d) { return d.y0 + d.y; }); })]) - .range([height, 0]); - - var color = d3.scale.linear() - .range(["#aad", "#556"]); - - var area = d3.svg.area<{ x: number; y: number; y0: number }>() - .x(function (d) { return x(d.x); }) - .y0(function (d) { return y(d.y0); }) - .y1(function (d) { return y(d.y0 + d.y); }); - - var svg = d3.select("body").append("svg") - .attr("width", width) - .attr("height", height); - - svg.selectAll("path") - .data(layers0) - .enter().append("path") - .attr("d", area) - .style("fill", function () { return color(Math.random()); }); - - function transition() { - d3.selectAll("path") - .data(function () { - var d = layers1; - layers1 = layers0; - return layers0 = d; - }) - .transition() - .duration(2500) - .attr("d", area); - } - - // Inspired by Lee Byron's test data generator. - function bumpLayer(n: number): Array<{x: number; y: number;y0?:number;}> { - - function bump(a: number[]) { - var x = 1 / (.1 + Math.random()), - y = 2 * Math.random() - .5, - z = 10 / (.1 + Math.random()); - for (var i = 0; i < n; i++) { - var w = (i / n - y) * z; - a[i] += x * Math.exp(-w * w); - } - } - - var a: number[] = [], i: number; - for (i = 0; i < n; ++i) a[i] = 0; - for (i = 0; i < 5; ++i) bump(a); - return a.map(function (d, i) { return { x: i, y: Math.max(0, d) }; } ); - } -} - -// example from http://mbostock.github.io/d3/talk/20111116/force-collapsible.html -namespace forceCollapsable2 { - interface Node extends d3.layout.force.Node { - children: Node[]; - _children: Node[]; - size: number; - id: string; - } - - var w = 1280, - h = 800, - node: d3.selection.Update, - link: d3.selection.Update>, - root: Node; - - var force = d3.layout.force() - .on("tick", tick) - .charge(function (d) { return d._children ? -d.size / 100 : -30; } ) - .linkDistance(function (d) { return d.target._children ? 80 : 30; } ) - .size([w, h - 160]); - - var vis = d3.select("body").append("svg:svg") - .attr("width", w) - .attr("height", h); - - d3.json("flare.json", function (json) { - root = json; - root.fixed = true; - root.x = w / 2; - root.y = h / 2 - 80; - update(); - } ); - - function update() { - var nodes = flatten(root), - links = d3.layout.tree().links(nodes); - - // Restart the force layout. - force - .nodes(nodes) - .links(links) - .start(); - - // Update the links… - link = vis.selectAll("line.link") - .data(links, function (d) { return d.target.id; } ); - - // Enter any new links. - link.enter().insert("svg:line", ".node") - .attr("class", "link") - .attr("x1", function (d) { return d.source.x; } ) - .attr("y1", function (d) { return d.source.y; } ) - .attr("x2", function (d) { return d.target.x; } ) - .attr("y2", function (d) { return d.target.y; } ); - - // Exit any old links. - link.exit().remove(); - - // Update the nodes… - node = vis.selectAll("circle.node") - .data(nodes, function (d) { return d.id; } ) - .style("fill", color); - - node.transition() - .attr("r", function (d) { return d.children ? 4.5 : Math.sqrt(d.size) / 10; } ); - - // Enter any new nodes. - node.enter().append("svg:circle") - .attr("class", "node") - .attr("cx", function (d) { return d.x; } ) - .attr("cy", function (d) { return d.y; } ) - .attr("r", function (d) { return d.children ? 4.5 : Math.sqrt(d.size) / 10; } ) - .style("fill", color) - .on("click", click) - .call(force.drag); - - // Exit any old nodes. - node.exit().remove(); - } - - function tick() { - link.attr("x1", function (d) { return d.source.x; } ) - .attr("y1", function (d) { return d.source.y; } ) - .attr("x2", function (d) { return d.target.x; } ) - .attr("y2", function (d) { return d.target.y; } ); - - node.attr("cx", function (d) { return d.x; } ) - .attr("cy", function (d) { return d.y; } ); - } - - // Color leaf nodes orange, and packages white or blue. - function color(d: Node) { - return d._children ? "#3182bd" : d.children ? "#c6dbef" : "#fd8d3c"; - } - - // Toggle children on click. - function click(d: Node) { - if (d.children) { - d._children = d.children; - d.children = null; - } else { - d.children = d._children; - d._children = null; - } - update(); - } - - // Returns a list of all nodes under the root. - function flatten(root: Node) { - var nodes: Node[] = [], i = 0; - - function recurse(node: Node) { - if (node.children) node.size = node.children.reduce(function (p, v) { return p + recurse(v); } , 0); - if (!node.id) node.id = String(++i); - nodes.push(node); - return node.size; - } - - root.size = recurse(root); - return nodes; - } -} - -//exapmle from http://bl.ocks.org/mbostock/4062006 -function chordDiagram() { - var matrix = [ - [11975, 5871, 8916, 2868], - [1951, 10048, 2060, 6171], - [8010, 16145, 8090, 8045], - [1013, 990, 940, 6907] - ]; - - var chord = d3.layout.chord() - .padding(.05) - .sortSubgroups(d3.descending) - .matrix(matrix); - - var width = 960, - height = 500, - innerRadius = Math.min(width, height) * .41, - outerRadius = innerRadius * 1.1; - - var fill = d3.scale.ordinal() - .domain(d3.range(4)) - .range(["#000000", "#FFDD89", "#957244", "#F26223"]); - - var svg = d3.select("body").append("svg") - .attr("width", width) - .attr("height", height) - .append("g") - .attr("transform", "translate(" + width / 2 + "," + height / 2 + ")"); - - svg.append("g").selectAll("path") - .data(chord.groups) - .enter().append("path") - .style("fill", function (d) { return fill(d.index); } ) - .style("stroke", function (d) { return fill(d.index); } ) - .attr("d", d3.svg.arc().innerRadius(innerRadius).outerRadius(outerRadius)) - .on("mouseover", fade(.1)) - .on("mouseout", fade(1)); - - var ticks = svg.append("g").selectAll("g") - .data(chord.groups) - .enter().append("g").selectAll("g") - .data(groupTicks) - .enter().append("g") - .attr("transform", function (d) { - return "rotate(" + (d.angle * 180 / Math.PI - 90) + ")" - + "translate(" + outerRadius + ",0)"; - } ); - - ticks.append("line") - .attr("x1", 1) - .attr("y1", 0) - .attr("x2", 5) - .attr("y2", 0) - .style("stroke", "#000"); - - ticks.append("text") - .attr("x", 8) - .attr("dy", ".35em") - .attr("transform", function (d) { return d.angle > Math.PI ? "rotate(180)translate(-16)" : null; } ) - .style("text-anchor", function (d) { return d.angle > Math.PI ? "end" : null; } ) - .text(function (d) { return d.label; } ); - - svg.append("g") - .attr("class", "chord") - .selectAll("path") - .data(chord.chords) - .enter().append("path") - .attr("d", d3.svg.chord().radius(innerRadius)) - .style("fill", function (d) { return fill(d.target.index); } ) - .style("opacity", 1); - - // Returns an array of tick angles and labels, given a group. - function groupTicks(d: d3.layout.chord.Node) { - var k = (d.endAngle - d.startAngle) / d.value; - return d3.range(0, d.value, 1000).map(function (v, i) { - return { - angle: v * k + d.startAngle, - label: i % 5 ? null : v / 1000 + "k" - }; - } ); - } - - // Returns an event handler for fading a given chord group. - function fade(opacity: number) { - return function (g: {}, i: number) { - svg.selectAll(".chord path") - .filter(function (d) { return d.source.index != i && d.target.index != i; } ) - .transition() - .style("opacity", opacity); - }; - } -} - -//example from http://mbostock.github.io/d3/talk/20111116/iris-parallel.html -function irisParallel() { - var species = ["setosa", "versicolor", "virginica"], - traits = ["sepal length", "petal length", "sepal width", "petal width"]; - - var m = [80, 160, 200, 160], - w = 1280 - m[1] - m[3], - h = 800 - m[0] - m[2]; - - var x = d3.scale.ordinal().domain(traits).rangePoints([0, w]), - y: {[key: string]: any} = {}; - - var line = d3.svg.line(), - axis = d3.svg.axis().orient("left"), - foreground: d3.Selection<{ [key: string]: string}>; - - var svg = d3.select("body").append("svg:svg") - .attr("width", w + m[1] + m[3]) - .attr("height", h + m[0] + m[2]) - .append("svg:g") - .attr("transform", "translate(" + m[3] + "," + m[0] + ")"); - - d3.csv("iris.csv", function (flowers) { - var i: number; - - // Create a scale and brush for each trait. - traits.forEach(function (d) { - y[d] = d3.scale.linear() - .domain(d3.extent(flowers, function (p) { return +p[d]; } )) - .range([h, 0]); - - y[d].brush = d3.svg.brush() - .y(y[d]) - .on("brush", brush); - } ); - - // Add a legend. - var legend = svg.selectAll("g.legend") - .data(species) - .enter().append("svg:g") - .attr("class", "legend") - .attr("transform", function (d, i) { return "translate(0," + (i * 20 + 584) + ")"; } ); - - legend.append("svg:line") - .attr("class", String) - .attr("x2", 8); - - legend.append("svg:text") - .attr("x", 12) - .attr("dy", ".31em") - .text(function (d) { return "Iris " + d; } ); - - // Add foreground lines. - foreground = svg.append("svg:g") - .attr("class", "foreground") - .selectAll("path") - .data(flowers) - .enter().append("svg:path") - .attr("d", path) - .attr("class", function (d) { return d['species']; } ); - - // Add a group element for each trait. - var g = svg.selectAll(".trait") - .data(traits) - .enter().append("svg:g") - .attr("class", "trait") - .attr("transform", function (d) { return "translate(" + x(d) + ")"; } ) - .call(d3.behavior.drag() - .origin(function (d) { return { x: x(d), y: NaN }; } ) - .on("dragstart", dragstart) - .on("drag", drag) - .on("dragend", dragend)); - - // Add an axis and title. - g.append("svg:g") - .attr("class", "axis") - .each(function (d) { d3.select(this).call(axis.scale(y[d])); } ) - .append("svg:text") - .attr("text-anchor", "middle") - .attr("y", -9) - .text(String); - - // Add a brush for each axis. - g.append("svg:g") - .attr("class", "brush") - .each(function (d) { d3.select(this).call(y[d].brush); } ) - .selectAll("rect") - .attr("x", -8) - .attr("width", 16); - - function dragstart(d: string) { - i = traits.indexOf(d); - } - - function drag(d: string) { - x.range()[i] = ( d3.event).x; - traits.sort(function (a, b) { return x(a) - x(b); } ); - g.attr("transform", function (d) { return "translate(" + x(d) + ")"; } ); - foreground.attr("d", path); - } - - function dragend(d: string) { - x.domain(traits).rangePoints([0, w]); - var t = d3.transition().duration(500); - t.selectAll(".trait").attr("transform", function (d) { return "translate(" + x(d) + ")"; } ); - t.selectAll(".foreground path").attr("d", path); - } - } ); - - // Returns the path for a given data point. - function path(d: any): string { - return line(traits.map(function (p): [number, number] { return [x(p), y[p](d[p])]; } )); - } - - // Handles a brush event, toggling the display of foreground lines. - function brush() { - var actives = traits.filter(function (p) { return !y[p].brush.empty(); } ), - extents = actives.map(function (p) { return y[p].brush.extent(); } ); - foreground.classed("fade", function (d) { - return !actives.every(function (p, i) { - return extents[i][0] <= d[p] && d[p] <= extents[i][1]; - } ); - } ); - } -} - -//example from -function healthAndWealth() { - // Various accessors that specify the four dimensions of data to visualize. - function x(d: any) { return d.income; } - function y(d: any) { return d.lifeExpectancy; } - function radius(d: any) { return d.population; } - function color(d: any) { return d.region; } - function key(d: any) { return d.name; } - - // Chart dimensions. - var margin = { top: 19.5, right: 19.5, bottom: 19.5, left: 39.5 }, - width = 960 - margin.right, - height = 500 - margin.top - margin.bottom; - - // Various scales. These domains make assumptions of data, naturally. - var xScale = d3.scale.log().domain([300, 1e5]).range([0, width]), - yScale = d3.scale.linear().domain([10, 85]).range([height, 0]), - radiusScale = d3.scale.sqrt().domain([0, 5e8]).range([0, 40]), - colorScale = d3.scale.category10(); - - // The x & y axes. - var xAxis = d3.svg.axis().orient("bottom").scale(xScale).ticks(12, d3.format(",d")), - yAxis = d3.svg.axis().scale(yScale).orient("left"); - - // Create the SVG container and set the origin. - var svg = d3.select("#chart").append("svg") - .attr("width", width + margin.left + margin.right) - .attr("height", height + margin.top + margin.bottom) - .append("g") - .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); - - // Add the x-axis. - svg.append("g") - .attr("class", "x axis") - .attr("transform", "translate(0," + height + ")") - .call(xAxis); - - // Add the y-axis. - svg.append("g") - .attr("class", "y axis") - .call(yAxis); - - // Add an x-axis label. - svg.append("text") - .attr("class", "x label") - .attr("text-anchor", "end") - .attr("x", width) - .attr("y", height - 6) - .text("income per capita, inflation-adjusted (dollars)"); - - // Add a y-axis label. - svg.append("text") - .attr("class", "y label") - .attr("text-anchor", "end") - .attr("y", 6) - .attr("dy", ".75em") - .attr("transform", "rotate(-90)") - .text("life expectancy (years)"); - - // Add the year label; the value is set on transition. - var label = svg.append("text") - .attr("class", "year label") - .attr("text-anchor", "end") - .attr("y", height - 24) - .attr("x", width) - .text(1800); - - // Load the data. - d3.json("nations.json", function (nations: any[]) { - - // A bisector since many nation's data is sparsely-defined. - var bisect = d3.bisector(function (d: any) { return d[0]; } ); - - // Add a dot per nation. Initialize the data at 1800, and set the colors. - var dot = svg.append("g") - .attr("class", "dots") - .selectAll(".dot") - .data(interpolateData(1800)) - .enter().append("circle") - .attr("class", "dot") - .style("fill", function (d) { return colorScale(color(d)); } ) - .call(position) - .sort(order); - - // Add a title. - dot.append("title") - .text(function (d) { return d.name; } ); - - // Add an overlay for the year label. - var box = (label.node()).getBBox(); - - var overlay = svg.append("rect") - .attr("class", "overlay") - .attr("x", box.x) - .attr("y", box.y) - .attr("width", box.width) - .attr("height", box.height) - .on("mouseover", enableInteraction); - - // Start a transition that interpolates the data based on year. - svg.transition() - .duration(30000) - .ease("linear") - .tween("year", tweenYear) - .each("end", enableInteraction); - - // Positions the dots based on data. - function position(dot: d3.Selection) { - dot.attr("cx", function (d) { return xScale(x(d)); } ) - .attr("cy", function (d) { return yScale(y(d)); } ) - .attr("r", function (d) { return radiusScale(radius(d)); } ); - } - - // Defines a sort order so that the smallest dots are drawn on top. - function order(a: any, b: any) { - return radius(b) - radius(a); - } - - // After the transition finishes, you can mouseover to change the year. - function enableInteraction() { - var yearScale = d3.scale.linear() - .domain([1800, 2009]) - .range([box.x + 10, box.x + box.width - 10]) - .clamp(true); - - // Cancel the current transition, if any. - svg.transition().duration(0); - - overlay - .on("mouseover", mouseover) - .on("mouseout", mouseout) - .on("mousemove", mousemove) - .on("touchmove", mousemove); - - function mouseover() { - label.classed("active", true); - } - - function mouseout() { - label.classed("active", false); - } - - function mousemove() { - displayYear(yearScale.invert(d3.mouse(this)[0])); - } - } - - // Tweens the entire chart by first tweening the year, and then the data. - // For the interpolated data, the dots and label are redrawn. - function tweenYear() { - var year = d3.interpolateNumber(1800, 2009); - return function (t: number) { displayYear(year(t)); }; - } - - // Updates the display to show the specified year. - function displayYear(year: number) { - dot.data(interpolateData(year), key).call(position).sort(order); - label.text(Math.round(year)); - } - - // Interpolates the dataset for the given (fractional) year. - function interpolateData(year: number) { - return nations.map(function (d) { - return { - name: d.name, - region: d.region, - income: interpolateValues(d.income, year), - population: interpolateValues(d.population, year), - lifeExpectancy: interpolateValues(d.lifeExpectancy, year) - }; - } ); - } - - // Finds (and possibly interpolates) the value for the specified year. - function interpolateValues(values: any[], year: number) { - var i = bisect.left(values, year, 0, values.length - 1), - a = values[i]; - if (i > 0) { - var b = values[i - 1], - t = (year - a[0]) / (b[0] - a[0]); - return a[1] * (1 - t) + b[1] * t; - } - return a[1]; - } - } ); -} - -// Test for d3.functor -function functorTest () { - var f: (n: number) => number = d3.functor(10); - var g = d3.functor(function (v: number) { return v; }); - - return f(10) === g(10); -} - -// Test for d3.Nest -// Most test adopted from: https://github.com/mbostock/d3/blob/master/test/arrays/nest-test.js -function nestTest () { - var data = [ - { - a: 10, - b: [ 1, 2 ] - }, - { - a: 20, - b: [ 2, 3 ] - }, - { - a: 30, - b: [ 1, 2 ] - } - ]; - - var n1 = d3.nest<{a: number; b: number[] }>() - .key(function (d) { return String(d.a); }) - .sortKeys(d3.descending) - .rollup(function (vals) { - return d3.sum(vals[0].b); - }); - n1.map(data); - n1.entries(data); - - var n2 = d3.nest<{ a: number; b: number[] }>() - .key(function (d) { return String(d.a); }) - .sortValues(function (x1, x2) { - return x1.b[0] < x1.b[1] ? -1 : (x1.b[0] > x1.b[0] ? 1 : 0); }); - n2.map(data); - n2.entries(data); - - // Tests adopted from d3's tests. - var keys = d3.nest<{ foo: number; }>() - .key(function(d) { return String(d.foo); }) - .entries([{foo: 1}, {foo: 1}, {foo: 2}]) - .map(function(d) { return d.key; }) - .sort(d3.ascending); - - var entries = d3.nest<{foo: number; bar?: number}>() - .key(function(d) { return String(d.foo); }) - .entries([{foo: 1, bar: 0}, {foo: 2}, {foo: 1, bar: 1}]); - - keys = d3.nest<{foo: number}>() - .key(function(d) { return String(d.foo); }).sortKeys(d3.descending) - .entries([{foo: 1}, {foo: 1}, {foo: 2}]) - .map(function(d) { return d.key; }); - - entries = d3.nest<{ foo: number; bar?: number }>() - .key(function(d) { return String(d.foo); }) - .sortValues(function(a, b) { return a.bar - b.bar; }) - .entries([{foo: 1, bar: 2}, {foo: 1, bar: 0}, {foo: 1, bar: 1}, {foo: 2}]); - - entries = d3.nest<{ foo: number; bar?: number }>() - .key(function(d) { return String(d.foo); }) - .rollup(function(values) { return d3.sum(values, function(d) { return d.bar; }); }) - .entries([{foo: 1, bar: 2}, {foo: 1, bar: 0}, {foo: 1, bar: 1}, {foo: 2}]); - - entries = d3.nest<[number, number]>() - .key(function(d) { return String(d[0]); }).sortKeys(d3.ascending) - .key(function(d) { return String(d[1]); }).sortKeys(d3.ascending) - .entries([[0, 1], [0, 2], [1, 1], [1, 2], [0, 2]]); - - entries = d3.nest<[number, number]>() - .key(function(d) { return String(d[0]); }).sortKeys(d3.ascending) - .key(function(d) { return String(d[1]); }).sortKeys(d3.ascending) - .rollup(function(values) { return values.length; }) - .entries([[0, 1], [0, 2], [1, 1], [1, 2], [0, 2]]); - - entries = d3.nest<{ 0: number; 1: number; 2?: number }>() - .key(function(d) { return String(d[0]); }).sortKeys(d3.ascending) - .key(function(d) { return String(d[1]); }).sortKeys(d3.ascending) - .sortValues(function(a, b) { return a[2] - b[2]; }) - .entries([[0, 1], [0, 2, 1], [1, 1], [1, 2], [0, 2, 0]]); - - var map = d3.nest<{ 0: number; 1: number; 2?: number }>() - .key(function(d) { return String(d[0]); }).sortKeys(d3.ascending) - .key(function(d) { return String(d[1]); }).sortKeys(d3.ascending) - .sortValues(function(a, b) { return a[2] - b[2]; }) - .map([[0, 1], [0, 2, 1], [1, 1], [1, 2], [0, 2, 0]]); -} - -// Test for setting attributes as an object -// From https://github.com/mbostock/d3/blob/master/test/selection/attr-test.js -function attrObjTest () { - d3.select('body') - .data(["orange"]) - .attr({"xlink:href": function(d, i) { return d + "-" + i + ".png"; }}); -} - -// Test for setting styles as an object -// From https://github.com/mbostock/d3/blob/master/test/selection/style-test.js -function styleObjTest () { - d3.select('body') - .style({"background-color": "white", opacity: .42}); -} - -// Test for setting styles as an object -// From https://github.com/mbostock/d3/blob/master/test/selection/property-test.js -function propertyObjTest () { - d3.select('body') - .property({bgcolor: "purple", opacity: .41}); -} - - -// Test for brushes -function brushTest() { - var xScale = d3.scale.linear(), - yScale = d3.scale.linear(); - - var xMin = 0, xMax = 1, - yMin = 0, yMax = 1; - - // Setting only x scale. - var brush1 = d3.svg.brush() - .x(xScale) - .on('brush', function () { - var extent = <[number, number]> brush1.extent(); - xMin = Math.max(extent[0], 0); - xMax = Math.min(extent[1], 1); - brush1.extent([xMin, xMax]); - }); - - // Setting both the x and y scale - var brush2 = d3.svg.brush() - .x(xScale) - .y(yScale) - .on('brush', function () { - var extent = <[[number, number], [number, number]]> brush2.extent(); - var xExtent = extent[0], - yExtent = extent[1]; - - xMin = Math.max(xExtent[0], 0); - xMax = Math.min(xExtent[1], 1); - - yMin = Math.max(yExtent[0], 0); - yMax = Math.min(yExtent[1], 1); - - brush1.extent([[xMin, xMax], [yMin, yMax]]); - }); -} - - -// Tests for area -// Adopted from: https://github.com/mbostock/d3/blob/master/test/svg/area-test.js -function svgAreaTest () { - var a = d3.svg.area(), - f: () => number, - n: number; - - a.x(f).x() === f; - a.x(n).x() === n; - a.x(0); - a.x(function (d) { return d[0] * 10; }); - a.x(function (d, i) { return i * 10; }); - - a.x(f).x0() === f; - a.x(n).x0() === n; - a.x0(0); - a.x0(function (d) { return d[0] * 10; }); - a.x0(function (d, i) { return i * 10; }); - - a.x(f).x1() === f; - a.x(n).x1() === n; - a.x1(0); - a.x1(function (d) { return d[0] * 10; }); - a.x1(function (d, i) { return i * 10; }); - - a.y(f).y() === f; - a.y(n).y() === n; - a.y(0); - a.y(function (d) { return d[0] * 10; }); - a.y(function (d, i) { return i * 10; }); - - a.y(f).y0() === f; - a.y(n).y0() === n; - a.y0(0); - a.y0(function (d) { return d[0] * 10; }); - a.y0(function (d, i) { return i * 10; }); - - a.y(f).y1() === f; - a.y(n).y1() === n; - a.y1(0); - a.y1(function (d) { return d[0] * 10; }); - a.y1(function (d, i) { return i * 10; }); -} - -// Tests for areaRadial -// Adopted from: https://github.com/mbostock/d3/blob/master/test/svg/area-radial-test.js -function svgAreaRadialTest () { - var a = d3.svg.area.radial(), - f: () => number, - n: number; - - a.radius(f).radius() === f; - a.radius(n).radius() === n; - a.radius(0); - a.radius(function (d) { return d[0] * 10; }); - a.radius(function (d, i) { return i * 10; }); - - a.radius(f).innerRadius() === f; - a.radius(n).innerRadius() === n; - a.innerRadius(0); - a.innerRadius(function (d) { return d[0] * 10; }); - a.innerRadius(function (d, i) { return i * 10; }); - - a.radius(f).outerRadius() === f; - a.radius(n).outerRadius() === n; - a.outerRadius(0); - a.outerRadius(function (d) { return d[1] * 10; }); - a.outerRadius(function (d, i) { return i * 10; }); - - a.angle(f).angle() === f; - a.angle(n).angle() === n; - a.angle(0); - a.angle(function (d) { return d[0] * 10; }); - a.angle(function (d, i) { return i * 10; }); - - a.angle(f).startAngle() === f; - a.angle(n).startAngle() === n; - a.startAngle(0); - a.startAngle(function (d) { return d[0] * 10; }); - a.startAngle(function (d, i) { return i * 10; }); - - a.angle(f).endAngle() === f; - a.angle(n).endAngle() === n; - a.endAngle(0); - a.endAngle(function (d) { return d[1] * 10; }); - a.endAngle(function (d, i) { return i * 10; }); -} - -// Tests for d3.svg.line -// Adopted from: https://github.com/mbostock/d3/blob/master/test/svg/line-test.js -function svgLineTest () { - var l = d3.svg.line(), - f: () => number, - n: number; - - l.x(f).x() === f; - l.x(n).x() === n; - l.x(0); - l.x(function (d) { return d[0]; }); - l.x(function (d, i) { return i; }); - - l.y(f).y() === f; - l.y(n).y() === n; - l.y(0); - l.y(function (d) { return d[1]; }); - l.y(function (d, i) { return i; }); -} - -// Tests for d3.svg.line.radial -// Adopted from: https://github.com/mbostock/d3/blob/master/test/svg/line-radial-test.js -function svgLineRadialTest () { - var l = d3.svg.line.radial(), - f: () => number, - n: number; - - l.radius(f).radius() === f; - l.radius(n).radius() === n; - l.radius(0); - l.radius(function (d) { return d[0]; }); - l.radius(function (d, i) { return i; }); - - l.angle(f).angle() === f; - l.angle(n).angle() === n; - l.angle(0); - l.angle(function (d) { return d[1]; }); - l.angle(function (d, i) { return i; }); -} - -// Tests for d3.svg.arc -// Adopted from: https://github.com/mbostock/d3/blob/master/test/svg/arc-test.js -function svgArcTest () { - var l = d3.svg.arc(), - f: () => number; - - l.innerRadius(f).innerRadius() === f; - l.innerRadius(0); - l.innerRadius(function (d) { return d.innerRadius; }); - l.innerRadius(function (d, i) { return i; }); - - l.outerRadius(f).outerRadius() === f; - l.outerRadius(0); - l.outerRadius(function (d) { return d.outerRadius; }); - l.outerRadius(function (d, i) { return i; }); - - l.startAngle(f).startAngle() === f; - l.startAngle(0); - l.startAngle(function (d) { return d.innerRadius; }); - l.startAngle(function (d, i) { return i; }); - - l.endAngle(f).endAngle() === f; - l.endAngle(0); - l.endAngle(function (d) { return d.outerRadius; }); - l.endAngle(function (d, i) { return i; }); -} - -function svgArcTest2 () { - var l = d3.svg.arc<[number, number]>(); - - l.innerRadius(d => d[0]); - l.outerRadius(d => d[1]); -} - -// Tests for d3.svg.diagonal -// Adopted from: https://github.com/mbostock/d3/blob/master/test/svg/diagonal-test.js -function svgDiagonalTest () { - var d = d3.svg.diagonal(); - - d.projection()({ x: 0, y: 1}, 0); - d.projection(function (d) { return [d.x, d.y]; }); - d.projection(function (d, i) { return [i, i + 1]; }); - - d.source()({ source: {x: 0, y: 1}, target: null }, 0); - d.source({x: 0, y: 1}); - d.source(function (d) { return {x: d.source.x, y: d.source.y}; }); - d.source(function (d, i) { return {x: d.source.x * i, y: d.source.y * i}; }); - - d.target()({ target: {x: 0, y: 1}, source: null }, 0); - d.target({x: 0, y: 1}); - d.target(function (d) { return {x: d.target.x, y: d.target.y}; }); - d.target(function (d, i) { return {x: d.target.x * i, y: d.target.y * i}; }); -} - -// Tests for d3.extent -// Adopted from: https://github.com/mbostock/d3/blob/master/test/arrays/extent-test.js -function extentTest() { - // usages of `o' suppressed as well as mixed-type comparisons - // see https://github.com/Microsoft/TypeScript/commit/c0db7ffe8f55b6ec335880482ca43b93b066689d - var o = { valueOf: function () { return NaN; } }; - - d3.extent([1]); - d3.extent([5, 1, 2, 3, 4]); - d3.extent([20, 3]); - d3.extent([3, 20]); - d3.extent(["c", "a", "b"]); - d3.extent(["20", "3"]); - d3.extent(["3", "20"]); - d3.extent([NaN, 1, 2, 3, 4, 5]); - // d3.extent([o, 1, 2, 3, 4, 5]); - d3.extent([1, 2, 3, 4, 5, NaN]); - // d3.extent([1, 2, 3, 4, 5, o]); - d3.extent([10, null, 3, undefined, 5, NaN]); - d3.extent([-1, null, -3, undefined, -5, NaN]); - // d3.extent([20, "3"]); - // d3.extent(["20", 3]); - // d3.extent([3, "20"]); - // d3.extent(["3", 20]); - - d3.extent([1], (d) => { return d; }); - d3.extent([5, 1, 2, 3, 4], (d) => { return d; }); - d3.extent([20, 3], (d) => { return d; }); - d3.extent([3, 20], (d) => { return d; }); - d3.extent(["c", "a", "b"], (d) => { return d; }); - d3.extent(["20", "3"], (d) => { return d; }); - d3.extent(["3", "20"], (d) => { return d; }); - d3.extent([NaN, 1, 2, 3, 4, 5], (d) => { return d; }); - // d3.extent([o, 1, 2, 3, 4, 5], (d) => { return d; }); - d3.extent([1, 2, 3, 4, 5, NaN], (d) => { return d; }); - // d3.extent([1, 2, 3, 4, 5, o], (d) => { return d; }); - d3.extent([10, null, 3, undefined, 5, NaN], (d) => { return d; }); - d3.extent([-1, null, -3, undefined, -5, NaN], (d) => { return d; }); - // d3.extent([20, "3"], (d) => { return d; }); - // d3.extent(["20", 3], (d) => { return d; }); - // d3.extent([3, "20"], (d) => { return d; }); - // d3.extent(["3", 20], (d) => { return d; }); -} - -// Tests for d3.time.format.multi -// Adopted from http://bl.ocks.org/mbostock/4149176 -function multiTest() { - var customTimeFormat = d3.time.format.multi([ - [".%L", function(d) { return !!d.getMilliseconds(); }], - [":%S", function(d) { return !!d.getSeconds(); }], - ["%I:%M", function(d) { return !!d.getMinutes(); }], - ["%I %p", function(d) { return !!d.getHours(); }], - ["%a %d", function(d) { return !!d.getDay() && d.getDate() != 1; }], - ["%b %d", function(d) { return d.getDate() != 1; }], - ["%B", function(d) { return !!d.getMonth(); }], - ["%Y", function() { return true; }] - ]); - - var margin = {top: 250, right: 40, bottom: 250, left: 40}, - width = 960 - margin.left - margin.right, - height = 500 - margin.top - margin.bottom; - - var x = d3.time.scale() - .domain([new Date(2012, 0, 1), new Date(2013, 0, 1)]) - .range([0, width]); - - var xAxis = d3.svg.axis() - .scale(x) - .tickFormat(customTimeFormat); - - var svg = d3.select("body").append("svg") - .attr("width", width + margin.left + margin.right) - .attr("height", height + margin.top + margin.bottom) - .append("g") - .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); - - svg.append("g") - .attr("class", "x axis") - .attr("transform", "translate(0," + height + ")") - .call(xAxis); -} - -function testD3Events () { - d3.select('svg') - .on('click', () => { - let e = d3.event; - var coords = [e.pageX, e.pageY]; - console.log("clicked", e.target, "at " + coords); - }) - .on('keypress', () => { - let e = d3.event; - if (e.shiftKey) { - console.log('shift + ' + e.which); - } - }); -} - -function testD3MutlieTimeFormat() { - var format = d3.time.format.multi([ - [".%L", function(d) { return d.getMilliseconds(); }], - [":%S", function(d) { return d.getSeconds(); }], - ["%I:%M", function(d) { return d.getMinutes(); }], - ["%I %p", function(d) { return d.getHours(); }], - ["%a %d", function(d) { return d.getDay() && d.getDate() != 1; }], - ["%b %d", function(d) { return d.getDate() != 1; }], - ["%B", function(d) { return d.getMonth(); }], - ["%Y", function() { return true; }] - ]); -} - -function testMultiUtcFormat() { - var format = d3.time.format.utc.multi([ - [".%L", function(d) { return d.getMilliseconds(); }], - [":%S", function(d) { return d.getSeconds(); }], - ["%I:%M", function(d) { return d.getMinutes(); }], - ["%I %p", function(d) { return d.getHours(); }], - ["%a %d", function(d) { return d.getDay() && d.getDate() != 1; }], - ["%b %d", function(d) { return d.getDate() != 1; }], - ["%B", function(d) { return d.getMonth(); }], - ["%Y", function() { return true; }] - ]); -} - -function testEnterSizeEmpty() { - - var selectionSize: number, - emptyStatus: boolean; - - var newNodes = d3.selectAll('.test') - .data(['1', '2', '3']) - .enter(); - - emptyStatus = newNodes.empty(); - selectionSize = newNodes.size(); - -} diff --git a/d3kit/d3kit-tests.ts b/d3kit/d3kit-tests.ts deleted file mode 100644 index c8a447ecda..0000000000 --- a/d3kit/d3kit-tests.ts +++ /dev/null @@ -1,196 +0,0 @@ -/// - -function test_abstract_chart() { - let el: Element, - chart: d3kit.AbstractChart, - options: d3kit.ChartOptions, - margins: d3kit.ChartMargin, - offsets: [number, number], - defopts: d3kit.ChartOptions, - fitopts: d3kit.FitOptions, - watchop: d3kit.WatchOptions, - events: string[], - w: number, h:number, d: [number, number], a: any, b: boolean; - - // create a div, append to body, return Node as type Element - el = document.body.appendChild(document.createElement('div')) as Element; - - // create examples of margins, offsets, options, fit options, watch options - margins = { top: 20, right: 20, bottom: 20, left: 20}; - offsets = [0.5, 0.5]; - options = { initialWidth: 400, initialHeight: 300, margin: margins, offset: offsets }; - fitopts = { mode: 'basic', width: '90%', ratio: 4/3 }; - watchop = { mode: 'window', target: null, interval: 500 }; - - /** - * Test constructor - */ - chart = new d3kit.AbstractChart(el); // with element - chart = new d3kit.AbstractChart('div#chart'); // with selector - chart = new d3kit.AbstractChart(el, options); // with element+options - chart = new d3kit.AbstractChart('div#chart', options); // with selector+options - - /** - * Test static functions - */ - defopts = d3kit.AbstractChart.getDefaultOptions(); - events = d3kit.AbstractChart.getCustomEventNames(); - - /** - * Test getters - */ - w = chart.getInnerWidth(); - h = chart.getInnerHeight(); - w = chart.width(); - h = chart.height(); - d = chart.dimension(); - a = chart.data(); - margins = chart.margin(); - offsets = chart.offset(); - options = chart.options(); - events = chart.getCustomEventNames(); - - /** - * Test setters - */ - chart.width(w); - chart.height(h); - chart.dimension(d); - chart.data([1, 2, 3, 4, 5, 6]); - chart.margin(margins); - chart.offset(offsets); - chart.options(options); - - /** - * Test booleans - */ - b = chart.hasData(); - b = chart.hasNonZeroArea(); - - /** - * Test events - */ - chart.dimension(d).updateDimensionNow(); - chart.setupDispatcher(['click', 'mouseover']); - chart.fit(fitopts); // without watch options - chart.fit(fitopts, watchop); // with watch options - chart.stopFitWatcher(); - chart.on('mouseover', () => { chart.stopFitWatcher(); }); - chart.off('mouseover'); - chart.destroy(); -} - -function test_svgchart() { - let el: Element, - chart: d3kit.SvgChart, - options: d3kit.ChartOptions, - margins: d3kit.ChartMargin, - offsets: [number, number], - svg: d3.Selection, - rootg: d3.Selection, - layers: d3kit.LayerOrganizer; - - // create a div, append to body, return Node as type Element - el = document.body.appendChild(document.createElement('div')) as Element; - - // create examples of margins, offsets, options, fit options, watch options - margins = { top: 20, right: 20, bottom: 20, left: 20}; - offsets = [0.5, 0.5]; - options = { initialWidth: 400, initialHeight: 300, margin: margins, offset: offsets }; - - /** - * Test constructor - */ - chart = new d3kit.SvgChart(el); // with element - chart = new d3kit.SvgChart('div#chart'); // with selector - chart = new d3kit.SvgChart(el, options); // with element+options - chart = new d3kit.SvgChart('div#chart', options); // with selector+options - - /** - * Test properties - */ - svg = chart.svg; - rootg = chart.rootG; - layers = chart.layers; -} - -function test_canvaschart() { - let el: Element, - chart: d3kit.CanvasChart, - options: d3kit.ChartOptions, - margins: d3kit.ChartMargin, - offsets: [number, number], - context: CanvasRenderingContext2D; - - // create a div, append to body, return Node as type Element - el = document.body.appendChild(document.createElement('div')) as Element; - - // create examples of margins, offsets, options, fit options, watch options - margins = { top: 20, right: 20, bottom: 20, left: 20}; - offsets = [0.5, 0.5]; - options = { initialWidth: 400, initialHeight: 300, margin: margins, offset: offsets, pixelRatio: 1 }; - - /** - * Test constructor - */ - chart = new d3kit.CanvasChart(el); // with element - chart = new d3kit.CanvasChart('div#chart'); // with selector - chart = new d3kit.CanvasChart(el, options); // with element+options - chart = new d3kit.CanvasChart('div#chart', options); // with selector+options - - /** - * Test canvas chart functions - */ - context = chart.getContext2d(); - options = d3kit.CanvasChart.getDefaultOptions(); - chart.clear(); -} - -function test_layer_organizer() { - let selection: d3.Selection, - layer: d3.Selection, - layers: d3kit.LayerOrganizer, - hasXAxis: boolean; - - selection = d3.select('svg'); - - /** - * Test constructor - */ - layers = new d3kit.LayerOrganizer(selection); // without specifying tag - layers = new d3kit.LayerOrganizer(selection, 'div'); // specifying tag - - /** - * Test layer creation - */ - layers.create('graph'); - layers.create(['graph', 'highlight']); - layers.create({'graph': [{'axes':['x-axis', 'y-axis']}, {'labels':['x-label', 'y-label', 'title']}]}); - layers.create([{'axes':['x-axis', 'y-axis']}, {'labels':['x-label', 'y-label', 'title']}]); - - /** - * Test other layer organizer functions - */ - layer = layers.get('x-axis'); - hasXAxis = layers.has('x-axis'); -} - -function test_helper() { - let simple1: Object = { "one": 1 }, - simple2: Object = { "two": 2 }, - complex: Object = { "fruit": ["apple", "pear", "grape"], "prez": { "fn": "Barack", "ln": "Obama" } }, - merged1: Object, merged2: Object, - anObject: Object = {"this": "isanobject"}, isObj: boolean, - aFuncxn = () => "this is a function", isFunc: boolean, - kebabed: string, dbouncd: any, throtld: any; - - dbouncd = d3kit.helper.debounce(aFuncxn, 300); - merged1 = d3kit.helper.extend(simple1, simple2); - merged2 = d3kit.helper.deepExtend(simple1, complex); - aFuncxn = d3kit.helper.functor(aFuncxn); // with a function argument - aFuncxn = d3kit.helper.functor(simple1); // with a value argument - isObj = d3kit.helper.isObject(anObject); - isFunc = d3kit.helper.isFunction(aFuncxn); - kebabed = d3kit.helper.kebabCase("a string to convert to kebab case"); - throtld = d3kit.helper.throttle(aFuncxn, 300); -} diff --git a/d3kit/v1/d3kit-tests.ts b/d3kit/v1/d3kit-tests.ts deleted file mode 100644 index d49891822b..0000000000 --- a/d3kit/v1/d3kit-tests.ts +++ /dev/null @@ -1,1111 +0,0 @@ -/// -/// -/// - -/* jshint expr: true */ - -var expect = chai.expect; -describe('Skeleton', function(){ - var element: Element, $element: d3.Selection, $svg: d3.Selection, skeleton: d3kit.Skeleton; - - beforeEach(function(done){ - element = document.body.appendChild(document.createElement('div')) as Element; - skeleton = new d3kit.Skeleton(element, null, ['custom1', 'custom2']); - $element = d3.select(element); - $svg = $element.select('svg'); - done(); - }); - - describe('new Skeleton()', function(){ - it('should create inside the element', function(){ - expect($element.select('svg').size()).to.be.equal(1); - }); - it('should create inside inside the element', function(){ - expect($element.select('svg').select('g').size()).to.be.equal(1); - }); - }); - - describe('#getCustomEventNames()', function(){ - it('should return custom event names', function(){ - expect(skeleton.getCustomEventNames()).to.deep.equal(['custom1', 'custom2']); - }); - }); - - describe('#getDispatcher()', function(){ - it('should return event dispatcher', function(){ - expect(skeleton.getDispatcher()).to.be.an('Object'); - expect(skeleton.getDispatcher().data).to.be.a('Function'); - }); - }); - - describe('#getInnerWidth()', function(){ - it('should return width of the skeleton excluding margin', function(){ - skeleton.options({ - margin: {left: 10, right: 10} - }); - skeleton.width(100); - expect(skeleton.getInnerWidth()).to.equal(80); - }); - }); - - describe('#getInnerHeight()', function(){ - it('should return height of the skeleton excluding margin', function(){ - skeleton.options({ - margin: {top: 10, bottom: 20} - }); - skeleton.height(100); - expect(skeleton.getInnerHeight()).to.equal(70); - }); - }); - - describe('#getLayerOrganizer()', function(){ - it('should return the LayerOrganizer', function(){ - expect(skeleton.getLayerOrganizer()).to.be.an('Object'); - }); - }); - - describe('#getRootG()', function(){ - it('should return d3 selection of the root ', function(){ - var g = skeleton.getRootG(); - expect(g.size()).to.equal(1); - expect((g[0][0] as Element).tagName).to.equal('g'); - }); - }); - - describe('#getSvg()', function(){ - it('should return d3 selection of the ', function(){ - var svg = skeleton.getSvg(); - expect(svg.size()).to.equal(1); - expect((svg[0][0] as Element).tagName).to.equal('svg'); - }); - }); - - describe('#data(data, doNotDispatch)', function(){ - it('should return data when called without argument', function(){ - skeleton.data({a: 1}); - expect(skeleton.data()).to.deep.equal({a: 1}); - }); - it('should set data when called with at least one argument', function(){ - skeleton.data('test'); - expect(skeleton.data()).to.equal('test'); - }); - it('after setting, should dispatch "data" event', function(done){ - skeleton.on('data.test', function(){ - // This block should be reached to pass the test. - expect(true).to.be.true; - done(); - }); - skeleton.data({a: 1}); - }); - it('after setting, should not dispatch "data" event if doNotDispatch is true', function(done){ - skeleton.on('data.test', function(){ - // This block should not be reached. - expect(true).to.be.false; - done(); - }); - skeleton.data({a: 1}, true); - setTimeout(done, 100); - }); - }); - - describe('#options(options, doNotDispatch)', function(){ - it('should return options when called without argument', function(){ - skeleton.options({a: 2}); - expect(skeleton.options()).to.include.keys(['a']); - expect(skeleton.options().a).to.equal(2); - }); - it('should set options when called with at least one argument', function(){ - skeleton.options({a: 1}); - expect(skeleton.options()).to.include.keys(['a']); - expect(skeleton.options().a).to.equal(1); - }); - it('should not overwrite but extend existing options when setting', function(){ - skeleton.options({a: 1}); - skeleton.options({b: 2}); - expect(skeleton.options()).to.include.keys(['a', 'b']); - expect(skeleton.options().a).to.equal(1); - expect(skeleton.options().b).to.equal(2); - }); - it('after setting, should dispatch "options" event', function(done){ - skeleton.on('options.test', function(){ - // This block should be reached to pass the test. - expect(true).to.be.true; - done(); - }); - skeleton.options({a: 1}); - }); - it('after setting, should not dispatch "options" event if doNotDispatch is true', function(done){ - skeleton.on('options.test', function(){ - // This block should not be reached. - expect(true).to.be.false; - done(); - }); - skeleton.options({a: 1}, true); - setTimeout(done, 100); - }); - }); - - describe('#margin(margin, doNotDispatch)', function(){ - it('should return margin when called without argument', function(){ - var margin = {left: 10, right: 10, top: 10, bottom: 10}; - skeleton.margin(margin); - expect(skeleton.margin()).to.deep.equal(margin); - }); - it('should set margin when called with at least one argument', function(){ - var margin = {left: 10, right: 10, top: 10, bottom: 10}; - skeleton.margin(margin); - - skeleton.margin({left: 20}); - expect(skeleton.margin().left).to.equal(20); - expect(skeleton.margin().right).to.equal(10); - skeleton.margin({right: 20}); - expect(skeleton.margin().right).to.equal(20); - skeleton.margin({top: 20}); - expect(skeleton.margin().top).to.equal(20); - skeleton.margin({bottom: 20}); - expect(skeleton.margin().bottom).to.equal(20); - }); - it('should update innerWidth after setting margin', function(){ - skeleton.width(100); - skeleton.margin({left: 10, right:10}); - expect(skeleton.getInnerWidth()).to.equal(80); - skeleton.margin({left: 15, right:15}); - expect(skeleton.getInnerWidth()).to.equal(70); - }); - it('should update innerHeight after setting margin', function(){ - skeleton.height(100); - skeleton.margin({top: 10, bottom:10}); - expect(skeleton.getInnerHeight()).to.equal(80); - skeleton.margin({top: 15, bottom:15}); - expect(skeleton.getInnerHeight()).to.equal(70); - }); - it('should update the root transform/translate', function(){ - skeleton.margin({left: 30, top: 30}); - skeleton.offset([0.5, 0.5]); - skeleton.margin({left: 10, top: 10}); - var translate = skeleton.getRootG().attr('transform'); - expect(translate).to.equal('translate(10.5,10.5)'); - }); - it('after setting, should dispatch "resize" event', function(done){ - skeleton.on('resize.test', function(){ - // This block should be reached to pass the test. - expect(true).to.be.true; - done(); - }); - skeleton.margin({left: 33}); - }); - it('after setting, should not dispatch "resize" event if doNotDispatch is true', function(done){ - skeleton.on('resize.test', function(){ - // This block should not be reached. - expect(true).to.be.false; - done(); - }); - skeleton.margin({left: 33}, true); - setTimeout(done, 100); - }); - }); - - describe('#offset(offset)', function(){ - it('should return offset when called without argument', function(){ - var offset = [1,1]; - skeleton.offset(offset); - expect(skeleton.offset()).to.deep.equal(offset); - }); - it('should set offset when called with at least one argument', function(){ - var offset = [1,1]; - skeleton.offset(offset); - skeleton.offset([2,3]); - expect(skeleton.offset()).to.deep.equal([2,3]); - }); - it('should update the root transform/translate', function(){ - skeleton.offset([0.5, 0.5]); - skeleton.margin({left: 10, top: 10}); - skeleton.offset([2,3]); - var translate = skeleton.getRootG().attr('transform'); - expect(translate).to.equal('translate(12,13)'); - }); - }); - - describe('#width(width, doNotDispatch)', function(){ - it('should return width when called without argument', function(){ - var w = $svg.attr('width'); - expect(skeleton.width()).to.equal(+w); - }); - it('should set width when called with Number as the first argument', function(){ - skeleton.width(300); - expect(+$svg.attr('width')).to.equal(300); - }); - it('should set width when called with a Number and "px" such as "100px" as the first argument', function(){ - skeleton.width('299px'); - expect(+$svg.attr('width')).to.equal(299); - }); - it('should set width to container\'s width when called with "auto" as the first argument', function(){ - var w = element.clientWidth; - skeleton.width('auto'); - expect(+$svg.attr('width')).to.equal(w); - }); - it('after setting, should dispatch "resize" event', function(done){ - skeleton.on('resize.test', function(){ - // This block should be reached to pass the test. - expect(true).to.be.true; - done(); - }); - skeleton.width(200); - }); - it('after setting, should not dispatch "resize" event if doNotDispatch is true', function(done){ - skeleton.on('resize.test', function(){ - // This block should not be reached. - expect(true).to.be.false; - done(); - }); - skeleton.width(200, true); - setTimeout(done, 100); - }); - }); - - describe('#height(height, doNotDispatch)', function(){ - it('should return height when called without argument', function(){ - var w = $svg.attr('height'); - expect(skeleton.height()).to.equal(+w); - }); - it('should set height when called with Number as the first argument', function(){ - skeleton.height(300); - expect(+$svg.attr('height')).to.equal(300); - }); - it('should set height when called with a Number and "px" such as "100px" as the first argument', function(){ - skeleton.height('299px'); - expect(+$svg.attr('height')).to.equal(299); - }); - it('should set height to container\'s height when called with "auto" as the first argument', function(){ - var w = element.clientHeight; - skeleton.height('auto'); - expect(+$svg.attr('height')).to.equal(w); - }); - it('after setting, should dispatch "resize" event', function(done){ - skeleton.on('resize.test', function(){ - // This block should be reached to pass the test. - expect(true).to.be.true; - done(); - }); - skeleton.height(200); - }); - it('after setting, should not dispatch "resize" event if doNotDispatch is true', function(done){ - skeleton.on('resize.test', function(){ - // This block should not be reached. - expect(true).to.be.false; - done(); - }); - skeleton.height(200, true); - setTimeout(done, 100); - }); - }); - - describe('#dimension(dimension, doNotDispatch)', function(){ - it('should return an array [width, height] when called without argument', function(){ - var dim = [+$svg.attr('width'), +$svg.attr('height')]; - expect(skeleton.dimension()).to.deep.equal(dim); - }); - it('should set width and height of the when called with an array [width, height] as the first argument', function(){ - skeleton.dimension([118, 118]); - expect([+$svg.attr('width'), +$svg.attr('height')]).to.deep.equal([118, 118]); - }); - it('after setting, should dispatch "resize" event', function(done){ - skeleton.on('resize.test', function(){ - // This block should be reached to pass the test. - expect(true).to.be.true; - done(); - }); - skeleton.dimension([150, 150]); - }); - it('after setting, should not dispatch "resize" event if doNotDispatch is true', function(done){ - skeleton.on('resize.test', function(){ - // This block should not be reached. - expect(true).to.be.false; - done(); - }); - skeleton.dimension([150, 150], true); - setTimeout(done, 100); - }); - }); - - describe('#hasData()', function(){ - it('should return true when data are not null nor undefined', function(){ - skeleton.data({}); - expect(skeleton.hasData()).to.be.true; - skeleton.data({test: 1}); - expect(skeleton.hasData()).to.be.true; - skeleton.data([]); - expect(skeleton.hasData()).to.be.true; - skeleton.data(['test']); - expect(skeleton.hasData()).to.be.true; - }); - it('should return false when data are null or undefined', function(){ - skeleton.data(null); - expect(skeleton.hasData()).to.be.false; - skeleton.data(undefined); - expect(skeleton.hasData()).to.be.false; - }); - }); - - describe('#hasNonZeroArea()', function(){ - it('should return true if \'s width & height excluding margin is more than zero', function(){ - skeleton.options({ - margin: {left: 10, right: 10} - }); - skeleton.width(80); - skeleton.options({ - margin: {top: 10, bottom: 20} - }); - skeleton.height(50); - expect(skeleton.hasNonZeroArea()).to.be.true; - }); - it('should return false otherwise', function(){ - skeleton.options({ - margin: {left: 10, right: 10} - }); - skeleton.width(20); - skeleton.options({ - margin: {top: 10, bottom: 20} - }); - skeleton.height(30); - expect(skeleton.hasNonZeroArea()).to.be.false; - }); - }); - - describe('#mixin({})', function(){ - it('should extend this skeleton with new fields/functions', function(){ - skeleton.mixin({ - a: 1, - b: 2 - }); - expect(skeleton).to.include.keys(['a', 'b']); - expect((skeleton).a).to.equal(1); - expect((skeleton).b).to.equal(2); - }); - it('should overwrite existing fields', function(){ - skeleton.mixin({ - b: 2 - }); - skeleton.mixin({ - b: 3 - }); - expect(skeleton).to.include.keys(['b']); - expect((skeleton).b).to.equal(3); - }); - it('should keep original fields if not overwritten', function(){ - skeleton.mixin({ - a: 1, - b: 2 - }); - skeleton.mixin({ - c: 20, - b: 3 - }); - expect(skeleton).to.include.keys(['a', 'b', 'c']); - expect((skeleton).a).to.equal(1); - expect((skeleton).b).to.equal(3); - expect((skeleton).c).to.equal(20); - }); - }); - - describe('#resizeToFitContainer(mode)', function(){ - it('when mode is "all" should resize to fit both width and height', function(){ - skeleton.dimension([element.clientWidth/2, element.clientHeight/2]); - var w = element.clientWidth; - var h = element.clientHeight; - skeleton.resizeToFitContainer('all'); - expect(skeleton.dimension()).to.deep.equal([w, h]); - }); - it('when mode is "both" should resize to fit both width and height', function(){ - skeleton.dimension([element.clientWidth/2, element.clientHeight/2]); - var w = element.clientWidth; - var h = element.clientHeight; - skeleton.resizeToFitContainer('both'); - expect(skeleton.dimension()).to.deep.equal([w, h]); - }); - it('when mode is "full" should resize to fit both width and height', function(){ - skeleton.dimension([element.clientWidth/2, element.clientHeight/2]); - var w = element.clientWidth; - var h = element.clientHeight; - skeleton.resizeToFitContainer('full'); - expect(skeleton.dimension()).to.deep.equal([w, h]); - }); - it('when mode is "width" should resize width to fit container but keep original height', function(){ - var w1 = element.clientWidth/2; - var h1 = element.clientHeight/2; - - skeleton.dimension([w1, h1]); - - var w2 = element.clientWidth; - var h2 = element.clientHeight; - - skeleton.resizeToFitContainer('width'); - - expect(skeleton.width()).to.equal(Math.floor(w2)); - expect(skeleton.height()).to.equal(Math.floor(h1)); - expect(skeleton.width()).to.not.equal(w1); - expect(skeleton.height()).to.not.equal(h2); - }); - it('when mode is "height" should resize height to fit container but keep original width', function(){ - var w1 = element.clientWidth/2; - var h1 = element.clientHeight*2; - - skeleton.dimension([w1, h1]); - - var w2 = element.clientWidth; - var h2 = element.clientHeight; - - skeleton.resizeToFitContainer('height'); - - expect(skeleton.width()).to.equal(Math.floor(w1)); - expect(skeleton.height()).to.equal(Math.floor(h2)); - expect(skeleton.width()).to.not.equal(w2); - expect(skeleton.height()).to.not.equal(h1); - }); - }); - - describe('#resizeToAspectRatio(ratio)', function(){ - // todo - }); - - describe('#autoResize(mode)', function(){ - it('should return current mode when called without argument', function(){ - skeleton.autoResize(false); - expect(skeleton.autoResize()).to.be.false; - skeleton.autoResize('width'); - expect(skeleton.autoResize()).to.equal('width'); - }); - it('should enable auto resize when set mode to "width/height/both/etc.", similar to parameters of resizeToFitContainer()', function(done){ - // set initial size - skeleton.width(50); - skeleton.autoResize('width'); - setTimeout(function(){ - expect(skeleton.width()).to.equal(element.clientWidth); - done(); - }, 500); - }); - it('should disable auto resize when set mode to false', function(done){ - // set initial size - skeleton.width(50); - skeleton.autoResize('width'); - setTimeout(function(){ - expect(skeleton.width()).to.equal(element.clientWidth); - // disable resize and - skeleton.autoResize(false); - skeleton.width(50); - setTimeout(function(){ - expect(skeleton.width()).to.not.equal(element.clientWidth); - done(); - }, 500); - }, 500); - }); - }); - - describe('#autoResizeDetection(detection)', function(){ - // todo - }); - - describe('#autoResizeToAspectRatio(ratio)', function(){ - // todo - }); - - -}); - -describe.only('LayerOrganizer', function(){ - - describe('new LayerOrganizer(container) will create layers as by default', function(){ - var container: d3.Selection, layers: d3kit.LayerOrganizer; - before(function(done){ - container = d3.select('body').append('svg').append('g'); - layers = new d3kit.LayerOrganizer(container); - done(); - }); - - describe('#create(names)', function(){ - it('should create single layer given a String', function(){ - layers.create('single'); - expect(container.select('g.single-layer').size()).to.be.equal(1); - }); - - it('should create multiple layers given an array', function(){ - layers.create(['a', 'b', 'c']); - expect(container.select('g.a-layer').size()).to.be.equal(1); - expect(container.select('g.b-layer').size()).to.be.equal(1); - expect(container.select('g.c-layer').size()).to.be.equal(1); - }); - - it('should create nested layers given a plain Object with a String inside', function(){ - layers.create({d: 'e'}); - expect(container.select('g.d-layer').size()).to.be.equal(1); - expect(container.select('g.d-layer g.e-layer').size()).to.be.equal(1); - }); - - it('should create nested layers given a plain Object with an Array inside', function(){ - layers.create({f: ['g', 'h']}); - expect(container.select('g.f-layer').size()).to.be.equal(1); - expect(container.select('g.f-layer g.g-layer').size()).to.be.equal(1); - expect(container.select('g.f-layer g.h-layer').size()).to.be.equal(1); - }); - - it('should create multiple nested layers given an array of objects', function(){ - layers.create([{'i': ['x']}, {'j': 'x'}, {'k': ['x','y']}]); - expect(container.select('g.i-layer').size()).to.be.equal(1); - expect(container.select('g.j-layer').size()).to.be.equal(1); - expect(container.select('g.k-layer').size()).to.be.equal(1); - expect(container.select('g.i-layer g.x-layer').size()).to.be.equal(1); - expect(container.select('g.i-layer g.x-layer').size()).to.be.equal(1); - expect(container.select('g.k-layer g.x-layer').size()).to.be.equal(1); - expect(container.select('g.k-layer g.y-layer').size()).to.be.equal(1); - }); - - it('should create multi-level nested layers given a nested plain Object', function(){ - layers.create({ - l: [ - 'm', - {'n': [ - {'o': ['p']}, 'q' - ]} - ] - }); - expect(container.select('g.l-layer').size()).to.be.equal(1); - expect(container.select('g.l-layer g.m-layer').size()).to.be.equal(1); - expect(container.select('g.l-layer g.n-layer').size()).to.be.equal(1); - expect(container.select('g.l-layer g.n-layer g.o-layer').size()).to.be.equal(1); - expect(container.select('g.l-layer g.n-layer g.o-layer g.p-layer').size()).to.be.equal(1); - expect(container.select('g.l-layer g.n-layer g.q-layer').size()).to.be.equal(1); - }); - - }); - - describe('#has(name)', function(){ - it('should be able to check first-level layer', function(){ - expect(layers.has('single')).to.be.true; - expect(layers.has('test')).to.be.false; - }); - it('should be able to check second-level layer', function(){ - expect(layers.has('l.m')).to.be.true; - expect(layers.has('l.x')).to.be.false; - }); - it('should be able to check third-level layer', function(){ - expect(layers.has('l.n.q')).to.be.true; - expect(layers.has('l.n.x')).to.be.false; - }); - }); - - describe('#get(name)', function(){ - it('should be able to get first-level layer', function(){ - expect(layers.get('single')).to.exist; - expect(layers.get('test')).to.be.not.exist; - }); - it('should be able to get second-level layer', function(){ - expect(layers.get('l.m')).to.exist; - expect(layers.get('l.x')).to.not.exist; - }); - it('should be able to get third-level layer', function(){ - expect(layers.get('l.n.o')).to.exist; - expect(layers.get('l.n.x')).to.not.exist; - }); - }); - }); - - describe('new LayerOrganizer(container, tag) will create layers with the given tag instead of ', function(){ - var container: d3.Selection, layers: d3kit.LayerOrganizer; - before(function(done){ - container = d3.select('body').append('div'); - layers = new d3kit.LayerOrganizer(container, 'div'); - done(); - }); - - describe('#create(names)', function(){ - it('should create single layer given a String', function(){ - layers.create('single'); - expect(container.select('div.single-layer').size()).to.be.equal(1); - }); - - it('should create multiple layers given an array', function(){ - layers.create(['a', 'b', 'c']); - expect(container.select('div.a-layer').size()).to.be.equal(1); - expect(container.select('div.b-layer').size()).to.be.equal(1); - expect(container.select('div.c-layer').size()).to.be.equal(1); - }); - - it('should create nested layers given a plain Object with a String inside', function(){ - layers.create({d: 'e'}); - expect(container.select('div.d-layer').size()).to.be.equal(1); - expect(container.select('div.d-layer div.e-layer').size()).to.be.equal(1); - }); - - it('should create nested layers given a plain Object with an Array inside', function(){ - layers.create({f: ['g', 'h']}); - expect(container.select('div.f-layer').size()).to.be.equal(1); - expect(container.select('div.f-layer div.g-layer').size()).to.be.equal(1); - expect(container.select('div.f-layer div.h-layer').size()).to.be.equal(1); - }); - - it('should create multiple nested layers given an array of objects', function(){ - layers.create([{'i': ['x']}, {'j': 'x'}, {'k': ['x','y']}]); - expect(container.select('div.i-layer').size()).to.be.equal(1); - expect(container.select('div.j-layer').size()).to.be.equal(1); - expect(container.select('div.k-layer').size()).to.be.equal(1); - expect(container.select('div.i-layer div.x-layer').size()).to.be.equal(1); - expect(container.select('div.i-layer div.x-layer').size()).to.be.equal(1); - expect(container.select('div.k-layer div.x-layer').size()).to.be.equal(1); - expect(container.select('div.k-layer div.y-layer').size()).to.be.equal(1); - }); - - it('should create multi-level nested layers given a nested plain Object', function(){ - layers.create({ - l: [ - 'm', - {'n': [ - {'o': ['p']}, 'q' - ]} - ] - }); - expect(container.select('div.l-layer').size()).to.be.equal(1); - expect(container.select('div.l-layer div.m-layer').size()).to.be.equal(1); - expect(container.select('div.l-layer div.n-layer').size()).to.be.equal(1); - expect(container.select('div.l-layer div.n-layer div.o-layer').size()).to.be.equal(1); - expect(container.select('div.l-layer div.n-layer div.o-layer div.p-layer').size()).to.be.equal(1); - expect(container.select('div.l-layer div.n-layer div.q-layer').size()).to.be.equal(1); - }); - - }); - - describe('#has(name)', function(){ - it('should be able to check first-level layer', function(){ - expect(layers.has('single')).to.be.true; - expect(layers.has('test')).to.be.false; - }); - it('should be able to check second-level layer', function(){ - expect(layers.has('l.m')).to.be.true; - expect(layers.has('l.x')).to.be.false; - }); - it('should be able to check third-level layer', function(){ - expect(layers.has('l.n.q')).to.be.true; - expect(layers.has('l.n.x')).to.be.false; - }); - }); - - describe('#get(name)', function(){ - it('should be able to get first-level layer', function(){ - expect(layers.get('single')).to.exist; - expect(layers.get('test')).to.be.not.exist; - }); - it('should be able to get second-level layer', function(){ - expect(layers.get('l.m')).to.exist; - expect(layers.get('l.x')).to.not.exist; - }); - it('should be able to get third-level layer', function(){ - expect(layers.get('l.n.o')).to.exist; - expect(layers.get('l.n.x')).to.not.exist; - }); - }); - }); - -}); - -describe('Chartlet', function(){ - interface ConfigureFunction { - (parent: d3kit.Chartlet, child: d3kit.Chartlet): void; - } - var enter: d3kit.ChartletEventFunction, update: d3kit.ChartletEventFunction, exit: d3kit.ChartletEventFunction, chartlet: d3kit.Chartlet; - var customEvents: Array = ['fooEvent']; - var ChildChartlet: () => d3kit.Chartlet; - var ParentChartlet: (configureFunction: ConfigureFunction) => d3kit.Chartlet; - - var callback = function(selection?: d3.Selection, done?: any) { return (sel: d3.Selection) => {done();};}; - beforeEach(function(done){ - ChildChartlet = function() { - var chartlet = new d3kit.Chartlet(callback, callback, callback); - (chartlet).runTest = function (testFunction: any) { - testFunction(chartlet); - }; - return chartlet; - }; - - ParentChartlet = function(configureFunction: ConfigureFunction) { - var chartlet = new d3kit.Chartlet(callback, callback, callback); - var child = ChildChartlet(); - configureFunction(chartlet, child); - (chartlet).runTest = (child).runTest; - return chartlet; - }; - - enter = callback; - update = callback; - exit = callback; - chartlet = new d3kit.Chartlet(enter, update, exit, customEvents); - done(); - }); - - describe('new Chartlet(enter, update, exit, customEvents)', function(){ - it('should create a chartlet', function(){ - expect(chartlet).to.be.an('Object'); - expect(chartlet).to.include.keys(['property', 'on']); - expect(chartlet.enter).to.be.a('Function'); - expect(chartlet.update).to.be.a('Function'); - expect(chartlet.exit).to.be.a('Function'); - expect(function(){ chartlet.enter(); }).to.not.throw(Error); - expect(function(){ chartlet.update(); }).to.not.throw(Error); - expect(function(){ chartlet.exit(); }).to.not.throw(Error); - expect(chartlet.getCustomEventNames()).to.deep.equal(customEvents); - }); - it('arguments "update", "exit" and "customEvents" are optional', function(){ - var comp = new d3kit.Chartlet(enter); - expect(comp).to.be.an('Object'); - expect(comp).to.include.keys(['property', 'on']); - expect(comp.enter).to.be.a('Function'); - expect(comp.update).to.be.a('Function'); - expect(comp.exit).to.be.a('Function'); - expect(function(){ comp.enter(); }).to.not.throw(Error); - expect(function(){ comp.update(); }).to.not.throw(Error); - expect(function(){ comp.exit(); }).to.not.throw(Error); - }); - }); - - describe('#getDispatcher()', function(){ - it('should return a dispatcher', function(){ - var dispatcher = chartlet.getDispatcher(); - expect(dispatcher).to.exist; - }); - it('returned dispatcher should handle enter/update/exit events', function(){ - var dispatcher = chartlet.getDispatcher(); - expect(dispatcher).to.include.keys(['enterDone', 'updateDone', 'exitDone'].concat(customEvents)); - }); - }); - - describe('#getPropertyValue(name, d, i)', function(){ - it('should return computed value for specified property name, d and i', function(){ - var d = {a: 99}; - var i = 2; - - chartlet.property('foo', 1); - chartlet.property('bar', 'two'); - chartlet.property('baz', function(d:{a:number}, i: number) {return 3;}); - chartlet.property('qux', function(d:{a:number}, i: number) {return 'four';}); - chartlet.property('nux', function(d:{a:number}, i: number) {return d.a * i;}); - - expect(chartlet.getPropertyValue('foo', d, i)).to.equal(1); - expect(chartlet.getPropertyValue('bar', d, i)).to.equal('two'); - expect(chartlet.getPropertyValue('baz', d, i)).to.equal(3); - expect(chartlet.getPropertyValue('qux', d, i)).to.equal('four'); - expect(chartlet.getPropertyValue('nux', d, i)).to.equal(198); - }); - }); - - describe('#property(name, valueOrFn)', function(){ - describe('should act as a getter when called with one argument', function(){ - it('should always return a function', function(){ - chartlet.property('foo', 1); - expect(chartlet.property('foo')).to.be.a('Function'); - chartlet.property('bar', function(){ return 100; }); - expect(chartlet.property('bar')).to.be.a('Function'); - }); - it('should return a function that return undefined for unknown property name', function(){ - expect(chartlet.property('unknown name')).to.be.a('Function'); - expect(chartlet.property('unknown name')()).to.equal(undefined); - }); - }); - - describe('should act as a setter when called with two arguments', function(){ - it('should set specified property to a functor of given value', function(){ - chartlet.property('foo', 1); - expect(chartlet.property('foo')).to.be.a('Function'); - expect(chartlet.property('foo')()).to.equal(1); - chartlet.property('bar', function(){ return 100; }); - expect(chartlet.property('bar')).to.be.a('Function'); - expect(chartlet.property('bar')()).to.equal(100); - }); - it('should overwrite previous value when set property with the same name', function(){ - chartlet.property('foo', 1); - expect(chartlet.property('foo')()).to.equal(1); - chartlet.property('foo', 100); - expect(chartlet.property('foo')()).to.equal(100); - }); - }); - }); - - describe('#on(eventName, listener)', function(){ - it('event "enterDone" should be triggered after chartlet.enter() is completed.', function(done){ - chartlet.on('enterDone', function(){ return (sel: d3.Selection) => {done();} }); - chartlet.enter(); - }); - it('event "updateDone" should be triggered after chartlet.update() is completed.', function(done){ - chartlet.on('updateDone', function(){ return (sel: d3.Selection) => {done();} }); - chartlet.update(); - }); - it('event "exitDone" should be triggered after chartlet.exit() is completed.', function(done){ - chartlet.on('exitDone', function(){ return (sel: d3.Selection) => {done();} }); - chartlet.exit(); - }); - }); - - describe('#inheritPropertyFrom(parentChartlet, parentPropertyName, childPropertyName)', function(){ - it('it should cause a child to inherit a parent property', function() { - var parent = ParentChartlet(function(parent: d3kit.Chartlet, child: d3kit.Chartlet) { - child.inheritPropertyFrom(parent, 'foo', 'bar'); - }) - .property('foo', function(d:number) {return 2 * d;}); - - (parent).runTest(function(child: d3kit.Chartlet) { - expect(child.getPropertyValue('bar', 4, 0)).to.be.equal(8); - }); - }); - - it('it should default to the parent property name', function() { - var parent = ParentChartlet( - function(parent: d3kit.Chartlet, child: d3kit.Chartlet) { - child.inheritPropertyFrom(parent, 'foo'); - }) - .property('foo', function(d:number) {return 2 * d;}); - - (parent).runTest(function(child: d3kit.Chartlet) { - expect(child.getPropertyValue('foo', 4, 0)).to.be.equal(8); - }); - }); - }); - - describe('#inheritProperties(parentChartlet, parentPropertyNames, childPropertyNames)', function(){ - it('it should cause a child to inherit many parent properties', function() { - var parent = ParentChartlet( - function(parent: d3kit.Chartlet, child: d3kit.Chartlet) { - child.inheritPropertiesFrom(parent, ['foo', 'bar', 'baz'], ['foo-x', 'bar-x', 'baz-x']); - }) - .property('foo', function(d:number) {return 2 * d;}) - .property('bar', function(d:number) {return 3 * d;}) - .property('baz', function(d:number) {return 4 * d;}); - - (parent).runTest(function(child: d3kit.Chartlet) { - expect(child.getPropertyValue('foo-x', 1, 0)).to.be.equal(2); - expect(child.getPropertyValue('bar-x', 1, 0)).to.be.equal(3); - expect(child.getPropertyValue('baz-x', 1, 0)).to.be.equal(4); - }); - }); - - it('it should default to the parent property names', function() { - var parent = ParentChartlet( - function(parent: d3kit.Chartlet, child: d3kit.Chartlet) { - child.inheritPropertiesFrom(parent, ['foo', 'bar', 'baz']); - }) - .property('foo', function(d:number) {return 2 * d;}) - .property('bar', function(d:number) {return 3 * d;}) - .property('baz', function(d:number) {return 4 * d;}); - - (parent).runTest(function(child: d3kit.Chartlet) { - expect(child.getPropertyValue('foo', 1, 0)).to.be.equal(2); - expect(child.getPropertyValue('bar', 1, 0)).to.be.equal(3); - expect(child.getPropertyValue('baz', 1, 0)).to.be.equal(4); - }); - }); - }); - - describe('#publishEventsTo(foreignDispatcher)', function(){ - it('should map events to a foreignDispatcher', function(done) { - - var parent = new d3kit.Chartlet(callback, callback, callback, ['foo']); - parent.getDispatcher().on('foo', function(value:number) { - expect(value).to.be.equal(99); - done(); - }); - - var child = new d3kit.Chartlet(callback, callback, callback, ['foo']) - .publishEventsTo(parent.getDispatcher()); - - (child.getDispatcher()).foo(99); - }); - }); -}); - -describe('#createChart', function(){ - var Chart = d3kit.factory.createChart({}, ['test'], function(skeleton: d3kit.Skeleton){ - return skeleton; - }); - - it('should return a function to create a chart', function(){ - expect(Chart).to.be.a('Function'); - }); - - // // Don't think it's possible to define these in a d.ts file; skipping - // it('results should have function getCustomEvents()', function(){ - // expect(Chart.getCustomEvents).to.exist; - // expect(Chart.getCustomEvents()).to.deep.equal(['test']); - // }); -}); - -describe('d3kit.helper', function(){ - - describe('#dasherize(str)', function(){ - it('should convert input to dash-case', function(){ - expect(d3kit.helper.dasherize('camelCase')).to.equal('camel-case'); - }); - }); - - describe('#deepExtend(target, src1, src2, ...)', function(){ - it('should copy fields from sources into target', function(){ - expect(d3kit.helper.deepExtend({}, { - a: 1, - b: 2 - },{ - b: 3, - c: 4 - })).to.deep.equal({ - a: 1, - b: 3, - c: 4 - }); - - expect(d3kit.helper.deepExtend({}, { - a: 1, - b: 2 - },{ - b: 3, - c: 4 - }, null)).to.deep.equal({ - a: 1, - b: 3, - c: 4 - }); - }); - - it('should copy arrays and functions correctly from sources into target', function(){ - var fn1 = function(d:number){return d + 1;}; - var fn2 = function(d:number){return d + 2;}; - expect(d3kit.helper.deepExtend({}, { - a: fn1, - b: [1,2] - },{ - b: [3,4], - c: fn2 - })).to.deep.equal({ - a: fn1, - b: [3,4], - c: fn2 - }); - }); - - it('should perform "deep" copy', function(){ - var fn1 = function(d:number){return d + 1;}; - var fn2 = function(d:number){return d + 2;}; - expect(d3kit.helper.deepExtend({}, { - a: { d: fn1 }, - b: [1,2], - c: { f: 3 }, - h: { i: [1,2,3], j: [3,4,5] } - },{ - a: { e: 2 }, - b: [3,4], - c: { f: 4, g: fn2 }, - h: { i: [2,3,4], k: [3,4,5], l: {m: 2} } - })).to.deep.equal({ - a: { d: fn1, e: 2 }, - b: [3,4], - c: { f: 4, g: fn2 }, - h: { i: [2,3,4], j: [3,4,5], k: [3,4,5], l: {m: 2} } - }); - }); - }); - - describe('#extend(target, src1, src2, ...)', function(){ - it('should copy fields from sources into target', function(){ - expect(d3kit.helper.extend({}, { - a: 1, - b: 2 - },{ - b: 3, - c: 4 - })).to.deep.equal({ - a: 1, - b: 3, - c: 4 - }); - - expect(d3kit.helper.extend({}, { - a: 1, - b: 2 - },{ - b: 3, - c: 4 - }, null)).to.deep.equal({ - a: 1, - b: 3, - c: 4 - }); - }); - - it('should copy arrays and functions correctly from sources into target', function(){ - var fn1 = function(d:number){return d + 1;}; - var fn2 = function(d:number){return d + 2;}; - expect(d3kit.helper.extend({}, { - a: fn1, - b: [1,2] - },{ - b: [3,4], - c: fn2 - })).to.deep.equal({ - a: fn1, - b: [3,4], - c: fn2 - }); - }); - - it('should NOT perform "deep" copy', function(){ - var fn1 = function(d:number){return d + 1;}; - var fn2 = function(d:number){return d + 2;}; - expect(d3kit.helper.extend({}, { - a: { d: fn1 }, - b: [1,2], - c: { f: 3 }, - h: { i: [1,2,3], j: [3,4,5] } - },{ - a: { e: 2 }, - b: [3,4], - c: { f: 4, g: fn2 }, - h: { i: [2,3,4], k: [3,4,5], l: {m: 2} } - })).to.deep.equal({ - a: { e: 2 }, - b: [3,4], - c: { f: 4, g: fn2 }, - h: { i: [2,3,4], k: [3,4,5], l: {m: 2} } - }); - }); - }); - - describe('#isFunction(function)', function(){ - it('should return true if the value is a function', function(){ - var fn1 = function(d:number){return d + 1;}; - function fn2(d:number){return d + 2;} - - expect(d3kit.helper.isFunction(fn1)).to.be.true; - expect(d3kit.helper.isFunction(fn2)).to.be.true; - }); - it('should return false if the value is not a function', function(){ - expect(d3kit.helper.isFunction(0)).to.be.false; - expect(d3kit.helper.isFunction(1)).to.be.false; - expect(d3kit.helper.isFunction(true)).to.be.false; - expect(d3kit.helper.isFunction('what')).to.be.false; - expect(d3kit.helper.isFunction(null)).to.be.false; - expect(d3kit.helper.isFunction(undefined)).to.be.false; - }); - }); - - describe('#isNumber(value)', function(){ - it('should return true for number', function(){ - expect(d3kit.helper.isNumber(1)).to.be.true; - expect(d3kit.helper.isNumber(0)).to.be.true; - expect(d3kit.helper.isNumber(-1)).to.be.true; - }); - it('should return false for string even if it is a number', function(){ - expect(d3kit.helper.isNumber('')).to.be.false; - expect(d3kit.helper.isNumber('1')).to.be.false; - expect(d3kit.helper.isNumber('0')).to.be.false; - expect(d3kit.helper.isNumber('what')).to.be.false; - }); - it('should return false for null and undefined', function(){ - expect(d3kit.helper.isNumber(null)).to.be.false; - expect(d3kit.helper.isNumber(undefined)).to.be.false; - }); - }); -}); - diff --git a/dagre-d3/dagre-d3-tests.ts b/dagre-d3/dagre-d3-tests.ts deleted file mode 100644 index 2b1a958ef7..0000000000 --- a/dagre-d3/dagre-d3-tests.ts +++ /dev/null @@ -1,22 +0,0 @@ - -namespace DagreD3Tests { - const gDagre = new dagreD3.graphlib.Graph(); - const graph = gDagre.graph(); - - // has graph methods from dagre.d.ts - graph.setNode("a", {}); - const num: number = 251 + graph.height + graph.width; - const predecessors: { [vertex: string]: string[] } = {}; - const successors: { [vertex: string]: string[] } = {}; - - predecessors["a"] = graph.predecessors("a"); - successors["a"] = graph.successors("a"); - graph.transition = (selection: d3.Selection) => { - return d3.transition(); - }; - - const render = new dagreD3.render(); - const svg = d3.select("svg"); - render.arrows()["arrowType"] = (parent: d3.Selection, id: string, edge: dagre.Edge, type: string) => {}; - render(svg, graph); -} diff --git a/dagre-d3/index.d.ts b/dagre-d3/index.d.ts deleted file mode 100644 index 480ca6b402..0000000000 --- a/dagre-d3/index.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -// Type definitions for dagre-d3.core.js 0.4 -// Project: https://github.com/cpettitt/dagre-d3 -// Definitions by: Mark Wong Siang Kai -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -import * as d3 from "d3"; -import * as dagre from "dagre"; - -export as namespace dagreD3; - -export * from "dagre"; -export const render: { new(): Render }; - -declare module "dagre" { - namespace graphlib { - // coupled with dagre.d.ts' Graph - // a lot of these methods come from graphlib.core.js - interface Graph { - graph(): Graph; - height: number; - predecessors(id: string): string[]; - successors(id: string): string[]; - // see source of http://cpettitt.github.io/project/dagre-d3/latest/demo/interactive-demo.html - transition?(selection: d3.Selection): d3.Transition; - width: number; - } - } -} - -interface Render { - // see http://cpettitt.github.io/project/dagre-d3/latest/demo/user-defined.html for example usage - arrows(): { [arrowStyleName: string]: (parent: d3.Selection, id: string, edge: dagre.Edge, type: string) => void }; - (selection: d3.Selection, g: dagre.graphlib.Graph): void; -} diff --git a/dagre-d3/tslint.json b/dagre-d3/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/dagre-d3/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/dagre/dagre-tests.ts b/dagre/dagre-tests.ts deleted file mode 100644 index 2855055451..0000000000 --- a/dagre/dagre-tests.ts +++ /dev/null @@ -1,10 +0,0 @@ -namespace DagreTests { - const gDagre = new dagre.graphlib.Graph(); - gDagre.setGraph({}) - .setDefaultEdgeLabel(() => {}) - .setNode("a", {}) - .setEdge("b", "c") - .setEdge("c", "d", {class: "class"}); - - dagre.layout(gDagre); -} diff --git a/dagre/index.d.ts b/dagre/index.d.ts deleted file mode 100644 index 96484e296f..0000000000 --- a/dagre/index.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -// Type definitions for dagre 0.7 -// Project: https://github.com/cpettitt/dagre -// Definitions by: Qinfeng Chen -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export as namespace dagre; - -export namespace graphlib { - class Graph { - edges(): Edge[]; - edge(id: any): any; - nodes(): string[]; - node(id: any): any; - setDefaultEdgeLabel(callback: () => void): Graph; - setEdge(sourceId: string, targetId: string, options?: { [key: string]: any }): Graph; - setGraph(options: { [key: string]: any }): Graph; - setNode(id: string, node: { [key: string]: any }): Graph; - } -} - -export function layout(graph: graphlib.Graph): void; - -interface Edge { - v: string; - w: string; -} diff --git a/dagre/tslint.json b/dagre/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/dagre/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/datatables.net-buttons/index.d.ts b/datatables.net-buttons/index.d.ts deleted file mode 100644 index b4ed4b0eb5..0000000000 --- a/datatables.net-buttons/index.d.ts +++ /dev/null @@ -1,118 +0,0 @@ -// Type definitions for JQuery DataTables Buttons extension 1.1.0 -// Project: http://datatables.net/extensions/buttons/ -// Definitions by: Sam Germano -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// -/// - -declare namespace DataTables { - export interface Settings { - /** - * Buttons extension options - */ - buttons?: boolean | string[] | ButtonSettings[]; - } - - //#region "button-settings" - - /** - * Buttons extension options - */ - export interface ButtonSettings { - /** - * Action to take when the button is activated - */ - action?: FunctionButtonAction; - - /** - * Ensure that any requirements have been satisfied before initialising a button - */ - available?: FunctionButtonAvailable; - - /** - * Set the class name for the button - */ - className?: string; - - /** - * Function that is called when the button is destroyed - */ - destroy?: FunctionButtonInit; - - /** - * Set a button's initial enabled state - */ - enabled?: boolean; - - /** - * Define which button type the button should be based on - */ - extend?: string; - - /** - * Initialisation function that can be used to add events specific to this button - */ - init?: FunctionButtonInit; - - /** - * Define an activation key for a button - */ - key?: string | ButtonKey; - - /** - * Set a name for each selection - */ - name?: string; - - /** - * Unique namespace for every button - */ - namespace?: string; - - /** - * The text to show in the button - */ - text?: string | ButtonText; - - /** - * Button 'title' attribute text - */ - titleAttr?: string; - - exportOptions?: ButtonExportOptions; - autoPrint?: boolean; - customize?: FunctionButtonCustomize; - } - - export interface FunctionButtonAvailable { - (dt: DataTables.DataTable, config: any): boolean - } - export interface ButtonExportOptions { - columns?: string; - } - - export interface ButtonKey { - key?: string; - shiftKey?: boolean; - altKey?: boolean; - ctrlKey?: boolean; - metaKey?: boolean; - } - - export interface ButtonText { - (dt: DataTables.DataTable, node: JQuery, config: any): string - } - export interface FunctionButtonInit { - (dt: DataTables.DataTable, node: JQuery, config: any): void - } - // api object? - export interface FunctionButtonAction { - (e: any, dt: DataTables.DataTable, node: JQuery, config: any): void - } - - export interface FunctionButtonCustomize { - (win: Window): void - } - //#endregion "button-settings -} diff --git a/datatables.net-fixedheader/datatables.net-fixedheader-tests.ts b/datatables.net-fixedheader/datatables.net-fixedheader-tests.ts deleted file mode 100644 index 949bca825c..0000000000 --- a/datatables.net-fixedheader/datatables.net-fixedheader-tests.ts +++ /dev/null @@ -1,14 +0,0 @@ -/// -/// - -$(document).ready(() => { - var config: DataTables.Settings = { - // FixedHeader extension options - fixedHeader: { - footer: true, - footerOffset: 4, - header: true, - headerOffset: 3 - } - }; -}); diff --git a/datatables.net-fixedheader/index.d.ts b/datatables.net-fixedheader/index.d.ts deleted file mode 100644 index caf3987d35..0000000000 --- a/datatables.net-fixedheader/index.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -// Type definitions for datatables.net-fixedheader 3.1 -// Project: https://datatables.net/extensions/fixedheader/ -// Definitions by: Jared Szechy -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// -/// - -declare namespace DataTables { - export interface Settings { - /* - * FixedHeader extension options - */ - fixedHeader?: boolean | FixedHeaderSettings; - } - - /* - * FixedHeader extension options - */ - interface FixedHeaderSettings { - /* - * Enable / disable fixed footer - */ - footer?: boolean; - - /* - * Offset the table's fixed footer - */ - footerOffset?: number; - - /* - * Enable / disable fixed header - */ - header?: boolean; - - /* - * Offset the table's fixed header - */ - headerOffset?: number; - } -} diff --git a/datatables.net-fixedheader/tslint.json b/datatables.net-fixedheader/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/datatables.net-fixedheader/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/datatables.net-select/datatables.net-select-tests.ts b/datatables.net-select/datatables.net-select-tests.ts deleted file mode 100644 index aa1851931c..0000000000 --- a/datatables.net-select/datatables.net-select-tests.ts +++ /dev/null @@ -1,16 +0,0 @@ -/// -/// - -$(document).ready(() => { - var config: DataTables.Settings = { - // Select extension options - select: { - blurable: true, - className: "selectClass", - info: true, - items: "row", - selector: "td:first-child", - style: "os" - } - }; -}); diff --git a/datatables.net-select/index.d.ts b/datatables.net-select/index.d.ts deleted file mode 100644 index 96529a10c1..0000000000 --- a/datatables.net-select/index.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -// Type definitions for datatables.net-select 1.2 -// Project: https://datatables.net/extensions/select/ -// Definitions by: Jared Szechy -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// -/// - -declare namespace DataTables { - export interface Settings { - /* - * Select extension options - */ - select?: boolean | string | SelectSettings; - } - - interface SelectSettings { - /* - * Indicate if the selected items will be removed when clicking outside of the table - */ - blurable?: boolean; - - /* - * Set the class name that will be applied to selected items - */ - className?: string; - - /* - * Enable / disable the display for item selection information in the table summary - */ - info?: boolean; - - /* - * Set which table items to select (rows, columns or cells) - */ - items?: string; - - /* - * Set the element selector used for mouse event capture to select items - */ - selector?: string; - - /* - * Set the selection style for end user interaction with the table - */ - style?: string; - } -} diff --git a/datatables.net-select/tslint.json b/datatables.net-select/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/datatables.net-select/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/datatables.net/index.d.ts b/datatables.net/index.d.ts deleted file mode 100644 index 2640dbabe6..0000000000 --- a/datatables.net/index.d.ts +++ /dev/null @@ -1,1935 +0,0 @@ -// Type definitions for JQuery DataTables 1.10.9 -// Project: http://www.datatables.net -// Definitions by: Kiarash Ghiaseddin , Omid Rad , Armin Sander -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -// missing: -// - Static methods that are defined in JQueryStatic.fn are not typed. -// - Plugin and extension definitions are not typed. -// - Some return types are not fully wokring - -/// - -interface JQuery { - DataTable(param?: DataTables.Settings): DataTables.DataTable; -} - -//TODO: Wrong, as jquery.d.ts has no interface for fn -//interface JQueryStatic { -// dataTable: DataTables.StaticFunctions; -//} - -declare namespace DataTables { - export interface DataTable extends DataTableCore { - /** - * Get the data for the whole table. - */ - data(): DataTable; - - /** - * Order Methods / Object - */ - order: OrderMethods; - - //#region "Cell/Cells" - - /** - * Select the cell found by a cell selector - * - * @param cellSelector Cell selector. - * @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account. - */ - cell(cellSelector: (string | Node | Function | JQuery | Object) | (string | Node | Function | JQuery | Object)[], modifier?: ObjectSelectorModifier): CellMethods; - - /** - * Select the cell found by a cell selector - * - * @param rowSelector Row selector. - * @param cellSelector Cell selector. - * @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account. - */ - cell(rowSelector: (string | Node | Function | JQuery | Object) | (string | Node | Function | JQuery | Object)[], cellSelector: (string | Node | Function | JQuery | Object) | (string | Node | Function | JQuery | Object)[], modifier?: ObjectSelectorModifier): CellMethods; - - /** - * Select all cells - * - * @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account. - */ - cells(modifier?: ObjectSelectorModifier): CellsMethods; - - /** - * Select cells found by a cell selector - * - * @param cellSelector Cell selector. - * @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account. - */ - cells(cellSelector: (string | Node | Function | JQuery | Object) | (string | Node | Function | JQuery | Object)[], modifier?: ObjectSelectorModifier): CellsMethods; - - /** - * Select cells found by both row and column selectors - * - * @param rowSelector Row selector. - * @param cellSelector Cell selector. - * @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account. - */ - cells(rowSelector: (string | Node | Function | JQuery | Object) | (string | Node | Function | JQuery | Object)[], cellSelector: (string | Node | Function | JQuery | Object) | (string | Node | Function | JQuery | Object)[], modifier?: ObjectSelectorModifier): CellsMethods; - //#endregion "Cell/Cells" - - //#region "Column/Columns" - - /** - * Column Methods / Object - */ - column: ColumnMethodsModel; - - /** - * Columns Methods / Object - */ - columns: ColumnsMethodsModel; - - //#endregion "Column/Columns" - - //#region "Row/Rows" - - /** - * Row Methode / Object - */ - row: RowMethodsModel - - /** - * Rows Methods / Object - */ - rows: RowsMethodsModel - - //#endregion "Row/Rows" - - //#region "Table/Tables" - - /** - * Select a table based on a selector from the API's context - * - * @param tableSelector Table selector. - */ - table(tableSelector: (string | Node | Function | JQuery | Object) | (string | Node | Function | JQuery | Object)[]): TableMethods; - - /** - * Select all tables - */ - tables(): TablesMethods; - - /** - * Select tables based on the given selector - * - * @param tableSelector Table selector. - */ - tables(tableSelector: (string | Node | Function | JQuery | Object) | (string | Node | Function | JQuery | Object)[]): TablesMethods; - - //#endregion "Table/Tables" - } - - export interface DataTables extends DataTableCore { - [index: number]: DataTable; - } - - interface ObjectSelectorModifier { - /** - * The order modifier provides the ability to control which order the rows are processed in. - * Values: 'current', 'applied', 'index', 'original' - */ - order?: string; - - /** - * The search modifier provides the ability to govern which rows are used by the selector using the search options that are applied to the table. - * Values: 'none', 'applied', 'removed' - */ - search?: string; - - /** - * The page modifier allows you to control if the selector should consider all data in the table, regardless of paging, or if only the rows in the currently disabled page should be used. - * Values: 'all', 'current' - */ - page?: string; - } - - //#region "Namespaces" - - //#region "core-methods" - - interface DataTableCore extends UtilityMethods { - /** - * Get jquery object - */ - $(selector: string | Node | Node[] | JQuery, modifier?: ObjectSelectorModifier): JQuery; - - ///// Almost identical to $ in operation, but in this case returns the data for the matched rows. - //_(selector: string | Node | Node[] | JQuery, modifier?: ObjectSelectorModifier): JQuery; - - /** - * Ajax Methods - */ - ajax: AjaxMethodModel; - - /** - * Clear the table of all data. - */ - clear(): DataTable; - - /** - * Destroy the DataTables in the current context. - * - * @param remove Completely remove the table from the DOM (true) or leave it in the DOM in its original plain un-enhanced HTML state (default, false). - */ - destroy(remove?: boolean): DataTable; - - /** - * Redraw the DataTables in the current context, optionally updating ordering, searching and paging as required. - * - * @param paging This parameter is used to determine what kind of draw DataTables will perform. - */ - draw(paging?: boolean | string): DataTable; - - /* - * Look up a language token that was defined in the DataTables' language initialisation object. - * - * @param token The language token to lookup from the language object. - * @param def The default value to use if the DataTables initialisation has not specified a value. - * @param numeric If handling numeric output, the number to be presented should be given in this parameter. If not numeric operator is required (for example button label text) this parameter is not required. - * - * @returns Resulting internationalised string. - */ - i18n(token: string, def: any | string, numeric?: number): string; - - /* - * Get the initialisation options used for the table. Since: DataTables 1.10.6 - */ - init(): Settings; - - /** - * Table events removal. - * - * @param event Event name to remove. - * @param callback Specific callback function to remove if you want to unbind a single event listener. - */ - off(event: string, callback?: Function): DataTable; - - /** - * Table events listener. - * - * @param event Event to listen for. - * @param callback Specific callback function to remove if you want to unbind a single event listener. - */ - on(event: string, callback: Function): DataTable; - - /** - * Listen for a table event once and then remove the listener. - * - * @param event Event to listen for. - * @param callback Specific callback function to remove if you want to unbind a single event listener. - */ - one(event: string, callback: Function): DataTable; - - /** - * Page Methods / Object - */ - page: PageMethods; - - /** - * Get current search - */ - search(): string; - - /** - * Search for data in the table. - * - * @param input Search string to apply to the table. - * @param regex Treat as a regular expression (true) or not (default, false). - * @param smart Perform smart search. - * @param caseInsen Do case-insensitive matching (default, true) or not (false). - */ - search(input: string, regex?: boolean, smart?: boolean, caseInsen?: boolean): DataTable; - - /** - * Obtain the table's settings object - */ - settings(): DataTable; - - /** - * Page Methods / Object - */ - state: StateMethods; - } - - //#region "ajax-methods" - - interface AjaxMethods extends DataTable { - /** - * Reload the table data from the Ajax data source. - * - * @param callback Function which is executed when the data as been reloaded and the table fully redrawn. - * @param resetPaging Reset (default action or true) or hold the current paging position (false). - */ - load(callback?: Function, resetPaging?: boolean): DataTable; - } - - interface AjaxMethodModel { - /** - * Get the latest JSON data obtained from the last Ajax request DataTables made - */ - json(): Object; - - /** - * Get the data submitted by DataTables to the server in the last Ajax request - */ - params(): Object; - - /** - * Reload the table data from the Ajax data source. - * - * @param callback Function which is executed when the data as been reloaded and the table fully redrawn. - * @param resetPaging Reset (default action or true) or hold the current paging position (false). - */ - reload(callback?: Function, resetPaging?: boolean): DataTable; - - /** - * Reload the table data from the Ajax data source - */ - url(): string; - - /** - * Reload the table data from the Ajax data source - * - * @param url URL to set to be the Ajax data source for the table. - */ - url(url: string): AjaxMethods; - } - - //#endregion "ajax-methods" - - //#region "order-methods" - - interface OrderMethods { - /** - * Get the ordering applied to the table. - */ - (): (string | number)[][]; - - /** - * Set the ordering applied to the table. - * - * @param order Order Model - */ - (order?: (string | number)[]): DataTable; - (order?: (string | number)[][]): DataTable; - (order: (string | number)[], ...args: any[]): DataTable; - - /** - * Add an ordering listener to an element, for a given column. - * - * @param node Selector - * @param column Column index - * @param callback Callback function - */ - listener(node: string | Node | JQuery, column: number, callback: Function): DataTable; - } - //#endregion "order-methods" - - //#region "page-methods" - - interface PageMethods { - /** - * Get the current page of the table. - */ - (): number; - - /** - * Set the current page of the table. - * - * @param page Index or 'first', 'next', 'previous', 'last' - */ - (page: number | string): DataTable; - - /** - * Get paging information about the table - */ - info(): PageMethodeModelInfoReturn; - - /** - * Get the table's page length. - */ - len(): number; - - /** - * Set the table's page length. - * - * @param length Page length to set. use -1 to show all records. - */ - len(length: number): DataTable; - } - - interface PageMethodeModelInfoReturn { - page: number; - pages: number; - start: number; - end: number; - length: number; - recordsTotal: number; - recordsDisplay: number; - serverSide: boolean - } - - //#endregion "page-methods" - - //#region "state-methods" - - interface StateMethods { - /** - * Get the last saved state of the table - */ - (): StateReturnModel; - - /** - * Clear the saved state of the table. - */ - clear(): DataTable; - - /** - * Get the table state that was loaded during initialisation. - */ - loaded(): StateReturnModel; - - /** - * Trigger a state save. - */ - save(): DataTable; - } - - interface StateReturnModel { - time: number; - start: number; - length: number; - order: (string | number)[][]; - search: SearchSettings; - columns: StateReturnModelColumns[]; - } - - interface StateReturnModelColumns { - search: SearchSettings; - visible: boolean; - } - - //#endregion "state-methods" - - //#endregion "core-methods" - - //#region "util-methods" - - interface UtilityMethods { - /* - * Get a boolean value to indicate if there are any entries in the API instance's result set (i.e. any data, selected rows, etc). - */ - any(): boolean; - - /** - * Concatenate two or more API instances together - * - * @param a API instance to concatenate to the initial instance. - * @param b Additional API instance(s) to concatenate to the initial instance. - */ - concat(a: Object, ...b: Object[]): DataTable; - - /** - * Get the number of entries in an API instance's result set, regardless of multi-table grouping (e.g. any data, selected rows, etc). Since: 1.10.8 - */ - count(): number; - - /** - * Iterate over the contents of the API result set. - * - * @param fn Callback function which is called for each item in the API instance result set. The callback is called with three parameters - */ - each(fn: Function): DataTable; - - /** - * Reduce an Api instance to a single context and result set. - * - * @param idx Index to select - */ - eq(idx: number): DataTable; - - /** - * Iterate over the result set of an API instance and test each item, creating a new instance from those items which pass. - * - * @param fn Callback function which is called for each item in the API instance result set. The callback is called with three parameters. - */ - filter(fn: Function): DataTable; - - /** - * Flatten a 2D array structured API instance to a 1D array structure. - */ - flatten(): DataTable; - - /** - * Find the first instance of a value in the API instance's result set. - * - * @param value Value to find in the instance's result set. - */ - indexOf(value: any): number; - - /** - * Join the elements in the result set into a string. - * - * @param separator The string that will be used to separate each element of the result set. - */ - join(separator: string): string; - - /** - * Find the last instance of a value in the API instance's result set. - * - * @param value Value to find in the instance's result set. - */ - lastIndexOf(value: any): number; - - /** - * Number of elements in an API instance's result set. - */ - length: number; - - /** - * Iterate over the result set of an API instance, creating a new API instance from the values returned by the callback. - * - * @param fn Callback function which is called for each item in the API instance result set. The callback is called with three parameters. - */ - map(fn: Function): DataTable; - - /** - * Iterate over the result set of an API instance, creating a new API instance from the values retrieved from the original elements. - * - * @param property Object property name to use from the element in the original result set for the new result set. - */ - pluck(property: number | string): DataTable; - - /** - * Remove the last item from an API instance's result set. - */ - pop(): any; - - /** - * Add one or more items to the end of an API instance's result set. - * - * @param value_1 Item to add to the API instance's result set. - */ - push(value_1: any | any[], ...value_2: any[]): number; - - /** - * Apply a callback function against and accumulator and each element in the Api's result set (left-to-right). - * - * @param fn Callback function which is called for each item in the API instance result set. The callback is called with four parameters. - * @param initialValue Value to use as the first argument of the first call to the fn callback. - */ - reduce(fn: Function, initialValue?: any): any; - - /** - * Apply a callback function against and accumulator and each element in the Api's result set (right-to-left). - * - * @param fn Callback function which is called for each item in the API instance result set. The callback is called with four parameters. - * @param initialValue Value to use as the first argument of the first call to the fn callback. - */ - reduceRight(fn: Function, initialValue?: any): any; - - /** - * Reverse the result set of the API instance and return the original array. - */ - reverse(): DataTable; - - /** - * Remove the first item from an API instance's result set. - */ - shift(): any; - - /** - * Sort the elements of the API instance's result set. - * - * @param fn This is a standard Javascript sort comparison function. It accepts two parameters. - */ - sort(fn?: Function): DataTable; - - /** - * Modify the contents of an Api instance's result set, adding or removing items from it as required. - * - * @param index Index at which to start modifying the Api instance's result set. - * @param howMany Number of elements to remove from the result set. - * @param value_1 Item to add to the result set at the index specified by the first parameter. - */ - splice(index: number, howMany: number, value_1?: any | any[], ...value_2: any[]): any[]; - - /** - * Convert the API instance to a jQuery object, with the objects from the instance's result set in the jQuery result set. - */ - to$(): JQuery; - - /** - * Create a native Javascript array object from an API instance. - */ - toArray(): any[]; - - /** - * Convert the API instance to a jQuery object, with the objects from the instance's result set in the jQuery result set. - */ - toJQuery(): JQuery; - - /** - * Create a new API instance containing only the unique items from a the elements in an instance's result set. - */ - unique(): DataTable; - - /** - * Add one or more items to the start of an API instance's result set. - * - * @param value_1 Item to add to the API instance's result set. - */ - unshift(value_1: any | any[], ...value_2: any[]): number; - } - - //#endregion "util-methods" - - interface CommonSubMethods { - /** - * Get the DataTables cached data for the selected cell - * - * @param t Specify which cache the data should be read from. Can take one of two values: search or order - */ - cache(t: string): DataTable; - } - - //#region "cell-methods" - - interface CommonCellMethods extends CommonSubMethods { - /** - * Invalidate the data held in DataTables for the selected cells - * - * @param source Data source to read the new data from. - */ - invalidate(source?: string): DataTable; - - /** - * Get data for the selected cell - * - * @param f Data type to get. This can be one of: 'display', 'filter', 'sort', 'type' - */ - render(t: string): any; - } - - interface CellMethods extends DataTableCore, CommonCellMethods { - /** - * Get data for the selected cell - */ - data(): any; - - /** - * Get data for the selected cell - * - * @param data Value to assign to the data for the cell - */ - data(data: any): DataTable; - - /** - * Get index information about the selected cell - */ - index(): CellIndexReturn; - - /** - * Get the DOM element for the selected cell - */ - node(): Node; - } - - interface CellIndexReturn { - row: number; - column: number; - columnVisible: number; - } - - interface CellsMethods extends DataTableCore, CommonCellMethods { - /** - * Get data for the selected cells - */ - data(): DataTable; - - /** - * Iterate over each selected cell, with the function context set to be the cell in question. Since: DataTables 1.10.6 - * - * @param fn Function to execute for every cell selected. - */ - every(fn: (cellRowIdx: number, cellColIdx: number, tableLoop: number, cellLoop: number) => void): DataTable; - - /** - * Get index information about the selected cells - */ - indexes(): DataTable; - - /** - * Get the DOM elements for the selected cells - */ - nodes(): DataTable; - } - //#endregion "cell-methods" - - //#region "column-methods" - - interface CommonColumnMethod extends CommonSubMethods { - /** - * Get the footer th / td cell for the selected column. - */ - footer(): any; - - /** - * Get the header th / td cell for a column. - */ - header(): Node; - - /** - * Order the table, in the direction specified, by the column selected by the column()DT selector. - * - * @param direction Direction of sort to apply to the selected column - desc (descending) or asc (ascending). - */ - order(direction: string): DataTable; - - /** - * Get the visibility of the selected column. - */ - visible(): boolean; - - /** - * Set the visibility of the selected column. - * - * @param show Specify if the column should be visible (true) or not (false). - * @param redrawCalculations Indicate if DataTables should recalculate the column layout (true - default) or not (false). Typically this would be left as the default value, but it can be useful to disable when using the method in a loop - so the calculations are performed on every call as they can hamper performance. - */ - visible(show: boolean, redrawCalculations?: boolean): DataTable; - } - - interface ColumnMethodsModel { - /** - * Select the column found by a column selector - * - * @param cellSelector Cell selector. - * @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account. - */ - (columnSelector: any, modifier?: ObjectSelectorModifier): ColumnMethods; - - /** - * Convert from the input column index type to that required. - * - * @param t The type on conversion that should take place: 'fromVisible', 'toData', 'fromData', 'toVisible' - * @param index The index to be converted - */ - index(t: string, index: number): number; - } - - interface ColumnMethods extends DataTableCore, CommonColumnMethod { - /** - * Get the data for the cells in the selected column. - */ - data(): DataTable; - - /** - * Get the data source property for the selected column - */ - dataSrc(): number | string | Function; - - /** - * Get index information about the selected cell - * - * @param t Specify if you want to get the column data index (default) or the visible index (visible). - */ - index(t?: string): DataTable; - - /** - * Obtain the th / td nodes for the selected column - */ - nodes(): DataTable[]; - } - - interface ColumnsMethodsModel { - /** - * Select all columns - * - * @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account. - */ - (modifier?: ObjectSelectorModifier): ColumnsMethods; - - /** - * Select columns found by a cell selector - * - * @param cellSelector Cell selector. - * @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account. - */ - (columnSelector: any, modifier?: ObjectSelectorModifier): ColumnsMethods; - - /** - * Recalculate the column widths for layout. - */ - adjust(): DataTable; - } - - interface ColumnsMethods extends DataTableCore, CommonColumnMethod { - /** - * Obtain the data for the columns from the selector - */ - data(): DataTable; - - /** - * Get the data source property for the selected columns. - */ - dataSrc(): DataTable; - - /** - * Iterate over each selected column, with the function context set to be the column in question. Since: DataTables 1.10.6 - * - * @param fn Function to execute for every column selected. - */ - every(fn: (colIdx: number, tableLoop: number, colLoop: number) => void): DataTable; - - /** - * Get the column indexes of the selected columns. - * - * @param t Specify if you want to get the column data index (default) or the visible index (visible). - */ - indexes(t?: string): DataTable; - - /** - * Obtain the th / td nodes for the selected columns - */ - nodes(): DataTable[][]; - } - //#endregion "column-methods" - - //#region "row-methods" - - interface CommonRowMethod extends CommonSubMethods { - /** - * Obtain the th / td nodes for the selected column - * - * @param source Data source to read the new data from. Values: 'auto', 'data', 'dom' - */ - invalidate(source?: string): DataTable; - } - - interface RowChildMethodModel { - /** - * Get the child row(s) that have been set for a parent row - */ - (): JQuery; - - /** - * Get the child row(s) that have been set for a parent row - * - * @param showRemove This parameter can be given as true or false - */ - (showRemove: boolean): RowChildMethods; - - /** - * Set the data to show in the child row(s). Note that calling this method will replace any child rows which are already attached to the parent row. - * - * @param data The data to be shown in the child row can be given in multiple different ways. - * @param className Class name that is added to the td cell node(s) of the child row(s). As of 1.10.1 it is also added to the tr row node of the child row(s). - */ - (data: (string | Node | JQuery) | (string | Node | JQuery)[], className?: string): RowChildMethods; - - /** - * Hide the child row(s) of a parent row - */ - hide(): DataTable; - - /** - * Check if the child rows of a parent row are visible - */ - isShown(): DataTable; - - /** - * Remove child row(s) from display and release any allocated memory - */ - remove(): DataTable; - - /** - * Show the child row(s) of a parent row - */ - show(): DataTable; - } - - interface RowChildMethods extends DataTableCore { - /** - * Hide the child row(s) of a parent row - */ - hide(): DataTable; - - /** - * Remove child row(s) from display and release any allocated memory - */ - remove(): DataTable; - - /** - * Make newly defined child rows visible - */ - show(): DataTable; - } - - interface RowMethodsModel { - /** - * Select a row found by a row selector - * - * @param rowSelector Row selector. - * @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account. - */ - (rowSelector: any, modifier?: ObjectSelectorModifier): RowMethods; - - /** - * Add a new row to the table using the given data - * - * @param data Data to use for the new row. This may be an array, object or Javascript object instance, but must be in the same format as the other data in the table - */ - add(data: any[] | Object): DataTable; - } - - interface RowMethods extends DataTableCore, CommonRowMethod { - /** - * Order Methods / Object - */ - child: RowChildMethodModel; - - /** - * Get the data for the selected row - */ - data(): any[] | Object; - - /** - * Set the data for the selected row - * - * @param d Data to use for the row. - */ - data(d: any[] | Object): DataTable; - - /** - - * Get the id of the selected row. Since: 1.10.8 - * - * @param hash true - Append a hash (#) to the start of the row id. This can be useful for then using the id as a selector - * false - Do not modify the id value. - * @returns Row id. If the row does not have an id available 'undefined' will be returned. - */ - id(hash?: boolean): string; - - /** - * Get the row index of the row column. - */ - index(): number; - - /** - * Obtain the tr node for the selected row - */ - node(): Node; - - /** - * Delete the selected row from the DataTable. - */ - remove(): Node; - } - - interface RowsMethodsModel { - /** - * Select all rows - * - * @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account. - */ - (modifier?: ObjectSelectorModifier): RowsMethods; - - /** - * Select rows found by a row selector - * - * @param cellSelector Row selector. - * @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account. - */ - (rowSelector: any, modifier?: ObjectSelectorModifier): RowsMethods; - - /** - * Add new rows to the table using the data given - * - * @param data Array of data elements, with each one describing a new row to be added to the table - */ - add(data: any[]): DataTable; - } - - interface RowsMethods extends DataTableCore, CommonRowMethod { - /** - * Get the data for the rows from the selector - */ - data(): DataTable; - - /** - * Set the data for the selected row - * - * @param d Data to use for the row. - */ - data(d: any[] | Object): DataTable; - - /** - * Iterate over each selected row, with the function context set to be the row in question. Since: DataTables 1.10.6 - * - * @param fn Function to execute for every row selected. - */ - every(fn: (rowIdx: number, tableLoop: number, rowLoop: number) => void): DataTable; - - /** - * Get the ids of the selected rows. Since: 1.10.8 - * - * @param hash true - Append a hash (#) to the start of each row id. This can be useful for then using the ids as selectors - * false - Do not modify the id value. - * @returns Api instance with the selected rows in its result set. If a row does not have an id available 'undefined' will be returned as the value. - */ - ids(hash?: boolean): DataTable; - - /** - * Get the row indexes of the selected rows. - */ - indexes(): DataTable; - - /** - * Obtain the tr nodes for the selected rows - */ - nodes(): DataTable; - - /** - * Delete the selected rows from the DataTable. - */ - remove(): DataTable; - } - //#endregion "row-methods" - - //#region "table-methods" - - interface TableMethods extends DataTableCore { - /** - * Get the tfoot node for the table in the API's context - */ - footer(): Node; - - /** - * Get the thead node for the table in the API's context - */ - header(): Node; - - /** - * Get the tbody node for the table in the API's context - */ - body(): Node; - - /** - * Get the div container node for the table in the API's context - */ - container(): Node; - - /** - * Get the table node for the table in the API's context - */ - node(): Node; - } - - interface TablesMethods extends DataTableCore { - /** - * Get the tfoot nodes for the tables in the API's context - */ - footer(): DataTable; - - /** - * Get the thead nodes for the tables in the API's context - */ - header(): DataTable; - - /** - * Get the tbody nodes for the tables in the API's context - */ - body(): DataTable; - - /** - * Get the div container nodes for the tables in the API's context - */ - containers(): DataTable; - - /** - * Get the table nodes for the tables in the API's context - */ - nodes(): DataTable; - } - //#endregion "table-methods" - - //#endregion "Namespaces" - - //#region "Static-Methods" - - export interface StaticFunctions { - /** - * Check is a table node is a DataTable or not - * - * @param table Selector string for table - */ - isDataTable(table: string): boolean; - - /** - * Get all DataTable tables that have been initialised - optionally you can select to get only currently visible tables and / or retrieve the tables as API instances. - * - * @param visible As a boolean value this options is used to indicate if you want all tables on the page should be returned (false), or visible tables only (true). - * Since 1.10.8 this option can also be given as an object. - */ - tables(visible?: boolean | ObjectTablesStatic): DataTables.DataTable[] | DataTables.DataTable; - - /** - * Version number compatibility check function - * - * @param version Version string - */ - versionCheck(version: string): boolean; - - /** - * Utils - */ - util: StaticUtilFunctions; - - /** - * Check is a table node is a DataTable or not - * - * @param table Selector string for table - */ - Api(selector: string | Node | Node[] | JQuery): DataTables.DataTable; - } - - export interface StaticUtilFunctions { - /** - * Escape special characters in a regular expression string. Since: 1.10.4 - * - * @param str String to escape - */ - escapeRegex(str: string): string; - - /** - * Throttle the calls to a method to reduce call frequency. Since: 1.10.3 - * - * @param fn Function - * @param period ms - */ - throttle(fn: Function, period?: number): Function; - } - - interface ObjectTablesStatic { - /** - * Get only visible tables (true) or all tables regardless of visibility (false). - */ - visible: boolean - - /** - * Return a DataTables API instance for the selected tables (true) or an array (false). - */ - api: boolean - } - - //#endregion "Static-Methods" - - //#region "Settings" - - export interface Settings { - - //#region "Features" - - /** - * Feature control DataTables' smart column width handling. Since: 1.10 - */ - autoWidth?: boolean; - - /** - * Feature control deferred rendering for additional speed of initialisation. Since: 1.10 - */ - deferRender?: boolean; - - /** - * Feature control table information display field. Since: 1.10 - */ - info?: boolean; - - /** - * Use markup and classes for the table to be themed by jQuery UI ThemeRoller. Since: 1.10 - */ - jQueryUI?: boolean; - - /** - * Feature control the end user's ability to change the paging display length of the table. Since: 1.10 - */ - lengthChange?: boolean; - - /** - * Feature control ordering (sorting) abilities in DataTables. Since: 1.10 - */ - ordering?: boolean; - - /** - * Enable or disable table pagination. Since: 1.10 - */ - paging?: boolean; - - /** - * Feature control the processing indicator. Since: 1.10 - */ - processing?: boolean; - - /** - * Horizontal scrolling. Since: 1.10 - */ - scrollX?: boolean; - - /** - * Vertical scrolling. Since: 1.10 Exp: "200px" - */ - scrollY?: string; - - /** - * Feature control search (filtering) abilities Since: 1.10 - */ - searching?: boolean; - - /** - * Feature control DataTables' server-side processing mode. Since: 1.10 - */ - serverSide?: boolean; - - /** - * State saving - restore table state on page reload. Since: 1.10 - */ - stateSave?: boolean; - - //#endregion "Features" - - //#region "Data" - - /** - * Load data for the table's content from an Ajax source. Since: 1.10 - */ - ajax?: string | AjaxSettings | FunctionAjax; - - /** - * Data to use as the display data for the table. Since: 1.10 - */ - data?: Object; - - //#endregion "Data" - - //#region "Options" - - /** - * Data to use as the display data for the table. Since: 1.10 - */ - columns?: ColumnSettings[]; - - /** - * Assign a column definition to one or more columns.. Since: 1.10 - */ - columnDefs?: ColumnDefsSettings[]; - - /** - * Delay the loading of server-side data until second draw - */ - deferLoading?: number | number[]; - - /** - * Destroy any existing table matching the selector and replace with the new options. Since: 1.10 - */ - destroy?: boolean; - - /** - * Initial paging start point. Since: 1.10 - */ - displayStart?: number; - - /** - * Define the table control elements to appear on the page and in what order. Since: 1.10 - */ - dom?: string; - - /** - * Change the options in the page length select list. Since: 1.10 - */ - lengthMenu?: (number | string)[] | (number | string)[][]; - - /** - * Control which cell the order event handler will be applied to in a column. Since: 1.10 - */ - orderCellsTop?: boolean; - - /** - * Highlight the columns being ordered in the table's body. Since: 1.10 - */ - orderClasses?: boolean; - - /** - * Initial order (sort) to apply to the table. Since: 1.10 - */ - order?: (string | number)[] | (string | number)[][]; - - /** - * Ordering to always be applied to the table. Since: 1.10 - */ - orderFixed?: (string | number)[] | (string | number)[][] | Object; - - /** - * Multiple column ordering ability control. Since: 1.10 - */ - orderMulti?: boolean; - - /** - * Change the initial page length (number of rows per page). Since: 1.10 - */ - pageLength?: number; - - /** - * Pagination button display options. Basic Types: numbers (1.10.8) simple, simple_numbers, full, full_numbers - */ - pagingType?: string; - - /** - * Retrieve an existing DataTables instance. Since: 1.10 - */ - retrieve?: boolean - - /** - * Display component renderer types. Since: 1.10 - */ - renderer?: string | RendererSettings; - - /** - * Data property name that DataTables will use to set
    element DOM IDs. Since: 1.10.8 - */ - rowId?: string; - - /** - * Allow the table to reduce in height when a limited number of rows are shown. Since: 1.10 - */ - scrollCollapse?: boolean; - - /** - * Set an initial filter in DataTables and / or filtering options. Since: 1.10 - */ - search?: SearchSettings; - - /** - * Define an initial search for individual columns. Since: 1.10 - */ - searchCols?: SearchSettings[]; - - /** - * Set a throttle frequency for searching. Since: 1.10 - */ - searchDelay?: number; - - /** - * Saved state validity duration. Since: 1.10 - */ - stateDuration?: number; - - /** - * Set the zebra stripe class names for the rows in the table. Since: 1.10 - */ - stripeClasses?: string[]; - - /** - * Tab index control for keyboard navigation. Since: 1.10 - */ - tabIndex?: number; - - //#endregion "Options" - - //#region "Callbacks" - - /** - * Callback for whenever a TR element is created for the table's body. Since: 1.10 - */ - createdRow?: FunctionCreateRow; - - /** - * Function that is called every time DataTables performs a draw. Since: 1.10 - */ - drawCallback?: FunctionDrawCallback; - - /** - * Footer display callback function. Since: 1.10 - */ - footerCallback?: FunctionFooterCallback; - - /** - * Number formatting callback function. Since: 1.10 - */ - formatNumber?: FunctionFormatNumber; - - /** - * Header display callback function. Since: 1.10 - */ - headerCallback?: FunctionHeaderCallback; - - /** - * Table summary information display callback. Since: 1.10 - */ - infoCallback?: FunctionInfoCallback; - - /** - * Initialisation complete callback. Since: 1.10 - */ - initComplete?: FunctionInitComplete; - - /** - * Pre-draw callback. Since: 1.10 - */ - preDrawCallback?: FunctionPreDrawCallback; - - /** - * Row draw callback.. Since: 1.10 - */ - rowCallback?: FunctionRowCallback; - - /** - * Callback that defines where and how a saved state should be loaded. Since: 1.10 - */ - stateLoadCallback?: FunctionStateLoadCallback; - - /** - * State loaded callback. Since: 1.10 - */ - stateLoaded?: FunctionStateLoaded; - - /** - * State loaded - data manipulation callback. Since: 1.10 - */ - stateLoadParams?: FunctionStateLoadParams; - - /** - * Callback that defines how the table state is stored and where. Since: 1.10 - */ - stateSaveCallback?: FunctionStateSaveCallback; - - /** - * State save - data manipulation callback. Since: 1.10 - */ - stateSaveParams?: FunctionStateSaveParams; - - //#endregion "Callbacks" - - //#region "Language" - - language?: LanguageSettings; - - //#endregion "Language" - } - - //#region "ajax-settings" - - export interface AjaxDataRequest { - draw: number; - start: number; - length: number; - data: any; - order: AjaxDataRequestOrder[]; - columns: AjaxDataRequestColumn[]; - search: AjaxDataRequestSearch; - } - - export interface AjaxDataRequestSearch { - value: string; - regex: boolean; - } - - export interface AjaxDataRequestOrder { - column: number; - dir: string; - } - - export interface AjaxDataRequestColumn { - data: string | number; - name: string; - searchable: boolean; - orderable: boolean; - search: AjaxDataRequestSearch; - } - - export interface AjaxData { - draw?: number; - recordsTotal?: number; - recordsFiltered?: number; - data: any; - error?: string; - } - - interface AjaxSettings extends JQueryAjaxSettings { - /** - * Add or modify data submitted to the server upon an Ajax request. Since: 1.10 - */ - data?: Object | FunctionAjaxData; - - /** - * Data property or manipulation method for table data. Since: 1.10 - */ - dataSrc?: string | Function; - } - - interface FunctionAjax { - (data: Object, callback: Function, settings: SettingsLegacy): void; - } - - interface FunctionAjaxData { - /* - * @param data Data that DataTables has constructed for the request. - * @param settings DataTables settings object. Since 1.10.6 - */ - (data: Object, settings: Settings): string | Object; - } - - //#endregion "ajax-settings" - - //#region "colunm-settings" - - export interface ColumnSettings { - /** - * Cell type to be created for a column. th/td Since: 1.10 - */ - cellType?: string; - - /** - * Class to assign to each cell in the column. Since: 1.10 - */ - className?: string; - - /** - * Add padding to the text content used when calculating the optimal with for a table. Since: 1.10 - */ - contentPadding?: string; - - /** - * Cell created callback to allow DOM manipulation. Since: 1.10 - */ - createdCell?: FunctionColumnCreatedCell; - - /** - * Class to assign to each cell in the column. Since: 1.10 - */ - data?: number | string | ObjectColumnData | FunctionColumnData; - - /** - * Set default, static, content for a column. Since: 1.10 - */ - defaultContent?: string; - - /** - * Set a descriptive name for a column. Since: 1.10 - */ - name?: string; - - /** - * Enable or disable ordering on this column. Since: 1.10 - */ - orderable?: boolean; - - /** - * Define multiple column ordering as the default order for a column. Since: 1.10 - */ - orderData?: number | number[]; - - /** - * Live DOM sorting type assignment. Since: 1.10 - */ - orderDataType?: string; - - /** - * Order direction application sequence. Since: 1.10 - */ - orderSequence?: string[]; - - /** - * Render (process) the data for use in the table. Since: 1.10 - */ - render?: number | string | ObjectColumnRender | FunctionColumnRender; - - /** - * Enable or disable filtering on the data in this column. Since: 1.10 - */ - searchable?: boolean; - - /** - * Set the column title. Since: 1.10 - */ - title?: string; - - /** - * Set the column type - used for filtering and sorting string processing. Since: 1.10 - */ - type?: string; - - /** - * Enable or disable the display of this column. Since: 1.10 - */ - visible?: boolean; - - /** - * Column width assignment. Since: 1.10 - */ - width?: string; - } - - interface ColumnDefsSettings extends ColumnSettings { - targets: string | number | (number | string)[] - } - - interface FunctionColumnCreatedCell { - (cell: Node, cellData: any, rowData: any, row: number, col: number): void; - } - - interface FunctionColumnData { - (row: any, t: 'set', s: any, meta: CellMetaSettings): void; - (row: any, t: 'display' | 'sort' | 'filter' | 'type', s: undefined, meta: CellMetaSettings): any; - } - - interface ObjectColumnData { - _: string; - filter?: string; - display?: string; - type?: string; - sort?: string; - } - - interface ObjectColumnRender extends ObjectColumnData { - } - - interface FunctionColumnRender { - (data: any, t: string, row: any, meta: CellMetaSettings): void; - } - - interface CellMetaSettings { - row: number; - col: number; - settings: DataTables.Settings; - } - - //#endregion "colunm-settings" - - //#region "other-settings" - - export interface RendererSettings { - header?: string; - pageButton?: string; - } - - export interface SearchSettings { - /** - * Control case-sensitive filtering option. Since: 1.10 - */ - caseInsensitive?: boolean; - - /** - * Enable / disable escaping of regular expression characters in the search term. Since: 1.10 - */ - regex?: boolean; - - /** - * Enable / disable DataTables' smart filtering. Since: 1.10 - */ - smart?: boolean; - - /** - * Set an initial filtering condition on the table. Since: 1.10 - */ - search?: string; - } - - //#endregion "other-settings" - - //#region "callback-functions" - - interface FunctionCreateRow { - (row: Node, data: any[] | Object, dataIndex: number): void; - } - - interface FunctionDrawCallback { - (settings: SettingsLegacy): void; - } - - interface FunctionFooterCallback { - (tfoot: Node, data: any[], start: number, end: number, display: any[]): void; - } - - interface FunctionFormatNumber { - (formatNumber: number): void; - } - - interface FunctionHeaderCallback { - (thead: Node, data: any[], start: number, end: number, display: any[]): void; - } - - interface FunctionInfoCallback { - (settings: SettingsLegacy, start: number, end: number, mnax: number, total: number, pre: string): void; - } - - interface FunctionInitComplete { - (settings: SettingsLegacy, json: Object): void; - } - - interface FunctionPreDrawCallback { - (settings: SettingsLegacy): void; - } - - interface FunctionRowCallback { - (row: Node, data: any[] | Object, index: number): void; - } - - interface FunctionStateLoadCallback { - (settings: SettingsLegacy): void; - } - - interface FunctionStateLoaded { - (settings: SettingsLegacy, data: Object): void; - } - - interface FunctionStateLoadParams { - (settings: SettingsLegacy, data: Object): void; - } - - interface FunctionStateSaveCallback { - (settings: SettingsLegacy, data: Object): void; - } - - interface FunctionStateSaveParams { - (settings: SettingsLegacy, data: Object): void; - } - - //#endregion "callback-functions" - - //#region "language-settings" - - // these are all optional - interface LanguageSettings { - emptyTable?: string; - info?: string; - infoEmpty?: string; - infoFiltered?: string; - infoPostFix?: string; - thousands?: string; - lengthMenu?: string; - loadingRecords?: string; - processing?: string; - search?: string; - zeroRecords?: string; - paginate?: LanguagePaginateSettings; - aria?: LanguageAriaSettings; - url?: string; - } - - interface LanguagePaginateSettings { - first: string; - last: string; - next: string; - previous: string; - } - - interface LanguageAriaSettings { - sortAscending: string; - sortDescending: string; - } - - //#endregion "language-settings" - - //#endregion "Settings" - - //#region "SettingsLegacy" - - interface ArrayStringNode { - [index: string]: Node; - } - - export interface SettingsLegacy { - ajax: any; - oApi: any; - oFeatures: FeaturesLegacy; - oScroll: ScrollingLegacy; - oLanguage: LanguageLegacy; // | { fnInfoCallback: FunctionInfoCallback; }; - oBrowser: BrowserLegacy; - aanFeatures: ArrayStringNode[][]; - aoData: RowLegacy[]; - aIds: any; - aiDisplay: number[]; - aiDisplayMaster: number[]; - aoColumns: ColumnLegacy[]; - aoHeader: any[]; - aoFooter: any[]; - asDataSearch: string[]; - oPreviousSearch: any; - aoPreSearchCols: any[]; - aaSorting: any[][]; - aaSortingFixed: any[][]; - asStripeClasses: string[]; - asDestroyStripes: string[]; - sDestroyWidth: number; - aoRowCallback: FunctionRowCallback[]; - aoHeaderCallback: FunctionHeaderCallback[]; - aoFooterCallback: FunctionFooterCallback[]; - aoDrawCallback: FunctionDrawCallback[]; - aoRowCreatedCallback: FunctionCreateRow[]; - aoPreDrawCallback: FunctionPreDrawCallback[]; - aoInitComplete: FunctionInitComplete[]; - aoStateSaveParams: FunctionStateSaveParams[]; - aoStateLoadParams: FunctionStateLoadParams[]; - aoStateLoaded: FunctionStateLoaded[]; - sTableId: string; - nTable: Node; - nTHead: Node; - nTFoot: Node; - nTBody: Node; - nTableWrapper: Node; - bDeferLoading: boolean; - bInitialized: boolean; - aoOpenRows: any[]; - sDom: string; - sPaginationType: string; - iCookieDuration: number; - sCookiePrefix: string; - fnCookieCallback: CookieCallbackLegacy; - aoStateSave: FunctionStateSaveCallback[]; - aoStateLoad: FunctionStateLoadCallback[]; - oLoadedState: any; - sAjaxSource: string; - sAjaxDataProp: string; - bAjaxDataGet: boolean; - jqXHR: any; - fnServerData: any; - aoServerParams: any[]; - sServerMethod: string; - fnFormatNumber: FunctionFormatNumber; - aLengthMenu: any[]; - iDraw: number; - bDrawing: boolean; - iDrawError: number; - _iDisplayLength: number; - _iDisplayStart: number; - _iDisplayEnd: number; - _iRecordsTotal: number; - _iRecordsDisplay: number; - bJUI: boolean; - oClasses: any; - bFiltered: boolean; - bSorted: boolean; - bSortCellsTop: boolean; - oInit: any; - aoDestroyCallback: any[]; - fnRecordsTotal: () => number; - fnRecordsDisplay: () => number; - fnDisplayEnd: () => number; - oInstance: any; - sInstance: string; - iTabIndex: number; - nScrollHead: Node; - nScrollFoot: Node; - rowIdFn: (mSource: string | number | Function) => Function; - } - - export interface BrowserLegacy { - barWidth: number, - bBounding: boolean, - bScrollbarLeft: boolean, - bScrollOversize: boolean - } - - export interface FeaturesLegacy { - bAutoWidth: boolean; - bDeferRender: boolean; - bFilter: boolean; - bInfo: boolean; - bLengthChange: boolean; - bPaginate: boolean; - bProcessing: boolean; - bServerSide: boolean; - bSort: boolean; - bSortClasses: boolean; - bStateSave: boolean; - } - - export interface ScrollingLegacy { - bAutoCss: boolean; - bCollapse: boolean; - bInfinite: boolean; - iBarWidth: number; - iLoadGap: number; - sX: string; - sY: string; - } - - export interface RowLegacy { - nTr: Node; - _aData: any; - _aSortData: any[]; - _anHidden: Node[]; - _sRowStripe: string; - } - - export interface ColumnLegacy { - aDataSort: any; - asSorting: string[]; - bSearchable: boolean; - bSortable: boolean; - bVisible: boolean; - _bAutoType: boolean; - fnCreatedCell: FunctionColumnCreatedCell; - fnGetData: (data: any, specific: string) => any; - fnSetData: (data: any, value: any) => void; - mData: any; - mRender: any; - nTh: Node; - nIf: Node; - sClass: string; - sContentPadding: string; - sDefaultContent: string; - sName: string; - sSortDataType: string; - sSortingClass: string; - sSortingClassJUI: string; - sTitle: string; - sType: string; - sWidth: string; - sWidthOrig: string; - } - - export interface CookieCallbackLegacy { - (name: string, data: any, expires: string, path: string, cookie: string): void; - } - - export interface LanguageLegacy { - oAria?: LanguageAriaLegacy; - oPaginate?: LanguagePaginateLegacy; - sEmptyTable?: string; - sInfo?: string; - sInfoEmpty?: string; - sInfoFiltered?: string; - sInfoPostFix?: string; - sInfoThousands?: string; - sLengthMenu?: string; - sLoadingRecords?: string; - sProcessing?: string; - sSearch?: string; - sUrl?: string; - sZeroRecords?: string; - } - - export interface LanguageAriaLegacy { - sSortAscending?: string; - sSortDescending?: string; - } - - export interface LanguagePaginateLegacy { - sFirst?: string; - sLast?: string; - sNext?: string; - sPrevious?: string; - } - //#endregion "SettingsLegacy" - -} diff --git a/daterangepicker/index.d.ts b/daterangepicker/index.d.ts deleted file mode 100644 index d78e06dd97..0000000000 --- a/daterangepicker/index.d.ts +++ /dev/null @@ -1,183 +0,0 @@ -// Type definitions for Date Range Picker v2.1.19 -// Project: http://www.daterangepicker.com/ -// Definitions by: SirMartin -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// -import moment = require("moment"); - -declare global { - interface JQuery { - daterangepicker(settings?: daterangepicker.Settings): JQuery; - daterangepicker(settings?: daterangepicker.Settings, callback?: (start?: string | Date | moment.Moment, end?: string | Date | moment.Moment, label?: string) => any): JQuery; - } -} - -declare namespace daterangepicker { - - interface DatepickerEventObject extends JQueryEventObject { - date: Date; - format(format?: string): string; - } - - interface Settings { - /** - * The start of the initially selected date range - */ - startDate?: string | moment.Moment | Date; - /** - * The end of the initially selected date range - */ - endDate?: string | moment.Moment | Date; - /** - * The earliest date a user may select - */ - minDate?: string | moment.Moment | Date; - /** - * The latest date a user may select - */ - maxDate?: string | moment.Moment | Date; - /** - * The maximum span between the selected start and end dates. Can have any property you can add to a moment object (i.e. days, months) - */ - dateLimit?: any; - /** - * Show year and month select boxes above calendars to jump to a specific month and year - */ - showDropdowns?: boolean; - /** - * Show localized week numbers at the start of each week on the calendars - */ - showWeekNumbers?: boolean; - /** - * Show ISO week numbers at the start of each week on the calendars - */ - showISOWeekNumbers?: boolean; - /** - * Allow selection of dates with times, not just dates - */ - timePicker?: boolean; - /** - * Increment of the minutes selection list for times (i.e. 30 to allow only selection of times ending in 0 or 30) - */ - timePickerIncrement?: number; - /** - * Use 24- hour instead of 12- hour times, removing the AM/ PM selection. - */ - timePicker24Hour?: boolean; - /** - * Show seconds in the timePicker. - */ - timePickerSeconds?: boolean; - /** - * Set predefined date ranges the user can select from.Each key is the label for the range, and its value an array with two dates representing the bounds of the range. - */ - ranges?: any; - /** - * (string: 'left'/'right'/'center') Whether the picker appears aligned to the left, to the right, or centered under the HTML element it's attached to - */ - opens?: string; - /** - * (string: 'down' or 'up') Whether the picker appears below (default) or above the HTML element it's attached to - */ - drops?: string; - /** - * CSS class names that will be added to all buttons in the picker - */ - buttonClasses?: string[]; - /** - * CSS class string that will be added to the apply button - */ - applyClass?: string; - /** - * CSS class string that will be added to the cancel button - */ - cancelClass?: string; - /** - * Allows you to provide localized strings for buttons and labels, customize the date display format, and change the first day of week for the calendars. - */ - locale?: Locale; - /** - * Show only a single calendar to choose one date, instead of a range picker with two calendars; the start and end dates provided to your callback will be the same single date chosen. - */ - singleDatePicker?: boolean; - /** - * Hide the apply and cancel buttons, and automatically apply a new date range as soon as two dates or a predefined range is selected. - */ - autoApply?: boolean; - /** - * When enabled, the two calendars displayed will always be for two sequential months (i.e.January and February), and both will be advanced when clicking the left or right arrows above the calendars.When disabled, the two calendars can be individually advanced and display any month/ year. - */ - linkedCalendars?: boolean; - /** - * jQuery selector of the parent element that the date range picker will be added to, if not provided this will be 'body' - */ - parentEl?: string; - /** - * A function that is passed each date in the two calendars before they are displayed, and may return true or false to indicate whether that date should be available for selection or not. - */ - isInvalidDate?(startDate: string | moment.Moment | Date, endDate?: string | moment.Moment | Date): boolean; - /** - * Indicates whether the date range picker should automatically update the value of an < input > element it's attached to at initialization and when the selected dates change. - */ - autoUpdateInput?: boolean; - /** - * Normally, if you use the ranges option to specify pre- defined date ranges, calendars for choosing a custom date range are not shown until the user clicks "Custom Range".When this option is set to true, the calendars for choosing a custom date range are always shown instead. - */ - alwaysShowCalendars?: boolean; - /** - * Whether to show the 'Custom Range' label or just pre-defined ranges - */ - showCustomRangeLabel?: boolean; - } - - interface Locale { - /** - * Text for cancel label. - */ - cancelLabel?: string; - /** - * Text for apply label. - */ - applyLabel?: string; - /** - * Text for fromLabel label. - */ - fromLabel?: string; - /** - * Text for toLabel label. - */ - toLabel?: string; - /** - * Format of the date string. example: 'YYYY-MM-DD' - */ - format?: string; - /** - * Separator between the startDate and endDate in the attached input element. Example: ' - ' - */ - separator?: string; - /** - * Text for the week label. - */ - weekLabel?: string; - /** - * Text for the custom range label. - */ - customRangeLabel?: string; - /** - * The first day of the week (0-6, Sunday to Saturday). - */ - firstDay?: number; - /** - * Weekday names displayed in the header of calendar. - */ - daysOfWeek?: string[]; - /** - * Month names used in the month select boxes. - */ - monthNames?: string[]; - } -} - -export = daterangepicker; -export as namespace daterangepicker; diff --git a/debounce/debounce-tests.ts b/debounce/debounce-tests.ts deleted file mode 100644 index 14d7cab190..0000000000 --- a/debounce/debounce-tests.ts +++ /dev/null @@ -1,13 +0,0 @@ - -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/index.d.ts b/debounce/index.d.ts deleted file mode 100644 index 43b1630689..0000000000 --- a/debounce/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Type definitions for compose-function -// Project: https://github.com/component/debounce -// Definitions by: Denis Sokolov -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - - -// Overload on boolean constants would allow us to narrow further, -// but it is not implemented for TypeScript yet -declare function f(f: A, interval?: number, immediate?: boolean): A -export default f; diff --git a/decay/tslint.json b/decay/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/decay/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/decimal.js/index.d.ts b/decimal.js/index.d.ts deleted file mode 100644 index 16f7839448..0000000000 --- a/decimal.js/index.d.ts +++ /dev/null @@ -1,765 +0,0 @@ -// Type definitions for decimal.js -// Project: http://mikemcl.github.io/decimal.js -// Definitions by: Joseph Rossi -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare var Decimal: decimal.IDecimalStatic; - -// Support AMD require -declare module 'decimal.js' { - export = Decimal; -} - -declare namespace decimal { - - enum RoundingMode { - /** - * Rounds away from zero - */ - ROUND_UP = 0, - - /** - * Rounds towards zero - */ - ROUND_DOWN = 1, - - /** - * Rounds towards Infinity - */ - ROUND_CEIL = 2, - - /** - * Rounds towards -Infinity - */ - ROUND_FLOOR = 3, - - /** - * Rounds towards nearest neighbour. - * If equidistant, rounds away from zero - */ - ROUND_HALF_UP = 4, - - /** - * Rounds towards nearest neighbour. - * If equidistant, rounds towards zero - */ - ROUND_HALF_DOWN = 5, - - /** - * Rounds towards nearest neighbour. - * If equidistant, rounds towards even neighbour - */ - ROUND_HALF_EVEN = 6, - - /** - * Rounds towards nearest neighbour. - * If equidistant, rounds towards Infinity - */ - ROUND_HALF_CEIL = 7, - - /** - * Rounds towards nearest neighbour. - * If equidistant, rounds towards -Infinity - */ - ROUND_HALF_FLOOR = 8, - - /** - * Not a rounding mode, see modulo - */ - EUCLID = 9, - } - - interface IFormatConfig { - decimalSeparator?: string; - groupSeparator?: string; - groupSize?: number; - secondaryGroupSize?: number; - fractionGroupSeparator?: string; - fractionGroupSize?: number; - } - - interface IDecimalConfig { - /** - * number: integer, 1 to 1e+9 inclusive - * Default value: 20 - * - * The maximum number of significant digits of the result of a calculation or base conversion. - * - * All methods which return a Decimal will round the return value to precision significant digits except absoluteValue, ceil, floor, negated, round, toDecimalPlaces, toNearest and truncated. - * - * A Decimal constructor will also not round to precision unless a base is specified. - */ - precision?: number; - - /** - * number: integer, 0 to 8 inclusive - * Default value: 4 (ROUND_HALF_UP) - * - * The default rounding mode used when rounding the result of a calculation or base conversion to precision significant digits, and when rounding the return value of the round, toDecimalPlaces, toExponential, toFixed, toFormat, toNearest, toPrecision and toSignificantDigits methods. - * - * The rounding modes are available as enumerated properties of the constructor. - */ - rounding?: RoundingMode; - - /** - * number: integer, -9e15 to 0 inclusive - * Default value: -7 - * - * The negative exponent value at and below which toString returns exponential notation. - * @type {[type]} - */ - toExpNeg?: number; - - /** - * number: integer, 0 to 9e15 inclusive - * Default value: 20 - * - * The positive exponent value at and above which toString returns exponential notation. - */ - toExpPos?: number; - - /** - * number: integer, -9e15 to 0 inclusive - * Default value: -9e15 - * - * The negative exponent limit, i.e. the exponent value below which underflow to zero occurs. - * - * If the Decimal to be returned by a calculation would have an exponent lower than minE then its value becomes zero. - * - * JavaScript numbers underflow to zero for exponents below -324. - */ - minE?: number; - - /** - * number: integer, 0 to 9e15 inclusive - * Default value: 9e15 - * - * The positive exponent limit, i.e. the exponent value above which overflow to Infinity occurs. - * - * If the Decimal to be returned by a calculation would have an exponent higher than maxE then its value becomes Infinity. - * - * JavaScript numbers overflow to Infinity for exponents above 308. - */ - maxE?: number; - - /** - * boolean/number: true, false, 1 or 0 - * Default value: true - * - * The value that determines whether Decimal Errors are thrown. If errors is false, this library will not throw errors. - */ - errors?: boolean | number; - - /** - * boolean/number: true, false, 1 or 0 - * Default value: false - * - * The value that determines whether cryptographically-secure pseudo-random number generation is used. - * - * If crypto is truthy then the random method will generate random digits using crypto.getRandomValues in browsers that support it, or crypto.randomBytes if using a version of Node.js that supports it. - * - * If neither function is supported by the host environment or if crypto is falsey then the source of randomness will be Math.random. If the crypto property is set directly (i.e. without using config) to true, then at the time the random method is called, if errors is true, an error will be thrown if the crypto methods are unavailable. - */ - crypto?: boolean | number; - - /** - * number: integer, 0 to 9 inclusive - * Default value: 1 (ROUND_DOWN) - * - * The modulo mode used when calculating the modulus: a mod n. - * - * The quotient, q = a / n, is calculated according to the rounding mode that corresponds to the chosen modulo mode. - * - * The remainder, r, is calculated as: r = a - n * q. - * - * The modes that are most commonly used for the modulus/remainder operation are ROUND_UP, ROUND_DOWN, ROUND_FLOOR, ROUND_HALF_EVEN, and EUCLID. Although the other rounding modes can be used, they may not give useful results. - */ - modulo?: RoundingMode; - - /** - * The format object configures the format of the string returned by the toFormat method. - * - * The example below shows the properties of the format object that are recognised, and their default values. - * - * Unlike setting other properties using config, the values of the properties of the format object will not be checked for validity. The existing format object will simply be replaced by the object that is passed in. Only the toFormat method ever references a Decimal constructor's format object property. - * - * See toFormat for examples of usage, and of setting format properties individually and directly without using config. - */ - format?: IFormatConfig; - } - - interface IDecimalStatic extends IDecimalConfig { - (value: number | string | Decimal, base?: number): Decimal; - - new(value: number | string | Decimal, base?: number): Decimal; - - /** - * Configures the 'global' settings for this particular Decimal constructor. - * - * Returns this Decimal constructor. - */ - config(object: IDecimalConfig): IDecimalStatic; - - /** - * Returns a new independent Decimal constructor with configuration settings as described by object - */ - constructor(object: IDecimalConfig): IDecimalStatic; - - /** - * Returns a new Decimal whose value is the base e (Euler's number, the base of the natural logarithm) exponential of the value of this Decimal, rounded to precision significant digits using rounding mode rounding. - */ - exp(n: number | string | Decimal): Decimal; - - /** - * Returns a new Decimal whose value is the natural logarithm of the value of this Decimal, rounded to precision significant digits using rounding mode rounding. - * - * The natual logarithm is the inverse of the exponential function. - */ - ln(n: number | string | Decimal): Decimal; - - /** - * Returns a new Decimal whose value is the base n logarithm of the value of this Decimal, rounded to precision significant digits using rounding mode rounding. - * - * If n is null or undefined, then the base 10 logarithm of the value of this Decimal will be returned. - */ - log(n: number | string | Decimal, base?: number): Decimal; - - /** - * Returns a new Decimal whose value is the maximum of arg1, arg2,... . - */ - max(...args: any[]): Decimal; - - /** - * Returns a new Decimal whose value is the minimum of arg1, arg2,... . - */ - min(...args: any[]): Decimal; - - /** - * Reverts the Decimal variable to the value it had before this library was loaded and returns a reference to the original Decimal constructor so it can be assigned to a variable with a different name. - */ - noConflict(): IDecimalStatic; - - /** - * Returns a new Decimal whose value is the value of this Decimal raised to the power n, rounded to precision significant digits using rounding mode rounding. - * - * The performance of this method degrades exponentially with increasing digits. For non-integer exponents in particular, the performance of this method may not be adequate. - */ - pow(base: number | string | Decimal, exponent: number | string | Decimal): Decimal; - - /** - * Returns a new Decimal with a pseudo-random value equal to or greater than 0 and less than 1. The return value will have dp decimal places (or less if trailing zeros are produced). If dp is omitted then the number of decimal places will default to the current precision setting. - * - * Depending on the value of a Decimal constructor's crypto property and the support for the crypto object in the host environment, the random digits of the return value are generated by either Math.random (fastest), crypto.getRandomValues (Web Cryptography API in recent browsers) or crypto.randomBytes (Node.js). - * - * If crypto is true, i.e. one of the crypto methods is to be used, the value of a returned Decimal should be cryptographically-secure and statistically indistinguishable from a random value. - */ - random(dp?: number): Decimal; - - /** - * The return value will be correctly rounded, i.e. rounded as if the result was first calculated to an infinite number of correct digits before rounding. - * - * This method is much faster than using the toPower method with an exponent of 0.5. - */ - sqrt(arg: number | string | Decimal): Decimal; - - /** - * A Decimal instance with value one. - */ - ONE: number; - - /** - * Rounds away from zero - */ - ROUND_UP: number; - - /** - * Rounds towards zero - */ - ROUND_DOWN: number; - - /** - * Rounds towards Infinity - */ - ROUND_CEIL: number; - - /** - * Rounds towards -Infinity - */ - ROUND_FLOOR: number; - - /** - * Rounds towards nearest neighbour. - * If equidistant, rounds away from zero - */ - ROUND_HALF_UP: number; - - /** - * Rounds towards nearest neighbour. - * If equidistant, rounds towards zero - */ - ROUND_HALF_DOWN: number; - - /** - * Rounds towards nearest neighbour. - * If equidistant, rounds towards even neighbour - */ - ROUND_HALF_EVEN: number; - - /** - * Rounds towards nearest neighbour. - * If equidistant, rounds towards Infinity - */ - ROUND_HALF_CEIL: number; - - /** - * Rounds towards nearest neighbour. - * If equidistant, rounds towards -Infinity - */ - ROUND_HALF_FLOOR: number; - - /** - * Not a rounding mode, see modulo - */ - EUCLID: number; - } - - interface Decimal { - - /** - * Returns a new Decimal whose value is the absolute value, i.e. the magnitude, of the value of this Decimal. - * - * The return value is not rounded. - */ - absoluteValue(): Decimal; - - /** - * Returns a new Decimal whose value is the absolute value, i.e. the magnitude, of the value of this Decimal. - * - * The return value is not rounded. - */ - abs(): Decimal; - - /** - * Returns a new Decimal whose value is the value of this Decimal rounded to a whole number in the direction of positive Infinity. - * - * The return value is not rounded to precision. - */ - ceil(): Decimal; - - /** - * @return 1, -1, 0, or null - * 1 If the value of this Decimal is greater than the - * value of n - * -1 If the value of this Decimal is less than the value - * of n - * 0 If this Decimal and n have the same value - * null If the value of either this Decimal or n is NaN - */ - comparedTo(n: number | string | Decimal, base?: number): number; - - /** - * Returns 1, -1, 0, or null - * 1 If the value of this Decimal is greater than the value - * of n - * -1 If the value of this Decimal is less than the value - * of n - * 0 If this Decimal and n have the same value - * null If the value of either this Decimal or n is NaN - */ - cmp(n: number | string | Decimal, base?: number): number; - - /** - * Returns the number of decimal places, i.e. the number of digits after the decimal point, of the value of this Decimal. - */ - decimalPlaces(): number; - - /** - * Returns the number of decimal places, i.e. the number of digits after the decimal point, of the value of this Decimal. - */ - dp(): number; - - /** - * Returns a new Decimal whose value is the value of this Decimal divided by n, rounded to precision significant digits using rounding mode rounding. - */ - dividedBy(n: number | string | Decimal, base?: number): Decimal; - - /** - * Returns a new Decimal whose value is the value of this Decimal divided by n, rounded to precision significant digits using rounding mode rounding. - */ - div(n: number | string | Decimal, base?: number): Decimal; - - /** - * Return a new Decimal whose value is the integer part of dividing this Decimal by n, rounded to precision significant digits using rounding mode rounding. - */ - dividedToIntegerBy(n: number | string| Decimal, base?: number): Decimal; - - /** - * Return a new Decimal whose value is the integer part of dividing this Decimal by n, rounded to precision significant digits using rounding mode rounding. - */ - divToInt(n: number | string| Decimal, base?: number): Decimal; - - /** - * Returns true if the value of this Decimal equals the value of n, otherwise returns false. - * - * As with JavaScript, NaN does not equal NaN. - * - * Note: This method uses the cmp method internally. - */ - equals(n: number | string | Decimal, base?: number): boolean; - - /** - * Returns true if the value of this Decimal equals the value of n, otherwise returns false. - * - * As with JavaScript, NaN does not equal NaN. - * - * Note: This method uses the cmp method internally. - */ - eq(n: number | string | Decimal, base?: number): boolean; - - /** - * Returns a new Decimal whose value is the base e (Euler's number, the base of the natural logarithm) exponential of the value of this Decimal, rounded to precision significant digits using rounding mode rounding. - */ - exponential(): Decimal; - - /** - * Returns a new Decimal whose value is the base e (Euler's number, the base of the natural logarithm) exponential of the value of this Decimal, rounded to precision significant digits using rounding mode rounding. - */ - exp(): Decimal; - - /** - * The return value is not rounded to precision. - */ - floor(): Decimal; - - - /** - * Note: This method uses cmp method internally. - */ - greaterThan(n: number | string | Decimal, base?: number): boolean; - - /** - * Note: This method uses cmp method internally. - */ - gt(n: number | string | Decimal, base?: number): boolean; - - /** - * Note: This method uses cmp method internally. - */ - greaterThanOrEqualTo(n: number | string | Decimal, base?: number): boolean; - - /** - * Note: This method uses cmp method internally. - */ - gte(n: number | string | Decimal, base?: number): boolean; - - /** - * The only possible non-finite values of a Decimal are NaN, Infinity and -Infinity. - */ - isFinite(): boolean; - - isInteger(): boolean; - - isInt(): boolean; - - isNaN(): boolean; - - isNegative(): boolean; - - isNeg(): boolean; - - isZero(): boolean; - - /** - * Note: This method uses cmp method internally. - */ - lessThan(n: number | string | Decimal, base?: number): boolean; - - /** - * Note: This method uses cmp method internally. - */ - lt(n: number | string | Decimal, base?: number): boolean; - - /** - * Note: This method uses cmp method internally. - */ - lessThanOrEqualTo(n: number | string | Decimal, base?: number): boolean; - - /** - * Note: This method uses cmp method internally. - */ - lte(n: number | string | Decimal, base?: number): boolean; - - /** - * Returns a new Decimal whose value is the base n logarithm of the value of this Decimal, rounded to precision significant digits using rounding mode rounding. - * - * If n is null or undefined, then the base 10 logarithm of the value of this Decimal will be returned. - */ - logarithm(n?: number | string | Decimal, base?: number): Decimal; - - /** - * Returns a new Decimal whose value is the base n logarithm of the value of this Decimal, rounded to precision significant digits using rounding mode rounding. - * - * If n is null or undefined, then the base 10 logarithm of the value of this Decimal will be returned. - */ - log(n?: number | string | Decimal, base?: number): Decimal; - - /** - * Returns a new Decimal whose value is the value of this Decimal minus n, rounded to precision significant digits using rounding mode rounding. - */ - minus(n: number | string | Decimal, base?: number): Decimal; - - /** - * Returns a new Decimal whose value is the value of this Decimal modulo n, rounded to precision significant digits using rounding mode rounding. - * - * The value returned, and in particular its sign, is dependent on the value of the modulo property of this Decimal's constructor. If it is 1 (default value), the result will have the same sign as this Decimal, and it will match that of Javascript's % operator (within the limits of double precision) and BigDecimal's remainder method. - */ - modulo(n: number | string | Decimal, base?: number): Decimal; - - /** - * Returns a new Decimal whose value is the value of this Decimal modulo n, rounded to precision significant digits using rounding mode rounding. - * - * The value returned, and in particular its sign, is dependent on the value of the modulo property of this Decimal's constructor. If it is 1 (default value), the result will have the same sign as this Decimal, and it will match that of Javascript's % operator (within the limits of double precision) and BigDecimal's remainder method. - */ - mod(n: number | string | Decimal, base?: number): Decimal; - - /** - * Returns a new Decimal whose value is the natural logarithm of the value of this Decimal, rounded to precision significant digits using rounding mode rounding. - * - * The natual logarithm is the inverse of the exponential function. - */ - naturalLogarithm(): Decimal; - - /** - * Returns a new Decimal whose value is the natural logarithm of the value of this Decimal, rounded to precision significant digits using rounding mode rounding. - * - * The natual logarithm is the inverse of the exponential function. - */ - ln(): Decimal; - - /** - * The return value is not rounded. - */ - negated(): Decimal; - - /** - * The return value is not rounded. - */ - neg(): Decimal; - - /** - * Returns a new Decimal whose value is the value of this Decimal plus n, rounded to precision significant digits using rounding mode rounding. - */ - plus(n: number | string | Decimal, base?: number): Decimal; - - /** - * If include_zeros is true or 1 then any trailing zeros of the integer part of a number are counted as significant digits, otherwise they are not. - */ - precision(include_leading_zeros?: boolean | number): number; - - /** - * If include_zeros is true or 1 then any trailing zeros of the integer part of a number are counted as significant digits, otherwise they are not. - */ - sd(include_leading_zeros?: boolean | number): number; - - round(): Decimal; - - /** - * The return value will be correctly rounded, i.e. rounded as if the result was first calculated to an infinite number of correct digits before rounding. - * - * This method is much faster than using the toPower method with an exponent of 0.5. - */ - squareRoot(): Decimal; - - /** - * The return value will be correctly rounded, i.e. rounded as if the result was first calculated to an infinite number of correct digits before rounding. - * - * This method is much faster than using the toPower method with an exponent of 0.5. - */ - sqrt(): Decimal; - - /** - * Returns a new Decimal whose value is the value of this Decimal times n, rounded to precision significant digits using rounding mode rounding. - */ - times(n: number | string | Decimal, base?: number): Decimal; - - /** - * Returns a new Decimal whose value is the value of this Decimal rounded to dp decimal places using rounding mode rm. - * - * If dp is omitted or is null or undefined, the return value will have the same value as this Decimal. - * - * If rm is omitted or is null or undefined, rounding mode rounding is used. - */ - toDecimalPlaces(dp?: number, rm?: RoundingMode): Decimal; - - /** - * Returns a new Decimal whose value is the value of this Decimal rounded to dp decimal places using rounding mode rm. - * - * If dp is omitted or is null or undefined, the return value will have the same value as this Decimal. - * - * If rm is omitted or is null or undefined, rounding mode rounding is used. - */ - toDP(dp?: number, rm?: RoundingMode): Decimal; - - /** - * Returns a string representing the value of this Decimal in exponential notation rounded using rounding mode rm to dp decimal places, i.e with one digit before the decimal point and dp digits after it. - * - * If the value of this Decimal in exponential notation has fewer than dp fraction digits, the return value will be appended with zeros accordingly. - * - * If dp is omitted, or is null or undefined, the number of digits after the decimal point defaults to the minimum number of digits necessary to represent the value exactly. - * - * If rm is omitted or is null or undefined, rounding mode rounding is used. - */ - toExponential(dp?: number, rm?: RoundingMode): string; - - /** - * Returns a string representing the value of this Decimal in normal (fixed-point) notation rounded to dp decimal places using rounding mode rm. - * - * If the value of this Decimal in normal notation has fewer than dp fraction digits , the return value will be appended with zeros accordingly. - * - * Unlike Number.prototype.toFixed, which returns exponential notation if a number is greater or equal to 1021, this method will always return normal notation. - * - * If dp is omitted or is null or undefined, then the return value will be unrounded and in normal notation. This is unlike Number.prototype.toFixed, which returns the value to zero decimal places, but is useful when because of the current toExpNeg or toExpNeg values, toString returns exponential notation - * - * if rm is omitted or is null or undefined, rounding mode rounding is used. - */ - toFixed(dp?: number, rm?: RoundingMode): string; - - /** - * Returns a string representing the value of this Decimal in fixed-point notation rounded to dp decimal places using rounding mode rm (as toFixed), and formatted according to the properties of this Decimal's constructor's format object property. - * - * See the examples below for the properties of the format object, their types and their usage. - * - * If dp is omitted or is null or undefined, then the return value is not rounded to a fixed number of decimal places. - * - * if rm is omitted or is null or undefined, rounding mode rounding is used. - */ - toFormat(dp?: number, rm?: RoundingMode): string; - - /** - * Returns a string array representing the value of this Decimal as a simple fraction with an integer numerator and an integer denominator. The denominator will be a positive non-zero value less than or equal to max_denominator. - * - * If a maximum denominator is not specified, or is null or undefined, the denominator will be the lowest value necessary to represent the number exactly. - */ - toFraction(max_denominator?: number | string | Decimal): string[]; - - toJSON(): string; - - /** - * Returns a new Decimal whose value is the nearest multiple of n to the value of this Decimal. - * - * If the value of this Decimal is equidistant from two multiples of n, the rounding mode rm, or rounding if rm is omitted or is null or undefined, determines the direction of the nearest. - * - * In this context, rounding mode ROUND_HALF_UP is interpreted the same as rounding mode ROUND_UP, and so on. I.e. the rounding is either up, own, to ceil, to floor or to even. - * - * The return value will always have the same sign as this Decimal, unless either this Decimal or n is NaN, in which case the return value will be also be NaN. - * - * The return value is not rounded to precision. - */ - toNearest(n: number | string | Decimal, rm?: RoundingMode): Decimal; - - /** - * Returns the value of this Decimal converted to a number primitive. - * - * Type coercion with, for example, JavaScript's unary plus operator will also work, except that a Decimal with the value minus zero will convert to positive zero. - */ - toNumber(): number; - - /** - * Returns a new Decimal whose value is the value of this Decimal raised to the power n, rounded to precision significant digits using rounding mode rounding. - * - * The performance of this method degrades exponentially with increasing digits. For non-integer exponents in particular, the performance of this method may not be adequate. - */ - toPower(n: number | string | Decimal, base?: number): Decimal; - - /** - * Returns a new Decimal whose value is the value of this Decimal raised to the power n, rounded to precision significant digits using rounding mode rounding. - * - * The performance of this method degrades exponentially with increasing digits. For non-integer exponents in particular, the performance of this method may not be adequate. - */ - pow(n: number | string | Decimal, base?: number): Decimal; - - /** - * Returns a string representing the value of this Decimal rounded to sd significant digits using rounding mode rm. - * - * If sd is less than the number of digits necessary to represent the integer part of the value in normal (fixed-point) notation, then exponential notation is used. - * - * If sd is omitted or is null or undefined, then the return value is the same as toString. - * - * if rm is omitted or is null or undefined, rounding mode rounding is used. - */ - toPrecision(sd?: number, rm?: RoundingMode): string; - - /** - * Returns a new Decimal whose value is the value of this Decimal rounded to sd significant digits using rounding mode rm. - * - * If sd is omitted or is null or undefined, the return value will be rounded to precision significant digits. - * - * if rm is omitted or is null or undefined, rounding mode rounding will be used. - */ - toSignificantDigits(sd?: number, rm?: RoundingMode): Decimal; - - /** - * Returns a new Decimal whose value is the value of this Decimal rounded to sd significant digits using rounding mode rm. - * - * If sd is omitted or is null or undefined, the return value will be rounded to precision significant digits. - * - * if rm is omitted or is null or undefined, rounding mode rounding will be used. - */ - toSD(sd?: number, rm?: RoundingMode): Decimal; - - /** - * base: number: integer, 2 to 64 inclusive - * - * Returns a string representing the value of this Decimal in the specified base, or base 10 if base is omitted or is null or undefined. - * - * For bases above 10, values from 10 to 35 are represented by a-z (as with Number.prototype.toString), 36 to 61 by A-Z, and 62 and 63 by $ and _ respectively. - * - * If a base is specified the value is rounded to precision significant digits using rounding mode rounding. - * - * If a base is not specified and this Decimal has a positive exponent that is equal to or greater than toExpPos, or a negative exponent equal to or less than toExpNeg, then exponential notation is returned. - * - * If base is null or undefined it is ignored. - */ - toString(base?: number): string; - - /** - * Returns a new Decimal whose value is the value of this Decimal truncated to a whole number. - * - * The return value is not rounded to precision. - */ - truncated(): Decimal; - - /** - * Returns a new Decimal whose value is the value of this Decimal truncated to a whole number. - * - * The return value is not rounded to precision. - */ - trunc(): Decimal; - - /** - * As toString, but does not accept a base argument. - */ - valueOf(): string; - - /** - * coefficient - * - * Array of integers, each 0 - 1e7 - */ - c: number[]; - - /** - * exponent - * - * Integer, -9e15 to 9e15 inclusive - */ - e: number; - - /** - * sign - * - * -1 or 1 - */ - s: number; - } -} diff --git a/deep-equal/tslint.json b/deep-equal/tslint.json deleted file mode 100644 index f9e30021f4..0000000000 --- a/deep-equal/tslint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../tslint.json" -} diff --git a/deep-freeze-strict/tslint.json b/deep-freeze-strict/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/deep-freeze-strict/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/deepmerge/index.d.ts b/deepmerge/index.d.ts deleted file mode 100644 index bf70f62e46..0000000000 --- a/deepmerge/index.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -// Type definitions for deepmerge 1.3 -// Project: https://github.com/KyleAMathews/deepmerge -// Definitions by: marvinscharle -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export = deepmerge; - -declare function deepmerge(x: T, y: T, options?: deepmerge.Options): T; - -declare namespace deepmerge { - interface Options { - clone?: boolean; - arrayMerge?: (destination: T, source: T, options?: Options) => T; - } - - function all(objects: T[], options?: Options): T; -} \ No newline at end of file diff --git a/deepmerge/tslint.json b/deepmerge/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/deepmerge/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/del/tslint.json b/del/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/del/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/detect-browser/index.d.ts b/detect-browser/index.d.ts deleted file mode 100644 index 0f845cd781..0000000000 --- a/detect-browser/index.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -// Type definitions for detect-browser v1.3.3 -// Project: https://github.com/DamonOehlman/detect-browser -// Definitions by: Rogier Schouten -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/** - * Browser name - */ -export const name: string; - -/** - * Browser version - */ -export const version: string; diff --git a/devextreme/README.md b/devextreme/README.md deleted file mode 100644 index 0a2c4ecabf..0000000000 --- a/devextreme/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# DevExtreme TypeScript definitions # - -You can use DevExtreme TypeScript definitions to add DevExtreme widgets ([UI widgets](http://js.devexpress.com/Documentation/ApiReference/UI_Widgets) and [Data Visualization widgets](http://js.devexpress.com/Documentation/ApiReference/Data_Visualization_Widgets)) to your TypeScript apps, as well as build [DevExtreme single-page applications](http://js.devexpress.com/Documentation/Howto/SPA_Framework/Application_Design) using TypeScript. To do that, simply add at the top of your code. - -The API enclosed into the DevExtreme TypeScript definition file fully corresponds to the API described in the DevExtreme JavaScript [Reference](http://js.devexpress.com/Documentation/ApiReference) documentation. - -To build applications based on the DevExtreme SPA framework in Visual Studio, use TypeScript [application templates](http://js.devexpress.com/Documentation/Howto/VS_Integration/Project_Templates) integrated into Visual Studio. - -If you have any issues while using the DevExtreme TypeScript definitions, please refer to our [Support Center](https://www.devexpress.com/Support/Center/Question/List/1). diff --git a/devextreme/devextreme-tests.ts b/devextreme/devextreme-tests.ts deleted file mode 100644 index 8d9bd5bc5b..0000000000 --- a/devextreme/devextreme-tests.ts +++ /dev/null @@ -1,320 +0,0 @@ - - -namespace Tests.ui { - var dataGridOptions: DevExpress.ui.dxDataGridOptions = { - activeStateEnabled: true, - allowColumnReordering: true, - allowColumnResizing: true, - onCellClick: function() { }, - cellHintEnabled: true, - columnAutoWidth: true, - columnChooser: { - emptyPanelText: "Nothing is here", - enabled: true, - height: 400, - width: 200, - title: "Column chooser" - }, - columns: [ - { - alignment: "center", - allowFixing: true, - allowEditing: true, - allowFiltering: true, - allowGrouping: true, - allowHiding: true, - allowReordering: true, - allowResizing: true, - allowSearch: true, - allowSorting: true, - autoExpandGroup: true, - calculateCellValue: function(rowData: Object) { return "test-value"; }, - calculateFilterExpression: function(filterValue: any, selectedFilterOperation: string) { return []; }, - caption: "Test column", - cellTemplate: function(container: JQuery, options: Object) { $("
    Template").appendTo(container); }, - cssClass: "test-ccs-class-name", - customizeText: function(cellInfo: { value: any, valueText: string; }) { return "New text" }, - dataField: "Test", - dataType: "string", - encodeHtml: true, - falseText: "FALSE", - filterOperations: ["contains", "notcontains"], - filterType: "exclude", - filterValue: "Test-filter-value", - fixed: true, - fixedPosition: "right", - groupIndex: 0, - lookup: { - allowClearing: true, - dataSource: ["first", "second"], - displayExpr: "this", - valueExpr: "this" - }, - name: "test-column-name", - showEditorAlways: true, - showInColumnChooser: true, - showWhenGrouped: true, - sortIndex: 1, - sortOrder: "desc", - trueText: "TRUE", - visible: true, - visibleIndex: 0, - width: "100%" - } - ], - customizeColumns: function(columns) { - var i: number; - for (i = 0; i < columns.length; i++) { - if (columns[i].dataField.indexOf('Date') > 0) { - columns[i].dataType = 'date'; - } - - if (columns[i].dataField === 'Freight') { - columns[i].dataType = 'number'; - } - - if (columns[i].dataField === 'CustomerID') { - columns[i].lookup = { - dataSource: { store: [], sort: 'ContactName' }, - valueExpr: 'CustomerID', - displayExpr: 'ContactName' - } - } - if (columns[i].dataField === 'EmployeeID') { - columns[i].lookup = { - dataSource: { store: [], sort: 'LastName' }, - valueExpr: 'EmployeeID', - displayExpr: function(data: any) { - return data.LastName + ' ' + data.FirstName; - } - } - } - if (columns[i].dataField === 'ShipVia') { - columns[i].lookup = { - dataSource: [ - { ShipperID: 1, CompanyName: 'Speedy Express' }, - { ShipperID: 2, CompanyName: 'United Package' }, - { ShipperID: 3, CompanyName: 'Federal Shipping' } - ], - valueExpr: 'ShipperID', - displayExpr: 'CompanyName' - } - } - if (columns[i].dataField === 'ShipCity') { - columns[i].editCellTemplate = function(container: JQuery, options: { value: string; setValue: Function }) { - $('

    ').dxAutocomplete({ - dataSource: ["Bern", "Lyon", "Lander"], - value: options.value, - onValueChanged: function() { - options.setValue("test-value"); - } - }).appendTo(container); - } - } - } - }, - summary: { - totalItems: [{ - column: 'CustomerID', - summaryType: 'count' - }, { - column: 'Freight', - summaryType: 'min', - valueFormat: "percent", - showInColumn: "CustomerID" - }, - { - column: 'OrderDate', - summaryType: 'min', - valueFormat: "shortDate" - }, - { - column: 'Freight', - summaryType: 'avg', - valueFormat: "fixedPoint", - precision: 2 - }], - groupItems: [{ - column: 'CustomerID', - summaryType: 'count', - showInGroupFooter: true - }, { - column: 'Freight', - summaryType: 'min' - }, { - column: 'Freight', - summaryType: 'max' - }, - { - column: 'ShipName', - summaryType: 'count', - showInGroupFooter: true - }, - { - column: 'OrderDate', - summaryType: 'min', - valueFormat: "shortDate", - showInColumn: "CustomerID", - showInGroupFooter: true - }] - }, - sortByGroupSummaryInfo: [{ summaryItem: 'count' }], - groupPanel: { - visible: true - }, - filterRow: { - visible: true - }, - pager: { - visible: true, - showInfo: true, - showNavigationButtons: true, - showPageSizeSelector: true - }, - stateStoring: { - enabled: false - }, - rowAlternationEnabled: true, - editing: { - editMode: 'batch', - insertEnabled: true, - editEnabled: true, - removeEnabled: true - }, - searchPanel: { - visible: true - }, - sorting: { - mode: 'multiple' - } - }; - - new DevExpress.ui.dxDataGrid($("#data-grid"), dataGridOptions); - new DevExpress.ui.dxDataGrid($("#data-grid").get(0), dataGridOptions); - $("#data-grid").dxDataGrid(dataGridOptions); -} - -namespace Tests.viz { - var chartOptions: DevExpress.viz.charts.dxChartOptions = { - dataSource: [ - { arg: "Illinois", s1: 100, s2: 50, s3: 75, s4: 25, s5: 50, s6: 100, s7: 25, s8: 75 }, - { arg: "Indiana", s1: 100, s2: 50, s3: 75, s4: 25, s5: 50, s6: 100, s7: 25, s8: 75 }, - { arg: "Michigan", s1: 100, s2: 50, s3: 75, s4: 25, s5: 50, s6: 100, s7: 25, s8: 75 } - ], - valueAxis: [{ title: 'Value Axis Title' }], - argumentAxis: { title: 'Argument Axis Title', grid: { visible: true } }, - legend: { border: { visible: true } }, - tooltip: { enabled: true }, - commonPaneSettings: { border: { visible: true } }, - commonSeriesSettings: { - type: 'bar', - hoverMode: 'allArgumentPoints', - selectionMode: 'allArgumentPoints', - label: { - visible: true, - format: 'fixedPoint', - precision: 2 - } - }, - series: [ - { valueField: 's1' }, - { valueField: 's2' }, - { valueField: 's3' }, - { valueField: 's4' }, - { valueField: 's5' }, - { valueField: 's6' }, - { valueField: 's7' }, - { valueField: 's8' } - ], - title: 'Long Chart\'s Title', - onPointClick: function(arg: any) { - arg.target.isSelected() ? arg.target.clearSelection() : arg.target.select(); - }, - onSeriesClick: function(arg: any) { - arg.target.isVisible() ? arg.target.hide() : arg.target.show(); - } - }; - - var pieChartOptions: DevExpress.viz.charts.dxPieChartOptions = { - dataSource: [{ arg: "Index1", arg1: 1, val: 100 }, - { arg: "Index2", arg1: 2, val: 50 }, - { arg: "Index3", arg1: 3, val: 75 }, - { arg: "Index4", arg1: 4, val: 25 }, - { arg: "Index5", arg1: 5, val: 50 }, - { arg: "Index6", arg1: 6, val: 100 }, - { arg: "Index7", arg1: 7, val: 25 }, - { arg: "Index8", arg1: 8, val: 75 }], - tooltip: { - enabled: true - }, - series: [{ - type: 'doughnut', - label: { - visible: true, - format: 'fixedPoint', - precision: 2 - } - }], - title: 'Long PieChart\'s Title' - }; - - new DevExpress.viz.dxChart($("chart"), chartOptions); - new DevExpress.viz.dxChart($("#chart").get(0), chartOptions); - $("#chart").dxChart(chartOptions); - - new DevExpress.viz.dxPieChart($("#pie-chart"), pieChartOptions); - new DevExpress.viz.dxPieChart($("#pie-chart").get(0), pieChartOptions); - $("#pie-chart").dxPieChart(pieChartOptions); -} - -namespace Tests.framework { - var app = new DevExpress.framework.html.HtmlApplication({ - namespace: "Application", - navigation: [ - { - title: "Home", - action: "#home", - icon: "home" - }, - { - title: "About", - action: "#about", - icon: "info" - } - ] - }); - - app.router.register(":view/:id", { view: "home", id: undefined }); - app.navigate(); -} - -namespace Tests.data { - new DevExpress.data.DataSource({ - sort: ["value", true], - group: ["id", false], - select: ["value"], - filter: ["value", "startswith", "first"], - - pageSize: 25, - paginate: true, - - map: function(item) { return item; }, - postProcess: function(data) { return data; }, - searchExpr: "expr", - searchOperation: "contains", - searchValue: "somevalue", - store: [1, 2, 3] - }); - - new DevExpress.data.ArrayStore(); - new DevExpress.data.ArrayStore({ - data: [{ id: 1, value: "First one" }, { id: 2, value: "Second one" }], - key: "id" - }); - - new DevExpress.data.CustomStore({ - load: function() { - return $.Deferred().promise(); - } - }); -} diff --git a/devextreme/index.d.ts b/devextreme/index.d.ts deleted file mode 100644 index e327800618..0000000000 --- a/devextreme/index.d.ts +++ /dev/null @@ -1,7985 +0,0 @@ -// Type definitions for DevExtreme 16.2.4 -// Project: http://js.devexpress.com/ -// Definitions by: DevExpress Inc. -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -interface 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; -} -interface 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; -} -interface 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; -} -interface 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; -} -interface 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; -} -interface 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; -} -interface 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; -} -interface 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; -} -interface 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; -} -interface 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; -} -interface 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; -} -interface JQuery { - dxDeferRendering(): JQuery; - dxDeferRendering(options: "instance"): DevExpress.ui.dxDeferRendering; - dxDeferRendering(options: string): any; - dxDeferRendering(options: string, ...params: any[]): any; - dxDeferRendering(options: DevExpress.ui.dxDeferRenderingOptions): JQuery; -} -interface 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; -} -interface JQuery { - dxForm(): JQuery; - dxForm(options: "instance"): DevExpress.ui.dxForm; - dxForm(options: string): any; - dxForm(options: string, ...params: any[]): any; - dxForm(options: DevExpress.ui.dxFormOptions): JQuery; -} -interface 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; -} -interface 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; -} -interface 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; -} -interface 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; -} -interface 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; -} -interface 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; -} -interface 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; -} -interface 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; -} -interface 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; -} -interface 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; -} -interface 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; -} -interface 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; -} -interface 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; -} -interface 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; -} -interface 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; -} -interface 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; -} -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; -} -interface 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; -} -interface 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; -} -interface 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; -} -interface 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; -} -interface 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; -} -interface 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; -} -interface 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; -} -interface 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; -} -interface JQuery { - dxSlideOutView(): JQuery; - dxSlideOutView(options: "instance"): DevExpress.ui.dxSlideOutView; - dxSlideOutView(options: string): any; - dxSlideOutView(options: string, ...params: any[]): any; - dxSlideOutView(options: DevExpress.ui.dxSlideOutViewOptions): JQuery; -} -interface 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; -} -interface 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; -} -interface 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; -} -interface 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; -} -interface 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; -} -interface 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; -} -interface 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; -} -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; -} -interface 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; -} -interface 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; -} -interface 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; -} -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; -} -interface JQuery { - dxValidationGroup(): JQuery; - dxValidationGroup(options: "instance"): DevExpress.ui.dxValidationGroup; - dxValidationGroup(options: string): any; - dxValidationGroup(options: string, ...params: any[]): any; - dxValidationGroup(options: DevExpress.ui.dxValidationGroupOptions): JQuery; -} -interface JQuery { - dxValidationSummary(): JQuery; - dxValidationSummary(options: "instance"): DevExpress.ui.dxValidationSummary; - dxValidationSummary(options: string): any; - dxValidationSummary(options: string, ...params: any[]): any; - dxValidationSummary(options: DevExpress.ui.dxValidationSummaryOptions): JQuery; -} -interface 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; -} -interface JQuery { - dxBarGauge(): JQuery; - dxBarGauge(options: "instance"): DevExpress.viz.dxBarGauge; - dxBarGauge(options: string): any; - dxBarGauge(options: string, ...params: any[]): any; - dxBarGauge(options: DevExpress.viz.gauges.dxBarGaugeOptions): JQuery; -} -interface JQuery { - dxBullet(): JQuery; - dxBullet(options: "instance"): DevExpress.viz.dxBullet; - dxBullet(options: string): any; - dxBullet(options: string, ...params: any[]): any; - dxBullet(options: DevExpress.viz.sparklines.dxBulletOptions): JQuery; -} -interface JQuery { - dxChart(): JQuery; - dxChart(options: "instance"): DevExpress.viz.dxChart; - dxChart(options: string): any; - dxChart(options: string, ...params: any[]): any; - dxChart(options: DevExpress.viz.charts.dxChartOptions): JQuery; -} -interface JQuery { - dxCircularGauge(): JQuery; - dxCircularGauge(options: "instance"): DevExpress.viz.dxCircularGauge; - dxCircularGauge(options: string): any; - dxCircularGauge(options: string, ...params: any[]): any; - dxCircularGauge(options: DevExpress.viz.gauges.dxCircularGaugeOptions): JQuery; -} -interface JQuery { - dxLinearGauge(): JQuery; - dxLinearGauge(options: "instance"): DevExpress.viz.dxLinearGauge; - dxLinearGauge(options: string): any; - dxLinearGauge(options: string, ...params: any[]): any; - dxLinearGauge(options: DevExpress.viz.gauges.dxLinearGaugeOptions): JQuery; -} -interface JQuery { - dxPieChart(): JQuery; - dxPieChart(options: "instance"): DevExpress.viz.dxPieChart; - dxPieChart(options: string): any; - dxPieChart(options: string, ...params: any[]): any; - dxPieChart(options: DevExpress.viz.charts.dxPieChartOptions): JQuery; -} -interface JQuery { - dxPolarChart(): JQuery; - dxPolarChart(options: "instance"): DevExpress.viz.dxPolarChart; - dxPolarChart(options: string): any; - dxPolarChart(options: string, ...params: any[]): any; - dxPolarChart(options: DevExpress.viz.charts.dxPolarChartOptions): JQuery; -} -interface JQuery { - dxRangeSelector(): JQuery; - dxRangeSelector(options: "instance"): DevExpress.viz.dxRangeSelector; - dxRangeSelector(options: string): any; - dxRangeSelector(options: string, ...params: any[]): any; - dxRangeSelector(options: DevExpress.viz.rangeSelector.dxRangeSelectorOptions): JQuery; -} -interface JQuery { - dxSparkline(): JQuery; - dxSparkline(options: "instance"): DevExpress.viz.dxSparkline; - dxSparkline(options: string): any; - dxSparkline(options: string, ...params: any[]): any; - dxSparkline(options: DevExpress.viz.sparklines.dxSparklineOptions): JQuery; -} -interface JQuery { - dxTreeMap(): JQuery; - dxTreeMap(options: "instance"): DevExpress.viz.dxTreeMap; - dxTreeMap(options: string): any; - dxTreeMap(options: string, ...params: any[]): any; - dxTreeMap(options: DevExpress.viz.treeMap.dxTreeMapOptions): JQuery; -} -interface JQuery { - dxVectorMap(): JQuery; - dxVectorMap(options: "instance"): DevExpress.viz.dxVectorMap; - dxVectorMap(options: string): any; - dxVectorMap(options: string, ...params: any[]): any; - dxVectorMap(options: DevExpress.viz.map.dxVectorMapOptions): JQuery; -} -declare module DevExpress { - /** Formats values. */ - export interface Format { - /** Specifies a predefined format. */ - type?: String; - /** Specifies the currency code for the 'currency' format. */ - currency?: String; - /** Specifies a precision for values of a numeric format. */ - precision?: number; - /** Parses string values into numeric or date-time values. */ - parser?: (value: any) => any; - /** Specifies a custom format. */ - formatter?: (value: any) => any; - } - /** 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 Validator objects extending fields of the specified ViewModel. */ - export function registerModelForValidation(model: Object): void; - /** Unregisters all the Validator objects extending fields of the specified ViewModel. */ - export function unregisterModelForValidation(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. * @deprecated Use the config(config) method instead. */ - export var rtlEnabled: boolean; - /** Gets the current global configuration object. */ - export function config(): Object; - /** Sets the global configuration object. */ - export function config(config: Object): void; - /** Registers a new component in the DevExpress.ui namespace as a jQuery plugin, AngularJS directive and Knockout binding. */ - export function registerComponent(name: string, componentClass: Object): void; - /** Registers a new component in the specified namespace as a jQuery plugin, AngularJS directive and Knockout binding. */ - export function registerComponent(name: string, namespace: Object, componentClass: Object): void; - export function requestAnimationFrame(callback: Function): number; - export function cancelAnimationFrame(requestID: number): void; - /** Custom Knockout binding that links an HTML element with a specific action. */ - export class Action { } - /** An object used to manage OData endpoints in your application. */ - export class EndpointSelector { - constructor(options: { - [key: string]: { - local?: string; - production?: string; - } - }); - /** Returns an endpoint for the specified key. */ - 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 easing function for animation. */ - easing?: string; - /** Specifies the initial animation state. */ - from?: any; - /** A function called before animation is started. */ - start?: (element: JQuery, config: AnimationOptions) => void; - /** Specifies a final animation state. */ - to?: any; - /** A string value specifying the animation type. */ - type?: string; - /** Specifies the animation direction for the "slideIn" and "slideOut" animation types. */ - direction?: string; - } - /** Animates the specified element. */ - export function animate(element: HTMLElement, config: AnimationOptions): Object; - /** Returns a value indicating whether the specified element is being animated. */ - export function isAnimating(element: HTMLElement): boolean; - /** Stops the animation. */ - export function stop(element: HTMLElement, jumpToEnd: boolean): void; - } - /** The manager that performs several specified animations at a time. */ - export class TransitionExecutor { - /** Deletes all the animations registered in the Transition Executor by using the enter(elements, animation) and leave(elements, animation) methods. */ - reset(): void; - /** Registers a set of elements that should be animated as "entering" using the specified animation configuration. */ - enter(elements: JQuery, animation: any): void; - /** Registers a set of elements that should be animated as "leaving" using the specified animation configuration. */ - leave(elements: JQuery, animation: any): void; - /** Starts all the animations registered using the enter(elements, animation) and leave(elements, animation) methods beforehand. */ - start(config: Object): JQueryPromise; - /** Stops all started animations. */ - stop(): void; - } - export class AnimationPresetCollection { - /** Resets all the changes made in the animation repository. */ - resetToDefaults(): void; - /** Deletes the specified animation or clears all the animation repository, if an animation name is not passed. */ - clear(name: string): void; - /** Adds the specified animation preset to the animation repository by the specified name. */ - registerPreset(name: string, config: any): void; - /** Applies the changes made in the animation repository. */ - applyChanges(): void; - /** Returns the configuration of the animation found in the animation repository by the specified name for the current device. */ - getPreset(name: string): void; - /** Registers predefined animations in the animation repository. */ - registerDefaultPresets(): void; - } - /** A repository of animations. */ - export var animationPresets: AnimationPresetCollection; - /** The device object defines the device on which the application is running. */ - export interface Device { - /** Indicates whether or not the device platform is Android. */ - android?: boolean; - /** Specifies the type of the device on which the application is running. */ - deviceType?: string; - /** Indicates whether or not the device platform is generic, which means that the application will look and behave according to a generic "light" or "dark" theme. */ - generic?: boolean; - /** Indicates whether or not the device platform is iOS. */ - ios?: boolean; - /** Indicates whether or not the device type is 'phone'. */ - phone?: boolean; - /** Specifies the platform of the device on which the application is running. */ - platform?: string; - /** Indicates whether or not the device type is 'tablet'. */ - tablet?: boolean; - /** Specifies an array with the major and minor versions of the device platform. */ - version?: Array; - /** Indicates whether or not the device platform is Windows. */ - win?: boolean; - /** Specifies a performance grade of the current device. */ - grade?: string; - } - export class Devices implements EventsMixin { - constructor(options: { window: Window }); - /** Overrides actual device information to force the application to operate as if it was running on a 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?: any; - /** The element within which the widget is positioned. */ - boundary?: any; - /** Specifies the horizontal and vertical offset from the window's boundaries. */ - boundaryOffset?: any; - /** 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?: any; - /** The target element that the widget is positioned against. */ - of?: any; - /** Specifies horizontal and vertical offset in pixels. */ - offset?: any; - } - 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; - /** Specifies the attributes to be attached to the widget's root element. */ - elementAttr?: Object; - /** A bag for holding any options that require two-way binding (Angular approach specific) */ - bindingOptions?: { [key: string]: any; }; - } - /** A base class for all components. */ - export class DOMComponent extends Component { - constructor(element: JQuery, options?: DOMComponentOptions); - constructor(element: HTMLElement, options?: DOMComponentOptions); - /** Returns the root HTML element of the widget. */ - element(): JQuery; - /** Specifies the device-dependent default configuration options for this component. */ - static defaultOptions(rule: { - device?: any; - options?: any; - }): void; - } - export module data { - export interface ODataError extends Error { - httpStatus?: number; - errorDetails?: any; - } - export interface StoreOptions { - /** A handler for the modified event. */ - onModified?: () => void; - /** A handler for the modifying event. */ - onModifying?: () => void; - /** A handler for the removed event. */ - onRemoved?: (key: any) => void; - /** A handler for the removing event. */ - onRemoving?: (key: any) => void; - /** A handler for the updated event. */ - onUpdated?: (key: any, values: Object) => void; - /** A handler for the updating event. */ - onUpdating?: (key: any, values: Object) => void; - /** A handler for the loaded event. */ - onLoaded?: (result: Array) => void; - /** A handler for the loading event. */ - onLoading?: (loadOptions: LoadOptions) => void; - /** A handler for the inserted event. */ - onInserted?: (values: Object, key: any) => void; - /** A handler for the inserting event. */ - onInserting?: (values: Object) => void; - /** Specifies the function called when the Store causes an error. */ - errorHandler?: (e: Error) => void; - /** Specifies the key properties within the data associated with the Store. */ - key?: any; - } - export interface LoadOptions { - searchValue?: Object; - searchExpr?: Object; - searchOperation?: Object; - filter?: Object; - sort?: Object; - select?: Object; - expand?: Object; - group?: Object; - skip?: number; - take?: number; - userData?: Object; - requireTotalCount?: boolean; - } - /** The base class for all Stores. */ - export class Store implements EventsMixin { - constructor(options?: StoreOptions); - /** Returns the data item specified by the key. */ - byKey(key: any): JQueryPromise; - /** Adds an item to the data associated with this Store. */ - insert(values: Object): JQueryPromise; - /** Returns the key expression specified via the key configuration option. */ - key(): any; - /** Returns the key of the Store item that matches the specified object. */ - keyOf(obj: Object): any; - /** Starts loading data. */ - load(obj?: LoadOptions): JQueryPromise; - /** Removes the data item specified by the key. */ - remove(key: any): JQueryPromise; - /** Obtains the total count of items that will be returned by the load() function. */ - totalCount(options?: { - filter?: Object; - group?: Object; - }): JQueryPromise; - /** Updates the data item specified by the key. */ - update(key: any, values: Object): JQueryPromise; - on(eventName: "removing", eventHandler: (key: any) => void): Store; - on(eventName: "removed", eventHandler: (key: any) => void): Store; - on(eventName: "updating", eventHandler: (key: any, values: Object) => void): Store; - on(eventName: "updated", eventHandler: (key: any, values: Object) => void): Store; - on(eventName: "inserting", eventHandler: (values: Object) => void): Store; - on(eventName: "inserted", eventHandler: (values: Object, key: any) => void): Store; - on(eventName: "modifying", eventHandler: () => void): Store; - on(eventName: "modified", eventHandler: () => void): Store; - on(eventName: "loading", eventHandler: (loadOptions: LoadOptions) => void): Store; - on(eventName: "loaded", eventHandler: (result: Array) => void): Store; - on(eventName: string, eventHandler: Function): Store; - on(events: { [eventName: string]: Function; }): Store; - off(eventName: "removing"): Store; - off(eventName: "removed"): Store; - off(eventName: "updating"): Store; - off(eventName: "updated"): Store; - off(eventName: "inserting"): Store; - off(eventName: "inserted"): Store; - off(eventName: "modifying"): Store; - off(eventName: "modified"): Store; - off(eventName: "loading"): Store; - off(eventName: "loaded"): Store; - off(eventName: string): Store; - off(eventName: "removing", eventHandler: (key: any) => void): Store; - off(eventName: "removed", eventHandler: (key: any) => void): Store; - off(eventName: "updating", eventHandler: (key: any, values: Object) => void): Store; - off(eventName: "updated", eventHandler: (key: any, values: Object) => void): Store; - off(eventName: "inserting", eventHandler: (values: Object) => void): Store; - off(eventName: "inserted", eventHandler: (values: Object, key: any) => void): Store; - off(eventName: "modifying", eventHandler: () => void): Store; - off(eventName: "modified", eventHandler: () => void): Store; - off(eventName: "loading", eventHandler: (loadOptions: LoadOptions) => void): Store; - off(eventName: "loaded", eventHandler: (result: Array) => void): Store; - off(eventName: string, eventHandler: Function): Store; - } - export interface ArrayStoreOptions extends StoreOptions { - /** Specifies the array associated with this Store. */ - data?: Array; - } - /** A Store accessing an in-memory array. */ - export class ArrayStore extends Store { - constructor(options?: ArrayStoreOptions); - /** Clears all data associated with the current ArrayStore. */ - clear(): void; - /** Creates the Query object for the underlying array. */ - createQuery(): Query; - } - interface Promise { - then(doneFn?: Function, failFn?: Function, progressFn?: Function): Promise; - } - export interface CustomStoreOptions extends StoreOptions { - /** Specifies whether or not the store combines the search expression with the filter expression. */ - useDefaultSearch?: boolean; - /** 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; - /** The bag of custom parameters passed to the query executed when the DataSource load operation is invoked. */ - customQueryParams?: 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; - } - export interface OperationPromise extends JQueryPromise { - operationId: number; - } - /** An object that provides access to a data web service or local data storage for collection container widgets. */ - export class DataSource implements EventsMixin { - constructor(url: string); - constructor(data: Array); - constructor(options: CustomStoreOptions); - constructor(options: DataSourceOptions); - /** Disposes all resources associated with this DataSource. */ - dispose(): void; - /** Returns the current filter option value. */ - filter(): Object; - /** Sets the filter option value. */ - filter(filterExpr: Object): void; - /** Returns the current group option value. */ - group(): Object; - /** Sets the group option value. */ - group(groupExpr: Object): void; - /** Indicates whether or not the current page contains fewer items than the number of items specified by the pageSize configuration option. */ - isLastPage(): boolean; - /** Indicates whether or not at least one load() method execution has successfully finished. */ - isLoaded(): boolean; - /** Indicates whether or not the DataSource is currently being loaded. */ - isLoading(): boolean; - /** Returns the array of items currently operated by the DataSource. */ - items(): Array; - /** Returns the key expression specified by the key configuration option of the underlying Store. */ - key(): any; - /** Starts loading data. */ - load(): OperationPromise>; - /** Clears currently loaded DataSource items and calls the load() method. */ - reload(): OperationPromise>; - /** Returns an object that would be passed to the load() method of the underlying Store according to the current data shaping option values of the current DataSource instance. */ - loadOptions(): Object; - /** Returns the current pageSize option value. */ - 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; - /** Cancels the load operation associated with the specified identifier. */ - cancel(operationId: number): boolean; - on(eventName: "loadingChanged", eventHandler: (isLoading: boolean) => void): DataSource; - on(eventName: "loadError", eventHandler: (e?: Error) => void): DataSource; - on(eventName: "changed", eventHandler: () => void): DataSource; - on(eventName: string, eventHandler: Function): DataSource; - on(events: { [eventName: string]: Function; }): DataSource; - off(eventName: "loadingChanged"): DataSource; - off(eventName: "loadError"): DataSource; - off(eventName: "changed"): DataSource; - off(eventName: string): DataSource; - off(eventName: "loadingChanged", eventHandler: (isLoading: boolean) => void): DataSource; - off(eventName: "loadError", eventHandler: (e?: Error) => void): DataSource; - off(eventName: "changed", eventHandler: () => void): DataSource; - off(eventName: string, eventHandler: Function): DataSource; - } - /** An object used to work with primitive data types not supported by JavaScript when accessing an OData web service. */ - export class EdmLiteral { - /** Creates an EdmLiteral instance and assigns the specified value to it. */ - constructor(value: string); - /** Returns a string representation of the value associated with this EdmLiteral object. */ - valueOf(): string; - } - /** An object used to generate and hold the GUID. */ - export class Guid { - /** Creates a new Guid instance that holds the specified GUID. */ - constructor(value: string); - /** Creates a new Guid instance holding the generated GUID. */ - constructor(); - /** Returns a string representation of the Guid instance. */ - toString(): string; - /** Returns a string representation of the Guid instance. */ - valueOf(): string; - } - export interface LocalStoreOptions extends ArrayStoreOptions { - /** Specifies the time (in miliseconds) after the change operation, before the data is flushed. */ - flushInterval?: number; - /** Specifies whether the data is flushed immediatelly after each change operation, or after the delay specified via the flushInterval option. */ - immediate?: boolean; - /** The unique identifier used to distinguish the data within the HTML5 Web Storage. */ - name?: string; - } - /** A Store providing access to the HTML5 Web Storage. */ - export class LocalStore extends ArrayStore { - constructor(options?: LocalStoreOptions); - /** Removes all data associated with this Store. */ - clear(): void; - } - export interface ODataContextOptions extends ODataStoreOptions { - /** Specifies the list of entities to be accessed via the ODataContext. */ - entities?: Object; - /** Specifies the function called if the ODataContext causes an error. */ - errorHandler?: (e: Error) => void; - } - /** Provides access to the entire OData service. */ - export class ODataContext { - constructor(options?: ODataContextOptions); - /** Initiates the specified WebGet service operation that returns a value. For the information on service operations, refer to the OData documentation. */ - get(operationName: string, params: Object): JQueryPromise; - /** Initiates the specified WebGet service operation that returns nothing. For the information on service operations, refer to the OData documentation. */ - invoke(operationName: string, params: Object, httpMethod: Object): JQueryPromise; - /** Return a special proxy object to describe the entity link. */ - objectLink(entityAlias: string, key: any): Object; - } - export interface ODataStoreOptions extends StoreOptions { - /** A function used to customize a web request before it is sent. */ - beforeSend?: (request: { - url: string; - async: boolean; - method: string; - timeout: number; - params: Object; - payload: Object; - headers: Object; - }) => void; - /** Specifies whether the ODataStore uses the JSONP approach to access non-CORS-compatible remote services. */ - jsonp?: boolean; - /** Specifies the type of the ODataStore key property. The following key types are supported out of the box: String, Int32, Int64, Boolean, Single, Decimal and Guid. */ - keyType?: any; - /** Specifies whether or not dates in a response are deserialized. */ - deserializeDates?: boolean; - /** Specifies the URL of the data service being accessed via the current ODataContext. */ - url?: string; - /** Specifies the version of the OData protocol used to interact with the data service. */ - version?: number; - /** Specifies the value of the withCredentials field of the underlying jqXHR object. */ - withCredentials?: boolean; - } - /** A Store providing access to a separate OData web service entity. */ - export class ODataStore extends Store { - constructor(options?: ODataStoreOptions); - /** Creates the Query object for the OData endpoint. */ - createQuery(loadOptions: Object): Object; - /** Returns the data item specified by the key. */ - byKey(key: any, extraOptions?: { expand?: Object }): JQueryPromise; - } - /** An universal chainable data query interface object. */ - export interface Query { - /** Calculates a custom summary for the items in the current Query. */ - aggregate(step: (accumulator: any, value: any) => any): JQueryPromise; - /** Calculates a custom summary for the items in the current Query. */ - aggregate(seed: any, step: (accumulator: any, value: any) => any, finalize: (result: any) => any): JQueryPromise; - /** Calculates the average item value for the current Query. */ - avg(getter: Object): JQueryPromise; - /** Finds the item with the maximum getter value. */ - max(getter: Object): JQueryPromise; - /** Finds the item with the maximum value in the Query. */ - max(): JQueryPromise; - /** Finds the item with the minimum value in the Query. */ - min(): JQueryPromise; - /** Finds the item with the minimum getter value. */ - min(getter: Object): JQueryPromise; - /** Calculates the average item value for the current Query, if each Query item has a numeric type. */ - avg(): JQueryPromise; - /** Returns the total count of items in the current Query. */ - count(): JQueryPromise; - /** Executes the Query. */ - enumerate(): JQueryPromise; - /** Filters the current Query data. */ - filter(criteria: Array): Query; - /** Filters the current Query data. */ - filter(predicate: (item: any) => boolean): Query; - /** Groups the current Query data. */ - groupBy(getter: Object): Query; - /** Applies the specified transformation to each item. */ - select(getter: Object): Query; - /** Limits the data item count. */ - slice(skip: number, take?: number): Query; - /** Sorts current Query data. */ - sortBy(getter: Object, desc: boolean): Query; - /** Sorts current Query data. */ - sortBy(getter: Object): Query; - /** Calculates the sum of item getter values in the current Query. */ - sum(getter: Object): JQueryPromise; - /** Calculates the sum of item values in the current Query. */ - sum(): JQueryPromise; - /** Adds one more sorting condition to the current Query. */ - thenBy(getter: Object): Query; - /** Adds one more sorting condition to the current Query. */ - thenBy(getter: Object, desc: boolean): Query; - /** Returns the array of current Query items. */ - toArray(): Array; - } - /** The global data layer error handler. */ - export var errorHandler: (e: Error) => void; - /** Encodes the specified string or array of bytes to base64 encoding. */ - export function base64_encode(input: any): string; - /** Creates a Query instance. */ - export function query(array: Array): Query; - /** Creates a Query instance for accessing the remote service specified by a URL. */ - export function query(url: string, queryOptions: Object): Query; - /** This section describes the utility objects provided by the DevExtreme data layer. */ - export module utils { - /** Compiles a getter function from the getter expression. */ - export function compileGetter(expr: any): Function; - /** Compiles a setter function from the setter expression. */ - export function compileSetter(expr: any): Function; - export module odata { - /** Holds key value converters for OData. */ - export module keyConverters { - export function String(value: any): string; - export function Int32(value: any): number; - export function Int64(value: any): EdmLiteral; - export function Guid(value: any): Guid; - export function Boolean(value: any): boolean; - export function Single(value: any): EdmLiteral; - export function Decimal(value: any): EdmLiteral; - } - } - } - } - /** An object that serves as a namespace for the methods that are used to localize an application. */ - export module localization { - /** Gets the current locale identifier. */ - export function locale(): string; - /** Sets the current locale identifier. */ - export function locale(locale: string): void; - /** Loads DevExtreme messages. */ - export function loadMessages(messages: any): void; - } - /** An object that serves as a namespace for DevExtreme UI widgets as well as for methods implementing UI logic in DevExtreme sites/applications. */ - export module ui { - export interface WidgetOptions extends DOMComponentOptions { - /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ - activeStateEnabled?: boolean; - /** A Boolean value specifying whether or not the widget can respond to user interaction. */ - disabled?: boolean; - /** A Boolean value specifying whether or not the widget changes its state when being hovered by an end user. */ - hoverStateEnabled?: boolean; - /** Specifies whether or not the widget can be focused. */ - focusStateEnabled?: boolean; - /** Specifies a shortcut key that sets focus on the widget element. */ - accessKey?: string; - /** A Boolean value specifying whether or not the widget is visible. */ - visible?: boolean; - /** Specifies the widget tab index. */ - tabIndex?: number; - /** Specifies the text of the hint displayed for the widget. */ - hint?: string; - } - /** The base class for widgets. */ - export class Widget extends DOMComponent { - constructor(options?: WidgetOptions); - /** Redraws the widget. */ - repaint(): void; - /** Sets focus on the widget. */ - focus(): void; - /** Registers a handler when a specified key is pressed. */ - registerKeyHandler(key: string, handler: Function): void; - } - export interface CollectionWidgetOptions extends WidgetOptions { - /** A data source used to fetch data to be displayed by the widget. */ - dataSource?: any; - /** The time period in milliseconds before the onItemHold event is raised. */ - itemHoldTimeout?: number; - /** An array of items displayed by the widget. */ - items?: Array; - /** The template to be used for rendering items. */ - itemTemplate?: any; - loopItemFocus?: boolean; - /** The text or HTML markup displayed by the widget if the item collection is empty. */ - noDataText?: string; - onContentReady?: any; - /** A handler for the itemClick event. */ - onItemClick?: any; - /** A handler for the itemContextMenu event. */ - onItemContextMenu?: Function; - /** A handler for the itemHold event. */ - onItemHold?: Function; - /** A handler for the itemRendered event. */ - onItemRendered?: Function; - /** A handler for the selectionChanged event. */ - onSelectionChanged?: Function; - /** The index of the currently selected widget item. */ - selectedIndex?: number; - /** The selected item object. */ - selectedItem?: Object; - /** An array of currently selected item objects. */ - selectedItems?: Array; - /** Specifies an array of currently selected item keys. */ - selectedItemKeys?: Array; - /** Specifies which data field provides keys for widget items. */ - keyExpr?: any; - /** A handler for the itemDeleting event. */ - onItemDeleting?: Function; - /** A handler for the itemDeleted event. */ - onItemDeleted?: Function; - /** A handler for the itemReordered event. */ - onItemReordered?: Function; - } - export interface DataHelperMixin { - /** Allows you to get the DataSource instance. */ - getDataSource(): DevExpress.data.DataSource; - } - /** The base class for widgets containing an item collection. */ - export class CollectionWidget extends Widget implements DataHelperMixin - { - 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; - getDataSource(): DevExpress.data.DataSource; - } - export interface DataExpressionMixinOptions { - /** A data source used to fetch data to be displayed by the widget. */ - dataSource?: any; - /** Specifies the name of the data source item field whose value is displayed by the widget. */ - displayExpr?: any; - /** Specifies the name of a data source item field whose value is held in the value configuration option. */ - valueExpr?: any; - /** An array of items displayed by the widget. */ - items?: Array; - /** The template to be used for rendering items. */ - itemTemplate?: any; - /** The currently selected value in the widget. */ - value?: Object; - } - export interface EditorOptions extends WidgetOptions { - /** The currently specified value. */ - value?: Object; - /** The value to be assigned to the name attribute of the underlying `` element. */ - name?: string; - /** A handler for the valueChanged event. */ - onValueChanged?: Function; - /** A Boolean value specifying whether or not the widget is read-only. */ - readOnly?: boolean; - /** Holds the object that defines the error that occurred during validation. */ - validationError?: Object; - /** Specifies whether the editor's value is valid. */ - isValid?: boolean; - /** Specifies how the message about the validation rules that are not satisfied by this editor's value is displayed. */ - validationMessageMode?: string; - } - /** A base class for editors. */ - export class Editor extends Widget { - /** Resets the editor's value to undefined. */ - reset(): void; - } - /** An object that serves as a namespace for methods displaying a message in an application/site. */ - export var dialog: { - /** Creates an alert dialog message containing a single "OK" button. */ - alert(message: string, title: string): JQueryPromise; - /** Creates a confirm dialog that contains "Yes" and "No" buttons. */ - confirm(message: string, title: string): JQueryPromise; - /** Creates a custom dialog using the options specified by the passed configuration object. */ - custom(options: { title?: string; message?: string; buttons?: Array; }): { - show(): JQueryPromise; - hide(): void; - hide(value: any): void; - }; - }; - /** Creates a toast message. */ - export function notify(message: any, type: string, displayTime: number): void; - /** Creates a toast message. */ - export function notify(options: Object): void; - /** An object that serves as a namespace for the methods that work with DevExtreme CSS Themes. */ - export var themes: { - /** Returns the name of the currently applied theme. */ - current(): string; - /** Changes the current theme to the specified one. */ - current(themeName: string): void; - }; - /** Sets a specified template engine. */ - export function setTemplateEngine(name: string): void; - /** Sets a custom template engine defined via custom compile and render functions. */ - export function setTemplateEngine(options: Object): void; - } - /** An object that serves as a namespace for utility methods that can be helpful when working with the DevExtreme framework and UI widgets. */ - export module utils { - /** Sets parameters for the viewport meta tag. */ - export function initMobileViewport(options: { allowZoom?: boolean; allowPan?: boolean; allowSelection?: boolean }): 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; - } - /** 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; - /** Allows you to export widgets using their SVG markup. */ - export function exportFromMarkup(markup: string, options: Object): 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 dxValidatorValidationAdapter { - /** A function that returns the value to be validated. */ - getValue?: Function; - /** The jQuery.Callbacks() object that is fired when the specified value should be validated. */ - validationRequestsCallbacks?: JQueryCallback; - /** A function that the Validator widget calls after validating a specified value. */ - applyValidationResults?: (params: validationEngine.ValidatorValidationResult) => void; - /** A function that resets the validated values. */ - reset?: Function; - /** A function that sets focus to the validated editors when the ValidationSummary is focused. */ - focus?: Function; - /** A function that returns a Boolean value specifying whether or not to bypass validation. */ - bypass?: Function; - } - 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?: dxValidatorValidationAdapter; - /** 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 Validator 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 Validator object. */ - reset(): void; - /** Sets focus to the editor associated with the current Validator object. */ - focus(): void; - } - export interface dxValidationGroupOptions extends DOMComponentOptions { } - /** The widget that is used in the Knockout and AngularJS approaches to combine the editors to be validated. */ - export class dxValidationGroup extends DOMComponent { - constructor(element: JQuery, options?: dxValidationGroupOptions); - constructor(element: Element, options?: dxValidationGroupOptions); - /** Validates rules of the validators that belong to the current validation group. */ - validate(): validationEngine.ValidationGroupValidationResult; - /** Resets the value and validation result of the editors that are included to the current validation group. */ - reset(): void; - } - export interface dxValidationSummaryOptions extends CollectionWidgetOptions { - /** Specifies the validation group for which summary should be generated. */ - validationGroup?: string; - } - /** A widget for displaying the result of checking validation rules for editors. */ - export class dxValidationSummary extends CollectionWidget { - constructor(element: JQuery, options?: dxValidationSummaryOptions); - constructor(element: Element, options?: dxValidationSummaryOptions); - } - export interface dxResizableOptions extends DOMComponentOptions { - /** Specifies which borders of the widget element are used as a handle. */ - handles?: string; - /** Specifies the lower width boundary for resizing. */ - minWidth?: number; - /** Specifies the upper width boundary for resizing. */ - maxWidth?: number; - /** Specifies the lower height boundary for resizing. */ - minHeight?: number; - /** Specifies the upper height boundary for resizing. */ - maxHeight?: number; - /** A handler for the resizeStart event. */ - onResizeStart?: Function; - /** A handler for the resize event. */ - onResize?: Function; - /** A handler for the resizeEnd event. */ - onResizeEnd?: Function; - } - /** A widget that displays required content in a resizable element. */ - export class dxResizable extends DOMComponent { - constructor(element: JQuery, options?: dxResizableOptions); - constructor(element: Element, options?: dxResizableOptions); - } - export interface dxTooltipOptions extends dxPopoverOptions { - } - /** A tooltip widget. */ - export class dxTooltip extends dxPopover { - constructor(element: JQuery, options?: dxTooltipOptions); - constructor(element: Element, options?: dxTooltipOptions); - } - export interface dxDropDownListOptions extends dxDropDownEditorOptions, DataExpressionMixinOptions { - /** Returns the value currently displayed by the widget. */ - displayValue?: string; - /** The minimum number of characters that must be entered into the text box to begin a search. */ - minSearchLength?: number; - /** Specifies whether or not the widget displays unfiltered values until a user types a number of characters exceeding the minSearchLength option value. */ - showDataBeforeSearch?: boolean; - /** Specifies the name of a data source item field or an expression whose value is compared to the search criterion. */ - searchExpr?: any; - /** 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 Use the DataSource paging opportunities instead. */ - 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 implements DataHelperMixin { - constructor(element: JQuery, options?: dxDropDownListOptions); - constructor(element: Element, options?: dxDropDownListOptions); - getDataSource(): DevExpress.data.DataSource; - } - export interface dxToolbarOptions extends CollectionWidgetOptions { - /** The template used to render menu items. */ - menuItemTemplate?: any; - /** Informs the widget about its location in a view HTML markup. */ - renderAs?: string; - } - /** A toolbar widget. */ - export class dxToolbar extends CollectionWidget { - constructor(element: JQuery, options?: dxToolbarOptions); - constructor(element: Element, options?: dxToolbarOptions); - } - export interface dxToastOptions extends dxOverlayOptions { - animation?: { - /** An object that defines the animation options used when the widget is being shown. */ - show?: fx.AnimationOptions; - /** An object that defines the animation options used when the widget is being hidden. */ - hide?: fx.AnimationOptions; - }; - /** The time span in milliseconds during which the Toast widget is visible. */ - displayTime?: number; - height?: any; - /** The Toast message text. */ - message?: string; - position?: PositionOptions; - shading?: boolean; - /** Specifies the Toast widget type. */ - type?: string; - width?: any; - closeOnBackButton?: boolean; - /** A Boolean value specifying whether or not the toast is closed if a user swipes it out of the screen boundaries. */ - closeOnSwipe?: boolean; - /** A Boolean value specifying whether or not the toast is closed if a user clicks it. */ - closeOnClick?: boolean; - } - /** The toast message widget. */ - export class dxToast extends dxOverlay { - constructor(element: JQuery, options?: dxToastOptions); - constructor(element: Element, options?: dxToastOptions); - } - export interface dxTextEditorOptions extends EditorOptions { - /** A handler for the change event. */ - onChange?: Function; - /** A handler for the copy event. */ - onCopy?: Function; - /** A handler for the cut event. */ - onCut?: Function; - /** A handler for the enterKey event. */ - onEnterKey?: Function; - /** A handler for the focusIn event. */ - onFocusIn?: Function; - /** A handler for the focusOut event. */ - onFocusOut?: Function; - /** A handler for the input event. */ - onInput?: Function; - /** A handler for the keyDown event. */ - onKeyDown?: Function; - /** A handler for the keyPress event. */ - onKeyPress?: Function; - /** A handler for the keyUp event. */ - onKeyUp?: Function; - /** A handler for the paste event. */ - onPaste?: Function; - /** The text displayed by the widget when the widget value is empty. */ - placeholder?: string; - /** Specifies whether to display the Clear button in the widget. */ - showClearButton?: boolean; - /** Specifies the current value displayed by the widget. */ - value?: any; - /** Specifies DOM event names that update a widget's value. */ - valueChangeEvent?: string; - /** Specifies whether or not the widget checks the inner text for spelling mistakes. */ - spellcheck?: boolean; - attr?: Object; - /** Specifies the attributes to be passed on to the underlying `` element. */ - inputAttr?: Object; - /** The read-only option that holds the text displayed by the widget input element. */ - text?: string; - focusStateEnabled?: boolean; - hoverStateEnabled?: boolean; - /** The editor mask that specifies the format of the entered string. */ - mask?: string; - /** Specifies a mask placeholder character. */ - maskChar?: string; - /** Specifies custom mask rules. */ - maskRules?: Object; - /** A message displayed when the entered text does not match the specified pattern. */ - maskInvalidMessage?: string; - /** Specifies whether the value option holds only characters entered by a user or prompt characters as well. */ - useMaskedValue?: boolean; - name?: 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; - /** Specifies the minimum height of the widget. */ - minHeight?: any; - /** Specifies the maximum height of the widget. */ - maxHeight?: any; - /** A Boolean value specifying whether or not the auto resizing mode is enabled. */ - autoResizeEnabled?: boolean; - } - /** A widget used to display and edit multi-line text. */ - export class dxTextArea extends dxTextBox { - constructor(element: JQuery, options?: dxTextAreaOptions); - constructor(element: Element, options?: dxTextAreaOptions); - } - export interface dxTabsOptions extends CollectionWidgetOptions { - /** Specifies whether the widget enables an end-user to select only a single item or multiple items. */ - selectionMode?: string; - /** Specifies whether or not an end-user can scroll tabs by swiping. */ - scrollByContent?: boolean; - /** Specifies whether or not an end-user can scroll tabs. */ - scrollingEnabled?: boolean; - /** A Boolean value that specifies the availability of navigation buttons. */ - showNavButtons?: boolean; - } - /** A tab strip used to switch between pages. */ - export class dxTabs extends CollectionWidget { - constructor(element: JQuery, options?: dxTabsOptions); - constructor(element: Element, options?: dxTabsOptions); - } - export interface dxTabPanelOptions extends dxMultiViewOptions { - /** A handler for the titleClick event. */ - onTitleClick?: any; - /** A handler for the titleHold event. */ - onTitleHold?: Function; - /** A handler for the titleRendered event. */ - onTitleRendered?: Function; - /** The template to be used for rendering an item title. */ - itemTitleTemplate?: any; - /** A Boolean value specifying if tabs in the title are scrolled by content. */ - scrollByContent?: boolean; - /** A Boolean indicating whether or not to add scrolling support for tabs in the title. */ - scrollingEnabled?: boolean; - /** A Boolean value that specifies the availability of navigation buttons. */ - showNavButtons?: boolean; - } - /** A widget used to display a view and to switch between several views by clicking the appropriate tabs. */ - export class dxTabPanel extends dxMultiView { - constructor(element: JQuery, options?: dxTabPanelOptions); - constructor(element: Element, options?: dxTabPanelOptions); - } - export interface dxSelectBoxOptions extends dxDropDownListOptions { - /** Specifies DOM event names that update a widget's value. */ - valueChangeEvent?: string; - /** The template to be used for rendering the widget text field. */ - fieldTemplate?: any; - /** The text that is provided as a hint in the select box editor. */ - placeholder?: string; - /** Specifies whether or not the widget allows an end-user to enter a custom value. */ - acceptCustomValue?: boolean; - /** Specifies whether or not to display selection controls. */ - showSelectionControls?: boolean; - /** A handler for the customItemCreating event. */ - onCustomItemCreating?: Function; - } - /** 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 { - values?: Array; - /** Specifies the selected items. */ - value?: Array; - /** Gets the currently selected items. */ - selectedItems?: Array; - /** Specifies how the widget applies values. */ - applyValueMode?: string; - /** A Boolean value specifying whether or not to hide selected items. */ - hideSelectedItems?: boolean; - /** A handler for the selectAllValueChanged event. */ - onSelectAllValueChanged?: Function; - /** A Boolean value specifying whether or not the widget is multiline. */ - multiline?: boolean; - /** A handler for the selectionChanged event. */ - onSelectionChanged?: Function; - /** The template to be used for rendering tags. */ - tagTemplate?: any; - } - /** A widget that allows you to select multiple items from a dropdown list. */ - export class dxTagBox extends dxSelectBox { - constructor(element: JQuery, options?: dxTagBoxOptions); - constructor(element: Element, options?: dxTagBoxOptions); - } - export interface dxScrollViewOptions extends dxScrollableOptions { - /** A handler for the pullDown event. */ - onPullDown?: Function; - /** Specifies the text shown in the pullDown panel when pulling the content down lowers the refresh threshold. */ - pulledDownText?: string; - /** Specifies the text shown in the pullDown panel while pulling the content down to the refresh threshold. */ - pullingDownText?: string; - /** A handler for the reachBottom event. */ - onReachBottom?: Function; - /** Specifies the text shown in the pullDown panel displayed when content is scrolled to the bottom. */ - reachBottomText?: string; - /** Specifies the text shown in the pullDown panel displayed when the content is being refreshed. */ - refreshingText?: string; - } - /** A widget used to display scrollable content. */ - export class dxScrollView extends dxScrollable { - constructor(element: JQuery, options?: dxScrollViewOptions); - constructor(element: Element, options?: dxScrollViewOptions); - /** 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; - } - export interface dxScrollableLocation { - top?: number; - left?: number; - } - export interface dxScrollableOptions extends DOMComponentOptions { - /** A string value specifying the available scrolling directions. */ - direction?: string; - /** A Boolean value specifying whether or not the widget can respond to user interaction. */ - disabled?: boolean; - /** A handler for the scroll event. */ - onScroll?: Function; - /** Specifies when the widget shows the scrollbar. */ - showScrollbar?: string; - /** A handler for the update event. */ - onUpdated?: Function; - /** Indicates whether to use native or simulated scrolling. */ - useNative?: boolean; - /** A Boolean value specifying whether to enable or disable the bounce-back effect. */ - bounceEnabled?: boolean; - /** A Boolean value specifying whether or not an end-user can scroll the widget content swiping it up or down. */ - scrollByContent?: boolean; - /** A Boolean value specifying whether or not an end-user can scroll the widget content using the scrollbar. */ - scrollByThumb?: boolean; - } - /** A widget used to display scrollable content. */ - export class dxScrollable extends DOMComponent { - constructor(element: JQuery, options?: dxScrollableOptions); - constructor(element: Element, options?: dxScrollableOptions); - /** Returns the height of the scrollable widget in pixels. */ - clientHeight(): number; - /** Returns the width of the scrollable widget in pixels. */ - clientWidth(): number; - /** Returns an HTML element of the widget. */ - content(): JQuery; - /** Scrolls the widget content by the specified number of pixels. */ - scrollBy(distance: number): void; - /** Scrolls widget content by the specified number of pixels in horizontal and vertical directions. */ - scrollBy(distanceObject: dxScrollableLocation): void; - /** Returns the height of the scrollable content in pixels. */ - scrollHeight(): number; - /** Returns the current scroll position against the leftmost position. */ - scrollLeft(): number; - /** Returns how far the scrollable content is scrolled from the top and from the left. */ - scrollOffset(): dxScrollableLocation; - /** Scrolls widget content to the specified position. */ - scrollTo(targetLocation: number): void; - /** Scrolls widget content to a specified position. */ - scrollTo(targetLocation: dxScrollableLocation): void; - /** Scrolls widget content to the specified element. */ - scrollToElement(element: Element): void; - /** Returns the current scroll position against the topmost position. */ - scrollTop(): number; - /** Returns the width of the scrollable content in pixels. */ - scrollWidth(): number; - /** Updates the dimensions of the scrollable contents. */ - update(): void; - } - export interface dxRadioGroupOptions extends EditorOptions, DataExpressionMixinOptions { - activeStateEnabled?: boolean; - /** Specifies the radio group layout. */ - layout?: string; - name?: 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 dxPopupToolbarItemOptions { - /** Specifies whether or not a toolbar item must be displayed disabled. */ - disabled?: boolean; - /** Specifies html code inserted into the toolbar item element. */ - html?: string; - /** Specifies a location for the item on the toolbar. */ - location?: string; - /** Specifies a configuration object for the widget that presents a toolbar item. */ - options?: Object; - /** Specifies an item template that should be used to render this item only. */ - template?: any; - /** Specifies text displayed for the toolbar item. */ - text?: string; - /** Specifies whether the item is displayed on a top or bottom toolbar. */ - toolbar?: string; - /** Specifies whether or not a widget item must be displayed. */ - visible?: boolean; - /** A widget that presents a toolbar item. */ - widget?: string; - } - export interface dxPopupOptions extends dxOverlayOptions { - /** Specifies whether or not to allow a user to drag the popup window. */ - dragEnabled?: boolean; - /** Specifies whether or not an end user can resize the widget. */ - resizeEnabled?: boolean; - /** 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 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. */ - toolbarItems?: 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 the animation options of the widget. */ - animation?: { - /** An object that defines the animation options used when the widget is being shown. */ - show?: fx.AnimationOptions; - /** An object that defines the animation options used when the widget is being hidden. */ - hide?: 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; - /** Specifies options for displaying the widget. */ - showEvent?: { - /** Specifies the event names on which the widget is shown. */ - name?: String; - /** The time span after which the widget is shown. */ - delay?: Number; - }; - /** Specifies options of popover hiding. */ - hideEvent?: { - /** Specifies the event names on which the widget is hidden. */ - name?: String; - /** The time span after which the popover is hidden. */ - delay?: Number; - }; - } - /** 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 defining the animation options of the widget. */ - animation?: { - /** An object that defines the animation options used when the widget is being shown. */ - show?: fx.AnimationOptions; - /** An object that defines the animation options used when the widget is being hidden. */ - hide?: 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; - /** The height of the widget in pixels. */ - height?: any; - /** Specifies the maximum height the widget can reach while resizing. */ - maxHeight?: any; - /** Specifies the maximum width the widget can reach while resizing. */ - maxWidth?: any; - /** Specifies the minimum height the widget can reach while resizing. */ - minHeight?: any; - /** Specifies the minimum width the widget can reach while resizing. */ - minWidth?: any; - /** A handler for the hidden event. */ - onHidden?: Function; - /** A handler for the hiding event. */ - onHiding?: Function; - /** An object defining widget positioning options. */ - position?: PositionOptions; - /** A Boolean value specifying whether or not the main screen is inactive while the widget is active. */ - shading?: boolean; - /** Specifies the shading color. */ - shadingColor?: string; - /** A handler for the showing event. */ - onShowing?: Function; - /** A handler for the shown event. */ - onShown?: Function; - onContentReady?: Function; - /** A Boolean value specifying whether or not the widget is visible. */ - visible?: boolean; - /** The widget width in pixels. */ - width?: any; - } - /** A widget displaying the required content in an overlay window. */ - export class dxOverlay extends Widget { - constructor(element: JQuery, options?: dxOverlayOptions); - constructor(element: Element, options?: dxOverlayOptions); - /** An HTML element of the widget. */ - content(): JQuery; - /** Hides the widget. */ - hide(): JQueryPromise; - /** Recalculates the overlay's size and position. */ - repaint(): void; - /** Shows the widget. */ - show(): JQueryPromise; - /** Toggles the visibility of the widget. */ - toggle(showing: boolean): JQueryPromise; - /** A static method that specifies the base z-index for all overlay widgets. */ - static baseZIndex(zIndex: number): void; - } - export interface dxNumberBoxOptions extends dxTextEditorOptions { - /** The maximum value accepted by the number box. */ - max?: number; - /** The minimum value accepted by the number box. */ - min?: number; - /** Specifies whether or not to show spin buttons. */ - showSpinButtons?: boolean; - useTouchSpinButtons?: boolean; - /** Specifies by which value the widget value changes when a spin button is clicked. */ - step?: number; - /** The current number box value. */ - value?: number; - /** The "mode" attribute value of the actual HTML input element representing the widget. */ - mode?: string; - /** Specifies the text of the message displayed if the specified value is not a number. */ - invalidValueMessage?: string; - } - /** A textbox widget that enables a user to enter numeric values. */ - export class dxNumberBox extends dxTextEditor { - constructor(element: JQuery, options?: dxNumberBoxOptions); - constructor(element: Element, options?: dxNumberBoxOptions); - } - export interface dxNavBarOptions extends dxTabsOptions { - scrollingEnabled?: boolean; - } - /** A widget that contains items used to navigate through application views. */ - export class dxNavBar extends dxTabs { - constructor(element: JQuery, options?: dxNavBarOptions); - constructor(element: Element, options?: dxNavBarOptions); - } - export interface dxMultiViewOptions extends CollectionWidgetOptions { - /** Specifies whether or not to animate the displayed item change. */ - animationEnabled?: boolean; - /** A Boolean value specifying whether or not to scroll back to the first item after the last item is swiped. */ - loop?: boolean; - /** The index of the currently displayed item. */ - selectedIndex?: number; - /** A Boolean value specifying whether or not to allow users to change the selected index by swiping. */ - swipeEnabled?: boolean; - /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ - deferRendering?: boolean; - } - /** A widget used to display a view and to switch between several views. */ - export class dxMultiView extends CollectionWidget { - constructor(element: JQuery, options?: dxMultiViewOptions); - constructor(element: Element, options?: dxMultiViewOptions); - } - export interface dxMapLocation { - /** The latitude location of the widget. */ - lat?: number; - /** The longitude location of the widget. */ - lng?: number; - } - export interface dxMapMarker { - /** A URL pointing to the custom icon to be used for the marker. */ - iconSrc?: string; - /** Specifies the marker location. */ - location?: dxMapLocation; - /** A callback function performed when the marker is clicked. */ - onClick?: Function; - /** A tooltip to be used for the marker. */ - tooltip?: { - /** Specifies whether a tooltip is visible by default or not. */ - isShown?: boolean; - /** Specifies the tooltip text. */ - text?: string; - } - } - export interface dxMapRoute { - /** Specifies the color of the line displaying the route. */ - color?: string; - /** Specifies a transportation mode to be used in the displayed route. */ - mode?: string; - /** Specifies the opacity of the line displaying the route. */ - opacity?: number; - /** Contains an array of objects making up the route. */ - locations?: Array; - /** Specifies the thickness of the line displaying the route in pixels. */ - weight?: number; - } - export interface dxMapOptions extends WidgetOptions { - /** Specifies whether or not the widget automatically adjusts center and zoom option values when adding a new marker or route, or when creating a widget if it initially contains markers or routes. */ - autoAdjust?: boolean; - center?: dxMapLocation; - /** A handler for the click event. */ - onClick?: any; - /** Specifies whether or not map widget controls are available. */ - controls?: boolean; - /** Specifies the height of the widget. */ - height?: any; - /** A key used to authenticate the application within the required map provider. */ - key?: { - /** A key used to authenticate the application within the "Bing" map provider. */ - bing?: string; - /** A key used to authenticate the application within the "Google" map provider. */ - google?: string; - /** A key used to authenticate the application within the "Google Static" map provider. */ - googleStatic?: string; - } - /** A handler for the markerAdded event. */ - onMarkerAdded?: Function; - /** A URL pointing to the custom icon to be used for map markers. */ - markerIconSrc?: string; - /** A handler for the markerRemoved event. */ - onMarkerRemoved?: Function; - /** An array of markers displayed on a map. */ - markers?: Array; - /** The name of the current map data provider. */ - provider?: string; - /** A handler for the ready event. */ - onReady?: Function; - /** A handler for the routeAdded event. */ - onRouteAdded?: Function; - /** A handler for the routeRemoved event. */ - onRouteRemoved?: Function; - /** An array of routes shown on the map. */ - routes?: Array; - /** The type of a map to display. */ - type?: string; - /** Specifies the width of the widget. */ - width?: any; - /** The zoom level of the map. */ - zoom?: number; - } - /** An interactive map widget. */ - export class dxMap extends Widget { - constructor(element: JQuery, options?: dxMapOptions); - constructor(element: Element, options?: dxMapOptions); - /** Adds a marker to the map. */ - addMarker(markerOptions: Object): JQueryPromise; - /** Adds a route to the map. */ - addRoute(routeOptions: Object): JQueryPromise; - /** Removes a marker from the map. */ - removeMarker(marker: Object): JQueryPromise; - /** Removes a route from the map. */ - removeRoute(route: any): JQueryPromise; - } - export interface dxLookupOptions extends dxDropDownListOptions { - applyValueMode?: string; - /** An object that defines widget animation options. */ - animation?: { - /** An object that defines the animation options used when the widget is being shown. */ - show?: fx.AnimationOptions; - /** An object that defines the animation options used when the widget is being hidden. */ - hide?: fx.AnimationOptions; - }; - /** The text displayed on the Cancel button. */ - cancelButtonText?: string; - /** The text displayed on the Clear button. */ - clearButtonText?: string; - /** Specifies whether or not the widget cleans the search box when the popup window is displayed. */ - cleanSearchOnOpening?: boolean; - /** A Boolean value specifying whether or not a widget is closed if a user clicks outside of the overlaying window. */ - closeOnOutsideClick?: any; - /** The text displayed on the Apply button. */ - applyButtonText?: string; - /** A Boolean value specifying whether or not to display the lookup in full-screen mode. */ - fullScreen?: boolean; - focusStateEnabled?: boolean; - /** A Boolean value specifying whether or not to group widget items. */ - grouped?: boolean; - /** The name of the template used to display a group header. */ - groupTemplate?: any; - /** The text displayed on the button used to load the next page from the data source. */ - nextButtonText?: string; - /** A handler for the pageLoading event. */ - onPageLoading?: Function; - /** Specifies whether the next page is loaded when a user scrolls the widget to the bottom or when the "next" button is clicked. */ - pageLoadMode?: string; - /** Specifies the text shown in the pullDown panel, which is displayed when the widget is scrolled to the bottom. */ - pageLoadingText?: string; - /** The text displayed by the widget when nothing is selected. */ - placeholder?: string; - /** The height of the widget popup element. */ - popupHeight?: any; - /** The width of the widget popup element. */ - popupWidth?: any; - /** An object defining widget positioning options. */ - position?: PositionOptions; - /** Specifies the text displayed in the pullDown panel when the widget is pulled below the refresh threshold. */ - pulledDownText?: string; - /** Specifies the text shown in the pullDown panel while the list is being pulled down to the refresh threshold. */ - pullingDownText?: string; - /** A handler for the pullRefresh event. */ - onPullRefresh?: Function; - /** A Boolean value specifying whether or not the widget supports the "pull down to refresh" gesture. */ - pullRefreshEnabled?: boolean; - /** Specifies the text displayed in the pullDown panel while the widget is being refreshed. */ - refreshingText?: string; - /** A handler for the scroll event. */ - onScroll?: Function; - /** A Boolean value specifying whether or not the search bar is visible. */ - searchEnabled?: boolean; - /** The text that is provided as a hint in the lookup's search bar. */ - searchPlaceholder?: string; - /** A Boolean value specifying whether or not the main screen is inactive while the lookup is active. */ - shading?: boolean; - /** Specifies whether to display the Cancel button in the lookup window. */ - showCancelButton?: boolean; - /** * A Boolean value specifying whether the widget loads the next page automatically when you reach the bottom of the list or when a button is clicked. * @deprecated Use the pageLoadMode option instead. */ - 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 Popover widget. */ - usePopover?: boolean; - /** A handler for the valueChanged event. */ - onValueChanged?: Function; - /** A handler for the titleRendered event. */ - onTitleRendered?: Function; - /** A Boolean value specifying whether or not to display the title in the popup window. */ - showPopupTitle?: boolean; - /** The template to be used for rendering the widget text field. */ - fieldTemplate?: any; - } - /** A widget that allows a user to select predefined values from a lookup window. */ - export class dxLookup extends dxDropDownList { - constructor(element: JQuery, options?: dxLookupOptions); - constructor(element: Element, options?: dxLookupOptions); - } - 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; - /** Specifies whether or not the widget can be focused. */ - focusStateEnabled?: boolean; - } - /** 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 ListOptionsMenuItem { - /** Specifies the menu item text. */ - text?: string; - /** Holds on a function called when the item is clicked. */ - action?: (itemElement: Element, itemData: any) => void; - } - export interface dxListOptions extends CollectionWidgetOptions { - /** A Boolean value specifying whether or not to display a grouped list. */ - grouped?: boolean; - /** The template to be used for rendering item groups. */ - groupTemplate?: any; - onItemDeleting?: Function; - /** A handler for the itemDeleted event. */ - onItemDeleted?: Function; - /** A handler for the groupRendered event. */ - onGroupRendered?: Function; - /** A handler for the itemReordered event. */ - onItemReordered?: Function; - /** A handler for the itemClick event. */ - onItemClick?: any; - /** A handler for the itemSwipe event. */ - onItemSwipe?: Function; - /** The text displayed on the button used to load the next page from the data source. */ - nextButtonText?: string; - /** A handler for the pageLoading event. */ - onPageLoading?: Function; - /** Specifies the text shown in the pullDown panel, which is displayed when the list is scrolled to the bottom. */ - pageLoadingText?: string; - /** Specifies the text displayed in the pullDown panel when the list is pulled below the refresh threshold. */ - pulledDownText?: string; - /** Specifies the text shown in the pullDown panel while the list is being pulled down to the refresh threshold. */ - pullingDownText?: string; - /** A handler for the pullRefresh event. */ - onPullRefresh?: Function; - /** A Boolean value specifying whether or not the widget supports the "pull down to refresh" gesture. */ - pullRefreshEnabled?: boolean; - /** Specifies the text displayed in the pullDown panel while the list is being refreshed. */ - refreshingText?: string; - /** A handler for the scroll event. */ - onScroll?: Function; - /** A Boolean value specifying whether to enable or disable list scrolling. */ - scrollingEnabled?: boolean; - /** Specifies when the widget shows the scrollbar. */ - showScrollbar?: string; - /** Specifies whether or not the widget uses native scrolling. */ - useNativeScrolling?: boolean; - /** A Boolean value specifying whether to enable or disable the bounce-back effect. */ - bounceEnabled?: boolean; - /** A Boolean value specifying if the list is scrolled by content. */ - scrollByContent?: boolean; - /** A Boolean value specifying if the list is scrolled using the scrollbar. */ - scrollByThumb?: boolean; - onItemContextMenu?: Function; - onItemHold?: Function; - /** Specifies whether or not an end-user can collapse groups. */ - collapsibleGroups?: boolean; - /** Specifies whether the next page is loaded when a user scrolls the widget to the bottom or when the "next" button is clicked. */ - pageLoadMode?: string; - /** Specifies whether or not to display controls used to select list items. */ - showSelectionControls?: boolean; - /** Specifies item selection mode. */ - selectionMode?: string; - /** Specifies the mode in which all items are selected. */ - selectAllMode?: string; - selectAllText?: string; - /** A handler for the selectAllValueChanged event. */ - onSelectAllValueChanged?: Function; - /** Specifies the array of items for a context menu called for a list item. */ - menuItems?: Array; - /** Specifies whether an item context menu is shown when a user holds or swipes an item. */ - menuMode?: string; - /** Specifies whether or not an end user can delete list items. */ - allowItemDeleting?: boolean; - /** Specifies the way a user can delete items from the list. */ - itemDeleteMode?: string; - /** Specifies whether or not an end user can reorder list items. */ - allowItemReordering?: boolean; - /** Specifies whether or not to show the loading panel when the DataSource bound to the widget is loading data. */ - indicateLoading?: boolean; - activeStateEnabled?: boolean; - } - /** A list widget. */ - export class dxList extends CollectionWidget { - constructor(element: JQuery, options?: dxListOptions); - constructor(element: Element, options?: dxListOptions); - /** Returns the height of the widget in pixels. */ - clientHeight(): number; - /** Removes the specified item from the list. */ - deleteItem(itemIndex: any): JQueryPromise; - /** Removes the specified item from the list. */ - deleteItem(itemElement: Element): JQueryPromise; - /** Returns a Boolean value that indicates whether or not the specified item is selected. */ - isItemSelected(itemIndex: any): boolean; - /** Returns a Boolean value that indicates whether or not the specified item is selected. */ - isItemSelected(itemElement: Element): boolean; - /** Reloads list data. */ - reload(): void; - /** Moves the specified item to the specified position in the list. */ - reorderItem(itemElement: Element, toItemElement: Element): JQueryPromise; - /** Moves the specified item to the specified position in the list. */ - reorderItem(itemIndex: any, toItemIndex: any): JQueryPromise; - /** Scrolls the list content by the specified number of pixels. */ - scrollBy(distance: number): void; - /** Returns the height of the list content in pixels. */ - scrollHeight(): number; - /** Scrolls list content to the specified position. */ - scrollTo(location: number): void; - /** Scrolls the list to the specified item. */ - scrollToItem(itemElement: Element): void; - /** Scrolls the list to the specified item. */ - scrollToItem(itemIndex: any): void; - /** Returns how far the list content is scrolled from the top. */ - scrollTop(): number; - /** Selects the specified item from the list. */ - selectItem(itemElement: Element): void; - /** Selects the specified item from the list. */ - selectItem(itemIndex: any): void; - /** Deselects the specified item from the list. */ - unselectItem(itemElement: Element): void; - /** Unselects the specified item from the list. */ - unselectItem(itemIndex: any): void; - /** Updates the widget scrollbar according to widget content size. */ - updateDimensions(): JQueryPromise; - /** Expands the specified group. */ - expandGroup(groupIndex: number): JQueryPromise; - /** Collapses the specified group. */ - collapseGroup(groupIndex: number): JQueryPromise; - } - export interface dxGalleryOptions extends CollectionWidgetOptions { - /** The time, in milliseconds, spent on slide animation. */ - animationDuration?: number; - /** Specifies whether or not to animate the displayed item change. */ - animationEnabled?: boolean; - /** A Boolean value specifying whether or not to allow users to switch between items by clicking an indicator. */ - indicatorEnabled?: boolean; - /** A Boolean value specifying whether or not to scroll back to the first item after the last item is swiped. */ - loop?: boolean; - /** The index of the currently active gallery item. */ - selectedIndex?: number; - /** A Boolean value specifying whether or not to display an indicator that points to the selected gallery item. */ - showIndicator?: boolean; - /** A Boolean value that specifies the availability of the "Forward" and "Back" navigation buttons. */ - showNavButtons?: boolean; - /** The time interval in milliseconds, after which the gallery switches to the next item. */ - slideshowDelay?: number; - /** A Boolean value specifying whether or not to allow users to switch between items by swiping. */ - swipeEnabled?: boolean; - /** Specifies whether or not to display parts of previous and next images along the sides of the current image. */ - wrapAround?: boolean; - /** Specifies if the widget stretches images to fit the total gallery width. */ - stretchImages?: boolean; - /** Specifies the width of an area used to display a single image. */ - initialItemWidth?: number; - } - /** An image gallery widget. */ - export class dxGallery extends CollectionWidget { - constructor(element: JQuery, options?: dxGalleryOptions); - constructor(element: Element, options?: dxGalleryOptions); - /** Shows the specified gallery item. */ - goToItem(itemIndex: number, animation: boolean): JQueryPromise; - /** Shows the next gallery item. */ - nextItem(animation: boolean): JQueryPromise; - /** Shows the previous gallery item. */ - prevItem(animation: boolean): JQueryPromise; - } - export interface dxDropDownEditorOptions extends dxTextBoxOptions { - /** Specifies the current value displayed by the widget. */ - value?: Object; - /** A handler for the closed event. */ - onClosed?: Function; - /** A handler for the opened event. */ - onOpened?: Function; - /** Specifies whether or not the drop-down editor is displayed. */ - opened?: boolean; - fieldEditEnabled?: boolean; - /** Specifies whether or not the widget allows an end-user to enter a custom value. */ - acceptCustomValue?: boolean; - /** Specifies the way an end-user applies the selected value. */ - applyValueMode?: string; - /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ - deferRendering?: boolean; - activeStateEnabled?: boolean; - } - /** A drop-down editor widget. */ - export class dxDropDownEditor extends dxTextBox { - constructor(element: JQuery, options?: dxDropDownEditorOptions); - constructor(element: Element, options?: dxDropDownEditorOptions); - /** Closes the drop-down editor. */ - close(): void; - /** Opens the drop-down editor. */ - open(): void; - /** Resets the widget's value to null. */ - reset(): void; - /** Returns an <input> element of the widget. */ - field(): JQuery; - /** Returns an HTML element of the popup window content. */ - content(): JQuery; - } - export interface dxDateBoxOptions extends dxTextEditorOptions { - formatString?: any; - /** Specifies the date display format. Applies only if the pickerType option is 'native' */ - displayFormat?: any; - format?: string; - /** A format used to display date/time information. */ - type?: 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 the 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 the 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 the date/time picker. */ - pickerType?: string; - /** Specifies the message displayed if the typed value is not a valid date or time. */ - invalidDateMessage?: string; - /** Specifies the message displayed if the specified date is later than the max value or earlier than the min value. */ - dateOutOfRangeMessage?: string; - /** The text displayed on the Apply button. */ - applyButtonText?: string; - /** Specifies whether or not adaptive widget rendering is enabled on a small screen. */ - adaptivityEnabled?: boolean; - /** The text displayed on the Cancel button. */ - cancelButtonText?: string; - } - /** A date box widget. */ - export class dxDateBox extends dxDropDownEditor { - constructor(element: JQuery, options?: dxDateBoxOptions); - constructor(element: Element, options?: dxDateBoxOptions); - } - export interface dxCheckBoxOptions extends EditorOptions { - activeStateEnabled?: boolean; - /** Specifies the widget state. */ - value?: boolean; - /** Specifies the text displayed by the check box. */ - text?: string; - name?: string; - } - /** A check box widget. */ - export class dxCheckBox extends Editor { - constructor(element: JQuery, options?: dxCheckBoxOptions); - constructor(element: Element, options?: dxCheckBoxOptions); - } - export interface dxCalendarOptions extends EditorOptions { - activeStateEnabled?: boolean; - /** Specifies a date displayed on the current calendar page. */ - currentDate?: Date; - /** Specifies the first day of a week. */ - firstDayOfWeek?: number; - /** An object or a value, specifying the date and time currently selected in the calendar. */ - value?: any; - /** The latest date the widget allows to select. */ - max?: any; - /** The earliest date the widget allows to select. */ - min?: any; - /** 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; - name?: string; - } - /** A calendar widget. */ - export class dxCalendar extends Editor { - constructor(element: JQuery, options?: dxCalendarOptions); - constructor(element: Element, options?: dxCalendarOptions); - } - export interface dxButtonOptions extends WidgetOptions { - /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ - activeStateEnabled?: boolean; - /** A handler for the click event. */ - onClick?: any; - /** Specifies the icon to be displayed on the button. */ - icon?: string; - iconSrc?: string; - /** A template to be used for rendering the Button 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; - /** Specifies whether the button must submit an HTML form. */ - useSubmitBehavior?: boolean; - } - /** A button widget. */ - export class dxButton extends Widget { - constructor(element: JQuery, options?: dxButtonOptions); - constructor(element: Element, options?: dxButtonOptions); - } - export interface dxBoxOptions extends CollectionWidgetOptions { - /** 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 Accordion items. */ - itemTemplate?: any; - /** A handler for the itemTitleClick event. */ - onItemTitleClick?: any; - /** 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?: Array; - 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; - /** Specifies the method for the upload request. */ - uploadMethod?: string; - /** Specifies headers for the upload request. */ - uploadHeaders?: Object; - /** A handler for the uploadStarted event. */ - onUploadStarted?: Function; - /** 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 uploadAborted event. */ - onUploadAborted?: 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; - } - /** 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; - /** The current widget value. */ - value?: number; - } - /** A widget used to indicate progress. */ - export class dxProgressBar extends dxTrackBar { - constructor(element: JQuery, options?: dxProgressBarOptions); - constructor(element: Element, options?: dxProgressBarOptions); - } - export interface dxSliderBaseOptions extends dxTrackBarOptions { - activeStateEnabled?: boolean; - /** The slider step size. */ - step?: 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; - }; - name?: string; - } - export interface dxSliderOptions extends dxSliderBaseOptions { - /** The current slider value. */ - value?: number; - } - /** 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 dxSliderBaseOptions { - /** 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; - /** The value to be assigned to the name attribute of the underlying `` element. */ - startName?: string; - /** The value to be assigned to the name attribute of the underlying `` element. */ - endName?: string; - value?: Array; - } - /** A widget that enables a user to select a range of numeric values. */ - export class dxRangeSlider extends dxSlider { - constructor(element: JQuery, options?: dxRangeSliderOptions); - constructor(element: Element, options?: dxRangeSliderOptions); - } - export interface dxFormItemLabel { - /** Specifies the label text. */ - text?: string; - /** Specifies whether or not the label is visible. */ - visible?: boolean; - /** Specifies whether or not a colon is displayed at the end of the current label. */ - showColon?: boolean; - /** Specifies the location of a label against the editor. */ - location?: string; - /** Specifies the label horizontal alignment. */ - alignment?: string; - } - export interface dxFormItem { - /** Specifies the type of the current item. */ - itemType?: string; - /** Specifies whether or not the current form item is visible. */ - visible?: boolean; - /** Specifies the sequence number of the item in a form, group or tab. */ - visibleIndex?: number; - /** Specifies a CSS class to be applied to the form item. */ - cssClass?: string; - /** Specifies the number of columns spanned by the item. */ - colSpan?: number; - } - /** This article describes configuration options of an empty form item. */ - export interface dxFormEmptyItem extends dxFormItem { - /** Specifies the form item name. */ - name?: string; - } - /** This article describes configuration options of a simple form item. */ - export interface dxFormSimpleItem extends dxFormItem { - /** Specifies the path to the formData object field bound to the current form item. */ - dataField?: string; - /** Specifies the form item name. */ - name?: string; - /** Specifies which editor widget is used to display and edit the form item value. */ - editorType?: string; - /** Specifies configuration options for the editor widget of the current form item. */ - editorOptions?: Object; - /** A template to be used for rendering the form item. */ - template?: any; - /** Specifies the help text displayed for the current form item. */ - helpText?: string; - /** Specifies whether the current form item is required. */ - isRequired?: boolean; - /** Specifies options for the form item label. */ - label?: dxFormItemLabel; - /** An array of validation rules to be checked for the form item editor. */ - validationRules?: Array; - } - /** Specifies dependency between the screen factor and the count of columns. */ - export interface ColCountResponsible { - /** The count of columns for an extra small-sized screen. */ - xs?: number; - /** The count of columns for a small-sized screen. */ - sm?: number; - /** The count of columns for a middle-sized screen. */ - md?: number; - /** The count of columns for a large screen size. */ - lg?: number; - } - /** This article describes configuration options of a group form item. */ - export interface dxFormGroupItem extends dxFormItem { - /** Specifies the group caption. */ - caption?: string; - /** A template to be used for rendering a group item. */ - template?: any; - /** The count of columns in the group layout. */ - colCount?: number; - /** Specifies dependency between the screen factor and the count of columns in the tab layout. */ - colCountByScreen?: ColCountResponsible; - /** 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 dependency between the screen factor and the count of columns in the group layout. */ - colCountByScreen?: ColCountResponsible; - /** Specifies whether or not labels of items displayed within the current tab are aligned. */ - alignItemLabels?: boolean; - /** Holds an array of form items displayed within the tab. */ - items?: Array; - /** Specifies a badge text for the tab. */ - badge?: string; - /** A Boolean value specifying whether or not the tab can respond to user interaction. */ - disabled?: boolean; - /** Specifies the icon to be displayed on the tab. */ - icon?: string; - /** The template to be used for rendering the tab. */ - tabTemplate?: any; - /** The template to be used for rendering the tab content. */ - template?: any; - } - /** This article describes configuration options of a tabbed form item. */ - export interface dxFormTabbedItem extends dxFormItem { - /** Holds a configuration object for the TabPanel 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 dependency between the screen factor and the count of columns in the form layout. */ - colCountByScreen?: ColCountResponsible; - /** Specifies the function returning the screen factor depending on the screen width. */ - screenByWidth?: (width: number) => string; - /** Specifies the location of a label against the editor. */ - labelLocation?: string; - /** Specifies whether or not all editors on the form are read-only. */ - readOnly?: boolean; - /** A handler for the fieldDataChanged event. */ - onFieldDataChanged?: (e: Object) => void; - /** A handler for the editorEnterKey event. */ - onEditorEnterKey?: (e: Object) => void; - /** Specifies a function that customizes a form item after it has been created. */ - customizeItem?: Function; - /** The minimum column width used for calculating column count in the form layout. */ - minColWidth?: number; - /** Specifies whether or not all root item labels are aligned. */ - alignItemLabels?: boolean; - /** Specifies whether or not item labels in all groups are aligned. */ - alignItemLabelsInAllGroups?: boolean; - /** Specifies whether or not a colon is displayed at the end of form labels. */ - showColonAfterLabel?: boolean; - /** Specifies whether or not the required mark is displayed for required fields. */ - showRequiredMark?: boolean; - /** Specifies whether or not the optional mark is displayed for optional fields. */ - showOptionalMark?: boolean; - /** The text displayed for required fields. */ - requiredMark?: string; - /** The text displayed for optional fields. */ - optionalMark?: string; - /** Specifies the message that is shown for end-users if a required field value is not specified. */ - requiredMessage?: string; - /** Specifies whether or not the total validation summary is displayed on the form. */ - showValidationSummary?: boolean; - /** Holds an array of form items. */ - items?: Array; - /** A Boolean value specifying whether to enable or disable form scrolling. */ - scrollingEnabled?: boolean; - /** Gives a name to the internal validation group. */ - validationGroup?: string; - onContentReady?: Function; - } - /** A form widget used to display and edit values of object fields. */ - export class dxForm extends Widget { - constructor(element: JQuery, options?: dxFormOptions); - constructor(element: Element, options?: dxFormOptions); - /** Updates the specified field of the formData object and the corresponding editor on the form. */ - updateData(dataField: string, value: any): void; - /** Updates the specified fields of the formData object and the corresponding editors on the form. */ - updateData(data: Object): void; - /** Updates the value of a form item option. */ - itemOption(field: string, option: string, value: any): void; - /** Updates the values of form item options. */ - itemOption(field: string, options: Object): void; - /** Gets the value of the form item option. */ - itemOption(field: string): any; - /** Returns an editor instance associated with the specified formData field or name of the form item. */ - 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; - /** Resets the editor's value to undefined. */ - resetValues(): void; - } - export interface dxDeferRenderingOptions extends WidgetOptions { - /** Indicates if a load indicator should be shown until the widget's content is rendered. */ - showLoadIndicator?: boolean; - /** Specifies the jQuery.Promise or boolean value, which when resolved, forces widget content to render. */ - renderWhen?: any; - /** Specifies the animation to be used to show the rendered content. */ - animation?: fx.AnimationOptions; - /** Specifies a jQuery selector of items that should be rendered using a staggered animation. */ - staggerItemSelector?: string; - /** Specifies a callback function that is called when the widget's content has finished rendering but is not yet shown. */ - onRendered?: Function; - /** Specifies a callback function that is called when widget content is shown and animation has completed. */ - onShown?: Function; - } - /** A container for elements that must be rendered at a specified moment. */ - export class dxDeferRendering extends Widget { - constructor(element: JQuery, options?: dxDeferRenderingOptions); - constructor(element: Element, options?: dxDeferRenderingOptions); - } -} -/* Private plugins. To be removed */ -interface 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; - dxTextEditor(): JQuery; - dxTextEditor(options: "instance"): DevExpress.ui.dxTextEditor; - dxTextEditor(options: string): any; - dxTextEditor(options: string, ...params: any[]): any; - dxTextEditor(options: DevExpress.ui.dxTextEditorOptions): 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; - dxOverlay(): JQuery; - dxOverlay(options: "instance"): DevExpress.ui.dxOverlay; - dxOverlay(options: string): any; - dxOverlay(options: string, ...params: any[]): any; - dxOverlay(options: DevExpress.ui.dxOverlayOptions): 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; -} -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 whether tiles are placed horizontally or vertically. */ - direction?: string; - /** Specifies the height of the widget. */ - height?: any; - /** Specifies the distance in pixels between adjacent tiles. */ - itemMargin?: number; - /** A Boolean value specifying whether or not to display a scrollbar. */ - showScrollbar?: boolean; - } - /** A widget displaying several blocks of data as tiles. */ - export class dxTileView extends CollectionWidget { - constructor(element: JQuery, options?: dxTileViewOptions); - constructor(element: Element, options?: dxTileViewOptions); - /** Returns the current scroll position of the widget content. */ - scrollPosition(): number; - } - export interface dxSwitchOptions extends EditorOptions { - activeStateEnabled?: boolean; - /** Text displayed when the widget is in a disabled state. */ - offText?: string; - /** Text displayed when the widget is in an enabled state. */ - onText?: string; - /** A Boolean value specifying whether the current switch state is "On" or "Off". */ - value?: boolean; - name?: string; - } - /** A switch widget. */ - export class dxSwitch extends Editor { - constructor(element: JQuery, options?: dxSwitchOptions); - constructor(element: Element, options?: dxSwitchOptions); - } - export interface dxSlideOutViewOptions extends WidgetOptions { - /** Specifies the current menu position. */ - menuPosition?: string; - /** Specifies whether or not the menu panel is visible. */ - menuVisible?: boolean; - /** Specifies whether or not the menu is shown when a user swipes the widget content. */ - swipeEnabled?: boolean; - /** A template to be used for rendering menu panel content. */ - menuTemplate?: any; - /** A template to be used for rendering widget content. */ - contentTemplate?: any; - } - /** The widget that allows you to slide-out the current view to reveal a custom menu. */ - export class dxSlideOutView extends Widget { - constructor(element: JQuery, options?: dxSlideOutViewOptions); - constructor(element: Element, options?: dxSlideOutViewOptions); - /** Returns an HTML element of the widget menu block. */ - menuContent(): JQuery; - /** Returns an HTML element of the widget content block. */ - content(): JQuery; - /** Displays the widget's menu block. */ - showMenu(): JQueryPromise; - /** Hides the widget's menu block. */ - hideMenu(): JQueryPromise; - /** Toggles the visibility of the widget's menu block. */ - toggleMenuVisibility(): JQueryPromise; - } - export interface dxSlideOutOptions extends CollectionWidgetOptions { - /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ - activeStateEnabled?: boolean; - /** A Boolean value specifying whether or not to display a grouped menu. */ - menuGrouped?: boolean; - /** Specifies the current menu position. */ - menuPosition?: string; - /** The name of the template used to display a group header. */ - menuGroupTemplate?: any; - /** The template used to render menu items. */ - menuItemTemplate?: any; - /** A handler for the menuGroupRendered event. */ - onMenuGroupRendered?: Function; - /** A handler for the menuItemRendered event. */ - onMenuItemRendered?: Function; - /** Specifies whether or not the slide-out menu is displayed. */ - menuVisible?: boolean; - /** Indicates whether the menu can be shown/hidden by swiping the widget's main panel. */ - swipeEnabled?: boolean; - /** A template to be used for rendering widget content. */ - contentTemplate?: any; - } - /** The widget that allows you to slide-out the current view to reveal an item list. */ - export class dxSlideOut extends CollectionWidget { - constructor(element: JQuery, options?: dxSlideOutOptions); - constructor(element: Element, options?: dxSlideOutOptions); - /** Hides the widget's slide-out menu. */ - hideMenu(): JQueryPromise; - /** Displays the widget's slide-out menu. */ - showMenu(): JQueryPromise; - /** Toggles the visibility of the widget's slide-out menu. */ - toggleMenuVisibility(showing: boolean): JQueryPromise; - } - export interface dxPivotOptions extends CollectionWidgetOptions { - /** The index of the currently active pivot item. */ - selectedIndex?: number; - /** A Boolean value specifying whether or not to allow users to switch between items by swiping. */ - swipeEnabled?: boolean; - /** A template to be used for rendering widget content. */ - contentTemplate?: any; - /** The template to be used for rendering an item title. */ - itemTitleTemplate?: any; - } - /** A widget that is similar to a traditional tab control, but optimized for the phone with simplified end-user interaction. */ - export class dxPivot extends CollectionWidget { - constructor(element: JQuery, options?: dxPivotOptions); - constructor(element: Element, options?: dxPivotOptions); - } - export interface dxPanoramaOptions extends CollectionWidgetOptions { - /** An object exposing options for setting a background image for the panorama. */ - backgroundImage?: { - /** Specifies the height of the panorama's background image. */ - height?: number; - /** Specifies the URL of the image that is used as the panorama's background image. */ - url?: string; - /** Specifies the width of the panorama's background image. */ - width?: number; - }; - /** The index of the currently active panorama item. */ - selectedIndex?: number; - /** Specifies the widget content title. */ - title?: string; - } - /** A widget displaying the required content in a long horizontal canvas that extends beyond the frames of the screen. */ - export class dxPanorama extends CollectionWidget { - constructor(element: JQuery, options?: dxDropDownEditorOptions); - constructor(element: Element, options?: dxDropDownEditorOptions); - } - export interface dxDropDownMenuOptions extends WidgetOptions { - /** A handler for the buttonClick event. */ - onButtonClick?: any; - /** The name of the icon to be displayed by the DropDownMenu button. */ - buttonIcon?: string; - /** The text displayed in the DropDownMenu button. */ - buttonText?: string; - buttonIconSrc?: string; - /** A data source used to fetch data to be displayed by the widget. */ - dataSource?: any; - /** A handler for the itemClick event. */ - onItemClick?: any; - /** An array of items displayed by the widget. */ - items?: Array; - /** The template to be used for rendering items. */ - itemTemplate?: any; - /** Specifies whether or not to show the drop down menu within a Popover widget. */ - usePopover?: boolean; - /** The width of the menu popup in pixels. */ - popupWidth?: any; - /** The height of the menu popup in pixels. */ - popupHeight?: any; - /** Specifies whether or not the drop-down menu is displayed. */ - opened?: boolean; - hoverStateEnabled?: boolean; - activeStateEnabled?: boolean; - } - /** A drop-down menu widget. */ - export class dxDropDownMenu extends Widget { - constructor(element: JQuery, options?: dxDropDownEditorOptions); - constructor(element: Element, options?: dxDropDownEditorOptions); - /** Opens the drop-down menu. */ - open(): void; - /** Closes the drop-down menu. */ - close(): void; - } - export interface dxActionSheetOptions extends CollectionWidgetOptions { - /** A handler for the cancelClick event. */ - onCancelClick?: any; - /** The text displayed in the button that closes the action sheet. */ - cancelText?: string; - /** Specifies whether or not to display the Cancel button in action sheet. */ - showCancelButton?: boolean; - /** A Boolean value specifying whether or not the title of the action sheet is visible. */ - showTitle?: boolean; - /** Specifies the element the action sheet popover points at. */ - target?: any; - /** The title of the action sheet. */ - title?: string; - /** Specifies whether or not to show the action sheet within a Popover widget. */ - usePopover?: boolean; - /** A Boolean value specifying whether or not the ActionSheet 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; - } -} -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; - /** A function used to customize a web request before it is sent. */ - beforeSend?: (request: Object) => void; - } - /** A Store that provides access to an OLAP cube using the XMLA standard. */ - export class XmlaStore { - constructor(options: XmlaStoreOptions); - } - export interface PivotGridField { - index?: number; - /** A boolean value specifying whether or not the field is visible in the pivot grid and the Field Chooser. */ - visible?: boolean; - /** Name of the data source field containing data for the pivot grid field. */ - dataField?: string; - /** A caption that will be displayed in the pivot grid's field chooser and field panel to identify the field. */ - caption?: string; - /** Specifies a type of field values. */ - dataType?: string; - /** Specifies how the values of the current field are combined into groups. Cannot be used for the XmlaStore store type. */ - groupInterval?: any; - /** Specifies how to aggregate field data. Cannot be used for the XmlaStore store type. */ - summaryType?: string; - /** Allows you to use a custom aggregate function to calculate the summary values. Cannot be used for the XmlaStore store type. */ - calculateCustomSummary?: (options: { - summaryProcess?: string; - value?: any; - totalValue?: any; - }) => void; - /** Specifies the function that determines how to split data from the data source into ranges for header items. Cannot be used for the XmlaStore store type and along with remote operations. */ - 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 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; - /** Sorts the header items of this field by the summary values of another field. */ - sortBySummaryField?: string; - /** The array of field names that specify a path to column/row whose summary field is used for sorting of this field's header items. */ - sortBySummaryPath?: Array; - /** 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 whether or not long text in header items should be wrapped. */ - wordWrapEnabled?: boolean; - /** Specifies a display format for field values. */ - format?: any; - /** 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. * @deprecated Use the format | precision option instead. */ - precision?: number; - /** Specifies how to sort the header items. */ - sortingMethod?: (a: Object, b: Object) => number; - /** Allows an end-user to change sorting options. */ - allowSorting?: boolean; - /** Allows an end-user to sort columns by summary values. */ - allowSortingBySummary?: boolean; - /** Allows an end-user to change filtering options. */ - allowFiltering?: boolean; - /** Allows an end-user to expand/collapse all header items within a header level. */ - allowExpandAll?: boolean; - /** Specifies the absolute width of the field in the pivot grid. */ - width?: number; - /** Specifies the summary post-processing algorithm. */ - summaryDisplayMode?: string; - /** Specifies whether to summarize each next summary value with the previous one by rows or columns. */ - runningTotal?: string; - /** Specifies whether to allow the predefined summary post-processing functions ('absoluteVariation' and 'percentVariation') and runningTotal to take values of different groups into account. */ - allowCrossGroupCalculation?: boolean; - /** Specifies a callback function that allows you to modify summary values after they are calculated. */ - calculateSummaryValue?: (e: Object) => number; - /** Specifies whether or not to display Total values for the field. */ - showTotals?: boolean; - /** Specifies whether or not to display Grand Total values for the field. */ - showGrandTotals?: boolean; - } - export class SummaryCell { - /** Gets the parent cell in a specified direction. */ - parent(direction: string): SummaryCell; - /** Gets all child 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 row or column field to which the current cell belongs. */ - field(area: string): PivotGridField; - /** Gets the value of the current cell. */ - value(): any; - /** Gets the value of the current cell. */ - value(isCalculatedValue: boolean): any; - /** Gets the value of any field linked with the current cell. */ - value(field: PivotGridField): any; - /** Gets the value of any field linked with the current cell. */ - value(field: PivotGridField, isCalculatedValue: boolean): any; - } - export interface PivotGridDataSourceOptions { - /** Specifies the underlying Store instance used to access data. */ - store?: any; - /** Indicates whether or not the automatic field generation from data in the Store is enabled. */ - retrieveFields?: boolean; - /** Specifies data filtering conditions. Cannot be used for the XmlaStore store type. */ - filter?: Object; - /** An array of pivot grid fields. */ - fields?: Array; - /** Specifies whether or not all the operations (filtering, grouping and summary calculation) are performed remotely. */ - remoteOperations?: 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 PivotGrid widget. */ - export class PivotGridDataSource implements EventsMixin { - constructor(options?: PivotGridDataSourceOptions); - /** Starts reloading data from any store and updating the data source. */ - reload(): JQueryPromise; - /** Starts updating the data source. Reloads data from the XMLA store only. */ - load(): JQueryPromise; - /** Indicates whether or not the PivotGridDataSource is currently being loaded. */ - isLoading(): boolean; - /** Gets data displayed in a PivotGrid. */ - getData(): Object; - /** Gets all fields within a specified area. */ - getAreaFields(area: string, collectGroups: boolean): Array; - /** Gets all fields from the data source. */ - fields(): Array; - /** Sets the fields option. */ - fields(fields: Array): void; - /** Gets current options of a specified field. */ - field(id: any): PivotGridField; - /** Sets one or more options of a specified field. */ - field(id: any, field: PivotGridField): void; - /** Collapses a specified header item. */ - collapseHeaderItem(area: string, path: Array): void; - /** Expands a specified header item. */ - expandHeaderItem(area: string, path: Array): void; - /** Expands all header items of a field. */ - expandAll(id: any): void; - /** Collapses all header items of a field. */ - collapseAll(id: any): void; - /** Disposes of all resources associated with this PivotGridDataSource. */ - dispose(): void; - /** Gets the current filter expression. Cannot be used for the XmlaStore store type. */ - filter(): Object; - /** Applies a new filter expression. Cannot be used for the XmlaStore store type. */ - filter(filterExpr: Object): void; - /** Provides access to a list of records (facts) that were used to calculate a specific summary. */ - createDrillDownDataSource(options: { - columnPath?: Array; - rowPath?: Array; - dataIndex?: number; - maxRowCount?: number; - customColumns?: Array; - }): DevExpress.data.DataSource; - /** Gets the current PivotGridDataSource state (fields configuration, sorting, filters, expanded headers, etc.) */ - state(): Object; - /** Sets the PivotGridDataSource state. */ - state(state: Object): void; - on(eventName: string, eventHandler: Function): PivotGridDataSource; - on(events: { [eventName: string]: Function; }): PivotGridDataSource; - off(eventName: string): PivotGridDataSource; - off(eventName: string, eventHandler: Function): PivotGridDataSource; - } -} -declare module DevExpress.ui { - export interface dxSchedulerViewOptions { - /** The name of the view. */ - type?: string; - /** The first day of a week. */ - firstDayOfWeek?: number; - /** The resource kinds by which appointments are grouped. */ - groups?: Array; - /** The start hour of the view time scale. */ - startDayHour?: number; - /** The end hour of the view time scale. */ - endDayHour?: number; - /** The cell duration in minutes. */ - cellDuration?: number; - /** Specifies the number of dates that can be shown at a time in the agenda view. */ - agendaDuration?: number; - /** The template to be used for rendering appointments. */ - appointmentTemplate?: any; - /** The template to be used for rendering an appointment tooltip. */ - appointmentTooltipTemplate?: any; - /** The template to be used for rendering table cells. */ - dataCellTemplate?: any; - /** The template to be used for rendering time scale items. */ - timeCellTemplate?: any; - /** The template to be used for rendering date scale items. */ - dateCellTemplate?: any; - /** The template to be used for rendering resource headers. */ - resourceCellTemplate?: any; - } - export interface dxSchedulerOptions extends WidgetOptions { - /** Specifies a date displayed on the current scheduler view by default. */ - currentDate?: any; - /** The earliest date the widget allows you to select. */ - min?: Date; - /** The latest date the widget allows you to select. */ - max?: Date; - /** Specifies the view used in the scheduler by default. */ - currentView?: string; - /** A data source used to fetch data to be displayed by the widget. */ - dataSource?: any; - /** Specifies the first day of a week. */ - firstDayOfWeek?: number; - /** The template to be used for rendering appointments. */ - appointmentTemplate?: any; - /** The template to be used for rendering an appointment tooltip. */ - appointmentTooltipTemplate?: any; - /** The template to be used for rendering table cells. */ - dataCellTemplate?: any; - /** The template to be used for rendering time scale items. */ - timeCellTemplate?: any; - /** The template to be used for rendering date scale items. */ - dateCellTemplate?: any; - /** The template to be used for rendering resource headers. */ - resourceCellTemplate?: any; - /** Lists the views to be available within the scheduler's View Selector. */ - views?: Array; - /** Specifies the resource kinds by which the scheduler's appointments are grouped in a timetable. */ - groups?: Array; - /** Specifies a start hour in the scheduler view's time interval. */ - startDayHour?: number; - /** Specifies an end hour in the scheduler view's time interval. */ - endDayHour?: number; - /** Specifies whether or not the "All-day" panel is visible. */ - showAllDayPanel?: boolean; - /** Specifies cell duration in minutes. */ - cellDuration?: number; - /** Specifies the edit mode for recurring appointments. */ - recurrenceEditMode?: string; - /** Specifies which editing operations an end-user can perform on appointments. */ - editing?: { - /** Specifies whether or not an end-user can add appointments. */ - allowAdding?: boolean; - /** Specifies whether or not an end-user can change appointment options. */ - allowUpdating?: boolean; - /** Specifies whether or not an end-user can delete appointments. */ - allowDeleting?: boolean; - /** Specifies whether or not an end-user can change an appointment duration. */ - allowResizing?: boolean; - /** Specifies whether or not an end-user can drag appointments. */ - allowDragging?: boolean; - } - /** Specifies an array of resources available in the scheduler. */ - resources?: Array<{ - /** Indicates whether or not several resources of this kind can be assigned to an appointment. */ - allowMultiple?: boolean; - /** * Indicates whether or not resources of this kind have priority in the color identification of the appointments that have resources of different kinds assigned. * @deprecated Use the useColorAsDefault option instead. */ - mainColor?: boolean; - /** Indicates whether or not resources of this kind have priority in the color identification of the appointments that have resources of different kinds assigned. */ - useColorAsDefault?: boolean; - /** A data source used to fetch resources to be available in the scheduler. */ - dataSource?: any; - /** Specifies the resource object field whose value is displayed by the Resource editor in the Appointment popup window. */ - displayExpr?: any; - /** Specifies the resource object field that is used as a value of the Resource editor in the Appointment popup window. */ - valueExpr?: any; - /** * The name of the appointment object field that specifies a resource of this kind. * @deprecated Use the fieldExpr option instead. */ - field?: string; - /** The name of the appointment object field that specifies a resource of this kind. */ - fieldExpr?: string; - /** Specifies the resource object field that is used as a resource color. */ - colorExpr?: string; - /** Specifies the label of the Appointment popup window field that allows end users to assign a resource of this kind. */ - label?: string; - }>; - /** A handler for the AppointmentAdding event. */ - onAppointmentAdding?: Function; - /** A handler for the appointmentAdded event. */ - onAppointmentAdded?: Function; - /** A handler for the AppointmentUpdating event. */ - onAppointmentUpdating?: Function; - /** A handler for the appointmentUpdated event. */ - onAppointmentUpdated?: Function; - /** A handler for the AppointmentDeleting event. */ - onAppointmentDeleting?: Function; - /** A handler for the appointmentDeleted event. */ - onAppointmentDeleted?: Function; - /** A handler for the appointmentRendered event. */ - onAppointmentRendered?: Function; - /** A handler for the appointmentClick event. */ - onAppointmentClick?: any; - /** A handler for the appointmentDblClick event. */ - onAppointmentDblClick?: any; - /** A handler for the cellClick event. */ - onCellClick?: any; - /** A handler for the appointmentFormCreated event. */ - onAppointmentFormCreated?: Function; - /** A handler for the contentReady event. */ - onContentReady?: Function; - horizontalScrollingEnabled?: boolean; - /** Specifies whether or not an end-user can scroll the view in both directions at the same time. */ - crossScrollingEnabled?: boolean; - /** Specifies whether a user can switch views using tabs or a drop-down menu. */ - useDropDownViewSwitcher?: boolean; - /** Specifies the name of the data source item field that defines the start of an appointment. */ - startDateExpr?: string; - /** Specifies the name of the data source item field that defines the ending of an appointment. */ - endDateExpr?: string; - /** Specifies the name of the data source item field that holds the subject of an appointment. */ - textExpr?: string; - /** Specifies the name of the data source item field whose value holds the description of the corresponding appointment. */ - descriptionExpr?: string; - /** Specifies the name of the data source item field whose value defines whether or not the corresponding appointment is an all-day appointment. */ - allDayExpr?: string; - /** Specifies the name of the data source item field that defines a recurrence rule for generating recurring appointments. */ - recurrenceRuleExpr?: string; - /** Specifies the name of the data source item field that defines exceptions for the current recurring appointment. */ - recurrenceExceptionExpr?: string; - /** Specifies the name of the data source item field that defines the timezone of the appointment start date. */ - startDateTimeZoneExpr?: string; - /** Specifies the name of the data source item field that defines the timezone of the appointment end date. */ - endDateTimeZoneExpr?: string; - /** Specifies whether filtering is performed on the server or client side. */ - remoteFiltering?: boolean; - /** Specifies the timezone of the widget. */ - timeZone?: string; - /** The text or HTML markup displayed by the widget if the item collection is empty. Available for the Agenda view only. */ - noDataText?: string; - } - /** A widget that displays scheduled data using different views and provides the capability to load, add and edit appointments. */ - export class dxScheduler extends Widget - implements DataHelperMixin - { - 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 of the specified day. */ - scrollToTime(hours: number, minutes: number, date: Date): void; - /** Displays the Appointment Details popup. */ - showAppointmentPopup(appointmentData: Object, createNewAppointment?: boolean, currentAppointmentData?: Object): void; - /** Hides an appointment details popup. */ - hideAppointmentPopup(saveChanges?: boolean): void; - /** Displays the appointment tooltip for the specified target element. */ - showAppointmentTooltip(appointmentData: Object, target?: JQuery, currentAppointmentData?: Object): void; - showAppointmentTooltip(appointmentData: Object, target?: Element, currentAppointmentData?: Object): void; - showAppointmentTooltip(appointmentData: Object, target?: string, currentAppointmentData?: Object): void; - /** Hides an appointment tooltip. */ - hideAppointmentTooltip(): void; - /** Returns the start date of the current view. */ - getStartViewDate(): Date; - /** Returns the end date of the current view. */ - getEndViewDate(): Date; - getDataSource(): DevExpress.data.DataSource; - } - export interface dxColorBoxOptions extends dxDropDownEditorOptions { - /** Specifies the text displayed on the button that applies changes and closes the drop-down editor. */ - applyButtonText?: string; - applyValueMode?: string; - /** Specifies the text displayed on the button that cancels changes and closes the drop-down editor. */ - cancelButtonText?: string; - /** Specifies whether or not the widget value includes the alpha channel component. */ - editAlphaChannel?: boolean; - /** Specifies the size of a step by which a handle is moved using a keyboard shortcut. */ - keyStep?: number; - } - /** A widget used to specify a color value. */ - export class dxColorBox extends dxDropDownEditor { - constructor(element: JQuery, options?: dxColorBoxOptions); - constructor(element: Element, options?: dxColorBoxOptions); - } - export interface HierarchicalCollectionWidgetOptions extends CollectionWidgetOptions { - /** Specifies the name of the data source item field whose value is displayed by the widget. */ - displayExpr?: any; - /** Specifies which data field provides keys for TreeView items. */ - 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; - hoverStateEnabled?: boolean; - focusStateEnabled?: boolean; - } - export class HierarchicalCollectionWidget extends CollectionWidget { - } - export interface dxTreeViewOptions extends HierarchicalCollectionWidgetOptions { - /** Specifies whether or not to animate item collapsing and expanding. */ - animationEnabled?: boolean; - /** Specifies whether a nested or plain array is used as a data source. */ - dataStructure?: string; - /** Specifies whether or not a user can expand all tree view items by the "*" hot key. */ - expandAllEnabled?: boolean; - /** * Specifies whether or not a check box is displayed at each tree view item. * @deprecated Use the showCheckBoxesMode options instead. */ - showCheckBoxes?: boolean; - /** Specifies the current check boxes display mode. */ - showCheckBoxesMode?: string; - /** Specifies the name of the data source item field whose value defines whether or not the corresponding widget item is displayed expanded. */ - expandedExpr?: any; - /** Specifies whether or not to select nodes recursively. */ - selectNodesRecursive?: boolean; - /** Specifies whether or not all parent nodes of an initially expanded node are displayed expanded. */ - expandNodesRecursive?: boolean; - /** * Specifies whether the "Select All" check box is displayed over the tree view. * @deprecated Use the showCheckBoxesMode options instead. */ - selectAllEnabled?: boolean; - /** Specifies whether or not an item becomes selected if a user clicks it. */ - selectByClick?: boolean; - /** Specifies item selection mode. */ - selectionMode?: string; - /** Specifies the text displayed at the "Select All" check box. */ - selectAllText?: string; - /** Specifies the name of the data source item field whose value defines whether or not the corresponding node includes child nodes. */ - hasItemsExpr?: any; - /** Specifies the name of the data source item field for holding the parent key of the corresponding node. */ - parentIdExpr?: any; - /** Specifies if the virtual mode is enabled. */ - virtualModeEnabled?: boolean; - /** Specifies the parent ID value of the root item. */ - rootValue?: Object; - /** 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 itemSelectionChanged event. */ - onItemSelectionChanged?: 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; - /** Allows you to load nodes manually. */ - createChildren?: Function; - } - export interface dxTreeViewNode { - children: Array; - disabled: boolean; - expanded: boolean; - itemData: Object; - key: any; - parent: dxTreeViewNode; - selected: boolean; - text: string; - } - /** A widget displaying specified data items as a tree. */ - export class dxTreeView extends HierarchicalCollectionWidget { - constructor(element: JQuery, options?: dxTreeViewOptions); - constructor(element: Element, options?: dxTreeViewOptions); - /** Updates the tree view scrollbars according to the current size of the widget content. */ - updateDimensions(): JQueryPromise; - /** Selects the specified item. */ - selectItem(itemElement: any): void; - /** Unselects the specified item. */ - unselectItem(itemElement: any): void; - /** Expands the specified item. */ - expandItem(itemElement: any): void; - /** Collapses the specified item. */ - collapseItem(itemElement: any): void; - /** Returns all nodes of the tree view. */ - getNodes(): Array; - /** Selects all widget items. */ - selectAll(): void; - /** Unselects all widget items. */ - unselectAll(): void; - } - export interface dxMenuBaseOptions extends HierarchicalCollectionWidgetOptions { - /** An object that defines the animation options of the widget. */ - animation?: { - /** An object that defines the animation options used when the widget is being shown. */ - show?: fx.AnimationOptions; - /** An object that defines the animation options used when the widget is being hidden. */ - hide?: 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. * @deprecated Use the selectByClick option instead. */ - selectionByClick?: boolean; - /** Specifies whether or not an item becomes selected if a user clicks it. */ - selectByClick?: boolean; - /** Specifies the selection mode supported by the menu. */ - selectionMode?: string; - /** Specifies options of submenu showing and hiding. */ - showSubmenuMode?: { - /** Specifies the mode name. */ - name?: string; - /** Specifies the delay of submenu show and hiding. */ - delay?: { - /** The time span after which the submenu is shown. */ - show?: number; - /** The time span after which the submenu is hidden. */ - hide?: number; - }; - }; - } - export class dxMenuBase extends HierarchicalCollectionWidget { - constructor(element: JQuery, options?: dxMenuBaseOptions); - constructor(element: Element, options?: dxMenuBaseOptions); - /** Selects the specified item. */ - selectItem(itemElement: any): void; - /** Unselects the specified item. */ - unselectItem(itemElement: any): void; - } - export interface dxMenuOptions extends dxMenuBaseOptions { - /** Specifies whether or not the submenu is hidden when the mouse pointer leaves it. */ - hideSubmenuOnMouseLeave?: boolean; - /** Specifies whether the menu has horizontal or vertical orientation. */ - orientation?: string; - /** Specifies options for showing and hiding the first level submenu. */ - showFirstSubmenuMode?: { - /** Specifies the mode name. */ - name?: string; - /** Specifies the delay in submenu showing and hiding. */ - delay?: { - /** The time span after which the submenu is shown. */ - show?: number; - /** The time span after which the submenu is hidden. */ - hide?: number; - }; - }; - /** Specifies the direction at which the submenus are displayed. */ - submenuDirection?: string; - /** A handler for the submenuHidden event. */ - onSubmenuHidden?: Function; - /** Specifies whether or not adaptive widget rendering is enabled on a small screen. */ - adaptivityEnabled?: boolean; - /** A handler for the submenuHiding event. */ - onSubmenuHiding?: Function; - /** A handler for the submenuShowing event. */ - onSubmenuShowing?: Function; - /** A handler for the submenuShown event. */ - onSubmenuShown?: Function; - } - /** A menu widget. */ - export class dxMenu extends dxMenuBase { - constructor(element: JQuery, options?: dxMenuOptions); - constructor(element: Element, options?: dxMenuOptions); - } - export interface dxContextMenuOptions extends dxMenuBaseOptions { - /** Specifies options for displaying the widget. */ - showEvent?: { - /** Specifies the event names on which the widget is shown. */ - name?: String; - /** The time span after which the widget is shown. */ - delay?: Number; - }; - /** A Boolean value specifying whether or not the widget is closed if a user clicks outside of the context menu. */ - closeOnOutsideClick?: any; - /** A handler for the hidden event. */ - onHidden?: Function; - /** A handler for the hiding event. */ - onHiding?: Function; - /** A handler for the positioning event. */ - onPositioning?: Function; - /** A handler for the showing event. */ - onShowing?: Function; - /** A handler for the shown event. */ - onShown?: Function; - /** An object defining widget positioning options. */ - position?: PositionOptions; - /** Specifies the direction at which submenus are displayed. */ - submenuDirection?: string; - /** The target element associated with a popover. */ - target?: any; - /** A Boolean value specifying whether or not the widget is visible. */ - visible?: boolean; - } - /** A context menu widget. */ - export class dxContextMenu extends dxMenuBase { - constructor(element: JQuery, options?: dxContextMenuOptions); - constructor(element: Element, options?: dxContextMenuOptions); - /** Toggles the visibility of the widget. */ - toggle(showing: boolean): JQueryPromise; - /** Shows the widget. */ - show(): JQueryPromise; - /** Hides the widget. */ - hide(): JQueryPromise; - } - export interface dxRemoteOperations { - /** Specifies whether or not filtering must be performed on the server side. */ - filtering?: boolean; - /** Specifies whether or not paging must be performed on the server side. */ - paging?: boolean; - /** Specifies whether or not sorting must be performed on the server side. */ - sorting?: boolean; - /** Specifies whether or not grouping must be performed on the server side. */ - grouping?: boolean; - /** Specifies whether or not paging by groups must be peformed on the server side. */ - groupPaging?: boolean; - /** Specifies whether or not summaries calculation must be performed on the server side. */ - summary?: boolean; - } - export interface dxDataGridRow { - data: Object; - key: any; - rowIndex: number; - rowType: string; - groupIndex: number; - isExpanded: boolean; - isSelected: boolean; - isEditing: boolean; - values: Array; - } - export interface dxDataGridColumn { - /** Specifies the content alignment within column cells. */ - alignment?: string; - /** Specifies whether the values in a column can be edited at runtime. Setting this option makes sense only when editing is enabled for a grid. */ - allowEditing?: boolean; - /** Specifies whether or not a column can be used for filtering grid records. Setting this option makes sense only when the filter row and column header filtering are visible. */ - allowFiltering?: boolean; - /** Specifies whether or not to allow filtering by this column using its header. */ - allowHeaderFiltering?: boolean; - /** Specifies whether or not the column can be anchored to a grid edge by end users. Setting this option makes sense only when the columnFixing | enabled option is set to true. */ - allowFixing?: boolean; - /** Specifies if a column can be used for searching grid records. Setting this option makes sense only when the search panel is visible. */ - allowSearch?: boolean; - /** Specifies whether the user can group data by values of this column. Applies only when grouping is enabled. */ - allowGrouping?: boolean; - /** Specifies whether or not a column can be hidden by a user. Setting this option makes sense only when the column chooser is visible. */ - allowHiding?: boolean; - /** Specifies whether or not a particular column can be used in column reordering. Setting this option makes sense only when the allowColumnReordering option is set to true. */ - allowReordering?: boolean; - /** Specifies whether or not a particular column can be resized by a user. Setting this option makes sense only when the allowColumnResizing option is true. */ - allowResizing?: boolean; - /** Specifies whether grid records can be sorted by a specific column at runtime. Setting this option makes sense only when the sorting mode differs from none. */ - allowSorting?: boolean; - /** Specifies whether groups appear expanded or not when records are grouped by a specific column. Setting this option makes sense only when grouping is allowed for this column. */ - autoExpandGroup?: boolean; - /** Specifies a callback function that returns a value to be displayed in a column cell. */ - calculateCellValue?: (rowData: Object) => string; - /** Specifies a callback function to be invoked after the cell value is edited by an end-user and before the new value is saved to the data source. */ - setCellValue?: (rowData: Object, value: any) => void; - /** Specifies a callback function that defines filters for customary calculated grid cells. */ - calculateFilterExpression?: (filterValue: any, selectedFilterOperation: string, target: string) => any; - /** Specifies a caption for a column. */ - caption?: string; - /** Specifies a custom template for grid column cells. */ - cellTemplate?: any; - /** Specifies a CSS class to be applied to a column. */ - cssClass?: string; - /** Specifies how to get a value to be displayed in a cell when it is not in an editing state. */ - calculateDisplayValue?: any; - /** Specifies a field name or a function that returns a field name or a value to be used for grouping column cells. */ - calculateGroupValue?: any; - /** Specifies a field name or a function that returns a field name or a value to be used for sorting column cells. */ - calculateSortValue?: any; - /** Specifies a callback function that returns the text to be displayed in the cells of a column. */ - customizeText?: (cellInfo: { value: any; valueText: string; target: string; groupInterval: any }) => string; - /** Specifies the field of a data source that provides data for a column. */ - dataField?: string; - /** Specifies the required type of column values. */ - dataType?: string; - /** Specifies a custom template for the cell of a grid column when it is in an editing state. */ - editCellTemplate?: any; - /** Specifies configuration options for the editor widget of the current column. */ - editorOptions?: Object; - /** Specifies whether HTML tags are displayed as plain text or applied to the values of the column. */ - encodeHtml?: boolean; - /** In a boolean column, replaces all false items with a specified text. */ - falseText?: string; - /** Specifies the set of available filter operations. */ - filterOperations?: Array; - /** Specifies a filter value for a column. */ - filterValue?: any; - /** Specifies initial filter values for the column's header filter. */ - filterValues?: Array; - /** Specifies whether to include or exclude the records with the values selected in the column's header filter. */ - filterType?: string; - /** Indicates whether the column takes part in horizontal grid scrolling or is anchored to a grid edge. */ - fixed?: boolean; - /** Specifies the order according to which grid columns must be concealed when the widget adapts to the screen or container size. */ - hidingPriority?: number; - /** Specifies the grid edge to which the column is anchored. */ - fixedPosition?: string; - /** Specifies a format for the values displayed in a column. */ - format?: any; - /** Specifies a custom template for the group cell of a grid column. */ - groupCellTemplate?: any; - /** Specifies the index of a column when grid records are grouped by the values of this column. */ - groupIndex?: number; - /** Specifies a custom template for the header of a grid column. */ - headerCellTemplate?: any; - /** Specifies options of a lookup column. */ - lookup?: { - /** Specifies whether or not a user can nullify values of a lookup column. */ - allowClearing?: boolean; - /** Specifies the data source providing data for a lookup column. */ - dataSource?: any; - /** Specifies the expression defining the data source field whose values must be displayed. */ - displayExpr?: any; - /** Specifies the expression defining the data source field whose values must be replaced. */ - valueExpr?: string; - }; - /** Specifies column-level options for filtering using a column header filter. */ - headerFilter?: { - /** Specifies the data source to be used for the header filter. */ - dataSource?: any; - /** Specifies how header filter values should be combined into groups. */ - groupInterval?: any; - }; - /** * Specifies a precision for formatted values displayed in a column. * @deprecated Use the format | precision option instead. */ - precision?: number; - /** Specifies the default filter operation of a column. */ - selectedFilterOperation?: string; - /** Specifies whether or not the column displays its values by using editors. */ - showEditorAlways?: boolean; - /** Specifies whether or not to display the column when grid records are grouped by it. */ - showWhenGrouped?: boolean; - /** Specifies the index of a column when grid records are sorted by the values of this column. */ - sortIndex?: number; - /** Specifies the initial sort order of column values. */ - sortOrder?: string; - /** In a boolean column, replaces all true items with a specified text. */ - trueText?: string; - /** Specifies whether a column is visible or not. */ - visible?: boolean; - /** Specifies the sequence number of the column in the grid. */ - visibleIndex?: number; - /** Specifies a column width in pixels or percentages. */ - width?: any; - /** Specifies an array of validation rules to be checked when updating column cell values. */ - validationRules?: Array; - /** Specifies whether or not to display the header of a hidden column in the column chooser. */ - showInColumnChooser?: boolean; - /** Specifies the identifier of the column. */ - name?: string; - /** The form item configuration object. Used only when the editing mode is "form". */ - formItem?: DevExpress.ui.dxFormItem; - /** An array of grid columns. */ - columns?: Array; - /** Specifies the band column that owns the current column. Accepts the index of the band column in the columns array. */ - ownerBand?: number; - /** Specifies whether the column bands other columns or not. */ - isBand?: boolean; - } - export interface dxDataGridOptions extends WidgetOptions { - /** Specifies whether the outer borders of the grid are visible or not. */ - showBorders?: boolean; - /** Indicates whether to show the error row for the grid. */ - errorRowEnabled?: boolean; - /** A handler for the rowValidating event. */ - onRowValidating?: (e: Object) => void; - /** A handler for the contextMenuPreparing event. */ - onContextMenuPreparing?: (e: Object) => void; - /** A handler for the toolbarPreparing event. */ - onToolbarPreparing?: (e: Object) => void; - /** A handler for the initNewRow event. */ - onInitNewRow?: (e: { data: Object }) => void; - /** A handler for the rowInserted event. */ - onRowInserted?: (e: { data: Object; key: any }) => void; - /** A handler for the rowInserting event. */ - onRowInserting?: (e: { data: Object; cancel: any }) => void; - /** A handler for the rowRemoved event. */ - onRowRemoved?: (e: { data: Object; key: any }) => void; - /** A handler for the rowRemoving event. */ - onRowRemoving?: (e: { data: Object; key: any; cancel: any }) => void; - /** A handler for the rowUpdated event. */ - onRowUpdated?: (e: { data: Object; key: any }) => void; - /** A handler for the rowUpdating event. */ - onRowUpdating?: (e: { oldData: Object; newData: Object; key: any; cancel: any }) => void; - /** Enables a hint that appears when a user hovers the mouse pointer over a cell with truncated content. */ - cellHintEnabled?: boolean; - /** Specifies whether or not the widget should hide columns in order to adapt to the screen or container size. */ - columnHidingEnabled?: boolean; - /** Specifies whether or not grid columns can be reordered by a user. */ - allowColumnReordering?: boolean; - /** Specifies whether or not grid columns can be resized by a user. */ - allowColumnResizing?: boolean; - /** A handler for the cellClick event. */ - onCellClick?: any; - /** A handler for the cellHoverChanged event. */ - onCellHoverChanged?: (e: Object) => void; - /** A handler for the cellPrepared event. */ - onCellPrepared?: (e: Object) => void; - /** A handler for the adaptiveDetailRowPreparing event. */ - onAdaptiveDetailRowPreparing?: (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 how the end-user chooses columns. */ - mode?: string; - /** Specifies the height of the column chooser panel. */ - height?: number; - /** Specifies text displayed in the title of the column chooser panel. */ - title?: string; - /** Specifies the width of the column chooser panel. */ - width?: number; - }; - /** Specifies options for column fixing. */ - columnFixing?: { - /** Indicates if column fixing is enabled. */ - enabled?: boolean; - /** Contains options that specify texts for column-fixing related commands in the column header's context menu. */ - texts?: { - /** Specifies text for a context menu item that fixes the column for which the context menu is invoked. */ - fix?: string; - /** Specifies text for a context menu item that unfixes the column for which the context menu is invoked. */ - unfix?: string; - /** Specifies text for a context menu subitem that fixes a column, for which the context menu is invoked, to the left grid edge. */ - leftPosition?: string; - /** Specifies text for a context menu subitem that fixes a column, for which the context menu is invoked, to the right grid edge. */ - rightPosition?: string; - }; - }; - /** Specifies options for filtering using a column header filter. */ - headerFilter?: { - /** Indicates whether or not the column header filter button is visible. */ - visible?: boolean; - /** Specifies the height of the dropdown menu invoked when using a column header filter. */ - height?: number; - /** Specifies the width of the dropdown menu invoked when using a column header filter. */ - width?: number; - /** Contains options that specify texts for the dropdown menu invoked when you use a column header filter. */ - texts?: { - /** Specifies text for the item specifying an empty value in the column header filter's dropdown menu. */ - emptyValue?: string; - /** Specifies text for a button that closes the column header filter's dropdown menu and applies specified filtering. */ - ok?: string; - /** Specifies text for a button that closes the column header filter's dropdown menu without applying performed selection. */ - cancel?: string; - } - }; - /** An array of grid columns. */ - columns?: Array; - onContentReady?: Function; - /** Specifies a function that customizes grid columns after they are created. */ - customizeColumns?: (columns: Array) => void; - /** Customizes grid columns and data before exporting. */ - customizeExportData?: (columns: Array, rows: Array) => void; - /** Specifies a data source for the grid. */ - dataSource?: any; - /** Specifies whether or not to enable data caching. */ - cacheEnabled?: boolean; - /** A handler for the editingStart event. */ - onEditingStart?: (e: { - data: Object; - key: any; - cancel: boolean; - column: dxDataGridColumn - }) => void; - /** A handler for the editorPrepared event. */ - onEditorPrepared?: (e: Object) => void; - /** A handler for the editorPreparing event. */ - onEditorPreparing?: (e: Object) => void; - /** Contains options that specify how grid content can be changed. */ - editing?: { - editMode?: string; - editEnabled?: boolean; - insertEnabled?: boolean; - removeEnabled?: boolean; - /** Specifies how grid values can be edited manually. */ - mode?: string; - /** Specifies whether or not grid records can be edited at runtime. */ - allowUpdating?: boolean; - /** Specifies whether or not new grid records can be added at runtime. */ - allowAdding?: boolean; - /** Specifies whether or not grid records can be deleted at runtime. */ - allowDeleting?: boolean; - /** The form configuration object. Used only when the editing mode is "form". */ - form?: DevExpress.ui.dxFormOptions; - /** Contains options that specify texts for editing-related grid controls. */ - texts?: { - /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Save" button. Setting this option makes sense only when the mode option is set to batch. */ - saveAllChanges?: string; - /** Specifies text for a cancel button displayed when a row is in the editing state. Setting this option makes sense only when the allowUpdating option is set to true. */ - cancelRowChanges?: string; - /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Revert" button. Setting this option makes sense only when the mode option is set to batch. */ - cancelAllChanges?: string; - /** Specifies a message to be displayed by a confirmation window. Setting this option makes sense only when the edit mode is "row". */ - confirmDeleteMessage?: string; - /** Specifies text to be displayed in the title of a confirmation window. Setting this option makes sense only when the edit mode is "row". */ - confirmDeleteTitle?: string; - /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Cancel changes" button. Setting this option makes sense only when the mode option is set to cell and the validation capabilities are enabled. -#####See Also##### -- Validation Engine -- Validation Engine - MVVM Approach */ - validationCancelChanges?: string; - /** Specifies text for a button that deletes a row from a grid. Setting this option makes sense only when the allowDeleting option is set to true. */ - deleteRow?: string; - /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Add" button. Setting this option makes sense only when the allowAdding option is true. */ - addRow?: string; - /** Specifies text for a button that turns a row into the editing state. Setting this option makes sense only when the allowUpdating option is set to true. */ - editRow?: string; - /** Specifies text for a save button displayed when a row is in the editing state. Setting this option makes sense only when the allowUpdating option is set to true. */ - saveRowChanges?: string; - /** Specifies text for a button that recovers a deleted row. Setting this option makes sense only if the grid uses the batch edit mode and the allowDeleting option is set to true. */ - undeleteRow?: string; - }; - }; - /** Specifies filter row options. */ - filterRow?: { - /** Specifies when to apply a filter. */ - applyFilter?: string; - /** Specifies text for the hint that pops up when a user hovers the mouse pointer over the "Apply Filter" button. */ - applyFilterText?: string; - /** Specifies descriptions for filter operations. */ - operationDescriptions?: { - /** Description for the '=' operation. */ - equal?: string; - /** Description for the '<>' operation. */ - notEqual?: string; - /** Description for the '<' operation. */ - lessThan?: string; - /** Description for the '<=' operation. */ - lessThanOrEqual?: string; - /** Description for the '>' operation. */ - greaterThan?: string; - /** Description for the '>=' operation. */ - greaterThanOrEqual?: string; - /** Description for the 'startswith' operation. */ - startsWith?: string; - /** Description for the 'contains' operation. */ - contains?: string; - /** Description for the 'notcontains' operation. */ - notContains?: string; - /** Description for the 'endswith' operation. */ - endsWith?: string; - /** Description for the 'between' operation. */ - between?: string; - }; - /** Specifies text for the reset operation in a filter list. */ - resetOperationText?: string; - /** Specifies text for the operation of clearing the applied filter when a select box is used. */ - showAllText?: string; - /** Specifies text for the range start in the 'between' filter type. */ - betweenStartText?: string; - /** Specifies text for the range end in the 'between' filter type. */ - betweenEndText?: string; - /** Specifies whether or not an icon that allows the user to choose a filter operation is visible. */ - showOperationChooser?: boolean; - /** Specifies whether the filter row is visible or not. */ - visible?: boolean; - }; - /** Specifies grouping settings and 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; - /** Enables the user to group data using the context menu. */ - contextMenuEnabled?: boolean; - /** Specifies the event on which a group will be expanded/collapsed. */ - expandMode?: string; - groupContinuedMessage?: string; - groupContinuesMessage?: string; - /** Defines the texts of grouping-related visual elements. */ - texts?: { - /** 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 the text of the context menu item that groups data by a specific column. */ - groupByThisColumn?: string; - /** Specifies the text of the context menu item that clears grouping settings of a specific column. */ - ungroup?: string; - /** Specifies the text of the context menu item that clears grouping settings of all columns. */ - ungroupAll?: string; - } - }; - /** Configures 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?: any; - }; - /** Specifies options configuring the load panel. */ - loadPanel?: { - /** Specifies whether to show the load panel or not. */ - enabled?: any; - /** 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 DataGrid loads data page by page or all at once. */ - enabled?: boolean; - /** Specifies the grid page that should be displayed by default. */ - pageIndex?: number; - /** Specifies the size of grid pages. */ - pageSize?: number; - }; - /** Specifies whether or not grid rows must be shaded in a different way. */ - rowAlternationEnabled?: boolean; - /** Specifies whether to enable two-way data binding. */ - twoWayBindingEnabled?: boolean; - /** A handler for the rowClick event. */ - onRowClick?: any; - /** A handler for the rowPrepared event. */ - onRowPrepared?: (e: Object) => void; - /** Specifies a custom template for grid rows. */ - rowTemplate?: any; - /** A configuration object specifying scrolling options. */ - scrolling?: { - /** Specifies the scrolling mode. */ - mode?: string; - /** Specifies whether or not a grid must preload pages adjacent to the current page when using virtual scrolling. */ - preloadEnabled?: boolean; - /** Specifies whether or not the widget uses native scrolling. */ - useNative?: any; - /** Specifies the scrollbar display policy. */ - showScrollbar?: string; - /** Specifies whether or not the scrolling by content is enabled. */ - scrollByContent?: boolean; - /** Specifies whether or not the scrollbar thumb scrolling enabled. */ - scrollByThumb?: boolean; - }; - /** Specifies options of the search panel. */ - searchPanel?: { - /** Specifies whether or not search strings in the located grid records should be highlighted. */ - highlightSearchText?: boolean; - /** Specifies text displayed by the search panel when no search string was typed. */ - placeholder?: string; - /** Specifies whether the search panel is visible or not. */ - visible?: boolean; - /** Specifies whether to search all columns or only visible ones. */ - searchVisibleColumnsOnly?: 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 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; - }; - /** Configures client-side export. */ - export?: { - /** Enables the client-side export feature. */ - 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 IE9 and Safari browsers. */ - proxyUrl?: string; - /** Allows an end user to export selected rows only. */ - allowExportSelectedData?: boolean; - /** Contains options that specify texts for the export-related commands and hints. */ - texts?: { - /** Specifies the hint of the Export button when the allowExportSelectedData option is true. */ - exportTo?: string; - exportToExcel?: string; - excelFormat?: string; - selectedRows?: string; - /** Specifies the text of the command that exports all data. */ - exportAll?: string; - /** Specifies the text of the drop-down menu command that exports selected rows. */ - exportSelectedRows?: string; - } - }; - /** Specifies the keys of the records that must appear initially selected. */ - selectedRowKeys?: Array; - /** Specifies filters for the records that must appear initially selected. */ - selectionFilter?: Object; - /** 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; - maxFilterLengthInRequest?: number; - /** Specifies the mode in which all the records are selected. */ - selectAllMode?: string; - /** Specifies whether or not deferred row selection is enabled. */ - deferred?: boolean; - }; - /** A handler for the dataErrorOccured event. */ - onDataErrorOccurred?: (e: { error: Error }) => void; - /** A handler for the selectionChanged event. */ - onSelectionChanged?: (e: { - currentSelectedRowKeys: Array; - currentDeselectedRowKeys: Array; - selectedRowKeys: Array; - selectedRowsData: Array; - }) => void; - /** A handler for the exporting event. */ - onExporting?: (e: { - fileName: string; - cancel: boolean; - }) => void; - /** A handler for the fileSaving event. */ - onFileSaving?: (e: { - fileName: string; - format: string; - data: any; - cancel: boolean; - }) => void; - /** A handler for the exported event. */ - onExported?: (e: Object) => void; - /** A handler for the keyDown event. */ - onKeyDown?: (e: Object) => void; - /** A handler for the rowExpanding event. */ - onRowExpanding?: (e: Object) => void; - /** A handler for the rowExpanded event. */ - onRowExpanded?: (e: Object) => void; - /** A handler for the rowCollapsing event. */ - onRowCollapsing?: (e: Object) => void; - /** A handler for the rowCollapsed event. */ - onRowCollapsed?: (e: Object) => void; - /** Specifies whether column headers are visible or not. */ - showColumnHeaders?: boolean; - /** Specifies whether or not vertical lines separating one grid column from another are visible. */ - showColumnLines?: boolean; - /** Specifies whether or not horizontal lines separating one grid row from another are visible. */ - showRowLines?: boolean; - /** Specifies options of runtime sorting. */ - sorting?: { - /** Specifies text for the context menu item that sets an ascending sort order in a column. */ - ascendingText?: string; - /** Specifies text for the context menu item that resets sorting settings for a column. */ - clearText?: string; - /** Specifies text for the context menu item that sets a descending sort order in a column. */ - descendingText?: string; - /** Specifies the runtime sorting mode. */ - mode?: string; - }; - /** Specifies options of state storing. */ - stateStoring?: { - /** Specifies a callback function that performs specific actions on state loading. */ - customLoad?: () => JQueryPromise; - /** Specifies a callback function that performs specific actions on state saving. */ - customSave?: (state: Object) => void; - /** Specifies whether or not a grid saves its state. */ - enabled?: boolean; - /** Specifies the delay between the last change of a grid state and the operation of saving this state in milliseconds. */ - savingTimeout?: number; - /** Specifies a unique key to be used for storing the grid state. */ - storageKey?: string; - /** Specifies the type of storage to be used for state storing. */ - type?: string; - }; - /** Specifies the options of the grid summary. */ - summary?: { - /** Contains options that specify text patterns for summary items. */ - texts?: { - /** Specifies a pattern for the 'sum' summary items when they are displayed in the parent column. */ - sum?: string; - /** Specifies a pattern for the 'sum' summary items displayed in a group row or in any other column rather than the parent one. */ - sumOtherColumn?: string; - /** Specifies a pattern for the 'min' summary items when they are displayed in the parent column. */ - min?: string; - /** Specifies a pattern for the 'min' summary items displayed in a group row or in any other column rather than the parent one. */ - minOtherColumn?: string; - /** Specifies a pattern for the 'max' summary items when they are displayed in the parent column. */ - max?: string; - /** Specifies a pattern for the 'max' summary items displayed in a group row or in any other column rather than the parent one. */ - maxOtherColumn?: string; - /** Specifies a pattern for the 'avg' summary items when they are displayed in the parent column. */ - avg?: string; - /** Specifies a pattern for the 'avg' summary items displayed in a group row or in any other column rather than the parent one. */ - avgOtherColumn?: string; - /** Specifies a pattern for the 'count' summary items. */ - count?: string; - }; - /** Specifies items of the group summary. */ - groupItems?: Array<{ - /** Specifies the identifier of a summary item. */ - name?: string; - /** Specifies the column that provides data for a group summary item. */ - column?: string; - /** Customizes the text to be displayed in the summary item. */ - customizeText?: (itemInfo: { - value: any; - valueText: string; - }) => string; - /** Specifies a pattern for the summary item text. */ - displayFormat?: string; - /** * Specifies a precision for the summary item value of a numeric format. * @deprecated Use the valueFormat | precision option instead. */ - 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?: any; - /** Specifies whether or not to skip empty strings, null and undefined values when calculating a summary. */ - skipEmptyValues?: boolean; - }>; - /** Specifies items of the total summary. */ - totalItems?: Array<{ - /** 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. * @deprecated Use the valueFormat | precision option instead. */ - 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?: any; - /** Specifies whether or not to skip empty strings, null and undefined values when calculating a summary. */ - skipEmptyValues?: boolean; - }>; - /** Specifies whether or not to skip empty strings, null and undefined values when calculating a summary. */ - skipEmptyValues?: boolean; - /** Allows you to use a custom aggregate function to calculate the value of a summary item. */ - calculateCustomSummary?: (options: { - component: dxDataGrid; - 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 implements DataHelperMixin { - 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; - /** Allows you to obtain a row element by its index. */ - getRowElement(rowIndex: number): any; - /** Returns the current state of the grid. */ - state(): Object; - /** Sets the grid state. */ - state(state: Object): void; - /** Allows you to obtain the row index by a data key. */ - getRowIndexByKey(key: any): number; - /** Allows you to obtain the data key by a row index. */ - getKeyByRowIndex(rowIndex: number): any; - /** Adds a new column to a grid. */ - addColumn(columnOptions: dxDataGridColumn): void; - /** Removes the column from the grid. */ - deleteColumn(id: any): void; - /** Displays the load panel. */ - beginCustomLoading(messageText: string): void; - /** Discards changes made in a grid. */ - cancelEditData(): void; - /** Checks whether or not the grid contains unsaved changes. */ - hasEditData(): boolean; - /** Clears all the filters of a specific type applied to grid records. */ - clearFilter(): void; - /** Deselects all grid records. */ - clearSelection(): void; - /** Draws the cell being edited from the editing state. Use this method when the edit mode is batch. */ - closeEditCell(): void; - /** Collapses groups or master rows in a grid. */ - collapseAll(groupIndex?: number): void; - /** Returns the number of data columns in a grid. */ - columnCount(): number; - /** Returns the value of a specific column option. */ - columnOption(id: any, optionName: string): any; - /** Sets an option of a specific column. */ - columnOption(id: any, optionName: string, optionValue: any): void; - /** Returns the options of a column by an identifier. */ - columnOption(id: any): Object; - /** Sets several options of a column at once. */ - columnOption(id: any, options: Object): void; - /** Gets an array of visible columns. */ - getVisibleColumns(): Array; - /** Gets an array of visible columns at a specific hierarchical level of column headers. */ - getVisibleColumns(headerLevel?: number): Array; - /** Gets an array of visible rows. */ - getVisibleRows(): Array; - /** Sets a specific cell into the editing state. */ - editCell(rowIndex: number, visibleColumnIndex: number): void; - /** Sets a specific cell into the editing state. */ - editCell(rowIndex: number, dataField: string): void; - /** Sets a specific row into the editing state. */ - editRow(rowIndex: number): void; - /** Gets the cell value. */ - cellValue(rowIndex: number, dataField: string): any; - /** Gets the cell value. */ - cellValue(rowIndex: number, visibleColumnIndex: number): any; - /** Sets the cell value. */ - cellValue(rowIndex: number, dataField: string, value: any): void; - /** Sets the cell value. */ - cellValue(rowIndex: number, visibleColumnIndex: number, value: any): void; - /** Hides the load panel. */ - endCustomLoading(): void; - /** Expands groups or master rows in a grid. */ - expandAll(groupIndex: number): void; - /** Allows you to find out whether a specific group or master row is expanded or collapsed. */ - isRowExpanded(key: any): boolean; - /** Allows you to expand a specific group or master row by its key. */ - expandRow(key: any): void; - /** Allows you to collapse a specific group or master row by its key. */ - collapseRow(key: any): void; - /** Checks whether a specific adaptive detail row is expanded or collapsed. */ - isAdaptiveDetailRowExpanded(key: any): void; - /** Expands an adaptive detail row by the key of its parent data row. */ - expandAdaptiveDetailRow(key: any): void; - /** Collapses the currently expanded adaptive detail row (if there is one). */ - collapseAdaptiveDetailRow(): 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 scenarios. */ - getCombinedFilter(): any; - /** Returns a filter expression applied to the grid using all possible scenarios. */ - getCombinedFilter(returnDataField?: boolean): any; - /** Gets the keys of currently selected grid records. */ - getSelectedRowKeys(): any; - /** Gets the data objects of the currently selected grid records. */ - getSelectedRowsData(): any; - /** Hides the column chooser panel. */ - hideColumnChooser(): void; - /** Adds a new data row to a grid. */ - addRow(): void; - /** * Adds a new data row to a grid. * @deprecated Use the addRow() method instead. */ - insertRow(): void; - /** Returns the key corresponding to the passed data object. */ - keyOf(obj: Object): any; - /** Switches a grid to a specified page. */ - pageIndex(newIndex: number): void; - /** Gets the index of the current page. */ - pageIndex(): number; - /** Sets the page size. */ - pageSize(value: number): void; - /** Gets the current page size. */ - pageSize(): number; - /** Refreshes grid data. */ - refresh(): JQueryPromise; - /** Removes a specific row from a grid. */ - deleteRow(rowIndex: number): void; - /** * Removes a specific row from a grid. * @deprecated Use the deleteRow(rowIndex) method instead. */ - removeRow(rowIndex: number): void; - /** Saves changes made in a grid. */ - saveEditData(): JQueryPromise; - /** Searches grid records by a search string. */ - searchByText(text: string): void; - /** Selects all grid records. */ - selectAll(): void; - /** Deselects the currently selected rows. */ - 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 or not the row with a specified data object is selected. */ - isRowSelected(arg: any): boolean; - /** Invokes the column chooser panel. */ - showColumnChooser(): void; - startSelectionWithCheckboxes(): boolean; - /** Returns how many pages the grid contains. */ - pageCount(): number; - /** 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; - getDataSource(): DevExpress.data.DataSource; - /** Gets instance of the Scrollable widget. */ - getScrollable(): dxScrollable; - /** Redraws the specified rows. */ - repaintRows(rowIndexes: Array): void; - } - export interface dxPivotGridOptions extends WidgetOptions { - onContentReady?: Function; - /** Specifies a data source for the pivot grid. */ - dataSource?: any; - useNativeScrolling?: any; - /** A configuration object specifying scrolling options. */ - scrolling?: { - /** Specifies the scrolling mode. */ - mode?: string; - /** Specifies whether or not the widget uses native scrolling. */ - useNative?: any; - }; - /** Allows an end-user to change sorting options. */ - allowSorting?: boolean; - /** Allows an end-user to sort columns by summary values. */ - allowSortingBySummary?: boolean; - /** Allows an end-user to change filtering options. */ - allowFiltering?: boolean; - /** Specifies the area to which data field headers must belong. */ - dataFieldArea?: string; - /** Configures the field panel. */ - fieldPanel?: { - /** Makes fields on the field panel draggable. */ - allowFieldDragging?: boolean; - /** Shows/hides filter fields on the field panel. */ - showFilterFields?: boolean; - /** Shows/hides data fields on the field panel. */ - showDataFields?: boolean; - /** Shows/hides column fields on the field panel. */ - showColumnFields?: boolean; - /** Shows/hides row fields on the field panel. */ - showRowFields?: boolean; - /** Shows/hides the field panel. */ - visible?: boolean; - /** Specifies the placeholders of the field areas. */ - texts?: { - /** Specifies the placeholder of the column field area. */ - columnFieldArea?: string; - /** Specifies the placeholder of the row field area. */ - rowFieldArea?: string; - /** Specifies the placeholder of the filter field area. */ - filterFieldArea?: string; - /** Specifies the placeholder of the data field area. */ - dataFieldArea?: string; - } - } - /** Allows an end-user to expand/collapse all header items within a header level. */ - allowExpandAll?: boolean; - /** Specifies whether long text in header items should be wrapped. */ - wordWrapEnabled?: boolean; - /** Specifies whether to display the Total rows. */ - showRowTotals?: boolean; - /** Specifies whether to display the Grand Total row. */ - showRowGrandTotals?: boolean; - /** Specifies whether to display the Total columns. */ - showColumnTotals?: boolean; - /** Specifies whether to display the Grand Total column. */ - showColumnGrandTotals?: boolean; - /** Specifies whether or not to hide rows and columns with no data. */ - hideEmptySummaryCells?: boolean; - /** Specifies where to show the total rows or columns. */ - showTotalsPrior?: string; - /** Specifies the layout of items in the row header. */ - rowHeaderLayout?: string; - /** Specifies whether the outer borders of the grid are visible or not. */ - showBorders?: boolean; - /** The Field Chooser configuration options. */ - fieldChooser?: { - /** Enables or disables the field chooser. */ - enabled?: boolean; - /** Specifies the field chooser layout. */ - layout?: number; - /** Specifies the text to display as a title of the field chooser popup window. */ - title?: string; - /** Specifies the field chooser width. */ - width?: number; - /** Specifies the field chooser height. */ - height?: number; - /** Strings that can be changed or localized in the pivot grid's integrated Field Chooser. */ - texts?: { - /** The string to display instead of Row Fields. */ - rowFields?: string; - /** The string to display instead of Column Fields. */ - columnFields?: string; - /** The string to display instead of Data Fields. */ - dataFields?: string; - /** The string to display instead of Filter Fields. */ - filterFields?: string; - /** The string to display instead of All Fields. */ - allFields?: string; - }; - } - /** Strings that can be changed or localized in the PivotGrid widget. */ - texts?: { - /** The string to display as a header of the Grand Total row and column. */ - grandTotal?: string; - /** The string to display as a header of the Total row and column. */ - total?: string; - /** Specifies the text displayed when a pivot grid does not contain any fields. */ - noData?: string; - /** The string to display as a Show Field Chooser context menu item. */ - showFieldChooser?: string; - /** The string to display as an Expand All context menu item. */ - expandAll?: string; - /** The string to display as a Collapse All context menu item. */ - collapseAll?: string; - /** The string to display as a Sort Column by Summary Value context menu item. */ - sortColumnBySummary?: string; - /** The string to display as a Sort Row by Summary Value context menu item. */ - sortRowBySummary?: string; - /** The string to display as a Remove All Sorting context menu item. */ - removeAllSorting?: string; - /** The string to display as an Export to Excel file context menu item. */ - exportToExcel?: string; - }; - /** Specifies options configuring the load panel. */ - 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; - /** Configures client-side export. */ - export?: { - /** Enables client-side export. */ - 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 IE9 and Safari browsers. */ - proxyUrl?: string; - }; - /** A handler for the exporting event. */ - onExporting?: (e: { - fileName: string; - cancel: boolean; - }) => void; - /** A handler for the fileSaving event. */ - onFileSaving?: (e: { - fileName: string; - format: string; - data: any; - cancel: boolean; - }) => void; - /** A handler for the exported event. */ - onExported?: (e: Object) => void; - /** A configuration object specifying options related to state storing. */ - stateStoring?: { - /** Specifies a callback function that performs specific actions on state loading. */ - customLoad?: () => JQueryPromise; - /** Specifies a callback function that performs specific actions on state saving. */ - customSave?: (gridState: Object) => void; - /** Specifies whether or not a grid saves its state. */ - enabled?: boolean; - /** Specifies the delay between the last change of a grid state and the operation of saving this state in milliseconds. */ - savingTimeout?: number; - /** Specifies a unique key to be used for storing the grid state. */ - storageKey?: string; - /** Specifies the type of storage to be used for state storing. */ - type?: string; - }; - } - /** A data summarization widget for multi-dimensional data analysis and data mining. */ - export class dxPivotGrid extends Widget { - constructor(element: JQuery, options?: dxPivotGridOptions); - constructor(element: Element, options?: dxPivotGridOptions); - /** Gets the PivotGridDataSource instance. */ - getDataSource(): DevExpress.data.PivotGridDataSource; - /** Gets the Popup 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; - /** Binds a Chart to the PivotGrid. */ - bindChart(chart: any, integrationOptions?: { - inverted?: boolean; - dataFieldsDisplayMode?: string; - putDataFieldsInto?: string; - alternateDataFields?: boolean; - processCell?: Function; - customizeChart?: Function; - customizeSeries?: Function; - }): any; - } - 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 PivotGrid widget. */ - dataSource?: DevExpress.data.PivotGridDataSource; - onContentReady?: Function; - /** A handler for the contextMenuPreparing event. */ - onContextMenuPreparing?: (e: Object) => void; - /** Strings that can be changed or localized in the PivotGridFieldChooser 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 PivotGrid that allows you to manage data displayed in the PivotGrid. */ - 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; - /** Gets the PivotGridDataSource instance. */ - getDataSource(): DevExpress.data.PivotGridDataSource; - } -} -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 { - /** 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 Button widget. */ - type?: string; - /** A Boolean value specifying whether or not the widget associated with this command is visible. */ - visible?: boolean; - } - /** A markup component used to define markup options for a command. */ - export class dxCommand extends DOMComponent { - constructor(element: JQuery, options: dxCommandOptions); - constructor(options: dxCommandOptions); - /** Executes the action associated with this command. */ - execute(): void; - } - /** An object responsible for routing. */ - export class Router { - /** Adds a routing rule to the list of registered rules. */ - register(pattern: string, defaults?: Object, constraints?: Object): void; - /** Decodes the specified URI to an object using the registered routing rules. */ - parse(uri: string): Object; - /** Formats an object to a URI. */ - format(obj: Object): string; - } - export interface StateManagerOptions { - /** A storage to which the state manager saves the application state. */ - storage?: Object; - } - /** An object used to store the current application state. */ - export class StateManager { - constructor(options?: StateManagerOptions); - /** Adds an object that implements an interface of a state source to the state manager's collection of state sources. */ - addStateSource(stateSource: Object): void; - /** Removes a specified state source from the state manager's collection of state sources. */ - removeStateSource(stateSource: Object): void; - /** Saves the current application state. */ - saveState(): void; - /** Restores the application state that has been saved by the saveState() method to the state storage. */ - restoreState(): void; - /** Removes the application state that has been saved by the saveState() method to the state storage. */ - clearState(): void; - } - export module html { - export var layoutSets: Array; - export var animationSets: { [animationSetName: string]: AnimationSet }; - export interface AnimationSet { - [animationName: string]: any - } - export interface HtmlApplicationOptions { - /** Specifies where the commands that are defined in the application's views must be displayed. */ - commandMapping?: Object; - /** Specifies whether or not view caching is disabled. */ - disableViewCache?: boolean; - /** An array of layout controllers that should be used to show application views in the current navigation context. */ - layoutSet?: any; - /** Specifies the animation presets that are used to animate different UI elements in the current application. */ - animationSet?: AnimationSet; - /** Specifies whether the current application must behave as a mobile or web application. */ - mode?: string; - /** Specifies the object that represents a root namespace of the application. */ - namespace?: Object; - /** Specifies application behavior when the user navigates to a root view. */ - navigateToRootViewMode?: string; - /** An array of dxCommand configuration objects used to define commands available from the application's global navigation. */ - navigation?: Array; - /** A state manager to be used in the application. */ - stateManager?: StateManager; - /** Specifies the storage to be used by the application's state manager to store the application state. */ - stateStorage?: Object; - /** Indicates whether on not to use the title of the previously displayed view as text on the Back button. */ - useViewTitleAsBackText?: boolean; - /** A custom view cache to be used in the application. */ - viewCache?: Object; - /** Specifies a limit for the views that can be cached. */ - viewCacheSize?: number; - /** Specifies the current version of application templates. */ - templatesVersion?: string; - /** Specifies options for the viewport meta tag of a mobile browser. */ - viewPort?: JQuery; - /** A custom router to be used in the application. */ - router?: Router; - } - /** An object used to manage views, as well as control the application life cycle. */ - export class HtmlApplication implements EventsMixin { - constructor(options: HtmlApplicationOptions); - afterViewSetup: JQueryCallback; - beforeViewSetup: JQueryCallback; - initialized: JQueryCallback; - navigating: JQueryCallback; - navigatingBack: JQueryCallback; - resolveLayoutController: JQueryCallback; - resolveViewCacheKey: JQueryCallback; - viewDisposed: JQueryCallback; - viewDisposing: JQueryCallback; - viewHidden: JQueryCallback; - viewRendered: JQueryCallback; - viewShowing: JQueryCallback; - viewShown: JQueryCallback; - /** Provides access to the ViewCache object. */ - viewCache: ViewCache; - /** An array of dxCommand components that are created based on the application's navigation option value. */ - navigation: Array; - /** Provides access to the StateManager object. */ - stateManager: StateManager; - /** Provides access to the Router object. */ - router: Router; - /** Navigates to the URI preceding the current one in the navigation history. */ - back(): void; - /** Returns a Boolean value indicating whether or not backwards navigation is currently possible. */ - canBack(): boolean; - /** Calls the clearState() method of the application's StateManager object. */ - clearState(): void; - /** Creates global navigation commands. */ - createNavigation(navigationConfig: Array): void; - /** Returns an HTML template of the specified view. */ - getViewTemplate(viewName: string): JQuery; - /** Returns a configuration object used to create a dxView component for a specified view. */ - getViewTemplateInfo(viewName: string): Object; - /** Adds a specified HTML template to a collection of view or layout templates. */ - loadTemplates(source: any): JQueryPromise; - /** Navigates to the specified URI. */ - navigate(uri?: any, options?: Object): void; - /** Renders navigation commands to the navigation command containers that are located in the layouts used in the application. */ - renderNavigation(): void; - /** Calls the restoreState() method of the application's StateManager object. */ - restoreState(): void; - /** Calls the saveState method of the application's StateManager object. */ - saveState(): void; - /** Provides access to the object that defines the current context to be considered when choosing an appropriate template for a view. */ - templateContext(): Object; - on(eventName: "initialized", eventHandler: () => void): HtmlApplication; - on(eventName: "afterViewSetup", eventHandler: (e: { - viewInfo: Object; - }) => void): HtmlApplication; - on(eventName: "beforeViewSetup", eventHandler: (e: { - viewInfo: Object; - }) => void): HtmlApplication; - on(eventName: "navigating", eventHandler: (e: { - currentUri: string; - uri: string; - cancel: boolean; - options: { - root: boolean; - target: string; - direction: string; - rootInDetailPane: boolean; - modal: boolean; - }; - }) => void): HtmlApplication; - on(eventName: "navigatingBack", eventHandler: (e: { - cancel: boolean; - isHardwareButton: boolean; - }) => void): HtmlApplication; - on(eventName: "resolveLayoutController", eventHandler: (e: { - viewInfo: Object; - layoutController: Object; - availableLayoutControllers: Array; - }) => void): HtmlApplication; - on(eventName: "resolveViewCacheKey", eventHandler: (e: { - key: string; - navigationItem: Object; - routeData: Object; - }) => void): HtmlApplication; - on(eventName: "viewDisposed", eventHandler: (e: { - viewInfo: Object; - }) => void): HtmlApplication; - on(eventName: "viewDisposing", eventHandler: (e: { - viewInfo: Object; - }) => void): HtmlApplication; - on(eventName: "viewHidden", eventHandler: (e: { - viewInfo: Object; - }) => void): HtmlApplication; - on(eventName: "viewRendered", eventHandler: (e: { - viewInfo: Object; - }) => void): HtmlApplication; - on(eventName: "viewShowing", eventHandler: (e: { - viewInfo: Object; - direction: string; - }) => void): HtmlApplication; - on(eventName: "viewShown", eventHandler: (e: { - viewInfo: Object; - direction: string; - }) => void): HtmlApplication; - on(eventName: string, eventHandler: Function): HtmlApplication; - on(events: { [eventName: string]: Function; }): HtmlApplication; - off(eventName: "initialized"): HtmlApplication; - off(eventName: "afterViewSetup"): HtmlApplication; - off(eventName: "beforeViewSetup"): HtmlApplication; - off(eventName: "navigating"): HtmlApplication; - off(eventName: "navigatingBack"): HtmlApplication; - off(eventName: "resolveLayoutController"): HtmlApplication; - off(eventName: "resolveViewCacheKey"): HtmlApplication; - off(eventName: "viewDisposed"): HtmlApplication; - off(eventName: "viewDisposing"): HtmlApplication; - off(eventName: "viewHidden"): HtmlApplication; - off(eventName: "viewRendered"): HtmlApplication; - off(eventName: "viewShowing"): HtmlApplication; - off(eventName: "viewShown"): HtmlApplication; - off(eventName: string): HtmlApplication; - off(eventName: "initialized", eventHandler: () => void): HtmlApplication; - off(eventName: "afterViewSetup", eventHandler: (e: { - viewInfo: Object; - }) => void): HtmlApplication; - off(eventName: "beforeViewSetup", eventHandler: (e: { - viewInfo: Object; - }) => void): HtmlApplication; - off(eventName: "navigating", eventHandler: (e: { - currentUri: string; - uri: string; - cancel: boolean; - options: { - root: boolean; - target: string; - direction: string; - rootInDetailPane: boolean; - modal: boolean; - }; - }) => void): HtmlApplication; - off(eventName: "navigatingBack", eventHandler: (e: { - cancel: boolean; - isHardwareButton: boolean; - }) => void): HtmlApplication; - off(eventName: "resolveLayoutController", eventHandler: (e: { - viewInfo: Object; - layoutController: Object; - availableLayoutControllers: Array; - }) => void): HtmlApplication; - off(eventName: "resolveViewCacheKey", eventHandler: (e: { - key: string; - navigationItem: Object; - routeData: Object; - }) => void): HtmlApplication; - off(eventName: "viewDisposed", eventHandler: (e: { - viewInfo: Object; - }) => void): HtmlApplication; - off(eventName: "viewDisposing", eventHandler: (e: { - viewInfo: Object; - }) => void): HtmlApplication; - off(eventName: "viewHidden", eventHandler: (e: { - viewInfo: Object; - }) => void): HtmlApplication; - off(eventName: "viewRendered", eventHandler: (e: { - viewInfo: Object; - }) => void): HtmlApplication; - off(eventName: "viewShowing", eventHandler: (e: { - viewInfo: Object; - direction: string; - }) => void): HtmlApplication; - off(eventName: "viewShown", eventHandler: (e: { - viewInfo: Object; - direction: string; - }) => void): HtmlApplication; - off(eventName: string, eventHandler: Function): HtmlApplication; - } - } -} -declare module DevExpress.viz.core { - 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 how transparent the vertical crosshair line should be. */ - opacity?: number; - } - export interface Font { - /** Colors the text displayed by the group labels. */ - color?: string; - /** Specifies the font family of the text displayed by the group labels. */ - family?: string; - /** Specifies how transparent the text displayed by the group labels should be. */ - opacity?: number; - /** Specifies the size of the text displayed by the group labels. */ - size?: any; - /** Specifies the font weight of the text displayed by the group labels. */ - 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 MarginOptions { - /** Generates space around the widget. */ - margin?: Margins; - } - export interface RedrawOnResizeOptions { - /** Specifies whether to redraw the widget when the size of the parent browser window changes or a mobile device rotates. */ - redrawOnResize?: boolean; - } - export interface TitleOptions { - /** Specifies the widget title. */ - title?: Title; - } - export interface ExportOptions { - /** Configures the exporting and printing features. */ - export?: Export; - } - export interface LoadingIndicatorOptions { - /** Configures the loading indicator. */ - loadingIndicator?: LoadingIndicator; - } - export interface LoadingIndicatorMethods { - /** Displays the loading indicator. */ - showLoadingIndicator(): void; - /** Conceals the loading indicator. */ - hideLoadingIndicator(): void; - } - export interface Size { - /** Specifies the width of the widget in pixels. */ - width?: number; - /** Specifies the height of the widget in pixels. */ - height?: number; - } - export interface Title { - /** Specifies font options for the title. */ - font?: viz.core.Font; - /** Specifies the title's alignment in a horizontal direction. */ - horizontalAlignment?: string; - /** Specifies the title's alignment in a vertical direction. */ - verticalAlignment?: string; - /** Generates space around the title. */ - margin?: Margins; - /** Specifies the minimum height that the title occupies. */ - placeholderSize?: number; - /** Specifies the title text. */ - text?: string; - /** Specifies the widget subtitle. */ - subtitle?: { - /** Specifies font options for the subtitle. */ - font?: viz.core.Font; - /** Specifies text for the subtitle. */ - text?: string; - } - } - export interface Export { - /** Enables the client-side exporting in the widget. */ - enabled?: boolean; - /** Enables the printing feature in the widget. Applies only if the export | enabled option is true. */ - printingEnabled?: boolean; - /** Specifies a set of formats available for exporting into. */ - formats?: Array; - /** Specifies a default name for the file to which the widget will be exported. */ - fileName?: string; - /** Specifies the URL of the server-side proxy that streams the resulting file to the end user to enable exporting in IE9 and Safari browsers. */ - proxyUrl?: string; - /** Specifies the color that will fill transparent regions in the resulting file or document. */ - backgroundColor?: string; - } - export interface Tooltip { - /** Specifies the length of the tooltip's arrow in pixels. */ - arrowLength?: number; - /** Specifies the appearance of the tooltip's border. */ - border?: DashedBorderWithOpacity; - /** Specifies the color of tooltips. */ - color?: string; - /** Specifies the z-index of tooltips. */ - zIndex?: number; - /** Specifies the container to draw tooltips inside of it. */ - container?: any; - /** Allows you to change tooltip appearance. */ - customizeTooltip?: (arg: Object) => { color?: string; text?: string }; - enabled?: boolean; - /** Specifies the font of the text displayed by a tooltip. */ - font?: Font; - /** Specifies the format of the value displayed by a tooltip. */ - format?: any; - /** Specifies the opacity of tooltips. */ - opacity?: number; - /** Generates space on the left and the right of the text displayed by a tooltip. */ - paddingLeftRight?: number; - /** Generates space above and below the text displayed by a tooltip. */ - paddingTopBottom?: number; - /** * Specifies the precision of formatted values in a tooltip. * @deprecated Use the tooltip | format | precision option instead. */ - precision?: number; - /** Specifies the appearance 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 itself measured in pixels. */ - offsetX?: number; - /** Specifies the vertical offset of the tooltip's shadow relative to the tooltip itself measured 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 { - /** Colors the background of the loading indicator. */ - backgroundColor?: string; - /** Specifies font options for the loading indicator. */ - font?: viz.core.Font; - /** Specifies whether to show the loading indicator or not. */ - show?: boolean; - /** Specifies the text to be displayed by the loading indicator. */ - text?: string; - } - export interface LegendBorder extends viz.core.DashedBorderWithOpacity { - /** Specifies a radius for the corners of the legend border. */ - cornerRadius?: number; - } - export interface BaseLegend { - /** Specifies the color of the legend's background. */ - backgroundColor?: string; - /** Specifies legend border settings. */ - border?: viz.core.LegendBorder; - /** Specifies how many columns must be taken to arrange legend items. */ - columnCount?: number; - /** Specifies the spacing between a pair of neighboring legend columns in pixels. */ - columnItemSpacing?: number; - /** Specifies font options for legend items. */ - font?: viz.core.Font; - /** Specifies the legend's position on the map. */ - horizontalAlignment?: string; - /** Specifies the alignment of legend items. */ - itemsAlignment?: string; - /** Specifies the position of text relative to the item marker. */ - itemTextPosition?: string; - /** Specifies the distance between the legend and the container borders in pixels. */ - margin?: viz.core.Margins; - /** Specifies the size of item markers in the legend in pixels. */ - markerSize?: number; - /** Specifies whether to arrange legend items horizontally or vertically. */ - orientation?: string; - /** Specifies the spacing between the legend left/right border and legend items in pixels. */ - paddingLeftRight?: number; - /** Specifies the spacing between the legend top/bottom border and legend items in pixels. */ - paddingTopBottom?: number; - /** Specifies how many rows must be taken to arrange legend items. */ - rowCount?: number; - /** Specifies the spacing between a pair of neighboring legend rows in pixels. */ - rowItemSpacing?: number; - /** Specifies the legend's position on the map. */ - verticalAlignment?: string; - /** Specifies whether or not the legend is visible on the map. */ - visible?: boolean; - } - export interface BaseWidgetOptions extends DOMComponentOptions { - /** Specifies the size of the widget in pixels. */ - size?: Size; - /** A handler for the drawn event. */ - onDrawn?: (e: { - component: BaseWidget; - element: Element; - }) => void; - /** A handler for the incidentOccurred event. */ - onIncidentOccurred?: ( - component: BaseWidget, - element: Element, - target: { - id: string; - type: string; - args: any; - text: string; - widget: string; - version: string; - } - ) => void; - /** A handler for the exporting event. */ - onExporting?: (e: { - fileName: string; - cancel: boolean; - }) => void; - /** A handler for the fileSaving event. */ - onFileSaving?: (e: { - fileName: string; - format: string; - data: any; - cancel: boolean; - }) => void; - /** A handler for the exported event. */ - onExported?: (e: Object) => void; - /** 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; - /** Exports the widget into a document with a specified name and format. */ - exportTo(): void; - /** Opens the browser's print window. */ - print(): void; - /** Redraws the widget. */ - render(): void; - } -} -declare module DevExpress.viz { - /** * 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; -} -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 points from the series point collection based on the specified argument. */ - getPointsByArg(pointArg: any): Array; - /** Gets a point from the series point collection based on the specified point position. */ - getPointByPos(positionIndex: number): Object; - /** Selects the series. The series is displayed in a 'selected' style until another series is selected or the current series is deselected programmatically. */ - select(): void; - /** Selects the specified point. The point is displayed in a 'selected' style. */ - selectPoint(point: BasePoint): void; - /** Deselects the specified point. The point is displayed in an initial style. */ - deselectPoint(point: BasePoint): void; - /** Returns an array of all points in the series. */ - getAllPoints(): Array; - /** Returns visible series points. */ - getVisiblePoints(): Array; - /** Returns the name of the series. */ - name: string; - /** Returns the tag of the series. */ - tag: string; - /** Hides a series. */ - hide(): void; - /** Provides information about the hover state of a series. */ - isHovered(): boolean; - /** Provides information about the selection state of a series. */ - isSelected(): boolean; - /** Provides information about the visibility state of a series. */ - isVisible(): boolean; - /** Makes a particular series visible. */ - show(): void; - } - /** This section describes the methods that can be used in code to manipulate the Point object. */ - export interface BasePoint { - /** Provides information about the state of the point object. */ - fullState: number; - /** Returns the point's argument value that was set in the data source. */ - originalArgument: any; - /** Returns the point's value that was set in the data source. */ - originalValue: any; - /** Returns the tag of the point. */ - tag: string; - /** Deselects the point. */ - clearSelection(): void; - /** Gets the color of a particular point. */ - getColor(): string; - /** Hides the tooltip of the point. */ - hideTooltip(): void; - /** Provides information about the hover state of a point. */ - isHovered(): boolean; - /** Provides information about the selection state of a point. */ - isSelected(): boolean; - /** Selects the point. The point is displayed in a 'selected' style until another point is selected or the current point is deselected programmatically. */ - select(): void; - /** Shows the tooltip of the point. */ - showTooltip(): void; - /** Allows you to obtain the label(s) of the series point. */ - getLabel(): any; - /** Returns the series object to which the point belongs. */ - series: BaseSeries; - } - /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ - export interface ChartSeries extends BaseSeries { - /** Returns the name of the series pane. */ - pane: string; - /** Returns the name of the value axis of the series. */ - axis: string; - selectPoint(point: ChartPoint): void; - deselectPoint(point: ChartPoint): void; - getAllPoints(): Array; - getVisiblePoints(): Array; - } - /** This section describes the methods that can be used in code to manipulate the Point object. */ - export interface ChartPoint extends BasePoint { - /** Contains the close value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ - originalCloseValue: any; - /** Contains the high value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ - originalHighValue: any; - /** Contains the low value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ - originalLowValue: any; - /** Contains the first value of the point. This field is useful for points belonging to a series of the range area or range bar type only. */ - originalMinValue: any; - /** Contains the open value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ - originalOpenValue: any; - /** Contains the size of the bubble as it was set in the data source. This field is useful for points belonging to a series of the bubble type only. */ - size: any; - /** Gets the parameters of the point's minimum bounding rectangle (MBR). */ - getBoundingRect(): { x: number; y: number; width: number; height: number; }; - series: ChartSeries; - } - /** This section describes the methods that can be used in code to manipulate the Label object. */ - export interface Label { - /** Gets the parameters of the label's minimum bounding rectangle (MBR). */ - getBoundingRect(): { x: number; y: number; width: number; height: number; }; - /** Hides the point label. */ - hide(): void; - /** Shows the point label. */ - show(): void; - } - export interface PieSeries extends BaseSeries { - selectPoint(point: PiePoint): void; - deselectPoint(point: PiePoint): void; - getAllPoints(): Array; - getVisiblePoints(): Array; - } - /** This section describes the methods that can be used in code to manipulate the Point object. */ - export interface PiePoint extends BasePoint { - /** Gets the percentage value of the specific point. */ - percent: any; - /** Provides information about the visibility state of a point. */ - isVisible(): boolean; - /** Makes a specific point visible. */ - show(): void; - /** Hides a specific point. */ - hide(): void; - series: PieSeries; - } - /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ - export interface PolarSeries extends BaseSeries { - /** Returns the name of the value axis of the series. */ - axis: string; - selectPoint(point: PolarPoint): void; - deselectPoint(point: PolarPoint): void; - getAllPoints(): Array; - getVisiblePoints(): Array; - } - /** This section describes the methods that can be used in code to manipulate the Point object. */ - export interface PolarPoint extends BasePoint { - series: PolarSeries; - } - export interface Strip { - /** Specifies a color for a strip. */ - color?: string; - /** An object that defines the label configuration options of a strip. */ - label?: { - /** Specifies the text displayed in a strip. */ - text?: string; - }; - /** Specifies a start value for a strip. */ - startValue?: any; - /** Specifies an end value for a strip. */ - endValue?: any; - } - export interface BaseSeriesConfigLabel { - /** Specifies a format for arguments displayed by point labels. */ - argumentFormat?: any; - /** * Specifies a precision for formatted point arguments displayed in point labels. * @deprecated Use the series | label | argumentFormat | precision instead. */ - 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?: any; - position?: string; - /** * Specifies a precision for formatted point values displayed in point labels. * @deprecated Use the series | label | format | precision option instead. */ - 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 labels for points with zero value. Applies only to bar-like series. */ - showForZeroValues?: boolean; - } - export interface ChartSeriesConfigLabel extends SeriesConfigLabel { - /** Aligns point labels in relation to their points. */ - alignment?: string; - /** Along with verticalOffset, shifts point labels from their initial positions. */ - horizontalOffset?: number; - /** Along with horizontalOffset, shifts point labels from their initial positions. */ - verticalOffset?: number; - /** * Specifies a precision for the percentage values displayed in the labels of a full-stacked-like series. * @deprecated Use the series | label | format | percentPrecision instead. */ - percentPrecision?: number; - } - export interface BaseCommonSeriesConfig { - /** Specifies the data source field that provides arguments for series points. */ - argumentField?: string; - axis?: string; - label?: ChartSeriesConfigLabel; - border?: viz.core.DashedBorder; - /** Specifies a series color. */ - color?: string; - /** Specifies the dash style of the series' line. */ - dashStyle?: string; - hoverMode?: string; - hoverStyle?: { - 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 series elements to be highlighted when a user selects a point. */ - selectionMode?: string; - selectionStyle?: { - 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 { - /** Substitutes the standard point symbols with an image. */ - image?: { - /** Specifies the height of the image used instead of a point marker. */ - height?: any; - /** Specifies the URL of 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 which data source field provides close values for points of a financial series. */ - closeValueField?: string; - /** Makes bars look rounded. Applies only to bar-like series. */ - cornerRadius?: number; - /** Specifies which data source field provides high values for points of a financial series. */ - highValueField?: string; - /** Specifies a filling color for the body of a series point that visualizes a non-reduced value. Applies only to candlestick series. */ - innerColor?: string; - /** Specifies which data source field provides low values for points of a financial series. */ - lowValueField?: string; - /** Specifies which data source field provides open values for points of a financial series. */ - openValueField?: string; - /** Specifies which pane the series should belong to. Accepts the name of the pane. */ - pane?: string; - point?: ChartCommonPointOptions; - /** Coupled with the rangeValue2Field option, specifies which data source field provides values for a range-like series. */ - rangeValue1Field?: string; - /** Coupled with the rangeValue1Field option, specifies which data source field provides values for a range-like series. */ - rangeValue2Field?: string; - /** Specifies reduction options for financial series. */ - reduction?: { - /** Specifies a color for the points whose price has decreased in comparison to the price of the previous point. */ - color?: string; - /** Specifies whether high, low, open or close prices of points should be compared. */ - level?: string; - }; - /** Specifies which data source field provides size values for bubbles. Required by and applies only to bubble series. */ - sizeField?: string; - } - export interface CommonSeriesSettings extends CommonSeriesConfig { - /** Defines common settings for all area series. */ - area?: CommonSeriesConfig; - /** Defines common settings for all bar series. */ - bar?: CommonSeriesConfig; - /** Defines common settings for all bubble series. */ - bubble?: CommonSeriesConfig; - /** Defines common settings for all candlestick series. */ - candlestick?: CommonSeriesConfig; - /** Defines common settings for all full-stacked area series. */ - fullstackedarea?: CommonSeriesConfig; - /** Defines common settings for all full-stacked spline area series. */ - fullstackedsplinearea?: CommonSeriesConfig; - /** Defines common settings for all full-stacked bar series. */ - fullstackedbar?: CommonSeriesConfig; - /** Defines common settings for all full-stacked line series. */ - fullstackedline?: CommonSeriesConfig; - /** Defines common settings for all full-stacked spline series. */ - fullstackedspline?: CommonSeriesConfig; - /** Defines common settings for all line series. */ - line?: CommonSeriesConfig; - /** Defines common settings for all range area series. */ - rangearea?: CommonSeriesConfig; - /** Defines common settings for all range bar series. */ - rangebar?: CommonSeriesConfig; - /** Defines common settings for all scatter series. */ - scatter?: CommonSeriesConfig; - /** Defines common settings for all spline series. */ - spline?: CommonSeriesConfig; - /** Defines common settings for all spline area series. */ - splinearea?: CommonSeriesConfig; - /** Defines common settings for all stacked area series. */ - stackedarea?: CommonSeriesConfig; - /** Defines common settings for all stacked spline area series. */ - stackedsplinearea?: CommonSeriesConfig; - /** Defines common settings for all stacked bar series. */ - stackedbar?: CommonSeriesConfig; - /** Defines common settings for all stacked line series. */ - stackedline?: CommonSeriesConfig; - /** Defines common settings for all stacked spline series. */ - stackedspline?: CommonSeriesConfig; - /** Defines common settings for all step area series. */ - steparea?: CommonSeriesConfig; - /** Defines common settings for all step line series. */ - stepline?: CommonSeriesConfig; - /** Defines common settings for all stock series. */ - stock?: CommonSeriesConfig; - /** Specifies the type of the series. */ - 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. * @deprecated Use the series | label | format | percentPrecision instead. */ - percentPrecision?: number; - } - /** An object that defines configuration options for chart series. */ - export interface CommonPieSeriesConfig { - /** Specifies the data source field that provides arguments for series points. */ - argumentField?: string; - /** Specifies the required type for series arguments. */ - argumentType?: string; - /** An object defining the series border configuration options. */ - border?: viz.core.DashedBorder; - /** Specifies a series color. */ - color?: string; - /** Specifies the chart elements to highlight when a series is hovered over. */ - hoverMode?: string; - /** An object defining configuration options for a hovered series. */ - hoverStyle?: { - /** An object defining the border options for a hovered series. */ - border?: viz.core.DashedBorder; - /** Sets a color for the series when it is hovered over. */ - color?: string; - /** Specifies the hatching options to be applied when a point is hovered over. */ - hatching?: viz.core.Hatching; - }; - /** * Specifies the fraction of the inner radius relative to the total radius in the series of the 'doughnut' type. * @deprecated Use the innerRadius option instead. */ - innerRadius?: number; - /** An object defining the label configuration options. */ - label?: PieSeriesConfigLabel; - /** Specifies how many points are acceptable to be in a series to display all labels for these points. Otherwise, the labels will not be displayed. */ - maxLabelCount?: number; - /** Specifies a minimal size of a displayed pie segment. */ - minSegmentSize?: number; - /** * Specifies the direction in which the PieChart series points are located. * @deprecated Use the segmentsDirection option instead. */ - segmentsDirection?: string; - /**

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

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

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

    */ - tagField?: string; - /** Specifies the data source field that provides values for series points. */ - valueField?: string; - } - export interface CommonPieSeriesSettings extends CommonPieSeriesConfig { - /** * Specifies the type of the pie chart series. * @deprecated Use the type option instead. */ - type?: string; - } - export interface PieSeriesConfig extends CommonPieSeriesConfig { - /** * Sets the series type. * @deprecated Use the type option instead. */ - type?: string; - /** Specifies the name that identifies the series. */ - name?: string; - /** Specifies data about a series. */ - tag?: any; - } - export interface SeriesTemplate { - /** Specifies a callback function that returns a series object with individual series settings. */ - customizeSeries?: (seriesName: string) => SeriesConfig; - /** Specifies a data source field that represents the series name. */ - nameField?: string; - } - export interface PolarSeriesTemplate { - /** Specifies a callback function that returns a series object with individual series settings. */ - customizeSeries?: (seriesName: string) => PolarSeriesConfig; - /** Specifies a data source field that represents the series name. */ - nameField?: string; - } - export interface ChartCommonConstantLineLabel { - /** Specifies font options for constant line labels. */ - font?: viz.core.Font; - /** Specifies the position of constant line labels on the chart plot. */ - position?: string; - /** Makes constant line labels visible. */ - 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 { - /** Configures constant line labels. */ - label?: ChartCommonConstantLineLabel; - /** Generates a pixel-measured empty space between the left/right side of a constant line and the constant line label. */ - paddingLeftRight?: number; - /** Generates a pixel-measured empty space between the top/bottom side of a constant line and the constant line label. */ - 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 { - /** Aligns axis labels in relation to ticks. */ - alignment?: string; - /** Decides how to arrange axis labels when there is not enough space to keep all of them. */ - overlappingBehavior?: { - /** Decides how to arrange axis labels when there is not enough space to keep all of them. */ - mode?: string; - /** Specifies the rotation angle of axis labels. Applies only if the mode option is "rotate". */ - rotationAngle?: number; - /** Adds a pixel-measured empty space between two staggered rows of axis labels. Applies only if the mode option is "stagger". */ - 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 the axis title. */ - font?: viz.core.Font; - /** Adds a pixel-measured empty space between the axis title and axis labels. */ - 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 PolarChart widget. */ - grid?: { - /** Specifies a color for grid lines. */ - color?: string; - /** Specifies an opacity for grid lines. */ - opacity?: number; - /** Indicates whether or not the grid lines of an axis are visible. */ - visible?: boolean; - /** Specifies the width of grid lines. */ - width?: number; - }; - /** Specifies the options of the minor grid. */ - minorGrid?: { - /** Specifies a color for the lines of the minor grid. */ - color?: string; - /** Specifies an opacity for the lines of the minor grid. */ - opacity?: number; - /** Indicates whether the minor grid is visible or not. */ - visible?: boolean; - /** Specifies a width for the lines of the minor grid. */ - width?: number; - }; - /** Indicates whether or not an axis is inverted. */ - inverted?: boolean; - /** Specifies the opacity of the line that represents an axis. */ - opacity?: number; - /** Indicates whether or not to set ticks/grid lines of a continuous axis of the 'date-time' type at the beginning of each date-time interval. */ - setTicksAtUnitBeginning?: boolean; - /** An object defining the configuration options for axis ticks. */ - tick?: { - /** Specifies ticks color. */ - color?: string; - /** Specifies tick opacity. */ - opacity?: number; - /** Indicates whether or not ticks are visible on an axis. */ - visible?: boolean; - /** Specifies tick width. */ - width?: number; - /** Specifies tick length. */ - length?: number; - }; - /** Specifies the options of the minor ticks. */ - minorTick?: { - /** Specifies a color for the minor ticks. */ - color?: string; - /** Specifies an opacity for the minor ticks. */ - opacity?: number; - /** Indicates whether or not the minor ticks are displayed on an axis. */ - visible?: boolean; - /** Specifies minor tick width. */ - width?: number; - /** Specifies minor tick length. */ - length?: number; - }; - /** Indicates whether or not the line that represents an axis in a chart is visible. */ - visible?: boolean; - /** Specifies the width of the line that represents an axis in the chart. */ - width?: number; - } - export interface ChartCommonAxisSettings extends BaseCommonAxisSettings { - /** Configures the appearance of all constant lines in the widget. */ - constantLineStyle?: ChartCommonConstantLineStyle; - /** Configures axis labels. */ - label?: ChartCommonAxisLabel; - /** Controls the empty space between the maximum series points and the axis. Applies only to the axes of the "continuous" and "logarithmic" type. */ - maxValueMargin?: number; - /** Controls the empty space between the minimum series points and the axis. Applies only to the axes of the "continuous" and "logarithmic" type. */ - minValueMargin?: number; - /** Reserves a pixel-measured space for the axis. */ - placeholderSize?: number; - /** Configures the appearance of strips. */ - stripStyle?: { - /** Configures the appearance of strip labels. */ - label?: { - /** Specifies font options for strip labels. */ - font?: viz.core.Font; - /** Aligns strip labels in the horizontal direction. */ - horizontalAlignment?: string; - /** Aligns strip labels in the vertical direction. */ - verticalAlignment?: string; - }; - /** Generates a pixel-measured empty space between the left/right border of a strip and the strip label. */ - paddingLeftRight?: number; - /** Generates a pixel-measured empty space between the top/bottom border of a strip and the strip label. */ - paddingTopBottom?: number; - }; - /** Configures axis titles. */ - title?: CommonAxisTitle; - /** Adds an empty space between the axis and the minimum and maximum series points. */ - 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 PolarChart 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 { - /** Aligns constant line labels in the horizontal direction. */ - horizontalAlignment?: string; - /** Aligns constant line labels in the vertical direction. */ - verticalAlignment?: string; - /** Specifies the text of a constant line label. By default, equals to the value of the constant line. */ - 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?: any; - /** * Specifies a precision for the formatted value displayed in the axis labels. * @deprecated Use the valueAxis | label | format | precision option instead. */ - precision?: number; - } - export interface ChartAxisLabel extends ChartCommonAxisLabel, AxisLabel { } - export interface PolarAxisLabel extends PolarCommonAxisLabel, AxisLabel { } - export interface AxisTitle extends CommonAxisTitle { - /** Specifies the text of the axis title. */ - text?: string; - } - export interface ChartConstantLineStyle extends ChartCommonConstantLineStyle { - /** Specifies the appearance of the labels of those constant lines that belong to the value axis. */ - label?: ChartConstantLineLabel; - } - export interface ChartConstantLine extends ChartConstantLineStyle { - /** Configures the constant line label. */ - label?: ChartConstantLineLabel; - /** Specifies the value indicated by a constant line. Setting this option is necessary. */ - 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; - /** Binds the value axis to a pane. */ - pane?: string; - /** Specifies options for value axis strips. */ - strips?: Array; - } - export interface ChartAxis extends ChartCommonAxisSettings, Axis { - /** Declares a collection of constant lines belonging to the value axis. */ - constantLines?: Array; - /** Specifies the appearance of those constant lines that belong to the value axis. */ - constantLineStyle?: ChartCommonConstantLineStyle; - /** Configures the labels of the value axis. */ - label?: ChartAxisLabel; - /** Coupled with the min option, focuses the widget on a specific chart segment. Applies only to the axes of the "continuous" and "logarithmic" type. */ - max?: any; - /** Coupled with the max option, focuses the widget on a specific chart segment. Applies only to the axes of the "continuous" and "logarithmic" type. */ - min?: any; - /** Relocates the value axis. */ - position?: string; - /** Configures the axis title. */ - title?: any; - } - export interface PolarAxis extends PolarCommonAxisSettings, Axis { - /** Defines an array of the value axis constant lines. */ - constantLines?: Array; - /** Specifies options for value axis labels. */ - label?: PolarAxisLabel; - } - export interface ArgumentAxis { - /** Specifies the desired type of axis values. */ - argumentType?: string; - /** Specifies the elements that will be highlighted when the argument axis is hovered over. */ - hoverMode?: string; - } - export interface ChartArgumentAxis extends ChartAxis, ArgumentAxis { } - export interface PolarArgumentAxis extends PolarAxis, ArgumentAxis { - /** Specifies the angle in arc degrees to which the argument axis should be rotated. The positive values rotate the axis clockwise. */ - startAngle?: number; - /** Specifies whether or not to display the first point at the angle specified by the startAngle option. */ - firstPointOnStartAngle?: boolean; - /** Specifies the value to be used as the origin for the argument axis. */ - originValue?: number; - /** Specifies the period of the argument values in the data source. */ - period?: number; - } - export interface ValueAxis { - /** Specifies the name of the value axis. */ - name?: string; - /** Specifies whether or not to indicate a zero value on the value axis. */ - showZero?: boolean; - /** Specifies the desired type of axis values. */ - valueType?: string; - } - export interface ChartValueAxis extends ChartAxis, ValueAxis { - /** Adds a pixel-measured empty space between two side-by-side value axes. Applies if several value axes are located on one side of the chart. */ - multipleAxesSpacing?: number; - /** Synchronizes two or more value axes with each other at a specific value. */ - 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 the color of the pane's background. */ - backgroundColor?: string; - /** Configures the pane border. */ - border?: PaneBorder; - } - export interface Pane extends CommonPane { - /** Specifies the name of the pane. */ - name?: string; - } - export interface PaneBorder extends viz.core.DashedBorderWithOpacity { - /** Shows/hides the bottom border of the pane. Applies only when the border | visible option is true. */ - bottom?: boolean; - /** Shows/hides the left border of the pane. Applies only when the border | visible option is true. */ - left?: boolean; - /** Shows/hides the right border of the pane. Applies only when the border | visible option is true. */ - right?: boolean; - /** Shows/hides the top border of the pane. Applies only when the border | visible option is true. */ - top?: boolean; - } - export interface ChartAnimation extends viz.core.Animation { - /** Specifies how many series points the widget should have before the animation will be disabled. */ - maxPointCountSupported?: number; - } - export interface BaseChartTooltip extends viz.core.Tooltip { - /** Specifies a format for arguments of the chart's series points. */ - argumentFormat?: any; - /** * Specifies a precision for formatted arguments displayed in tooltips. * @deprecated Use the tooltip | argumentFormat | precision option instead. */ - argumentPrecision?: number; - /** * Specifies a precision for a percent value displayed in tooltips for stacked series and PieChart series. * @deprecated Use the tooltip | format | percentPrecision option instead. */ - percentPrecision?: number; - } - export interface BaseChartOptions extends viz.core.BaseWidgetOptions, viz.core.MarginOptions, viz.core.RedrawOnResizeOptions, viz.core.TitleOptions, viz.core.LoadingIndicatorOptions, viz.core.ExportOptions { - /** Specifies adaptive layout options. */ - adaptiveLayout?: { - /** Specifies the widget's width small enough for the layout to begin adapting. */ - width?: number; - /** Specifies the widget's height small enough for the layout to begin adapting. */ - height?: number; - /** Specifies whether or not point labels should be kept when the layout is adapting. */ - keepLabels?: boolean; - }; - /** Specifies animation options. */ - animation?: ChartAnimation; - /** Customizes the appearance of an individual point label. */ - customizeLabel?: (pointInfo: Object) => Object; - /** Customizes the appearance of an individual series point. */ - customizePoint?: (pointInfo: Object) => Object; - /** Specifies the origin of data for the widget. */ - dataSource?: any; - /** Specifies options of a Chart's (PieChart's) legend. */ - legend?: core.BaseLegend; - /** Sets the name of the palette to be used in the chart. Alternatively, an array of colors can be set as a custom palette to be used within this chart. */ - palette?: any; - /** A handler for the done event. */ - onDone?: (e: { - component: BaseChart; - element: Element; - }) => void; - /** A handler for the pointClick event. */ - onPointClick?: any; - /** A handler for the pointHoverChanged event. */ - onPointHoverChanged?: (e: { - component: BaseChart; - element: Element; - target: TPoint; - }) => void; - /** A handler for the pointSelectionChanged event. */ - onPointSelectionChanged?: (e: { - component: BaseChart; - element: Element; - target: TPoint; - }) => void; - /** Specifies whether a single point or multiple points can be selected in the chart. */ - pointSelectionMode?: string; - /** Specifies options for the Chart and PieChart widget series. */ - series?: any; - /** Configures tooltips. */ - tooltip?: BaseChartTooltip; - /** A handler for the tooltipShown event. */ - onTooltipShown?: (e: { - component: BaseChart; - element: Element; - target: BasePoint; - }) => void; - /** A handler for the tooltipHidden event. */ - onTooltipHidden?: (e: { - component: BaseChart; - element: Element; - target: BasePoint; - }) => void; - } - /** A base class for all chart widgets included in the ChartJS library. */ - export class BaseChart extends viz.core.BaseWidget implements viz.core.LoadingIndicatorMethods { - /** Deselects the chart's selected series. The series is displayed in an initial style. */ - clearSelection(): void; - /** Gets the current size of the widget. */ - getSize(): { width: number; height: number }; - /** Returns an array of all series in the chart. */ - getAllSeries(): Array; - /** Gets a series within the chart's series collection by the specified name (see the name option). */ - getSeriesByName(seriesName: string): BaseSeries; - /** Gets a series within the chart's series collection by its position number. */ - getSeriesByPos(seriesIndex: number): BaseSeries; - /** Returns the DataSource instance. */ - getDataSource(): DevExpress.data.DataSource; - /** Hides all widget tooltips. */ - hideTooltip(): void; - showLoadingIndicator(): void; - hideLoadingIndicator(): void; - /** Redraws a widget. */ - render(renderOptions?: { - force?: boolean; - animate?: boolean; - asyncSeriesRendering?: boolean; - }): void; - } - export interface AdvancedLegend extends core.BaseLegend { - /** Specifies the text for a hint that appears when a user hovers the mouse pointer over a legend item. */ - customizeHint?: (seriesInfo: { seriesName: string; seriesIndex: number; seriesColor: string; }) => string; - /**

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

    */ - customizeText?: (seriesInfo: { seriesName: string; seriesIndex: number; seriesColor: string; }) => string; - /** Specifies what series elements to highlight when a corresponding item in the legend is hovered over. */ - hoverMode?: string; - } - export interface AdvancedOptions extends BaseChartOptions { - /** A handler for the argumentAxisClick event. */ - onArgumentAxisClick?: any; - /** Specifies the color of the parent page element. */ - containerBackgroundColor?: string; - /** An object providing options for managing data from a data source. */ - dataPrepareSettings?: { - /** Specifies whether or not to validate the values from a data source. */ - checkTypeForAllData?: boolean; - /** Specifies whether or not to convert the values from a data source into the data type of an axis. */ - convertToAxisDataType?: boolean; - /** Specifies how to sort the series points. */ - sortingMethod?: any; - }; - /** A handler for the legendClick event. */ - onLegendClick?: any; - /** A handler for the seriesClick event. */ - onSeriesClick?: any; - /** A handler for the seriesHoverChanged event. */ - onSeriesHoverChanged?: (e: { - component: BaseChart; - element: Element; - target: TSeries; - }) => void; - /** A handler for the seriesSelectionChanged event. */ - onSeriesSelectionChanged?: (e: { - component: BaseChart; - element: Element; - target: TSeries; - }) => void; - /** Specifies whether a single series or multiple series can be selected in the chart. */ - seriesSelectionMode?: string; - /** Specifies how the chart must behave when series point labels overlap. */ - resolveLabelOverlapping?: string; - /** Specifies whether or not all bars in a series must have the same angle, or may have different angles if any points in other series are missing. */ - equalBarWidth?: boolean; - /** Specifies a common bar width as a percentage from 0 to 1. */ - barWidth?: number; - /** Forces the widget to treat negative values as zeroes. Applies to stacked-like series only. */ - negativesAsZeroes?: boolean; - } - export interface Legend extends AdvancedLegend { - /** Specifies whether the legend is located outside or inside the chart's plot. */ - position?: string; - } - export interface ChartTooltip extends BaseChartTooltip { - /** Specifies whether the tooltip must be located in the center of a series point or on its edge. Applies to bar-like and bubble series only. */ - location?: string; - /** Specifies the kind of information to display in a tooltip. */ - shared?: boolean; - } - export interface dxChartOptions extends AdvancedOptions { - /** 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; - /** Specifies whether or not to adjust the value axis when zooming the widget. */ - adjustOnZoom?: boolean; - /** Configures the argument axis. */ - argumentAxis?: ChartArgumentAxis; - /** Defines common settings for both the argument and value axis in a chart. */ - commonAxisSettings?: ChartCommonAxisSettings; - /** Defines common settings for all panes in a chart. */ - commonPaneSettings?: CommonPane; - /** Specifies settings common for all series in the chart. */ - commonSeriesSettings?: CommonSeriesSettings; - /** Configures the crosshair feature. */ - crosshair?: { - /** Specifies the color of the crosshair lines. */ - color?: string; - /** Specifies the dash style of the crosshair lines. */ - dashStyle?: string; - /** Enables the crosshair. */ - enabled?: boolean; - /** Specifies how transparent the crosshair lines should be. */ - opacity?: number; - /** Specifies the width of the crosshair lines. */ - width?: number; - /** Configures the horizontal crosshair line individually. */ - horizontalLine?: CrosshairWithLabel; - /** Configures the vertical crosshair line individually. */ - verticalLine?: CrosshairWithLabel; - /** Configures the crosshair labels. */ - label?: { - /** Paints the background of the crosshair labels. */ - backgroundColor?: string; - /** Makes the crosshair labels visible. Applies only if the crosshair feature is enabled. */ - visible?: boolean; - /** Specifies font options for the crosshair labels. */ - font?: viz.core.Font; - /** Formats the point value/argument before it will be displayed in the crosshair label. */ - format?: any; - /** * Specifies a precision for formatted values. * @deprecated Use the crosshair | label | format | precision option instead. */ - precision?: number; - /** Customizes the text displayed by the crosshair labels. */ - customizeText?: (info: { value: any; valueText: string; point: ChartPoint; }) => string; - } - }; - /** Specifies which pane should be used by default. */ - 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; - /** Declares a collection of panes. */ - panes?: Array; - /** Swaps the axes around making the value axis horizontal and the argument axis vertical. */ - rotated?: boolean; - /** Specifies the options of a chart's legend. */ - legend?: Legend; - /** A handler for the zoomStart event. */ - onZoomStart?: (e: { - component: BaseChart; - element: Element; - }) => void; - /** A handler for the zoomEnd event. */ - onZoomEnd?: (e: { - component: BaseChart; - element: Element; - rangeStart: any; - rangeEnd: any; - }) => void; - /** Specifies options for Chart widget series. */ - series?: Array; - /** Defines options for the series template. */ - seriesTemplate?: SeriesTemplate; - tooltip?: ChartTooltip; - /** Configures the value axis. */ - 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; - }; - } - interface CrosshairWithLabel extends viz.core.DashedBorderWithOpacity { - /** Configures the label that belongs to the horizontal crosshair line. */ - label?: { - /** Paints the background of the label that belongs to the horizontal crosshair line. */ - backgroundColor?: string; - /** Makes the label of the horizontal crosshair line visible. Applies only if the crosshair feature is enabled and the horizontal line is visible. */ - visible?: boolean; - /** Specifies font options for the label of the horizontal crosshair line. */ - font?: viz.core.Font; - /** Formats the point value before it will be displayed in the crosshair label. */ - format?: any; - /** * Specifies a precision for formatted values. * @deprecated Use the crosshair | horizontalLine | label | format | precision option instead. */ - precision?: number; - /** Customizes the text displayed by the label that belongs to the horizontal crosshair line. */ - customizeText?: (info: { value: any; valueText: string; point: ChartPoint; }) => string; - } - } - export interface PolarChartTooltip extends BaseChartTooltip { - /** Specifies the kind of information to display in a tooltip. */ - shared?: boolean; - } - export interface dxPolarChartOptions extends AdvancedOptions { - /** Specifies adaptive layout options. */ - adaptiveLayout?: { - width?: number; - height?: number; - }; - /** Indicates whether or not to display a "spider web". */ - useSpiderWeb?: boolean; - /** Specifies argument axis options for the PolarChart widget. */ - argumentAxis?: PolarArgumentAxis; - /** An object defining the configuration options that are common for all axes of the PolarChart widget. */ - commonAxisSettings?: PolarCommonAxisSettings; - /** An object defining the configuration options that are common for all series of the PolarChart widget. */ - commonSeriesSettings?: CommonPolarSeriesSettings; - /** Specifies the options of a chart's legend. */ - legend?: AdvancedLegend; - /** Specifies options for PolarChart widget series. */ - series?: Array; - /** Defines options for the series template. */ - seriesTemplate?: PolarSeriesTemplate; - tooltip?: PolarChartTooltip; - /** Specifies value axis options for the PolarChart widget. */ - valueAxis?: PolarValueAxis; - } - 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?: { - keepLabels?: boolean; - }; - /** Specifies PieChart legend options. */ - legend?: PieLegend; - /** Specifies options for the series of the PieChart widget. */ - series?: Array; - /** Specifies the diameter of the pie. */ - diameter?: number; - /** Specifies the direction that the pie chart segments will occupy. */ - segmentsDirection?: string; - /** Specifies the angle in arc degrees from which the first segment of a pie chart should start. */ - startAngle?: number; - /** Specifies the fraction of the inner radius relative to the total radius in the series of the 'doughnut' type. The value should be between 0 and 1. */ - innerRadius?: number; - /** A handler for the legendClick event. */ - onLegendClick?: any; - /** Specifies how a chart must behave when series point labels overlap. */ - resolveLabelOverlapping?: string; - /** An object defining the configuration options that are common for all series of the PieChart widget. */ - commonSeriesSettings?: CommonPieSeriesSettings; - /** Specifies the type of the pie chart series. */ - type?: string; - } -} -declare module DevExpress.viz { - /** A widget providing charts of various types for web applications. */ - export class dxChart extends DevExpress.viz.charts.BaseChart { - constructor(element: JQuery, options?: DevExpress.viz.charts.dxChartOptions); - constructor(element: Element, options?: DevExpress.viz.charts.dxChartOptions); - /** Sets the specified start and end values for the chart's argument axis. */ - zoomArgument(startValue: any, endValue: any): void; - } - /** A circular chart widget for web applications. */ - export class dxPieChart extends DevExpress.viz.charts.BaseChart { - constructor(element: JQuery, options?: DevExpress.viz.charts.dxPieChartOptions); - constructor(element: Element, options?: DevExpress.viz.charts.dxPieChartOptions); - /** * Provides access to the PieChart series. * @deprecated Use the getAllSeries() method instead. */ - getSeries(): DevExpress.viz.charts.PieSeries; - } - /** A chart widget displaying data in a polar coordinate system. */ - export class dxPolarChart extends DevExpress.viz.charts.BaseChart { - constructor(element: JQuery, options?: DevExpress.viz.charts.dxPolarChartOptions); - constructor(element: Element, options?: DevExpress.viz.charts.dxPolarChartOptions); - } -} -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. * @deprecated Use the scale | customMinorTicks option instead. */ - customTickValues?: Array; - /** Specifies the length of the scale's minor ticks. */ - length?: number; - /** * Indicates whether automatically calculated minor ticks are visible or not. * @deprecated This feature is no longer available. */ - showCalculatedTicks?: boolean; - /** * Specifies an interval between minor ticks. * @deprecated Use the scale | minorTickInterval option instead. */ - tickInterval?: number; - /** Indicates whether scale minor ticks are visible or not. */ - visible?: boolean; - /** Specifies the width of the scale's minor ticks. */ - width?: number; - } - export interface ScaleMajorTick extends ScaleTick { - /** * Specifies whether or not to expand the current major tick interval if labels overlap each other. * @deprecated Use the overlappingBehavior | useAutoArrangement option instead. */ - useTicksAutoArrangement?: boolean; - } - export interface ScaleMinorTick extends ScaleTick { - /** Specifies the opacity of the scale's minor ticks. */ - opacity?: number; - } - export interface BaseScaleLabel { - /** Specifies whether or not scale labels should be colored similarly to their corresponding ranges in the range container. */ - useRangeColors?: boolean; - /** Specifies a callback function that returns the text to be displayed in scale labels. */ - customizeText?: (scaleValue: { value: number; valueText: string }) => string; - /** Specifies the overlap resolving options to be applied to scale labels. */ - overlappingBehavior?: { - /** Specifies whether or not to expand the current major tick interval if labels overlap each other. */ - useAutoArrangement?: boolean; - /** Specifies what label to hide in case of overlapping. */ - hideFirstOrLast?: string; - }; - /** Specifies font options for the text displayed in the scale labels of the gauge. */ - font?: viz.core.Font; - /** Specifies a format for the text displayed in scale labels. */ - format?: any; - /** * Specifies a precision for the formatted value displayed in the scale labels. * @deprecated Use the scale | label | format | precision option instead. */ - precision?: number; - /** Specifies whether or not scale labels are visible on the gauge. */ - visible?: boolean; - } - export interface BaseScale { - /** Specifies the end value for the scale of the gauge. */ - endValue?: number; - /** * Specifies whether or not to hide the first scale label. * @deprecated This feature is no longer available. */ - hideFirstLabel?: boolean; - /** * Specifies whether or not to hide the first major tick on the scale. * @deprecated This feature is no longer available. */ - hideFirstTick?: boolean; - /** * Specifies whether or not to hide the last scale label. * @deprecated This feature is no longer available. */ - hideLastLabel?: boolean; - /** * Specifies whether or not to hide the last major tick on the scale. * @deprecated This feature is no longer available. */ - hideLastTick?: boolean; - /** Specifies an interval between major ticks. */ - tickInterval?: number; - /** Specifies an interval between minor ticks. */ - minorTickInterval?: number; - /** Specifies an array of custom major ticks. */ - customTicks?: Array; - /** Specifies an array of custom minor ticks. */ - customMinorTicks?: Array; - /** Specifies common options for scale labels. */ - label?: BaseScaleLabel; - /** * Specifies options of the gauge's major ticks. * @deprecated Use the tick option instead. */ - majorTick?: ScaleMajorTick; - /** Specifies options of the gauge's major ticks. */ - tick?: { - /** Specifies the color of the scale's major ticks. */ - color?: string; - /** Specifies the length of the scale's major ticks. */ - length?: number; - /** Indicates whether scale major ticks are visible or not. */ - visible?: boolean; - /** Specifies the width of the scale's major ticks. */ - width?: number; - /** Specifies the opacity of the scale's major ticks. */ - opacity?: number; - }; - /** Specifies options of the gauge's minor ticks. */ - minorTick?: ScaleMinorTick; - /** Specifies the start value for the scale of the gauge. */ - startValue?: number; - } - export interface BaseValueIndicator { - /** Specifies the type of subvalue indicators. */ - type?: string; - /** Specifies the background color for the indicator of the rangeBar type. */ - backgroundColor?: string; - /** Specifies the base value for the indicator of the rangeBar type. */ - baseValue?: number; - /** Specifies a color of the indicator. */ - color?: string; - /** Specifies the range bar size for an indicator of the rangeBar type. */ - size?: number; - text?: { - /** Specifies a callback function that returns the text to be displayed in an indicator. */ - customizeText?: (indicatedValue: { value: number; valueText: string }) => string; - font?: viz.core.Font; - /** Specifies a format for the text displayed in an indicator. */ - format?: any; - /** Specifies the range bar's label indent in pixels. */ - indent?: number; - /** * Specifies a precision for the formatted value displayed by an indicator. * @deprecated Use the text | format | precision option instead. */ - 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?: any; - /** 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 LinearGauge widget. */ - horizontalOrientation?: string; - /** Specifies the orientation of the rangeBar indicator on a horizontally oriented LinearGauge widget. */ - verticalOrientation?: string; - } - export interface SharedGaugeOptions extends viz.core.MarginOptions, viz.core.RedrawOnResizeOptions, viz.core.TitleOptions, viz.core.LoadingIndicatorOptions, viz.core.ExportOptions { - /** Specifies animation options. */ - animation?: viz.core.Animation; - /** * Specifies a subtitle for the widget. * @deprecated Use the title | subtitle option instead. */ - subtitle?: { - /** * Specifies font options for the subtitle. * @deprecated Use the title | subtitle | font option instead. */ - font?: viz.core.Font; - /** * Specifies a text for the subtitle. * @deprecated Use the title | subtitle | text option instead. */ - text?: string; - }; - /** Configures 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 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 implements viz.core.LoadingIndicatorMethods { - showLoadingIndicator(): void; - hideLoadingIndicator(): 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 LinearGauge widget. */ - horizontalOrientation?: string; - /** Specifies the orientation of a range container on a horizontally oriented LinearGauge widget. */ - verticalOrientation?: string; - /** Specifies the width of the range container's start and end boundaries in the LinearGauge 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 LinearGauge widget. */ - horizontalOrientation?: string; - label?: LinearScaleLabel; - /** Specifies the orientation of scale ticks on a horizontally oriented LinearGauge widget. */ - verticalOrientation?: string; - } - export interface dxLinearGaugeOptions extends BaseGaugeOptions { - /** Specifies the options required to set the geometry of the LinearGauge widget. */ - geometry?: { - /** Indicates whether to display the LinearGauge widget vertically or horizontally. */ - orientation?: string; - }; - /** Specifies gauge range container options. */ - rangeContainer?: LinearRangeContainer; - scale?: LinearScale; - } - export interface CircularRangeContainer extends BaseRangeContainer { - /** Specifies the orientation of the range container in the CircularGauge 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 CircularGauge 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; - } - 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?: any; - /** Specifies the distance between the upper bar and bar labels in pixels. */ - indent?: number; - /** * Specifies a precision for the formatted value displayed by labels. * @deprecated Use the label | format | precision option instead. */ - 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?: any; - /** 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; - } -} -declare module DevExpress.viz { - /** A widget that represents a gauge with a linear scale. */ - export class dxLinearGauge extends DevExpress.viz.gauges.dxBaseGauge { - constructor(element: JQuery, options?: DevExpress.viz.gauges.dxLinearGaugeOptions); - constructor(element: Element, options?: DevExpress.viz.gauges.dxLinearGaugeOptions); - } - /** A widget that represents a gauge with a circular scale. */ - export class dxCircularGauge extends DevExpress.viz.gauges.dxBaseGauge { - constructor(element: JQuery, options?: DevExpress.viz.gauges.dxCircularGaugeOptions); - constructor(element: Element, options?: DevExpress.viz.gauges.dxCircularGaugeOptions); - } - /** A circular bar widget. */ - export class dxBarGauge extends viz.core.BaseWidget implements viz.core.LoadingIndicatorMethods { - constructor(element: JQuery, options?: DevExpress.viz.gauges.dxBarGaugeOptions); - constructor(element: Element, options?: DevExpress.viz.gauges.dxBarGaugeOptions); - showLoadingIndicator(): void; - hideLoadingIndicator(): void; - /** Returns an array of gauge values. */ - values(): Array; - /** Updates the values displayed by a gauge. */ - values(values: Array): void; - } -} -declare module DevExpress.viz.rangeSelector { - export interface dxRangeSelectorOptions extends viz.core.BaseWidgetOptions, viz.core.MarginOptions, viz.core.RedrawOnResizeOptions, viz.core.TitleOptions, viz.core.LoadingIndicatorOptions, viz.core.ExportOptions { - /** Specifies the options for the range selector's background. */ - background?: { - /** Specifies the background color for the RangeSelector. */ - 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 RangeSelector'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. * @deprecated Use the callValueChanged option instead. */ - callSelectedRangeChanged?: string; - /** Specifies when to call the onValueChanged function. */ - callValueChanged?: string; - /** Indicates whether or not an end user can specify the range using a mouse, without the use of sliders. */ - manualRangeSelectionEnabled?: boolean; - /** Indicates whether or not an end user can shift the selected range to the required location on a scale by clicking. */ - moveSelectedRangeByClick?: boolean; - /** Indicates whether to snap a slider to ticks. */ - snapToTicks?: boolean; - }; - /** Specifies the options required to display a chart as the range selector's background. */ - chart?: { - /** Specifies a coefficient for determining an indent from the bottom background boundary to the lowest chart point. */ - bottomIndent?: number; - /** An object defining the common configuration options for the chart’s series. */ - commonSeriesSettings?: viz.charts.CommonSeriesSettings; - /** An object providing options for managing data from a data source. */ - dataPrepareSettings?: { - /** Specifies whether or not to validate values from a data source. */ - checkTypeForAllData?: boolean; - /** Specifies whether or not to convert the values from a data source into the data type of an axis. */ - convertToAxisDataType?: boolean; - /** Specifies how to sort series points. */ - sortingMethod?: any; - }; - /** Specifies whether all bars in a series must have the same width, or may have different widths if any points in other series are missing. */ - equalBarWidth?: boolean; - /** Specifies a common bar width as a percentage from 0 to 1. */ - barWidth?: number; - /** Forces the widget to treat negative values as zeroes. Applies to stacked-like series only. */ - negativesAsZeroes?: boolean; - /** Sets the name of the palette to be used in the range selector's chart. Alternatively, an array of colors can be set as a custom palette to be used within this chart. */ - palette?: any; - /** An object defining the chart’s series. */ - 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; - /** Configures the chart 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 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?: any; - /** * Specifies a precision for the formatted value displayed in the scale labels. * @deprecated Use the scale | label | format | precision option instead. */ - precision?: number; - /** Specifies a spacing between scale labels and the background bottom edge. */ - topIndent?: number; - /** Specifies whether or not the scale's labels are visible. */ - visible?: boolean; - }; - /** Specifies the value to be raised to a power when generating ticks for a logarithmic scale. */ - logarithmBase?: number; - /** * Specifies an interval between major ticks. * @deprecated Use the tickInterval option instead. */ - majorTickInterval?: any; - /** Specifies an interval between axis ticks. */ - tickInterval?: any; - /** Specifies options for the date-time scale's markers. */ - marker?: { - /** Defines the options that can be set for the text that is displayed by the scale markers. */ - label?: { - /** Specifies a callback function that returns the text to be displayed in scale markers. */ - customizeText?: (markerValue: { value: any; valueText: string }) => string; - /** Specifies a format for the text displayed in scale markers. */ - format?: any; - }; - /** Specifies the height of the marker's separator. */ - separatorHeight?: number; - /** Specifies the space between the marker label and the marker separator. */ - textLeftIndent?: number; - /** Specifies the space between the marker's label and the top edge of the marker's separator. */ - textTopIndent?: number; - /** Specified the indent between the marker and the scale lables. */ - topIndent?: number; - /** Indicates whether scale markers are visible. */ - visible?: boolean; - }; - /** Specifies the maximum range that can be selected. */ - maxRange?: any; - /** Specifies the number of minor ticks between neighboring major ticks. */ - minorTickCount?: number; - /** Specifies an interval between minor ticks. */ - minorTickInterval?: any; - /** Specifies the minimum range that can be selected. */ - minRange?: any; - /** Specifies the height of the space reserved for the scale in pixels. */ - placeholderHeight?: number; - /** Indicates whether or not to set ticks of a date-time scale at the beginning of each date-time interval. */ - setTicksAtUnitBeginning?: boolean; - /** Specifies whether or not to show ticks for the boundary scale values, when neither major ticks nor minor ticks are created for these values. */ - showCustomBoundaryTicks?: boolean; - /** * Indicates whether or not to show minor ticks on the scale. * @deprecated Use the minorTick | visible option instead. */ - showMinorTicks?: boolean; - /** Specifies the scale's start value. */ - startValue?: any; - /** Specifies options defining the appearance of scale ticks. */ - tick?: { - /** Specifies the color of scale ticks (both major and minor ticks). */ - color?: string; - /** Specifies the opacity of scale ticks (both major and minor ticks). */ - opacity?: number; - /** Specifies the width of the scale's ticks (both major and minor ticks). */ - width?: number; - }; - /** Specifies options of the range selector's minor ticks. */ - minorTick?: { - /** Specifies the color of the scale's minor ticks. */ - color?: string; - /** Specifies the opacity of the scale's minor ticks. */ - opacity?: number; - /** Specifies the width of the scale's minor ticks. */ - width?: number; - /** Indicates whether scale minor ticks are visible or not. */ - visible?: boolean; - }; - /** Specifies the type of the scale. */ - type?: string; - /** Specifies whether or not to expand the current tick interval if labels overlap each other. */ - useTicksAutoArrangement?: boolean; - /** Specifies the type of values on the scale. */ - valueType?: string; - /** Specifies the order of arguments on a discrete scale. */ - categories?: Array; - }; - /** * Specifies the range to be selected when displaying the RangeSelector. * @deprecated Use the value option instead. */ - selectedRange?: { - /** Specifies the start value of the range to be selected when displaying the RangeSelector widget on a page. */ - startValue?: any; - /** Specifies the end value of the range to be selected when displaying the RangeSelector widget on a page. */ - endValue?: any; - }; - /** The selected range, initial or current. */ - value?: Array; - /** Specifies the color of the selected range. */ - selectedRangeColor?: string; - /** Range selector's indent options. */ - indent?: { - /** Specifies range selector's left indent. */ - left?: number; - /** Specifies range selector's right indent. */ - right?: number; - }; - /** * A handler for the selectedRangeChanged event. * @deprecated Use the onValueChanged option instead. */ - onSelectedRangeChanged?: (e: { - startValue: any; - endValue: any; - component: dxRangeSelector; - element: Element; - }) => void; - /** A handler for the valueChanged event. */ - onValueChanged?: (e: { - value: Array; - previousValue: Array; - 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 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?: any; - /** 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. * @deprecated Use the sliderMarker | format | precision option instead. */ - precision?: number; - /** Indicates whether or not the slider markers are visible. */ - visible?: boolean; - }; - } -} -declare module DevExpress.viz { - /** A widget that allows end users to select a range of values on a scale. */ - export class dxRangeSelector extends viz.core.BaseWidget implements viz.core.LoadingIndicatorMethods { - constructor(element: JQuery, options?: DevExpress.viz.rangeSelector.dxRangeSelectorOptions); - constructor(element: Element, options?: DevExpress.viz.rangeSelector.dxRangeSelectorOptions); - showLoadingIndicator(): void; - hideLoadingIndicator(): void; - /** Redraws a widget. */ - render(skipChartAnimation?: boolean): void; - /** * Returns the currently selected range. * @deprecated Use the getValue() method instead. */ - getSelectedRange(): { startValue: any; endValue: any; }; - /** * Sets a specified range. * @deprecated Use the setValue(value) method instead. */ - setSelectedRange(selectedRange: { startValue: any; endValue: any; }): void; - /** Gets the currently selected range. */ - getValue(): Array; - /** Selects a specific range. */ - setValue(value: Array): void; - /** Returns the DataSource instance. */ - getDataSource(): DevExpress.data.DataSource; - } -} -declare module DevExpress.viz.map { - /** This section describes the fields and methods that can be used in code to manipulate the Layer object. */ - export interface MapLayer { - /** The name of the layer. */ - 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; - /** Returns the DataSource instance. */ - getDataSource(): DevExpress.data.DataSource; - } - /** This section describes the fields and methods that can be used in code to manipulate the Layer Element object. */ - export interface MapLayerElement { - /** The parent layer of the layer element. */ - layer: MapLayer; - /** Gets the layer element coordinates. */ - coordinates(): Object; - /** Sets the value of an attribute. */ - attribute(name: string, value: any): void; - /** Gets the value of an attribute. */ - attribute(name: string): any; - /** Gets the selection state of the layer element. */ - selected(): boolean; - /** Sets the selection state of the layer element. */ - selected(state: boolean): void; - /** Applies the layer element settings and updates element appearance. */ - applySettings(settings: any): void; - } - /** * This section describes the fields and methods that can be used in code to manipulate the Area object. * @deprecated Use the Layer Element instead. */ - export interface Area { - /** * Contains the element type. * @deprecated Use the Layer | type instead. */ - type: string; - /** * Return the value of an attribute. * @deprecated Use the Layer Element | attribute(name, value) method instead. */ - attribute(name: string): any; - /** * Provides information about the selection state of an area. * @deprecated Use the Layer Element | selected() method instead. */ - selected(): boolean; - /** * Sets a new selection state for an area. * @deprecated Use the Layer Element | selected(state) method instead. */ - selected(state: boolean): void; - /** * Applies the area settings specified as a parameter and updates the area appearance. * @deprecated Use the Layer Element | applySettings(settings) method instead. */ - applySettings(settings: any): void; - } - /** * This section describes the fields and methods that can be used in code to manipulate the Markers object. * @deprecated Use the Layer Element instead. */ - export interface Marker { - /** * Contains the descriptive text accompanying the map marker. * @deprecated Get the text using the Layer Element | attribute(name) method. The name parameter value for text is set at the dataField option. */ - text: string; - /** * Contains the type of the element. * @deprecated Use the Layer | type instead. */ - type: string; - /** * Contains the URL of an image map marker. * @deprecated Get the image URL using the Layer Element | attribute(name) method. The name parameter value for the image URL is set at the dataField option. */ - url: string; - /** * Contains the value of a bubble map marker. * @deprecated Get the bubble value using the Layer Element | attribute(name) method. The name parameter for the bubble value is set at the dataField option. */ - value: number; - /** * Contains the values of a pie map marker. * @deprecated Get the pie values using the Layer Element | attribute(name) method. The name parameter for pie values is set at the dataField option. */ - values: Array; - /** * Returns the value of an attribute. * @deprecated Use the Layer Element | attribute(name, value) method instead. */ - attribute(name: string): any; - /** * Returns the coordinates of a specific marker. * @deprecated Use the Layer Element | coordinates() method instead. */ - coordinates(): Array; - /** * Provides information about the selection state of a marker. * @deprecated Use the Layer Element | selected() method instead. */ - selected(): boolean; - /** * Sets a new selection state for a marker. * @deprecated Use the Layer Element | selected(state) method instead. */ - selected(state: boolean): void; - /** * Applies the marker settings specified as a parameter and updates marker appearance. * @deprecated Use the Layer Element | applySettings(settings) method instead. */ - applySettings(settings: any): void; - } - export interface MapLayerSettings { - /** Specifies the layer name. */ - name?: string; - /** Specifies layer type. */ - type?: string; - /** Specifies the type of a marker element. Setting this option makes sense only if the layer type is "marker". */ - elementType?: string; - /** Specifies a data source for the layer. */ - dataSource?: any; - /** Specifies the line width (for layers of a line type) or width of the layer elements border in pixels. */ - borderWidth?: number; - /** Specifies a color for the border of the layer elements. */ - borderColor?: string; - /** Specifies a color for layer elements. */ - color?: string; - /** Specifies a color for the border of the layer element when it is hovered over. */ - hoveredBorderColor?: string; - /** Specifies the pixel-measured line width (for layers of a line type) or width for the border of the layer element when it is hovered over. */ - hoveredBorderWidth?: number; - /** Specifies a color for a layer element when it is hovered over. */ - hoveredColor?: string; - /** Specifies a pixel-measured line width (for layers of a line type) or width for the border of the layer element when it is selected. */ - selectedBorderWidth?: number; - /** Specifies a color for the border of the layer element when it is selected. */ - selectedBorderColor?: string; - /** Specifies a color for the layer element when it is selected. */ - selectedColor?: string; - /** Specifies the layer opacity (from 0 to 1). */ - opacity?: number; - /** Specifies the size of markers. Setting this option makes sense only if the layer type is "marker" and the elementType is "dot", "pie" or "image". */ - size?: number; - /** Specifies the pixel-measured diameter of the marker that represents the smallest value. Setting this option makes sense only if the layer type is "marker". */ - minSize?: number; - /** Specifies the pixel-measured diameter of the marker that represents the biggest value. Setting this option makes sense only if the layer type is "marker". */ - maxSize?: number; - /** Specifies whether or not to change the appearance of a layer element when it is hovered over. */ - hoverEnabled?: boolean; - /** Specifies whether single or multiple map elements can be selected on a vector map. */ - selectionMode?: string; - /** Specifies the name of the palette or a custom range of colors to be used for coloring a layer. */ - palette?: any; - /** Specifies the number of colors in a palette. */ - paletteSize?: number; - /** Allows you to paint layer elements with similar attributes in the same color. */ - colorGroups?: Array; - /** Specifies the field that provides data to be used for coloring of layer elements. */ - colorGroupingField?: string; - /** Allows you to display bubbles with similar attributes in the same size. Setting this option makes sense only if the layer type is "marker" and the elementType is "bubble". */ - sizeGroups?: Array; - /** Specifies the field that provides data to be used for sizing bubble markers. Setting this option makes sense only if the layer type is "marker" and the elementType is "bubble". */ - sizeGroupingField?: string; - /** Specifies the name of the attribute containing marker data. Setting this option makes sense only if the layer type is "marker" and the elementType is "bubble", "pie" or "image". */ - dataField?: string; - /** Specifies the function that customizes each layer element individually. */ - customize?: (eleemnts: Array) => void; - /** Specifies marker label options. */ - label?: { - /** The name of the data source attribute containing marker texts. */ - dataField?: string; - /** Enables marker labels. */ - enabled?: boolean; - /** Specifies font options for marker labels. */ - font?: viz.core.Font; - }; - } - export interface AreaSettings { - /** * Specifies the width of the area border in pixels. * @deprecated Use the layers | borderWidth option instead. */ - borderWidth?: number; - /** * Specifies a color for the area border. * @deprecated Use the layers | borderColor option instead. */ - borderColor?: string; - /** * Specifies a color for an area. * @deprecated Use the layers | color option instead. */ - color?: string; - /** * Specifies the function that customizes each area individually. * @deprecated Use the layers | customize option instead. */ - customize?: (areaInfo: Area) => AreaSettings; - /** * Specifies a color for the area border when the area is hovered over. * @deprecated Use the layers | hoveredBorderColor option instead. */ - hoveredBorderColor?: string; - /** * Specifies the pixel-measured width of the area border when the area is hovered over. * @deprecated Use the layers | hoveredBorderWidth option instead. */ - hoveredBorderWidth?: number; - /** * Specifies a color for an area when this area is hovered over. * @deprecated Use the layers | hoveredColor option instead. */ - hoveredColor?: string; - /** * Specifies whether or not to change the appearance of an area when it is hovered over. * @deprecated Use the layers | hoverEnabled option instead. */ - hoverEnabled?: boolean; - /** * Configures area labels. * @deprecated Use the layers | label option instead. */ - label?: { - /** * Specifies the data field that provides data for area labels. * @deprecated Use the layers | label | dataField option instead. */ - dataField?: string; - /** * Enables area labels. * @deprecated Use the layers | label | enabled option instead. */ - enabled?: boolean; - /** * Specifies font options for area labels. * @deprecated Use the layers | label | font option instead. */ - font?: viz.core.Font; - }; - /** * Specifies the name of the palette or a custom range of colors to be used for coloring a map. * @deprecated Use the layers | palette option instead. */ - palette?: any; - /** * Specifies the number of colors in a palette. * @deprecated Use the layers | paletteSize option instead. */ - paletteSize?: number; - /** * Allows you to paint areas with similar attributes in the same color. * @deprecated Use the layers | colorGroups option instead. */ - colorGroups?: Array; - /** * Specifies the field that provides data to be used for coloring areas. * @deprecated Use the layers | colorGroupingField option instead. */ - colorGroupingField?: string; - /** * Specifies a color for the area border when the area is selected. * @deprecated Use the layers | selectedBorderColor option instead. */ - selectedBorderColor?: string; - /** * Specifies a color for an area when this area is selected. * @deprecated Use the layers | selectedColor option instead. */ - selectedColor?: string; - /** * Specifies the pixel-measured width of the area border when the area is selected. * @deprecated Use the layers | selectedBorderWidth option instead. */ - selectedBorderWidth?: number; - /** * Specifies whether single or multiple areas can be selected on a vector map. * @deprecated Use the layers | selectionMode option instead. */ - selectionMode?: string; - } - export interface MarkerSettings { - /** * Specifies a color for the marker border. * @deprecated Use the layers | borderColor option instead. */ - borderColor?: string; - /** * Specifies the width of the marker border in pixels. * @deprecated Use the layers | borderWidth option instead. */ - borderWidth?: number; - /** * Specifies a color for a marker of the dot or bubble type. * @deprecated Use the layers | color option instead. */ - color?: string; - /** * Specifies the function that customizes each marker individually. * @deprecated Use the layers | customize option instead. */ - customize?: (markerInfo: Marker) => MarkerSettings; - /** * Specifies the pixel-measured width of the marker border when the marker is hovered over. * @deprecated Use the layers | hoveredBorderWidth option instead. */ - hoveredBorderWidth?: number; - /** * Specifies a color for the marker border when the marker is hovered over. * @deprecated Use the layers | hoveredBorderColor option instead. */ - hoveredBorderColor?: string; - /** * Specifies a color for a marker of the dot or bubble type when this marker is hovered over. * @deprecated Use the layers | hoveredColor option instead. */ - hoveredColor?: string; - /** * Specifies whether or not to change the appearance of a marker when it is hovered over. * @deprecated Use the layers | hoverEnabled option instead. */ - hoverEnabled?: boolean; - /** * Specifies marker label options. * @deprecated Use the layers | label option instead. */ - label?: { - /** * Enables marker labels. * @deprecated Use the layers | label | enabled option instead. */ - enabled?: boolean; - /** * Specifies font options for marker labels. * @deprecated Use the layers | label | font option instead. */ - 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 Use the layers | maxSize option instead. */ - 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 Use the layers | minSize option instead. */ - minSize?: number; - /** * Specifies the opacity of markers. Setting this option makes sense only if you use markers of the bubble type. * @deprecated Use the layers | opacity option instead. */ - opacity?: number; - /** * Specifies the pixel-measured width of the marker border when the marker is selected. * @deprecated Use the layers | selectedBorderWidth option instead. */ - selectedBorderWidth?: number; - /** * Specifies a color for the marker border when the marker is selected. * @deprecated Use the layers | selectedBorderColor option instead. */ - selectedBorderColor?: string; - /** * Specifies a color for a marker of the dot or bubble type when this marker is selected. * @deprecated Use the layers | selectedColor option instead. */ - selectedColor?: string; - /** * Specifies whether a single or multiple markers can be selected on a vector map. * @deprecated Use the layers | selectionMode option instead. */ - selectionMode?: string; - /** * Specifies the size of markers. Setting this option makes sense for any type of marker except bubble. * @deprecated Use the layers | size option instead. */ - size?: number; - /** * Specifies the type of markers to be used on the map. * @deprecated Use the layers | elementType option instead. */ - 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 Use the layers | palette option instead. */ - palette?: any; - /** * Allows you to paint markers with similar attributes in the same color. * @deprecated Use the layers | colorGroups option instead. */ - colorGroups?: Array; - /** * Specifies the field that provides data to be used for coloring markers. * @deprecated Use the layers | colorGroupingField option instead. */ - colorGroupingField?: string; - /** * Allows you to display bubbles with similar attributes in the same size. * @deprecated Use the layers | sizeGroups option instead. */ - sizeGroups?: Array; - /** * Specifies the field that provides data to be used for sizing bubble markers. * @deprecated Use the layers | sizeGroupingField option instead. */ - sizeGroupingField?: string; - } - export interface dxVectorMapOptions extends viz.core.BaseWidgetOptions, viz.core.RedrawOnResizeOptions, viz.core.TitleOptions, viz.core.LoadingIndicatorOptions, viz.core.ExportOptions { - /** * An object specifying options for the map areas. * @deprecated Use the "area" type element of the layers array. */ - areaSettings?: AreaSettings; - /** Specifies the options for the map background. */ - background?: { - /** Specifies a color for the background border. */ - borderColor?: string; - /** Specifies a color for the background. */ - color?: string; - }; - /** Specifies options for VectorMap widget layers. */ - layers?: Array; - /** Specifies the map projection. */ - projection?: Object; - /** Specifies the positioning of a map in geographical coordinates. */ - bounds?: Array; - /** Specifies the options of the control bar. */ - controlBar?: { - /** Specifies a color for the outline of the control bar elements. */ - borderColor?: string; - /** Specifies a color for the inner area of the control bar elements. */ - color?: string; - /** Specifies whether or not to display the control bar. */ - enabled?: boolean; - /** Specifies the margin of the control bar in pixels. */ - margin?: number; - /** Specifies the position of the control bar. */ - horizontalAlignment?: string; - /** Specifies the position of the control bar. */ - verticalAlignment?: string; - /** Specifies the opacity of the control bar. */ - opacity?: number; - }; - /** * Specifies a data source for the map area. * @deprecated Use the layers | dataSource option instead. */ - mapData?: any; - /** * Specifies a data source for the map markers. * @deprecated Use the layers | dataSource option instead. */ - markers?: any; - /** * An object specifying options for the map markers. * @deprecated Use the "marker" type element of the layers array. */ - markerSettings?: MarkerSettings; - /** Configures tooltips. */ - tooltip?: viz.core.Tooltip; - /** Configures map legends. */ - legends?: Array; - /** Specifies whether or not the map should respond when a user rolls the mouse wheel. */ - wheelEnabled?: boolean; - /** Specifies whether the map should respond to touch gestures. */ - touchEnabled?: boolean; - /** Disables the zooming capability. */ - zoomingEnabled?: boolean; - /** Specifies the geographical coordinates of the center for a map. */ - center?: Array; - /** A handler for the centerChanged event. */ - onCenterChanged?: (e: { - center: Array; - component: dxVectorMap; - element: Element; - }) => void; - /** A handler for the tooltipShown event. */ - onTooltipShown?: (e: { - component: dxVectorMap; - element: Element; - target: {}; - }) => void; - /** A handler for the tooltipHidden event. */ - onTooltipHidden?: (e: { - component: dxVectorMap; - element: Element; - target: {}; - }) => void; - /** Specifies a number that is used to zoom a map initially. */ - zoomFactor?: number; - /** Specifies a map's maximum zoom factor. */ - maxZoomFactor?: number; - /** A handler for the zoomFactorChanged event. */ - onZoomFactorChanged?: (e: { - component: dxVectorMap; - element: Element; - zoomFactor: number; - }) => void; - /** A handler for the click event. */ - onClick?: any; - /** A handler for the selectionChanged event. */ - onSelectionChanged?: (e: { - component: dxVectorMap; - element: Element; - target: MapLayerElement; - }) => void; - /** * A handler for the areaClick event. * @deprecated Use the onClick option instead. */ - onAreaClick?: any; - /** * A handler for the areaSelectionChanged event. * @deprecated Use the onSelectionChanged option instead. */ - onAreaSelectionChanged?: (e: { - target: Area; - component: dxVectorMap; - element: Element; - }) => void; - /** * A handler for the markerClick event. * @deprecated Use the onClick option instead. */ - onMarkerClick?: any; - /** * A handler for the markerSelectionChanged event. * @deprecated Use the onSelecitonChanged option instead. */ - onMarkerSelectionChanged?: (e: { - target: Marker; - component: dxVectorMap; - element: Element; - }) => void; - /** Disables the panning capability. */ - panningEnabled?: boolean; - } - export interface Legend extends viz.core.BaseLegend { - /** Specifies the color of item markers in the legend. The specified color applied only when the legend uses 'size' source. */ - markerColor?: string; - /** Specifies the shape of item markers. */ - markerShape?: string; - /** Specifies text for legend items. */ - customizeText?: (itemInfo: { start: number; end: number; index: number; color: string; size: number; }) => string; - /** Specifies text for a hint that appears when a user hovers the mouse pointer over the text of a legend item. */ - customizeHint?: (itemInfo: { start: number; end: number; index: number; color: string; size: number }) => string; - /** Specifies the source of data for the legend. */ - source?: { - /** Specifies a layer to which the legend belongs. */ - layer?: string; - /** Specifies the type of the legend grouping. */ - grouping?: string; - } - } - 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; - } -} -declare module DevExpress.viz { - /** A vector map widget. */ - export class dxVectorMap extends viz.core.BaseWidget implements viz.core.LoadingIndicatorMethods { - constructor(element: JQuery, options?: DevExpress.viz.map.dxVectorMapOptions); - constructor(element: Element, options?: DevExpress.viz.map.dxVectorMapOptions); - showLoadingIndicator(): void; - hideLoadingIndicator(): void; - /** Gets the current coordinates of the map center. */ - center(): Array; - /** Sets the coordinates of the map center. */ - center(centerCoordinates: Array): void; - /** * Deselects all the selected areas on a map. The areas are displayed in their initial style after. * @deprecated Use the layer's clearSelection() method instead. */ - clearAreaSelection(): void; - /** * Deselects all the selected markers on a map. The markers are displayed in their initial style after. * @deprecated Use the layer's clearSelection() method instead. */ - clearMarkerSelection(): void; - /** Deselects all the selected area and markers on a map at once. The areas and markers are displayed in their initial style after. */ - clearSelection(): void; - /** Converts client area coordinates into map coordinates. */ - convertCoordinates(x: number, y: number): Array; - /** Gets all map layers. */ - getLayers(): Array; - /** Gets the layer by its index. */ - getLayerByIndex(index: number): DevExpress.viz.map.MapLayer; - /** Gets the layer by its name. */ - getLayerByName(name: string): DevExpress.viz.map.MapLayer; - /** * Returns an array with all the map areas. * @deprecated Use the layer's getElements() method instead. */ - getAreas(): Array; - /** * Returns an array with all the map markers. * @deprecated Use the layer's getElements() method instead. */ - getMarkers(): Array; - /** Gets the current coordinates of the map viewport. */ - viewport(): Array; - /** Sets the coordinates of the map viewport. */ - viewport(viewportCoordinates: Array): void; - /** Gets the current value of the map zoom factor. */ - zoomFactor(): number; - /** Sets the value of the map zoom factor. */ - zoomFactor(zoomFactor: number): void; - } -} -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 longer useful because the tooltips are aligned automatically. */ - horizontalAlignment?: string; - /** * Specifies how a tooltip is vertically aligned relative to the graph. * @deprecated Tooltip alignment is no longer useful because the tooltips are aligned automatically. */ - verticalAlignment?: string; - } - export interface BaseSparklineOptions extends viz.core.BaseWidgetOptions, viz.core.MarginOptions { - /** Configures the tooltip. */ - 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 { - } - export interface dxBulletOptions extends BaseSparklineOptions { - /** 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; - } - 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?: any; - /** 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; - } -} -declare module DevExpress.viz { - /** A bullet graph widget. */ - export class dxBullet extends DevExpress.viz.sparklines.BaseSparkline { - constructor(element: JQuery, options?: DevExpress.viz.sparklines.dxBulletOptions); - constructor(element: Element, options?: DevExpress.viz.sparklines.dxBulletOptions); - } - /** A sparkline widget. */ - export class dxSparkline extends DevExpress.viz.sparklines.BaseSparkline { - constructor(element: JQuery, options?: DevExpress.viz.sparklines.dxSparklineOptions); - constructor(element: Element, options?: DevExpress.viz.sparklines.dxSparklineOptions); - /** Returns the DataSource instance. */ - getDataSource(): DevExpress.data.DataSource; - } -} -declare module DevExpress.viz.treeMap { - export interface dxTreeMapOptions extends viz.core.BaseWidgetOptions, viz.core.RedrawOnResizeOptions, viz.core.TitleOptions, viz.core.LoadingIndicatorOptions, viz.core.ExportOptions { - /** Specifies the origin of data for the widget. */ - dataSource?: any; - /** Specifies the name of the data source field that provides nested items for a group. Applies to hierarchical data sources only. */ - childrenField?: string; - /** Specifies the name of the data source field that provides values for tiles. */ - valueField?: string; - /** Specifies the name of the data source field that provides colors for tiles. */ - colorField?: string; - /** Specifies the name of the data source field that provides texts for tile and group labels. */ - labelField?: string; - /** Specifies the name of the data source field that provides IDs for items. Applies to flat data sources only. */ - idField?: string; - /** Specifies the name of the data source field that provides parent IDs for items. Applies to flat data sources only. */ - parentField?: string; - /** Specifies the layout algorithm. */ - layoutAlgorithm?: any; - /** Specifies the direction in which the items will be laid out. */ - layoutDirection?: string; - /** Decides whether those labels that overflow their tile/group should be hidden or truncated with ellipsis. */ - resolveLabelOverflow?: string; - /** Configures tiles. */ - tile?: { - /** Configures the tile borders. */ - border?: { - /** Specifies the width of the tile borders in pixels. */ - width?: number; - /** Colors the tile borders. */ - color?: string; - }; - /** Specifies a single color for all tiles. */ - color?: string; - /** Specifies the appearance of tiles in the hover state. */ - hoverStyle?: { - /** Configures the appearance of the tile borders in the hover state. */ - border?: { - /** Specifies the width of the tile borders in pixels. Applies to a tile in the hover state. */ - width?: number; - /** Colors the tile borders in the hover state. */ - color?: string; - }; - /** Colors tiles in the hover state. */ - color?: string; - }; - /** Specifies the appearance of tiles in the selected state. */ - selectionStyle?: { - /** Configures the appearance of the tile borders in the selected state. */ - border?: { - /** Specifies the width of the tile borders in pixels. Applies to a tile in the selected state. */ - width?: number; - /** Colors the tile borders in the selected state. */ - color?: string; - }; - /** Colors tiles in the selected state. */ - color?: string; - }; - /** Configures the tile labels. */ - label?: { - /** Changes the visibility of the tile labels. */ - visible?: boolean; - /** Specifies the font settings of the tile labels. */ - font?: viz.core.Font; - }; - }; - /** Configures groups. */ - group?: { - /** Specifies the height of the group headers in pixels. */ - headerHeight?: number; - /** Configures the group borders. */ - border?: { - /** Specifies the width of the group borders in pixels. */ - width?: number; - /** Colors the group borders. */ - color?: string; - }; - /** Colors the group headers. */ - color?: string; - /** Specifies the appearance of groups in the hover state. */ - hoverStyle?: { - /** Configures the appearance of the group borders in the hover state. */ - border?: { - /** Specifies the width of the group borders in pixels. Applies to a group in the hover state. */ - width?: number; - /** Colors the group borders in the hover state. */ - color?: string; - }; - /** Colors the group headers in the hover state. */ - color?: string; - }; - /** Specifies the appearance of groups in the selected state. */ - selectionStyle?: { - /** Configures the appearance of the group borders in the selected state. */ - border?: { - /** Specifies the width of the group borders in pixels. Applies to a group in the selected state. */ - width?: number; - /** Colors the group borders in the selected state. */ - color?: string; - }; - /** Colors the group headers in the selected state. */ - color?: string; - }; - /** Configures the group labels. */ - label?: { - /** Changes the visibility of the group labels. */ - visible?: boolean; - /** Specifies the font settings of the group labels. */ - font?: viz.core.Font; - }; - }; - /** Manages the color settings. */ - colorizer?: { - /** Specifies the colorizing algorithm. */ - type?: string; - /** Sets the palette to be used for colorizing tiles. */ - palette?: any; - /** Specifies whether or not all tiles in a group must be colored uniformly. Applies only if the type option is "discrete". */ - colorizeGroups?: boolean; - /** Allows you to paint tiles with similar values uniformly. Applies only if the type option is "gradient" or "range". */ - range?: Array; - /** Specifies the name of the data source field whose values define the color of a tile. Applies only if the type option is "gradient" or "range". */ - colorCodeField?: string; - }; - /** Specifies whether tiles and groups change their style in the hover state. */ - hoverEnabled?: boolean; - /** Specifies whether a single or multiple nodes can be in the selected state simultaneously. */ - selectionMode?: string; - /** Specifies how many hierarchical levels must be visualized. */ - maxDepth?: number; - /** Specifies whether the user will interact with a single tile or its group. */ - interactWithGroup?: boolean; - tooltip?: viz.core.Tooltip; - /** A handler for the nodesInitialized event. */ - onNodesInitialized?: (e: { - component: dxTreeMap; - element: Element; - root: TreeMapNode - }) => void; - /** A handler for the nodesRendering event. */ - onNodesRendering?: (e: { - component: dxTreeMap; - element: Element; - node: TreeMapNode - }) => void; - /** A handler for the click event. */ - onClick?: any; - /** A handler for the hoverChanged event. */ - onHoverChanged?: (e: { - component: dxTreeMap; - element: Element; - node: TreeMapNode; - }) => void; - /** A handler for the selectionChanged event. */ - onSelectionChanged?: (e: { - component: dxTreeMap; - element: Element; - node: TreeMapNode; - }) => void; - /** A handler for the drill event. */ - onDrill?: (e: { - component: dxTreeMap; - element: Element; - node: TreeMapNode - }) => void; - } - /** This section describes fields and methods that can be used in code to manipulate a Node object. */ - export interface TreeMapNode { - /** The level that the current node occupies in the hierarchy of nodes. */ - level: number; - /** The index of the current node in the array of all nodes on the same level. */ - index: number; - /** The object from the data source visualized by the node. */ - data: Object; - /** Returns the parent node of the current node. */ - getParent(): TreeMapNode; - /** Indicates how many direct descendants the current node has. */ - getChildrenCount(): number; - /** Returns all nodes nested in the current node. */ - getAllChildren(): Array; - /** Returns all descendant nodes. */ - getAllNodes(): Array; - /** Gets a specific node from a collection of direct descendants. */ - getChild(index: number): TreeMapNode; - /** Gets the raw value of the node. */ - value(): number; - /** Returns the label of the node. */ - label(): string; - /** Sets the label to the node. */ - label(label: string): void; - /** Customizes the node. */ - customize(options: any): void; - /** Reverts the appearance of the node to the initial state. */ - resetCustomization(): void; - /** Indicates whether the node is in the hover state or not. */ - isHovered(): boolean; - /** Sets the selection state of a node. */ - select(state: boolean): void; - /** Indicates whether the node is selected or not. */ - isSelected(): boolean; - /** Indicates whether the node is visualized by a tile or a group of tiles. */ - isLeaf(): boolean; - /** Indicates whether the current node is active. */ - isActive(): boolean; - /** Shows the tooltip. */ - showTooltip(): void; - /** Drills down into the node. */ - drillDown(): void; - } -} -declare module DevExpress.viz { - /** A widget for displaying hierarchical data by using nested rectangles. */ - export class dxTreeMap extends viz.core.BaseWidget implements viz.core.LoadingIndicatorMethods { - constructor(element: JQuery, options?: DevExpress.viz.treeMap.dxTreeMapOptions); - constructor(element: Element, options?: DevExpress.viz.treeMap.dxTreeMapOptions); - /** Returns the root node. */ - getRootNode(): DevExpress.viz.treeMap.TreeMapNode; - /** Returns the current node. */ - getCurrentNode(): DevExpress.viz.treeMap.TreeMapNode; - /** Deselects all nodes in the widget. */ - clearSelection(): void; - /** Hides the tooltip. */ - hideTooltip(): void; - /** Drills one level up. */ - drillUp(): void; - /** Resets the drill down level. */ - resetDrillDown(): void; - showLoadingIndicator(): void; - hideLoadingIndicator(): void; - /** Returns the DataSource instance. */ - getDataSource(): DevExpress.data.DataSource; - } -} diff --git a/devextreme/tsconfig.json b/devextreme/tsconfig.json deleted file mode 100644 index da45f2fbe0..0000000000 --- a/devextreme/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "files": [ - "index.d.ts", - "devextreme-tests.ts" - ], - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - } -} \ No newline at end of file diff --git a/devextreme/v15/devextreme-tests.ts b/devextreme/v15/devextreme-tests.ts deleted file mode 100644 index a38aae1f05..0000000000 --- a/devextreme/v15/devextreme-tests.ts +++ /dev/null @@ -1,320 +0,0 @@ - - -namespace Tests.ui { - var dataGridOptions: DevExpress.ui.dxDataGridOptions = { - activeStateEnabled: true, - allowColumnReordering: true, - allowColumnResizing: true, - onCellClick: function() { }, - cellHintEnabled: true, - columnAutoWidth: true, - columnChooser: { - emptyPanelText: "Nothing is here", - enabled: true, - height: 400, - width: 200, - title: "Column chooser" - }, - columns: [ - { - alignment: "center", - allowFixing: true, - allowEditing: true, - allowFiltering: true, - allowGrouping: true, - allowHiding: true, - allowReordering: true, - allowResizing: true, - allowSearch: true, - allowSorting: true, - autoExpandGroup: true, - calculateCellValue: function(rowData: Object) { return "test-value"; }, - calculateFilterExpression: function(filterValue: any, selectedFilterOperation: string) { return []; }, - caption: "Test column", - cellTemplate: function(container: JQuery, options: Object) { $("Template").appendTo(container); }, - cssClass: "test-ccs-class-name", - customizeText: function(cellInfo: { value: any, valueText: string; }) { return "New text" }, - dataField: "Test", - dataType: "string", - encodeHtml: true, - falseText: "FALSE", - filterOperations: ["contains", "notcontains"], - filterType: "exclude", - filterValue: "Test-filter-value", - fixed: true, - fixedPosition: "right", - groupIndex: 0, - lookup: { - allowClearing: true, - dataSource: ["first", "second"], - displayExpr: "this", - valueExpr: "this" - }, - name: "test-column-name", - showEditorAlways: true, - showInColumnChooser: true, - showWhenGrouped: true, - sortIndex: 1, - sortOrder: "desc", - trueText: "TRUE", - visible: true, - visibleIndex: 0, - width: "100%" - } - ], - customizeColumns: function(columns) { - var i: number; - for (i = 0; i < columns.length; i++) { - if (columns[i].dataField.indexOf('Date') > 0) { - columns[i].dataType = 'date'; - } - - if (columns[i].dataField === 'Freight') { - columns[i].dataType = 'number'; - } - - if (columns[i].dataField === 'CustomerID') { - columns[i].lookup = { - dataSource: { store: [], sort: 'ContactName' }, - valueExpr: 'CustomerID', - displayExpr: 'ContactName' - } - } - if (columns[i].dataField === 'EmployeeID') { - columns[i].lookup = { - dataSource: { store: [], sort: 'LastName' }, - valueExpr: 'EmployeeID', - displayExpr: function(data: any) { - return data.LastName + ' ' + data.FirstName; - } - } - } - if (columns[i].dataField === 'ShipVia') { - columns[i].lookup = { - dataSource: [ - { ShipperID: 1, CompanyName: 'Speedy Express' }, - { ShipperID: 2, CompanyName: 'United Package' }, - { ShipperID: 3, CompanyName: 'Federal Shipping' } - ], - valueExpr: 'ShipperID', - displayExpr: 'CompanyName' - } - } - if (columns[i].dataField === 'ShipCity') { - columns[i].editCellTemplate = function(container: JQuery, options: { value: string; setValue: Function }) { - $('
    ').dxAutocomplete({ - dataSource: ["Bern", "Lyon", "Lander"], - value: options.value, - onValueChanged: function() { - options.setValue("test-value"); - } - }).appendTo(container); - } - } - } - }, - summary: { - totalItems: [{ - column: 'CustomerID', - summaryType: 'count' - }, { - column: 'Freight', - summaryType: 'min', - valueFormat: "percent", - showInColumn: "CustomerID" - }, - { - column: 'OrderDate', - summaryType: 'min', - valueFormat: "shortDate" - }, - { - column: 'Freight', - summaryType: 'avg', - valueFormat: "fixedPoint", - precision: 2 - }], - groupItems: [{ - column: 'CustomerID', - summaryType: 'count', - showInGroupFooter: true - }, { - column: 'Freight', - summaryType: 'min' - }, { - column: 'Freight', - summaryType: 'max' - }, - { - column: 'ShipName', - summaryType: 'count', - showInGroupFooter: true - }, - { - column: 'OrderDate', - summaryType: 'min', - valueFormat: "shortDate", - showInColumn: "CustomerID", - showInGroupFooter: true - }] - }, - sortByGroupSummaryInfo: [{ summaryItem: 'count' }], - groupPanel: { - visible: true - }, - filterRow: { - visible: true - }, - pager: { - visible: true, - showInfo: true, - showNavigationButtons: true, - showPageSizeSelector: true - }, - stateStoring: { - enabled: false - }, - rowAlternationEnabled: true, - editing: { - editMode: 'batch', - insertEnabled: true, - editEnabled: true, - removeEnabled: true - }, - searchPanel: { - visible: true - }, - sorting: { - mode: 'multiple' - } - }; - - new DevExpress.ui.dxDataGrid($("#data-grid"), dataGridOptions); - new DevExpress.ui.dxDataGrid($("#data-grid").get(0), dataGridOptions); - $("#data-grid").dxDataGrid(dataGridOptions); -} - -namespace Tests.viz { - var chartOptions: DevExpress.viz.charts.dxChartOptions = { - dataSource: [ - { arg: "Illinois", s1: 100, s2: 50, s3: 75, s4: 25, s5: 50, s6: 100, s7: 25, s8: 75 }, - { arg: "Indiana", s1: 100, s2: 50, s3: 75, s4: 25, s5: 50, s6: 100, s7: 25, s8: 75 }, - { arg: "Michigan", s1: 100, s2: 50, s3: 75, s4: 25, s5: 50, s6: 100, s7: 25, s8: 75 } - ], - valueAxis: [{ title: 'Value Axis Title' }], - argumentAxis: { title: 'Argument Axis Title', grid: { visible: true } }, - legend: { border: { visible: true } }, - tooltip: { enabled: true }, - commonPaneSettings: { border: { visible: true } }, - commonSeriesSettings: { - type: 'bar', - hoverMode: 'allArgumentPoints', - selectionMode: 'allArgumentPoints', - label: { - visible: true, - format: 'fixedPoint', - precision: 2 - } - }, - series: [ - { valueField: 's1' }, - { valueField: 's2' }, - { valueField: 's3' }, - { valueField: 's4' }, - { valueField: 's5' }, - { valueField: 's6' }, - { valueField: 's7' }, - { valueField: 's8' } - ], - title: 'Long Chart\'s Title', - onPointClick: function(arg: any) { - arg.target.isSelected() ? arg.target.clearSelection() : arg.target.select(); - }, - onSeriesClick: function(arg: any) { - arg.target.isVisible() ? arg.target.hide() : arg.target.show(); - } - }; - - var pieChartOptions: DevExpress.viz.charts.dxPieChartOptions = { - dataSource: [{ arg: "Index1", arg1: 1, val: 100 }, - { arg: "Index2", arg1: 2, val: 50 }, - { arg: "Index3", arg1: 3, val: 75 }, - { arg: "Index4", arg1: 4, val: 25 }, - { arg: "Index5", arg1: 5, val: 50 }, - { arg: "Index6", arg1: 6, val: 100 }, - { arg: "Index7", arg1: 7, val: 25 }, - { arg: "Index8", arg1: 8, val: 75 }], - tooltip: { - enabled: true - }, - series: [{ - type: 'doughnut', - label: { - visible: true, - format: 'fixedPoint', - precision: 2 - } - }], - title: 'Long PieChart\'s Title' - }; - - new DevExpress.viz.charts.dxChart($("chart"), chartOptions); - new DevExpress.viz.charts.dxChart($("#chart").get(0), chartOptions); - $("#chart").dxChart(chartOptions); - - new DevExpress.viz.charts.dxPieChart($("#pie-chart"), pieChartOptions); - new DevExpress.viz.charts.dxPieChart($("#pie-chart").get(0), pieChartOptions); - $("#pie-chart").dxPieChart(pieChartOptions); -} - -namespace Tests.framework { - var app = new DevExpress.framework.html.HtmlApplication({ - namespace: "Application", - navigation: [ - { - title: "Home", - action: "#home", - icon: "home" - }, - { - title: "About", - action: "#about", - icon: "info" - } - ] - }); - - app.router.register(":view/:id", { view: "home", id: undefined }); - app.navigate(); -} - -namespace Tests.data { - new DevExpress.data.DataSource({ - sort: ["value", true], - group: ["id", false], - select: ["value"], - filter: ["value", "startswith", "first"], - - pageSize: 25, - paginate: true, - - map: function(item) { return item; }, - postProcess: function(data) { return data; }, - searchExpr: "expr", - searchOperation: "contains", - searchValue: "somevalue", - store: [1, 2, 3] - }); - - new DevExpress.data.ArrayStore(); - new DevExpress.data.ArrayStore({ - data: [{ id: 1, value: "First one" }, { id: 2, value: "Second one" }], - key: "id" - }); - - new DevExpress.data.CustomStore({ - load: function() { - return $.Deferred().promise(); - } - }); -} diff --git a/devextreme/v15/index.d.ts b/devextreme/v15/index.d.ts deleted file mode 100644 index 4c73e12d30..0000000000 --- a/devextreme/v15/index.d.ts +++ /dev/null @@ -1,7531 +0,0 @@ -// Type definitions for DevExtreme 15.2.13 -// Project: http://js.devexpress.com/ -// Definitions by: DevExpress Inc. -// Definitions: https://github.com/DefinitelyTyped/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; - export function requestAnimationFrame(callback: Function): number; - export function cancelAnimationFrame(requestID: number): void; - /** Custom Knockout binding that links an HTML element with a specific action. */ - export class Action { } - /** Used to get URLs that vary in a locally running application and the application running on production. */ - export class EndpointSelector { - constructor(options: { - [key: string]: { - local?: string; - production?: string; - } - }); - /** Returns a local or a productional URL depending on how the application is currently running. */ - urlFor(key: string): string; - } - /** An object that serves as a namespace for the methods that are used to animate UI elements. */ - export module fx { - /** Defines animation options. */ - export interface AnimationOptions { - /** A function called after animation is completed. */ - complete?: (element: JQuery, config: AnimationOptions) => void; - /** A number specifying wait time before animation execution. */ - delay?: number; - /** A number specifying the time period to wait before the animation of the next stagger item starts. */ - staggerDelay?: number; - /** A number specifying the time in milliseconds spent on animation. */ - duration?: number; - /** A string specifying the type of an easing function used for animation. */ - easing?: string; - /** Specifies the initial animation state. */ - from?: any; - /** A function called before animation is started. */ - start?: (element: JQuery, config: AnimationOptions) => void; - /** Specifies a final animation state. */ - to?: any; - /** A string value specifying the animation type. */ - type?: string; - /** Specifies the animation direction for the "slideIn" and "slideOut" animation types. */ - direction?: string; - } - /** Animates the specified element. */ - export function animate(element: HTMLElement, config: AnimationOptions): Object; - /** Returns a value indicating whether the specified element is being animated. */ - export function isAnimating(element: HTMLElement): boolean; - /** Stops the animation. */ - export function stop(element: HTMLElement, jumpToEnd: boolean): void; - } - /** The manager that performs several specified animations at a time. */ - export class TransitionExecutor { - /** Deletes all the animations registered in the Transition Executor by using the enter(elements, animation) and leave(elements, animation) methods. */ - reset(): void; - /** Registers a set of elements that should be animated as "entering" using the specified animation configuration. */ - enter(elements: JQuery, animation: any): void; - /** Registers a set of elements that should be animated as "leaving" using the specified animation configuration. */ - leave(elements: JQuery, animation: any): void; - /** Starts all the animations registered using the enter(elements, animation) and leave(elements, animation) methods beforehand. */ - start(config: Object): JQueryPromise; - /** Stops all started animations. */ - stop(): void; - } - export class AnimationPresetCollection { - /** Resets all the changes made in the animation repository. */ - resetToDefaults(): void; - /** Deletes the specified animation or clears all the animation repository, if an animation name is not passed. */ - clear(name: string): void; - /** Adds the specified animation preset to the animation repository by the specified name. */ - registerPreset(name: string, config: any): void; - /** Applies the changes made in the animation repository. */ - applyChanges(): void; - /** Returns the configuration of the animation found in the animation repository by the specified name for the current device. */ - getPreset(name: string): void; - /** Registers predefined animations in the animation repository. */ - registerDefaultPresets(): void; - } - /** A repository of animations. */ - export var animationPresets: AnimationPresetCollection; - /** The device object defines the device on which the application is running. */ - export interface Device { - /** Indicates whether or not the device platform is Android. */ - android?: boolean; - /** Specifies the type of the device on which the application is running. */ - deviceType?: string; - /** Indicates whether or not the device platform is generic, which means that the application will look and behave according to a generic "light" or "dark" theme. */ - generic?: boolean; - /** Indicates whether or not the device platform is iOS. */ - ios?: boolean; - /** Indicates whether or not the device type is 'phone'. */ - phone?: boolean; - /** Specifies the platform of the device on which the application is running. */ - platform?: string; - /** Indicates whether or not the device type is 'tablet'. */ - tablet?: boolean; - /** Specifies an array with the major and minor versions of the device platform. */ - version?: Array; - /** Indicates whether or not the device platform is Windows. */ - win?: boolean; - /** Specifies a performance grade of the current device. */ - grade?: string; - } - export class Devices implements EventsMixin { - constructor(options: { window: Window }); - /** Overrides actual device information to force the application to operate as if it was running on the specified device. */ - current(deviceName: any): void; - /** Returns information about the current device. */ - current(): Device; - orientationChanged: JQueryCallback; - /** Returns the current device orientation. */ - orientation(): string; - /** Returns real information about the current device regardless of the value passed to the devices.current(deviceName) method. */ - real(): Device; - on(eventName: "orientationChanged", eventHandler: (e: { orientation: string }) => void): Devices; - on(eventName: string, eventHandler: Function): Devices; - on(events: { [eventName: string]: Function; }): Devices; - off(eventName: "orientationChanged"): Devices; - off(eventName: string): Devices; - off(eventName: "orientationChanged", eventHandler: (e: { orientation: string }) => void): Devices; - off(eventName: string, eventHandler: Function): Devices; - } - /** An object that serves as a namespace for the methods and events specifying information on the current device. */ - export var devices: Devices; - /** The position object specifies the widget positioning options. */ - export interface PositionOptions { - /** The target element position that the widget is positioned against. */ - at?: any; - /** The element within which the widget is positioned. */ - boundary?: Object; - /** Specifies the horizontal and vertical offset from the window's boundaries. */ - boundaryOffset?: any; - /** 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?: any; - /** The target element that the widget is positioned against. */ - of?: Object; - /** Specifies horizontal and vertical offset in pixels. */ - offset?: any; - } - 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 bag for holding any options that require two-way binding (Angular approach specific) */ - bindingOptions?: { [key: string]: any; }; - } - /** A base class for all components. */ - export class DOMComponent extends Component { - constructor(element: JQuery, options?: DOMComponentOptions); - constructor(element: HTMLElement, options?: DOMComponentOptions); - /** Returns the root HTML element of the widget. */ - element(): JQuery; - /** Specifies the device-dependent default configuration options for this component. */ - static defaultOptions(rule: { - device?: any; - options?: any; - }): void; - } - export module data { - export interface ODataError extends Error { - httpStatus?: number; - errorDetails?: any; - } - export interface StoreOptions { - /** A handler for the modified event. */ - onModified?: () => void; - /** A handler for the modifying event. */ - onModifying?: () => void; - /** A handler for the removed event. */ - onRemoved?: (key: any) => void; - /** A handler for the removing event. */ - onRemoving?: (key: any) => void; - /** A handler for the updated event. */ - onUpdated?: (key: any, values: Object) => void; - /** A handler for the updating event. */ - onUpdating?: (key: any, values: Object) => void; - /** A handler for the loaded event. */ - onLoaded?: (result: Array) => void; - /** A handler for the loading event. */ - onLoading?: (loadOptions: LoadOptions) => void; - /** A handler for the inserted event. */ - onInserted?: (values: Object, key: any) => void; - /** A handler for the inserting event. */ - onInserting?: (values: Object) => void; - /** Specifies the function called when the Store causes an error. */ - errorHandler?: (e: Error) => void; - /** Specifies the key properties within the data associated with the Store. */ - key?: any; - } - export interface LoadOptions { - filter?: Object; - sort?: Object; - select?: Object; - expand?: Object; - group?: Object; - skip?: number; - take?: number; - userData?: Object; - requireTotalCount?: boolean; - } - /** The base class for all Stores. */ - export class Store implements EventsMixin { - constructor(options?: StoreOptions); - /** Returns the data item specified by the key. */ - byKey(key: any): JQueryPromise; - /** Adds an item to the data associated with this Store. */ - insert(values: Object): JQueryPromise; - /** Returns the key expression specified via the key configuration option. */ - key(): any; - /** Returns the key of the Store item that matches the specified object. */ - keyOf(obj: Object): any; - /** Starts loading data. */ - load(obj?: LoadOptions): JQueryPromise; - /** Removes the data item specified by the key. */ - remove(key: any): JQueryPromise; - /** Obtains the total count of items that will be returned by the load() function. */ - totalCount(options?: { - filter?: Object; - group?: Object; - }): JQueryPromise; - /** Updates the data item specified by the key. */ - update(key: any, values: Object): JQueryPromise; - on(eventName: "removing", eventHandler: (key: any) => void): Store; - on(eventName: "removed", eventHandler: (key: any) => void): Store; - on(eventName: "updating", eventHandler: (key: any, values: Object) => void): Store; - on(eventName: "updated", eventHandler: (key: any, values: Object) => void): Store; - on(eventName: "inserting", eventHandler: (values: Object) => void): Store; - on(eventName: "inserted", eventHandler: (values: Object, key: any) => void): Store; - on(eventName: "modifying", eventHandler: () => void): Store; - on(eventName: "modified", eventHandler: () => void): Store; - on(eventName: "loading", eventHandler: (loadOptions: LoadOptions) => void): Store; - on(eventName: "loaded", eventHandler: (result: Array) => void): Store; - on(eventName: string, eventHandler: Function): Store; - on(events: { [eventName: string]: Function; }): Store; - off(eventName: "removing"): Store; - off(eventName: "removed"): Store; - off(eventName: "updating"): Store; - off(eventName: "updated"): Store; - off(eventName: "inserting"): Store; - off(eventName: "inserted"): Store; - off(eventName: "modifying"): Store; - off(eventName: "modified"): Store; - off(eventName: "loading"): Store; - off(eventName: "loaded"): Store; - off(eventName: string): Store; - off(eventName: "removing", eventHandler: (key: any) => void): Store; - off(eventName: "removed", eventHandler: (key: any) => void): Store; - off(eventName: "updating", eventHandler: (key: any, values: Object) => void): Store; - off(eventName: "updated", eventHandler: (key: any, values: Object) => void): Store; - off(eventName: "inserting", eventHandler: (values: Object) => void): Store; - off(eventName: "inserted", eventHandler: (values: Object, key: any) => void): Store; - off(eventName: "modifying", eventHandler: () => void): Store; - off(eventName: "modified", eventHandler: () => void): Store; - off(eventName: "loading", eventHandler: (loadOptions: LoadOptions) => void): Store; - off(eventName: "loaded", eventHandler: (result: Array) => void): Store; - off(eventName: string, eventHandler: Function): Store; - } - export interface ArrayStoreOptions extends StoreOptions { - /** Specifies the array associated with this Store. */ - data?: Array; - } - /** A Store accessing an in-memory array. */ - export class ArrayStore extends Store { - constructor(options?: ArrayStoreOptions); - /** Clears all data associated with the current ArrayStore. */ - clear(): void; - /** Creates the Query object for the underlying array. */ - createQuery(): Query; - } - interface Promise { - then(doneFn?: Function, failFn?: Function, progressFn?: Function): Promise; - } - export interface CustomStoreOptions extends StoreOptions { - /** Specifies whether or not the store combines the search expression with the filter expression. */ - useDefaultSearch?: boolean; - /** 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; - /** The bag of custom parameters passed to the query executed when the DataSource load operation is invoked. */ - customQueryParams?: 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; - } - export interface OperationPromise extends JQueryPromise { - operationId: number; - } - /** An object that provides access to a data web service or local data storage for collection container widgets. */ - export class DataSource implements EventsMixin { - constructor(url: string); - constructor(data: Array); - constructor(options: CustomStoreOptions); - constructor(options: DataSourceOptions); - /** Disposes all resources associated with this DataSource. */ - dispose(): void; - /** Returns the current filter option value. */ - filter(): Object; - /** Sets the filter option value. */ - filter(filterExpr: Object): void; - /** Returns the current group option value. */ - group(): Object; - /** Sets the group option value. */ - group(groupExpr: Object): void; - /** Indicates whether or not the current page contains fewer items than the number of items specified by the pageSize configuration option. */ - isLastPage(): boolean; - /** Indicates whether or not at least one load() method execution has successfully finished. */ - isLoaded(): boolean; - /** Indicates whether or not the DataSource is currently being loaded. */ - isLoading(): boolean; - /** Returns the array of items currently operated by the DataSource. */ - items(): Array; - /** Returns the key expression. */ - key(): any; - /** Starts loading data. */ - load(): OperationPromise>; - /** Clears currently loaded DataSource items and calls the load() method. */ - reload(): OperationPromise>; - /** Returns an object that would be passed to the load() method of the underlying Store according to the current data shaping option values of the current DataSource instance. */ - loadOptions(): Object; - /** Returns the current pageSize option value. */ - 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; - /** Cancels the load operation associated with the specified identifier. */ - cancel(operationId: number): boolean; - on(eventName: "loadingChanged", eventHandler: (isLoading: boolean) => void): DataSource; - on(eventName: "loadError", eventHandler: (e?: Error) => void): DataSource; - on(eventName: "changed", eventHandler: () => void): DataSource; - on(eventName: string, eventHandler: Function): DataSource; - on(events: { [eventName: string]: Function; }): DataSource; - off(eventName: "loadingChanged"): DataSource; - off(eventName: "loadError"): DataSource; - off(eventName: "changed"): DataSource; - off(eventName: string): DataSource; - off(eventName: "loadingChanged", eventHandler: (isLoading: boolean) => void): DataSource; - off(eventName: "loadError", eventHandler: (e?: Error) => void): DataSource; - off(eventName: "changed", eventHandler: () => void): DataSource; - off(eventName: string, eventHandler: Function): DataSource; - } - /** An object used to work with primitive data types not supported by JavaScript when accessing an OData web service. */ - export class EdmLiteral { - /** Creates an EdmLiteral instance and assigns the specified value to it. */ - constructor(value: string); - /** Returns a string representation of the value associated with this EdmLiteral object. */ - valueOf(): string; - } - /** An object used to generate and hold the GUID. */ - export class Guid { - /** Creates a new Guid instance that holds the specified GUID. */ - constructor(value: string); - /** Creates a new Guid instance holding the generated GUID. */ - constructor(); - /** Returns a string representation of the Guid instance. */ - toString(): string; - /** Returns a string representation of the Guid instance. */ - valueOf(): string; - } - export interface LocalStoreOptions extends ArrayStoreOptions { - /** Specifies the time (in miliseconds) after the change operation, before the data is flushed. */ - flushInterval?: number; - /** Specifies whether the data is flushed immediatelly after each change operation, or after the delay specified via the flushInterval option. */ - immediate?: boolean; - /** The unique identifier used to distinguish the data within the HTML5 Web Storage. */ - name?: string; - } - /** A Store providing access to the HTML5 Web Storage. */ - export class LocalStore extends ArrayStore { - constructor(options?: LocalStoreOptions); - /** Removes all data associated with this Store. */ - clear(): void; - } - export interface ODataContextOptions extends ODataStoreOptions { - /** Specifies the list of entities to be accessed via the ODataContext. */ - entities?: Object; - /** Specifies the function called if the ODataContext causes an error. */ - errorHandler?: (e: Error) => void; - } - /** Provides access to the entire OData service. */ - export class ODataContext { - constructor(options?: ODataContextOptions); - /** Initiates the specified WebGet service operation that returns a value. For the information on service operations, refer to the OData documentation. */ - get(operationName: string, params: Object): JQueryPromise; - /** Initiates the specified WebGet service operation that returns nothing. For the information on service operations, refer to the OData documentation. */ - invoke(operationName: string, params: Object, httpMethod: Object): JQueryPromise; - /** Return a special proxy object to describe the entity link. */ - objectLink(entityAlias: string, key: any): Object; - } - export interface ODataStoreOptions extends StoreOptions { - /** A function used to customize a web request before it is sent. */ - beforeSend?: (request: { - url: string; - async: boolean; - method: string; - timeout: number; - params: Object; - payload: Object; - headers: Object; - }) => void; - /** Specifies whether the ODataStore uses the JSONP approach to access non-CORS-compatible remote services. */ - jsonp?: boolean; - /** Specifies the type of the ODataStore key property. The following key types are supported out of the box: String, Int32, Int64, and Guid. */ - keyType?: any; - /** Specifies whether or not dates found in the response are deserialized. */ - deserializeDates?: boolean; - /** Specifies the URL of the data service being accessed via the current ODataContext. */ - url?: string; - /** Specifies the version of the OData protocol used to interact with the data service. */ - version?: number; - /** Specifies the value of the withCredentials field of the underlying jqXHR object. */ - withCredentials?: boolean; - } - /** A Store providing access to a separate OData web service entity. */ - export class ODataStore extends Store { - constructor(options?: ODataStoreOptions); - /** Creates the Query object for the OData endpoint. */ - createQuery(loadOptions: Object): Object; - /** Returns the data item specified by the key. */ - byKey(key: any, extraOptions?: { expand?: Object }): JQueryPromise; - } - /** An universal chainable data query interface object. */ - export interface Query { - /** Calculates a custom summary for the items in the current Query. */ - aggregate(step: (accumulator: any, value: any) => any): JQueryPromise; - /** Calculates a custom summary for the items in the current Query. */ - aggregate(seed: any, step: (accumulator: any, value: any) => any, finalize: (result: any) => any): JQueryPromise; - /** Calculates the average item value for the current Query. */ - avg(getter: Object): JQueryPromise; - /** Finds the item with the maximum getter value. */ - max(getter: Object): JQueryPromise; - /** Finds the item with the maximum value in the Query. */ - max(): JQueryPromise; - /** Finds the item with the minimum value in the Query. */ - min(): JQueryPromise; - /** Finds the item with the minimum getter value. */ - min(getter: Object): JQueryPromise; - /** Calculates the average item value for the current Query, if each Query item has a numeric type. */ - avg(): JQueryPromise; - /** Returns the total count of items in the current Query. */ - count(): JQueryPromise; - /** Executes the Query. */ - enumerate(): JQueryPromise; - /** Filters the current Query data. */ - filter(criteria: Array): Query; - /** Filters the current Query data. */ - filter(predicate: (item: any) => boolean): Query; - /** Groups the current Query data. */ - groupBy(getter: Object): Query; - /** Applies the specified transformation to each item. */ - select(getter: Object): Query; - /** Limits the data item count. */ - slice(skip: number, take?: number): Query; - /** Sorts current Query data. */ - sortBy(getter: Object, desc: boolean): Query; - /** Sorts current Query data. */ - sortBy(getter: Object): Query; - /** Calculates the sum of item getter values in the current Query. */ - sum(getter: Object): JQueryPromise; - /** Calculates the sum of item values in the current Query. */ - sum(): JQueryPromise; - /** Adds one more sorting condition to the current Query. */ - thenBy(getter: Object): Query; - /** Adds one more sorting condition to the current Query. */ - thenBy(getter: Object, desc: boolean): Query; - /** Returns the array of current Query items. */ - toArray(): Array; - } - /** The global data layer error handler. */ - export var errorHandler: (e: Error) => void; - /** Encodes the specified string or array of bytes to base64 encoding. */ - export function base64_encode(input: any): string; - /** Creates a Query instance. */ - export function query(array: Array): Query; - /** Creates a Query instance for accessing the remote service specified by a URL. */ - export function query(url: string, queryOptions: Object): Query; - /** This section describes the utility objects provided by the DevExtreme data layer. */ - export var utils: { - /** Compiles a getter function from the getter expression. */ - compileGetter(expr: any): Function; - /** Compiles a setter function from the setter expression. */ - compileSetter(expr: any): Function; - odata: { - /** Holds key value converters for OData. */ - keyConverters: { - String(value: any): string; - Int32(value: any): number; - Int64(value: any): EdmLiteral; - Guid(value: any): Guid; - Boolean(value: any): boolean; - Single(value: any): EdmLiteral; - Decimal(value: any): EdmLiteral; - }; - } - } - } - /** An object that serves as a namespace for DevExtreme UI widgets as well as for methods implementing UI logic in DevExtreme sites/applications. */ - export module ui { - export interface WidgetOptions extends DOMComponentOptions { - /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ - activeStateEnabled?: boolean; - /** A Boolean value specifying whether or not the widget can respond to user interaction. */ - disabled?: boolean; - /** A Boolean value specifying whether or not the widget changes its state when being hovered by an end user. */ - hoverStateEnabled?: boolean; - /** Specifies whether or not the widget can be focused. */ - focusStateEnabled?: boolean; - /** Specifies a shortcut key that sets focus on the widget element. */ - accessKey?: string; - /** A Boolean value specifying whether or not the widget is visible. */ - visible?: boolean; - /** Specifies the widget tab index. */ - tabIndex?: number; - /** Specifies the text of the hint displayed for the widget. */ - hint?: string; - } - /** The base class for widgets. */ - export class Widget extends DOMComponent { - constructor(options?: WidgetOptions); - /** Redraws the widget. */ - repaint(): void; - /** Sets focus on the widget. */ - focus(): void; - /** Registers a handler when a specified key is pressed. */ - registerKeyHandler(key: string, handler: Function): void; - } - export interface CollectionWidgetOptions extends WidgetOptions { - /** A data source used to fetch data to be displayed by the widget. */ - dataSource?: any; - /** The time period in milliseconds before the onItemHold event is raised. */ - itemHoldTimeout?: number; - /** An array of items displayed by the widget. */ - items?: Array; - /** The template to be used for rendering items. */ - itemTemplate?: any; - loopItemFocus?: boolean; - /** The text or HTML markup displayed by the widget if the item collection is empty. */ - noDataText?: string; - onContentReady?: any; - /** A handler for the itemClick event. */ - onItemClick?: any; - /** A handler for the itemContextMenu event. */ - onItemContextMenu?: Function; - /** A handler for the itemHold event. */ - onItemHold?: Function; - /** A handler for the itemRendered event. */ - onItemRendered?: Function; - /** A handler for the selectionChanged event. */ - onSelectionChanged?: Function; - /** The index of the currently selected widget item. */ - selectedIndex?: number; - /** The selected item object. */ - selectedItem?: Object; - /** An array of currently selected item objects. */ - selectedItems?: Array; - /** A handler for the itemDeleting event. */ - onItemDeleting?: Function; - /** A handler for the itemDeleted event. */ - onItemDeleted?: Function; - /** A handler for the itemReordered event. */ - onItemReordered?: Function; - } - /** The base class for widgets containing an item collection. */ - export class CollectionWidget extends Widget { - constructor(element: JQuery, options?: CollectionWidgetOptions); - constructor(element: HTMLElement, options?: CollectionWidgetOptions); - selectItem(itemElement: any): void; - unselectItem(itemElement: any): void; - deleteItem(itemElement: any): JQueryPromise; - isItemSelected(itemElement: any): boolean; - reorderItem(itemElement: any, toItemElement: any): JQueryPromise; - } - export interface DataExpressionMixinOptions { - /** A data source used to fetch data to be displayed by the widget. */ - dataSource?: any; - /** Specifies the name of the data source item field whose value is displayed by the widget. */ - displayExpr?: any; - /** Specifies the name of a data source item field whose value is held in the value configuration option. */ - valueExpr?: any; - /** An array of items displayed by the widget. */ - items?: Array; - /** The template to be used for rendering items. */ - itemTemplate?: any; - /** The currently selected value in the widget. */ - value?: Object; - } - export interface EditorOptions extends WidgetOptions { - /** The currently specified value. */ - value?: Object; - /** A handler for the valueChanged event. */ - onValueChanged?: Function; - /** A Boolean value specifying whether or not the widget is read-only. */ - readOnly?: boolean; - /** Holds the object that defines the error that occurred during validation. */ - validationError?: Object; - /** Specifies whether the editor's value is valid. */ - isValid?: boolean; - /** Specifies how the message about the validation rules that are not satisfied by this editor's value is displayed. */ - validationMessageMode?: string; - } - /** A base class for editors. */ - export class Editor extends Widget { - /** Resets the editor's value to undefined. */ - reset(): void; - } - /** An object that serves as a namespace for methods displaying a message in an application/site. */ - export var dialog: { - /** Creates an alert dialog message containing a single "OK" button. */ - alert(message: string, title: string): JQueryPromise; - /** Creates a confirm dialog that contains "Yes" and "No" buttons. */ - confirm(message: string, title: string): JQueryPromise; - /** Creates a custom dialog using the options specified by the passed configuration object. */ - custom(options: { title?: string; message?: string; buttons?: Array; }): { - show(): JQueryPromise; - hide(): void; - hide(value: any): void; - }; - }; - /** Creates a toast message. */ - export function notify(message: any, type: string, displayTime: number): void; - /** Creates a toast message. */ - export function notify(options: Object): void; - /** An object that serves as a namespace for the methods that work with DevExtreme CSS Themes. */ - export var themes: { - /** Returns the name of the currently applied theme. */ - current(): string; - /** Changes the current theme to the specified one. */ - current(themeName: string): void; - }; - /** Sets a specified template engine. */ - export function setTemplateEngine(name: string): void; - /** Sets a custom template engine defined via custom compile and render functions. */ - export function setTemplateEngine(options: Object): void; - } - /** An object that serves as a namespace for utility methods that can be helpful when working with the DevExtreme framework and UI widgets. */ - export var utils: { - /** Sets parameters for the viewport meta tag. */ - initMobileViewport(options: { allowZoom?: boolean; allowPan?: boolean; allowSelection?: boolean }): void; - /** Requests that the browser call a specified function to update animation before the next repaint. */ - requestAnimationFrame(callback: Function): number; - /** Cancels an animation frame request scheduled with the requestAnimationFrame method. */ - cancelAnimationFrame(requestID: number): void; - }; - /** An object that serves as a namespace for DevExtreme Data Visualization Widgets. */ - export module viz { - /** Applies a theme for the entire page with several DevExtreme visualization widgets. */ - export function currentTheme(theme: string): void; - /** Applies a new theme (with the color scheme defined separately) for the entire page with several DevExtreme visualization widgets. */ - export function currentTheme(platform: string, colorScheme: string): void; - /** Registers a new theme based on the existing one. */ - export function registerTheme(customTheme: Object, baseTheme: string): void; - /** Applies a predefined or registered custom palette to all visualization widgets at once. */ - export function currentPalette(paletteName: string): void; - /** Obtains the color sets of a predefined or registered palette. */ - export function getPalette(paletteName: string): Object; - /** Registers a new palette. */ - export function registerPalette(paletteName: string, palette: Object): void; - } -} -declare 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 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?: any; - /** 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 Use the DataSource paging opportunities instead. - */ - pagingEnabled?: boolean; - /** The text or HTML markup displayed by the widget if the item collection is empty. */ - noDataText?: string; - /** A handler for the selectionChanged event. */ - onSelectionChanged?: Function; - /** A handler for the itemClick event. */ - onItemClick?: Function; - onContentReady?: Function; - } - /** A base class for drop-down list widgets. */ - export class dxDropDownList extends dxDropDownEditor { - constructor(element: JQuery, options?: dxDropDownListOptions); - constructor(element: Element, options?: dxDropDownListOptions); - } - export interface dxToolbarOptions extends CollectionWidgetOptions { - /** The template used to render menu items. */ - menuItemTemplate?: any; - /** Informs the widget about its location in a view HTML markup. */ - renderAs?: string; - } - /** A toolbar widget. */ - export class dxToolbar extends CollectionWidget { - constructor(element: JQuery, options?: dxToolbarOptions); - constructor(element: Element, options?: dxToolbarOptions); - } - export interface dxToastOptions extends dxOverlayOptions { - animation?: { - /** An object that defines the animation options used when the widget is being shown. */ - show?: fx.AnimationOptions; - /** An object that defines the animation options used when the widget is being hidden. */ - hide?: fx.AnimationOptions; - }; - /** The time span in milliseconds during which the dxToast widget is visible. */ - displayTime?: number; - height?: any; - /** The dxToast message text. */ - message?: string; - position?: PositionOptions; - shading?: boolean; - /** Specifies the dxToast widget type. */ - type?: string; - width?: any; - closeOnBackButton?: boolean; - /** A Boolean value specifying whether or not the toast is closed if a user swipes it out of the screen boundaries. */ - closeOnSwipe?: boolean; - /** A Boolean value specifying whether or not the toast is closed if a user clicks it. */ - closeOnClick?: boolean; - } - /** The toast message widget. */ - export class dxToast extends dxOverlay { - constructor(element: JQuery, options?: dxToastOptions); - constructor(element: Element, options?: dxToastOptions); - } - export interface dxTextEditorOptions extends EditorOptions { - /** A handler for the change event. */ - onChange?: Function; - /** A handler for the copy event. */ - onCopy?: Function; - /** A handler for the cut event. */ - onCut?: Function; - /** A handler for the enterKey event. */ - onEnterKey?: Function; - /** A handler for the focusIn event. */ - onFocusIn?: Function; - /** A handler for the focusOut event. */ - onFocusOut?: Function; - /** A handler for the input event. */ - onInput?: Function; - /** A handler for the keyDown event. */ - onKeyDown?: Function; - /** A handler for the keyPress event. */ - onKeyPress?: Function; - /** A handler for the keyUp event. */ - onKeyUp?: Function; - /** A handler for the paste event. */ - onPaste?: Function; - /** The text displayed by the widget when the widget value is empty. */ - placeholder?: string; - /** Specifies whether to display the Clear button in the widget. */ - showClearButton?: boolean; - /** Specifies the current value displayed by the widget. */ - value?: any; - /** Specifies DOM event names that update a widget's value. */ - valueChangeEvent?: string; - /** Specifies whether or not the widget checks the inner text for spelling mistakes. */ - spellcheck?: boolean; - /** Specifies HTML attributes applied to the inner input element of the widget. */ - attr?: Object; - /** The read-only option that holds the text displayed by the widget input element. */ - text?: string; - focusStateEnabled?: boolean; - hoverStateEnabled?: boolean; - /** The editor mask that specifies the format of the entered string. */ - mask?: string; - /** Specifies a mask placeholder character. */ - maskChar?: string; - /** Specifies custom mask rules. */ - maskRules?: Object; - /** A message displayed when the entered text does not match the specified pattern. */ - maskInvalidMessage?: string; - /** Specifies whether the value option holds only characters entered by a user or prompt characters as well. */ - useMaskedValue?: boolean; - } - /** A base class for text editing widgets. */ - export class dxTextEditor extends Editor { - constructor(element: JQuery, options?: dxTextEditorOptions); - constructor(element: Element, options?: dxTextEditorOptions); - /** Removes focus from the input element. */ - blur(): void; - /** Sets focus to the input element representing the widget. */ - focus(): void; - } - export interface dxTextBoxOptions extends dxTextEditorOptions { - /** Specifies the maximum number of characters you can enter into the textbox. */ - maxLength?: any; - /** The "mode" attribute value of the actual HTML input element representing the text box. */ - mode?: string; - } - /** A single-line text box widget. */ - export class dxTextBox extends dxTextEditor { - constructor(element: JQuery, options?: dxTextBoxOptions); - constructor(element: Element, options?: dxTextBoxOptions); - } - export interface dxTextAreaOptions extends dxTextBoxOptions { - /** Specifies whether or not the widget checks the inner text for spelling mistakes. */ - spellcheck?: boolean; - } - /** A widget used to display and edit multi-line text. */ - export class dxTextArea extends dxTextBox { - constructor(element: JQuery, options?: dxTextAreaOptions); - constructor(element: Element, options?: dxTextAreaOptions); - } - export interface dxTabsOptions extends CollectionWidgetOptions { - /** Specifies whether the widget enables an end-user to select only a single item or multiple items. */ - selectionMode?: string; - /** Specifies whether or not an end-user can scroll tabs by swiping. */ - scrollByContent?: boolean; - /** Specifies whether or not an end-user can scroll tabs. */ - scrollingEnabled?: boolean; - /** A Boolean value that specifies the availability of navigation buttons. */ - showNavButtons?: boolean; - } - /** A tab strip used to switch between pages. */ - export class dxTabs extends CollectionWidget { - constructor(element: JQuery, options?: dxTabsOptions); - constructor(element: Element, options?: dxTabsOptions); - } - export interface dxTabPanelOptions extends dxMultiViewOptions { - /** A handler for the titleClick event. */ - onTitleClick?: any; - /** A handler for the titleHold event. */ - onTitleHold?: Function; - /** A handler for the titleRendered event. */ - onTitleRendered?: Function; - /** The template to be used for rendering an item title. */ - itemTitleTemplate?: any; - /** A Boolean value specifying if tabs in the title are scrolled by content. */ - scrollByContent?: boolean; - /** A Boolean value that indicates whether or not to add scrolling support for tabs in the title. */ - scrollingEnabled?: boolean; - /** A Boolean value that specifies the availability of navigation buttons. */ - showNavButtons?: boolean; - } - /** A widget used to display a view and to switch between several views by clicking the appropriate tabs. */ - export class dxTabPanel extends dxMultiView { - constructor(element: JQuery, options?: dxTabPanelOptions); - constructor(element: Element, options?: dxTabPanelOptions); - } - export interface dxSelectBoxOptions extends dxDropDownListOptions { - /** Specifies DOM event names that update a widget's value. */ - valueChangeEvent?: string; - /** The template to be used for rendering the widget text field. */ - fieldTemplate?: any; - /** The text that is provided as a hint in the select box editor. */ - placeholder?: string; - /** Specifies whether or not the widget allows an end-user to enter a custom value. */ - fieldEditEnabled?: boolean; - } - /** A widget that allows you to select an item in a dropdown list. */ - export class dxSelectBox extends dxDropDownList { - constructor(element: JQuery, options?: dxSelectBoxOptions); - constructor(element: Element, options?: dxSelectBoxOptions); - } - export interface dxTagBoxOptions extends dxSelectBoxOptions { - /** Holds the list of selected values. */ - values?: Array; - /** A read-only option that holds the last selected value. */ - value?: Object; - } - /** A widget that allows you to select multiple items from a dropdown list. */ - export class dxTagBox extends dxSelectBox { - constructor(element: JQuery, options?: dxTagBoxOptions); - constructor(element: Element, options?: dxTagBoxOptions); - } - export interface dxScrollViewOptions extends dxScrollableOptions { - /** A handler for the pullDown event. */ - onPullDown?: Function; - /** Specifies the text shown in the pullDown panel when pulling the content down lowers the refresh threshold. */ - pulledDownText?: string; - /** Specifies the text shown in the pullDown panel while pulling the content down to the refresh threshold. */ - pullingDownText?: string; - /** A handler for the reachBottom event. */ - onReachBottom?: Function; - /** Specifies the text shown in the pullDown panel displayed when content is scrolled to the bottom. */ - reachBottomText?: string; - /** Specifies the text shown in the pullDown panel displayed when the content is being refreshed. */ - refreshingText?: string; - } - /** A widget used to display scrollable content. */ - export class dxScrollView extends dxScrollable { - constructor(element: JQuery, options?: dxScrollViewOptions); - constructor(element: Element, options?: dxScrollViewOptions); - /** 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; - } - export interface dxScrollableLocation { - top?: number; - left?: number; - } - export interface dxScrollableOptions extends DOMComponentOptions { - /** A string value specifying the available scrolling directions. */ - direction?: string; - /** A Boolean value specifying whether or not the widget can respond to user interaction. */ - disabled?: boolean; - /** A handler for the scroll event. */ - onScroll?: Function; - /** Specifies when the widget shows the scrollbar. */ - showScrollbar?: string; - /** A handler for the update event. */ - onUpdated?: Function; - /** Indicates whether to use native or simulated scrolling. */ - useNative?: boolean; - /** A Boolean value specifying whether to enable or disable the bounce-back effect. */ - bounceEnabled?: boolean; - /** A Boolean value specifying whether or not an end-user can scroll the widget content swiping it up or down. */ - scrollByContent?: boolean; - /** A Boolean value specifying whether or not an end-user can scroll the widget content using the scrollbar. */ - scrollByThumb?: boolean; - } - /** A widget used to display scrollable content. */ - export class dxScrollable extends DOMComponent { - constructor(element: JQuery, options?: dxScrollableOptions); - constructor(element: Element, options?: dxScrollableOptions); - /** Returns the height of the scrollable widget in pixels. */ - clientHeight(): number; - /** Returns the width of the scrollable widget in pixels. */ - clientWidth(): number; - /** Returns an HTML element of the widget. */ - content(): JQuery; - /** Scrolls the widget content by the specified number of pixels. */ - scrollBy(distance: number): void; - /** Scrolls widget content by the specified number of pixels in horizontal and vertical directions. */ - scrollBy(distanceObject: dxScrollableLocation): void; - /** Returns the height of the scrollable content in pixels. */ - scrollHeight(): number; - /** Returns the current scroll position against the leftmost position. */ - scrollLeft(): number; - /** Returns how far the scrollable content is scrolled from the top and from the left. */ - scrollOffset(): dxScrollableLocation; - /** Scrolls widget content to the specified position. */ - scrollTo(targetLocation: number): void; - /** Scrolls widget content to a specified position. */ - scrollTo(targetLocation: dxScrollableLocation): void; - /** Scrolls widget content to the specified element. */ - scrollToElement(element: Element): void; - /** Returns the current scroll position against the topmost position. */ - scrollTop(): number; - /** Returns the width of the scrollable content in pixels. */ - scrollWidth(): number; - /** Updates the dimensions of the scrollable contents. */ - update(): void; - } - export interface dxRadioGroupOptions extends EditorOptions, DataExpressionMixinOptions { - activeStateEnabled?: boolean; - /** Specifies the radio group layout. */ - layout?: string; - } - /** A widget that enables a user to select one item within a list of items represented by radio buttons. */ - export class dxRadioGroup extends CollectionWidget { - constructor(element: JQuery, options?: dxRadioGroupOptions); - constructor(element: Element, options?: dxRadioGroupOptions); - } - export interface dxPopupButtonOptions { - /** Specifies whether or not a toolbar item must be displayed disabled. */ - disabled?: boolean; - /** Specifies html code inserted into the toolbar item element. */ - html?: string; - /** Specifies a location for the item on the toolbar. */ - location?: string; - /** Specifies a configuration object for the widget that presents a toolbar item. */ - options?: Object; - /** Specifies an item template that should be used to render this item only. */ - template?: any; - /** Specifies text displayed for the toolbar item. */ - text?: string; - /** Specifies whether the item is displayed on a top or bottom toolbar. */ - toolbar?: string; - /** Specifies whether or not a widget item must be displayed. */ - visible?: boolean; - /** A widget that presents a toolbar item. */ - widget?: string; - } - export interface dxPopupOptions extends dxOverlayOptions { - /** 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 that defines the animation options of the widget. */ - animation?: { - /** An object that defines the animation options used when the widget is being shown. */ - show?: fx.AnimationOptions; - /** An object that defines the animation options used when the widget is being hidden. */ - hide?: 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?: { - /** An object that defines the animation options used when the widget is being shown. */ - show?: fx.AnimationOptions; - /** An object that defines the animation options used when the widget is being hidden. */ - hide?: fx.AnimationOptions; - }; - /** A Boolean value specifying whether or not the widget is closed if a user presses the Back hardware button. */ - closeOnBackButton?: boolean; - /** A Boolean value specifying whether or not the widget is closed if a user clicks outside of the overlapping window. */ - closeOnOutsideClick?: any; - /** A template to be used for rendering widget content. */ - contentTemplate?: any; - /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ - deferRendering?: boolean; - /** Specifies whether or not an end-user can drag the widget. */ - dragEnabled?: boolean; - /** Specifies whether or not an end user can resize the widget. */ - resizeEnabled?: boolean; - /** The height of the widget in pixels. */ - height?: any; - /** Specifies the maximum height the widget can reach while resizing. */ - maxHeight?: any; - /** Specifies the maximum width the widget can reach while resizing. */ - maxWidth?: any; - /** Specifies the minimum height the widget can reach while resizing. */ - minHeight?: any; - /** Specifies the minimum width the widget can reach while resizing. */ - minWidth?: any; - /** A handler for the hidden event. */ - onHidden?: Function; - /** A handler for the resizeStart event. */ - onResizeStart?: Function; - /** A handler for the resize event. */ - onResize?: Function; - /** A handler for the resizeEnd event. */ - onResizeEnd?: Function; - /** A handler for the hiding event. */ - onHiding?: Function; - /** An object defining widget positioning options. */ - position?: PositionOptions; - /** A Boolean value specifying whether or not the main screen is inactive while the widget is active. */ - shading?: boolean; - /** Specifies the shading color. */ - shadingColor?: string; - /** A handler for the showing event. */ - onShowing?: Function; - /** A handler for the shown event. */ - onShown?: Function; - onContentReady?: Function; - /** A Boolean value specifying whether or not the widget is visible. */ - visible?: boolean; - /** The widget width in pixels. */ - width?: any; - } - /** A widget displaying the required content in an overlay window. */ - export class dxOverlay extends Widget { - constructor(element: JQuery, options?: dxOverlayOptions); - constructor(element: Element, options?: dxOverlayOptions); - /** An HTML element of the widget. */ - content(): JQuery; - /** Hides the widget. */ - hide(): JQueryPromise; - /** Recalculates the overlay's size and position. */ - repaint(): void; - /** Shows the widget. */ - show(): JQueryPromise; - /** Toggles the visibility of the widget. */ - toggle(showing: boolean): JQueryPromise; - /** A static method that specifies the base z-index for all overlay widgets. */ - static baseZIndex(zIndex: number): void; - } - export interface dxNumberBoxOptions extends dxTextEditorOptions { - /** The maximum value accepted by the number box. */ - max?: number; - /** The minimum value accepted by the number box. */ - min?: number; - /** Specifies whether or not to show spin buttons. */ - showSpinButtons?: boolean; - useTouchSpinButtons?: boolean; - /** Specifies by which value the widget value changes when a spin button is clicked. */ - step?: number; - /** The current number box value. */ - value?: number; - /** The "mode" attribute value of the actual HTML input element representing the widget. */ - mode?: string; - } - /** A textbox widget that enables a user to enter numeric values. */ - export class dxNumberBox extends dxTextEditor { - constructor(element: JQuery, options?: dxNumberBoxOptions); - constructor(element: Element, options?: dxNumberBoxOptions); - } - export interface dxNavBarOptions extends dxTabsOptions { - scrollingEnabled?: boolean; - } - /** A widget that contains items used to navigate through application views. */ - export class dxNavBar extends dxTabs { - constructor(element: JQuery, options?: dxNavBarOptions); - constructor(element: Element, options?: dxNavBarOptions); - } - export interface dxMultiViewOptions extends CollectionWidgetOptions { - /** Specifies whether or not to animate the displayed item change. */ - animationEnabled?: boolean; - /** A Boolean value specifying whether or not to scroll back to the first item after the last item is swiped. */ - loop?: boolean; - /** The index of the currently displayed item. */ - selectedIndex?: number; - /** A Boolean value specifying whether or not to allow users to change the selected index by swiping. */ - swipeEnabled?: boolean; - /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ - deferRendering?: boolean; - } - /** A widget used to display a view and to switch between several views. */ - export class dxMultiView extends CollectionWidget { - constructor(element: JQuery, options?: dxMultiViewOptions); - constructor(element: Element, options?: dxMultiViewOptions); - } - export interface dxMapOptions extends WidgetOptions { - /** Specifies whether or not the widget automatically adjusts center and zoom option values when adding a new marker or route, or when creating a widget if it initially contains markers or routes. */ - autoAdjust?: boolean; - center?: { - /** The latitude location displayed in the center of the widget. */ - lat?: number; - /** The longitude location displayed in the center of the widget. */ - lng?: number; - }; - /** A handler for the click event. */ - onClick?: any; - /** Specifies whether or not map widget controls are available. */ - controls?: boolean; - /** Specifies the height of the widget. */ - height?: any; - /** A key used to authenticate the application within the required map provider. */ - key?: { - /** A key used to authenticate the application within the "Bing" map provider. */ - bing?: string; - /** A key used to authenticate the application within the "Google" map provider. */ - google?: string; - /** A key used to authenticate the application within the "Google Static" map provider. */ - googleStatic?: string; - } - /** A handler for the markerAdded event. */ - onMarkerAdded?: Function; - /** A URL pointing to the custom icon to be used for map markers. */ - markerIconSrc?: string; - /** A handler for the markerRemoved event. */ - onMarkerRemoved?: Function; - /** An array of markers displayed on a map. */ - markers?: Array; - /** The name of the current map data provider. */ - provider?: string; - /** A handler for the ready event. */ - onReady?: Function; - /** A handler for the routeAdded event. */ - onRouteAdded?: Function; - /** A handler for the routeRemoved event. */ - onRouteRemoved?: Function; - /** An array of routes shown on the map. */ - routes?: Array; - /** The type of a map to display. */ - type?: string; - /** Specifies the width of the widget. */ - width?: any; - /** The zoom level of the map. */ - zoom?: number; - } - /** An interactive map widget. */ - export class dxMap extends Widget { - constructor(element: JQuery, options?: dxMapOptions); - constructor(element: Element, options?: dxMapOptions); - /** Adds a marker to the map. */ - addMarker(markerOptions: Object): JQueryPromise; - /** Adds a route to the map. */ - addRoute(routeOptions: Object): JQueryPromise; - /** Removes a marker from the map. */ - removeMarker(marker: Object): JQueryPromise; - /** Removes a route from the map. */ - removeRoute(route: any): JQueryPromise; - } - export interface dxLookupOptions extends dxDropDownListOptions { - applyValueMode?: string; - /** An object that defines widget animation options. */ - animation?: { - /** An object that defines the animation options used when the widget is being shown. */ - show?: fx.AnimationOptions; - /** An object that defines the animation options used when the widget is being hidden. */ - hide?: fx.AnimationOptions; - }; - /** The text displayed on the Cancel button. */ - cancelButtonText?: string; - /** The text displayed on the Clear button. */ - clearButtonText?: string; - /** Specifies whether or not the widget cleans the search box when the popup window is displayed. */ - cleanSearchOnOpening?: boolean; - /** A Boolean value specifying whether or not a widget is closed if a user clicks outside of the overlaying window. */ - closeOnOutsideClick?: any; - /** The text displayed on the Apply button. */ - applyButtonText?: string; - /** A Boolean value specifying whether or not to display the lookup in full-screen mode. */ - fullScreen?: boolean; - focusStateEnabled?: boolean; - /** A Boolean value specifying whether or not to group widget items. */ - grouped?: boolean; - /** The name of the template used to display a group header. */ - groupTemplate?: any; - /** The text displayed on the button used to load the next page from the data source. */ - nextButtonText?: string; - /** A handler for the pageLoading event. */ - onPageLoading?: Function; - /** Specifies whether the next page is loaded when a user scrolls the widget to the bottom or when the "next" button is clicked. */ - pageLoadMode?: string; - /** Specifies the text shown in the pullDown panel, which is displayed when the widget is scrolled to the bottom. */ - pageLoadingText?: string; - /** The text displayed by the widget when nothing is selected. */ - placeholder?: string; - /** The height of the widget popup element. */ - popupHeight?: any; - /** The width of the widget popup element. */ - popupWidth?: any; - /** An object defining widget positioning options. */ - position?: PositionOptions; - /** Specifies the text displayed in the pullDown panel when the widget is pulled below the refresh threshold. */ - pulledDownText?: string; - /** Specifies the text shown in the pullDown panel while the list is being pulled down to the refresh threshold. */ - pullingDownText?: string; - /** A handler for the pullRefresh event. */ - onPullRefresh?: Function; - /** A Boolean value specifying whether or not the widget supports the "pull down to refresh" gesture. */ - pullRefreshEnabled?: boolean; - /** Specifies the text displayed in the pullDown panel while the widget is being refreshed. */ - refreshingText?: string; - /** A handler for the scroll event. */ - onScroll?: Function; - /** A Boolean value specifying whether or not the search bar is visible. */ - searchEnabled?: boolean; - /** The text that is provided as a hint in the lookup's search bar. */ - searchPlaceholder?: string; - /** A Boolean value specifying whether or not the main screen is inactive while the lookup is active. */ - shading?: boolean; - /** Specifies whether to display the Cancel button in the lookup window. */ - showCancelButton?: boolean; - /** - * A Boolean value specifying whether the widget loads the next page automatically when you reach the bottom of the list or when a button is clicked. - * @deprecated Use the pageLoadMode option instead. - */ - showNextButton?: boolean; - /** The title of the lookup window. */ - title?: string; - /** A template to be used for rendering the widget title. */ - titleTemplate?: any; - /** Specifies whether or not the widget uses native scrolling. */ - useNativeScrolling?: boolean; - /** Specifies whether or not to show lookup contents in a dxPopover widget. */ - usePopover?: boolean; - /** A handler for the valueChanged event. */ - onValueChanged?: Function; - /** A handler for the titleRendered event. */ - onTitleRendered?: Function; - /** A Boolean value specifying whether or not to display the title in the popup window. */ - showPopupTitle?: boolean; - /** The template to be used for rendering the widget text field. */ - fieldTemplate?: any; - } - /** A widget that allows a user to select predefined values from a lookup window. */ - export class dxLookup extends dxDropDownList { - constructor(element: JQuery, options?: dxLookupOptions); - constructor(element: Element, options?: dxLookupOptions); - } - 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); - } - /** An object containing items for a context menu called for a list item. */ - export interface ListOptionsMenuItem { - /** Specifies the menu item text. */ - text?: string; - /** Specifies the function called when the menu item is clicked. */ - action?: (itemElement: Element, itemData: any) => void; - } - export interface dxListOptions extends CollectionWidgetOptions { - /** A Boolean value specifying whether or not to display a grouped list. */ - grouped?: boolean; - /** The template to be used for rendering item groups. */ - groupTemplate?: any; - onItemDeleting?: Function; - /** A handler for the itemDeleted event. */ - onItemDeleted?: Function; - /** A handler for the groupRendered event. */ - onGroupRendered?: Function; - /** A handler for the itemReordered event. */ - onItemReordered?: Function; - /** A handler for the itemClick event. */ - onItemClick?: any; - /** A handler for the itemSwipe event. */ - onItemSwipe?: Function; - /** The text displayed on the button used to load the next page from the data source. */ - nextButtonText?: string; - /** A handler for the pageLoading event. */ - onPageLoading?: Function; - /** Specifies the text shown in the pullDown panel, which is displayed when the list is scrolled to the bottom. */ - pageLoadingText?: string; - /** Specifies the text displayed in the pullDown panel when the list is pulled below the refresh threshold. */ - pulledDownText?: string; - /** Specifies the text shown in the pullDown panel while the list is being pulled down to the refresh threshold. */ - pullingDownText?: string; - /** A handler for the pullRefresh event. */ - onPullRefresh?: Function; - /** A Boolean value specifying whether or not the widget supports the "pull down to refresh" gesture. */ - pullRefreshEnabled?: boolean; - /** Specifies the text displayed in the pullDown panel while the list is being refreshed. */ - refreshingText?: string; - /** A handler for the scroll event. */ - onScroll?: Function; - /** A Boolean value specifying whether to enable or disable list scrolling. */ - scrollingEnabled?: boolean; - /** Specifies when the widget shows the scrollbar. */ - showScrollbar?: string; - /** Specifies whether or not the widget uses native scrolling. */ - useNativeScrolling?: boolean; - /** A Boolean value specifying whether to enable or disable the bounce-back effect. */ - bounceEnabled?: boolean; - /** A Boolean value specifying if the list is scrolled by content. */ - scrollByContent?: boolean; - /** A Boolean value specifying if the list is scrolled using the scrollbar. */ - scrollByThumb?: boolean; - onItemContextMenu?: Function; - onItemHold?: Function; - /** Specifies whether or not an end-user can collapse groups. */ - collapsibleGroups?: boolean; - /** Specifies whether the next page is loaded when a user scrolls the widget to the bottom or when the "next" button is clicked. */ - pageLoadMode?: string; - /** Specifies whether or not to display controls used to select list items. */ - showSelectionControls?: boolean; - /** Specifies item selection mode. */ - selectionMode?: string; - selectAllText?: string; - onSelectAllChanged?: Function; - /** Specifies the array of items for a context menu called for a list item. */ - menuItems?: Array; - /** Specifies whether an item context menu is shown when a user holds or swipes an item. */ - menuMode?: string; - /** Specifies whether or not an end user can delete list items. */ - allowItemDeleting?: boolean; - /** Specifies the way a user can delete items from the list. */ - itemDeleteMode?: string; - /** Specifies whether or not an end user can reorder list items. */ - allowItemReordering?: boolean; - /** Specifies whether or not to show the loading panel when the DataSource bound to the widget is loading data. */ - indicateLoading?: boolean; - activeStateEnabled?: boolean; - } - /** A list widget. */ - export class dxList extends CollectionWidget { - constructor(element: JQuery, options?: dxListOptions); - constructor(element: Element, options?: dxListOptions); - /** Returns the height of the widget in pixels. */ - clientHeight(): number; - /** Removes the specified item from the list. */ - deleteItem(itemIndex: any): JQueryPromise; - /** Removes the specified item from the list. */ - deleteItem(itemElement: Element): JQueryPromise; - /** Returns a Boolean value that indicates whether or not the specified item is selected. */ - isItemSelected(itemIndex: any): boolean; - /** Returns a Boolean value that indicates whether or not the specified item is selected. */ - isItemSelected(itemElement: Element): boolean; - /** Reloads list data. */ - reload(): void; - /** Moves the specified item to the specified position in the list. */ - reorderItem(itemElement: Element, toItemElement: Element): JQueryPromise; - /** Moves the specified item to the specified position in the list. */ - reorderItem(itemIndex: any, toItemIndex: any): JQueryPromise; - /** Scrolls the list content by the specified number of pixels. */ - scrollBy(distance: number): void; - /** Returns the height of the list content in pixels. */ - scrollHeight(): number; - /** Scrolls list content to the specified position. */ - scrollTo(location: number): void; - /** Scrolls the list to the specified item. */ - scrollToItem(itemElement: Element): void; - /** Scrolls the list to the specified item. */ - scrollToItem(itemIndex: any): void; - /** Returns how far the list content is scrolled from the top. */ - scrollTop(): number; - /** Selects the specified item from the list. */ - selectItem(itemElement: Element): void; - /** Selects the specified item from the list. */ - selectItem(itemIndex: any): void; - /** Deselects the specified item from the list. */ - unselectItem(itemElement: Element): void; - /** Unselects the specified item from the list. */ - unselectItem(itemIndex: any): void; - /** Updates the widget scrollbar according to widget content size. */ - updateDimensions(): JQueryPromise; - /** Expands the specified group. */ - expandGroup(groupIndex: number): JQueryPromise; - /** Collapses the specified group. */ - collapseGroup(groupIndex: number): JQueryPromise; - } - export interface dxGalleryOptions extends CollectionWidgetOptions { - /** The time, in milliseconds, spent on slide animation. */ - animationDuration?: number; - /** Specifies whether or not to animate the displayed item change. */ - animationEnabled?: boolean; - /** A Boolean value specifying whether or not to allow users to switch between items by clicking an indicator. */ - indicatorEnabled?: boolean; - /** A Boolean value specifying whether or not to scroll back to the first item after the last item is swiped. */ - loop?: boolean; - /** The index of the currently active gallery item. */ - selectedIndex?: number; - /** A Boolean value specifying whether or not to display an indicator that points to the selected gallery item. */ - showIndicator?: boolean; - /** A Boolean value that specifies the availability of the "Forward" and "Back" navigation buttons. */ - showNavButtons?: boolean; - /** The time interval in milliseconds, after which the gallery switches to the next item. */ - slideshowDelay?: number; - /** A Boolean value specifying whether or not to allow users to switch between items by swiping. */ - swipeEnabled?: boolean; - /** Specifies whether or not to display parts of previous and next images along the sides of the current image. */ - wrapAround?: boolean; - /** Specifies if the widget stretches images to fit the total gallery width. */ - stretchImages?: boolean; - /** Specifies the width of an area used to display a single image. */ - initialItemWidth?: number; - } - /** An image gallery widget. */ - export class dxGallery extends CollectionWidget { - constructor(element: JQuery, options?: dxGalleryOptions); - constructor(element: Element, options?: dxGalleryOptions); - /** Shows the specified gallery item. */ - goToItem(itemIndex: number, animation: boolean): JQueryPromise; - /** Shows the next gallery item. */ - nextItem(animation: boolean): JQueryPromise; - /** Shows the previous gallery item. */ - prevItem(animation: boolean): JQueryPromise; - } - export interface dxDropDownEditorOptions extends dxTextBoxOptions { - /** Specifies the current value displayed by the widget. */ - value?: Object; - /** A handler for the closed event. */ - onClosed?: Function; - /** A handler for the opened event. */ - onOpened?: Function; - /** Specifies whether or not the drop-down editor is displayed. */ - opened?: boolean; - /** Specifies whether or not the widget allows an end-user to enter a custom value. */ - fieldEditEnabled?: boolean; - /** Specifies the way an end-user applies the selected value. */ - applyValueMode?: string; - /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ - deferRendering?: boolean; - activeStateEnabled?: boolean; - } - /** A drop-down editor widget. */ - export class dxDropDownEditor extends dxTextBox { - constructor(element: JQuery, options?: dxDropDownEditorOptions); - constructor(element: Element, options?: dxDropDownEditorOptions); - /** Closes the drop-down editor. */ - close(): void; - /** Opens the drop-down editor. */ - open(): void; - /** Resets the widget's value to null. */ - reset(): void; - /** Returns an <input> element of the widget. */ - field(): JQuery; - /** Returns an HTML element of the popup window content. */ - content(): JQuery; - } - export interface dxDateBoxOptions extends dxTextEditorOptions { - /** A format used to display date/time information. */ - format?: string; - /** A Globalize format string specifying the date display format. */ - formatString?: string; - /** The last date that can be selected within the widget. */ - max?: any; - /** The minimum date that can be selected within the widget. */ - min?: any; - /** The text displayed by the widget when the widget value is not yet specified. This text is also used as a title of the date picker. */ - placeholder?: string; - /** - * Specifies whether or not a user can pick out a date using the drop-down calendar. - * @deprecated Use the 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 the pickerType option instead. - */ - useNative?: boolean; - /** Specifies the interval between neighboring values in the popup list in minutes. */ - interval?: number; - /** Specifies the maximum zoom level of a calendar, which is used to pick the date. */ - maxZoomLevel?: string; - /** Specifies the minimal zoom level of a calendar, which is used to pick the date. */ - minZoomLevel?: string; - /** Specifies the type of date/time picker. */ - pickerType?: string; - /** Specifies the message displayed if the typed value is not a valid date or time. */ - invalidDateMessage?: string; - /** Specifies the message displayed if the specified date is later than the max value or earlier than the min value. */ - dateOutOfRangeMessage?: string; - /** The text displayed on the Apply button. */ - applyButtonText?: string; - /** The text displayed on the Cancel button. */ - cancelButtonText?: string; - } - /** A date box widget. */ - export class dxDateBox extends dxDropDownEditor { - constructor(element: JQuery, options?: dxDateBoxOptions); - constructor(element: Element, options?: dxDateBoxOptions); - } - export interface dxCheckBoxOptions extends EditorOptions { - activeStateEnabled?: boolean; - /** Specifies the widget state. */ - value?: boolean; - /** Specifies the text displayed by the check box. */ - text?: string; - } - /** A check box widget. */ - export class dxCheckBox extends Editor { - constructor(element: JQuery, options?: dxCheckBoxOptions); - constructor(element: Element, options?: dxCheckBoxOptions); - } - export interface dxCalendarOptions extends EditorOptions { - activeStateEnabled?: boolean; - /** Specifies a date displayed on the current calendar page. */ - currentDate?: Date; - /** Specifies the first day of a week. */ - firstDayOfWeek?: number; - /** An object or a value, specifying the date and time currently selected in the calendar. */ - value?: any; - /** The latest date the widget allows to select. */ - max?: any; - /** The earliest date the widget allows to select. */ - min?: any; - /** Specifies whether or not the widget displays a button that selects the current date. */ - showTodayButton?: boolean; - /** Specifies the current calendar zoom level. */ - zoomLevel?: string; - /** Specifies the maximum zoom level of the calendar. */ - maxZoomLevel?: string; - /** Specifies the minimum zoom level of the calendar. */ - minZoomLevel?: string; - /** The template to be used for rendering calendar cells. */ - cellTemplate?: any; - } - /** A calendar widget. */ - export class dxCalendar extends Editor { - constructor(element: JQuery, options?: dxCalendarOptions); - constructor(element: Element, options?: dxCalendarOptions); - } - export interface dxButtonOptions extends WidgetOptions { - /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ - activeStateEnabled?: boolean; - /** A handler for the click event. */ - onClick?: any; - /** Specifies the icon to be displayed on the button. */ - icon?: string; - iconSrc?: string; - /** A template to be used for rendering the dxButton widget. */ - template?: any; - /** The text displayed on the button. */ - text?: string; - /** Specifies the button type. */ - type?: string; - /** Specifies the name of the validation group to be accessed in the click event handler. */ - validationGroup?: string; - } - /** A button widget. */ - export class dxButton extends Widget { - constructor(element: JQuery, options?: dxButtonOptions); - constructor(element: Element, options?: dxButtonOptions); - } - export interface dxBoxOptions extends CollectionWidgetOptions { - /** 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; - /** The template to be used for rendering an item title. */ - itemTitleTemplate?: any; - /** The index number of the currently selected item. */ - selectedIndex?: number; - /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ - deferRendering?: boolean; - } - /** A widget that displays data source items on collapsible panels. */ - export class dxAccordion extends CollectionWidget { - constructor(element: JQuery, options?: dxAccordionOptions); - constructor(element: Element, options?: dxAccordionOptions); - /** Collapses the specified item. */ - collapseItem(index: number): JQueryPromise; - /** Expands the specified item. */ - expandItem(index: number): JQueryPromise; - /** Updates the dimensions of the widget contents. */ - updateDimensions(): JQueryPromise; - } - export interface dxFileUploaderOptions extends EditorOptions { - /** A read-only option that holds a File instance representing the selected file. */ - value?: File; - /** Holds the File instances representing files selected in the widget. */ - values?: Array; - buttonText?: string; - /** The text displayed on the button that opens the file browser. */ - selectButtonText?: string; - /** The text displayed on the button that starts uploading. */ - uploadButtonText?: string; - /** Specifies the text displayed on the area to which an end-user can drop a file. */ - labelText?: string; - /** Specifies the value passed to the name attribute of the underlying input element. */ - name?: string; - /** Specifies whether the widget enables an end-user to select a single file or multiple files. */ - multiple?: boolean; - /** Specifies a file type or several types accepted by the widget. */ - accept?: string; - /** Specifies a target Url for the upload request. */ - uploadUrl?: string; - /** Specifies if an end user can remove a file from the selection and interrupt uploading. */ - allowCanceling?: boolean; - /** Specifies whether or not the widget displays the list of selected files. */ - showFileList?: boolean; - /** Gets the current progress in percentages. */ - progress?: number; - /** The message displayed by the widget when it is ready to upload the specified files. */ - readyToUploadMessage?: string; - /** The message displayed by the widget when uploading is finished. */ - uploadedMessage?: string; - /** The message displayed by the widget on uploading failure. */ - uploadFailedMessage?: string; - /** Specifies how the widget uploads files. */ - uploadMode?: string; - /** A handler for the uploaded event. */ - onUploaded?: Function; - /** A handler for the uploaded event. */ - onProgress?: Function; - /** A handler for the uploadError event. */ - onUploadError?: Function; - /** A handler for the valueChanged event. */ - onValueChanged?: Function; - } - /** A widget used to select and upload a file or multiple files. */ - export class dxFileUploader extends Editor { - constructor(element: JQuery, options?: dxFileUploaderOptions); - constructor(element: Element, options?: dxFileUploaderOptions); - } - export interface dxTrackBarOptions extends EditorOptions { - /** The minimum value the widget can accept. */ - min?: number; - /** The maximum value the widget can accept. */ - max?: number; - /** The current widget value. */ - value?: number; - } - /** A base class for track bar widgets. */ - export class dxTrackBar extends Editor { - constructor(element: JQuery, options?: dxTrackBarOptions); - constructor(element: Element, options?: dxTrackBarOptions); - } - export interface dxProgressBarOptions extends dxTrackBarOptions { - /** Specifies a format for the progress status. */ - statusFormat?: any; - /** Specifies whether or not the widget displays a progress status. */ - showStatus?: boolean; - /** A handler for the complete event. */ - onComplete?: Function; - } - /** A widget used to indicate progress. */ - export class dxProgressBar extends dxTrackBar { - constructor(element: JQuery, options?: dxProgressBarOptions); - constructor(element: Element, options?: dxProgressBarOptions); - } - export interface dxSliderOptions extends dxTrackBarOptions { - activeStateEnabled?: boolean; - /** The slider step size. */ - step?: number; - /** The current slider value. */ - value?: number; - /** Specifies whether or not to highlight a range selected within the widget. */ - showRange?: boolean; - /** Specifies the size of a step by which a slider handle is moved when a user uses the Page up or Page down keyboard shortcuts. */ - keyStep?: number; - /** Specifies options for the slider tooltip. */ - tooltip?: { - /** Specifies whether or not the tooltip is enabled. */ - enabled?: boolean; - /** Specifies format for the tooltip. */ - format?: any; - /** Specifies whether the tooltip is located over or under the slider. */ - position?: string; - /** Specifies whether the widget always shows a tooltip or only when a pointer is over the slider. */ - showMode?: string; - }; - /** Specifies options for labels displayed at the min and max values. */ - label?: { - /** Specifies whether or not slider labels are visible. */ - visible?: boolean; - /** Specifies whether labels are located over or under the scale. */ - position?: string; - /** Specifies a format for labels. */ - format?: any; - }; - } - /** A widget that allows a user to select a numeric value within a given range. */ - export class dxSlider extends dxTrackBar { - constructor(element: JQuery, options?: dxSliderOptions); - constructor(element: Element, options?: dxSliderOptions); - } - export interface dxRangeSliderOptions extends dxSliderOptions { - /** The left edge of the interval currently selected using the range slider. */ - start?: number; - /** The right edge of the interval currently selected using the range slider. */ - end?: number; - } - /** A widget that enables a user to select a range of numeric values. */ - export class dxRangeSlider extends dxSlider { - constructor(element: JQuery, options?: dxRangeSliderOptions); - constructor(element: Element, options?: dxRangeSliderOptions); - } - export interface dxFormItemLabel { - /** Specifies the label text. */ - text?: string; - /** Specifies whether or not the label is visible. */ - visible?: boolean; - /** Specifies whether or not a colon is displayed at the end of the current label. */ - showColon?: boolean; - /** Specifies the location of a label against the editor. */ - location?: string; - /** Specifies the label horizontal alignment. */ - alignment?: string; - } - export interface dxFormItem { - /** Specifies the type of the current item. */ - itemType?: string; - /** Specifies whether or not the current form item is visible. */ - visible?: boolean; - /** Specifies the sequence number of the item in a form, group or tab. */ - visibleIndex?: number; - /** Specifies a CSS class to be applied to the form item. */ - cssClass?: string; - /** Specifies the number of columns spanned by the item. */ - colSpan?: number; - } - export interface dxFormEmptyItem extends dxFormItem { - /** Specifies the form item name. */ - name?: string; - } - export interface dxFormSimpleItem extends dxFormItem { - /** Specifies the path to the formData object field bound to the current form item. */ - dataField?: string; - /** Specifies the form item name. */ - name?: string; - /** Specifies which editor widget is used to display and edit the form item value. */ - editorType?: string; - /** Specifies configuration options for the editor widget of the current form item. */ - editorOptions?: Object; - /** A template to be used for rendering the form item. */ - template?: any; - /** Specifies the help text displayed for the current form item. */ - helpText?: string; - /** Specifies whether the current form item is required. */ - isRequired?: boolean; - /** Specifies options for the form item label. */ - label?: dxFormItemLabel; - /** An array of validation rules to be checked for the form item editor. */ - validationRules?: Array; - } - export interface dxFormGroupItem extends dxFormItem { - /** Specifies the group caption. */ - caption?: string; - /** A template to be used for rendering the group item. */ - template?: any; - /** The count of columns in the group layout. */ - colCount?: number; - /** Specifies whether or not all group item labels are aligned. */ - alignItemLabels?: boolean; - /** Holds an array of form items displayed within the group. */ - items?: Array; - } - export interface dxFormTab { - /** Specifies the tab title. */ - title?: string; - /** The count of columns in the tab layout. */ - colCount?: number; - /** Specifies whether or not labels of items displayed within the current tab are aligned. */ - alignItemLabels?: boolean; - /** Holds an array of form items displayed within the tab. */ - items?: Array; - /** Specifies a badge text for the tab. */ - badge?: string; - /** A Boolean value specifying whether or not the tab can respond to user interaction. */ - disabled?: boolean; - /** Specifies the icon to be displayed on the tab. */ - icon?: string; - /** The template to be used for rendering the tab. */ - tabTemplate?: any; - /** The template to be used for rendering the tab content. */ - template?: any; - } - export interface dxFormTabbedItem extends dxFormItem { - /** Holds a configuration object for the dxTabPanel widget used to display the current form item. */ - tabPanelOptions?: Object; - /** An array of tab configuration objects. */ - tabs?: Array; - } - export interface dxFormOptions extends WidgetOptions { - /** An object providing data for the form. */ - formData?: Object; - /** The count of columns in the form layout. */ - colCount?: any; - /** Specifies the location of a label against the editor. */ - labelLocation?: string; - /** Specifies whether or not all editors on the form are read-only. */ - readOnly?: boolean; - /** A handler for the fieldDataChanged event. */ - onFieldDataChanged?: (e: Object) => void; - /** A handler for the editorEnterKey event. */ - onEditorEnterKey?: (e: Object) => void; - /** Specifies a function that customizes a form item after it has been created. */ - customizeItem?: Function; - /** The minimum column width used for calculating column count in the form layout. */ - minColWidth?: number; - /** Specifies whether or not all root item labels are aligned. */ - alignItemLabels?: boolean; - /** Specifies whether or not item labels in all groups are aligned. */ - alignItemLabelsInAllGroups?: boolean; - /** Specifies whether or not a colon is displayed at the end of form labels. */ - showColonAfterLabel?: boolean; - /** Specifies whether or not the required mark is displayed for required fields. */ - showRequiredMark?: boolean; - /** Specifies whether or not the optional mark is displayed for optional fields. */ - showOptionalMark?: boolean; - /** The text displayed for required fields. */ - requiredMark?: string; - /** The text displayed for optional fields. */ - optionalMark?: string; - /** Specifies the message that is shown for end-users if a required field value is not specified. */ - requiredMessage?: string; - /** Specifies whether or not the total validation summary is displayed on the form. */ - showValidationSummary?: boolean; - /** Holds an array of form items. */ - items?: Array; - /** A Boolean value specifying whether to enable or disable form scrolling. */ - scrollingEnabled?: boolean; - onContentReady?: Function; - } - /** A form widget used to display and edit values of object fields. */ - export class dxForm extends Widget { - constructor(element: JQuery, options?: dxFormOptions); - constructor(element: Element, options?: dxFormOptions); - /** Updates the specified field of the formData object and the corresponding editor on the form. */ - updateData(dataField: string, value: any): void; - /** Updates the specified fields of the formData object and the corresponding editors on the form. */ - updateData(data: Object): void; - /** Updates the value of a form item option. */ - itemOption(field: string, option: string, value: any): void; - /** Updates the values of form item options. */ - itemOption(field: string, options: Object): void; - /** Returns an editor instance associated with the specified formData field or name of the form item. */ - 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; - /** Resets the editor's value to undefined. */ - resetValues(): void; - } - export interface dxDeferRenderingOptions extends WidgetOptions { - /** Indicates if a load indicator should be shown until the widget's content is rendered. */ - showLoadIndicator?: boolean; - /** Specifies a jQuery.Promise or a boolean value, which upon resolving forces widget content to render. */ - renderWhen?: any; - /** Specifies the animation to be used to show the rendered content. */ - animation?: fx.AnimationOptions; - /** Specifies a jQuery selector of items that should be rendered using a staggered animation. */ - staggerItemSelector?: string; - /** Specifies a callback function that is called when the widget's content has finished rendering but is not yet shown. */ - onRendered?: Function; - /** Specifies a callback function that is called when widget content is shown and animation has completed. */ - onShown?: Function; - } - /** A container for elements that must be rendered at a specified moment. */ - export class dxDeferRendering extends Widget { - constructor(element: JQuery, options?: dxDeferRenderingOptions); - constructor(element: Element, options?: dxDeferRenderingOptions); - } -} -interface JQuery { - dxProgressBar(): JQuery; - dxProgressBar(options: "instance"): DevExpress.ui.dxProgressBar; - dxProgressBar(options: string): any; - dxProgressBar(options: string, ...params: any[]): any; - dxProgressBar(options: DevExpress.ui.dxProgressBarOptions): JQuery; - dxSlider(): JQuery; - dxSlider(options: "instance"): DevExpress.ui.dxSlider; - dxSlider(options: string): any; - dxSlider(options: string, ...params: any[]): any; - dxSlider(options: DevExpress.ui.dxSliderOptions): JQuery; - dxRangeSlider(): JQuery; - dxRangeSlider(options: "instance"): DevExpress.ui.dxRangeSlider; - dxRangeSlider(options: string): any; - dxRangeSlider(options: string, ...params: any[]): any; - dxRangeSlider(options: DevExpress.ui.dxRangeSliderOptions): JQuery; - dxFileUploader(): JQuery; - dxFileUploader(options: "instance"): DevExpress.ui.dxFileUploader; - dxFileUploader(options: string): any; - dxFileUploader(options: string, ...params: any[]): any; - dxFileUploader(options: DevExpress.ui.dxFileUploaderOptions): JQuery; - dxValidator(): JQuery; - dxValidator(options: "instance"): DevExpress.ui.dxValidator; - dxValidator(options: string): any; - dxValidator(options: string, ...params: any[]): any; - dxValidator(options: DevExpress.ui.dxValidatorOptions): JQuery; - dxValidationGroup(): JQuery; - dxValidationGroup(options: "instance"): DevExpress.ui.dxValidationGroup; - dxValidationGroup(options: string): any; - dxValidationGroup(options: string, ...params: any[]): any; - dxValidationSummary(): JQuery; - dxValidationSummary(options: "instance"): DevExpress.ui.dxValidationSummary; - dxValidationSummary(options: string): any; - dxValidationSummary(options: string, ...params: any[]): any; - dxValidationSummary(options: DevExpress.ui.dxValidationSummaryOptions): JQuery; - dxTooltip(): JQuery; - dxTooltip(options: "instance"): DevExpress.ui.dxTooltip; - dxTooltip(options: string): any; - dxTooltip(options: string, ...params: any[]): any; - dxTooltip(options: DevExpress.ui.dxTooltipOptions): JQuery; - dxResizable(): JQuery; - dxResizable(options: "instance"): DevExpress.ui.dxResizable; - dxResizable(options: string): any; - dxResizable(options: string, ...params: any[]): any; - dxResizable(options: DevExpress.ui.dxResizableOptions): JQuery; - dxDropDownList(): JQuery; - dxDropDownList(options: "instance"): DevExpress.ui.dxDropDownList; - dxDropDownList(options: string): any; - dxDropDownList(options: string, ...params: any[]): any; - dxDropDownList(options: DevExpress.ui.dxDropDownListOptions): JQuery; - dxToolbar(): JQuery; - dxToolbar(options: "instance"): DevExpress.ui.dxToolbar; - dxToolbar(options: string): any; - dxToolbar(options: string, ...params: any[]): any; - dxToolbar(options: DevExpress.ui.dxToolbarOptions): JQuery; - dxToast(): JQuery; - dxToast(options: "instance"): DevExpress.ui.dxToast; - dxToast(options: string): any; - dxToast(options: string, ...params: any[]): any; - dxToast(options: DevExpress.ui.dxToastOptions): JQuery; - dxTextEditor(): JQuery; - dxTextEditor(options: "instance"): DevExpress.ui.dxTextEditor; - dxTextEditor(options: string): any; - dxTextEditor(options: string, ...params: any[]): any; - dxTextEditor(options: DevExpress.ui.dxTextEditorOptions): JQuery; - dxTextBox(): JQuery; - dxTextBox(options: "instance"): DevExpress.ui.dxTextBox; - dxTextBox(options: string): any; - dxTextBox(options: string, ...params: any[]): any; - dxTextBox(options: DevExpress.ui.dxTextBoxOptions): JQuery; - dxTextArea(): JQuery; - dxTextArea(options: "instance"): DevExpress.ui.dxTextArea; - dxTextArea(options: string): any; - dxTextArea(options: string, ...params: any[]): any; - dxTextArea(options: DevExpress.ui.dxTextAreaOptions): JQuery; - dxTabs(): JQuery; - dxTabs(options: "instance"): DevExpress.ui.dxTabs; - dxTabs(options: string): any; - dxTabs(options: string, ...params: any[]): any; - dxTabs(options: DevExpress.ui.dxTabsOptions): JQuery; - dxTabPanel(): JQuery; - dxTabPanel(options: "instance"): DevExpress.ui.dxTabPanel; - dxTabPanel(options: string): any; - dxTabPanel(options: string, ...params: any[]): any; - dxTabPanel(options: DevExpress.ui.dxTabPanelOptions): JQuery; - dxSelectBox(): JQuery; - dxSelectBox(options: "instance"): DevExpress.ui.dxSelectBox; - dxSelectBox(options: string): any; - dxSelectBox(options: string, ...params: any[]): any; - dxSelectBox(options: DevExpress.ui.dxSelectBoxOptions): JQuery; - dxTagBox(): JQuery; - dxTagBox(options: "instance"): DevExpress.ui.dxTagBox; - dxTagBox(options: string): any; - dxTagBox(options: string, ...params: any[]): any; - dxTagBox(options: DevExpress.ui.dxTagBoxOptions): JQuery; - dxScrollView(): JQuery; - dxScrollView(options: "instance"): DevExpress.ui.dxScrollView; - dxScrollView(options: string): any; - dxScrollView(options: string, ...params: any[]): any; - dxScrollView(options: DevExpress.ui.dxScrollViewOptions): JQuery; - dxScrollable(): JQuery; - dxScrollable(options: "instance"): DevExpress.ui.dxScrollable; - dxScrollable(options: string): any; - dxScrollable(options: string, ...params: any[]): any; - dxScrollable(options: DevExpress.ui.dxScrollableOptions): JQuery; - dxRadioGroup(): JQuery; - dxRadioGroup(options: "instance"): DevExpress.ui.dxRadioGroup; - dxRadioGroup(options: string): any; - dxRadioGroup(options: string, ...params: any[]): any; - dxRadioGroup(options: DevExpress.ui.dxRadioGroupOptions): JQuery; - dxPopup(): JQuery; - dxPopup(options: "instance"): DevExpress.ui.dxPopup; - dxPopup(options: string): any; - dxPopup(options: string, ...params: any[]): any; - dxPopup(options: DevExpress.ui.dxPopupOptions): JQuery; - dxPopover(): JQuery; - dxPopover(options: "instance"): DevExpress.ui.dxPopover; - dxPopover(options: string): any; - dxPopover(options: string, ...params: any[]): any; - dxPopover(options: DevExpress.ui.dxPopoverOptions): JQuery; - dxOverlay(): JQuery; - dxOverlay(options: "instance"): DevExpress.ui.dxOverlay; - dxOverlay(options: string): any; - dxOverlay(options: string, ...params: any[]): any; - dxOverlay(options: DevExpress.ui.dxOverlayOptions): JQuery; - dxNumberBox(): JQuery; - dxNumberBox(options: "instance"): DevExpress.ui.dxNumberBox; - dxNumberBox(options: string): any; - dxNumberBox(options: string, ...params: any[]): any; - dxNumberBox(options: DevExpress.ui.dxNumberBoxOptions): JQuery; - dxNavBar(): JQuery; - dxNavBar(options: "instance"): DevExpress.ui.dxNavBar; - dxNavBar(options: string): any; - dxNavBar(options: string, ...params: any[]): any; - dxNavBar(options: DevExpress.ui.dxNavBarOptions): JQuery; - dxMultiView(): JQuery; - dxMultiView(options: "instance"): DevExpress.ui.dxMultiView; - dxMultiView(options: string): any; - dxMultiView(options: string, ...params: any[]): any; - dxMultiView(options: DevExpress.ui.dxMultiViewOptions): JQuery; - dxMap(): JQuery; - dxMap(options: "instance"): DevExpress.ui.dxMap; - dxMap(options: string): any; - dxMap(options: string, ...params: any[]): any; - dxMap(options: DevExpress.ui.dxMapOptions): JQuery; - dxLookup(): JQuery; - dxLookup(options: "instance"): DevExpress.ui.dxLookup; - dxLookup(options: string): any; - dxLookup(options: string, ...params: any[]): any; - dxLookup(options: DevExpress.ui.dxLookupOptions): JQuery; - dxLoadPanel(): JQuery; - dxLoadPanel(options: "instance"): DevExpress.ui.dxLoadPanel; - dxLoadPanel(options: string): any; - dxLoadPanel(options: string, ...params: any[]): any; - dxLoadPanel(options: DevExpress.ui.dxLoadPanelOptions): JQuery; - dxLoadIndicator(): JQuery; - dxLoadIndicator(options: "instance"): DevExpress.ui.dxLoadIndicator; - dxLoadIndicator(options: string): any; - dxLoadIndicator(options: string, ...params: any[]): any; - dxLoadIndicator(options: DevExpress.ui.dxLoadIndicatorOptions): JQuery; - dxList(): JQuery; - dxList(options: "instance"): DevExpress.ui.dxList; - dxList(options: string): any; - dxList(options: string, ...params: any[]): any; - dxList(options: DevExpress.ui.dxListOptions): JQuery; - dxGallery(): JQuery; - dxGallery(options: "instance"): DevExpress.ui.dxGallery; - dxGallery(options: string): any; - dxGallery(options: string, ...params: any[]): any; - dxGallery(options: DevExpress.ui.dxGalleryOptions): JQuery; - dxDropDownEditor(): JQuery; - dxDropDownEditor(options: "instance"): DevExpress.ui.dxDropDownEditor; - dxDropDownEditor(options: string): any; - dxDropDownEditor(options: string, ...params: any[]): any; - dxDropDownEditor(options: DevExpress.ui.dxDropDownEditorOptions): JQuery; - dxDateBox(): JQuery; - dxDateBox(options: "instance"): DevExpress.ui.dxDateBox; - dxDateBox(options: string): any; - dxDateBox(options: string, ...params: any[]): any; - dxDateBox(options: DevExpress.ui.dxDateBoxOptions): JQuery; - dxCheckBox(): JQuery; - dxCheckBox(options: "instance"): DevExpress.ui.dxCheckBox; - dxCheckBox(options: string): any; - dxCheckBox(options: string, ...params: any[]): any; - dxCheckBox(options: DevExpress.ui.dxCheckBoxOptions): JQuery; - dxBox(): JQuery; - dxBox(options: "instance"): DevExpress.ui.dxBox; - dxBox(options: string): any; - dxBox(options: string, ...params: any[]): any; - dxBox(options: DevExpress.ui.dxBoxOptions): JQuery; - dxButton(): JQuery; - dxButton(options: "instance"): DevExpress.ui.dxButton; - dxButton(options: string): any; - dxButton(options: string, ...params: any[]): any; - dxButton(options: DevExpress.ui.dxButtonOptions): JQuery; - dxCalendar(): JQuery; - dxCalendar(options: "instance"): DevExpress.ui.dxCalendar; - dxCalendar(options: string): any; - dxCalendar(options: string, ...params: any[]): any; - dxCalendar(options: DevExpress.ui.dxCalendarOptions): JQuery; - dxAccordion(): JQuery; - dxAccordion(options: "instance"): DevExpress.ui.dxAccordion; - dxAccordion(options: string): any; - dxAccordion(options: string, ...params: any[]): any; - dxAccordion(options: DevExpress.ui.dxAccordionOptions): JQuery; - dxResponsiveBox(): JQuery; - dxResponsiveBox(options: "instance"): DevExpress.ui.dxResponsiveBox; - dxResponsiveBox(options: string): any; - dxResponsiveBox(options: string, ...params: any[]): any; - dxResponsiveBox(options: DevExpress.ui.dxResponsiveBoxOptions): JQuery; - dxAutocomplete(): JQuery; - dxAutocomplete(options: "instance"): DevExpress.ui.dxAutocomplete; - dxAutocomplete(options: string): any; - dxAutocomplete(options: string, ...params: any[]): any; - dxAutocomplete(options: DevExpress.ui.dxAutocompleteOptions): JQuery; - dxForm(): JQuery; - dxForm(options: "instance"): DevExpress.ui.dxForm; - dxForm(options: string): any; - dxForm(options: string, ...params: any[]): any; - dxForm(options: DevExpress.ui.dxFormOptions): 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 whether tiles are placed horizontally or vertically. */ - direction?: string; - /** Specifies the height of the widget. */ - height?: any; - /** Specifies the distance in pixels between adjacent tiles. */ - itemMargin?: number; - /** A Boolean value specifying whether or not to display a scrollbar. */ - showScrollbar?: boolean; - } - /** A widget displaying several blocks of data as tiles. */ - export class dxTileView extends CollectionWidget { - constructor(element: JQuery, options?: dxTileViewOptions); - constructor(element: Element, options?: dxTileViewOptions); - /** Returns the current scroll position of the widget content. */ - scrollPosition(): number; - } - export interface dxSwitchOptions extends EditorOptions { - activeStateEnabled?: boolean; - /** Text displayed when the widget is in a disabled state. */ - offText?: string; - /** Text displayed when the widget is in an enabled state. */ - onText?: string; - /** A Boolean value specifying whether the current switch state is "On" or "Off". */ - value?: boolean; - } - /** A switch widget. */ - export class dxSwitch extends Editor { - constructor(element: JQuery, options?: dxSwitchOptions); - constructor(element: Element, options?: dxSwitchOptions); - } - export interface dxSlideOutViewOptions extends WidgetOptions { - /** Specifies the current menu position. */ - menuPosition?: string; - /** Specifies whether or not the menu panel is visible. */ - menuVisible?: boolean; - /** Specifies whether or not the menu is shown when a user swipes the widget content. */ - swipeEnabled?: boolean; - /** A template to be used for rendering menu panel content. */ - menuTemplate?: any; - /** A template to be used for rendering widget content. */ - contentTemplate?: any; - } - /** The widget that allows you to slide-out the current view to reveal a custom menu. */ - export class dxSlideOutView extends Widget { - constructor(element: JQuery, options?: dxSlideOutViewOptions); - constructor(element: Element, options?: dxSlideOutViewOptions); - /** Returns an HTML element of the widget menu block. */ - menuContent(): JQuery; - /** Returns an HTML element of the widget content block. */ - content(): JQuery; - /** Displays the widget's menu block. */ - showMenu(): JQueryPromise; - /** Hides the widget's menu block. */ - hideMenu(): JQueryPromise; - /** Toggles the visibility of the widget's menu block. */ - toggleMenuVisibility(): JQueryPromise; - } - export interface dxSlideOutOptions extends CollectionWidgetOptions { - /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ - activeStateEnabled?: boolean; - /** A Boolean value specifying whether or not to display a grouped menu. */ - menuGrouped?: boolean; - /** Specifies the current menu position. */ - menuPosition?: string; - /** The name of the template used to display a group header. */ - menuGroupTemplate?: any; - /** The template used to render menu items. */ - menuItemTemplate?: any; - /** A handler for the menuGroupRendered event. */ - onMenuGroupRendered?: Function; - /** A handler for the menuItemRendered event. */ - onMenuItemRendered?: Function; - /** Specifies whether or not the slide-out menu is displayed. */ - menuVisible?: boolean; - /** Indicates whether the menu can be shown/hidden by swiping the widget's main panel. */ - swipeEnabled?: boolean; - /** A template to be used for rendering widget content. */ - contentTemplate?: any; - } - /** The widget that allows you to slide-out the current view to reveal an item list. */ - export class dxSlideOut extends CollectionWidget { - constructor(element: JQuery, options?: dxSlideOutOptions); - constructor(element: Element, options?: dxSlideOutOptions); - /** Hides the widget's slide-out menu. */ - hideMenu(): JQueryPromise; - /** Displays the widget's slide-out menu. */ - showMenu(): JQueryPromise; - /** Toggles the visibility of the widget's slide-out menu. */ - toggleMenuVisibility(showing: boolean): JQueryPromise; - } - export interface dxPivotOptions extends CollectionWidgetOptions { - /** The index of the currently active pivot item. */ - selectedIndex?: number; - /** A Boolean value specifying whether or not to allow users to switch between items by swiping. */ - swipeEnabled?: boolean; - /** A template to be used for rendering widget content. */ - contentTemplate?: any; - /** The template to be used for rendering an item title. */ - itemTitleTemplate?: any; - } - /** A widget that is similar to a traditional tab control, but optimized for the phone with simplified end-user interaction. */ - export class dxPivot extends CollectionWidget { - constructor(element: JQuery, options?: dxPivotOptions); - constructor(element: Element, options?: dxPivotOptions); - } - export interface dxPanoramaOptions extends CollectionWidgetOptions { - /** An object exposing options for setting a background image for the panorama. */ - backgroundImage?: { - /** Specifies the height of the panorama's background image. */ - height?: number; - /** Specifies the URL of the image that is used as the panorama's background image. */ - url?: string; - /** Specifies the width of the panorama's background image. */ - width?: number; - }; - /** The index of the currently active panorama item. */ - selectedIndex?: number; - /** Specifies the widget content title. */ - title?: string; - } - /** A widget displaying the required content in a long horizontal canvas that extends beyond the frames of the screen. */ - export class dxPanorama extends CollectionWidget { - constructor(element: JQuery, options?: dxDropDownEditorOptions); - constructor(element: Element, options?: dxDropDownEditorOptions); - } - export interface dxDropDownMenuOptions extends WidgetOptions { - /** A handler for the buttonClick event. */ - onButtonClick?: any; - /** The name of the icon to be displayed by the DropDownMenu button. */ - buttonIcon?: string; - /** The text displayed in the DropDownMenu button. */ - buttonText?: string; - buttonIconSrc?: string; - /** A data source used to fetch data to be displayed by the widget. */ - dataSource?: any; - /** A handler for the itemClick event. */ - onItemClick?: any; - /** An array of items displayed by the widget. */ - items?: Array; - /** The template to be used for rendering items. */ - itemTemplate?: any; - /** Specifies whether or not to show the drop down menu within a dxPopover widget. */ - usePopover?: boolean; - /** The width of the menu popup in pixels. */ - popupWidth?: any; - /** The height of the menu popup in pixels. */ - popupHeight?: any; - /** Specifies whether or not the drop-down menu is displayed. */ - opened?: boolean; - hoverStateEnabled?: boolean; - activeStateEnabled?: boolean; - } - /** A drop-down menu widget. */ - export class dxDropDownMenu extends Widget { - constructor(element: JQuery, options?: dxDropDownEditorOptions); - constructor(element: Element, options?: dxDropDownEditorOptions); - /** Opens the drop-down menu. */ - open(): void; - /** Closes the drop-down menu. */ - close(): void; - } - export interface dxActionSheetOptions extends CollectionWidgetOptions { - /** A handler for the cancelClick event. */ - onCancelClick?: any; - /** The text displayed in the button that closes the action sheet. */ - cancelText?: string; - /** Specifies whether or not to display the Cancel button in action sheet. */ - showCancelButton?: boolean; - /** A Boolean value specifying whether or not the title of the action sheet is visible. */ - showTitle?: boolean; - /** Specifies the element the action sheet popover points at. */ - target?: any; - /** The title of the action sheet. */ - title?: string; - /** Specifies whether or not to show the action sheet within a dxPopover widget. */ - usePopover?: boolean; - /** A Boolean value specifying whether or not the dxActionSheet widget is visible. */ - visible?: boolean; - } - /** A widget consisting of a set of choices related to a certain task. */ - export class dxActionSheet extends CollectionWidget { - constructor(element: JQuery, options?: dxActionSheetOptions); - constructor(element: Element, options?: dxActionSheetOptions); - /** Hides the widget. */ - hide(): JQueryPromise; - /** Shows the widget. */ - show(): JQueryPromise; - /** Shows or hides the widget depending on the Boolean value passed as the parameter. */ - toggle(showing: boolean): JQueryPromise; - } -} -interface JQuery { - dxTileView(): JQuery; - dxTileView(options: "instance"): DevExpress.ui.dxTileView; - dxTileView(options: string): any; - dxTileView(options: string, ...params: any[]): any; - dxTileView(options: DevExpress.ui.dxTileViewOptions): JQuery; - dxSwitch(): JQuery; - dxSwitch(options: "instance"): DevExpress.ui.dxSwitch; - dxSwitch(options: string): any; - dxSwitch(options: string, ...params: any[]): any; - dxSwitch(options: DevExpress.ui.dxSwitchOptions): JQuery; - dxSlideOut(): JQuery; - dxSlideOut(options: "instance"): DevExpress.ui.dxSlideOut; - dxSlideOut(options: string): any; - dxSlideOut(options: string, ...params: any[]): any; - dxSlideOut(options: DevExpress.ui.dxSlideOutOptions): JQuery; - dxPivot(): JQuery; - dxPivot(options: "instance"): DevExpress.ui.dxPivot; - dxPivot(options: string): any; - dxPivot(options: string, ...params: any[]): any; - dxPivot(options: DevExpress.ui.dxPivotOptions): JQuery; - dxPanorama(): JQuery; - dxPanorama(options: "instance"): DevExpress.ui.dxPanorama; - dxPanorama(options: string): any; - dxPanorama(options: string, ...params: any[]): any; - dxPanorama(options: DevExpress.ui.dxPanoramaOptions): JQuery; - dxActionSheet(): JQuery; - dxActionSheet(options: "instance"): DevExpress.ui.dxActionSheet; - dxActionSheet(options: string): any; - dxActionSheet(options: string, ...params: any[]): any; - dxActionSheet(options: DevExpress.ui.dxActionSheetOptions): JQuery; - dxDropDownMenu(): JQuery; - dxDropDownMenu(options: "instance"): DevExpress.ui.dxDropDownMenu; - dxDropDownMenu(options: string): any; - dxDropDownMenu(options: string, ...params: any[]): any; - dxDropDownMenu(options: DevExpress.ui.dxDropDownMenuOptions): JQuery; -} -declare 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; - /** A function used to customize a web request before it is sent. */ - beforeSend?: (request: Object) => void; - } - /** A Store that provides access to an OLAP cube using the XMLA standard. */ - export class XmlaStore { - constructor(options: XmlaStoreOptions); - } - export interface PivotGridField { - index?: number; - /** A boolean value specifying whether or not the field is visible in the pivot grid and the Field Chooser. */ - visible?: boolean; - /** Name of the data source field containing data for the pivot grid field. */ - dataField?: string; - /** A caption that will be displayed in the pivot grid's field chooser to identify the field. */ - caption?: string; - /** Specifies a type of field values. */ - dataType?: string; - /** Specifies how the values of the current field are combined into groups. Cannot be used for the XmlaStore store type. */ - groupInterval?: any; - /** Specifies how to aggregate field data. Cannot be used for the XmlaStore store type. */ - summaryType?: string; - /** Allows you to use a custom aggregate function to calculate the summary values. Cannot be used for the XmlaStore store type. */ - calculateCustomSummary?: (options: { - summaryProcess?: string; - value?: any; - totalValue?: any; - }) => void; - /** Specifies the function that determines how to split data from the data source into ranges for header items. Cannot be used for the XmlaStore store type. */ - selector?: (data: Object) => any; - /** Type of the area where the field is located. */ - area?: string; - /** Index among the other fields displayed within the same area. */ - areaIndex?: number; - /** The name of the folder in which the field is located. */ - displayFolder?: string; - /** The name of the group to which the field belongs. */ - groupName?: string; - /** The index of the field within a group. */ - groupIndex?: number; - /** Specifies the 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; - /** Sorts the header items of this field by the summary values of another field. */ - sortBySummaryField?: string; - /** The array of field names that specify a path to column/row whose summary field is used for sorting of this field's header items. */ - sortBySummaryPath?: Array; - /** The filter values for the current field. */ - filterValues?: Array; - /** The filter type for the current field. */ - filterType?: string; - /** Indicates whether all header items of the field's header level are expanded. */ - expanded?: boolean; - /** Specifies whether the field should be treated as a Data Field. */ - isMeasure?: boolean; - /** Specifies a display format for field values. */ - format?: string; - /** Specifies a callback function that returns the text to be displayed in the cells of a field. */ - customizeText?: (cellInfo: { value: any; valueText: string }) => string; - /** Specifies a precision for formatted field values. */ - precision?: number; - /** Specifies how to sort the header items. */ - sortingMethod?: (a: Object, b: Object) => number; - /** Allows an end-user to change sorting options. */ - allowSorting?: boolean; - /** Allows an end-user to sort columns by summary values. */ - allowSortingBySummary?: boolean; - /** Allows an end-user to change filtering options. */ - allowFiltering?: boolean; - /** Allows an end-user to expand/collapse all header items within a header level. */ - allowExpandAll?: boolean; - /** Specifies the absolute width of the field in the pivot grid. */ - width?: number; - /** Specifies the summary post-processing algorithm. */ - summaryDisplayMode?: string; - /** Specifies whether to summarize each next summary value with the previous one by rows or columns. */ - runningTotal?: string; - /** Specifies whether to allow the predefined summary post-processing functions ('absoluteVariation' and 'percentVariation') and runningTotal to take values of different groups into account. */ - allowCrossGroupCalculation?: boolean; - /** Specifies a callback function that allows you to modify summary values after they are calculated. */ - calculateSummaryValue?: (e: Object) => number; - /** Specifies whether or not to display Total values for the field. */ - showTotals?: boolean; - /** Specifies whether or not to display Grand Total values for the field. */ - showGrandTotals?: boolean; - } - export class SummaryCell { - /** Gets the parent cell in a specified direction. */ - parent(direction: string): SummaryCell; - /** Gets all children cells in a specified direction. */ - children(direction: string): Array; - /** Gets a partial Grand Total cell of a row or column. */ - grandTotal(direction: string): SummaryCell; - /** Gets the Grand Total of the entire pivot grid. */ - grandTotal(): SummaryCell; - /** Gets the cell next to the current one in a specified direction. */ - next(direction: string): SummaryCell; - /** Gets the cell next to current in a specified direction. */ - next(direction: string, allowCrossGroup: boolean): SummaryCell; - /** Gets the cell prior to the current one in a specified direction. */ - prev(direction: string): SummaryCell; - /** Gets the cell previous to current in a specified direction. */ - prev(direction: string, allowCrossGroup: boolean): SummaryCell; - /** Gets the child cell in a specified direction. */ - child(direction: string, fieldValue: any): SummaryCell; - /** Gets the cell located by the path of the source cell with one field value changed. */ - slice(field: PivotGridField, value: any): SummaryCell; - /** Gets the row or column field to which the current cell belongs. */ - field(area: string): PivotGridField; - /** Gets the value of the current cell. */ - value(): any; - /** Gets the value of the current cell. */ - value(isCalculatedValue: boolean): any; - /** Gets the value of any field linked with the current cell. */ - value(field: PivotGridField): any; - /** Gets the value of any field linked with the current cell. */ - value(field: PivotGridField, isCalculatedValue: boolean): any; - } - export interface PivotGridDataSourceOptions { - /** Specifies the underlying Store instance used to access data. */ - store?: any; - /** Indicates whether or not the automatic field generation from data in the Store is enabled. */ - retrieveFields?: boolean; - /** Specifies data filtering conditions. Cannot be used for the XmlaStore store type. */ - filter?: Object; - /** An array of pivot grid fields. */ - fields?: Array; - /** A handler for the changed event. */ - onChanged?: () => void; - /** A handler for the loadingChanged event. */ - onLoadingChanged?: (isLoading: boolean) => void; - /** A handler for the loadError event. */ - onLoadError?: (e?: Object) => void; - /** A handler for the fieldsPrepared event. */ - onFieldsPrepared?: (e?: Array) => void; - } - /** An object that provides access to data for the dxPivotGrid widget. */ - export class PivotGridDataSource implements EventsMixin { - constructor(options?: PivotGridDataSource); - /** Starts reloading data from any store and updating the data source. */ - reload(): JQueryPromise; - /** Starts updating the data source. Reloads data from the XMLA store only. */ - load(): JQueryPromise; - /** Indicates whether or not the PivotGridDataSource is currently being loaded. */ - isLoading(): boolean; - /** Gets data displayed in a PivotGrid. */ - getData(): Object; - /** Gets all fields within a specified area. */ - getAreaFields(area: string, collectGroups: boolean): Array; - /** Gets all fields from the data source. */ - fields(): Array; - /** Sets the fields option. */ - fields(fields: Array): void; - /** Gets current options of a specified field. */ - field(id: any): PivotGridField; - /** Sets one or more options of a specified field. */ - field(id: any, field: PivotGridField): void; - /** Collapses a specified header item. */ - collapseHeaderItem(area: string, path: Array): void; - /** Expands a specified header item. */ - expandHeaderItem(area: string, path: Array): void; - /** Expands all header items of a field. */ - expandAll(id: any): void; - /** Collapses all header items of a field. */ - collapseAll(id: any): void; - /** Disposes of all resources associated with this PivotGridDataSource. */ - dispose(): void; - /** Gets the current filter expression. Cannot be used for the XmlaStore store type. */ - filter(): Object; - /** Applies a new filter expression. Cannot be used for the XmlaStore store type. */ - filter(filterExpr: Object): void; - /** Provides access to a list of records (facts) that were used to calculate a specific summary. */ - createDrillDownDataSource(options: { - columnPath?: Array; - rowPath?: Array; - dataIndex?: number; - maxRowCount?: number; - customColumns?: Array; - }): DevExpress.data.DataSource; - /** Gets the current PivotGridDataSource state (fields configuration, sorting, filters, expanded headers, etc.) */ - state(): Object; - /** Sets the PivotGridDataSource state. */ - state(state: Object): void; - on(eventName: string, eventHandler: Function): PivotGridDataSource; - on(events: { [eventName: string]: Function; }): PivotGridDataSource; - off(eventName: string): PivotGridDataSource; - off(eventName: string, eventHandler: Function): PivotGridDataSource; - } -} -declare module DevExpress.ui { - export interface dxSchedulerOptions extends WidgetOptions { - /** Specifies a date displayed on the current scheduler view by default. */ - currentDate?: any; - /** The earliest date the widget allows you to select. */ - min?: Date; - /** The latest date the widget allows you to select. */ - max?: Date; - /** Specifies the view used in the scheduler by default. */ - currentView?: string; - /** A data source used to fetch data to be displayed by the widget. */ - dataSource?: any; - /** Specifies the first day of a week. */ - firstDayOfWeek?: number; - /** The template to be used for rendering appointments. */ - appointmentTemplate?: any; - /** The template to be used for rendering an appointment tooltip. */ - appointmentTooltipTemplate?: any; - /** Lists the views to be available within the scheduler's View Selector. */ - views?: Array; - /** Specifies the resource kinds by which the scheduler's appointments are grouped in a timetable. */ - groups?: Array; - /** Specifies a start hour in the scheduler view's time interval. */ - startDayHour?: number; - /** Specifies an end hour in the scheduler view's time interval. */ - endDayHour?: number; - /** Specifies whether or not the "All-day" panel is visible. */ - showAllDayPanel?: boolean; - /** Specifies cell duration in minutes. */ - cellDuration?: number; - /** Specifies the edit mode for recurring appointments. */ - recurrenceEditMode?: string; - /** Specifies which editing operations an end-user can perform on appointments. */ - editing?: { - /** Specifies whether or not an end-user can add appointments. */ - allowAdding?: boolean; - /** Specifies whether or not an end-user can change appointment options. */ - allowUpdating?: boolean; - /** Specifies whether or not an end-user can delete appointments. */ - allowDeleting?: boolean; - /** Specifies whether or not an end-user can change an appointment duration. */ - allowResizing?: boolean; - /** Specifies whether or not an end-user can drag appointments. */ - allowDragging?: boolean; - } - /** Specifies an array of resources available in the scheduler. */ - resources?: Array<{ - /** Indicates whether or not several resources of this kind can be assigned to an appointment. */ - allowMultiple?: boolean; - /** - * Indicates whether or not resources of this kind have priority in the color identification of the appointments that have resources of different kinds assigned. - * @deprecated Use the useColorAsDefault option instead. - */ - mainColor?: boolean; - /** Indicates whether or not resources of this kind have priority in the color identification of the appointments that have resources of different kinds assigned. */ - useColorAsDefault?: boolean; - /** A data source used to fetch resources to be available in the scheduler. */ - dataSource?: any; - /** Specifies the resource object field whose value is displayed by the Resource editor in the Appointment popup window. */ - displayExpr?: any; - /** Specifies the resource object field that is used as a value of the Resource editor in the Appointment popup window. */ - valueExpr?: any; - /** The name of the appointment object field that specifies a resource of this kind. */ - field?: string; - /** Specifies the label of the Appointment popup window field that allows end users to assign a resource of this kind. */ - label?: string; - }>; - /** A handler for the AppointmentAdding event. */ - onAppointmentAdding?: Function; - /** A handler for the appointmentAdded event. */ - onAppointmentAdded?: Function; - /** A handler for the AppointmentUpdating event. */ - onAppointmentUpdating?: Function; - /** A handler for the appointmentUpdated event. */ - onAppointmentUpdated?: Function; - /** A handler for the AppointmentDeleting event. */ - onAppointmentDeleting?: Function; - /** A handler for the appointmentDeleted event. */ - onAppointmentDeleted?: Function; - /** A handler for the appointmentRendered event. */ - onAppointmentRendered?: Function; - /** A handler for the appointmentClick event. */ - onAppointmentClick?: any; - /** A handler for the appointmentDblClick event. */ - onAppointmentDblClick?: any; - /** A handler for the cellClick event. */ - onCellClick?: any; - /** A handler for the appointmentFormCreated event. */ - onAppointmentFormCreated?: Function; - /** Specifies whether or not an end-user can scroll the view horizontally. */ - horizontalScrollingEnabled?: boolean; - /** Specifies whether a user can switch views using tabs or a drop-down menu. */ - useDropDownViewSwitcher?: boolean; - /** Specifies the name of the data source item field that defines the start of an appointment. */ - startDateExpr?: string; - /** Specifies the name of the data source item field that defines the ending of an appointment. */ - endDateExpr?: string; - /** Specifies the name of the data source item field that holds the subject of an appointment. */ - textExpr?: string; - /** Specifies the name of the data source item field whose value holds the description of the corresponding appointment. */ - descriptionExpr?: string; - /** Specifies the name of the data source item field whose value defines whether or not the corresponding appointment is an all-day appointment. */ - allDayExpr?: string; - /** Specifies the name of the data source item field that defines a recurrence rule for generating recurring appointments. */ - recurrenceRuleExpr?: string; - /** Specifies the name of the data source item field that defines exceptions for the current recurring appointment. */ - recurrenceExceptionExpr?: string; - /** Specifies whether filtering is performed on the server or client side. */ - remoteFiltering?: boolean; - } - /** A widget that displays scheduled data using different views and provides the capability to load, add and edit appointments. */ - export class dxScheduler extends Widget { - constructor(element: JQuery, options?: dxSchedulerOptions); - constructor(element: Element, options?: dxSchedulerOptions); - /** Add the appointment defined by the object passed as a parameter to the data associated with the widget. */ - addAppointment(appointment: Object): void; - /** Updates the appointment specified by the first method parameter by the appointment object specified by the second method parameter in the the data associated with the widget. */ - updateAppointment(target: Object, appointment: Object): void; - /** Deletes the appointment defined by the parameter from the the data associated with the widget. */ - deleteAppointment(appointment: Object): void; - /** Scrolls the scheduler work space to the specified time of the specified day. */ - scrollToTime(hours: number, minutes: number, date: Date): void; - /** Displayes the Appointment Details popup. */ - showAppointmentPopup(appointmentData: Object, createNewAppointment?: boolean, currentAppointmentData?: Object): void; - } - export interface dxColorBoxOptions extends dxDropDownEditorOptions { - /** Specifies the text displayed on the button that applies changes and closes the drop-down editor. */ - applyButtonText?: string; - applyValueMode?: string; - /** Specifies the text displayed on the button that cancels changes and closes the drop-down editor. */ - cancelButtonText?: string; - /** Specifies whether or not the widget value includes the alpha channel component. */ - editAlphaChannel?: boolean; - /** Specifies the size of a step by which a handle is moved using a keyboard shortcut. */ - keyStep?: number; - } - /** A widget used to specify a color value. */ - export class dxColorBox extends dxDropDownEditor { - constructor(element: JQuery, options?: dxColorBoxOptions); - constructor(element: Element, options?: dxColorBoxOptions); - } - export interface HierarchicalCollectionWidgetOptions extends CollectionWidgetOptions { - /** Specifies the name of the data source item field whose value is displayed by the widget. */ - displayExpr?: any; - /** Specifies the name of the data source item field used as a key. */ - keyExpr?: any; - /** Specifies the name of the data source item field whose value defines whether or not the corresponding widget items is selected. */ - selectedExpr?: any; - /** Specifies the name of the data source item field that contains an array of nested items. */ - itemsExpr?: any; - /** Specifies the name of the data source item field whose value defines whether or not the corresponding widget item is disabled. */ - disabledExpr?: any; - /** Specifies the name of the data source item field that holds the key of the parent item. */ - parentIdExpr?: any; - /** Specifies the name of the data source item field whose value defines whether or not the corresponding widget items is expanded. */ - expandedExpr?: any; - hoverStateEnabled?: boolean; - focusStateEnabled?: boolean; - } - export class HierarchicalCollectionWidget extends CollectionWidget { - } - export interface dxTreeViewOptions extends HierarchicalCollectionWidgetOptions { - /** Specifies whether or not to animate item collapsing and expanding. */ - animationEnabled?: boolean; - /** Specifies whether a nested or plain array is used as a data source. */ - dataStructure?: string; - /** Specifies whether or not a user can expand all tree view items by the "*" hot key. */ - expandAllEnabled?: boolean; - /** - * Specifies whether or not a check box is displayed at each tree view item. - * @deprecated Use the showCheckBoxesMode options instead. - */ - showCheckBoxes?: boolean; - /** Specifies the current check boxes display mode. */ - showCheckBoxesMode?: string; - /** Specifies whether or not to select nodes recursively. */ - selectNodesRecursive?: boolean; - /** Specifies whether or not all parent nodes of an initially expanded node are displayed expanded. */ - expandNodesRecursive?: boolean; - /** - * Specifies whether the "Select All" check box is displayed over the tree view. - * @deprecated Use the showCheckBoxesMode options instead. - */ - selectAllEnabled?: boolean; - /** Specifies the text displayed at the "Select All" check box. */ - selectAllText?: string; - /** Specifies the name of the data source item field whose value defines whether or not the corresponding node includes child nodes. */ - hasItemsExpr?: any; - /** Specifies if the virtual mode is enabled. */ - virtualModeEnabled?: boolean; - /** Specifies the parent ID value of the root item. */ - rootValue?: any; - /** Specifies the current value used to filter tree view items. */ - searchValue?: string; - /** A string value specifying available scrolling directions. */ - scrollDirection?: string; - /** A handler for the itemSelected event. */ - onItemSelected?: Function; - /** A handler for the itemExpanded event. */ - onItemExpanded?: Function; - /** A handler for the itemCollapsed event. */ - onItemCollapsed?: Function; - onItemClick?: Function; - onItemContextMenu?: Function; - onItemRendered?: Function; - onItemHold?: Function; - } - /** A widget displaying specified data items as a tree. */ - export class dxTreeView extends HierarchicalCollectionWidget { - constructor(element: JQuery, options?: dxTreeViewOptions); - constructor(element: Element, options?: dxTreeViewOptions); - /** Updates the tree view scrollbars according to the current size of the widget content. */ - updateDimensions(): JQueryPromise; - /** Selects the specified item. */ - selectItem(itemElement: any): void; - /** Unselects the specified item. */ - unselectItem(itemElement: any): void; - /** Expands the specified item. */ - expandItem(itemElement: any): void; - /** Collapses the specified item. */ - collapseItem(itemElement: any): void; - /** Returns all nodes of the tree view. */ - getNodes(): Array; - /** Selects all widget items. */ - selectAll(): void; - /** Unselects all widget items. */ - unselectAll(): void; - } - export interface dxMenuBaseOptions extends HierarchicalCollectionWidgetOptions { - /** An object that defines the animation options of the widget. */ - animation?: { - /** An object that defines the animation options used when the widget is being shown. */ - show?: fx.AnimationOptions; - /** An object that defines the animation options used when the widget is being hidden. */ - hide?: fx.AnimationOptions; - }; - /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ - activeStateEnabled?: boolean; - /** Specifies the name of the CSS class associated with the menu. */ - cssClass?: string; - /** Holds an array of menu items. */ - items?: Array; - /** Specifies whether or not an item becomes selected if an end-user clicks it. */ - selectionByClick?: boolean; - /** Specifies the selection mode supported by the menu. */ - selectionMode?: string; - /** Specifies options of submenu showing and hiding. */ - showSubmenuMode?: { - /** Specifies the mode name. */ - name?: string; - /** Specifies the delay of submenu show and hiding. */ - delay?: { - /** The time span after which the submenu is shown. */ - show?: number; - /** The time span after which the submenu is hidden. */ - hide?: number; - }; - }; - } - export class dxMenuBase extends HierarchicalCollectionWidget { - constructor(element: JQuery, options?: dxMenuBaseOptions); - constructor(element: Element, options?: dxMenuBaseOptions); - /** Selects the specified item. */ - selectItem(itemElement: any): void; - /** Unselects the specified item. */ - unselectItem(itemElement: any): void; - } - export interface dxMenuOptions extends dxMenuBaseOptions { - /** Specifies whether or not the submenu is hidden when the mouse pointer leaves it. */ - hideSubmenuOnMouseLeave?: boolean; - /** Specifies whether the menu has horizontal or vertical orientation. */ - orientation?: string; - /** Specifies options for showing and hiding the first level submenu. */ - showFirstSubmenuMode?: { - /** Specifies the mode name. */ - name?: string; - /** Specifies the delay in submenu showing and hiding. */ - delay?: { - /** The time span after which the submenu is shown. */ - show?: number; - /** The time span after which the submenu is hidden. */ - hide?: number; - }; - }; - /** Specifies the direction at which the submenus are displayed. */ - submenuDirection?: string; - /** A handler for the submenuHidden event. */ - onSubmenuHidden?: Function; - /** A handler for the submenuHiding event. */ - onSubmenuHiding?: Function; - /** A handler for the submenuShowing event. */ - onSubmenuShowing?: Function; - /** A handler for the submenuShown event. */ - onSubmenuShown?: Function; - } - /** A menu widget. */ - export class dxMenu extends dxMenuBase { - constructor(element: JQuery, options?: dxMenuOptions); - constructor(element: Element, options?: dxMenuOptions); - } - export interface dxContextMenuOptions extends dxMenuBaseOptions { - /** Holds an object that specifies options of alternative menu invocation. */ - alternativeInvocationMode?: { - /** Specifies whether or not an alternative invocation mode is enabled. */ - enabled?: Boolean; - /** Specifies the element used to invoke the context menu. */ - invokingElement?: any; - }; - /** A handler for the hidden event. */ - onHidden?: Function; - /** A handler for the hiding event. */ - onHiding?: Function; - /** A handler for the positioning event. */ - onPositioning?: Function; - /** A handler for the showing event. */ - onShowing?: Function; - /** A handler for the shown event. */ - onShown?: Function; - /** An object defining widget positioning options. */ - position?: PositionOptions; - /** Specifies the direction at which submenus are displayed. */ - submenuDirection?: string; - /** The target element associated with a popover. */ - target?: any; - /** A Boolean value specifying whether or not the widget is visible. */ - visible?: boolean; - } - /** A context menu widget. */ - export class dxContextMenu extends dxMenuBase { - constructor(element: JQuery, options?: dxContextMenuOptions); - constructor(element: Element, options?: dxContextMenuOptions); - /** Toggles the visibility of the widget. */ - toggle(showing: boolean): JQueryPromise; - /** Shows the widget. */ - show(): JQueryPromise; - /** Hides the widget. */ - hide(): JQueryPromise; - } - export interface dxRemoteOperations { - /** Specifies whether or not filtering must be performed on the server side. */ - filtering?: boolean; - /** Specifies whether or not paging must be performed on the server side. */ - paging?: boolean; - /** Specifies whether or not sorting must be performed on the server side. */ - sorting?: boolean; - /** Specifies whether or not grouping must be performed on the server side. */ - grouping?: boolean; - /** Specifies whether or not summaries calculation must be performed on the server side. */ - summary?: boolean; - } - export interface dxDataGridRow { - /** The data object represented by the row. */ - data: Object; - /** The key of the data object represented by the row. */ - key: any; - /** The visible index of the row. */ - rowIndex: number; - /** The type of the row. */ - rowType: string; - /** The group index of the row. Available when the rowType is "group". */ - groupIndex: number; - /** Indicates whether the row is expanded or collapsed. Available if rowType is "data", "detail" or "group". */ - isExpanded: boolean; - /** Indicates whether the row is selected. Available if rowType is "data". */ - isSelected: boolean; - /** Values of the row as they exist in the data source. */ - values: Array; - } - export interface dxDataGridColumn { - /** Specifies the content alignment within column cells. */ - alignment?: string; - /** Specifies whether the values in a column can be edited at runtime. Setting this option makes sense only when editing is enabled for a grid. */ - allowEditing?: boolean; - /** Specifies whether or not a column can be used for filtering grid records. Setting this option makes sense only when the filter row and column header filtering are visible. */ - allowFiltering?: boolean; - /** Specifies whether or not to allow filtering by this column using its header. */ - allowHeaderFiltering?: boolean; - /** Specifies whether or not the column can be anchored to a grid edge by end users. Setting this option makes sense only when the columnFixing | enabled option is set to true. */ - allowFixing?: boolean; - /** Specifies if a column can be used for searching grid records. Setting this option makes sense only when the search panel is visible. */ - allowSearch?: boolean; - /** Specifies whether a column can be used for grouping grid records at runtime. Setting this option makes sense only when the group panel is visible. */ - allowGrouping?: boolean; - /** Specifies whether or not a column can be hidden by a user. Setting this option makes sense only when the column chooser is visible. */ - allowHiding?: boolean; - /** Specifies whether or not a particular column can be used in column reordering. Setting this option makes sense only when the allowColumnReordering option is set to true. */ - allowReordering?: boolean; - /** Specifies whether or not a particular column can be resized by a user. Setting this option makes sense only when the allowColumnResizing option is true. */ - allowResizing?: boolean; - /** Specifies whether grid records can be sorted by a specific column at runtime. Setting this option makes sense only when the sorting mode differs from none. */ - allowSorting?: boolean; - /** Specifies whether groups appear expanded or not when records are grouped by a specific column. Setting this option makes sense only when grouping is allowed for this column. */ - autoExpandGroup?: boolean; - /** Specifies a callback function that returns a value to be displayed in a column cell. */ - calculateCellValue?: (rowData: Object) => string; - /** Specifies a callback function to be invoked after the cell value is edited by an end-user and before the new value is saved to the data source. */ - setCellValue?: (rowData: Object, value: any) => void; - /** Specifies a callback function that defines filters for customary calculated grid cells. */ - calculateFilterExpression?: (filterValue: any, selectedFilterOperation: string, target: string) => Array; - /** Specifies a caption for a column. */ - caption?: string; - /** Specifies a custom template for grid column cells. */ - cellTemplate?: any; - /** Specifies a CSS class to be applied to a column. */ - cssClass?: string; - /** Specifies how to get a value to be displayed in a cell when it is not in an editing state. */ - calculateDisplayValue?: any; - /** Specifies a field name or a function that returns a field name or a value to be used for grouping column cells. */ - calculateGroupValue?: any; - /** Specifies a field name or a function that returns a field name or a value to be used for sorting column cells. */ - calculateSortValue?: any; - /** Specifies a callback function that returns the text to be displayed in the cells of a column. */ - customizeText?: (cellInfo: { value: any; valueText: string }) => string; - /** Specifies the field of a data source that provides data for a column. */ - dataField?: string; - /** Specifies the required type of column values. */ - dataType?: string; - /** Specifies a custom template for the cell of a grid column when it is in an editing state. */ - editCellTemplate?: any; - /** Specifies configuration options for the editor widget of the current column. */ - editorOptions?: Object; - /** Specifies whether HTML tags are displayed as plain text or applied to the values of the column. */ - encodeHtml?: boolean; - /** In a boolean column, replaces all false items with a specified text. */ - falseText?: string; - /** Specifies the set of available filter operations. */ - filterOperations?: Array; - /** Specifies a filter value for a column. */ - filterValue?: any; - /** Specifies initial filter values for the column's header filter. */ - filterValues?: Array; - /** Specifies whether to include or exclude the records with the values selected in the column's header filter. */ - filterType?: string; - /** Indicates whether the column takes part in horizontal grid scrolling or is anchored to a grid edge. */ - fixed?: boolean; - /** Specifies the grid edge to which the column is anchored. */ - fixedPosition?: string; - /** Specifies a format for the values displayed in a column. */ - format?: string; - /** Specifies a custom template for the group cell of a grid column. */ - groupCellTemplate?: any; - /** Specifies the index of a column when grid records are grouped by the values of this column. */ - groupIndex?: number; - /** Specifies a custom template for the header of a grid column. */ - headerCellTemplate?: any; - /** Specifies options of a lookup column. */ - lookup?: { - /** Specifies whether or not a user can nullify values of a lookup column. */ - allowClearing?: boolean; - /** Specifies the data source providing data for a lookup column. */ - dataSource?: any; - /** Specifies the expression defining the data source field whose values must be displayed. */ - displayExpr?: any; - /** Specifies the expression defining the data source field whose values must be replaced. */ - valueExpr?: string; - }; - /** Specifies column-level options for filtering using a column header filter. */ - headerFilter?: { - /** Specifies the data source to be used for the header filter. */ - dataSource?: any; - /** Specifies how header filter values should be combined into groups. */ - groupInterval?: any; - }; - /** Specifies a precision for formatted values displayed in a column. */ - precision?: number; - /** Specifies the default filter operation of a column. */ - selectedFilterOperation?: string; - /** Specifies whether or not the column displays its values by using editors. */ - showEditorAlways?: boolean; - /** Specifies whether or not to display the column when grid records are grouped by it. */ - showWhenGrouped?: boolean; - /** Specifies the index of a column when grid records are sorted by the values of this column. */ - sortIndex?: number; - /** Specifies the initial sort order of column values. */ - sortOrder?: string; - /** In a boolean column, replaces all true items with a specified text. */ - trueText?: string; - /** Specifies whether a column is visible or not. */ - visible?: boolean; - /** Specifies the sequence number of the column in the grid. */ - visibleIndex?: number; - /** Specifies a column width in pixels or percentages. */ - width?: any; - /** Specifies an array of validation rules to be checked when updating column cell values. */ - validationRules?: Array; - /** Specifies whether or not to display the header of a hidden column in the column chooser. */ - showInColumnChooser?: boolean; - /** Specifies the identifier of the column. */ - name?: string; - /** The form item configuration object. Used only when the editing mode is "form". */ - formItem?: DevExpress.ui.dxFormItem; - } - export interface dxDataGridOptions extends WidgetOptions { - /** Specifies whether the outer borders of the grid are visible or not. */ - showBorders?: boolean; - /** Indicates whether to show the error row for the grid. */ - errorRowEnabled?: boolean; - /** A handler for the rowValidating event. */ - onRowValidating?: (e: Object) => void; - /** A handler for the contextMenuPreparing event. */ - onContextMenuPreparing?: (e: Object) => void; - /** A handler for the initNewRow event. */ - onInitNewRow?: (e: { data: Object }) => void; - /** A handler for the rowInserted event. */ - onRowInserted?: (e: { data: Object; key: any }) => void; - /** A handler for the rowInserting event. */ - onRowInserting?: (e: { data: Object; cancel: any }) => void; - /** A handler for the rowRemoved event. */ - onRowRemoved?: (e: { data: Object; key: any }) => void; - /** A handler for the rowRemoving event. */ - onRowRemoving?: (e: { data: Object; key: any; cancel: any }) => void; - /** A handler for the rowUpdated event. */ - onRowUpdated?: (e: { data: Object; key: any }) => void; - /** A handler for the rowUpdating event. */ - onRowUpdating?: (e: { oldData: Object; newData: Object; key: any; cancel: any }) => void; - /** Enables a hint that appears when a user hovers the mouse pointer over a cell with truncated content. */ - cellHintEnabled?: boolean; - /** Specifies whether or not grid columns can be reordered by a user. */ - allowColumnReordering?: boolean; - /** Specifies whether or not grid columns can be resized by a user. */ - allowColumnResizing?: boolean; - /** A handler for the cellClick event. */ - onCellClick?: any; - /** A handler for the cellHoverChanged event. */ - onCellHoverChanged?: (e: Object) => void; - /** A handler for the cellPrepared event. */ - onCellPrepared?: (e: Object) => void; - /** Specifies whether or not the width of grid columns depends on column content. */ - columnAutoWidth?: boolean; - /** Specifies the options of a column chooser. */ - columnChooser?: { - /** Specifies text displayed by the column chooser panel when it does not contain any columns. */ - emptyPanelText?: string; - /** Specifies whether a user can invoke the column chooser or not. */ - enabled?: boolean; - /** Specifies the height of the column chooser panel. */ - height?: number; - /** Specifies text displayed in the title of the column chooser panel. */ - title?: string; - /** Specifies the width of the column chooser panel. */ - width?: number; - }; - /** Specifies options for column fixing. */ - columnFixing?: { - /** Indicates if column fixing is enabled. */ - enabled?: boolean; - /** Contains options that specify texts for column-fixing related commands in the column header's context menu. */ - texts?: { - /** Specifies text for a context menu item that fixes the column for which the context menu is invoked. */ - fix?: string; - /** Specifies text for a context menu item that unfixes the column for which the context menu is invoked. */ - unfix?: string; - /** Specifies text for a context menu subitem that fixes a column, for which the context menu is invoked, to the left grid edge. */ - leftPosition?: string; - /** Specifies text for a context menu subitem that fixes a column, for which the context menu is invoked, to the right grid edge. */ - rightPosition?: string; - }; - }; - /** Specifies options for filtering using a column header filter. */ - headerFilter?: { - /** Indicates whether or not the column header filter button is visible. */ - visible?: boolean; - /** Specifies the height of the dropdown menu invoked when using a column header filter. */ - height?: number; - /** Specifies the width of the dropdown menu invoked when using a column header filter. */ - width?: number; - /** Contains options that specify texts for the dropdown menu invoked when you use a column header filter. */ - texts?: { - /** Specifies text for the item specifying an empty value in the column header filter's dropdown menu. */ - emptyValue?: string; - /** Specifies text for a button that closes the column header filter's dropdown menu and applies specified filtering. */ - ok?: string; - /** Specifies text for a button that closes the column header filter's dropdown menu without applying performed selection. */ - cancel?: string; - } - }; - /** An array of grid columns. */ - columns?: Array; - onContentReady?: Function; - /** Specifies a function that customizes grid columns after they are created. */ - customizeColumns?: (columns: Array) => void; - /** Customizes grid columns and data before exporting. */ - customizeExportData?: (columns: Array, rows: Array) => void; - /** Specifies a data source for the grid. */ - dataSource?: any; - /** Specifies whether or not to enable data caching. */ - cacheEnabled?: boolean; - /** A handler for the editingStart event. */ - onEditingStart?: (e: { - data: Object; - key: any; - cancel: boolean; - column: dxDataGridColumn - }) => void; - /** A handler for the editorPrepared event. */ - onEditorPrepared?: (e: Object) => void; - /** A handler for the editorPreparing event. */ - onEditorPreparing?: (e: Object) => void; - /** Contains options that specify how grid content can be changed. */ - editing?: { - editMode?: string; - editEnabled?: boolean; - insertEnabled?: boolean; - removeEnabled?: boolean; - /** Specifies how grid values can be edited manually. */ - mode?: string; - /** Specifies whether or not grid records can be edited at runtime. */ - allowUpdating?: boolean; - /** Specifies whether or not new grid records can be added at runtime. */ - allowAdding?: boolean; - /** Specifies whether or not grid records can be deleted at runtime. */ - allowDeleting?: boolean; - /** The form configuration object. Used only when the editing mode is "form". */ - form?: DevExpress.ui.dxFormOptions; - /** Contains options that specify texts for editing-related grid controls. */ - texts?: { - /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Save" button. Setting this option makes sense only when the mode option is set to batch. */ - saveAllChanges?: string; - /** Specifies text for a cancel button displayed when a row is in the editing state. Setting this option makes sense only when the allowUpdating option is set to true. */ - cancelRowChanges?: string; - /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Revert" button. Setting this option makes sense only when the mode option is set to batch. */ - cancelAllChanges?: string; - /** Specifies a message to be displayed by a confirmation window. Setting this option makes sense only when the edit mode is "row". */ - confirmDeleteMessage?: string; - /** Specifies text to be displayed in the title of a confirmation window. Setting this option makes sense only when the edit mode is "row". */ - confirmDeleteTitle?: string; - /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Cancel changes" button. Setting this option makes sense only when the mode option is set to cell and the validation capabilities are enabled. */ - validationCancelChanges?: string; - /** Specifies text for a button that deletes a row from a grid. Setting this option makes sense only when the allowDeleting option is set to true. */ - deleteRow?: string; - /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Add" button. Setting this option makes sense only when the allowAdding option is true. */ - addRow?: string; - /** Specifies text for a button that turns a row into the editing state. Setting this option makes sense only when the allowUpdating option is set to true. */ - editRow?: string; - /** Specifies text for a save button displayed when a row is in the editing state. Setting this option makes sense only when the allowUpdating option is set to true. */ - saveRowChanges?: string; - /** Specifies text for a button that recovers a deleted row. Setting this option makes sense only if the grid uses the batch edit mode and the allowDeleting option is set to true. */ - undeleteRow?: string; - }; - }; - /** Specifies filter row options. */ - filterRow?: { - /** Specifies when to apply a filter. */ - applyFilter?: string; - /** Specifies text for the hint that pops up when a user hovers the mouse pointer over the "Apply Filter" button. */ - applyFilterText?: string; - /** Specifies descriptions for filter operations. */ - operationDescriptions?: { - "=": string; - "<>": string; - "<": string; - "<=": string; - ">": string; - ">=": string; - "startswith": string; - "contains": string; - "notcontains": string; - "endswith": string; - }; - /** Specifies text for the reset operation in a filter list. */ - resetOperationText?: string; - /** Specifies text for the operation of clearing the applied filter when a select box is used. */ - showAllText?: string; - /** Specifies text for the range start in the 'between' filter type. */ - betweenStartText?: string; - /** Specifies text for the range end in the 'between' filter type. */ - betweenEndText?: string; - /** Specifies whether or not an icon that allows the user to choose a filter operation is visible. */ - showOperationChooser?: boolean; - /** Specifies whether the filter row is visible or not. */ - visible?: boolean; - }; - /** Specifies the behavior of grouped grid records. */ - grouping?: { - /** Specifies whether the user can collapse grouped records in a grid or not. */ - allowCollapsing?: boolean; - /** Specifies whether groups appear expanded or not. */ - autoExpandAll?: boolean; - /** Specifies the message displayed in a group row when the corresponding group is continued from the previous page. */ - groupContinuedMessage?: string; - /** Specifies the message displayed in a group row when the corresponding group continues on the next page. */ - groupContinuesMessage?: string; - }; - /** Specifies options that configure the group panel. */ - groupPanel?: { - /** Specifies whether columns can be dragged onto or from the group panel. */ - allowColumnDragging?: boolean; - /** Specifies text displayed by the group panel when it does not contain any columns. */ - emptyPanelText?: string; - /** Specifies whether the group panel is visible or not. */ - visible?: boolean; - }; - /** Specifies options configuring the load panel. */ - loadPanel?: { - /** Specifies whether to show the load panel or not. */ - enabled?: boolean; - /** Specifies the height of the load panel in pixels. */ - height?: number; - /** Specifies a URL pointing to an image to be used as a loading indicator. */ - indicatorSrc?: string; - /** Specifies whether or not a loading indicator must be displayed on the load panel. */ - showIndicator?: boolean; - /** Specifies whether or not the pane of the load panel must be displayed. */ - showPane?: boolean; - /** Specifies text displayed by the load panel. */ - text?: string; - /** Specifies the width of the load panel in pixels. */ - width?: number; - }; - /** Specifies text displayed when a grid does not contain any records. */ - noDataText?: string; - /** Specifies the options of a grid pager. */ - pager?: { - /** Specifies the page sizes that can be selected at runtime. */ - allowedPageSizes?: any; - /** Specifies whether to show the page size selector or not. */ - showPageSizeSelector?: boolean; - /** Specifies whether to show the pager or not. */ - visible?: any; - /** Specifies the text accompanying the page navigator. */ - infoText?: string; - /** Specifies whether or not to display the text accompanying the page navigator. This text is specified by the infoText option. */ - showInfo?: boolean; - /** Specifies whether or not to display buttons that switch the grid to the previous or next page. */ - showNavigationButtons?: boolean; - }; - /** Specifies paging options. */ - paging?: { - /** Specifies whether dxDataGrid loads data page by page or all at once. */ - enabled?: boolean; - /** Specifies the grid page that should be displayed by default. */ - pageIndex?: number; - /** Specifies the size of grid pages. */ - pageSize?: number; - }; - /** Specifies whether or not grid rows must be shaded in a different way. */ - rowAlternationEnabled?: boolean; - /** Specifies whether to enable two-way data binding. */ - twoWayBindingEnabled?: boolean; - /** A handler for the rowClick event. */ - onRowClick?: any; - /** A handler for the rowPrepared event. */ - onRowPrepared?: (e: Object) => void; - /** Specifies a custom template for grid rows. */ - rowTemplate?: any; - /** A configuration object specifying scrolling options. */ - scrolling?: { - /** Specifies the scrolling mode. */ - mode?: string; - /** Specifies whether or not a grid must preload pages adjacent to the current page when using virtual scrolling. */ - preloadEnabled?: boolean; - /** Specifies whether or not the widget uses native scrolling. */ - useNative?: any; - /** Specifies the scrollbar display policy. */ - showScrollbar?: string; - /** Specifies whether or not the scrolling by content is enabled. */ - scrollByContent?: boolean; - /** Specifies whether or not the scrollbar thumb scrolling enabled. */ - scrollByThumb?: boolean; - }; - /** Specifies options of the search panel. */ - searchPanel?: { - /** Specifies whether or not search strings in the located grid records should be highlighted. */ - highlightSearchText?: boolean; - /** Specifies text displayed by the search panel when no search string was typed. */ - placeholder?: string; - /** Specifies whether the search panel is visible or not. */ - visible?: boolean; - /** Specifies the width of the search panel in pixels. */ - width?: number; - /** Sets a search string for the search panel. */ - text?: string; - }; - /** Specifies the operations that must be performed on the server side. */ - remoteOperations?: any; - /** Allows you to sort groups according to the values of group summary items. */ - sortByGroupSummaryInfo?: Array<{ - /** Specifies the group summary item whose values must be used to sort groups. */ - summaryItem?: string; - /** Specifies the identifier of the column that must be used in grouping so that sorting by group summary item values be applied. */ - groupColumn?: string; - /** Specifies the sort order of group summary item values. */ - sortOrder?: string; - }>; - /** Allows you to build a master-detail interface in the grid. */ - masterDetail?: { - /** Enables an end-user to expand/collapse detail sections. */ - enabled?: boolean; - /** Specifies whether detail sections appear expanded or collapsed. */ - autoExpandAll?: boolean; - /** Specifies the template for detail sections. */ - template?: any; - }; - /** Specifies options for exporting grid data. */ - export?: { - /** Indicates if the export feature is enabled in the grid. */ - enabled?: boolean; - /** Specifies a default name for the file to which grid data is exported. */ - fileName?: string; - /** Specifies whether to enable Excel filtering for the exported data in the resulting XLSX file. */ - excelFilterEnabled?: boolean; - /** Specifies whether to enable word wrapping for the exported data in the resulting XLSX file. */ - excelWrapTextEnabled?: boolean; - /** Specifies the URL of the server-side proxy that streams the resulting file to the end user to enable export in IE8, IE9 and Safari browsers. */ - proxyUrl?: string; - /** Indicates whether to allow end users to export not only the data displayed in the grid, but the selected rows only. */ - allowExportSelectedData?: boolean; - /** Contains options that specify texts for the export-related commands and hints. */ - texts?: { - /** Specifies text for the Export button when this button invokes a dropdown menu so you can choose the required export format. */ - exportTo?: string; - /** Specifies text for the Export button's hint when this button exports to the XSLX format without invoking the drop-down menu. */ - exportToExcel?: string; - /** Specifies text for the item in the Export dropdown menu that exports grid data to Excel. */ - excelFormat?: string; - /** Specifies text for the option in the Export dropdown menu that allows you to choose whether to export all the grid data or the selected rows only. */ - selectedRows?: string; - } - }; - /** Specifies the keys of the records that must appear selected initially. */ - selectedRowKeys?: Array; - /** Specifies options of runtime selection. */ - selection?: { - /** Specifies the checkbox row display policy in the multiple mode. */ - showCheckBoxesMode?: string; - /** Specifies whether the user can select all grid records at once. */ - allowSelectAll?: boolean; - /** Specifies the selection mode. */ - mode?: string; - }; - /** A handler for the dataErrorOccured event. */ - onDataErrorOccurred?: (e: { error: Error }) => void; - /** A handler for the selectionChanged event. */ - onSelectionChanged?: (e: { - currentSelectedRowKeys: Array; - currentDeselectedRowKeys: Array; - selectedRowKeys: Array; - selectedRowsData: Array; - }) => void; - /** A handler for the exporting event. */ - onExporting?: (e: { - fileName: string; - cancel: boolean; - }) => void; - /** A handler for the fileSaving event. */ - onFileSaving?: (e: { - fileName: string; - format: string; - data: any; - cancel: boolean; - }) => void; - /** A handler for the exported event. */ - onExported?: (e: Object) => void; - /** A handler for the keyDown event. */ - onKeyDown?: (e: Object) => void; - /** A handler for the rowExpanding event. */ - onRowExpanding?: (e: Object) => void; - /** A handler for the rowExpanded event. */ - onRowExpanded?: (e: Object) => void; - /** A handler for the rowCollapsing event. */ - onRowCollapsing?: (e: Object) => void; - /** A handler for the rowCollapsed event. */ - onRowCollapsed?: (e: Object) => void; - /** Specifies whether column headers are visible or not. */ - showColumnHeaders?: boolean; - /** Specifies whether or not vertical lines separating one grid column from another are visible. */ - showColumnLines?: boolean; - /** Specifies whether or not horizontal lines separating one grid row from another are visible. */ - showRowLines?: boolean; - /** Specifies options of runtime sorting. */ - sorting?: { - /** Specifies text for the context menu item that sets an ascending sort order in a column. */ - ascendingText?: string; - /** Specifies text for the context menu item that resets sorting settings for a column. */ - clearText?: string; - /** Specifies text for the context menu item that sets a descending sort order in a column. */ - descendingText?: string; - /** Specifies the runtime sorting mode. */ - mode?: string; - }; - /** Specifies options of state storing. */ - stateStoring?: { - /** Specifies a callback function that performs specific actions on state loading. */ - customLoad?: () => JQueryPromise; - /** Specifies a callback function that performs specific actions on state saving. */ - customSave?: (state: Object) => void; - /** Specifies whether or not a grid saves its state. */ - enabled?: boolean; - /** Specifies the delay between the last change of a grid state and the operation of saving this state in milliseconds. */ - savingTimeout?: number; - /** Specifies a unique key to be used for storing the grid state. */ - storageKey?: string; - /** Specifies the type of storage to be used for state storing. */ - type?: string; - }; - /** Specifies the options of the grid summary. */ - summary?: { - /** Contains options that specify text patterns for summary items. */ - texts?: { - /** Specifies a pattern for the 'sum' summary items when they are displayed in the parent column. */ - sum?: string; - /** Specifies a pattern for the 'sum' summary items displayed in a group row or in any other column rather than the parent one. */ - sumOtherColumn?: string; - /** Specifies a pattern for the 'min' summary items when they are displayed in the parent column. */ - min?: string; - /** Specifies a pattern for the 'min' summary items displayed in a group row or in any other column rather than the parent one. */ - minOtherColumn?: string; - /** Specifies a pattern for the 'max' summary items when they are displayed in the parent column. */ - max?: string; - /** Specifies a pattern for the 'max' summary items displayed in a group row or in any other column rather than the parent one. */ - maxOtherColumn?: string; - /** Specifies a pattern for the 'avg' summary items when they are displayed in the parent column. */ - avg?: string; - /** Specifies a pattern for the 'avg' summary items displayed in a group row or in any other column rather than the parent one. */ - avgOtherColumn?: string; - /** Specifies a pattern for the 'count' summary items. */ - count?: string; - }; - /** Specifies items of the group summary. */ - groupItems?: Array<{ - /** Specifies the identifier of a summary item. */ - name?: string; - /** Specifies the column that provides data for a group summary item. */ - column?: string; - /** Customizes the text to be displayed in the summary item. */ - customizeText?: (itemInfo: { - value: any; - valueText: string; - }) => string; - /** Specifies a pattern for the summary item text. */ - displayFormat?: string; - /** Specifies a precision for the summary item value of a numeric format. */ - precision?: number; - /** Specifies whether or not a summary item must be displayed in the group footer. */ - showInGroupFooter?: boolean; - /** Indicates whether to display group summary items in parentheses after the group row header or to align them by the corresponding columns within the group row. */ - alignByColumn?: boolean; - /** Specifies the column that must hold the summary item when this item is displayed in the group footer or aligned by a column in the group row. */ - showInColumn?: string; - /** Specifies how to aggregate data for a summary item. */ - summaryType?: string; - /** Specifies a format for the summary item value. */ - valueFormat?: string; - /** Specifies whether or not to skip empty strings, null and undefined values when calculating a summary. */ - skipEmptyValues?: boolean; - }>; - /** Specifies items of the total summary. */ - totalItems?: Array<{ - /** 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; - /** Specifies whether or not to skip empty strings, null and undefined values when calculating a summary. */ - skipEmptyValues?: boolean; - }>; - /** Specifies whether or not to skip empty strings, null and undefined values when calculating a summary. */ - skipEmptyValues?: boolean; - /** Allows you to use a custom aggregate function to calculate the value of a summary item. */ - calculateCustomSummary?: (options: { - component: dxDataGrid; - name?: string; - value: any; - totalValue: any; - summaryProcess: string - }) => void; - }; - /** Specifies whether text that does not fit into a column should be wrapped. */ - wordWrapEnabled?: boolean; - } - /** A data grid widget. */ - export class dxDataGrid extends Widget { - constructor(element: JQuery, options?: dxDataGridOptions); - constructor(element: Element, options?: dxDataGridOptions); - /** Ungroups grid records. */ - clearGrouping(): void; - /** Clears sorting settings of all grid columns at once. */ - clearSorting(): void; - /** Allows you to obtain a cell by its row index and the data field of its column. */ - getCellElement(rowIndex: number, dataField: string): any; - /** Allows you to obtain a cell by its row index and the visible index of its column. */ - getCellElement(rowIndex: number, visibleColumnIndex: number): any; - /** Returns the current state of the grid. */ - state(): Object; - /** Sets the grid state. */ - state(state: Object): void; - /** Allows you to obtain the row index by a data key. */ - getRowIndexByKey(key: any): number; - /** Allows you to obtain the data key by a row index. */ - getKeyByRowIndex(rowIndex: number): any; - /** Adds a new column to a grid. */ - addColumn(columnOptions: dxDataGridColumn): void; - /** Removes the column from the grid. */ - deleteColumn(id: any): void; - /** Displays the load panel. */ - beginCustomLoading(messageText: string): void; - /** Discards changes made in a grid. */ - cancelEditData(): void; - /** Checks whether or not the grid contains unsaved changes. */ - hasEditData(): boolean; - /** Clears all the filters of a specific type applied to grid records. */ - clearFilter(): void; - /** Deselects all grid records. */ - clearSelection(): void; - /** Draws the cell being edited from the editing state. Use this method when the edit mode is batch. */ - closeEditCell(): void; - /** Collapses groups or master rows in a grid. */ - collapseAll(groupIndex?: number): void; - /** Returns the number of data columns in a grid. */ - columnCount(): number; - /** Returns the value of a specific column option. */ - columnOption(id: any, optionName: string): any; - /** Sets an option of a specific column. */ - columnOption(id: any, optionName: string, optionValue: any): void; - /** Returns the options of a column by an identifier. */ - columnOption(id: any): Object; - /** Sets several options of a column at once. */ - columnOption(id: any, options: Object): void; - /** Sets a specific cell into the editing state. */ - editCell(rowIndex: number, visibleColumnIndex: number): void; - /** Sets a specific cell into the editing state. */ - editCell(rowIndex: number, dataField: string): void; - /** Sets a specific row into the editing state. */ - editRow(rowIndex: number): void; - /** Gets the cell value. */ - cellValue(rowIndex: number, dataField: string): any; - /** Gets the cell value. */ - cellValue(rowIndex: number, visibleColumnIndex: number): any; - /** Sets the cell value. */ - cellValue(rowIndex: number, dataField: string, value: any): void; - /** Sets the cell value. */ - cellValue(rowIndex: number, visibleColumnIndex: number, value: any): void; - /** Hides the load panel. */ - endCustomLoading(): void; - /** Expands groups or master rows in a grid. */ - expandAll(groupIndex: number): void; - /** Allows you to find out whether a specific group or master row is expanded or collapsed. */ - isRowExpanded(key: any): boolean; - /** Allows you to expand a specific group or master row by its key. */ - expandRow(key: any): void; - /** Allows you to collapse a specific group or master row by its key. */ - collapseRow(key: any): void; - /** Applies a filter to the grid's data source. */ - filter(filterExpr?: any): void; - /** Returns a filter expression applied to the grid's data source using the filter(filterExpr) method. */ - filter(): any; - /** Returns a filter expression applied to the grid using all possible scenarious. */ - getCombinedFilter(): any; - /** Gets the keys of currently selected grid records. */ - getSelectedRowKeys(): Array; - /** Gets the data objects of currently selected grid records. */ - getSelectedRowsData(): Array; - /** Hides the column chooser panel. */ - hideColumnChooser(): void; - /** Adds a new data row to a grid. */ - addRow(): void; - /** - * Adds a new data row to a grid. - * @deprecated Use the addRow() method instead. - */ - insertRow(): void; - /** Returns the key corresponding to the passed data object. */ - keyOf(obj: Object): any; - /** Switches a grid to a specified page. */ - pageIndex(newIndex: number): void; - /** Gets the index of the current page. */ - pageIndex(): number; - /** Sets the page size. */ - pageSize(value: number): void; - /** Gets the current page size. */ - pageSize(): number; - /** Refreshes grid data. */ - refresh(): JQueryPromise; - /** Removes a specific row from a grid. */ - deleteRow(rowIndex: number): void; - /** - * Removes a specific row from a grid. - * @deprecated Use the deleteRow(rowIndex) method instead. - */ - removeRow(rowIndex: number): void; - /** Saves changes made in a grid. */ - saveEditData(): JQueryPromise; - /** Searches grid records by a search string. */ - searchByText(text: string): void; - /** Selects all grid records. */ - selectAll(): void; - /** Deselects the rows that are currently selected within the applied filter. */ - deselectAll(): void; - /** Selects specific grid records. */ - selectRows(keys: Array, preserve: boolean): void; - /** Deselects specific grid records. */ - deselectRows(keys: Array): void; - /** Selects grid rows by indexes. */ - selectRowsByIndexes(indexes: Array): void; - /** Allows you to find out whether a row is selected or not. */ - isRowSelected(key: any): boolean; - /** Invokes the column chooser panel. */ - showColumnChooser(): void; - startSelectionWithCheckboxes(): boolean; - /** Returns the number of records currently held by a grid. */ - totalCount(): number; - /** Recovers a row deleted in the batch edit mode. */ - undeleteRow(rowIndex: number): void; - /** Allows you to obtain a data object by its key. */ - byKey(key: any): JQueryPromise; - /** Gets the value of a total summary item. */ - getTotalSummaryValue(summaryItemName: string): any; - /** Exports grid data to Excel. */ - exportToExcel(selectionOnly: boolean): void; - /** Updates the grid to the size of its content. */ - updateDimensions(): void; - /** Focuses the specified cell element in the grid. */ - focus(element?: JQuery): void; - } - export interface dxPivotGridOptions extends WidgetOptions { - onContentReady?: Function; - /** Specifies a data source for the pivot grid. */ - dataSource?: any; - useNativeScrolling?: any; - /** A configuration object specifying scrolling options. */ - scrolling?: { - /** Specifies the scrolling mode. */ - mode?: string; - /** Specifies whether or not the widget uses native scrolling. */ - useNative?: any; - }; - /** Allows an end-user to change sorting options. */ - allowSorting?: boolean; - /** Allows an end-user to sort columns by summary values. */ - allowSortingBySummary?: boolean; - /** Allows an end-user to change filtering options. */ - allowFiltering?: boolean; - /** Allows an end-user to expand/collapse all header items within a header level. */ - allowExpandAll?: boolean; - /** Specifies whether to display the Total rows. */ - showRowTotals?: boolean; - /** Specifies whether to display the Grand Total row. */ - showRowGrandTotals?: boolean; - /** Specifies whether to display the Total columns. */ - showColumnTotals?: boolean; - /** Specifies whether to display the Grand Total column. */ - showColumnGrandTotals?: boolean; - /** Specifies whether or not to hide rows and columns with no data. */ - hideEmptySummaryCells?: boolean; - /** Specifies where to show the total rows or columns. */ - showTotalsPrior?: string; - /** Specifies whether the outer borders of the grid are visible or not. */ - showBorders?: boolean; - /** The Field Chooser configuration options. */ - fieldChooser?: { - /** Enables or disables the field chooser. */ - enabled?: boolean; - /** Specifies the field chooser layout. */ - layout?: number; - /** Specifies the text to display as a title of the field chooser popup window. */ - title?: string; - /** Specifies the field chooser width. */ - width?: number; - /** Specifies the field chooser height. */ - height?: number; - /** Strings that can be changed or localized in the pivot grid's integrated Field Chooser. */ - texts?: { - /** The string to display instead of Row Fields. */ - rowFields?: string; - /** The string to display instead of Column Fields. */ - columnFields?: string; - /** The string to display instead of Data Fields. */ - dataFields?: string; - /** The string to display instead of Filter Fields. */ - filterFields?: string; - /** The string to display instead of All Fields. */ - allFields?: string; - }; - } - /** Strings that can be changed or localized in the dxPivotGrid widget. */ - texts?: { - /** The string to display as a header of the Grand Total row and column. */ - grandTotal?: string; - /** The string to display as a header of the Total row and column. */ - total?: string; - /** Specifies the text displayed when a pivot grid does not contain any fields. */ - noData?: string; - /** The string to display as a Show Field Chooser context menu item. */ - showFieldChooser?: string; - /** The string to display as an Expand All context menu item. */ - expandAll?: string; - /** The string to display as a Collapse All context menu item. */ - collapseAll?: string; - /** The string to display as a Sort Column by Summary Value context menu item. */ - sortColumnBySummary?: string; - /** The string to display as a Sort Row by Summary Value context menu item. */ - sortRowBySummary?: string; - /** The string to display as a Remove All Sorting context menu item. */ - removeAllSorting?: string; - /** The string to display as an Export to Excel file context menu item. */ - exportToExcel?: string; - }; - /** Specifies options configuring the load panel. */ - loadPanel?: { - /** Enables or disables the load panel. */ - enabled?: boolean; - /** Specifies the height of the load panel. */ - height?: number; - /** Specifies the URL pointing to an image that will be used as a load indicator. */ - indicatorSrc?: string; - /** Specifies whether or not to show a load indicator. */ - showIndicator?: boolean; - /** Specifies whether or not to show load panel background. */ - showPane?: boolean; - /** Specifies the text to display inside a load panel. */ - text?: string; - /** Specifies the width of the load panel. */ - width?: number; - }; - /** A handler for the cellClick event. */ - onCellClick?: (e: any) => void; - /** A handler for the cellPrepared event. */ - onCellPrepared?: (e: any) => void; - /** A handler for the contextMenuPreparing event. */ - onContextMenuPreparing?: (e: Object) => void; - /** Specifies options for exporting pivot grid data. */ - export?: { - /** Indicates whether the export feature is enabled for the pivot grid. */ - enabled?: boolean; - /** Specifies a default name for the file to which grid data is exported. */ - fileName?: string; - /** Specifies the URL of the server-side proxy that streams the resulting file to the end user to enable export in IE8, IE9 and Safari browsers. */ - proxyUrl?: string; - }; - /** A handler for the exporting event. */ - onExporting?: (e: { - fileName: string; - cancel: boolean; - }) => void; - /** A handler for the fileSaving event. */ - onFileSaving?: (e: { - fileName: string; - format: string; - data: any; - cancel: boolean; - }) => void; - /** A handler for the exported event. */ - onExported?: (e: Object) => void; - /** A configuration object specifying options related to state storing. */ - stateStoring?: { - /** Specifies a callback function that performs specific actions on state loading. */ - customLoad?: () => JQueryPromise; - /** Specifies a callback function that performs specific actions on state saving. */ - customSave?: (gridState: Object) => void; - /** Specifies whether or not a grid saves its state. */ - enabled?: boolean; - /** Specifies the delay between the last change of a grid state and the operation of saving this state in milliseconds. */ - savingTimeout?: number; - /** Specifies a unique key to be used for storing the grid state. */ - storageKey?: string; - /** Specifies the type of storage to be used for state storing. */ - type?: string; - }; - } - /** A data summarization widget for multi-dimensional data analysis and data mining. */ - export class dxPivotGrid extends Widget { - constructor(element: JQuery, options?: dxPivotGridOptions); - constructor(element: Element, options?: dxPivotGridOptions); - /** Gets the PivotGridDataSource instance. */ - getDataSource(): DevExpress.data.PivotGridDataSource; - /** Gets the dxPopup instance of the field chooser window. */ - getFieldChooserPopup(): DevExpress.ui.dxPopup; - /** Updates the widget to the size of its content. */ - updateDimensions(): void; - /** Exports pivot grid data to the Excel file. */ - exportToExcel(): void; - } - export interface dxPivotGridFieldChooserOptions extends WidgetOptions { - /** Specifies the height of the widget. */ - height?: any; - /** Specifies the field chooser layout. */ - layout?: number; - /** The data source of a dxPivotGrid widget. */ - dataSource?: DevExpress.data.PivotGridDataSource; - onContentReady?: Function; - /** Strings that can be changed or localized in the dxPivotGridFieldChooser widget. */ - texts?: { - /** The string to display instead of Row Fields. */ - rowFields?: string; - /** The string to display instead of Column Fields. */ - columnFields?: string; - /** The string to display instead of Data Fields. */ - dataFields?: string; - /** The string to display instead of Filter Fields. */ - filterFields?: string; - /** The string to display instead of All Fields. */ - allFields?: string; - }; - } - /** A complementary widget for dxPivotGrid that allows you to manage data displayed in the dxPivotGrid. */ - export class dxPivotGridFieldChooser extends Widget { - constructor(element: JQuery, options?: dxPivotGridFieldChooserOptions); - constructor(element: Element, options?: dxPivotGridFieldChooserOptions); - /** Updates the widget to the size of its content. */ - updateDimensions(): void; - } -} -interface JQuery { - dxTreeView(): JQuery; - dxTreeView(options: "instance"): DevExpress.ui.dxTreeView; - dxTreeView(options: string): any; - dxTreeView(options: string, ...params: any[]): any; - dxTreeView(options: DevExpress.ui.dxTreeViewOptions): JQuery; - dxMenuBase(): JQuery; - dxMenuBase(options: "instance"): DevExpress.ui.dxMenuBase; - dxMenuBase(options: string): any; - dxMenuBase(options: string, ...params: any[]): any; - dxMenuBase(options: DevExpress.ui.dxMenuBaseOptions): JQuery; - dxMenu(): JQuery; - dxMenu(options: "instance"): DevExpress.ui.dxMenu; - dxMenu(options: string): any; - dxMenu(options: string, ...params: any[]): any; - dxMenu(options: DevExpress.ui.dxMenuOptions): JQuery; - dxContextMenu(): JQuery; - dxContextMenu(options: "instance"): DevExpress.ui.dxContextMenu; - dxContextMenu(options: string): any; - dxContextMenu(options: string, ...params: any[]): any; - dxContextMenu(options: DevExpress.ui.dxContextMenuOptions): JQuery; - dxColorBox(): JQuery; - dxColorBox(options: "instance"): DevExpress.ui.dxColorBox; - dxColorBox(options: string): any; - dxColorBox(options: string, ...params: any[]): any; - dxColorBox(options: DevExpress.ui.dxColorBoxOptions): JQuery; - dxDataGrid(): JQuery; - dxDataGrid(options: "instance"): DevExpress.ui.dxDataGrid; - dxDataGrid(options: string): any; - dxDataGrid(options: string, ...params: any[]): any; - dxDataGrid(options: DevExpress.ui.dxDataGridOptions): JQuery; - dxPivotGrid(): JQuery; - dxPivotGrid(options: "instance"): DevExpress.ui.dxPivotGrid; - dxPivotGrid(options: string): any; - dxPivotGrid(options: string, ...params: any[]): any; - dxPivotGrid(options: DevExpress.ui.dxPivotGridOptions): JQuery; - dxPivotGridFieldChooser(): JQuery; - dxPivotGridFieldChooser(options: "instance"): DevExpress.ui.dxPivotGridFieldChooser; - dxPivotGridFieldChooser(options: string): any; - dxPivotGridFieldChooser(options: string, ...params: any[]): any; - dxPivotGridFieldChooser(options: DevExpress.ui.dxPivotGridFieldChooserOptions): JQuery; - dxScheduler(): JQuery; - dxScheduler(options: "instance"): DevExpress.ui.dxScheduler; - dxScheduler(options: string): any; - dxScheduler(options: string, ...params: any[]): any; - dxScheduler(options: DevExpress.ui.dxSchedulerOptions): JQuery; -} -declare 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 { - /** Specifies an action performed when the execute() method of the command is called. */ - onExecute?: any; - /** Indicates whether or not the widget that displays this command is disabled. */ - disabled?: boolean; - /** Specifies whether the current command is rendered when a view is being rendered or after a view is shown. */ - renderStage?: string; - /** Specifies the name of the icon shown inside the widget associated with this command. */ - icon?: string; - iconSrc?: string; - /** The identifier of the command. */ - id?: string; - /** Specifies the title of the widget associated with this command. */ - title?: string; - /** Specifies the type of the button, if the command is rendered as a dxButton widget. */ - type?: string; - /** A Boolean value specifying whether or not the widget associated with this command is visible. */ - visible?: boolean; - } - /** A markup component used to define markup options for a command. */ - export class dxCommand extends DOMComponent { - constructor(element: JQuery, options: dxCommandOptions); - constructor(options: dxCommandOptions); - /** Executes the action associated with this command. */ - execute(): void; - } - /** An object responsible for routing. */ - export class Router { - /** Adds a routing rule to the list of registered rules. */ - register(pattern: string, defaults?: Object, constraints?: Object): void; - /** Decodes the specified URI to an object using the registered routing rules. */ - parse(uri: string): Object; - /** Formats an object to a URI. */ - format(obj: Object): string; - } - export interface StateManagerOptions { - /** A storage to which the state manager saves the application state. */ - storage?: Object; - } - /** An object used to store the current application state. */ - export class StateManager { - constructor(options?: StateManagerOptions); - /** Adds an object that implements an interface of a state source to the state manager's collection of state sources. */ - addStateSource(stateSource: Object): void; - /** Removes a specified state source from the state manager's collection of state sources. */ - removeStateSource(stateSource: Object): void; - /** Saves the current application state. */ - saveState(): void; - /** Restores the application state that has been saved by the saveState() method to the state storage. */ - restoreState(): void; - /** Removes the application state that has been saved by the saveState() method to the state storage. */ - clearState(): void; - } - export module html { - export var layoutSets: Array; - export var animationSets: { [animationSetName: string]: AnimationSet }; - export interface AnimationSet { - [animationName: string]: any - } - export interface HtmlApplicationOptions { - /** Specifies where the commands that are defined in the application's views must be displayed. */ - commandMapping?: Object; - /** Specifies whether or not view caching is disabled. */ - disableViewCache?: boolean; - /** An array of layout controllers that should be used to show application views in the current navigation context. */ - layoutSet?: any; - /** Specifies the animation presets that are used to animate different UI elements in the current application. */ - animationSet?: AnimationSet; - /** Specifies whether the current application must behave as a mobile or web application. */ - mode?: string; - /** Specifies the object that represents a root namespace of the application. */ - namespace?: Object; - /** Specifies application behavior when the user navigates to a root view. */ - navigateToRootViewMode?: string; - /** An array of dxCommand configuration objects used to define commands available from the application's global navigation. */ - navigation?: Array; - /** A state manager to be used in the application. */ - stateManager?: StateManager; - /** Specifies the storage to be used by the application's state manager to store the application state. */ - stateStorage?: Object; - /** Indicates whether on not to use the title of the previously displayed view as text on the Back button. */ - useViewTitleAsBackText?: boolean; - /** A custom view cache to be used in the application. */ - viewCache?: Object; - /** Specifies a limit for the views that can be cached. */ - viewCacheSize?: number; - /** Specifies the current version of application templates. */ - templatesVersion?: string; - /** Specifies options for the viewport meta tag of a mobile browser. */ - viewPort?: JQuery; - /** A custom router to be used in the application. */ - router?: Router; - } - /** An object used to manage views, as well as control the application life cycle. */ - export class HtmlApplication implements EventsMixin { - constructor(options: HtmlApplicationOptions); - afterViewSetup: JQueryCallback; - beforeViewSetup: JQueryCallback; - initialized: JQueryCallback; - navigating: JQueryCallback; - navigatingBack: JQueryCallback; - resolveLayoutController: JQueryCallback; - resolveViewCacheKey: JQueryCallback; - viewDisposed: JQueryCallback; - viewDisposing: JQueryCallback; - viewHidden: JQueryCallback; - viewRendered: JQueryCallback; - viewShowing: JQueryCallback; - viewShown: JQueryCallback; - /** Provides access to the ViewCache object. */ - viewCache: ViewCache; - /** An array of dxCommand components that are created based on the application's navigation option value. */ - navigation: Array; - /** Provides access to the StateManager object. */ - stateManager: StateManager; - /** Provides access to the Router object. */ - router: Router; - /** Navigates to the URI preceding the current one in the navigation history. */ - back(): void; - /** Returns a Boolean value indicating whether or not backwards navigation is currently possible. */ - canBack(): boolean; - /** Calls the clearState() method of the application's StateManager object. */ - clearState(): void; - /** Creates global navigation commands. */ - createNavigation(navigationConfig: Array): void; - /** Returns an HTML template of the specified view. */ - getViewTemplate(viewName: string): JQuery; - /** Returns a configuration object used to create a dxView component for a specified view. */ - getViewTemplateInfo(viewName: string): Object; - /** Adds a specified HTML template to a collection of view or layout templates. */ - loadTemplates(source: any): JQueryPromise; - /** Navigates to the specified URI. */ - navigate(uri?: any, options?: Object): void; - /** Renders navigation commands to the navigation command containers that are located in the layouts used in the application. */ - renderNavigation(): void; - /** Calls the restoreState() method of the application's StateManager object. */ - restoreState(): void; - /** Calls the saveState method of the application's StateManager object. */ - saveState(): void; - /** Provides access to the object that defines the current context to be considered when choosing an appropriate template for a view. */ - templateContext(): Object; - on(eventName: "initialized", eventHandler: () => void): HtmlApplication; - on(eventName: "afterViewSetup", eventHandler: (e: { - viewInfo: Object; - }) => void): HtmlApplication; - on(eventName: "beforeViewSetup", eventHandler: (e: { - viewInfo: Object; - }) => void): HtmlApplication; - on(eventName: "navigating", eventHandler: (e: { - currentUri: string; - uri: string; - cancel: boolean; - options: { - root: boolean; - target: string; - direction: string; - rootInDetailPane: boolean; - modal: boolean; - }; - }) => void): HtmlApplication; - on(eventName: "navigatingBack", eventHandler: (e: { - cancel: boolean; - isHardwareButton: boolean; - }) => void): HtmlApplication; - on(eventName: "resolveLayoutController", eventHandler: (e: { - viewInfo: Object; - layoutController: Object; - availableLayoutControllers: Array; - }) => void): HtmlApplication; - on(eventName: "resolveViewCacheKey", eventHandler: (e: { - key: string; - navigationItem: Object; - routeData: Object; - }) => void): HtmlApplication; - on(eventName: "viewDisposed", eventHandler: (e: { - viewInfo: Object; - }) => void): HtmlApplication; - on(eventName: "viewDisposing", eventHandler: (e: { - viewInfo: Object; - }) => void): HtmlApplication; - on(eventName: "viewHidden", eventHandler: (e: { - viewInfo: Object; - }) => void): HtmlApplication; - on(eventName: "viewRendered", eventHandler: (e: { - viewInfo: Object; - }) => void): HtmlApplication; - on(eventName: "viewShowing", eventHandler: (e: { - viewInfo: Object; - direction: string; - }) => void): HtmlApplication; - on(eventName: "viewShown", eventHandler: (e: { - viewInfo: Object; - direction: string; - }) => void): HtmlApplication; - on(eventName: string, eventHandler: Function): HtmlApplication; - on(events: { [eventName: string]: Function; }): HtmlApplication; - off(eventName: "initialized"): HtmlApplication; - off(eventName: "afterViewSetup"): HtmlApplication; - off(eventName: "beforeViewSetup"): HtmlApplication; - off(eventName: "navigating"): HtmlApplication; - off(eventName: "navigatingBack"): HtmlApplication; - off(eventName: "resolveLayoutController"): HtmlApplication; - off(eventName: "resolveViewCacheKey"): HtmlApplication; - off(eventName: "viewDisposed"): HtmlApplication; - off(eventName: "viewDisposing"): HtmlApplication; - off(eventName: "viewHidden"): HtmlApplication; - off(eventName: "viewRendered"): HtmlApplication; - off(eventName: "viewShowing"): HtmlApplication; - off(eventName: "viewShown"): HtmlApplication; - off(eventName: string): HtmlApplication; - off(eventName: "initialized", eventHandler: () => void): HtmlApplication; - off(eventName: "afterViewSetup", eventHandler: (e: { - viewInfo: Object; - }) => void): HtmlApplication; - off(eventName: "beforeViewSetup", eventHandler: (e: { - viewInfo: Object; - }) => void): HtmlApplication; - off(eventName: "navigating", eventHandler: (e: { - currentUri: string; - uri: string; - cancel: boolean; - options: { - root: boolean; - target: string; - direction: string; - rootInDetailPane: boolean; - modal: boolean; - }; - }) => void): HtmlApplication; - off(eventName: "navigatingBack", eventHandler: (e: { - cancel: boolean; - isHardwareButton: boolean; - }) => void): HtmlApplication; - off(eventName: "resolveLayoutController", eventHandler: (e: { - viewInfo: Object; - layoutController: Object; - availableLayoutControllers: Array; - }) => void): HtmlApplication; - off(eventName: "resolveViewCacheKey", eventHandler: (e: { - key: string; - navigationItem: Object; - routeData: Object; - }) => void): HtmlApplication; - off(eventName: "viewDisposed", eventHandler: (e: { - viewInfo: Object; - }) => void): HtmlApplication; - off(eventName: "viewDisposing", eventHandler: (e: { - viewInfo: Object; - }) => void): HtmlApplication; - off(eventName: "viewHidden", eventHandler: (e: { - viewInfo: Object; - }) => void): HtmlApplication; - off(eventName: "viewRendered", eventHandler: (e: { - viewInfo: Object; - }) => void): HtmlApplication; - off(eventName: "viewShowing", eventHandler: (e: { - viewInfo: Object; - direction: string; - }) => void): HtmlApplication; - off(eventName: "viewShown", eventHandler: (e: { - viewInfo: Object; - direction: string; - }) => void): HtmlApplication; - off(eventName: string, eventHandler: Function): HtmlApplication; - } - } -} -declare 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 distance in pixels between the bottom side of the title and the surrounding widget elements. */ - bottom?: number; - /** Specifies the distance in pixels between the left side of the title and the surrounding widget elements. */ - left?: number; - /** Specifies the distance between the right side of the title and surrounding widget elements in pixels. */ - right?: number; - /** Specifies the distance between the top side of the title and surrounding widget elements in pixels. */ - top?: number; - } - export interface Size { - /** Specifies the width of the widget. */ - width?: number; - /** Specifies the height of the widget. */ - height?: number; - } - export interface Title { - /** Specifies font options for the title. */ - font?: viz.core.Font; - /** Specifies the widget title's horizontal position. */ - horizontalAlignment?: string; - /** Specifies the widget title's position in the vertical direction. */ - verticalAlignment?: string; - /** Specifies the distance between the title and surrounding widget elements in pixels. */ - margin?: viz.core.Margins; - /** Specifies the height of the space reserved for the title. */ - placeholderSize?: number; - /** Specifies text for the title. */ - text?: string; - /** Specifies a subtitle for the widget. */ - subtitle?: { - /** Specifies font options for the subtitle. */ - font?: viz.core.Font; - /** Specifies text for the subtitle. */ - text?: string; - } - } - export interface Tooltip { - /** Specifies the length of the tooltip's arrow in pixels. */ - arrowLength?: number; - /** Specifies the appearance of the tooltip's border. */ - border?: viz.core.DashedBorderWithOpacity; - /** Specifies a color for the tooltip. */ - color?: string; - /** Specifies the z-index for tooltips. */ - zIndex?: number; - /** Specifies the container to draw tooltips inside of it. */ - container?: any; - /** Specifies text and appearance of a set of tooltips. */ - customizeTooltip?: (arg: Object) => { color?: string; text?: string }; - /** Specifies whether or not the tooltip is enabled. */ - enabled?: boolean; - /** Specifies font options for the text displayed by the tooltip. */ - font?: Font; - /** Specifies a format for the text displayed by the tooltip. */ - format?: string; - /** Specifies the opacity of a tooltip. */ - opacity?: number; - /** Specifies a distance from the tooltip's left/right boundaries to the inner text in pixels. */ - paddingLeftRight?: number; - /** Specifies a distance from the tooltip's top/bottom boundaries to the inner text in pixels. */ - paddingTopBottom?: number; - /** Specifies a precision for formatted values displayed by the tooltip. */ - precision?: number; - /** Specifies options of the tooltip's shadow. */ - shadow?: { - /** Specifies the blur distance of the tooltip's shadow. */ - blur?: number; - /** Specifies the color of the tooltip's shadow. */ - color?: string; - /** Specifies the horizontal offset of the tooltip's shadow relative to the tooltip in pixels. */ - offsetX?: number; - /** Specifies the vertical offset of the tooltip's shadow relative to the tooltip in pixels. */ - offsetY?: number; - /** Specifies the opacity of the tooltip's shadow. */ - opacity?: number; - }; - } - export interface Animation { - /** Determines how long animation runs. */ - duration?: number; - /** Specifies the animation easing mode. */ - easing?: string; - /** Indicates whether or not animation is enabled. */ - enabled?: boolean; - } - export interface LoadingIndicator { - /** Specifies a color for the loading indicator background. */ - backgroundColor?: string; - /** Specifies font options for the loading indicator text. */ - font?: viz.core.Font; - /** Specifies whether to show the loading indicator or not. */ - show?: boolean; - /** Specifies a text to be displayed by the loading indicator. */ - text?: string; - } - export interface LegendBorder extends viz.core.DashedBorderWithOpacity { - /** Specifies a radius for the corners of the legend border. */ - cornerRadius?: number; - } - export interface BaseLegend { - /** Specifies the color of the legend's background. */ - backgroundColor?: string; - /** Specifies legend border settings. */ - border?: viz.core.LegendBorder; - /** Specifies how many columns must be taken to arrange legend items. */ - columnCount?: number; - /** Specifies the spacing between a pair of neighboring legend columns in pixels. */ - columnItemSpacing?: number; - /** Specifies font options for legend items. */ - font?: viz.core.Font; - /** Specifies the legend's position on the map. */ - horizontalAlignment?: string; - /** Specifies the alignment of legend items. */ - itemsAlignment?: string; - /** Specifies the position of text relative to the item marker. */ - itemTextPosition?: string; - /** Specifies the distance between the legend and the container borders in pixels. */ - margin?: viz.core.Margins; - /** Specifies the size of item markers in the legend in pixels. */ - markerSize?: number; - /** Specifies whether to arrange legend items horizontally or vertically. */ - orientation?: string; - /** Specifies the spacing between the legend left/right border and legend items in pixels. */ - paddingLeftRight?: number; - /** Specifies the spacing between the legend top/bottom border and legend items in pixels. */ - paddingTopBottom?: number; - /** Specifies how many rows must be taken to arrange legend items. */ - rowCount?: number; - /** Specifies the spacing between a pair of neighboring legend rows in pixels. */ - rowItemSpacing?: number; - /** Specifies the legend's position on the map. */ - verticalAlignment?: string; - /** Specifies whether or not the legend is visible on the map. */ - visible?: boolean; - } - export interface BaseWidgetOptions extends DOMComponentOptions { - /** A handler for the drawn event. */ - onDrawn?: (e: { - component: BaseWidget; - element: Element; - }) => void; - /** A handler for the incidentOccurred event. */ - onIncidentOccurred?: ( - component: BaseWidget, - element: Element, - target: { - id: string; - type: string; - args: any; - text: string; - widget: string; - version: string; - } - ) => void; - /** Notifies a widget that it is embedded into an HTML page that uses a path modifier. */ - pathModified?: boolean; - /** Specifies whether or not the widget supports right-to-left representation. */ - rtlEnabled?: boolean; - /** Sets the name of the theme to be used in the widget. */ - theme?: string; - } - /** This section describes options and methods that are common to all widgets. */ - export class BaseWidget extends DOMComponent { - /** Returns the widget's SVG markup. */ - svg(): string; - } -} -declare 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 points from the series point collection based on the specified argument. */ - getPointsByArg(pointArg: any): Array; - /** Gets a point from the series point collection based on the specified point position. */ - getPointByPos(positionIndex: number): Object; - /** Selects the series. The series is displayed in a 'selected' style until another series is selected or the current series is deselected programmatically. */ - select(): void; - /** Selects the specified point. The point is displayed in a 'selected' style. */ - selectPoint(point: BasePoint): void; - /** Deselects the specified point. The point is displayed in an initial style. */ - deselectPoint(point: BasePoint): void; - /** Returns an array of all points in the series. */ - getAllPoints(): Array; - /** Returns visible series points. */ - getVisiblePoints(): Array; - /** Returns the name of the series. */ - name: string; - /** Returns the tag of the series. */ - tag: string; - /** Hides a series. */ - hide(): void; - /** Provides information about the hover state of a series. */ - isHovered(): boolean; - /** Provides information about the selection state of a series. */ - isSelected(): boolean; - /** Provides information about the visibility state of a series. */ - isVisible(): boolean; - /** Makes a particular series visible. */ - show(): void; - } - /** This section describes the methods that can be used in code to manipulate the Point object. */ - export interface BasePoint { - /** Provides information about the state of the point object. */ - fullState: number; - /** Returns the point's argument value that was set in the data source. */ - originalArgument: any; - /** Returns the point's value that was set in the data source. */ - originalValue: any; - /** Returns the tag of the point. */ - tag: string; - /** Deselects the point. */ - clearSelection(): void; - /** Gets the color of a particular point. */ - getColor(): string; - /** Hides the tooltip of the point. */ - hideTooltip(): void; - /** Provides information about the hover state of a point. */ - isHovered(): boolean; - /** Provides information about the selection state of a point. */ - isSelected(): boolean; - /** Selects the point. The point is displayed in a 'selected' style until another point is selected or the current point is deselected programmatically. */ - select(): void; - /** Shows the tooltip of the point. */ - showTooltip(): void; - /** Allows you to obtain the label(s) of the series point. */ - getLabel(): any; - /** Returns the series object to which the point belongs. */ - series: BaseSeries; - } - /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ - export interface ChartSeries extends BaseSeries { - /** Returns the name of the series pane. */ - pane: string; - /** Returns the name of the value axis of the series. */ - axis: string; - selectPoint(point: ChartPoint): void; - deselectPoint(point: ChartPoint): void; - getAllPoints(): Array; - getVisiblePoints(): Array; - } - /** This section describes the methods that can be used in code to manipulate the Point object. */ - export interface ChartPoint extends BasePoint { - /** Contains the close value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ - originalCloseValue: any; - /** Contains the high value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ - originalHighValue: any; - /** Contains the low value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ - originalLowValue: any; - /** Contains the first value of the point. This field is useful for points belonging to a series of the range area or range bar type only. */ - originalMinValue: any; - /** Contains the open value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ - originalOpenValue: any; - /** Contains the size of the bubble as it was set in the data source. This field is useful for points belonging to a series of the bubble type only. */ - size: any; - /** Gets the parameters of the point's minimum bounding rectangle (MBR). */ - getBoundingRect(): { x: number; y: number; width: number; height: number; }; - series: ChartSeries; - } - /** This section describes the methods that can be used in code to manipulate the Label object. */ - export interface Label { - /** Gets the parameters of the label's minimum bounding rectangle (MBR). */ - getBoundingRect(): { x: number; y: number; width: number; height: number; }; - /** Hides the point label. */ - hide(): void; - /** Shows the point label. */ - show(): void; - } - export interface PieSeries extends BaseSeries { - selectPoint(point: PiePoint): void; - deselectPoint(point: PiePoint): void; - getAllPoints(): Array; - getVisiblePoints(): Array; - } - /** This section describes the methods that can be used in code to manipulate the Point object. */ - export interface PiePoint extends BasePoint { - /** Gets the percentage value of the specific point. */ - percent: any; - /** Provides information about the visibility state of a point. */ - isVisible(): boolean; - /** Makes a specific point visible. */ - show(): void; - /** Hides a specific point. */ - hide(): void; - series: PieSeries; - } - /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ - export interface PolarSeries extends BaseSeries { - /** Returns the name of the value axis of the series. */ - axis: string; - selectPoint(point: PolarPoint): void; - deselectPoint(point: PolarPoint): void; - getAllPoints(): Array; - getVisiblePoints(): Array; - } - /** This section describes the methods that can be used in code to manipulate the Point object. */ - export interface PolarPoint extends BasePoint { - series: PolarSeries; - } - export interface Strip { - /** Specifies a color for a strip. */ - color?: string; - /** An object that defines the label configuration options of a strip. */ - label?: { - /** Specifies the text displayed in a strip. */ - text?: string; - }; - /** Specifies a start value for a strip. */ - startValue?: any; - /** Specifies an end value for a strip. */ - endValue?: any; - } - export interface BaseSeriesConfigLabel { - /** Specifies a format for arguments displayed by point labels. */ - argumentFormat?: string; - /** Specifies a precision for formatted point arguments displayed in point labels. */ - argumentPrecision?: number; - /** Specifies a background color for point labels. */ - backgroundColor?: string; - /** Specifies border options for point labels. */ - border?: viz.core.DashedBorder; - /** Specifies connector options for series point labels. */ - connector?: { - /** Specifies the color of label connectors. */ - color?: string; - /** Indicates whether or not label connectors are visible. */ - visible?: boolean; - /** Specifies the width of label connectors. */ - width?: number; - }; - /** Specifies a callback function that returns the text to be displayed by point labels. */ - customizeText?: (pointInfo: Object) => string; - /** Specifies font options for the text displayed in point labels. */ - font?: viz.core.Font; - /** Specifies a format for the text displayed by point labels. */ - format?: string; - position?: string; - /** Specifies a precision for formatted point values displayed in point labels. */ - precision?: number; - /** Specifies the angle used to rotate point labels from their initial position. */ - rotationAngle?: number; - /** Specifies the visibility of point labels. */ - visible?: boolean; - } - export interface SeriesConfigLabel extends BaseSeriesConfigLabel { - /** Specifies whether or not to show a label when the point has a zero value. */ - showForZeroValues?: boolean; - } - export interface ChartSeriesConfigLabel extends SeriesConfigLabel { - /** Specifies how to align point labels relative to the corresponding data points that they represent. */ - alignment?: string; - /** Specifies how to shift point labels horizontally from their initial positions. */ - horizontalOffset?: number; - /** Specifies how to shift point labels vertically from their initial positions. */ - verticalOffset?: number; - /** Specifies a precision for the percentage values displayed in the labels of a full-stacked-like series. */ - percentPrecision?: number; - } - export interface BaseCommonSeriesConfig { - /** Specifies the data source field that provides arguments for series points. */ - argumentField?: string; - axis?: string; - /** An object defining the label configuration options for a series in the dxChart widget. */ - label?: ChartSeriesConfigLabel; - /** Specifies border options for point labels. */ - border?: viz.core.DashedBorder; - /** Specifies a series color. */ - color?: string; - /** Specifies the dash style of the series' line. */ - dashStyle?: string; - hoverMode?: string; - hoverStyle?: { - /** An object defining the border options for a hovered series. */ - border?: viz.core.DashedBorder; - /**

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

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

    Sets a color for a point when it is selected.

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

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

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

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

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

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

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

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

    */ - customizeText?: (seriesInfo: { seriesName: string; seriesIndex: number; seriesColor: string; }) => string; - /** Specifies what series elements to highlight when a corresponding item in the legend is hovered over. */ - hoverMode?: string; - } - export interface AdvancedOptions extends BaseChartOptions { - /** A handler for the argumentAxisClick event. */ - onArgumentAxisClick?: any; - /** Specifies the color of the parent page element. */ - containerBackgroundColor?: string; - /** An object providing options for managing data from a data source. */ - dataPrepareSettings?: { - /** Specifies whether or not to validate the values from a data source. */ - checkTypeForAllData?: boolean; - /** Specifies whether or not to convert the values from a data source into the data type of an axis. */ - convertToAxisDataType?: boolean; - /** Specifies how to sort the series points. */ - sortingMethod?: any; - }; - /** A handler for the legendClick event. */ - onLegendClick?: any; - /** A handler for the seriesClick event. */ - onSeriesClick?: any; - /** A handler for the seriesHoverChanged event. */ - onSeriesHoverChanged?: (e: { - component: BaseChart; - element: Element; - target: TSeries; - }) => void; - /** A handler for the seriesSelectionChanged event. */ - onSeriesSelectionChanged?: (e: { - component: BaseChart; - element: Element; - target: TSeries; - }) => void; - /** Specifies whether a single series or multiple series can be selected in the chart. */ - seriesSelectionMode?: string; - /** Specifies how the chart must behave when series point labels overlap. */ - resolveLabelOverlapping?: string; - /** Specifies whether or not all bars in a series must have the same angle, or may have different angles if any points in other series are missing. */ - equalBarWidth?: boolean; - /** Specifies a common bar width as a percentage from 0 to 1. */ - barWidth?: number; - /** Forces the widget to treat negative values as zeroes. Applies to stacked-like series only. */ - negativesAsZeroes?: boolean; - } - export interface Legend extends AdvancedLegend { - /** Specifies whether the legend is located outside or inside the chart's plot. */ - position?: string; - } - export interface ChartTooltip extends BaseChartTooltip { - /** Specifies whether the tooltip must be located in the center of a bar or on its edge. Applies to the Bar and Bubble series. */ - location?: string; - /** Specifies the kind of information to display in a tooltip. */ - shared?: boolean; - } - export interface dxChartOptions extends AdvancedOptions { - adaptiveLayout?: { - keepLabels?: boolean; - }; - /** Indicates whether or not to synchronize value axes when they are displayed on a single pane. */ - synchronizeMultiAxes?: boolean; - /** Specifies whether or not to filter the series points depending on their quantity. */ - useAggregation?: boolean; - /** Indicates whether or not to adjust a value axis to the current minimum and maximum values of a zoomed chart. */ - adjustOnZoom?: boolean; - /** Specifies argument axis options for the dxChart widget. */ - argumentAxis?: ChartArgumentAxis; - /** An object defining the configuration options that are common for all axes of the dxChart widget. */ - commonAxisSettings?: ChartCommonAxisSettings; - /** An object defining the configuration options that are common for all panes in the dxChart widget. */ - commonPaneSettings?: CommonPane; - /** An object defining the configuration options that are common for all series of the dxChart widget. */ - commonSeriesSettings?: CommonSeriesSettings; - /** An object that specifies the appearance options of the chart crosshair. */ - crosshair?: { - /** Specifies a color for the crosshair lines. */ - color?: string; - /** Specifies a dash style for the crosshair lines. */ - dashStyle?: string; - /** Specifies whether to enable the crosshair or not. */ - enabled?: boolean; - /** Specifies the opacity of the crosshair lines. */ - opacity?: number; - /** Specifies the width of the crosshair lines. */ - width?: number; - /** Specifies the appearance of the horizontal crosshair line. */ - horizontalLine?: CrosshaierWithLabel; - /** Specifies the appearance of the vertical crosshair line. */ - verticalLine?: CrosshaierWithLabel; - /** Specifies the options of the crosshair labels. */ - label?: { - /** Specifies a color for the background of the crosshair labels. */ - backgroundColor?: string; - /** Specifies whether the crosshair labels are visible or not. */ - visible?: boolean; - /** Specifies font options for the text of the crosshair labels. */ - font?: viz.core.Font; - /** Specifies the format of the values displayed by crosshair labels. */ - format?: string; - /** Specifies a precision for formatted values. */ - precision?: number; - /** Customizes the text displayed by the crosshair labels. */ - customizeText?: (info: { value: any; valueText: string; point: ChartPoint; }) => string; - } - }; - /** Specifies a default pane for the chart series. */ - defaultPane?: string; - /** Specifies a coefficient determining the diameter of the largest bubble. */ - maxBubbleSize?: number; - /** Specifies the diameter of the smallest bubble measured in pixels. */ - minBubbleSize?: number; - /** Defines the dxChart widget's pane(s). */ - panes?: Array; - /** Swaps the axes round so that the value axis becomes horizontal and the argument axes becomes vertical. */ - rotated?: boolean; - /** Specifies the options of a chart's legend. */ - legend?: Legend; - /** Specifies options for dxChart widget series. */ - series?: Array; - /** Defines options for the series template. */ - seriesTemplate?: SeriesTemplate; - /** Specifies tooltip options. */ - tooltip?: ChartTooltip; - /** Specifies value axis options for the dxChart widget. */ - valueAxis?: Array; - /** Enables scrolling in your chart. */ - scrollingMode?: string; - /** Enables zooming in your chart. */ - zoomingMode?: string; - /** Specifies the settings of the scroll bar. */ - scrollBar?: { - /** Specifies whether the scroll bar is visible or not. */ - visible?: boolean; - /** Specifies the spacing between the scroll bar and the chart's plot in pixels. */ - offset?: number; - /** Specifies the color of the scroll bar. */ - color?: string; - /** Specifies the width of the scroll bar in pixels. */ - width?: number; - /** Specifies the opacity of the scroll bar. */ - opacity?: number; - /** Specifies the position of the scroll bar in the chart. */ - position?: string; - }; - } - /** A widget used to embed charts into web applications. */ - export class dxChart extends BaseChart { - constructor(element: JQuery, options?: dxChartOptions); - constructor(element: Element, options?: dxChartOptions); - /** Sets the specified start and end values for the chart's argument axis. */ - zoomArgument(startValue: any, endValue: any): void; - } - interface CrosshaierWithLabel extends viz.core.DashedBorderWithOpacity { - /** Configures the label that belongs to the horizontal crosshair line. */ - label?: { - /** Specifies a color for the background of the label that belongs to the horizontal crosshair line. */ - backgroundColor?: string; - /** Specifies whether the label of the horizontal crosshair line is visible or not. */ - visible?: boolean; - /** Specifies font options for the text of the label that belongs to the horizontal crosshair line. */ - font?: viz.core.Font; - /** Specifies the format of the values displayed by crosshair labels. */ - format?: string; - /** Specifies a precision for formatted values. */ - precision?: number; - /** Customizes the text displayed by the crosshair label that accompany the horizontal line. */ - customizeText?: (info: { value: any; valueText: string; point: ChartPoint; }) => string; - } - } - export interface PolarChartTooltip extends BaseChartTooltip { - /** Specifies the kind of information to display in a tooltip. */ - shared?: boolean; - } - export interface dxPolarChartOptions extends AdvancedOptions { - /** Specifies adaptive layout options. */ - adaptiveLayout?: { - width?: number; - height?: number; - /** Specifies whether or not point labels can be hidden when the layout is adapting. */ - keepLabels?: boolean; - }; - /** Indicates whether or not to display a "spider web". */ - useSpiderWeb?: boolean; - /** Specifies argument axis options for the dxPolarChart widget. */ - argumentAxis?: PolarArgumentAxis; - /** An object defining the configuration options that are common for all axes of the dxPolarChart widget. */ - commonAxisSettings?: PolarCommonAxisSettings; - /** An object defining the configuration options that are common for all series of the dxPolarChart widget. */ - commonSeriesSettings?: CommonPolarSeriesSettings; - /** Specifies the options of a chart's legend. */ - legend?: AdvancedLegend; - /** Specifies options for dxPolarChart widget series. */ - series?: Array; - /** Defines options for the series template. */ - seriesTemplate?: PolarSeriesTemplate; - /** Specifies tooltip options. */ - tooltip?: PolarChartTooltip; - /** Specifies value axis options for the dxPolarChart widget. */ - valueAxis?: PolarValueAxis; - } - /** A chart widget displaying data in a polar coordinate system. */ - export class dxPolarChart extends BaseChart { - constructor(element: JQuery, options?: dxPolarChartOptions); - constructor(element: Element, options?: dxPolarChartOptions); - } - export interface PieLegend extends core.BaseLegend { - /** Specifies what chart elements to highlight when a corresponding item in the legend is hovered over. */ - hoverMode?: string; - /** Specifies the text for a hint that appears when a user hovers the mouse pointer over a legend item. */ - customizeHint?: (pointInfo: { pointName: string; pointIndex: number; pointColor: string; }) => string; - /** Specifies a callback function that returns the text to be displayed by a legend item. */ - customizeText?: (pointInfo: { pointName: string; pointIndex: number; pointColor: string; }) => string; - } - export interface dxPieChartOptions extends BaseChartOptions { - /** Specifies adaptive layout options. */ - adaptiveLayout?: { - /** Specifies whether or not point labels can be hidden when the layout is adapting. */ - keepLabels?: boolean; - }; - /** Specifies dxPieChart legend options. */ - legend?: PieLegend; - /** Specifies options for the series of the dxPieChart widget. */ - series?: Array; - /** Specifies the diameter of the pie. */ - diameter?: number; - /** Specifies the direction that the pie chart segments will occupy. */ - segmentsDirection?: string; - /** Specifies the angle in arc degrees from which the first segment of a pie chart should start. */ - startAngle?: number; - /** Specifies the fraction of the inner radius relative to the total radius in the series of the 'doughnut' type. The value should be between 0 and 1. */ - innerRadius?: number; - /** A handler for the legendClick event. */ - onLegendClick?: any; - /** Specifies how a chart must behave when series point labels overlap. */ - resolveLabelOverlapping?: string; - /** An object defining the configuration options that are common for all series of the dxPieChart widget. */ - commonSeriesSettings?: CommonPieSeriesSettings; - /** Specifies the type of the pie chart series. */ - type?: string; - } - /** A circular chart widget for web applications. */ - export class dxPieChart extends BaseChart { - constructor(element: JQuery, options?: dxPieChartOptions); - constructor(element: Element, options?: dxPieChartOptions); - /** - * Provides access to the dxPieChart series. - * @deprecated Use the getAllSeries() method instead. - */ - 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. - * @deprecated Use the scale | customMinorTicks option instead. - */ - customTickValues?: Array; - /** Specifies the length of the scale's minor ticks. */ - length?: number; - /** - * Indicates whether automatically calculated minor ticks are visible or not. - * @deprecated This feature is no longer available. - */ - showCalculatedTicks?: boolean; - /** - * Specifies an interval between minor ticks. - * @deprecated Use the scale | minorTickInterval option instead. - */ - tickInterval?: number; - /** Indicates whether scale minor ticks are visible or not. */ - visible?: boolean; - /** Specifies the width of the scale's minor ticks. */ - width?: number; - } - export interface ScaleMajorTick extends ScaleTick { - /** - * Specifies whether or not to expand the current major tick interval if labels overlap each other. - * @deprecated Use the overlappingBehavior | useAutoArrangement option instead. - */ - useTicksAutoArrangement?: boolean; - } - export interface ScaleMinorTick extends ScaleTick { - /** Specifies the opacity of the scale's minor ticks. */ - opacity?: number; - } - export interface BaseScaleLabel { - /** Specifies whether or not scale labels should be colored similarly to their corresponding ranges in the range container. */ - useRangeColors?: boolean; - /** Specifies a callback function that returns the text to be displayed in scale labels. */ - customizeText?: (scaleValue: { value: number; valueText: string }) => string; - /** Specifies the overlap resolving options to be applied to scale labels. */ - overlappingBehavior?: { - /** Specifies whether or not to expand the current major tick interval if labels overlap each other. */ - useAutoArrangement?: boolean; - /** Specifies what label to hide in case of overlapping. */ - hideFirstOrLast?: string; - }; - /** Specifies font options for the text displayed in the scale labels of the gauge. */ - font?: viz.core.Font; - /** Specifies a format for the text displayed in scale labels. */ - format?: string; - /** Specifies a precision for the formatted value displayed in the scale labels. */ - precision?: number; - /** Specifies whether or not scale labels are visible on the gauge. */ - visible?: boolean; - } - export interface BaseScale { - /** Specifies the end value for the scale of the gauge. */ - endValue?: number; - /** - * Specifies whether or not to hide the first scale label. - * @deprecated This feature is no longer available. - */ - hideFirstLabel?: boolean; - /** - * Specifies whether or not to hide the first major tick on the scale. - * @deprecated This feature is no longer available. - */ - hideFirstTick?: boolean; - /** - * Specifies whether or not to hide the last scale label. - * @deprecated This feature is no longer available. - */ - hideLastLabel?: boolean; - /** - * Specifies whether or not to hide the last major tick on the scale. - * @deprecated This feature is no longer available. - */ - hideLastTick?: boolean; - /** Specifies an interval between major ticks. */ - tickInterval?: number; - /** Specifies an interval between minor ticks. */ - minorTickInterval?: number; - /** Specifies an array of custom major ticks. */ - customTicks?: Array; - /** Specifies an array of custom minor ticks. */ - customMinorTicks?: Array; - /** Specifies common options for scale labels. */ - label?: BaseScaleLabel; - /** - * Specifies options of the gauge's major ticks. - * @deprecated Use the tick option instead. - */ - majorTick?: ScaleMajorTick; - /** Specifies options of the gauge's major ticks. */ - tick?: { - /** Specifies the color of the scale's major ticks. */ - color?: string; - /** Specifies the length of the scale's major ticks. */ - length?: number; - /** Indicates whether scale major ticks are visible or not. */ - visible?: boolean; - /** Specifies the width of the scale's major ticks. */ - width?: number; - /** Specifies the opacity of the scale's major ticks. */ - opacity?: number; - }; - /** Specifies options of the gauge's minor ticks. */ - minorTick?: ScaleMinorTick; - /** Specifies the start value for the scale of the gauge. */ - startValue?: number; - } - export interface BaseValueIndicator { - /** Specifies the type of subvalue indicators. */ - type?: string; - /** Specifies the background color for the indicator of the rangeBar type. */ - backgroundColor?: string; - /** Specifies the base value for the indicator of the rangeBar type. */ - baseValue?: number; - /** Specifies a color of the indicator. */ - color?: string; - /** Specifies the range bar size for an indicator of the rangeBar type. */ - size?: number; - text?: { - /** Specifies a callback function that returns the text to be displayed in an indicator. */ - customizeText?: (indicatedValue: { value: number; valueText: string }) => string; - font?: viz.core.Font; - /** Specifies a format for the text displayed in an indicator. */ - format?: string; - /** Specifies the range bar's label indent in pixels. */ - indent?: number; - /** Specifies a precision for the formatted value displayed by an indicator. */ - precision?: number; - }; - offset?: number; - length?: number; - width?: number; - /** Specifies the length of an arrow for the indicator of the textCloud type in pixels. */ - arrowLength?: number; - /** Sets the array of colors to be used for coloring subvalue indicators. */ - palette?: Array; - /** Specifies the distance between the needle and the center of a gauge for the indicator of a needle-like type. */ - indentFromCenter?: number; - /** Specifies the second color for the indicator of the twoColorNeedle type. */ - secondColor?: string; - /** Specifies the length of a twoNeedleColor type indicator tip as a percentage. */ - secondFraction?: number; - /** Specifies the spindle's diameter in pixels for the indicator of a needle-like type. */ - spindleSize?: number; - /** Specifies the inner diameter in pixels, so that the spindle has the shape of a ring. */ - spindleGapSize?: number; - /** Specifies the orientation of the rangeBar indicator on a vertically oriented dxLinearGauge widget. */ - horizontalOrientation?: string; - /** Specifies the orientation of the rangeBar indicator on a horizontally oriented dxLinearGauge widget. */ - verticalOrientation?: string; - } - export interface SharedGaugeOptions { - /** Specifies animation options. */ - animation?: viz.core.Animation; - /** Specifies the appearance of the loading indicator. */ - loadingIndicator?: viz.core.LoadingIndicator; - /** Specifies whether to redraw the widget when the size of the parent browser window changes or a mobile device rotates. */ - redrawOnResize?: boolean; - /** Specifies the size of the widget in pixels. */ - size?: viz.core.Size; - /** - * Specifies a subtitle for the widget. - * @deprecated Use the title | subtitle option instead. - */ - subtitle?: { - /** - * Specifies font options for the subtitle. - * @deprecated Use the title | subtitle | font option instead. - */ - font?: viz.core.Font; - /** - * Specifies a text for the subtitle. - * @deprecated Use the title | subtitle | text option instead. - */ - text?: string; - }; - /** Specifies a title for a gauge. */ - title?: { - /** Specifies font options for the title. */ - font?: viz.core.Font; - /** - * Specifies a title's position on the gauge. - * @deprecated Use the horizontalAlignment and verticalAlignment options instead. - */ - position?: string; - /** Specifies the distance between the title and surrounding gauge elements in pixels. */ - margin?: viz.core.Margins; - /** Specifies the height of the space reserved for the title. */ - placeholderSize?: number; - /** Specifies the gauge title's position in the vertical direction. */ - verticalAlignment?: string; - /** Specifies the gauge title's horizontal position. */ - horizontalAlignment?: string; - /** Specifies text for the title. */ - text?: string; - /** Specifies a subtitle for the widget. */ - subtitle?: { - /** Specifies font options for the subtitle. */ - font?: viz.core.Font; - /** Specifies text for the subtitle. */ - text?: string; - } - }; - /** Specifies options for gauge tooltips. */ - tooltip?: viz.core.Tooltip; - /** A handler for the tooltipShown event. */ - onTooltipShown?: (e: { - component: dxBaseGauge; - element: Element; - target: {}; - }) => void; - /** A handler for the tooltipHidden event. */ - onTooltipHidden?: (e: { - component: dxBaseGauge; - element: Element; - target: {}; - }) => void; - } - export interface BaseGaugeOptions extends viz.core.BaseWidgetOptions, SharedGaugeOptions { - /** Specifies the color of the parent page element. */ - containerBackgroundColor?: string; - /** Specifies the blank space in pixels between the widget's extreme elements and the boundaries of the area provided for the widget (see the size option). */ - margin?: viz.core.Margins; - /** Specifies options of the gauge's range container. */ - rangeContainer?: BaseRangeContainer; - /** Specifies a gauge's scale options. */ - scale?: BaseScale; - /** Specifies the appearance options of subvalue indicators. */ - subvalueIndicator?: BaseValueIndicator; - /** Specifies a set of subvalues to be designated by the subvalue indicators. */ - subvalues?: Array; - /** Specifies the main value on a gauge. */ - value?: number; - /** Specifies the appearance options of the value indicator. */ - valueIndicator?: BaseValueIndicator; - } - /** A gauge widget. */ - export class dxBaseGauge extends viz.core.BaseWidget { - /** Displays the loading indicator. */ - showLoadingIndicator(): void; - /** Conceals the loading indicator. */ - hideLoadingIndicator(): void; - /** Redraws a widget. */ - render(): void; - /** Returns the main gauge value. */ - value(): number; - /** Updates a gauge value. */ - value(value: number): void; - /** Returns an array of gauge subvalues. */ - subvalues(): Array; - /** Updates gauge subvalues. */ - subvalues(subvalues: Array): void; - } - export interface LinearRangeContainer extends BaseRangeContainer { - /** Specifies the orientation of the range container on a vertically oriented dxLinearGauge widget. */ - horizontalOrientation?: string; - /** Specifies the orientation of a range container on a horizontally oriented dxLinearGauge widget. */ - verticalOrientation?: string; - /** Specifies the width of the range container's start and end boundaries in the dxLinearGauge widget. */ - width?: any; - /** Specifies an end width of a range container. */ - end?: number; - /** Specifies a start width of a range container. */ - start?: number; - } - export interface LinearScaleLabel extends BaseScaleLabel { - /** Specifies the spacing between scale labels and ticks. */ - indentFromTick?: number; - } - export interface LinearScale extends BaseScale { - /** Specifies the orientation of scale ticks on a vertically oriented dxLinearGauge widget. */ - horizontalOrientation?: string; - label?: LinearScaleLabel; - /** Specifies the orientation of scale ticks on a horizontally oriented dxLinearGauge widget. */ - verticalOrientation?: string; - } - export interface dxLinearGaugeOptions extends BaseGaugeOptions { - /** Specifies the options required to set the geometry of the dxLinearGauge widget. */ - geometry?: { - /** Indicates whether to display the dxLinearGauge widget vertically or horizontally. */ - orientation?: string; - }; - /** Specifies gauge range container options. */ - rangeContainer?: LinearRangeContainer; - scale?: LinearScale; - } - /** A widget that represents a gauge with a linear scale. */ - export class dxLinearGauge extends dxBaseGauge { - constructor(element: JQuery, options?: dxLinearGaugeOptions); - constructor(element: Element, options?: dxLinearGaugeOptions); - } - export interface CircularRangeContainer extends BaseRangeContainer { - /** Specifies the orientation of the range container in the dxCircularGauge widget. */ - orientation?: string; - /** Specifies the range container's width in pixels. */ - width?: number; - } - export interface CircularScaleLabel extends BaseScaleLabel { - /** Specifies the spacing between scale labels and ticks. */ - indentFromTick?: number; - } - export interface CircularScale extends BaseScale { - label?: CircularScaleLabel; - /** Specifies the orientation of scale ticks. */ - orientation?: string; - } - export interface dxCircularGaugeOptions extends BaseGaugeOptions { - /** Specifies the options required to set the geometry of the dxCircularGauge widget. */ - geometry?: { - /** Specifies the end angle of the circular gauge's arc. */ - endAngle?: number; - /** Specifies the start angle of the circular gauge's arc. */ - startAngle?: number; - }; - /** Specifies gauge range container options. */ - rangeContainer?: CircularRangeContainer; - scale?: CircularScale; - } - /** A widget that represents a gauge with a circular scale. */ - export class dxCircularGauge extends dxBaseGauge { - constructor(element: JQuery, options?: dxCircularGaugeOptions); - constructor(element: Element, options?: dxCircularGaugeOptions); - } - export interface dxBarGaugeOptions extends viz.core.BaseWidgetOptions, SharedGaugeOptions { - /** Specifies a color for the remaining segment of the bar's track. */ - backgroundColor?: string; - /** Specifies a distance between bars in pixels. */ - barSpacing?: number; - /** Specifies a base value for bars. */ - baseValue?: number; - /** Specifies an end value for the gauge's invisible scale. */ - endValue?: number; - /** Defines the shape of the gauge's arc. */ - geometry?: { - /** Specifies the end angle of the bar gauge's arc. */ - endAngle?: number; - /** Specifies the start angle of the bar gauge's arc. */ - startAngle?: number; - }; - /** Specifies the options of the labels that accompany gauge bars. */ - label?: { - /** Specifies a color for the label connector text. */ - connectorColor?: string; - /** Specifies the width of the label connector in pixels. */ - connectorWidth?: number; - /** Specifies a callback function that returns a text for labels. */ - customizeText?: (barValue: { value: number; valueText: string }) => string; - /** Specifies font options for bar labels. */ - font?: viz.core.Font; - /** Specifies a format for bar labels. */ - format?: string; - /** Specifies the distance between the upper bar and bar labels in pixels. */ - indent?: number; - /** Specifies a precision for the formatted value displayed by labels. */ - precision?: number; - /** Specifies whether bar labels appear on a gauge or not. */ - visible?: boolean; - }; - /** Sets the name of the palette or an array of colors to be used for coloring the gauge range container. */ - palette?: any; - /** 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 a title for the range selector. */ - title?: viz.core.Title; - /** Specifies the dxRangeSelector's behavior options. */ - behavior?: { - /** Indicates whether or not you can swap sliders. */ - allowSlidersSwap?: boolean; - /** Indicates whether or not animation is enabled. */ - animationEnabled?: boolean; - /** Specifies when to call the onSelectedRangeChanged function. */ - callSelectedRangeChanged?: string; - /** Indicates whether or not an end user can specify the range using a mouse, without the use of sliders. */ - manualRangeSelectionEnabled?: boolean; - /** Indicates whether or not an end user can shift the selected range to the required location on a scale by clicking. */ - moveSelectedRangeByClick?: boolean; - /** Indicates whether to snap a slider to ticks. */ - snapToTicks?: boolean; - }; - /** Specifies the options required to display a chart as the range selector's background. */ - chart?: { - /** Specifies a coefficient for determining an indent from the bottom background boundary to the lowest chart point. */ - bottomIndent?: number; - /** An object defining the common configuration options for the chart’s series. */ - commonSeriesSettings?: viz.charts.CommonSeriesSettings; - /** An object providing options for managing data from a data source. */ - dataPrepareSettings?: { - /** Specifies whether or not to validate values from a data source. */ - checkTypeForAllData?: boolean; - /** Specifies whether or not to convert the values from a data source into the data type of an axis. */ - convertToAxisDataType?: boolean; - /** Specifies how to sort series points. */ - sortingMethod?: any; - }; - /** Specifies whether all bars in a series must have the same width, or may have different widths if any points in other series are missing. */ - equalBarWidth?: boolean; - /** Specifies a common bar width as a percentage from 0 to 1. */ - barWidth?: number; - /** Forces the widget to treat negative values as zeroes. Applies to stacked-like series only. */ - negativesAsZeroes?: boolean; - /** Sets the name of the palette to be used in the range selector's chart. Alternatively, an array of colors can be set as a custom palette to be used within this chart. */ - palette?: any; - /** An object defining the chart’s series. */ - series?: Array; - /** Defines options for the series template. */ - seriesTemplate?: viz.charts.SeriesTemplate; - /** Specifies a coefficient for determining an indent from the background's top boundary to the topmost chart point. */ - topIndent?: number; - /** Specifies whether or not to filter the series points depending on their quantity. */ - useAggregation?: boolean; - /** Specifies options for the chart's value axis. */ - valueAxis?: { - /** Indicates whether or not the chart's value axis must be inverted. */ - inverted?: boolean; - /** Specifies the value to be raised to a power when generating ticks for a logarithmic value axis. */ - logarithmBase?: number; - /** Specifies the maximum value of the chart's value axis. */ - max?: number; - /** Specifies the minimum value of the chart's value axis. */ - min?: number; - /** Specifies the type of the value axis. */ - type?: string; - /** Specifies the desired type of axis values. */ - valueType?: string; - }; - }; - /** Specifies the color of the parent page element. */ - containerBackgroundColor?: string; - /** Specifies a data source for the scale values and for the chart at the background. */ - dataSource?: any; - /** Specifies the data source field that provides data for the scale. */ - dataSourceField?: string; - /** Specifies the appearance of the loading indicator. */ - loadingIndicator?: viz.core.LoadingIndicator; - /** Specifies the blank space in pixels between the dxRangeSelector widget's extreme elements and the boundaries of the area provided for the widget (see size). */ - margin?: viz.core.Margins; - /** Specifies whether to redraw the widget when the size of the parent browser window changes or a mobile device rotates. */ - redrawOnResize?: boolean; - /** Specifies options of the range selector's scale. */ - scale?: { - /** Specifies the scale's end value. */ - endValue?: any; - /** Specifies common options for scale labels. */ - label?: { - /** Specifies a callback function that returns the text to be displayed in scale labels. */ - customizeText?: (scaleValue: { value: any; valueText: string; }) => string; - /** Specifies font options for the text displayed in the range selector's scale labels. */ - font?: viz.core.Font; - /** Specifies a format for the text displayed in scale labels. */ - format?: string; - /** Specifies a precision for the formatted value displayed in the scale labels. */ - precision?: number; - /** Specifies a spacing between scale labels and the background bottom edge. */ - topIndent?: number; - /** Specifies whether or not the scale's labels are visible. */ - visible?: boolean; - }; - /** Specifies the value to be raised to a power when generating ticks for a logarithmic scale. */ - logarithmBase?: number; - /** - * Specifies an interval between major ticks. - * @deprecated Use the tickInterval option instead. - */ - majorTickInterval?: any; - /** Specifies an interval between axis ticks. */ - tickInterval?: any; - /** Specifies options for the date-time scale's markers. */ - marker?: { - /** Defines the options that can be set for the text that is displayed by the scale markers. */ - label?: { - /** Specifies a callback function that returns the text to be displayed in scale markers. */ - customizeText?: (markerValue: { value: any; valueText: string }) => string; - /** Specifies a format for the text displayed in scale markers. */ - format?: string; - }; - /** Specifies the height of the marker's separator. */ - separatorHeight?: number; - /** Specifies the space between the marker label and the marker separator. */ - textLeftIndent?: number; - /** Specifies the space between the marker's label and the top edge of the marker's separator. */ - textTopIndent?: number; - /** Specified the indent between the marker and the scale lables. */ - topIndent?: number; - /** Indicates whether scale markers are visible. */ - visible?: boolean; - }; - /** Specifies the maximum range that can be selected. */ - maxRange?: any; - /** Specifies the number of minor ticks between neighboring major ticks. */ - minorTickCount?: number; - /** Specifies an interval between minor ticks. */ - minorTickInterval?: any; - /** Specifies the minimum range that can be selected. */ - minRange?: any; - /** Specifies the height of the space reserved for the scale in pixels. */ - placeholderHeight?: number; - /** Indicates whether or not to set ticks of a date-time scale at the beginning of each date-time interval. */ - setTicksAtUnitBeginning?: boolean; - /** Specifies whether or not to show ticks for the boundary scale values, when neither major ticks nor minor ticks are created for these values. */ - showCustomBoundaryTicks?: boolean; - /** - * Indicates whether or not to show minor ticks on the scale. - * @deprecated Use the minorTick | visible option instead. - */ - showMinorTicks?: boolean; - /** Specifies the scale's start value. */ - startValue?: any; - /** Specifies options defining the appearance of scale ticks. */ - tick?: { - /** Specifies the color of scale ticks (both major and minor ticks). */ - color?: string; - /** Specifies the opacity of scale ticks (both major and minor ticks). */ - opacity?: number; - /** Specifies the width of the scale's ticks (both major and minor ticks). */ - width?: number; - }; - /** Specifies options of the range selector's minor ticks. */ - minorTick?: { - /** Specifies the color of the scale's minor ticks. */ - color?: string; - /** Specifies the opacity of the scale's minor ticks. */ - opacity?: number; - /** Specifies the width of the scale's minor ticks. */ - width?: number; - /** Indicates whether scale minor ticks are visible or not. */ - visible?: boolean; - }; - /** Specifies the type of the scale. */ - type?: string; - /** Specifies whether or not to expand the current tick interval if labels overlap each other. */ - useTicksAutoArrangement?: boolean; - /** Specifies the type of values on the scale. */ - valueType?: string; - /** Specifies the order of arguments on a discrete scale. */ - categories?: Array; - }; - /** Specifies the range to be selected when displaying the dxRangeSelector. */ - selectedRange?: { - /** Specifies the start value of the range to be selected when displaying the dxRangeSelector widget on a page. */ - startValue?: any; - /** Specifies the end value of the range to be selected when displaying the dxRangeSelector widget on a page. */ - endValue?: any; - }; - /** Specifies the color of the selected range. */ - selectedRangeColor?: string; - /** Range selector's indent options. */ - indent?: { - /** Specifies range selector's left indent. */ - left?: number; - /** Specifies range selector's right indent. */ - right?: number; - }; - /** A handler for the selectedRangeChanged event. */ - onSelectedRangeChanged?: (e: { - startValue: any; - endValue: any; - component: dxRangeSelector; - element: Element; - }) => void; - /** Specifies range selector shutter options. */ - shutter?: { - /** Specifies shutter color. */ - color?: string; - /** Specifies the opacity of the color of shutters. */ - opacity?: number; - }; - /** Specifies in pixels the size of the dxRangeSelector widget. */ - size?: viz.core.Size; - /** Specifies the appearance of the range selector's slider handles. */ - sliderHandle?: { - /** Specifies the color of the slider handles. */ - color?: string; - /** Specifies the opacity of the slider handles. */ - opacity?: number; - /** Specifies the width of the slider handles. */ - width?: number; - }; - /** Defines the options of the range selector slider markers. */ - sliderMarker?: { - /** Specifies the color of the slider markers. */ - color?: string; - /** Specifies a callback function that returns the text to be displayed by slider markers. */ - customizeText?: (scaleValue: { value: any; valueText: any; }) => string; - /** Specifies font options for the text displayed by the range selector slider markers. */ - font?: viz.core.Font; - /** Specifies a format for the text displayed in slider markers. */ - format?: string; - /** Specifies the color used for the slider marker text when the currently selected range does not match the minRange and maxRange values. */ - invalidRangeColor?: string; - /** - * Specifies the empty space between the marker's border and the marker’s text. - * @deprecated Use the paddingTopBottom and paddingLeftRight options instead. - */ - padding?: number; - /** Specifies the empty space between the marker's top and bottom borders and the marker's text. */ - paddingTopBottom?: number; - /** Specifies the empty space between the marker's left and right borders and the marker's text. */ - paddingLeftRight?: number; - /** Specifies the placeholder height of the slider marker. */ - placeholderHeight?: number; - /** - * Specifies in pixels the height and width of the space reserved for the range selector slider markers. - * @deprecated Use the placeholderHeight and indent options instead. - */ - placeholderSize?: { - /** Specifies the height of the placeholder for the left and right slider markers. */ - height?: number; - /** Specifies the width of the placeholder for the left and right slider markers. */ - width?: { - /** Specifies the width of the left slider marker's placeholder. */ - left?: number; - /** Specifies the width of the right slider marker's placeholder. */ - right?: number; - }; - }; - /** Specifies a precision for the formatted value displayed in slider markers. */ - precision?: number; - /** Indicates whether or not the slider markers are visible. */ - visible?: boolean; - }; - } - /** A widget that allows end users to select a range of values on a scale. */ - export class dxRangeSelector extends viz.core.BaseWidget { - constructor(element: JQuery, options?: dxRangeSelectorOptions); - constructor(element: Element, options?: dxRangeSelectorOptions); - /** Displays the loading indicator. */ - showLoadingIndicator(): void; - /** Conceals the loading indicator. */ - hideLoadingIndicator(): void; - /** Redraws a widget. */ - render(skipChartAnimation?: boolean): void; - /** Returns the currently selected range. */ - getSelectedRange(): { startValue: any; endValue: any; }; - /** Sets a specified range. */ - setSelectedRange(selectedRange: { startValue: any; endValue: any; }): void; - } -} -interface JQuery { - dxRangeSelector(options?: DevExpress.viz.rangeSelector.dxRangeSelectorOptions): JQuery; - dxRangeSelector(methodName: string, ...params: any[]): any; - dxRangeSelector(methodName: "instance"): DevExpress.viz.rangeSelector.dxRangeSelector; -} -declare module DevExpress.viz.map { - /** This section describes the fields and methods that can be used in code to manipulate the Layer object. */ - export interface MapLayer { - /** The name of the layer. */ - name: string; - /** The layer index in the layers array. */ - index: number; - /** The layer type. Can be "area", "line" or "marker". */ - type: string; - /** The type of the layer elements. */ - elementType: string; - /** Gets all layer elements. */ - getElements(): Array; - /** Deselects all layer elements. */ - clearSelection(): void; - } - /** This section describes the fields and methods that can be used in code to manipulate the Layer Element object. */ - export interface MapLayerElement { - /** The parent layer of the layer element. */ - layer: MapLayer; - /** Gets the layer element coordinates. */ - coordinates(): Object; - /** Sets the value of an attribute. */ - attribute(name: string, value: any): void; - /** Gets the value of an attribute. */ - attribute(name: string): any; - /** Gets the selection state of the layer element. */ - selected(): boolean; - /** Sets the selection state of the layer element. */ - selected(state: boolean): void; - /** Applies the layer element settings and updates element appearance. */ - applySettings(settings: any): void; - } - /** - * This section describes the fields and methods that can be used in code to manipulate the Area object. - * @deprecated Use the Layer Element instead. - */ - export interface Area { - /** - * Contains the element type. - * @deprecated Use the Layer | type instead. - */ - type: string; - /** - * Return the value of an attribute. - * @deprecated Use the Layer Element | attribute(name, value) method instead. - */ - attribute(name: string): any; - /** - * Provides information about the selection state of an area. - * @deprecated Use the Layer Element | selected() method instead. - */ - selected(): boolean; - /** - * Sets a new selection state for an area. - * @deprecated Use the Layer Element | selected(state) method instead. - */ - selected(state: boolean): void; - /** - * Applies the area settings specified as a parameter and updates the area appearance. - * @deprecated Use the Layer Element | applySettings(settings) method instead. - */ - applySettings(settings: any): void; - } - /** - * This section describes the fields and methods that can be used in code to manipulate the Markers object. - * @deprecated Use the Layer Element instead. - */ - export interface Marker { - /** - * Contains the descriptive text accompanying the map marker. - * @deprecated Get the text using the Layer Element | attribute(name) method. The name parameter value for text is set at the dataField option. - */ - text: string; - /** - * Contains the type of the element. - * @deprecated Use the Layer | type instead. - */ - type: string; - /** - * Contains the URL of an image map marker. - * @deprecated Get the image URL using the Layer Element | attribute(name) method. The name parameter value for the image URL is set at the dataField option. - */ - url: string; - /** - * Contains the value of a bubble map marker. - * @deprecated Get the bubble value using the Layer Element | attribute(name) method. The name parameter for the bubble value is set at the dataField option. - */ - value: number; - /** - * Contains the values of a pie map marker. - * @deprecated Get the pie values using the Layer Element | attribute(name) method. The name parameter for pie values is set at the dataField option. - */ - values: Array; - /** - * Returns the value of an attribute. - * @deprecated Use the Layer Element | attribute(name, value) method instead. - */ - attribute(name: string): any; - /** - * Returns the coordinates of a specific marker. - * @deprecated Use the Layer Element | coordinates() method instead. - */ - coordinates(): Array; - /** - * Provides information about the selection state of a marker. - * @deprecated Use the Layer Element | selected() method instead. - */ - selected(): boolean; - /** - * Sets a new selection state for a marker. - * @deprecated Use the Layer Element | selected(state) method instead. - */ - selected(state: boolean): void; - /** - * Applies the marker settings specified as a parameter and updates marker appearance. - * @deprecated Use the Layer Element | applySettings(settings) method instead. - */ - applySettings(settings: any): void; - } - export interface MapLayerSettings { - /** Specifies the layer name. */ - name?: string; - /** Specifies layer type. */ - type?: string; - /** Specifies the type of a marker element. Setting this option makes sense only if the layer type is "marker". */ - elementType?: string; - /** Specifies a data source for the layer. */ - dataSource?: any; - /** Specifies the line width (for layers of a line type) or width of the layer elements border in pixels. */ - borderWidth?: number; - /** Specifies a color for the border of the layer elements. */ - borderColor?: string; - /** Specifies a color for layer elements. */ - color?: string; - /** Specifies a color for the border of the layer element when it is hovered over. */ - hoveredBorderColor?: string; - /** Specifies the pixel-measured line width (for layers of a line type) or width for the border of the layer element when it is hovered over. */ - hoveredBorderWidth?: number; - /** Specifies a color for a layer element when it is hovered over. */ - hoveredColor?: string; - /** Specifies a pixel-measured line width (for layers of a line type) or width for the border of the layer element when it is selected. */ - selectedBorderWidth?: number; - /** Specifies a color for the border of the layer element when it is selected. */ - selectedBorderColor?: string; - /** Specifies a color for the layer element when it is selected. */ - selectedColor?: string; - /** Specifies the layer opacity (from 0 to 1). */ - opacity?: number; - /** Specifies the size of markers. Setting this option makes sense only if the layer type is "marker" and the elementType is "dot", "pie" or "image". */ - size?: number; - /** Specifies the pixel-measured diameter of the marker that represents the smallest value. Setting this option makes sense only if the layer type is "marker". */ - minSize?: number; - /** Specifies the pixel-measured diameter of the marker that represents the biggest value. Setting this option makes sense only if the layer type is "marker". */ - maxSize?: number; - /** Specifies whether or not to change the appearance of a layer element when it is hovered over. */ - hoverEnabled?: boolean; - /** Specifies whether single or multiple map elements can be selected on a vector map. */ - selectionMode?: string; - /** Specifies the name of the palette or a custom range of colors to be used for coloring a layer. */ - palette?: any; - /** Specifies the number of colors in a palette. */ - paletteSize?: number; - /** Allows you to paint layer elements with similar attributes in the same color. */ - colorGroups?: Array; - /** Specifies the field that provides data to be used for coloring of layer elements. */ - colorGroupingField?: string; - /** Allows you to display bubbles with similar attributes in the same size. Setting this option makes sense only if the layer type is "marker" and the elementType is "bubble". */ - sizeGroups?: Array; - /** Specifies the field that provides data to be used for sizing bubble markers. Setting this option makes sense only if the layer type is "marker" and the elementType is "bubble". */ - sizeGroupingField?: string; - /** Specifies the name of the attribute containing marker data. Setting this option makes sense only if the layer type is "marker" and the elementType is "bubble", "pie" or "image". */ - dataField?: string; - /** Specifies the function that customizes each layer element individually. */ - customize?: (eleemnts: Array) => void; - /** Specifies marker label options. */ - label?: { - /** The name of the dataSource attribute containing marker texts. */ - dataField?: string; - /** Enables marker labels. */ - enabled?: boolean; - /** Specifies font options for marker labels. */ - font?: viz.core.Font; - }; - } - export interface AreaSettings { - /** - * Specifies the width of the area border in pixels. - * @deprecated Use the layers | borderWidth option instead. - */ - borderWidth?: number; - /** - * Specifies a color for the area border. - * @deprecated Use the layers | borderColor option instead. - */ - borderColor?: string; - /** - * Specifies a color for an area. - * @deprecated Use the layers | color option instead. - */ - color?: string; - /** - * Specifies the function that customizes each area individually. - * @deprecated Use the layers | customize option instead. - */ - customize?: (areaInfo: Area) => AreaSettings; - /** - * Specifies a color for the area border when the area is hovered over. - * @deprecated Use the layers | hoveredBorderColor option instead. - */ - hoveredBorderColor?: string; - /** - * Specifies the pixel-measured width of the area border when the area is hovered over. - * @deprecated Use the layers | hoveredBorderWidth option instead. - */ - hoveredBorderWidth?: number; - /** - * Specifies a color for an area when this area is hovered over. - * @deprecated Use the layers | hoveredColor option instead. - */ - hoveredColor?: string; - /** - * Specifies whether or not to change the appearance of an area when it is hovered over. - * @deprecated Use the layers | hoverEnabled option instead. - */ - hoverEnabled?: boolean; - /** - * Configures area labels. - * @deprecated Use the layers | label option instead. - */ - label?: { - /** - * Specifies the data field that provides data for area labels. - * @deprecated Use the layers | label | dataField option instead. - */ - dataField?: string; - /** - * Enables area labels. - * @deprecated Use the layers | label | enabled option instead. - */ - enabled?: boolean; - /** - * Specifies font options for area labels. - * @deprecated Use the layers | label | font option instead. - */ - font?: viz.core.Font; - }; - /** - * Specifies the name of the palette or a custom range of colors to be used for coloring a map. - * @deprecated Use the layers | palette option instead. - */ - palette?: any; - /** - * Specifies the number of colors in a palette. - * @deprecated Use the layers | paletteSize option instead. - */ - paletteSize?: number; - /** - * Allows you to paint areas with similar attributes in the same color. - * @deprecated Use the layers | colorGroups option instead. - */ - colorGroups?: Array; - /** - * Specifies the field that provides data to be used for coloring areas. - * @deprecated Use the layers | colorGroupingField option instead. - */ - colorGroupingField?: string; - /** - * Specifies a color for the area border when the area is selected. - * @deprecated Use the layers | selectedBorderColor option instead. - */ - selectedBorderColor?: string; - /** - * Specifies a color for an area when this area is selected. - * @deprecated Use the layers | selectedColor option instead. - */ - selectedColor?: string; - /** - * Specifies the pixel-measured width of the area border when the area is selected. - * @deprecated Use the layers | selectedBorderWidth option instead. - */ - selectedBorderWidth?: number; - /** - * Specifies whether single or multiple areas can be selected on a vector map. - * @deprecated Use the layers | selectionMode option instead. - */ - selectionMode?: string; - } - export interface MarkerSettings { - /** - * Specifies a color for the marker border. - * @deprecated Use the layers | borderColor option instead. - */ - borderColor?: string; - /** - * Specifies the width of the marker border in pixels. - * @deprecated Use the layers | borderWidth option instead. - */ - borderWidth?: number; - /** - * Specifies a color for a marker of the dot or bubble type. - * @deprecated Use the layers | color option instead. - */ - color?: string; - /** - * Specifies the function that customizes each marker individually. - * @deprecated Use the layers | customize option instead. - */ - customize?: (markerInfo: Marker) => MarkerSettings; - /** - * Specifies the pixel-measured width of the marker border when the marker is hovered over. - * @deprecated Use the layers | hoveredBorderWidth option instead. - */ - hoveredBorderWidth?: number; - /** - * Specifies a color for the marker border when the marker is hovered over. - * @deprecated Use the layers | hoveredBorderColor option instead. - */ - hoveredBorderColor?: string; - /** - * Specifies a color for a marker of the dot or bubble type when this marker is hovered over. - * @deprecated Use the layers | hoveredColor option instead. - */ - hoveredColor?: string; - /** - * Specifies whether or not to change the appearance of a marker when it is hovered over. - * @deprecated Use the layers | hoverEnabled option instead. - */ - hoverEnabled?: boolean; - /** - * Specifies marker label options. - * @deprecated Use the layers | label option instead. - */ - label?: { - /** - * Enables marker labels. - * @deprecated Use the layers | label | enabled option instead. - */ - enabled?: boolean; - /** - * Specifies font options for marker labels. - * @deprecated Use the layers | label | font option instead. - */ - 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 Use the layers | maxSize option instead. - */ - 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 Use the layers | minSize option instead. - */ - minSize?: number; - /** - * Specifies the opacity of markers. Setting this option makes sense only if you use markers of the bubble type. - * @deprecated Use the layers | opacity option instead. - */ - opacity?: number; - /** - * Specifies the pixel-measured width of the marker border when the marker is selected. - * @deprecated Use the layers | selectedBorderWidth option instead. - */ - selectedBorderWidth?: number; - /** - * Specifies a color for the marker border when the marker is selected. - * @deprecated Use the layers | selectedBorderColor option instead. - */ - selectedBorderColor?: string; - /** - * Specifies a color for a marker of the dot or bubble type when this marker is selected. - * @deprecated Use the layers | selectedColor option instead. - */ - selectedColor?: string; - /** - * Specifies whether a single or multiple markers can be selected on a vector map. - * @deprecated Use the layers | selectionMode option instead. - */ - selectionMode?: string; - /** - * Specifies the size of markers. Setting this option makes sense for any type of marker except bubble. - * @deprecated Use the layers | size option instead. - */ - size?: number; - /** - * Specifies the type of markers to be used on the map. - * @deprecated Use the layers | elementType option instead. - */ - 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 Use the layers | palette option instead. - */ - palette?: any; - /** - * Allows you to paint markers with similar attributes in the same color. - * @deprecated Use the layers | colorGroups option instead. - */ - colorGroups?: Array; - /** - * Specifies the field that provides data to be used for coloring markers. - * @deprecated Use the layers | colorGroupingField option instead. - */ - colorGroupingField?: string; - /** - * Allows you to display bubbles with similar attributes in the same size. - * @deprecated Use the layers | sizeGroups option instead. - */ - sizeGroups?: Array; - /** - * Specifies the field that provides data to be used for sizing bubble markers. - * @deprecated Use the layers | sizeGroupingField option instead. - */ - sizeGroupingField?: string; - } - export interface dxVectorMapOptions extends viz.core.BaseWidgetOptions { - /** - * An object specifying options for the map areas. - * @deprecated Use the "area" type element of the layers array. - */ - areaSettings?: AreaSettings; - /** Specifies the options for the map background. */ - background?: { - /** Specifies a color for the background border. */ - borderColor?: string; - /** Specifies a color for the background. */ - color?: string; - }; - /** Specifies options for dxVectorMap widget layers. */ - layers?: Array; - /** Specifies the map projection. */ - projection?: Object; - /** Specifies the positioning of a map in geographical coordinates. */ - bounds?: Array; - /** Specifies the options of the control bar. */ - controlBar?: { - /** Specifies a color for the outline of the control bar elements. */ - borderColor?: string; - /** Specifies a color for the inner area of the control bar elements. */ - color?: string; - /** Specifies whether or not to display the control bar. */ - enabled?: boolean; - /** Specifies the margin of the control bar in pixels. */ - margin?: number; - /** Specifies the position of the control bar. */ - horizontalAlignment?: string; - /** Specifies the position of the control bar. */ - verticalAlignment?: string; - /** Specifies the opacity of the control bar. */ - opacity?: number; - }; - /** Specifies the appearance of the loading indicator. */ - loadingIndicator?: viz.core.LoadingIndicator; - /** - * Specifies a data source for the map area. - * @deprecated Use the layers | dataSource option instead. - */ - mapData?: any; - /** - * Specifies a data source for the map markers. - * @deprecated Use the layers | dataSource option instead. - */ - markers?: any; - /** - * An object specifying options for the map markers. - * @deprecated Use the "marker" type element of the layers array. - */ - markerSettings?: MarkerSettings; - /** Specifies the size of the dxVectorMap widget. */ - size?: viz.core.Size; - /** Specifies a title for the vector map. */ - title?: viz.core.Title; - /** Specifies tooltip options. */ - tooltip?: viz.core.Tooltip; - /** Configures map legends. */ - legends?: Array; - /** Specifies whether or not the map should respond when a user rolls the mouse wheel. */ - wheelEnabled?: boolean; - /** Specifies whether the map should respond to touch gestures. */ - touchEnabled?: boolean; - /** Disables the zooming capability. */ - zoomingEnabled?: boolean; - /** Specifies the geographical coordinates of the center for a map. */ - center?: Array; - /** A handler for the centerChanged event. */ - onCenterChanged?: (e: { - center: Array; - component: dxVectorMap; - element: Element; - }) => void; - /** A handler for the tooltipShown event. */ - onTooltipShown?: (e: { - component: dxVectorMap; - element: Element; - target: {}; - }) => void; - /** A handler for the tooltipHidden event. */ - onTooltipHidden?: (e: { - component: dxVectorMap; - element: Element; - target: {}; - }) => void; - /** Specifies a number that is used to zoom a map initially. */ - zoomFactor?: number; - /** Specifies a map's maximum zoom factor. */ - maxZoomFactor?: number; - /** A handler for the zoomFactorChanged event. */ - onZoomFactorChanged?: (e: { - component: dxVectorMap; - element: Element; - zoomFactor: number; - }) => void; - /** A handler for the click event. */ - onClick?: any; - /** A handler for the selectionChanged event. */ - onSelectionChanged?: (e: { - component: dxVectorMap; - element: Element; - target: MapLayerElement; - }) => void; - /** - * A handler for the areaClick event. - * @deprecated Use the onClick option instead. - */ - onAreaClick?: any; - /** - * A handler for the areaSelectionChanged event. - * @deprecated Use the onSelectionChanged option instead. - */ - onAreaSelectionChanged?: (e: { - target: Area; - component: dxVectorMap; - element: Element; - }) => void; - /** - * A handler for the markerClick event. - * @deprecated Use the onClick option instead. - */ - onMarkerClick?: any; - /** - * A handler for the markerSelectionChanged event. - * @deprecated Use the onSelecitonChanged option instead. - */ - onMarkerSelectionChanged?: (e: { - target: Marker; - component: dxVectorMap; - element: Element; - }) => void; - /** Disables the panning capability. */ - panningEnabled?: boolean; - } - export interface Legend extends viz.core.BaseLegend { - /** Specifies the color of item markers in the legend. The specified color applied only when the legend uses 'size' source. */ - markerColor?: string; - /** Specifies text for legend items. */ - customizeText?: (itemInfo: { start: number; end: number; index: number; color: string; size: number; }) => string; - /** Specifies text for a hint that appears when a user hovers the mouse pointer over the text of a legend item. */ - customizeHint?: (itemInfo: { start: number; end: number; index: number; color: string; size: number }) => string; - /** Specifies the source of data for the legend. */ - source?: { - /** Specifies a layer to which the legend belongs. */ - layer?: string; - /** Specifies the type of the legend grouping. */ - grouping?: string; - } - } - /** A vector map widget. */ - export class dxVectorMap extends viz.core.BaseWidget { - constructor(element: JQuery, options?: dxVectorMapOptions); - constructor(element: Element, options?: dxVectorMapOptions); - /** Displays the loading indicator. */ - showLoadingIndicator(): void; - /** Conceals the loading indicator. */ - hideLoadingIndicator(): void; - /** Redraws a widget. */ - render(): void; - /** Gets the current coordinates of the map center. */ - center(): Array; - /** Sets the coordinates of the map center. */ - center(centerCoordinates: Array): void; - /** - * Deselects all the selected areas on a map. The areas are displayed in their initial style after. - * @deprecated Use the layer's clearSelection() method instead. - */ - clearAreaSelection(): void; - /** - * Deselects all the selected markers on a map. The markers are displayed in their initial style after. - * @deprecated Use the layer's clearSelection() method instead. - */ - clearMarkerSelection(): void; - /** Deselects all the selected area and markers on a map at once. The areas and markers are displayed in their initial style after. */ - clearSelection(): void; - /** Converts client area coordinates into map coordinates. */ - convertCoordinates(x: number, y: number): Array; - /** Gets all map layers. */ - getLayers(): Array; - /** Gets the layer by its index. */ - getLayerByIndex(index: number): MapLayer; - /** Gets the layer by its name. */ - getLayerByName(name: string): MapLayer; - /** - * Returns an array with all the map areas. - * @deprecated Use the layer's getElements() method instead. - */ - getAreas(): Array; - /** - * Returns an array with all the map markers. - * @deprecated Use the layer's getElements() method instead. - */ - getMarkers(): Array; - /** Gets the current coordinates of the map viewport. */ - viewport(): Array; - /** Sets the coordinates of the map viewport. */ - viewport(viewportCoordinates: Array): void; - /** Gets the current value of the map zoom factor. */ - zoomFactor(): number; - /** Sets the value of the map zoom factor. */ - zoomFactor(zoomFactor: number): void; - } - export var projection: ProjectionCreator; - export interface ProjectionCreator { - /** Creates a new projection. */ - (data: { - to?: (coordinates: Array) => Array; - from?: (coordinates: Array) => Array; - aspectRatio?: number; - }): Object; - /** Gets the default or custom projection from the projection storage. */ - get(name: string): Object; - /** Adds a new projection to the internal projections storage. */ - add(name: string, projection: Object): void; - } -} -interface JQuery { - dxVectorMap(options?: DevExpress.viz.map.dxVectorMapOptions): JQuery; - dxVectorMap(methodName: string, ...params: any[]): any; - dxVectorMap(methodName: "instance"): DevExpress.viz.map.dxVectorMap; -} -declare 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 longer useful because the tooltips are aligned automatically. - */ - horizontalAlignment?: string; - /** - * Specifies how a tooltip is vertically aligned relative to the graph. - * @deprecated Tooltip alignment is no longer useful because the tooltips are aligned automatically. - */ - 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 BaseSparklineOptions { - /** 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?: any; - /** 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/v15/tsconfig.json b/devextreme/v15/tsconfig.json deleted file mode 100644 index 885e677c62..0000000000 --- a/devextreme/v15/tsconfig.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../../", - "typeRoots": [ - "../../" - ], - "types": [], - "paths": { - "devextreme": [ - "devextreme/v15" - ] - }, - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "devextreme-tests.ts" - ] -} \ No newline at end of file diff --git a/dhtmlxscheduler/index.d.ts b/dhtmlxscheduler/index.d.ts deleted file mode 100644 index 3f075861ab..0000000000 --- a/dhtmlxscheduler/index.d.ts +++ /dev/null @@ -1,1780 +0,0 @@ -// Type definitions for dhtmlxScheduler 4.3.0 -// Project: http://dhtmlx.com/docs/products/dhtmlxScheduler -// Definitions by: Maksim Kozhukh -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -interface SchedulerCallback { (...args: any[]): any } -interface SchedulerFilterCallback { (id: string | number, event: any): boolean } - -type SchedulerEventName = 'onAfterEventDisplay' | 'onAfterFolderToggle' | 'onAfterLightbox' | 'onAfterSchedulerResize' | 'onBeforeCollapse' | 'onBeforeDrag' | 'onBeforeEventChanged' | 'onBeforeEventCreated' | 'onBeforeEventDelete' | 'onBeforeEventDisplay' | 'onBeforeEventDragIn' | 'onBeforeEventDragOut' | 'onBeforeExpand' | 'onBeforeExternalDragIn' | 'onBeforeFolderToggle' | 'onBeforeLightbox' | 'onBeforeSectionRender' | 'onBeforeTodayDisplayed' | 'onBeforeTooltip' | 'onBeforeViewChange' | 'onCellClick' | 'onCellDblClick' | 'onClearAll' | 'onClick' | 'onCollapse' | 'onConfirmedBeforeEventDelete' | 'onContextMenu' | 'onDblClick' | 'onDragEnd' | 'onEmptyClick' | 'onEventAdded' | 'onEventCancel' | 'onEventChanged' | 'onEventCollision' | 'onEventCopied' | 'onEventCreated' | 'onEventCut' | 'onEventDeleted' | 'onEventDrag' | 'onEventDragIn' | 'onEventDragOut' | 'onEventDropOut' | 'onEventIdChange' | 'onEventLoading' | 'onEventPasted' | 'onEventSave' | 'onExpand' | 'onExternalDragIn' | 'onLightbox' | 'onLightboxButton' | 'onLimitViolation' | 'onLoadError' | 'onLocationError' | 'onMouseDown' | 'onMouseMove' | 'onOptionsLoad' | 'onOptionsLoadFinal' | 'onOptionsLoadStart' | 'onSaveError' | 'onScaleAdd' | 'onScaleDblClick' | 'onSchedulerReady' | 'onSchedulerResize' | 'onTemplatesReady' | 'onTimelineCreated' | 'onViewChange' | 'onViewMoreClick' | 'onXLE' | 'onXLS' | 'onXScaleClick' | 'onXScaleDblClick' | 'onYScaleClick' | 'onYScaleDblClick'; - -interface SchedulerTemplates { - /** - * specifies the date in the header of the view - * @param start the start date of the view - * @param end the end date of the view - */ - agenda_date(start: Date, end: Date): string; - - /** - * specifies the text in the second column of the Agenda view - * @param start the date when an event is scheduled to begin - * @param end the date when an event is scheduled to be completed - * @param event the event object - */ - agenda_text(start: Date, end: Date, event: any): string; - - /** - * specifies the date in the first column of the Agenda view - * @param start the date when an event is scheduled to begin - * @param end the date when an event is scheduled to be completed - * @param event the event object - */ - agenda_time(start: Date, end: Date, event: any): string; - - /** - * specifies the format of dates that are set by means of API methods. Used to parse incoming dates - * @param date the date which needs formatting - */ - api_date(date: Date): string; - - /** - * specifies the format of the date in a cell - * @param date the cell's date - */ - calendar_date(date: Date): string; - - /** - * specifies the date in the header of the calendar - * @param date the date which needs formatting - */ - calendar_month(date: Date): string; - - /** - * specifies the day name in the week sub-header of the view - * @param date the date which needs formatting - */ - calendar_scale_date(date: Date): string; - - /** - * specifies the date format of the lightbox's start and end date inputs - * @param date the date which needs formatting - */ - calendar_time(date: Date): string; - - /** - * specifies the date in the header of the Day and Units views - * @param date the date which needs formatting - */ - day_date(date: Date): string; - - /** - * specifies the date in the sub-header of the Day view - * @param date the date which needs formatting - */ - day_scale_date(date: Date): string; - - /** - * specifies the CSS class that will be applied to the highlighted event's duration on the time scale - * @param start the date when an event is scheduled to begin - * @param end the date when an event is scheduled to be completed - * @param ev the event's object - */ - drag_marker_class(start: Date, end: Date, ev: any): void; - - /** - * specifies the content of the highlighted block on the time scale - * @param start the date when an event is scheduled to begin - * @param end the date when an event is scheduled to be completed - * @param ev the event's object - */ - drag_marker_content(start: Date, end: Date, ev: any): void; - - /** - * specifies the date of an event. Applied to one-day events only - * @param start the date when an event is scheduled to begin - * @param end the date when an event is scheduled to be completed - * @param event the event object - */ - event_bar_date(start: Date, end: Date, event: any): string; - - /** - * specifies the event's text. Applied to multi-day events only - * @param start the date when an event is scheduled to begin - * @param end the date when an event is scheduled to be completed - * @param event the event's object - */ - event_bar_text(start: Date, end: Date, event: any): string; - - /** - * specifies the CSS class that will be applied to the event's container - * @param start the date when an event is scheduled to begin - * @param end the date when an event is scheduled to be completed - * @param ev the event's object - */ - event_class(start: Date, end: Date, ev: any): string; - - /** - * specifies the time part of the start and end dates of the event. Mostly used by other templates for presenting time periods - * @param date the date which needs formatting - */ - event_date(date: Date): string; - - /** - * specifies the event's header - * @param start the date when an event is scheduled to begin - * @param end the date when an event is scheduled to be completed - * @param event the event's object - */ - event_header(start: Date, end: Date, event: any): string; - - /** - * specifies the event's text - * @param start the date when an event is scheduled to begin - * @param end the date when an event is scheduled to be completed - * @param event the event object - */ - event_text(start: Date, end: Date, event: any): string; - - /** - * specifies the items of the Y-Axis - * @param date the date which needs formatting - */ - hour_scale(date: Date): string; - - /** - * specifies the format of requests in the dynamic loading mode - * @param date the date which needs formatting - */ - load_format(date: Date): string; - - /** - * specifies the date in the header of the view - * @param start the start date of the view - * @param end the end date of the view - */ - map_date(start: Date, end: Date): string; - - /** - * specifies the text in the second column of the view - * @param start the date when an event is scheduled to begin - * @param end the date when an event is scheduled to be completed - * @param event the event object - */ - map_text(start: Date, end: Date, event: any): string; - - /** - * specifies the date in the first column of the view - * @param start the date when an event is scheduled to begin - * @param end the date when an event is scheduled to be completed - * @param event the event object - */ - map_time(start: Date, end: Date, event: any): string; - - /** - * specifies the date of the event in the Google Maps popup marker - * @param start the date when an event is scheduled to begin - * @param end the date when an event is scheduled to be completed - * @param event the event object - */ - marker_date(start: Date, end: Date, event: any): string; - - /** - * specifies the text of the event in the Google Maps popup marker - * @param start the date when an event is scheduled to begin - * @param end the date when an event is scheduled to be completed - * @param event the event object - */ - marker_text(start: Date, end: Date, event: any): string; - - /** - * specifies the date in the header of the view - * @param date the date which needs formatting - */ - month_date(date: Date): string; - - /** - * specifies the CSS class that will be applied to a day cell - * @param date the date which needs formatting - */ - month_date_class(date: Date): string; - - /** - * specifies the format of the day in a cell - * @param date the date which needs formatting - */ - month_day(date: Date): string; - - /** - * specifies the presentation of the 'View more' link in the cell of the Month view - * @param date the date of a month cell - * @param count the number of events in the cell - */ - month_events_link(date: Date, count: number): string; - - /** - * specifies the date format of the X-Axis of the view - * @param date the date which needs formatting - */ - month_scale_date(date: Date): string; - - /** - * specifies the content of the pop-up edit form - * @param start the date when an event is scheduled to begin - * @param end the date when an event is scheduled to be completed - * @param event the event object - */ - quick_info_content(start: Date, end: Date, event: any): string; - - /** - * specifies the date of the pop-up edit form - * @param start the date when an event is scheduled to begin - * @param end the date when an event is scheduled to be completed - * @param event the event object - */ - quick_info_date(start: Date, end: Date, event: any): string; - - /** - * specifies the title of the pop-up edit form - * @param start the date when an event is scheduled to begin - * @param end the date when an event is scheduled to be completed - * @param event the event object - */ - quick_info_title(start: Date, end: Date, event: any): string; - - /** - * specifies the drop-down time selector in the lightbox - */ - time_picker(): string; - - /** - * specifies the format of start and end dates displayed in the tooltip - * @param date the date which needs formatting - */ - tooltip_date_format(date: Date): string; - - /** - * specifies the text of tooltips - * @param start the date when an event is scheduled to begin - * @param end the date when an event is scheduled to be completed - * @param event the event object - */ - tooltip_text(start: Date, end: Date, event: any): string; - - /** - * specifies the event's text - * @param start the date when an event is scheduled to begin - * @param end the date when an event is scheduled to be completed - * @param event the event object - * @param cellDate the date of a day cell that a one-day event or a single occurrence of
    the recurring event displays in - * @param pos the position of a single occurrence in the recurring event: 'start' - the first occurrence, 'end' - the last occurrence, 'middle' - for remaining occurrences - */ - week_agenda_event_text(start: Date, end: Date, event: any, cellDate: Date, pos: string): string; - - /** - * the date of a day cell of the view - * @param date the date which needs formatting - */ - week_agenda_scale_date(date: Date): string; - - /** - * specifies the date in the header of the view - * @param start the start date of the view - * @param end the end date of the view - */ - week_date(start: Date, end: Date): string; - - /** - * specifies the CSS class that will be applied to a day cell - * @param start the date when an event is scheduled to begin - * @param end the date when an event is scheduled to be completed - * @param event the event object - */ - week_date_class(start: Date, end: Date, event: any): string; - - /** - * specifies the date in the sub-header of the view - * @param date the date which needs formatting - */ - week_scale_date(date: Date): string; - - /** - * a string from an XML file is converted into a date object in conformity with this template - * @param date the string which need to be parsed - */ - xml_date(date: Date): Date; - - /** - * a date object is converted into a string in conformity with this template. Used to send data back to the server - * @param date the date which needs formatting - */ - xml_format(date: Date): string; - - /** - * specifies the date in the header of the view - * @param date the date which needs formatting - */ - year_date(date: Date): string; - - /** - * specifies the month's name in the header of a month block of the view. - * @param date the date which needs formatting - */ - year_month(date: Date): string; - - /** - * specifies the day's name in the sub-header of a month block of the view - * @param date the date which needs formatting - */ - year_scale_date(date: Date): string; - - /** - * specifies the tooltip over a day cell containing some scheduled event(s) - * @param start the date when an event is scheduled to begin - * @param end the date when an event is scheduled to be completed - * @param event the event object - */ - year_tooltip(start: Date, end: Date, event: any): string; - - /** - * specifies the lightbox's header - * @param start the date when an event is scheduled to begin - * @param end the date when an event is scheduled to be completed - * @param event the event object - */ - lightbox_header(start: Date, end: Date, event: any): string; - - /** - * specifies the date in the header of the view - * @param start the start date of the view - * @param end the end date of the view - */ - grid_date(start: Date, end: Date): string; - - /** - * specifies the format of dates in columns with id='date' - * @param start the date when an event is scheduled to begin - * @param end the date when an event is scheduled to be completed - * @param ev the event object - */ - grid_full_date(start: Date, end: Date, ev: any): string; - - /** - * specifies the format of dates in columns with id='start_date' or id='end_date' - * @param date the date which needs formatting - */ - grid_single_date(date: Date): string; - - /** - * specifies the text in the columns - * @param field_name the column's id - * @param event the event object - */ - grid_field(field_name: string, event: any): string; - - /** - * specifies the number of scheduled events in a cell of the view - * @param evs an array of objects of events contained in a cell - * @param date the date of a cell - */ - timeline_cell_value(evs: any[], date: Date): string; - - /** - * specifies the CSS class that will be applied to a cell of the view - * @param evs an array of objects of events contained in a cell (defined only in the 'cell' mode) - * @param date the date of a column - * @param section the section object - */ - timeline_cell_class(evs: any[], date: Date, section: any): string; - - /** - * specifies the name of a CSS class that will be applied to items of the X-Axis - * @param date the date which needs formatting - */ - timeline_scalex_class(date: Date): string; - - /** - * specifies the name of a CSS class that will be applied to items of the second X-Axis - * @param date the date which needs formatting - */ - timeline_second_scalex_class(date: Date): string; - - /** - * specifies the name of a CSS class that will be applied to items of the Y-Axis - * @param key the section's id - * @param label the section's label - * @param section the section object that contains the 'key' and 'label' properties - */ - timeline_scaley_class(key: string, label: string, section: any): string; - - /** - * specifies items of the Y-Axis - * @param key the section's id (key) - * @param label the section's label - * @param section the section object containing the 'key' and 'label' properties - */ - timeline_scale_label(key: string, label: string, section: any): string; - - /** - * specifies the tooltip over a day cell containing some scheduled event(s) - * @param start the date when an event is scheduled to begin - * @param end the date when an event is scheduled to be completed - * @param event the event object - */ - timeline_tooltip(start: Date, end: Date, event: any): string; - - /** - * specifies the date in the header of the view - * @param date1 the date when an event is scheduled to begin - * @param date2 the date when an event is scheduled to be completed - */ - timeline_date(date1: Date, date2: Date): string; - - /** - * specifies items of the X-Axis - * @param date the date which needs formatting - */ - timeline_scale_date(date: Date): string; - - /** - * specifies items of the second X-Axis - * @param date the date which needs formatting - */ - timeline_second_scale_date(date: Date): string; - - /** - * specifies the date in the header of the view - * @param date the date which needs formatting - */ - units_date(date: Date): string; - - /** - * specifies items of the X-Axis - * @param key the unit's id (key) - * @param label the unit's label - * @param unit the unit object containing the 'key' and 'label' properties - */ - units_scale_text(key: string, label: string, unit: any): string; - -} - -interface SchedulerConfigOptions { - /** - * 'says' to present the numbers of days in the Month view as clickable links that open the related day in the specified view - */ - active_link_view: string; - - /** - * sets the date to display events until - */ - agenda_end: Date; - - /** - * sets the date to start displaying events from - */ - agenda_start: Date; - - /** - * specifies how to display the default error notification in case the XML data loading failed - */ - ajax_error: string | boolean; - - /** - * 'says' to show multi-day events in the regular way (as one-day events are displayed) - */ - all_timed: boolean | string; - - /** - * sets the date format that will be used by the addEvent() method to parse the start_date, end_date properties in case they are specified as strings - */ - api_date: string; - - /** - * enables automatic changing of the end event date after changing the start date - */ - auto_end_date: boolean; - - /** - * stores a collection of buttons resided in the left bottom corner of the lightbox - */ - buttons_left: any[]; - - /** - * stores a collection of buttons resided in the right bottom corner of the lightbox - */ - buttons_right: any[]; - - /** - * sets the maximum number of events in a cascade - */ - cascade_event_count: number; - - /** - * sets the 'cascade' display mode - */ - cascade_event_display: boolean; - - /** - * sets the left margin for a cascade of events - */ - cascade_event_margin: number; - - /** - * activates/disables checking of limits - */ - check_limits: boolean; - - /** - * sets the maximum allowable number of events per time slot - */ - collision_limit: number; - - /** - * forces the scheduler container to automatically change its size to show the whole content without scrolling - */ - container_autoresize: boolean; - - /** - * sets the date format for the X-Axis of the Week and Units views - */ - day_date: string; - - /** - * enables the possibility to create events by double click - */ - dblclick_create: boolean; - - /** - * sets the date format used by the templates 'day_date', 'week_date', 'day_scale_date' for setting date in the views' headers - */ - default_date: string; - - /** - * sets a timeout (in milliseconds) that wraps the api/scheduler_updateview.md and api/scheduler_setcurrentview.md calls ( that cause re-drawing of the scheduler ) - */ - delay_render: number; - - /** - * 'says' to use the extended form while creating new events by drag or double click - */ - details_on_create: boolean; - - /** - * 'says' to open the lightbox after double clicking on an event - */ - details_on_dblclick: boolean; - - /** - * defines whether the marked(blocked) time spans should be highlighted in the scheduler - */ - display_marked_timespans: boolean; - - /** - * sets the default background color for the events retrieved by the showEvent() method - */ - displayed_event_color: string; - - /** - * sets the default font color for the events retrieved by the showEvent() method - */ - displayed_event_text_color: string; - - /** - * enables the possibility to create new events by drag-and-drop - */ - drag_create: boolean; - - /** - * highlights the event's duration on the time scale when you drags an event over the scheduler - */ - drag_highlight: boolean; - - /** - * restrict dragging events to the calling scheduler from any other scheduler(s) - */ - drag_in: boolean; - - /** - * enables the possibility to drag the lightbox by the header - */ - drag_lightbox: boolean; - - /** - * enables the possibility to move events by drag-and-drop - */ - drag_move: boolean; - - /** - * restrict dragging events from the calling scheduler to any other scheduler(s) - */ - drag_out: boolean; - - /** - * enables the possibility to resize events by drag-and-drop - */ - drag_resize: boolean; - - /** - * 'says' to open the lightbox while creating new events - */ - edit_on_create: boolean; - - /** - * sets the initial duration of events in minutes - */ - event_duration: number; - - /** - * sets the minimum value for the hour scale (Y-Axis) - */ - first_hour: number; - - /** - * moves views' tabs from the left to the right side - */ - fix_tab_position: boolean; - - /** - * enables setting of the event's duration to the full day - */ - full_day: boolean; - - /** - * specifies whether events retrieved by the showEvent method should be highlighted while displaying - */ - highlight_displayed_event: boolean; - - /** - * sets the time format of Y-Axis. Also used in the default event and lighbox templates for setting the time part. - */ - hour_date: string; - - /** - * sets the height of an hour unit in pixels - */ - hour_size_px: number; - - /** - * stores a collection of icons visible in the side edit menu of the event's box - */ - icons_edit: any[]; - - /** - * stores a collection of icons visible in the side selection menu of the event's box - */ - icons_select: any[]; - - /** - * defines whether the date specified in the 'End by' field should be exclusive or inclusive - */ - include_end_by: boolean; - - /** - * disables the keyboard navigation in the scheduler - */ - key_nav: boolean; - - /** - * sets the maximum value of the hour scale (Y-Axis) - */ - last_hour: number; - - /** - * adds the dotted left border to the scheduler - */ - left_border: boolean; - - /** - * specifies the lightbox object - */ - lightbox: any; - - /** - * defines the lightbox's behavior, when the user opens the lightbox to edit a recurring event - */ - lightbox_recurring: string; - - /** - * denies to drag events out of the visible area of the scheduler - */ - limit_drag_out: boolean; - - /** - * sets the right border of the allowable date range - */ - limit_end: Date; - - /** - * sets the left border of the allowable date range - */ - limit_start: Date; - - /** - * sets the max and min values of the time selector in the lightbox to the values of the 'last_hour' and 'first_hour' options - */ - limit_time_select: boolean; - - /** - * limits the date period during which the user can view the events - */ - limit_view: boolean; - - /** - * sets the format of server request parameters 'from', 'to' in case of dynamic loading - */ - load_date: string; - - /** - * sets the date to display events until - */ - map_end: Date; - - /** - * sets the position that will be displayed on the map in case the event's location can't be identified - */ - map_error_position: any; - - /** - * the maximum width of the Google Maps's popup marker in the Map view - */ - map_infowindow_max_width: number; - - /** - * sets the initial position of the map - */ - map_initial_position: any; - - /** - * sets the initial zoom of Google Maps in the Map view - */ - map_initial_zoom: number; - - /** - * activates attempts to resolve the event's location, if the database doesn't have the event's coordinates stored - */ - map_resolve_event_location: boolean; - - /** - * enables/disables prompts asking the user to share his location for displaying on the map - */ - map_resolve_user_location: boolean; - - /** - * sets the date to start displaying events from - */ - map_start: Date; - - /** - * sets the type of Google Maps - */ - map_type: any; - - /** - * sets the zoom that will be used to show the user's location, if the user agrees to the browser's offer to show it - */ - map_zoom_after_resolve: number; - - /** - * enables/disables the marker displaying the current time - */ - mark_now: boolean; - - /** - * sets the maximum number of events displayable in a cell - */ - max_month_events: number; - - /** - * specifies the mini calendar object - */ - minicalendar: any; - - /** - * sets the format for the header of the Month view - */ - month_date: string; - - /** - * sets the format for the day in the cells of the Month and Year views - */ - month_day: string; - - /** - * sets the minimum height of cells in the Month view - */ - month_day_min_height: number; - - /** - * enables rendering of multi-day events - */ - multi_day: boolean; - - /** - * sets the height of the area that displays multi-day events - */ - multi_day_height_limit: number | boolean; - - /** - * enables the possibility to render the same events in several sections of the Timeline or Units view - */ - multisection: boolean; - - /** - * specifies whether while dragging events that assigned to several sections of the Timeline or Units view, all instances should be dragged at once ('true') or just the selected one ('false') - */ - multisection_shift_all: boolean; - - /** - * sets the date for the current-time marker in the Limit extension (enabled by the configuration - mark_now) - */ - now_date: Date; - - /** - * allows working with recurring events independently of time zones - */ - occurrence_timestamp_in_utc: boolean; - - /** - * defines the 'saving' behaviour for the case, when the user edits the event's text directly in the event's box - */ - positive_closing: boolean; - - /** - * preserves the visible length of an event while dragging along a non-linear time scale - */ - preserve_length: boolean; - - /** - * cancels preserving of the current scroll position while navigating between dates of the same view - */ - preserve_scroll: boolean; - - /** - * enables/disables caching of GET requests in the browser - */ - prevent_cache: boolean; - - /** - * defines whether the event form will appear from the left/right side of the screen or near the selected event - */ - quick_info_detached: boolean; - - /** - * activates the read-only mode for the scheduler - */ - readonly: boolean; - - /** - * activates the read-only mode for the lightbox - */ - readonly_form: boolean; - - /** - * specifies working days that will affect the recurring event when the user selects the ""Every workday" option in the lightbox - */ - recurring_workdays: any[]; - - /** - * sets the date format of the 'End by' field in the 'recurring' lightbox - */ - repeat_date: string; - - /** - * prevents including past days to events with the 'weekly' recurrence - */ - repeat_precise: boolean; - - /** - * enables the possibility to resize multi-day events in the Month view by drag-and-drop - */ - resize_month_events: boolean; - - /** - * enables the possibility to resize single-day events in the Month view by drag-n-drop - */ - resize_month_timed: boolean; - - /** - * sets the initial position of the vertical scroll in the scheduler (an hour in the 24-hour clock format) - */ - scroll_hour: number; - - /** - * specifies the delimeter that will be used to separate several sections/units in the related data property of the event - */ - section_delemiter: string; - - /** - * shows/hides the select bar in the event's box - */ - select: boolean; - - /** - * allows preventing short events from overlapping - */ - separate_short_events: boolean; - - /** - * enables converting server-side dates from UTC to a local time zone (and backward) while sending data to the server - */ - server_utc: boolean; - - /** - * enables showing a progress/spinner while data is loading (useful for dynamic loading) - */ - show_loading: boolean; - - /** - * activates/disables the 'quick_info' extension (pop-up task's details form) - */ - show_quick_info: boolean; - - /** - * sets the start day of weeks - */ - start_on_monday: boolean; - - /** - * sets the minimum step (in minutes) for event's time values - */ - time_step: number; - - /** - * enables/disables the touch support in the scheduler - */ - touch: boolean | string; - - /** - * defines the time period in milliseconds that is used to differ the long touch gesture from the scroll gesture - */ - touch_drag: number | boolean; - - /** - * enables/disables prompting messages in the right top corner of the screen - */ - touch_tip: boolean; - - /** - * disables dhtmxlScheduler's tooltips on the touch devices - */ - touch_tooltip: boolean; - - /** - * updates the mode when the scheduler fully repaints itself on any action - */ - update_render: boolean; - - /** - * 'says' events to occupy the whole width of the cell - */ - use_select_menu_space: boolean; - - /** - * sets the format of the date in the sub-header of the Month view - */ - week_date: string; - - /** - * enables/disables displaying the standard (wide) lightbox instead of the short one - */ - wide_form: boolean; - - /** - * sets the date format that is used to parse data from the data set - */ - xml_date: string; - - /** - * sets the number of rows in the Year view - */ - year_x: number; - - /** - * sets the number of columns in the Year view - */ - year_y: number; - -} - -interface SchedulerDateHelpers { - add(origin: Date, count: number, unit: string): Date; - copy(origin: Date): Date; - - date_part(origin: Date): Date; - time_part(origin: Date): Date; - - day_start(origin: Date): Date; - month_start(origin: Date): Date; - week_start(origin: Date): Date; - year_start(origin: Date): Date; - - getISOWeek(origin: Date): number; - getUTCISOWeek(origin: Date): number; - - date_to_str(format: string): any; - str_to_date(format: string): any; - convert_to_utc(origin: Date): Date; - to_fixed(value: number): string; -} - -interface SchedulerHotkeys { - edit_save: number; - edit_cancel: number; -} - -interface SchedulerLocaleDate { - month_full: string[]; - month_short: string[]; - day_full: string[]; - day_short: string[]; -} - -interface SchedulerLocaleLabels { - dhx_cal_today_button: string; - day_tab: string; - week_tab: string; - month_tab: string; - new_event: string; - icon_save: string; - icon_cancel: string; - icon_details: string; - icon_edit: string; - icon_delete: string; - confirm_closing: string; - confirm_deleting: string; - section_description: string; - section_time: string; -} - -interface SchedulerLocale { - date: SchedulerLocaleDate; - labels: SchedulerLocaleLabels; -} - - -interface SchedulerSizes { - /** - * the height of day cells in the month view - */ - bar_height: number; - - /** - * the width of the event text input 140 day - */ - editor_width: number; - - /** - * increases the length of the lightbox - */ - lightbox_additional_height: number; - - /** - * the width of the date column in the Map view - */ - map_date_width: number; - - /** - * the width of the description column in the Map view - */ - map_description_width: number; - - /** - * the left margin of the main scheduler area - */ - margin_left: number; - - /** - * the bottom margin of the main scheduler area - */ - margin_top: number; - - /** - * the width of the selection menu - */ - menu_width: number; - - /** - * the minimal height of the event box - */ - min_event_height: number; - - /** - * the top offset of an event in a cell in the month view - */ - month_scale_height: number; - - /** - * the height of the navigation bar - */ - nav_height: number; - - /** - * the height of the X-Axis - */ - scale_height: number; - - /** - * the width of the Y-Axis - */ - scale_width: number; - - /** - * the width of the scrollbar area - */ - scroll_width: number; -} - -interface SchedulerEnterprise { - /** - * Creates a new instance of Scheduler - */ - getSchedulerInstance(): SchedulerStatic; -} - -interface SchedulerStatic { - templates: SchedulerTemplates; - config: SchedulerConfigOptions; - date: SchedulerDateHelpers; - keys: SchedulerHotkeys; - skin: String; - version: String; - xy: SchedulerSizes; - locale: SchedulerLocale; - - /** - * filter events that will be displayed on the day view - */ - filter_day: SchedulerFilterCallback; - - /** - * filter events that will be displayed on the week view - */ - filter_week: SchedulerFilterCallback; - - /** - * filter events that will be displayed on the month view - */ - filter_month: SchedulerFilterCallback; - - /** - * filter events that will be displayed on the year view - */ - filter_year: SchedulerFilterCallback; - - /** - * filter events that will be displayed on the agenda view - */ - filter_agenda: SchedulerFilterCallback; - - /** - * filter events that will be displayed on the timeline view - */ - filter_timeline: SchedulerFilterCallback; - - /** - * filter events that will be displayed on the units view - */ - filter_units: SchedulerFilterCallback; - - /** - * filter events that will be displayed on the grid view - */ - filter_grid: SchedulerFilterCallback; - - - /** - * removes all blocking sets from the scheduler - */ - deleteMarkedTimespan(); - - /** - * removes marking/blocking set by the addMarkedTimespan() and blockTime() methods - * @param configuration for deleting - */ - deleteMarkedTimespan(config: any); - - - /** - * adds a new event - * @param event the event object - */ - addEvent(event: any): string; - - /** - * adds a new event and opens the lightbox to confirm - * @param event the event object - */ - addEventNow(event: any): string; - - /** - * marks dates, but with certain settings makes blocking (unlike blockTime() allows setting custom styling for the limit) - * @param config the configuration object of the timespan to mark/block - */ - addMarkedTimespan(config: any): number; - - /** - * adds a section to the currently active view (if the opened view isn't Timeline in the 'Tree' mode - the method will be ignored) - * @param section the object of the section to add - * @param parent_id the id of the parent section. Pass 'null' if you are adding a section to the root - */ - addSection(section: any, parent_id: string): boolean; - - /** - * attaches the handler to an inner event of dhtmlxScheduler - * @param name the event's name, case-insensitive - * @param handler the handler function - */ - attachEvent(name: SchedulerEventName, handler: SchedulerCallback): string; - - /** - * makes the scheduler reflect all data changes in the Backbone model and vice versa - * @param events the Backbone data collection - */ - backbone(events: any): void; - - /** - * blocks the specified date and applies the default 'dimmed' style to it. - * @param date a date to block ( if a number is provided, the parameter will be treated as a week
    day: '0' index refers to Sunday,'6' - to Saturday ) - * @param time_points an array [start_minute,end_minute,..,start_minute_N,end_minute_N],
    where each pair sets a certain limit range. The array can have any number of
    such pairs - * @param items defines specific items of view(s) to block - */ - blockTime(date: Date | number, time_points: any[], items?: any): void; - - /** - * calls an inner event - * @param name the event's name, case-insensitive - * @param params an array of the event-related data - */ - callEvent(name: string, params: any[]): boolean; - - /** - * changes the event's id - * @param id the current event's id - * @param new_id the new event's id - */ - changeEventId(id: string, new_id: string): void; - - /** - * checks whether the specified event occurs at the time that has already been occupied by another event(s) - * @param event the event object - */ - checkCollision(event: any): boolean; - - /** - * checks whether an event has some handler(s) specified - * @param name the event's name - */ - checkEvent(name: SchedulerEventName): boolean; - - /** - * checks whether an event resides in a timespan of a specific type - * @param event the event object - * @param timespan the timespan's type - */ - checkInMarkedTimespan(event: any, timespan: string): boolean; - - /** - * checks whether the specified event takes place at the blocked time period - * @param event the event object - */ - checkLimitViolation(event: any): boolean; - - /** - * removes all events from the scheduler - */ - clearAll(): void; - - /** - * closes all sections in the currently active view (if the opened view isn't Timeline in the 'Tree' mode - the method will be ignored) - */ - closeAllSections(): void; - - /** - * closes the specified section in the currently active view (if the opened view isn't Timeline in the 'Tree' mode - the method will be ignored) - * @param section_id the section's id - */ - closeSection(section_id: string): void; - - /** - * collapses the expanded scheduler back to the normal size - */ - collapse(): void; - - /** - * creates the Grid view in the scheduler - * @param config the configuration object of the Grid view - */ - createGridView(config: any): void; - - /** - * creates the Timeline view in the scheduler - * @param config the configuration object of the Timeline view - */ - createTimelineView(config: any): void; - - /** - * creates the Units view in the scheduler - * @param config the configuration object of the Units view - */ - createUnitsView(config: any): void; - - /** - * deletes all sections from the currently active view (if the opened view isn't Timeline in the 'Tree' mode - the method will be ignored) - */ - deleteAllSections(): void; - - /** - * deletes the specified event - * @param id the event's id - */ - deleteEvent(id: string | number): void; - - /** - * removes marking/blocking set by the addMarkedTimespan() and blockTime() methods - * @param id the timespan's id - */ - deleteMarkedTimespan(id: string): void; - - /** - * deletes a section from the currently active view (if the opened view isn't Timeline in the 'Tree' mode - the method will be ignored) - * @param section_id the section's id - */ - deleteSection(section_id: string): boolean; - - /** - * destroys previously created mini-calendar - * @param name the mini-calendar's object (if not specified, the scheduler attempts
    to destroy the last created mini calendar) - */ - destroyCalendar(name?: any): void; - - /** - * detaches a handler from an event (which was attached before by the attachEvent method) - * @param id the event's id - */ - detachEvent(id: string): void; - - /** - * opens the inline editor to alter the event's text (the editor in the event's box) - * @param id the event's id - */ - edit(id: string): void; - - /** - * closes the inline event editor, if it's currently open - * @param id the event's id - */ - editStop(id: string): void; - - /** - * closes the lightbox - * @param mode if set to true, the changes, made in the lightbox, will be saved before closing.
    If - false, the changes will be cancelled. - * @param box the HTML container for the lightbox - */ - endLightbox(mode: boolean, box?: HTMLElement): void; - - /** - * expands the scheduler to the full screen view - */ - expand(): void; - - /** - * gives access to the objects of lightbox's sections - * @param name the name of a lightbox section - */ - formSection(name: string): any; - - /** - * returns the current cursor-pointed date and section (if defined) - * @param e a native event object - */ - getActionData(e: Event): any; - - /** - * returns the event object by its id - * @param event_id the event's id - */ - getEvent(event_id: string | number): any; - - /** - * gets the event's end date - * @param id the event's id - */ - getEventEndDate(id: string | number): Date; - - /** - * gets the event's start date - * @param id the event's id - */ - getEventStartDate(id: string | number): Date; - - /** - * gets the event's text - * @param id the event's id - */ - getEventText(id: string | number): string; - - /** - * returns a collection of events which occur during the specified period - * @param from the start date of the period - * @param to the end date of the period - */ - getEvents(from?: Date, to?: Date): any; - - /** - * gets the label of a select control in the lightbox - * @param property the name of a data property that the control is mapped to - * @param key the option's id. This parameter is compared with the event's data property
    to assign the select's option to an event - */ - getLabel(property: string, key: string | number): any; - - /** - * gets the lightbox's HTML object element - */ - getLightbox(): HTMLElement; - - /** - * returns all occurrences of a recurring event - * @param id the id of a recurring event - * @param number the maximum number of occurrences to return (by default, 100) - */ - getRecDates(id: string, number: number): any; - - /** - * gets the object of the currently displayed event - * @param id the event's id - */ - getRenderedEvent(id: string): HTMLElement; - - /** - * gets the object of the specified section in the currently active view (if the opened view isn't Timeline in the 'Tree' mode - the method will be ignored) - * @param section_id the section's id - */ - getSection(section_id: string): any; - - /** - * gets the current state of the scheduler - */ - getState(): any; - - /** - * gets the user data associated with the specified event - * @param id the event's id - * @param name the user data name - */ - getUserData(id: string, name: string): any; - - /** - * hides the lightbox modal overlay that blocks interactions with the remaining screen - * @param box an element to hide - */ - hideCover(box?: HTMLElement): void; - - /** - * hides the pop-up event form (if it's currently active) - */ - hideQuickInfo(): void; - - /** - * highlights the event's duration on the time scale - * @param event the event object - */ - highlightEventPosition(event: any): void; - - /** - * constructor. Initializes a dhtmlxScheduler object - * @param container an HTML container ( or its id) where a dhtmlxScheduler object will be initialized - * @param date the initial date of the scheduler (by default, the current date) - * @param view the name of the initial view (by default, "week") - */ - init(container: string | HTMLElement, date?: Date, view?: string): void; - - /** - * inverts the specified time zones - * @param zones an array **[start_minute,end_minute,..,start_minute_N,end_minute_N]**
    where each pair sets a certain limit range (in minutes). The array can have any
    number of such pairs - */ - invertZones(zones: any[]): void; - - /** - * checks whether the calendar is currently opened in the scheduler - */ - isCalendarVisible(): boolean | HTMLElement; - - /** - * checks whether the specified event one-day or multi-day - * @param event the event object - */ - isOneDayEvent(event: any): boolean; - - /** - * checks whether a view with the specified name exists - * @param name the view name - */ - isViewExists(name: string): boolean; - - /** - * 'says' to change the active date in the mini calendar each time, the active date in the scheduler is changed - * @param calendar the mini calendar object - * @param shift a function that defines the difference between active dates in the mini-calendar
    and the scheduler. The function takes the scheduler's date as a parameter and
    returns the date that should be displayed in the mini calendar - */ - linkCalendar(calendar: any, shift: SchedulerCallback): void; - - /** - * loads data to the scheduler from an external data source - * @param url the server side url (may be a static file or a server side script which outputs data
    as XML) - * @param type ('json', 'xml', 'ical') the data type. The default value - 'xml' - * @param callback the callback function - */ - load(url: string, type?: string, callback?: SchedulerCallback): void; - - /** - * applies a css class to the specified date - * @param calendar the calendar object - * @param date the date to mark - * @param css the name of a css class - */ - markCalendar(calendar: any, date: Date, css: string): void; - - /** - * marks and/or blocks date(s) by applying the default or a custom style to them. Marking is cancelled right after any internal update in the app. Can be used for highlighting - * @param config the configuration object of the timespan to mark/block - */ - markTimespan(config: any): void; - - /** - * opens all sections in the currently active view (if the opened view isn't Timeline in the 'Tree' mode - the method will be ignored) - */ - openAllSections(): void; - - /** - * opens the specified section in the currently active view (if the opened view isn't Timeline in the 'Tree' mode - the method will be ignored) - * @param section_id the section's id - */ - openSection(section_id: string): void; - - /** - * loads data from a client-side resource - * @param data a string or object which represents data - * @param type ('json', 'xml', 'ical') the data type. The default value - 'xml' - */ - parse(data: any, type?: string): void; - - /** - * creates a mini calendar - * @param config the calendar configuration object - */ - renderCalendar(config: any): void; - - /** - * generates HTML content for a custom event's box - * @param container the event container - * @param event the event object - */ - renderEvent(container: HTMLElement, event: any): boolean; - - /** - * removes the current lightbox's HTML object element - */ - resetLightbox(): void; - - /** - * scrolls the specified number of units in the Units view - * @param step the number of units to scroll (set the positive value to scroll units to the right
    side, the negative value - to the left side
    ). - */ - scrollUnit(step: number): void; - - /** - * selects the specified event - * @param id the event's id - */ - select(id: string): void; - - /** - * returns a list of options - * @param list_name the name of a list - * @param options an array of options - */ - serverList(list_name: string, options?: any[]): void; - - /** - * displays the specified view and date - * @param date the date to display - * @param view the name of a view to display - */ - setCurrentView(date?: Date, view?: string): void; - - /** - * adds a new event to the scheduler's data pool - * @param id the event's id - * @param event the event object - */ - setEvent(id: string | number, event: any): void; - - /** - * sets the event's end date - * @param id the event's id - * @param date the new end date of the event - */ - setEventEndDate(id: string, date: Date): void; - - /** - * sets the event's start date - * @param id the event's id - * @param date the new start date of the event - */ - setEventStartDate(id: string, date: Date): void; - - /** - * sets the event's text - * @param id the event's id - * @param text the new text of the event - */ - setEventText(id: string, text: string): void; - - /** - * forces the lightbox to resize - */ - setLightboxSize(): void; - - /** - * sets the mode that allows loading data by parts (enables the dynamic loading) - * @param mode the loading mode - */ - setLoadMode(mode: string): void; - - /** - * sets the user data associated with the specified event - * @param id the event's id - * @param name the user data name - * @param value the user data value - */ - setUserData(id: string, name: string, value: any): void; - - /** - * shows the lightbox modal overlay that blocks interactions with the remaining screen - * @param box an element to hide - */ - showCover(box?: HTMLElement): void; - - /** - * shows and highlights the specified event in the current or specified view - * @param id the event's id - * @param view the view name - */ - showEvent(id: string, view?: string): void; - - /** - * opens the lightbox for the specified event - * @param id the event's id - */ - showLightbox(id: string): void; - - /** - * displays the pop-up event form for the specified event - * @param id the event's id - */ - showQuickInfo(id: string): void; - - /** - * shows a custom lightbox in the specified HTML container centered on the screen - * @param id the event's id - * @param box the lightbox's HTML container - */ - startLightbox(id: string, box: HTMLElement): void; - - /** - * converts scheduler's data to the ICal format - * @param header sets the value for the content's header field - */ - toICal(header?: string): string; - - /** - * converts scheduler's data into the JSON format - */ - toJSON(): string; - - /** - * exports the current view to a PDF document (can be used for printing) - * @param url the path to the server-side PDF converter - * @param mode the color map of the resulting PDF document - */ - toPDF(url: string, mode?: string): void; - - /** - * exports several scheduler's views to a PDF document (can be used for printing) - * @param from the date to start export events from - * @param to the date to export events until - * @param view the name of a view that the export should be applied to - * @param path the path to the php file which generates a PDF file (details) - * @param color the color map in use - */ - toPDFRange(from: Date, to: Date, view: string, path: string, color: string): void; - - /** - * converts scheduler's data into the XML format - */ - toXML(): string; - - /** - * generates a unique ID (unique inside the current scheduler, not GUID) - */ - uid(): void; - - /** - * removes blocking set by the blockTime() method - * @param days (Date, number,array, string) days that should be limited - * @param zones the period in minutes that should be limited. Can be set to 'fullday' value
    to limit the entire day - * @param sections allows blocking date(s) just for specific items of specific views. BTW, the specified date(s) will be blocked just in the related view(s) - */ - unblockTime(days: any, zones?: any[], sections?: any): void; - - /** - * removes a css class from the specified date - * @param calendar the mini calendar object - * @param date the date to unmark - * @param css the name of a css class to remove - */ - unmarkCalendar(calendar: any, date: Date, css: string): void; - - /** - * removes marking/blocking set by the markTimespan() method - * @param divs a timespan to remove marking/blocking from (or an array of timespans) - */ - unmarkTimespan(divs: HTMLElement | any[]): void; - - /** - * unselects the specified event - * @param id the event's id (if not specified, the currently selected event will be unselected) - */ - unselect(id?: string): void; - - /** - * displays the specified date in the mini calendar - * @param calendar the mini calendar object - * @param new_date a new date to display in the mini calendar - */ - updateCalendar(calendar: any, new_date: Date): void; - - /** - * updates the specified collection with new options - * @param collection the name of the collection to update - * @param options the new values of the collection - */ - updateCollection(collection: string, options: any[]): boolean; - - /** - * updates the specified event - * @param id the event's id - */ - updateEvent(id: string): void; - - /** - * displays the specified view and date (doesn't invoke any events) - * @param date the date to set - * @param view the view name - */ - updateView(date: Date, view: string): void; - -} - -declare var scheduler: SchedulerStatic; -declare var Scheduler: SchedulerEnterprise; \ No newline at end of file diff --git a/discontinuous-range/index.d.ts b/discontinuous-range/index.d.ts deleted file mode 100644 index 670379a57e..0000000000 --- a/discontinuous-range/index.d.ts +++ /dev/null @@ -1,73 +0,0 @@ -// Type definitions for discontinuous-range 1.0 -// Project: https://www.npmjs.com/package/discontinuous-range -// Definitions by: Victor Zhou -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/** - * Represents a discontinuous range of numbers. - */ -declare class DiscontinuousRange { - - /** - * Creates a discontinuous range at rangeStart, and ending at - * rangeEnd. If rangeEnd is not specified, a range containing - * only rangeStart is created. - * @param rangeStart The start of the range to create. - * @param rangeEnd The end of the range to create. Defaults to rangeStart. - */ - constructor(rangeStart: number, rangeEnd?: number); - - /** - * Adds the numbers from rangeStart to rangeEnd to the current range. - * If rangeEnd is not defined, only rangeStart is added to the current range. - * @param rangeStart The first number to add to the range. - * @param rangeEnd The last number to add to the range. Defaults to rangeStart. - * @returns The range on which add was called. It contains the numbers from rangeStart to rangeEnd. - */ - add(rangeStart: number, rangeEnd?: number): DiscontinuousRange; - - /** - * Adds a range to the current range. - * @param rangeToAdd The range to union with the current range. - * @returns The range on which add was called. It contains the numbers in rangeToAdd. - */ - add(rangeToAdd: DiscontinuousRange): DiscontinuousRange; - - /** - * Removes the numbers from rangeStart to rangeEnd to the current range. - * If rangeEnd is not defined, only rangeStart is removed from the current range. - * @param rangeStart The first number to remove from the range. - * @param rangeEnd The last number to remove from the range. Defaults to rangeStart. - * @returns The range on which subtract was called. It does not contain the numbers from rangeStart to rangeEnd. - */ - subtract(rangeStart: number, rangeEnd?: number): DiscontinuousRange; - - /** - * Removes rangeToRemove from the current range. - * @param rangeToRemove The range to exclude from the current range. - * @returns The range on which subtract was called. It contains the numbers in rangeToRemove. - */ - subtract(rangeToRemove: DiscontinuousRange): DiscontinuousRange; - - /** - * Returns the number in the discontinuous range at the specified index. - * @param index The index to lookup a number. - * @returns A number in the range. null if index is greater than the number of elements in the range. - */ - index(index: number): number | null; - - /** - * Returns a string representation of this discontinuous range in the format - * "[ rangeOneLow-rangeOneHigh, ... , rangeNLow-rangeNHigh ]" - * @returns A string representation of this discontinuous range. - */ - toString(): string; - - /** - * Returns a copy of this discontinuous range. - * @returns A deep clone of the current discontinuous range. - */ - clone(): DiscontinuousRange; -} - -export = DiscontinuousRange; \ No newline at end of file diff --git a/discontinuous-range/tslint.json b/discontinuous-range/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/discontinuous-range/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/dockerode/dockerode-tests.ts b/dockerode/dockerode-tests.ts deleted file mode 100644 index 3bd1c30097..0000000000 --- a/dockerode/dockerode-tests.ts +++ /dev/null @@ -1,58 +0,0 @@ -import * as Docker from 'dockerode'; - -// Code samples from Dockerode 'Getting started' -const docker = new Docker(); -const docker1 = new Docker({ socketPath: '/var/run/docker.sock' }); -const docker2 = new Docker({ host: 'http://192.168.1.10', port: 3000 }); -const docker3 = new Docker({ protocol: 'http', host: '127.0.0.1', port: 3000 }); -const docker4 = new Docker({ host: '127.0.0.1', port: 3000 }); - -const docker5 = new Docker({ - host: '192.168.1.10', - port: process.env.DOCKER_PORT || 2375, - ca: 'ca', - cert: 'cert', - key: 'key' -}); - -const docker6 = new Docker({ - protocol: 'https', // you can enforce a protocol - host: '192.168.1.10', - port: process.env.DOCKER_PORT || 2375, - ca: 'ca', - cert: 'cert', - key: 'key' -}); - -const container = docker.getContainer('container-id'); -container.inspect((err, data) => { - // NOOP -}); - -container.start((err, data) => { - // NOOP -}); - -container.remove((err, data) => { - // NOOP -}); - -docker.listContainers((err, containers) => { - containers.forEach(container => { - docker - .getContainer(container.Id) - .stop((err, data) => { - // NOOP - }); - }); -}); - -docker.buildImage('archive.tar', { t: 'imageName' }, (err, response) => { - // NOOP -}); - -docker.createContainer({ Tty: true }, (err, container) => { - container.start((err, data) => { - // NOOP - }); -}); \ No newline at end of file diff --git a/dockerode/index.d.ts b/dockerode/index.d.ts deleted file mode 100644 index 968199436a..0000000000 --- a/dockerode/index.d.ts +++ /dev/null @@ -1,644 +0,0 @@ -// Type definitions for dockerode 2.3 -// Project: https://github.com/apocas/dockerode -// Definitions by: Carl Winkler -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -import * as stream from 'stream'; -import * as events from 'events'; - - -declare namespace Dockerode { - interface Container { - inspect(options: {}, callback: Callback): void; - inspect(callback: Callback): void; - inspect(options?: {}): { id: string }; - - rename(options: {}, callback: Callback): void; - - update(options: {}, callback: Callback): void; - - top(options: {}, callback: Callback): void; - top(callback: Callback): void; - - changes(callback: Callback): void; - - export(callback: Callback): void; - - start(options: {}, callback: Callback): void; - start(callback: Callback): void; - - pause(options: {}, callback: Callback): void; - pause(callback: Callback): void; - - unpause(options: {}, callback: Callback): void; - unpause(callback: Callback): void; - - exec(options: {}, callback: Callback): void; - - commit(options: {}, callback: Callback): void; - commit(callback: Callback): void; - - stop(options: {}, callback: Callback): void; - stop(callback: Callback): void; - - restart(options: {}, callback: Callback): void; - restart(callback: Callback): void; - - kill(options: {}, callback: Callback): void; - kill(callback: Callback): void; - - resize(options: {}, callback: Callback): void; - resize(callback: Callback): void; - - wait(callback: Callback): void; - - remove(options: {}, callback: Callback): void; - remove(callback: Callback): void; - - /** Deprecated since RAPI v1.20 */ - copy(options: {}, callback: Callback): void; - /** Deprecated since RAPI v1.20 */ - copy(callback: Callback): void; - - getArchive(options: {}, callback: Callback): void; - - infoArchive(options: {}, callback: Callback): void; - - /** @param file Filename (will read synchronously), Buffer or stream */ - putArchive(file: string | Buffer | NodeJS.ReadableStream, options: {}, callback: Callback): void; - - logs(options: { stdout?: boolean, stderr?: boolean, follow?: boolean, since?: number, details?: boolean, tail?: number, timestamps?: boolean }, callback: Callback): void; - logs(callback: Callback): void; - - stats(options: {}, callback: Callback): void; - stats(callback: Callback): void; - - attach(options: {}, callback: Callback): void; - - modem: any; - id?: string; - } - - interface Image { - inspect(callback: Callback): void; - - history(callback: Callback): void; - - get(callback: Callback): void; - - push(options: {}, callback: Callback): void; - push(callback: Callback): void; - - tag(options: {}, callback: Callback): void; - tag(callback: Callback): void; - - remove(options: {}, callback: Callback): void; - remove(callback: Callback): void; - - modem: any; - id?: string; - } - - interface Volume { - inspect(callback: Callback): void; - - remove(options: {}, callback: Callback): void; - remove(callback: Callback): void; - - modem: any; - name?: string; - } - - interface Service { - inspect(callback: Callback): void; - - remove(options: {}, callback: Callback): void; - remove(callback: Callback): void; - - update(options: {}, callback: Callback): void; - - modem: any; - id?: string; - } - - interface Task { - inspect(callback: Callback): void; - - modem: any; - id?: string; - } - - interface Node { - inspect(callback: Callback): void; - - modem: any; - id?: string; - } - - interface Network { - inspect(callback: Callback): void; - - remove(options: {}, callback: Callback): void; - remove(callback: Callback): void; - - connect(options: {}, callback: Callback): void; - connect(callback: Callback): void; - - disconnect(options: {}, callback: Callback): void; - disconnect(callback: Callback): void; - - modem: any; - id?: string; - } - - interface Exec { - inspect(callback: Callback): void; - - start(options: {}, callback: Callback): void; - - resize(options: {}, callback: Callback): void; - - modem: any; - id?: string; - } - - interface ImageInfo { - Id: string; - ParentId: string; - RepoTags: string[]; - RepoDigests?: string[]; - Created: number; - Size: number; - VirtualSize: number; - Labels: { [label: string]: string }; - } - - interface ContainerInfo { - Id: string; - Names: string[]; - Image: string; - ImageID: string; - Command: string; - Created: number; - Ports: Port[]; - Labels: { [label: string]: string }; - State: string; - Status: string; - HostConfig: { - NetworkMode: string; - }; - NetworkSettings: { - Networks: { [networkType: string]: NetworkInfo } - }; - } - - interface Port { - IP: string; - PrivatePort: number; - PublicPort: number; - Type: string; - } - - interface NetworkInfo { - IPAMConfig?: any; - Links?: any; - Aliases?: any; - NetworkID: string; - EndpointID: string; - Gateway: string; - IPAddress: string; - IPPrefixLen: number; - IPv6Gateway: string; - GlobalIPv6Address: string; - GlobalIPv6PrefixLen: number; - MacAddress: string; - } - - interface ContainerInspectInfo { - Id: string; - Created: string; - Path: string; - Args: string[]; - State: { - Status: string; - Running: boolean; - Paused: boolean; - Restarting: boolean; - OOMKilled: boolean; - Dead: boolean; - Pid: number; - ExitCode: number; - Error: string; - StartedAt: string; - FinishedAt: string; - }; - Image: string; - ResolvConfPath: string; - HostnamePath: string; - HostsPath: string; - LogPath: string; - Name: string; - RestartCount: number; - Driver: string; - MountLabel: string; - ProcessLabel: string; - AppArmorProfile: string; - ExecIDs?: any; - HostConfig: HostConfig; - GraphDriver: { - Name: string; - Data: { - DeviceId: string; - DeviceName: string; - DeviceSize: string; - } - }; - Mounts: Array<{ - Source: string; - Destination: string; - Mode: string; - RW: boolean; - Propagation: string; - }>; - Config: { - Hostname: string; - Domainname: string; - User: string; - AttachStdin: boolean; - AttachStdout: boolean; - AttachStderr: boolean; - ExposedPorts: { [portAndProtocol: string]: {} }; - Tty: boolean; - OpenStdin: boolean; - StdinOnce: boolean; - Env: string[]; - Cmd: string[]; - Image: string; - Volumes: { [volume: string]: {} }; - WorkingDir: string; - Entrypoint?: any; - OnBuild?: any; - Labels: { [label: string]: string } - }; - NetworkSettings: { - Bridge: string; - SandboxID: string; - HairpinMode: boolean; - LinkLocalIPv6Address: string; - LinkLocalIPv6PrefixLen: number; - Ports: { - [portAndProtocol: string]: { - HostIp: string; - HostPort: string; - } - }; - SandboxKey: string; - SecondaryIPAddresses?: any; - SecondaryIPv6Addresses?: any; - EndpointID: string; - Gateway: string; - GlobalIPv6Address: string; - GlobalIPv6PrefixLen: number; - IPAddress: string; - IPPrefixLen: number; - IPv6Gateway: string; - MacAddress: string; - Networks: { - [type: string]: { - IPAMConfig?: any; - Links?: any; - Aliases?: any; - NetworkID: string; - EndpointID: string; - Gateway: string; - IPAddress: string; - IPPrefixLen: number; - IPv6Gateway: string; - GlobalIPv6Address: string; - GlobalIPv6PrefixLen: number; - MacAddress: string; - } - } - }; - } - - interface HostConfig { - Binds: string[]; - ContainerIDFile: string; - LogConfig: { - Type: string; - Config: any; - }; - NetworkMode: string; - PortBindings?: any; - RestartPolicy: { - Name: string; - MaximumRetryCount: number; - }; - VolumeDriver: string; - VolumesFrom?: any; - CapAdd?: any; - CapDrop?: any; - Dns: any[]; - DnsOptions: any[]; - DnsSearch: any[]; - ExtraHosts?: any; - IpcMode: string; - Links?: any; - OomScoreAdj: number; - PidMode: string; - Privileged: boolean; - PublishAllPorts: boolean; - ReadonlyRootfs: boolean; - SecurityOpt?: any; - UTSMode: string; - ShmSize: number; - ConsoleSize: number[]; - Isolation: string; - CpuShares: number; - CgroupParent: string; - BlkioWeight: number; - BlkioWeightDevice?: any; - BlkioDeviceReadBps?: any; - BlkioDeviceWriteBps?: any; - BlkioDeviceReadIOps?: any; - BlkioDeviceWriteIOps?: any; - CpuPeriod: number; - CpuQuota: number; - CpusetCpus: string; - CpusetMems: string; - Devices?: any; - KernelMemory: number; - Memory: number; - MemoryReservation: number; - MemorySwap: number; - MemorySwappiness: number; - OomKillDisable: boolean; - PidsLimit: number; - Ulimits?: any; - } - - interface ImageInspectInfo { - Id: string; - RepoTags: string[]; - RepoDigests: string[]; - Parent: string; - Comment: string; - Created: string; - Container: string; - ContainerConfig: - { - Hostname: string; - Domainname: string; - User: string; - AttachStdin: boolean; - AttachStdout: boolean; - AttachStderr: boolean; - ExposedPorts: { [portAndProtocol: string]: {} }; - Tty: boolean; - OpenStdin: boolean; - StdinOnce: boolean; - Env: string[]; - Cmd: string[]; - ArgsEscaped: boolean; - Image: string; - Volumes: { [path: string]: {} }, - WorkingDir: string; - Entrypoint?: any; - OnBuild?: any[]; - Labels: { [label: string]: string } - }; - DockerVersion: string; - Author: string; - Config: - { - Hostname: string; - Domainname: string; - User: string; - AttachStdin: boolean; - AttachStdout: boolean; - AttachStderr: boolean; - ExposedPorts: { [portAndProtocol: string]: {} } - Tty: boolean; - OpenStdin: boolean; - StdinOnce: boolean; - Env: string[]; - Cmd: string[]; - ArgsEscaped: boolean; - Image: string; - Volumes: { [path: string]: {} }, - WorkingDir: string; - Entrypoint?: any; - OnBuild: any[]; - Labels: { [label: string]: string } - }; - Architecture: string; - Os: string; - Size: number; - VirtualSize: number; - GraphDriver: - { - Name: string; - Data: - { - DeviceId: string; - DeviceName: string; - DeviceSize: string; - } - }; - } - - interface ContainerCreateOptions { - name?: string; - Hostname?: string; - Domainname?: string; - User?: string; - AttachStdin?: boolean; - AttachStdout?: boolean; - AttachStderr?: boolean; - Tty?: boolean; - OpenStdin?: boolean; - StdinOnce?: boolean; - Env?: string[]; - Cmd?: string[]; - Entrypoint?: string; - Image?: string; - Labels?: { [label: string]: string }; - Volumes?: { [volume: string]: {} }; - WorkingDir?: string; - NetworkDisabled?: boolean; - MacAddress?: boolean; - ExposedPorts?: { [port: string]: {} }; - StopSignal?: string; - HostConfig?: { - Binds?: string[]; - Links?: string[]; - Memory?: number; - MemorySwap?: number; - MemoryReservation?: number; - KernelMemory?: number; - CpuPercent?: number; - CpuShares?: number; - CpuPeriod?: number; - CpuQuota?: number; - CpusetMems?: string; - MaximumIOps?: number; - MaxmimumIOBps?: number; - BlkioWeightDevice?: Array<{}>; - BlkioDeviceReadBps?: Array<{}>; - BlkioDeviceReadIOps?: Array<{}>; - BlkioDeviceWriteBps?: Array<{}>; - BlkioDeviceWriteIOps?: Array<{}>; - MemorySwappiness?: number; - OomKillDisable?: boolean; - OomScoreAdj?: number; - PidMode?: string; - PidsLimit?: number; - PortBindings?: { [portAndProtocol: string]: Array<{ [index: string]: string }> }; - PublishAllPorts?: boolean; - Privileged?: boolean; - ReadonlyRootfs?: boolean; - Dns?: string[]; - DnsOptions?: string[]; - DnsSearch?: string[]; - ExtraHosts?: any; - VolumesFrom?: string[]; - CapAdd?: string[]; - CapDrop?: string[]; - GroupAdd?: string[]; - RestartPolicy?: { [index: string]: number | string }; - NetworkMode?: string; - Devices?: any[]; - Sysctls?: { [index: string]: string }; - Ulimits?: Array<{}>; - LogConfig?: { [index: string]: string | {} }; - SecurityOpt?: { [index: string]: any }; - CgroupParent?: string; - VolumeDriver?: string; - ShmSize?: number; - }; - NetworkingConfig?: { - EndpointsConfig?: { - [index: string]: any; - isolated_nw?: { - [index: string]: any; - IPAMConfig?: { - IPv4Address?: string; - IPv6Adress?: string; - LinkLocalIPs?: string[]; - } - Links?: string[]; - Aliases?: string[]; - } - } - }; - } - - interface DockerOptions { - socketPath?: string; - host?: string; - port?: number; - ca?: string; - cert?: string; - key?: string; - protocol?: "https" | "http"; - timeout?: number; - } -} - -type Callback = (error?: any, result?: T) => void; - -declare class Dockerode { - constructor(options?: Dockerode.DockerOptions); - - createContainer(options: Dockerode.ContainerCreateOptions, callback: Callback): void; - - createImage(options: {}, callback: Callback): void; - createImage(auth: any, options: {}, callback: Callback): void; - - loadImage(file: string, options: {}, callback: Callback): void; - loadImage(file: string, callback: Callback): void; - - importImage(file: string, options: {}, callback: Callback): void; - importImage(file: string, callback: Callback): void; - - checkAuth(options: any, callback: Callback): void; - - buildImage(file: string | NodeJS.ReadableStream, options: {}, callback: Callback): void; - buildImage(file: string | NodeJS.ReadableStream, callback: Callback): void; - - getContainer(id: string): Dockerode.Container; - - getImage(name: string): Dockerode.Image; - - getVolume(name: string): Dockerode.Volume; - - getService(id: string): Dockerode.Service; - - getTask(id: string): Dockerode.Task; - - getNode(id: string): Dockerode.Node; - - getNetwork(id: string): Dockerode.Network; - - getExec(id: string): Dockerode.Exec; - - listContainers(options: {}, callback: Callback): void; - listContainers(callback: Callback): void; - - listImages(options: {}, callback: Callback): void; - listImages(callback: Callback): void; - - listServices(options: {}, callback: Callback): void; - listServices(callback: Callback): void; - - listNodes(options: {}, callback: Callback): void; - listNodes(callback: Callback): void; - - listTasks(options: {}, callback: Callback): void; - listTasks(callback: Callback): void; - - listVolumes(options: {}, callback: Callback): void; - listVolumes(callback: Callback): void; - - listNetworks(options: {}, callback: Callback): void; - listNetworks(callback: Callback): void; - - createVolume(options: {}, callback: Callback): void; - - createService(options: {}, callback: Callback): void; - - createNetwork(options: {}, callback: Callback): void; - - searchImages(options: {}, callback: Callback): void; - - info(callback: Callback): void; - - version(callback: Callback): void; - - ping(callback: Callback): void; - - getEvents(options: {}, callback: Callback): void; - getEvents(callback: Callback): void; - - pull(repoTag: string, options: {}, callback: Callback, auth?: {}): Dockerode.Image; - - run(image: string, cmd: string[], outputStream: NodeJS.WritableStream, createOptions: {}, startOptions: {}, callback: Callback): events.EventEmitter; - run(image: string, cmd: string[], outputStream: NodeJS.WritableStream, startOptions: {}, callback: Callback): events.EventEmitter; - run(image: string, cmd: string[], outputStream: NodeJS.WritableStream, callback: Callback): events.EventEmitter; - run(image: string, cmd: string[], outputStream: NodeJS.WritableStream, createOptions: {}, callback: Callback): events.EventEmitter; - - swarmInit(options: {}, callback: Callback): void; - - swarmJoin(options: {}, callback: Callback): void; - - swarmLeave(options: {}, callback: Callback): void; - - swarmUpdate(options: {}, callback: Callback): void; - - modem: any; -} - -export = Dockerode; diff --git a/dockerode/tslint.json b/dockerode/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/dockerode/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/documentdb/documentdb-tests.ts b/documentdb/documentdb-tests.ts deleted file mode 100644 index f4a06d3fb7..0000000000 --- a/documentdb/documentdb-tests.ts +++ /dev/null @@ -1,150 +0,0 @@ - -import docDB = require('documentdb'); -var docDBClient = new docDB.DocumentClient('host', { masterKey: 'masterKey' }); - -docDBClient.createDatabase({ id: 'foo' }, undefined, (error, result) => { - - if (error) { - throw new Error(error.body); - } - else { - console.log('Created database: ' + result.id); - } -}); - -var dbQuerySpec: docDB.SqlQuerySpec = {query: 'SELECT * FROM d WHERE d.meta = @meta', parameters: [{name: '@meta', value: {creator: 'John Smith', type: 'documentdb'}}]}; -docDBClient.queryDatabases(dbQuerySpec).toArray((error, result) => { - - if (error) { - throw new Error(error.body); - } - else { - if (result.length < 1) { - throw new Error('Database foo not found'); - } - else { - console.log('Found database: ' + result[0].id); - } - } -}); - -docDBClient.createCollection('database', { id: 'foo' }, undefined, (error, result) => { - - if (error) { - throw new Error(error.body); - } - else { - console.log('Created collection: ' + result.id); - } -}); - -var procedure: docDB.Procedure = { - id: 'procedure-one', - body: function () { - console.log('foo'); - } -}; - -docDBClient.createStoredProcedure('collection', procedure, undefined, (error, result) => { - - if (error) { - throw new Error(error.body); - } - else { - console.log('Created procedure: ' + result.id); - } -}); - -var userDefinedFunction: docDB.UserDefinedFunction = { - id: 'udf1', - body: function () { - console.log('foo'); - } -}; - -docDBClient.createUserDefinedFunction('collection', userDefinedFunction, undefined, (error, result) => { - if (error) { - throw new Error(error.body); - } - else { - console.log('Created function: ' + result.id); - } -}); - -docDBClient.queryUserDefinedFunctions('collection', "SELECT * FROM root", undefined).toArray((error, results) => { - if (error) { - throw new Error(error.body); - } - else { - console.log('Number of functions in collection: ' + results.length); - } -}); - -var trigger: docDB.Trigger = { - id: 'trigger-one', - body: function () { - console.log('bar'); - }, - triggerType: 'pre', - triggerOperation: 'all' -}; - -docDBClient.createTrigger('collection', trigger, undefined, (error, result) => { - - if (error) { - throw new Error(error.body); - } - else { - console.log('Created trigger: ' + result.id); - } -}); - -var triggerQuerySpec: docDB.SqlQuerySpec = {query: 'SELECT * FROM t WHERE t.id = @id', parameters: [{name: '@id', value: 'trigger-foo'}]}; -docDBClient.queryTriggers('collection', triggerQuerySpec).toArray((error, result) => { - - if (error) { - throw new Error(error.body); - } - else { - if (result.length < 1) { - throw new Error('Trigger trigger-foo not found'); - } - else { - console.log('Found trigger: ' + result[0].id); - } - } -}); - -var document: docDB.NewDocument<{ val: string }> = { - id: '10' -}; - -docDBClient.createDocument('collection', document, undefined, (error, result) => { - - if (error) { - throw new Error(error.body); - } - else { - console.log('Created document: ' + result.id); - - docDBClient.replaceDocument(result._self, document, undefined, (subError, subResult) => { - - if (subError) { - throw new Error(subError.body); - } - else { - console.log('Replaced document: ' + subResult.id); - } - }) - } -}); - -docDBClient.executeStoredProcedure('procedure', [10, 'foo'], (error, result) => { - - if (error) { - throw new Error(error.body); - } - else { - console.log('Procedure result: ' + result); - } -}); \ No newline at end of file diff --git a/documentdb/index.d.ts b/documentdb/index.d.ts deleted file mode 100644 index 048825b492..0000000000 --- a/documentdb/index.d.ts +++ /dev/null @@ -1,452 +0,0 @@ -// Type definitions for DocumentDB -// Project: https://github.com/Azure/azure-documentdb-node -// Definitions by: Noel Abrahams , Brett Gutstein -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped/documentdb - - - -/** The feed options and query methods.*/ -interface FeedOptions { - - /** Max number of items to be returned in the enumeration operation. */ - maxItemCount?: number; - - /** Opaque token for continuing the enumeration. */ - continuation?: string; - - /** Token for use with Session consistency. */ - sessionToken?: string; -} - -/** Options that can be specified for a request issued to the DocumentDB servers. */ -interface RequestOptions { - - /** Indicates what is the pre trigger to be invoked before the operation. */ - preTriggerInclude?: string; - - /** Indicates what is the post trigger to be invoked after the operation. */ - postTriggerInclude?: string; - - /** Conditions Associated with the request. */ - accessCondition?: { - - /** Conditional HTTP method header type.*/ - type: string; - - /** Conditional HTTP method header value.*/ - condition: string - }; - - /** Specifies indexing directives (index, do not index ..etc).*/ - indexingDirective?: string; - - /** Consistency level required by the client. */ - consistencyLevel?: string; - - /** Token for use with Session consistency.*/ - sessionToken?: string; - - /** Expiry time (in seconds) for resource token associated with permission (applicable only for requests on permissions).*/ - resourceTokenExpirySeconds?: number; - - /** Disables the automatic id generation. If id is missing in the body and this option is true, an error will be returned. */ - disableAutomaticIdGeneration?: boolean; -} - -/** The Sql query parameter. */ -interface SqlParameter { - /** The name of the parameter. */ - name: string; - - /** The value of the parameter. */ - value: any; -} - -/** The Sql query specification. */ -interface SqlQuerySpec { - /** The body of the query. */ - query: string; - - /** The array of SqlParameters. */ - parameters: SqlParameter[]; -} - -/** Represents the error object returned from a failed query. */ -interface QueryError { - - /** The response code corresponding to the error. */ - code: number; - - /** A string representing the error information. */ - body: string; // { code: string; message: string; }; -} - -/** -* The callback to execute after the request execution. -* @param error - Will contain error information if an error occurs, undefined otherwise. -* @param resource - An object that represents the requested resource (Db, collection, document ... etc) if no error happens. -* @param responseHeaders - An object that contain the response headers. -*/ -interface RequestCallback { - (error: QueryError, resource: TResult, responseHeaders: any): void; -} - -/** Represents the result returned from a query. */ -interface QueryIterator { - current(): TResultRow; - executeNext(callback: (error: QueryError, result: TResultRow[], responseHeaders? : any) => void): void; - forEach(iteratorFunction : (error: QueryError, element: TResultRow, responseHeaders? : any) => void): void; - hasMoreResults(): boolean; - nextItem(callback: (error: QueryError, item: TResultRow, responseHeaders? : any) => void): void; - reset(): void; - toArray(callback: (error: QueryError, result: TResultRow[], responseHeaders? : any) => void): void -} - -/** Reprents an object with a unique identifier. */ -interface UniqueId { - - /** The user-defined unique identifier for a document or other DocumentDB object (database, collection, procedure...) */ - id: string; -} - -/** Represents the common meta data for all DocumentDB objects. */ -interface AbstractMeta extends UniqueId { - - /** The self link.*/ - _self: string; - - /** The time the object was created.*/ - _ts: string; - - _rid?: string; - _etag?: string; - - _attachments?: string; -} - -/** Represents a custom document for storing in DocumentDB */ -interface NewDocument extends UniqueId { - - /** A custom property for containing the actual JSON object representing the document. - * Define a custom property in order to disambiguate the JSON document from the metadata added by Azure. - * This property is optional and the name is application-specific. - */ - // doc: TContent; -} - -/** Represents a document retrieved from storage. - * This differs from a new document by the properties in AbstractMeta, which are added by the system. - */ -interface RetrievedDocument extends NewDocument, AbstractMeta { - -} - -/** Represents the meta data for a database. */ -interface DatabaseMeta extends AbstractMeta { -} - -/** Represents the meta data for a collection. */ -interface CollectionMeta extends AbstractMeta { -} - -/** Represents the meta data for a stored procedure. */ -interface ProcedureMeta extends AbstractMeta { - body: string; -} - -/** Represents the meta data for a user-defined function. */ -interface UserDefinedFunctionMeta extends AbstractMeta { -} - -/** Represents the meta data for a trigger. */ -interface TriggerMeta extends AbstractMeta { - body: string; - triggerType: string; - triggerOperation: string; -} - -/** An object that is used for authenticating requests and must contains one of the options. */ -export interface AuthOptions { - - /** The authorization master key to use to create the client. */ - masterKey?: string; - - /** An object that contains resources tokens. Keys for the object are resource Ids and values are the resource tokens.*/ - resourceTokens?: any; - - /** An array of {@link Permission} objects. */ - permissionFeed?: any[]; -} - -/** Represents a DocumentDB stored procecedure. */ -export interface Procedure extends UniqueId { - - /** The function representing the stored procedure. */ - body(...params: any[]): void; -} - -/** Represents a DocumentDB user-defined function. */ -export interface UserDefinedFunction extends UniqueId { - - /** The function representing the user-defined function. */ - body(...params: any[]): void; -} - -/** Represents a DocumentDB trigger. */ -export interface Trigger extends UniqueId { - /** The type of the trigger. Should be either 'pre' or 'post'. */ - triggerType: string; - - /** The trigger operation. Should be one of 'all', 'create', 'update', 'delete', or 'replace'. */ - triggerOperation: string; - - /** The function representing the trigger. */ - body(...params: any[]): void; -} - -/** Represents DocumentDB collection. */ -export interface Collection extends UniqueId { - - indexingPolicy?: IndexingPolicy; -} - -/** The Indexing Path -*

    Indexing paths hints to optimize indexing.
    -* Indexing paths allow tradeoff between indexing storage and query performance -*

    -*/ -interface IndexingPath { - - /** The indexing type(range or hash) {@link IndexType}.*/ - IndexType: string; - - /** Path to be indexed.*/ - Path: string; - - /** Precision for this particular Index type for numeric data. */ - NumericPrecision: number; - - /** Precision for this particular Index type for string data. */ - StringPrecision: number; -} - -/** The Indexing Policy represents the indexing policy configuration for a collection. */ -interface IndexingPolicy { - - /** Specifies whether automatic indexing is enabled for a collection. -

    In automatic indexing, documents can be explicitly excluded from indexing using {@link RequestOptions}. - In manual indexing, documents can be explicitly included.

    */ - automatic: boolean; - - /** The indexing mode (consistent or lazy) {@link IndexingMode}. */ - indexingMode: string; - - /** An array of {@link IndexingPath} represents The paths to be incuded for indexing. */ - IncludedPaths: IndexingPath[]; - - /** An array of strings representing the paths to be excluded from indexing. */ - ExcludedPaths: string[]; -} - -/** Provides a client-side logical representation of the Azure DocumentDB database account. This client is used to configure and execute requests against the service. - */ -export declare class DocumentClient { - /** - * Constructs a DocumentClient. - * @param urlConnection - The service endpoint to use to create the client. - * @param auth - An object that is used for authenticating requests and must contains one of the options. - * @param [connectionPolicy] - An instance of {@link ConnectionPolicy} class. This parameter is optional and the default connectionPolicy will be used if omitted. - * @param [consistencyLevel] - An optional parameter that represents the consistency level. It can take any value from {@link ConsistencyLevel}. - */ - constructor(urlConnection: string, auth: AuthOptions, connectionPolicy?: any, consistencyLevel?: string); - - /** Send a request for creating a database. - *

    - * A database manages users, permissions and a set of collections.
    - * Each Azure DocumentDB Database Account is able to support multiple independent named databases, with the database being the logical container for data.
    - * Each Database consists of one or more collections, each of which in turn contain one or more documents. Since databases are an an administrative resource, the Service Master Key will be required in order to access and successfully complete any action using the User APIs.
    - *

    - * @param body - A json object that represents The database to be created. - * @param [options] - The request options. - * @param callback - The callback for the request. - */ - public createDatabase(body: UniqueId, options: RequestOptions, callback: RequestCallback): void; - - /** - * Creates a collection. - *

    - * A collection is a named logical container for documents.
    - * A database may contain zero or more named collections and each collection consists of zero or more JSON documents.
    - * Being schema-free, the documents in a collection do not need to share the same structure or fields.
    - * Since collections are application resources, they can be authorized using either the master key or resource keys.
    - *

    - * @param databaseLink - The self-link of the database. - * @param body - Represents the body of the collection. - * @param [options] - The request options. - * @param callback - The callback for the request. - */ - public createCollection(databaseLink: string, body: Collection, options: RequestOptions, callback: RequestCallback): void; - - /** - * Create a StoredProcedure. - *

    - * DocumentDB allows stored procedures to be executed in the storage tier, directly against a document collection. The script
    - * gets executed under ACID transactions on the primary storage partition of the specified collection. For additional details,
    - * refer to the server-side JavaScript API documentation. - *

    - * @param collectionLink - The self-link of the collection. - * @param procedure - Represents the body of the stored procedure. - * @param [options] - The request options. - * @param callback - The callback for the request. - */ - public createStoredProcedure(collectionLink: string, procedure: Procedure, options: RequestOptions, callback: RequestCallback): void; - - /** - * Create a UserDefinedFunction. - *

    - * DocumentDB supports JavaScript UDFs which can be used inside queries, stored procedures and triggers.
    - * For additional details, refer to the server-side JavaScript API documentation. - *

    - * @param collectionLink - The self-link of the collection. - * @param udf - Represents the body of the userDefinedFunction. - * @param [options] - The request options. - * @param callback - The callback for the request. - */ - public createUserDefinedFunction(collectionLink: string, udf: UserDefinedFunction, options: RequestOptions, callback: RequestCallback): void; - - /** - * Create a trigger. - *

    - * DocumentDB supports pre and post triggers defined in JavaScript to be executed on creates, updates and deletes.
    - * For additional details, refer to the server-side JavaScript API documentation. - *

    - * @param collectionLink - The self-link of the collection. - * @param trigger - Represents the body of the trigger. - * @param [options] - The request options. - * @param callback - The callback for the request. - */ - public createTrigger(collectionLink: string, trigger: Trigger, options: RequestOptions, callback: RequestCallback): void; - - /** - * Create a document. - *

    - * There is no set schema for JSON documents. They may contain any number of custom properties as well as an optional list of attachments.
    - * A Document is an application resource and can be authorized using the master key or resource keys - *

    - * @param collectionLink - The self-link of the collection. - * @param document - Represents the body of the document. Can contain any number of user defined properties. - * @param [options] - The request options. - * @param callback - The callback for the request. - */ - public createDocument(collectionSelfLink: string, document: NewDocument, options: RequestOptions, callback: RequestCallback>): void; - - /** - * Execute the StoredProcedure represented by the object. - * @param procedureLink - The self-link of the stored procedure. - * @param [params] - Represents the parameters of the stored procedure. - * @param callback - The callback for the request. - */ - public executeStoredProcedure(procedureLink: string, params: any[], callback: RequestCallback): void; - - /** Lists all databases that satisfy a query. - * @param query - A SQL query string. - * @param [options] - The feed options. - * @returns - An instance of QueryIterator to handle reading feed. - */ - public queryDatabases(query: string | SqlQuerySpec): QueryIterator; - - /** - * Query the collections for the database. - * @param databaseLink - The self-link of the database. - * @param query - A SQL query string. - * @param [options] - Represents the feed options. - * @returns - An instance of queryIterator to handle reading feed. - */ - public queryCollections(databaseLink: string, query: string | SqlQuerySpec): QueryIterator; - - /** - * Query the storedProcedures for the collection. - * @param collectionLink - The self-link of the collection. - * @param query - A SQL query string. - * @param [options] - Represents the feed options. - * @returns - An instance of queryIterator to handle reading feed. - */ - public queryStoredProcedures(collectionLink: string, query: string | SqlQuerySpec): QueryIterator; - - /** - * Query the user-defined functions for the collection. - * @param collectionLink - The self-link of the collection. - * @param query - A SQL query string. - * @param [options] - Represents the feed options. - * @returns - An instance of queryIterator to handle reading feed. - */ - public queryUserDefinedFunctions(collectionLink: string, query: string | SqlQuerySpec, options?: FeedOptions): QueryIterator; - - /** - * Query the documents for the collection. - * @param collectionLink - The self-link of the collection. - * @param query - A SQL query string. - * @param [options] - Represents the feed options. - * @returns - An instance of queryIterator to handle reading feed. - */ - public queryDocuments(collectionLink: string, query: string | SqlQuerySpec, options?: FeedOptions): QueryIterator>; - - /** - * Query the triggers for the collection. - * @param {string} collectionLink - The self-link of the collection. - * @param {SqlQuerySpec | string} query - A SQL query. - * @param {FeedOptions} [options] - Represents the feed options. - * @returns {QueryIterator} - An instance of queryIterator to handle reading feed. - */ - public queryTriggers(collectionLink: string, query: string | SqlQuerySpec, options?: FeedOptions): QueryIterator; - - /** - * Delete the document object. - * @param documentLink - The self-link of the document. - * @param [options] - The request options. - * @param callback - The callback for the request. - */ - public deleteDocument(documentLink: string, options: RequestOptions, callback: RequestCallback): void; - - /** - * Delete the database object. - * @param databaseLink - The self-link of the database. - * @param [options] - The request options. - * @param callback - The callback for the request. - */ - public deleteDatabase(databaseLink: string, options: RequestOptions, callback: RequestCallback): void; - - /** - * Delete the collection object. - * @param collectionLink - The self-link of the collection. - * @param [options] - The request options. - * @param callback - The callback for the request. - */ - public deleteCollection(collectionLink: string, options: RequestOptions, callback: RequestCallback): void; - - /** - * Delete the StoredProcedure object. - * @param procedureLink - The self-link of the stored procedure. - * @param [options] - The request options. - * @param callback - The callback for the request. - */ - public deleteStoredProcedure(procedureLink: string, options: RequestOptions, callback: RequestCallback): void; - - /** - * Replace the document object. - * @param {string} documentLink - The self-link of the document. - * @param {object} document - Represent the new document body. - * @param {RequestOptions} [options] - The request options. - * @param {RequestCallback} callback - The callback for the request. - */ - public replaceDocument(documentLink: string, document: NewDocument, options: RequestOptions, callback: RequestCallback>): void; - - /** - * Replace the StoredProcedure object. - * @param procedureLink - The self-link of the stored procedure. - * @param procedure - Represent the new procedure body. - * @param [options] - The request options. - * @param callback - The callback for the request. - */ - public replaceStoredProcedure(procedureLink: string, procedure: Procedure, options: RequestOptions, callback: RequestCallback): void; -} diff --git a/documentdb/tsconfig.json b/documentdb/tsconfig.json deleted file mode 100644 index 552149e7db..0000000000 --- a/documentdb/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "documentdb-tests.ts" - ] -} \ No newline at end of file diff --git a/dookie/dookie-tests.ts b/dookie/dookie-tests.ts deleted file mode 100644 index 44cd6ec7ac..0000000000 --- a/dookie/dookie-tests.ts +++ /dev/null @@ -1,8 +0,0 @@ - -import {push, pull} from './index'; - -(async () => { - - await push('mongodb://localhost:27017/test', {test: [{ok: 1}, {ok: 2}]}); - -})(); diff --git a/dookie/index.d.ts b/dookie/index.d.ts deleted file mode 100644 index bd3f6ea06b..0000000000 --- a/dookie/index.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Type definitions for dookie 0.1 -// Project: https://github.com/vkarpov15/dookie#readme -// Definitions by: Swanest -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -interface PushOpts { - filename?: string; - dropDatabase: boolean; -} - -// Our exports: -export function push(uri: string, data: any, opts?: PushOpts): Promise; - -export function pull(uri: string): Promise; - -export function pullToStream(uri: string, stream: any): Promise; - -// Make this available as a global for non-module code. -export as namespace dookie; diff --git a/dookie/tslint.json b/dookie/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/dookie/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/dot/dot-tests.ts b/dot/dot-tests.ts deleted file mode 100644 index 0987f9eb46..0000000000 --- a/dot/dot-tests.ts +++ /dev/null @@ -1,32 +0,0 @@ - - -var headertmpl = "

    {{=it.title}}

    "; - -var pagetmpl = "

    Here is the page using a header template< / h2 >\n" - + "{{#def.header}}\n" - + "{{=it.name}}"; - -var customizableheadertmpl = "{{#def.header}}" - + "\n{{#def.mycustominjectionintoheader || ''} }"; - -var pagetmplwithcustomizableheader = "

    Here is the page with customized header template

    \n" - + "{{##def.mycustominjectionintoheader:\n" - + "
    {{=it.title}} is not {{=it.name}}
    \n" - + "#}}\n" - + "{{#def.customheader}}\n" - + "{{=it.name}}"; - -var def = { - header: headertmpl, - customheader: customizableheadertmpl -}; -var data = { - title: "My title", - name: "My name" -}; - -var pagefn = doT.template(pagetmpl, undefined, def); -var content = pagefn(data); - -pagefn = doT.template(pagetmplwithcustomizableheader, undefined, def); -var contentcustom = pagefn(data); diff --git a/dot/index.d.ts b/dot/index.d.ts deleted file mode 100644 index 893b611d6c..0000000000 --- a/dot/index.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -// Type definitions for doT 1.1 -// Project: https://github.com/olado/doT -// Definitions by: ZombieHunter -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export as namespace doT; - -/** Version number */ -export const version: string; - -/** Default template settings */ -export const templateSettings: TemplateSettings; - -type RenderFunction = (...args: any[]) => string; - -/** Compile template */ -export function template(tmpl: string, c?: TemplateSettings, def?: {}): RenderFunction; - -/** For express */ -export function compile(tmpl: string, def?: {}): RenderFunction; - -interface TemplateSettings { - evaluate: RegExp; - interpolate: RegExp; - encode: RegExp; - use: RegExp; - useParams: RegExp; - define: RegExp; - defineParams: RegExp; - conditional: RegExp; - iterate: RegExp; - varname: string; - strip: boolean; - append: boolean; - selfcontained: boolean; -} - -declare global { - interface String { - encodeHTML(): string; - } -} diff --git a/dot/tslint.json b/dot/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/dot/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/dotenv/tslint.json b/dotenv/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/dotenv/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/draft-js/index.d.ts b/draft-js/index.d.ts deleted file mode 100644 index 1805a17ab0..0000000000 --- a/draft-js/index.d.ts +++ /dev/null @@ -1,954 +0,0 @@ -// Type definitions for Draft.js v0.9.0 -// Project: https://facebook.github.io/draft-js/ -// Definitions by: Dmitry Rogozhny , Eelco Lempsink -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 - -import * as React from 'react'; -import * as Immutable from 'immutable'; - -type SyntheticKeyboardEvent = React.KeyboardEvent<{}>; -type SyntheticEvent = React.SyntheticEvent<{}>; - -declare namespace Draft { - namespace Component { - namespace Base { - import DraftEditorCommand = Draft.Model.Constants.DraftEditorCommand; - import DraftBlockType = Draft.Model.Constants.DraftBlockType; - import DraftDragType = Draft.Model.Constants.DraftDragType; - import DraftHandleValue = Draft.Model.Constants.DraftHandleValue; - - import EditorState = Draft.Model.ImmutableData.EditorState; - import ContentBlock = Draft.Model.ImmutableData.ContentBlock; - import SelectionState = Draft.Model.ImmutableData.SelectionState; - import DraftInlineStyle = Draft.Model.ImmutableData.DraftInlineStyle; - - import DraftBlockRenderConfig = Draft.Model.ImmutableData.DraftBlockRenderConfig; - - type DraftBlockRenderMap = Immutable.Map; - - /** - * `DraftEditor` is the root editor component. It composes a `contentEditable` - * div, and provides a wide variety of useful function props for managing the - * state of the editor. See `DraftEditorProps` for details. - */ - class DraftEditor extends React.Component { - // Force focus back onto the editor node. - focus(): void; - // Remove focus from the editor node. - blur(): void; - } - - /** - * The two most critical props are `editorState` and `onChange`. - * - * The `editorState` prop defines the entire state of the editor, while the - * `onChange` prop is the method in which all state changes are propagated - * upward to higher-level components. - * - * These props are analagous to `value` and `onChange` in controlled React - * text inputs. - */ - interface DraftEditorProps { - editorState: EditorState; - onChange(editorState: EditorState): void; - - placeholder?: string; - - // Specify whether text alignment should be forced in a direction - // regardless of input characters. - textAlignment?: DraftTextAlignment; - - // For a given `ContentBlock` object, return an object that specifies - // a custom block component and/or props. If no object is returned, - // the default `TextEditorBlock` is used. - blockRendererFn?(block: ContentBlock): any; - - // Function that allows to define class names to apply to the given block when it is rendered. - blockStyleFn?(block: ContentBlock): string; - - // Provide a map of inline style names corresponding to CSS style objects - // that will be rendered for matching ranges. - customStyleMap?: any; - - // Provide a function that will construct CSS style objects given inline - // style names. - customStyleFn?: (style: DraftInlineStyle) => Object; - - // A function that accepts a synthetic key event and returns - // the matching DraftEditorCommand constant, or null if no command should - // be invoked. - keyBindingFn?(e: SyntheticKeyboardEvent): DraftEditorCommand; - keyBindingFn?(e: SyntheticKeyboardEvent): string; - - // Set whether the `DraftEditor` component should be editable. Useful for - // temporarily disabling edit behavior or allowing `DraftEditor` rendering - // to be used for consumption purposes. - readOnly?: boolean; - - // Note: spellcheck is always disabled for IE. If enabled in Safari, OSX - // autocorrect is enabled as well. - spellCheck?: boolean; - - // Set whether to remove all style information from pasted content. If your - // use case should not have any block or inline styles, it is recommended - // that you set this to `true`. - stripPastedStyles?: boolean; - - tabIndex?: number; - - ariaActiveDescendantID?: string; - ariaAutoComplete?: string; - ariaDescribedBy?: string; - ariaExpanded?: boolean; - ariaHasPopup?: boolean; - ariaLabel?: string; - ariaOwneeID?: string; - - webDriverTestID?: string; - - /** - * Cancelable event handlers, handled from the top level down. A handler - * that returns `handled` will be the last handler to execute for that event. - */ - - // Useful for managing special behavior for pressing the `Return` key. E.g. - // removing the style from an empty list item. - handleReturn?(e: SyntheticKeyboardEvent): DraftHandleValue, - - // Map a key command string provided by your key binding function to a - // specified behavior. - handleKeyCommand?(command: DraftEditorCommand): DraftHandleValue, - handleKeyCommand?(command: string): DraftHandleValue, - - - // Handle intended text insertion before the insertion occurs. This may be - // useful in cases where the user has entered characters that you would like - // to trigger some special behavior. E.g. immediately converting `:)` to an - // emoji Unicode character, or replacing ASCII quote characters with smart - // quotes. - handleBeforeInput?(chars: string): DraftHandleValue, - - handlePastedText?(text: string, html?: string): DraftHandleValue, - - handlePastedFiles?(files: Array): DraftHandleValue, - - // Handle dropped files - handleDroppedFiles?(selection: SelectionState, files: Array): DraftHandleValue, - - // Handle other drops to prevent default text movement/insertion behaviour - handleDrop?(selection: SelectionState, dataTransfer: Object, isInternal: DraftDragType): DraftHandleValue, - - /** - * Non-cancelable event triggers. - */ - onEscape?(e: SyntheticKeyboardEvent): void, - onTab?(e: SyntheticKeyboardEvent): void, - onUpArrow?(e: SyntheticKeyboardEvent): void, - onDownArrow?(e: SyntheticKeyboardEvent): void, - - onBlur?(e: SyntheticEvent): void, - onFocus?(e: SyntheticEvent): void, - - // Provide a map of block rendering configurations. Each block type maps to - // an element tag and an optional react element wrapper. This configuration - // is used for both rendering and paste processing. - blockRenderMap?: DraftBlockRenderMap - } - - type DraftTextAlignment = "left" | "center" | "right"; - } - - namespace Components { - class DraftEditorBlock extends React.Component { - } - } - - namespace Selection { - interface FakeClientRect { - left: number, - width: number, - right: number, - top: number, - bottom: number, - height: number, - } - - /** - * Return the bounding ClientRect for the visible DOM selection, if any. - * In cases where there are no selected ranges or the bounding rect is - * temporarily invalid, return null. - */ - function getVisibleSelectionRect(global: any): FakeClientRect; - } - - namespace Utils { - import DraftEditorCommand = Draft.Model.Constants.DraftEditorCommand; - - class KeyBindingUtil { - /** - * Check whether the ctrlKey modifier is *not* being used in conjunction with - * the altKey modifier. If they are combined, the result is an `altGraph` - * key modifier, which should not be handled by this set of key bindings. - */ - static isCtrlKeyCommand(e: SyntheticKeyboardEvent): boolean; - - static isOptionKeyCommand(e: SyntheticKeyboardEvent): boolean; - - static hasCommandModifier(e: SyntheticKeyboardEvent): boolean; - } - - /** - * Retrieve a bound key command for the given event. - */ - function getDefaultKeyBinding(e: SyntheticKeyboardEvent): DraftEditorCommand; - function getDefaultKeyBinding(e: SyntheticKeyboardEvent): string; - } - } - - namespace Model { - namespace Constants { - /** - * A set of editor commands that may be invoked by keyboard commands or UI - * controls. These commands should map to operations that modify content or - * selection state and update the editor state accordingly. - */ - type DraftEditorCommand = ( - /** - * Self-explanatory. - */ - "undo" | - "redo" | - - /** - * Perform a forward deletion. - */ - "delete" | - - /** - * Perform a forward deletion to the next word boundary after the selection. - */ - "delete-word" | - - /** - * Perform a backward deletion. - */ - "backspace" | - - /** - * Perform a backward deletion to the previous word boundary before the - * selection. - */ - "backspace-word" | - - /** - * Perform a backward deletion to the beginning of the current line. - */ - "backspace-to-start-of-line" | - - /** - * Toggle styles. Commands may be intepreted to modify inline text ranges - * or block types. - */ - "bold" | - "italic" | - "underline" | - "code" | - - /** - * Split a block in two. - */ - "split-block" | - - /** - * Self-explanatory. - */ - "transpose-characters" | - "move-selection-to-start-of-block" | - "move-selection-to-end-of-block" | - - /** - * Commands to support the "secondary" clipboard provided by certain - * browsers and operating systems. - */ - "secondary-cut" | - "secondary-paste" - ); - - /** - * A type that allows us to avoid passing boolean arguments - * around to indicate whether a drag type is internal or external. - */ - type DraftDragType = "internal" | "external"; - - /** - * The list of default valid block types. - */ - type DraftBlockType = ( - "unstyled" | - "paragraph" | - "header-one" | - "header-two" | - "header-three" | - "header-four" | - "header-five" | - "header-six" | - "unordered-list-item" | - "ordered-list-item" | - "blockquote" | - "code-block" | - "atomic" - ); - - /** - * A type that allows us to avoid passing boolean arguments - * around to indicate whether a deletion is forward or backward. - */ - type DraftRemovalDirection = "backward" | "forward"; - - /** - * A type that allows us to avoid returning boolean values - * to indicate whether an event was handled or not. - */ - type DraftHandleValue = "handled" | "not-handled"; - } - - namespace Decorators { - import ContentBlock = Draft.Model.ImmutableData.ContentBlock; - - /** - * An interface for document decorator classes, allowing the creation of - * custom decorator classes. - * - * See `CompositeDraftDecorator` for the most common use case. - */ - interface DraftDecoratorType { - /** - * Given a `ContentBlock`, return an immutable List of decorator keys. - */ - getDecorations(block: ContentBlock): Immutable.List; - - /** - * Given a decorator key, return the component to use when rendering - * this decorated range. - */ - getComponentForKey(key: string): Function; - - /** - * Given a decorator key, optionally return the props to use when rendering - * this decorated range. - */ - getPropsForKey(key: string): any; - } - - /** - * A DraftDecorator is a strategy-component pair intended for use when - * rendering content. - * - * - A "strategy": A function that accepts a ContentBlock object and - * continuously executes a callback with start/end values corresponding to - * relevant matches in the document text. For example, getHashtagMatches - * uses a hashtag regex to find hashtag strings in the block, and - * for each hashtag match, executes the callback with start/end pairs. - * - * - A "component": A React component that will be used to render the - * "decorated" section of text. - * - * - "props": Props to be passed into the React component that will be used. - */ - interface DraftDecorator { - strategy: (block: ContentBlock, callback: (start: number, end: number) => void) => void; - component: Function; - props?: Object; - } - - /** - * A CompositeDraftDecorator traverses through a list of DraftDecorator - * instances to identify sections of a ContentBlock that should be rendered - * in a "decorated" manner. For example, hashtags, mentions, and links may - * be intended to stand out visually, be rendered as anchors, etc. - * - * The list of decorators supplied to the constructor will be used in the - * order they are provided. This allows the caller to specify a priority for - * string matching, in case of match collisions among decorators. - * - * For instance, I may have a link with a `#` in its text. Though this section - * of text may match our hashtag decorator, it should not be treated as a - * hashtag. I should therefore list my link DraftDecorator - * before my hashtag DraftDecorator when constructing this composite - * decorator instance. - * - * Thus, when a collision like this is encountered, the earlier match is - * preserved and the new match is discarded. - */ - class CompositeDraftDecorator { - constructor(decorators: Array); - - getDecorations(block: ContentBlock): Immutable.List; - getComponentForKey(key: string): Function; - getPropsForKey(key: string): Object; - } - } - - namespace Encoding { - import ContentBlock = Draft.Model.ImmutableData.ContentBlock; - import ContentState = Draft.Model.ImmutableData.ContentState; - - import DraftBlockRenderMap = Draft.Component.Base.DraftBlockRenderMap; - import DraftBlockType = Draft.Model.Constants.DraftBlockType; - - import DraftEntityType = Draft.Model.Entity.DraftEntityType; - import DraftEntityMutability = Draft.Model.Entity.DraftEntityMutability; - - /** - * A plain object representation of an entity attribution. - * - * The `key` value corresponds to the key of the entity in the `entityMap` of - * a `ComposedText` object, not for use with `DraftEntity.get()`. - */ - interface EntityRange { - key: number, - offset: number, - length: number, - } - - /** - * A plain object representation of an inline style range. - */ - interface InlineStyleRange { - style: string; - offset: number; - length: number; - } - - /** - * A plain object representation of an EntityInstance. - */ - interface RawDraftEntity { - type: DraftEntityType; - mutability: DraftEntityMutability; - data: { [key: string]: any }; - } - - /** - * A plain object representation of a ContentBlock, with all style and entity - * attribution repackaged as range objects. - */ - interface RawDraftContentBlock { - key: string; - type: DraftBlockType; - text: string; - depth: number; - inlineStyleRanges: Array; - entityRanges: Array; - data?: Object; - } - - /** - * A type that represents a composed document as vanilla JavaScript objects, - * with all styles and entities represented as ranges. Corresponding entity - * objects are packaged as objects as well. - * - * This object is especially useful when sending the document state to the - * server for storage, as its representation is more concise than our - * immutable objects. - */ - interface RawDraftContentState { - blocks: Array; - entityMap: { [key: string]: RawDraftEntity }; - } - - function convertFromHTMLtoContentBlocks(html: string, DOMBuilder?: Function, blockRenderMap?: DraftBlockRenderMap): Array; - function convertFromRawToDraftState(rawState: RawDraftContentState): ContentState; - function convertFromDraftStateToRaw(contentState: ContentState): RawDraftContentState; - } - - namespace Entity { - type ComposedEntityType = "LINK" | "TOKEN" | "PHOTO"; - type DraftEntityType = string | ComposedEntityType; - - /** - * An enum representing the possible "mutability" options for an entity. - * This refers to the behavior that should occur when inserting or removing - * characters in a text range with an entity applied to it. - * - * `MUTABLE`: - * The text range can be modified freely. Generally used in cases where - * the text content and the entity do not necessarily have a direct - * relationship. For instance, the text and URI for a link may be completely - * different. The user is allowed to edit the text as needed, and the entity - * is preserved and applied to any characters added within the range. - * - * `IMMUTABLE`: - * Not to be confused with immutable data structures used to represent the - * state of the editor. Immutable entity ranges cannot be modified in any - * way. Adding characters within the range will remove the entity from the - * entire range. Deleting characters will delete the entire range. Example: - * Facebook Page mentions. - * - * `SEGMENTED`: - * Segmented entities allow the removal of partial ranges of text, as - * separated by a delimiter. Adding characters wihin the range will remove - * the entity from the entire range. Deleting characters within a segmented - * entity will delete only the segments affected by the deletion. Example: - * Facebook User mentions. - */ - type DraftEntityMutability = "MUTABLE" | "IMMUTABLE" | "SEGMENTED"; - - /** - * A "document entity" is an object containing metadata associated with a - * piece of text in a ContentBlock. - * - * For example, a `link` entity might include a `uri` property. When a - * ContentBlock is rendered in the browser, text that refers to that link - * entity may be rendered as an anchor, with the `uri` as the href value. - * - * In a ContentBlock, every position in the text may correspond to zero - * or one entities. This correspondence is tracked using a key string, - * generated via DraftEntity.create() and used to obtain entity metadata - * via DraftEntity.get(). - */ - class DraftEntity { - /** - * Create a DraftEntityInstance and store it for later retrieval. - * - * A random key string will be generated and returned. This key may - * be used to track the entity's usage in a ContentBlock, and for - * retrieving data about the entity at render time. - */ - static create(type: DraftEntityType, mutability: DraftEntityMutability, data?: Object): string; - - /** - * Add an existing DraftEntityInstance to the DraftEntity map. This is - * useful when restoring instances from the server. - */ - static add(instance: DraftEntityInstance): string; - - /** - * Retrieve the entity corresponding to the supplied key string. - */ - static get(key: string): DraftEntityInstance; - - /** - * Entity instances are immutable. If you need to update the data for an - * instance, this method will merge your data updates and return a new - * instance. - */ - static mergeData(key: string, toMerge: { [key: string]: any }): DraftEntityInstance; - - /** - * Completely replace the data for a given instance. - */ - static replaceData(key: string, newData: { [key: string]: any }): DraftEntityInstance; - } - - /** - * An instance of a document entity, consisting of a `type` and relevant - * `data`, metadata about the entity. - * - * For instance, a "link" entity might provide a URI, and a "mention" - * entity might provide the mentioned user's ID. These pieces of data - * may be used when rendering the entity as part of a ContentBlock DOM - * representation. For a link, the data would be used as an href for - * the rendered anchor. For a mention, the ID could be used to retrieve - * a hovercard. - */ - interface DraftEntityInstance { - getType(): DraftEntityType; - getMutability(): DraftEntityMutability; - getData(): any; - } - } - - namespace ImmutableData { - import DraftBlockType = Draft.Model.Constants.DraftBlockType; - import DraftDecoratorType = Draft.Model.Decorators.DraftDecoratorType; - - type DraftInlineStyle = Immutable.OrderedSet; - type BlockMap = Immutable.OrderedMap; - - var Record: Immutable.Record.Class; - - interface DraftBlockRenderConfig { - element: string; - wrapper?: React.ReactElement; - } - - class EditorState extends Record { - static createEmpty(decorator?: DraftDecoratorType): EditorState; - static createWithContent(contentState: ContentState, decorator?: DraftDecoratorType): EditorState; - static create(config: Object): EditorState; - static set(editorState: EditorState, put: Object): EditorState; - - /** - * Incorporate native DOM selection changes into the EditorState. This - * method can be used when we simply want to accept whatever the DOM - * has given us to represent selection, and we do not need to re-render - * the editor. - * - * To forcibly move the DOM selection, see `EditorState.forceSelection`. - */ - static acceptSelection(editorState: EditorState, selection: SelectionState): EditorState; - - /** - * At times, we need to force the DOM selection to be where we - * need it to be. This can occur when the anchor or focus nodes - * are non-text nodes, for instance. In this case, we want to trigger - * a re-render of the editor, which in turn forces selection into - * the correct place in the DOM. The `forceSelection` method - * accomplishes this. - * - * This method should be used in cases where you need to explicitly - * move the DOM selection from one place to another without a change - * in ContentState. - */ - static forceSelection(editorState: EditorState, selection: SelectionState): EditorState; - - /** - * Move selection to the end of the editor without forcing focus. - */ - static moveSelectionToEnd(editorState: EditorState): EditorState; - - /** - * Force focus to the end of the editor. This is useful in scenarios - * where we want to programmatically focus the input and it makes sense - * to allow the user to continue working seamlessly. - */ - static moveFocusToEnd(editorState: EditorState): EditorState; - - /** - * Push the current ContentState onto the undo stack if it should be - * considered a boundary state, and set the provided ContentState as the - * new current content. - */ - static push(editorState: EditorState, contentState: ContentState, changeType: EditorChangeType): EditorState; - - /** - * Make the top ContentState in the undo stack the new current content and - * push the current content onto the redo stack. - */ - static undo(editorState: EditorState): EditorState; - - /** - * Make the top ContentState in the redo stack the new current content and - * push the current content onto the undo stack. - */ - static redo(editorState: EditorState): EditorState; - - toJS(): Object; - getAllowUndo(): boolean; - getCurrentContent(): ContentState; - getUndoStack(): Immutable.Stack; - getRedoStack(): Immutable.Stack; - getSelection(): SelectionState; - getDecorator(): DraftDecoratorType; - isInCompositionMode(): boolean; - mustForceSelection(): boolean; - getNativelyRenderedContent(): ContentState; - getLastChangeType(): EditorChangeType; - - /** - * While editing, the user may apply inline style commands with a collapsed - * cursor, intending to type text that adopts the specified style. In this - * case, we track the specified style as an "override" that takes precedence - * over the inline style of the text adjacent to the cursor. - * - * If null, there is no override in place. - */ - getInlineStyleOverride(): DraftInlineStyle; - - static setInlineStyleOverride(editorState: EditorState, inlineStyleOverride: DraftInlineStyle): EditorState; - - /** - * Get the appropriate inline style for the editor state. If an - * override is in place, use it. Otherwise, the current style is - * based on the location of the selection state. - */ - getCurrentInlineStyle(): DraftInlineStyle; - - getBlockTree(blockKey: string): Immutable.List; - isSelectionAtStartOfContent(): boolean; - isSelectionAtEndOfContent(): boolean; - getDirectionMap(): Immutable.OrderedMap; - } - - class ContentBlock extends Record { - getKey(): string; - - getType(): DraftBlockType; - getType(): string; - - getText(): string; - getCharacterList(): Immutable.List; - getLength(): number; - getDepth(): number; - getData(): Immutable.Map; - getInlineStyleAt(offset: number): DraftInlineStyle; - getEntityAt(offset: number): string; - - /** - * Execute a callback for every contiguous range of styles within the block. - */ - findStyleRanges(filterFn: (value: CharacterMetadata) => boolean, callback: (start: number, end: number) => void): void; - - /** - * Execute a callback for every contiguous range of entities within the block. - */ - findEntityRanges(filterFn: (value: CharacterMetadata) => boolean, callback: (start: number, end: number) => void): void; - } - - class ContentState extends Record { - static createFromBlockArray(blocks: Array): ContentState; - static createFromText(text: string, delimiter?: string): ContentState; - - getBlockMap(): BlockMap; - getSelectionBefore(): SelectionState; - getSelectionAfter(): SelectionState; - getBlockForKey(key: string): ContentBlock; - - getKeyBefore(key: string): string; - getKeyAfter(key: string): string; - getBlockAfter(key: string): ContentBlock; - getBlockBefore(key: string): ContentBlock; - - getBlocksAsArray(): Array; - getFirstBlock(): ContentBlock; - getLastBlock(): ContentBlock; - getPlainText(delimiter?: string): string; - hasText(): boolean; - } - - class SelectionState extends Record { - static createEmpty(key: string): SelectionState; - - serialize(): string; - getAnchorKey(): string; - getAnchorOffset(): number; - getFocusKey(): string; - getFocusOffset(): number; - getIsBackward(): boolean; - getHasFocus(): boolean; - /** - * Return whether the specified range overlaps with an edge of the - * SelectionState. - */ - hasEdgeWithin(blockKey: string, start: number, end: number): boolean; - isCollapsed(): boolean; - getStartKey(): string; - getStartOffset(): number; - getEndKey(): string; - getEndOffset(): number; - } - - class CharacterMetadata { - static applyStyle(record: CharacterMetadata, style: string): CharacterMetadata; - static removeStyle(record: CharacterMetadata, style: string): CharacterMetadata; - static applyEntity(record: CharacterMetadata, entityKey: string): CharacterMetadata; - static applyEntity(record: CharacterMetadata): CharacterMetadata; - /** - * Use this function instead of the `CharacterMetadata` constructor. - * Since most content generally uses only a very small number of - * style/entity permutations, we can reuse these objects as often as - * possible. - */ - static create(config?: CharacterMetadataConfig): CharacterMetadata; - static create(): CharacterMetadata; - - getStyle(): DraftInlineStyle; - getEntity(): string; - hasStyle(style: string): boolean; - } - - interface CharacterMetadataConfig { - style?: DraftInlineStyle; - entity?: string; - } - - type EditorChangeType = ( - "adjust-depth" | - "apply-entity" | - "backspace-character" | - "change-block-data" | - "change-block-type" | - "change-inline-style" | - "delete-character" | - "insert-characters" | - "insert-fragment" | - "redo" | - "remove-range" | - "spellcheck-change" | - "split-block" | - "undo" - ) - - interface BlockMapBuilder { - createFromArray(blocks: Array): BlockMap; - } - - const DefaultDraftBlockRenderMap: Immutable.Map; - const DefaultDraftInlineStyle: Immutable.Map; - } - - namespace Keys { - function generateRandomKey(): string; - } - - namespace Modifier { - import EditorState = Draft.Model.ImmutableData.EditorState; - import ContentState = Draft.Model.ImmutableData.ContentState; - import SelectionState = Draft.Model.ImmutableData.SelectionState; - - import BlockMap = Draft.Model.ImmutableData.BlockMap; - import DraftInlineStyle = Draft.Model.ImmutableData.DraftInlineStyle; - - import DraftRemovalDirection = Draft.Model.Constants.DraftRemovalDirection; - import DraftBlockType = Draft.Model.Constants.DraftBlockType; - - import DraftEditorCommand = Draft.Model.Constants.DraftEditorCommand; - - type URI = any; - - class AtomicBlockUtils { - static insertAtomicBlock(editorState: EditorState, entityKey: string, character: string): EditorState; - } - - /** - * `DraftModifier` provides a set of convenience methods that apply - * modifications to a `ContentState` object based on a target `SelectionState`. - * - * Any change to a `ContentState` should be decomposable into a series of - * transaction functions that apply the required changes and return output - * `ContentState` objects. - * - * These functions encapsulate some of the most common transaction sequences. - */ - class DraftModifier { - static replaceText(contentState: ContentState, rangeToReplace: SelectionState, text: string, inlineStyle?: DraftInlineStyle, entityKey?: string): ContentState; - static insertText(contentState: ContentState, targetRange: SelectionState, text: string, inlineStyle?: DraftInlineStyle, entityKey?: string): ContentState; - static moveText(contentState: ContentState, removalRange: SelectionState, targetRange: SelectionState): ContentState; - static replaceWithFragment(contentState: ContentState, targetRange: SelectionState, fragment: BlockMap): ContentState; - - static removeRange(contentState: ContentState, rangeToRemove: SelectionState, removalDirection: DraftRemovalDirection): ContentState; - - static splitBlock(contentState: ContentState, selectionState: SelectionState): ContentState; - static applyInlineStyle(contentState: ContentState, selectionState: SelectionState, inlineStyle: string): ContentState; - static removeInlineStyle(contentState: ContentState, selectionState: SelectionState, inlineStyle: string): ContentState; - - static setBlockType(contentState: ContentState, selectionState: SelectionState, blockType: DraftBlockType): ContentState; - static setBlockType(contentState: ContentState, selectionState: SelectionState, blockType: string): ContentState; - - static setBlockData(contentState: ContentState, selectionState: SelectionState, blockData: Immutable.Map): ContentState; - static mergeBlockData(contentState: ContentState, selectionState: SelectionState, blockData: Immutable.Map): ContentState; - static applyEntity(contentState: ContentState, selectionState: SelectionState, entityKey: string): ContentState; - } - - class RichTextEditorUtil { - static currentBlockContainsLink(editorState: EditorState): boolean; - static getCurrentBlockType(editorState: EditorState): DraftBlockType; - static getCurrentBlockType(editorState: EditorState): string; - static getDataObjectForLinkURL(uri: URI): Object; - - static handleKeyCommand(editorState: EditorState, command: DraftEditorCommand): EditorState; - static handleKeyCommand(editorState: EditorState, command: string): EditorState; - - static insertSoftNewline(editorState: EditorState): EditorState; - - /** - * For collapsed selections at the start of styled blocks, backspace should - * just remove the existing style. - */ - static onBackspace(editorState: EditorState): EditorState; - static onDelete(editorState: EditorState): EditorState; - static onTab(event: SyntheticKeyboardEvent, editorState: EditorState, maxDepth: number): EditorState; - - static toggleBlockType(editorState: EditorState, blockType: DraftBlockType): EditorState; - static toggleBlockType(editorState: EditorState, blockType: string): EditorState; - - static toggleCode(editorState: EditorState): EditorState; - - /** - * Toggle the specified inline style for the selection. If the - * user's selection is collapsed, apply or remove the style for the - * internal state. If it is not collapsed, apply the change directly - * to the document state. - */ - static toggleInlineStyle(editorState: EditorState, inlineStyle: string): EditorState; - - static toggleLink(editorState: EditorState, targetSelection: SelectionState, entityKey: string): EditorState; - - /** - * When a collapsed cursor is at the start of an empty styled block, allow - * certain key commands (newline, backspace) to simply change the - * style of the block instead of the default behavior. - */ - static tryToRemoveBlockStyle(editorState: EditorState): ContentState; - } - } - } -} - -import Editor = Draft.Component.Base.DraftEditor; -import EditorBlock = Draft.Component.Components.DraftEditorBlock; -import EditorState = Draft.Model.ImmutableData.EditorState; - -import CompositeDecorator = Draft.Model.Decorators.CompositeDraftDecorator; -import Entity = Draft.Model.Entity.DraftEntity; -import EntityInstance = Draft.Model.Entity.DraftEntityInstance; - -import BlockMapBuilder = Draft.Model.ImmutableData.BlockMapBuilder; -import CharacterMetadata = Draft.Model.ImmutableData.CharacterMetadata; -import ContentBlock = Draft.Model.ImmutableData.ContentBlock; -import ContentState = Draft.Model.ImmutableData.ContentState; -import SelectionState = Draft.Model.ImmutableData.SelectionState; -import DraftInlineStyle = Draft.Model.ImmutableData.DraftInlineStyle; - -import AtomicBlockUtils = Draft.Model.Modifier.AtomicBlockUtils; -import KeyBindingUtil = Draft.Component.Utils.KeyBindingUtil; -import Modifier = Draft.Model.Modifier.DraftModifier; -import RichUtils = Draft.Model.Modifier.RichTextEditorUtil; - -import DefaultDraftBlockRenderMap = Draft.Model.ImmutableData.DefaultDraftBlockRenderMap; -import DefaultDraftInlineStyle = Draft.Model.ImmutableData.DefaultDraftInlineStyle; - -import RawDraftContentState = Draft.Model.Encoding.RawDraftContentState; -import convertFromRaw = Draft.Model.Encoding.convertFromRawToDraftState; -import convertToRaw = Draft.Model.Encoding.convertFromDraftStateToRaw; -import convertFromHTML = Draft.Model.Encoding.convertFromHTMLtoContentBlocks; - -import genKey = Draft.Model.Keys.generateRandomKey; -import getDefaultKeyBinding = Draft.Component.Utils.getDefaultKeyBinding; -import getVisibleSelectionRect = Draft.Component.Selection.getVisibleSelectionRect; - -export { - Editor, - EditorBlock, - EditorState, - - CompositeDecorator, - Entity, - EntityInstance, - - BlockMapBuilder, - CharacterMetadata, - ContentBlock, - ContentState, - SelectionState, - DraftInlineStyle, - - AtomicBlockUtils, - KeyBindingUtil, - Modifier, - RichUtils, - - DefaultDraftBlockRenderMap, - DefaultDraftInlineStyle, - - RawDraftContentState, - convertFromRaw, - convertToRaw, - convertFromHTML, - - genKey, - getDefaultKeyBinding, - getVisibleSelectionRect -}; diff --git a/dragster/dragster-tests.ts b/dragster/dragster-tests.ts deleted file mode 100644 index a05d06e1dd..0000000000 --- a/dragster/dragster-tests.ts +++ /dev/null @@ -1,7 +0,0 @@ -import Dragster = require("dragster"); - -var dropzone = document.getElementById("my-dropzone") as HTMLElement; -var dragster = new Dragster(dropzone); - -dragster.removeListeners(); -dragster.reset(); \ No newline at end of file diff --git a/dragster/index.d.ts b/dragster/index.d.ts deleted file mode 100644 index c02f510084..0000000000 --- a/dragster/index.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -// Type definitions for dragster 0.1 -// Project: https://github.com/bensmithett/dragster -// Definitions by: Zsolt Kovacs -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare namespace Dragster { - interface Dragster { - removeListeners(): void; - reset(): void; - } - - interface DragsterStatic { - (elem: HTMLElement): Dragster; - new (elem: HTMLElement): Dragster; - } -} - -// Support through imports. -declare var Dragster: Dragster.DragsterStatic; -export = Dragster; - -// Support as a global -export as namespace Dragster; \ No newline at end of file diff --git a/dragster/tslint.json b/dragster/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/dragster/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/dropkickjs/dropkickjs-tests.ts b/dropkickjs/dropkickjs-tests.ts deleted file mode 100644 index 206554da09..0000000000 --- a/dropkickjs/dropkickjs-tests.ts +++ /dev/null @@ -1,89 +0,0 @@ -// constructor -var constructorNoOptions = new Dropkick('#my-select'); -var constructorNoOptions2 = new Dropkick(new HTMLSelectElement()); -var constructorOptions = new Dropkick('#my-select', {}); -var constructorOptions2 = new Dropkick(new HTMLSelectElement(), {}); - -// options -var options: DropkickOptions = { - disabled: true, - form: new HTMLFormElement(), - length: 1, - mobile: true, - multiple: true, - options: ['test'], - selectedIndex: 0, - selectedOptions: ['test'], - value: 'test', - change() { }, - close() { }, - open() { }, - initialize: () => { } -}; -var withFullOptions = new Dropkick('#test', options); - -var dk = new Dropkick('#test'); - -// fields (same as options) -var o1 = dk.disabled; -var o2 = dk.form; -var o3 = dk.length; -var o4 = dk.mobile; -var o5 = dk.multiple; -var o6 = dk.options; -var o7 = dk.selectedIndex; -var o8 = dk.selectedOptions; -var o9 = dk.value; - -// methods -dk.add('new'); -dk.add(new HTMLSelectElement()); -dk.add('new', 'old'); -dk.add('new', 1); - -dk.disable(); -dk.disable(false); -dk.disable(4, true); -dk.disable(4); - -dk.dispose(); - -dk.focus(); - -dk.hide(4); -dk.hide(4, false); - -var node = dk.item(4); - -dk.open(); - -dk.refresh(); - -dk.remove(4); - -dk.reset(); -dk.reset(true); - -var words = dk.search("qwer", "fuzzy"); - -var node2 = dk.select(4); -var node3 = dk.select("AL"); -var node4 = dk.select(4, true); - -var node5 = dk.selectOne(4); -var node6 = dk.selectOne(4, true); - -// real life example -var fieldValue = ''; -var selectOptions: DropkickOptions = { - open(this: Dropkick) { - const optionsList = ( this).data.elem.lastChild; // undocumented but useful data field - if (optionsList.scrollWidth > optionsList.offsetWidth) { - optionsList.style.width = optionsList.scrollWidth + 25 + 'px'; - } - }, - change: () => { - fieldValue = select.value; - } -}; -var select = new Dropkick('#select', options); \ No newline at end of file diff --git a/dropkickjs/index.d.ts b/dropkickjs/index.d.ts deleted file mode 100644 index 1e0a4f4acf..0000000000 --- a/dropkickjs/index.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -// Type definitions for dropkickjs 2.1 -// Project: http://dropkickjs.com/ -// Definitions by: Dmitry Pesterev -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -interface DropkickOptions { - disabled?: boolean; - form?: Node; - length?: number; - mobile?: boolean; - multiple?: boolean; - options?: string[]; - selectedIndex?: number; - selectedOptions?: string[]; - value?: string; - - change?: () => void; - close?: () => void; - initialize?: () => void; - open?: () => void; -} - -declare class Dropkick { - constructor(id: string|HTMLElement, options?: DropkickOptions); - - add(value: string | Node, before?: number | string): void; - close(): void; - disable(disabled?: boolean): void; - disable(index: number, disabled?: boolean): void; - dispose(): void; - focus(): void; - hide(index: number, hidden?: boolean): void; - item(index: number): Node; - open(): void; - refresh(): void; - remove(index: number): void; - reset(clear?: boolean): void; - search(string: string, mode?: string): string[]; - select(element: number|string, selectDisabled?: boolean): Node; - selectOne(element: number, selectDisabled?: boolean): Node; - - disabled: boolean; - form: Node; - length: number; - mobile: boolean; - multiple: boolean; - options: string[]; - selectedIndex: number; - selectedOptions: string[]; - value: string; -} \ No newline at end of file diff --git a/dropkickjs/tslint.json b/dropkickjs/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/dropkickjs/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/duplexer2/tslint.json b/duplexer2/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/duplexer2/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/easy-api-request/index.d.ts b/easy-api-request/index.d.ts deleted file mode 100644 index 8f4ca0d553..0000000000 --- a/easy-api-request/index.d.ts +++ /dev/null @@ -1,110 +0,0 @@ -// Type definitions for easy-api-request -// Project: https://github.com/DeadAlready/easy-api-request -// Definitions by: Karl Düüna -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// -/// - -import stream = require('stream'); -import http = require('http'); -import request = require('request'); -import Logger = require('bunyan'); -import express = require('express'); -import Q = require('q'); - -export declare function create(opts: { - name: any; - config: { - url: string; - internal?: boolean; - headers?: string[]; - cookies?: string[]; - replyCookies?: string[]; - jSend?: boolean; - opts?: Object; - }; -}): void; - -interface Result { - response: http.IncomingMessage; - body: any; - err?: any; - data?: any; -} -declare class BaseRequest { - protected base: request.Request; - protected req: express.Request; - protected log: Logger; - protected replyCookies: string[]; - protected jSend: boolean; - constructor(opts: any); - _parseOptions(args: IArguments, type: string): { - opts: any; - cb: any; - }; - _do(args: IArguments, type?: string): any; - _request(opts?: any, cb?: any): any; - - get(url?: any, opts?: any, cb?: any): any; - post(url?: any, opts?: any, cb?: any): any; - patch(url?: any, opts?: any, cb?: any): any; - del(url?: any, opts?: any, cb?: any): any; -} - -declare class StreamRequest extends BaseRequest { - _request(opts: Object): stream.Stream; - - get(url: string, params: Object): stream.Stream; - get(opts: Object): stream.Stream; - get(url: string): stream.Stream; - - post(url: string, params: Object): stream.Stream; - post(opts: Object): stream.Stream; - post(url: string): stream.Stream; - - patch(url: string, params: Object): stream.Stream; - patch(opts: Object): stream.Stream; - patch(url: string): stream.Stream; - - del(url: string, params: Object): stream.Stream; - del(opts: Object): stream.Stream; - del(url: string): stream.Stream; -} - -declare class CBPromiseRequest extends BaseRequest { - _request(opts: Object): stream.Stream; - - get(url: string, params: Object, cb: (err?: any, resp?: Result) => void): void; - get(url: string, cb: (err?: any, resp?: Result) => void): void; - get(opts: Object, cb: (err?: any, resp?: Result) => void): void; - get(url: string, params: Object): Q.Promise; - get(opts: Object): Q.Promise; - get(url: string): Q.Promise; - - post(url: string, params: Object, cb: (err?: any, resp?: Result) => void): void; - post(url: string, cb: (err?: any, resp?: Result) => void): void; - post(opts: Object, cb: (err?: any, resp?: Result) => void): void; - post(url: string, params: Object): Q.Promise; - post(opts: Object): Q.Promise; - post(url: string): Q.Promise; - - patch(url: string, params: Object, cb: (err?: any, resp?: Result) => void): void; - patch(url: string, cb: (err?: any, resp?: Result) => void): void; - patch(opts: Object, cb: (err?: any, resp?: Result) => void): void; - patch(url: string, params: Object): Q.Promise; - patch(opts: Object): Q.Promise; - patch(url: string): Q.Promise; - - del(url: string, params: Object, cb: (err?: any, resp?: Result) => void): void; - del(url: string, cb: (err?: any, resp?: Result) => void): void; - del(opts: Object, cb: (err?: any, resp?: Result) => void): void; - del(url: string, params: Object): Q.Promise; - del(opts: Object): Q.Promise; - del(url: string): Q.Promise; -} - -export interface RequestMaker { - (): CBPromiseRequest; - (stream: boolean): StreamRequest | CBPromiseRequest; -} diff --git a/easy-api-request/tsconfig.json b/easy-api-request/tsconfig.json deleted file mode 100644 index 663d9a15d0..0000000000 --- a/easy-api-request/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "easy-api-request-tests.ts" - ] -} \ No newline at end of file diff --git a/echarts/index.d.ts b/echarts/index.d.ts deleted file mode 100644 index f460a9eaca..0000000000 --- a/echarts/index.d.ts +++ /dev/null @@ -1,133 +0,0 @@ -// Type definitions for echarts -// Project: http://echarts.baidu.com/ -// Definitions by: Xie Jingyang -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare namespace ECharts { - function init(dom:HTMLDivElement|HTMLCanvasElement, theme?:Object|string, opts?:{ - devicePixelRatio?: number - renderer?: string - }):ECharts; - - function connect(group:string|Array):void; - - function disConnect(group:string):void; - - function dispose(target:ECharts|HTMLDivElement|HTMLCanvasElement):void; - - function getInstanceByDom(target:HTMLDivElement|HTMLCanvasElement):void; - - function registerMap(mapName:string, geoJson:Object, specialAreas?:Object):void; - - function registerTheme(themeName:string, theme:Object):void; - - class ECharts { - group:string; - - setOption(option:EChartOption, notMerge?:boolean, notRefreshImmediately?:boolean):void - - getWidth():number - - getHeight():number - - getDom():HTMLCanvasElement|HTMLDivElement - - getOption():Object - - resize():void - - dispatchAction(payload:Object):void - - on(eventName:string, handler:Function, context?:Object):void - - off(eventName:string, handler?:Function):void - - showLoading(type?:string, opts?:Object):void - - hideLoading():void - - getDataURL(opts:{ - // 导出的格式,可选 png, jpeg - type?: string, - // 导出的图片分辨率比例,默认为 1。 - pixelRatio?: number, - // 导出的图片背景色,默认使用 option 里的 backgroundColor - backgroundColor?: string - }):string - - getConnectedDataURL(opts:{ - // 导出的格式,可选 png, jpeg - type: string, - // 导出的图片分辨率比例,默认为 1。 - pixelRatio: number, - // 导出的图片背景色,默认使用 option 里的 backgroundColor - backgroundColor: string - }):string - - clear():void - - isDisposed():boolean - - dispose():void - } - - interface EChartOption { - title?: EChartTitleOption - legend?: Object, - grid?: Object, - xAxis?: Object, - yAxis?: Object, - polar?: Object, - radiusAxis?: Object, - angleAxis?: Object, - radar?: Object, - dataZoom?: Array, - visualMap?: Array, - tooltip?: Object, - toolbox?: Object, - geo?: Object, - parallel?: Object, - parallelAxis?: Object, - timeline?: Object, - series?: Array, - color?: Array, - backgroundColor?: string, - textStyle?: Object, - animation?: boolean, - animationDuration?: number, - animationEasing?: string, - animationDurationUpdate?: number, - animationEasingUpdate?: string - } - - interface EChartTitleOption { - show?: boolean; - text?: string; - link?: string, - target?: string, - textStyle?: Object, - subtext?: string, - sublink?: string, - subtarget?: string, - subtextStyle?: Object, - padding?: number, - itemGap?: number, - zlevel?: number, - z?: number, - left?: string, - top?: string, - right?: string, - bottom?: string, - backgroundColor?: string, - borderColor?: string, - borderWidth?: number, - shadowBlur?: number, - shadowColor?: number, - shadowOffsetX?: number, - shadowOffsetY?: number, - } -} - -declare module "echarts" { - export = ECharts; -} diff --git a/ecurve/ecurve-tests.ts b/ecurve/ecurve-tests.ts deleted file mode 100644 index c2214c6905..0000000000 --- a/ecurve/ecurve-tests.ts +++ /dev/null @@ -1,55 +0,0 @@ -/// - -import ecurve = require('ecurve'); -import crypto = require('crypto'); - -import BigInteger = require('bigi'); -import cs = require('coinstring'); - - -var ecparams = ecurve.getCurveByName('secp256k1'); -console.log(ecparams.n.toString(16)); -// => fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141 -console.log(ecparams.G.getEncoded().toString('hex')); // getEncoded() returns type 'Buffer' instead of 'BigInteger' -// => 0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 -console.log(ecparams.h.toString(16)); -// => 1 - - -var privateKey = new Buffer("1184cd2cdd640ca42cfc3a091c51d549b2f016d454b2774019c2b2d2e08529fd", 'hex'); - -var ecparams = ecurve.getCurveByName('secp256k1'); -var curvePt = ecparams.G.multiply(BigInteger.fromBuffer(privateKey)); -var x = curvePt.affineX.toBuffer(32); -var y = curvePt.affineY.toBuffer(32); - -var publicKey = Buffer.concat([new Buffer([0x04]), x, y]); -console.log(publicKey.toString('hex')); -// => 04d0988bfa799f7d7ef9ab3de97ef481cd0f75d2367ad456607647edde665d6f6fbdd594388756a7beaf73b4822bc22d36e9bda7db82df2b8b623673eefc0b7495 - -// alternatively -publicKey = curvePt.getEncoded(false); // false forces uncompressed public key -console.log(publicKey.toString('hex')); -// => 04d0988bfa799f7d7ef9ab3de97ef481cd0f75d2367ad456607647edde665d6f6fbdd594388756a7beaf73b4822bc22d36e9bda7db82df2b8b623673eefc0b7495 - -// want compressed? -publicKey = curvePt.getEncoded(true); // true forces compressed public key -console.log(publicKey.toString('hex')); -// => 03d0988bfa799f7d7ef9ab3de97ef481cd0f75d2367ad456607647edde665d6f6f - -var sha = crypto.createHash('sha256').update(publicKey).digest(); -var pubkeyHash = crypto.createHash('rmd160').update(sha).digest(); - -// pubkeyHash of compressed public key -console.log(pubkeyHash.toString('hex')); -// => a1c2f92a9dacbd2991c3897724a93f338e44bdc1 - -// address of compressed public key -console.log(cs.encode(pubkeyHash, 0x0)); // <-- 0x0 is for public addresses -// => 1FkKMsKNJqWSDvTvETqcCeHcUQQ64kSC6s - -console.log(cs.encode(privateKey, 0x80)); // <--- 0x80 is for private addresses -// => 5Hx15HFGyep2CfPxsJKe2fXJsCVn5DEiyoeGGF6JZjGbTRnqfiD - -console.log(cs.encode(Buffer.concat([privateKey, new Buffer([0])]), 0x80)); // <-- compressed private address -// => KwomKti1X3tYJUUMb1TGSM2mrZk1wb1aHisUNHCQXTZq5aqzCxDY \ No newline at end of file diff --git a/ecurve/tslint.json b/ecurve/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/ecurve/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/ej.web.all/index.d.ts b/ej.web.all/index.d.ts deleted file mode 100644 index 356eb6af40..0000000000 --- a/ej.web.all/index.d.ts +++ /dev/null @@ -1,64972 +0,0 @@ -// Type definitions for ej.web.all 15.1 -// Project: http://help.syncfusion.com/js/typescript -// Definitions by: Syncfusion -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -/*! -* filename: ej.web.all.d.ts -* version : 15.1.0.33 -* Copyright Syncfusion Inc. 2001 - 2017. All rights reserved. -* Use of this code is subject to the terms of our license. -* A copy of the current license can be obtained at any time by e-mailing -* licensing@syncfusion.com. Any infringement will be prosecuted under -* applicable laws. -*/ -declare namespace ej { - const dataUtil: dataUtil; - function isMobile(): boolean; - function isIOS(): boolean; - function isAndroid(): boolean; - function isFlat(): boolean; - function isWindows(): boolean; - function isCssCalc(): boolean; - function getCurrentPage(): JQuery; - function isLowerResolution(): boolean; - function browserInfo(): browserInfoOptions; - function isTouchDevice(): boolean; - function addPrefix(style: string): string; - function animationEndEvent(): string; - function blockDefaultActions(e: any): void; - function buildTag(tag: string, innerHtml?: string, styles?: any, attrs?: any): JQuery; - function cancelEvent(): string; - function copyObject(): string; - function createObject(nameSpace: string, value: any, initIn: any): JQuery; - function createObject(element: any, eventEmitter: any, model: any): any; - function setCulture(culture: string): void; - function getObject(element: string, model: any ): T; - function getObject(nameSpace: string, fromdata?: any): any; - function defineClass(className: string, constructor: any, proto: any, replace: boolean): any; - function destroyWidgets(element: any): void; - function endEvent(): string; - function event(type: string, data: any, eventProp: any): any; - function getAndroidVersion(): any; - function getAttrVal(ele: any, val: string, option: any): any; - function getBooleanVal(ele: any, val: string, option: any): any; - function getClearString(): string; - function getDimension(element: any, method: string): any; - function getFontString(fontObj: any): string; - function getFontStyle(style: string): string; - function getMaxZindex(): number; - function getNameSpace(className: string): string; - function getOffset(ele: string): any; - function getRenderMode(): string; - function getScrollableParents(element: any): void; - function getTheme(): string; - function getZindexPartial(element: any, popupEle: string): number; - function hasRenderMode(element: string): void; - function hasStyle(prop: string): boolean; - function hasTheme(element: string): string; - function hexFromRGB(color: string): string; - function ieClearRemover(element: string): void; - function isAndroidWebView(): string; - function isDevice(): boolean; - function isIOS7(): boolean; - function isIOSWebView(): boolean; - function isLowerAndroid(): boolean; - function isNullOrUndefined(value: any): boolean; - function isPlainObject(): JQuery; - function isPortrait(): any; - function isTablet(): boolean; - function isWindowsWebView(): string; - function listenEvents(selectors: any, eventTypes: any, handlers: any, remove?: any, pluginObj?: any, disableMouse?: boolean): void; - function listenTouchEvent(selectors: any, eventTypes: any, handlers: any, remove?: any, pluginObj?: any, disableMouse?: boolean): void; - function logBase(val: string, base: string): number; - function measureText(text: string, maxwidth: number, font: string): string; - function moveEvent(): string; - function print(element: string, printWindow: any): void; - function proxy(fn: any, context?: string, arg?: string): any; - function round(value: string, div: string, up: string): any; - function sendAjaxRequest(ajaxOptions: any): void; - function setCaretToPos(nput: string, pos1: string, pos2: string): void; - function setRenderMode(element: string): void; - function setTheme(): any; - function startEvent(): string; - function tapEvent(): string; - function tapHoldEvent(): string; - function throwError(): any; - function transitionEndEvent(): any; - function userAgent(): boolean; - function widget(pluginName: string, className: string, proto: any): any; - function avg(json: any, filedName: string): any; - function getGuid(prefix: string): number; - function group(jsonArray: any, field: string, agg: string, level: number, groupDs: string): any; - function isJson(jsonData: string): string; - function max(jsonArray: any, fieldName?: string, comparer?: string): any; - function min(jsonArray: any, fieldName: string, comparer: string): any; - function merge(first: string, second: string): any; - function mergeshort(jsonArray: any, fieldName: string, comparer: string): any; - function parseJson(jsonText: string): string; - function parseTable(table: number, headerOption: string, headerRowIndex: string): any; - function select(jsonArray: any, fields: string): any; - function setTransition(): boolean; - function sum(json: string, fieldName: string): string; - function swap(array: any, x: string, y: string): any; - const cssUA: string; - const serverTimezoneOffset: number; - const transform: string; - const transformOrigin: string; - const transformStyle: string; - const transition: string; - const transitionDelay: string; - const transitionDuration: string; - const transitionProperty: string; - const transitionTimingFunction: string; - const template: any; - const util: { - valueFunction(val: string): any; - }; - export namespace device { - function isAndroid(): boolean; - function isIOS(): boolean; - function isFlat(): boolean; - function isIOS7(): boolean; - function isWindows(): boolean; - } - export namespace widget { - const autoInit: boolean; - const registeredInstances: any[]; - const registeredWidgets: any[]; - function register(pluginName: string, className: string, prototype: any): void; - function destroyAll(elements: Element): void; - function init(element: Element): void; - function registerInstance(element: Element, pluginName: string, className: string, prototype: any): void; - } - interface browserInfoOptions { - name: string; - version: string; - culture: any; - isMSPointerEnabled: boolean; - } - class WidgetBase { - destroy(): void; - element: JQuery; - setModel(options: any, forceSet?: boolean): any; - option(prop?: any, value?: any, forceSet?: boolean): any; - _trigger(eventName?: string, eventProp?: any): any; - _on(element: JQuery, eventType?: string, handler?: (eventObject: JQueryEventObject) => any): any; - _on(element: JQuery, eventType ?: string, selector ?: string, handler ?: (eventObject: JQueryEventObject) => any): any; - _off(element: JQuery, eventName: string, handler ?: (eventObject: JQueryEventObject) => any): any; - _off(element: JQuery, eventType ?: string, selector ?: string, handler ?: (eventObject: JQueryEventObject) => any): any; - persistState(): void; - restoreState(silent: boolean): void; - } - - class Widget extends WidgetBase { - constructor(pluginName: string, className: string, proto: any); - static fn: Widget; - static extend(widget: Widget): any; - register(pluginName: string, className: string, prototype: any): void; - destroyAll(elements: Element): void; - model: any; - } - - - interface BaseEvent { - cancel: boolean; - type: string; - } - class DataManager { - constructor(dataSource?: any, query?: ej.Query, adaptor?: any); - setDefaultQuery(query: ej.Query): void; - executeQuery(query?: ej.Query, done?: any, fail?: any, always?: any): JQueryPromise; - executeLocal(query?: ej.Query): ej.DataManager; - saveChanges(changes?: Changes, key?: string, tableName?: string): JQueryDeferred; - insert(data: any, tableName?: string): JQueryPromise; - remove(keyField: string, value: any, tableName?: string): any; - update(keyField: string, value: any, tableName?: string): any; - } - - class Query { - constructor(); - static fn: Query; - static extend(prototype: any): Query; - key(field: string): ej.Query; - using(dataManager: ej.DataManager): ej.Query; - execute(dataManager: ej.DataManager, done: any, fail?: string, always?: string): any; - executeLocal(dataManager: ej.DataManager): ej.DataManager; - clone(): ej.Query; - from(tableName: any): ej.Query; - addParams(key: string, value: string): ej.Query; - expand(tables: any): ej.Query; - where(fieldName: string, operator: ej.FilterOperators, value: any, ignoreCase?: boolean): ej.Query; - where(predicate: ej.Predicate): ej.Query; - search(searchKey: any, fieldNames?: any, operator?: string, ignoreCase?: boolean): ej.Query; - sortBy(fieldName: string, comparer?: ej.SortOrder, isFromGroup?: boolean): ej.Query; - sortByDesc(fieldName: string): ej.Query; - group(fieldName: string): ej.Query; - page(pageIndex: number, pageSize: number): ej.Query; - take(nos: number): ej.Query; - skip(nos: number): ej.Query; - select(fieldNames: any): ej.Query; - hierarchy(query: ej.Query, selectorFn: any): ej.Query; - foreignKey(key: string): ej.Query; - requiresCount(): ej.Query; - range(start: number, end: number): ej.Query; - } - - class Adaptor { - constructor(ds: any); - pvt: any; - type: ej.Adaptor; - options: AdaptorOptions; - extend(overrides: any): ej.Adaptor; - processQuery(dm: ej.DataManager, query: ej.Query): any; - processResponse(data: any, ds: any, query: ej.Query, xhr: JQueryXHR, request?: any, changes?: Changes): any; - convertToQueryString(req: any, query: ej.Query, dm: ej.DataManager): JQueryParam; - } - - interface AdaptorOptions { - from?: string; - requestType?: string; - sortBy?: string; - select?: string; - skip?: string; - group?: string; - take?: string; - search?: string; - count?: string; - where?: string; - aggregates?: string; - } - - class UrlAdaptor extends ej.Adaptor { - constructor(); - processQuery(dm: ej.DataManager, query: ej.Query, hierarchyFilters?: any): { - type: string; url: string; ejPvtData: any; contentType?: string; data?: any; - } - convertToQueryString(req: any, query: ej.Query, dm: ej.DataManager): JQueryParam; - processResponse(data: any, ds: any, query: ej.Query, xhr: JQueryXHR, request?: any, changes?: Changes): any; - onGroup(e: any): void; - batchRequest(dm: ej.DataManager, changes: Changes, e: any): void; - beforeSend(dm: ej.DataManager, request: any, settings?: any): void; - insert(dm: ej.DataManager, data: any, tableName: string): { url: string; data: any }; - remove(dm: ej.DataManager, keyField: string, value: any, tableName: string): { type: string; url: string; data?: any }; - update(dm: ej.DataManager, keyField: string, value: any, tableName: string): { type: string; url: string; data: any }; - getFiltersFrom(data: any, query: ej.Query): ej.Predicate; - } - - class ODataAdaptor extends ej.UrlAdaptor { - constructor(); - options: UrlAdaptorOptions; - onEachWhere(filter: any, requiresCast: boolean): any; - onPredicate(pred: ej.Predicate, query: ej.Query, requiresCast: boolean): string; - onComplexPredicate(pred: ej.Predicate, requiresCast: boolean): string; - onWhere(filters: string[]): string; - onEachSearch(e: any): void; - onSearch(e: any): string; - onEachSort(e: any): string; - onSortBy(e: any): string; - onGroup(e: any): string; - onSelect(e: any): string; - onCount(e: any): string; - beforeSend(dm: ej.DataManager, request: any, settings?: any): void; - processResponse(data: any, ds: any, query: ej.Query, xhr: any, request: any, changes: Changes): { - result: any; count: number - }; - convertToQueryString(req: any, query: ej.Query, dm: ej.DataManager): JQueryParam; - insert(dm: ej.DataManager, data: any, tableName: string): { url: string; data: any; } - remove(dm: ej.DataManager, keyField: string, value: any, tableName: string): { url: string; type: string; } - update(dm: ej.DataManager, keyField: string, value: any, tableName: string): { url: string; type: string; data: any; accept: string; } - batchRequest(dm: ej.DataManager, changes: Changes, e: any): { url: string; type: string; data: any; contentType: string; } - generateDeleteRequest(arr: any[], e: any): string; - generateInsertRequest(arr: any[], e: any): string; - generateUpdateRequest(arr: any[], e: any): string; - } - interface UrlAdaptorOptions { - requestType?: string; - accept?: string; - multipartAccept?: string; - sortBy?: string; - select?: string; - skip?: string; - take?: string; - count?: string; - where?: string; - expand?: string; - batch?: string; - changeSet?: string; - batchPre?: string; - contentId?: string; - batchContent?: string; - changeSetContent?: string; - batchChangeSetContentType?: string; - } - class WebApiAdaptor extends ej.ODataAdaptor { - constructor(); - insert(dm: ej.DataManager, data: any, tableName?: string): { url: string; type: string; data: any; } - remove(dm: ej.DataManager, value: any, keyField?: string, tableName?: string): { url: string; type: string; data: any; } - update(dm: ej.DataManager, value: any, keyField?: string, tableName?: string): { url: string; type: string; data: any; accept: string; } - processResponse(data: any, ds: any, query: ej.Query, xhr: any, request: any, changes: Changes): { - result: any; count: number - }; - } - class ODataV4Adaptor extends ej.ODataAdaptor { - constructor(); - options: ODataAdaptorOptions; - onCount(e: any): string; - onEachSearch(e: any): void; - onSearch(e: any): string; - beforeSend(dm: ej.DataManager, request: any, settings?: any): void; - processResponse(data: any, ds: any, query: ej.Query, xhr: any, request: any, changes: Changes): { - result: any; count: number - }; - } - interface ODataAdaptorOptions { - requestType?: string; - accept?: string; - multipartAccept?: string; - sortBy?: string; - select?: string; - skip?: string; - take?: string; - count?: string; - search?: string; - where?: string; - expand?: string; - batch?: string; - changeSet?: string; - batchPre?: string; - contentId?: string; - batchContent?: string; - changeSetContent?: string; - batchChangeSetContentType?: string; - } - - class JsonAdaptor extends ej.Adaptor { - constructor(); - processQuery(ds: any, query: ej.Query): string; - batchRequest(dm: ej.DataManager, changes: Changes, e: any): Changes; - onWhere(ds: any, e: any): any; - onSearch(ds: any, e: any): any - onSortBy(ds: any, e: any, query: ej.Query): any; - onGroup(ds: any, e: any, query: ej.Query): any; - onPage(ds: any, e: any, query: ej.Query): any; - onRange(ds: any, e: any): any; - onTake(ds: any, e: any): any; - onSkip(ds: any, e: any): any; - onSelect(ds: any, e: any): any; - insert(dm: ej.DataManager, data: any): any; - remove(dm: ej.DataManager, keyField: string, value: any, tableName: string): any; - update(dm: ej.DataManager, keyField: string, value: any, tableName: string): any; - } - class remoteSaveAdaptor extends ej.UrlAdaptor { - constructor(); - batchRequest(dm: ej.DataManager, changes: Changes, e: any): void; - beforeSend(dm: ej.DataManager, request: any, settings?: any): void; - insert(dm: ej.DataManager, data: any, tableName: string): { url: string; data: any }; - remove(dm: ej.DataManager, keyField: string, value: any, tableName: string): { type: string; url: string; data?: any }; - update(dm: ej.DataManager, keyField: string, value: any, tableName: string): { type: string; url: string; data: any }; - } - class TableModel { - constructor(name: string, jsonArray: any[], dataManager: ej.DataManager, modelComputed: any); - on(eventName: string, handler: any): void; - off(eventName: string, handler: any): void; - setDataManager(dataManager: DataManager): void; - saveChanges(): void; - rejectChanges(): void; - insert(json: any): void; - update(value: any): void; - remove(key: string): void; - isDirty(): boolean; - getChanges(): Changes; - toArray(): any[]; - setDirty(dirty: any, model: any): void; - get(index: number): void; - length(): number; - bindTo(element: any): void; - } - class Model { - constructor(json: any, table: string, name: string); - formElements: string[]; - computes(value: any): void; - on(eventName: string, handler: any): void; - off(eventName: string, handler: any): void; - set(field: string, value: any): void; - get(field: string): any; - revert(suspendEvent: any): void; - save(dm: ej.DataManager, key: string): void; - markCommit(): void; - markDelete(): void; - changeState(state: boolean, args: any): void; - properties(): any; - bindTo(element: any): void; - unbind(element: any): void; - } - interface Changes { - changed?: any[]; - added?: any[]; - deleted?: any[]; - } - class Predicate { - constructor(); - constructor(field: string, operator: ej.FilterOperators, value: any, ignoreCase: boolean); - and(field: string, operator: any, value: any, ignoreCase: boolean): ej.Predicate; - or(field: string, operator: any, value: any, ignoreCase: boolean): ej.Predicate; - or(predicate: any[]): any; - validate(record: any): boolean; - toJSON(): { - isComplex: boolean; - field: string; - operator: string; - value: any; - ignoreCase: boolean; - condition: string; - predicates: any; - }; - } - interface dataUtil { - swap(array: any[], x: number, y: number): void; - mergeSort(jsonArray: any[], fieldName?: string, comparer?: any): any[]; - max(jsonArray: any[], fieldName?: string, comparer?: string): any[]; - min(jsonArray: any[], fieldName: string, comparer: string): any[]; - distinct(jsonArray: any[], fieldName?: string, requiresCompleteRecord?: any): any[]; - sum(json: any, fieldName: string): number; - avg(json: any, fieldName: string): number; - select(jsonArray: any[], fieldName: string, fields: string): any[]; - group(jsonArray: any[], field: string, /* internal */ level: number): any[]; - parseTable(table: string, headerOption: ej.headerOption, headerRowIndex: number): any; - } - interface AjaxSettings { - type?: string; - cache: boolean; - data?: any; - dataType?: string; - contentType?: any; - async?: boolean; - } - enum FilterOperators { - contains, - endsWith, - equal, - greaterThan, - greaterThanOrEqual, - lessThan, - lessThanOrEqual, - notEqual, - startsWith - } - - enum MatrixDefaults { - m11, - m12, - m21, - m22, - offsetX, - offsetY, - type - } - enum MatrixTypes { - Identity, - Scaling, - Translation, - Unknown - } - - enum Orientation { - Horizontal, - Vertical - } - - enum SliderType { - Default, - MinRange, - Range - } - - enum eventType { - click, - mouseDown, - mouseLeave, - mouseMove, - mouseUp - } - enum headerOption { - row, - tHead - } - enum filterType { - StartsWith, - Contains, - EndsWith, - LessThan, - GreaterThan, - LessThanOrEqual , - GreaterThanOrEqual, - Equal, - NotEqual - } - enum Animation { - Fade, - None, - Slide - } - enum Type { - Overlay, - Slide - } - enum SortOrder { - Ascending, - Descending - } -class Draggable extends ej.Widget { - static fn: Draggable; - constructor(element: JQuery | Element, options?: Draggable.Model); - static Locale: any; - model: Draggable.Model; - defaults: Draggable.Model; - - /** destroy in the draggable. - * @returns {void} - */ - _destroy(): void; -} -export namespace Draggable { - -export interface Model { - - /** If clone is specified. - * @Default {false} - */ - clone?: boolean; - - /** Sets the offset of the dragging helper relative to the mouse cursor. - * @Default {{ top: -1, left: -2 }} - */ - cursorAt?: any; - - /** Distance in pixels after mousedown the mouse must move before dragging should start. This option can be used to prevent unwanted drags when clicking on an element. - * @Default {1} - */ - distance?: number; - - /** The drag area is used to restrict the dragging element bounds. - * @Default {false} - */ - dragArea?: boolean; - - /** If specified, restricts drag start click to the specified element(s). - * @Default {null} - */ - handle?: string; - - /** Used to group sets of draggable and droppable items, in addition to droppable's accept option. A draggable with the same scope value as a droppable will be accepted by the droppable. - * @Default {'default'} - */ - scope?: string; - - /** This event is triggered when dragging element is destroyed. */ - destroy?(e: DestroyEventArgs): void; - - /** This event is triggered when the mouse is moved during the dragging. */ - drag?(e: DragEventArgs): void; - - /** Supply a callback function to handle the drag start event as an init option. */ - dragStart?(e: DragStartEventArgs): void; - - /** This event is triggered when the mouse is moved during the dragging. */ - dragStop?(e: DragStopEventArgs): void; - - /** This event is triggered when dragged. */ - helper?(e: HelperEventArgs): void; -} - -export interface DestroyEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the autocomplete model - */ - model?: ej.Draggable.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface DragEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the draggable model - */ - model?: ej.Draggable.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the event model values - */ - event?: any; - - /** returns the exact mouse down target element - */ - target?: any; -} - -export interface DragStartEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the draggable model - */ - model?: ej.Draggable.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the event model values - */ - event?: any; - - /** returns the exact mouse down target element - */ - target?: any; -} - -export interface DragStopEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the draggable model - */ - model?: ej.Draggable.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the event model values - */ - event?: any; - - /** returns the exact mouse down target element - */ - target?: any; -} - -export interface HelperEventArgs { - - /** returns the draggable element object - */ - element?: any; - - /** returns the event model values - */ - sender?: any; -} -} - -class Droppable extends ej.Widget { - static fn: Droppable; - constructor(element: JQuery | Element, options?: Droppable.Model); - static Locale: any; - model: Droppable.Model; - defaults: Droppable.Model; - - /** destroy in the Droppable. - * @returns {void} - */ - _destroy(): void; -} -export namespace Droppable { - -export interface Model { - - /** Used to accept the specified draggable items. - * @Default {null} - */ - accept?: any; - - /** Used to group sets of droppable items, in addition to droppable's accept option. A draggable with the same scope value as a droppable will be accepted by the droppable. - * @Default {'default'} - */ - scope?: string; - - /** This event is triggered when the mouse up is moved during the dragging. */ - drop?(e: DropEventArgs): void; - - /** This event is triggered when the mouse is moved out. */ - out?(e: OutEventArgs): void; - - /** This event is triggered when the mouse is moved over. */ - over?(e: OverEventArgs): void; -} - -export interface DropEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the autocomplete model - */ - model?: ej.Droppable.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the element which accepts the droppable element. - */ - targetElement?: any; -} - -export interface OutEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the autocomplete model - */ - model?: ej.Droppable.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the mouse out over the element - */ - targetElement?: any; -} - -export interface OverEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the autocomplete model - */ - model?: ej.Droppable.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the mouse over the element - */ - targetElement?: any; -} -} - -class Resizable extends ej.Widget { - static fn: Resizable; - constructor(element: JQuery | Element, options?: Resizable.Model); - static Locale: any; - model: Resizable.Model; - defaults: Resizable.Model; - - /** destroy in the Resizable. - * @returns {void} - */ - _destroy(): void; -} -export namespace Resizable { - -export interface Model { - - /** Sets the offset of the resizing helper relative to the mouse cursor. - * @Default {{ top: -1, left: -2 }} - */ - cursorAt?: any; - - /** Distance in pixels after mousedown the mouse must move before resizing should start. This option can be used to prevent unwanted drags when clicking on an element. - * @Default {1} - */ - distance?: number; - - /** If specified, restricts resize start click to the specified element(s). - * @Default {null} - */ - handle?: string; - - /** Sets the max height for resizing - * @Default {null} - */ - maxHeight?: number; - - /** Sets the max width for resizing - * @Default {null} - */ - maxWidth?: number; - - /** Sets the min Height for resizing - * @Default {10} - */ - minHeight?: number; - - /** Sets the min Width for resizing - * @Default {10} - */ - minWidth?: number; - - /** Used to group sets of resizable items. - * @Default {'default'} - */ - scope?: string; - - /** This event is triggered when the widget destroys. */ - destroy?(e: DestroyEventArgs): void; - - /** This event is triggered when resized. */ - helper?(e: HelperEventArgs): void; -} - -export interface DestroyEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the autocomplete model - */ - model?: ej.Resizable.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface HelperEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the autocomplete model - */ - model?: ej.Resizable.Model; - - /** returns the name of the event - */ - type?: string; -} -} - - - const globalize: globalize; - const cultures: culture; - function addCulture(name: string, culture ?: any): void; - function preferredCulture(culture ?: string): culture; - function format(value: any, format: string, culture ?: string): string; - function parseInt(value: string, radix?: any, culture ?: string): number; - function parseFloat(value: string, radix?: any, culture ?: string): number; - function parseDate(value: string, format: string, culture ?: string): Date; - function getLocalizedConstants(controlName: string, culture ?: string): any; - -interface globalize { - addCulture(name: string, culture?: any): void; - preferredCulture(culture?: string): culture; - format(value: any, format: string, culture?: string): string; - parseInt(value: string, radix?: any, culture?: string): number; - parseFloat(value: string, radix?: any, culture?: string): number; - parseDate(value: string, format: string, culture?: string): Date; - getLocalizedConstants(controlName: string, culture?: string): any; - } - interface culture { - name?: string; - englishName?: string; - namtiveName?: string; - language?: string; - isRTL: boolean; - numberFormat?: formatSettings; - calendars?: calendarsSettings; - } - interface formatSettings { - pattern: string[]; - decimals: number; - groupSizes: number[]; - percent: percentSettings; - currency: currencySettings; - } - interface percentSettings { - pattern: string[]; - decimals: number; - groupSizes: number[]; - symbol: string; - } - interface currencySettings { - pattern: string[]; - decimals: number; - groupSizes: number[]; - symbol: string; - } - interface calendarsSettings { - standard: standardSettings; - } - interface standardSettings { - firstDay: number; - days: daySettings; - months: monthSettings; - AM: string[]; - PM: string[]; - twoDigitYearMax: number; - patterns: patternSettings; - } - interface daySettings { - names: string[]; - namesAbbr: string[]; - namesShort: string[]; - } - interface monthSettings { - names: string[]; - namesAbbr: string[]; - } - interface patternSettings { - d: string; - D: string; - t: string; - T: string; - f: string; - F: string; - M: string; - Y: string; - S: string; - } -class Scroller extends ej.Widget { - static fn: Scroller; - constructor(element: JQuery | Element, options?: Scroller.Model); - static Locale: any; - model: Scroller.Model; - defaults: Scroller.Model; - - /** destroy the Scroller control, unbind the all ej control related events automatically and bring the control to pre-init state. - * @returns {void} - */ - destroy(): void; - - /** User disables the Scroller control at any time. - * @returns {void} - */ - disable(): void; - - /** User enables the Scroller control at any time. - * @returns {void} - */ - enable(): void; - - /** Returns true if horizontal scrollbar is shown, else return false. - * @returns {boolean} - */ - isHScroll(): boolean; - - /** Returns true if vertical scrollbar is shown, else return false. - * @returns {boolean} - */ - isVScroll(): boolean; - - /** User refreshes the Scroller control at any time. - * @returns {void} - */ - refresh(): void; - - /** Horizontal scroller moves to given pixel from its origin position. We can also specify the animation speed,in which the scroller has to move while re-positioning it. - * @param {number|string} Horizontal scroller moves to the specified pixel. - * @param {boolean} Specifies to enable/disable the animation. - * @param {number} Specifies the animation speed when scrolling, if animation is enabled. - * @returns {void} - */ - scrollX(pixel: number|string, disableAnimation: boolean, animationSpeed: number): void; - - /** Vertical scroller moves to given pixel from its origin position. We can also specify the animation speed,in which the scroller has to move while re-positioning it. - * @param {number|string} Vertical scroller moves to the specified pixel. - * @param {boolean} Specifies to enable/disable the animation. - * @param {number} Specifies the animation speed when scrolling, if animation is enabled. - * @returns {void} - */ - scrollY(pixel: number|string, disableAnimation: boolean, animationSpeed: number): void; -} -export namespace Scroller { - -export interface Model { - - /** Specifies the swipe scrolling speed(in millisecond). - * @Default {600} - */ - animationSpeed?: number; - - /** Set true to hides the scrollbar, when mouseout the content area. - * @Default {false} - */ - autoHide?: boolean; - - /** Specifies the height and width of button in the scrollbar. - * @Default {18} - */ - buttonSize?: number; - - /** Specifies to enable or disable the scroller - * @Default {true} - */ - enabled?: boolean; - - /** Save current model value to browser cookies for state maintenance. While refresh the page Rating control values are retained. - * @Default {false} - */ - enablePersistence?: boolean; - - /** Indicates the Right to Left direction to scroller - * @Default {undefined} - */ - enableRTL?: boolean; - - /** Enables or Disable the touch Scroll - * @Default {true} - */ - enableTouchScroll?: boolean; - - /** Specifies the height of Scroll panel and scrollbars. - * @Default {250} - */ - height?: number|string; - - /** If the scrollbar has vertical it set as width, else it will set as height of the handler. - * @Default {18} - */ - scrollerSize?: number; - - /** The Scroller content and scrollbars move left with given value. - * @Default {0} - */ - scrollLeft?: number; - - /** While press on the arrow key the scrollbar position added to the given pixel value. - * @Default {57} - */ - scrollOneStepBy?: number; - - /** The Scroller content and scrollbars move to top position with specified value. - * @Default {0} - */ - scrollTop?: number; - - /** Indicates the target area to which scroller have to appear. - * @Default {null} - */ - targetPane?: string; - - /** Specifies the width of Scroll panel and scrollbars. - * @Default {0} - */ - width?: number|string; - - /** Fires when Scroller control is created. */ - create?(e: CreateEventArgs): void; - - /** Fires when Scroller control is destroyed. */ - destroy?(e: DestroyEventArgs): void; - - /** Fires when a thumb point is moved along the touch surface. */ - thumbMove?(e: ThumbMoveEventArgs): void; - - /** Fires when a thumb point is placed on the touch surface. */ - thumbStart?(e: ThumbStartEventArgs): void; - - /** Fires when a thumb point is removed from the touch surface. */ - thumbEnd?(e: ThumbEndEventArgs): void; - - /** It fires whenever the mouse wheel is rotated either in upwards or downwards. */ - wheelMove?(e: WheelMoveEventArgs): void; - - /** It will fire when mouse trackball has been start to wheel. */ - wheelStart?(e: WheelStartEventArgs): void; - - /** It will fire when mouse trackball has been stop to wheel. */ - wheelStop?(e: WheelStopEventArgs): void; -} - -export interface CreateEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the scroller model - */ - model?: ej.Scroller.Model; - - /** returns the name of the event. - */ - type?: string; -} - -export interface DestroyEventArgs { - - /** returns the scroller model - */ - model?: ej.Scroller.Model; - - /** returns the name of the event. - */ - type?: string; -} - -export interface ThumbMoveEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the scroller model - */ - model?: ej.Scroller.Model; - - /** returns the original event name and its event properties of the current event. - */ - originalEvent?: any; - - /** returns the current data related to the event. - */ - scrollData?: any; - - /** returns the name of the event. - */ - type?: string; -} - -export interface ThumbStartEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the scroller model - */ - model?: ej.Scroller.Model; - - /** returns the original event name and its event properties of the current event. - */ - originalEvent?: any; - - /** returns the current data related to the event. - */ - scrollData?: any; - - /** returns the name of the event. - */ - type?: string; -} - -export interface ThumbEndEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the scroller model - */ - model?: ej.Scroller.Model; - - /** returns the original event name and its event properties of the current event. - */ - originalEvent?: any; - - /** returns the current data related to the event. - */ - scrollData?: any; - - /** returns the name of the event. - */ - type?: string; -} - -export interface WheelMoveEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the scroller model - */ - model?: ej.Scroller.Model; - - /** returns the original event name and its event properties of the current event. - */ - originalEvent?: any; -} - -export interface WheelStartEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the scroller model - */ - model?: ej.Scroller.Model; - - /** returns the original event name and its event properties of the current event. - */ - originalEvent?: any; - - /** returns the current data related to the event. - */ - scrollData?: any; - - /** returns the name of the event. - */ - type?: string; -} - -export interface WheelStopEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the scroller model - */ - model?: ej.Scroller.Model; - - /** returns the name of the event. - */ - type?: string; - - /** returns the original event name and its event properties of the current event. - */ - originalEvent?: any; -} -} - -class Accordion extends ej.Widget { - static fn: Accordion; - constructor(element: JQuery | Element, options?: Accordion.Model); - static Locale: any; - model: Accordion.Model; - defaults: Accordion.Model; - - /** AddItem method is used to add the panel in dynamically. It receives the following parameters - * @param {string} specify the name of the header - * @param {string} content of the new panel - * @param {number} insertion place of the new panel - * @param {boolean} Enable or disable the AJAX request to the added panel - * @returns {void} - */ - addItem(header_name: string, content: string, index: number, isAjaxReq: boolean): void; - - /** This method used to collapse the all the expanded items in accordion at a time. - * @returns {void} - */ - collapseAll(): void; - - /** This method used to Collapses the specified items in accordion at a time. - * @returns {void} - */ - collapsePanel(): void; - - /** destroy the Accordion widget all events bound using this._on will be unbind automatically and bring the control to pre-init state. - * @returns {void} - */ - destroy(): void; - - /** Disables the accordion widget includes all the headers and content panels. - * @returns {void} - */ - disable(): void; - - /** Disable the accordion widget item based on specified header index. - * @param {Array} index values to disable the panels - * @returns {void} - */ - disableItems(index: any[]): void; - - /** Enable the accordion widget includes all the headers and content panels. - * @returns {void} - */ - enable(): void; - - /** Enable the accordion widget item based on specified header index. - * @param {Array} index values to enable the panels - * @returns {void} - */ - enableItems(index: any[]): void; - - /** To expand all the accordion widget items. - * @returns {void} - */ - expandAll(): void; - - /** This method used to Expand the specified items in accordion at a time. - * @returns {void} - */ - expandPanel(): void; - - /** Returns the total number of panels in the control. - * @returns {number} - */ - getItemsCount(): number; - - /** Hides the visible Accordion control. - * @returns {void} - */ - hide(): void; - - /** The refresh method is used to adjust the control size based on the parent element dimension. - * @returns {void} - */ - refresh(): void; - - /** RemoveItem method is used to remove the specified index panel.It receives the parameter as number. - * @param {number} specify the index value for remove the accordion panel. - * @returns {void} - */ - removeItem(index: number): void; - - /** Shows the hidden Accordion control. - * @returns {void} - */ - show(): void; -} -export namespace Accordion { - -export interface Model { - - /** Specifies the ajaxSettings option to load the content to the accordion control. - * @Default {null} - */ - ajaxSettings?: AjaxSettings; - - /** Accordion headers can be expanded and collapsed on keyboard action. - * @Default {true} - */ - allowKeyboardNavigation?: boolean; - - /** To set the Accordion headers Collapse Speed. - * @Default {300} - */ - collapseSpeed?: number; - - /** Specifies the collapsible state of accordion control. - * @Default {false} - */ - collapsible?: boolean; - - /** Sets the root CSS class for Accordion theme, which is used customize. - */ - cssClass?: string; - - /** Allows you to set the custom header Icon. It accepts two key values “header”, ”selectedHeader”. - * @Default {{ header: e-collapse, selectedHeader: e-expand }} - */ - customIcon?: CustomIcon; - - /** Disables the specified indexed items in accordion. - * @Default {[]} - */ - disabledItems?: number[]; - - /** Specifies the animation behavior in accordion. - * @Default {true} - */ - enableAnimation?: boolean; - - /** With this enabled property, you can enable or disable the Accordion. - * @Default {true} - */ - enabled?: boolean; - - /** Used to enable the disabled items in accordion. - * @Default {[]} - */ - enabledItems?: number[]; - - /** Multiple content panels to activate at a time. - * @Default {false} - */ - enableMultipleOpen?: boolean; - - /** Save current model value to browser cookies for maintaining states. When refreshing the accordion control page, the model value is applied from browser cookies or HTML 5local storage. - * @Default {false} - */ - enablePersistence?: boolean; - - /** Display headers and panel text from right-to-left. - * @Default {false} - */ - enableRTL?: boolean; - - /** The events API binds the action for activating the accordion header. Users can activate the header by using mouse actions such as mouse-over, mouse-up, mouse-down, and soon. - * @Default {click} - */ - events?: string; - - /** To set the Accordion headers Expand Speed. - * @Default {300} - */ - expandSpeed?: number; - - /** Sets the height for Accordion items header. - */ - headerSize?: number|string; - - /** Specifies height of the accordion. - * @Default {null} - */ - height?: number|string; - - /** Adjusts the content panel height based on the given option (content, auto, or fill). By default, the panel heights are adjusted based on the content. - * @Default {content} - */ - heightAdjustMode?: ej.Accordion.HeightAdjustMode|string; - - /** It allows to define the characteristics of the Accordion control. It will helps to extend the capability of an HTML element. - * @Default {{}} - */ - htmlAttributes?: any; - - /** The given index header will activate (open). If collapsible is set to true, and a negative value is given, then all headers are collapsed. Otherwise, the first panel isactivated. - * @Default {0} - */ - selectedItemIndex?: number; - - /** Activate the specified indexed items of the accordion - * @Default {[0]} - */ - selectedItems?: number[]; - - /** Used to determines the close button visibility an each accordion items. This close button helps to remove the accordion item from the control. - * @Default {false} - */ - showCloseButton?: boolean; - - /** Displays rounded corner borders on the Accordion control's panels and headers. - * @Default {false} - */ - showRoundedCorner?: boolean; - - /** Specifies width of the accordion. - * @Default {null} - */ - width?: number|string; - - /** Triggered after a Accordion item is active or inactive. Argument values are activeIndex, activeHeader, inActiveHeader, inActiveIndex and current model value. */ - activate?(e: ActivateEventArgs): void; - - /** Triggered before the AJAX content is loaded in a content panel. Arguments have location of the content (URL) and current model value. */ - ajaxBeforeLoad?(e: AjaxBeforeLoadEventArgs): void; - - /** Triggered after AJAX load failed action. Arguments have URL, error message, and current model value. */ - ajaxError?(e: AjaxErrorEventArgs): void; - - /** Triggered after the AJAX content loads. Arguments have current model values. */ - ajaxLoad?(e: AjaxLoadEventArgs): void; - - /** Triggered after AJAX success action. Arguments have URL, content, and current model values. */ - ajaxSuccess?(e: AjaxSuccessEventArgs): void; - - /** Triggered before a tab item is active. Arguments have active index and model values. */ - beforeActivate?(e: BeforeActivateEventArgs): void; - - /** Triggered after a Accordion item is active or inactive. Argument values are activeIndex, activeHeader, inActiveHeader, inActiveIndex and current model value. */ - beforeInactivate?(e: BeforeInactivateEventArgs): void; - - /** Triggered after Accordion control creation. */ - create?(e: CreateEventArgs): void; - - /** Triggered after Accordion control destroy. */ - destroy?(e: DestroyEventArgs): void; - - /** Triggered after a Accordion item is active or inactive. Argument values are activeIndex, activeHeader, inActiveHeader, inActiveIndex and current model value. */ - inActivate?(e: InActivateEventArgs): void; -} - -export interface ActivateEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the accordion model - */ - model?: ej.Accordion.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns active index - */ - activeIndex?: number; - - /** returns current active header - */ - activeHeader?: any; - - /** returns true when the Accordion index activated by user interaction otherwise returns false - */ - isInteraction?: boolean; -} - -export interface AjaxBeforeLoadEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the accordion model - */ - model?: ej.Accordion.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns current AJAX content location - */ - URL?: string; -} - -export interface AjaxErrorEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the accordion model - */ - model?: ej.Accordion.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns current AJAX content location - */ - URL?: string; - - /** returns the failed data sent. - */ - data?: string; -} - -export interface AjaxLoadEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the accordion model - */ - model?: ej.Accordion.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the name of the URL - */ - URL?: string; -} - -export interface AjaxSuccessEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the accordion model - */ - model?: ej.Accordion.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns current AJAX content location - */ - URL?: string; - - /** returns the successful data sent. - */ - data?: string; - - /** returns the AJAX content. - */ - content?: string; -} - -export interface BeforeActivateEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the accordion model - */ - model?: ej.Accordion.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns active index - */ - activeIndex?: number; - - /** returns true when the Accordion index activated by user interaction otherwise returns false - */ - isInteraction?: boolean; -} - -export interface BeforeInactivateEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the accordion model - */ - model?: ej.Accordion.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns active index - */ - inActiveIndex?: number; - - /** returns true when the Accordion index activated by user interaction otherwise returns false - */ - isInteraction?: boolean; -} - -export interface CreateEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the accordion model - */ - model?: ej.Accordion.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface DestroyEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the accordion model - */ - model?: ej.Accordion.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface InActivateEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the accordion model - */ - model?: ej.Accordion.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns active index - */ - inActiveIndex?: number; - - /** returns in active element - */ - inActiveHeader?: any; - - /** returns true when the Accordion index activated by user interaction otherwise returns false - */ - isInteraction?: boolean; -} - -export interface AjaxSettings { - - /** It specifies, whether to enable or disable asynchronous request. - */ - async?: boolean; - - /** It specifies the page will be cached in the web browser. - */ - cache?: boolean; - - /** It specifies the type of data is send in the query string. - */ - contentType?: string; - - /** It specifies the data as an object, will be passed in the query string. - */ - data?: any; - - /** It specifies the type of data that you're expecting back from the response. - */ - dataType?: string; - - /** It specifies the HTTP request type. - */ - type?: string; -} - -export interface CustomIcon { - - /** This class name set to collapsing header. - */ - header?: string; - - /** This class name set to expanded (active) header. - */ - selectedHeader?: string; -} - -enum HeightAdjustMode { - - ///Height fit to the content in the panel - Content, - - ///Height set to the largest content in the panel - Auto, - - ///Height filled to the content of the panel - Fill -} - -} - -class Autocomplete extends ej.Widget { - static fn: Autocomplete; - constructor(element: JQuery | Element, options?: Autocomplete.Model); - static Locale: any; - model: Autocomplete.Model; - defaults: Autocomplete.Model; - - /** Clears the text in the Autocomplete textbox. - * @returns {void} - */ - clearText(): void; - - /** Destroys the Autocomplete widget. - * @returns {void} - */ - destroy(): void; - - /** Disables the autocomplete widget. - * @returns {void} - */ - disable(): void; - - /** Enables the autocomplete widget. - * @returns {void} - */ - enable(): void; - - /** Returns objects (data object) of all the selected items in the autocomplete textbox. - * @returns {any} - */ - getSelectedItems(): any; - - /** Returns the current selected value from the Autocomplete textbox. - * @returns {string} - */ - getValue(): string; - - /** Returns the current active text value in the Autocomplete suggestion list. - * @returns {string} - */ - getActiveText(): string; - - /** Search the entered text and show it in the suggestion list if available. - * @returns {void} - */ - search(): void; - - /** Open up the autocomplete suggestion popup with all list items. - * @returns {void} - */ - open(): void; - - /** Sets the value of the Autocomplete textbox based on the given key value. - * @param {string} The key value of the specific suggestion item. - * @returns {void} - */ - selectValueByKey(Key: string): void; - - /** Sets the value of the Autocomplete textbox based on the given input text value. - * @param {string} The text (label) value of the specific suggestion item. - * @returns {void} - */ - selectValueByText(Text: string): void; -} -export namespace Autocomplete { - -export interface Model { - - /** Customize "Add New" text (label) to be added in the autocomplete popup list for the entered text when there are no suggestions for it. - * @Default {Add New} - */ - addNewText?: boolean; - - /** Allows new values to be added to the autocomplete input other than the values in the suggestion list. - * Normally, when there are no suggestions it will display “No suggestions” label in the popup. - * @Default {false} - */ - allowAddNew?: boolean; - - /** Enables or disables the sorting of suggestion list item. The default sort order is ascending order. You customize sort order. - * @Default {true} - */ - allowSorting?: boolean; - - /** Enables or disables selecting the animation style for the popup list. Animation types can be selected through either of the following options, - * @Default {slide} - */ - animateType?: ej.Autocomplete.Animation|string; - - /** To focus the items in the suggestion list when the popup is shown. By default first item will be focused. - * @Default {false} - */ - autoFocus?: boolean; - - /** Enables or disables the case sensitive search. - * @Default {false} - */ - caseSensitiveSearch?: boolean; - - /** The root class for the Autocomplete textbox widget which helps in customizing its theme. - * @Default {””} - */ - cssClass?: string; - - /** The data source contains the list of data for the suggestions list. It can be a string array or JSON array. - * @Default {null} - */ - dataSource?: any|any[]; - - /** The time delay (in milliseconds) after which the suggestion popup will be shown. - * @Default {200} - */ - delaySuggestionTimeout?: number; - - /** The special character which acts as a separator for the given words for multi-mode search i.e. the text after the delimiter are considered as a separate word or query for search operation. - * @Default {’,’} - */ - delimiterChar?: string; - - /** The text to be displayed in the popup when there are no suggestions available for the entered text. - * @Default {“No suggestions”} - */ - emptyResultText?: string; - - /** Fills the autocomplete textbox with the first matched item from the suggestion list automatically based on the entered text when enabled. - * @Default {false} - */ - enableAutoFill?: boolean; - - /** Enables or disables the Autocomplete textbox widget. - * @Default {true} - */ - enabled?: boolean; - - /** Enables or disables displaying the duplicate names present in the search result. - * @Default {false} - */ - enableDistinct?: boolean; - - /** Allows the current model values to be saved in local storage or browser cookies for state maintenance - * when it is set to true. - * While refreshing the page, it retains the model value from browser cookies or local storage. - * @Default {false} - */ - enablePersistence?: boolean; - - /** Displays the Autocomplete widget’s content from right to left when enabled. - * @Default {false} - */ - enableRTL?: boolean; - - /** Mapping fields for the suggestion items of the Autocomplete textbox widget. - * @Default {null} - */ - fields?: Fields; - - /** Specifies the search filter type. - * There are several types of search filter available such as ‘startswith’, - * ‘contains’, ‘endswith’, ‘lessthan’, ‘lessthanorequal’, ‘greaterthan’, - * ‘greaterthanorequal’, ‘equal’, ‘notequal’. - * @Default {ej.filterType.StartsWith} - */ - filterType?: string; - - /** The height of the Autocomplete textbox. - * @Default {null} - */ - height?: string; - - /** The search text can be highlighted in the AutoComplete suggestion list when enabled. - * @Default {false} - */ - highlightSearch?: boolean; - - /** Number of items to be displayed in the suggestion list. - * @Default {0} - */ - itemsCount?: number; - - /** Set the localization culture for Autocomplete Widget. - */ - locale?: string; - - /** Minimum number of character to be entered in the Autocomplete textbox to show the suggestion list. - * @Default {1} - */ - minCharacter?: number; - - /** An Autocomplete column collection can be defined and customized through the multiColumnSettings property.Column's header, field, and stringFormat can be define via multiColumnSettings properties. - */ - multiColumnSettings?: MultiColumnSettings; - - /** Enables or disables selecting multiple values from the suggestion list. Multiple values can be selected through either of the following options, - * @Default {ej.MultiSelectMode.None} - */ - multiSelectMode?: ej.Autocomplete.MultiSelectMode|string; - - /** The height of the suggestion list. - * @Default {“152px”} - */ - popupHeight?: string; - - /** The width of the suggestion list. - * @Default {“auto”} - */ - popupWidth?: string; - - /** The query to retrieve the data from the data source. - * @Default {null} - */ - query?: ej.Query; - - /** Indicates that the autocomplete textbox values can only be readable. - * @Default {false} - */ - readOnly?: boolean; - - /** Sets the value for the Autocomplete textbox based on the given input key value. - */ - selectValueByKey?: number; - - /** Enables or disables showing the message when there are no suggestions for the entered text. - * @Default {true} - */ - showEmptyResultText?: boolean; - - /** Enables or disables the loading icon to intimate the searching operation. The loading icon is visible when there is a time delay to perform the search. - * @Default {true} - */ - showLoadingIcon?: boolean; - - /** Enables the showPopup button in autocomplete textbox. When the showPopup button is clicked, it displays all the available data from the data source. - * @Default {false} - */ - showPopupButton?: boolean; - - /** Enables or disables rounded corner. - * @Default {false} - */ - showRoundedCorner?: boolean; - - /** Enables or disables reset icon to clear the textbox values. - * @Default {false} - */ - showResetIcon?: boolean; - - /** Sort order specifies whether the suggestion list values has to be displayed in ascending or descending order. - * @Default {ej.SortOrder.Ascending} - */ - sortOrder?: ej.Autocomplete.SortOrder|string; - - /** The template to display the suggestion list items with customized appearance. - * @Default {null} - */ - template?: string; - - /** The jQuery validation error message to be displayed on form validation. - * @Default {null} - */ - validationMessage?: any; - - /** The jQuery validation rules for form validation. - * @Default {null} - */ - validationRules?: any; - - /** The value to be displayed in the autocomplete textbox. - * @Default {null} - */ - value?: string; - - /** Enables or disables the visibility of the autocomplete textbox. - * @Default {true} - */ - visible?: boolean; - - /** The text to be displayed when the value of the autocomplete textbox is empty. - * @Default {null} - */ - watermarkText?: string; - - /** The width of the Autocomplete textbox. - * @Default {null} - */ - width?: string; - - /** Triggers when the AJAX requests Begins. */ - actionBegin?(e: ActionBeginEventArgs): void; - - /** Triggers when the data requested from AJAX will get successfully loaded in the Autocomplete widget. */ - actionSuccess?(e: ActionSuccessEventArgs): void; - - /** Triggers when the AJAX requests complete. The request may get failed or succeed. */ - actionComplete?(e: ActionCompleteEventArgs): void; - - /** Triggers when the data requested from AJAX get failed. */ - actionFailure?(e: ActionFailureEventArgs): void; - - /** Triggers when the text box value is changed. */ - change?(e: ChangeEventArgs): void; - - /** Triggers after the suggestion popup is closed. */ - close?(e: CloseEventArgs): void; - - /** Triggers when Autocomplete widget is created. */ - create?(e: CreateEventArgs): void; - - /** Triggers after the Autocomplete widget is destroyed. */ - destroy?(e: DestroyEventArgs): void; - - /** Triggers after the autocomplete textbox is focused. */ - focusIn?(e: FocusInEventArgs): void; - - /** Triggers after the Autocomplete textbox gets out of the focus. */ - focusOut?(e: FocusOutEventArgs): void; - - /** Triggers after the suggestion list is opened. */ - open?(e: OpenEventArgs): void; - - /** Triggers when an item has been selected from the suggestion list. */ - select?(e: SelectEventArgs): void; -} - -export interface ActionBeginEventArgs { - /** Returns the cancel option value. - */ - cancel?: boolean; -} - -export interface ActionSuccessEventArgs { - /** Returns the cancel option value. - */ - cancel?: boolean; -} - -export interface ActionCompleteEventArgs { - /** Returns the cancel option value. - */ - cancel?: boolean; -} - -export interface ActionFailureEventArgs { - /** Returns the cancel option value. - */ - cancel?: boolean; -} - -export interface ChangeEventArgs { - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Instance of the autocomplete model object. - */ - model?: ej.Autocomplete.Model; - - /** Name of the event. - */ - type?: string; - - /** Value of the autocomplete textbox. - */ - value?: string; -} - -export interface CloseEventArgs { - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Instance of the autocomplete model object. - */ - model?: ej.Autocomplete.Model; - - /** Name of the event. - */ - type?: string; -} - -export interface CreateEventArgs { - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Instance of the autocomplete model object. - */ - model?: ej.Autocomplete.Model; - - /** Name of the event. - */ - type?: string; -} - -export interface DestroyEventArgs { - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Instance of the autocomplete model object. - */ - model?: ej.Autocomplete.Model; - - /** Name of the event. - */ - type?: string; -} - -export interface FocusInEventArgs { - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Instance of the autocomplete model object. - */ - model?: ej.Autocomplete.Model; - - /** Name of the event. - */ - type?: string; - - /** Value of the autocomplete textbox. - */ - value?: string; -} - -export interface FocusOutEventArgs { - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Instance of the autocomplete model object. - */ - model?: ej.Autocomplete.Model; - - /** Name of the event. - */ - type?: string; - - /** Value of the autocomplete textbox. - */ - value?: string; -} - -export interface OpenEventArgs { - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Instance of the autocomplete model object. - */ - model?: ej.Autocomplete.Model; - - /** Name of the event. - */ - type?: string; -} - -export interface SelectEventArgs { - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Instance of the autocomplete model object. - */ - model?: ej.Autocomplete.Model; - - /** Name of the event. - */ - type?: string; - - /** Value of the autocomplete textbox. - */ - value?: string; - - /** Text of the selected item. - */ - text?: string; - - /** Key of the selected item. - */ - key?: string; - - /** Data object of the selected item. - */ - Item?: ej.Autocomplete.Model; -} - -export interface Fields { - - /** Used to group the suggestion list items. - */ - groupBy?: string; - - /** Defines the HTML attributes such as id, class, styles for the item. - */ - htmlAttributes?: any; - - /** Defines the specific field name which contains unique key values for the list items. - */ - key?: string; - - /** Defines the specific field name in the data source to load the suggestion list with data. - */ - text?: string; -} - -export interface MultiColumnSettingsColumn { - - /** Get or set a value that indicates to display the columns in the autocomplete mapping with column name of the dataSource. - */ - field?: string; - - /** Get or set a value that indicates to display the title of that particular column. - */ - headerText?: string; - - /** Gets or sets a value that indicates to render the multicolumn with custom theme. - */ - cssClass?: string; - - /** Specifies the search data type. There are four types of data types available such as string, ‘number’, ‘boolean’ and ‘date’. - * @Default {ej.Type.String} - */ - type?: ej.Type|string; - - /** Specifies the search filter type. There are several types of search filter available such as ‘startswith’, - * ‘contains’, ‘endswith’, ‘lessthan’, ‘lessthanorequal’, ‘greaterthan’, - * ‘greaterthanorequal’, ‘equal’, ‘notequal’. - * @Default {ej.filterType.StartsWith} - */ - filterType?: ej.filterType|string; - - /** This defines the text alignment of a particular column header cell value. See headerTextAlign - * @Default {ej.TextAlign.Left} - */ - headerTextAlign?: ej.TextAlign|string; - - /** Gets or sets a value that indicates to align the text within the column. See textAlign - * @Default {ej.TextAlign.Left} - */ - textAlign?: ej.TextAlign|string; -} - -export interface MultiColumnSettings { - - /** Allow list of data to be displayed in several columns. - * @Default {false} - */ - enable?: boolean; - - /** Allow header text to be displayed in corresponding columns. - * @Default {true} - */ - showHeader?: boolean; - - /** Displayed selected value and autocomplete search based on mentioned column value specified in that format. - */ - stringFormat?: string; - - /** Field and Header Text collections can be defined and customized through columns field. - */ - columns?: MultiColumnSettingsColumn[]; -} - -enum Animation { - - ///Supports to animation type with none type only. - None, - - ///Supports to animation type with slide type only. - Slide, - - ///Supports to animation type with fade type only. - Fade -} - - -enum MultiSelectMode { - - ///Multiple values are separated using a given special character. - Delimiter, - - ///Each values are displayed in separate box with close button. - VisualMode -} - - -enum SortOrder { - - ///Items to be displayed in the suggestion list in ascending order. - Ascending, - - ///Items to be displayed in the suggestion list in descending order. - Descending -} - -} - -class Button extends ej.Widget { - static fn: Button; - constructor(element: JQuery | Element, options?: Button.Model); - static Locale: any; - model: Button.Model; - defaults: Button.Model; - - /** destroy the button widget all events bound using this._on will be unbind automatically and bring the control to pre-init state. - * @returns {void} - */ - destroy(): void; - - /** To disable the button - * @returns {void} - */ - disable(): void; - - /** To enable the button - * @returns {void} - */ - enable(): void; -} -export namespace Button { - -export interface Model { - - /** Specifies the contentType of the Button. See below to know available ContentType - * @Default {ej.ContentType.TextOnly} - */ - contentType?: ej.ContentType|string; - - /** Sets the root CSS class for Button theme, which is used customize. - */ - cssClass?: string; - - /** Specifies the button control state. - * @Default {true} - */ - enabled?: boolean; - - /** Specify the Right to Left direction to button - * @Default {false} - */ - enableRTL?: boolean; - - /** Specifies the height of the Button. - * @Default {28} - */ - height?: number; - - /** It allows to define the characteristics of the Button control. It will helps to extend the capability of an HTML element. - * @Default {{}} - */ - htmlAttributes?: any; - - /** Specifies the image position of the Button. This image position is applicable - * only with the textandimage contentType property. The images can be positioned in both - * imageLeft and imageRight options. See below to know about available ImagePosition - * @Default {ej.ImagePosition.ImageLeft} - */ - imagePosition?: ej.ImagePosition|string; - - /** Specifies the primary icon for Button. This icon will be displayed from the left margin of the button. - * @Default {null} - */ - prefixIcon?: string; - - /** Convert the button as repeat button. It raises the 'Click' event repeatedly from the it is pressed until it is released. - * @Default {false} - */ - repeatButton?: boolean; - - /** Displays the Button with rounded corners. - * @Default {false} - */ - showRoundedCorner?: boolean; - - /** Specifies the size of the Button. See below to know available ButtonSize - * @Default {ej.ButtonSize.Normal} - */ - size?: ej.ButtonSize|string; - - /** Specifies the secondary icon for Button. This icon will be displayed from the right margin of the button. - * @Default {null} - */ - suffixIcon?: string; - - /** Specifies the text content for Button. - * @Default {null} - */ - text?: string; - - /** Specified the time interval between two consecutive 'click' event on the button. - * @Default {150} - */ - timeInterval?: string; - - /** Specifies the Type of the Button. See below to know available ButtonType - * @Default {ej.ButtonType.Submit} - */ - type?: ej.ButtonType|string; - - /** Specifies the width of the Button. - * @Default {100px} - */ - width?: string|number; - - /** Fires when Button control is clicked successfully.Consider the scenario to perform any validation, - * modification of content or any other operations click on button,we can make use of this click event - * to achieve the scenario. - */ - click?(e: ClickEventArgs): void; - - /** Fires after Button control is created.If the user want to perform any operation after the button control creation then the user can make use of this create event. */ - create?(e: CreateEventArgs): void; - - /** Fires when the button is destroyed successfully.If the user want to perform any operation after the destroy button control then the user can make use of this destroy event. */ - destroy?(e: DestroyEventArgs): void; -} - -export interface ClickEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the button model - */ - model?: ej.Button.Model; - - /** returns the name of the event - */ - type?: string; - - /** return the button state - */ - status?: boolean; - - /** return the event model for sever side processing. - */ - e?: any; -} - -export interface CreateEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the button model - */ - model?: ej.Button.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface DestroyEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the button model - */ - model?: ej.Button.Model; - - /** returns the name of the event - */ - type?: string; -} -} -enum ContentType { -//To display the text content only in button -TextOnly, -//To display the image only in button -ImageOnly, -//Supports to display image for both ends of the button -ImageBoth, -//Supports to display image with the text content -TextAndImage, -//Supports to display image with both ends of the text -ImageTextImage, -} -enum ImagePosition { -//support for aligning text in left and image in right -ImageRight, -//support for aligning text in right and image in left -ImageLeft, -//support for aligning text in bottom and image in top. -ImageTop, -//support for aligning text in top and image in bottom -ImageBottom, -} -enum ButtonSize { -//Creates button with Built-in default size height, width specified -Normal, -//Creates button with Built-in mini size height, width specified -Mini, -//Creates button with Built-in small size height, width specified -Small, -//Creates button with Built-in medium size height, width specified -Medium, -//Creates button with Built-in large size height, width specified -Large, -} -enum ButtonType { -//Creates button with Built-in button type specified -Button, -//Creates button with Built-in reset type specified -Reset, -//Creates button with Built-in submit type specified -Submit, -} - -class Captcha extends ej.Widget { - static fn: Captcha; - constructor(element: JQuery | Element, options?: Captcha.Model); - static Locale: any; - model: Captcha.Model; - defaults: Captcha.Model; -} -export namespace Captcha { - -export interface Model { - - /** Specifies the character set of the Captcha that will be used to generate captcha text randomly. - */ - characterSet?: string; - - /** Specifies the error message to be displayed when the Captcha mismatch. - */ - customErrorMessage?: string; - - /** Set the Captcha validation automatically. - */ - enableAutoValidation?: boolean; - - /** Specifies the case sensitivity for the characters typed in the Captcha. - */ - enableCaseSensitivity?: boolean; - - /** Specifies the background patterns for the Captcha. - */ - enablePattern?: boolean; - - /** Sets the Captcha direction as right to left alignment. - */ - enableRTL?: boolean; - - /** Specifies the background appearance for the captcha. - */ - hatchStyle?: ej.HatchStyle|string; - - /** Specifies the height of the Captcha. - */ - height?: number; - - /** Specifies the method with values to be mapped in the Captcha. - */ - mapper?: string; - - /** Specifies the maximum number of characters used in the Captcha. - */ - maximumLength?: number; - - /** Specifies the minimum number of characters used in the Captcha. - */ - minimumLength?: number; - - /** Specifies the method to map values to Captcha. - */ - requestMapper?: string; - - /** Sets the Captcha with audio support, that enables to dictate the captcha text. - */ - showAudioButton?: boolean; - - /** Sets the Captcha with a refresh button. - */ - showRefreshButton?: boolean; - - /** Specifies the target button of the Captcha to validate the entered text and captcha text. - */ - targetButton?: string; - - /** Specifies the target input element that will verify the Captcha. - */ - targetInput?: string; - - /** Specifies the width of the Captcha. - */ - width?: number; - - /** Fires when captcha refresh begins. */ - refreshBegin?(e: RefreshBeginEventArgs): void; - - /** Fires after captcha refresh completed. */ - refreshComplete?(e: RefreshCompleteEventArgs): void; - - /** Fires when captcha refresh fails to load. */ - refreshFailure?(e: RefreshFailureEventArgs): void; - - /** Fires after captcha refresh succeeded. */ - refreshSuccess?(e: RefreshSuccessEventArgs): void; -} - -export interface RefreshBeginEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the Captcha model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; -} - -export interface RefreshCompleteEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the Captcha model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; -} - -export interface RefreshFailureEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the Captcha model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; -} - -export interface RefreshSuccessEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the Captcha model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; -} -} -enum HatchStyle { -//Set background as None to Captcha -None, -//Set background as BackwardDiagonal to Captcha -BackwardDiagonal, -//Set background as Cross to Captcha -Cross, -//Set background as DarkDownwardDiagonal to Captcha -DarkDownwardDiagonal, -//Set background as DarkHorizontal to Captcha -DarkHorizontal, -//Set background as DarkUpwardDiagonal to Captcha -DarkUpwardDiagonal, -//Set background as DarkVertical to Captcha -DarkVertical, -//Set background as DashedDownwardDiagonal to Captcha -DashedDownwardDiagonal, -//Set background as DashedHorizontal to Captcha -DashedHorizontal, -//Set background as DashedUpwardDiagonal to Captcha -DashedUpwardDiagonal, -//Set background as DashedVertical to Captcha -DashedVertical, -//Set background as DiagonalBrick to Captcha -DiagonalBrick, -//Set background as DiagonalCross to Captcha -DiagonalCross, -//Set background as Divot to Captcha -Divot, -//Set background as DottedDiamond to Captcha -DottedDiamond, -//Set background as DottedGrid to Captcha -DottedGrid, -//Set background as ForwardDiagonal to Captcha -ForwardDiagonal, -//Set background as Horizontal to Captcha -Horizontal, -//Set background as HorizontalBrick to Captcha -HorizontalBrick, -//Set background as LargeCheckerBoard to Captcha -LargeCheckerBoard, -//Set background as LargeConfetti to Captcha -LargeConfetti, -//Set background as LargeGrid to Captcha -LargeGrid, -//Set background as LightDownwardDiagonal to Captcha -LightDownwardDiagonal, -//Set background as LightHorizontal to Captcha -LightHorizontal, -//Set background as LightUpwardDiagonal to Captcha -LightUpwardDiagonal, -//Set background as LightVertical to Captcha -LightVertical, -//Set background as Max to Captcha -Max, -//Set background as Min to Captcha -Min, -//Set background as NarrowHorizontal to Captcha -NarrowHorizontal, -//Set background as NarrowVertical to Captcha -NarrowVertical, -//Set background as OutlinedDiamond to Captcha -OutlinedDiamond, -//Set background as Percent90 to Captcha -Percent90, -//Set background as Wave to Captcha -Wave, -//Set background as Weave to Captcha -Weave, -//Set background as WideDownwardDiagonal to Captcha -WideDownwardDiagonal, -//Set background as WideUpwardDiagonal to Captcha -WideUpwardDiagonal, -//Set background as ZigZag to Captcha -ZigZag, -} - -class ListBox extends ej.Widget { - static fn: ListBox; - constructor(element: JQuery | Element, options?: ListBox.Model); - static Locale: any; - model: ListBox.Model; - defaults: ListBox.Model; - - /** Adds a given list items in the ListBox widget at a specified index. It accepts two parameters. - * @param {any|string} This can be a list item object (for JSON binding) or a string (for UL and LI rendering). - * Also we can the specify this as an array of list item object or an array of strings to add multiple items. - * @param {number} The index value to add the given items at the specified index. If index is not specified, the given items will be added at the end of the list. - * @returns {void} - */ - addItem(listItem: any|string, index: number): void; - - /** Checks all the list items in the ListBox widget. It is dependent on showCheckbox property. - * @returns {void} - */ - checkAll(): void; - - /** Checks a list item by using its index. It is dependent on showCheckbox property. - * @param {number} Index of the listbox item to be checked. If index is not specified, the given items will be added at the end of the list. - * @returns {void} - */ - checkItemByIndex(index: number): void; - - /** Checks multiple list items by using its index values. It is dependent on showCheckbox property. - * @param {number[]} Index/Indices of the listbox items to be checked. If index is not specified, the given items will be added at the end of the list. - * @returns {void} - */ - checkItemsByIndices(indices: number[]): void; - - /** Disables the ListBox widget. - * @returns {void} - */ - disable(): void; - - /** Disables a list item by passing the item text as parameter. - * @param {string} Text of the listbox item to be disabled. - * @returns {void} - */ - disableItem(text: string): void; - - /** Disables a list Item using its index value. - * @param {number} Index of the listbox item to be disabled. - * @returns {void} - */ - disableItemByIndex(index: number): void; - - /** Disables set of list Items using its index values. - * @param {number[]|string} Indices of the listbox items to be disabled. - * @returns {void} - */ - disableItemsByIndices(Indices: number[]|string): void; - - /** Enables the ListBox widget when it is disabled. - * @returns {void} - */ - enable(): void; - - /** Enables a list Item using its item text value. - * @param {string} Text of the listbox item to be enabled. - * @returns {void} - */ - enableItem(text: string): void; - - /** Enables a list item using its index value. - * @param {number} Index of the listbox item to be enabled. - * @returns {void} - */ - enableItemByIndex(index: number): void; - - /** Enables a set of list Items using its index values. - * @param {number[]|string} Indices of the listbox items to be enabled. - * @returns {void} - */ - enableItemsByIndices(indices: number[]|string): void; - - /** Returns the list of checked items in the ListBox widget. It is dependent on showCheckbox property. - * @returns {any} - */ - getCheckedItems(): any; - - /** Returns the list of selected items in the ListBox widget. - * @returns {any} - */ - getSelectedItems(): any; - - /** Returns an item’s index based on the given text. - * @param {string} The list item text (label) - * @returns {number} - */ - getIndexByText(text: string): number; - - /** Returns an item’s index based on the value given. - * @param {string} The list item’s value - * @returns {number} - */ - getIndexByValue(indices: string): number; - - /** Returns an item’s text (label) based on the index given. - * @returns {string} - */ - getTextByIndex(): string; - - /** Returns a list item’s object using its index. - * @returns {any} - */ - getItemByIndex(): any; - - /** Returns a list item’s object based on the text given. - * @param {string} The list item text. - * @returns {any} - */ - getItemByText(text: string): any; - - /** Merges the given data with the existing data items in the listbox. - * @param {Array} Data to merge in listbox. - * @returns {void} - */ - mergeData(data: any[]): void; - - /** Selects the next item based on the current selection. - * @returns {void} - */ - moveDown(): void; - - /** Selects the previous item based on the current selection. - * @returns {void} - */ - moveUp(): void; - - /** Refreshes the ListBox widget. - * @param {boolean} Refreshes both the datasource and the dimensions of the ListBox widget when the parameter is passed as true, otherwise only the ListBox dimensions will be refreshed. - * @returns {void} - */ - refresh(refreshData: boolean): void; - - /** Removes all the list items from listbox. - * @returns {void} - */ - removeAll(): void; - - /** Removes the selected list items from the listbox. - * @returns {void} - */ - removeSelectedItems(): void; - - /** Removes a list item by using its text. - * @param {string} Text of the listbox item to be removed. - * @returns {void} - */ - removeItemByText(text: string): void; - - /** Removes a list item by using its index value. - * @param {number} Index of the listbox item to be removed. - * @returns {void} - */ - removeItemByIndex(index: number): void; - - /** - * @returns {void} - */ - selectAll(): void; - - /** Selects the list item using its text value. - * @param {string} Text of the listbox item to be selected. - * @returns {void} - */ - selectItemByText(text: string): void; - - /** Selects list item using its value property. - * @param {string} Value of the listbox item to be selected. - * @returns {void} - */ - selectItemByValue(value: string): void; - - /** Selects list item using its index value. - * @param {number} Index of the listbox item to be selected. - * @returns {void} - */ - selectItemByIndex(index: number): void; - - /** Selects a set of list items through its index values. - * @param {number|number[]} Index/Indices of the listbox item to be selected. - * @returns {void} - */ - selectItemsByIndices(Indices: number|number[]): void; - - /** Unchecks all the checked list items in the ListBox widget. To use this method showCheckbox property to be set as true. - * @returns {void} - */ - uncheckAll(): void; - - /** Unchecks a checked list item using its index value. To use this method showCheckbox property to be set as true. - * @param {number} Index of the listbox item to be unchecked. - * @returns {void} - */ - uncheckItemByIndex(index: number): void; - - /** Unchecks the set of checked list items using its index values. To use this method showCheckbox property must be set to true. - * @param {number[]|string} Indices of the listbox item to be unchecked. - * @returns {void} - */ - uncheckItemsByIndices(indices: number[]|string): void; - - /** - * @returns {void} - */ - unselectAll(): void; - - /** Unselects a selected list item using its index value - * @param {number} Index of the listbox item to be unselected. - * @returns {void} - */ - unselectItemByIndex(index: number): void; - - /** Unselects a selected list item using its text value. - * @param {string} Text of the listbox item to be unselected. - * @returns {void} - */ - unselectItemByText(text: string): void; - - /** Unselects a selected list item using its value. - * @param {string} Value of the listbox item to be unselected. - * @returns {void} - */ - unselectItemByValue(value: string): void; - - /** Unselects a set of list items using its index values. - * @param {number[]|string} Indices of the listbox item to be unselected. - * @returns {void} - */ - unselectItemsByIndices(indices: number[]|string): void; - - /** Hides all the checked items in the listbox. - * @returns {void} - */ - hideCheckedItems(): void; - - /** Shows a set of hidden list Items using its index values. - * @param {number[]|string} Indices of the listbox items to be shown. - * @returns {void} - */ - showItemByIndices(indices: number[]|string): void; - - /** Hides a set of list Items using its index values. - * @param {number[]|string} Indices of the listbox items to be hidden. - * @returns {void} - */ - hideItemsByIndices(indices: number[]|string): void; - - /** Shows the hidden list items using its values. - * @param {Array} Values of the listbox items to be shown. - * @returns {void} - */ - showItemsByValues(values: any[]): void; - - /** Hides the list item using its values. - * @param {Array} Values of the listbox items to be hidden. - * @returns {void} - */ - hideItemsByValues(values: any[]): void; - - /** Shows a hidden list item using its value. - * @param {string} Value of the listbox item to be shown. - * @returns {void} - */ - showItemByValue(value: string): void; - - /** Hide a list item using its value. - * @param {string} Value of the listbox item to be hidden. - * @returns {void} - */ - hideItemByValue(value: string): void; - - /** Shows a hidden list item using its index value. - * @param {number} Index of the listbox item to be shown. - * @returns {void} - */ - showItemByIndex(index: number): void; - - /** Hides a list item using its index value. - * @param {number} Index of the listbox item to be hidden. - * @returns {void} - */ - hideItemByIndex(index: number): void; - - /** - * @returns {void} - */ - show(): void; - - /** Hides the listbox. - * @returns {void} - */ - hide(): void; - - /** Hides all the listbox items in the listbox. - * @returns {void} - */ - hideAllItems(): void; - - /** Shows all the listbox items in the listbox. - * @returns {void} - */ - showAllItems(): void; -} -export namespace ListBox { - -export interface Model { - - /** Enables/disables the dragging behavior of the items in ListBox widget. - * @Default {false} - */ - allowDrag?: boolean; - - /** Accepts the items which are dropped in to it, when it is set to true. - * @Default {false} - */ - allowDrop?: boolean; - - /** Enables or disables multiple selection. - * @Default {false} - */ - allowMultiSelection?: boolean; - - /** Loads the list data on demand via scrolling behavior to improve the application’s performance. There are two ways to load data which can be defined using “virtualScrollMode” property. - * @Default {false} - */ - allowVirtualScrolling?: boolean; - - /** Enables or disables the case sensitive search for list item by typing the text (search) value. - * @Default {false} - */ - caseSensitiveSearch?: boolean; - - /** Dynamically populate data of a list box while selecting an item in another list box i.e. - * rendering child list box based on the item selection in parent list box. - * This property accepts the id of the child ListBox widget to populate the data. - * @Default {null} - */ - cascadeTo?: string; - - /** Set of list items to be checked by default using its index. It works only when the showCheckbox property is set to true. - * @Default {null} - */ - checkedIndices?: any[]; - - /** The root class for the ListBox widget to customize the existing theme. - * @Default {“”} - */ - cssClass?: string; - - /** Contains the list of data for generating the list items. - * @Default {null} - */ - dataSource?: any; - - /** Enables or disables the ListBox widget. - * @Default {true} - */ - enabled?: boolean; - - /** Enables or disables the search behavior to find the specific list item by typing the text value. - * @Default {false} - */ - enableIncrementalSearch?: boolean; - - /** Allows the current model values to be saved in local storage or browser cookies for state maintenance when it is set to true. - * @Default {false} - */ - enablePersistence?: boolean; - - /** Displays the ListBox widget’s content from right to left when enabled. - * @Default {false} - */ - enableRTL?: boolean; - - /** Specifies ellipsis ("...") representation in an overflowed list item content when it is set to false. - * @Default {true} - */ - enableWordWrap?: boolean; - - /** Mapping fields for the data items of the ListBox widget. - * @Default {null} - */ - fields?: Fields; - - /** Defines the height of the ListBox widget. - * @Default {null} - */ - height?: string; - - /** Defines the height for individual ListBox item. - * @Default {null} - */ - itemHeight?: string; - - /** The number of list items to be shown in the ListBox widget. The remaining list items will be scrollable. - * @Default {null} - */ - itemsCount?: number; - - /** The total number of list items to be rendered in the ListBox widget. - * @Default {null} - */ - totalItemsCount?: number; - - /** The number of list items to be loaded in the list box while enabling virtual scrolling and when virtualScrollMode is set to continuous. - * @Default {5} - */ - itemRequestCount?: number; - - /** Loads data for the listbox by default (i.e. on initialization) when it is set to true. It creates empty ListBox if it is set to false. - */ - loadDataOnInit?: boolean; - - /** The query to retrieve required data from the data source. - * @Default {ej.Query()} - */ - query?: ej.Query; - - /** The list item to be selected by default using its index. - * @Default {null} - */ - selectedIndex?: number; - - /** The list items to be selected by default using its indices. To use this property allowMultiSelection should be enabled. - * @Default {[]} - */ - selectedIndices?: any[]; - - /** Enables/Disables the multi selection option with the help of checkbox control. - * @Default {false} - */ - showCheckbox?: boolean; - - /** To display the ListBox container with rounded corners. - * @Default {false} - */ - showRoundedCorner?: boolean; - - /** The template to display the ListBox widget with customized appearance. - * @Default {null} - */ - template?: string; - - /** Holds the selected items values and used to bind value to the list item using AngularJS and KnockoutJS. - * @Default {“”} - */ - value?: number; - - /** Specifies the virtual scroll mode to load the list data on demand via scrolling behavior. There are two types of mode. - */ - virtualScrollMode?: ej.VirtualScrollMode|string; - - /** Defines the width of the ListBox widget. - * @Default {null} - */ - width?: string; - - /** Specifies the targetID for the listbox items. - */ - targetID?: string; - - /** Triggers before the AJAX request begins to load data in the ListBox widget. */ - actionBegin?(e: ActionBeginEventArgs): void; - - /** Triggers after the data requested via AJAX is successfully loaded in the ListBox widget. */ - actionSuccess?(e: ActionSuccessEventArgs): void; - - /** Triggers when the AJAX requests complete. The request may get failed or succeed. */ - actionComplete?(e: ActionCompleteEventArgs): void; - - /** Triggers when the data requested from AJAX get failed. */ - actionFailure?(e: ActionFailureEventArgs): void; - - /** Event will be triggered before the requested data via AJAX once loaded in successfully. */ - actionBeforeSuccess?(e: ActionBeforeSuccessEventArgs): void; - - /** Triggers when the item selection is changed. */ - change?(e: ChangeEventArgs): void; - - /** Triggers when the list item is checked or unchecked. */ - checkChange?(e: CheckChangeEventArgs): void; - - /** Triggers when the ListBox widget is created successfully. */ - create?(e: CreateEventArgs): void; - - /** Triggers when the ListBox widget is destroyed successfully. */ - destroy?(e: DestroyEventArgs): void; - - /** Triggers when focus the listbox items. */ - focusIn?(e: FocusInEventArgs): void; - - /** Triggers when focus out from listbox items. */ - focusOut?(e: FocusOutEventArgs): void; - - /** Triggers when the list item is being dragged. */ - itemDrag?(e: ItemDragEventArgs): void; - - /** Triggers when the list item is ready to be dragged. */ - itemDragStart?(e: ItemDragStartEventArgs): void; - - /** Triggers when the list item stops dragging. */ - itemDragStop?(e: ItemDragStopEventArgs): void; - - /** Triggers when the list item is dropped. */ - itemDrop?(e: ItemDropEventArgs): void; - - /** Triggers when a list item gets selected. */ - select?(e: SelectEventArgs): void; - - /** Triggers when a list item gets unselected. */ - unselect?(e: UnselectEventArgs): void; -} - -export interface ActionBeginEventArgs { - /** Returns the cancel option value. - */ - cancel?: boolean; -} - -export interface ActionSuccessEventArgs { - /** Returns the cancel option value. - */ - cancel?: boolean; -} - -export interface ActionCompleteEventArgs { - /** Returns the cancel option value. - */ - cancel?: boolean; -} - -export interface ActionFailureEventArgs { - /** Returns the cancel option value. - */ - cancel?: boolean; -} - -export interface ActionBeforeSuccessEventArgs { - - /** Instance of the listbox model object. - */ - model?: ej.ListBox.Model; - - /** Name of the event. - */ - type?: string; - - /** List of actual object. - */ - actual?: any; - - /** Object of ListBox widget which contains DataManager arguments - */ - request?: any; - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** List of array object - */ - result?: any[]; - - /** ExecuteQuery object of DataManager - */ - xhr?: any; -} - -export interface ChangeEventArgs { - - /** Instance of the listbox model object. - */ - model?: ej.ListBox.Model; - - /** Name of the event. - */ - type?: string; - - /** List item object. - */ - item?: any; - - /** The Datasource of the listbox. - */ - data?: any; - - /** List item’s index. - */ - index?: number; - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Boolean value based on whether the list item is checked or not. - */ - isChecked?: boolean; - - /** Boolean value based on whether the list item is selected or not. - */ - isSelected?: boolean; - - /** Boolean value based on the list item is enabled or not. - */ - isEnabled?: boolean; - - /** List item’s text (label). - */ - text?: string; - - /** List item’s value. - */ - value?: string; -} - -export interface CheckChangeEventArgs { - - /** Instance of the listbox model object. - */ - model?: ej.ListBox.Model; - - /** Name of the event. - */ - type?: string; - - /** List item object. - */ - item?: any; - - /** The Datasource of the listbox. - */ - data?: any; - - /** List item’s index. - */ - index?: number; - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Boolean value based on whether the list item is checked or not. - */ - isChecked?: boolean; - - /** Boolean value based on whether the list item is selected or not. - */ - isSelected?: boolean; - - /** Boolean value based on the list item is enabled or not. - */ - isEnabled?: boolean; - - /** List item’s text (label). - */ - text?: string; - - /** List item’s value. - */ - value?: string; -} - -export interface CreateEventArgs { - - /** Instance of the listbox model object. - */ - model?: ej.ListBox.Model; - - /** Name of the event. - */ - type?: string; - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; -} - -export interface DestroyEventArgs { - - /** Instance of the listbox model object. - */ - model?: ej.ListBox.Model; - - /** Name of the event. - */ - type?: string; - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; -} - -export interface FocusInEventArgs { - - /** Instance of the listbox model object. - */ - model?: ej.ListBox.Model; - - /** Name of the event. - */ - type?: string; - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; -} - -export interface FocusOutEventArgs { - - /** Instance of the listbox model object. - */ - model?: ej.ListBox.Model; - - /** Name of the event. - */ - type?: string; - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; -} - -export interface ItemDragEventArgs { - - /** Instance of the listbox model object. - */ - model?: ej.ListBox.Model; - - /** Name of the event. - */ - type?: string; - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** The Datasource of the listbox. - */ - data?: any; - - /** List item’s index. - */ - index?: number; - - /** Boolean value based on whether the list item is checked or not. - */ - isChecked?: boolean; - - /** Boolean value based on whether the list item is selected or not. - */ - isSelected?: boolean; - - /** Boolean value based on whether the list item is enabled or not. - */ - isEnabled?: boolean; - - /** List item’s text (label). - */ - text?: string; - - /** List item’s value. - */ - value?: string; -} - -export interface ItemDragStartEventArgs { - - /** Instance of the listbox model object. - */ - model?: ej.ListBox.Model; - - /** Name of the event. - */ - type?: string; - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** The Datasource of the listbox. - */ - data?: any; - - /** List item’s index. - */ - index?: number; - - /** Boolean value based on whether the list item is checked or not. - */ - isChecked?: boolean; - - /** Boolean value based on whether the list item is selected or not. - */ - isSelected?: boolean; - - /** Boolean value based on whether the list item is enabled or not. - */ - isEnabled?: boolean; - - /** List item’s text (label). - */ - text?: string; - - /** List item’s value. - */ - value?: string; -} - -export interface ItemDragStopEventArgs { - - /** Instance of the listbox model object. - */ - model?: ej.ListBox.Model; - - /** Name of the event. - */ - type?: string; - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** The Datasource of the listbox. - */ - data?: any; - - /** List item’s index. - */ - index?: number; - - /** Boolean value based on whether the list item is checked or not. - */ - isChecked?: boolean; - - /** Boolean value based on whether the list item is selected or not. - */ - isSelected?: boolean; - - /** Boolean value based on whether the list item is enabled or not. - */ - isEnabled?: boolean; - - /** List item’s text (label). - */ - text?: string; - - /** List item’s value. - */ - value?: string; -} - -export interface ItemDropEventArgs { - - /** Instance of the listbox model object. - */ - model?: ej.ListBox.Model; - - /** Name of the event. - */ - type?: string; - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** The Datasource of the listbox. - */ - data?: any; - - /** List item’s index. - */ - index?: number; - - /** Boolean value based on whether the list item is checked or not. - */ - isChecked?: boolean; - - /** Boolean value based on whether the list item is selected or not. - */ - isSelected?: boolean; - - /** Boolean value based on whether the list item is enabled or not. - */ - isEnabled?: boolean; - - /** List item’s text (label). - */ - text?: string; - - /** List item’s value. - */ - value?: string; -} - -export interface SelectEventArgs { - - /** Instance of the listbox model object. - */ - model?: ej.ListBox.Model; - - /** Name of the event. - */ - type?: string; - - /** List item object. - */ - item?: any; - - /** The Datasource of the listbox. - */ - data?: any; - - /** List item’s index. - */ - index?: number; - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Boolean value based on whether the list item is checked or not. - */ - isChecked?: boolean; - - /** Boolean value based on whether the list item is selected or not. - */ - isSelected?: boolean; - - /** Boolean value based on the list item is enabled or not. - */ - isEnabled?: boolean; - - /** List item’s text (label). - */ - text?: string; - - /** List item’s value. - */ - value?: string; -} - -export interface UnselectEventArgs { - - /** Instance of the listbox model object. - */ - model?: ej.ListBox.Model; - - /** Name of the event. - */ - type?: string; - - /** List item object. - */ - item?: any; - - /** The Datasource of the listbox. - */ - data?: any; - - /** List item’s index. - */ - index?: number; - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Boolean value based on whether the list item is checked or not. - */ - isChecked?: boolean; - - /** Boolean value based on whether the list item is selected or not. - */ - isSelected?: boolean; - - /** Boolean value based on the list item is enabled or not. - */ - isEnabled?: boolean; - - /** List item’s text (label). - */ - text?: string; - - /** List item’s value. - */ - value?: string; -} - -export interface Fields { - - /** Defines the specific field name which contains Boolean values to specify whether the list items to be checked by default or not. - */ - checkBy?: boolean; - - /** The grouping in the ListBox widget can be defined using this field. - */ - groupBy?: string; - - /** Defines the HTML attributes such as id, class, styles for the specific ListBox item. - */ - htmlAttributes?: any; - - /** Defines the specific field name which contains id values for the list items. - */ - id?: string; - - /** Defines the imageURL for the image to be displayed in the ListBox item. - */ - imageUrl?: string; - - /** Defines the image attributes such as height, width, styles and so on. - */ - imageAttributes?: string; - - /** Defines the specific field name which contains Boolean values to specify whether the list items to be selected by default or not. - */ - selectBy?: boolean; - - /** Defines the sprite CSS class for the image to be displayed. - */ - spriteCssClass?: string; - - /** Defines the table name to get the specific set of list items to be loaded in the ListBox widget while rendering with remote data. - */ - tableName?: string; - - /** Defines the specific field name in the data source to load the list with data. - */ - text?: string; - - /** Defines the specific field name in the data source to load the list with data value property. - */ - value?: string; -} -} - -class Calculate { - static fn: Calculate; - constructor(element: JQuery | Element, options?: Calculate.Model); - static Locale: any; - model: Calculate.Model; - defaults: Calculate.Model; - - /** Add the custom formulas with function in CalcEngine library - * @param {string} pass the formula name - * @param {string} pass the custom function name to call - * @returns {void} - */ - addCustomFunction(FormulaName: string, FunctionName: string): void; - - /** Adds a named range to the NamedRanges collection - * @param {string} pass the namedRange's name - * @param {string} pass the cell range of NamedRange - * @returns {void} - */ - addNamedRange(Name: string, cellRange: string): void; - - /** Accepts a possible parsed formula and returns the calculated value without quotes. - * @param {string} pass the cell range to adjust its range - * @returns {string} - */ - adjustRangeArg(Name: string): string; - - /** When a formula cell changes, call this method to clear it from its dependent cells. - * @param {string} pass the changed cell address - * @returns {void} - */ - clearFormulaDependentCells(Cell: string): void; - - /** Call this method to clear whether an exception was raised during the computation of a library function. - * @returns {void} - */ - clearLibraryComputationException(): void; - - /** Get the column index from a cell reference passed in. - * @param {string} pass the cell address - * @returns {void} - */ - colIndex(Cell: string): void; - - /** Evaluates a parsed formula. - * @param {string} pass the parsed formula - * @returns {string} - */ - computedValue(Formula: string): string; - - /** Evaluates a parsed formula. - * @param {string} pass the parsed formula - * @returns {string} - */ - computeFormula(Formula: string): string; -} -export namespace Calculate { - -export interface Model { - /** Returns the cancel option value. - */ - cancel?: boolean; -} -} - -class CheckBox extends ej.Widget { - static fn: CheckBox; - constructor(element: JQuery | Element, options?: CheckBox.Model); - static Locale: any; - model: CheckBox.Model; - defaults: CheckBox.Model; - - /** Destroy the CheckBox widget all events bound using this._on will be unbind automatically and bring the control to pre-init state. - * @returns {void} - */ - destroy(): void; - - /** Disable the CheckBox to prevent all user interactions. - * @returns {void} - */ - disable(): void; - - /** To enable the CheckBox - * @returns {void} - */ - enable(): void; - - /** To Check the status of CheckBox - * @returns {boolean} - */ - isChecked(): boolean; -} -export namespace CheckBox { - -export interface Model { - - /** Specifies whether CheckBox has to be in checked or not. - * We can also specify array of string as value for this property. - * If any of the value in the specified array matches the value of the textbox, - * then it will be considered as checked. It will be useful in MVVM binding, - * specify array type to identify the values of the checked CheckBoxes. - * @Default {false} - */ - checked?: boolean|string[]; - - /** Specifies the State of CheckBox.See below to get available CheckState - * @Default {null} - */ - checkState?: ej.CheckState|string; - - /** Sets the root CSS class for CheckBox theme, which is used customize. - */ - cssClass?: string; - - /** Specifies the checkbox control state. - * @Default {true} - */ - enabled?: boolean; - - /** Specifies the persist property for CheckBox while initialization. - * The persist API save current model value to browser cookies for state maintains. - * While refreshing the CheckBox control page the model value apply from browser cookies. - * @Default {false} - */ - enablePersistence?: boolean; - - /** Specify the Right to Left direction to Checkbox - * @Default {false} - */ - enableRTL?: boolean; - - /** Specifies the enable or disable Tri-State for checkbox control. - * @Default {false} - */ - enableTriState?: boolean; - - /** It allows to define the characteristics of the CheckBox control. It will helps to extend the capability of an HTML element. - * @Default {{}} - */ - htmlAttributes?: any; - - /** Specified value to be added an id attribute of the CheckBox. - * @Default {null} - */ - id?: string; - - /** Specify the prefix value of id to be added before the current id of the CheckBox. - * @Default {ej} - */ - idPrefix?: string; - - /** Specifies the name attribute of the CheckBox. - * @Default {null} - */ - name?: string; - - /** Displays rounded corner borders to CheckBox - * @Default {false} - */ - showRoundedCorner?: boolean; - - /** Specifies the size of the CheckBox.See below to know available CheckboxSize - * @Default {small} - */ - size?: ej.CheckboxSize|string; - - /** Specifies the text content to be displayed for CheckBox. - */ - text?: string; - - /** Set the jQuery validation error message in CheckBox. - * @Default {null} - */ - validationMessage?: any; - - /** Set the jQuery validation rules in CheckBox. - * @Default {null} - */ - validationRules?: any; - - /** Specifies the value attribute of the CheckBox. - * @Default {null} - */ - value?: string; - - /** Fires before the CheckBox is going to changed its state successfully */ - beforeChange?(e: BeforeChangeEventArgs): void; - - /** Fires when the CheckBox state is changed successfully */ - change?(e: ChangeEventArgs): void; - - /** Fires when the CheckBox state is created successfully */ - create?(e: CreateEventArgs): void; - - /** Fires when the CheckBox state is destroyed successfully */ - destroy?(e: DestroyEventArgs): void; -} - -export interface BeforeChangeEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the CheckBox model - */ - model?: ej.CheckBox.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the event model values - */ - event?: any; - - /** returns the status whether the element is checked or not. - */ - isChecked?: boolean; -} - -export interface ChangeEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the CheckBox model - */ - model?: ej.CheckBox.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the event arguments - */ - event?: any; - - /** returns the status whether the element is checked or not. - */ - isChecked?: boolean; - - /** returns the state of the checkbox - */ - checkState?: string; -} - -export interface CreateEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the CheckBox model - */ - model?: ej.CheckBox.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface DestroyEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the CheckBox model - */ - model?: ej.CheckBox.Model; - - /** returns the name of the event - */ - type?: string; -} -} -enum CheckState { -//string -Uncheck, -//string -Check, -//string -Indeterminate, -} -enum CheckboxSize { -//Displays the CheckBox in medium size -Medium, -//Displays the CheckBox in small size -Small, -} - -class ColorPicker extends ej.Widget { - static fn: ColorPicker; - constructor(element: JQuery | Element, options?: ColorPicker.Model); - static Locale: any; - model: ColorPicker.Model; - defaults: ColorPicker.Model; - - /** Disables the color picker control - * @returns {void} - */ - disable(): void; - - /** Enable the color picker control - * @returns {void} - */ - enable(): void; - - /** Gets the selected color in RGB format - * @returns {any} - */ - getColor(): any; - - /** Gets the selected color value as string - * @returns {string} - */ - getValue(): string; - - /** To Convert color value from hexCode to RGB - * @param {string} Specified HEX code converted to RGB - * @returns {any} - */ - hexCodeToRGB(colorCode: string): any; - - /** Hides the ColorPicker popup, if in opened state. - * @returns {void} - */ - hide(): void; - - /** Convert color value from HSV to RGB - * @param {any} Specified HSV code converted to RGB - * @returns {any} - */ - HSVToRGB(HSV: any): any; - - /** Convert color value from RGB to HEX - * @param {any} Specified RGB code converted to HEX code - * @returns {string} - */ - RGBToHEX(RGB: any): string; - - /** Convert color value from RGB to HSV - * @param {any} Specified RGB code converted to HSV code - * @returns {any} - */ - RGBToHSV(RGB: any): any; - - /** Open the ColorPicker popup. - * @returns {void} - */ - show(): void; -} -export namespace ColorPicker { - -export interface Model { - - /** The ColorPicker control allows to define the customized text to displayed in button elements. Using the property to achieve the customized culture values. - * @Default {{ apply: Apply, cancel: Cancel, swatches: Swatches }} - */ - buttonText?: ButtonText; - - /** Allows to change the mode of the button. Please refer below to know available button mode - * @Default {ej.ButtonMode.Split} - */ - buttonMode?: ej.ButtonMode|string; - - /** Specifies the number of columns to be displayed color palette model. - * @Default {10} - */ - columns?: number|string; - - /** This property allows you to customize its appearance using user-defined CSS and custom skin options such as colors and backgrounds. - */ - cssClass?: string; - - /** This property allows to define the custom colors in the palette model.Custom palettes are created by passing a comma delimited string of HEX values or an array of colors. - * @Default {empty} - */ - custom?: any[]; - - /** This property allows to embed the popup in the order of DOM element flow . When we set the value as true, the color picker popup is always in visible state. - * @Default {false} - */ - displayInline?: boolean; - - /** This property allows to change the control in enabled or disabled state. - * @Default {true} - */ - enabled?: boolean; - - /** This property allows to enable or disable the opacity slider in the color picker control - * @Default {true} - */ - enableOpacity?: boolean; - - /** It allows to define the characteristics of the ColorPicker control. It will helps to extend the capability of an HTML element. - * @Default {{}} - */ - htmlAttributes?: any; - - /** Defines the localized text values in button and tooltip. - * @Default {en-US} - */ - locale?: string; - - /** Specifies the model type to be rendered initially in the color picker control. See below to get available ModelType - * @Default {ej.ColorPicker.ModelType.Default} - */ - modelType?: ej.ColorPicker.ModelType|string; - - /** This property allows to change the opacity value .The selected color opacity will be adjusted by using this opacity value. - * @Default {100} - */ - opacityValue?: number|string; - - /** Specifies the palette type to be displayed at initial time in palette model.There two types of palette model available in ColorPicker control. See below available Palette - * @Default {ej.ColorPicker.Palette.BasicPalette} - */ - palette?: ej.ColorPicker.Palette|string; - - /** This property allows to define the preset model to be rendered initially in palette type.It consists of 12 different types of presets. Each presets have 50 colors. - * See below available Presets - * @Default {ej.ColorPicker.Presets.Basic} - */ - presetType?: ej.ColorPicker.Presets|string; - - /** Allows to show/hides the apply and cancel buttons in ColorPicker control - * @Default {true} - */ - showApplyCancel?: boolean; - - /** Allows to show/hides the clear button in ColorPicker control - * @Default {true} - */ - showClearButton?: boolean; - - /** This property allows to provides live preview support for current cursor selection color and selected color. - * @Default {true} - */ - showPreview?: boolean; - - /** This property allows to store the color values in custom list.The ColorPicker will keep up to 11 colors in a custom list. - * By clicking the add button, the selected color from picker or palette will get added in the recent color list. - * @Default {false} - */ - showRecentColors?: boolean; - - /** Allows to show/hides the switcher button in ColorPicker control.It helps to switch palette or picker mode in colorpicker. - * @Default {true} - */ - showSwitcher?: boolean; - - /** This property allows to shows tooltip to notify the slider value in color picker control. - * @Default {false} - */ - showTooltip?: boolean; - - /** Specifies the toolIcon to be displayed in dropdown control color area. - * @Default {null} - */ - toolIcon?: string; - - /** This property allows to define the customized text or content to displayed when mouse over the following elements. This property also allows to use the culture values. - * @Default {{ switcher: Switcher, addbutton: Add Color, basic: Basic, monochrome: Mono Chrome, flatcolors: Flat Color, seawolf: Sea Wolf, webcolors: Web Colors, - * sandy: Sandy, pinkshades: Pink Shades, misty: Misty, citrus: Citrus, vintage: Vintage, moonlight: Moon Light, candycrush: Candy Crush, - * currentcolor: Current Color, selectedcolor: Selected Color }} - */ - tooltipText?: TooltipText; - - /** Specifies the color value for color picker control, the value is in hexadecimal form with prefix of "#". - * @Default {null} - */ - value?: string; - - /** Fires after Color value has been changed successfully.If the user want to perform any operation after the color value changed then the user can make use of this change event. */ - change?(e: ChangeEventArgs): void; - - /** Fires after closing the color picker popup. */ - close?(e: CloseEventArgs): void; - - /** Fires after Color picker control is created. If the user want to perform any operation after the color picker control creation then the user can make use of this create event. */ - create?(e: CreateEventArgs): void; - - /** Fires after Color picker control is destroyed. If the user want to perform any operation after the color picker control destroyed then the user can make use of this destroy event. */ - destroy?(e: DestroyEventArgs): void; - - /** Fires after opening the color picker popup */ - open?(e: OpenEventArgs): void; - - /** Fires after Color value has been selected successfully. If the user want to perform any operation after the color value selected then the user can make use of this select event. */ - select?(e: SelectEventArgs): void; -} - -export interface ChangeEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the color picker model - */ - model?: ej.ColorPicker.Model; - - /** returns the name of the event - */ - type?: string; - - /** return the changed color value - */ - value?: string; -} - -export interface CloseEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the color picker model - */ - model?: ej.ColorPicker.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface CreateEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the color picker model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; -} - -export interface DestroyEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the color picker model - */ - model?: ej.ColorPicker.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface OpenEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the color picker model - */ - model?: ej.ColorPicker.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface SelectEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the color picker model - */ - model?: ej.ColorPicker.Model; - - /** returns the name of the event - */ - type?: string; - - /** return the selected color value - */ - value?: string; -} - -export interface ButtonText { - - /** Sets the text for the apply button. - */ - apply?: string; - - /** Sets the text for the cancel button. - */ - cancel?: string; - - /** Sets the header text for the swatches area. - */ - swatches?: string; -} - -export interface TooltipText { - - /** Sets the tooltip text for the switcher button. - */ - switcher?: string; - - /** Sets the tooltip text for the add button. - */ - addbutton?: string; - - /** Sets the tooltip text for the basic preset. - */ - basic?: string; - - /** Sets the tooltip text for the mono chrome preset. - */ - monochrome?: string; - - /** Sets the tooltip text for the flat colors preset. - */ - flatcolors?: string; - - /** Sets the tooltip text for the sea wolf preset. - */ - seawolf?: string; - - /** Sets the tooltip text for the web colors preset. - */ - webcolors?: string; - - /** Sets the tooltip text for the sandy preset. - */ - sandy?: string; - - /** Sets the tooltip text for the pink shades preset. - */ - pinkshades?: string; - - /** Sets the tooltip text for the misty preset. - */ - misty?: string; - - /** Sets the tooltip text for the citrus preset. - */ - citrus?: string; - - /** Sets the tooltip text for the vintage preset. - */ - vintage?: string; - - /** Sets the tooltip text for the moon light preset. - */ - moonlight?: string; - - /** Sets the tooltip text for the candy crush preset. - */ - candycrush?: string; - - /** Sets the tooltip text for the current color area. - */ - currentcolor?: string; - - /** Sets the tooltip text for the selected color area. - */ - selectedcolor?: string; -} - -enum ModelType { - - ///support palette type mode in color picker. - Palette, - - ///support palette type mode in color picker. - Picker -} - - -enum Palette { - - ///used to show the basic palette - BasicPalette, - - ///used to show the custompalette - CustomPalette -} - - -enum Presets { - - ///used to show the basic presets - Basic, - - ///used to show the CandyCrush colors presets - CandyCrush, - - ///used to show the Citrus colors presets - Citrus, - - ///used to show the FlatColors presets - FlatColors, - - ///used to show the Misty presets - Misty, - - ///used to show the MoonLight presets - MoonLight, - - ///used to show the PinkShades presets - PinkShades, - - ///used to show the Sandy presets - Sandy, - - ///used to show the Seawolf presets - SeaWolf, - - ///used to show the Vintage presets - Vintage, - - ///used to show the WebColors presets - WebColors -} - -} -enum ButtonMode { -//Displays the button in split mode -Split, -//Displays the button in Dropdown mode -Dropdown, -} - -class FileExplorer extends ej.Widget { - static fn: FileExplorer; - constructor(element: JQuery | Element, options?: FileExplorer.Model); - static Locale: any; - model: FileExplorer.Model; - defaults: FileExplorer.Model; - - /** Refresh the size of FileExplorer control. - * @returns {void} - */ - adjustSize(): void; - - /** Disable the particular context menu item. - * @param {string|HTMLElement} Id of the menu item/ Menu element to be disabled - * @returns {void} - */ - disableMenuItem(item: string|HTMLElement): void; - - /** Disable the particular toolbar item. - * @param {string|HTMLElement} Id of the toolbar item/ Tool item element to be disabled - * @returns {void} - */ - disableToolbarItem(item: string|HTMLElement): void; - - /** Enable the particular context menu item. - * @param {string|HTMLElement} Id of the menu item/ Menu element to be Enabled - * @returns {void} - */ - enableMenuItem(item: string|HTMLElement): void; - - /** Enable the particular toolbar item - * @param {string|HTMLElement} Id of the tool item/ Tool item element to be Enabled - * @returns {void} - */ - enableToolbarItem(item: string|HTMLElement): void; - - /** Refresh the content of the selected folder in FileExplorer control. - * @returns {void} - */ - refresh(): void; - - /** Remove the particular toolbar item. - * @param {string|HTMLElement} Id of the tool item/ tool item element to be removed - * @returns {void} - */ - removeToolbarItem(item: string|HTMLElement): void; -} -export namespace FileExplorer { - -export interface Model { - - /** Sets the URL of server side AJAX handling method that handles file operation like Read, Remove, Rename, Create, Upload, Download, Copy and Move in FileExplorer. - */ - ajaxAction?: string; - - /** Specifies the data type of server side AJAX handling method. - * @Default {json} - */ - ajaxDataType?: string; - - /** By using ajaxSettings property, you can customize the AJAX configurations. Normally you can customize the following option in AJAX handling data, URL, type, async, contentType, dataType and - * success. For upload, download and getImage API, you can only customize URL. - * @Default {{ read: {}, createFolder: {}, remove: {}, rename: {}, paste: {}, getDetails: {}, download: {}, upload: {}, getImage: {}, search: {}}} - */ - ajaxSettings?: any; - - /** The FileExplorer allows to move the files from one folder to another folder of FileExplorer by using drag and drop option. Also it supports to upload a file by dragging it - * from windows explorer to the necessary folder of ejFileExplorer. - * @Default {true} - */ - allowDragAndDrop?: boolean; - - /** Gets or sets a value that indicates whether to enable keyboard support for FileExplorer actions. - * @Default {true} - */ - allowKeyboardNavigation?: boolean; - - /** The FileExplorer allows to select multiple files by enabling the allowMultiSelection property. You can perform multi selection by pressing the Ctrl key or Shift key. - * @Default {true} - */ - allowMultiSelection?: boolean; - - /** By using the contextMenuSettings property, you can customize the ContextMenu in the FileExplorer control. - */ - contextMenuSettings?: ContextMenuSettings; - - /** Sets the root class for FileExplorer theme. This cssClass API allows to use custom skinning option for File Explorer control. - * By defining the root class by using this API, you have to include this root class in CSS. - */ - cssClass?: string; - - /** Specify the enablePersistence to FileExplorer to save the current model value in browser cookies for state maintains. - * @Default {false} - */ - enablePersistence?: boolean; - - /** Enables or disables the resize support in FileExplorer control. - * @Default {false} - */ - enableResize?: boolean; - - /** Enables or disables the Right to Left alignment support in FileExplorer control. - * @Default {false} - */ - enableRTL?: boolean; - - /** Enables or disables the thumbnail image compression option in FileExplorer control. By enabling this option, you can reduce the thumbnail image size while loading. - * @Default {false} - */ - enableThumbnailCompress?: boolean; - - /** Allows specified type of files only to display in FileExplorer control. - * @Default {.} - */ - fileTypes?: string; - - /** By using filterSettings property, you can customize the search functionality of the search bar in FileExplorer control. - */ - filterSettings?: FilterSettings; - - /** By using the gridSettings property, you can customize the grid behavior in the FileExplorer control. - */ - gridSettings?: GridSettings; - - /** Specifies the height of FileExplorer control. - * @Default {400} - */ - height?: string|number; - - /** Enables or disables the responsive support for FileExplorer control during the window resizing time. - * @Default {false} - */ - isResponsive?: boolean; - - /** Sets the file view type. There are three view types available such as Grid, Tile and Large icons. See layoutType. - * @Default {ej.FileExplorer.layoutType.Grid} - */ - layout?: ej.FileExplorer.layoutType|string; - - /** Sets the culture in FileExplorer. - * @Default {en-US} - */ - locale?: string; - - /** Sets the maximum height of FileExplorer control. - * @Default {null} - */ - maxHeight?: string|number; - - /** Sets the maximum width of FileExplorer control. - * @Default {null} - */ - maxWidth?: string|number; - - /** Sets the minimum height of FileExplorer control. - * @Default {250px} - */ - minHeight?: string|number; - - /** Sets the minimum width of FileExplorer control. - * @Default {400px} - */ - minWidth?: string|number; - - /** The property path denotes the filesystem path that are to be explored. The path for the filesystem can be physical path or relative path, but it has to be relevant to where the Web API is hosted. - */ - path?: string; - - /** The selectedFolder is used to select the specified folder of FileExplorer control. - */ - selectedFolder?: string; - - /** The selectedItems is used to select the specified items (file, folder) of FileExplorer control. - */ - selectedItems?: string|any[]; - - /** Enables or disables the checkbox option in FileExplorer control. - * @Default {true} - */ - showCheckbox?: boolean; - - /** Enables or disables the context menu option in FileExplorer control. - * @Default {true} - */ - showContextMenu?: boolean; - - /** Enables or disables the footer in FileExplorer control. The footer element displays the details of the current selected files and folders. - * And also the footer having the switcher to change the layout view. - * @Default {true} - */ - showFooter?: boolean; - - /** FileExplorer control is displayed with rounded corner when this property is set to true. - * @Default {false} - */ - showRoundedCorner?: boolean; - - /** FileExplorer control is rendered with thumbnail preview of images in Tile and LargeIcons layout when this property set to true. - * @Default {true} - */ - showThumbnail?: boolean; - - /** Shows or disables the toolbar in FileExplorer control. - * @Default {true} - */ - showToolbar?: boolean; - - /** Enables or disables the navigation pane in FileExplorer control. The navigation pane contains a tree view element that displays all the folders from the filesystem in a hierarchical manner. - * This is useful to a quick navigation of any folder in the filesystem. - * @Default {true} - */ - showNavigationPane?: boolean; - - /** The tools property is used to configure and group required toolbar items in FileExplorer control. - * @Default {{ creation: [NewFolder], navigation: [Back, Forward, Upward], addressBar: [Addressbar], editing: [Refresh, Upload, Delete, Rename, Download], copyPaste: [Cut, Copy, Paste], - * getProperties: [Details], searchBar: [Searchbar], layout: [Layout], sortBy: [SortBy]}} - */ - tools?: any; - - /** The toolsList property is used to arrange the toolbar items in the FileExplorer control. - * @Default {[layout, creation, navigation, addressBar, editing, copyPaste, sortBy, getProperties, searchBar]} - */ - toolsList?: any[]; - - /** Gets or sets an object that indicates whether to customize the upload behavior in the FileExplorer. - */ - uploadSettings?: UploadSettings; - - /** Specifies the width of FileExplorer control. - * @Default {850} - */ - width?: string|number; - - /** Fires before the AJAX request is performed. */ - beforeAjaxRequest?(e: BeforeAjaxRequestEventArgs): void; - - /** Fires before downloading the files. */ - beforeDownload?(e: BeforeDownloadEventArgs): void; - - /** Fires before getting a requested image from server. Also this event will be triggered when you have enabled thumbnail image compression option in FileExplorer. - * Using this event, you can customize the image compression size. - */ - beforeGetImage?(e: BeforeGetImageEventArgs): void; - - /** Fires before files or folders open. */ - beforeOpen?(e: BeforeOpenEventArgs): void; - - /** Fires before uploading the files. */ - beforeUpload?(e: BeforeUploadEventArgs): void; - - /** Fires when FileExplorer control was created */ - create?(e: CreateEventArgs): void; - - /** Fires when file or folder is copied successfully. */ - copy?(e: CopyEventArgs): void; - - /** Fires when new folder is created successfully in file system. */ - createFolder?(e: CreateFolderEventArgs): void; - - /** Fires when file or folder is cut successfully. */ - cut?(e: CutEventArgs): void; - - /** Fires when the FileExplorer is destroyed successfully. */ - destroy?(e: DestroyEventArgs): void; - - /** Fires when the files or directory has been started to drag over on the FileExplorer */ - dragStart?(e: DragStartEventArgs): void; - - /** Fires when the files or directory is dragging over on the FileExplorer. */ - drag?(e: DragEventArgs): void; - - /** Fires when the files or directory has been stopped to drag over on FileExplorer */ - dragStop?(e: DragStopEventArgs): void; - - /** Fires when the files or directory is dropped to the target folder of FileExplorer */ - drop?(e: DropEventArgs): void; - - /** Fires after loading the requested image from server. Using this event, you can get the details of loaded image. */ - getImage?(e: GetImageEventArgs): void; - - /** Fires when keydown in FileExplorer control. */ - keydown?(e: KeydownEventArgs): void; - - /** Fires when the file view type is changed. */ - layoutChange?(e: LayoutChangeEventArgs): void; - - /** Fires when before the ContextMenu opening. */ - menuBeforeOpen?(e: MenuBeforeOpenEventArgs): void; - - /** Fires when click the ContextMenu item. */ - menuClick?(e: MenuClickEventArgs): void; - - /** Fires when ContextMenu is successfully opened. */ - menuOpen?(e: MenuOpenEventArgs): void; - - /** Fires when files are successfully opened. */ - open?(e: OpenEventArgs): void; - - /** Fires when a file or folder is pasted successfully. */ - paste?(e: PasteEventArgs): void; - - /** Fires when file or folder is deleted successfully. */ - remove?(e: RemoveEventArgs): void; - - /** Fires when resizing is performed for FileExplorer. */ - resize?(e: ResizeEventArgs): void; - - /** Fires when resizing is started for FileExplorer. */ - resizeStart?(e: ResizeStartEventArgs): void; - - /** Fires this event when the resizing is stopped for FileExplorer. */ - resizeStop?(e: ResizeStopEventArgs): void; - - /** Fires when the items from grid view or tile view of FileExplorer control is selected. */ - select?(e: SelectEventArgs): void; - - /** Triggered when refresh the template column elements in the grid view of FileExplorer control. */ - templateRefresh?(e: TemplateRefreshEventArgs): void; - - /** Fires when the items from grid view or tile view or large icons view of FileExplorer control is unselected. */ - unselect?(e: UnselectEventArgs): void; -} - -export interface BeforeAjaxRequestEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the AJAX request data - */ - data?: any; - - /** returns the FileExplorer model - */ - model?: ej.FileExplorer.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface BeforeDownloadEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the downloaded file names. - */ - files?: string[]; - - /** returns the FileExplorer model. - */ - model?: ej.FileExplorer.Model; - - /** returns the path of currently opened item. - */ - path?: string; - - /** returns the selected item details. - */ - selectedItems?: any; - - /** returns the name of the event. - */ - type?: string; -} - -export interface BeforeGetImageEventArgs { - - /** set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** enable or disable the image compress option. - */ - canCompress?: boolean; - - /** returns the FileExplorer model. - */ - model?: ej.FileExplorer.Model; - - /** returns the expected image size. - */ - size?: any; - - /** returns the selected item details. - */ - selectedItems?: any; - - /** returns the name of the event. - */ - type?: string; -} - -export interface BeforeOpenEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the opened item type. - */ - itemType?: string; - - /** returns the FileExplorer model. - */ - model?: ej.FileExplorer.Model; - - /** returns the path of currently opened item. - */ - path?: string; - - /** returns the selected item details. - */ - selectedItems?: any; - - /** returns the name of the event. - */ - type?: string; -} - -export interface BeforeUploadEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the FileExplorer model. - */ - model?: ej.FileExplorer.Model; - - /** returns the path of currently opened item. - */ - path?: string; - - /** returns the selected item details. - */ - selectedItems?: any; - - /** returns the upload item details. - */ - uploadItemDetails?: any; - - /** returns the name of the event. - */ - type?: string; -} - -export interface CreateEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the FileExplorer model. - */ - model?: ej.FileExplorer.Model; - - /** returns the name of the event. - */ - type?: string; -} - -export interface CopyEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the FileExplorer model. - */ - model?: ej.FileExplorer.Model; - - /** returns the name of copied file/folder. - */ - name?: string[]; - - /** returns the selected item details. - */ - selectedItems?: any; - - /** returns the source path. - */ - sourcePath?: string; - - /** returns the name of the event. - */ - type?: string; -} - -export interface CreateFolderEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the AJAX response data - */ - data?: any; - - /** returns the FileExplorer model - */ - model?: ej.FileExplorer.Model; - - /** returns the selected item details - */ - selectedItems?: any; - - /** returns the name of the event. - */ - type?: string; -} - -export interface CutEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the FileExplorer model. - */ - model?: ej.FileExplorer.Model; - - /** returns the name of moved file or folder. - */ - name?: string[]; - - /** returns the selected item details. - */ - selectedItems?: any; - - /** returns the source path. - */ - sourcePath?: string; - - /** returns the name of the event. - */ - type?: string; -} - -export interface DestroyEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the FileExplorer model. - */ - model?: ej.FileExplorer.Model; - - /** returns the name of the event. - */ - type?: string; -} - -export interface DragStartEventArgs { - - /** set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the FileExplorer model. - */ - model?: ej.FileExplorer.Model; - - /** returns the name of the event. - */ - type?: string; - - /** returns the dragging element. - */ - target?: any; - - /** returns the path of dragging element. - */ - targetPath?: string; - - /** returns the dragging file details. - */ - selectedItems?: any; -} - -export interface DragEventArgs { - - /** set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the FileExplorer model. - */ - model?: ej.FileExplorer.Model; - - /** returns the name of the event. - */ - type?: string; - - /** returns the target element. - */ - target?: any; - - /** returns the name of target element. - */ - targetElementName?: string; - - /** returns the path of target element. - */ - targetPath?: string; -} - -export interface DragStopEventArgs { - - /** set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the FileExplorer model. - */ - model?: ej.FileExplorer.Model; - - /** returns the name of the event. - */ - type?: string; - - /** returns the target element. - */ - target?: any; - - /** returns the path of target element. - */ - targetPath?: string; - - /** returns the name of target element - */ - targetElementName?: string; - - /** returns the action, which is performed after dropping the files (upload/ move). - */ - dropAction?: string; - - /** returns the dragging file details - */ - fileInfo?: any; -} - -export interface DropEventArgs { - - /** set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the FileExplorer model. - */ - model?: ej.FileExplorer.Model; - - /** returns the name of the event. - */ - type?: string; - - /** returns the target element. - */ - target?: any; - - /** returns the name of target folder. - */ - targetFolder?: string; - - /** returns the path of target folder. - */ - targetPath?: string; - - /** returns the dragging element details. - */ - fileInfo?: any; - - /** returns the action, which is performed after dropping the files (upload/ move). - */ - dropAction?: string; -} - -export interface GetImageEventArgs { - - /** set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** loaded image path. - */ - path?: string; - - /** loaded image element - */ - element?: any; - - /** returns the FileExplorer model. - */ - model?: ej.FileExplorer.Model; - - /** original arguments of image load or error event - */ - originalArgs?: any; - - /** returns the action type, which specifies thumbnail preview or opening image. - */ - action?: string; - - /** returns the name of the event. - */ - type?: string; -} - -export interface KeydownEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the downed key keyCode value - */ - keyCode?: number; - - /** returns altKey value. - */ - altKey?: boolean; - - /** returns shiftKey value. - */ - shiftKey?: boolean; - - /** returns ctrlKey value. - */ - ctrlKey?: boolean; - - /** returns the event object. - */ - originalArgs?: any; - - /** returns the FileExplorer model. - */ - model?: ej.FileExplorer.Model; - - /** returns the name of the event. - */ - type?: string; -} - -export interface LayoutChangeEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** return true when we change the layout via interaction, else false. - */ - isInteraction?: boolean; - - /** returns the current view type. - */ - layoutType?: string; - - /** returns the FileExplorer model. - */ - model?: any; - - /** returns the name of the event. - */ - type?: string; -} - -export interface MenuBeforeOpenEventArgs { - - /** set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the name of ContextMenu items group. - */ - contextMenu?: string; - - /** returns the dataSource of ContextMenu. - */ - dataSource?: any[]; - - /** returns the element of ContextMenu. - */ - element?: any; - - /** returns the event of ContextMenu. - */ - events?: any; - - /** returns the FileExplorer model. - */ - model?: ej.FileExplorer.Model; - - /** returns the target element. - */ - target?: any; - - /** returns the name of the event. - */ - type?: string; -} - -export interface MenuClickEventArgs { - - /** returns the ID of clicked ContextMenu item. - */ - ID?: string; - - /** set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the name of ContextMenu items group. - */ - contextMenu?: string; - - /** returns the element of clicked ContextMenu item. - */ - element?: any; - - /** returns the event of ContextMenu. - */ - event?: any; - - /** returns the FileExplorer model. - */ - model?: ej.FileExplorer.Model; - - /** returns the parent element ID of clicked ContextMenu item. - */ - parentId?: string; - - /** returns the parent element text of clicked ContextMenu item. - */ - parentText?: string; - - /** returns the text of clicked ContextMenu item. - */ - text?: string; - - /** returns the name of the event. - */ - type?: string; -} - -export interface MenuOpenEventArgs { - - /** set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the name of ContextMenu items group. - */ - contextMenu?: string; - - /** returns the element of ContextMenu. - */ - element?: any; - - /** returns the FileExplorer model. - */ - model?: ej.FileExplorer.Model; - - /** returns the target element. - */ - target?: any; - - /** returns the name of the event. - */ - type?: string; -} - -export interface OpenEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the opened item type. - */ - itemType?: string; - - /** returns the FileExplorer model. - */ - model?: ej.FileExplorer.Model; - - /** returns the path of currently opened item. - */ - path?: string; - - /** returns the selected item details. - */ - selectedItems?: any; - - /** returns the name of the event. - */ - type?: string; -} - -export interface PasteEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the FileExplorer model. - */ - model?: ej.FileExplorer.Model; - - /** returns the name of moved/copied file or folder. - */ - name?: string[]; - - /** returns the selected item details. - */ - selectedItems?: any; - - /** returns the target folder item details. - */ - targetFolder?: any; - - /** returns the target path. - */ - targetPath?: string; - - /** returns the name of the event. - */ - type?: string; -} - -export interface RemoveEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the AJAX response data. - */ - data?: any; - - /** returns the FileExplorer model. - */ - model?: ej.FileExplorer.Model; - - /** returns the names of deleted items. - */ - name?: string; - - /** returns the path of deleted item. - */ - path?: string; - - /** returns the removed item details. - */ - selectedItems?: any; - - /** returns the name of the event. - */ - type?: string; -} - -export interface ResizeEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the mouse move event args. - */ - event?: any; - - /** returns the FileExplorer model. - */ - model?: ej.FileExplorer.Model; - - /** returns the name of the event. - */ - type?: string; -} - -export interface ResizeStartEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the mouse down event args. - */ - event?: any; - - /** returns the FileExplorer model. - */ - model?: ej.FileExplorer.Model; - - /** returns the name of the event. - */ - type?: string; -} - -export interface ResizeStopEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the mouse leave event args. - */ - event?: any; - - /** returns the FileExplorer model. - */ - model?: ej.FileExplorer.Model; - - /** returns the name of the event. - */ - type?: string; -} - -export interface SelectEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the FileExplorer model. - */ - model?: ej.FileExplorer.Model; - - /** returns the name of selected items. - */ - name?: string[]; - - /** returns the path of selected items. - */ - path?: string; - - /** returns the selected item details - */ - selectedItems?: any; - - /** returns the name of the event. - */ - type?: string; -} - -export interface TemplateRefreshEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** Returns the cell object. - */ - cell?: ej.FileExplorer.Model; - - /** Returns the column object. - */ - column?: any; - - /** Returns the current row data. - */ - data?: any; - - /** Returns the grid model of FileExplorer. - */ - model?: any; - - /** Returns the current row index. - */ - rowIndex?: number; - - /** returns the name of the event. - */ - type?: string; -} - -export interface UnselectEventArgs { - - /** Returns the FileExplorer model. - */ - model?: ej.FileExplorer.Model; - - /** Returns the name of unselected item. - */ - name?: string; - - /** Returns the type of unselected item. - */ - nodeType?: string; - - /** Returns the path of unselected item. - */ - path?: string; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the unselected item details. - */ - unselectedItem?: any; -} - -export interface ContextMenuSettings { - - /** The items property is used to configure and group the required ContextMenu items in FileExplorer control. - * @Default {{% highlight javascript %}{navbar: [NewFolder, Upload, |, Delete, Rename, |, Cut, Copy, Paste, |, Getinfo],cwd: [Refresh, Paste,|, SortBy, |, NewFolder, Upload, |, - * Getinfo],files: [Open, Download, |, Upload, |, Delete, Rename, |, Cut, Copy, Paste, |, OpenFolderLocation, Getinfo]}{% endhighlight %}} - */ - items?: any; - - /** The customMenuFields property is used to define custom functionality for custom ContextMenu item's which are defined in items property. - * @Default {[]} - */ - customMenuFields?: any[]; -} - -export interface FilterSettings { - - /** It allows to search the text given in search Textbox in every keyup event. When this property was set as false, searching will works only on Enter key and searchbar blur. - * @Default {true} - */ - allowSearchOnTyping?: boolean; - - /** Enables or disables to perform the filter operation with case sensitive. - * @Default {false} - */ - caseSensitiveSearch?: boolean; - - /** Sets the search filter type. There are several filter types available such as "startswith", "contains", "endswith". See filterType. - * @Default {ej.FileExplorer.filterType.Contains} - */ - filterType?: ej.FilterType|string; -} - -export interface GridSettings { - - /** Allows to Resize the width of the columns by simply click and move the particular column header line. - * @Default {true} - */ - allowResizing?: boolean; - - /** Gets or sets a value that indicates whether to enable the dynamic sorting behavior on grid data. Sorting can be done through clicking on particular column header. - * @Default {true} - */ - allowSorting?: boolean; - - /** Gets or sets an object that indicates to render the grid with specified columns. You can use this property same as the column property in Grid control. - * @Default {[{ field: name, headerText: Name, width: 30% }, { field: dateModified, headerText: Date Modified, width: 30% }, { field: type, headerText: Type, width: 15% }, - * { field: size, headerText: Size, width: 12%, textAlign: right, headerTextAlign: left }]} - */ - columns?: any[]; -} - -export interface UploadSettings { - - /** Specifies the maximum file size allowed to upload. It accepts the value in bytes. - * @Default {31457280} - */ - maxFileSize?: number; - - /** Enables or disables the multiple files upload. When it is enabled, you can upload multiple files at a time and when disabled, you can upload only one file at a time. - * @Default {true} - */ - allowMultipleFile?: boolean; - - /** Enables or disables the auto upload option while uploading files in FileExplorer control. - * @Default {false} - */ - autoUpload?: boolean; -} - -enum layoutType { - - ///Supports to display files in tile view - Tile, - - ///Supports to display files in grid view - Grid, - - ///Supports to display files as large icons - LargeIcons -} - -} - -class DatePicker extends ej.Widget { - static fn: DatePicker; - constructor(element: JQuery | Element, options?: DatePicker.Model); - static Locale: any; - model: DatePicker.Model; - defaults: DatePicker.Model; - - /** Disables the DatePicker control. - * @returns {void} - */ - disable(): void; - - /** Enable the DatePicker control, if it is in disabled state. - * @returns {void} - */ - enable(): void; - - /** Returns the current date value in the DatePicker control. - * @returns {string} - */ - getValue(): string; - - /** Close the DatePicker popup, if it is in opened state. - * @returns {void} - */ - hide(): void; - - /** Opens the DatePicker popup. - * @returns {void} - */ - show(): void; -} -export namespace DatePicker { - -export interface Model { - - /** Used to allow or restrict the editing in DatePicker input field directly. By setting false to this API, You can only pick the date from DatePicker popup. - * @Default {true} - */ - allowEdit?: boolean; - - /** allow or restrict the drill down to multiple levels of view (month/year/decade) in DatePicker calendar - * @Default {true} - */ - allowDrillDown?: boolean; - - /** Disable the list of specified date value. - * @Default {{}} - */ - blackoutDates?: any; - - /** Sets the specified text value to the today button in the DatePicker calendar. - * @Default {Today} - */ - buttonText?: string; - - /** Sets the root CSS class for DatePicker theme, which is used customize. - */ - cssClass?: string; - - /** Formats the value of the DatePicker in to the specified date format. If this API is not specified, dateFormat will be set based on the current culture of DatePicker. - * @Default {MM/dd/yyyy} - */ - dateFormat?: string; - - /** Specifies the header format of days in DatePicker calendar. See below to get available Headers options - * @Default {ej.DatePicker.Header.Short} - */ - dayHeaderFormat?: string | ej.DatePicker.Header; - - /** Specifies the navigation depth level in DatePicker calendar. This option is not applied when start level view option is lower than depth level view. - * See below to know available levels in DatePicker Calendar - */ - depthLevel?: string | ej.DatePicker.Level; - - /** Allows to embed the DatePicker calendar in the page. Also associates DatePicker with div element instead of input. - * @Default {false} - */ - displayInline?: boolean; - - /** Enables or disables the animation effect with DatePicker calendar. - * @Default {true} - */ - enableAnimation?: boolean; - - /** Enable or disable the DatePicker control. - * @Default {true} - */ - enabled?: boolean; - - /** Sustain the entire widget model of DatePicker even after form post or browser refresh - * @Default {false} - */ - enablePersistence?: boolean; - - /** Displays DatePicker calendar along with DatePicker input field in Right to Left direction. - * @Default {false} - */ - enableRTL?: boolean; - - /** Allows to enter valid or invalid date in input textbox and indicate as error if it is invalid value, when this API value is set to true. For false value, invalid date is not allowed - * to input field and corrected to valid date automatically, even if invalid date is given. - * @Default {false} - */ - enableStrictMode?: boolean; - - /** Used the required fields for special Dates in DatePicker in order to customize the special dates in a calendar. - * @Default {null} - */ - fields?: Fields; - - /** Specifies the header format to be displayed in the DatePicker calendar. - * @Default {MMMM yyyy} - */ - headerFormat?: string; - - /** Specifies the height of the DatePicker input text. - * @Default {28px} - */ - height?: string; - - /** HighlightSection is used to highlight currently selected date's month/week/workdays. See below to get available HighlightSection options - * @Default {none} - */ - highlightSection?: string | ej.DatePicker.HighlightSection; - - /** Weekend dates will be highlighted when this property is set to true. - * @Default {false} - */ - highlightWeekend?: boolean; - - /** Specifies the HTML Attributes of the DatePicker. - * @Default {{}} - */ - htmlAttributes?: any; - - /** Change the DatePicker calendar and date format based on given culture. - * @Default {en-US} - */ - locale?: string; - - /** Specifies the maximum date in the calendar that the user can select. - * @Default {new Date(2099, 11, 31)} - */ - maxDate?: string|Date; - - /** Specifies the minimum date in the calendar that the user can select. - * @Default {new Date(1900, 00, 01)} - */ - minDate?: string|Date; - - /** Allows to toggles the read only state of the DatePicker. When the widget is readOnly, it doesn't allow your input. - * @Default {false} - */ - readOnly?: boolean; - - /** It allow to show/hide the disabled date ranges - * @Default {true} - */ - showDisabledRange?: boolean; - - /** It allows to display footer in DatePicker calendar. - * @Default {true} - */ - showFooter?: boolean; - - /** It allows to display/hides the other months days from the current month calendar in a DatePicker. - * @Default {true} - */ - showOtherMonths?: boolean; - - /** Shows/hides the date icon button at right side of textbox, which is used to open or close the DatePicker calendar popup. - * @Default {true} - */ - showPopupButton?: boolean; - - /** DatePicker input is displayed with rounded corner when this property is set to true. - * @Default {false} - */ - showRoundedCorner?: boolean; - - /** Used to show the tooltip when hovering on the days in the DatePicker calendar. - * @Default {true} - */ - showTooltip?: boolean; - - /** Specifies the special dates in DatePicker. - * @Default {null} - */ - specialDates?: any; - - /** Specifies the start day of the week in DatePicker calendar. - * @Default {0} - */ - startDay?: number; - - /** Specifies the start level view in DatePicker calendar. See below available Levels - * @Default {ej.DatePicker.Level.Month} - */ - startLevel?: string | ej.DatePicker.Level; - - /** Specifies the number of months to be navigate for one click of next and previous button in a DatePicker Calendar. - * @Default {1} - */ - stepMonths?: number; - - /** Provides option to customize the tooltip format. - * @Default {ddd MMM dd yyyy} - */ - tooltipFormat?: string; - - /** Sets the jQuery validation support to DatePicker Date value. See validation - * @Default {null} - */ - validationMessage?: any; - - /** Sets the jQuery validation custom rules to the DatePicker. see validation - * @Default {null} - */ - validationRules?: any; - - /** sets or returns the current value of DatePicker - * @Default {null} - */ - value?: string|Date; - - /** Specifies the water mark text to be displayed in input text. - * @Default {Select date} - */ - watermarkText?: string; - - /** Specifies the width of the DatePicker input text. - * @Default {160px} - */ - width?: string; - - /** Fires before closing the DatePicker popup. */ - beforeClose?(e: BeforeCloseEventArgs): void; - - /** Fires when each date is created in the DatePicker popup calendar. */ - beforeDateCreate?(e: BeforeDateCreateEventArgs): void; - - /** Fires before opening the DatePicker popup. */ - beforeOpen?(e: BeforeOpenEventArgs): void; - - /** Fires when the DatePicker input value is changed. */ - change?(e: ChangeEventArgs): void; - - /** Fires when DatePicker popup is closed. */ - close?(e: CloseEventArgs): void; - - /** Fires when the DatePicker is created successfully. */ - create?(e: CreateEventArgs): void; - - /** Fires when the DatePicker is destroyed successfully. */ - destroy?(e: DestroyEventArgs): void; - - /** Fires when DatePicker input gets focus. */ - focusIn?(e: FocusInEventArgs): void; - - /** Fires when DatePicker input loses the focus. */ - focusOut?(e: FocusOutEventArgs): void; - - /** Fires when calender view navigates to month/year/decade/century. */ - navigate?(e: NavigateEventArgs): void; - - /** Fires when DatePicker popup is opened. */ - open?(e: OpenEventArgs): void; - - /** Fires when a date is selected from the DatePicker popup. */ - select?(e: SelectEventArgs): void; -} - -export interface BeforeCloseEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the DatePicker model. - */ - model?: ej.DatePicker.Model; - - /** returns the name of the event. - */ - type?: string; - - /** returns the event parameters from DatePicker. - */ - events?: any; - - /** returns the DatePicker popup. - */ - element?: HTMLElement; -} - -export interface BeforeDateCreateEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the DatePicker model. - */ - model?: ej.DatePicker.Model; - - /** returns the name of the event. - */ - type?: string; - - /** returns the currently created date object. - */ - date?: any; - - /** returns the current DOM object of the date from the Calendar. - */ - element?: HTMLElement; - - /** returns the currently created date as string type. - */ - value?: string; -} - -export interface BeforeOpenEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the DatePicker model. - */ - model?: ej.DatePicker.Model; - - /** returns the name of the event. - */ - type?: string; - - /** returns the event parameters from DatePicker. - */ - events?: any; - - /** returns the DatePicker popup. - */ - element?: HTMLElement; -} - -export interface ChangeEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the DatePicker model. - */ - model?: ej.DatePicker.Model; - - /** returns the name of the event. - */ - type?: string; - - /** returns the DatePicker input value. - */ - value?: string; - - /** returns the previously selected value. - */ - prevDate?: string; -} - -export interface CloseEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the current date object. - */ - date?: any; - - /** returns the DatePicker model. - */ - model?: ej.DatePicker.Model; - - /** returns the name of the event. - */ - type?: string; - - /** returns the current date value. - */ - value?: string; - - /** returns the previously selected value. - */ - prevDate?: string; -} - -export interface CreateEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the DatePicker model. - */ - model?: ej.DatePicker.Model; - - /** returns the name of the event. - */ - type?: string; -} - -export interface DestroyEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the DatePicker model. - */ - model?: ej.DatePicker.Model; - - /** returns the name of the event. - */ - type?: string; -} - -export interface FocusInEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the DatePicker model. - */ - model?: ej.DatePicker.Model; - - /** returns the name of the event. - */ - type?: string; - - /** returns the currently selected date value. - */ - value?: string; -} - -export interface FocusOutEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the DatePicker model. - */ - model?: ej.DatePicker.Model; - - /** returns the name of the event. - */ - type?: string; - - /** returns the currently selected date value. - */ - value?: string; - - /** returns the previously selected date value. - */ - prevDate?: string; -} - -export interface NavigateEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the current date object. - */ - date?: any; - - /** returns the DatePicker model. - */ - model?: ej.DatePicker.Model; - - /** returns the previous view state of calendar. - */ - navigateFrom?: string; - - /** returns the current view state of calendar. - */ - navigateTo?: string; - - /** returns the name of the event - */ - type?: string; - - /** returns the current date value. - */ - value?: string; -} - -export interface OpenEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the current date object. - */ - date?: any; - - /** returns the DatePicker model. - */ - model?: ej.DatePicker.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the current date value. - */ - value?: string; - - /** returns the previously selected value. - */ - prevDate?: string; -} - -export interface SelectEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the selected date object. - */ - date?: any; - - /** returns the DatePicker model. - */ - model?: ej.DatePicker.Model; - - /** returns the name of the event. - */ - type?: string; - - /** returns the current date value. - */ - value?: string; - - /** returns the previously selected value. - */ - prevDate?: string; - - /** returns whether the currently selected date is special date or not. - */ - isSpecialDay?: string; -} - -export interface Fields { - - /** Specifies the specials dates - */ - date?: string; - - /** Specifies the icon class to special dates. - */ - iconClass?: string; - - /** Specifies the tooltip to special dates. - */ - tooltip?: string; - - /** Specifies the CSS class to customize the date. - */ - cssClass?: string; -} - -enum Header { - - ///Removes day header in DatePicker - None, - - ///sets the short format of day name (like Sun) in header in DatePicker - Short, - - ///sets the Min format of day name (like su) in header format DatePicker - Min -} - - -enum Level { - - ///allow navigation upto year level in DatePicker - Year, - - ///allow navigation upto decade level in DatePicker - Decade, - - ///allow navigation upto Century level in DatePicker - Century -} - - -enum HighlightSection { - - ///Highlight the week of the currently selected date in DatePicker popup calendar - Week, - - ///Highlight the workdays in a currently selected date's week in DatePicker popup calendar - WorkDays, - - ///Nothing will be highlighted, remove highlights from DatePicker popup calendar if already exists - None -} - -} - -class DateTimePicker extends ej.Widget { - static fn: DateTimePicker; - constructor(element: JQuery | Element, options?: DateTimePicker.Model); - static Locale: any; - model: DateTimePicker.Model; - defaults: DateTimePicker.Model; - - /** Disables the DateTimePicker control. - * @returns {void} - */ - disable(): void; - - /** Enables the DateTimePicker control. - * @returns {void} - */ - enable(): void; - - /** Returns the current datetime value in the DateTimePicker. - * @returns {string} - */ - getValue(): string; - - /** Hides or closes the DateTimePicker popup. - * @returns {void} - */ - hide(): void; - - /** Updates the current system date value and time value to the DateTimePicker. - * @returns {void} - */ - setCurrentDateTime(): void; - - /** Shows or opens the DateTimePicker popup. - * @returns {void} - */ - show(): void; -} -export namespace DateTimePicker { - -export interface Model { - - /** Displays the custom text for the buttons inside the DateTimePicker popup. when the culture value changed, we can change the buttons text based on the culture. - * @Default {{ today: Today, timeNow: Time Now, done: Done, timeTitle: Time }} - */ - buttonText?: ButtonText; - - /** Set the root class for DateTimePicker theme. This cssClass API helps to use custom skinning option for DateTimePicker control. - */ - cssClass?: string; - - /** Defines the datetime format displayed in the DateTimePicker. The value should be a combination of date format and time format. - * @Default {M/d/yyyy h:mm tt} - */ - dateTimeFormat?: string; - - /** Specifies the header format of the datepicker inside the DateTimePicker popup. See DatePicker.Header - * @Default {ej.DatePicker.Header.Short} - */ - dayHeaderFormat?: ej.DatePicker.Header|string; - - /** Specifies the navigation depth level in DatePicker calendar inside DateTimePicker popup. This option is not applied - * when start level view option is lower than depth level view. See ej.DatePicker.Level - */ - depthLevel?: ej.DatePicker.Level|string; - - /** Enable or disable the animation effect in DateTimePicker. - * @Default {true} - */ - enableAnimation?: boolean; - - /** When this property is set to false, it disables the DateTimePicker control. - * @Default {false} - */ - enabled?: boolean; - - /** Enables or disables the state maintenance of DateTimePicker. - * @Default {false} - */ - enablePersistence?: boolean; - - /** Sets the DateTimePicker direction as right to left alignment. - * @Default {false} - */ - enableRTL?: boolean; - - /** When enableStrictMode true it allows the value outside of the range also but it highlights the textbox with error class, otherwise it internally changed to the correct value. - * @Default {false} - */ - enableStrictMode?: boolean; - - /** Specifies the header format to be displayed in the DatePicker calendar inside the DateTimePicker popup. - * @Default {MMMM yyyy} - */ - headerFormat?: string; - - /** Defines the height of the DateTimePicker textbox. - * @Default {30} - */ - height?: string|number; - - /** Specifies the HTML Attributes of the ejDateTimePicker - * @Default {{}} - */ - htmlAttributes?: any; - - /** Sets the time interval between the two adjacent time values in the time popup. - * @Default {30} - */ - interval?: number; - - /** Defines the localization culture for DateTimePicker. - * @Default {en-US} - */ - locale?: string; - - /** Sets the maximum value to the DateTimePicker. Beyond the maximum value an error class is added to the wrapper element when we set true to enableStrictMode. - * @Default {new Date(12/31/2099 11:59:59 PM)} - */ - maxDateTime?: string|Date; - - /** Sets the minimum value to the DateTimePicker. Behind the minimum value an error class is added to the wrapper element. - * @Default {new Date(1/1/1900 12:00:00 AM)} - */ - minDateTime?: string|Date; - - /** Specifies the popup position of DateTimePicker.See below to know available popup positions - * @Default {ej.DateTimePicker.Bottom} - */ - popupPosition?: string | ej.popupPosition; - - /** Indicates that the DateTimePicker value can only be read and can’t change. - * @Default {false} - */ - readOnly?: boolean; - - /** It allows showing days in other months of DatePicker calendar inside the DateTimePicker popup. - * @Default {true} - */ - showOtherMonths?: boolean; - - /** Shows or hides the arrow button from the DateTimePicker textbox. When the button disabled, the DateTimePicker popup opens while focus in the textbox and hides while focus out from the textbox. - * @Default {true} - */ - showPopupButton?: boolean; - - /** Changes the sharped edges into rounded corner for the DateTimePicker textbox and popup. - * @Default {false} - */ - showRoundedCorner?: boolean; - - /** Specifies the start day of the week in datepicker inside the DateTimePicker popup. - * @Default {1} - */ - startDay?: number; - - /** Specifies the start level view in datepicker inside the DateTimePicker popup. See DatePicker.Level - * @Default {ej.DatePicker.Level.Month or month} - */ - startLevel?: ej.DatePicker.Level|string; - - /** Specifies the number of months to navigate at one click of next and previous button in datepicker inside the DateTimePicker popup. - * @Default {1} - */ - stepMonths?: number; - - /** Defines the time format displayed in the time dropdown inside the DateTimePicker popup. - * @Default {h:mm tt} - */ - timeDisplayFormat?: string; - - /** We can drill down up to time interval on selected date with meridian details. - * @Default {{ enabled: false, interval: 5, showMeridian: false, autoClose: true }} - */ - timeDrillDown?: TimeDrillDown; - - /** Defines the width of the time dropdown inside the DateTimePicker popup. - * @Default {100} - */ - timePopupWidth?: string|number; - - /** Set the jQuery validation error message in DateTimePicker. - * @Default {null} - */ - validationMessage?: any; - - /** Set the jQuery validation rules in DateTimePicker. - * @Default {null} - */ - validationRules?: any; - - /** Sets the DateTime value to the control. - */ - value?: string|Date; - - /** Specifies the water mark text to be displayed in input text. - * @Default {Select date and time} - */ - watermarkText?: string; - - /** Defines the width of the DateTimePicker textbox. - * @Default {143} - */ - width?: string|number; - - /** Fires before the datetime popup closed in the DateTimePicker. */ - beforeClose?(e: BeforeCloseEventArgs): void; - - /** Fires before the datetime popup open in the DateTimePicker. */ - beforeOpen?(e: BeforeOpenEventArgs): void; - - /** Fires when the datetime value changed in the DateTimePicker textbox. */ - change?(e: ChangeEventArgs): void; - - /** Fires when DateTimePicker popup closes. */ - close?(e: CloseEventArgs): void; - - /** Fires after DateTimePicker control is created. */ - create?(e: CreateEventArgs): void; - - /** Fires when the DateTimePicker is destroyed successfully */ - destroy?(e: DestroyEventArgs): void; - - /** Fires when the focus-in happens in the DateTimePicker textbox. */ - focusIn?(e: FocusInEventArgs): void; - - /** Fires when the focus-out happens in the DateTimePicker textbox. */ - focusOut?(e: FocusOutEventArgs): void; - - /** Fires when DateTimePicker popup opens. */ - open?(e: OpenEventArgs): void; -} - -export interface BeforeCloseEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the DateTimePicker model. - */ - model?: ej.DateTimePicker.Model; - - /** returns the name of the event. - */ - type?: string; - - /** returns the event parameters from DateTimePicker. - */ - events?: any; - - /** returns the DateTimePicker popup. - */ - element?: HTMLElement; -} - -export interface BeforeOpenEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the DateTimePicker model. - */ - model?: ej.DateTimePicker.Model; - - /** returns the name of the event. - */ - type?: string; - - /** returns the event parameters from DateTimePicker. - */ - events?: any; - - /** returns the DateTimePicker popup. - */ - element?: HTMLElement; -} - -export interface ChangeEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TimePicker model - */ - model?: ej.DateTimePicker.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the current value is valid or not - */ - isValidState?: boolean; - - /** returns the modified datetime value - */ - value?: string; - - /** returns the previously selected date time value - */ - prevDateTime?: string; - - /** returns true if change event triggered by interaction, otherwise returns false - */ - isInteraction?: boolean; -} - -export interface CloseEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TimePicker model - */ - model?: ej.DateTimePicker.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the modified datetime value - */ - value?: string; - - /** returns the previously selected date time value - */ - prevDateTime?: string; -} - -export interface CreateEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the DateTimePicker model - */ - model?: ej.DateTimePicker.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface DestroyEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the DateTimePicker model - */ - model?: ej.DateTimePicker.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface FocusInEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TimePicker model - */ - model?: ej.DateTimePicker.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the datetime value, which is in text box - */ - value?: string; -} - -export interface FocusOutEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TimePicker model - */ - model?: ej.DateTimePicker.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the datetime value, which is in text box - */ - value?: string; -} - -export interface OpenEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TimePicker model - */ - model?: ej.DateTimePicker.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the modified datetime value - */ - value?: string; - - /** returns the previously selected date time value - */ - prevDateTime?: string; -} - -export interface ButtonText { - - /** Sets the text for the Done button inside the datetime popup. - */ - done?: string; - - /** Sets the text for the Now button inside the datetime popup. - */ - timeNow?: string; - - /** Sets the header text for the Time dropdown. - */ - timeTitle?: string; - - /** Sets the text for the Today button inside the datetime popup. - */ - today?: string; -} - -export interface TimeDrillDown { - - /** This is the field to show/hide the timeDrillDown in DateTimePicker. - */ - enabled?: boolean; - - /** Sets the interval time of minutes on selected date. - */ - interval?: number; - - /** Allows the user to show or hide the meridian with time in DateTimePicker. - */ - showMeridian?: boolean; - - /** After choosing the time, the popup will close automatically if we set it as true, otherwise we focus out the DateTimePicker or choose timeNow button for closing the popup. - */ - autoClose?: boolean; -} -} -enum popupPosition { -//Opens the DateTimePicker popup below to the DateTimePicker input box -Bottom, -//Opens the DateTimePicker popup above to the DateTimePicker input box -Top, -} - -class DateRangePicker extends ej.Widget { - static fn: DateRangePicker; - constructor(element: JQuery | Element, options?: DateRangePicker.Model); - static Locale: any; - model: DateRangePicker.Model; - defaults: DateRangePicker.Model; - - /** Add the preset ranges to DateRangePicker popup. - * @param {string} Display name - * @param {Array} StartDate and endDate of range. - * @returns {void} - */ - addRanges(label: string, range: any[]): void; - - /** Clears the all ranges selections in DateRangePicker popup - * @returns {void} - */ - clearRanges(): void; - - /** Disables the DateRangePicker control. - * @returns {void} - */ - disable(): void; - - /** Enable the DateRangePicker control, if it is in disabled state. - * @returns {void} - */ - enable(): void; - - /** Returns the startDate and endDate values in the selected ranges in the DateRangePicker control. - * @returns {string} - */ - getSelectedValue(): string; - - /** Close the DateRangePicker popup, if it is in opened state. - * @returns {void} - */ - popupHide(): void; - - /** Opens the DateRangePicker popup. - * @returns {void} - */ - popupShow(): void; - - /** set the preset ranges to DateRangePicker popup. - * @returns {void} - */ - setRange(): void; -} -export namespace DateRangePicker { - -export interface Model { - - /** Used to allow or restrict the editing in DateRangePicker input field directly. By setting false to this API, You can only pick the date ranges from DateRangePicker popup. - * @Default {true} - */ - allowEdit?: boolean; - - /** Sets the specified text value to the available buttons (Reset, Cancel, Apply) in the DateRangePicker popup. - * @Default {{ reset: Reset, cancel: Cancel, apply: Apply}} - */ - buttonText?: any; - - /** Sets the root CSS class for DateRangePicker theme, which is used to customize. - */ - cssClass?: string; - - /** Formats the date value of the DateRangePicker in to the specified date format. If this API is not specified, dateFormat will be set based on the current culture of DateRangePicker. - * @Default {MM/dd/yyyy} - */ - dateFormat?: string; - - /** Allows to embed the Timepicker align with the calendars in the page, two timepicker will be render, for selecting start and end date. - * @Default {false} - */ - enableTimePicker?: boolean; - - /** Enable or disable the DateRangePicker control. - * @Default {true} - */ - enabled?: boolean; - - /** Sustain the entire widget model of DateRangePicker even after form post or browser refresh - * @Default {false} - */ - enablePersistence?: boolean; - - /** Specifies the end date of the date ranges. - * @Default {null} - */ - endDate?: string|Date; - - /** Specifies the height of the DateRangePicker input. - * @Default {28px} - */ - height?: string|number; - - /** Change the DateRangePicker calendar and date format based on given culture. - * @Default {en-US} - */ - locale?: string; - - /** Used to add the preset ranges. Added ranges using this, will show in popup in right side for easy selection of different preset ranges. - * @Default {null} - */ - ranges?: any; - - /** Specifies the start date of the date ranges - * @Default {null} - */ - startDate?: string|Date; - - /** Shows/hides the date icon button at right side of textbox, which is used to open or close the DateRangePicker calendar popup. - * @Default {true} - */ - showPopupButton?: boolean; - - /** DateRangePicker input and popup is displayed with rounded corner when this property is set to true. - * @Default {false} - */ - showRoundedCorner?: boolean; - - /** Formats the date value of the DateRangePicker in to the specified time format. If this API is not specified, timeFormat will be set based on the current culture of DateRangePicker. - * @Default {HH:mm tt} - */ - timeFormat?: string; - - /** Separated two date values in string format to sets the date ranges in calendars. - * @Default {null} - */ - value?: string; - - /** Specifies the water mark text to be displayed in input text. - * @Default {Select Range} - */ - watermarkText?: string; - - /** Specifies the width of the DateRangePicker input text. - * @Default {160px} - */ - width?: string|number; - - /** Fires before closing the DateRangePicker popup. */ - beforeClose?(e: BeforeCloseEventArgs): void; - - /** Fires before opening the DateRangePicker popup. */ - beforeOpen?(e: BeforeOpenEventArgs): void; - - /** Fires when the DateRangePicker values get changed. */ - onChange?(e: OnChangeEventArgs): void; - - /** Fires when DateRangePicker popup is closed. */ - close?(e: CloseEventArgs): void; - - /** Fires when the DateRangePicker is created successfully. */ - create?(e: CreateEventArgs): void; - - /** Fires when the DateRangePicker is destroyed successfully. */ - destroy?(e: DestroyEventArgs): void; - - /** Fires when DateRangePicker popup is opened. */ - open?(e: OpenEventArgs): void; - - /** Fires when a date ranges is selected from the DateRangePicker popup. */ - select?(e: SelectEventArgs): void; -} - -export interface BeforeCloseEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the DateRangePicker model - */ - model?: ej.DateRangePicker.Model; - - /** returns the name of the event. - */ - type?: string; - - /** returns the event parameters from DateRangePicker. - */ - events?: any; - - /** returns the DateRangePicker popup. - */ - element?: HTMLElement; -} - -export interface BeforeOpenEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the DateRangePicker model. - */ - model?: ej.DateRangePicker.Model; - - /** returns the name of the event. - */ - type?: string; - - /** returns the event parameters from DateRangePicker. - */ - events?: any; - - /** returns the DateRangePicker popup. - */ - element?: HTMLElement; -} - -export interface OnChangeEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the DateRangePicker model. - */ - model?: ej.DateRangePicker.Model; - - /** returns the name of the event. - */ - type?: string; - - /** returns the DateRangePicker input value. - */ - value?: string; - - /** returns the startDate of DateRangePicker. - */ - startDate?: any; - - /** returns the endDate of the DateRangePicker popup. - */ - endDate?: any; -} - -export interface CloseEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the current date object. - */ - date?: any; - - /** returns the DateRangePicker model. - */ - model?: ej.DateRangePicker.Model; - - /** returns the name of the event. - */ - type?: string; - - /** returns the DateRangePicker popup. - */ - element?: HTMLElement; -} - -export interface CreateEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the DateRangePicker model. - */ - model?: ej.DateRangePicker.Model; - - /** returns the name of the event. - */ - type?: string; -} - -export interface DestroyEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the DateRangePicker model. - */ - model?: ej.DateRangePicker.Model; - - /** returns the name of the event. - */ - type?: string; -} - -export interface OpenEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the current date object. - */ - date?: any; - - /** returns the DateRangePicker model. - */ - model?: ej.DateRangePicker.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the DateRangePicker popup. - */ - element?: HTMLElement; -} - -export interface SelectEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the selected date object. - */ - startDate?: any; - - /** returns the DateRangePicker model. - */ - model?: ej.DateRangePicker.Model; - - /** returns the name of the event. - */ - type?: string; - - /** returns the current date value. - */ - endDate?: any; -} -} - -class Dialog extends ej.Widget { - static fn: Dialog; - constructor(element: JQuery | Element, options?: Dialog.Model); - static Locale: any; - model: Dialog.Model; - defaults: Dialog.Model; - - /** Closes the dialog widget dynamically. - * @returns {any} - */ - close(): any; - - /** Collapses the content area when it is expanded. - * @returns {any} - */ - collapse(): any; - - /** Destroys the Dialog widget. - * @returns {void} - */ - destroy(): void; - - /** Expands the content area when it is collapsed. - * @returns {any} - */ - expand(): any; - - /** Checks whether the Dialog widget is opened or not. This methods returns Boolean value. - * @returns {boolean} - */ - isOpen(): boolean; - - /** Maximizes the Dialog widget. - * @returns {any} - */ - maximize(): any; - - /** Minimizes the Dialog widget. - * @returns {any} - */ - minimize(): any; - - /** Opens the Dialog widget. - * @returns {any} - */ - open(): any; - - /** Pins the dialog in its current position. - * @returns {any} - */ - pin(): any; - - /** Refreshes the dialog content dynamically. - * @returns {void} - */ - refresh(): void; - - /** Restores the dialog. - * @returns {any} - */ - restore(): any; - - /** Unpins the Dialog widget. - * @returns {any} - */ - unpin(): any; - - /** Sets the title for the Dialog widget. - * @param {string} The title for the dialog widget. - * @returns {any} - */ - setTitle(Title: string): any; - - /** Sets the content for the Dialog widget dynamically. - * @param {string} The content for the dialog widget. It accepts both string and HTML string. - * @returns {any} - */ - setContent(content: string): any; - - /** Sets the focus on the Dialog widget. - * @returns {any} - */ - focus(): any; -} -export namespace Dialog { - -export interface Model { - - /** Adds action buttons like close, minimize, pin, maximize in the dialog header. - */ - actionButtons?: string[]; - - /** Specifies the ajaxSettings option to load the content to the Dialog control. - * @Default {null} - */ - ajaxSettings?: AjaxSettings; - - /** Enables or disables draggable. - */ - allowDraggable?: boolean; - - /** Enables or disables keyboard interaction. - */ - allowKeyboardNavigation?: boolean; - - /** Customizes the Dialog widget animations. The Dialog widget can be animated while opening and closing the dialog. - * In order to customize animation effects, you need to set “enableAnimation” as true. It contains the following sub properties. - */ - animation?: any; - - /** Closes the dialog widget on pressing the ESC key when it is set to true. - */ - closeOnEscape?: boolean; - - /** The selector for the container element. If the property is set, then dialog will append to the selected element and it is restricted to move only within the specified container element. - */ - containment?: string; - - /** The content type to load the dialog content at run time. The possible values are null, AJAX, iframe and image. When it is null (default value), - * the content inside dialog element will be displayed as content and when it is not null, the content will be loaded from the URL specified in the contentUrl property. - */ - contentType?: string; - - /** The URL to load the dialog content (such as AJAX, image, and iframe). In order to load content from URL, you need to set contentType as ‘ajax’ or ‘iframe’ or ‘image’. - */ - contentUrl?: string; - - /** The root class for the Dialog widget to customize the existing theme. - */ - cssClass?: string; - - /** Enable or disables animation when the dialog is opened or closed. - */ - enableAnimation?: boolean; - - /** Enables or disables the Dialog widget. - */ - enabled?: boolean; - - /** Enable or disables modal dialog. The modal dialog acts like a child window that is displayed on top of the main window/screen and disables the main window interaction until it is closed. - */ - enableModal?: boolean; - - /** Allows the current model values to be saved in local storage or browser cookies for state maintenance when it is set to true. - */ - enablePersistence?: boolean; - - /** Allows the dialog to be resized. The dialog cannot be resized less than the minimum height, width values and greater than the maximum height and width. - */ - enableResize?: boolean; - - /** Displays dialog content from right to left when set to true. - */ - enableRTL?: boolean; - - /** The CSS class name to display the favicon in the dialog header. In order to display favicon, you need to set showHeader as true since the favicon will be displayed in the dialog header. - */ - faviconCSS?: string; - - /** Sets the height for the dialog widget. It accepts both string and integer values. For example, it can accepts values like “auto”, “100%”, “100px” as string type - * and “100”, “500” as integer type. - */ - height?: string|number; - - /** Specifies the HTML Attributes of the Dialog. - * @Default {{}} - */ - htmlAttributes?: any; - - /** Enable or disables responsive behavior. - */ - isResponsive?: boolean; - - /** Default Value:{:.param}“en-US” - */ - locale?: number; - - /** Sets the maximum height for the dialog widget. - */ - maxHeight?: number; - - /** Sets the maximum width for the dialog widget. - */ - maxWidth?: number; - - /** Sets the minimum height for the dialog widget. - */ - minHeight?: number; - - /** Sets the minimum width for the dialog widget. - */ - minWidth?: number; - - /** Displays the Dialog widget at the given X and Y position. - */ - position?: any; - - /** Shows or hides the dialog header. - */ - showHeader?: boolean; - - /** The Dialog widget can be opened by default i.e. on initialization, when it is set to true. - */ - showOnInit?: boolean; - - /** Enables or disables the rounder corner. - */ - showRoundedCorner?: boolean; - - /** The selector for the container element. If this property is set, the dialog will be displayed (positioned) based on its container. - */ - target?: string; - - /** The title text to be displayed in the dialog header. In order to set title, you need to set showHeader as true since the title will be displayed in the dialog header. - */ - title?: string; - - /** Add or configure the tooltip text for actionButtons in the dialog header. - */ - tooltip?: any; - - /** Sets the height for the dialog widget. It accepts both string and integer values. For example, it can accepts values like “auto”, “100%”, - * “100px” as string type and “100”, “500” as integer type. - */ - width?: string|number; - - /** Sets the z-index value for the Dialog widget. - */ - zIndex?: number; - - /** Sets the Footer for the Dialog widget. - */ - showFooter?: boolean; - - /** Sets the FooterTemplate for the Dialog widget. - */ - footerTemplateId?: string; - - /** This event is triggered before the dialog widgets gets open. */ - beforeOpen?(e: BeforeOpenEventArgs): void; - - /** This event is triggered whenever the AJAX request fails to retrieve the dialog content. */ - ajaxError?(e: AjaxErrorEventArgs): void; - - /** This event is triggered whenever the AJAX request to retrieve the dialog content, gets succeed. */ - ajaxSuccess?(e: AjaxSuccessEventArgs): void; - - /** This event is triggered before the dialog widgets get closed. */ - beforeClose?(e: BeforeCloseEventArgs): void; - - /** This event is triggered after the dialog widget is closed. */ - close?(e: CloseEventArgs): void; - - /** Triggered after the dialog content is loaded in DOM. */ - contentLoad?(e: ContentLoadEventArgs): void; - - /** Triggered after the dialog is created successfully */ - create?(e: CreateEventArgs): void; - - /** Triggered after the dialog widget is destroyed successfully */ - destroy?(e: DestroyEventArgs): void; - - /** Triggered while the dialog is dragged. */ - drag?(e: DragEventArgs): void; - - /** Triggered when the user starts dragging the dialog. */ - dragStart?(e: DragStartEventArgs): void; - - /** Triggered when the user stops dragging the dialog. */ - dragStop?(e: DragStopEventArgs): void; - - /** Triggered after the dialog is opened. */ - open?(e: OpenEventArgs): void; - - /** Triggered while the dialog is resized. */ - resize?(e: ResizeEventArgs): void; - - /** Triggered when the user starts resizing the dialog. */ - resizeStart?(e: ResizeStartEventArgs): void; - - /** Triggered when the user stops resizing the dialog. */ - resizeStop?(e: ResizeStopEventArgs): void; - - /** Triggered when the dialog content is expanded. */ - expand?(e: ExpandEventArgs): void; - - /** Triggered when the dialog content is collapsed. */ - collapse?(e: CollapseEventArgs): void; - - /** Triggered when the custom action button clicked. */ - actionButtonClick?(e: ActionButtonClickEventArgs): void; -} - -export interface BeforeOpenEventArgs { - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Instance of the dialog model object. - */ - model?: ej.Dialog.Model; - - /** Name of the event - */ - type?: string; -} - -export interface AjaxErrorEventArgs { - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Instance of the dialog model object. - */ - model?: ej.Dialog.Model; - - /** Name of the event. - */ - type?: string; - - /** URL of the content. - */ - URL?: string; - - /** Error page content. - */ - responseText?: string; - - /** Error code. - */ - status?: number; - - /** The corresponding error description. - */ - statusText?: string; -} - -export interface AjaxSuccessEventArgs { - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Instance of the dialog model object. - */ - model?: ej.Dialog.Model; - - /** Name of the event. - */ - type?: string; - - /** URL of the content. - */ - URL?: string; - - /** Response content. - */ - data?: string; -} - -export interface BeforeCloseEventArgs { - - /** Current event object. - */ - event?: any; - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Instance of the dialog model object. - */ - model?: ej.Dialog.Model; - - /** Name of the event. - */ - type?: string; -} - -export interface CloseEventArgs { - - /** Current event object. - */ - event?: any; - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Instance of the dialog model object. - */ - model?: ej.Dialog.Model; - - /** Name of the event - */ - type?: string; -} - -export interface ContentLoadEventArgs { - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Instance of the dialog model object. - */ - model?: ej.Dialog.Model; - - /** Name of the event. - */ - type?: string; - - /** URL of the content. - */ - URL?: string; - - /** Content type - */ - contentType?: any; -} - -export interface CreateEventArgs { - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Instance of the dialog model object. - */ - model?: ej.Dialog.Model; - - /** Name of the event. - */ - type?: string; -} - -export interface DestroyEventArgs { - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Instance of the dialog model object. - */ - model?: ej.Dialog.Model; - - /** Name of the event. - */ - type?: string; -} - -export interface DragEventArgs { - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Instance of the dialog model object. - */ - model?: ej.Dialog.Model; - - /** Name of the event. - */ - type?: string; - - /** Current event object. - */ - event?: any; -} - -export interface DragStartEventArgs { - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Instance of the dialog model object. - */ - model?: ej.Dialog.Model; - - /** Name of the event. - */ - type?: string; - - /** Current event object. - */ - event?: any; -} - -export interface DragStopEventArgs { - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Instance of the dialog model object. - */ - model?: ej.Dialog.Model; - - /** Name of the event. - */ - type?: string; - - /** Current event object. - */ - event?: any; -} - -export interface OpenEventArgs { - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Instance of the dialog model object. - */ - model?: ej.Dialog.Model; - - /** Name of the event. - */ - type?: string; -} - -export interface ResizeEventArgs { - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Instance of the dialog model object. - */ - model?: ej.Dialog.Model; - - /** Name of the event. - */ - type?: string; - - /** Current event object. - */ - event?: any; -} - -export interface ResizeStartEventArgs { - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Instance of the dialog model object. - */ - model?: ej.Dialog.Model; - - /** Name of the event - */ - type?: string; - - /** Current event object. - */ - event?: any; -} - -export interface ResizeStopEventArgs { - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Instance of the dialog model object. - */ - model?: ej.Dialog.Model; - - /** Name of the event - */ - type?: string; - - /** Current event object. - */ - event?: any; -} - -export interface ExpandEventArgs { - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Instance of the dialog model object. - */ - model?: ej.Dialog.Model; - - /** Name of the event. - */ - type?: string; -} - -export interface CollapseEventArgs { - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Instance of the dialog model object. - */ - model?: ej.Dialog.Model; - - /** Name of the event. - */ - type?: string; -} - -export interface ActionButtonClickEventArgs { - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Name of the event target attribute. - */ - buttonID?: string; - - /** Name of the event. - */ - type?: string; - - /** Instance of the dialog model object. - */ - model?: ej.Dialog.Model; - - /** Name of the event current target title. - */ - currentTarget?: string; -} - -export interface AjaxSettings { - - /** It specifies, whether to enable or disable asynchronous request. - */ - async?: boolean; - - /** It specifies the page will be cached in the web browser. - */ - cache?: boolean; - - /** It specifies the type of data is send in the query string. - */ - contentType?: string; - - /** It specifies the data as an object, will be passed in the query string. - */ - data?: any; - - /** It specifies the type of data that you're expecting back from the response. - */ - dataType?: string; - - /** It specifies the HTTP request type. - */ - type?: string; -} -} - -class DocumentEditor extends ej.Widget { - static fn: DocumentEditor; - constructor(element: JQuery | Element, options?: DocumentEditor.Model); - static Locale: any; - model: DocumentEditor.Model; - defaults: DocumentEditor.Model; - - /** Loads the document from specified path using web API provided by importUrl. - * @param {string} Specifies the file path. - * @returns {void} - */ - load(path: string): void; - - /** Gets the page number of current selection in the document. - * @returns {number} - */ - getCurrentPageNumber(): number; - - /** Gets the total number of pages in the document. - * @returns {number} - */ - getPageCount(): number; - - /** Gets the text of current selection in the document. - * @returns {string} - */ - getSelectedText(): string; - - /** Gets the current zoom factor value of the document editor. - * @returns {number} - */ - getZoomFactor(): number; - - /** Scales the document editor with the specified zoom factor. The range of zoom factor should be 0.10 to 5.00 (10 - 500 %). - * @param {number} Specifies the factor for zooming. - * @returns {void} - */ - setZoomFactor(factor: number): void; - - /** Prints the document content as page by page. - * @returns {void} - */ - print(): void; - - /** Finds the first occurrence of specified text from current selection and highlights the result. If the document end is reached, find operation will occur from the document start position. - * @param {string} Specifies the text to search in a document. - * @returns {void} - */ - find(text: string): void; -} -export namespace DocumentEditor { - -export interface Model { - - /** Gets or sets an object that indicates initialization of importing and exporting documents in document editor. - */ - importExportSettings?: ImportExportSettings; - - /** Triggers when the document changes. */ - onDocumentChange?(e: OnDocumentChangeEventArgs): void; - - /** Triggers when the selection changes. */ - onSelectionChange?(e: OnSelectionChangeEventArgs): void; - - /** Triggers when the zoom factor changes. */ - onZoomFactorChange?(e: OnZoomFactorChangeEventArgs): void; - - /** Triggers when the hyperlink is clicked. */ - onRequestNavigate?(e: OnRequestNavigateEventArgs): void; -} - -export interface OnDocumentChangeEventArgs { - - /** True, if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** Returns the document editor model. - */ - model?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface OnSelectionChangeEventArgs { - - /** True, if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** Returns the document editor model. - */ - model?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface OnZoomFactorChangeEventArgs { - - /** True, if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** Returns the document editor model. - */ - model?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface OnRequestNavigateEventArgs { - - /** true, if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** Returns the document editor model. - */ - model?: any; - - /** Returns the link type and navigation link. - */ - hyperlink?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface ImportExportSettings { - - /** Gets or sets URL of Web API that should be used to parse the document while loading. - */ - importUrl?: string; -} -} - -class DropDownList extends ej.Widget { - static fn: DropDownList; - constructor(element: JQuery | Element, options?: DropDownList.Model); - static Locale: any; - model: DropDownList.Model; - defaults: DropDownList.Model; - - /** Adding a single item or an array of items into the DropDownList allows you to specify all the field attributes such as value, template, image URL, and HTML attributes for those items. - * @param {any|Array} this parameter should have field attributes with respect to mapped field attributes and it's corresponding values to fields - * @returns {void} - */ - addItem(data: any|any[]): void; - - /** This method is used to select all the items in the DropDownList. - * @returns {void} - */ - checkAll(): void; - - /** Clears the text in the DropDownList textbox. - * @returns {void} - */ - clearText(): void; - - /** Destroys the DropDownList widget. - * @returns {void} - */ - destroy(): void; - - /** This property is used to disable the DropDownList widget. - * @returns {void} - */ - disable(): void; - - /** This property disables the set of items in the DropDownList. - * @param {string|number|Array} disable the given index list items - * @returns {void} - */ - disableItemsByIndices(index: string|number|any[]): void; - - /** This property enables the DropDownList control. - * @returns {void} - */ - enable(): void; - - /** Enables an Item or set of Items that are disabled in the DropDownList - * @param {string|number|Array} enable the given index list items if it's disabled - * @returns {void} - */ - enableItemsByIndices(index: string|number|any[]): void; - - /** This method retrieves the items using given value. - * @param {string|number|any} Return the whole object of data based on given value - * @returns {Array} - */ - getItemDataByValue(value: string|number|any): any[]; - - /** This method is used to retrieve the items that are bound with the DropDownList. - * @returns {any} - */ - getListData(): any; - - /** This method is used to get the selected items in the DropDownList. - * @returns {Array} - */ - getSelectedItem(): any[]; - - /** This method is used to retrieve the items value that are selected in the DropDownList. - * @returns {string} - */ - getSelectedValue(): string; - - /** This method hides the suggestion popup in the DropDownList. - * @returns {void} - */ - hidePopup(): void; - - /** This method is used to select the list of items in the DropDownList through the Index of the items. - * @param {string|number|Array} select the given index list items - * @returns {void} - */ - selectItemsByIndices(index: string|number|any[]): void; - - /** This method is used to select an item in the DropDownList by using the given text value. - * @param {string|number|Array} select the list items relates to given text - * @returns {void} - */ - selectItemByText(index: string|number|any[]): void; - - /** This method is used to select an item in the DropDownList by using the given value. - * @param {string|number|Array} select the list items relates to given values - * @returns {void} - */ - selectItemByValue(index: string|number|any[]): void; - - /** This method shows the DropDownList control with the suggestion popup. - * @returns {void} - */ - showPopup(): void; - - /** This method is used to unselect all the items in the DropDownList. - * @returns {void} - */ - unCheckAll(): void; - - /** This method is used to unselect the list of items in the DropDownList through Index of the items. - * @param {string|number|Array} unselect the given index list items - * @returns {void} - */ - unselectItemsByIndices(index: string|number|any[]): void; - - /** This method is used to unselect an item in the DropDownList by using the given text value. - * @param {string|number|Array} unselect the list items relates to given text - * @returns {void} - */ - unselectItemByText(index: string|number|any[]): void; - - /** This method is used to unselect an item in the DropDownList by using the given value. - * @param {string|number|Array} unselect the list items relates to given values - * @returns {void} - */ - unselectItemByValue(index: string|number|any[]): void; -} -export namespace DropDownList { - -export interface Model { - - /** The Virtual Scrolling(lazy loading) feature is used to display a large amount of data that you require without buffering the entire load of a huge database records in the DropDownList, - * that is, when scrolling, an AJAX request is sent to fetch some amount of data from the server dynamically. To achieve this scenario with DropDownList, set the allowVirtualScrolling to true. - * @Default {false} - */ - allowVirtualScrolling?: boolean; - - /** The cascading DropDownLists is a series of two or more DropDownLists in which each DropDownList is filtered according to the previous DropDownList’s value. - * @Default {null} - */ - cascadeTo?: string; - - /** Sets the case sensitivity of the search operation. It supports both enableFilterSearch and enableIncrementalSearch property. - * @Default {false} - */ - caseSensitiveSearch?: boolean; - - /** Dropdown widget's style and appearance can be controlled based on 13 different default built-in themes.You can customize the appearance of the dropdown by using the cssClass property. - * You need to specify a class name in the cssClass property and the same class name is used before the class definitions wherever the custom styles are applied. - */ - cssClass?: string; - - /** This property is used to serve data from the data services based on the query provided. To bind the data to the dropdown widget, - * the dataSource property is assigned with the instance of the ej.DataManager. - * @Default {null} - */ - dataSource?: any; - - /** Sets the separator when the multiSelectMode with delimiter option or checkbox is enabled with the dropdown. When you enter the delimiter value,the texts after the delimiter are considered - * as a separate word or query. The delimiter string is a single character and must be a symbol. Mostly, the delimiter symbol is used as comma (,) or semi-colon (;) or any other special character. - * @Default {','} - */ - delimiterChar?: string; - - /** The enabled Animation property uses the easeOutQuad animation to SlideDown and SlideUp the Popup list in 200 and 100 milliseconds, respectively. - * @Default {false} - */ - enableAnimation?: boolean; - - /** This property is used to indicate whether the DropDownList control responds to the user interaction or not. By default, the control is in the enabled mode - * and you can disable it by setting it to false. - * @Default {true} - */ - enabled?: boolean; - - /** Specifies to perform incremental search for the selection of items from the DropDownList with the help of this property. This helps in selecting the item by using the typed character. - * @Default {true} - */ - enableIncrementalSearch?: boolean; - - /** This property selects the item in the DropDownList when the item is entered in the Search textbox. - * @Default {false} - */ - enableFilterSearch?: boolean; - - /** Saves the current model value to the browser cookies for state maintenance. While refreshing the DropDownList control page, it retains the model value and - * it is applied from the browser cookies. - * @Default {false} - */ - enablePersistence?: boolean; - - /** This enables the resize handler to resize the popup to any size. - * @Default {false} - */ - enablePopupResize?: boolean; - - /** Sets the DropDownList textbox direction from right to left align. - * @Default {false} - */ - enableRTL?: boolean; - - /** This property is used to sort the Items in the DropDownList. By default, it sorts the items in an ascending order. - * @Default {false} - */ - enableSorting?: boolean; - - /** Specifies the mapping fields for the data items of the DropDownList. - * @Default {null} - */ - fields?: Fields; - - /** When the enableFilterSearch property value is set to true, the values in the DropDownList shows the items starting with or containing the key word/letter typed in the Search textbox. - * @Default {ej.FilterType.Contains} - */ - filterType?: ej.FilterType|string; - - /** Used to create visualized header for dropdown items - * @Default {null} - */ - headerTemplate?: string; - - /** Defines the height of the DropDownList textbox. - * @Default {null} - */ - height?: string|number; - - /** It sets the given HTML attributes for the DropDownList control such as ID, name, disabled, etc. - * @Default {null} - */ - htmlAttributes?: any; - - /** Data can be fetched in the DropDownList control by using the DataSource, specifying the number of items. - * @Default {5} - */ - itemsCount?: number; - - /** Allows the user to set the particular country or region language for the DropDownList. - * @Default {en-US} - */ - locale?: string; - - /** Defines the maximum height of the suggestion box. This property restricts the maximum height of the popup when resize is enabled. - * @Default {null} - */ - maxPopupHeight?: string|number; - - /** Defines the minimum height of the suggestion box. This property restricts the minimum height of the popup when resize is enabled. - * @Default {null} - */ - minPopupHeight?: string|number; - - /** Defines the maximum width of the suggestion box. This property restricts the maximum width of the popup when resize is enabled. - * @Default {null} - */ - maxPopupWidth?: string|number; - - /** Defines the minimum height of the suggestion box. This property restricts the minimum height of the popup when resize is enabled. - * @Default {0} - */ - minPopupWidth?: string|number; - - /** With the help of this property, you can make a single or multi selection with the DropDownList and display the text in two modes, delimiter and visual mode. - * In delimiter mode, you can separate the items by using the delimiter character such as comma (,) or semi-colon (;) or any other special character. - * In the visual mode, the items are showcased like boxes with close icon in the textbox. - * @Default {ej.MultiSelectMode.None} - */ - multiSelectMode?: ej.MultiSelectMode|string; - - /** Defines the height of the suggestion popup box in the DropDownList control. - * @Default {152px} - */ - popupHeight?: string|number; - - /** Defines the width of the suggestion popup box in the DropDownList control. - * @Default {auto} - */ - popupWidth?: string|number; - - /** Specifies the query to retrieve the data from the DataSource. - * @Default {null} - */ - query?: any; - - /** Specifies that the DropDownList textbox values should be read-only. - * @Default {false} - */ - readOnly?: boolean; - - /** Specifies an item to be selected in the DropDownList. - * @Default {null} - */ - selectedIndex?: number; - - /** Specifies the selectedItems for the DropDownList. - * @Default {[]} - */ - selectedIndices?: any[]; - - /** Selects multiple items in the DropDownList with the help of the checkbox control. To achieve this, enable the showCheckbox option to true. - * @Default {false} - */ - showCheckbox?: boolean; - - /** DropDownList control is displayed with the popup seen. - * @Default {false} - */ - showPopupOnLoad?: boolean; - - /** DropDownList textbox displayed with the rounded corner style. - * @Default {false} - */ - showRoundedCorner?: boolean; - - /** When the enableSorting property value is set to true, this property helps to sort the items either in ascending or descending order - * @Default {ej.SortOrder.Ascending} - */ - sortOrder?: ej.SortOrder|string; - - /** Specifies the targetID for the DropDownList’s items. - * @Default {null} - */ - targetID?: string; - - /** By default, you can add any text or image to the DropDownList item. To customize the item layout or to create your own visualized elements, you can use this template support. - * @Default {null} - */ - template?: string; - - /** Defines the text value that is displayed in the DropDownList textbox. - * @Default {null} - */ - text?: string; - - /** Sets the jQuery validation error message in the DropDownList - * @Default {null} - */ - validationMessage?: any; - - /** Sets the jQuery validation rules in the Dropdownlist. - * @Default {null} - */ - validationRules?: any; - - /** Specifies the value (text content) for the DropDownList control. - * @Default {null} - */ - value?: string|number; - - /** Specifies a short hint that describes the expected value of the DropDownList control. - * @Default {null} - */ - watermarkText?: string; - - /** Defines the width of the DropDownList textbox. - * @Default {null} - */ - width?: string|number; - - /** The Virtual Scrolling feature is used to display a large amount of records in the DropDownList, that is, when scrolling, an AJAX request is sent to fetch some amount of data from - * the server dynamically. To achieve this scenario with DropDownList, set the allowVirtualScrolling to true. - * You can set the itemsCount property that represents the number of items to be fetched from the server on every AJAX request. - * @Default {normal} - */ - virtualScrollMode?: ej.VirtualScrollMode|string; - - /** Fires the action before the XHR request. */ - actionBegin?(e: ActionBeginEventArgs): void; - - /** Fires the action when the list of items is bound to the DropDownList by xhr post calling */ - actionComplete?(e: ActionCompleteEventArgs): void; - - /** Fires the action when the xhr post calling failed on remote data binding with the DropDownList control. */ - actionFailure?(e: ActionFailureEventArgs): void; - - /** Fires the action when the xhr post calling succeed on remote data binding with the DropDownList control */ - actionSuccess?(e: ActionSuccessEventArgs): void; - - /** Fires the action before the popup is ready to hide. */ - beforePopupHide?(e: BeforePopupHideEventArgs): void; - - /** Fires the action before the popup is ready to be displayed. */ - beforePopupShown?(e: BeforePopupShownEventArgs): void; - - /** Fires when the cascading happens between two DropDownList exactly after the value changes in the first dropdown and before filtering in the second Dropdown. */ - cascade?(e: CascadeEventArgs): void; - - /** Fires the action when the DropDownList control’s value is changed. */ - change?(e: ChangeEventArgs): void; - - /** Fires the action when the list item checkbox value is changed. */ - checkChange?(e: CheckChangeEventArgs): void; - - /** Fires the action once the DropDownList is created. */ - create?(e: CreateEventArgs): void; - - /** Fires the action when the list items is bound to the DropDownList. */ - dataBound?(e: DataBoundEventArgs): void; - - /** Fires the action when the DropDownList is destroyed. */ - destroy?(e: DestroyEventArgs): void; - - /** Fires the action when the DropDownList is focused. */ - focusIn?(e: FocusInEventArgs): void; - - /** Fires the action when the DropDownList is about to lose focus. */ - focusOut?(e: FocusOutEventArgs): void; - - /** Fires the action, once the popup is closed */ - popupHide?(e: PopupHideEventArgs): void; - - /** Fires the action, when the popup is resized. */ - popupResize?(e: PopupResizeEventArgs): void; - - /** Fires the action, once the popup is opened. */ - popupShown?(e: PopupShownEventArgs): void; - - /** Fires the action, when resizing a popup starts. */ - popupResizeStart?(e: PopupResizeStartEventArgs): void; - - /** Fires the action, when the popup resizing is stopped. */ - popupResizeStop?(e: PopupResizeStopEventArgs): void; - - /** Fires the action before filtering the list items that starts in the DropDownList when the enableFilterSearch is enabled. */ - search?(e: SearchEventArgs): void; - - /** Fires the action, when the list of item is selected. */ - select?(e: SelectEventArgs): void; -} - -export interface ActionBeginEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the DropDownList model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; -} - -export interface ActionCompleteEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** Returns number of times trying to fetch the data - */ - count?: number; - - /** returns the DropDownList model - */ - model?: any; - - /** Returns the query for data retrieval - */ - query?: any; - - /** Returns the query for data retrieval from the Database - */ - request?: any; - - /** returns the name of the event - */ - type?: string; - - /** Returns the number of items fetched from remote data - */ - result?: any[]; - - /** Returns the requested data - */ - xhr?: any; -} - -export interface ActionFailureEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** Returns the error message - */ - error?: any; - - /** returns the DropDownList model - */ - model?: any; - - /** Returns the query for data retrieval - */ - query?: any; - - /** returns the name of the event - */ - type?: string; -} - -export interface ActionSuccessEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** Returns number of times trying to fetch the data - */ - count?: number; - - /** returns the DropDownList model - */ - model?: any; - - /** Returns the query for data retrieval - */ - query?: any; - - /** Returns the query for data retrieval from the Database - */ - request?: any; - - /** returns the name of the event - */ - type?: string; - - /** Returns the number of items fetched from remote data - */ - result?: any[]; - - /** Returns the requested data - */ - xhr?: any; -} - -export interface BeforePopupHideEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the DropDownList model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; - - /** returns the selected text - */ - text?: string; - - /** returns the selected value - */ - value?: string; -} - -export interface BeforePopupShownEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the DropDownList model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; - - /** returns the selected text - */ - text?: string; - - /** returns the selected value - */ - value?: string; -} - -export interface CascadeEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** Returns the cascading dropdown model. - */ - cascadeModel?: any; - - /** returns the current selected value in first dropdown. - */ - cascadeValue?: string; - - /** returns the DropDownList model - */ - model?: any; - - /** returns the default filter action for second dropdown data should happen or not. - */ - requiresDefaultFilter?: boolean; - - /** returns the name of the event - */ - type?: string; -} - -export interface ChangeEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** Returns the selected item with checkbox checked or not. - */ - isChecked?: boolean; - - /** Returns the selected item ID. - */ - itemId?: string; - - /** returns the DropDownList model - */ - model?: any; - - /** Returns the selected item text. - */ - selectedText?: string; - - /** returns the name of the event - */ - type?: string; - - /** Returns the selected text. - */ - text?: string; - - /** Returns the selected value. - */ - value?: string; -} - -export interface CheckChangeEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** Returns the selected item with checkbox checked or not. - */ - isChecked?: boolean; - - /** Returns the selected item ID. - */ - itemId?: string; - - /** returns the DropDownList model - */ - model?: any; - - /** Returns the selected item text. - */ - selectedText?: string; - - /** returns the name of the event - */ - type?: string; - - /** Returns the selected text. - */ - text?: string; - - /** Returns the selected value. - */ - value?: string; -} - -export interface CreateEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the DropDownList model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; -} - -export interface DataBoundEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the DropDownList model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; - - /** returns the data that is bound to DropDownList - */ - data?: any; -} - -export interface DestroyEventArgs { - - /** its value is set as true,if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the DropDownList model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; -} - -export interface FocusInEventArgs { - - /** its value is set as true,if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the DropDownList model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; -} - -export interface FocusOutEventArgs { - - /** its value is set as true,if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the DropDownList model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; -} - -export interface PopupHideEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the DropDownList model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; - - /** returns the selected text - */ - text?: string; - - /** returns the selected value - */ - value?: string; -} - -export interface PopupResizeEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the DropDownList model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; - - /** Returns the data from the resizable plugin. - */ - event?: any; -} - -export interface PopupShownEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the DropDownList model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; - - /** returns the selected text - */ - text?: string; - - /** returns the selected value - */ - value?: string; -} - -export interface PopupResizeStartEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the DropDownList model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; - - /** Returns the data from the resizable plugin. - */ - event?: any; -} - -export interface PopupResizeStopEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the DropDownList model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; - - /** Returns the data from the resizable plugin. - */ - event?: any; -} - -export interface SearchEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** Returns the data bound to the DropDownList. - */ - items?: any; - - /** returns the DropDownList model - */ - model?: any; - - /** Returns the selected item text. - */ - selectedText?: string; - - /** returns the name of the event - */ - type?: string; - - /** Returns the search string typed in search box. - */ - searchString?: string; -} - -export interface SelectEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** Returns the selected item with checkbox checked or not. - */ - isChecked?: boolean; - - /** Returns the selected item ID. - */ - itemId?: string; - - /** returns the DropDownList model - */ - model?: any; - - /** Returns the selected item text. - */ - selectedText?: string; - - /** returns the name of the event - */ - type?: string; - - /** Returns the selected text. - */ - text?: string; - - /** Returns the selected value. - */ - value?: string; -} - -export interface Fields { - - /** Used to group the items. - */ - groupBy?: string; - - /** Defines the HTML attributes such as ID, class, and styles for the item. - */ - htmlAttributes?: any; - - /** Defines the ID for the tag. - */ - id?: string; - - /** Defines the image attributes such as height, width, styles, and so on. - */ - imageAttributes?: string; - - /** Defines the imageURL for the image location. - */ - imageUrl?: string; - - /** Defines the tag value to be selected initially. - */ - selected?: boolean; - - /** Defines the sprite CSS for the image tag. - */ - spriteCssClass?: string; - - /** Defines the table name for tag value or display text while rendering remote data. - */ - tableName?: string; - - /** Defines the text content for the tag. - */ - text?: string; - - /** Defines the tag value. - */ - value?: string; -} -} -enum FilterType { -//filter the data wherever contains search key -Contains, -//filter the data based on search key present at start position -StartsWith, -} -enum MultiSelectMode { -// can select only single item in DropDownList -None, -//can select multiple items and it's separated by delimiterChar -Delimiter, -// can select multiple items and it's show's like visual box in textbox -VisualMode, -} -enum VirtualScrollMode { -// The data is loaded only to the corresponding page (display items). When scrolling some other position, it enables the load on demand with the DropDownList. -Normal, -//The data items are loaded from the remote when scroll handle reaches the end of the scrollbar like infinity scrolling. -Continuous, -} - -class Tooltip extends ej.Widget { - static fn: Tooltip; - constructor(element: JQuery | Element, options?: Tooltip.Model); - static Locale: any; - model: Tooltip.Model; - defaults: Tooltip.Model; - - /** Destroys the Tooltip control. - * @returns {void} - */ - destroy(): void; - - /** Disables the Tooltip control. - * @returns {void} - */ - disable(): void; - - /** Enables the Tooltip control. - * @returns {void} - */ - enable(): void; - - /** Hide the Tooltip popup. - * @param {string} optional Determines the type of effect that takes place when hiding the tooltip. - * @param {Function} optional custom effect takes place when hiding the tooltip. - * @returns {void} - */ - hide(effect?: string, func?: any): void; - - /** Shows the Tooltip popup for the given target element with the specified effect. - * @param {string} optional Determines the type of effect that takes place when showing the tooltip. - * @param {Function} optional custom effect takes place when showing the tooltip. - * @param {JQuery} optional Tooltip will be shown for the given element - * @returns {void} - */ - show(effect?: string, func?: any, target?: JQuery): void; -} -export namespace Tooltip { - -export interface Model { - - /** Tooltip control can be accessed through the keyboard shortcut keys. - * @Default {true} - */ - allowKeyboardNavigation?: boolean; - - /** Specifies the animation behavior in Tooltip. It contains the following sub properties. - */ - animation?: Animation; - - /** Sets the position related to target element, window, mouse or (x,y) co-ordinates. - * @Default {ej.Tooltip.Associate.Target} - */ - associate?: ej.Tooltip.Associate|string; - - /** Specified the delay to hide Tooltip when closeMode is auto. - * @Default {4000} - */ - autoCloseTimeout?: number; - - /** Specifies the closing behavior of Tooltip popup. - * @Default {ej.Tooltip.CloseMode.None} - */ - closeMode?: ej.Tooltip.CloseMode|string; - - /** Sets the Tooltip in alternate position when collision occurs. - * @Default {ej.Tooltip.Collision.FlipFit} - */ - collision?: ej.Tooltip.Collision|string; - - /** Specified the selector for the container element. - * @Default {body} - */ - containment?: string; - - /** Specifies the text for Tooltip. - * @Default {null} - */ - content?: string; - - /** Sets the root CSS class for Tooltip for the customization. - * @Default {null} - */ - cssClass?: string; - - /** Enables or disables the Tooltip. - * @Default {true} - */ - enabled?: boolean; - - /** Sets the Tooltip direction from right to left. - * @Default {false} - */ - enableRTL?: boolean; - - /** Defines the height of the Tooltip popup. - * @Default {auto} - */ - height?: string|number; - - /** Enables the arrow in Tooltip. - * @Default {true} - */ - isBalloon?: boolean; - - /** defines various attributes of the Tooltip position - */ - position?: Position; - - /** Enables or disables rounded corner. - * @Default {false} - */ - showRoundedCorner?: boolean; - - /** Enables or disables shadow effect. - * @Default {false} - */ - showShadow?: boolean; - - /** Specified a selector for elements, within the container. - * @Default {null} - */ - target?: string; - - /** The title text to be displayed in the Tooltip header. - * @Default {null} - */ - title?: string; - - /** Specified the event action to show case the Tooltip. - * @Default {ej.Tooltip.Trigger.Hover} - */ - trigger?: ej.Tooltip.Trigger|string; - - /** Defines the width of the Tooltip popup. - * @Default {auto} - */ - width?: string|number; - - /** This event is triggered before the Tooltip widget get closed. */ - beforeClose?(e: BeforeCloseEventArgs): void; - - /** This event is triggered before the Tooltip widget gets open. */ - beforeOpen?(e: BeforeOpenEventArgs): void; - - /** Fires on clicking to the target element. */ - click?(e: ClickEventArgs): void; - - /** This event is triggered after the Tooltip widget is closed. */ - close?(e: CloseEventArgs): void; - - /** This event is triggered after the Tooltip is created successfully. */ - create?(e: CreateEventArgs): void; - - /** This event is triggered after the Tooltip widget is destroyed successfully. */ - destroy?(e: DestroyEventArgs): void; - - /** This event is triggered while hovering the target element, when tooltip positioning relates to target element. */ - hover?(e: HoverEventArgs): void; - - /** This event is triggered after the Tooltip is opened. */ - open?(e: OpenEventArgs): void; - - /** This event is triggered while hover the target element, when the tooltip positioning is relates to the mouse. */ - tracking?(e: TrackingEventArgs): void; -} - -export interface BeforeCloseEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the tooltip model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; - - /** returns the Tooltip's content - */ - content?: string; -} - -export interface BeforeOpenEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the Tooltip model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; - - /** returns the Tooltip's content - */ - content?: string; -} - -export interface ClickEventArgs { - - /** its value is set as true,if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the Tooltip model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; - - /** returns the event object - */ - event?: any; -} - -export interface CloseEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the Tooltip model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; - - /** returns the Tooltip's content - */ - content?: string; -} - -export interface CreateEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the Tooltip model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; -} - -export interface DestroyEventArgs { - - /** its value is set as true,if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the Tooltip model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; -} - -export interface HoverEventArgs { - - /** its value is set as true,if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the Tooltip model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; - - /** returns the event object - */ - event?: any; -} - -export interface OpenEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the Tooltip model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; - - /** returns the Tooltip's content - */ - content?: string; -} - -export interface TrackingEventArgs { - - /** its value is set as true,if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the Tooltip model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; - - /** returns the event object - */ - event?: any; -} - -export interface Animation { - - /** Determines the type of effect. - * @Default {ej.Tooltip.Effect.None} - */ - effect?: ej.Tooltip.effect|string; - - /** Sets the animation speed in milliseconds. - * @Default {4000} - */ - speed?: number; -} - -export interface PositionTarget { - - /** Sets the Tooltip position against target based on horizontal(x) value. - * @Default {center} - */ - horizontal?: string|number; - - /** Sets the Tooltip position against target based on vertical(y) value. - * @Default {top} - */ - vertical?: string|number; -} - -export interface PositionStem { - - /** Sets the arrow position again popup based on horizontal(x) value - * @Default {center} - */ - horizontal?: string; - - /** Sets the arrow position again popup based on vertical(y) value - * @Default {bottom} - */ - vertical?: string; -} - -export interface Position { - - /** Sets the Tooltip position against target. - */ - target?: PositionTarget; - - /** Sets the arrow position again popup. - */ - stem?: PositionStem; -} - -enum effect { - - ///No animation takes place when showing/hiding the Tooltip - None, - - ///Sliding effect takes place when showing/hiding the Tooltip - Slide, - - ///Fade the Tooltip in and out of visibility. - Fade -} - - -enum Associate { - - ///Sets the position related to target element. - Target, - - ///Sets the position related to mouse. - MouseFollow, - - ///Sets the position related to mouse, first entry to the target element. - MouseEnter, - - ///Sets the position related to (x,y) co-ordinates. - Axis, - - ///Sets the position related to browser window. - Window -} - - -enum CloseMode { - - ///Enables close button in Tooltip. - Sticky, - - ///Sets the delay for Tooltip close - Auto, - - ///The Tooltip will be display normally. - None -} - - -enum Collision { - - ///Flips the Tooltip to the opposite side of the target, if collision is occurs. - Flip, - - ///Shift the Tooltip popup away from the edge of the window(collision side) that means adjacent position. - Fit, - - ///Ensure as much of the element is visible as possible to showcase. - FlipFit, - - ///No collision detection is take place - None -} - - -enum Trigger { - - ///The Tooltip to be shown when the target element is clicked. - Click, - - ///Enables the Tooltip when hover on the target element. - Hover, - - ///Enables the Tooltip when focus is set to target element. - Focus -} - -} - -class Editor extends ej.Widget { - static fn: Editor; - constructor(element: JQuery | Element, options?: Editor.Model); - static Locale: any; - model: Editor.Model; - defaults: Editor.Model; - - /** destroy the editor widgets all events are unbind automatically and bring the control to pre-init state. - * @returns {void} - */ - destroy(): void; - - /** To disable the corresponding Editors - * @returns {void} - */ - disable(): void; - - /** To enable the corresponding Editors - * @returns {void} - */ - enable(): void; - - /** To get value from corresponding Editors - * @returns {number} - */ - getValue(): number; -} - - class NumericTextbox extends Editor { -} - - class CurrencyTextbox extends Editor { -} - - class PercentageTextbox extends Editor { -} -export namespace Editor { - -export interface Model { - - /** Sets the root CSS class for Editors which allow us to customize the appearance. - */ - cssClass?: string; - - /** Specifies the number of digits that should be allowed after the decimal point. - * @Default {0} - */ - decimalPlaces?: number; - - /** Specifies the editor control state. - * @Default {true} - */ - enabled?: boolean; - - /** Specify the enablePersistence to editor to save current editor control value to browser cookies for state maintenance. - * @Default {false} - */ - enablePersistence?: boolean; - - /** Specifies the Right to Left Direction to editor. - * @Default {false} - */ - enableRTL?: boolean; - - /** When enableStrictMode true it allows the value outside of the range also but it highlights the textbox with error class,otherwise it internally changed to the correct value. - * @Default {false} - */ - enableStrictMode?: boolean; - - /** Specifies the number of digits in each group to the editor. - * @Default {Based on the culture.} - */ - groupSize?: string; - - /** It provides the options to get the customized character to separate the digits. If not set, the separator defined by the current culture. - * @Default {Based on the culture} - */ - groupSeparator?: string; - - /** Specifies the height of the editor. - * @Default {30} - */ - height?: string; - - /** It allows to define the characteristics of the Editors control. It will helps to extend the capability of an HTML element. - * @Default {{}} - */ - htmlAttributes?: any; - - /** The Editor value increment or decrement based an incrementStep value. - * @Default {1} - */ - incrementStep?: number; - - /** Defines the localization culture for editor. - * @Default {en-US} - */ - locale?: string; - - /** Specifies the maximum value of the editor. - * @Default {Number.MAX_VALUE} - */ - maxValue?: number; - - /** Specifies the minimum value of the editor. - * @Default {-(Number.MAX_VALUE) and 0 for Currency Textbox.} - */ - minValue?: number; - - /** Specifies the name of the editor. - * @Default {Sets id as name if it is null.} - */ - name?: string; - - /** Specifies the pattern for formatting positive values in editor.We have maintained some standard to define the negative pattern. - * you have to specify 'n' to place the digit in your pattern.ejTextbox allows you to define a currency or percent symbol where you want to place it. - * @Default {Based on the culture} - */ - negativePattern?: string; - - /** Specifies the pattern for formatting positive values in editor.We have maintained some standard to define the positive pattern. - * you have to specify 'n' to place the digit in your pattern.ejTextbox allows you to define a currency or percent symbol where you want to place it. - * @Default {Based on the culture} - */ - positivePattern?: string; - - /** Toggles the readonly state of the editor. When the Editor is readonly it doesn't allow user interactions. - * @Default {false} - */ - readOnly?: boolean; - - /** Specifies to Change the sharped edges into rounded corner for the Editor. - * @Default {false} - */ - showRoundedCorner?: boolean; - - /** Specifies whether the up and down spin buttons should be displayed in editor. - * @Default {true} - */ - showSpinButton?: boolean; - - /** Enables decimal separator position validation on type . - * @Default {false} - */ - validateOnType?: boolean; - - /** Set the jQuery validation error message in editor. - * @Default {null} - */ - validationMessage?: any; - - /** Set the jQuery validation rules to the editor. - * @Default {null} - */ - validationRules?: any; - - /** Specifies the value of the editor. - * @Default {null} - */ - value?: number|string; - - /** Specifies the watermark text to editor. - * @Default {Based on the culture.} - */ - watermarkText?: string; - - /** Specifies the width of the editor. - * @Default {143} - */ - width?: string; - - /** Fires after Editor control value is changed. */ - change?(e: ChangeEventArgs): void; - - /** Fires after Editor control is created. */ - create?(e: CreateEventArgs): void; - - /** Fires when the Editor is destroyed successfully. */ - destroy?(e: DestroyEventArgs): void; - - /** Fires after Editor control is focused. */ - focusIn?(e: FocusInEventArgs): void; - - /** Fires after Editor control is loss the focus. */ - focusOut?(e: FocusOutEventArgs): void; -} - -export interface ChangeEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the corresponding editor model. - */ - model?: ej.Editor.Model; - - /** returns the name of the event. - */ - type?: string; - - /** returns the corresponding editor control value. - */ - value?: number; - - /** returns true when the value changed by user interaction otherwise returns false - */ - isInteraction?: boolean; -} - -export interface CreateEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the editor model - */ - model?: ej.Editor.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface DestroyEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the editor model - */ - model?: ej.Editor.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface FocusInEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the corresponding editor model. - */ - model?: ej.Editor.Model; - - /** returns the name of the event. - */ - type?: string; - - /** returns the corresponding editor control value. - */ - value?: number; -} - -export interface FocusOutEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the corresponding editor model. - */ - model?: ej.Editor.Model; - - /** returns the name of the event. - */ - type?: string; - - /** returns the corresponding editor control value. - */ - value?: number; -} -} - -class ListView extends ej.Widget { - static fn: ListView; - constructor(element: JQuery | Element, options?: ListView.Model); - static Locale: any; - model: ListView.Model; - defaults: ListView.Model; - - /** To add item in the given index. If you have enabled grouping in ListView then you need to pass the corresponding group list title to add item in it. - * @param {any} Specifies the item to be added in ListView - * @param {number} Specifies the index where item to be added - * @param {string} optionalThis is an optional parameter. You must pass the group list title here if grouping is enabled in the ListView - * @returns {void} - */ - addItem(item: any, index: number, groupid: string): void; - - /** To check all the items. - * @returns {void} - */ - checkAllItem(): void; - - /** To check item in the given index. - * @param {number} Specifies the index of the item to be checked - * @returns {void} - */ - checkItem(index: number): void; - - /** To clear all the list item in the control before updating with new datasource. - * @returns {void} - */ - clear(): void; - - /** To make the item in the given index to be default state. - * @param {number} Specifies the index to make the item to be in default state. - * @returns {void} - */ - deActive(index: number): void; - - /** To disable item in the given index. - * @param {number} Specifies the index value to be disabled. - * @returns {void} - */ - disableItem(index: number): void; - - /** To enable item in the given index. - * @param {number} Specifies the index value to be enabled. - * @returns {void} - */ - enableItem(index: number): void; - - /** To get the active item. - * @returns {HTMLElement} - */ - getActiveItem(): HTMLElement; - - /** To get the text of the active item. - * @returns {string} - */ - getActiveItemText(): string; - - /** To get all the checked items. - * @returns {Array} - */ - getCheckedItems(): any[]; - - /** To get the text of all the checked items. - * @returns {Array} - */ - getCheckedItemsText(): any[]; - - /** To get the total item count. - * @returns {number} - */ - getItemsCount(): number; - - /** To get the text of the item in the given index. - * @param {string|number} Specifies the index value to get the text value. - * @returns {string} - */ - getItemText(index: string|number): string; - - /** To check whether the item in the given index has child item. - * @param {number} Specifies the index value to check the item has child or not. - * @returns {boolean} - */ - hasChild(index: number): boolean; - - /** To hide the list. - * @returns {void} - */ - hide(): void; - - /** To hide item in the given index. - * @param {number} Specifies the index value to hide the item. - * @returns {void} - */ - hideItem(index: number): void; - - /** To check whether item in the given index is checked. - * @returns {boolean} - */ - isChecked(): boolean; - - /** To load the AJAX content while selecting the item. - * @param {string} Specifies the item to load the AJAX content. - * @returns {void} - */ - loadAjaxContent(item: string): void; - - /** To remove the check mark either for specific item in the given index or for all items. - * @param {number} Specifies the index value to remove the checkbox. - * @returns {void} - */ - removeCheckMark(index: number): void; - - /** To remove item in the given index. - * @param {number} Specifies the index value to remove the item. - * @returns {void} - */ - removeItem(index: number): void; - - /** To select item in the given index. - * @param {number} Specifies the index value to select the item. - * @returns {void} - */ - selectItem(index: number): void; - - /** To make the item in the given index to be active state. - * @param {number} Specifies the index value to make the item in active state. - * @returns {void} - */ - setActive(index: number): void; - - /** To show the list. - * @returns {void} - */ - show(): void; - - /** To show item in the given index. - * @param {number} Specifies the index value to show the hided item. - * @returns {void} - */ - showItem(index: number): void; - - /** To uncheck all the items. - * @returns {void} - */ - unCheckAllItem(): void; - - /** To uncheck item in the given index. - * @param {number} Specifies the index value to uncheck the item. - * @returns {void} - */ - unCheckItem(index: number): void; -} -export namespace ListView { - -export interface Model { - - /** Specifies the ajaxSettings option to load the items to the ListView control. - * @Default {null} - */ - ajaxSettings?: AjaxSettings; - - /** Set the index values to be selected on initial loading. This works only when enableCheckMark is set true. - * @Default {[]} - */ - checkedIndices?: any[]; - - /** Sets the root class for ListView theme. This cssClass API helps to use custom skinning option for ListView control. By defining the root class using this API, - * we need to include this root class in CSS. - */ - cssClass?: string; - - /** Contains the list of data for generating the ListView items. - * @Default {[]} - */ - dataSource?: any[]; - - /** Specifies whether to load AJAX content while selecting item. - * @Default {false} - */ - enableAjax?: boolean; - - /** Specifies whether to enable caching the content. - * @Default {false} - */ - enableCache?: boolean; - - /** Specifies whether to enable check mark for the item. - * @Default {false} - */ - enableCheckMark?: boolean; - - /** Specifies whether to enable the filtering feature to filter the item. - * @Default {false} - */ - enableFiltering?: boolean; - - /** Specifies whether to group the list item. - * @Default {false} - */ - enableGroupList?: boolean; - - /** Specifies to maintain the current model value to browser cookies for state maintenance. While refresh the page, the model value will get apply to the control from browser cookies. - * @Default {false} - */ - enablePersistence?: boolean; - - /** Specifies the field settings to map the datasource. - */ - fieldSettings?: any; - - /** Contains the array of items to be added in ListView. - * @Default {[]} - */ - items?: any[]; - - /** Specifies the text of the back button in the header. - * @Default {null} - */ - headerBackButtonText?: string; - - /** Specifies the title of the header. - * @Default {Title} - */ - headerTitle?: string; - - /** Specifies the height. - * @Default {null} - */ - height?: string|number; - - /** Set the localization culture for ListView Widget. - */ - locale?: string; - - /** Specifies whether to retain the selection of the item. - * @Default {false} - */ - persistSelection?: boolean; - - /** Specifies whether to prevent the selection of the item. - * @Default {false} - */ - preventSelection?: boolean; - - /** Specifies the query to execute with the datasource. - * @Default {null} - */ - query?: any; - - /** Specifies whether need to render the control with the template contents. - * @Default {false} - */ - renderTemplate?: boolean; - - /** Specifies the index of item which need to be in selected state initially while loading. - * @Default {0} - */ - selectedItemIndex?: number; - - /** Specifies whether to show the header. - * @Default {true} - */ - showHeader?: boolean; - - /** Specifies whether to show the back button header. - * @Default {false} - */ - showHeaderBackButton?: boolean; - - /** Specifies ID of the element contains template contents. - * @Default {null} - */ - templateId?: string; - - /** Specifies the width. - * @Default {null} - */ - width?: string|number; - - /** Event triggers before the AJAX request happens. */ - ajaxBeforeLoad?(e: AjaxBeforeLoadEventArgs): void; - - /** Event triggers after the AJAX content loaded completely. */ - ajaxComplete?(e: AjaxCompleteEventArgs): void; - - /** Event triggers when the AJAX request failed. */ - ajaxError?(e: AjaxErrorEventArgs): void; - - /** Event triggers after the AJAX content loaded successfully. */ - ajaxSuccess?(e: AjaxSuccessEventArgs): void; - - /** Event triggers before the items loaded. */ - load?(e: LoadEventArgs): void; - - /** Event triggers after the items loaded. */ - loadComplete?(e: LoadCompleteEventArgs): void; - - /** Event triggers when mouse down happens on the item. */ - mouseDown?(e: MouseDownEventArgs): void; - - /** Event triggers when mouse up happens on the item. */ - mouseUp?(e: MouseUpEventArgs): void; -} - -export interface AjaxBeforeLoadEventArgs { - - /** returns true if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the name of the event. - */ - type?: string; - - /** returns the model value of the control. - */ - model?: ej.ListView.Model; - - /** returns the AJAX settings. - */ - ajaxData?: any; -} - -export interface AjaxCompleteEventArgs { - - /** returns true if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the name of the event. - */ - type?: string; - - /** returns the model value of the control. - */ - model?: ej.ListView.Model; -} - -export interface AjaxErrorEventArgs { - - /** returns true if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the name of the event. - */ - type?: string; - - /** returns the model value of the control. - */ - model?: ej.ListView.Model; - - /** returns the error thrown in the AJAX post. - */ - errorThrown?: any; - - /** returns the status. - */ - textStatus?: any; - - /** returns the current list item. - */ - item?: any; - - /** returns the current item text. - */ - text?: string; - - /** returns the current item index. - */ - index?: number; -} - -export interface AjaxSuccessEventArgs { - - /** returns true if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the name of the event. - */ - type?: string; - - /** returns the model value of the control. - */ - model?: ej.ListView.Model; - - /** returns the AJAX current content. - */ - content?: string; - - /** returns the current list item. - */ - item?: any; - - /** returns the current item text. - */ - text?: string; - - /** returns the current item index. - */ - index?: number; - - /** returns the current URL of the AJAX post. - */ - URL?: string; -} - -export interface LoadEventArgs { - - /** returns true if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the name of the event. - */ - type?: string; - - /** returns the model value of the control. - */ - model?: ej.ListView.Model; -} - -export interface LoadCompleteEventArgs { - - /** returns true if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the name of the event. - */ - type?: string; - - /** returns the model value of the control. - */ - model?: ej.ListView.Model; -} - -export interface MouseDownEventArgs { - - /** returns true if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the name of the event. - */ - type?: string; - - /** returns the model value of the control. - */ - model?: ej.ListView.Model; - - /** If the child element exist return true; otherwise, false. - */ - hasChild?: boolean; - - /** returns the current list item. - */ - item?: string; - - /** returns the current text of item. - */ - text?: string; - - /** returns the current Index of the item. - */ - index?: number; - - /** If checked return true; otherwise, false. - */ - isChecked?: boolean; - - /** returns the list of checked items. - */ - checkedItems?: number; - - /** returns the current checked item text. - */ - checkedItemsText?: string; -} - -export interface MouseUpEventArgs { - - /** returns true if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the name of the event. - */ - type?: string; - - /** returns the model value of the control. - */ - model?: ej.ListView.Model; - - /** If the child element exist return true; otherwise, false. - */ - hasChild?: boolean; - - /** returns the current list item. - */ - item?: string; - - /** returns the current text of item. - */ - text?: string; - - /** returns the current Index of the item. - */ - index?: number; - - /** If checked return true; otherwise, false. - */ - isChecked?: boolean; - - /** returns the list of checked items. - */ - checkedItems?: number; - - /** returns the current checked item text. - */ - checkedItemsText?: string; -} - -export interface AjaxSettings { - - /** It specifies, whether to enable or disable asynchronous request. - */ - async?: boolean; - - /** It specifies the page will be cached in the web browser. - */ - cache?: boolean; - - /** It specifies the type of data is send in the query string. - */ - contentType?: string; - - /** It specifies the data as an object, will be passed in the query string. - */ - data?: any; - - /** It specifies the type of data that you're expecting back from the response. - */ - dataType?: string; - - /** It specifies the HTTP request type. - */ - type?: string; -} -} - -class MaskEdit extends ej.Widget { - static fn: MaskEdit; - constructor(element: JQuery | Element, options?: MaskEdit.Model); - static Locale: any; - model: MaskEdit.Model; - defaults: MaskEdit.Model; - - /** To clear the text in mask edit textbox control. - * @returns {void} - */ - clear(): void; - - /** To disable the mask edit textbox control. - * @returns {void} - */ - disable(): void; - - /** To enable the mask edit textbox control. - * @returns {void} - */ - enable(): void; - - /** To obtained the pure value of the text value, removes all the symbols in mask edit textbox control. - * @returns {string} - */ - get_StrippedValue(): string; - - /** To obtained the textbox value as such that, Just replace all '_' to ' '(space) in mask edit textbox control. - * @returns {string} - */ - get_UnstrippedValue(): string; -} -export namespace MaskEdit { - -export interface Model { - - /** Specify the cssClass to achieve custom theme. - * @Default {null} - */ - cssClass?: string; - - /** Specify the custom character allowed to entered in mask edit textbox control. - * @Default {null} - */ - customCharacter?: string; - - /** Specify the state of the mask edit textbox control. - * @Default {true} - */ - enabled?: boolean; - - /** Specify the enablePersistence to mask edit textbox to save current model value to browser cookies for state maintains. - */ - enablePersistence?: boolean; - - /** Specifies the height for the mask edit textbox control. - * @Default {28 px} - */ - height?: string; - - /** Specifies whether hide the prompt characters with spaces on blur. Prompt chars will be shown again on focus the textbox. - * @Default {false} - */ - hidePromptOnLeave?: boolean; - - /** Specifies the list of HTML attributes to be added to mask edit textbox. - * @Default {{}} - */ - htmlAttributes?: any; - - /** Specify the inputMode for mask edit textbox control. See InputMode - * @Default {ej.InputMode.Text} - */ - inputMode?: ej.InputMode|string; - - /** Specifies the input mask. - * @Default {null} - */ - maskFormat?: string; - - /** Specifies the name attribute value for the mask edit textbox. - * @Default {null} - */ - name?: string; - - /** Toggles the readonly state of the mask edit textbox. When the mask edit textbox is readonly, it doesn't allow your input. - * @Default {false} - */ - readOnly?: boolean; - - /** Specifies whether the error will show until correct value entered in the mask edit textbox control. - * @Default {false} - */ - showError?: boolean; - - /** when showPromptChar is true, the hide the prompt characters are shown in focus of the control and hides in focus out of the control. - * @Default {true} - */ - showPromptChar?: boolean; - - /** MaskEdit input is displayed in rounded corner style when this property is set to true. - * @Default {false} - */ - showRoundedCorner?: boolean; - - /** Specify the text alignment for mask edit textbox control.See TextAlign - * @Default {left} - */ - textAlign?: ej.TextAlign|string; - - /** Sets the jQuery validation error message in mask edit. This property works when the widget is present inside the form. Include jquery.validate.min.js plugin additionally. - * @Default {null} - */ - validationMessage?: any; - - /** Sets the jQuery validation rules to the MaskEdit. This property works when the widget is present inside the form. Include jquery.validate.min.js plugin additionally. - * @Default {null} - */ - validationRules?: any; - - /** Specifies the value for the mask edit textbox control. - * @Default {null} - */ - value?: string; - - /** Specifies the water mark text to be displayed in input text. - * @Default {null} - */ - watermarkText?: string; - - /** Specifies the width for the mask edit textbox control. - * @Default {143pixel} - */ - width?: string; - - /** Fires when value changed in mask edit textbox control. */ - change?(e: ChangeEventArgs): void; - - /** Fires after MaskEdit control is created. */ - create?(e: CreateEventArgs): void; - - /** Fires when the MaskEdit is destroyed successfully. */ - destroy?(e: DestroyEventArgs): void; - - /** Fires when focused in mask edit textbox control. */ - focusIn?(e: FocusInEventArgs): void; - - /** Fires when focused out in mask edit textbox control. */ - focusOut?(e: FocusOutEventArgs): void; - - /** Fires when keydown in mask edit textbox control. */ - keydown?(e: KeydownEventArgs): void; - - /** Fires when key press in mask edit textbox control. */ - keyPress?(e: KeyPressEventArgs): void; - - /** Fires when keyup in mask edit textbox control. */ - keyup?(e: KeyupEventArgs): void; - - /** Fires when mouse out in mask edit textbox control. */ - mouseOut?(e: MouseOutEventArgs): void; - - /** Fires when mouse over in mask edit textbox control. */ - mouseOver?(e: MouseOverEventArgs): void; -} - -export interface ChangeEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the mask edit model - */ - model?: ej.MaskEdit.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the mask edit value - */ - value?: number; - - /** returns unstripped value in mask edit textbox control. - */ - unmaskedValue?: string; -} - -export interface CreateEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the MaskEdit model - */ - model?: ej.MaskEdit.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface DestroyEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the MaskEdit model - */ - model?: ej.MaskEdit.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface FocusInEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the mask edit model - */ - model?: ej.MaskEdit.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the mask edit value - */ - value?: number; - - /** returns unstripped value in mask edit textbox control. - */ - unmaskedValue?: string; -} - -export interface FocusOutEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the mask edit model - */ - model?: ej.MaskEdit.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the mask edit value - */ - value?: number; - - /** returns unstripped value in mask edit textbox control. - */ - unmaskedValue?: string; -} - -export interface KeydownEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the mask edit model - */ - model?: ej.MaskEdit.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the mask edit value - */ - value?: number; - - /** returns unstripped value in mask edit textbox control. - */ - unmaskedValue?: string; -} - -export interface KeyPressEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the mask edit model - */ - model?: ej.MaskEdit.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the mask edit value - */ - value?: number; - - /** returns unstripped value in mask edit textbox control. - */ - unmaskedValue?: string; -} - -export interface KeyupEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the mask edit model - */ - model?: ej.MaskEdit.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the mask edit value - */ - value?: number; - - /** returns unstripped value in mask edit textbox control. - */ - unmaskedValue?: string; -} - -export interface MouseOutEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the mask edit model - */ - model?: ej.MaskEdit.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the mask edit value - */ - value?: number; - - /** returns unstripped value in mask edit textbox control. - */ - unmaskedValue?: string; -} - -export interface MouseOverEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the mask edit model - */ - model?: ej.MaskEdit.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the mask edit value - */ - value?: number; - - /** returns unstripped value in mask edit textbox control. - */ - unmaskedValue?: string; -} -} -enum InputMode { -//string -Password, -//string -Text, -} -enum TextAlign { -//string -Center, -//string -Justify, -//string -Left, -//string -Right, -} - -class Menu extends ej.Widget { - static fn: Menu; - constructor(element: JQuery | Element, options?: Menu.Model); - static Locale: any; - model: Menu.Model; - defaults: Menu.Model; - - /** Disables the Menu control. - * @returns {void} - */ - disable(): void; - - /** Specifies the Menu Item to be disabled by using the Menu Item Text. - * @param {string} Specifies the Menu Item Text to be disabled. - * @returns {void} - */ - disableItem(itemtext: string): void; - - /** Specifies the Menu Item to be disabled by using the Menu Item Id. - * @param {string|number} Specifies the Menu Item id to be disabled - * @returns {void} - */ - disableItemByID(itemid: string|number): void; - - /** Enables the Menu control. - * @returns {void} - */ - enable(): void; - - /** Specifies the Menu Item to be enabled by using the Menu Item Text. - * @param {string} Specifies the Menu Item Text to be enabled. - * @returns {void} - */ - enableItem(itemtext: string): void; - - /** Specifies the Menu Item to be enabled by using the Menu Item Id. - * @param {string|number} Specifies the Menu Item id to be enabled. - * @returns {void} - */ - enableItemByID(itemid: string|number): void; - - /** Hides the Context Menu control. - * @returns {void} - */ - hide(): void; - - /** Hides the specific items in Menu control. - * @returns {void} - */ - hideItems(): void; - - /** Insert the menu item as child of target node. - * @param {any} Information about Menu item. - * @param {string|any} Selector of target node or Object of target node. - * @returns {void} - */ - insert(item: any, target: string|any): void; - - /** Insert the menu item after the target node. - * @param {any} Information about Menu item. - * @param {string|any} Selector of target node or Object of target node. - * @returns {void} - */ - insertAfter(item: any, target: string|any): void; - - /** Insert the menu item before the target node. - * @param {any} Information about Menu item. - * @param {string|any} Selector of target node or Object of target node. - * @returns {void} - */ - insertBefore(item: any, target: string|any): void; - - /** Remove Menu item. - * @param {any|Array} Selector of target node or Object of target node. - * @returns {void} - */ - remove(target: any|any[]): void; - - /** To show the Menu control. - * @param {number} x co-ordinate position of context menu. - * @param {number} y co-ordinate position of context menu. - * @param {any} target element - * @param {any} name of the event - * @returns {void} - */ - show(locationX: number, locationY: number, targetElement: any, event: any): void; - - /** Show the specific items in Menu control. - * @returns {void} - */ - showItems(): void; -} -export namespace Menu { - -export interface Model { - - /** To enable or disable the Animation while hover or click an menu items.See AnimationType - * @Default {ej.AnimationType.Default} - */ - animationType?: ej.AnimationType|string; - - /** Specifies the target id of context menu. On right clicking the specified contextTarget element, context menu gets shown. - * @Default {null} - */ - contextMenuTarget?: string; - - /** Specify the CSS class to achieve custom theme. - */ - cssClass?: string; - - /** To enable or disable the Animation effect while hover or click an menu items. - * @Default {true} - */ - enableAnimation?: boolean; - - /** Specifies the root menu items to be aligned center in horizontal menu. - * @Default {false} - */ - enableCenterAlign?: boolean; - - /** Enable / Disable the Menu control. - * @Default {true} - */ - enabled?: boolean; - - /** Specifies the menu items to be displayed in right to left direction. - * @Default {false} - */ - enableRTL?: boolean; - - /** When this property sets to false, the menu items is displayed without any separators. - * @Default {true} - */ - enableSeparator?: boolean; - - /** Specifies the target which needs to be excluded. i.e., The context menu will not be displayed in those specified targets. - * @Default {null} - */ - excludeTarget?: string; - - /** Fields used to bind the data source and it includes following field members to make data bind easier. - * @Default {null} - */ - fields?: Fields; - - /** Specifies the height of the root menu. - * @Default {auto} - */ - height?: string|number; - - /** Specifies the list of HTML attributes to be added to menu control. - * @Default {{}} - */ - htmlAttributes?: any; - - /** Enables/disables responsive support for the Menu control during the window resizing time. - * @Default {true} - */ - isResponsive?: boolean; - - /** Specifies the type of the menu. Essential JavaScript Menu consists of two type of menu, they are Normal Menu and Context Menu mode.See MenuType - * @Default {ej.MenuType.NormalMenu} - */ - menuType?: string|ej.MenuType; - - /** Specifies the sub menu items to be show or open only on click. - * @Default {false} - */ - openOnClick?: boolean; - - /** Specifies the orientation of normal menu. Normal menu can rendered in horizontal or vertical direction by using this API. See Orientation - * @Default {ej.Orientation.Horizontal} - */ - orientation?: ej.Orientation|string; - - /** Specifies the main menu items arrows only to be shown if it contains child items. - * @Default {true} - */ - showRootLevelArrows?: boolean; - - /** Specifies the sub menu items arrows only to be shown if it contains child items. - * @Default {true} - */ - showSubLevelArrows?: boolean; - - /** Specifies position of pull down submenu that will appear on mouse over.See Direction - * @Default {ej.Direction.Right} - */ - subMenuDirection?: string|ej.Direction; - - /** Specifies the title to responsive menu. - * @Default {Menu} - */ - titleText?: string; - - /** Specifies the width of the main menu. - * @Default {auto} - */ - width?: string|number; - - /** Specifies the popup menu height. - * @Default {auto} - */ - overflowHeight?: string|number; - - /** Specifies the popup menu width. - * @Default {auto} - */ - overflowWidth?: string|number; - - /** Fires before context menu gets open. */ - beforeOpen?(e: BeforeOpenEventArgs): void; - - /** Fires when mouse click on menu items. */ - click?(e: ClickEventArgs): void; - - /** Fire when context menu on close. */ - close?(e: CloseEventArgs): void; - - /** Fires when context menu on open. */ - open?(e: OpenEventArgs): void; - - /** Fires to create menu items. */ - create?(e: CreateEventArgs): void; - - /** Fires to destroy menu items. */ - destroy?(e: DestroyEventArgs): void; - - /** Fires when key down on menu items. */ - keydown?(e: KeydownEventArgs): void; - - /** Fires when mouse out from menu items. */ - mouseout?(e: MouseoutEventArgs): void; - - /** Fires when mouse over the Menu items. */ - mouseover?(e: MouseoverEventArgs): void; - - /** Fires when overflow popup menu opens. */ - overflowOpen?(e: OverflowOpenEventArgs): void; - - /** Fires when overflow popup menu closes. */ - overflowClose?(e: OverflowCloseEventArgs): void; -} - -export interface BeforeOpenEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the menu model - */ - model?: ej.Menu.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the target element - */ - target?: any; -} - -export interface ClickEventArgs { - - /** returns the menu model - */ - model?: ej.Menu.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns clicked menu item text - */ - text?: string; - - /** returns clicked menu item element - */ - element?: any; - - /** returns the event - */ - event?: any; - - /** returns the selected item - */ - selectedItem?: number; -} - -export interface CloseEventArgs { - - /** returns the menu model - */ - model?: ej.Menu.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the target element - */ - target?: any; -} - -export interface OpenEventArgs { - - /** returns the menu model - */ - model?: ej.Menu.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the target element - */ - target?: any; -} - -export interface CreateEventArgs { - - /** returns the menu model - */ - model?: ej.Menu.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface DestroyEventArgs { - - /** returns the menu model - */ - model?: ej.Menu.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface KeydownEventArgs { - - /** returns the menu model - */ - model?: ej.Menu.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns clicked menu item text - */ - menuText?: string; - - /** returns clicked menu item element - */ - element?: any; - - /** returns the event - */ - event?: any; -} - -export interface MouseoutEventArgs { - - /** returns the menu model - */ - model?: ej.Menu.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns clicked menu item text - */ - text?: string; - - /** returns clicked menu item element - */ - element?: any; - - /** returns the event - */ - event?: any; -} - -export interface MouseoverEventArgs { - - /** returns the menu model - */ - model?: ej.Menu.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns clicked menu item text - */ - text?: string; - - /** returns clicked menu item element - */ - element?: any; - - /** returns the event - */ - event?: any; -} - -export interface OverflowOpenEventArgs { - - /** returns the menu model - */ - model?: ej.Menu.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the event object - */ - e?: any; - - /** if the event should be cancelled ; otherwise ,false - */ - cancel?: boolean; -} - -export interface OverflowCloseEventArgs { - - /** returns the menu model - */ - model?: ej.Menu.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the event object - */ - e?: any; - - /** if the event should be cancelled ; otherwise ,false - */ - cancel?: boolean; -} - -export interface Fields { - - /** It receives the child data for the inner level. - */ - child?: any; - - /** It receives datasource as Essential DataManager object and JSON object. - */ - dataSource?: any; - - /** Specifies the HTML attributes to “LI” item list. - */ - htmlAttribute?: string; - - /** Specifies the id to menu items list - */ - id?: string; - - /** Specifies the image attribute to “img” tag inside items list. - */ - imageAttribute?: string; - - /** Specifies the image URL to “img” tag inside item list. - */ - imageUrl?: string; - - /** Adds custom attributes like "target" to the anchor tag of the menu items. - */ - linkAttribute?: string; - - /** Specifies the parent id of the table. - */ - parentId?: string; - - /** It receives query to retrieve data from the table (query is same as SQL). - */ - query?: any; - - /** Specifies the sprite CSS class to “LI” item list. - */ - spriteCssClass?: string; - - /** It receives table name to execute query on the corresponding table. - */ - tableName?: string; - - /** Specifies the text of menu items list. - */ - text?: string; - - /** Specifies the URL to the anchor tag in menu item list. - */ - url?: string; -} -} -enum AnimationType { -//string -Default, -//string -None, -} -enum MenuType { -//string -ContextMenu, -//string -NormalMenu, -} -enum Direction { -//string -Left, -//string -None, -//string -Right, -} - -class Pager extends ej.Widget { - static fn: Pager; - constructor(element: JQuery | Element, options?: Pager.Model); - static Locale: any; - model: Pager.Model; - defaults: Pager.Model; - - /** Send a paging request to specified page through the pager control. - * @param {number} Specifies the index to be navigated - * @returns {void} - */ - gotoPage(pageIndex: number): void; - - /** refreshPager() helps to refresh the model value of pager control. - * @returns {void} - */ - refreshPager(): void; -} -export namespace Pager { - -export interface Model { - - /** Gets or sets a value that indicates whether to display the custom text message in Pager. - */ - customText?: string; - - /** Gets or sets a value that indicates whether to define which page to display currently in pager. - * @Default {1} - */ - currentPage?: number; - - /** Gets or sets a value that indicates whether to display the external Message in Pager. - * @Default {false} - */ - enableExternalMessage?: boolean; - - /** Gets or sets a value that indicates whether to pass the current page information as a query string along with the URL while navigating to other page. - * @Default {false} - */ - enableQueryString?: boolean; - - /** Align content in the pager control from right to left by setting the property as true. - * @Default {false} - */ - enableRTL?: boolean; - - /** Gets or sets a value that indicates whether to display the external Message in Pager. - */ - externalMessage?: string; - - /** Gets or sets a value that indicates whether to customizing the user interface (UI) as locale-specific in order to display regional data i.e. - * in a language and culture specific to a particular country or region. - * @Default {en-US} - */ - locale?: string; - - /** Gets or sets a value that indicates whether to define the number of pages displayed in the pager for navigation. - * @Default {10} - */ - pageCount?: number; - - /** Gets or sets a value that indicates whether to define the number of records displayed per page. - * @Default {12} - */ - pageSize?: number; - - /** Get or sets a value of total number of pages in the pager. The totalPages value is calculated based on page size and total records. - * @Default {null} - */ - totalPages?: number; - - /** Get the value of total number of records which is bound to a data item. - * @Default {null} - */ - totalRecordsCount?: number; - - /** Shows or hides the current page information in pager footer. - * @Default {true} - */ - showPageInfo?: boolean; - - /** Triggered when pager numeric item is clicked in pager control. */ - click?(e: ClickEventArgs): void; -} - -export interface ClickEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the current page index. - */ - currentPage?: number; - - /** Returns the pager model. - */ - model?: any; - - /** Returns the name of event - */ - type?: string; - - /** Returns current action event type and its target. - */ - event?: any; -} -} - -class ProgressBar extends ej.Widget { - static fn: ProgressBar; - constructor(element: JQuery | Element, options?: ProgressBar.Model); - static Locale: any; - model: ProgressBar.Model; - defaults: ProgressBar.Model; - - /** Destroy the progressbar widget - * @returns {void} - */ - destroy(): void; - - /** Disables the progressbar control - * @returns {void} - */ - disable(): void; - - /** Enables the progressbar control - * @returns {void} - */ - enable(): void; - - /** Returns the current progress value in percent. - * @returns {number} - */ - getPercentage(): number; - - /** Returns the current progress value - * @returns {number} - */ - getValue(): number; -} -export namespace ProgressBar { - -export interface Model { - - /** Sets the root CSS class for ProgressBar theme, which is used customize. - * @Default {null} - */ - cssClass?: string; - - /** When this property sets to false, it disables the ProgressBar control - * @Default {true} - */ - enabled?: boolean; - - /** Save current model value to browser cookies for state maintains. While refresh the progressBar control page retains the model value apply from browser cookies - * @Default {false} - */ - enablePersistence?: boolean; - - /** Sets the ProgressBar direction as right to left alignment. - * @Default {false} - */ - enableRTL?: boolean; - - /** Defines the height of the ProgressBar. - * @Default {null} - */ - height?: number|string; - - /** It allows to define the characteristics of the progressBar control. It will helps to extend the capability of an HTML element. - * @Default {{}} - */ - htmlAttributes?: any; - - /** Sets the maximum value of the ProgressBar. - * @Default {100} - */ - maxValue?: number; - - /** Sets the minimum value of the ProgressBar. - * @Default {0} - */ - minValue?: number; - - /** Sets the ProgressBar value in percentage. The value should be in between 0 to 100. - * @Default {0} - */ - percentage?: number; - - /** Displays rounded corner borders on the progressBar control. - * @Default {false} - */ - showRoundedCorner?: boolean; - - /** Sets the custom text for the ProgressBar. The text placed in the middle of the ProgressBar and it can be customizable using the class 'e-progress-text'. - * @Default {null} - */ - text?: string; - - /** Sets the ProgressBar value. The value should be in between min and max values. - * @Default {0} - */ - value?: number; - - /** Defines the width of the ProgressBar. - * @Default {null} - */ - width?: number|string; - - /** Event triggers when the progress value changed */ - change?(e: ChangeEventArgs): void; - - /** Event triggers when the process completes (at 100%) */ - complete?(e: CompleteEventArgs): void; - - /** Event triggers when the progressbar are created */ - create?(e: CreateEventArgs): void; - - /** Event triggers when the progressbar are destroyed */ - destroy?(e: DestroyEventArgs): void; - - /** Event triggers when the process starts (from 0%) */ - start?(e: StartEventArgs): void; -} - -export interface ChangeEventArgs { - - /** returns the cancel option value - */ - cancel?: boolean; - - /** returns the ProgressBar model - */ - model?: ej.ProgressBar.Model; - - /** returns the current progress percentage - */ - percentage?: any; - - /** returns the name of the event - */ - type?: string; - - /** returns the current progress value - */ - value?: string; -} - -export interface CompleteEventArgs { - - /** returns the cancel option value - */ - cancel?: boolean; - - /** returns the ProgressBar model - */ - model?: ej.ProgressBar.Model; - - /** returns the current progress percentage - */ - percentage?: any; - - /** returns the name of the event - */ - type?: string; - - /** returns the current progress value - */ - value?: string; -} - -export interface CreateEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the progressbar model - */ - model?: ej.ProgressBar.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface DestroyEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the progressbar model - */ - model?: ej.ProgressBar.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface StartEventArgs { - - /** returns the cancel option value - */ - cancel?: boolean; - - /** returns the ProgressBar model - */ - model?: ej.ProgressBar.Model; - - /** returns the current progress percentage - */ - percentage?: any; - - /** returns the name of the event - */ - type?: string; - - /** returns the current progress value - */ - value?: string; -} -} - -class RadioButton extends ej.Widget { - static fn: RadioButton; - constructor(element: JQuery | Element, options?: RadioButton.Model); - static Locale: any; - model: RadioButton.Model; - defaults: RadioButton.Model; - - /** To disable the RadioButton - * @returns {void} - */ - disable(): void; - - /** To enable the RadioButton - * @returns {void} - */ - enable(): void; -} -export namespace RadioButton { - -export interface Model { - - /** Specifies the check attribute of the Radio Button. - * @Default {false} - */ - checked?: boolean; - - /** Specify the CSS class to RadioButton to achieve custom theme. - */ - cssClass?: string; - - /** Specifies the RadioButton control state. - * @Default {true} - */ - enabled?: boolean; - - /** Specifies the enablePersistence property for RadioButton while initialization. The enablePersistence API save current model value to browser cookies for state maintains. - * While refreshing the radio button control page the model value apply from browser cookies. - * @Default {false} - */ - enablePersistence?: boolean; - - /** Specify the Right to Left direction to RadioButton - * @Default {false} - */ - enableRTL?: boolean; - - /** Specifies the HTML Attributes of the Checkbox - * @Default {{}} - */ - htmlAttributes?: any; - - /** Specifies the id attribute for the Radio Button while initialization. - * @Default {null} - */ - id?: string; - - /** Specify the idPrefix value to be added before the current id of the RadioButton. - * @Default {ej} - */ - idPrefix?: string; - - /** Specifies the name attribute for the Radio Button while initialization. - * @Default {Sets id as name if it is null} - */ - name?: string; - - /** Specifies the size of the RadioButton. - * @Default {small} - */ - size?: ej.RadioButtonSize|string; - - /** Specifies the text content for RadioButton. - */ - text?: string; - - /** Set the jQuery validation error message in radio button. - * @Default {null} - */ - validationMessage?: any; - - /** Set the jQuery validation rules in radio button. - * @Default {null} - */ - validationRules?: any; - - /** Specifies the value attribute of the Radio Button. - * @Default {null} - */ - value?: string; - - /** Fires before the RadioButton is going to changed its state successfully */ - beforeChange?(e: BeforeChangeEventArgs): void; - - /** Fires when the RadioButton state is changed successfully */ - change?(e: ChangeEventArgs): void; - - /** Fires when the RadioButton created successfully */ - create?(e: CreateEventArgs): void; - - /** Fires when the RadioButton destroyed successfully */ - destroy?(e: DestroyEventArgs): void; -} - -export interface BeforeChangeEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the RadioButton model - */ - model?: ej.RadioButton.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns true if element is checked, otherwise returns false - */ - isChecked?: boolean; - - /** returns true if change event triggered by interaction, otherwise returns false - */ - isInteraction?: boolean; -} - -export interface ChangeEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the RadioButton model - */ - model?: ej.RadioButton.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns true if element is checked, otherwise returns false - */ - isChecked?: boolean; - - /** returns true if change event triggered by interaction, otherwise returns false - */ - isInteraction?: boolean; -} - -export interface CreateEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the RadioButton model - */ - model?: ej.RadioButton.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface DestroyEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the RadioButton model - */ - model?: ej.RadioButton.Model; - - /** returns the name of the event - */ - type?: string; -} -} -enum RadioButtonSize { -//Shows small size radio button -Small, -//Shows medium size radio button -Medium, -} - -class Rating extends ej.Widget { - static fn: Rating; - constructor(element: JQuery | Element, options?: Rating.Model); - static Locale: any; - model: Rating.Model; - defaults: Rating.Model; - - /** Destroy the Rating widget all events bound will be unbind automatically and bring the control to pre-init state. - * @returns {void} - */ - destroy(): void; - - /** To get the current value of rating control. - * @returns {number} - */ - getValue(): number; - - /** To hide the rating control. - * @returns {void} - */ - hide(): void; - - /** User can refresh the rating control to identify changes. - * @returns {void} - */ - refresh(): void; - - /** To reset the rating value. - * @returns {void} - */ - reset(): void; - - /** To set the rating value. - * @param {string|number} Specifies the rating value. - * @returns {void} - */ - setValue(value: string|number): void; - - /** To show the rating control - * @returns {void} - */ - show(): void; -} -export namespace Rating { - -export interface Model { - - /** Enables the rating control with reset button.It can be used to reset the rating control value. - * @Default {true} - */ - allowReset?: boolean; - - /** Specify the CSS class to achieve custom theme. - */ - cssClass?: string; - - /** When this property is set to false, it disables the rating control. - * @Default {true} - */ - enabled?: boolean; - - /** Save current model value to browser cookies for state maintenance. While refresh the page Rating control values are retained. - * @Default {false} - */ - enablePersistence?: boolean; - - /** Specifies the height of the Rating control wrapper. - * @Default {null} - */ - height?: string; - - /** Specifies the list of HTML attributes to be added to rating control. - * @Default {{}} - */ - htmlAttributes?: any; - - /** Specifies the value to be increased while navigating between shapes(stars) in Rating control. - * @Default {1} - */ - incrementStep?: number; - - /** Allow to render the maximum number of Rating shape(star). - * @Default {5} - */ - maxValue?: number; - - /** Allow to render the minimum number of Rating shape(star). - * @Default {0} - */ - minValue?: number; - - /** Specifies the orientation of Rating control. See Orientation - * @Default {ej.Rating.Orientation.Horizontal} - */ - orientation?: ej.Orientation|string; - - /** Helps to provide more precise ratings.Rating control supports three precision modes - full, half, and exact. See Precision - * @Default {full} - */ - precision?: ej.Rating.Precision|string; - - /** Interaction with Rating control can be prevented by enabling this API. - * @Default {false} - */ - readOnly?: boolean; - - /** To specify the height of each shape in Rating control. - * @Default {23} - */ - shapeHeight?: number; - - /** To specify the width of each shape in Rating control. - * @Default {23} - */ - shapeWidth?: number; - - /** Enables the tooltip option.Currently selected value will be displayed in tooltip. - * @Default {true} - */ - showTooltip?: boolean; - - /** To specify the number of stars to be selected while rendering. - * @Default {1} - */ - value?: number; - - /** Specifies the width of the Rating control wrapper. - * @Default {null} - */ - width?: string; - - /** Fires when Rating value changes. */ - change?(e: ChangeEventArgs): void; - - /** Fires when Rating control is clicked successfully. */ - click?(e: ClickEventArgs): void; - - /** Fires when Rating control is created. */ - create?(e: CreateEventArgs): void; - - /** Fires when Rating control is destroyed successfully. */ - destroy?(e: DestroyEventArgs): void; - - /** Fires when mouse hover is removed from Rating control. */ - mouseout?(e: MouseoutEventArgs): void; - - /** Fires when mouse hovered over the Rating control. */ - mouseover?(e: MouseoverEventArgs): void; -} - -export interface ChangeEventArgs { - - /** returns the current value. - */ - value?: number; - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the rating model - */ - model?: ej.Rating.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the mouse click event args values. - */ - event?: any; -} - -export interface ClickEventArgs { - - /** returns the current value. - */ - value?: number; - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the rating model - */ - model?: ej.Rating.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the mouse click event args values. - */ - event?: any; -} - -export interface CreateEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the rating model - */ - model?: ej.Rating.Model; - - /** returns the name of the event. - */ - type?: string; -} - -export interface DestroyEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the rating model - */ - model?: ej.Rating.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface MouseoutEventArgs { - - /** returns the current value. - */ - value?: number; - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the rating model - */ - model?: ej.Rating.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the mouse click event args values. - */ - event?: any; -} - -export interface MouseoverEventArgs { - - /** returns the current value. - */ - value?: number; - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the rating model - */ - model?: ej.Rating.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the mouse click event args values. - */ - event?: any; - - /** returns the current index value. - */ - index?: any; -} - -enum Precision { - - ///string - Exact, - - ///string - Full, - - ///string - Half -} - -} - -class Ribbon extends ej.Widget { - static fn: Ribbon; - constructor(element: JQuery | Element, options?: Ribbon.Model); - static Locale: any; - model: Ribbon.Model; - defaults: Ribbon.Model; - - /** Adds contextual tab or contextual tab set dynamically in the ribbon control with contextual tabs object and index position. - * When index is null, ribbon contextual tab or contextual tab set is added at the last index. - * @param {any} contextual tab or contextual tab set object. - * @param {number} index of the contextual tab or contextual tab set, this is optional. - * @returns {void} - */ - addContextualTabs(contextualTabSet: any, index?: number): void; - - /** Add new option to Backstage page. - * @param {any} select the object to add the backstage item - * @param {number} index to the backstage item this is optional. - * @returns {void} - */ - addBackStageItem(item: any, index?: number): void; - - /** Adds tab dynamically in the ribbon control with given name, tab group array and index position. When index is null, ribbon tab is added at the last index. - * @param {string} ribbon tab display text. - * @param {Array} groups to be displayed in ribbon tab . - * @param {number} index of the ribbon tab,this is optional. - * @returns {void} - */ - addTab(tabText: string, ribbonGroups: any[], index?: number): void; - - /** Adds tab group dynamically in the ribbon control with given tab index, tab group object and group index position. When group index is null, ribbon group is added at the last index. - * @param {number} ribbon tab index. - * @param {any} group to be displayed in ribbon tab . - * @param {number} index of the ribbon group,this is optional. - * @returns {void} - */ - addTabGroup(tabIndex: number, tabGroup: any, groupIndex?: number): void; - - /** Adds group content dynamically in the ribbon control with given tab index, group index, sub group index, content and content index position. - * When content index is null, content is added at the last index. - * @param {number} ribbon tab index. - * @param {number} ribbon group index. - * @param {number} sub group index in the ribbon group, - * @param {any} content to be displayed in the ribbon group. - * @param {number} ribbon content index .this is optional. - * @returns {void} - */ - addTabGroupContent(tabIndex: number, groupIndex: number, subGroupIndex: number, content: any, contentIndex?: number): void; - - /** Hides the ribbon backstage page. - * @returns {void} - */ - hideBackstage(): void; - - /** Collapses the ribbon tab content. - * @returns {void} - */ - collapse(): void; - - /** Destroys the ribbon widget. All the events bound using this._on are unbound automatically and the ribbon control is moved to pre-init state. - * @returns {void} - */ - destroy(): void; - - /** Expands the ribbon tab content. - * @returns {void} - */ - expand(): void; - - /** Gets text of the given index tab in the ribbon control. - * @param {number} index of the tab item. - * @returns {String} - */ - getTabText(index: number): string; - - /** Hides the given text tab in the ribbon control. - * @param {string} text of the tab item. - * @returns {void} - */ - hideTab(text: string): void; - - /** Checks whether the given text tab in the ribbon control is enabled or not. - * @param {string} text of the tab item. - * @returns {Boolean} - */ - isEnable(text: string): boolean; - - /** Checks whether the given text tab in the ribbon control is visible or not. - * @param {string} text of the tab item. - * @returns {Boolean} - */ - isVisible(text: string): boolean; - - /** Removes the given index tab item from the ribbon control. - * @param {number} index of tab item. - * @returns {void} - */ - removeTab(index: number): void; - - /** Sets new text to the given text tab in the ribbon control. - * @param {string} current text of the tab item. - * @param {string} new text of the tab item. - * @returns {void} - */ - setTabText(tabText: string, newText: string): void; - - /** Displays the ribbon backstage page. - * @returns {void} - */ - showBackstage(): void; - - /** Displays the given text tab in the ribbon control. - * @param {string} text of the tab item. - * @returns {void} - */ - showTab(text: string): void; - - /** To customize Group alone in the inside content. - * @param {number} ribbon tab index. - * @param {string} group id to be displayed in ribbon tab . - * @param {any} contentGroup is used in the object - * @returns {void} - */ - updateGroup(tabIndex: number, groupId: string, contentGroup?: any): void; - - /** Update option in existing Backstage. - * @param {number} index to the backstage item - * @param {any} select the object to add the backstage item - * @returns {void} - */ - updateBackStageItem(index: number, item?: any): void; - - /** To customize whole content from Tab Group. - * @param {number} ribbon tab index. - * @param {string} ribbon group text. - * @param {number} sub group index in the ribbon group, - * @returns {void} - */ - removeTabGroupContent(tabIndex: number, groupText: string, subGroupIndex?: number): void; - - /** Remove option from Backstage. - * @param {number} index to the backstage item - * @returns {void} - */ - removeBackStageItem(index: number): void; -} -export namespace Ribbon { - -export interface Model { - - /** Enables the ribbon resize feature.allowResizing is a deprecated property of isResponsive. - * @Default {false} - */ - allowResizing?: boolean; - - /** When set to true, adapts the Ribbon layout to fit the screen size of devices on which it renders. - * @Default {false} - */ - isResponsive?: boolean; - - /** Specifies the height, width, enableRTL, showRoundedCorner,enabled,cssClass property to the controls in the ribbon commonly andit will work only when those properties - * are not defined in buttonSettings and content defaults. - * @Default {Object} - */ - buttonDefaults?: any; - - /** Property to enable the ribbon quick access toolbar. - * @Default {false} - */ - showQAT?: boolean; - - /** Sets custom setting to the collapsible pin in the ribbon. - * @Default {Object} - */ - collapsePinSettings?: CollapsePinSettings; - - /** Set enableOnDemand as true to load ribbon tab and backstage contents while corresponding item clicked. - * @Default {false} - */ - enableOnDemand?: boolean; - - /** Set collapsible property as true to render ribbon in initially collapsed state. - * @Default {false} - */ - collapsible?: boolean; - - /** Align content in the ribbon control from right to left by setting the property as true. - * @Default {false} - */ - enableRTL?: boolean; - - /** Sets custom setting to the expandable pin in the ribbon. - * @Default {Object} - */ - expandPinSettings?: ExpandPinSettings; - - /** Specifies the application tab to contain application menu or backstage page in the ribbon control. - * @Default {Object} - */ - applicationTab?: ApplicationTab; - - /** Specifies the contextual tabs and tab set to the ribbon control with the background color and border color. Refer to the tabs section for adding tabs - * into the contextual tab and contextual tab set. - * @Default {Array} - */ - contextualTabs?: ContextualTab[]; - - /** Specifies the index or indexes to disable the given index tab or indexes tabs in the ribbon control. - * @Default {0} - */ - disabledItemIndex?: any[]; - - /** Specifies the index or indexes to enable the given index tab or indexes tabs in the ribbon control. - * @Default {null} - */ - enabledItemIndex?: any[]; - - /** Specifies the index of the ribbon tab to select the given index tab item in the ribbon control. - * @Default {1} - */ - selectedItemIndex?: number; - - /** Specifies the tabs and its groups. Also specifies the control details that has to be placed in the tab area in the ribbon control. - * @Default {Array} - */ - tabs?: Tab[]; - - /** Gets or sets a value that indicates whether to customizing the user interface (UI) as locale-specific in order to display regional data i.e. in a language and culture specific - * to a particular country or region and it will need to use the user's preference. - * @Default {en-US} - */ - locale?: string; - - /** Specifies the width to the ribbon control. You can set width in string or number format. - * @Default {null} - */ - width?: string|number; - - /** Triggered before the ribbon tab item is removed. */ - beforeTabRemove?(e: BeforeTabRemoveEventArgs): void; - - /** Triggered before the ribbon control is created. */ - create?(e: CreateEventArgs): void; - - /** Triggered before the ribbon control is destroyed. */ - destroy?(e: DestroyEventArgs): void; - - /** Triggered when the control in the group is clicked successfully. */ - groupClick?(e: GroupClickEventArgs): void; - - /** Triggered when the group expander in the group is clicked successfully. */ - groupExpand?(e: GroupExpandEventArgs): void; - - /** Triggered when an item in the Gallery control is clicked successfully. */ - galleryItemClick?(e: GalleryItemClickEventArgs): void; - - /** Triggered when a tab or button in the backstage page is clicked successfully. */ - backstageItemClick?(e: BackstageItemClickEventArgs): void; - - /** Triggered when the ribbon control is collapsed. */ - collapse?(e: CollapseEventArgs): void; - - /** Triggered when the ribbon control is expanded. */ - expand?(e: ExpandEventArgs): void; - - /** Triggered before the ribbon control is load. */ - load?(e: LoadEventArgs): void; - - /** Triggered after adding the new ribbon tab item. */ - tabAdd?(e: TabAddEventArgs): void; - - /** Triggered when tab is clicked successfully in the ribbon control. */ - tabClick?(e: TabClickEventArgs): void; - - /** Triggered before the ribbon tab is created. */ - tabCreate?(e: TabCreateEventArgs): void; - - /** Triggered after the tab item is removed from the ribbon control. */ - tabRemove?(e: TabRemoveEventArgs): void; - - /** Triggered after the ribbon tab item is selected in the ribbon control. */ - tabSelect?(e: TabSelectEventArgs): void; - - /** Triggered when the expand/collapse button is clicked successfully . */ - toggleButtonClick?(e: ToggleButtonClickEventArgs): void; - - /** Triggered when the QAT menu item is clicked successfully . */ - qatMenuItemClick?(e: QatMenuItemClickEventArgs): void; -} - -export interface BeforeTabRemoveEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the ribbon model. - */ - model?: any; - - /** returns the name of the event. - */ - type?: string; - - /** returns current tab item index in the ribbon control. - */ - index?: number; -} - -export interface CreateEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the ribbon model. - */ - model?: any; - - /** returns the name of the event. - */ - type?: string; -} - -export interface DestroyEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the ribbon model. - */ - model?: any; - - /** returns the name of the event. - */ - type?: string; - - /** returns current ribbon tab item index - */ - deleteIndex?: number; -} - -export interface GroupClickEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the ribbon model. - */ - model?: any; - - /** returns the name of the event. - */ - type?: string; - - /** returns the control clicked in the group. - */ - target?: number; -} - -export interface GroupExpandEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the ribbon model. - */ - model?: any; - - /** returns the name of the event. - */ - type?: string; - - /** returns the clicked group expander. - */ - target?: number; -} - -export interface GalleryItemClickEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the ribbon model. - */ - model?: any; - - /** returns the gallery model. - */ - galleryModel?: any; - - /** returns the name of the event. - */ - type?: string; - - /** returns the item clicked in the gallery. - */ - target?: number; -} - -export interface BackstageItemClickEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the ribbon model. - */ - model?: any; - - /** returns the name of the event. - */ - type?: string; - - /** returns the item clicked in the gallery. - */ - target?: number; - - /** returns the id of the target item. - */ - id?: string; - - /** returns the text of the target item. - */ - text?: string; -} - -export interface CollapseEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the ribbon model. - */ - model?: any; - - /** returns the name of the event. - */ - type?: string; -} - -export interface ExpandEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the ribbon model. - */ - model?: any; - - /** returns the name of the event. - */ - type?: string; -} - -export interface LoadEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the ribbon model. - */ - model?: any; - - /** returns the name of the event. - */ - type?: string; -} - -export interface TabAddEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the ribbon model. - */ - model?: any; - - /** returns the name of the event. - */ - type?: string; - - /** returns new added tab header. - */ - tabHeader?: any; - - /** returns new added tab content panel. - */ - tabContent?: any; -} - -export interface TabClickEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the ribbon model. - */ - model?: any; - - /** returns the name of the event. - */ - type?: string; - - /** returns previous active tab header. - */ - prevActiveHeader?: any; - - /** returns previous active index. - */ - prevActiveIndex?: number; - - /** returns current active tab header . - */ - activeHeader?: any; - - /** returns current active index. - */ - activeIndex?: number; -} - -export interface TabCreateEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the ribbon model. - */ - model?: any; - - /** returns the name of the event. - */ - type?: string; - - /** returns current ribbon tab item index - */ - deleteIndex?: number; -} - -export interface TabRemoveEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the ribbon model. - */ - model?: any; - - /** returns the name of the event. - */ - type?: string; - - /** returns the removed index. - */ - removedIndex?: number; -} - -export interface TabSelectEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the ribbon model. - */ - model?: any; - - /** returns the name of the event. - */ - type?: string; - - /** returns previous active tab header. - */ - prevActiveHeader?: any; - - /** returns previous active index. - */ - prevActiveIndex?: number; - - /** returns current active tab header . - */ - activeHeader?: any; - - /** returns current active index. - */ - activeIndex?: number; -} - -export interface ToggleButtonClickEventArgs { - - /** Set to true when the event has to be canceled, else false. - */ - cancel?: boolean; - - /** returns the ribbon model. - */ - model?: any; - - /** returns the name of the event. - */ - type?: string; - - /** returns the expand/collapse button. - */ - target?: number; -} - -export interface QatMenuItemClickEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the ribbon model. - */ - model?: any; - - /** returns the name of the event. - */ - type?: string; - - /** returns the clicked menu item text. - */ - text?: string; -} - -export interface CollapsePinSettings { - - /** Sets tooltip for the collapse pin . - * @Default {null} - */ - toolTip?: string; - - /** Specifies the custom tooltip for collapse pin.Refer to ejRibbon#tabs->groups->content->groups->customToolTip for its inner properties. - * @Default {Object} - */ - customToolTip?: any; -} - -export interface ExpandPinSettings { - - /** Sets tooltip for the expand pin. - * @Default {null} - */ - toolTip?: string; - - /** Specifies the custom tooltip for expand pin.Refer to ejRibbon#tabs->groups->content->groups->customToolTip for its inner properties. - * @Default {Object} - */ - customToolTip?: any; -} - -export interface ApplicationTabBackstageSettingsPage { - - /** Specifies the id for ribbon backstage page's tab and button elements. - * @Default {null} - */ - id?: string; - - /** Specifies the text for ribbon backstage page's tab header and button elements. - * @Default {null} - */ - text?: string; - - /** Specifies the type for ribbon backstage page's contents. Set "ej.Ribbon.BackStageItemType.Tab" to render the tab or " - * ej.Ribbon.BackStageItemType.Button" to render the button. - * @Default {ej.Ribbon.ItemType.Tab} - */ - itemType?: ej.Ribbon.ItemType|string; - - /** Specifies the id of HTML elements like div,ul, etc., as ribbon backstage page's tab content. - * @Default {null} - */ - contentID?: string; - - /** Specifies the separator between backstage page's tab and button elements. - * @Default {false} - */ - enableSeparator?: boolean; -} - -export interface ApplicationTabBackstageSettings { - - /** Specifies the display text of application tab. - * @Default {null} - */ - text?: string; - - /** Specifies the height of ribbon backstage page. - * @Default {null} - */ - height?: string|number; - - /** Specifies the width of ribbon backstage page. - * @Default {null} - */ - width?: string|number; - - /** Specifies the ribbon backstage page with its tab and button elements. - * @Default {Array} - */ - pages?: ApplicationTabBackstageSettingsPage[]; - - /** Specifies the width of backstage page header that contains tabs and buttons. - * @Default {null} - */ - headerWidth?: string|number; -} - -export interface ApplicationTab { - - /** Specifies the ribbon backstage page items. - * @Default {Object} - */ - backstageSettings?: ApplicationTabBackstageSettings; - - /** Specifies the ID of ul list to create application menu in the ribbon control. - * @Default {null} - */ - menuItemID?: string; - - /** Specifies the menu members, events by using the menu settings for the menu in the application tab. - * @Default {Object} - */ - menuSettings?: any; - - /** Specifies the application menu or backstage page. Specify the type of application tab as "ej.Ribbon.ApplicationTabType.Menu" to render the application menu or - * "ej.Ribbon.ApplicationTabType.Backstage" to render backstage page in the ribbon control. - * @Default {ej.Ribbon.ApplicationTabType.Menu} - */ - type?: ej.Ribbon.ApplicationTabType|string; -} - -export interface ContextualTab { - - /** Specifies the backgroundColor of the contextual tabs and tab set in the ribbon control. - * @Default {null} - */ - backgroundColor?: string; - - /** Specifies the borderColor of the contextual tabs and tab set in the ribbon control. - * @Default {null} - */ - borderColor?: string; - - /** Specifies the tabs to present in the contextual tabs and tab set. Refer to the tabs section for adding tabs into the contextual tabs and tab set. - * @Default {Array} - */ - tabs?: any[]; -} - -export interface TabsGroupsContentDefaults { - - /** Specifies the controls height such as Syncfusion button,split button,dropdown list,toggle button in the subgroup of the ribbon tab. - * @Default {null} - */ - height?: string|number; - - /** Specifies the controls width such as Syncfusion button,split button,dropdown list,toggle button in the subgroup of the ribbon tab. - * @Default {null} - */ - width?: string|number; - - /** Specifies the controls type such as Syncfusion button,split button,dropdown list,toggle button in the subgroup of the ribbon tab. - * @Default {ej.Ribbon.Type.Button} - */ - type?: string; - - /** Specifies the controls size such as Syncfusion button,split button,dropdown list,toggle button in the subgroup of the ribbon tab. - * @Default {false} - */ - isBig?: boolean; -} - -export interface TabsGroupsContentGroupsCustomGalleryItem { - - /** Specifies the Syncfusion button members, events by using buttonSettings. - * @Default {Object} - */ - buttonSettings?: any; - - /** Specifies the type as ej.Ribbon.CustomItemType.Menu or ej.Ribbon.CustomItemType.Button to render Syncfusion button and menu. - * @Default {ej.Ribbon.CustomItemType.Button} - */ - customItemType?: ej.Ribbon.CustomItemType|string; - - /** Specifies the custom tooltip for gallery extra item's button. Refer to ejRibbon#tabs->groups->content->groups->customToolTip for its inner properties. - * @Default {Object} - */ - customToolTip?: any; - - /** Specifies the UL list id to render menu as gallery extra item. - * @Default {null} - */ - menuId?: string; - - /** Specifies the Syncfusion menu members, events by using menuSettings. - * @Default {Object} - */ - menuSettings?: any; - - /** Specifies the text for gallery extra item's button. - * @Default {null} - */ - text?: string; - - /** Specifies the tooltip for gallery extra item's button. - * @Default {null} - */ - toolTip?: string; -} - -export interface TabsGroupsContentGroupsCustomToolTip { - - /** Sets content to the custom tooltip. Text and HTML support are provided for content. - * @Default {null} - */ - content?: string; - - /** Sets icon to the custom tooltip content. - * @Default {null} - */ - prefixIcon?: string; - - /** Sets title to the custom tooltip. Text and HTML support are provided for title and the title is in bold for text format. - * @Default {null} - */ - title?: string; -} - -export interface TabsGroupsContentGroupsGalleryItem { - - /** Specifies the Syncfusion button members, events by using buttonSettings. - * @Default {Object} - */ - buttonSettings?: any; - - /** Specifies the custom tooltip for gallery content. Refer to ejRibbon#tabs->groups->content->groups->customToolTip for its inner properties. - * @Default {Object} - */ - customToolTip?: any; - - /** Sets text for the gallery content. - * @Default {null} - */ - text?: string; - - /** Sets tooltip for the gallery content. - * @Default {null} - */ - toolTip?: string; -} - -export interface TabsGroupsContentGroup { - - /** When isMobileOnly is true,its shows in mobile toolbar.isResponsive should be true for using this property. - * @Default {false} - */ - isMobileOnly?: boolean; - - /** Specifies the Syncfusion button members, events by using this buttonSettings. - * @Default {Object} - */ - buttonSettings?: any; - - /** It is used to set the count of gallery contents in a row. - * @Default {null} - */ - columns?: number; - - /** Specifies the custom items such as div, table, controls as custom controls with the type "ej.Ribbon.Type.Custom" in the groups. - * @Default {null} - */ - contentID?: string; - - /** Specifies the CSS class property to apply styles to the button, split, dropdown controls in the groups. - * @Default {null} - */ - cssClass?: string; - - /** Specifies the Syncfusion button and menu as gallery extra items. - * @Default {Array} - */ - customGalleryItems?: TabsGroupsContentGroupsCustomGalleryItem[]; - - /** Provides custom tooltip for button, split button, dropdown list, toggle button, custom controls in the sub groups. Text and HTML support are also provided for title and content. - * @Default {Object} - */ - customToolTip?: TabsGroupsContentGroupsCustomToolTip; - - /** Specifies the Syncfusion dropdown list members, events by using this dropdownSettings. - * @Default {Object} - */ - dropdownSettings?: any; - - /** Specifies the separator to the control that is in row type group. The separator separates the control from the next control in the group. Set "true" to enable the separator. - * @Default {false} - */ - enableSeparator?: boolean; - - /** Sets the count of gallery contents in a row, when the gallery is in expanded state. - * @Default {null} - */ - expandedColumns?: number; - - /** Defines each gallery content. - * @Default {Array} - */ - galleryItems?: TabsGroupsContentGroupsGalleryItem[]; - - /** Specifies the Id for button, split button, dropdown list, toggle button, gallery, custom controls in the sub groups. - * @Default {null} - */ - id?: string; - - /** Specifies the size for button, split button controls. Set "true" for big size and "false" for small size. - * @Default {null} - */ - isBig?: boolean; - - /** Sets the height of each gallery content. - * @Default {null} - */ - itemHeight?: string|number; - - /** Sets the width of each gallery content. - * @Default {null} - */ - itemWidth?: string|number; - - /** Specifies the Syncfusion split button members, events by using this splitButtonSettings. - * @Default {Object} - */ - splitButtonSettings?: any; - - /** Specifies the text for button, split button, toggle button controls in the sub groups. - * @Default {null} - */ - text?: string; - - /** Specifies the Syncfusion toggle button members, events by using toggleButtonSettings. - * @Default {Object} - */ - toggleButtonSettings?: any; - - /** Specifies the tooltip for button, split button, dropdown list, toggle button, custom controls in the sub groups. - * @Default {null} - */ - toolTip?: string; - - /** To add,show and hide controls in Quick Access toolbar. - * @Default {ej.Ribbon.QuickAccessMode.None} - */ - quickAccessMode?: ej.Ribbon.QuickAccessMode|string; - - /** Specifies the type as "ej.Ribbon.Type.Button" or "ej.Ribbon.Type.SplitButton" or "ej.Ribbon.Type.DropDownList" or "ej.Ribbon.Type.ToggleButton" - * or "ej.Ribbon.Type.Custom" or "ej.Ribbon.Type.Gallery" to render button, split, dropdown, toggle button, gallery, custom controls. - * @Default {ej.Ribbon.Type.Button} - */ - type?: ej.Ribbon.Type|string; -} - -export interface TabsGroupsContent { - - /** Specifies the height, width, type, isBig property to the controls in the group commonly. - * @Default {Object} - */ - defaults?: TabsGroupsContentDefaults; - - /** Specifies the controls such as Syncfusion button, split button, dropdown list, toggle button, gallery, custom controls in the subgroup of the ribbon tab . - * @Default {Array} - */ - groups?: TabsGroupsContentGroup[]; -} - -export interface TabsGroupsGroupExpanderSettings { - - /** Sets tooltip for the group expander of the group. - * @Default {null} - */ - toolTip?: string; - - /** Specifies the custom tooltip for group expander.Refer to ejRibbon#tabs->groups->content->groups->customToolTip for its inner properties. - * @Default {Object} - */ - customToolTip?: any; -} - -export interface TabsGroup { - - /** Specifies the alignment of controls in the groups in 'row' type or 'column' type. Value for row type is "ej.Ribbon.AlignType.Rows" - * and for column type is "ej.Ribbon.alignType.columns". - * @Default {ej.Ribbon.AlignType.Rows} - */ - alignType?: ej.Ribbon.AlignType|string; - - /** Specifies the Syncfusion button, split button, dropdown list, toggle button, gallery, custom controls to the groups in the ribbon control. - * @Default {Array} - */ - content?: TabsGroupsContent[]; - - /** Specifies the ID of custom items to be placed in the groups. - * @Default {null} - */ - contentID?: string; - - /** Specifies the HTML contents to place into the groups. - * @Default {null} - */ - customContent?: string; - - /** Specifies the group expander for groups in the ribbon control. Set "true" to enable the group expander. - * @Default {false} - */ - enableGroupExpander?: boolean; - - /** Sets custom setting to the groups in the ribbon control. - * @Default {Object} - */ - groupExpanderSettings?: TabsGroupsGroupExpanderSettings; - - /** Specifies the text to the groups in the ribbon control. - * @Default {null} - */ - text?: string; - - /** Specifies the custom items such as div, table, controls by using the "custom" type. - * @Default {null} - */ - type?: string; -} - -export interface Tab { - - /** Specifies single group or multiple groups and its contents to each tab in the ribbon control. - * @Default {Array} - */ - groups?: TabsGroup[]; - - /** Specifies the ID for each tab's content panel. - * @Default {null} - */ - id?: string; - - /** Specifies the text of the tab in the ribbon control. - * @Default {null} - */ - text?: string; -} - -enum ItemType { - - ///To render the button for ribbon backstage page’s contents - Button, - - ///To render the tab for ribbon backstage page’s contents - Tab -} - - -enum ApplicationTabType { - - ///applicationTab display as menu - Menu, - - ///applicationTab display as backstage - Backstage -} - - -enum AlignType { - - ///To align the group content's in row - Rows, - - ///To align group content's in columns - Columns -} - - -enum CustomItemType { - - ///Specifies the button type in customGalleryItems - Button, - - ///Specifies the menu type in customGalleryItems - Menu -} - - -enum QuickAccessMode { - - ///Controls are hidden in Quick Access toolbar - None, - - ///Add controls in toolBar - ToolBar, - - ///Add controls in menu - Menu -} - - -enum Type { - - ///Specifies the button control - Button, - - ///Specifies the split button - SplitButton, - - ///Specifies the dropDown - DropDownList, - - ///To append external element's - Custom, - - ///Specifies the toggle button - ToggleButton, - - ///Specifies the ribbon gallery - Gallery -} - -} - -class Kanban extends ej.Widget { - static fn: Kanban; - constructor(element: JQuery | Element, options?: Kanban.Model); - static Locale: any; - model: Kanban.Model; - defaults: Kanban.Model; - - /** Add or remove columns in Kanban columns collections.Default action is add. - * @param {Array|string} Pass array of columns or string of headerText to add/remove the column in Kanban - * @param {Array|string} Pass array of columns or string of key value to add/remove the column in Kanban - * @param {string} optional Pass add/remove action to be performed. By default "add" action will perform - * @returns {void} - */ - columns(columndetails: any[]|string, keyvalue: any[]|string, action?: string): void; - - /** Destroy the Kanban widget all events bound using this._on will be unbind automatically and bring the control to pre-init state. - * @returns {void} - */ - destroy(): void; - - /** Refresh the Kanban with new data source. - * @param {Array} Pass new data source to the Kanban - * @returns {void} - */ - dataSource(datasource: any[]): void; - - /** toggleColumn based on the headerText in Kanban. - * @param {any} Pass the header text of the column to get the corresponding column object - * @returns {void} - */ - toggleColumn(headerText: any): void; - - /** Expand or collapse the card based on the state of target "div" - * @param {string|number} Pass the id of card to be toggle - * @returns {void} - */ - toggleCard(key: string|number): void; - - /** Used for get the names of all the visible column name collections in Kanban. - * @returns {Array} - */ - getVisibleColumnNames(): any[]; - - /** Get the scroller object of Kanban. - * @returns {ej.Scroller} - */ - getScrollObject(): ej.Scroller; - - /** Get the column details based on the given header text in Kanban. - * @param {string} Pass the header text of the column to get the corresponding column object - * @returns {String} - */ - getColumnByHeaderText(headerText: string): string; - - /** Get the table details based on the given header table in Kanban. - * @returns {String} - */ - getHeaderTable(): string; - - /** Hide columns from the Kanban based on the header text - * @param {Array|string} you can pass either array of header text of various columns or a header text of a column to hide - * @returns {void} - */ - hideColumns(headerText: any[]|string): void; - - /** Print the Kanban Board - * @returns {void} - */ - print(): void; - - /** Refresh the template of the Kanban - * @returns {void} - */ - refreshTemplate(): void; - - /** Refresh the Kanban contents.The template refreshment is based on the argument passed along with this method - * @param {boolean} optional When templateRefresh is set true, template and Kanban contents both are refreshed in Kanban else only Kanban content is refreshed - * @returns {void} - */ - refresh(templateRefresh?: boolean): void; - - /** Show columns in the Kanban based on the header text. - * @param {Array|string} You can pass either array of header text of various columns or a header text of a column to show - * @returns {void} - */ - showColumns(headerText: any[]|string): void; - - /** Update a card in Kanban control based on key and JSON data given. - * @param {string} Pass the key field Name of the column - * @param {Array} Pass the edited JSON data of card need to be update. - * @returns {void} - */ - updateCard(key: string, data: any[]): void; - - KanbanSelection: Kanban.KanbanSelection; - - KanbanSwimlane: Kanban.KanbanSwimlane; - - KanbanFilter: Kanban.KanbanFilter; - - KanbanEdit: Kanban.KanbanEdit; -} -export namespace Kanban { - -export interface KanbanSelection { - - /** It is used to clear all the card selection. - * @returns {void} - */ - clear(): void; -} - -export interface KanbanSwimlane { - - /** Expand all the swimlane rows in Kanban. - * @returns {void} - */ - expandAll(): void; - - /** Collapse all the swimlane rows in Kanban. - * @returns {void} - */ - collapseAll(): void; - - /** Expand or collapse the swimlane row based on the state of target "div" - * @param {any} Pass the div object to toggleSwimlane row based on its row state - * @returns {void} - */ - toggle($div: any): void; -} - -export interface KanbanFilter { - - /** Method used for send a clear search request to Kanban. - * @returns {void} - */ - clearSearch(): void; - - /** Send a search request to Kanban with specified string passed in it. - * @param {string} Pass the string to search in Kanban card - * @returns {void} - */ - searchCards(searchString: string): void; - - /** Send a clear request to filter cards in the kanban. - * @returns {void} - */ - clearFilter(): void; - - /** Send a filtering request to cards in the kanban. - * @returns {void} - */ - filterCards(): void; -} - -export interface KanbanEdit { - - /** Add a new card in Kanban control when allowAdding is set as true. If parameters are not given default dialog will be open. - * @param {string} Pass the primary key field Name of the column - * @param {Array} Pass the edited JSON data of card need to be add. - * @returns {void} - */ - addCard(primaryKey: string, card: any[]): void; - - /** Send a cancel request of add/edit card in Kanban when allowEditing/allowAdding is set as true. - * @returns {void} - */ - cancelEdit(): void; - - /** Delete a card in Kanban control when allowAdding/allowEditing is set as true. - * @param {string|number} Pass the key of card to be delete - * @returns {void} - */ - deleteCard(Key: string|number): void; - - /** Send a save request in Kanban when any card is in edit/new add card state and allowEditing/allowAdding is set as true. - * @returns {void} - */ - endEdit(): void; - - /** Send an edit card request in Kanban when allowEditing is set as true. Parameter will be HTML element or primary key - * @param {any} Pass the div selected row element to be edited in Kanban - * @returns {void} - */ - startEdit($div: any): void; - - /** Method used for set validation to a field during editing. - * @param {string} Specify the name of the column to set validation rules - * @param {any} Specify the validation rules for the field - * @returns {void} - */ - setValidationToField(name: string, rules: any): void; -} - -export interface Model { - - /** Gets or sets a value that indicates whether to enable allowDragAndDrop behavior on Kanban. - * @Default {true} - */ - allowDragAndDrop?: boolean; - - /** To enable or disable the title of the card. - * @Default {false} - */ - allowTitle?: boolean; - - /** Customize the settings for swim lane. - * @Default {Object} - */ - swimlaneSettings?: SwimlaneSettings; - - /** To enable or disable the column expand /collapse. - * @Default {false} - */ - allowToggleColumn?: boolean; - - /** To enable Searching operation in Kanban. - * @Default {false} - */ - allowSearching?: boolean; - - /** To enable filtering behavior on Kanban.User can specify query in filterSettings collection after enabling allowFiltering. - * @Default {false} - */ - allowFiltering?: boolean; - - /** Gets or sets a value that indicates whether to enable allowSelection behavior on Kanban.User can select card and the selected card will be highlighted on Kanban. - * @Default {true} - */ - allowSelection?: boolean; - - /** Gets or sets a value that indicates whether to allow card hover actions. - * @Default {true} - */ - allowHover?: boolean; - - /** To allow keyboard navigation actions. - * @Default {false} - */ - allowKeyboardNavigation?: boolean; - - /** Gets or sets a value that indicates whether to enable the scrollbar in the Kanban and view the card by scroll through the Kanban manually. - * @Default {false} - */ - allowScrolling?: boolean; - - /** Gets or sets a value that indicates whether to enable printing option. - * @Default {false} - */ - allowPrinting?: boolean; - - /** Gets or sets an object that indicates whether to customize the context menu behavior of the Kanban. - * @Default {Object} - */ - contextMenuSettings?: ContextMenuSettings; - - /** Gets or sets an object that indicates to render the Kanban with specified columns. - * @Default {Array} - */ - columns?: Column[]; - - /** Gets or sets an object that indicates whether to Customize the card settings. - * @Default {Object} - */ - cardSettings?: CardSettings; - - /** Gets or sets a value that indicates whether to add customToolbarItems within the toolbar to perform any action in the Kanban. - * @Default {[]} - */ - customToolbarItems?: CustomToolbarItem[]; - - /** Gets or sets a value that indicates to render the Kanban with custom theme. - */ - cssClass?: string; - - /** Gets or sets the data to render the Kanban with cards. - * @Default {null} - */ - dataSource?: any; - - /** To perform kanban functionalities with touch interaction. - * @Default {true} - */ - enableTouch?: boolean; - - /** Align content in the Kanban control align from right to left by setting the property as true. - * @Default {false} - */ - enableRTL?: boolean; - - /** To show total count of cards in each column. - * @Default {false} - */ - enableTotalCount?: boolean; - - /** Get or sets an object that indicates whether to customize the editing behavior of the Kanban. - * @Default {Object} - */ - editSettings?: EditSettings; - - /** To customize field mappings for card , editing title and control key parameters - * @Default {Object} - */ - fields?: Fields; - - /** To map datasource field for column values mapping - * @Default {null} - */ - keyField?: string; - - /** When set to true, adapts the Kanban layout to fit the screen size of devices on which it renders. - * @Default {false} - */ - isResponsive?: boolean; - - /** Gets or sets a value that indicates whether to set the minimum width of the responsive Kanban while isResponsive property is true. - * @Default {0} - */ - minWidth?: number; - - /** To customize the filtering behavior based on queries given. - * @Default {Array} - */ - filterSettings?: FilterSetting[]; - - /** ej Query to query database of Kanban. - * @Default {null} - */ - query?: any; - - /** To change the key in keyboard interaction to Kanban control. - * @Default {null} - */ - keySettings?: any; - - /** Gets or sets an object that indicates whether to customize the scrolling behavior of the Kanban. - * @Default {Object} - */ - scrollSettings?: ScrollSettings; - - /** To customize the searching behavior of the Kanban. - * @Default {Object} - */ - searchSettings?: SearchSettings; - - /** To allow customize selection type. Accepting types are "single" and "multiple". - * @Default {ej.Kanban.SelectionType.Single} - */ - selectionType?: ej.Kanban.SelectionType|string; - - /** Gets or sets an object that indicates to managing the collection of stacked header rows for the Kanban. - * @Default {Array} - */ - stackedHeaderRows?: StackedHeaderRow[]; - - /** The tooltip allows to display card details in a tooltip while hovering on it. - */ - tooltipSettings?: TooltipSettings; - - /** Gets or sets an object that indicates to render the Kanban with specified workflows. - * @Default {Array} - */ - workflows?: Workflow[]; - - /** Gets or sets a value that indicates whether to customizing the user interface (UI) as locale-specific in order to display regional data i.e. in a language and culture specific - * to a particular country or region. - * @Default {en-US} - */ - locale?: string; - - /** Triggered for every Kanban action before its starts. */ - actionBegin?(e: ActionBeginEventArgs): void; - - /** Triggered for every Kanban action success event. */ - actionComplete?(e: ActionCompleteEventArgs): void; - - /** Triggered for every Kanban action server failure event. */ - actionFailure?(e: ActionFailureEventArgs): void; - - /** Triggered before the task is going to be edited. */ - beginEdit?(e: BeginEditEventArgs): void; - - /** Triggered before the card is going to be added */ - beginAdd?(e: BeginAddEventArgs): void; - - /** Triggered before the card is selected. */ - beforeCardSelect?(e: BeforeCardSelectEventArgs): void; - - /** Trigger after the card is clicked. */ - cardClick?(e: CardClickEventArgs): void; - - /** Triggered when the card is being dragged. */ - cardDrag?(e: CardDragEventArgs): void; - - /** Triggered when card dragging start. */ - cardDragStart?(e: CardDragStartEventArgs): void; - - /** Triggered when card dragging stops. */ - cardDragStop?(e: CardDragStopEventArgs): void; - - /** Triggered when the card is Dropped. */ - cardDrop?(e: CardDropEventArgs): void; - - /** Triggered after the card is selected. */ - cardSelect?(e: CardSelectEventArgs): void; - - /** Triggered when card is double clicked. */ - cardDoubleClick?(e: CardDoubleClickEventArgs): void; - - /** Triggered before the card is selected. */ - cardSelecting?(e: CardSelectingEventArgs): void; - - /** Triggered when the Kanban is rendered completely */ - create?(e: CreateEventArgs): void; - - /** Triggers after the cell is clicked. */ - cellClick?(e: CellClickEventArgs): void; - - /** Triggered the Kanban is bound with data during initial rendering. */ - dataBound?(e: DataBoundEventArgs): void; - - /** Triggered when Kanban going to destroy. */ - destroy?(e: DestroyEventArgs): void; - - /** Triggered after the card is deleted. */ - endDelete?(e: EndDeleteEventArgs): void; - - /** Triggered after the card is edited. */ - endEdit?(e: EndEditEventArgs): void; - - /** Triggers after the header is clicked. */ - headerClick?(e: HeaderClickEventArgs): void; - - /** Triggered initial load. */ - load?(e: LoadEventArgs): void; - - /** Triggered when toolbar item is clicked in Kanban. */ - toolbarClick?(e: ToolbarClickEventArgs): void; - - /** Triggered every time a single card rendered request is made to access particular card information. */ - queryCellInfo?(e: QueryCellInfoEventArgs): void; - - /** Triggered before the context menu is opened. */ - contextOpen?(e: ContextOpenEventArgs): void; -} - -export interface ActionBeginEventArgs { - - /** Returns the Kanban model. - */ - model?: any; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the current action event type. - */ - originalEventType?: string; - - /** Returns primary key value. - */ - primaryKeyValue?: string; - - /** Returns request type. - */ - requestType?: string; - - /** Returns the edited row index. - */ - rowIndex?: number; - - /** Returns the card object (JSON). - */ - data?: any; - - /** Returns current filtering object field name. - */ - currentFilteringobject?: any; - - /** Returns filter details. - */ - filterCollection?: any; -} - -export interface ActionCompleteEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the Kanban model. - */ - model?: any; - - /** Returns request type. - */ - requestType?: string; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns current action event type. - */ - originalEventType?: string; - - /** Returns primary key. - */ - primaryKey?: string; - - /** Returns primary key value. - */ - primaryKeyValue?: string; - - /** Returns Kanban element. - */ - target?: any; - - /** Returns the card object (JSON). - */ - data?: any; - - /** Returns the selectedRow index. - */ - selectedRow?: number; - - /** Returns current filtering column field name. - */ - currentFilteringColumn?: string; - - /** Returns filter details. - */ - filterCollection?: any; -} - -export interface ActionFailureEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the Kanban model. - */ - model?: any; - - /** Returns request type. - */ - requestType?: string; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the error return by server. - */ - error?: any; - - /** Returns current action event type. - */ - originalEventType?: string; - - /** Returns primary key value. - */ - primaryKeyValue?: string; - - /** Returns Kanban element. - */ - target?: any; - - /** Returns the card object (JSON). - */ - data?: any; - - /** Returns current filtering column field name. - */ - currentFilteringColumn?: string; - - /** Returns filter details. - */ - filterCollection?: any; -} - -export interface BeginEditEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the Kanban model. - */ - model?: any; - - /** Returns primary key value. - */ - primaryKeyValue?: string; - - /** Returns begin edit data. - */ - data?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface BeginAddEventArgs { - - /** Returns the Kanban model. - */ - model?: any; - - /** Returns primary key value. - */ - primaryKeyValue?: string; - - /** Returns beginAdd data. - */ - data?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface BeforeCardSelectEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the select cell index value. - */ - cellIndex?: number; - - /** Returns the select card index value. - */ - cardIndex?: number; - - /** Returns the select cell element - */ - currentCell?: any; - - /** Returns the previously select the card element - */ - previousCard?: any; - - /** Returns the previously select card indexes - */ - previousRowcellindex?: any[]; - - /** Returns the Target item. - */ - Target?: any; - - /** Returns the Kanban model. - */ - model?: any; - - /** Returns select card data. - */ - data?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface CardClickEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns current record object (JSON). - */ - data?: any; - - /** Returns the current card to the Kanban. - */ - currentCard?: string; - - /** Returns Kanban element. - */ - target?: any; - - /** Returns the Kanban model. - */ - model?: any; - - /** Returns the Header text of the column corresponding to the selected card. - */ - columnName?: string; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface CardDragEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns drag data. - */ - data?: any; - - /** Returns drag start element. - */ - dragtarget?: any; - - /** Returns dragged element. - */ - draggedElement?: any; - - /** Returns the Kanban model. - */ - model?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface CardDragStartEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns card drag start data. - */ - data?: any; - - /** Returns dragged element. - */ - draggedElement?: any; - - /** Returns the Kanban model. - */ - model?: any; - - /** Returns drag start element. - */ - dragtarget?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface CardDragStopEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns dragged element. - */ - draggedElement?: any; - - /** Returns the Kanban model. - */ - model?: any; - - /** Returns drag stop element. - */ - droptarget?: any; - - /** Returns drag stop data. - */ - data?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface CardDropEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns dragged element. - */ - draggedElement?: any; - - /** Returns previous parent of dragged element - */ - draggedParent?: any; - - /** Returns dragged data. - */ - data?: any; - - /** Returns the Kanban model. - */ - model?: any; - - /** Returns drop element. - */ - target?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface CardSelectEventArgs { - - /** Returns the select cell index value. - */ - cellIndex?: number; - - /** Returns the select card index value. - */ - cardIndex?: number; - - /** Returns the select cell element - */ - currentCell?: any; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the previously select the card element - */ - previousCard?: any; - - /** Returns the previously select card indexes - */ - previousRowcellindex?: any[]; - - /** Returns the current item. - */ - currentTarget?: any; - - /** Returns the Kanban model. - */ - model?: any; - - /** Returns select card data. - */ - data?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface CardDoubleClickEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns current card object (JSON). - */ - data?: any; - - /** Returns the Kanban model. - */ - model?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface CardSelectingEventArgs { - - /** Returns the selecting cell index value. - */ - cellIndex?: number; - - /** Returns the selecting card index value. - */ - cardIndex?: number; - - /** Returns the selecting cell element - */ - currentCell?: any; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the previously selecting the card element - */ - previousCard?: any; - - /** Returns the previously rowcell is selecting card indexes - */ - previousRowcellindex?: any[]; - - /** Returns the current item. - */ - currentTarget?: any; - - /** Returns the Kanban model. - */ - model?: any; - - /** Returns added data. - */ - data?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface CreateEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the kanban model. - */ - model?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface CellClickEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the kanban model. - */ - model?: any; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the select cell index value. - */ - cellIndex?: number; - - /** Returns the edited row index. - */ - rowIndex?: number; -} - -export interface DataBoundEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the Kanban model. - */ - model?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface DestroyEventArgs { - - /** Returns the kanban model. - */ - model?: any; - - /** Returns deleted data. - */ - data?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface EndDeleteEventArgs { - - /** Returns the Kanban model. - */ - model?: any; - - /** Returns request type. - */ - requestType?: string; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns deleted data. - */ - data?: any; - - /** Returns the name of the event. - */ - type?: string; - - /** Current action name - */ - action?: string; -} - -export interface EndEditEventArgs { - - /** Returns the Kanban model. - */ - model?: any; - - /** Returns request type. - */ - requestType?: string; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns modified data. - */ - data?: any; - - /** Returns the name of the event. - */ - type?: string; - - /** Current Action name - */ - action?: string; -} - -export interface HeaderClickEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the kanban model. - */ - model?: any; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the select cell index value. - */ - cellIndex?: number; - - /** Returns the column object. - */ - columnData?: any; -} - -export interface LoadEventArgs { - - /** Returns the kanban model. - */ - model?: any; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface ToolbarClickEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the current item. - */ - currentTarget?: any; - - /** Returns the item id of that current element. - */ - itemId?: string; - - /** Returns the item index of that current element. - */ - itemIndex?: number; - - /** Returns the item name of that current element. - */ - itemName?: string; - - /** Returns the item text of that current element. - */ - itemText?: string; - - /** Returns the Kanban model. - */ - model?: any; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the toolbar object of the Kanban. - */ - toolbarData?: any; -} - -export interface QueryCellInfoEventArgs { - - /** Returns Kanban card. - */ - card?: any; - - /** Returns Kanban card. - */ - cell?: any; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns current row record object (JSON). - */ - data?: any; - - /** Returns the column object. - */ - column?: any; - - /** Returns the Kanban model. - */ - model?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface ContextOpenEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the Kanban model. - */ - model?: any; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the current item. - */ - currentTarget?: any; - - /** Returns the status of contextmenu item which denotes its enabled state. - */ - status?: boolean; - - /** Returns the target item. - */ - target?: any; -} - -export interface SwimlaneSettingsUnassignedGroup { - - /** To enable or disable unassigned category change with swim lane key values. - * @Default {true} - */ - enable?: boolean; - - /** To set the user defined values which are need to categorized as unassigned category swim lane groups. - * @Default {[null,undefined,]} - */ - keys?: any[]; -} - -export interface SwimlaneSettings { - - /** To enable or disable items count in swim lane. - * @Default {true} - */ - showCount?: boolean; - - /** To enable or disable DragAndDrop across swim lane. - * @Default {false} - */ - allowDragAndDrop?: boolean; - - /** Customize the settings for unassigned category of swim lane. - * @Default {Object} - */ - unassignedGroup?: SwimlaneSettingsUnassignedGroup; -} - -export interface ContextMenuSettingsCustomMenuItem { - - /** Its sets target element to custom context menu item. - * @Default {ej.Kanban.Target.All} - */ - target?: ej.Kanban.Target|string; - - /** Gets the display name to custom menu item. - * @Default {null} - */ - text?: string; - - /** Gets the template to render custom context menu item. - * @Default {null} - */ - template?: string; -} - -export interface ContextMenuSettings { - - /** To enable context menu.All default context menu will show. - * @Default {false} - */ - enable?: boolean; - - /** Gets or sets a value that indicates the list of items needs to be disable from default context menu items. - * @Default {Array} - */ - disableDefaultItems?: any[]; - - /** Its used to add specific default context menu items. - * @Default {Array} - */ - menuItems?: any[]; - - /** Gets or sets a value that indicates whether to add custom contextMenu items. - * @Default {Array} - */ - customMenuItems?: ContextMenuSettingsCustomMenuItem[]; -} - -export interface ColumnsConstraints { - - /** It is used to specify the type of constraints as column or swimlane. - * @Default {null} - */ - type?: string; - - /** It is used to specify the minimum amount of card in particular column cell or swimlane cell can hold. - * @Default {null} - */ - min?: number; - - /** It is used to specify the maximum amount of card in particular column cell or swimlane cell can hold. - * @Default {null} - */ - max?: number; -} - -export interface Column { - - /** Gets or sets an object that indicates to render the Kanban with specified columns header text. - * @Default {null} - */ - headerText?: string; - - /** To customize the totalCount properties. - * @Default {false} - */ - totalCount?: string; - - /** Gets or sets an object that indicates to render the Kanban with specified columns key. - * @Default {null} - */ - key?: string|number; - - /** To enable/disable allowDrop for specific column wise. - * @Default {true} - */ - allowDrop?: boolean; - - /** To enable/disable allowDrag for specific column wise. - * @Default {true} - */ - allowDrag?: boolean; - - /** To set column collapse or expand state - * @Default {false} - */ - isCollapsed?: boolean; - - /** To customize the column level constraints with minimum ,maximum limit validation. - * @Default {Object} - */ - constraints?: ColumnsConstraints; - - /** Gets or sets a value that indicates to add the template within the header element. - * @Default {null} - */ - headerTemplate?: string; - - /** Gets or sets an object that indicates to render the Kanban with specified columns width. - * @Default {null} - */ - width?: string|number; - - /** Gets or sets an object that indicates to set specific column visibility. - * @Default {true} - */ - visible?: boolean; - - /** Gets or sets an object that indicates whether to show add new button. - * @Default {false} - */ - showAddButton?: boolean; -} - -export interface CardSettings { - - /** Gets or sets a value that indicates to add the template for card . - * @Default {null} - */ - template?: string; - - /** To customize the card border color based on assigned task. Colors and corresponding values defined here will be mapped with colorField mapped data source column. - * @Default {Object} - */ - colorMapping?: any; -} - -export interface CustomToolbarItem { - - /** Gets the template to render customToolbarItems. - * @Default {null} - */ - template?: string; -} - -export interface EditSettingsEditItem { - - /** It is used to map editing field from the data source. - * @Default {null} - */ - field?: string; - - /** It is used to set the particular editType in the card for editing. - * @Default {ej.Kanban.EditingType.String} - */ - editType?: ej.Kanban.EditingType|string; - - /** Gets or sets a value that indicates to define constraints for saving data to the database. - * @Default {Object} - */ - validationRules?: any; - - /** It is used to set the particular editparams in the card for editing. - * @Default {Object} - */ - editParams?: any; - - /** It is used to specify defaultValue for the fields while adding new card. - * @Default {null} - */ - defaultValue?: string|number; -} - -export interface EditSettings { - - /** Gets or sets a value that indicates whether to enable the editing action in cards of Kanban. - * @Default {false} - */ - allowEditing?: boolean; - - /** Gets or sets a value that indicates whether to enable the adding action in cards behavior on Kanban. - * @Default {false} - */ - allowAdding?: boolean; - - /** This specifies the id of the template which is require to be edited using the Dialog Box. - * @Default {null} - */ - dialogTemplate?: string; - - /** Get or sets an object that indicates whether to customize the editMode of the Kanban. - * @Default {ej.Kanban.EditMode.Dialog} - */ - editMode?: ej.Kanban.EditMode|string; - - /** Get or sets an object that indicates whether to customize the editing fields of Kanban card. - * @Default {Array} - */ - editItems?: EditSettingsEditItem[]; - - /** This specifies the id of the template which is require to be edited using the External edit form. - * @Default {null} - */ - externalFormTemplate?: string; - - /** This specifies to set the position of an External edit form either in the right or bottom of the Kanban. - * @Default {ej.Kanban.FormPosition.Bottom} - */ - formPosition?: ej.Kanban.FormPosition|string; -} - -export interface Fields { - - /** The primarykey field is mapped to data source field. And this will used for Drag and drop and editing mainly. - * @Default {null} - */ - primaryKey?: string; - - /** To enable swimlane grouping based on the given key field from datasource mapping. - * @Default {null} - */ - swimlaneKey?: string; - - /** Priority field has been mapped data source field to maintain cards priority. - * @Default {null} - */ - priority?: string; - - /** Content field has been Mapped into card text. - * @Default {null} - */ - content?: string; - - /** Tag field has been Mapped into card tag. - * @Default {null} - */ - tag?: string; - - /** Title field has been Mapped to field in datasource for title content. If title field specified , card expand/collapse will be enabled with header and content section. - * @Default {null} - */ - title?: string; - - /** To customize the card has been Mapped into card color field. - * @Default {null} - */ - color?: string; - - /** ImageUrl field has been Mapped into card image. - * @Default {null} - */ - imageUrl?: string; -} - -export interface FilterSetting { - - /** Gets or sets an object of display name to filter queries. - * @Default {null} - */ - text?: string; - - /** Gets or sets an object that Queries to perform filtering - * @Default {Object} - */ - query?: any; - - /** Gets or sets an object of tooltip to filter buttons. - * @Default {null} - */ - description?: string; -} - -export interface ScrollSettings { - - /** Gets or sets an object that indicates to render the Kanban with specified scroll height. - * @Default {0} - */ - height?: string|number; - - /** Gets or sets an object that indicates to render the Kanban with specified scroll width. - * @Default {auto} - */ - width?: string|number; - - /** To allow the Kanban to freeze particular swimlane at the time of scrolling , until scroll reaches next swimlane and it continues. - * @Default {false} - */ - allowFreezeSwimlane?: boolean; -} - -export interface SearchSettings { - - /** To customize the fields the searching operation can be perform. - * @Default {Array} - */ - fields?: any[]; - - /** To customize the searching string. - */ - key?: string; - - /** To customize the operator based on searching. - * @Default {contains} - */ - operator?: string; - - /** To customize the ignore case based on searching. - * @Default {true} - */ - ignoreCase?: boolean; -} - -export interface StackedHeaderRowsStackedHeaderColumn { - - /** Gets or sets a value that indicates the headerText for the particular stacked header column. - * @Default {null} - */ - headerText?: string; - - /** Gets or sets a value that indicates the column for the particular stacked header column. - * @Default {null} - */ - column?: string; -} - -export interface StackedHeaderRow { - - /** Gets or sets a value that indicates whether to add stacked header columns into the stacked header rows. - * @Default {Array} - */ - stackedHeaderColumns?: StackedHeaderRowsStackedHeaderColumn[]; -} - -export interface TooltipSettings { - - /** To enable or disable the tooltip display. - * @Default {false} - */ - enable?: boolean; - - /** To customize the tooltip display based on your requirements. - * @Default {null} - */ - template?: string; -} - -export interface Workflow { - - /** Gets or sets an object that indicates to render the Kanban with specified workflows key. - * @Default {null} - */ - key?: string|number; - - /** Gets or sets an object that indicates to render the Kanban with specified workflows allowed Transitions. - * @Default {null} - */ - allowedTransitions?: string; -} - -enum Target { - - ///Sets context menu to Kanban header - Header, - - ///Sets context menu to Kanban content - Content, - - ///Sets context menu to Kanban card - Card, - - ///Sets context menu to Kanban - All -} - - -enum EditMode { - - ///Creates Kanban with editMode as Dialog - Dialog, - - ///Creates Kanban with editMode as DialogTemplate - DialogTemplate, - - ///Creates Kanban with editMode as ExternalForm - ExternalForm, - - ///Creates Kanban with editMode as ExternalFormTemplate - ExternalFormTemplate -} - - -enum EditingType { - - ///Allows to set edit type as string edit type - String, - - ///Allows to set edit type as numeric edit type - Numeric, - - ///Allows to set edit type as drop down edit type - Dropdown, - - ///Allows to set edit type as date picker edit type - DatePicker, - - ///Allows to set edit type as date time picker edit type - DateTimePicker, - - ///Allows to set edit type as text area edit type - TextArea, - - ///Allows to set edit type as RTE edit type - RTE -} - - -enum FormPosition { - - ///Form position is bottom. - Bottom, - - ///Form position is right. - Right -} - - -enum SelectionType { - - ///Support for Single selection in Kanban - Single, - - ///Support for multiple selections in Kanban - Multiple -} - -} - -class Rotator extends ej.Widget { - static fn: Rotator; - constructor(element: JQuery | Element, options?: Rotator.Model); - static Locale: any; - model: Rotator.Model; - defaults: Rotator.Model; - - /** Disables the Rotator control. - * @returns {void} - */ - disable(): void; - - /** Enables the Rotator control. - * @returns {void} - */ - enable(): void; - - /** This method is used to get the current slide index. - * @returns {number} - */ - getIndex(): number; - - /** This method is used to move a slide to the specified index. - * @param {number} index of an slide - * @returns {void} - */ - gotoIndex(index: number): void; - - /** This method is used to pause autoplay. - * @returns {void} - */ - pause(): void; - - /** This method is used to move slides continuously (or start autoplay) in the specified autoplay direction. - * @returns {void} - */ - play(): void; - - /** This method is used to move to the next slide from the current slide. If the current slide is the last slide, then the first slide will be treated as the next slide. - * @returns {void} - */ - slideNext(): void; - - /** This method is used to move to the previous slide from the current slide. If the current slide is the first slide, then the last slide will be treated as the previous slide. - * @returns {void} - */ - slidePrevious(): void; - - /** This method is used to update/modify the slide content of template rotator by using id based on index value. - * @param {number} index of an slide - * @param {string} id of a new updated slide - * @returns {void} - */ - updateTemplateById(index: number, id: string): void; -} -export namespace Rotator { - -export interface Model { - - /** Turns on keyboard interaction with the Rotator items. You must set this property to true to access the following keyboard shortcuts: - * @Default {true} - */ - allowKeyboardNavigation?: boolean; - - /** Sets the animationSpeed of slide transition. - * @Default {600} - */ - animationSpeed?: string|number; - - /** Specifies the animationType type for the Rotator Item. animationType options include slide, fastSlide, slowSlide, and other custom easing animationTypes. - * @Default {slide} - */ - animationType?: string; - - /** Enables the circular mode item rotation. - * @Default {true} - */ - circularMode?: boolean; - - /** Specify the CSS class to Rotator to achieve custom theme. - */ - cssClass?: string; - - /** Specify the list of data which contains a set of data fields. Each data value is used to render an item for the Rotator. - * @Default {null} - */ - dataSource?: any; - - /** Sets the delay between the Rotator Items move after the slide transition. - * @Default {500} - */ - delay?: number; - - /** Specifies the number of Rotator Items to be displayed. - * @Default {1} - */ - displayItemsCount?: string|number; - - /** Rotates the Rotator Items continuously without user interference. - * @Default {false} - */ - enableAutoPlay?: boolean; - - /** Enables or disables the Rotator control. - * @Default {true} - */ - enabled?: boolean; - - /** Specifies right to left transition of slides. - * @Default {false} - */ - enableRTL?: boolean; - - /** Defines mapping fields for the data items of the Rotator. - * @Default {null} - */ - fields?: Fields; - - /** Sets the space between the Rotator Items. - */ - frameSpace?: string|number; - - /** Resizes the Rotator when the browser is resized. - * @Default {false} - */ - isResponsive?: boolean; - - /** Specifies the number of Rotator Items to navigate on a single click (next/previous/play buttons). - * The navigateSteps property value must be less than or equal to the displayItemsCount property value. - * @Default {1} - */ - navigateSteps?: string|number; - - /** Specifies the orientation for the Rotator control, that is, whether it must be rendered horizontally or vertically. See Orientation - * @Default {ej.Orientation.Horizontal} - */ - orientation?: ej.Orientation|string; - - /** Specifies the position of the showPager in the Rotator Item. See PagerPosition - * @Default {outside} - */ - pagerPosition?: string|ej.Rotator.PagerPosition; - - /** Retrieves data from remote data. This property is applicable only when a remote data source is used. - * @Default {null} - */ - query?: string; - - /** If the Rotator Item is an image, you can specify a caption for the Rotator Item. The caption text for each Rotator Item must be set by using the title attribute of the respective tag. - * The caption cannot be displayed if multiple Rotator Items are present. - * @Default {false} - */ - showCaption?: boolean; - - /** Turns on or off the slide buttons (next and previous) in the Rotator Items. Slide buttons are used to navigate the Rotator Items. - * @Default {true} - */ - showNavigateButton?: boolean; - - /** Turns on or off the pager support in the Rotator control. The Pager is used to navigate the Rotator Items. - * @Default {true} - */ - showPager?: boolean; - - /** Enable play / pause button on rotator. - * @Default {false} - */ - showPlayButton?: boolean; - - /** Turns on or off thumbnail support in the Rotator control. Thumbnail is used to navigate between slides. Thumbnail supports only single slide transition - * You must specify the source for thumbnail elements through the thumbnailSourceID property. - * @Default {false} - */ - showThumbnail?: boolean; - - /** Sets the height of a Rotator Item. - */ - slideHeight?: string|number; - - /** Sets the width of a Rotator Item. - */ - slideWidth?: string|number; - - /** Sets the index of the slide that must be displayed first. - * @Default {0} - */ - startIndex?: string|number; - - /** Pause the auto play while hover on the rotator content. - * @Default {false} - */ - stopOnHover?: boolean; - - /** The template to display the Rotator widget with customized appearance. - * @Default {null} - */ - template?: string; - - /** The templateId enables to bind multiple customized template items in Rotator. - * @Default {null} - */ - templateId?: any[]; - - /** Specifies the source for thumbnail elements. - * @Default {null} - */ - thumbnailSourceID?: any; - - /** This event is fired when the Rotator slides are changed. */ - change?(e: ChangeEventArgs): void; - - /** This event is fired when the Rotator control is initialized. */ - create?(e: CreateEventArgs): void; - - /** This event is fired when the Rotator control is destroyed. */ - destroy?(e: DestroyEventArgs): void; - - /** This event is fired when a pager is clicked. */ - pagerClick?(e: PagerClickEventArgs): void; - - /** This event is fired when enableAutoPlay is started. */ - start?(e: StartEventArgs): void; - - /** This event is fired when autoplay is stopped or paused. */ - stop?(e: StopEventArgs): void; - - /** This event is fired when a thumbnail pager is clicked. */ - thumbItemClick?(e: ThumbItemClickEventArgs): void; -} - -export interface ChangeEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the rotator model - */ - model?: ej.Rotator.Model; - - /** returns the name of the event - */ - type?: string; - - /** the current rotator id. - */ - itemId?: string; - - /** returns the current slide index. - */ - activeItemIndex?: number; -} - -export interface CreateEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the rotator model - */ - model?: ej.Rotator.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface DestroyEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the rotator model - */ - model?: ej.Rotator.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface PagerClickEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the rotator model - */ - model?: ej.Rotator.Model; - - /** returns the name of the event - */ - type?: string; - - /** the current rotator id. - */ - itemId?: string; - - /** returns the current slide index. - */ - activeItemIndex?: number; -} - -export interface StartEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the rotator model - */ - model?: ej.Rotator.Model; - - /** returns the name of the event - */ - type?: string; - - /** the current rotator id. - */ - itemId?: string; - - /** returns the current slide index. - */ - activeItemIndex?: number; -} - -export interface StopEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the rotator model - */ - model?: ej.Rotator.Model; - - /** returns the name of the event - */ - type?: string; - - /** the current rotator id. - */ - itemId?: string; - - /** returns the current slide index. - */ - activeItemIndex?: number; -} - -export interface ThumbItemClickEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the rotator model - */ - model?: ej.Rotator.Model; - - /** returns the name of the event - */ - type?: string; - - /** the current rotator id. - */ - itemId?: string; - - /** returns the current slide index. - */ - activeItemIndex?: number; -} - -export interface Fields { - - /** Specifies a link for the image. - */ - linkAttribute?: string; - - /** Specifies where to open a given link. - */ - targetAttribute?: string; - - /** Specifies a caption for the image. - */ - text?: string; - - /** Specifies a caption for the thumbnail image. - */ - thumbnailText?: string; - - /** Specifies the URL for an thumbnail image. - */ - thumbnailUrl?: string; - - /** Specifies the URL for an image. - */ - url?: string; -} - -enum PagerPosition { - - ///string - BottomLeft, - - ///string - BottomRight, - - ///string - Outside, - - ///string - TopCenter, - - ///string - TopLeft, - - ///string - TopRight -} - -} - -class RTE extends ej.Widget { - static fn: RTE; - constructor(element: JQuery | Element, options?: RTE.Model); - static Locale: any; - model: RTE.Model; - defaults: RTE.Model; - - /** Returns the range object. - * @returns {any} - */ - createRange(): any; - - /** Disables the RTE control. - * @returns {void} - */ - disable(): void; - - /** Disables the corresponding tool in the RTE ToolBar. - * @returns {void} - */ - disableToolbarItem(): void; - - /** Enables the RTE control. - * @returns {void} - */ - enable(): void; - - /** Enables the corresponding tool in the toolbar when the tool is disabled. - * @returns {void} - */ - enableToolbarItem(): void; - - /** Performs the action value based on the given command. - * @returns {void} - */ - executeCommand(): void; - - /** Focuses the RTE control. - * @returns {void} - */ - focus(): void; - - /** Gets the command status of the selected text based on the given comment in the RTE control. - * @returns {boolean} - */ - getCommandStatus(): boolean; - - /** Gets the Document from the RTE control. - * @returns {Document} - */ - getDocument(): Document; - - /** Gets the HTML string from the RTE control. - * @returns {HTMLElement} - */ - getHtml(): HTMLElement; - - /** Gets the selected HTML string from the RTE control. - * @returns {HTMLElement} - */ - getSelectedHtml(): HTMLElement; - - /** Gets the content as string from the RTE control. - * @returns {string} - */ - getText(): string; - - /** Hides the RTE control. - * @returns {void} - */ - hide(): void; - - /** Inserts new item to the target contextmenu node. - * @returns {void} - */ - insertMenuOption(): void; - - /** Add a table column at the right or left of the specified cell - * @param {boolean} If it’s true, add a column at the left of the cell, otherwise add a column at the right of the cell - * @param {JQuery} Column will be added based on the given cell element - * @returns {HTMLElement} - */ - insertColumn(before?: boolean, cell?: JQuery): HTMLElement; - - /** To add a table row below or above the specified cell. - * @param {boolean} If it’s true, add a row before the cell, otherwise add a row after the cell - * @param {JQuery} Row will be added based on the given cell element - * @returns {HTMLElement} - */ - insertRow(before?: boolean, cell?: JQuery): HTMLElement; - - /** This method helps to insert/paste the content at the current cursor (caret) position or the selected content to be replaced with our text by passing the value as parameter to the - * pasteContent method in the Editor. - * @returns {void} - */ - pasteContent(): void; - - /** Refreshes the RTE control. - * @returns {void} - */ - refresh(): void; - - /** Removes the specified table column. - * @param {JQuery} Remove the given column element - * @returns {void} - */ - removeColumn(cell?: JQuery): void; - - /** Removes the specified table row. - * @param {JQuery} Remove the given row element - * @returns {void} - */ - removeRow(cell?: JQuery): void; - - /** Deletes the specified table. - * @param {JQuery} Remove the given table - * @returns {void} - */ - removeTable(table?: JQuery): void; - - /** Removes the target menu item from the RTE contextmenu. - * @returns {void} - */ - removeMenuOption(): void; - - /** Removes the given tool from the RTE Toolbar. - * @returns {void} - */ - removeToolbarItem(): void; - - /** Selects all the contents within the RTE. - * @returns {void} - */ - selectAll(): void; - - /** Selects the contents in the given range. - * @returns {void} - */ - selectRange(): void; - - /** Sets the color picker model type rendered initially in the RTE control. - * @returns {void} - */ - setColorPickerType(): void; - - /** Sets the HTML string from the RTE control. - * @returns {void} - */ - setHtml(): void; - - /** Displays the RTE control. - * @returns {void} - */ - show(): void; -} -export namespace RTE { - -export interface Model { - - /** Enables/disables the editing of the content. - * @Default {True} - */ - allowEditing?: boolean; - - /** RTE control can be accessed through the keyboard shortcut keys. - * @Default {True} - */ - allowKeyboardNavigation?: boolean; - - /** When the property is set to true, it focuses the RTE at the time of rendering. - * @Default {false} - */ - autoFocus?: boolean; - - /** Based on the content size, its height is adjusted instead of adding the scrollbar. - * @Default {false} - */ - autoHeight?: boolean; - - /** Sets the colorCode to display the color of the fontColor and backgroundColor in the font tools of the RTE. - * @Default {[000000, FFFFFF, C4C4C4, ADADAD, 595959, 262626, 4f81bd, dbe5f1, b8cce4, 95b3d7, 366092, 244061, c0504d, f2dcdb, e5b9b7, d99694, 953734,632423, 9bbb59, - ebf1dd, d7e3bc, c3d69b, 76923c, 4f6128, 8064a2, e5e0ec, ccc1d9, b2a2c7, 5f497a, 3f3151, f79646, fdeada, fbd5b5, fac08f,e36c09, 974806]} - */ - colorCode?: any; - - /** The number of columns given are rendered in the color palate popup. - * @Default {6} - */ - colorPaletteColumns?: number; - - /** The number of rows given are rendered in the color palate popup. - * @Default {6} - */ - colorPaletteRows?: number; - - /** Sets the root class for the RTE theme. This cssClass API helps the usage of custom skinning option for the RTE control by including this root class in CSS. - */ - cssClass?: string; - - /** Enables/disables the RTE control’s accessibility or interaction. - * @Default {True} - */ - enabled?: boolean; - - /** When the property is set to true, it returns the encrypted text. - * @Default {false} - */ - enableHtmlEncode?: boolean; - - /** Maintain the values of the RTE after page reload. - * @Default {false} - */ - enablePersistence?: boolean; - - /** Shows the resize icon and enables the resize option in the RTE. - * @Default {True} - */ - enableResize?: boolean; - - /** Shows the RTE in the RTL direction. - * @Default {false} - */ - enableRTL?: boolean; - - /** Formats the contents based on the XHTML rules. - * @Default {false} - */ - enableXHTML?: boolean; - - /** Enables the tab key action with the RichTextEditor content. - * @Default {True} - */ - enableTabKeyNavigation?: boolean; - - /** This API allows to enable url and fileName for pdf export. - * @Default {null} - */ - exportToPdfSettings?: ExportToPdfSettings; - - /** This API allows to enable url and fileName for word export. - * @Default {null} - */ - exportToWordSettings?: ExportToWordSettings; - - /** Load the external CSS file inside Iframe. - * @Default {null} - */ - externalCSS?: string; - - /** This API allows to enable the file browser support in the RTE control to browse, create, delete and upload the files in the specified current directory. - * @Default {null} - */ - fileBrowser?: FileBrowser; - - /** Sets the fontName in the RTE. - * @Default {{text: Segoe UI, value: Segoe UI },{text: Arial, value: Arial,Helvetica,sans-serif },{text: Courier New, value: Courier New,Courier,Monospace }, - * {text: Georgia, value: Georgia,serif },{text: Impact, value: Impact,Charcoal,sans-serif },{text: Lucida Console, value: Lucida Console,Monaco,Monospace }, - * {text: Tahoma, value: Tahoma,Geneva,sans-serif },{text: Times New Roman, value: Times New Roman },{text: Trebuchet MS, value: Trebuchet MS,Helvetica,sans-serif }, - * {text: Verdana, value: Verdana,Geneva,sans-serif}} - */ - fontName?: any; - - /** Sets the fontSize in the RTE. - * @Default {{ text: 1, value: 1 },{ text: 2 (10pt), value: 2 },{ text: 3 (12pt), value: 3 },{ text: 4 (14pt), value: 4 },{ text: 5 (18pt), value: 5 }, - * { text: 6 (24pt), value: 6 },{ text: 7 (36pt), value: 7 }} - */ - fontSize?: any; - - /** Sets the format in the RTE. - * @Default {{ text: Paragraph, value: <p>, spriteCssClass: e-paragraph },{ text: Quotation, value: <blockquote>, spriteCssClass: e-quotation }, - * { text: Heading 1, value: <h1>, spriteCssClass: e-h1 },{ text: Heading 2, value: <h2>, spriteCssClass: e-h2 },{ text: Heading 3, value: <h3>, spriteCssClass: e-h3 }, - * { text: Heading 4, value: <h4>, spriteCssClass: e-h4 },{ text: Heading 5, value: <h5>, spriteCssClass: e-h5 },{ text: Heading 6, value: <h6>, spriteCssClass: e-h6}} - */ - format?: string; - - /** Defines the height of the RTE textbox. - * @Default {370} - */ - height?: string|number; - - /** Specifies the HTML Attributes of the ejRTE. - * @Default {{}} - */ - htmlAttributes?: any; - - /** Sets the given attributes to the iframe body element. - * @Default {{}} - */ - iframeAttributes?: any; - - /** This API allows the image browser to support in the RTE control to browse, create, delete, and upload the image files to the specified current directory. - * @Default {null} - */ - imageBrowser?: ImageBrowser; - - /** This API allows to enable the url for connecting to RTE import. - * @Default {null} - */ - importSettings?: ImportSettings; - - /** Enables/disables responsive support for the RTE control toolbar items during the window resizing time. - * @Default {false} - */ - isResponsive?: boolean; - - /** Sets the culture in the RTE when you set the localization values are needs to be assigned to the corresponding text as follows. - * @Default {en-US} - */ - locale?: string; - - /** Sets the maximum height for the RTE outer wrapper element. - * @Default {null} - */ - maxHeight?: string|number; - - /** Sets the maximum length for the RTE outer wrapper element. - * @Default {7000} - */ - maxLength?: number; - - /** Sets the maximum width for the RTE outer wrapper element. - * @Default {null} - */ - maxWidth?: string|number; - - /** Sets the minimum height for the RTE outer wrapper element. - * @Default {280} - */ - minHeight?: string|number; - - /** Sets the minimum width for the RTE outer wrapper element. - * @Default {400} - */ - minWidth?: string|number; - - /** Sets the name in the RTE. When the name value is not initialized, the ID value is assigned to the name. - */ - name?: string; - - /** Shows ClearAll icon in the RTE footer. - * @Default {false} - */ - showClearAll?: boolean; - - /** Shows the clear format in the RTE footer. - * @Default {true} - */ - showClearFormat?: boolean; - - /** Shows the Custom Table in the RTE. - * @Default {True} - */ - showCustomTable?: boolean; - - /** The showContextMenu property helps to enable custom context menu within editor area. - * @Default {True} - */ - showContextMenu?: boolean; - - /** This API is used to set the default dimensions for the image and video. When this property is set to true, the image and video dialog displays the dimension option. - * @Default {false} - */ - showDimensions?: boolean; - - /** Shows the FontOption in the RTE. - * @Default {True} - */ - showFontOption?: boolean; - - /** Shows footer in the RTE. When the footer is enabled, it displays the HTML tag, word Count, character count, clear format, resize icon and clear all the content icons, by default. - * @Default {false} - */ - showFooter?: boolean; - - /** Shows the HtmlSource in the RTE footer. - * @Default {false} - */ - showHtmlSource?: boolean; - - /** When the cursor is placed or when the text is selected in the RTE, it displays the tag info in the footer. - * @Default {True} - */ - showHtmlTagInfo?: boolean; - - /** Shows the toolbar in the RTE. - * @Default {True} - */ - showToolbar?: boolean; - - /** Counts the total characters and displays it in the RTE footer. - * @Default {True} - */ - showCharCount?: boolean; - - /** Enables or disables rounded corner UI look for RTE. - * @Default {false} - */ - showRoundedCorner?: boolean; - - /** Counts the total words and displays it in the RTE footer. - * @Default {True} - */ - showWordCount?: boolean; - - /** The given number of columns render the insert table pop. - * @Default {10} - */ - tableColumns?: number; - - /** The given number of rows render the insert table pop. - * @Default {8} - */ - tableRows?: number; - - /** Sets the tools in the RTE and gets the inner display order of the corresponding group element. Tools are dependent on the toolsList property. - * @Default {formatStyle: [format],style: [bold, italic, underline, strikethrough],alignment: [justifyLeft, justifyCenter, justifyRight, justifyFull],lists: [unorderedList, orderedList], - * indenting: [outdent, indent],doAction: [undo, redo],links: [createLink,removeLink],images: [image],media: [video],tables: [createTable, addRowAbove, addRowBelow, - * addColumnLeft, addColumnRight, deleteRow, deleteColumn, deleteTable]],view:[“fullScreen”,zoomIn,zoomOut],print:[print]} - */ - tools?: Tools; - - /** Specifies the list of groups and order of those groups displayed in the RTE toolbar. The toolsList property is used to get the root group order and tools property is used to get the - * inner order of the corresponding groups displayed. When the value is not specified, it gets its default display order and tools. - * @Default {[formatStyle, font, style, effects, alignment, lists, indenting, clipboard, doAction, clear, links, images, media, tables, casing,view, customTools,print,edit]} - */ - toolsList?: any[]; - - /** Display the hints for the tools in the Toolbar. - * @Default {{ associate: mouseenter, showShadow: true, position: { stem: { horizontal: left, vertical: top } }, tip: { size: { width: 5, height: 5 }, isBalloon: false }} - */ - tooltipSettings?: any; - - /** Gets the undo stack limit. - * @Default {50} - */ - undoStackLimit?: number; - - /** The given string value is displayed in the editable area. - * @Default {null} - */ - value?: string; - - /** Sets the jQuery validation rules to the Rich Text Editor. - * @Default {null} - */ - validationRules?: any; - - /** Sets the jQuery validation error message to the Rich Text Editor. - * @Default {null} - */ - validationMessage?: any; - - /** Defines the width of the RTE textbox. - * @Default {786} - */ - width?: string|number; - - /** Increases and decreases the contents zoom range in percentage - * @Default {0.05} - */ - zoomStep?: string|number; - - /** Fires when changed successfully. */ - change?(e: ChangeEventArgs): void; - - /** Fires when the RTE is created successfully */ - create?(e: CreateEventArgs): void; - - /** Fires when mouse click on menu items. */ - contextMenuClick?(e: ContextMenuClickEventArgs): void; - - /** Fires before the RTE is destroyed. */ - destroy?(e: DestroyEventArgs): void; - - /** Fires when the commands are executed successfully. */ - execute?(e: ExecuteEventArgs): void; - - /** Fires when the keydown action is successful. */ - keydown?(e: KeydownEventArgs): void; - - /** Fires when the keyup action is successful. */ - keyup?(e: KeyupEventArgs): void; - - /** Fires before the RTE Edit area is rendered and after the toolbar is rendered. */ - preRender?(e: PreRenderEventArgs): void; - - /** Fires when the text is selected in the text area */ - select?(e: SelectEventArgs): void; -} - -export interface ChangeEventArgs { - - /** When the event is canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the RTE model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; -} - -export interface CreateEventArgs { - - /** When the event is canceled; otherwise, false. - */ - cancel?: boolean; - - /** Returns the RTE model - */ - model?: any; - - /** Returns the name of the event - */ - type?: string; -} - -export interface ContextMenuClickEventArgs { - - /** returns clicked menu item text. - */ - text?: string; - - /** returns clicked menu item element. - */ - element?: any; - - /** returns the selected item. - */ - selectedItem?: number; -} - -export interface DestroyEventArgs { - - /** When the event is canceled; otherwise, false. - */ - cancel?: boolean; - - /** Returns the RTE model - */ - model?: any; - - /** Returns the name of the event - */ - type?: string; -} - -export interface ExecuteEventArgs { - - /** When the event is canceled; otherwise, false. - */ - cancel?: boolean; - - /** Returns the RTE model - */ - model?: any; - - /** Returns the name of the event - */ - type?: string; -} - -export interface KeydownEventArgs { - - /** When the event is canceled; otherwise, false. - */ - cancel?: boolean; - - /** Returns the RTE model - */ - model?: any; - - /** Returns the name of the event - */ - type?: string; -} - -export interface KeyupEventArgs { - - /** When the event is canceled; otherwise, false. - */ - cancel?: boolean; - - /** Returns the RTE model - */ - model?: any; - - /** Returns the name of the event - */ - type?: string; -} - -export interface PreRenderEventArgs { - - /** When the event is canceled; otherwise, false. - */ - cancel?: boolean; - - /** Returns the RTE model - */ - model?: any; - - /** Returns the name of the event - */ - type?: string; -} - -export interface SelectEventArgs { - - /** When the event is canceled; otherwise, false. - */ - cancel?: boolean; - - /** Returns the RTE model - */ - model?: any; - - /** Returns the name of the event - */ - type?: string; - - /** Returns the event object - */ - event?: any; -} - -export interface ExportToPdfSettings { - - /** This API is used to receive the server-side handler for export related operations. - */ - url?: string; - - /** Specifies the file name for the exported pdf file. - */ - fileName?: string; -} - -export interface ExportToWordSettings { - - /** This API is used to receive the server-side handler for export related operations. - */ - url?: string; - - /** Specifies the file name for the exported word file. - */ - fileName?: string; -} - -export interface FileBrowser { - - /** This API is used to receive the server-side handler for file related operations. - */ - ajaxAction?: string; - - /** Specifies the file type extension shown in the file browser window. - */ - extensionAllow?: string; - - /** Specifies the directory to perform operations like create, delete and rename folder and files, and upload the selected files to the current directory. - */ - filePath?: string; -} - -export interface ImageBrowser { - - /** This API is used to receive the server-side handler for the file related operations. - */ - ajaxAction?: string; - - /** Specifies the file type extension shown in the image browser window. - */ - extensionAllow?: string; - - /** Specifies the directory to perform operations like create, delete and rename folder and files, and upload the selected images to the current directory. - */ - filePath?: string; -} - -export interface ImportSettings { - - /** This API is used to receive the server-side handler for import operations. - */ - url?: string; -} - -export interface ToolsCustomOrderedList { - - /** Specifies the name for customOrderedList item. - */ - name?: string; - - /** Specifies the title for customOrderedList item. - */ - tooltip?: string; - - /** Specifies the styles for customOrderedList item. - */ - css?: string; - - /** Specifies the text for customOrderedList item. - */ - text?: string; - - /** Specifies the list style for customOrderedList item. - */ - listStyle?: string; - - /** Specifies the image for customOrderedList item. - */ - listImage?: string; -} - -export interface ToolsCustomUnorderedList { - - /** Specifies the name for customUnorderedList item. - */ - name?: string; - - /** Specifies the title for customUnorderedList item. - */ - tooltip?: string; - - /** Specifies the styles for customUnorderedList item. - */ - css?: string; - - /** Specifies the text for customUnorderedList item. - */ - text?: string; - - /** Specifies the list style for customUnorderedList item. - */ - listStyle?: string; - - /** Specifies the image for customUnorderedList item. - */ - listImage?: string; -} - -export interface Tools { - - /** Specifies the alignment tools and the display order of this tool in the RTE toolbar. - */ - alignment?: any; - - /** Specifies the casing tools and the display order of this tool in the RTE toolbar. - */ - casing?: any[]; - - /** Specifies the clear tools and the display order of this tool in the RTE toolbar. - */ - clear?: any[]; - - /** Specifies the clipboard tools and the display order of this tool in the RTE toolbar. - */ - clipboard?: any[]; - - /** Specifies the edit tools and the displays tool in the RTE toolbar. - */ - edit?: any[]; - - /** Specifies the doAction tools and the display order of this tool in the RTE toolbar. - */ - doAction?: any[]; - - /** Specifies the effect of tools and the display order of this tool in RTE toolbar. - */ - effects?: any[]; - - /** Specifies the font tools and the display order of this tool in the RTE toolbar. - */ - font?: any[]; - - /** Specifies the formatStyle tools and the display order of this tool in the RTE toolbar. - */ - formatStyle?: any[]; - - /** Specifies the image tools and the display order of this tool in the RTE toolbar. - */ - images?: any[]; - - /** Specifies the indent tools and the display order of this tool in the RTE toolbar. - */ - indenting?: any[]; - - /** Specifies the link tools and the display order of this tool in the RTE toolbar. - */ - links?: any[]; - - /** Specifies the list tools and the display order of this tool in the RTE toolbar. - */ - lists?: any[]; - - /** Specifies the media tools and the display order of this tool in the RTE toolbar. - */ - media?: any[]; - - /** Specifies the style tools and the display order of this tool in the RTE toolbar. - */ - style?: any[]; - - /** Specifies the table tools and the display order of this tool in the RTE toolbar. - */ - tables?: any[]; - - /** Specifies the view tools and the display order of this tool in the RTE toolbar. - */ - view?: any[]; - - /** Specifies the print tools and the display order of this tool in the RTE toolbar. - */ - print?: any[]; - - /** Specifies the importExport tools and the display order of this tool in the RTE toolbar. - */ - importExport?: any[]; - - /** Specifies the customOrderedList tools and the display order of this tool in the RTE toolbar. - */ - customOrderedList?: ToolsCustomOrderedList[]; - - /** Specifies the customUnOrderedList tools and the display order of this tool in the RTE toolbar. - */ - customUnorderedList?: ToolsCustomUnorderedList[]; -} -} - -class Slider extends ej.Widget { - static fn: Slider; - constructor(element: JQuery | Element, options?: Slider.Model); - static Locale: any; - model: Slider.Model; - defaults: Slider.Model; - - /** To disable the slider - * @returns {void} - */ - disable(): void; - - /** To enable the slider - * @returns {void} - */ - enable(): void; - - /** To get value from slider handle - * @returns {number} - */ - getValue(): number; - - /** To set value to slider handle.By default animation is false while set the value. If you want to enable the animation, pass the enableAnimation as true to this method. - * @returns {void} - */ - setValue(): void; -} -export namespace Slider { - -export interface Model { - - /** Specifies the allowMouseWheel of the slider. - * @Default {false} - */ - allowMouseWheel?: boolean; - - /** Specifies the animationSpeed of the slider. - * @Default {500} - */ - animationSpeed?: number; - - /** Specify the CSS class to slider to achieve custom theme. - */ - cssClass?: string; - - /** Specifies the animation behavior of the slider. - * @Default {true} - */ - enableAnimation?: boolean; - - /** Specifies the state of the slider. - * @Default {true} - */ - enabled?: boolean; - - /** Specify the enablePersistence to slider to save current model value to browser cookies for state maintains - * @Default {false} - */ - enablePersistence?: boolean; - - /** Specifies the Right to Left Direction of the slider. - * @Default {false} - */ - enableRTL?: boolean; - - /** Specifies the height of the slider. - * @Default {14} - */ - height?: string; - - /** Specifies the HTML Attributes of the ejSlider. - * @Default {{}} - */ - htmlAttributes?: any; - - /** Specifies the incremental step value of the slider. - * @Default {1} - */ - incrementStep?: number; - - /** Specifies the distance between two major (large) ticks from the scale of the slider. - * @Default {10} - */ - largeStep?: number; - - /** Specifies the ending value of the slider. - * @Default {100} - */ - maxValue?: number; - - /** Specifies the starting value of the slider. - * @Default {0} - */ - minValue?: number; - - /** Specifies the orientation of the slider. - * @Default {ej.orientation.Horizontal} - */ - orientation?: ej.Orientation|string; - - /** Specifies the readOnly of the slider. - * @Default {false} - */ - readOnly?: boolean; - - /** Specifies the rounded corner behavior for slider. - * @Default {false} - */ - showRoundedCorner?: boolean; - - /** Shows/Hide the major (large) and minor (small) ticks in the scale of the slider. - * @Default {false} - */ - showScale?: boolean; - - /** Specifies the small ticks from the scale of the slider. - * @Default {true} - */ - showSmallTicks?: boolean; - - /** Specifies the showTooltip to shows the current Slider value, while moving the Slider handle or clicking on the slider handle of the slider. - * @Default {true} - */ - showTooltip?: boolean; - - /** Specifies the sliderType of the slider. - * @Default {ej.SliderType.Default} - */ - sliderType?: ej.slider.sliderType|string; - - /** Specifies the distance between two minor (small) ticks from the scale of the slider. - * @Default {1} - */ - smallStep?: number; - - /** Specifies the value of the slider. But it's not applicable for range slider. To range slider we can use values property. - * @Default {0} - */ - value?: number; - - /** Specifies the values of the range slider. But it's not applicable for default and minRange sliders. we can use value property for default and minRange sliders. - * @Default {[minValue,maxValue]} - */ - values?: any[]; - - /** Specifies the width of the slider. - * @Default {100%} - */ - width?: string; - - /** Fires once Slider control value is changed successfully. */ - change?(e: ChangeEventArgs): void; - - /** Fires once Slider control has been created successfully. */ - create?(e: CreateEventArgs): void; - - /** Fires when Slider control has been destroyed successfully. */ - destroy?(e: DestroyEventArgs): void; - - /** Fires once Slider control is sliding successfully. */ - slide?(e: SlideEventArgs): void; - - /** Fires once Slider control is started successfully. */ - start?(e: StartEventArgs): void; - - /** Fires when Slider control is stopped successfully. */ - stop?(e: StopEventArgs): void; - - /** Fires when display the custom tooltip */ - tooltipChange?(e: TooltipChangeEventArgs): void; -} - -export interface ChangeEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns current handle number or index - */ - sliderIndex?: number; - - /** returns slider id. - */ - id?: string; - - /** returns the slider model. - */ - model?: ej.Slider.Model; - - /** returns the name of the event. - */ - type?: string; - - /** returns the slider value. - */ - value?: number; - - /** returns true if event triggered by interaction else returns false. - */ - isInteraction?: boolean; -} - -export interface CreateEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the slider model - */ - model?: ej.Slider.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface DestroyEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the slider model - */ - model?: ej.Slider.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface SlideEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns current handle number or index - */ - sliderIndex?: number; - - /** returns slider id - */ - id?: string; - - /** returns the slider model - */ - model?: ej.Slider.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the slider value - */ - value?: number; -} - -export interface StartEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns current handle number or index - */ - sliderIndex?: number; - - /** returns slider id - */ - id?: string; - - /** returns the slider model - */ - model?: ej.Slider.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the slider value - */ - value?: number; -} - -export interface StopEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns current handle number or index - */ - sliderIndex?: number; - - /** returns slider id - */ - id?: string; - - /** returns the slider model - */ - model?: ej.Slider.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the slider value - */ - value?: number; -} - -export interface TooltipChangeEventArgs { - /** Returns the cancel option value. - */ - cancel?: boolean; -} -} -namespace slider { -enum sliderType { -//Shows default slider -Default, -//Shows minRange slider -MinRange, -//Shows Range slider -Range, -} -} - -class SplitButton extends ej.Widget { - static fn: SplitButton; - constructor(element: JQuery | Element, options?: SplitButton.Model); - static Locale: any; - model: SplitButton.Model; - defaults: SplitButton.Model; - - /** Destroy the split button widget all events bound using this._on will be unbind automatically and bring the control to pre-init state. - * @returns {void} - */ - destroy(): void; - - /** To disable the split button - * @returns {void} - */ - disable(): void; - - /** To Enable the split button - * @returns {void} - */ - enable(): void; - - /** To hide the list content of the split button. - * @returns {void} - */ - hide(): void; - - /** To show the list content of the split button. - * @returns {void} - */ - show(): void; -} -export namespace SplitButton { - -export interface Model { - - /** Specifies the arrowPosition of the Split or Dropdown Button.See arrowPosition - * @Default {ej.ArrowPosition.Right} - */ - arrowPosition?: string|ej.ArrowPosition; - - /** Specifies the buttonMode like Split or Dropdown Button.See ButtonMode - * @Default {ej.ButtonMode.Split} - */ - buttonMode?: string|ej.ButtonMode; - - /** Specifies the contentType of the Split Button.See ContentType - * @Default {ej.ContentType.TextOnly} - */ - contentType?: string|ej.ContentType; - - /** Set the root class for Split Button control theme - */ - cssClass?: string; - - /** Specifies the disabling of Split Button if enabled is set to false. - * @Default {true} - */ - enabled?: boolean; - - /** Specifies the enableRTL property for Split Button while initialization. - * @Default {false} - */ - enableRTL?: boolean; - - /** Specifies the height of the Split Button. - * @Default {“”} - */ - height?: string|number; - - /** Specifies the HTML Attributes of the Split Button. - * @Default {{}} - */ - htmlAttributes?: any; - - /** Specifies the imagePosition of the Split Button.See imagePositions - * @Default {ej.ImagePosition.ImageRight} - */ - imagePosition?: string|ej.ImagePosition; - - /** Specifies the image content for Split Button while initialization. - */ - prefixIcon?: string; - - /** Specifies the showRoundedCorner property for Split Button while initialization. - * @Default {false} - */ - showRoundedCorner?: boolean; - - /** Specifies the size of the Button. See ButtonSize - * @Default {ej.ButtonSize.Normal} - */ - size?: string|ej.ButtonSize; - - /** Specifies the image content for Split Button while initialization. - */ - suffixIcon?: string; - - /** Specifies the list content for Split Button while initialization - */ - targetID?: string; - - /** Specifies the text content for Split Button while initialization. - */ - text?: string; - - /** Specifies the width of the Split Button. - * @Default {“”} - */ - width?: string|number; - - /** Fires before menu of the split button control is opened. */ - beforeOpen?(e: BeforeOpenEventArgs): void; - - /** Fires when Button control is clicked successfully */ - click?(e: ClickEventArgs): void; - - /** Fires before the list content of Button control is closed */ - close?(e: CloseEventArgs): void; - - /** Fires after Split Button control is created. */ - create?(e: CreateEventArgs): void; - - /** Fires when the Split Button is destroyed successfully */ - destroy?(e: DestroyEventArgs): void; - - /** Fires when a menu item is Hovered out successfully */ - itemMouseOut?(e: ItemMouseOutEventArgs): void; - - /** Fires when a menu item is Hovered in successfully */ - itemMouseOver?(e: ItemMouseOverEventArgs): void; - - /** Fires when a menu item is clicked successfully */ - itemSelected?(e: ItemSelectedEventArgs): void; - - /** Fires before the list content of Button control is opened */ - open?(e: OpenEventArgs): void; -} - -export interface BeforeOpenEventArgs { - - /** returns the cancel option value - */ - cancel?: boolean; - - /** returns the split button model - */ - model?: ej.SplitButton.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface ClickEventArgs { - - /** returns the cancel option value - */ - cancel?: boolean; - - /** returns the split button model - */ - model?: ej.SplitButton.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the target of the current object. - */ - target?: any; - - /** return the button state - */ - status?: boolean; -} - -export interface CloseEventArgs { - - /** returns the cancel option value - */ - cancel?: boolean; - - /** returns the split button model - */ - model?: ej.SplitButton.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface CreateEventArgs { - - /** returns the cancel option value - */ - cancel?: boolean; - - /** returns the split button model - */ - model?: ej.SplitButton.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface DestroyEventArgs { - - /** returns the cancel option value - */ - cancel?: boolean; - - /** returns the split button model - */ - model?: ej.SplitButton.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface ItemMouseOutEventArgs { - - /** returns the cancel option value - */ - cancel?: boolean; - - /** returns the split button model - */ - model?: ej.SplitButton.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the clicked menu item element - */ - element?: any; - - /** return the menu item id - */ - ID?: string; - - /** return the clicked menu item text - */ - Text?: string; -} - -export interface ItemMouseOverEventArgs { - - /** returns the cancel option value - */ - cancel?: boolean; - - /** returns the split button model - */ - model?: ej.SplitButton.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the clicked menu item element - */ - element?: any; - - /** return the menu item id - */ - ID?: string; - - /** return the clicked menu item text - */ - Text?: string; -} - -export interface ItemSelectedEventArgs { - - /** returns the cancel option value - */ - cancel?: boolean; - - /** returns the split button model - */ - model?: ej.SplitButton.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the clicked menu item element - */ - element?: any; - - /** returns the selected item - */ - selectedItem?: any; - - /** return the menu id - */ - menuId?: string; - - /** return the clicked menu item text - */ - menuText?: string; -} - -export interface OpenEventArgs { - - /** returns the cancel option value - */ - cancel?: boolean; - - /** returns the split button model - */ - model?: ej.SplitButton.Model; - - /** returns the name of the event - */ - type?: string; -} -} -enum ArrowPosition { -//To set Left arrowPosition of the split button -Left, -//To set Right arrowPosition of the split button -Right, -//To set Top arrowPosition of the split button -Top, -//To set Bottom arrowPosition of the split button -Bottom, -} - -class Splitter extends ej.Widget { - static fn: Splitter; - constructor(element: JQuery | Element, options?: Splitter.Model); - static Locale: any; - model: Splitter.Model; - defaults: Splitter.Model; - - /** To add a new pane to splitter control. - * @param {string} content of pane. - * @param {any} pane properties. - * @param {number} index of pane. - * @returns {HTMLElement} - */ - addItem(content: string, property: any, index: number): HTMLElement; - - /** To collapse the splitter control pane. - * @param {number} index number of pane. - * @returns {void} - */ - collapse(paneIndex: number): void; - - /** To expand the splitter control pane. - * @param {number} index number of pane. - * @returns {void} - */ - expand(paneIndex: number): void; - - /** To refresh the splitter control pane resizing. - * @returns {void} - */ - refresh(): void; - - /** To remove a specified pane from the splitter control. - * @param {number} index of pane. - * @returns {void} - */ - removeItem(index: number): void; -} -export namespace Splitter { - -export interface Model { - - /** Turns on keyboard interaction with the Splitter panes. You must set this property to true to access the keyboard shortcuts of ejSplitter. - * @Default {true} - */ - allowKeyboardNavigation?: boolean; - - /** Specify animation speed for the Splitter pane movement, while collapsing and expanding. - * @Default {300} - */ - animationSpeed?: number; - - /** Specify the CSS class to splitter control to achieve custom theme. - * @Default {“”} - */ - cssClass?: string; - - /** Specifies the animation behavior of the splitter. - * @Default {true} - */ - enableAnimation?: boolean; - - /** Specifies the splitter control to be displayed in right to left direction. - * @Default {false} - */ - enableRTL?: boolean; - - /** Specify height for splitter control. - * @Default {null} - */ - height?: string; - - /** Specifies the HTML Attributes of the Splitter. - * @Default {{}} - */ - htmlAttributes?: any; - - /** Specify window resizing behavior for splitter control. - * @Default {false} - */ - isResponsive?: boolean; - - /** Specify the orientation for splitter control. See orientation - * @Default {ej.orientation.Horizontal or “horizontal”} - */ - orientation?: ej.Orientation|string; - - /** Specify properties for each pane like paneSize, minSize, maxSize, collapsible, expandable, resizable. - * @Default {[]} - */ - properties?: any[]; - - /** Specify width for splitter control. - * @Default {null} - */ - width?: string; - - /** Fires before expanding / collapsing the split pane of splitter control. */ - beforeExpandCollapse?(e: BeforeExpandCollapseEventArgs): void; - - /** Fires when splitter control pane has been created. */ - create?(e: CreateEventArgs): void; - - /** Fires when splitter control pane has been destroyed. */ - destroy?(e: DestroyEventArgs): void; - - /** Fires when expand / collapse operation in splitter control pane has been performed successfully. */ - expandCollapse?(e: ExpandCollapseEventArgs): void; - - /** Fires when resize in splitter control pane. */ - resize?(e: ResizeEventArgs): void; -} - -export interface BeforeExpandCollapseEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns collapsed pane details. - */ - collapsed?: any; - - /** returns expanded pane details. - */ - expanded?: any; - - /** returns the splitter model. - */ - model?: ej.Splitter.Model; - - /** returns the current split bar index. - */ - splitbarIndex?: number; - - /** returns the name of the event. - */ - type?: string; -} - -export interface CreateEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the splitter model. - */ - model?: ej.Splitter.Model; - - /** returns the name of the event. - */ - type?: string; -} - -export interface DestroyEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the splitter model. - */ - model?: ej.Splitter.Model; - - /** returns the name of the event. - */ - type?: string; -} - -export interface ExpandCollapseEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns collapsed pane details. - */ - collapsed?: any; - - /** returns expanded pane details. - */ - expanded?: any; - - /** returns the splitter model. - */ - model?: ej.Splitter.Model; - - /** returns the current split bar index. - */ - splitbarIndex?: number; - - /** returns the name of the event. - */ - type?: string; -} - -export interface ResizeEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns previous pane details. - */ - prevPane?: any; - - /** returns next pane details. - */ - nextPane?: any; - - /** returns the splitter model. - */ - model?: ej.Splitter.Model; - - /** returns the current split bar index. - */ - splitbarIndex?: number; - - /** returns the name of the event. - */ - type?: string; -} -} - -class Tab extends ej.Widget { - static fn: Tab; - constructor(element: JQuery | Element, options?: Tab.Model); - static Locale: any; - model: Tab.Model; - defaults: Tab.Model; - - /** Add new tab items with given name, URL and given index position, if index null it’s add last item. - * @param {string} URL name / tab id. - * @param {string} Tab Display name. - * @param {number} Index position to placed , this is optional. - * @param {string} specifies cssClass, this is optional. - * @param {string} specifies id of tab, this is optional. - * @returns {void} - */ - addItem(URL: string, displayLabel: string, index: number, cssClass: string, id: string): void; - - /** To disable the tab control. - * @returns {void} - */ - disable(): void; - - /** To enable the tab control. - * @returns {void} - */ - enable(): void; - - /** This function get the number of tab rendered - * @returns {number} - */ - getItemsCount(): number; - - /** This function hides the tab control. - * @returns {void} - */ - hide(): void; - - /** This function hides the specified item tab in tab control. - * @param {number} index of tab item. - * @returns {void} - */ - hideItem(index: number): void; - - /** Remove the given index tab item. - * @param {number} index of tab item. - * @returns {void} - */ - removeItem(index: number): void; - - /** This function is to show the tab control. - * @returns {void} - */ - show(): void; - - /** This function helps to show the specified hidden tab item in tab control. - * @param {number} index of tab item. - * @returns {void} - */ - showItem(index: number): void; -} -export namespace Tab { - -export interface Model { - - /** Specifies the ajaxSettings option to load the content to the Tab control. - */ - ajaxSettings?: AjaxSettings; - - /** Tab items interaction with keyboard keys, like headers active navigation. - * @Default {true} - */ - allowKeyboardNavigation?: boolean; - - /** Allow to collapsing the active item, while click on the active header. - * @Default {false} - */ - collapsible?: boolean; - - /** Set the root class for Tab theme. This cssClass API helps to use custom skinning option for Tab control. - */ - cssClass?: string; - - /** Disables the given tab headers and content panels. - * @Default {[]} - */ - disabledItemIndex?: number[]; - - /** Specifies the animation behavior of the tab. - * @Default {true} - */ - enableAnimation?: boolean; - - /** When this property is set to false, it disables the tab control. - * @Default {true} - */ - enabled?: boolean; - - /** Enables the given tab headers and content panels. - * @Default {[]} - */ - enabledItemIndex?: number[]; - - /** Save current model value to browser cookies for state maintains. While refresh the Tab control page the model value apply from browser cookies. - * @Default {false} - */ - enablePersistence?: boolean; - - /** Display Right to Left direction for headers and panels text of tab. - * @Default {false} - */ - enableRTL?: boolean; - - /** Specify to enable scrolling for Tab header. - * @Default {false} - */ - enableTabScroll?: boolean; - - /** The event API to bind the action for active the tab items. - * @Default {click} - */ - events?: string; - - /** Specifies the position of Tab header as top, bottom, left or right. See below to get available Position - * @Default {top} - */ - headerPosition?: string | ej.Tab.Position; - - /** Set the height of the tab header element. Default this property value is null, so height take content height. - * @Default {null} - */ - headerSize?: string|number; - - /** Height set the outer panel element. Default this property value is null, so height take content height. - * @Default {null} - */ - height?: string|number; - - /** Adjust the content panel height for given option (content, auto and fill), by default panels height adjust based on the content.See below to get available HeightAdjustMode - * @Default {content} - */ - heightAdjustMode?: string | ej.Tab.HeightAdjustMode; - - /** Specifies to hide a pane of Tab control. - * @Default {[]} - */ - hiddenItemIndex?: any[]; - - /** Specifies the HTML Attributes of the Tab. - * @Default {{}} - */ - htmlAttributes?: any; - - /** The idPrefix property appends the given string on the added tab item id’s in runtime. - * @Default {ej-tab-} - */ - idPrefix?: string; - - /** Specifies the Tab header in active for given index value. - * @Default {0} - */ - selectedItemIndex?: number; - - /** Display the close button for each tab items. While clicking on the close icon, particular tab item will be removed. - * @Default {false} - */ - showCloseButton?: boolean; - - /** Display the Reload button for each tab items. - * @Default {false} - */ - showReloadIcon?: boolean; - - /** Tab panels and headers to be displayed in rounded corner style. - * @Default {false} - */ - showRoundedCorner?: boolean; - - /** Set the width for outer panel element, if not it’s take parent width. - * @Default {null} - */ - width?: string|number; - - /** Triggered after a tab item activated. */ - itemActive?(e: ItemActiveEventArgs): void; - - /** Triggered before AJAX content has been loaded. */ - ajaxBeforeLoad?(e: AjaxBeforeLoadEventArgs): void; - - /** Triggered if error occurs in AJAX request. */ - ajaxError?(e: AjaxErrorEventArgs): void; - - /** Triggered after AJAX content load action. */ - ajaxLoad?(e: AjaxLoadEventArgs): void; - - /** Triggered after a tab item activated. */ - ajaxSuccess?(e: AjaxSuccessEventArgs): void; - - /** Triggered before a tab item activated. */ - beforeActive?(e: BeforeActiveEventArgs): void; - - /** Triggered before a tab item remove. */ - beforeItemRemove?(e: BeforeItemRemoveEventArgs): void; - - /** Triggered before a tab item Create. */ - create?(e: CreateEventArgs): void; - - /** Triggered before a tab item destroy. */ - destroy?(e: DestroyEventArgs): void; - - /** Triggered after new tab item add */ - itemAdd?(e: ItemAddEventArgs): void; - - /** Triggered after tab item removed. */ - itemRemove?(e: ItemRemoveEventArgs): void; -} - -export interface ItemActiveEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the tab model. - */ - model?: ej.Tab.Model; - - /** returns the name of the event. - */ - type?: string; - - /** returns previous active tab header. - */ - prevActiveHeader?: HTMLElement; - - /** returns previous active index. - */ - prevActiveIndex?: number; - - /** returns current active tab header . - */ - activeHeader?: HTMLElement; - - /** returns current active index. - */ - activeIndex?: number; - - /** returns, is it triggered by interaction or not. - */ - isInteraction?: boolean; -} - -export interface AjaxBeforeLoadEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the tab model. - */ - model?: ej.Tab.Model; - - /** returns the name of the event. - */ - type?: string; - - /** returns previous active tab header. - */ - prevActiveHeader?: HTMLElement; - - /** returns previous active index. - */ - prevActiveIndex?: number; - - /** returns current active tab header . - */ - activeHeader?: HTMLElement; - - /** returns current active index. - */ - activeIndex?: number; - - /** returns the URL of AJAX request - */ - URL?: string; - - /** returns, is it triggered by interaction or not. - */ - isInteraction?: boolean; -} - -export interface AjaxErrorEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the tab model. - */ - model?: ej.Tab.Model; - - /** returns the name of the event. - */ - type?: string; - - /** returns AJAX data details. - */ - data?: any; - - /** returns the URL of AJAX request. - */ - URL?: string; -} - -export interface AjaxLoadEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the tab model. - */ - model?: ej.Tab.Model; - - /** returns the name of the event. - */ - type?: string; - - /** returns previous active tab header. - */ - prevActiveHeader?: HTMLElement; - - /** returns previous active index. - */ - prevActiveIndex?: number; - - /** returns current active tab header . - */ - activeHeader?: HTMLElement; - - /** returns current active index. - */ - activeIndex?: number; - - /** returns the URL of AJAX request - */ - URL?: string; - - /** returns, is it triggered by interaction or not. - */ - isInteraction?: boolean; -} - -export interface AjaxSuccessEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the tab model. - */ - model?: ej.Tab.Model; - - /** returns the name of the event. - */ - type?: string; - - /** return AJAX data. - */ - data?: any; - - /** returns AJAX URL - */ - URL?: string; - - /** returns content of AJAX request. - */ - content?: any; -} - -export interface BeforeActiveEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the tab model. - */ - model?: ej.Tab.Model; - - /** returns the name of the event. - */ - type?: string; - - /** returns previous active tab header. - */ - prevActiveHeader?: HTMLElement; - - /** returns previous active index. - */ - prevActiveIndex?: number; - - /** returns current active tab header . - */ - activeHeader?: HTMLElement; - - /** returns current active index. - */ - activeIndex?: number; - - /** returns, is it triggered by interaction or not. - */ - isInteraction?: boolean; -} - -export interface BeforeItemRemoveEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the tab model. - */ - model?: ej.Tab.Model; - - /** returns the name of the event. - */ - type?: string; - - /** returns current tab item index - */ - index?: number; -} - -export interface CreateEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the tab model. - */ - model?: ej.Tab.Model; - - /** returns the name of the event. - */ - type?: string; -} - -export interface DestroyEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the tab model. - */ - model?: ej.Tab.Model; - - /** returns the name of the event. - */ - type?: string; -} - -export interface ItemAddEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the tab model. - */ - model?: ej.Tab.Model; - - /** returns the name of the event. - */ - type?: string; - - /** returns new added tab header. - */ - tabHeader?: HTMLElement; - - /** returns new added tab content panel. - */ - tabContent?: any; -} - -export interface ItemRemoveEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the tab model. - */ - model?: ej.Tab.Model; - - /** returns the name of the event. - */ - type?: string; - - /** returns removed tab header. - */ - removedTab?: HTMLElement; -} - -export interface AjaxSettings { - - /** It specifies, whether to enable or disable asynchronous request. - * @Default {true} - */ - async?: boolean; - - /** It specifies the page will be cached in the web browser. - * @Default {false} - */ - cache?: boolean; - - /** It specifies the type of data is send in the query string. - * @Default {html} - */ - contentType?: string; - - /** It specifies the data as an object, will be passed in the query string. - * @Default {{}} - */ - data?: any; - - /** It specifies the type of data that you're expecting back from the response. - * @Default {html} - */ - dataType?: string; - - /** It specifies the HTTP request type. - * @Default {get} - */ - type?: string; -} - -enum Position { - - ///Tab headers display to top position - Top, - - ///Tab headers display to bottom position - Bottom, - - ///Tab headers display to left position. - Left, - - ///Tab headers display to right position. - Right -} - - -enum HeightAdjustMode { - - ///string - None, - - ///string - Content, - - ///string - Auto, - - ///string - Fill -} - -} - -class TagCloud extends ej.Widget { - static fn: TagCloud; - constructor(element: JQuery | Element, options?: TagCloud.Model); - static Locale: any; - model: TagCloud.Model; - defaults: TagCloud.Model; - - /** Inserts a new item into the TagCloud - * @param {string} Insert new item into the TagCloud - * @returns {void} - */ - insert(name: string): void; - - /** Inserts a new item into the TagCloud at a particular position. - * @param {string} Inserts a new item into the TagCloud - * @param {number} Inserts a new item into the TagCloud with the specified position - * @returns {void} - */ - insertAt(name: string, position: number): void; - - /** Removes the item from the TagCloud based on the name. It removes all the tags which have the corresponding name - * @param {string} name of the tag. - * @returns {void} - */ - remove(name: string): void; - - /** Removes the item from the TagCloud based on the position. It removes the tags from the the corresponding position only. - * @param {number} position of tag item. - * @returns {void} - */ - removeAt(position: number): void; -} -export namespace TagCloud { - -export interface Model { - - /** Specify the CSS class to button to achieve custom theme. - */ - cssClass?: string; - - /** The dataSource contains the list of data to display in a cloud format. Each data contains a link URL, frequency to categorize the font size and a display text. - * @Default {null} - */ - dataSource?: any; - - /** Sets the TagCloud and tag items direction as right to left alignment. - * @Default {false} - */ - enableRTL?: boolean; - - /** Defines the mapping fields for the data items of the TagCloud. - * @Default {null} - */ - fields?: Fields; - - /** Specifies the list of HTML attributes to be added to TagCloud control. - * @Default {{}} - */ - htmlAttributes?: any; - - /** Defines the format for the TagCloud to display the tag items.See Format - * @Default {ej.Format.Cloud} - */ - format?: string|ej.Format; - - /** Sets the maximum font size value for the tag items. The font size for the tag items will be generated in between the minimum and maximum font size values. - * @Default {40px} - */ - maxFontSize?: string|number; - - /** Sets the minimum font size value for the tag items. The font size for the tag items will be generated in between the minimum and maximum font size values. - * @Default {10px} - */ - minFontSize?: string|number; - - /** Define the query to retrieve the data from online server. The query is used only when the online dataSource is used. - * @Default {null} - */ - query?: any; - - /** Shows or hides the TagCloud title. When this set to false, it hides the TagCloud header. - * @Default {true} - */ - showTitle?: boolean; - - /** Sets the title image for the TagCloud. To show the title image, the showTitle property should be enabled. - * @Default {null} - */ - titleImage?: string; - - /** Sets the title text for the TagCloud. To show the title text, the showTitle property should be enabled. - * @Default {Title} - */ - titleText?: string; - - /** Event triggers when the TagCloud items are clicked */ - click?(e: ClickEventArgs): void; - - /** Event triggers when the TagCloud are created */ - create?(e: CreateEventArgs): void; - - /** Event triggers when the TagCloud are destroyed */ - destroy?(e: DestroyEventArgs): void; - - /** Event triggers when the cursor leaves out from a tag item */ - mouseout?(e: MouseoutEventArgs): void; - - /** Event triggers when the cursor hovers on a tag item */ - mouseover?(e: MouseoverEventArgs): void; -} - -export interface ClickEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TagCloud model - */ - model?: ej.TagCloud.Model; - - /** returns the name of the event - */ - type?: string; - - /** return current tag name - */ - text?: string; - - /** return current URL link - */ - URL?: string; -} - -export interface CreateEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TagCloud model - */ - model?: ej.TagCloud.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface DestroyEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TagCloud model - */ - model?: ej.TagCloud.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface MouseoutEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TagCloud model - */ - model?: ej.TagCloud.Model; - - /** returns the name of the event - */ - type?: string; - - /** return current tag name - */ - text?: string; - - /** return current URL link - */ - URL?: string; -} - -export interface MouseoverEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TagCloud model - */ - model?: ej.TagCloud.Model; - - /** returns the name of the event - */ - type?: string; - - /** return current tag name - */ - text?: string; - - /** return current URL link - */ - URL?: string; -} - -export interface Fields { - - /** Defines the frequency column number to categorize the font size. - */ - frequency?: string; - - /** Defines the HTML attributes column for the anchor elements inside the each tag items. - */ - htmlAttributes?: string; - - /** Defines the tag value or display text. - */ - text?: string; - - /** Defines the URL link to navigate while click the tag. - */ - url?: string; -} -} -enum Format { -//To render the TagCloud items in cloud format -Cloud, -//To render the TagCloud items in list format -List, -} - -class TimePicker extends ej.Widget { - static fn: TimePicker; - constructor(element: JQuery | Element, options?: TimePicker.Model); - static Locale: any; - model: TimePicker.Model; - defaults: TimePicker.Model; - - /** Allows you to disable the TimePicker. - * @returns {void} - */ - disable(): void; - - /** Allows you to enable the TimePicker. - * @returns {void} - */ - enable(): void; - - /** It returns the current time value. - * @returns {string} - */ - getValue(): string; - - /** This method will hide the TimePicker control popup. - * @returns {void} - */ - hide(): void; - - /** Updates the current system time in TimePicker. - * @returns {void} - */ - setCurrentTime(): void; - - /** This method will show the TimePicker control popup. - * @returns {void} - */ - show(): void; -} -export namespace TimePicker { - -export interface Model { - - /** Sets the root CSS class for the TimePicker theme, which is used to customize. - */ - cssClass?: string; - - /** Specifies the list of time range to be disabled. - * @Default {{}} - */ - disableTimeRanges?: any; - - /** Specifies the animation behavior in TimePicker. - * @Default {true} - */ - enableAnimation?: boolean; - - /** When this property is set to false, it disables the TimePicker control. - * @Default {true} - */ - enabled?: boolean; - - /** Save current model value to browser cookies for maintaining states. When refreshing the TimePicker control page, the model value is applied from browser cookies or HTML 5local storage. - * @Default {false} - */ - enablePersistence?: boolean; - - /** Displays the TimePicker as right to left alignment. - * @Default {false} - */ - enableRTL?: boolean; - - /** When the enableStrictMode is set as true it allows the value outside of the range and also indicate with red color border, - * otherwise it internally changed to the min or max range value based an input value. - * @Default {false} - */ - enableStrictMode?: boolean; - - /** Defines the height of the TimePicker textbox. - */ - height?: string|number; - - /** Sets the step value for increment an hour value through arrow keys or mouse scroll. - * @Default {1} - */ - hourInterval?: number; - - /** It allows to define the characteristics of the TimePicker control. It will helps to extend the capability of an HTML element. - * @Default {{}} - */ - htmlAttributes?: any; - - /** Sets the time interval between the two adjacent time values in the popup. - * @Default {30} - */ - interval?: number; - - /** Defines the localization info used by the TimePicker. - * @Default {en-US} - */ - locale?: string; - - /** Sets the maximum time value to the TimePicker. - * @Default {11:59:59 PM} - */ - maxTime?: string; - - /** Sets the minimum time value to the TimePicker. - * @Default {12:00:00 AM} - */ - minTime?: string; - - /** Sets the step value for increment the minute value through arrow keys or mouse scroll. - * @Default {1} - */ - minutesInterval?: number; - - /** Defines the height of the TimePicker popup. - * @Default {191px} - */ - popupHeight?: string|number; - - /** Defines the width of the TimePicker popup. - * @Default {auto} - */ - popupWidth?: string|number; - - /** Toggles the readonly state of the TimePicker - * @Default {false} - */ - readOnly?: boolean; - - /** Sets the step value for increment the seconds value through arrow keys or mouse scroll. - * @Default {1} - */ - secondsInterval?: number; - - /** shows or hides the drop down button in TimePicker. - * @Default {true} - */ - showPopupButton?: boolean; - - /** TimePicker is displayed with rounded corner when this property is set to true. - * @Default {false} - */ - showRoundedCorner?: boolean; - - /** Defines the time format displayed in the TimePicker. - * @Default {h:mm tt} - */ - timeFormat?: string; - - /** Sets a specified time value on the TimePicker. - * @Default {null} - */ - value?: string|Date; - - /** Defines the width of the TimePicker textbox. - */ - width?: string|number; - - /** Fires when the time value changed in the TimePicker. */ - beforeChange?(e: BeforeChangeEventArgs): void; - - /** Fires when the TimePicker popup before opened. */ - beforeOpen?(e: BeforeOpenEventArgs): void; - - /** Fires when the time value changed in the TimePicker. */ - change?(e: ChangeEventArgs): void; - - /** Fires when the TimePicker popup closed. */ - close?(e: CloseEventArgs): void; - - /** Fires when create TimePicker successfully. */ - create?(e: CreateEventArgs): void; - - /** Fires when the TimePicker is destroyed successfully. */ - destroy?(e: DestroyEventArgs): void; - - /** Fires when the TimePicker control gets focus. */ - focusIn?(e: FocusInEventArgs): void; - - /** Fires when the TimePicker control get lost focus. */ - focusOut?(e: FocusOutEventArgs): void; - - /** Fires when the TimePicker popup opened. */ - open?(e: OpenEventArgs): void; - - /** Fires when the value is selected from the TimePicker dropdown list. */ - select?(e: SelectEventArgs): void; -} - -export interface BeforeChangeEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TimePicker model - */ - model?: ej.TimePicker.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the previously selected time value - */ - prevTime?: string; - - /** returns the modified time value - */ - value?: string; -} - -export interface BeforeOpenEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TimePicker model - */ - model?: ej.TimePicker.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the previously selected time value - */ - prevTime?: string; - - /** returns the time value - */ - value?: string; -} - -export interface ChangeEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TimePicker model - */ - model?: ej.TimePicker.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns true when the value changed by user interaction otherwise returns false - */ - isInteraction?: boolean; - - /** returns the previously selected time value - */ - prevTime?: string; - - /** returns the modified time value - */ - value?: string; -} - -export interface CloseEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TimePicker model - */ - model?: ej.TimePicker.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the previously selected time value - */ - prevTime?: string; - - /** returns the time value - */ - value?: string; -} - -export interface CreateEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TimePicker model - */ - model?: ej.TimePicker.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface DestroyEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TimePicker model - */ - model?: ej.TimePicker.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface FocusInEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TimePicker model - */ - model?: ej.TimePicker.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the previously selected time value - */ - prevTime?: string; - - /** returns the current time value - */ - value?: string; -} - -export interface FocusOutEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TimePicker model - */ - model?: ej.TimePicker.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the previously selected time value - */ - prevTime?: string; - - /** returns the current time value - */ - value?: string; -} - -export interface OpenEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TimePicker model - */ - model?: ej.TimePicker.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the time value - */ - value?: string; -} - -export interface SelectEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TimePicker model - */ - model?: ej.TimePicker.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the previously selected time value - */ - prevTime?: string; - - /** returns the selected time value - */ - value?: string; -} -} - -class ToggleButton extends ej.Widget { - static fn: ToggleButton; - constructor(element: JQuery | Element, options?: ToggleButton.Model); - static Locale: any; - model: ToggleButton.Model; - defaults: ToggleButton.Model; - - /** Allows you to destroy the ToggleButton widget. - * @returns {void} - */ - destroy(): void; - - /** To disable the ToggleButton to prevent all user interactions. - * @returns {void} - */ - disable(): void; - - /** To enable the ToggleButton. - * @returns {void} - */ - enable(): void; -} -export namespace ToggleButton { - -export interface Model { - - /** Specify the icon in active state to the toggle button and it will be aligned from left margin of the button. - */ - activePrefixIcon?: string; - - /** Specify the icon in active state to the toggle button and it will be aligned from right margin of the button. - */ - activeSuffixIcon?: string; - - /** Sets the text when ToggleButton is in active state i.e.,checked state. - * @Default {null} - */ - activeText?: string; - - /** Specifies the contentType of the ToggleButton. See ContentType as below - * @Default {ej.ContentType.TextOnly} - */ - contentType?: ej.ContentType|string; - - /** Specify the CSS class to the ToggleButton to achieve custom theme. - */ - cssClass?: string; - - /** Specify the icon in default state to the toggle button and it will be aligned from left margin of the button. - */ - defaultPrefixIcon?: string; - - /** Specify the icon in default state to the toggle button and it will be aligned from right margin of the button. - */ - defaultSuffixIcon?: string; - - /** Specifies the text of the ToggleButton, when the control is a default state. i.e., unChecked state. - * @Default {null} - */ - defaultText?: string; - - /** Specifies the state of the ToggleButton. - * @Default {true} - */ - enabled?: boolean; - - /** Save current model value to browser cookies for maintaining states. When refreshing the ToggleButton control page, the model value is applied from browser cookies or HTML 5local storage. - * @Default {false} - */ - enablePersistence?: boolean; - - /** Specify the Right to Left direction of the ToggleButton. - * @Default {false} - */ - enableRTL?: boolean; - - /** Specifies the height of the ToggleButton. - * @Default {28pixel} - */ - height?: number|string; - - /** It allows to define the characteristics of the ToggleButton control. It will helps to extend the capability of an HTML element. - * @Default {{}} - */ - htmlAttributes?: any; - - /** Specifies the image position of the ToggleButton. - * @Default {ej.ImagePosition.ImageLeft} - */ - imagePosition?: ej.ImagePosition|string; - - /** Allows to prevents the control switched to checked (active) state. - * @Default {false} - */ - preventToggle?: boolean; - - /** Displays the ToggleButton with rounded corners. - * @Default {false} - */ - showRoundedCorner?: boolean; - - /** Specifies the size of the ToggleButton. See ButtonSize as below - * @Default {ej.ButtonSize.Normal} - */ - size?: ej.ButtonSize|string; - - /** It allows to define the ToggleButton state to checked(Active) or unchecked(Default) at initial time. - * @Default {false} - */ - toggleState?: boolean; - - /** Specifies the type of the ToggleButton. See ButtonType as below - * @Default {ej.ButtonType.Button} - */ - type?: ej.ButtonType|string; - - /** Specifies the width of the ToggleButton. - * @Default {100pixel} - */ - width?: number|string; - - /** Fires when ToggleButton control state is changed successfully. */ - change?(e: ChangeEventArgs): void; - - /** Fires when ToggleButton control is clicked successfully. */ - click?(e: ClickEventArgs): void; - - /** Fires when ToggleButton control is created successfully. */ - create?(e: CreateEventArgs): void; - - /** Fires when ToggleButton control is destroyed successfully. */ - destroy?(e: DestroyEventArgs): void; -} - -export interface ChangeEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** return the toggle button checked state - */ - isChecked?: boolean; - - /** returns the toggle button model - */ - model?: ej.ToggleButton.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface ClickEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** return the toggle button checked state - */ - isChecked?: boolean; - - /** returns the toggle button model - */ - model?: ej.ToggleButton.Model; - - /** return the toggle button state - */ - status?: boolean; - - /** returns the name of the event - */ - type?: string; -} - -export interface CreateEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the toggle button model - */ - model?: ej.ToggleButton.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface DestroyEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the toggle button model - */ - model?: ej.ToggleButton.Model; - - /** returns the name of the event - */ - type?: string; -} -} - -class Toolbar extends ej.Widget { - static fn: Toolbar; - constructor(element: JQuery | Element, options?: Toolbar.Model); - static Locale: any; - model: Toolbar.Model; - defaults: Toolbar.Model; - - /** Deselect the specified Toolbar item. - * @param {any} The element need to be deselected - * @returns {void} - */ - deselectItem(element: any): void; - - /** Deselect the Toolbar item based on specified id. - * @param {string} The ID of the element need to be deselected - * @returns {void} - */ - deselectItemByID(ID: string): void; - - /** Allows you to destroy the Toolbar widget. - * @returns {void} - */ - destroy(): void; - - /** To disable all items in the Toolbar control. - * @returns {void} - */ - disable(): void; - - /** Disable the specified Toolbar item. - * @param {any} The element need to be disabled - * @returns {void} - */ - disableItem(element: any): void; - - /** Disable the Toolbar item based on specified item id in the Toolbar. - * @param {string} The ID of the element need to be disabled - * @returns {void} - */ - disableItemByID(ID: string): void; - - /** Enable the Toolbar if it is in disabled state. - * @returns {void} - */ - enable(): void; - - /** Enable the Toolbar item based on specified item. - * @param {any} The element need to be enabled - * @returns {void} - */ - enableItem(element: any): void; - - /** Enable the Toolbar item based on specified item id in the Toolbar. - * @param {string} The ID of the element need to be enabled - * @returns {void} - */ - enableItemByID(ID: string): void; - - /** To hide the Toolbar - * @returns {void} - */ - hide(): void; - - /** Remove the item from toolbar, based on specified item. - * @param {any} The element need to be removed - * @returns {void} - */ - removeItem(element: any): void; - - /** Remove the item from toolbar, based on specified item id in the Toolbar. - * @param {string} The ID of the element need to be removed - * @returns {void} - */ - removeItemByID(ID: string): void; - - /** Selects the item from toolbar, based on specified item. - * @param {any} The element need to be selected - * @returns {void} - */ - selectItem(element: any): void; - - /** Selects the item from toolbar, based on specified item id in the Toolbar. - * @param {string} The ID of the element need to be selected - * @returns {void} - */ - selectItemByID(ID: string): void; - - /** To show the Toolbar. - * @returns {void} - */ - show(): void; -} -export namespace Toolbar { - -export interface Model { - - /** Sets the root CSS class for Toolbar control to achieve the custom theme. - */ - cssClass?: string; - - /** Specifies dataSource value for the Toolbar control during initialization. - * @Default {null} - */ - dataSource?: any; - - /** Disables an Item or set of Items that are enabled in the Toolbar - * @Default {[]} - */ - disabledItemIndices?: any[]; - - /** Specifies the Toolbar control state. - * @Default {true} - */ - enabled?: boolean; - - /** Enables an Item or set of Items that are disabled in the Toolbar - * @Default {[]} - */ - enabledItemIndices?: any[]; - - /** Specifies enableRTL property to align the Toolbar control from right to left direction. - * @Default {false} - */ - enableRTL?: boolean; - - /** Allows to separate the each UL items in the Toolbar control. - * @Default {false} - */ - enableSeparator?: boolean; - - /** Specifies the mapping fields for the data items of the Toolbar - * @Default {null} - */ - fields?: string; - - /** Specifies the height of the Toolbar. - * @Default {28} - */ - height?: number|string; - - /** Specifies the list of HTML attributes to be added to toolbar control. - * @Default {{}} - */ - htmlAttributes?: any; - - /** Specifies whether the Toolbar control is need to be show or hide. - * @Default {false} - */ - hide?: boolean; - - /** Enables/Disables the responsive support for Toolbar items during the window resizing time. - * @Default {false} - */ - isResponsive?: boolean; - - /** Specifies the items of Toolbar - * @Default {null} - */ - Items?: Items; - - /** Specifies the Toolbar orientation. See orientation - * @Default {Horizontal} - */ - orientation?: ej.Orientation|string; - - /** Specifies the query to retrieve the data from the online server. The query is used only when the online dataSource is used. - * @Default {null} - */ - query?: any; - - /** Specifies the Toolbar responsive type. - * @Default {Popup} - */ - responsiveType?: ej.Toolbar.ResponsiveType|string; - - /** Displays the Toolbar with rounded corners. - * @Default {false} - */ - showRoundedCorner?: boolean; - - /** Specifies the width of the Toolbar. - */ - width?: number|string; - - /** Fires after Toolbar control is clicked. */ - click?(e: ClickEventArgs): void; - - /** Fires after Toolbar control is created. */ - create?(e: CreateEventArgs): void; - - /** Fires after Toolbar control is focused. */ - focusOut?(e: FocusOutEventArgs): void; - - /** Fires when the Toolbar is destroyed successfully. */ - destroy?(e: DestroyEventArgs): void; - - /** Fires after Toolbar control item is hovered. */ - itemHover?(e: ItemHoverEventArgs): void; - - /** Fires after mouse leave from Toolbar control item. */ - itemLeave?(e: ItemLeaveEventArgs): void; - - /** Fires when the overflow popup of toolbar is opened. */ - overflowOpen?(e: OverflowOpenEventArgs): void; - - /** Fires when the overflow popup of toolbar is closed. */ - overflowClose?(e: OverflowCloseEventArgs): void; -} - -export interface ClickEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the Toolbar model - */ - model?: ej.Toolbar.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the target of the current object. - */ - target?: any; - - /** returns the target of the current object. - */ - currentTarget?: any; - - /** return the Toolbar state - */ - status?: boolean; -} - -export interface CreateEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the Toolbar model - */ - model?: ej.Toolbar.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface FocusOutEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the Toolbar model - */ - model?: ej.Toolbar.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface DestroyEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the Toolbar model - */ - model?: ej.Toolbar.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface ItemHoverEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the Toolbar model - */ - model?: ej.Toolbar.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the target of the current object. - */ - target?: any; - - /** returns the target of the current object. - */ - currentTarget?: any; - - /** return the Toolbar state - */ - status?: boolean; -} - -export interface ItemLeaveEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the Toolbar model - */ - model?: ej.Toolbar.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the target of the current object. - */ - target?: any; - - /** returns the target of the current object. - */ - currentTarget?: any; - - /** return the Toolbar state - */ - status?: boolean; -} - -export interface OverflowOpenEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the Toolbar model - */ - model?: ej.Toolbar.Model; - - /** returns the name of the event - */ - type?: string; - - /** Returns the current X position of the target . - */ - clientX?: number; - - /** Returns the current Y position of the target . - */ - clientY?: number; - - /** returns the target of the current object. - */ - currentTarget?: any; -} - -export interface OverflowCloseEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the Toolbar model - */ - model?: ej.Toolbar.Model; - - /** returns the name of the event - */ - type?: string; - - /** Returns the current X position of the target . - */ - clientX?: number; - - /** Returns the current Y position of the target . - */ - clientY?: number; - - /** returns the target of the current object. - */ - currentTarget?: any; -} - -export interface Fields { - - /** Defines the group name for the item. - */ - group?: string; - - /** Defines the HTML attributes such as id, class, styles for the item to extend the capability. - */ - htmlAttributes?: any; - - /** Defines id for the tag. - */ - id?: string; - - /** Defines the image attributes such as height, width, styles and so on. - */ - imageAttributes?: string; - - /** Defines the imageURL for the image location. - */ - imageUrl?: string; - - /** Defines the sprite CSS for the image tag. - */ - spriteCssClass?: string; - - /** Defines the text content for the tag. - */ - text?: string; - - /** Defines the tooltip text for the tag. - */ - tooltipText?: string; - - /** Allows you to add template as toolbar item - */ - template?: string; -} - -export interface Items { - - /** Defines the group name for the item. - */ - group?: string; - - /** Defines the HTML attributes such as id, class, styles for the item . - */ - htmlAttributes?: any; - - /** Defines id for the tag. - */ - id?: string; - - /** Defines the image attributes such as height, width, styles and so on. - */ - imageAttributes?: string; - - /** Defines the imageURL for the image location. - */ - imageUrl?: string; - - /** Defines the sprite CSS for the image tag. - */ - spriteCssClass?: string; - - /** Defines the text content for the tag. - */ - text?: string; - - /** Defines the tooltip text for the tag. - */ - tooltipText?: string; - - /** Allows to add template as toolbar item. - */ - template?: string; -} - -enum ResponsiveType { - - ///To display the toolbar overflow items as popup - Popup, - - ///To display the toolbar overflow items as inline toolbar - Inline -} - -} - -class TreeView extends ej.Widget { - static fn: TreeView; - constructor(element: JQuery | Element, options?: TreeView.Model); - static Locale: any; - model: TreeView.Model; - defaults: TreeView.Model; - - /** To add a Node or collection of nodes in TreeView. If target tree node is specified, then the given nodes are added as child of target tree node, otherwise nodes are added in TreeView. - * @param {string|any} New node text or JSON object - * @param {string|any} ID of TreeView node/object of TreeView node - * @returns {void} - */ - addNode(newNodeText: string|any, target: string|any): void; - - /** To add a collection of nodes in TreeView. If target tree node is specified, then the given nodes are added as child of target tree node, otherwise nodes are added in TreeView. - * @param {any|Array} New node details in JSON object - * @param {string|any} ID of TreeView node/object of TreeView node - * @returns {void} - */ - addNodes(collection: any|any[], target: string|any): void; - - /** To check all the nodes in TreeView. - * @returns {void} - */ - checkAll(): void; - - /** To check a node in TreeView. - * @param {string|any|Array} ID of TreeView node/object of TreeView node/collection of ID/object of TreeView nodes - * @returns {void} - */ - checkNode(element: string|any|any[]): void; - - /** This method is used to collapse all nodes in TreeView control. If you want to collapse all nodes up to the specific level in - * TreeView control then we need to pass levelUntil as argument to this method. - * @param {number} TreeView nodes will collapse until the given level - * @param {boolean} Weather exclude the hidden nodes of TreeView while collapse all nodes - * @returns {void} - */ - collapseAll(levelUntil?: number, excludeHiddenNodes?: boolean): void; - - /** To collapse a particular node in TreeView. - * @param {string|any|Array} ID of TreeView node|object of TreeView node/collection of ID/object of TreeView nodes - * @returns {void} - */ - collapseNode(element: string|any|any[]): void; - - /** To disable the node in the TreeView. - * @param {string|any|Array} ID of TreeView node/object of TreeView node/collection of ID/object of TreeView nodes - * @returns {void} - */ - disableNode(element: string|any|any[]): void; - - /** To enable the node in the TreeView. - * @param {string|any|Array} ID of TreeView node/object of TreeView node/collection of ID/object of TreeView nodes - * @returns {void} - */ - enableNode(element: string|any|any[]): void; - - /** To ensure that the TreeView node is visible in the TreeView. This method is useful if we need select a TreeView node dynamically. - * @param {string|any} ID of TreeView node/object of TreeView node - * @returns {boolean} - */ - ensureVisible(element: string|any): boolean; - - /** This method is used to expand all nodes in TreeView control. If you want to expand all nodes up to the specific level in TreeView control - * then we need to pass levelUntil as argument to this method. - * @param {number} TreeView nodes will expand until the given level - * @param {boolean} Weather exclude the hidden nodes of TreeView while expand all nodes - * @returns {void} - */ - expandAll(levelUntil?: number, excludeHiddenNodes?: boolean): void; - - /** To expandNode particular node in TreeView. - * @param {string|any|Array} ID of TreeView node/object of TreeView node/collection of ID/object of TreeView nodes - * @returns {void} - */ - expandNode(element: string|any|any[]): void; - - /** To get currently checked nodes in TreeView. - * @returns {any} - */ - getCheckedNodes(): any; - - /** To get currently checked nodes indexes in TreeView. - * @returns {Array} - */ - getCheckedNodesIndex(): any[]; - - /** This method is used to get immediate child nodes of a node in TreeView control. If you want to get the all child nodes include nested - * child nodes then we need to pass includeNestedChild as true along with element arguments to this method. - * @param {string|any} ID of TreeView node/object of TreeView node - * @param {boolean} Weather include nested child nodes of TreeView node - * @returns {Array} - */ - getChildren(element: string|any, includeNestedChild?: boolean): any[]; - - /** To get number of nodes in TreeView. - * @returns {number} - */ - getNodeCount(): number; - - /** To get currently expanded nodes in TreeView. - * @returns {any} - */ - getExpandedNodes(): any; - - /** To get currently expanded nodes indexes in TreeView. - * @returns {Array} - */ - getExpandedNodesIndex(): any[]; - - /** To get TreeView node by using index position in TreeView. - * @param {number} Index position of TreeView node - * @returns {any} - */ - getNodeByIndex(index: number): any; - - /** To get TreeView node data such as id, text, parentId, selected, checked, expanded, level, childes and index. - * @param {string|any} ID of TreeView node/object of TreeView node - * @returns {any} - */ - getNode(element: string|any): any; - - /** To get current index position of TreeView node. - * @param {string|any} ID of TreeView node/object of TreeView node - * @returns {number} - */ - getNodeIndex(element: string|any): number; - - /** To get immediate parent TreeView node of particular TreeView node. - * @param {string|any} ID of TreeView node/object of TreeView node - * @returns {any} - */ - getParent(element: string|any): any; - - /** To get the currently selected node in TreeView. - * @returns {any} - */ - getSelectedNode(): any; - - /** To get the currently selected nodes in TreeView. - * @returns {Array} - */ - getSelectedNodes(): any[]; - - /** To get the index position of currently selected node in TreeView. - * @returns {number} - */ - getSelectedNodeIndex(): number; - - /** To get the index positions of currently selected nodes in TreeView. - * @returns {Array} - */ - getSelectedNodesIndex(): any[]; - - /** To get the text of a node in TreeView. - * @param {string|any} ID of TreeView node/object of TreeView node - * @returns {string} - */ - getText(element: string|any): string; - - /** To get the updated datasource of TreeView after performing some operation like drag and drop, node editing, adding and removing node. - * @param {string|number} ID of TreeView node - * @returns {Array} - */ - getTreeData(id?: string|number): any[]; - - /** To get currently visible nodes in TreeView. - * @returns {any} - */ - getVisibleNodes(): any; - - /** To check a node having child or not. - * @param {string|any} ID of TreeView node/object of TreeView node - * @returns {boolean} - */ - hasChildNode(element: string|any): boolean; - - /** To show nodes in TreeView. - * @returns {void} - */ - hide(): void; - - /** To hide particular node in TreeView. - * @param {string|any|Array} ID of TreeView node/object of TreeView node/collection of ID/object of TreeView nodes - * @returns {void} - */ - hideNode(element: string|any|any[]): void; - - /** To add a Node or collection of nodes after the particular TreeView node. - * @param {string|any} New node text or JSON object - * @param {string|any} ID of TreeView node/object of TreeView node - * @returns {void} - */ - insertAfter(newNodeText: string|any, target: string|any): void; - - /** To add a Node or collection of nodes before the particular TreeView node. - * @param {string|any} New node text or JSON object - * @param {string|any} ID of TreeView node/object of TreeView node - * @returns {void} - */ - insertBefore(newNodeText: string|any, target: string|any): void; - - /** To check the given TreeView node is checked or unchecked. - * @param {string|any} ID of TreeView node/object of TreeView node - * @returns {boolean} - */ - isNodeChecked(element: string|any): boolean; - - /** To check whether the child nodes are loaded of the given TreeView node. - * @param {string|any} ID of TreeView node/object of TreeView node - * @returns {boolean} - */ - isChildLoaded(element: string|any): boolean; - - /** To check the given TreeView node is disabled or enabled. - * @param {string|any} ID of TreeView node/object of TreeView node - * @returns {boolean} - */ - isDisabled(element: string|any): boolean; - - /** To check the given node is exist in TreeView. - * @param {string|any} ID of TreeView node/object of TreeView node - * @returns {boolean} - */ - isExist(element: string|any): boolean; - - /** To get the expand status of the given TreeView node. - * @param {string|any} ID of TreeView node/object of TreeView node - * @returns {boolean} - */ - isExpanded(element: string|any): boolean; - - /** To get the select status of the given TreeView node. - * @param {string|any} ID of TreeView node/object of TreeView node - * @returns {boolean} - */ - isSelected(element: string|any): boolean; - - /** To get the visibility status of the given TreeView node. - * @param {string|any} ID of TreeView node/object of TreeView node - * @returns {boolean} - */ - isVisible(element: string|any): boolean; - - /** To load the TreeView nodes from the particular URL. If target tree node is specified, then the given nodes are added as child of target tree node, otherwise nodes are added in TreeView. - * @param {string} URL location, the data returned from the URL will be loaded in TreeView - * @param {string|any} ID of TreeView node/object of TreeView node - * @returns {void} - */ - loadData(URL: string, target: string|any): void; - - /** To move the TreeView node with in same TreeView. The new position of given TreeView node will be based on destination node and index position. - * @param {string|any} ID of TreeView node/object of TreeView node - * @param {string|any} ID of TreeView node/object of TreeView node - * @param {number} New index position of given source node - * @returns {void} - */ - moveNode(sourceNode: string|any, destinationNode: string|any, index: number): void; - - /** To refresh the TreeView - * @returns {void} - */ - refresh(): void; - - /** To remove all the nodes in TreeView. - * @returns {void} - */ - removeAll(): void; - - /** To remove a node in TreeView. - * @param {string|any|Array} ID of TreeView node/object of TreeView node/collection of ID/object of TreeView nodes - * @returns {void} - */ - removeNode(element: string|any|any[]): void; - - /** To select all the TreeView nodes when enable allowMultiSelection property. - * @returns {void} - */ - selectAll(): void; - - /** This method is used to select a node in TreeView control. If you want to select the collection of nodes in TreeView control then we need to enable allowMultiSelection property. - * @param {string|any|Array} ID of TreeView node/object of TreeView node/ collection of ID/object of TreeView nodes - * @returns {void} - */ - selectNode(element: string|any|any[]): void; - - /** To show nodes in TreeView. - * @returns {void} - */ - show(): void; - - /** To show a node in TreeView. - * @param {string|any|Array} ID of TreeView node/object of TreeView node/collection of ID/object of TreeView nodes - * @returns {void} - */ - showNode(element: string|any|any[]): void; - - /** To uncheck all the nodes in TreeView. - * @returns {void} - */ - unCheckAll(): void; - - /** To uncheck a node in TreeView. - * @param {string|any|Array} ID of TreeView node/object of TreeView node/collection of ID/object of TreeView nodes - * @returns {void} - */ - uncheckNode(element: string|any|any[]): void; - - /** To unselect all the TreeView nodes when enable allowMultiSelection property. - * @returns {void} - */ - unselectAll(): void; - - /** This method is used to unselect a node in TreeView control. If you want to unselect the collection of nodes in TreeView control then we need to enable allowMultiSelection property. - * @param {string|any|Array} ID of TreeView node/object of TreeView node/ collection of ID/object of TreeView nodes - * @returns {void} - */ - unselectNode(element: string|any|any[]): void; - - /** To edit or update the text of the TreeView node. - * @param {string|any} ID of TreeView node/object of TreeView node - * @param {string} New text - * @returns {void} - */ - updateText(target: string|any, newText: string): void; -} -export namespace TreeView { - -export interface Model { - - /** Gets or sets a value that indicates whether to enable drag and drop a node within the same tree. - * @Default {false} - */ - allowDragAndDrop?: boolean; - - /** Gets or sets a value that indicates whether to enable drag and drop a node in inter ej.TreeView. - * @Default {true} - */ - allowDragAndDropAcrossControl?: boolean; - - /** Gets or sets a value that indicates whether to drop a node to a sibling of particular node. - * @Default {true} - */ - allowDropSibling?: boolean; - - /** Gets or sets a value that indicates whether to drop a node to a child of particular node. - * @Default {true} - */ - allowDropChild?: boolean; - - /** Gets or sets a value that indicates whether to enable node editing support for TreeView. - * @Default {false} - */ - allowEditing?: boolean; - - /** Gets or sets a value that indicates whether to enable keyboard support for TreeView actions like nodeSelection, nodeEditing, nodeExpand, nodeCollapse, nodeCut and Paste. - * @Default {true} - */ - allowKeyboardNavigation?: boolean; - - /** Gets or sets a value that indicates whether to enable multi selection support for TreeView. - * @Default {false} - */ - allowMultiSelection?: boolean; - - /** Allow us to specify the parent and child nodes to get auto check while we check or uncheck a node. - * @Default {true} - */ - autoCheck?: boolean; - - /** Allow us to specify the parent node to be retain in checked or unchecked state instead of going for indeterminate state. - * @Default {false} - */ - autoCheckParentNode?: boolean; - - /** Gets or sets a value that indicates the checkedNodes index collection as an array. The given array index position denotes the nodes, that are checked while rendering TreeView. - * @Default {[]} - */ - checkedNodes?: any[]; - - /** Sets the root CSS class for TreeView which allow us to customize the appearance. - */ - cssClass?: string; - - /** Gets or sets a value that indicates whether to enable or disable the animation effect while expanding or collapsing a node. - * @Default {true} - */ - enableAnimation?: boolean; - - /** Gets or sets a value that indicates whether a TreeView can be enabled or disabled. No actions can be performed while this property is set as false - * @Default {true} - */ - enabled?: boolean; - - /** Allow us to prevent multiple nodes to be in expanded state. If it set to false, previously expanded node will be collapsed automatically, while we expand a node. - * @Default {true} - */ - enableMultipleExpand?: boolean; - - /** Sets a value that indicates whether to persist the TreeView model state in page using applicable medium i.e., HTML5 localStorage or cookies - * @Default {false} - */ - enablePersistence?: boolean; - - /** Gets or sets a value that indicates to align content in the TreeView control from right to left by setting the property as true. - * @Default {false} - */ - enableRTL?: boolean; - - /** Gets or sets a array of value that indicates the expandedNodes index collection as an array. The given array index position denotes the nodes, that are expanded while rendering TreeView. - * @Default {[]} - */ - expandedNodes?: any[]; - - /** Gets or sets a value that indicates the TreeView node can be expand or collapse by using the specified action. - * @Default {dblclick} - */ - expandOn?: string; - - /** Gets or sets a fields object that allow us to map the data members with field properties in order to make the data binding easier. - * @Default {null} - */ - fields?: Fields; - - /** Gets or sets a value that indicates whether to enable full row selection support for TreeView. - * @Default {false} - */ - fullRowSelect?: boolean; - - /** Defines the height of the TreeView. - * @Default {Null} - */ - height?: string|number; - - /** Specifies the HTML Attributes for the TreeView. Using this API we can add custom attributes in TreeView control. - * @Default {{}} - */ - htmlAttributes?: any; - - /** Specifies the child nodes to be loaded on demand - * @Default {false} - */ - loadOnDemand?: boolean; - - /** Gets or Sets a value that indicates the index position of a tree node. The particular index tree node will be selected while rendering the TreeView. - * @Default {-1} - */ - selectedNode?: number; - - /** Gets or sets a value that indicates the selectedNodes index collection as an array. The given array index position denotes the nodes, that are selected while rendering TreeView. - * @Default {[]} - */ - selectedNodes?: any[]; - - /** Gets or sets a value that indicates whether to display or hide checkbox for all TreeView nodes. - * @Default {false} - */ - showCheckbox?: boolean; - - /** By using sortSettings property, you can customize the sorting option in TreeView control. - */ - sortSettings?: SortSettings; - - /** Allow us to use custom template in order to create TreeView. - * @Default {null} - */ - template?: string; - - /** Defines the width of the TreeView. - * @Default {Null} - */ - width?: string|number; - - /** Fires before adding node to TreeView. */ - beforeAdd?(e: BeforeAddEventArgs): void; - - /** Fires before collapse a node. */ - beforeCollapse?(e: BeforeCollapseEventArgs): void; - - /** Fires before cut node in TreeView. */ - beforeCut?(e: BeforeCutEventArgs): void; - - /** Fires before deleting node in TreeView. */ - beforeDelete?(e: BeforeDeleteEventArgs): void; - - /** Fires before editing the node in TreeView. */ - beforeEdit?(e: BeforeEditEventArgs): void; - - /** Fires before expanding the node. */ - beforeExpand?(e: BeforeExpandEventArgs): void; - - /** Fires before loading nodes to TreeView. */ - beforeLoad?(e: BeforeLoadEventArgs): void; - - /** Fires before paste node in TreeView. */ - beforePaste?(e: BeforePasteEventArgs): void; - - /** Fires before selecting node in TreeView. */ - beforeSelect?(e: BeforeSelectEventArgs): void; - - /** Fires when TreeView created successfully. */ - create?(e: CreateEventArgs): void; - - /** Fires when TreeView destroyed successfully. */ - destroy?(e: DestroyEventArgs): void; - - /** Fires before nodeEdit Successful. */ - inlineEditValidation?(e: InlineEditValidationEventArgs): void; - - /** Fires when key pressed successfully. */ - keyPress?(e: KeyPressEventArgs): void; - - /** Fires when data load fails. */ - loadError?(e: LoadErrorEventArgs): void; - - /** Fires when data loaded successfully. */ - loadSuccess?(e: LoadSuccessEventArgs): void; - - /** Fires once node added successfully. */ - nodeAdd?(e: NodeAddEventArgs): void; - - /** Fires once node checked successfully. */ - nodeCheck?(e: NodeCheckEventArgs): void; - - /** Fires when node clicked successfully. */ - nodeClick?(e: NodeClickEventArgs): void; - - /** Fires when node collapsed successfully. */ - nodeCollapse?(e: NodeCollapseEventArgs): void; - - /** Fires when node cut successfully. */ - nodeCut?(e: NodeCutEventArgs): void; - - /** Fires when node deleted successfully. */ - nodeDelete?(e: NodeDeleteEventArgs): void; - - /** Fires when node dragging. */ - nodeDrag?(e: NodeDragEventArgs): void; - - /** Fires once node drag start successfully. */ - nodeDragStart?(e: NodeDragStartEventArgs): void; - - /** Fires before the dragged node to be dropped. */ - nodeDragStop?(e: NodeDragStopEventArgs): void; - - /** Fires once node dropped successfully. */ - nodeDropped?(e: NodeDroppedEventArgs): void; - - /** Fires once node edited successfully. */ - nodeEdit?(e: NodeEditEventArgs): void; - - /** Fires once node expanded successfully. */ - nodeExpand?(e: NodeExpandEventArgs): void; - - /** Fires once node pasted successfully. */ - nodePaste?(e: NodePasteEventArgs): void; - - /** Fires when node selected successfully. */ - nodeSelect?(e: NodeSelectEventArgs): void; - - /** Fires once node unchecked successfully. */ - nodeUncheck?(e: NodeUncheckEventArgs): void; - - /** Fires once node unselected successfully. */ - nodeUnselect?(e: NodeUnselectEventArgs): void; - - /** Fires when TreeView nodes are loaded successfully */ - ready?(e: ReadyEventArgs): void; -} - -export interface BeforeAddEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TreeView model - */ - model?: ej.TreeView.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the given new node data - */ - data?: string|any; - - /** returns the parent element, the given new nodes to be appended to the given parent element - */ - targetParent?: any; - - /** returns the given parent node details - */ - parentDetails?: any; -} - -export interface BeforeCollapseEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TreeView model - */ - model?: ej.TreeView.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the value of the node - */ - value?: string; - - /** returns the current element of the node clicked - */ - currentElement?: any; - - /** returns the child nodes are loaded or not - */ - isChildLoaded?: boolean; - - /** returns the id of currently clicked node - */ - id?: string; - - /** returns the parent id of currently clicked node - */ - parentId?: string; - - /** returns the format asynchronous or synchronous - */ - async?: boolean; -} - -export interface BeforeCutEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TreeView model - */ - model?: ej.TreeView.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the event object - */ - event?: any; - - /** returns the target element, the given node to be cut - */ - target?: any; - - /** returns the given target node values - */ - nodeDetails?: any; - - /** returns the key pressed key code value - */ - keyCode?: number; -} - -export interface BeforeDeleteEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TreeView model - */ - model?: ej.TreeView.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the event object - */ - event?: any; - - /** returns the target element, the given node to be deleted - */ - target?: any; - - /** returns the given target node values - */ - nodeDetails?: any; - - /** returns the current parent element of the target node - */ - parentElement?: any; - - /** returns the parent node values - */ - parentDetails?: any; - - /** returns the currently removed nodes - */ - removedNodes?: any[]; -} - -export interface BeforeEditEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TreeView model - */ - model?: ej.TreeView.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the current element of the node clicked - */ - currentElement?: any; -} - -export interface BeforeExpandEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TreeView model - */ - model?: ej.TreeView.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the value of the node - */ - value?: string; - - /** if the child node is ready to expanded state; otherwise, false. - */ - isChildLoaded?: boolean; - - /** returns the current element of the node clicked - */ - currentElement?: any; - - /** returns the id of currently clicked node - */ - id?: string; - - /** returns the parent id of currently clicked node - */ - parentId?: string; - - /** returns the format asynchronous or synchronous - */ - async?: boolean; -} - -export interface BeforeLoadEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TreeView model - */ - model?: ej.TreeView.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the AJAX settings object - */ - AjaxOptions?: any; -} - -export interface BeforePasteEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TreeView model - */ - model?: ej.TreeView.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the event object - */ - event?: any; - - /** returns the target element, the given node to be pasted - */ - target?: any; - - /** returns the given target node values - */ - nodeDetails?: any; - - /** returns the key pressed key code value - */ - keyCode?: number; -} - -export interface BeforeSelectEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TreeView model - */ - model?: ej.TreeView.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the target element, the given node to be selected - */ - target?: any; - - /** returns the given target node values - */ - nodeDetails?: any; -} - -export interface CreateEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TreeView model - */ - model?: ej.TreeView.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface DestroyEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TreeView model - */ - model?: ej.TreeView.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface InlineEditValidationEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TreeView model - */ - model?: ej.TreeView.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the new entered text for the node - */ - newText?: string; - - /** returns the current node element id - */ - id?: any; - - /** returns the old node text - */ - oldText?: string; -} - -export interface KeyPressEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TreeView model - */ - model?: ej.TreeView.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the event object - */ - event?: any; - - /** returns the current element of the node clicked - */ - currentElement?: any; - - /** returns the value of the node - */ - value?: string; - - /** returns node path from root element - */ - path?: string; - - /** returns the key pressed key code value - */ - keyCode?: number; - - /** it returns when the current node is in expanded state; otherwise, false. - */ - isExpanded?: boolean; - - /** returns the id of current TreeView node - */ - id?: string; - - /** returns the parentId of current TreeView node - */ - parentId?: string; -} - -export interface LoadErrorEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TreeView model - */ - model?: ej.TreeView.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the AJAX error object - */ - error?: any; -} - -export interface LoadSuccessEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TreeView model - */ - model?: ej.TreeView.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the success data from the URL - */ - data?: any; - - /** returns the target parent element, the data returned from the URL to be appended to the given parent element, else in TreeView - */ - targetParent?: any; - - /** returns the given parent node details - */ - parentDetails?: any; -} - -export interface NodeAddEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TreeView model - */ - model?: ej.TreeView.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the added data, that are given initially - */ - data?: any; - - /** returns the newly added elements - */ - nodes?: any; - - /** returns the target parent element of the added element - */ - parentElement?: any; - - /** returns the given parent node details - */ - parentDetails?: any; -} - -export interface NodeCheckEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TreeView model - */ - model?: ej.TreeView.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the event object - */ - event?: any; - - /** returns the value of the node - */ - value?: string; - - /** returns the id of the current element of the node clicked - */ - id?: string; - - /** returns the id of the parent element of current element of the node clicked - */ - parentId?: string; - - /** returns the current element of the node clicked - */ - currentElement?: any; - - /** it returns true when the node checkbox is checked; otherwise, false. - */ - isChecked?: boolean; - - /** it returns the currently checked node name - */ - currentNode?: any[]; - - /** it returns the currently checked and its child node details - */ - currentCheckedNodes?: any[]; -} - -export interface NodeClickEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TreeView model - */ - model?: ej.TreeView.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the event object - */ - event?: any; - - /** returns the current element of the node clicked - */ - currentElement?: any; - - /** returns the id of currently clicked TreeView node - */ - id?: string; - - /** returns the parentId of currently clicked TreeView node - */ - parentId?: string; -} - -export interface NodeCollapseEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TreeView model - */ - model?: ej.TreeView.Model; - - /** returns the id of the current element of the node clicked - */ - id?: string; - - /** returns the name of the event - */ - type?: string; - - /** returns the id of the parent element of current element of the node clicked - */ - parentId?: string; - - /** returns the value of the node - */ - value?: string; - - /** returns the current element of the node clicked - */ - currentElement?: any; - - /** returns the child nodes are loaded or not - */ - isChildLoaded?: boolean; - - /** returns the format asynchronous or synchronous - */ - async?: boolean; -} - -export interface NodeCutEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TreeView model - */ - model?: ej.TreeView.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the event object - */ - event?: any; - - /** returns the current parent element of the cut node - */ - parentElement?: any; - - /** returns the given parent node details - */ - parentDetails?: any; - - /** returns the key pressed key code value - */ - keyCode?: number; -} - -export interface NodeDeleteEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TreeView model - */ - model?: ej.TreeView.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the event object - */ - event?: any; - - /** returns the current parent element of the deleted node - */ - parentElement?: any; - - /** returns the given parent node details - */ - parentDetails?: any; - - /** returns the currently removed nodes - */ - removedNodes?: any[]; -} - -export interface NodeDragEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TreeView model - */ - model?: ej.TreeView.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the original drag target - */ - dragTarget?: any; - - /** returns the current target TreeView node - */ - target?: any; - - /** returns the current target details - */ - targetElementData?: any; - - /** returns the current parent element of the target node - */ - draggedElement?: any; - - /** returns the given parent node details - */ - draggedElementData?: any; - - /** returns the event object - */ - event?: any; -} - -export interface NodeDragStartEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TreeView model - */ - model?: ej.TreeView.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the original drag target - */ - dragTarget?: any; - - /** returns the current dragging parent TreeView node - */ - parentElement?: any; - - /** returns the current dragging parent TreeView node details - */ - parentElementData?: any; - - /** returns the current parent element of the dragging node - */ - target?: any; - - /** returns the given parent node details - */ - targetElementData?: any; - - /** returns the event object - */ - event?: any; -} - -export interface NodeDragStopEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TreeView model - */ - model?: ej.TreeView.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the original drop target - */ - dropTarget?: any; - - /** returns the current dragged TreeView node - */ - draggedElement?: any; - - /** returns the current dragged TreeView node details - */ - draggedElementData?: any; - - /** returns the current parent element of the dragged node - */ - target?: any; - - /** returns the given parent node details - */ - targetElementData?: any; - - /** returns the drop position such as before, after or over - */ - position?: string; - - /** returns the event object - */ - event?: any; -} - -export interface NodeDroppedEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TreeView model - */ - model?: ej.TreeView.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the original drop target - */ - dropTarget?: any; - - /** returns the current dropped TreeView node - */ - droppedElement?: any; - - /** returns the current dropped TreeView node details - */ - droppedElementData?: any; - - /** returns the current parent element of the dropped node - */ - target?: any; - - /** returns the given parent node details - */ - targetElementData?: any; - - /** returns the drop position such as before, after or over - */ - position?: string; - - /** returns the event object - */ - event?: any; -} - -export interface NodeEditEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TreeView model - */ - model?: ej.TreeView.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the id of the element - */ - id?: string; - - /** returns the oldText of the element - */ - oldText?: string; - - /** returns the newText of the element - */ - newText?: string; - - /** returns the event object - */ - event?: any; - - /** returns the target element, the given node to be cut - */ - target?: any; - - /** returns the given target node values - */ - nodeDetails?: any; -} - -export interface NodeExpandEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TreeView model - */ - model?: ej.TreeView.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the value of the node - */ - value?: string; - - /** if the child node is ready to expanded state; otherwise, false. - */ - isChildLoaded?: boolean; - - /** returns the current element of the node clicked - */ - currentElement?: any; - - /** returns the id of currently clicked node - */ - id?: string; - - /** returns the parent id of currently clicked node - */ - parentId?: string; - - /** returns the format asynchronous or synchronous - */ - async?: boolean; -} - -export interface NodePasteEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TreeView model - */ - model?: ej.TreeView.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the event object - */ - event?: any; - - /** returns the pasted element - */ - target?: any; - - /** returns the given target node values - */ - nodeDetails?: any; - - /** returns the key pressed key code value - */ - keyCode?: number; -} - -export interface NodeSelectEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TreeView model - */ - model?: ej.TreeView.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the id of the current element of the node clicked - */ - id?: any; - - /** returns the id of the parent element of current element of the node clicked - */ - parentId?: any; - - /** returns the current selected nodes index of TreeView - */ - selectedNodes?: any[]; - - /** returns the value of the node - */ - value?: string; - - /** returns the current element of the node clicked - */ - currentElement?: any; -} - -export interface NodeUncheckEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TreeView model - */ - model?: ej.TreeView.Model; - - /** returns the name of the event - */ - type?: string; - - /** returns the event object - */ - event?: any; - - /** returns the id of the current element of the node clicked - */ - id?: any; - - /** returns the id of the parent element of current element of the node clicked - */ - parentId?: any; - - /** returns the value of the node - */ - value?: string; - - /** returns the current element of the node clicked - */ - currentElement?: any; - - /** it returns true when the node checkbox is checked; otherwise, false. - */ - isChecked?: boolean; - - /** it returns currently unchecked node name - */ - currentNode?: string; - - /** it returns currently unchecked node and its child node details. - */ - currentUncheckedNodes?: any[]; -} - -export interface NodeUnselectEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the current element of the node unselected - */ - currentElement?: any; - - /** returns the id of the current element of the node unselected - */ - id?: string; - - /** returns the TreeView model - */ - model?: ej.TreeView.Model; - - /** returns the id of the parent element of current element of the node unselected - */ - parentId?: string; - - /** returns the current selected nodes index of TreeView - */ - selectedNodes?: any[]; - - /** returns the name of the event - */ - type?: string; - - /** returns the value of the node - */ - value?: string; -} - -export interface ReadyEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the TreeView model - */ - model?: ej.TreeView.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface Fields { - - /** It receives the child level or inner level data source such as Essential DataManager object and JSON object. - */ - child?: any; - - /** It receives Essential DataManager object and JSON object. - */ - dataSource?: any; - - /** Specifies the node to be in expanded state. - */ - expanded?: string; - - /** Its allow us to indicate whether the node has child or not in load on demand - */ - hasChild?: string; - - /** Specifies the HTML Attributes to "li" item list. - */ - htmlAttribute?: any; - - /** Specifies the id to TreeView node items list. - */ - id?: string; - - /** Specifies the image attribute to “img” tag inside items list - */ - imageAttribute?: any; - - /** Specifies the HTML Attributes to "li" item list. - */ - imageUrl?: string; - - /** If its true Checkbox node will be checked when rendered with checkbox. - */ - isChecked?: string; - - /** Specifies the link attribute to “a” tag in item list. - */ - linkAttribute?: any; - - /** Specifies the parent id of the node. The nodes are listed as child nodes of the specified parent node by using its parent id. - */ - parentId?: string; - - /** It receives query to retrieve data from the table (query is same as SQL). - */ - query?: any; - - /** Allow us to specify the node to be in selected state - */ - selected?: string; - - /** Specifies the sprite CSS class to "li" item list. - */ - spriteCssClass?: string; - - /** It receives the table name to execute query on the corresponding table. - */ - tableName?: string; - - /** Specifies the text of TreeView node items list. - */ - text?: string; -} - -export interface SortSettings { - - /** Enables or disables the sorting option in TreeView control - * @Default {false} - */ - allowSorting?: boolean; - - /** Sets the sorting order type. There are two sorting types available, such as "ascending", "descending". - * @Default {ej.sortOrder.Ascending} - */ - sortOrder?: ej.sortOrder|string; -} -} -enum sortOrder { -//Enum for Ascending sort order -Ascending, -//Enum for Descending sort order -Descending, -} - -class Uploadbox extends ej.Widget { - static fn: Uploadbox; - constructor(element: JQuery | Element, options?: Uploadbox.Model); - static Locale: any; - model: Uploadbox.Model; - defaults: Uploadbox.Model; - - /** The destroy method destroys the control and brings the control to a pre-init state. All the events of the Upload control is bound by using this._on unbinds automatically. - * @returns {void} - */ - destroy(): void; - - /** Disables the Uploadbox control - * @returns {void} - */ - disable(): void; - - /** Enables the Uploadbox control - * @returns {void} - */ - enable(): void; - - /** Refresh the Uploadbox control - * @returns {void} - */ - refresh(): void; -} -export namespace Uploadbox { - -export interface Model { - - /** Enables the file drag and drop support to the Uploadbox control. - * @Default {false} - */ - allowDragAndDrop?: boolean; - - /** Uploadbox supports both synchronous and asynchronous upload. This can be achieved by using the asyncUpload property. - * @Default {true} - */ - asyncUpload?: boolean; - - /** Uploadbox supports auto uploading of files after the file selection is done. - * @Default {false} - */ - autoUpload?: boolean; - - /** Sets the text for each action button. - * @Default {{browse: Browse, upload: Upload, cancel: Cancel, close: Close}} - */ - buttonText?: ButtonText; - - /** Sets the root class for the Uploadbox control theme. This cssClass API helps to use custom skinning option for the Uploadbox button and dialog content. - */ - cssClass?: string; - - /** Specifies the custom file details in the dialog popup on initialization. - * @Default {{ title:true, name:true, size:true, status:true, action:true}} - */ - customFileDetails?: CustomFileDetails; - - /** Specifies the actions for dialog popup while initialization. - * @Default {{ modal:false, closeOnComplete:false, content:null, drag:true}} - */ - dialogAction?: DialogAction; - - /** Displays the Uploadbox dialog at the given X and Y positions. X: Dialog sets the left position value. Y: Dialog sets the top position value. - * @Default {null} - */ - dialogPosition?: any; - - /** Property for applying the text to the Dialog title and content headers. - * @Default {{ title: Upload Box, name: Name, size: Size, status: Status}} - */ - dialogText?: DialogText; - - /** The dropAreaText is displayed when the drag and drop support is enabled in the Uploadbox control. - * @Default {Drop files or click to upload} - */ - dropAreaText?: string; - - /** Specifies the dropAreaHeight when the drag and drop support is enabled in the Uploadbox control. - * @Default {100%} - */ - dropAreaHeight?: number|string; - - /** Specifies the dropAreaWidth when the drag and drop support is enabled in the Uploadbox control. - * @Default {100%} - */ - dropAreaWidth?: number|string; - - /** Based on the property value, Uploadbox is enabled or disabled. - * @Default {true} - */ - enabled?: boolean; - - /** Sets the right-to-left direction property for the Uploadbox control. - * @Default {false} - */ - enableRTL?: boolean; - - /** Only the files with the specified extension is allowed to upload. This is mentioned in the string format. - */ - extensionsAllow?: string; - - /** Only the files with the specified extension is denied for upload. This is mentioned in the string format. - */ - extensionsDeny?: string; - - /** Sets the maximum size limit for uploading the file. This is mentioned in the number format. - * @Default {31457280} - */ - fileSize?: number; - - /** Sets the height of the browse button. - * @Default {35px} - */ - height?: string; - - /** Specifies the list of HTML attributes to be added to uploadbox control. - * @Default {{}} - */ - htmlAttributes?: any; - - /** Configures the culture data and sets the culture to the Uploadbox. - * @Default {en-US} - */ - locale?: string; - - /** Enables multiple file selection for upload. - * @Default {true} - */ - multipleFilesSelection?: boolean; - - /** You can push the file to the Uploadbox in the client-side of the XHR supported browsers alone. - * @Default {null} - */ - pushFile?: any; - - /** Specifies the remove action to be performed after the file uploading is completed. Here, mention the server address for removal. - */ - removeUrl?: string; - - /** Specifies the save action to be performed after the file is pushed for uploading. Here, mention the server address to be saved. - */ - saveUrl?: string; - - /** Enables the browse button support to the Uploadbox control. - * @Default {true} - */ - showBrowseButton?: boolean; - - /** Specifies the file details to be displayed when selected for uploading. This can be done when the showFileDetails is set to true. - * @Default {true} - */ - showFileDetails?: boolean; - - /** Specifies the file details to be displayed when selected for uploading. This can be done when the showFileDetails is set to true. - * @Default {true} - */ - showRoundedCorner?: boolean; - - /** Sets the name for the Uploadbox control. This API helps to Map the action in code behind to retrieve the files. - */ - uploadName?: string; - - /** Sets the width of the browse button. - * @Default {100px} - */ - width?: string; - - /** Fires when the upload progress beforeSend. */ - beforeSend?(e: BeforeSendEventArgs): void; - - /** Fires when the upload progress begins. */ - begin?(e: BeginEventArgs): void; - - /** Fires when the upload progress is cancelled. */ - cancel?(e: CancelEventArgs): void; - - /** Fires when the file upload progress is completed. */ - complete?(e: CompleteEventArgs): void; - - /** Fires when the file upload progress is succeeded. */ - success?(e: SuccessEventArgs): void; - - /** Fires when the Uploadbox control is created. */ - create?(e: CreateEventArgs): void; - - /** Fires when the Uploadbox control is destroyed. */ - destroy?(e: DestroyEventArgs): void; - - /** Fires when the Upload process ends in Error. */ - error?(e: ErrorEventArgs): void; - - /** Fires when the file is selected for upload successfully. */ - fileSelect?(e: FileSelectEventArgs): void; - - /** Fires when the file is uploading. */ - inProgress?(e: InProgressEventArgs): void; - - /** Fires when the uploaded file is removed successfully. */ - remove?(e: RemoveEventArgs): void; -} - -export interface BeforeSendEventArgs { - - /** Selected FileList Object. - */ - files?: any; - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the Uploadbox model - */ - model?: any; - - /** XHR-AJAX Object for reference. - */ - xhr?: any; - - /** returns the name of the event. - */ - type?: string; -} - -export interface BeginEventArgs { - - /** To pass additional information to the server. - */ - data?: any; - - /** Selected FileList Object. - */ - files?: any; - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the Uploadbox model - */ - model?: any; - - /** returns the name of the event. - */ - type?: string; -} - -export interface CancelEventArgs { - - /** Canceled FileList Object. - */ - fileStatus?: any; - - /** returns the Uploadbox model - */ - model?: any; - - /** returns the name of the event. - */ - type?: string; -} - -export interface CompleteEventArgs { - - /** AJAX event argument for reference. - */ - e?: any; - - /** Uploaded file list. - */ - files?: any; - - /** response from the server. - */ - responseText?: string; - - /** XHR-AJAX Object for reference. - */ - xhr?: any; - - /** returns the Uploadbox model - */ - model?: any; - - /** returns the name of the event. - */ - type?: string; -} - -export interface SuccessEventArgs { - - /** response from the server. - */ - responseText?: string; - - /** AJAX event argument for reference. - */ - e?: any; - - /** successfully uploaded files list. - */ - success?: any; - - /** Uploaded file list. - */ - files?: any; - - /** XHR-AJAX Object for reference. - */ - xhr?: any; - - /** returns the Uploadbox model - */ - model?: any; - - /** returns the name of the event. - */ - type?: string; -} - -export interface CreateEventArgs { - - /** returns the Uploadbox model - */ - model?: any; - - /** returns the name of the event. - */ - type?: string; -} - -export interface DestroyEventArgs { - - /** returns the Uploadbox model - */ - model?: any; - - /** returns the name of the event. - */ - type?: string; -} - -export interface ErrorEventArgs { - - /** details about the error information. - */ - error?: string; - - /** returns the name of the event. - */ - type?: string; - - /** error event action details. - */ - action?: string; - - /** returns the file details of the file uploaded - */ - files?: any; -} - -export interface FileSelectEventArgs { - - /** returns Selected FileList objects - */ - files?: any; - - /** returns the Uploadbox model - */ - model?: any; - - /** returns the name of the event. - */ - type?: string; -} - -export interface InProgressEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** AJAX event argument for reference. - */ - e?: any; - - /** returns Selected FileList objects - */ - files?: any; - - /** returns the Uploadbox model - */ - model?: any; - - /** returns the current progress percentage. - */ - percentage?: any; - - /** returns the name of the event. - */ - type?: string; -} - -export interface RemoveEventArgs { - - /** returns the Uploadbox model - */ - model?: any; - - /** returns the name of the event. - */ - type?: string; - - /** returns the file details of the file object - */ - fileStatus?: any; -} - -export interface ButtonText { - - /** Sets the text for the browse button. - */ - browse?: string; - - /** Sets the text for the cancel button. - */ - cancel?: string; - - /** Sets the text for the close button. - */ - Close?: string; - - /** Sets the text for the Upload button inside the dialog popup. - */ - upload?: string; -} - -export interface CustomFileDetails { - - /** Enables the file upload interactions like remove/cancel in File details of the dialog popup. - */ - action?: boolean; - - /** Enables the name in the File details of the dialog popup. - */ - name?: boolean; - - /** Enables or disables the File size details of the dialog popup. - */ - size?: boolean; - - /** Enables or disables the file uploading status visibility in the dialog file details content. - */ - status?: boolean; - - /** Enables the title in File details for the dialog popup. - */ - title?: boolean; -} - -export interface DialogAction { - - /** Once uploaded successfully, the dialog popup closes immediately. - */ - closeOnComplete?: boolean; - - /** Sets the content container option to the Uploadbox dialog popup. - */ - content?: string; - - /** Enables the drag option to the dialog popup. - */ - drag?: boolean; - - /** Enables or disables the Uploadbox dialog’s modal property to the dialog popup. - */ - modal?: boolean; -} - -export interface DialogText { - - /** Sets the uploaded file’s Name (header text) to the Dialog popup. - */ - name?: string; - - /** Sets the upload file Size (header text) to the dialog popup. - */ - size?: string; - - /** Sets the upload file Status (header text) to the dialog popup. - */ - status?: string; - - /** Sets the title text of the dialog popup. - */ - title?: string; -} -} - -class WaitingPopup extends ej.Widget { - static fn: WaitingPopup; - constructor(element: JQuery | Element, options?: WaitingPopup.Model); - static Locale: any; - model: WaitingPopup.Model; - defaults: WaitingPopup.Model; - - /** To hide the waiting popup - * @returns {void} - */ - hide(): void; - - /** Refreshes the WaitingPopup control by resetting the pop-up panel position and content position - * @returns {void} - */ - refresh(): void; - - /** To show the waiting popup - * @returns {void} - */ - show(): void; -} -export namespace WaitingPopup { - -export interface Model { - - /** Sets the root class for the WaitingPopup control theme - * @Default {null} - */ - cssClass?: string; - - /** Specifies the list of HTML attributes to be added to waitingpopup control. - * @Default {{}} - */ - htmlAttributes?: any; - - /** Enables or disables the default loading icon. - * @Default {true} - */ - showImage?: boolean; - - /** Enables the visibility of the WaitingPopup control - * @Default {false} - */ - showOnInit?: boolean; - - /** Specified a selector for elements, within the container. - * @Default {null} - */ - target?: string; - - /** Waitingpopup element append to given container element. - * @Default {null} - */ - appendTo?: string; - - /** Loads HTML content inside the popup panel instead of the default icon - * @Default {null} - */ - template?: any; - - /** Sets the custom text in the pop-up panel to notify the waiting process - * @Default {null} - */ - text?: string; - - /** Fires after Create WaitingPopup successfully */ - create?(e: CreateEventArgs): void; - - /** Fires after Destroy WaitingPopup successfully */ - destroy?(e: DestroyEventArgs): void; -} - -export interface CreateEventArgs { - - /** returns the cancel option value - */ - cancel?: boolean; - - /** returns the WaitingPopup model - */ - model?: ej.WaitingPopup.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface DestroyEventArgs { - - /** returns the cancel option value - */ - cancel?: boolean; - - /** returns the WaitingPopup model - */ - model?: ej.WaitingPopup.Model; - - /** returns the name of the event - */ - type?: string; -} -} - -class Grid extends ej.Widget { - static fn: Grid; - constructor(element: JQuery | Element, options?: Grid.Model); - static Locale: any; - model: Grid.Model; - defaults: Grid.Model; - - /** Adds a grid model property which is to be ignored upon exporting. - * @param {Array} Pass the array of parameters which need to be ignored on exporting - * @returns {void} - */ - addIgnoreOnExport(propertyNames: any[]): void; - - /** Add a new record in grid control when allowAdding is set as true. - * @returns {void} - */ - //addRecord(): void; - - /** Add a new record in grid control when allowAdding is set as true. - * @param {Array} Pass the array of added Records - * @param {Array} optionalIf we pass serverChange as true, send post to server side for server action. - * @returns {void} - */ - addRecord(data: any[], serverChange?: any[]): void; - - /** Cancel the modified changes in grid control when edit mode is "batch". - * @returns {void} - */ - batchCancel(): void; - - /** Save the modified changes to data source in grid control when edit mode is "batch". - * @returns {void} - */ - batchSave(): void; - - /** Send a cancel request in grid. - * @returns {void} - */ - cancelEdit(): void; - - /** Send a cancel request to the edited cell in grid. - * @returns {void} - */ - cancelEditCell(): void; - - /** It is used to clear all the cell selection. - * @returns {Boolean} - */ - clearCellSelection(): boolean; - - /** It is used to clear specified cell selection based on the rowIndex and columnIndex provided. - * @param {number} It is used to pass the row index of the cell - * @param {number} It is used to pass the column index of the cell. - * @returns {Boolean} - */ - clearCellSelection(rowIndex: number, columnIndex: number): boolean; - - /** It is used to clear all the row selection or at specific row selection based on the index provided. - * @param {number} optional If index of the column is specified then it will remove the selection from the particular column else it will clears all of the column selection - * @returns {Boolean} - */ - clearColumnSelection(index?: number): boolean; - - /** It is used to clear all the filtering done. - * @param {string} If field of the column is specified then it will clear the particular filtering column - * @returns {void} - */ - clearFiltering(field: string): void; - - /** Clear the searching from the grid - * @returns {void} - */ - clearSearching(): void; - - /** Clear all the row selection or at specific row selection based on the index provided - * @param {number} optional If index of the row is specified then it will remove the selection from the particular row else it will clears all of the row selection - * @returns {Boolean} - */ - clearSelection(index?: number): boolean; - - /** Clear the sorting from columns in the grid - * @returns {void} - */ - clearSorting(): void; - - /** Collapse all the group caption rows in grid - * @returns {void} - */ - collapseAll(): void; - - /** Collapse the group drop area in grid - * @returns {void} - */ - collapseGroupDropArea(): void; - - /** Add or remove columns in grid column collections - * @param {Array|string} Pass array of columns or string of field name to add/remove the column in grid - * @param {string} optional Pass add/remove action to be performed. By default "add" action will perform - * @returns {void} - */ - columns(columnDetails: any[]|string, action?: string): void; - - /** Refresh the grid with new data source - * @param {Array} Pass new data source to the grid - * @param {boolean} optional When templateRefresh is set true, both header and contents get refreshed - * @returns {void} - */ - dataSource(datasource: any[], templateRefresh?: boolean): void; - - /** Delete a record in grid control when allowDeleting is set as true - * @param {string} Pass the primary key field Name of the column - * @param {Array} Pass the JSON data of record need to be delete. - * @returns {void} - */ - deleteRecord(fieldName: string, data: any[]): void; - - /** Destroy the grid widget all events bound using this._on will be unbind automatically and bring the control to pre-init state. - * @returns {void} - */ - destroy(): void; - - /** Edit a particular cell based on the row index and field name provided in "batch" edit mode. - * @param {number} Pass row index to edit particular cell - * @param {string} Pass the field name of the column to perform batch edit - * @returns {void} - */ - editCell(index: number, fieldName: string): void; - - /** Send a save request in grid. - * @returns {void} - */ - endEdit(): void; - - /** Expand all the group caption rows in grid. - * @returns {void} - */ - expandAll(): void; - - /** Expand or collapse the row based on the row state in grid - * @param {JQuery} Pass the target object to expand/collapse the row based on its row state - * @returns {void} - */ - expandCollapse($target: JQuery): void; - - /** Expand the group drop area in grid. - * @returns {void} - */ - expandGroupDropArea(): void; - - /** Export the grid content to excel, word or PDF document. - * @param {string} Pass the controller action name corresponding to exporting - * @param {string} optionalASP server event name corresponding to exporting - * @param {boolean} optionalPass the multiple exporting value as true/false - * @param {Array} optionalPass the array of the gridIds to be filtered - * @returns {void} - */ - export(action: string, serverEvent?: string, multipleExport?: boolean, gridIds?: any[]): void; - - /** Send a filtering request to filter one column in grid. - * @param {Array} Pass the field name of the column - * @param {string} string/integer/dateTime operator - * @param {string} Pass the value to be filtered in a column - * @param {string} Pass the predicate as and/or - * @param {boolean} optional Pass the match case value as true/false - * @param {any} optionalactualFilterValue denote the filter object of current filtered columns.Pass the value to filtered in a column - * @returns {void} - */ - filterColumn(fieldName: any[], filterOperator: string, filterValue: string, predicate: string, matchcase?: boolean, actualFilterValue?: any): void; - - /** Send a filtering request to filter single or multiple column in grid. - * @param {Array} Pass array of filterColumn query for performing filter operation - * @returns {void} - */ - filterColumn(filterQueries: any[]): void; - - /** Get the batch changes of edit, delete and add operations of grid. - * @returns {any} - */ - getBatchChanges(): any; - - /** Get the browser details - * @returns {any} - */ - getBrowserDetails(): any; - - /** Get the column details based on the given field in grid - * @param {string} Pass the field name of the column to get the corresponding column object - * @returns {any} - */ - getColumnByField(fieldName: string): any; - - /** Get the column details based on the given header text in grid. - * @param {string} Pass the header text of the column to get the corresponding column object - * @returns {any} - */ - getColumnByHeaderText(headerText: string): any; - - /** Get the column details based on the given column index in grid - * @param {number} Pass the index of the column to get the corresponding column object - * @returns {any} - */ - getColumnByIndex(columnIndex: number): any; - - /** Get the list of field names from column collection in grid. - * @returns {Array} - */ - getColumnFieldNames(): any[]; - - /** Get the column index of the given field in grid. - * @param {string} Pass the field name of the column to get the corresponding column index - * @returns {number} - */ - getColumnIndexByField(fieldName: string): number; - - /** Get the content div element of grid. - * @returns {HTMLElement} - */ - getContent(): HTMLElement; - - /** Get the content table element of grid - * @returns {Array} - */ - getContentTable(): HTMLTableElement[]; - - /** Get the data of currently edited cell value in "batch" edit mode - * @returns {any} - */ - getCurrentEditCellData(): any; - - /** Get the current page index in grid pager. - * @returns {number} - */ - getCurrentIndex(): number; - - /** Get the current page data source of grid. - * @returns {Array} - */ - getCurrentViewData(): any[]; - - /** Get the column field name from the given header text in grid. - * @param {string} Pass header text of the column to get its corresponding field name - * @returns {String} - */ - getFieldNameByHeaderText(headerText: string): string; - - /** Get the filter bar of grid - * @returns {HTMLElement} - */ - getFilterBar(): HTMLElement; - - /** Get the records filtered or searched in Grid - * @returns {Array} - */ - getFilteredRecords(): any[]; - - /** Get the footer content of grid. - * @returns {HTMLElement} - */ - getFooterContent(): HTMLElement; - - /** Get the footer table element of grid. - * @returns {HTMLElement} - */ - getFooterTable(): HTMLElement; - - /** Get the header content div element of grid. - * @returns {HTMLElement} - */ - getHeaderContent(): HTMLElement; - - /** Get the header table element of grid - * @returns {HTMLElement} - */ - getHeaderTable(): HTMLElement; - - /** Get the column header text from the given field name in grid. - * @param {string} Pass field name of the column to get its corresponding header text - * @returns {String} - */ - getHeaderTextByFieldName(field: string): string; - - /** Get the names of all the hidden column collections in grid. - * @returns {Array} - */ - getHiddenColumnNames(): any[]; - - /** Get the row index based on the given tr element in grid. - * @param {JQuery} Pass the tr element in grid content to get its row index - * @returns {number} - */ - getIndexByRow($tr: JQuery): number; - - /** Get the pager of grid. - * @returns {HTMLElement} - */ - getPager(): HTMLElement; - - /** Get the names of primary key columns in Grid - * @returns {Array} - */ - getPrimaryKeyFieldNames(): any[]; - - /** Get the rows(tr element) from the given from and to row index in grid - * @param {number} Pass the from index from which the rows to be returned - * @param {number} Pass the to index to which the rows to be returned - * @returns {HTMLElement} - */ - getRowByIndex(from: number, to: number): HTMLElement; - - /** Get the row height of grid. - * @returns {number} - */ - getRowHeight(): number; - - /** Get the rows(tr element)of grid which is displayed in the current page. - * @returns {HTMLElement} - */ - getRows(): HTMLElement; - - /** Get the scroller object of grid. - * @returns {ej.Scroller} - */ - getScrollObject(): ej.Scroller; - - /** Get the selected records details in grid. - * @returns {Array} - */ - getSelectedRecords(): any[]; - - /** Get the calculated summary values of JSON data passed to it - * @param {any} Pass Summary Column details - * @param {any} Pass JSON Array for which its field values to be calculated - * @returns {Number} - */ - getSummaryValues(summaryCol: any, summaryData: any): number; - - /** Get the names of all the visible column collections in grid - * @returns {Array} - */ - getVisibleColumnNames(): any[]; - - /** Send a paging request to specified page in grid - * @param {number} Pass the page index to perform paging at specified page index - * @returns {void} - */ - gotoPage(pageIndex: number): void; - - /** Send a column grouping request in grid. - * @param {string} Pass the field Name of the column to be grouped in grid control - * @returns {void} - */ - groupColumn(fieldName: string): void; - - /** Hide columns from the grid based on the header text - * @param {Array|string} you can pass either array of header text of various columns or a header text of a column to hide - * @returns {void} - */ - hideColumns(headerText: any[]|string): void; - - /** Print the grid control - * @returns {void} - */ - print(): void; - - /** It is used to refresh and reset the changes made in "batch" edit mode - * @returns {void} - */ - refreshBatchEditChanges(): void; - - /** It is used to refresh the grid header. - * @returns {void} - */ - refreshHeader(): void; - - /** Refresh the grid contents. The template refreshment is based on the argument passed along with this method - * @param {boolean} optional When templateRefresh is set true, template and grid contents both are refreshed in grid else only grid content is refreshed - * @returns {void} - */ - refreshContent(templateRefresh?: boolean): void; - - /** Refresh the template of the grid - * @returns {void} - */ - refreshTemplate(): void; - - /** Refresh the toolbar items in grid. - * @returns {void} - */ - refreshToolbar(): void; - - /** Remove a column or collection of columns from a sorted column collections in grid. - * @param {Array|string} Pass array of field names of the columns to remove a collection of sorted columns or pass a string of field name to remove a column from sorted column collections - * @returns {void} - */ - removeSortedColumns(fieldName: any[]|string): void; - - /** Creates a grid control - * @returns {void} - */ - render(): void; - - /** Re-order the column in grid - * @param {string} Pass the from field name of the column needs to be changed - * @param {string} Pass the to field name of the column needs to be changed - * @returns {void} - */ - reorderColumns(fromFieldName: string, toFieldName: string): void; - - /** Reset the model collections like pageSettings, groupSettings, filterSettings, sortSettings and summaryRows. - * @returns {void} - */ - resetModelCollections(): void; - - /** Resize the columns by giving column name and width for the corresponding one. - * @param {string} Pass the column name that needs to be changed - * @param {string} Pass the width to resize the particular columns - * @returns {void} - */ - resizeColumns(column: string, width: string): void; - - /** Resolves row height issue when unbound column is used with FrozenColumn - * @returns {void} - */ - rowHeightRefresh(): void; - - /** Save the particular edited cell in grid. - * @returns {void} - */ - //saveCell(): void; - - /** We can prevent the client side cellSave event triggering by passing the preventSaveEvent argument as true. - * @param {boolean} optionalIf we pass preventSaveEvent as true, it prevents the client side cellSave event triggering - * @returns {void} - */ - saveCell(preventSaveEvent: boolean): void; - - /** Set dimension for grid with corresponding to grid parent. - * @param {number} Pass the height of the grid container - * @param {number} Pass the width of the grid container - * @returns {void} - */ - setDimension(height: number, width: number): void; - - /** Send a request to grid to refresh the width set to columns - * @returns {void} - */ - setWidthToColumns(): void; - - /** Send a search request to grid with specified string passed in it - * @param {string} Pass the string to search in Grid records - * @returns {void} - */ - search(searchString: string): void; - - /** Select cells in grid. - * @param {any} It is used to set the starting index of row and indexes of cells for that corresponding row for selecting cells. - * @returns {void} - */ - selectCells(rowCellIndexes: any): void; - - /** Select columns in grid. - * @param {number} It is used to set the starting index of column for selecting columns. - * @returns {void} - */ - selectColumns(fromIndex: number): void; - - /** Select the specified columns in grid based on Index provided. - * @param {number} It is used to set the starting index of column for selecting columns. - * @param {number} optionalIt is used to set the ending index of column for selecting columns. - * @returns {Boolean} - */ - selectColumns(columnIndex: number, toIndex?: number): boolean; - - /** Select rows in grid. - * @param {number} It is used to set the starting index of row for selecting rows. - * @param {number} It is used to set the ending index of row for selecting rows. - * @returns {void} - */ - selectRows(fromIndex: number, toIndex: number): void; - - /** Select specified rows in grid based on Index provided. - * @param {Array|number} It is used to set the starting index of row for selecting rows. - * @param {number} optionalIt is used to set the ending index of row for selecting rows. - * @param {any} optionalTarget element which is clicked. - * @returns {void} - */ - selectRows(from: any[]|number, to: number, target?: any): void; - - /** Select rows in grid. - * @param {Array} Pass array of rowIndexes for selecting rows - * @returns {void} - */ - selectRows(rowIndexes: any[]): void; - - /** Used to update a particular cell value. - * @returns {void} - */ - setCellText(): void; - - /** Used to update a particular cell value based on specified row Index and the fieldName. - * @param {number} It is used to set the index for selecting the row. - * @param {string} It is used to set the field name for selecting column. - * @param {any} It is used to set the value for the selected cell. - * @returns {void} - */ - setCellValue(Index: number, fieldName: string, value: any): void; - - /** The grid rows has to be rendered as detail view in mobile mode based on given value. - * @param {number} It is used to render grid rows as details view in mobile mode. - * @returns {void} - */ - setPhoneModeMaxWidth(Index: number): void; - - /** Set validation to a field during editing. - * @param {string} Specify the field name of the column to set validation rules - * @param {any} Specify the validation rules for the field - * @returns {void} - */ - setValidationToField(fieldName: string, rules: any): void; - - /** Show columns in the grid based on the header text - * @param {Array|string} you can pass either array of header text of various columns or a header text of a column to show - * @returns {void} - */ - showColumns(headerText: any[]|string): void; - - /** Send a sorting request in grid. - * @param {string} Pass the field name of the column as columnName for which sorting have to be performed - * @param {string} optional Pass the sort direction ascending/descending by which the column have to be sort. By default it is sorting in an ascending order - * @returns {void} - */ - sortColumn(columnName: string, sortingDirection?: string): void; - - /** Send an edit record request in grid - * @param {JQuery} Pass the tr- selected row element to be edited in grid - * @returns {void} - */ - startEdit($tr: JQuery): void; - - /** Un-group a column from grouped columns collection in grid - * @param {string} Pass the field Name of the column to be ungrouped from grouped column collection - * @returns {void} - */ - ungroupColumn(fieldName: string): void; - - /** Update a edited record in grid control when allowEditing is set as true. - * @param {string} Pass the primary key field Name of the column - * @param {Array} Pass the edited JSON data of record need to be update. - * @returns {void} - */ - updateRecord(fieldName: string, data: any[]): void; - - /** It adapts grid to its parent element or to the browsers window. - * @returns {void} - */ - windowonresize(): void; -} -export namespace Grid { - -export interface Model { - - /** Gets or sets a value that indicates whether to customizing cell based on our needs. - * @Default {false} - */ - allowCellMerging?: boolean; - - /** Gets or sets a value that indicates whether to enable dynamic grouping behavior. Grouping can be done by drag on drop desired columns to grid’s GroupDropArea. - * This can be further customized through “groupSettings” property. - * @Default {false} - */ - allowGrouping?: boolean; - - /** Gets or sets a value that indicates whether to enable keyboard support for performing grid actions. selectionType – Gets or sets a value that indicates whether to enable single - * row or multiple rows selection behavior in grid. Multiple selection can be done through by holding CTRL and clicking the grid rows - * @Default {true} - */ - allowKeyboardNavigation?: boolean; - - /** Gets or sets a value that indicates whether to enable dynamic filtering behavior on grid. Filtering can be used to limit the records displayed using required criteria and - * this can be further customized through “filterSettings” property - * @Default {false} - */ - allowFiltering?: boolean; - - /** Gets or sets a value that indicates whether to enable the dynamic sorting behavior on grid data. Sorting can be done through clicking on particular column header. - * @Default {false} - */ - allowSorting?: boolean; - - /** Gets or sets a value that indicates whether to enable multi columns sorting behavior in grid. Sort multiple columns by holding CTRL and click on the corresponding column header. - * @Default {false} - */ - allowMultiSorting?: boolean; - - /** This specifies the grid to show the paginated data. Also enables pager control at the bottom of grid for dynamic navigation through data source. - * Paging can be further customized through “pageSettings” property. - * @Default {false} - */ - allowPaging?: boolean; - - /** Gets or sets a value that indicates whether to enable the columns reordering behavior in the grid. Reordering can be done through by drag and drop the particular column - * from one index to another index within the grid. - * @Default {false} - */ - allowReordering?: boolean; - - /** Gets or sets a value that indicates whether the column is non resizable. Column width is set automatically based on the content or header text which is large. - * @Default {false} - */ - allowResizeToFit?: boolean; - - /** Gets or sets a value that indicates whether to enable dynamic resizable of columns. Resize the width of the columns by simply click and move the particular column header line - * @Default {false} - */ - allowResizing?: boolean; - - /** Gets or sets a value that indicates whether to enable the rows reordering in Grid and drag & drop rows between multiple Grid. - * @Default {false} - */ - allowRowDragAndDrop?: boolean; - - /** Gets or sets a value that indicates whether to enable the scrollbar in the grid and view the records by scroll through the grid manually - * @Default {false} - */ - allowScrolling?: boolean; - - /** Gets or sets a value that indicates whether to enable dynamic searching behavior in grid. Currently search box can be enabled through “toolbarSettings” - * @Default {false} - */ - allowSearching?: boolean; - - /** Gets or sets a value that indicates whether user can select rows on grid. On enabling feature, selected row will be highlighted. - * @Default {true} - */ - allowSelection?: boolean; - - /** Gets or sets a value that indicates whether the Content will wrap to the next line if the content exceeds the boundary of the Column Cells. - * @Default {false} - */ - allowTextWrap?: boolean; - - /** Gets or sets a value that indicates whether to enable the multiple exporting behavior on grid data. - * @Default {false} - */ - allowMultipleExporting?: boolean; - - /** Gets or sets a value that indicates to define common width for all the columns in the grid. - */ - commonWidth?: number; - - /** Gets or sets a value that indicates to enable the visibility of the grid lines. - * @Default {ej.Grid.GridLines.Both} - */ - gridLines?: ej.Grid.GridLines|string; - - /** This specifies the grid to add the grid control inside the grid row of the parent with expand/collapse options - * @Default {null} - */ - childGrid?: any; - - /** Used to enable or disable static width settings for column. If the columnLayout is set as fixed, then column width will be static. - * @Default {ej.Grid.ColumnLayout.Auto} - */ - columnLayout?: ej.Grid.ColumnLayout|string; - - /** Gets or sets an object that indicates to render the grid with specified columns - * @Default {[]} - */ - columns?: Column[]; - - /** Gets or sets an object that indicates whether to customize the context menu behavior of the grid. - */ - contextMenuSettings?: ContextMenuSettings; - - /** Gets or sets a value that indicates to render the grid with custom theme. - */ - cssClass?: string; - - /** Gets or sets the data to render the grid with records - * @Default {null} - */ - dataSource?: any; - - /** Default Value: - * @Default {null} - */ - detailsTemplate?: string; - - /** Gets or sets an object that indicates whether to customize the editing behavior of the grid. - */ - editSettings?: EditSettings; - - /** Gets or sets a value that indicates whether to enable the alternative rows differentiation in the grid records based on corresponding theme. - * @Default {true} - */ - enableAltRow?: boolean; - - /** Gets or sets a value that indicates whether to enable the save action in the grid through row selection - * @Default {true} - */ - enableAutoSaveOnSelectionChange?: boolean; - - /** Gets or sets a value that indicates whether to enable mouse over effect on the corresponding column header cell of the grid - * @Default {false} - */ - enableHeaderHover?: boolean; - - /** Gets or sets a value that indicates whether to persist the grid model state in page using applicable medium i.e., HTML5 localStorage or cookies - * @Default {false} - */ - enablePersistence?: boolean; - - /** Gets or sets a value that indicates whether the grid rows has to be rendered as detail view in mobile mode - * @Default {false} - */ - enableResponsiveRow?: boolean; - - /** Gets or sets a value that indicates whether to enable mouse over effect on corresponding grid row. - * @Default {true} - */ - enableRowHover?: boolean; - - /** Align content in the grid control from right to left by setting the property as true. - * @Default {false} - */ - enableRTL?: boolean; - - /** To Disable the mouse swipe property as false. - * @Default {true} - */ - enableTouch?: boolean; - - /** Act as mapper for the excel exporting URL. - * @Default {ExportToExcel} - */ - exportToExcelAction?: string; - - /** Act as mapper for the PDF exporting URL. - * @Default {ExportToPdf} - */ - exportToPdfAction?: string; - - /** Act as mapper for the Word exporting URL. - * @Default {ExportToWord} - */ - exportToWordAction?: string; - - /** Gets or sets an object that indicates whether to customize the filtering behavior of the grid - */ - filterSettings?: FilterSettings; - - /** Gets or sets an object that indicates whether to customize the grouping behavior of the grid. - */ - groupSettings?: GroupSettings; - - /** Gets or sets a value that indicates whether the grid design has be to made responsive. - * @Default {false} - */ - isResponsive?: boolean; - - /** This specifies to change the key in keyboard interaction to grid control - * @Default {null} - */ - keySettings?: any; - - /** Gets or sets a value that indicates whether to customizing the user interface (UI) as locale-specific in order to display regional data i.e. in a language and - * culture specific to a particular country or region. - * @Default {en-US} - */ - locale?: string; - - /** Gets or sets a value that indicates whether to set the minimum width of the responsive grid while isResponsive property is true and enableResponsiveRow property is set as false. - * @Default {0} - */ - minWidth?: number; - - /** Gets or sets an object that indicates whether to modify the pager default configuration. - */ - pageSettings?: PageSettings; - - /** Query the dataSource from the table for Grid. - * @Default {null} - */ - query?: any; - - /** Gets or sets an object that indicates whether to modify the resizing behavior. - */ - resizeSettings?: ResizeSettings; - - /** Gets or sets a value that indicates to render the grid with template rows. The template row must be a table row. That table row must have the JavaScript render binding format ({{:columnName}}) - * then the grid data source binds the data to the corresponding table row of the template. - * @Default {null} - */ - rowTemplate?: string; - - /** Gets or sets an object that indicates whether to customize the drag and drop behavior of the grid rows - */ - rowDropSettings?: RowDropSettings; - - /** Gets or sets an object that indicates whether to customize the searching behavior of the grid - */ - searchSettings?: SearchSettings; - - /** Gets a value that indicates whether the grid model to hold multiple selected records . selectedRecords can be used to displayed hold the single - * or multiple selected records using “selectedRecords” property - * @Default {null} - */ - selectedRecords?: any[]; - - /** Gets or sets a value that indicates to select the row while initializing the grid - * @Default {-1} - */ - selectedRowIndex?: number; - - /** Gets or sets a value that indicates the selected rows in grid - * @Default {[]} - */ - selectedRowIndices?: any[]; - - /** This property is used to configure the selection behavior of the grid. - */ - selectionSettings?: SelectionSettings; - - /** The row selection behavior of grid. Accepting types are "single" and "multiple". - * @Default {ej.Grid.SelectionType.Single} - */ - selectionType?: ej.Grid.SelectionType|string; - - /** Gets or sets an object that indicates whether to customize the scrolling behavior of the grid. - */ - scrollSettings?: ScrollSettings; - - /** Default Value: - * @Default {false} - */ - showColumnChooser?: boolean; - - /** Gets or sets a value that indicates stacked header should be shown on grid layout when the property “stackedHeaderRows” is set. - * @Default {false} - */ - showStackedHeader?: boolean; - - /** Gets or sets a value that indicates summary rows should be shown on grid layout when the property “summaryRows” is set - * @Default {false} - */ - showSummary?: boolean; - - /** Gets or sets a value that indicates whether to customize the sorting behavior of the grid. - */ - sortSettings?: SortSettings; - - /** Gets or sets an object that indicates to managing the collection of stacked header rows for the grid. - * @Default {[]} - */ - stackedHeaderRows?: StackedHeaderRow[]; - - /** Gets or sets an object that indicates to managing the collection of summary rows for the grid. - * @Default {[]} - */ - summaryRows?: SummaryRow[]; - - /** Gets or sets an object that indicates whether to auto wrap the grid header or content or both - */ - textWrapSettings?: TextWrapSettings; - - /** Gets or sets an object that indicates whether to enable the toolbar in the grid and add toolbar items - */ - toolbarSettings?: ToolbarSettings; - - /** Triggered for every grid action before its starts. */ - actionBegin?(e: ActionBeginEventArgs): void; - - /** Triggered for every grid action success event. */ - actionComplete?(e: ActionCompleteEventArgs): void; - - /** Triggered for every grid action server failure event. */ - actionFailure?(e: ActionFailureEventArgs): void; - - /** Triggered when record batch add. */ - batchAdd?(e: BatchAddEventArgs): void; - - /** Triggered when record batch delete. */ - batchDelete?(e: BatchDeleteEventArgs): void; - - /** Triggered before the batch add. */ - beforeBatchAdd?(e: BeforeBatchAddEventArgs): void; - - /** Triggered before the batch delete. */ - beforeBatchDelete?(e: BeforeBatchDeleteEventArgs): void; - - /** Triggered before the batch save. */ - beforeBatchSave?(e: BeforeBatchSaveEventArgs): void; - - /** Triggered before the record is going to be edited. */ - beginEdit?(e: BeginEditEventArgs): void; - - /** Triggered when record cell edit. */ - cellEdit?(e: CellEditEventArgs): void; - - /** Triggered when record cell save. */ - cellSave?(e: CellSaveEventArgs): void; - - /** Triggered after the cell is selected. */ - cellSelected?(e: CellSelectedEventArgs): void; - - /** Triggered before the cell is going to be selected. */ - cellSelecting?(e: CellSelectingEventArgs): void; - - /** Triggered after the cell is deselected. */ - cellDeselected?(e: CellDeselectedEventArgs): void; - - /** Triggered before the cell is going to be deselected. */ - cellDeselecting?(e: CellDeselectingEventArgs): void; - - /** Triggered when the column is being dragged. */ - columnDrag?(e: ColumnDragEventArgs): void; - - /** Triggered when column dragging begins. */ - columnDragStart?(e: ColumnDragStartEventArgs): void; - - /** Triggered when the column is dropped. */ - columnDrop?(e: ColumnDropEventArgs): void; - - /** Triggered when the row is being dragged. */ - rowDrag?(e: RowDragEventArgs): void; - - /** Triggered when row dragging begins. */ - rowDragStart?(e: RowDragStartEventArgs): void; - - /** Triggered when the row is dropped. */ - rowDrop?(e: RowDropEventArgs): void; - - /** Triggered after the column is selected. */ - columnSelected?(e: ColumnSelectedEventArgs): void; - - /** Triggered before the column is going to be selected. */ - columnSelecting?(e: ColumnSelectingEventArgs): void; - - /** Triggered after the column is deselected. */ - columnDeselected?(e: ColumnDeselectedEventArgs): void; - - /** Triggered before the column is going to be deselected. */ - columnDeselecting?(e: ColumnDeselectingEventArgs): void; - - /** Triggered when context menu item is clicked */ - contextClick?(e: ContextClickEventArgs): void; - - /** Triggered before the context menu is opened. */ - contextOpen?(e: ContextOpenEventArgs): void; - - /** Triggered when the grid is rendered completely. */ - create?(e: CreateEventArgs): void; - - /** Triggered when the grid is bound with data during initial rendering. */ - dataBound?(e: DataBoundEventArgs): void; - - /** Triggered when grid going to destroy. */ - destroy?(e: DestroyEventArgs): void; - - /** Triggered when detail template row is clicked to collapse. */ - detailsCollapse?(e: DetailsCollapseEventArgs): void; - - /** Triggered detail template row is initialized. */ - detailsDataBound?(e: DetailsDataBoundEventArgs): void; - - /** Triggered when detail template row is clicked to expand. */ - detailsExpand?(e: DetailsExpandEventArgs): void; - - /** Triggered after the record is added. */ - endAdd?(e: EndAddEventArgs): void; - - /** Triggered after the record is deleted. */ - endDelete?(e: EndDeleteEventArgs): void; - - /** Triggered after the record is edited. */ - endEdit?(e: EndEditEventArgs): void; - - /** Triggered initial load. */ - load?(e: LoadEventArgs): void; - - /** Triggered every time a request is made to access particular cell information, element and data. */ - mergeCellInfo?(e: MergeCellInfoEventArgs): void; - - /** Triggered every time a request is made to access particular cell information, element and data. */ - queryCellInfo?(e: QueryCellInfoEventArgs): void; - - /** Triggered when record is clicked. */ - recordClick?(e: RecordClickEventArgs): void; - - /** Triggered when record is double clicked. */ - recordDoubleClick?(e: RecordDoubleClickEventArgs): void; - - /** Triggered after column resized. */ - resized?(e: ResizedEventArgs): void; - - /** Triggered when column resize end. */ - resizeEnd?(e: ResizeEndEventArgs): void; - - /** Triggered when column resize start. */ - resizeStart?(e: ResizeStartEventArgs): void; - - /** Triggered when right clicked on grid element. */ - rightClick?(e: RightClickEventArgs): void; - - /** Triggered every time a request is made to access row information, element and data. */ - rowDataBound?(e: RowDataBoundEventArgs): void; - - /** Triggered after the row is selected. */ - rowSelected?(e: RowSelectedEventArgs): void; - - /** Triggered before the row is going to be selected. */ - rowSelecting?(e: RowSelectingEventArgs): void; - - /** Triggered after the row is deselected. */ - rowDeselected?(e: RowDeselectedEventArgs): void; - - /** Triggered before the row is going to be deselected. */ - rowDeselecting?(e: RowDeselectingEventArgs): void; - - /** Triggered when refresh the template column elements in the Grid. */ - templateRefresh?(e: TemplateRefreshEventArgs): void; - - /** Triggered when toolbar item is clicked in grid. */ - toolbarClick?(e: ToolbarClickEventArgs): void; -} - -export interface ActionBeginEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the grid model. - */ - model?: any; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the current selected page number. - */ - currentPage?: number; - - /** Returns the previous selected page number. - */ - previousPage?: number; - - /** Returns the end row index of that current page. - */ - endIndex?: number; - - /** Returns request type. - */ - requestType?: string; - - /** Returns the start row index of that current page. - */ - startIndex?: number; - - /** Returns the current grouped column field name. - */ - columnName?: string; - - /** Returns the column sort direction. - */ - columnSortDirection?: string; - - /** Returns current edited row. - */ - row?: any; - - /** Returns the current action event type. - */ - originalEventType?: string; - - /** Returns primary key. - */ - primaryKey?: string; - - /** Returns primary key value. - */ - primaryKeyValue?: string; - - /** Returns the edited row index. - */ - rowIndex?: number; - - /** Returns the record object (JSON). - */ - data?: any; - - /** Returns the foreign key record object (JSON). - */ - foreignKeyData?: any; - - /** Returns the selected row index. - */ - selectedRow?: number; - - /** Returns selected row for delete. - */ - tr?: any; - - /** Returns current filtering column field name. - */ - currentFilteringColumn?: any; - - /** Returns current filtering object. - */ - currentFilterObject?: any; - - /** Returns filter details. - */ - filterCollection?: any; - - /** Returns type of the column like number, string and so on. - */ - columnType?: string; - - /** Returns the excel filter model. - */ - filtermodel?: any; - - /** Returns the dataSource. - */ - dataSource?: any; - - /** Returns the query manager. - */ - query?: any; - - /** Returns the customfilter option value. - */ - isCustomFilter?: boolean; -} - -export interface ActionCompleteEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the grid model. - */ - model?: any; - - /** Returns request type. - */ - requestType?: string; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the current selected page number. - */ - currentPage?: number; - - /** Returns the previous selected page number. - */ - previousPage?: number; - - /** Returns the end row index of that current page. - */ - endIndex?: number; - - /** Returns current action event type. - */ - originalEventType?: string; - - /** Returns the start row index of the current page. - */ - startIndex?: number; - - /** Returns grid element. - */ - target?: any; - - /** Returns the current sorted column field name. - */ - columnName?: string; - - /** Returns the column sort direction. - */ - columnSortDirection?: string; - - /** Returns current edited row. - */ - row?: any; - - /** Returns primary key. - */ - primaryKey?: string; - - /** Returns primary key value. - */ - primaryKeyValue?: string; - - /** Returns the edited row index. - */ - rowIndex?: number; - - /** Returns the record object (JSON). - */ - data?: any; - - /** Returns the selectedRow index. - */ - selectedRow?: number; - - /** Returns the foreign key record object (JSON). - */ - foreignKeyData?: any; - - /** Returns selected row for delete. - */ - tr?: any; - - /** Returns current filtering column field name. - */ - currentFilteringColumn?: string; - - /** Returns current filtering object. - */ - currentFilterObject?: any; - - /** Returns filter details. - */ - filterCollection?: any; - - /** Returns the dataSource. - */ - dataSource?: any; - - /** Returns the excel filter model. - */ - filtermodel?: any; - - /** Returns type of the column like number, string and so on. - */ - columnType?: string; - - /** Returns the customfilter option value. - */ - isCustomFilter?: boolean; -} - -export interface ActionFailureEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the grid model. - */ - model?: any; - - /** Returns request type. - */ - requestType?: string; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the error return by server. - */ - error?: any; - - /** Returns the current selected page number. - */ - currentPage?: number; - - /** Returns the previous selected page number. - */ - previousPage?: number; - - /** Returns the end row index of that current page. - */ - endIndex?: number; - - /** Returns current action event type. - */ - originalEventType?: string; - - /** Returns the start row index of the current page. - */ - startIndex?: number; - - /** Returns grid element. - */ - target?: any; - - /** Returns the current sorted column field name. - */ - columnName?: string; - - /** Returns the column sort direction. - */ - columnSortDirection?: string; - - /** Returns current edited row. - */ - row?: any; - - /** Returns primary key. - */ - primaryKey?: string; - - /** Returns primary key value. - */ - primaryKeyValue?: string; - - /** Returns the edited row index. - */ - rowIndex?: number; - - /** Returns the record object (JSON). - */ - data?: any; - - /** Returns the selectedRow index. - */ - selectedRow?: number; - - /** Returns the foreign key record object (JSON). - */ - foreignKeyData?: any; - - /** Returns selected row for delete. - */ - tr?: any; - - /** Returns current filtering column field name. - */ - currentFilteringColumn?: string; - - /** Returns current filtering object. - */ - currentFilterObject?: any; - - /** Returns filter details. - */ - filterCollection?: any; -} - -export interface BatchAddEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the grid model. - */ - model?: any; - - /** Returns deleted data. - */ - data?: any; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the column object. - */ - columnObject?: any; - - /** Returns the column index. - */ - columnIndex?: number; - - /** Returns the row element. - */ - row?: any; - - /** Returns the primaryKey. - */ - primaryKey?: any; - - /** Returns the cell object. - */ - cell?: any; -} - -export interface BatchDeleteEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the grid model. - */ - model?: any; - - /** Returns deleted data. - */ - data?: any; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the primary key. - */ - primaryKey?: any; - - /** Returns the row Index. - */ - rowIndex?: number; -} - -export interface BeforeBatchAddEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the grid model. - */ - model?: any; - - /** Returns deleted data. - */ - data?: any; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the default data object. - */ - defaultData?: any; - - /** Returns the primaryKey. - */ - primaryKey?: any; -} - -export interface BeforeBatchDeleteEventArgs { - - /** Returns the grid model. - */ - model?: any; - - /** Returns deleted data. - */ - data?: any; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the primaryKey. - */ - primaryKey?: any; - - /** Returns the row index. - */ - rowIndex?: number; - - /** Returns the row data. - */ - rowData?: any; - - /** Returns the row element. - */ - row?: any; -} - -export interface BeforeBatchSaveEventArgs { - - /** Returns the grid model. - */ - model?: any; - - /** Returns deleted data. - */ - data?: any; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the changed record object. - */ - batchChanges?: any; -} - -export interface BeginEditEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the current edited row. - */ - row?: any; - - /** Returns the grid model. - */ - model?: any; - - /** Returns the primary key. - */ - primaryKey?: any; - - /** Returns the primary key value. - */ - primaryKeyValue?: any; - - /** Returns the edited row index. - */ - rowIndex?: number; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface CellEditEventArgs { - - /** Returns the grid model. - */ - model?: any; - - /** Returns deleted data. - */ - data?: any; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the validation rules. - */ - validationRules?: any; - - /** Returns the column name. - */ - columnName?: string; - - /** Returns the cell value. - */ - value?: string; - - /** Returns the row data object. - */ - rowData?: any; - - /** Returns the previous value of the cell. - */ - previousValue?: string; - - /** Returns the column object. - */ - columnObject?: any; - - /** Returns the cell object. - */ - cell?: any; - - /** Returns isForeignKey option value. - */ - isForeignKey?: boolean; -} - -export interface CellSaveEventArgs { - - /** Returns the grid model. - */ - model?: any; - - /** Returns deleted data. - */ - data?: any; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the column name. - */ - columnName?: string; - - /** Returns the cell value. - */ - value?: string; - - /** Returns the row data object. - */ - rowData?: any; - - /** Returns the previous value of the cell. - */ - previousValue?: string; - - /** Returns the column object. - */ - columnObject?: any; - - /** Returns the cell object. - */ - cell?: any; - - /** Returns isForeignKey option value. - */ - isForeignKey?: boolean; -} - -export interface CellSelectedEventArgs { - - /** Returns the selected cell index value. - */ - cellIndex?: number; - - /** Returns the previous selected cell index value. - */ - previousRowCellIndex?: number; - - /** Returns the selected cell element. - */ - currentCell?: any; - - /** Returns the previous selected cell element. - */ - previousRowCell?: any; - - /** Returns current record object (JSON). - */ - data?: any; - - /** Returns the selected row cell index values. - */ - selectedRowCellIndex?: any[]; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the grid model. - */ - model?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface CellSelectingEventArgs { - - /** Returns the selected cell index value. - */ - cellIndex?: number; - - /** Returns the previous selected cell index value. - */ - previousRowCellIndex?: number; - - /** Returns the selected cell element. - */ - currentCell?: any; - - /** Returns the previous selected cell element. - */ - previousRowCell?: any; - - /** Returns current record object (JSON). - */ - data?: any; - - /** Returns whether the ctrl key is pressed while selecting cell - */ - isCtrlKeyPressed?: boolean; - - /** Returns whether the shift key is pressed while selecting cell - */ - isShiftKeyPressed?: boolean; - - /** Returns the grid model. - */ - model?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface CellDeselectedEventArgs { - - /** Returns the deselected cell index value. - */ - cellIndex?: number; - - /** Returns the deselected cell element. - */ - currentCell?: any; - - /** Returns current record object (JSON). - */ - data?: any; - - /** Returns the grid model. - */ - model?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface CellDeselectingEventArgs { - - /** Returns the deselecting cell index value. - */ - cellIndex?: number; - - /** Returns the deselecting cell element. - */ - currentCell?: any; - - /** Returns current record object (JSON). - */ - data?: any; - - /** Returns whether the ctrl key is pressed while deselecting cell - */ - isCtrlKeyPressed?: boolean; - - /** Returns whether the shift key is pressed while deselecting cell - */ - isShiftKeyPressed?: boolean; - - /** Returns the grid model. - */ - model?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface ColumnDragEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns draggable element type. - */ - draggableType?: any; - - /** Returns the draggable column object. - */ - column?: any; - - /** Returns the grid model. - */ - model?: any; - - /** Returns target elements based on mouse move position. - */ - target?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface ColumnDragStartEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns draggable element type. - */ - draggableType?: any; - - /** Returns the draggable column object. - */ - column?: any; - - /** Returns the grid model. - */ - model?: any; - - /** Returns drag start element. - */ - target?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface ColumnDropEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns draggable element type. - */ - draggableType?: string; - - /** Returns the draggable column object. - */ - column?: any; - - /** Returns the grid model. - */ - model?: any; - - /** Returns dropped dragged element. - */ - target?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface RowDragEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns draggable element type. - */ - draggableType?: any; - - /** Returns the draggable row object. - */ - target?: any; - - /** Returns the grid model. - */ - model?: any; - - /** Returns target elements based on mouse move position. - */ - currentTarget?: any; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns JSON data of dragged rows. - */ - data?: any; -} - -export interface RowDragStartEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns draggable element type. - */ - draggableType?: any; - - /** Returns the draggable row object. - */ - target?: any; - - /** Returns the grid model. - */ - model?: any; - - /** Returns drag start element cell. - */ - currentTarget?: any; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the JSON data of dragged rows. - */ - data?: any; -} - -export interface RowDropEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns draggable element type. - */ - draggableType?: string; - - /** Returns the draggable row object. - */ - rows?: any; - - /** Returns the grid model. - */ - model?: any; - - /** Returns the current mouse position cell element. - */ - target?: any; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the JSON data of dragged rows. - */ - data?: any; -} - -export interface ColumnSelectedEventArgs { - - /** Returns the selected cell index value. - */ - columnIndex?: number; - - /** Returns the previous selected column index value. - */ - previousColumnIndex?: number; - - /** Returns the selected header cell element. - */ - headerCell?: any; - - /** Returns the previous selected header cell element. - */ - prevColumnHeaderCell?: any; - - /** Returns corresponding column object (JSON). - */ - column?: any; - - /** Returns the selected columns values. - */ - selectedColumnsIndex?: any[]; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the grid model. - */ - model?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface ColumnSelectingEventArgs { - - /** Returns the selected column index value. - */ - columnIndex?: number; - - /** Returns the previous selected column index value. - */ - previousColumnIndex?: number; - - /** Returns the selected header cell element. - */ - headerCell?: any; - - /** Returns the previous selected header cell element. - */ - prevColumnHeaderCell?: any; - - /** Returns corresponding column object (JSON). - */ - column?: any; - - /** Returns whether the ctrl key is pressed while selecting cell - */ - isCtrlKeyPressed?: boolean; - - /** Returns whether the shift key is pressed while selecting cell - */ - isShiftKeyPressed?: boolean; - - /** Returns the grid model. - */ - model?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface ColumnDeselectedEventArgs { - - /** Returns the Deselected column index value. - */ - columnIndex?: number; - - /** Returns the Deselected column header element. - */ - headerCell?: any; - - /** Returns corresponding column object (JSON). - */ - column?: any; - - /** Returns the grid model. - */ - model?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface ColumnDeselectingEventArgs { - - /** Returns the deselecting column index value. - */ - columnIndex?: number; - - /** Returns the deselecting column header element. - */ - headerCell?: any; - - /** Returns corresponding column object (JSON). - */ - column?: any; - - /** Returns whether the ctrl key is pressed while deselecting column - */ - isCtrlKeyPressed?: boolean; - - /** Returns whether the shift key is pressed while deselecting column - */ - isShiftKeyPressed?: boolean; - - /** Returns the grid model. - */ - model?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface ContextClickEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the current item. - */ - currentTarget?: any; - - /** Returns the grid model. - */ - model?: any; - - /** Returns the status of contextmenu item which denotes its enabled state - */ - status?: boolean; - - /** Returns the target item. - */ - target?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface ContextOpenEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the current item. - */ - currentTarget?: any; - - /** Returns the grid model. - */ - model?: any; - - /** Returns the status of contextmenu item which denotes its enabled state - */ - status?: boolean; - - /** Returns the target item. - */ - target?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface CreateEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the grid model. - */ - model?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface DataBoundEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the grid model. - */ - model?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface DestroyEventArgs { - - /** Returns the grid model. - */ - model?: any; - - /** Returns deleted data. - */ - data?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface DetailsCollapseEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns detail row element. - */ - detailsRow?: any; - - /** Returns master row of detail row record object (JSON). - */ - masterData?: any; - - /** Returns the foreign key record object (JSON). - */ - foreignKeyData?: any; - - /** Returns master row element. - */ - masterRow?: any; - - /** Returns the grid model. - */ - model?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface DetailsDataBoundEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns details row element. - */ - detailsElement?: any; - - /** Returns the details row data. - */ - data?: any; - - /** Returns the grid model. - */ - model?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface DetailsExpandEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns detail row element. - */ - detailsRow?: any; - - /** Returns master row of detail row record object (JSON). - */ - masterData?: any; - - /** Returns the foreign key record object (JSON). - */ - foreignKeyData?: any; - - /** Returns master row element. - */ - masterRow?: any; - - /** Returns the grid model. - */ - model?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface EndAddEventArgs { - - /** Returns the grid model. - */ - model?: any; - - /** Returns added data. - */ - data?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface EndDeleteEventArgs { - - /** Returns the grid model. - */ - model?: any; - - /** Returns deleted data. - */ - data?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface EndEditEventArgs { - - /** Returns the grid model. - */ - model?: any; - - /** Returns modified data. - */ - data?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface LoadEventArgs { - - /** Returns the grid model. - */ - model?: any; - - /** Returns deleted data. - */ - data?: any; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface MergeCellInfoEventArgs { - - /** Returns grid cell. - */ - cell?: any; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns current row record object (JSON). - */ - data?: any; - - /** Returns the text value in the cell. - */ - text?: string; - - /** Returns the column object. - */ - column?: any; - - /** Method to merge Grid rows. - */ - rowMerge?: any; - - /** Method to merge Grid columns. - */ - colMerge?: any; - - /** Method to merge Grid rows and columns. - */ - merge?: any; - - /** Returns the grid model. - */ - model?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface QueryCellInfoEventArgs { - - /** Returns grid cell. - */ - cell?: any; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns current row record object (JSON). - */ - data?: any; - - /** Returns the text value in the cell. - */ - text?: string; - - /** Returns the column object. - */ - column?: any; - - /** Returns the foreign key record object (JSON). - */ - foreignKeyData?: any; - - /** Returns the grid model. - */ - model?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface RecordClickEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns current record object (JSON). - */ - data?: any; - - /** Returns the row index of the selected row. - */ - rowIndex?: number; - - /** Returns the jQuery object of the current selected row. - */ - row?: any; - - /** Returns the current selected cell. - */ - cell?: any; - - /** Returns the grid model. - */ - model?: any; - - /** Returns the cell index value. - */ - cellIndex?: number; - - /** Returns the corresponding cell value. - */ - cellValue?: string; - - /** Returns the Header text of the column corresponding to the selected cell. - */ - columnName?: string; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface RecordDoubleClickEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns current record object (JSON). - */ - data?: any; - - /** Returns the row index of the selected row. - */ - rowIndex?: number; - - /** Returns the jQuery object of the current selected row. - */ - row?: any; - - /** Returns the current selected cell. - */ - cell?: any; - - /** Returns the grid model. - */ - model?: any; - - /** Returns the selected cell index value. - */ - cellIndex?: number; - - /** Returns the corresponding cell value. - */ - cellValue?: string; - - /** Returns the Header text of the column corresponding to the selected cell. - */ - columnName?: string; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface ResizedEventArgs { - - /** Returns the grid model. - */ - model?: any; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns deleted data. - */ - data?: any; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the column index. - */ - columnIndex?: number; - - /** Returns the column object. - */ - column?: any; - - /** Returns the grid object. - */ - target?: any; - - /** Returns the old width value. - */ - oldWidth?: number; - - /** Returns the new width value. - */ - newWidth?: number; -} - -export interface ResizeEndEventArgs { - - /** Returns the grid model. - */ - model?: any; - - /** Returns deleted data. - */ - data?: any; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the column index. - */ - columnIndex?: number; - - /** Returns the column object. - */ - column?: any; - - /** Returns the grid object. - */ - target?: any; - - /** Returns the old width value. - */ - oldWidth?: number; - - /** Returns the new width value. - */ - newWidth?: number; - - /** Returns the extra width value. - */ - extra?: number; -} - -export interface ResizeStartEventArgs { - - /** Returns the grid model. - */ - model?: any; - - /** Returns deleted data. - */ - data?: any; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the column index. - */ - columnIndex?: number; - - /** Returns the column object. - */ - column?: any; - - /** Returns the grid object. - */ - target?: any; - - /** Returns the old width value. - */ - oldWidth?: number; -} - -export interface RightClickEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns current record object (JSON). - */ - currentData?: any; - - /** Returns the row index of the selected row. - */ - rowIndex?: number; - - /** Returns the current selected row. - */ - row?: any; - - /** Returns the selected row data object. - */ - data?: any; - - /** Returns the cell index of the selected cell. - */ - cellIndex?: number; - - /** Returns the cell value. - */ - cellValue?: string; - - /** Returns the cell object. - */ - cell?: any; - - /** Returns the grid model. - */ - model?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface RowDataBoundEventArgs { - - /** Returns grid row. - */ - row?: any; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns current row record object (JSON). - */ - data?: any; - - /** Returns the foreign key record object (JSON). - */ - foreignKeyData?: any; - - /** Returns the grid model. - */ - model?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface RowSelectedEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns current record object (JSON). - */ - data?: any; - - /** Returns the foreign key record object (JSON). - */ - foreignKeyData?: any; - - /** Returns the row index of the selected row. - */ - rowIndex?: number; - - /** Returns the current selected row. - */ - row?: any; - - /** Returns the previous selected row element. - */ - prevRow?: any; - - /** Returns the previous selected row index. - */ - prevRowIndex?: number; - - /** Returns the grid model. - */ - model?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface RowSelectingEventArgs { - - /** Returns the selected row index value. - */ - rowIndex?: number; - - /** Returns the selected row element. - */ - row?: any; - - /** Returns the previous selected row element. - */ - prevRow?: any; - - /** Returns the previous selected row index. - */ - prevRowIndex?: number; - - /** Returns current record object (JSON). - */ - data?: any; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the grid model. - */ - model?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface RowDeselectedEventArgs { - - /** Returns current record object (JSON). - */ - data?: any; - - /** Returns the row index of the deselected row. - */ - rowIndex?: number; - - /** Returns the current deselected row element. - */ - row?: any; - - /** Returns the grid model. - */ - model?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface RowDeselectingEventArgs { - - /** Returns the deselecting row index value. - */ - rowIndex?: number; - - /** Returns the deselecting row element. - */ - row?: any; - - /** Returns current record object (JSON). - */ - data?: any; - - /** Returns whether the ctrl key is pressed while deselecting row - */ - isCtrlKeyPressed?: boolean; - - /** Returns whether the shift key is pressed while deselecting row - */ - isShiftKeyPressed?: boolean; - - /** Returns the grid model. - */ - model?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface TemplateRefreshEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the cell object. - */ - cell?: any; - - /** Returns the column object. - */ - column?: any; - - /** Returns the current row data. - */ - data?: any; - - /** Returns the grid model. - */ - model?: any; - - /** Returns the current row index. - */ - rowIndex?: number; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface ToolbarClickEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the current item. - */ - currentTarget?: any; - - /** Returns the grid model. - */ - model?: any; - - /** Returns the status of toolbar item which denotes its enabled state - */ - status?: boolean; - - /** Returns the target item. - */ - target?: any; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the grid model. - */ - gridModel?: any; - - /** Returns the toolbar object of the selected toolbar element. - */ - toolbarData?: any; - - /** Returns the Id of the current toolbar element. - */ - itemId?: string; - - /** Returns the index of the current toolbar element. - */ - itemIndex?: number; - - /** Returns the name of the current toolbar element. - */ - itemName?: string; -} - -export interface ColumnsCommand { - - /** Gets or sets an object that indicates to define all the button options which are available in ejButton. - */ - buttonOptions?: any; - - /** Gets or sets a value that indicates to add the command column button. See unboundType - */ - type?: ej.Grid.UnboundType|string; -} - -export interface Column { - - /** Sets the clip mode for Grid cell as ellipsis or clipped content(both header and content) - * @Default {ej.Grid.ClipMode.Clip} - */ - clipMode?: ej.Grid.ClipMode|string; - - /** Gets or sets a value that indicates whether to enable editing behavior for particular column. - * @Default {true} - */ - allowEditing?: boolean; - - /** Gets or sets a value that indicates whether to enable dynamic filtering behavior for particular column. - * @Default {true} - */ - allowFiltering?: boolean; - - /** Gets or sets a value that indicates whether to enable dynamic grouping behavior for particular column. - * @Default {true} - */ - allowGrouping?: boolean; - - /** Gets or sets a value that indicates whether to enable dynamic sorting behavior for particular column. - * @Default {true} - */ - allowSorting?: boolean; - - /** Gets or sets a value that indicates whether to enable dynamic resizable for particular column. - * @Default {true} - */ - allowResizing?: boolean; - - /** Gets or sets an object that indicates to define a command column in the grid. - * @Default {[]} - */ - commands?: ColumnsCommand[]; - - /** Gets or sets a value that indicates to provide custom CSS for an individual column. - */ - cssClass?: string; - - /** Gets or sets a value that indicates the attribute values to the td element of a particular column - */ - customAttributes?: any; - - /** Gets or sets a value that indicates to bind the external datasource to the particular column when column editType as dropdownedit and also it is used to bind the datasource - * to the foreign key column while editing the grid. //Where data is array of JSON objects of text and value for the drop-down and array of JSON objects for foreign key column. - * @Default {null} - */ - dataSource?: any[]; - - /** Gets or sets a value that indicates to display the specified default value while adding a new record to the grid - */ - defaultValue?: string|number|boolean|Date; - - /** Gets or sets a value that indicates to render the grid content and header with an HTML elements - * @Default {false} - */ - disableHtmlEncode?: boolean; - - /** Gets or sets a value that indicates to display a column value as checkbox or string - * @Default {true} - */ - displayAsCheckBox?: boolean; - - /** Gets or sets a value that indicates to customize ejNumericTextbox of an editable column. See editingType - */ - editParams?: any; - - /** Gets or sets a template that displays a custom editor used to edit column values. See editTemplate - * @Default {null} - */ - editTemplate?: any; - - /** Gets or sets a value that indicates to render the element(based on edit type) for editing the grid record. See editingType - * @Default {ej.Grid.EditingType.String} - */ - editType?: ej.Grid.EditingType|string; - - /** Gets or sets a value that indicates to groups the column based on its column format. - * @Default {false} - */ - enableGroupByFormat?: boolean; - - /** Gets or sets a value that indicates to display the columns in the grid mapping with column name of the dataSource. - */ - field?: string; - - /** Gets or sets a template that customize the filter control from default . See filterBarTemplate - * @Default {null} - */ - filterBarTemplate?: any; - - /** Gets or sets a value that indicates to define foreign key field name of the grid datasource. - * @Default {null} - */ - foreignKeyField?: string; - - /** Gets or sets a value that indicates to bind the field which is in foreign column datasource based on the foreignKeyField - * @Default {null} - */ - foreignKeyValue?: string; - - /** Gets or sets a value that indicates the format for the text applied on the column - */ - format?: string; - - /** Gets or sets a value that indicates to add the template within the header element of the particular column. - * @Default {null} - */ - headerTemplateID?: string; - - /** Gets or sets a value that indicates to display the title of that particular column. - */ - headerText?: string; - - /** This defines the text alignment of a particular column header cell value. See headerTextAlign - * @Default {null} - */ - headerTextAlign?: ej.TextAlign|string; - - /** You can use this property to freeze selected columns in grid at the time of scrolling. - * @Default {false} - */ - isFrozen?: boolean; - - /** Gets or sets a value that indicates the column has an identity in the database. - * @Default {false} - */ - isIdentity?: boolean; - - /** Gets or sets a value that indicates the column is act as a primary key(read-only) of the grid. The editing is performed based on the primary key column - * @Default {false} - */ - isPrimaryKey?: boolean; - - /** Gets or sets a value that indicates the order of Column that are to be hidden or visible when Grid element is in responsive mode and could not occupy all columns. - * @Default {null} - */ - priority?: number; - - /** Used to hide the particular column in column chooser by giving value as false. - * @Default {true} - */ - showInColumnChooser?: boolean; - - /** Gets or sets a value that indicates whether to enables column template for a particular column. - * @Default {false} - */ - template?: boolean|string; - - /** Gets or sets a value that indicates to align the text within the column. See textAlign - * @Default {ej.TextAlign.Left} - */ - textAlign?: ej.TextAlign|string; - - /** Sets the template for Tooltip in Grid Columns(both header and content) - */ - tooltip?: string; - - /** Gets or sets a value that indicates to specify the data type of the specified columns. - */ - type?: string; - - /** Gets or sets a value that indicates to define constraints for saving data to the database. - */ - validationRules?: any; - - /** Gets or sets a value that indicates whether this column is visible in the grid. - * @Default {true} - */ - visible?: boolean; - - /** Gets or sets a value that indicates to define the width for a particular column in the grid. - */ - width?: number; -} - -export interface ContextMenuSettingsSubContextMenu { - - /** Used to get or set the corresponding custom context menu item to which the submenu to be appended. - * @Default {null} - */ - contextMenuItem?: string; - - /** Used to get or set the sub menu items to the custom context menu item. - * @Default {[]} - */ - subMenu?: any[]; -} - -export interface ContextMenuSettings { - - /** Gets or sets a value that indicates whether to add the default context menu actions as a context menu items If enableContextMenu is true it will show all the items related to the target, - * if you want selected items from contextmenu you have to mention in the contextMenuItems - * @Default {[]} - */ - contextMenuItems?: any[]; - - /** Gets or sets a value that indicates whether to add custom contextMenu items within the toolbar to perform any action in the grid - * @Default {[]} - */ - customContextMenuItems?: any[]; - - /** Gets or sets a value that indicates whether to enable the context menu action in the grid. - * @Default {false} - */ - enableContextMenu?: boolean; - - /** Used to get or set the subMenu to the corresponding custom context menu item. - */ - subContextMenu?: ContextMenuSettingsSubContextMenu[]; - - /** Gets or sets a value that indicates whether to disable the default context menu items in the grid. - * @Default {false} - */ - disableDefaultItems?: boolean; -} - -export interface EditSettings { - - /** Gets or sets a value that indicates whether to enable insert action in the editing mode. - * @Default {false} - */ - allowAdding?: boolean; - - /** Gets or sets a value that indicates whether to enable the delete action in the editing mode. - * @Default {false} - */ - allowDeleting?: boolean; - - /** Gets or sets a value that indicates whether to enable the edit action in the editing mode. - * @Default {false} - */ - allowEditing?: boolean; - - /** Gets or sets a value that indicates whether to enable the editing action while double click on the record - * @Default {true} - */ - allowEditOnDblClick?: boolean; - - /** This specifies the id of the template. This template can be used to display the data that you require to be edited using the Dialog Box - * @Default {null} - */ - dialogEditorTemplateID?: string; - - /** Gets or sets a value that indicates whether to define the mode of editing See editMode - * @Default {ej.Grid.EditMode.Normal} - */ - editMode?: ej.Grid.EditMode|string; - - /** This specifies the id of the template. This template can be used to display the data that you require to be edited using the External edit form - * @Default {null} - */ - externalFormTemplateID?: string; - - /** This specifies to set the position of an External edit form either in the top-right or bottom-left of the grid - * @Default {ej.Grid.FormPosition.BottomLeft} - */ - formPosition?: ej.Grid.FormPosition|string; - - /** This specifies the id of the template. This template can be used to display the data that you require to be edited using the Inline edit form - * @Default {null} - */ - inlineFormTemplateID?: string; - - /** This specifies to set the position of an adding new row either in the top or bottom of the grid - * @Default {ej.Grid.RowPosition.Top} - */ - rowPosition?: ej.Grid.RowPosition|string; - - /** Gets or sets a value that indicates whether the confirm dialog has to be shown while saving or discarding the batch changes - * @Default {true} - */ - showConfirmDialog?: boolean; - - /** Gets or sets a value that indicates whether the confirm dialog has to be shown while deleting record - * @Default {false} - */ - showDeleteConfirmDialog?: boolean; - - /** Gets or sets a value that indicates whether the title for edit form is different from the primarykey column. - * @Default {null} - */ - titleColumn?: string; - - /** Gets or sets a value that indicates whether to display the add new form by default in the grid. - * @Default {false} - */ - showAddNewRow?: boolean; -} - -export interface FilterSettingsFilteredColumn { - - /** Gets or sets a value that indicates whether to define the field name of the column to be filter. - */ - field?: string; - - /** Gets or sets a value that indicates whether to define the filter condition to filtered column. - */ - operator?: ej.FilterOperators|string; - - /** Gets or sets a value that indicates whether to define the predicate as and/or. - */ - predicate?: string; - - /** Gets or sets a value that indicates whether to define the value to be filtered in a column. - */ - value?: string|number; -} - -export interface FilterSettings { - - /** Gets or sets a value that indicates to perform the filter operation with case sensitive in excel styled filter menu mode - * @Default {false} - */ - enableCaseSensitivity?: boolean; - - /** This specifies the grid to starts the filter action while typing in the filterBar or after pressing the enter key. based on the filterBarMode. See filterBarMode - * @Default {ej.Grid.FilterBarMode.Immediate} - */ - filterBarMode?: ej.Grid.FilterBarMode|string; - - /** Gets or sets a value that indicates whether to define the filtered columns details programmatically at initial load - * @Default {[]} - */ - filteredColumns?: FilterSettingsFilteredColumn[]; - - /** This specifies the grid to show the filterBar or filterMenu to the grid records. See filterType - * @Default {ej.Grid.FilterType.FilterBar} - */ - filterType?: ej.Grid.FilterType|string; - - /** Gets or sets a value that indicates the maximum number of filter choices that can be showed in the excel styled filter menu. - * @Default {1000} - */ - maxFilterChoices?: number; - - /** This specifies the grid to show the filter text within the grid pager itself. - * @Default {true} - */ - showFilterBarMessage?: boolean; - - /** Gets or sets a value that indicates whether to enable the predicate options in the filtering menu - * @Default {false} - */ - showPredicate?: boolean; -} - -export interface GroupSettings { - - /** Gets or sets a value that customize the group caption format. - * @Default {null} - */ - captionFormat?: string; - - /** Gets or sets a value that indicates whether to enable animation button option in the group drop area of the grid. - * @Default {false} - */ - enableDropAreaAutoSizing?: boolean; - - /** Gets or sets a value that indicates whether to add grouped columns programmatically at initial load - * @Default {[]} - */ - groupedColumns?: any[]; - - /** Gets or sets a value that indicates whether to show the group drop area just above the column header. It can be used to avoid ungrouping the already grouped column using groupSettings. - * @Default {true} - */ - showDropArea?: boolean; - - /** Gets or sets a value that indicates whether to hide the grouped columns from the grid - * @Default {false} - */ - showGroupedColumn?: boolean; - - /** Gets or sets a value that indicates whether to show the group button image(toggle button)in the column header and also in the grouped column in the group drop area. - * It can be used to group/ungroup the columns by click on the toggle button. - * @Default {false} - */ - showToggleButton?: boolean; - - /** Gets or sets a value that indicates whether to enable the close button in the grouped column which is in the group drop area to ungroup the grouped column - * @Default {false} - */ - showUngroupButton?: boolean; -} - -export interface PageSettings { - - /** Gets or sets a value that indicates whether to define which page to display currently in the grid - * @Default {1} - */ - currentPage?: number; - - /** Gets or sets a value that indicates whether to pass the current page information as a query string along with the URL while navigating to other page. - * @Default {false} - */ - enableQueryString?: boolean; - - /** Gets or sets a value that indicates whether to enables pager template for the grid. - * @Default {false} - */ - enableTemplates?: boolean; - - /** Gets or sets a value that indicates whether to define the number of pages displayed in the pager for navigation - * @Default {8} - */ - pageCount?: number; - - /** Gets or sets a value that indicates whether to define the number of records displayed per page - * @Default {12} - */ - pageSize?: number; - - /** Gets or sets a value that indicates whether to enables default pager for the grid. - * @Default {false} - */ - showDefaults?: boolean; - - /** Gets or sets a value that indicates to add the template as a pager template for grid. - * @Default {null} - */ - template?: string; - - /** Get the value of total number of pages in the grid. The totalPages value is calculated based on page size and total records of grid - * @Default {null} - */ - totalPages?: number; - - /** Get the value of total number of records which is bound to the grid. The totalRecordsCount value is calculated based on dataSource bound to the grid. - * @Default {null} - */ - totalRecordsCount?: number; - - /** Gets or sets a value that indicates whether to define the number of pages to print - * @Default {ej.Grid.PrintMode.AllPages} - */ - printMode?: ej.Grid.PrintMode|string; -} - -export interface ResizeSettings { - - /** Gets or sets a value that indicates whether to define the mode of resizing. - * @Default {ej.Grid.ResizeMode.Normal} - */ - resizeMode?: ej.Grid.ResizeMode|string; -} - -export interface RowDropSettings { - - /** This specifies the grid to drop the grid rows only at particular target element. - * @Default {null} - */ - dropTargetID?: any; - - /** This helps in mapping server-side action when rows are dragged from Grid. - * @Default {null} - */ - dragMapper?: string; - - /** This helps in mapping server-side action when rows are dropped in Grid. - * @Default {null} - */ - dropMapper?: string; -} - -export interface SearchSettings { - - /** This specify the grid to search for the value in particular columns that is mentioned in the field. - * @Default {[]} - */ - fields?: any; - - /** This specifies the grid to search the particular data that is mentioned in the key. - */ - key?: string; - - /** It specifies the grid to search the records based on operator. - * @Default {contains} - */ - operator?: string; - - /** It enables or disables case-sensitivity while searching the search key in grid. - * @Default {true} - */ - ignoreCase?: boolean; -} - -export interface SelectionSettings { - - /** Gets or sets a value that indicates whether to enable the toggle selection behavior for row, cell and column. - * @Default {false} - */ - enableToggle?: boolean; - - /** Gets or sets a value that indicates whether to add the default selection actions as a selection mode.See selectionMode - * @Default {[row]} - */ - selectionMode?: any[]; -} - -export interface ScrollSettings { - - /** This specify the grid to to view data that you require without buffering the entire load of a huge database - * @Default {false} - */ - allowVirtualScrolling?: boolean; - - /** This specify the grid to enable/disable touch control for scrolling. - * @Default {true} - */ - enableTouchScroll?: boolean; - - /** This specify the grid to freeze particular columns at the time of scrolling. - * @Default {0} - */ - frozenColumns?: number; - - /** This specify the grid to freeze particular rows at the time of scrolling. - * @Default {0} - */ - frozenRows?: number; - - /** This specify the grid to show the vertical scroll bar, to scroll and view the grid contents. - * @Default {0} - */ - height?: string|number; - - /** This is used to define the mode of virtual scrolling in grid. See virtualScrollMode - * @Default {ej.Grid.VirtualScrollMode.Normal} - */ - virtualScrollMode?: ej.Grid.VirtualScrollMode|string; - - /** This is used to enable the enhanced virtual scrolling in Grid. - * @Default {false} - */ - enableVirtualization?: boolean; - - /** This specify the grid to show the horizontal scroll bar, to scroll and view the grid contents - * @Default {250} - */ - width?: string|number; - - /** This specify the scroll down pixel of mouse wheel, to scroll mouse wheel and view the grid contents. - * @Default {57} - */ - scrollOneStepBy?: number; -} - -export interface SortSettingsSortedColumn { - - /** Gets or sets a value that indicates whether to define the direction to sort the column. - */ - direction?: string; - - /** Gets or sets a value that indicates whether to define the field name of the column to be sort - */ - field?: string; -} - -export interface SortSettings { - - /** Gets or sets a value that indicates whether to define the direction and field to sort the column. - */ - sortedColumns?: SortSettingsSortedColumn[]; -} - -export interface StackedHeaderRowsStackedHeaderColumn { - - /** Gets or sets a value that indicates the header text for the particular stacked header column. - * @Default {null} - */ - column?: any; - - /** Gets or sets a value that indicates class to the corresponding stackedHeaderColumn. - * @Default {null} - */ - cssClass?: string; - - /** Gets or sets a value that indicates the header text for the particular stacked header column. - * @Default {null} - */ - headerText?: string; - - /** Gets or sets a value that indicates the text alignment of the corresponding headerText. - * @Default {ej.TextAlign.Left} - */ - textAlign?: string; -} - -export interface StackedHeaderRow { - - /** Gets or sets a value that indicates whether to add stacked header columns into the stacked header rows - * @Default {[]} - */ - stackedHeaderColumns?: StackedHeaderRowsStackedHeaderColumn[]; -} - -export interface SummaryRowsSummaryColumn { - - /** Gets or sets a value that indicates the text displayed in the summary column as a value - * @Default {null} - */ - customSummaryValue?: string; - - /** This specifies summary column used to perform the summary calculation - * @Default {null} - */ - dataMember?: string; - - /** Gets or sets a value that indicates to define the target column at which to display the summary. - * @Default {null} - */ - displayColumn?: string; - - /** Gets or sets a value that indicates the format for the text applied on the column - * @Default {null} - */ - format?: string; - - /** Gets or sets a value that indicates the text displayed before the summary column value - * @Default {null} - */ - prefix?: string; - - /** Gets or sets a value that indicates the text displayed after the summary column value - * @Default {null} - */ - suffix?: string; - - /** Gets or sets a value that indicates the type of calculations to be performed for the corresponding summary column - * @Default {[]} - */ - summaryType?: ej.Grid.SummaryType|string; - - /** Gets or sets a value that indicates to add the template for the summary value of dataMember given. - * @Default {null} - */ - template?: string; -} - -export interface SummaryRow { - - /** Gets or sets a value that indicates whether to show the summary value within the group caption area for the corresponding summary column while grouping the column - * @Default {false} - */ - showCaptionSummary?: boolean; - - /** Gets or sets a value that indicates whether to show the group summary value for the corresponding summary column while grouping a column - * @Default {false} - */ - showGroupSummary?: boolean; - - /** Gets or sets a value that indicates whether to show the total summary value the for the corresponding summary column. The summary row is added after the grid content. - * @Default {true} - */ - showTotalSummary?: boolean; - - /** Gets or sets a value that indicates whether to add summary columns into the summary rows. - * @Default {[]} - */ - summaryColumns?: SummaryRowsSummaryColumn[]; - - /** This specifies the grid to show the title for the summary rows. - */ - title?: string; - - /** This specifies the grid to show the title of summary row in the specified column. - * @Default {null} - */ - titleColumn?: string; -} - -export interface TextWrapSettings { - - /** This specifies the grid to apply the auto wrap for grid content or header or both. - * @Default {ej.Grid.WrapMode.Both} - */ - wrapMode?: ej.Grid.WrapMode|string; -} - -export interface ToolbarSettings { - - /** Gets or sets a value that indicates whether to add custom toolbar items within the toolbar to perform any action in the grid - * @Default {[]} - */ - customToolbarItems?: any[]; - - /** Gets or sets a value that indicates whether to enable toolbar in the grid. - * @Default {false} - */ - showToolbar?: boolean; - - /** Gets or sets a value that indicates whether to add the default editing actions as a toolbar items - * @Default {[]} - */ - toolbarItems?: Array; -} - -enum GridLines { - - ///Displays both the horizontal and vertical grid lines. - Both, - - ///Displays the horizontal grid lines only. - Horizontal, - - ///Displays the vertical grid lines only. - Vertical, - - ///No grid lines are displayed. - None -} - - -enum ClipMode { - - ///Shows ellipsis for the overflown cell. - Ellipsis, - - ///Truncate the text in the cell - Clip, - - ///Shows ellipsis and tooltip for the overflown cell. - EllipsisWithTooltip -} - - -enum ColumnLayout { - - ///Column layout is auto(based on width). - Auto, - - ///Column layout is fixed(based on width). - Fixed -} - - -enum UnboundType { - - ///Unbound type is edit. - Edit, - - ///Unbound type is save. - Save, - - ///Unbound type is delete. - Delete, - - ///Unbound type is cancel. - Cancel -} - - -enum EditingType { - - ///Specifies editing type as string edit. - String, - - ///Specifies editing type as boolean edit. - Boolean, - - ///Specifies editing type as numeric edit. - Numeric, - - ///Specifies editing type as dropdown edit. - Dropdown, - - ///Specifies editing type as datepicker. - DatePicker, - - ///Specifies editing type as datetime picker. - DateTimePicker -} - - -enum EditMode { - - ///Edit mode is normal. - Normal, - - ///Edit mode is dialog. - Dialog, - - ///Edit mode is dialog template. - DialogTemplate, - - ///Edit mode is batch. - Batch, - - ///Edit mode is inline form. - InlineForm, - - ///Edit mode is inline template form. - InlineTemplateForm, - - ///Edit mode is external form. - ExternalForm, - - ///Edit mode is external form template. - ExternalFormTemplate -} - - -enum FormPosition { - - ///Form position is bottomleft. - BottomLeft, - - ///Form position is topright. - TopRight -} - - -enum RowPosition { - - ///Specifies position of add new row as top. - Top, - - ///Specifies position of add new row as bottom. - Bottom -} - - -enum FilterBarMode { - - ///Initiate filter operation on typing the filter query. - Immediate, - - ///Initiate filter operation after Enter key is pressed. - OnEnter -} - - -enum FilterType { - - ///Specifies the filter type as menu. - Menu, - - ///Specifies the filter type as excel. - Excel, - - ///Specifies the filter type as filterbar. - FilterBar -} - - -enum PrintMode { - - ///Prints all pages. - AllPages, - - ///Prints current page. - CurrentPage -} - - -enum ResizeMode { - - ///New column size will be adjusted by all other Columns - Normal, - - ///New column Size will be adjusted using next column. - NextColumn, - - ///New column Size will be adjusted using entire control - Control -} - - -enum SelectionType { - - ///Specifies the selection type as single. - Single, - - ///Specifies the selection type as multiple. - Multiple -} - - -enum VirtualScrollMode { - - ///virtual scroll mode is normal. - Normal, - - ///virtual scroll mode is continuous. - Continuous -} - - -enum SummaryType { - - ///Summary type is average. - Average, - - ///Summary type is minimum. - Minimum, - - ///Summary type is maximum. - Maximum, - - ///Summary type is count. - Count, - - ///Summary type is sum. - Sum, - - ///Summary type is custom. - Custom, - - ///Summary type is true count. - TrueCount, - - ///Summary type is false count. - FalseCount -} - - -enum WrapMode { - - ///Auto wrap is applied for both content and header. - Both, - - ///Auto wrap is applied only for content. - Content, - - ///Auto wrap is applied only for header. - Header -} - - -enum ToolBarItems { - - ///Toolbar item is add. - Add, - - ///Toolbar item is edit. - Edit, - - ///Toolbar item is delete. - Delete, - - ///Toolbar item is update. - Update, - - ///Toolbar item is cancel. - Cancel, - - ///Toolbar item is search. - Search, - - ///Toolbar item is pdfExport. - PdfExport, - - ///Toolbar item is printGrid. - PrintGrid, - - ///Toolbar item is wordExport. - WordExport -} - -} - -class Sparkline extends ej.Widget { - static fn: Sparkline; - constructor(element: JQuery | Element, options?: Sparkline.Model); - static Locale: any; - model: Sparkline.Model; - defaults: Sparkline.Model; - - /** Redraws the entire sparkline. You can call this method whenever you update, add or remove points from the data source or whenever you want to refresh the UI. - * @returns {void} - */ - redraw(): void; -} -export namespace Sparkline { - -export interface Model { - - /** Background color of the plot area. - * @Default {transparent} - */ - background?: string; - - /** Fill color for the sparkline series. - * @Default {#33ccff} - */ - fill?: string; - - /** Border color of the series. - * @Default {null} - */ - stroke?: string; - - /** Options for customizing the color, opacity and width of the sparkline border. - */ - border?: Border; - - /** Border width of the series. - * @Default {1} - */ - width?: number; - - /** Opacity of the series. - * @Default {1} - */ - opacity?: number; - - /** Color for series high point. - * @Default {null} - */ - highPointColor?: string; - - /** Color for series low point. - * @Default {null} - */ - lowPointColor?: string; - - /** Color for series start point. - * @Default {null} - */ - startPointColor?: string; - - /** Color for series end point. - * @Default {null} - */ - endPointColor?: string; - - /** Color for series negative point. - * @Default {null} - */ - negativePointColor?: string; - - /** Options for customizing the color, opacity of the sparkline start and end range. - */ - rangeBandSettings?: RangeBandSettings; - - /** Name of a field in data source, where the fill color for all the data points is generated. - */ - palette?: string; - - /** Controls whether sparkline has to be responsive or not. - * @Default {true} - */ - isResponsive?: boolean; - - /** Controls whether Sparkline has to be rendered as Canvas or SVG.Canvas rendering supports all functionalities in SVG rendering. - * @Default {false} - */ - enableCanvasRendering?: boolean; - - /** Specifies the dataSource for the series. It can be an array of JSON objects or an instance of ej.DataManager. - * @Default {null} - */ - dataSource?: any; - - /** Name of the property in the datasource that contains x value for the series. - * @Default {null} - */ - xName?: string; - - /** Name of the property in the datasource that contains y value for the series. - * @Default {null} - */ - yName?: string; - - /** Gap or padding for sparkline. - * @Default {8} - */ - padding?: number; - - /** Specifies the type of the series to render in sparkline. - * @Default {line. See Type} - */ - type?: ej.datavisualization.Sparkline.Type|string; - - /** Specifies the theme for Sparkline. - * @Default {Flatlight. See Theme} - */ - theme?: ej.datavisualization.Sparkline.Theme|string; - - /** Options to customize the tooltip. - */ - tooltip?: Tooltip; - - /** Options for displaying and customizing marker for a data point. - */ - markerSettings?: MarkerSettings; - - /** Options to customize the Sparkline size. - */ - size?: Size; - - /** Options for customizing the color,dashArray and width of the axisLine. - */ - axisLineSettings?: AxisLineSettings; - - /** Fires before loading the sparkline. */ - load?(e: LoadEventArgs): void; - - /** Fires after loaded the sparkline. */ - loaded?(e: LoadedEventArgs): void; - - /** Fires before rendering trackball tooltip. You can use this event to customize the text displayed in trackball tooltip. */ - tooltipInitialize?(e: TooltipInitializeEventArgs): void; - - /** Fires before rendering a series. This event is fired for each series in Sparkline. */ - seriesRendering?(e: SeriesRenderingEventArgs): void; - - /** Fires when mouse is moved over a point. */ - pointRegionMouseMove?(e: PointRegionMouseMoveEventArgs): void; - - /** Fires on clicking a point in sparkline. You can use this event to handle clicks made on points. */ - pointRegionMouseClick?(e: PointRegionMouseClickEventArgs): void; - - /** Fires on moving mouse over the sparkline. */ - sparklineMouseMove?(e: SparklineMouseMoveEventArgs): void; - - /** Fires on moving mouse outside the sparkline. */ - sparklineMouseLeave?(e: SparklineMouseLeaveEventArgs): void; -} - -export interface LoadEventArgs { - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the sparkline model object - */ - model?: any; - - /** Name of the event - */ - type?: string; -} - -export interface LoadedEventArgs { - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the sparkline model object - */ - model?: any; - - /** Name of the event - */ - type?: string; -} - -export interface TooltipInitializeEventArgs { - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the sparkline model object - */ - model?: any; - - /** Name of the event - */ - type?: string; - - /** X Location of the trackball tooltip in pixels - */ - locationX?: any; - - /** Y Location of the trackball tooltip in pixels - */ - locationY?: any; - - /** Index of the point for which trackball tooltip is displayed - */ - pointIndex?: number; - - /** Text to be displayed in trackball tooltip. Use this option to add custom text in trackball tooltip - */ - currentText?: string; -} - -export interface SeriesRenderingEventArgs { - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the sparkline model object - */ - model?: any; - - /** Name of the event - */ - type?: string; - - /** Minimum x value of the data point - */ - minX?: any; - - /** Minimum y value of the data point - */ - minY?: any; - - /** Maximum x value of the data point - */ - maxX?: any; - - /** Maximum y value of the data point - */ - maxY?: any; -} - -export interface PointRegionMouseMoveEventArgs { - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the sparkline model object - */ - model?: any; - - /** Name of the event - */ - type?: string; - - /** X-coordinate of point in pixel - */ - locationX?: number; - - /** Y-coordinate of point in pixel - */ - locationY?: number; - - /** Index of the point in series - */ - pointIndex?: number; - - /** Type of the series - */ - seriesType?: string; -} - -export interface PointRegionMouseClickEventArgs { - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the sparkline model object - */ - model?: any; - - /** Name of the event - */ - type?: string; - - /** X-coordinate of point in pixel - */ - locationX?: number; - - /** Y-coordinate of point in pixel - */ - locationY?: number; - - /** Index of the point in series - */ - pointIndex?: number; - - /** Type of the series - */ - seriesType?: string; -} - -export interface SparklineMouseMoveEventArgs { - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the sparkline model object - */ - model?: any; - - /** Name of the event - */ - type?: string; -} - -export interface SparklineMouseLeaveEventArgs { - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the sparkline model object - */ - model?: any; - - /** Name of the event - */ - type?: string; -} - -export interface Border { - - /** Border color of the sparkline. - * @Default {transparent} - */ - color?: string; - - /** Width of the Sparkline border. - * @Default {1} - */ - width?: number; -} - -export interface RangeBandSettings { - - /** Start value of the range band. - * @Default {null} - */ - startRange?: number; - - /** End value of the range band. - * @Default {null} - */ - endRange?: number; - - /** Range band opacity of the series. - * @Default {1} - */ - opacity?: number; - - /** Range band color of the series. - * @Default {transparent} - */ - color?: string; -} - -export interface TooltipBorder { - - /** Border color of the tooltip. - * @Default {transparent} - */ - color?: string; - - /** Border width of the tooltip. - * @Default {1} - */ - width?: number; -} - -export interface TooltipFont { - - /** Font color of the text in the tooltip. - * @Default {#111111} - */ - color?: string; - - /** Font Family for the tooltip. - * @Default {Segoe UI} - */ - fontFamily?: string; - - /** Specifies the font Style for the tooltip. - * @Default {Normal} - */ - fontStyle?: ej.datavisualization.Sparkline.FontStyle|string; - - /** Specifies the font weight for the tooltip. - * @Default {Regular} - */ - fontWeight?: ej.datavisualization.Sparkline.FontWeight|string; - - /** Opacity for text in the tooltip. - * @Default {1} - */ - opacity?: number; - - /** Font size for text in the tooltip. - * @Default {8px} - */ - size?: string; -} - -export interface Tooltip { - - /** Show/hides the tooltip visibility. - * @Default {false} - */ - visible?: boolean; - - /** Fill color for the sparkline tooltip. - * @Default {white} - */ - fill?: string; - - /** Custom template to the tooltip. - */ - template?: string; - - /** Options for customizing the border of the tooltip. - */ - border?: TooltipBorder; - - /** Options for customizing the font of the tooltip. - */ - font?: TooltipFont; -} - -export interface MarkerSettingsBorder { - - /** Border color of the marker shape. - * @Default {transparent} - */ - color?: string; - - /** Controls the opacity of the marker border. - * @Default {1} - */ - opacity?: number; - - /** Border width of the marker shape. - * @Default {null} - */ - width?: number; -} - -export interface MarkerSettings { - - /** Controls the opacity of the marker. - * @Default {1} - */ - opacity?: number; - - /** Controls the visibility of the marker shape. - * @Default {false} - */ - visible?: boolean; - - /** width of the marker shape. - * @Default {2} - */ - width?: number; - - /** Color of the marker shape. - * @Default {white} - */ - fill?: string; - - /** Options for customizing the border of the marker shape. - */ - border?: MarkerSettingsBorder; -} - -export interface Size { - - /** Height of the Sparkline. Height can be specified in either pixel or percentage. - * @Default {''} - */ - height?: string; - - /** Width of the Sparkline. Width can be specified in either pixel or percentage. - * @Default {''} - */ - width?: string; -} - -export interface AxisLineSettings { - - /** Controls the visibility of the axis. - * @Default {false} - */ - visible?: boolean; - - /** Color of the axis line. - * @Default {'#111111'} - */ - color?: string; - - /** Width of the axis line. - * @Default {1} - */ - width?: number; - - /** Dash array of the axis line. - * @Default {1} - */ - dashArray?: number; -} -} -namespace Sparkline { -enum Type { -//string -Area, -//string -Line, -//string -Column, -//string -Pie, -//string -WinLoss, -} -} -namespace Sparkline { -enum Theme { -//string -Azure, -//string -FlatLight, -//string -FlatDark, -//string -Azuredark, -//string -Lime, -//string -LimeDark, -//string -Saffron, -//string -SaffronDark, -//string -GradientLight, -//string -GradientDark, -} -} -namespace Sparkline { -enum FontStyle { -//string -Normal, -//string -Italic, -} -} -namespace Sparkline { -enum FontWeight { -//string -Regular, -//string -Bold, -//string -Lighter, -} -} - -class SunburstChart extends ej.Widget { - static fn: SunburstChart; - constructor(element: JQuery | Element, options?: SunburstChart.Model); - static Locale: any; - model: SunburstChart.Model; - defaults: SunburstChart.Model; - - /** Redraws the entire sunburst. You can call this method whenever you update, add or remove points from the data source or whenever you want to refresh the UI. - * @returns {void} - */ - redraw(): void; - - /** destroy the sunburst - * @returns {void} - */ - _destroy(): void; -} -export namespace SunburstChart { - -export interface Model { - - /** Background color of the plot area. - * @Default {null} - */ - background?: string; - - /** Bind the data field from the data source. - * @Default {null} - */ - valueMemberPath?: string; - - /** Options for customizing the sunburst border. - */ - border?: Border; - - /** Options for customizing the sunburst segment border. - */ - segmentBorder?: SegmentBorder; - - /** Specifies the dataSource to the sunburst. - * @Default {null} - */ - dataSource?: any; - - /** Palette color for the data points. - * @Default {null} - */ - palette?: string; - - /** Parent node of the data points. - * @Default {null} - */ - parentNode?: string; - - /** Name of the property in the datasource that contains x values. - * @Default {null} - */ - xName?: string; - - /** Name of the property in the datasource that contains y values. - * @Default {null} - */ - yName?: string; - - /** Controls wheather sunburst has to be responsive or not. - * @Default {true} - */ - isResponsive?: boolean; - - /** Options to customize the Sunburst size. - */ - size?: Size; - - /** Controls the visibility of sunburst. - * @Default {true} - */ - visible?: boolean; - - /** Options to customize the Sunburst tooltip. - */ - tooltip?: Tooltip; - - /** Options for customizing sunburst points. - */ - points?: Points; - - /** Sunburst rendering will start from the specified value - * @Default {null} - */ - startAngle?: number; - - /** Sunburst rendering will end at the specified value - * @Default {null} - */ - endAngle?: number; - - /** Sunburst outer radius value - * @Default {1} - */ - radius?: number; - - /** Sunburst inner radius value - * @Default {0.4} - */ - innerRadius?: number; - - /** Options to customize the Sunburst dataLabel. - */ - dataLabelSettings?: DataLabelSettings; - - /** Options for customizing the title and subtitle of sunburst. - */ - title?: Title; - - /** Options for customizing the appearance of the levels or point while highlighting. - */ - highlightSettings?: HighlightSettings; - - /** Options for customizing the appearance of the levels or data point while selection. - */ - selectionSettings?: SelectionSettings; - - /** Specify levels of sunburst for grouped visualization of data - * @Default {[]} - */ - levels?: Level[]; - - /** Options to customize the legend items and legend title. - */ - legend?: Legend; - - /** Specifies the theme for Sunburst. - * @Default {Flatlight. See Theme} - */ - theme?: ej.datavisualization.Sunburst.SunburstTheme|string; - - /** Options to customize the left, right, top and bottom margins of sunburst area. - */ - margin?: Margin; - - /** Enable/disable the animation for all the levels. - * @Default {false} - */ - enableAnimation?: boolean; - - /** Opacity of the levels. - * @Default {1} - */ - opacity?: number; - - /** Options for enable zooming feature of chart. - */ - zoomSettings?: ZoomSettings; - - /** Animation type of sunburst - * @Default {rotation. See Alignment} - */ - animationType?: ej.datavisualization.Sunburst.Animation|string; - - /** Fires before loading. */ - load?(e: LoadEventArgs): void; - - /** Fires before rendering sunburst. */ - preRender?(e: PreRenderEventArgs): void; - - /** Fires after rendering sunburst. */ - loaded?(e: LoadedEventArgs): void; - - /** Fires before rendering the datalabel */ - dataLabelRendering?(e: DataLabelRenderingEventArgs): void; - - /** Fires before rendering each segment */ - segmentRendering?(e: SegmentRenderingEventArgs): void; - - /** Fires before rendering sunburst title. */ - titleRendering?(e: TitleRenderingEventArgs): void; - - /** Fires during initialization of tooltip. */ - tooltipInitialize?(e: TooltipInitializeEventArgs): void; - - /** Fires after clicking the point in sunburst */ - pointRegionClick?(e: PointRegionClickEventArgs): void; - - /** Fires while moving the mouse over sunburst points */ - pointRegionMousemove?(e: PointRegionMousemoveEventArgs): void; - - /** Fires when clicking the point to perform drilldown. */ - drillDownClick?(e: DrillDownClickEventArgs): void; - - /** Fires when resetting drilldown points. */ - drillDownBack?(e: DrillDownBackEventArgs): void; - - /** Fires after resetting the sunburst points */ - drillDownReset?(e: DrillDownResetEventArgs): void; -} - -export interface LoadEventArgs { - - /** Load event data - */ - data?: string; - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the sunburst model object - */ - model?: any; - - /** Name of the event - */ - type?: string; -} - -export interface PreRenderEventArgs { - - /** PreRender event data - */ - data?: string; - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the sunburst model object - */ - model?: any; - - /** Name of the event - */ - type?: string; -} - -export interface LoadedEventArgs { - - /** Loaded event data - */ - data?: string; - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the sunburst model object - */ - model?: any; - - /** Name of the event - */ - type?: string; -} - -export interface DataLabelRenderingEventArgs { - - /** Sunburst datalabel data - */ - data?: string; - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the sunburst model object - */ - model?: any; - - /** Name of the event - */ - type?: string; -} - -export interface SegmentRenderingEventArgs { - - /** Sunburst datalabel data - */ - data?: string; - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the sunburst model object - */ - model?: any; - - /** Name of the event - */ - type?: string; -} - -export interface TitleRenderingEventArgs { - - /** Sunburst title data - */ - data?: string; - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the sunburst model object - */ - model?: any; - - /** Name of the event - */ - type?: string; -} - -export interface TooltipInitializeEventArgs { - - /** Sunburst tooltip data - */ - data?: string; - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the sunburst model object - */ - model?: any; - - /** Name of the event - */ - type?: string; -} - -export interface PointRegionClickEventArgs { - - /** Includes clicked points region data - */ - data?: string; - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the sunburst model object - */ - model?: any; - - /** Name of the event - */ - type?: string; -} - -export interface PointRegionMousemoveEventArgs { - - /** Includes data of mouse moved region - */ - data?: string; - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the sunburst model object - */ - model?: any; - - /** Name of the event - */ - type?: string; -} - -export interface DrillDownClickEventArgs { - - /** Clicked point data - */ - data?: string; - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the sunburst model object - */ - model?: any; - - /** Name of the event - */ - type?: string; -} - -export interface DrillDownBackEventArgs { - - /** Drill down data of points - */ - data?: string; - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the sunburst model object - */ - model?: any; - - /** Name of the event - */ - type?: string; -} - -export interface DrillDownResetEventArgs { - - /** Drill down reset data - */ - data?: string; - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the sunburst model object - */ - model?: any; - - /** Name of the event - */ - type?: string; -} - -export interface Border { - - /** Border color of the sunburst. - * @Default {null} - */ - color?: string; - - /** Width of the Sunburst border. - * @Default {2} - */ - width?: number; -} - -export interface SegmentBorder { - - /** Segment Border color of the sunburst. - * @Default {null} - */ - color?: string; - - /** Width of the Sunburst segment border. - * @Default {2} - */ - width?: number; -} - -export interface Size { - - /** Height of the Sunburst. - * @Default {''} - */ - height?: string; - - /** Width of the Sunburst. - * @Default {''} - */ - width?: string; -} - -export interface TooltipBorder { - - /** Border color of the tooltip. - * @Default {null} - */ - color?: string; - - /** Border width of the tooltip. - * @Default {5} - */ - width?: number; -} - -export interface TooltipFont { - - /** Font color of the text in the tooltip. - * @Default {null} - */ - color?: string; - - /** Font Family for the tooltip. - * @Default {Segoe UI} - */ - fontFamily?: string; - - /** Specifies the font Style for the tooltip. - * @Default {Normal} - */ - fontStyle?: ej.datavisualization.Sunburst.FontStyle|string; - - /** Specifies the font weight for the tooltip. - * @Default {Regular} - */ - fontWeight?: ej.datavisualization.Sunburst.FontWeight|string; - - /** Opacity for text in the tooltip. - * @Default {1} - */ - opacity?: number; - - /** Font size for text in the tooltip. - * @Default {12px} - */ - size?: string; -} - -export interface Tooltip { - - /** tooltip visibility of the Sunburst. - * @Default {true} - */ - visible?: boolean; - - /** Options for customizing the border of the sunburst tooltip. - */ - border?: TooltipBorder; - - /** Fill color for the sunburst tooltip. - * @Default {null} - */ - fill?: string; - - /** Options for customizing the font of the tooltip. - */ - font?: TooltipFont; - - /** Custom template to the tooltip. - * @Default {null} - */ - template?: string; -} - -export interface Points { - - /** Points x value of the sunburst. - * @Default {null} - */ - x?: string; - - /** Points y value of the sunburst. - * @Default {null} - */ - y?: number; - - /** Points text of the sunburst. - * @Default {null} - */ - text?: string; - - /** Points fill color of the sunburst. - * @Default {null} - */ - fill?: string; -} - -export interface DataLabelSettingsFont { - - /** Font family of the data label. - * @Default {Segoe UI} - */ - fontFamily?: string; - - /** Font style of the data label. - * @Default {normal. See FontStyle} - */ - fontStyle?: ej.datavisualization.Sunburst.FontStyle|string; - - /** Font weight of the data label. - * @Default {regular. See FontWeight} - */ - fontWeight?: ej.datavisualization.Sunburst.FontWeight|string; - - /** Opacity of the text. - * @Default {1} - */ - opacity?: number; - - /** Font color of the data label text. - * @Default {null} - */ - color?: string; - - /** Font size of the data label. - * @Default {12px} - */ - size?: string; -} - -export interface DataLabelSettings { - - /** Datalabel visibility of the Sunburst. - * @Default {false} - */ - visible?: boolean; - - /** Alginment of sunburst datalabel - * @Default {Angle. See DatalabelAlignment} - */ - labelRotationMode?: ej.datavisualization.Sunburst.SunburstLabelRotationMode|string; - - /** Options for customizing the data label font. - */ - font?: DataLabelSettingsFont; - - /** Custome template for datalabel - * @Default {null} - */ - template?: string; - - /** Fill color for the datalable - * @Default {null} - */ - fill?: string; - - /** Datalabel overflow mode - * @Default {Trim. See LabelOverflowMode} - */ - labelOverflowMode?: ej.datavisualization.Sunburst.SunburstLabelOverflowMode|string; -} - -export interface TitleFont { - - /** Font family for Sunburst title. - * @Default {Segoe UI} - */ - fontFamily?: string; - - /** Font style for Sunburst title. - * @Default {Normal. See FontStyle} - */ - fontStyle?: ej.datavisualization.Sunburst.FontStyle|string; - - /** Font weight for Sunburst title. - * @Default {Regular. See FontWeight} - */ - fontWeight?: ej.datavisualization.Sunburst.FontWeight|string; - - /** Opacity of the Sunburst title. - * @Default {1} - */ - opacity?: number; - - /** Font size for Sunburst title. - * @Default {20px} - */ - size?: string; -} - -export interface TitleSubtitleFont { - - /** Font family of sub title. - * @Default {Segoe UI} - */ - fontFamily?: string; - - /** Font style for sub title. - * @Default {Normal. See FontStyle} - */ - fontStyle?: ej.datavisualization.Sunburst.FontStyle|string; - - /** Font weight for sub title. - * @Default {Regular. See FontWeight} - */ - fontWeight?: ej.datavisualization.Sunburst.FontWeight|string; - - /** Opacity of the sub title. - * @Default {1} - */ - opacity?: number; - - /** Font size for sub title. - * @Default {12px} - */ - size?: string; -} - -export interface TitleSubtitle { - - /** Subtitle text for sunburst - */ - text?: string; - - /** Sub title text visibility for sunburst - * @Default {true} - */ - visible?: string; - - /** Sub title text alignment - * @Default {far. See TextAlignment} - */ - textAlignment?: ej.datavisualization.Sunburst.SunburstAlignment|string; - - /** Options for customizing the font of sub title. - */ - font?: TitleSubtitleFont; -} - -export interface Title { - - /** Title text for sunburst - */ - text?: string; - - /** Title text visibility for sunburst - * @Default {true} - */ - visible?: string; - - /** Title text alignment - * @Default {center. See TextAlignment} - */ - textAlignment?: ej.datavisualization.Sunburst.SunburstAlignment|string; - - /** Options for customizing the font of sunburst title. - */ - font?: TitleFont; - - /** Options to customize the sub title of Sunburst. - */ - subtitle?: TitleSubtitle; -} - -export interface HighlightSettings { - - /** Enables/disables the ability to highlight the levels or point interactively. - * @Default {false} - */ - enable?: boolean; - - /** Specifies whether the levels or point has to be highlighted. - * @Default {point. See Mode} - */ - mode?: ej.datavisualization.Sunburst.SunburstHighlightMode|string; - - /** Color of the levels/point on highlight. - * @Default {red} - */ - color?: string; - - /** Opacity of the levels/point on highlight. - * @Default {0.5} - */ - opacity?: number; - - /** Specifies whether the levels or data point has to be highlighted. - * @Default {opacity. See Mode} - */ - type?: ej.datavisualization.Sunburst.SunburstHighlightType|string; -} - -export interface SelectionSettings { - - /** Enables/disables the ability to select the levels or data point interactively. - * @Default {false} - */ - enable?: boolean; - - /** Specifies whether the levels or data point has to be selected. - * @Default {point. See Mode} - */ - mode?: ej.datavisualization.Sunburst.SunburstHighlightMode|string; - - /** Color of the levels/point on selection. - * @Default {green} - */ - color?: string; - - /** Opacity of the levels/point on selection. - * @Default {0.5} - */ - opacity?: number; - - /** Specifies whether the levels or data point has to be selected. - * @Default {opacity. See Mode} - */ - type?: ej.datavisualization.Sunburst.SunburstHighlightType|string; -} - -export interface Level { - - /** Specifies the group member path - * @Default {null} - */ - groupMemberPath?: string; -} - -export interface LegendBorder { - - /** Border color of the legend. - * @Default {null} - */ - color?: string; - - /** Border width of the legend. - * @Default {1} - */ - width?: number; -} - -export interface LegendFont { - - /** Font family for legend item text. - * @Default {Segoe UI} - */ - fontFamily?: string; - - /** Font style for legend item text. - * @Default {Normal. See FontStyle} - */ - fontStyle?: ej.datavisualization.Sunburst.FontStyle|string; - - /** Font weight for legend item text. - * @Default {Regular. See FontWeight} - */ - fontWeight?: ej.datavisualization.Sunburst.FontWeight|string; - - /** Font size for legend item text. - * @Default {12px} - */ - size?: string; -} - -export interface LegendItemStyle { - - /** Height of the shape in legend items. - * @Default {10} - */ - height?: number; - - /** Width of the shape in legend items. - * @Default {10} - */ - width?: number; -} - -export interface LegendLocation { - - /** X value or horizontal offset to position the legend in chart. - * @Default {0} - */ - x?: number; - - /** Y value or vertical offset to position the legend. - * @Default {0} - */ - y?: number; -} - -export interface LegendSize { - - /** Height of the legend. Height can be specified in either pixel or percentage. - * @Default {null} - */ - height?: string; - - /** Width of the legend. Width can be specified in either pixel or percentage. - * @Default {null} - */ - width?: string; -} - -export interface LegendTitleFont { - - /** Font family for the text in legend title. - * @Default {Segoe UI} - */ - fontFamily?: string; - - /** Font style for legend title. - * @Default {normal. See FontStyle} - */ - fontStyle?: ej.datavisualization.Sunburst.FontStyle|string; - - /** Font weight for legend title. - * @Default {normal. See FontWeight} - */ - fontWeight?: ej.datavisualization.Sunburst.FontWeight|string; - - /** Font size for legend title. - * @Default {12px} - */ - size?: string; -} - -export interface LegendTitle { - - /** Options to customize the font used for legend title - */ - font?: LegendTitleFont; - - /** Enables or disables the legend title. - * @Default {true} - */ - visible?: string; - - /** Text to be displayed in legend title. - */ - text?: string; - - /** Alignment of the legend title. - * @Default {center. See Alignment} - */ - textAlignment?: ej.datavisualization.Sunburst.SunburstAlignment|string; -} - -export interface Legend { - - /** Visibility of the legend. - * @Default {false} - */ - visible?: boolean; - - /** Interactive action of legend items. - * @Default {toggleSegmentVisibility. See Alignment} - */ - clickAction?: ej.datavisualization.Sunburst.SunburstClickAction|string; - - /** Horizontal alignment of the legend. - * @Default {Center. See Alignment} - */ - alignment?: ej.datavisualization.Sunburst.SunburstAlignment|string; - - /** Options for customizing the legend border. - */ - border?: LegendBorder; - - /** Number of columns to arrange the legend items. - * @Default {null} - */ - columnCount?: number; - - /** Number of rows to arrange the legend items. - * @Default {null} - */ - rowCount?: number; - - /** Options to customize the font used for legend item text. - */ - font?: LegendFont; - - /** Gap or padding between the legend items. - * @Default {10} - */ - itemPadding?: number; - - /** Options to customize the style of legend items. - */ - itemStyle?: LegendItemStyle; - - /** Options to customize the location of sunburst legend. Legend is placed in provided location only when value of position property is custom - */ - location?: LegendLocation; - - /** Places the legend at specified position. Legend can be placed at left, right, top or bottom of the chart area.To manually specify the location of legend, set custom as value to this property. - * @Default {Bottom. See Position} - */ - position?: ej.datavisualization.Sunburst.SunburstLegendPosition|string; - - /** Shape of the legend items. - * @Default {None. See Shape} - */ - shape?: ej.datavisualization.Sunburst.SunburstLegendShape|string; - - /** Options to customize the size of the legend. - */ - size?: LegendSize; - - /** Options to customize the legend title. - */ - title?: LegendTitle; -} - -export interface Margin { - - /** Spacing for the left margin of chart area. Setting positive value decreases the width of the chart area from left side. - * @Default {10} - */ - left?: number; - - /** Spacing for the right margin of chart area. Setting positive value decreases the width of the chart area from right side. - * @Default {10} - */ - right?: number; - - /** Spacing for the top margin of chart area. Setting positive value decreases the height of the chart area from the top. - * @Default {10} - */ - top?: number; - - /** Spacing for the bottom margin of the chart area. Setting positive value decreases the height of the chart area from the bottom. - * @Default {10} - */ - bottom?: number; -} - -export interface ZoomSettings { - - /** Enables or disables zooming. - * @Default {false} - */ - enable?: boolean; - - /** Toolbar horizontal alignment - * @Default {right. See Alignment} - */ - toolbarHorizontalAlignment?: ej.datavisualization.Sunburst.SunburstHorizontalAlignment|string; - - /** Toolbar vertical alignment - * @Default {top. See Alignment} - */ - toolbarVerticalAlignment?: ej.datavisualization.Sunburst.SunburstVerticalAlignment|string; -} -} -namespace Sunburst { -enum FontStyle { -//string -Normal, -//string -Italic, -} -} -namespace Sunburst { -enum FontWeight { -//string -Regular, -//string -Bold, -//string -Lighter, -} -} -namespace Sunburst { -enum SunburstLabelRotationMode { -//string -Angle, -//string -Normal, -} -} -namespace Sunburst { -enum SunburstLabelOverflowMode { -//string -Trim, -//string -Hide, -//string -None, -} -} -namespace Sunburst { -enum SunburstAlignment { -//string -Center, -//string -Near, -//string -Far, -} -} -namespace Sunburst { -enum SunburstHighlightMode { -//string -Point, -//string -Parent, -//string -Child, -//string -All, -} -} -namespace Sunburst { -enum SunburstHighlightType { -//string -Opacity, -//string -Color, -} -} -namespace Sunburst { -enum SunburstClickAction { -//string -None, -//string -ToggleSegmentVisibility, -//string -ToggleSegmentSelection, -} -} -namespace Sunburst { -enum SunburstLegendPosition { -//string -Left, -//string -Right, -//string -Top, -//string -Bottom, -} -} -namespace Sunburst { -enum SunburstLegendShape { -//string -Diamond, -//string -Pentagon, -//string -Rectangle, -//string -Circle, -//string -Cross, -//string -Triangle, -} -} -namespace Sunburst { -enum SunburstTheme { -//string -FlatLight, -//string -FlatDark, -} -} -namespace Sunburst { -enum SunburstHorizontalAlignment { -//string -Center, -//string -Left, -//string -Right, -} -} -namespace Sunburst { -enum SunburstVerticalAlignment { -//string -Top, -//string -Bottom, -//string -Middle, -} -} -namespace Sunburst { -enum Animation { -//string -Rotation, -//string -FadeIn, -} -} - -class PivotGrid extends ej.Widget { - static fn: PivotGrid; - constructor(element: JQuery | Element, options?: PivotGrid.Model); - static Locale: any; - model: PivotGrid.Model; - defaults: PivotGrid.Model; - - /** Performs an asynchronous HTTP (AJAX) request. - * @returns {void} - */ - doAjaxPost(): void; - - /** Performs an asynchronous HTTP (FullPost) submit. - * @returns {void} - */ - doPostBack(): void; - - /** Exports the PivotGrid to the specified format. - * @returns {void} - */ - exportPivotGrid(): void; - - /** This function re-renders the PivotGrid on clicking the navigation buttons on PivotPager. - * @returns {void} - */ - refreshPagedPivotGrid(): void; - - /** This function refreshes the PivotGrid with modified data input in client-mode. - * @returns {void} - */ - refreshPivotGrid(): void; - - /** This function re-renders the control with the report available at that instant. - * @returns {void} - */ - refreshControl(): void; - - /** This function returns the height of all rows and width each and every column. - * @returns {any} - */ - calculateCellWidths(): any; - - /** This function creates the conditional formatting dialog to apply conditional formatting for PivotGrid control. - * @returns {void} - */ - createConditionalDialog(): void; - - /** This function saves the current report to the database/local storage. - * @returns {void} - */ - saveReport(): void; - - /** This function loads the specified report from the database/local storage. - * @returns {void} - */ - loadReport(): void; - - /** This function reconstructs the JSON data formed for rendering PivotGrid in excel-like layout format. - * @returns {void} - */ - excelLikeLayout(): void; - - /** Returns the OlapReport string maintained along with the axis elements information. - * @returns {string} - */ - getOlapReport(): string; - - /** Sets the OlapReport string along with the axis information. - * @returns {void} - */ - setOlapReport(): void; - - /** Returns the JSON records formed to render the control. - * @returns {Array} - */ - getJSONRecords(): any[]; - - /** Sets the JSON records formed to render the control. - * @returns {void} - */ - setJSONRecords(): void; - - /** This function allows user to change the caption of the Pivot Item (name displayed in UI) on-demand for relational datasource in client-mode. - * @returns {void} - */ - refreshFieldCaption(): void; - - /** This function receives the JSON formatted datasource to render the PivotGrid control. - * @returns {void} - */ - renderControlFromJSON(): void; -} -export namespace PivotGrid { - -export interface Model { - - /** Sets the mode for the PivotGrid widget for binding either OLAP or relational data source. - * @Default {ej.Pivot.AnalysisMode.Pivot} - */ - analysisMode?: ej.Pivot.AnalysisMode|string; - - /** Specifies the CSS class to PivotGrid to achieve custom theme. - * @Default {“”} - */ - cssClass?: string; - - /** Connects the PivotSchemaDesigner with the specified ID to the PivotGrid Control. - * @Default {“”} - */ - pivotTableFieldListID?: string; - - /** Initializes the data source for the PivotGrid widget, when it functions completely on client-side. - * @Default {{}} - */ - dataSource?: DataSource; - - /** Holds the neccessary properties for value sorting. - * @Default {{}} - */ - valueSortSettings?: ValueSortSettings; - - /** Object that holds the settings of frozen headers. - * @Default {{}} - */ - frozenHeaderSettings?: FrozenHeaderSettings; - - /** Object utilized to pass additional information between client-end and service-end on operating the control in server mode. - * @Default {null} - */ - customObject?: any; - - /** Allows the user to collapsed the specified members in each field by default. - * @Default {null} - */ - collapsedMembers?: any; - - /** Allows the user to access each cell on mouse right-click. - * @Default {false} - */ - enableCellContext?: boolean; - - /** Enables the cell selection for a specific range of value cells. - * @Default {false} - */ - enableCellSelection?: boolean; - - /** Enables the Drill-Through feature which retrieves the raw items that are used to create the specific cell in PivotGrid. - * @Default {false} - */ - enableDrillThrough?: boolean; - - /** Allows user to get the cell details in JSON format on double clicking the cell. - * @Default {false} - */ - enableCellDoubleClick?: boolean; - - /** Allows user to edit the value cells for write-back support in PivotGrid. This is applicable only for server-mode. - * @Default {false} - */ - enableCellEditing?: boolean; - - /** Collapses the Pivot items along rows and columns by default. It works only for relational data source. - * @Default {false} - */ - enableCollapseByDefault?: boolean; - - /** Enables/Disables the display of grand total for all the columns. - * @Default {true} - */ - enableColumnGrandTotal?: boolean; - - /** Allows the user to format a specific set of cells based on the condition. - * @Default {false} - */ - enableConditionalFormatting?: boolean; - - /** Allows the user to refresh the control on-demand and not during every UI operation. - * @Default {false} - */ - enableDeferUpdate?: boolean; - - /** Enables the display of GroupingBar allowing you to filter, sort and remove fields obtained from datasource. - * @Default {false} - */ - enableGroupingBar?: boolean; - - /** Enables/Disables the display of grand total for rows and columns. - * @Default {true} - */ - enableGrandTotal?: boolean; - - /** Allows the user to load PivotGrid using JSON data. - * @Default {false} - */ - enableJSONRendering?: boolean; - - /** Enables rendering of PivotGrid widget along with the PivotTable Field List, which allows UI operations. - * @Default {true} - */ - enablePivotFieldList?: boolean; - - /** Enables the display of grand total for all the rows. - * @Default {true} - */ - enableRowGrandTotal?: boolean; - - /** Allows the user to view layout of the PivotGrid from right to left. - * @Default {false} - */ - enableRTL?: boolean; - - /** Allows the user to enable ToolTip option. - * @Default {false} - */ - enableToolTip?: boolean; - - /** Allows the user to enable the animation effects in tooltip. - * @Default {false} - */ - enableToolTipAnimation?: boolean; - - /** Allows the user to adjust the width of the columns dynamically. - * @Default {false} - */ - enableColumnResizing?: boolean; - - /** Allows the user to view large amount of data through virtual scrolling. - * @Default {false} - */ - enableVirtualScrolling?: boolean; - - /** Allows the user to view large amount of data by applying paging. - * @Default {false} - */ - enablePaging?: boolean; - - /** Allows the user to configure hyperlink settings of PivotGrid control. - * @Default {{}} - */ - hyperlinkSettings?: HyperlinkSettings; - - /** Allows the user to enable PivotGrid’s responsiveness in the browser layout. - * @Default {false} - */ - isResponsive?: boolean; - - /** Contains the serialized JSON string which renders PivotGrid. - */ - jsonRecords?: string; - - /** Sets the summary layout for PivotGrid.Following are the ways in which summary can be positioned: normal summary (bottom), top summary, no summary and excel-like summary. - * @Default {ej.PivotGrid.Layout.Normal} - */ - layout?: ej.PivotGrid.Layout|string; - - /** Allows the user to set the localized language for the widget. - * @Default {en-US} - */ - locale?: string; - - /** Sets the mode for the PivotGrid widget for binding data source either in server-side or client-side. - * @Default {ej.Pivot.OperationalMode.ClientMode} - */ - operationalMode?: ej.Pivot.OperationalMode|string; - - /** Allows the user to set custom name for the methods at service-end, communicated during AJAX post. - * @Default {{}} - */ - serviceMethodSettings?: ServiceMethodSettings; - - /** Connects the service using the specified URL for any server updates. - * @Default {“”} - */ - url?: string; - - /** Triggers when it reaches client-side after any AJAX request. */ - afterServiceInvoke?(e: AfterServiceInvokeEventArgs): void; - - /** Triggers before any AJAX request is passed from PivotGrid to service methods. */ - beforeServiceInvoke?(e: BeforeServiceInvokeEventArgs): void; - - /** Triggers before Pivot Engine starts to populate. */ - beforePivotEnginePopulate?(e: BeforePivotEnginePopulateEventArgs): void; - - /** Triggers when double click action is performed over a cell. */ - cellDoubleClick?(e: CellDoubleClickEventArgs): void; - - /** Triggers when right-click action is performed on a cell. */ - cellContext?(e: CellContextEventArgs): void; - - /** Triggers when a specific range of value cells are selected. */ - cellSelection?(e: CellSelectionEventArgs): void; - - /** Triggers when the hyperlink of column header is clicked. */ - columnHeaderHyperlinkClick?(e: ColumnHeaderHyperlinkClickEventArgs): void; - - /** Triggers after performing drill operation in PivotGrid. */ - drillSuccess?(e: DrillSuccessEventArgs): void; - - /** Triggers while clicking "OK" button in the drill-through dialog. */ - drillThrough?(e: DrillThroughEventArgs): void; - - /** Triggers when PivotGrid loading is initiated. */ - load?(e: LoadEventArgs): void; - - /** Triggers when PivotGrid widget completes all operations at client-side after any AJAX request. */ - renderComplete?(e: RenderCompleteEventArgs): void; - - /** Triggers when any error occurred during AJAX request. */ - renderFailure?(e: RenderFailureEventArgs): void; - - /** Triggers when PivotGrid successfully reaches client-side after any AJAX request. */ - renderSuccess?(e: RenderSuccessEventArgs): void; - - /** Triggers when the hyperlink of row header is clicked. */ - rowHeaderHyperlinkClick?(e: RowHeaderHyperlinkClickEventArgs): void; - - /** Triggers when the hyperlink of summary cell is clicked. */ - summaryCellHyperlinkClick?(e: SummaryCellHyperlinkClickEventArgs): void; - - /** Triggers when the hyperlink of value cell is clicked. */ - valueCellHyperlinkClick?(e: ValueCellHyperlinkClickEventArgs): void; - - /** Triggers before saving the current report to database. */ - saveReport?(e: SaveReportEventArgs): void; - - /** Triggers before loading a report from database. */ - loadReport?(e: LoadReportEventArgs): void; - - /** Triggers before performing exporting in pivot grid. */ - beforeExport?(e: BeforeExportEventArgs): void; - - /** Triggers before editing the cells. */ - cellEdit?(e: CellEditEventArgs): void; -} - -export interface AfterServiceInvokeEventArgs { - - /** returns the current action of PivotGrid control. - */ - action?: string; - - /** returns the custom object bound with PivotGrid control. - */ - customObject?: any; - - /** returns the HTML element of PivotGrid control. - */ - element?: any; -} - -export interface BeforeServiceInvokeEventArgs { - - /** returns the current action of PivotGrid control. - */ - action?: string; - - /** returns the custom object bound with PivotGrid control. - */ - customObject?: any; - - /** returns the HTML element of PivotGrid control. - */ - element?: any; -} - -export interface BeforePivotEnginePopulateEventArgs { - - /** returns the PivotGrid object - */ - pivotGridObject?: any; -} - -export interface CellDoubleClickEventArgs { - - /** returns the JSON details of the double clicked cell. - */ - selectedData?: any[]; - - /** returns the custom object bound with PivotGrid control. - */ - customObject?: any; - - /** returns the HTML element of PivotGrid control. - */ - element?: any; -} - -export interface CellContextEventArgs { - - /** returns the cell position (row index and column index) in table. - */ - cellPosition?: string; - - /** returns the type of the cell. - */ - cellType?: string; - - /** returns the content of the cell. - */ - cellValue?: string; - - /** returns the unique name of levels/members. - */ - uniqueName?: string; - - /** returns the role of the cell in PivotGrid. - */ - role?: string; - - /** returns JSON record corresponding to the selected cell. - */ - rawdata?: any; - - /** returns the original event object. - */ - args?: any; -} - -export interface CellSelectionEventArgs { - - /** returns the JSON records of the selected range of cells. - */ - JSONRecords?: any; - - /** Returns the row headers corresponding to the selected value cells. - */ - rowheader?: any; - - /** Returns the column headers corresponding to the selected value cells. - */ - columnheader?: any; - - /** Returns the information about the measure associated with the selected cell. - */ - measureCount?: string; -} - -export interface ColumnHeaderHyperlinkClickEventArgs { - - /** returns the information about the clicked cell - */ - args?: any; - - /** returns the HTML element of the control. - */ - element?: any; - - /** returns the custom object bound to the control. - */ - customObject?: any; -} - -export interface DrillSuccessEventArgs { - - /** returns the HTML element of the control. - */ - args?: any; -} - -export interface DrillThroughEventArgs { - - /** return the JSON records of the generated cells on drill-through operation. - */ - data?: any; - - /** returns the HTML element of PivotGrid control. - */ - element?: any; -} - -export interface LoadEventArgs { - - /** returns the custom object bound with the control. - */ - customObject?: any; - - /** returns the HTML element of PivotGrid control. - */ - element?: any; -} - -export interface RenderCompleteEventArgs { - - /** returns the current action of PivotGrid control. - */ - action?: string; - - /** returns the custom object bound with the control. - */ - customObject?: any; - - /** returns the HTML element of PivotGrid control. - */ - element?: any; -} - -export interface RenderFailureEventArgs { - - /** returns the current action of PivotGrid control. - */ - action?: string; - - /** returns the custom object bound with the control. - */ - customObject?: any; - - /** returns the HTML element of PivotGrid control. - */ - element?: any; - - /** returns the error message with error code. - */ - message?: string; -} - -export interface RenderSuccessEventArgs { - - /** returns the current action of PivotGrid control. - */ - action?: string; - - /** returns the custom object bound with the control. - */ - customObject?: any; - - /** returns the HTML element of PivotGrid control. - */ - element?: any; -} - -export interface RowHeaderHyperlinkClickEventArgs { - - /** returns the information about the clicked cell - */ - args?: any; - - /** returns the HTML element of the control. - */ - element?: any; - - /** returns the custom object bound to the control. - */ - customObject?: any; -} - -export interface SummaryCellHyperlinkClickEventArgs { - - /** returns the information about the clicked cell - */ - args?: any; - - /** returns the HTML element of the control. - */ - element?: any; - - /** returns the custom object bound to the control. - */ - customObject?: any; -} - -export interface ValueCellHyperlinkClickEventArgs { - - /** returns the information about the clicked cell - */ - args?: any; - - /** returns the HTML element of the control. - */ - element?: any; - - /** returns the custom object bound to the control. - */ - customObject?: any; -} - -export interface SaveReportEventArgs { - - /** returns the report to be stored in database. - */ - report?: any; -} - -export interface LoadReportEventArgs { - - /** returns the PivotGrid object. - */ - targetControl?: any; - - /** returns whether the control is bound with OLAP or Relational data source. - */ - dataModel?: string; -} - -export interface BeforeExportEventArgs { - - /** contains the url of the service responsible for exporting. - */ - url?: string; - - /** contains the name of the exporting file. - */ - fileName?: string; -} - -export interface CellEditEventArgs { - - /** contains the array of cells selected for editing. - */ - editCellsInfo?: any[]; -} - -export interface DataSourceColumnsAdvancedFilter { - - /** Allows the user to provide level unique name to perform advanced filtering. - */ - name?: string; - - /** Allows the user to set the operator to perform Label Filtering. - * @Default {none} - */ - labelFilterOperator?: string; - - /** Allows the user to set the operator to perform Value Filtering. - * @Default {none} - */ - valueFilterOperator?: string; - - /** Allows the user to set the filtering type while performing advanced filtering. - */ - advancedFilterType?: string; - - /** In case of value filtering, this property contains the measure name to which the filter is applied. - */ - measure?: string; - - /** Allows the user to hold the filter operand values in advanced filtering. - */ - values?: any[]; -} - -export interface DataSourceColumnsFilterItems { - - /** Sets the type of filter whether to include/exclude the mentioned values. - * @Default {ej.PivotAnalysis.FilterType.Exclude} - */ - filterType?: ej.PivotAnalysis.FilterType|string; - - /** Contains the collection of items to be included/excluded among the field members. - * @Default {[]} - */ - values?: any[]; -} - -export interface DataSourceColumn { - - /** Allows the user to bind the item by using its unique name as field name. - */ - fieldName?: string; - - /** Allows the user to set the display caption for an item. - */ - fieldCaption?: string; - - /** Allows the user to filter the report by default using advanced filtering (excel-like) option for OLAP data source in client-mode. - * @Default {[]} - */ - advancedFilter?: DataSourceColumnsAdvancedFilter[]; - - /** Allows the user to indicate whether the added item is a named set or not. - * @Default {false} - */ - isNamedSets?: boolean; - - /** Shows/Hides the sub-total of the field in PivotGrid. - * @Default {true} - */ - showSubTotal?: boolean; - - /** Allows the user to set the sorting order of the members of the field. - * @Default {ej.PivotAnalysis.SortOrder.Ascending} - */ - sortOrder?: ej.PivotAnalysis.SortOrder|string; - - /** Contains the list of members need to be drilled down by default in the field. - * @Default {[]} - */ - drilledItems?: any[]; - - /** Applies filter to the field members. - * @Default {null} - */ - filterItems?: DataSourceColumnsFilterItems; -} - -export interface DataSourceRowsAdvancedFilter { - - /** Allows the user to provide level unique name to perform advanced filtering. - */ - name?: string; - - /** Allows the user to set the operator to perform Label Filtering. - * @Default {none} - */ - labelFilterOperator?: string; - - /** Allows the user to set the operator to perform Value Filtering. - * @Default {none} - */ - valueFilterOperator?: string; - - /** Allows the user to set the filtering type while performing advanced filtering. - */ - advancedFilterType?: string; - - /** In case of value filtering, this property contains the measure name to which the filter is applied. - */ - measure?: string; - - /** Allows the user to hold the filter operand values in advanced filtering. - */ - values?: any[]; -} - -export interface DataSourceRowsFilterItems { - - /** Sets the type of filter whether to include/exclude the mentioned values. - * @Default {ej.PivotAnalysis.FilterType.Exclude} - */ - filterType?: ej.PivotAnalysis.FilterType|string; - - /** Contains the collection of items to be included/excluded among the field members. - * @Default {[]} - */ - values?: any[]; -} - -export interface DataSourceRow { - - /** Allows the user to bind the item by using its unique name as field name. - */ - fieldName?: string; - - /** Allows the user to set the display caption for an item. - */ - fieldCaption?: string; - - /** Allows the user to filter the report by default using advanced filtering (excel-like) option for OLAP data source in client-mode. - * @Default {[]} - */ - advancedFilter?: DataSourceRowsAdvancedFilter[]; - - /** Allows the user to indicate whether the added item is a named set or not. - * @Default {false} - */ - isNamedSets?: boolean; - - /** Shows/Hides the sub-total of the field. - * @Default {true} - */ - showSubTotal?: boolean; - - /** Allows the user to set the sorting order of the members of the field. - * @Default {ej.PivotAnalysis.SortOrder.Ascending} - */ - sortOrder?: ej.PivotAnalysis.SortOrder|string; - - /** Contains the list of members need to be drilled down by default in the field. - * @Default {[]} - */ - drilledItems?: any[]; - - /** Applies filter to the field members. - * @Default {null} - */ - filterItems?: DataSourceRowsFilterItems; -} - -export interface DataSourceValuesMeasure { - - /** Allows the user to bind the measure from OLAP datasource by using its unique name as field name. - */ - fieldName?: string; -} - -export interface DataSourceValue { - - /** Allows the user to bind the item by using its unique name as field name for Relational datasource. - */ - fieldName?: string; - - /** Allows the user to set the display caption for an item for Relational datasource. - */ - fieldCaption?: string; - - /** This holds the list of unique names of measures to bind them from the OLAP cube. - * @Default {[]} - */ - measures?: DataSourceValuesMeasure[]; - - /** Allows to set the axis name to place the measures items. - * @Default {rows} - */ - axis?: string; - - /** Indicates whether the field is a calculated field or not with Relational datasource. - * @Default {false} - */ - isCalculatedField?: boolean; - - /** Allows to set the type of PivotGrid summary calculation for the value field with Relational datasource. - * @Default {ej.PivotAnalysis.SummaryType.Sum} - */ - summaryType?: ej.PivotAnalysis.SummaryType|string; - - /** Allows to set the format of the values. - */ - format?: string; - - /** This property sets type of display of date. - */ - formatString?: string; - - /** Allows to set the formula for calculation of values for calculated members in Relational datasource. - */ - formula?: string; -} - -export interface DataSourceFiltersFilterItems { - - /** Sets the type of filter whether to include/exclude the mentioned values. - * @Default {ej.PivotAnalysis.FilterType.Exclude} - */ - filterType?: ej.PivotAnalysis.FilterType|string; - - /** Contains the collection of items to be included/excluded among the field members. - * @Default {[]} - */ - values?: any[]; -} - -export interface DataSourceFilter { - - /** Allows the user to bind the item by using its unique name as field name. - */ - fieldName?: string; - - /** Allows the user to set the display name for an item. - */ - fieldCaption?: string; - - /** Applies filter to the field members. - * @Default {null} - */ - filterItems?: DataSourceFiltersFilterItems; -} - -export interface DataSourcePagerOptions { - - /** Allows to set the number of categorical columns to be displayed in each page on applying paging. - * @Default {0} - */ - categoricalPageSize?: number; - - /** Allows to set the number of series rows to be displayed in each page on applying paging. - * @Default {0} - */ - seriesPageSize?: number; - - /** Allows to set the page number in categorical axis to be loaded by default. - * @Default {1} - */ - categoricalCurrentPage?: number; - - /** Allows to set the page number in series axis to be loaded by default. - * @Default {1} - */ - seriesCurrentPage?: number; -} - -export interface DataSource { - - /** Lists out the items to be arranged in columns section of PivotGrid. - * @Default {[]} - */ - columns?: DataSourceColumn[]; - - /** Lists out the items to be arranged in rows section of PivotGrid. - * @Default {[]} - */ - rows?: DataSourceRow[]; - - /** Lists out the items which supports calculation in PivotGrid. - * @Default {[]} - */ - values?: DataSourceValue[]; - - /** Lists out the items which supports filtering of values without displaying the members in UI in PivotGrid. - * @Default {[]} - */ - filters?: DataSourceFilter[]; - - /** Contains the respective cube name from OLAP database as string type. - * @Default {“”} - */ - cube?: string; - - /** Provides the raw data source for the PivotGrid. - * @Default {null} - */ - data?: any; - - /** In connection with an OLAP database, this property contains the database name as string to fetch the data from the given connection string. - * @Default {“”} - */ - catalog?: string; - - /** Allows user to filter the members (by its name and values) through advanced filtering (excel-like) option for OLAP data source in client-mode. - * @Default {false} - */ - enableAdvancedFilter?: boolean; - - /** Sets a name to the report bound to the control. - */ - reportName?: string; - - /** Allows to set the page size and current page number for each axis on applying paging. - * @Default {{}} - */ - pagerOptions?: DataSourcePagerOptions; -} - -export interface ValueSortSettings { - - /** Contains the headers of the specific column to which value sorting is applied. - */ - headerText?: string; - - /** Allows the user to set the string for separating column headers provided in the above property headerText. - */ - headerDelimiters?: string; - - /** Allows the user to set the sorting order of the values of the field. - * @Default {ej.PivotAnalysis.SortOrder.Ascending} - */ - sortOrder?: ej.PivotAnalysis.SortOrder|string; -} - -export interface FrozenHeaderSettings { - - /** Allows the user to freeze the row headers alone on scrolling the horizontal scroll bar. - * @Default {false} - */ - enableFrozenRowHeaders?: boolean; - - /** Allows the user to freeze the column headers alone on scrolling the vertical scroll bar. - * @Default {false} - */ - enableFrozenColumnHeaders?: boolean; - - /** Allows the user to freeze both the row headers and column headers on scrolling. - * @Default {false} - */ - enableFrozenHeaders?: boolean; -} - -export interface HyperlinkSettings { - - /** Allows the user to enable/disable hyperlink for column header. - * @Default {false} - */ - enableColumnHeaderHyperlink?: boolean; - - /** Allows the user to enable/disable hyperlink for row header. - * @Default {false} - */ - enableRowHeaderHyperlink?: boolean; - - /** Allows the user to enable/disable hyperlink for summary cells. - * @Default {false} - */ - enableSummaryCellHyperlink?: boolean; - - /** Allows the user to enable/disable hyperlink for value cells. - * @Default {false} - */ - enableValueCellHyperlink?: boolean; -} - -export interface ServiceMethodSettings { - - /** Allows the user to set the custom name for the service method responsible for drill up/down operation in PivotGrid. - * @Default {DrillGrid} - */ - drillDown?: string; - - /** Allows the user to set the custom name for the service method responsible for exporting. - * @Default {Export} - */ - exportPivotGrid?: string; - - /** Allows the user to set the custom name for the service method responsible for performing server-side actions on defer update. - * @Default {DeferUpdate} - */ - deferUpdate?: string; - - /** Allows the user to set the custom name for the service method responsible for getting the values for the tree-view inside filter dialog. - * @Default {FetchMembers} - */ - fetchMembers?: string; - - /** Allows the user to set the custom name for the service method responsible for filtering operation in PivotGrid. - * @Default {Filtering} - */ - filtering?: string; - - /** Allows the user to set the custom name for the service method responsible for initializing PivotGrid. - * @Default {InitializeGrid} - */ - initialize?: string; - - /** Allows the user to set the custom name for the service method responsible for the server-side action, on dropping a node from Field List. - * @Default {NodeDropped} - */ - nodeDropped?: string; - - /** Allows the user to set the custom name for the service method responsible for the server-side action on changing the checked state of a node in Field List. - * @Default {NodeStateModified} - */ - nodeStateModified?: string; - - /** Allows the user to set the custom name for the service method responsible for performing paging operation in PivotGrid. - * @Default {Paging} - */ - paging?: string; - - /** Allows the user to set the custom name for the service method responsible for sorting operation in PivotGrid. - * @Default {Sorting} - */ - sorting?: string; - - /** Allows the user to set the custom name for the service method responsible for expanding members inside member editor. - * @Default {MemberExpanded} - */ - memberExpand?: string; - - /** Allows the user to set the custom name for the service method responsible for editing the cells. - * @Default {CellEditing} - */ - cellEditing?: string; - - /** Allows the user to set the custom name for the service method responsible for saving the current report to database. - * @Default {SaveReport} - */ - saveReport?: string; - - /** Allows the user to set the custom name for the service method responsible for loading a report from database. - * @Default {LoadReportFromDB} - */ - loadReport?: string; - - /** Allows the user to set the custom name for the service method responsible for adding a calculated field to the report. - * @Default {CalculatedField} - */ - calculatedField?: string; - - /** Allows the user to set the custom name for the service method responsible for performing drill through operation. - * @Default {DrillThroughHierarchies} - */ - drillThroughHierarchies?: string; - - /** Allows the user to set the custom name for the service method responsible for performing drill through operation in data table. - * @Default {DrillThroughDataTable} - */ - drillThroughDataTable?: string; - - /** Allows the user to set the custom name for the service method responsible for write-back operation in OLAP Cube. This is only applicable in server-side component. - * @Default {WriteBack} - */ - writeBack?: string; -} - -enum Layout { - - ///To set normal summary layout in PivotGrid. - Normal, - - ///To set layout with summaries at the top in PivotGrid. - NormalTopSummary, - - ///To set layout without summaries in PivotGrid. - NoSummaries, - - ///To set excel-like layout in PivotGrid. - ExcelLikeLayout -} - -} -namespace Pivot { -enum AnalysisMode { -//To bind an OLAP data source to PivotGrid. -OLAP, -//To bind a relational data source to PivotGrid. -Pivot, -} -} -namespace PivotAnalysis { -enum SortOrder { -//Sorts the members of the field in ascending order. -Ascending, -//Sorts the members of the field in descending order. -Descending, -//Displays the members without sorting in any order. -None, -} -} -namespace PivotAnalysis { -enum FilterType { -//Excludes the specified values among the members of the field. -Exclude, -//Includes the specified values alone among the members of the field. -Include, -} -} -namespace PivotAnalysis { -enum SummaryType { -//Calculates the summary as the total of all values. -Sum, -//Displays the average of all values as the summaries. -Average, -//Displays the count of items in summaries. -Count, -//Displays the minimum value of all the items in the summary. -Min, -//Displays the maximum value of all the items in the summary. -Max, -} -} -namespace Pivot { -enum OperationalMode { -//To bind data source completely from client-side. -ClientMode, -//To bind data source completely from server-side. -ServerMode, -} -} - -class PivotSchemaDesigner extends ej.Widget { - static fn: PivotSchemaDesigner; - constructor(element: JQuery | Element, options?: PivotSchemaDesigner.Model); - static Locale: any; - model: PivotSchemaDesigner.Model; - defaults: PivotSchemaDesigner.Model; - - /** Performs an asynchronous HTTP (AJAX) request. - * @returns {void} - */ - doAjaxPost(): void; - - /** Re-renders the control with the data source bound to the pivot control at that instant. - * @returns {void} - */ - refreshControl(): void; -} -export namespace PivotSchemaDesigner { - -export interface Model { - - /** Specifies the CSS class to PivotSchemaDesigner to achieve custom theme. - * @Default {“”} - */ - cssClass?: string; - - /** Object utilized to pass additional information between client-end and service-end. - * @Default {{}} - */ - customObject?: any; - - /** For ASP.NET and MVC Wrapper, PivotSchemaDesigner will be initialized and rendered empty initially. Once the connected pivot control widget is rendered completely, - * PivotSchemaDesigner will just be populated with data source by setting this property to “true”. - * @Default {false} - */ - enableWrapper?: boolean; - - /** Allows the user to view PivotTable Field List from right to left. - * @Default {false} - */ - enableRTL?: boolean; - - /** Sets the visibility of OLAP elements in PivotTable Field List. This is only applicable for OLAP datasource. - * @Default {null} - */ - olap?: Olap; - - /** Allows the user to enable/disable drag and drop operations within the PivotTable Field List. - * @Default {true} - */ - enableDragDrop?: boolean; - - /** Sets the height for PivotSchemaDesigner. - * @Default {“”} - */ - height?: string; - - /** Allows the user to set the localized language for the widget. - * @Default {en-US} - */ - locale?: string; - - /** Sets the Pivot control bound with this PivotSchemaDesigner. - * @Default {null} - */ - pivotControl?: any; - - /** Allows the user to set custom name for the methods at service-end, communicated during AJAX post. - * @Default {{}} - */ - serviceMethod?: ServiceMethod; - - /** Connects the service using the specified URL for any server updates. - * @Default {“”} - */ - url?: string; - - /** Sets the width for PivotSchemaDesigner. - * @Default {“”} - */ - width?: string; - - /** Sets the layout for PivotSchemaDesigner. - * @Default {ej.PivotSchemaDesigner.Layouts.Excel} - */ - layout?: ej.PivotSchemaDesigner.Layouts|string; - - /** Triggers when it reaches client-side after any AJAX request. */ - afterServiceInvoke?(e: AfterServiceInvokeEventArgs): void; - - /** Triggers before any AJAX request is passed from PivotSchemaDesigner to service methods. */ - beforeServiceInvoke?(e: BeforeServiceInvokeEventArgs): void; - - /** Triggers when we start dragging any field from PivotSchemaDesigner. */ - dragMove?(e: DragMoveEventArgs): void; -} - -export interface AfterServiceInvokeEventArgs { - - /** returns the current action of PivotSchemaDesigner control. - */ - action?: string; - - /** returns the custom object bound with PivotSchemaDesigner control. - */ - customObject?: any; - - /** returns the HTML element of PivotSchemaDesigner control. - */ - element?: any; -} - -export interface BeforeServiceInvokeEventArgs { - - /** returns the current action of PivotSchemaDesigner control. - */ - action?: string; - - /** returns the custom object bound with PivotSchemaDesigner control. - */ - customObject?: any; - - /** returns the HTML element of PivotSchemaDesigner control. - */ - element?: any; -} - -export interface DragMoveEventArgs { - - /** returns the HTML element of the dragged field from PivotSchemaDesigner. - */ - dragTarget?: any; - - /** return the JSON details of the dragged field. - */ - draggedElementData?: any; - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the PivotSchemaDesigner model - */ - model?: any; -} - -export interface Olap { - - /** Allows the user to view the KPI elements in tree-view inside PivotTable Field List. This is only applicable for OLAP datasource. - * @Default {false} - */ - showKPI?: boolean; - - /** Allows the user to view the named sets in tree-view inside PivotTable Field List. This is only applicable for OLAP datasource. - * @Default {false} - */ - showNamedSets?: boolean; -} - -export interface ServiceMethod { - - /** Allows the user to set the custom name for the service method responsible for getting the values for the tree-view inside filter dialog. - * @Default {FetchMembers} - */ - fetchMembers?: string; - - /** Allows the user to set the custom name for the service method responsible for filtering operation in Field List. - * @Default {Filtering} - */ - filtering?: string; - - /** Allows the user to set the custom name for the service method responsible for the server-side action, on expanding members in Field List. - * @Default {MemberExpanded} - */ - memberExpand?: string; - - /** Allows the user to set the custom name for the service method responsible for the server-side action, on dropping a node into Field List. - * @Default {NodeDropped} - */ - nodeDropped?: string; - - /** Allows the user to set the custom name for the service method responsible for the server-side action on changing the checked state of a node in Field List. - * @Default {NodeStateModified} - */ - nodeStateModified?: string; - - /** Allows the user to set the custom name for the service method responsible for button removing operation in Field List. - * @Default {RemoveButton} - */ - removeButton?: string; -} - -enum Layouts { - - ///To set the layout as same in the Excel. - Excel, - - ///To set normal layout for Field List. - Normal, - - ///To set layout with the axes one above the other. - OneByOne -} - -} - -class PivotPager extends ej.Widget { - static fn: PivotPager; - constructor(element: JQuery | Element, options?: PivotPager.Model); - static Locale: any; - model: PivotPager.Model; - defaults: PivotPager.Model; - - /** This function initializes the page counts and page numbers for the PivotPager. - * @returns {void} - */ - initPagerProperties(): void; -} -export namespace PivotPager { - -export interface Model { - - /** Contains the current page number in categorical axis. - * @Default {1} - */ - categoricalCurrentPage?: number; - - /** Contains the total page count in categorical axis. - * @Default {1} - */ - categoricalPageCount?: number; - - /** Allows the user to set the localized language for the widget. - * @Default {en-US} - */ - locale?: string; - - /** Sets the pager mode (Only Categorical Pager/Only Series Pager/Both) for the PivotPager. - * @Default {ej.PivotPager.Mode.Both} - */ - mode?: ej.PivotPager.Mode|string; - - /** Contains the current page number in series axis. - * @Default {1} - */ - seriesCurrentPage?: number; - - /** Contains the total page count in series axis. - * @Default {1} - */ - seriesPageCount?: number; - - /** Contains the ID of the target element for which paging needs to be done. - * @Default {“”} - */ - targetControlID?: string; -} - -enum Mode { - - ///To set both categorical and series pager for paging. - Both, - - ///To set only categorical pager for paging. - Categorical, - - ///To set only series pager for paging. - Series -} - -} - -class PivotChart extends ej.Widget { - static fn: PivotChart; - constructor(element: JQuery | Element, options?: PivotChart.Model); - static Locale: any; - model: PivotChart.Model; - defaults: PivotChart.Model; - - /** Performs an asynchronous HTTP (AJAX) request. - * @returns {void} - */ - doAjaxPost(): void; - - /** Perform an asynchronous HTTP (FullPost) submit. - * @returns {void} - */ - doPostBack(): void; - - /** Exports the PivotChart to the format specified in the parameter. - * @returns {void} - */ - exportPivotChart(): void; - - /** This function renders the PivotChart control with the JSON formatted datasource. - * @returns {void} - */ - renderChartFromJSON(): void; - - /** This function receives the update from service-end, which would be utilized for rendering the widget. - * @returns {void} - */ - renderControlSuccess(): void; - - /** Returns the OlapReport string maintained along with the axis elements information. - * @returns {string} - */ - getOlapReport(): string; - - /** Sets the OlapReport string along with the axis information and maintains it in a property. - * @returns {void} - */ - setOlapReport(): void; - - /** Returns the JSON records formed to render the control. - * @returns {Array} - */ - getJSONRecords(): any[]; - - /** Sets the JSON records to render the control. - * @returns {void} - */ - setJSONRecords(): void; - - /** Returns the PivotEngine formed to render the control. - * @returns {Array} - */ - getPivotEngine(): any[]; - - /** Sets the PivotEngine required to render the control. - * @returns {void} - */ - setPivotEngine(): void; - - /** Re-renders the control with the data source at the instant. - * @returns {void} - */ - refreshControl(): void; - - /** Renders the control with the pivot engine obtained from olap cube. - * @returns {void} - */ - generateJSON(): void; - - /** Navigates to the specified page number in specified axis. - * @returns {void} - */ - refreshPagedPivotChart(): void; -} -export namespace PivotChart { - -export interface Model { - - /** Sets the mode for the PivotChart widget for binding either OLAP or Relational data source. - * @Default {ej.Pivot.AnalysisMode.Pivot} - */ - analysisMode?: ej.Pivot.AnalysisMode|string; - - /** Specifies the CSS class to PivotChart to achieve custom theme. - * @Default {“”} - */ - cssClass?: string; - - /** Options for enabling zooming feature of PivotChart. - * @Default {{}} - */ - zooming?: Zooming; - - /** Options available to configure the properties of entire series. You can also override the options for specific series by using series collection. - * @Default {{}} - */ - commonSeriesOptions?: CommonSeriesOptions; - - /** Initializes the data source for the PivotChart widget, when it functions completely on client-side. - * @Default {{}} - */ - dataSource?: DataSource; - - /** Object utilized to pass additional information between client-end and service-end on operating the control in server mode. - * @Default {{}} - */ - customObject?: any; - - /** Allows the user to enable 3D view of PivotChart. - * @Default {false} - */ - enable3D?: boolean; - - /** Allows the user to view PivotChart from right to left. - * @Default {false} - */ - enableRTL?: boolean; - - /** Allows the user to enable PivotChart’s responsiveness in the browser layout. - * @Default {false} - */ - isResponsive?: boolean; - - /** Lets the user to customize the legend items and their labels. - * @Default {{}} - */ - legend?: any; - - /** Allows the user to set the localized language for the widget. - * @Default {en-US} - */ - locale?: string; - - /** Sets the mode for the PivotChart widget for binding data source either in server-side or client-side. - * @Default {ej.Pivot.OperationalMode.ClientMode} - */ - operationalMode?: ej.Pivot.OperationalMode|string; - - /** This is a horizontal axis that contains options to configure axis and it is the primary x axis for all the series in series array. - * To override x axis for particular series, create an axis object by providing unique name by using name property and add it to axes array. - * Then, assign the name to the series’s xAxisName property to link both axis and series. - * @Default {{}} - */ - primaryXAxis?: any; - - /** This is a vertical axis that contains options to configure axis. This is the primary y axis for all the series in series array. - * To override y axis for particular series, create an axis object by providing unique name by using name property and add it to axes array. - * Then, assign the name to the series’s yAxisName property to link both axis and series. - * @Default {{}} - */ - primaryYAxis?: any; - - /** Allows the user to rotate the angle of PivotChart in 3D view. - * @Default {0} - */ - rotation?: number; - - /** Allows the user to set custom name for the methods at service-end, communicated on AJAX post. - * @Default {{}} - */ - serviceMethodSettings?: ServiceMethodSettings; - - /** Options to customize the size of the PivotChart control. - * @Default {{}} - */ - size?: any; - - /** Connects the service using the specified URL for any server updates on operating the control in server mode. - * @Default {“”} - */ - url?: string; - - /** Triggers when PivotChart starts to render. */ - load?(e: LoadEventArgs): void; - - /** Triggers when it reaches client-side after any AJAX request. */ - afterServiceInvoke?(e: AfterServiceInvokeEventArgs): void; - - /** Triggers before any AJAX request is passed from PivotChart to service methods. */ - beforeServiceInvoke?(e: BeforeServiceInvokeEventArgs): void; - - /** Triggers on performing drill up/down in PivotChart control. */ - drillSuccess?(e: DrillSuccessEventArgs): void; - - /** Triggers when PivotChart widget completes all operations at client-side after any AJAX request. */ - renderComplete?(e: RenderCompleteEventArgs): void; - - /** Triggers when any error occurred during AJAX request. */ - renderFailure?(e: RenderFailureEventArgs): void; - - /** Triggers when PivotChart successfully reaches client-side after any AJAX request. */ - renderSuccess?(e: RenderSuccessEventArgs): void; - - /** Triggers before performing exporting in pivot chart. */ - beforeExport?(e: BeforeExportEventArgs): void; -} - -export interface LoadEventArgs { - - /** returns the current action of PivotChart control. - */ - action?: string; - - /** returns the custom object bound with PivotChart control. - */ - customObject?: any; - - /** returns the HTML element of PivotChart control. - */ - element?: any; -} - -export interface AfterServiceInvokeEventArgs { - - /** returns the current action of PivotChart control. - */ - action?: string; - - /** returns the custom object bound with PivotChart control. - */ - customObject?: any; - - /** returns the HTML element of PivotChart control. - */ - element?: any; -} - -export interface BeforeServiceInvokeEventArgs { - - /** returns the current action of PivotChart control. - */ - action?: string; - - /** returns the custom object bound with PivotChart control. - */ - customObject?: any; - - /** returns the HTML element of PivotChart control. - */ - element?: any; -} - -export interface DrillSuccessEventArgs { - - /** returns the current instance of PivotChart. - */ - chartObj?: any; - - /** returns the drill action of PivotChart. - */ - drillAction?: string; - - /** contains the name of the member drilled. - */ - drilledMember?: string; - - /** returns the event object. - */ - event?: any; -} - -export interface RenderCompleteEventArgs { - - /** returns the current action of PivotChart control. - */ - action?: string; - - /** returns the custom object bound with PivotChart control. - */ - customObject?: any; - - /** returns the HTML element of PivotChart control. - */ - element?: any; -} - -export interface RenderFailureEventArgs { - - /** returns the current action of PivotChart control. - */ - action?: string; - - /** returns the custom object bound with PivotChart control. - */ - customObject?: any; - - /** returns the HTML element of PivotChart control. - */ - element?: any; - - /** returns the error stack trace of the original exception. - */ - message?: string; -} - -export interface RenderSuccessEventArgs { - - /** returns the current instance of PivotChart. - */ - args?: any; -} - -export interface BeforeExportEventArgs { - - /** contains the url of the service responsible for exporting. - */ - url?: string; - - /** contains the name of the exporting file. - */ - fileName?: string; -} - -export interface Zooming { - - /** Enables or disables horizontal scrollbar. - * @Default {false} - */ - enableScrollbar?: boolean; -} - -export interface CommonSeriesOptions { - - /** Allows the user to set the specific chart type for PivotChart widget. - * @Default {ej.PivotChart.ChartTypes.Column} - */ - type?: ej.PivotChart.ChartTypes|string; -} - -export interface DataSourceColumnsFilterItems { - - /** Sets the type of filter whether to include/exclude the mentioned values. - * @Default {ej.PivotAnalysis.FilterType.Exclude} - */ - filterType?: ej.PivotAnalysis.FilterType|string; - - /** Contains the collection of items to be included/excluded among the field members. - * @Default {[]} - */ - values?: any[]; -} - -export interface DataSourceColumn { - - /** Allows the user to bind the item by using its unique name as field name. - */ - fieldName?: string; - - /** Allows the user to set the display caption for an item. - */ - fieldCaption?: string; - - /** Allows the user to indicate whether the added item is a named set or not. - * @Default {false} - */ - isNamedSets?: boolean; - - /** Allows the user to set the sorting order of the members of the field. - * @Default {ej.PivotAnalysis.SortOrder.Ascending} - */ - sortOrder?: ej.PivotAnalysis.SortOrder|string; - - /** Applies filter to the field members. - * @Default {null} - */ - filterItems?: DataSourceColumnsFilterItems; -} - -export interface DataSourceRowsFilterItems { - - /** Sets the type of filter whether to include/exclude the mentioned values. - * @Default {ej.PivotAnalysis.FilterType.Exclude} - */ - filterType?: ej.PivotAnalysis.FilterType|string; - - /** Contains the collection of items to be included/excluded among the field members. - * @Default {[]} - */ - values?: any[]; -} - -export interface DataSourceRow { - - /** Allows the user to bind the item by using its unique name as field name. - */ - fieldName?: string; - - /** Allows the user to set the display caption for an item. - */ - fieldCaption?: string; - - /** Allows the user to indicate whether the added item is a named set or not. - * @Default {false} - */ - isNamedSets?: boolean; - - /** Allows the user to set the sorting order of the members of the field. - * @Default {ej.PivotAnalysis.SortOrder.Ascending} - */ - sortOrder?: ej.PivotAnalysis.SortOrder|string; - - /** Applies filter to the field members. - * @Default {null} - */ - filterItems?: DataSourceRowsFilterItems; -} - -export interface DataSourceValuesMeasure { - - /** Allows the user to bind the measure from OLAP datasource by using its unique name as field name. - */ - fieldName?: string; -} - -export interface DataSourceValue { - - /** Allows the user to bind the item by using its unique name as field name for Relational datasource. - */ - fieldName?: string; - - /** Allows the user to set the display caption for an item for Relational datasource. - */ - fieldCaption?: string; - - /** This holds the list of unique names of measures to bind them from the OLAP cube. - * @Default {[]} - */ - measures?: DataSourceValuesMeasure[]; - - /** Allows to set the axis name to place the measures items. - * @Default {rows} - */ - axis?: string; - - /** Indicates whether the field is a calculated field or not with Relational datasource. - * @Default {false} - */ - isCalculatedField?: boolean; - - /** Allows to set the formula for calculation of values for calculated members in Relational datasource. - */ - formula?: string; -} - -export interface DataSourceFiltersFilterItems { - - /** Sets the type of filter whether to include/exclude the mentioned values. - * @Default {ej.PivotAnalysis.FilterType.Exclude} - */ - filterType?: ej.PivotAnalysis.FilterType|string; - - /** Contains the collection of items to be included/excluded among the field members. - * @Default {[]} - */ - values?: any[]; -} - -export interface DataSourceFilter { - - /** Allows the user to bind the item by using its unique name as field name. - */ - fieldName?: string; - - /** Applies filter to the field members. - * @Default {null} - */ - filterItems?: DataSourceFiltersFilterItems; -} - -export interface DataSource { - - /** Contains the respective cube name from OLAP database as string type. - * @Default {“”} - */ - cube?: string; - - /** Provides the raw data source for the PivotChart. - * @Default {null} - */ - data?: any; - - /** In connection with an OLAP database, this property contains the database name as string to fetch the data from the given connection string. - * @Default {“”} - */ - catalog?: string; - - /** Lists out the items to be displayed as series of PivotChart. - * @Default {[]} - */ - columns?: DataSourceColumn[]; - - /** Lists out the items to be displayed as segments of PivotChart. - * @Default {[]} - */ - rows?: DataSourceRow[]; - - /** Lists out the items supports calculation in PivotChart. - * @Default {[]} - */ - values?: DataSourceValue[]; - - /** Lists out the items which supports filtering of values without displaying the members in UI in PivotChart. - * @Default {[]} - */ - filters?: DataSourceFilter[]; -} - -export interface ServiceMethodSettings { - - /** Allows the user to set the custom name for the service method responsible for drilling up/down operation in PivotChart. - * @Default {DrillChart} - */ - drillDown?: string; - - /** Allows the user to set the custom name for the service method responsible for exporting. - * @Default {Export} - */ - exportPivotChart?: string; - - /** Allows the user to set the custom name for the service method responsible for initializing PivotChart. - * @Default {InitializeChart} - */ - initialize?: string; - - /** Allows the user to set the custom name for the service method responsible for navigating between pages in paged PivotChart. - * @Default {Paging} - */ - paging?: string; -} - -enum ChartTypes { - - ///To render a Line type PivotChart. - Line, - - ///To render a Spline type PivotChart. - Spline, - - ///To render a Column type PivotChart. - Column, - - ///To render an Area type PivotChart. - Area, - - ///To render a SplineArea type PivotChart. - SplineArea, - - ///To render a StepLine type PivotChart. - StepLine, - - ///To render a StepArea type PivotChart. - StepArea, - - ///To render a Pie type PivotChart. - Pie, - - ///To render a Bar type PivotChart. - Bar, - - ///To render a StackingArea type PivotChart. - StackingArea, - - ///To render a StackingColumn type PivotChart. - StackingColumn, - - ///To render a StackingBar type PivotChart. - StackingBar, - - ///To render a Pyramid type PivotChart. - Pyramid, - - ///To render a Funnel type PivotChart. - Funnel, - - ///To render a Doughnut type PivotChart. - Doughnut, - - ///To render a Scatter type PivotChart. - Scatter, - - ///To render a Bubble type PivotChart. - Bubble -} - -} - -class PivotClient extends ej.Widget { - static fn: PivotClient; - constructor(element: JQuery | Element, options?: PivotClient.Model); - static Locale: any; - model: PivotClient.Model; - defaults: PivotClient.Model; - - /** Performs an asynchronous HTTP (AJAX) request. - * @returns {void} - */ - doAjaxPost(): void; - - /** Performs an asynchronous HTTP (FullPost) submit. - * @returns {void} - */ - doPostBack(): void; - - /** Navigates to the specified page in specified axis. - * @returns {void} - */ - refreshPagedPivotClient(): void; - - /** Updates the PivotClient component with the JSON data fetched from the service on navigating between pages. - * @returns {void} - */ - refreshPagedPivotClientSuccess(): void; - - /** Renders the PivotChart and PivotGrid with the JSON data provided. - * @returns {void} - */ - generateJSON(): void; - - /** Re-renders the control with the report at that instant. - * @returns {void} - */ - refreshControl(): void; - - /** Returns the OlapReport string maintained along with the axis elements information. - * @returns {string} - */ - getOlapReport(): string; - - /** Sets the OlapReport string along with the axis information and maintains it in a property. - * @returns {void} - */ - setOlapReport(): void; - - /** Returns the JSON records formed to render the control. - * @returns {Array} - */ - getJSONRecords(): any[]; - - /** Sets the JSON records formed to render the control to a property. - * @returns {void} - */ - setJSONRecords(): void; -} -export namespace PivotClient { - -export interface Model { - - /** Sets the mode for the PivotClient widget for binding either OLAP or Relational data source. - * @Default {ej.Pivot.AnalysisMode.Pivot} - */ - analysisMode?: ej.Pivot.AnalysisMode|string; - - /** Allows the user to set the specific chart type for PivotChart inside PivotClient widget. - * @Default {ej.PivotChart.ChartTypes.Column} - */ - chartType?: ej.PivotChart.ChartTypes|string; - - /** Allows the user to set the content on exporting the PivotClient widget. - * @Default {ej.PivotClient.ClientExportMode.ChartAndGrid} - */ - clientExportMode?: ej.PivotClient.ClientExportMode|string; - - /** Specifies the CSS class to PivotClient to achieve custom theme. - * @Default {“”} - */ - cssClass?: string; - - /** Object utilized to pass additional information between client-end and service-end when the control functions in server-mode. - * @Default {{}} - */ - customObject?: any; - - /** Initializes the data source for the PivotClient widget, when it functions completely on client-side. - * @Default {{}} - */ - dataSource?: DataSource; - - /** Allows the user to customize the widget's layout and appearance. - * @Default {{}} - */ - displaySettings?: DisplaySettings; - - /** Enables the splitter option for resizing the elements inside the control. - * @Default {false} - */ - enableSplitter?: boolean; - - /** Enables the advanced filtering options Value Filtering, Label Filtering and Sorting for each dimensions on binding OLAP data in server mode. - * @Default {false} - */ - enableAdvancedFilter?: boolean; - - /** Allows the user to refresh the control on-demand and not during every UI operation. - * @Default {false} - */ - enableDeferUpdate?: boolean; - - /** Lets the user to save and load reports in a customized way with the help of events. - * @Default {false} - */ - enableLocalStorage?: boolean; - - /** Allows the user to enable paging for both the PivotChart and PivotGrid components for the ease of viewing large data. - * @Default {false} - */ - enablePaging?: boolean; - - /** Allows the user to include the PivotTreeMap component as one of the chart types. - * @Default {false} - */ - enablePivotTreeMap?: boolean; - - /** Allows the user to view the layout of PivotClient from right to left. - * @Default {false} - */ - enableRTL?: boolean; - - /** Enables/disables the visibility of measure group selector drop-down in Cube Browser. - * @Default {false} - */ - enableMeasureGroups?: boolean; - - /** Allows the user to enable virtual scrolling for both the PivotChart and PivotGrid components for the ease of viewing large data. - * @Default {false} - */ - enableVirtualScrolling?: boolean; - - /** Enables/Disables paging in Member Editor for viewing the large count of members in pages. - * @Default {false} - */ - enableMemberEditorPaging?: boolean; - - /** Allows the user to set the number of members to be displayed in each page of Member Editor on applying paging in it. - * @Default {100} - */ - memberEditorPageSize?: number; - - /** Sets the summary layout for PivotGrid. Following are the ways in which summary can be positioned: normal summary (bottom), top summary, no summary and excel-like summary. - * @Default {ej.PivotGrid.Layout.Normal} - */ - gridLayout?: ej.PivotGrid.Layout|string; - - /** Allows the user to set the localized language for the widget. - * @Default {en-US} - */ - locale?: string; - - /** Sets the mode for the PivotClient widget for binding data source either in server-side or client-side. - * @Default {ej.Pivot.OperationalMode.ClientMode} - */ - operationalMode?: ej.Pivot.OperationalMode|string; - - /** Allows the user to set custom name for the methods at service-end, communicated during AJAX post. - * @Default {{}} - */ - serviceMethodSettings?: ServiceMethodSettings; - - /** Sets the title for PivotClient widget. - */ - title?: string; - - /** Connects the service using the specified URL for any server updates. - */ - url?: string; - - /** Triggers when it reaches client-side after any AJAX request. */ - afterServiceInvoke?(e: AfterServiceInvokeEventArgs): void; - - /** Triggers before any AJAX request is passed from client-side to service methods. */ - beforeServiceInvoke?(e: BeforeServiceInvokeEventArgs): void; - - /** Triggers before saving the current collection of reports. */ - saveReport?(e: SaveReportEventArgs): void; - - /** Triggers before loading a saved collection of reports. */ - loadReport?(e: LoadReportEventArgs): void; - - /** Triggers before fetching the report collection from storage. */ - fetchReport?(e: FetchReportEventArgs): void; - - /** Triggers before exporting the control. */ - beforeExport?(e: BeforeExportEventArgs): void; - - /** Triggers before rendering the PivotChart. */ - chartLoad?(e: ChartLoadEventArgs): void; - - /** Triggers before rendering the PivotTreeMap. */ - treeMapLoad?(e: TreeMapLoadEventArgs): void; - - /** Triggers while we initiate loading of the widget. */ - load?(e: LoadEventArgs): void; - - /** Triggers when PivotClient widget completes all operations at client-end after any AJAX request. */ - renderComplete?(e: RenderCompleteEventArgs): void; - - /** Triggers when any error occurred during AJAX request. */ - renderFailure?(e: RenderFailureEventArgs): void; - - /** Triggers when PivotClient successfully completes rendering. */ - renderSuccess?(e: RenderSuccessEventArgs): void; -} - -export interface AfterServiceInvokeEventArgs { - - /** returns the current action of PivotClient control. - */ - action?: string; - - /** returns the custom object bounds with PivotClient control. - */ - customObject?: any; - - /** returns the HTML element of PivotClient control. - */ - element?: any; -} - -export interface BeforeServiceInvokeEventArgs { - - /** returns the current action of PivotClient control. - */ - action?: string; - - /** returns the custom object bounds with PivotClient control. - */ - customObject?: any; - - /** returns the HTML element of PivotClient control. - */ - element?: any; -} - -export interface SaveReportEventArgs { - - /** returns the current instance of PivotClient control. - */ - targetControl?: any; - - /** returns the object which holds the necessary parameters required for saving the report collection. - */ - saveReportSetting?: any; -} - -export interface LoadReportEventArgs { - - /** returns the current instance of PivotClient control. - */ - targetControl?: any; - - /** returns the object which holds the necessary parameters required for loading a report collection from database. - */ - loadReportSetting?: any; -} - -export interface FetchReportEventArgs { - - /** returns the current instance of PivotClient control. - */ - targetControl?: any; - - /** returns the object which holds the necessary parameters required for fetching the report names stored in database. - */ - fetchReportSetting?: any; -} - -export interface BeforeExportEventArgs { - - /** holds the url of the service method responsible for exporting the PivotClient control. - */ - url?: string; - - /** holds the name of the file to be exported. - */ - fileName?: string; -} - -export interface ChartLoadEventArgs { - - /** returns the current action of PivotChart control. - */ - action?: string; - - /** returns the custom object bound with PivotChart control. - */ - customObject?: any; - - /** returns the HTML element of PivotChart control. - */ - element?: any; -} - -export interface TreeMapLoadEventArgs { - - /** returns the current action of PivotTreeMap control. - */ - action?: string; - - /** returns the custom object bound with PivotTreeMap control. - */ - customObject?: any; - - /** returns the HTML element of PivotTreeMap control. - */ - element?: any; -} - -export interface LoadEventArgs { - - /** returns the HTML element of PivotClient component. - */ - element?: any; - - /** returns the custom object bound with PivotTreeMap control. - */ - customObject?: any; -} - -export interface RenderCompleteEventArgs { - - /** returns the HTML element of PivotClient component. - */ - element?: any; - - /** returns the custom object bound with PivotTreeMap control. - */ - customObject?: any; -} - -export interface RenderFailureEventArgs { - - /** returns the custom object bound with the control. - */ - customObject?: any; - - /** returns the HTML element of PivotClient control. - */ - element?: any; - - /** returns the error message with error code. - */ - message?: string; -} - -export interface RenderSuccessEventArgs { - - /** returns the object of PivotClient control at that instant. - */ - args?: any; -} - -export interface DataSourceColumnsAdvancedFilter { - - /** Allows the user to provide level unique name to perform advanced filtering. - */ - name?: string; - - /** Allows the user to set the operator to perform Label Filtering. - * @Default {none} - */ - labelFilterOperator?: string; - - /** Allows the user to set the operator to perform Value Filtering. - * @Default {none} - */ - valueFilterOperator?: string; - - /** Allows the user to set the filtering type while performing advanced filtering. - */ - advancedFilterType?: string; - - /** In case of value filtering, this property contains the measure name to which the filter is applied. - */ - measure?: string; - - /** Allows the user to hold the filter operand values in advanced filtering. - */ - values?: any[]; -} - -export interface DataSourceColumnsFilterItems { - - /** Sets the type of filter whether to include/exclude the mentioned values. - * @Default {ej.PivotAnalysis.FilterType.Exclude} - */ - filterType?: ej.PivotAnalysis.FilterType|string; - - /** Contains the collection of items to be included/excluded among the field members. - * @Default {[]} - */ - values?: any[]; -} - -export interface DataSourceColumn { - - /** Allows the user to bind the item by using its unique name as field name. - */ - fieldName?: string; - - /** Allows the user to set the display caption for an item. - */ - fieldCaption?: string; - - /** Allows the user to filter the report by default using advanced filtering (excel-like) option for OLAP data source in client-mode. - * @Default {[]} - */ - advancedFilter?: DataSourceColumnsAdvancedFilter[]; - - /** Allows the user to indicate whether the added item is a named set or not. - * @Default {false} - */ - isNamedSets?: boolean; - - /** Shows/Hides the sub-total of the field in PivotGrid. - * @Default {true} - */ - showSubTotal?: boolean; - - /** Allows the user to set the sorting order of the members of the field. - * @Default {ej.PivotAnalysis.SortOrder.Ascending} - */ - sortOrder?: ej.PivotAnalysis.SortOrder|string; - - /** Contains the list of members need to be drilled down by default in the field. - * @Default {[]} - */ - drilledItems?: any[]; - - /** Applies filter to the field members. - * @Default {null} - */ - filterItems?: DataSourceColumnsFilterItems; -} - -export interface DataSourceRowsAdvancedFilter { - - /** Allows the user to provide level unique name to perform advanced filtering. - */ - name?: string; - - /** Allows the user to set the operator to perform Label Filtering. - * @Default {none} - */ - labelFilterOperator?: string; - - /** Allows the user to set the operator to perform Value Filtering. - * @Default {none} - */ - valueFilterOperator?: string; - - /** Allows the user to set the filtering type while performing advanced filtering. - */ - advancedFilterType?: string; - - /** In case of value filtering, this property contains the measure name to which the filter is applied. - */ - measure?: string; - - /** Allows the user to hold the filter operand values in advanced filtering. - */ - values?: any[]; -} - -export interface DataSourceRowsFilterItems { - - /** Sets the type of filter whether to include/exclude the mentioned values. - * @Default {ej.PivotAnalysis.FilterType.Exclude} - */ - filterType?: ej.PivotAnalysis.FilterType|string; - - /** Contains the collection of items to be included/excluded among the field members. - * @Default {[]} - */ - values?: any[]; -} - -export interface DataSourceRow { - - /** Allows the user to bind the item by using its unique name as field name. - */ - fieldName?: string; - - /** Allows the user to set the display caption for an item. - */ - fieldCaption?: string; - - /** Allows the user to filter the report by default using advanced filtering (excel-like) option for OLAP data source in client-mode. - * @Default {[]} - */ - advancedFilter?: DataSourceRowsAdvancedFilter[]; - - /** Allows the user to indicate whether the added item is a named set or not. - * @Default {false} - */ - isNamedSets?: boolean; - - /** Shows/Hides the sub-total of the field. - * @Default {true} - */ - showSubTotal?: boolean; - - /** Allows the user to set the sorting order of the members of the field. - * @Default {ej.PivotAnalysis.SortOrder.Ascending} - */ - sortOrder?: ej.PivotAnalysis.SortOrder|string; - - /** Contains the list of members need to be drilled down by default in the field. - * @Default {[]} - */ - drilledItems?: any[]; - - /** Applies filter to the field members. - * @Default {null} - */ - filterItems?: DataSourceRowsFilterItems; -} - -export interface DataSourceValuesMeasure { - - /** Allows the user to bind the measure from OLAP datasource by using its unique name as field name. - */ - fieldName?: string; -} - -export interface DataSourceValue { - - /** Allows the user to bind the item by using its unique name as field name for Relational datasource. - */ - fieldName?: string; - - /** Allows the user to set the display caption for an item for Relational datasource. - */ - fieldCaption?: string; - - /** This holds the list of unique names of measures to bind them from the OLAP cube. - * @Default {[]} - */ - measures?: DataSourceValuesMeasure[]; - - /** Allows to set the axis name to place the measures items. - * @Default {rows} - */ - axis?: string; - - /** Indicates whether the field is a calculated field or not with Relational datasource. - * @Default {false} - */ - isCalculatedField?: boolean; - - /** Allows to set the type of PivotGrid summary calculation for the value field with Relational datasource. - * @Default {ej.PivotAnalysis.SummaryType.Sum} - */ - summaryType?: ej.PivotAnalysis.SummaryType|string; - - /** Allows to set the format of the values. - */ - format?: string; - - /** This property sets type of display of date. - */ - formatString?: string; - - /** Allows to set the formula for calculation of values for calculated members in Relational datasource. - */ - formula?: string; -} - -export interface DataSourceFiltersFilterItems { - - /** Sets the type of filter whether to include/exclude the mentioned values. - * @Default {ej.PivotAnalysis.FilterType.Exclude} - */ - filterType?: ej.PivotAnalysis.FilterType|string; - - /** Contains the collection of items to be included/excluded among the field members. - * @Default {[]} - */ - values?: any[]; -} - -export interface DataSourceFilter { - - /** Allows the user to bind the item by using its unique name as field name. - */ - fieldName?: string; - - /** Allows the user to set the display name for an item. - */ - fieldCaption?: string; - - /** Applies filter to the field members. - * @Default {null} - */ - filterItems?: DataSourceFiltersFilterItems; -} - -export interface DataSourcePagerOptions { - - /** Allows to set the number of categorical columns to be displayed in each page on applying paging. - * @Default {0} - */ - categoricalPageSize?: number; - - /** Allows to set the number of series rows to be displayed in each page on applying paging. - * @Default {0} - */ - seriesPageSize?: number; - - /** Allows to set the page number in categorical axis to be loaded by default. - * @Default {1} - */ - categoricalCurrentPage?: number; - - /** Allows to set the page number in series axis to be loaded by default. - * @Default {1} - */ - seriesCurrentPage?: number; -} - -export interface DataSource { - - /** Lists out the items to be arranged in columns section of PivotClient. - * @Default {[]} - */ - columns?: DataSourceColumn[]; - - /** Lists out the items to be arranged in rows section of PivotClient. - * @Default {[]} - */ - rows?: DataSourceRow[]; - - /** Lists out the items which supports calculation in PivotClient. - * @Default {[]} - */ - values?: DataSourceValue[]; - - /** Lists out the items which supports filtering of values without displaying the members in UI in PivotClient. - * @Default {[]} - */ - filters?: DataSourceFilter[]; - - /** Contains the respective cube name from OLAP database as string type. - * @Default {“”} - */ - cube?: string; - - /** Provides the raw data source for the PivotClient. - * @Default {null} - */ - data?: any; - - /** In connection with an OLAP database, this property contains the database name as string to fetch the data from the given connection string. - * @Default {“”} - */ - catalog?: string; - - /** Allows user to filter the members (by its name and values) through advanced filtering (excel-like) option for OLAP data source in client-mode. - * @Default {false} - */ - enableAdvancedFilter?: boolean; - - /** Sets a name to the report bound to the control. - */ - reportName?: string; - - /** Allows to set the page size and current page number for each axis on applying paging. - * @Default {{}} - */ - pagerOptions?: DataSourcePagerOptions; -} - -export interface DisplaySettings { - - /** Lets the user to customize the display of PivotChart and PivotGrid widgets, either in tabs or tiles. - * @Default {ej.PivotClient.ControlPlacement.Tab} - */ - controlPlacement?: ej.PivotClient.ControlPlacement|string; - - /** Lets the user to set either Chart or Grid as the start-up widget. - * @Default {ej.PivotClient.DefaultView.Grid} - */ - defaultView?: ej.PivotClient.DefaultView|string; - - /** Lets the user to have an option for switching to full screen view of PivotChart and PivotGrid from default view in PivotClient. - * @Default {false} - */ - enableFullScreen?: boolean; - - /** Enables an option to enhance the space for PivotGrid and PivotChart by hiding Cube Browser and Axis Element Builder. - * @Default {false} - */ - enableTogglePanel?: boolean; - - /** Allows the user to enable PivotClient’s responsiveness in the browser layout. - * @Default {false} - */ - isResponsive?: boolean; - - /** Sets the display mode (Only Chart/Only Grid/Both) in PivotClient. - * @Default {ej.PivotClient.DisplayMode.ChartAndGrid} - */ - mode?: ej.PivotClient.DisplayMode|string; -} - -export interface ServiceMethodSettings { - - /** Allows the user to set the custom name for the service method responsible for updating the entire report and widget, while changing the Cube. - * @Default {CubeChanged} - */ - cubeChanged?: string; - - /** Allows the user to set the custom name for the service method responsible for exporting. - * @Default {Export} - */ - exportPivotClient?: string; - - /** Allows the user to set the custom name for the service method responsible to get the members for the tree-view, inside member-editor dialog. - * @Default {FetchMemberTreeNodes} - */ - fetchMemberTreeNodes?: string; - - /** Allows the user to set the custom name for the service method responsible for fetching the report names from the database. - * @Default {FetchReportListFromDB} - */ - fetchReportList?: string; - - /** Allows the user to set the custom name for the service method responsible for updating report while filtering members. - * @Default {FilterElement} - */ - filterElement?: string; - - /** Allows the user to set the custom name for the service method responsible for initializing PivotClient. - * @Default {InitializeClient} - */ - initialize?: string; - - /** Allows the user to set the custom name for the service method responsible for loading a report collection from the database. - * @Default {LoadReportFromDB} - */ - loadReport?: string; - - /** Allows the user to set the custom name for the service method responsible for retrieving the MDX query for the current report. - * @Default {GetMDXQuery} - */ - mdxQuery?: string; - - /** Allows the user to set the custom name for the service method responsible for updating the tree-view inside Cube Browser, while changing the measure group. - * @Default {MeasureGroupChanged} - */ - measureGroupChanged?: string; - - /** Allows the user to set the custom name for the service method responsible to get the child members, on tree-view node expansion. - * @Default {MemberExpanded} - */ - memberExpand?: string; - - /** Allows the user to set the custom name for the service method responsible for updating report while dropping a node/SplitButton inside Axis Element Builder. - * @Default {NodeDropped} - */ - nodeDropped?: string; - - /** Allows the user to set the custom name for the service method responsible for updating report while removing SplitButton from Axis Element Builder. - * @Default {RemoveSplitButton} - */ - removeSplitButton?: string; - - /** Allows the user to set the custom name for the service method responsible for saving the report collection to database. - * @Default {SaveReportToDB} - */ - saveReport?: string; - - /** Allows the user to set the custom name for the service method responsible for toggling the elements in row and column axes. - * @Default {ToggleAxis} - */ - toggleAxis?: string; - - /** Allows the user to set the custom name for the service method responsible for all the toolbar operations. - * @Default {ToolbarOperations} - */ - toolbarServices?: string; - - /** Allows the user to set the custom name for the service method responsible for updating report collection. - * @Default {UpdateReport} - */ - updateReport?: string; - - /** Allows the user to set the custom name for the service method responsible on navigating between pages in paged PivotClient. - * @Default {Paging} - */ - paging?: string; -} - -enum ClientExportMode { - - ///Exports both the PivotChart and PivotGrid on exporting. - ChartAndGrid, - - ///Exports the PivotChart control alone on exporting. - ChartOnly, - - ///Exports the PivotGrid control alone on exporting. - GridOnly -} - - -enum ControlPlacement { - - ///Displays PivotChart and PivotGrid widgets in separate tabs. - Tab, - - ///Displays PivotChart and PivotGrid widgets one above the other. - Tile -} - - -enum DefaultView { - - ///To set PivotChart as a default control in view. - Chart, - - ///To set PivotGrid as a default control in view. - Grid -} - - -enum DisplayMode { - - ///To display only PivotChart widget. - ChartOnly, - - ///To display only PivotGrid widget. - GridOnly, - - ///To display both PivotChart and PivotGrid widgets. - ChartAndGrid -} - -} - -class PivotGauge extends ej.Widget { - static fn: PivotGauge; - constructor(element: JQuery | Element, options?: PivotGauge.Model); - static Locale: any; - model: PivotGauge.Model; - defaults: PivotGauge.Model; - - /** Performs an asynchronous HTTP (AJAX) request. - * @returns {void} - */ - doAjaxPost(): void; - - /** This function is used to refresh the PivotGauge at client-side itself. - * @returns {void} - */ - refresh(): void; - - /** This function removes the KPI related images from PivotGauge on binding OLAP datasource. - * @returns {void} - */ - removeImg(): void; - - /** This function receives the JSON formatted datasource and renders the PivotGauge control. - * @returns {void} - */ - renderControlFromJSON(): void; - - /** Returns the OlapReport string maintained along with the axis elements information. - * @returns {string} - */ - getOlapReport(): string; - - /** Sets the OlapReport string along with the axis information and maintains it in a property. - * @returns {void} - */ - setOlapReport(): void; - - /** Returns the JSON records formed to render the control. - * @returns {Array} - */ - getJSONRecords(): any[]; - - /** Sets the JSON records to render the control. - * @returns {void} - */ - setJSONRecords(): void; - - /** Returns the JSON records required to render the PivotGauge on performing any action with OLAP data source. - * @returns {void} - */ - getJSONData(): void; -} -export namespace PivotGauge { - -export interface Model { - - /** Sets the number of columns to arrange the Pivot Gauges. - * @Default {0} - */ - columnsCount?: number; - - /** Specifies the CSS class to PivotGauge to achieve custom theme. - * @Default {“”} - */ - cssClass?: string; - - /** Object utilized to pass additional information between client-end and service-end on operating in server mode. - * @Default {{}} - */ - customObject?: any; - - /** Initializes the data source for the PivotGauge widget, when it functions completely on client-side. - * @Default {{}} - */ - dataSource?: DataSource; - - /** Enables/disables the animation of pointer in PivotGauge. - * @Default {false} - */ - enableAnimation?: boolean; - - /** Enables/disables tooltip visibility in PivotGauge. - * @Default {false} - */ - enableTooltip?: boolean; - - /** Allows the user to view PivotGauge from right to left. - * @Default {false} - */ - enableRTL?: boolean; - - /** Allows the user to enable PivotGauge’s responsiveness in the browser layout. - * @Default {false} - */ - isResponsive?: boolean; - - /** Allows the user to change the format of the label values in PivotGauge. - * @Default {null} - */ - labelFormatSettings?: LabelFormatSettings; - - /** Allows the user to set the localized language for the widget. - * @Default {en-US} - */ - locale?: string; - - /** Sets the number of rows to arrange the Pivot Gauges. - * @Default {0} - */ - rowsCount?: number; - - /** Sets the scale values such as pointers, indicators, etc... for PivotGauge. - * @Default {{}} - */ - scales?: any; - - /** Allows the user to set the custom name for the methods at service-end, communicated during AJAX post. - * @Default {{}} - */ - serviceMethodSettings?: ServiceMethodSettings; - - /** Enables/disables the header labels in PivotGauge. - * @Default {true} - */ - showHeaderLabel?: boolean; - - /** Connects the service using the specified URL for any server updates on server mode operation. - * @Default {“”} - */ - url?: string; - - /** Sets the mode for the PivotGauge widget for binding either OLAP or Relational data source. - * @Default {ej.Pivot.AnalysisMode.Pivot} - */ - analysisMode?: ej.Pivot.AnalysisMode|string; - - /** Sets the mode for the PivotGauge widget for binding data source either in server-side or client-side. - * @Default {ej.Pivot.OperationalMode.ClientMode} - */ - operationalMode?: ej.Pivot.OperationalMode|string; - - /** Triggers when it reaches client-side after any AJAX request. */ - afterServiceInvoke?(e: AfterServiceInvokeEventArgs): void; - - /** Triggers before any AJAX request is passed from PivotGauge to service methods. */ - beforeServiceInvoke?(e: BeforeServiceInvokeEventArgs): void; - - /** Triggers before populating the pivot engine on operating in client mode. */ - beforePivotEnginePopulate?(e: BeforePivotEnginePopulateEventArgs): void; - - /** Triggers when PivotGauge started loading at client-side. */ - load?(e: LoadEventArgs): void; - - /** Triggers when PivotGauge widget completes all operations at client-side after any AJAX request. */ - renderComplete?(e: RenderCompleteEventArgs): void; - - /** Triggers when any error occurred during AJAX request. */ - renderFailure?(e: RenderFailureEventArgs): void; - - /** Triggers when PivotGauge successfully reaches client-side after any AJAX request. */ - renderSuccess?(e: RenderSuccessEventArgs): void; -} - -export interface AfterServiceInvokeEventArgs { - - /** returns the custom object bound with PivotGauge control. - */ - customObject?: any; - - /** returns the HTML element of PivotGauge control. - */ - element?: any; -} - -export interface BeforeServiceInvokeEventArgs { - - /** returns the custom object bound with PivotGauge control. - */ - customObject?: any; - - /** returns the HTML element of PivotGauge control. - */ - element?: any; -} - -export interface BeforePivotEnginePopulateEventArgs { - - /** returns the current instance of PivotGauge control. - */ - gaugeObject?: any; -} - -export interface LoadEventArgs { - - /** returns the current action of PivotGauge control. - */ - action?: string; - - /** returns the model of PivotGauge control. - */ - model?: any; - - /** returns the HTML element of the widget. - */ - element?: any; - - /** returns the custom object bound to the control. - */ - customObject?: any; -} - -export interface RenderCompleteEventArgs { - - /** returns the custom object bound with PivotGauge control. - */ - customObject?: any; - - /** returns the HTML element of PivotGauge control. - */ - element?: any; -} - -export interface RenderFailureEventArgs { - - /** returns the HTML element of PivotGauge control. - */ - element?: any; - - /** returns the custom object bound with the control. - */ - customObject?: any; - - /** returns the error message with error code. - */ - message?: string; -} - -export interface RenderSuccessEventArgs { - - /** returns the HTML element of PivotGauge control. - */ - element?: any; - - /** returns the custom object bound with the control. - */ - customObject?: any; -} - -export interface DataSourceColumnsFilterItems { - - /** Sets the type of filter whether to include/exclude the mentioned values. - * @Default {ej.PivotAnalysis.FilterType.Exclude} - */ - filterType?: ej.PivotAnalysis.FilterType|string; - - /** Contains the collection of items to be included/excluded among the field members. - * @Default {[]} - */ - values?: any[]; -} - -export interface DataSourceColumn { - - /** Allows the user to bind the item by using its unique name as field name. - */ - fieldName?: string; - - /** Applies filter to the field members. - * @Default {null} - */ - filterItems?: DataSourceColumnsFilterItems; -} - -export interface DataSourceRowsFilterItems { - - /** Sets the type of filter whether to include/exclude the mentioned values. - * @Default {ej.PivotAnalysis.FilterType.Exclude} - */ - filterType?: ej.PivotAnalysis.FilterType|string; - - /** Contains the collection of items to be included/excluded among the field members. - * @Default {[]} - */ - values?: any[]; -} - -export interface DataSourceRow { - - /** Allows the user to bind the item by using its unique name as field name. - */ - fieldName?: string; - - /** Applies filter to the field members. - * @Default {null} - */ - filterItems?: DataSourceRowsFilterItems; -} - -export interface DataSourceValuesMeasure { - - /** Allows the user to bind the measure from OLAP datasource by using its unique name as field name. - */ - fieldName?: string; -} - -export interface DataSourceValue { - - /** Allows the user to bind the item by using its unique name as field name for Relational datasource. - */ - fieldName?: string; - - /** Allows the user to set the display caption for an item for Relational datasource. - */ - fieldCaption?: string; - - /** This holds the list of unique names of measures to bind them from the OLAP cube. - * @Default {[]} - */ - measures?: DataSourceValuesMeasure[]; - - /** Allows to set the axis name to place the measures items. - * @Default {rows} - */ - axis?: string; - - /** Indicates whether the field is a calculated field or not with Relational datasource. - * @Default {false} - */ - isCalculatedField?: boolean; - - /** Allows to set the formula for calculation of values for calculated members in Relational datasource. - */ - formula?: string; -} - -export interface DataSourceFiltersFilterItems { - - /** Sets the type of filter whether to include/exclude the mentioned values. - * @Default {ej.PivotAnalysis.FilterType.Exclude} - */ - filterType?: ej.PivotAnalysis.FilterType|string; - - /** Contains the collection of items to be included/excluded among the field members. - * @Default {[]} - */ - values?: any[]; -} - -export interface DataSourceFilter { - - /** Allows the user to bind the item by using its unique name as field name. - */ - fieldName?: string; - - /** Applies filter to the field members. - * @Default {null} - */ - filterItems?: DataSourceFiltersFilterItems; -} - -export interface DataSource { - - /** Contains the respective cube name from OLAP database as string type. - * @Default {“”} - */ - cube?: string; - - /** Provides the raw data source for the PivotGauge. - * @Default {null} - */ - data?: any; - - /** In connection with an OLAP database, this property contains the database name as string to fetch the data from the given connection string. - * @Default {“”} - */ - catalog?: string; - - /** Lists out the items to bind in columns section. - * @Default {[]} - */ - columns?: DataSourceColumn[]; - - /** Lists out the items to bind in rows section. - * @Default {[]} - */ - rows?: DataSourceRow[]; - - /** Lists out the items supports calculation in PivotGauge. - * @Default {[]} - */ - values?: DataSourceValue[]; - - /** Lists out the items which supports filtering of values without displaying the members in UI in PivotGauge. - * @Default {[]} - */ - filters?: DataSourceFilter[]; -} - -export interface LabelFormatSettings { - - /** Allows the user to change the number format of the label values in PivotGauge. - * @Default {ej.PivotGauge.NumberFormat.Default} - */ - numberFormat?: ej.PivotGauge.NumberFormat|string; - - /** Allows you to set the number of digits displayed after decimal point. - * @Default {5} - */ - decimalPlaces?: number; - - /** Allows you to add a text at the beginning of the label. - */ - prefixText?: string; - - /** Allows you to add text at the end of the label. - */ - suffixText?: string; -} - -export interface ServiceMethodSettings { - - /** Allows the user to set the custom name for the service method responsible for initializing PivotGauge. - * @Default {InitializeGauge} - */ - initialize?: string; -} - -enum NumberFormat { - - ///To set default format for label values. - Default, - - ///To set currency format for label values. - Currency, - - ///To set percentage format for label values. - Percentage, - - ///To set fraction format for label values. - Fraction, - - ///To set scientific format for label values. - Scientific, - - ///To set text format for label values. - Text, - - ///To set notation format for label values. - Notation -} - -} - -class PivotTreeMap extends ej.Widget { - static fn: PivotTreeMap; - constructor(element: JQuery | Element, options?: PivotTreeMap.Model); - static Locale: any; - model: PivotTreeMap.Model; - defaults: PivotTreeMap.Model; - - /** Performs an asynchronous HTTP (AJAX) request. - * @returns {void} - */ - doAjaxPost(): void; - - /** Returns the OlapReport string maintained along with the axis elements information. - * @returns {string} - */ - getOlapReport(): string; - - /** Sets the OlapReport string along with the axis information and maintains it in a property. - * @returns {void} - */ - setOlapReport(): void; - - /** Returns the JSON records formed to render the control. - * @returns {Array} - */ - getJSONRecords(): any[]; - - /** Sets the JSON records to render the control. - * @returns {void} - */ - setJSONRecords(): void; - - /** Renders the control with the pivot engine obtained from OLAP cube. - * @returns {void} - */ - generateJSON(): void; - - /** This function receives the JSON formatted datasource to render the PivotTreeMap control. - * @returns {void} - */ - renderTreeMapFromJSON(): void; - - /** This function receives the update from service-end, which would be utilized for rendering the widget. - * @returns {void} - */ - renderControlSuccess(): void; -} -export namespace PivotTreeMap { - -export interface Model { - - /** Specifies the CSS class to PivotTreeMap to achieve custom theme. - * @Default {“”} - */ - cssClass?: string; - - /** Initializes the data source for the PivotTreeMap widget, when it functions completely on client-side. - * @Default {{}} - */ - dataSource?: DataSource; - - /** Object utilized to pass additional information between client-end and service-end. - * @Default {{}} - */ - customObject?: any; - - /** Allows the user to enable PivotTreeMap’s responsiveness in the browser layout. - * @Default {false} - */ - isResponsive?: boolean; - - /** Allows the user to set the localized language for the widget. - * @Default {en-US} - */ - locale?: string; - - /** Sets the mode for the PivotTreeMap widget for binding data source either in server-side or client-side. - * @Default {ej.Pivot.OperationalMode.ClientMode} - */ - operationalMode?: ej.Pivot.OperationalMode|string; - - /** Allows the user to set custom name for the methods at service-end, communicated on AJAX post. - * @Default {{}} - */ - serviceMethodSettings?: ServiceMethodSettings; - - /** Connects the service using the specified URL for any server updates. - * @Default {“”} - */ - url?: string; - - /** Triggers when it reaches client-side after any AJAX request. */ - afterServiceInvoke?(e: AfterServiceInvokeEventArgs): void; - - /** Triggers before any AJAX request is passed from PivotTreeMap to service methods. */ - beforeServiceInvoke?(e: BeforeServiceInvokeEventArgs): void; - - /** Triggers when PivotTreeMap starts to render. */ - load?(e: LoadEventArgs): void; - - /** Triggers before populating the pivot engine from datasource. */ - beforePivotEnginePopulate?(e: BeforePivotEnginePopulateEventArgs): void; - - /** Triggers when drill up/down happens in PivotTreeMap control. And it returns the outer HTML of PivotTreeMap control. */ - drillSuccess?(e: DrillSuccessEventArgs): void; - - /** Triggers when PivotTreeMap widget completes all operations at client-side after any AJAX request. */ - renderComplete?(e: RenderCompleteEventArgs): void; - - /** Triggers when any error occurred during AJAX request. */ - renderFailure?(e: RenderFailureEventArgs): void; - - /** Triggers when PivotTreeMap successfully reaches client-side after any AJAX request. */ - renderSuccess?(e: RenderSuccessEventArgs): void; -} - -export interface AfterServiceInvokeEventArgs { - - /** returns the current action of PivotTreeMap control. - */ - action?: string; - - /** returns the custom object bound with PivotTreeMap control. - */ - customObject?: any; - - /** returns the HTML element of PivotTreeMap control. - */ - element?: any; -} - -export interface BeforeServiceInvokeEventArgs { - - /** returns the current action of PivotTreeMap control. - */ - action?: string; - - /** returns the custom object bound with PivotTreeMap control. - */ - customObject?: any; - - /** returns the HTML element of PivotTreeMap control. - */ - element?: any; -} - -export interface LoadEventArgs { - - /** returns the current action of PivotTreeMap control. - */ - action?: string; - - /** returns the custom object bound with PivotTreeMap control. - */ - customObject?: any; - - /** returns the HTML element of PivotTreeMap control. - */ - element?: any; -} - -export interface BeforePivotEnginePopulateEventArgs { - - /** returns the current instance of PivotTreeMap control. - */ - treeMapObject?: any; -} - -export interface DrillSuccessEventArgs { - - /** return the HTML element of PivotTreeMap control. - */ - element?: any; -} - -export interface RenderCompleteEventArgs { - - /** returns the current action of PivotTreeMap control. - */ - action?: string; - - /** returns the custom object bound with PivotTreeMap control. - */ - customObject?: any; - - /** returns the HTML element of PivotTreeMap control. - */ - element?: any; -} - -export interface RenderFailureEventArgs { - - /** returns the current action of PivotTreeMap control. - */ - action?: string; - - /** returns the custom object bound with PivotTreeMap control. - */ - customObject?: any; - - /** returns the HTML element of PivotTreeMap control. - */ - element?: any; - - /** returns the error stack trace of the original exception. - */ - message?: string; -} - -export interface RenderSuccessEventArgs { - - /** returns the current action of PivotTreeMap control. - */ - action?: string; - - /** returns the custom object bound with PivotTreeMap control. - */ - customObject?: any; - - /** returns the HTML element of PivotTreeMap control. - */ - element?: any; -} - -export interface DataSourceColumnsFilterItems { - - /** Contains the collection of items to be excluded among the field members. - * @Default {[]} - */ - values?: any[]; -} - -export interface DataSourceColumn { - - /** Allows the user to bind the item by using its unique name as field name. - */ - fieldName?: string; - - /** Allows the user to indicate whether the added item is a named set or not. - * @Default {false} - */ - isNamedSets?: boolean; - - /** Applies filter to the field members. - * @Default {null} - */ - filterItems?: DataSourceColumnsFilterItems; -} - -export interface DataSourceRowsFilterItems { - - /** Contains the collection of items to be excluded among the field members. - * @Default {[]} - */ - values?: any[]; -} - -export interface DataSourceRow { - - /** Allows the user to bind the item by using its unique name as field name. - */ - fieldName?: string; - - /** Allows the user to indicate whether the added item is a named set or not. - * @Default {false} - */ - isNamedSets?: boolean; - - /** Applies filter to the field members. - * @Default {null} - */ - filterItems?: DataSourceRowsFilterItems; -} - -export interface DataSourceValuesMeasure { - - /** Allows the user to bind the measure from OLAP datasource by using its unique name as field name. - */ - fieldName?: string; -} - -export interface DataSourceValue { - - /** This holds the list of unique names of measures to bind them from the OLAP cube. - * @Default {[]} - */ - measures?: DataSourceValuesMeasure[]; - - /** Allows to set the axis name to place the measures items. - * @Default {rows} - */ - axis?: string; -} - -export interface DataSourceFiltersFilterItems { - - /** Contains the collection of items to be excluded among the field members. - * @Default {[]} - */ - values?: any[]; -} - -export interface DataSourceFilter { - - /** Allows the user to bind the item by using its unique name as field name. - */ - fieldName?: string; - - /** Applies filter to the field members. - * @Default {null} - */ - filterItems?: DataSourceFiltersFilterItems; -} - -export interface DataSource { - - /** Provides the raw data source for the PivotTreeMap. - * @Default {null} - */ - data?: any; - - /** Contains the respective cube name from OLAP database as string type. - * @Default {“”} - */ - cube?: string; - - /** In connection with an OLAP database, this property contains the database name as string to fetch the data from the given connection string. - * @Default {“”} - */ - catalog?: string; - - /** Lists out the items to be displayed as series of PivotTreeMap. - * @Default {[]} - */ - columns?: DataSourceColumn[]; - - /** Lists out the items to be displayed as segments of PivotTreeMap. - * @Default {[]} - */ - rows?: DataSourceRow[]; - - /** Lists out the items supports calculation in PivotTreeMap. - * @Default {[]} - */ - values?: DataSourceValue[]; - - /** Lists out the items which supports filtering of values without displaying the members in UI in PivotTreeMap. - * @Default {[]} - */ - filters?: DataSourceFilter[]; -} - -export interface ServiceMethodSettings { - - /** Allows the user to set the custom name for the service method responsible for initializing PivotTreeMap. - * @Default {InitializeTreemap} - */ - initialize?: string; - - /** Allows the user to set the custom name for the service method responsible for drilling up/down operation in PivotTreeMap. - * @Default {DrillTreeMap} - */ - drillDown?: string; -} -} - -class Schedule extends ej.Widget { - static fn: Schedule; - constructor(element: JQuery | Element, options?: Schedule.Model); - static Locale: any; - model: Schedule.Model; - defaults: Schedule.Model; - - /** This method is used to delete the appointment based on the guid value or the appointment data passed to it. - * @param {string|any} GUID value of an appointment element or an appointment object - * @returns {void} - */ - deleteAppointment(data: string|any): void; - - /** Destroys the Schedule widget. All the events bound using this._on are unbound automatically and the control is moved to pre-init state. - * @returns {void} - */ - destroy(): void; - - /** Exports the appointments from the Schedule control. - * @param {string} It refers the controller action name to redirect. (For MVC) - * @param {string} It refers the server event name.(For ASP) - * @param {string|number} Pass the id of an appointment, in case if a single appointment needs to be exported. Otherwise, it takes the null value. - * @returns {void} - */ - exportSchedule(action: string, serverEvent: string, id: string|number): void; - - /** Searches and filters the appointments from appointment list of Schedule control. - * @param {Array} Holds array of one or more conditional objects for filtering the appointments based on it. - * @returns {Array} - */ - filterAppointments(filterConditions: any[]): any[]; - - /** Gets the complete appointment list of Schedule control. - * @returns {Array} - */ - getAppointments(): any[]; - - /** Prints the entire Scheduler or a single appointment based on the appointment data passed as an argument to it. Simply calling the print() method, - * without passing any argument will print the entire Scheduler. - * @param {any} Either accepts no arguments at all or else accepts an appointment object. - * @returns {void} - */ - print(data: any): void; - - /** Refreshes the Scroller of Scheduler while using it within some other controls or application. - * @returns {void} - */ - refreshScroller(): void; - - /** It is used to save the appointment. The appointment object is based on the argument passed to this method. - * @param {any} appointment object which includes appointment details - * @returns {void} - */ - saveAppointment(appointmentObject: any): void; - - /** Generate the recurrence rule as a string, based on the repeat options selected. - * @returns {string} - */ - getRecurrenceRule(): string; - - /** Retrieves the time slot information (start/end time and resource details) of the given element. - * The parameter is optional - as when no element is passed to it, the currently selected cell information will be retrieved. When multiple cells are selected in the Scheduler, - * it is not necessary to provide the parameter. - * @param {any} TD element object rendered as Scheduler work cell - * @returns {any} - */ - getSlotByElement(element: any): any; - - /** Searches the appointments from the appointment list of Schedule control based on the provided search string in its argument list. - * @param {any|string} Defines the search word or the filter condition, based on which the appointments are filtered from the list. - * @param {string} Defines the field name on which the search is to be made. - * @param {ej.FilterOperators|string} Defines the filterOperator value for the search operation. - * @param {boolean} Defines the ignoreCase value for performing the search operation. - * @returns {Array} - */ - searchAppointments(searchString: any|string, field: string, operator: ej.FilterOperators|string, ignoreCase: boolean): any[]; - - /** Refreshes the entire Schedule control. - * @returns {void} - */ - refresh(): void; - - /** Refreshes only the appointment elements within the Schedule control. - * @returns {void} - */ - refreshAppointments(): void; - - /** Passes the server-side action and data to the client-side for rendering the modified appointment list on the Schedule control. - * @returns {void} - */ - notifyChanges(): void; -} -export namespace Schedule { - -export interface Model { - - /** When set to true, Schedule allows the appointments to be dragged and dropped at required time. - * @Default {true} - */ - allowDragAndDrop?: boolean; - - /** When set to true, Scheduler allows interaction through keyboard shortcut keys. - * @Default {true} - */ - allowKeyboardNavigation?: boolean; - - /** It includes the dataSource option and the fields related to Schedule appointments. The appointment fields within the appointmentSettings can accept both string and object type values. - * To apply validation rules on the appointment window fields, then the appointment fields needs to be defined with object type values. - */ - appointmentSettings?: AppointmentSettings; - - /** Template design that applies on the Schedule appointments. All the field names that are mapped from dataSource - * to the appropriate field properties within the appointmentSettings can be used within the template. - * @Default {null} - */ - appointmentTemplateId?: string; - - /** Accepts the custom CSS class name that defines specific user-defined styles and themes to be applied for partial or complete elements of the Schedule. - */ - cssClass?: string; - - /** Sets various categorize colors to the Schedule appointments to differentiate it. - */ - categorizeSettings?: CategorizeSettings; - - /** Sets the height for Schedule cells. - * @Default {20px} - */ - cellHeight?: string; - - /** Sets the width for Schedule cells. - */ - cellWidth?: string; - - /** Holds all options related to the context menu settings of Scheduler. - */ - contextMenuSettings?: ContextMenuSettings; - - /** Sets current date of the Schedule. The Schedule displays initially with the date that is provided here. - * @Default {new Date()} - */ - currentDate?: any; - - /** Sets current view of the Schedule. Schedule renders initially with the view that is specified here. The available views are day, week, workweek, month, agenda and - * custom view - from which any one of the required view can be set to the Schedule. It accepts both string or enum values. The enum values that are accepted - * by currentView(ej.Schedule.CurrentView) are as follows, - * @Default {ej.Schedule.CurrentView.Week} - */ - currentView?: string|ej.Schedule.CurrentView; - - /** Sets the date format for Schedule. - */ - dateFormat?: string; - - /** When set to true, shows the previous/next appointment navigator button on the Scheduler. - * @Default {true} - */ - showAppointmentNavigator?: boolean; - - /** When set to true, enables the resize behavior of appointments within the Schedule. - * @Default {true} - */ - enableAppointmentResize?: boolean; - - /** When set to true, enables the loading of Schedule appointments based on your demand. With this load on demand concept, the data consumption of the Schedule can be limited. - * @Default {false} - */ - enableLoadOnDemand?: boolean; - - /** Saves the current model value to browser cookies for state maintenance. When the page gets refreshed, Schedule control values are retained. - * @Default {false} - */ - enablePersistence?: boolean; - - /** When set to true, the Schedule layout and behavior changes as per the common RTL conventions. - * @Default {false} - */ - enableRTL?: boolean; - - /** Sets the end hour time limit to be displayed on the Schedule. - * @Default {24} - */ - endHour?: number; - - /** To configure resource grouping on the Schedule. - */ - group?: Group; - - /** Sets the height of the Schedule. Accepts both pixel and percentage values. - * @Default {1120px} - */ - height?: string; - - /** To define the work hours within the Schedule control. - */ - workHours?: WorkHours; - - /** When set to true, enables the Schedule to observe Daylight Saving Time for supported timezones. - * @Default {false} - */ - isDST?: boolean; - - /** When set to true, adapts the Schedule layout to fit the screen size of devices on which it renders. - * @Default {true} - */ - isResponsive?: boolean; - - /** Sets the specific culture to the Schedule. - * @Default {en-US} - */ - locale?: string; - - /** Sets the maximum date limit to display on the Schedule. Setting maxDate with specific date value disallows the Schedule to navigate beyond that date. - * @Default {new Date(2099, 12, 31)} - */ - maxDate?: any; - - /** Sets the minimum date limit to display on the Schedule. Setting minDate with specific date value disallows the Schedule to navigate beyond that date. - * @Default {new Date(1900, 01, 01)} - */ - minDate?: any; - - /** Sets the mode of Schedule rendering either in a vertical or horizontal direction. It accepts either string("vertical" or "horizontal") or enum values. - * The enum values that are accepted by orientation(ej.Schedule.Orientation) are as follows, - * @Default {ej.Schedule.Orientation.Vertical} - */ - orientation?: string|ej.Schedule.Orientation; - - /** Holds all the options related to priority settings of the Schedule. - */ - prioritySettings?: PrioritySettings; - - /** When set to true, disables the interaction with the Schedule appointments, simply allowing the date and view navigation to occur. - * @Default {false} - */ - readOnly?: boolean; - - /** Holds all the options related to reminder settings of the Schedule. - */ - reminderSettings?: ReminderSettings; - - /** Defines the specific start and end dates to be rendered in the Schedule control. To render such user-specified custom date ranges in the Schedule control, - * set the currentView property to ej.Schedule.CurrentView.CustomView. - * @Default {null} - */ - renderDates?: RenderDates; - - /** Template design that applies on the Schedule resource header. - * @Default {null} - */ - resourceHeaderTemplateId?: string; - - /** Holds all the options related to the resources settings of the Schedule. It is a collection of one or more resource objects, where the levels of resources are rendered on the Schedule - * based on the order of the resource data provided within this collection. - * @Default {null} - */ - resources?: Resource[]; - - /** When set to true, displays the all-day row cells on the Schedule. - * @Default {true} - */ - showAllDayRow?: boolean; - - /** When set to true, displays the current time indicator on the Schedule. - * @Default {true} - */ - showCurrentTimeIndicator?: boolean; - - /** When set to true, displays the header bar on the Schedule. - * @Default {true} - */ - showHeaderBar?: boolean; - - /** When set to true, displays the location field additionally on Schedule appointment window. - * @Default {false} - */ - showLocationField?: boolean; - - /** When set to false, doesn't render the start and end timezone fields on the Schedule appointment window. - * @Default {true} - */ - showTimeZoneFields?: boolean; - - /** When set to true, displays the quick window for every single click made on the Schedule cells or appointments. - * @Default {true} - */ - showQuickWindow?: boolean; - - /** Sets the start hour time range to be displayed on the Schedule. - * @Default {0} - */ - startHour?: number; - - /** Sets either 12 or 24 hour time mode on the Schedule. It accepts either the string value("12" or "24") or the below mentioned enum values. - * The enum values that are accepted by timeMode(ej.Schedule.TimeMode) are as follows, - * @Default {null} - */ - timeMode?: string|ej.Schedule.TimeMode; - - /** Sets the timezone for the Schedule. - * @Default {null} - */ - timeZone?: string; - - /** Sets the collection of timezone items to be bound to the Schedule. Only the items bound to this property gets listed out in the timezone field of the appointment window. - */ - timeZoneCollection?: TimeZoneCollection; - - /** Defines the view collection to be displayed on the Schedule. By default, it displays all the views namely, Day, Week, WorkWeek and Month. - * @Default {[Day, Week, WorkWeek, Month, Agenda]} - */ - views?: any[]; - - /** Sets the width of the Schedule. Accepts both pixel and percentage values. - * @Default {100%} - */ - width?: string; - - /** When set to true, Schedule allows the validation of recurrence pattern to take place before it is being assigned to the appointments. For example, when one of the instance of - * recurrence appointment is dragged beyond the next or previous instance of the same recurrence appointment, a pop-up is displayed with the validation message disallowing the drag functionality. - * @Default {true} - */ - enableRecurrenceValidation?: boolean; - - /** Sets the week to display more than one week appointment summary. - */ - agendaViewSettings?: AgendaViewSettings; - - /** Sets specific day as the starting day of the week. - * @Default {null} - */ - firstDayOfWeek?: string; - - /** Sets different day collection within workWeek view. - * @Default {[Monday, Tuesday, Wednesday, Thursday, Friday]} - */ - workWeek?: any[]; - - /** Allows to pop-up appointment details in a tooltip while hovering over the appointments. - */ - tooltipSettings?: TooltipSettings; - - /** Holds all the options related to the time scale of Scheduler. The timeslots either major or minor slots can be customized with this property. - */ - timeScale?: TimeScale; - - /** When set to true, shows the delete confirmation dialog before deleting an appointment. - * @Default {true} - */ - showDeleteConfirmationDialog?: boolean; - - /** Accepts the id value of the template layout defined for the all-day cells and customizes it. - * @Default {null} - */ - allDayCellsTemplateId?: string; - - /** Accepts the id value of the template layout defined for the work cells and month cells. - * @Default {null} - */ - workCellsTemplateId?: string; - - /** Accepts the id value of the template layout defined for the date header cells and customizes it. - * @Default {null} - */ - dateHeaderTemplateId?: string; - - /** when set to false, allows the height of the work-cells to adjust automatically (either expand or collapse) based on the number of appointment count it has. - * @Default {true} - */ - showOverflowButton?: boolean; - - /** Allows setting draggable area for the Scheduler appointments. Also, turns on the external drag and drop, when set with some specific external drag area name. - */ - appointmentDragArea?: string; - - /** When set to true, displays the other months days from the current month on the Schedule. - * @Default {true} - */ - showNextPrevMonth?: boolean; - - /** Blocks the user-specific time interval on the Scheduler, so that no appointments can be created on that particular time slots. - * It includes the dataSource option and also the fields related to block intervals. - */ - blockoutSettings?: BlockoutSettings; - - /** Triggers on the beginning of every action that starts within the Schedule. */ - actionBegin?(e: ActionBeginEventArgs): void; - - /** Triggers after the completion of every action within the Schedule. */ - actionComplete?(e: ActionCompleteEventArgs): void; - - /** Triggers after an appointment is clicked. */ - appointmentClick?(e: AppointmentClickEventArgs): void; - - /** Triggers before the appointment is being removed from the Scheduler. */ - beforeAppointmentRemove?(e: BeforeAppointmentRemoveEventArgs): void; - - /** Triggers before the edited appointment is being saved. */ - beforeAppointmentChange?(e: BeforeAppointmentChangeEventArgs): void; - - /** Triggers on hovering the mouse over the appointments. */ - appointmentHover?(e: AppointmentHoverEventArgs): void; - - /** Triggers before the new appointment gets saved. */ - beforeAppointmentCreate?(e: BeforeAppointmentCreateEventArgs): void; - - /** Triggers before the appointment window opens. */ - appointmentWindowOpen?(e: AppointmentWindowOpenEventArgs): void; - - /** Triggers before the context menu opens. */ - beforeContextMenuOpen?(e: BeforeContextMenuOpenEventArgs): void; - - /** Triggers after the cell is clicked. */ - cellClick?(e: CellClickEventArgs): void; - - /** Triggers after the cell is clicked twice. */ - cellDoubleClick?(e: CellDoubleClickEventArgs): void; - - /** Triggers on hovering the mouse overs the cells. */ - cellHover?(e: CellHoverEventArgs): void; - - /** Triggers when the Scheduler completely renders on the page. */ - create?(e: CreateEventArgs): void; - - /** Triggers when the Scheduler and all its sub-components gets destroyed. */ - destroy?(e: DestroyEventArgs): void; - - /** Triggers while the appointment is being dragged over the work cells. */ - drag?(e: DragEventArgs): void; - - /** Triggers when the appointment dragging begins. */ - dragStart?(e: DragStartEventArgs): void; - - /** Triggers when the appointment is dropped. */ - dragStop?(e: DragStopEventArgs): void; - - /** Triggers after the menu/sub-menu items within the context menu is clicked. */ - menuItemClick?(e: MenuItemClickEventArgs): void; - - /** Triggers after the Schedule view or date is navigated. */ - navigation?(e: NavigationEventArgs): void; - - /** Triggers every time before the elements of the scheduler such as work cells, time cells or header cells and so on renders or re-renders on a page. */ - queryCellInfo?(e: QueryCellInfoEventArgs): void; - - /** Triggers when the reminder is raised for an appointment based on the alertBefore value. */ - reminder?(e: ReminderEventArgs): void; - - /** Triggers while resizing the appointment. */ - resize?(e: ResizeEventArgs): void; - - /** Triggers when the appointment resizing begins. */ - resizeStart?(e: ResizeStartEventArgs): void; - - /** Triggers when an appointment resizing stops. */ - resizeStop?(e: ResizeStopEventArgs): void; - - /** Triggers when the overflow button is clicked. */ - overflowButtonClick?(e: OverflowButtonClickEventArgs): void; - - /** Triggers while mouse hovering on the overflow button. */ - overflowButtonHover?(e: OverflowButtonHoverEventArgs): void; - - /** Triggers when any of the keyboard keys are pressed. */ - keyDown?(e: KeyDownEventArgs): void; - - /** Triggers after the new appointment is saved. */ - appointmentCreated?(e: AppointmentCreatedEventArgs): void; - - /** Triggers after an existing appointment is edited. */ - appointmentChanged?(e: AppointmentChangedEventArgs): void; - - /** Triggers after the appointment is deleted. */ - appointmentRemoved?(e: AppointmentRemovedEventArgs): void; -} - -export interface ActionBeginEventArgs { - - /** Returns the current date value. - */ - currentDate?: any; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the current view value. - */ - currentView?: string; - - /** Returns the Schedule model. - */ - model?: ej.Schedule.Model; - - /** Returns the action begin request type. - */ - requestType?: string; - - /** Returns the target of the click. - */ - target?: any; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the save appointment value. - */ - data?: any; - - /** Returns the id of delete appointment. - */ - id?: number; -} - -export interface ActionCompleteEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the data about view change action. - */ - data?: any; - - /** Returns the Schedule model. - */ - model?: ej.Schedule.Model; - - /** Returns the action complete request type. - */ - requestType?: string; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the appointment data dropped. - */ - appointment?: any; -} - -export interface AppointmentClickEventArgs { - - /** Returns the object of appointmentClick event. - */ - object?: any; - - /** Returns the clicked appointment object. - */ - appointment?: any; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the Schedule model. - */ - model?: ej.Schedule.Model; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface BeforeAppointmentRemoveEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the deleted appointment object. - */ - appointment?: any; - - /** Returns the Schedule model. - */ - model?: ej.Schedule.Model; - - /** Returns the name of the Scheduler event. - */ - type?: string; -} - -export interface BeforeAppointmentChangeEventArgs { - - /** Returns the edited appointment object. - */ - appointment?: any; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the Schedule model. - */ - model?: ej.Schedule.Model; - - /** Returns the name of the Scheduler event. - */ - type?: string; -} - -export interface AppointmentHoverEventArgs { - - /** Returns the object of appointmentHover event. - */ - object?: any; - - /** Returns the hovered appointment object. - */ - appointment?: any; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the Schedule model. - */ - model?: ej.Schedule.Model; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface BeforeAppointmentCreateEventArgs { - - /** Returns the appointment object. - */ - appointment?: any; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the Schedule model. - */ - model?: ej.Schedule.Model; - - /** Returns the name of the Scheduler event. - */ - type?: string; -} - -export interface AppointmentWindowOpenEventArgs { - - /** returns the object of appointmentWindowOpen event while selecting the detail option from quick window or edit appointment or edit series option. - */ - object?: any; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the end time of the double clicked cell. - */ - endTime?: any; - - /** Returns the Schedule model. - */ - model?: ej.Schedule.Model; - - /** Returns the action name that triggers window open. - */ - originalEventType?: string; - - /** Returns the start time of the double clicked cell. - */ - startTime?: any; - - /** Returns the target of the double clicked cell. - */ - target?: any; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the edit appointment object. - */ - appointment?: any; - - /** Returns the edit occurrence option value. - */ - edit?: boolean; -} - -export interface BeforeContextMenuOpenEventArgs { - - /** Returns the object of beforeContextMenuOpen event. - */ - object?: any; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the current cell index value. - */ - cellIndex?: number; - - /** Returns the current date value. - */ - currentDate?: any; - - /** Returns the current resource details, when multiple resources are present, otherwise returns null. - */ - resources?: any; - - /** Returns the current appointment details while opening the menu from appointment. - */ - appointment?: any; - - /** Returns the object of before opening menu target. - */ - events?: any; - - /** Returns the Schedule model. - */ - model?: ej.Schedule.Model; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface CellClickEventArgs { - - /** Returns the object of cellClick event. - */ - object?: any; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the end time of the clicked cell. - */ - endTime?: any; - - /** Returns the Schedule model. - */ - model?: ej.Schedule.Model; - - /** Returns the start time of the clicked cell. - */ - startTime?: any; - - /** Returns the target of the clicked cell. - */ - target?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface CellDoubleClickEventArgs { - - /** Returns the object of cellDoubleClick event. - */ - object?: any; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the end time of the double clicked cell. - */ - endTime?: any; - - /** Returns the Schedule model. - */ - model?: ej.Schedule.Model; - - /** Returns the start time of the double clicked cell. - */ - startTime?: any; - - /** Returns the target of the double clicked cell. - */ - target?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface CellHoverEventArgs { - - /** Returns the object of cellHover event. - */ - object?: any; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the index of the hovered cell. - */ - cellIndex?: any; - - /** Returns the current date of the hovered cell. - */ - currentDate?: any; - - /** Returns the Schedule model. - */ - model?: ej.Schedule.Model; - - /** Returns the target of the clicked cell. - */ - target?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface CreateEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the Schedule model. - */ - model?: ej.Schedule.Model; - - /** Returns the name of the Scheduler event. - */ - type?: string; -} - -export interface DestroyEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the Schedule model. - */ - model?: ej.Schedule.Model; - - /** Returns the name of the Scheduler event. - */ - type?: string; -} - -export interface DragEventArgs { - - /** Returns the object of dragOver event. - */ - object?: any; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the Schedule model. - */ - model?: ej.Schedule.Model; - - /** Returns the target of the drag over appointment. - */ - target?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface DragStartEventArgs { - - /** Returns the object of dragStart event. - */ - object?: any; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the Schedule model. - */ - model?: ej.Schedule.Model; - - /** Returns the target of the dragging appointment. - */ - target?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface DragStopEventArgs { - - /** Returns the object of dragDrop event. - */ - object?: any; - - /** Returns the dropped appointment object. - */ - appointment?: any; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the Schedule model. - */ - model?: ej.Schedule.Model; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface MenuItemClickEventArgs { - - /** Returns the object of menuItemClick event. - */ - object?: any; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the object of menu item event. - */ - events?: any; - - /** Returns the Schedule model. - */ - model?: ej.Schedule.Model; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface NavigationEventArgs { - - /** Returns the current date object. - */ - currentDate?: any; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the Schedule model. - */ - model?: ej.Schedule.Model; - - /** Returns the current view value. - */ - currentView?: string; - - /** Returns the previous view value. - */ - previousView?: string; - - /** Returns the target of the action. - */ - target?: any; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the previous date of the Schedule. - */ - previousDate?: any; -} - -export interface QueryCellInfoEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the Schedule model. - */ - model?: ej.Schedule.Model; - - /** Returns the current appointment data. - */ - appointment?: any; - - /** Returns the currently rendering DOM element. - */ - element?: any; - - /** Returns the name of the currently rendering element on the scheduler. - */ - requestType?: string; - - /** Returns the cell type which is currently rendering on the Scheduler. - */ - cellType?: string; - - /** Returns the start date of the currently rendering appointment. - */ - currentAppointmentDate?: any; - - /** Returns the currently rendering cell information. - */ - cell?: any; - - /** Returns the currently rendering resource details. - */ - resource?: any; - - /** Returns the currently rendering date information. - */ - currentDay?: any; -} - -export interface ReminderEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the Schedule model. - */ - model?: ej.Schedule.Model; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the appointment object for which the reminder is raised. - */ - reminderAppointment?: any; -} - -export interface ResizeEventArgs { - - /** Returns the object of resizing event. - */ - object?: any; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the resize element value. - */ - element?: any; - - /** Returns the Schedule model. - */ - model?: ej.Schedule.Model; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface ResizeStartEventArgs { - - /** Returns the object of resizeStart event. - */ - object?: any; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the resize element value. - */ - element?: any; - - /** Returns the Schedule model. - */ - model?: ej.Schedule.Model; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface ResizeStopEventArgs { - - /** Returns the object of resizeStop event. - */ - object?: any; - - /** Returns the resized appointment value. - */ - appointment?: any; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the Schedule model. - */ - model?: ej.Schedule.Model; - - /** Returns the target of the resized appointment. - */ - target?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface OverflowButtonClickEventArgs { - - /** Returns the object consisting of start time, end time and resource value of the underlying cell on which the clicked overflow button is present. - */ - object?: any; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the object of menu item event. - */ - events?: any; - - /** Returns the Schedule model. - */ - model?: ej.Schedule.Model; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface OverflowButtonHoverEventArgs { - - /** Returns the object consisting of start time, end time and resource value of the underlying cell on which the overflow button is currently hovered. - */ - object?: any; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the object of menu item event. - */ - events?: any; - - /** Returns the Schedule model. - */ - model?: ej.Schedule.Model; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface KeyDownEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the object of menu item event. - */ - events?: any; - - /** Returns the Schedule model. - */ - model?: ej.Schedule.Model; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface AppointmentCreatedEventArgs { - - /** Returns the appointment object. - */ - appointment?: any; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the Schedule model. - */ - model?: ej.Schedule.Model; - - /** Returns the name of the Scheduler event. - */ - type?: string; -} - -export interface AppointmentChangedEventArgs { - - /** Returns the edited appointment object. - */ - appointment?: any; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the Schedule model. - */ - model?: ej.Schedule.Model; - - /** Returns the name of the Scheduler event. - */ - type?: string; -} - -export interface AppointmentRemovedEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the deleted appointment object. - */ - appointment?: any; - - /** Returns the Schedule model. - */ - model?: ej.Schedule.Model; - - /** Returns the name of the Scheduler event. - */ - type?: string; -} - -export interface AppointmentSettings { - - /** The dataSource option accepts either JSON object collection or DataManager (ej.DataManager) instance that contains Schedule appointments. - * @Default {[]} - */ - dataSource?: any|any[]; - - /** It holds either the ej.Query() object or simply the query string that retrieves the specified records from the table. - * @Default {null} - */ - query?: string; - - /** Assign the table name from where the records are to be fetched for the Schedule. - * @Default {null} - */ - tableName?: string; - - /** When set to false, doesn't consider the time difference offset calculation on appointment time. - * @Default {true} - */ - applyTimeOffset?: boolean; - - /** Binds the id field name in dataSource to the id of Schedule appointments. It denotes the unique id assigned to appointments. - * @Default {null} - */ - id?: string; - - /** Binds the name of startTime field in the dataSource with start time of the Schedule appointments. It indicates the date and Time when Schedule appointment actually starts. - * @Default {null} - */ - startTime?: string; - - /** Binds the name of endTime field in dataSource with the end time of Schedule appointments. It indicates the date and time when Schedule appointment actually ends. - * @Default {null} - */ - endTime?: string; - - /** Binds the name of subject field in the dataSource to appointment Subject. Indicates the Subject or title that gets displayed on Schedule appointments. - * @Default {null} - */ - subject?: string; - - /** Binds the description field name in dataSource. It indicates the appointment description. - * @Default {null} - */ - description?: string; - - /** Binds the name of recurrence field in dataSource. It indicates whether the appointment is a recurrence appointment or not. - * @Default {null} - */ - recurrence?: string; - - /** Binds the name of recurrenceRule field in dataSource. It indicates the recurrence pattern associated with appointments. - * @Default {null} - */ - recurrenceRule?: string; - - /** Binds the name of allDay field in dataSource. It indicates whether the appointment is an all-day appointment or not. - * @Default {null} - */ - allDay?: string; - - /** Binds one or more fields in resource collection dataSource. It maps the resource field names with appointments denoting the resource of appointments actually belongs. - * @Default {null} - */ - resourceFields?: string; - - /** Binds the name of categorize field in dataSource. It indicates the categorize value, red categorize, green, yellow and so on applied to the appointments. - * @Default {null} - */ - categorize?: string; - - /** Binds the name of location field in dataSource. It indicates the appointment location. - * @Default {null} - */ - location?: string; - - /** Binds the name of the priority field in dataSource. It indicates the priority, high, low, medium and none of the appointments. - * @Default {null} - */ - priority?: string; - - /** Binds the name of start timezone field in dataSource. It indicates the timezone of appointment start date. When startTimeZone field is not mentioned, - * the appointment uses the Schedule timeZone or System timeZone. - * @Default {null} - */ - startTimeZone?: string; - - /** Binds the name of end timezone field in dataSource. It indicates the timezone of appointment end date. When the endTimeZone field is not mentioned, - * the appointment uses the Schedule timeZone or System timeZone. - * @Default {null} - */ - endTimeZone?: string; -} - -export interface CategorizeSettings { - - /** When set to true, enables the multiple selection of categories to be applied for the appointments. - * @Default {false} - */ - allowMultiple?: boolean; - - /** When set to true, enables the categories option to be applied for the appointments. - * @Default {false} - */ - enable?: boolean; - - /** The dataSource option accepts either the JSON object collection or DataManager [ej.DataManager] instance that contains the categorize data. - */ - dataSource?: any[]|any; - - /** Binds id field name in the dataSource to id of category data. - * @Default {id} - */ - id?: string; - - /** Binds text field name in the dataSource to category text. - * @Default {text} - */ - text?: string; - - /** Binds color field name in the dataSource to category color. - * @Default {color} - */ - color?: string; - - /** Binds fontColor field name in the dataSource to category font. - * @Default {fontColor} - */ - fontColor?: string; -} - -export interface ContextMenuSettingsMenuItems { - - /** All the appointment related context menu items are grouped under this appointment menu collection. - */ - appointment?: any[]; - - /** All the Scheduler cell related context menu items are grouped under this cells menu item collection. - */ - cells?: any[]; -} - -export interface ContextMenuSettings { - - /** When set to true, enables the context menu options available for the Schedule cells and appointments. - * @Default {false} - */ - enable?: boolean; - - /** Contains all the default context menu options that are applicable for both Schedule cells and appointments. It also supports adding custom menu items to cells or appointment collection. - */ - menuItems?: ContextMenuSettingsMenuItems; -} - -export interface Group { - - /** Holds the array of resource names to be grouped on the Schedule. - */ - resources?: any[]; -} - -export interface WorkHours { - - /** When set to true, highlights the work hours of the Schedule. - * @Default {true} - */ - highlight?: boolean; - - /** Sets the start time to depict the start of working or business hour in a day. - * @Default {9} - */ - start?: number; - - /** Sets the end time to depict the end of working or business hour in a day. - * @Default {18} - */ - end?: number; -} - -export interface PrioritySettings { - - /** When set to true, enables the priority options available for the Schedule appointments. - * @Default {false} - */ - enable?: boolean; - - /** The dataSource option can accept the JSON object collection that contains the priority related data. - * @Default {{% highlight js%}[{ text: None, value: none },{ text: High, value: high },{ text: Medium, value: medium },{ text: Low, value: low }]{% endhighlight %}} - */ - dataSource?: any|any[]; - - /** Binds text field name in the dataSource to prioritySettings text. These text gets listed out in priority field of the appointment window. - * @Default {text} - */ - text?: string; - - /** Binds value field name in the dataSource to prioritySettings value. These field names usually accepts four priority values by default, high, low, medium and none. - * @Default {value} - */ - value?: string; - - /** Allows priority field customization in the appointment window to add custom icons denoting the priority level for the appointments. - * @Default {null} - */ - template?: string; -} - -export interface ReminderSettings { - - /** When set to true, enables the reminder option available for the Schedule appointments. - * @Default {false} - */ - enable?: boolean; - - /** Sets the timing, when the reminders are to be alerted for the Schedule appointments. - * @Default {5} - */ - alertBefore?: number; -} - -export interface RenderDates { - - /** Sets the start of custom date range to be rendered in the Schedule. - * @Default {null} - */ - start?: any; - - /** Sets the end limit of the custom date range. - * @Default {null} - */ - end?: any; -} - -export interface ResourcesResourceSettings { - - /** The dataSource option accepts either JSON object collection or DataManager (ejDataManager) instance that contains the resources related data. - * @Default {[]} - */ - dataSource?: any|any[]; - - /** Binds text field name in the dataSource to resourceSettings text. These text gets listed out in resources field of the appointment window. - * @Default {null} - */ - text?: string; - - /** Binds id field name in the dataSource to resourceSettings id. - * @Default {null} - */ - id?: string; - - /** Binds groupId field name in the dataSource to resourceSettings groupId. - * @Default {null} - */ - groupId?: string; - - /** Binds color field name in the dataSource to resourceSettings color. The color specified here gets applied to the Schedule appointments denoting to the resource it belongs. - * @Default {null} - */ - color?: string; - - /** Binds the starting work hour field name in the dataSource. It's optional, but providing it with some numeric value will set the starting work hour for specific resources. - * @Default {null} - */ - start?: string; - - /** Binds the end work hour field name in the dataSource. It's optional, but providing it with some numeric value will set the end work hour for specific resources. - * @Default {null} - */ - end?: string; - - /** Binds the resources working days field name in the dataSource. It's optional, and accepts the array of strings (week day names). When provided with specific collection of - * days (array of day names), only those days will render for the specific resources. - * @Default {null} - */ - workWeek?: string; - - /** Binds appointmentClass field name in the dataSource. It applies custom CSS class name to appointments depicting to the resource it belongs. - * @Default {null} - */ - appointmentClass?: string; -} - -export interface Resource { - - /** It holds the name of the resource field to be bound to the Schedule appointments that contains the resource Id. - * @Default {null} - */ - field?: string; - - /** It holds the title name of the resource field to be displayed on the Schedule appointment window. - * @Default {null} - */ - title?: string; - - /** A unique resource name that is used for differentiating various resource objects while grouping it in various levels. - * @Default {null} - */ - name?: string; - - /** When set to true, allows multiple selection of resource names, thus creating multiple instances of same appointment for the selected resources. - * @Default {false} - */ - allowMultiple?: boolean; - - /** It holds the field names of the resources to be bound to the Schedule and also the dataSource. - */ - resourceSettings?: ResourcesResourceSettings; -} - -export interface TimeZoneCollection { - - /** Sets the collection of timezone items to the dataSource that accepts either JSON object collection or DataManager (ej.DataManager) instance that contains Schedule timezones. - */ - dataSource?: any; - - /** Binds text field name in the dataSource to timeZoneCollection text. These text gets listed out in the timezone fields of the appointment window. - * @Default {text} - */ - text?: string; - - /** Binds id field name in the dataSource to timeZoneCollection id. - * @Default {id} - */ - id?: string; - - /** Binds value field name in the dataSource to timeZoneCollection value. - * @Default {value} - */ - value?: string; -} - -export interface AgendaViewSettings { - - /** You can display the summary of multiple week's appointment by setting this value. - * @Default {7} - */ - daysInAgenda?: number; - - /** You can customize the Date column display based on the requirement. - * @Default {null} - */ - dateColumnTemplateId?: string; - - /** You can customize the time column display based on the requirement. - * @Default {null} - */ - timeColumnTemplateId?: string; -} - -export interface TooltipSettings { - - /** Enables or disables the tooltip display. - * @Default {false} - */ - enable?: boolean; - - /** Template design that customizes the tooltip. All the field names that are mapped from dataSource to the appropriate field properties within - * the appointmentSettings can be accessed within the template. - * @Default {null} - */ - templateId?: string; -} - -export interface TimeScale { - - /** When set to true, displays the time slots on the Scheduler. - * @Default {true} - */ - enable?: boolean; - - /** When set with some specific value, defines the number of time divisions split per hour(as per value given for the majorTimeSlot). Those time divisions are meant to be the minor slots. - * @Default {2} - */ - minorSlotCount?: number; - - /** Accepts the value in minutes. When provided with specific value, displays the appropriate time interval on the Scheduler - * @Default {60} - */ - majorSlot?: number; - - /** Template design that customizes the timecells (minor slots) that are partitioned based on minorSlotCount. Accepts id value of the template defined for minor time slots. - * @Default {null} - */ - minorSlotTemplateId?: string; - - /** Template design that customizes the timecells (major slots). Accepts id value of the template defined for major time slots. - * @Default {null} - */ - majorSlotTemplateId?: string; -} - -export interface BlockoutSettings { - - /** When set to true, enables the blockout option to be applied on the Scheduler cells. - * @Default {false} - */ - enable?: boolean; - - /** Template design that applies on the Schedule block intervals. All the field names that are mapped from dataSource to the appropriate field - * properties within the blockoutSettings can be used within the template. - * @Default {null} - */ - templateId?: string; - - /** The dataSource option accepts either JSON object collection or DataManager (ej.DataManager) instance that contains Schedule block intervals. - * @Default {[]} - */ - dataSource?: any|any[]; - - /** It holds either the ej.Query() object or simply the query string that retrieves the specified records from the table. - * @Default {null} - */ - query?: string; - - /** Assign the table name from where the records are to be fetched for the Schedule. - * @Default {null} - */ - tableName?: string; - - /** Binds the id field name in dataSource to the id of block time interval. It denotes the unique id assigned to each of the block records. - * @Default {null} - */ - id?: string; - - /** Binds the name of startTime field in the dataSource with start time of block time interval. It indicates the date and time, when the block interval actually starts in the Scheduler. - * @Default {null} - */ - startTime?: string; - - /** Binds the name of endTime field in dataSource with the end time of block time interval. It indicates the date and time, when the block interval actually ends in the Scheduler. - * @Default {null} - */ - endTime?: string; - - /** Binds the name of subject field in the dataSource to block time Subject. Indicates the Subject or title that gets displayed on the Schedule block intervals. - * @Default {null} - */ - subject?: string; - - /** Binds the name of isBlockAppointment field in dataSource. When set to true, disables the appointments that lies on the blocked area and restrict to perform CRUD operations in it. - * @Default {null} - */ - isBlockAppointment?: string; - - /** Binds the name of isAllDay field in dataSource. It indicates whether an entire day is blocked or not. - * @Default {null} - */ - isAllDay?: string; - - /** Binds the name of resourceId field in dataSource. Specifies the id of the resources, to which the time intervals are needed to be blocked. - * @Default {null} - */ - resourceId?: string; - - /** Binds the name of customStyle field in dataSource. It applies the custom CSS to the block intervals. - * @Default {null} - */ - customStyle?: string; -} - -enum CurrentView { - - ///Sets currentView of the Scheduler as Day - Day, - - ///Sets currentView of the Scheduler as Week - Week, - - ///Sets currentView of the Scheduler as WorkWeek - Workweek, - - ///Sets currentView of the Scheduler as Month - Month, - - ///Sets currentView of the Scheduler as Agenda - Agenda, - - ///Sets currentView of the Scheduler as CustomView with user-specified date range. - CustomView -} - - -enum Orientation { - - ///Set orientation as vertical to Scheduler - Vertical, - - ///Set orientation as horizontal to Scheduler - Horizontal -} - - -enum TimeMode { - - ///Sets 12 hour time mode to Scheduler - Hour12, - - ///Sets 24 hour time mode to Scheduler - Hour24 -} - -} - -class RecurrenceEditor extends ej.Widget { - static fn: RecurrenceEditor; - constructor(element: JQuery | Element, options?: RecurrenceEditor.Model); - static Locale: any; - model: RecurrenceEditor.Model; - defaults: RecurrenceEditor.Model; - - /** Generates the recurrence rule with the options selected within the Recurrence Editor. - * @returns {String} - */ - getRecurrenceRule(): string; - - /** Generates the collection of date, that lies within the selected recurrence start and end date for which the recurrence pattern applies. - * @param {string} It refers the recurrence rule. - * @param {any} It refers the start date of the recurrence. - * @returns {any} - */ - recurrenceDateGenerator(recurrenceString: string, startDate: any): any; - - /** It splits and returns the recurrence rule string into object collection. - * @param {string} It refers the recurrence rule string. - * @param {any} It refers the appointment dates (ExDate) to be excluded - * @returns {any} - */ - recurrenceRuleSplit(recurrenceRule: string, exDate: any): any; -} -export namespace RecurrenceEditor { - -export interface Model { - - /** Defines the collection of recurrence frequencies within Recurrence Editor such as Never, Daily, Weekly, Monthly, Yearly and Every Weekday. - * @Default {[never, daily, weekly, monthly, yearly, everyweekday]} - */ - frequencies?: any[]; - - /** Sets the starting day of the week. - * @Default {null} - */ - firstDayOfWeek?: string; - - /** When set to true, enables the spin button of numeric textboxes within the Recurrence Editor. - * @Default {true} - */ - enableSpinners?: boolean; - - /** Sets the start date of the recurrence. The Recurrence Editor initially displays the current date as its start date. - * @Default {new Date()} - */ - startDate?: any; - - /** Sets the specific culture to the Recurrence Editor. - * @Default {en-US} - */ - locale?: string; - - /** Sets the date format for the datepickers available within the Recurrence Editor. - */ - dateFormat?: string; - - /** When set to true, renders the Recurrence Editor options from Right-to-Left direction. - * @Default {false} - */ - enableRTL?: boolean; - - /** Sets the active/current repeat type(frequency) on Recurrence Editor based on the index value provided. For example, setting the value 1 will initially set the repeat type - * as Daily and display its related options. - * @Default {0} - */ - selectedRecurrenceType?: number; - - /** Sets the minimum date limit to display on the datepickers defined within the Recurrence Editor. Setting minDate with specific date value disallows the datepickers within - * Recurrence Editor to navigate beyond that date. - * @Default {new Date(1900, 01, 01)} - */ - minDate?: any; - - /** Sets the maximum date limit to display on the datepickers used within the Recurrence Editor. Setting maxDate with specific date value disallows the - * datepickers within the Recurrence Editor to navigate beyond that date. - * @Default {new Date(2099, 12, 31)} - */ - maxDate?: any; - - /** Accepts the custom CSS class name, that defines user-defined styles and themes to be applied on partial or complete elements of the Recurrence Editor. - */ - cssClass?: string; - - /** Triggers whenever any of the Recurrence Editor's value is changed. */ - change?(e: ChangeEventArgs): void; -} - -export interface ChangeEventArgs { - - /** When set to true, event gets canceled. - */ - cancel?: boolean; - - /** Returns the Recurrence Editor model - */ - model?: ej.RecurrenceEditor.Model; - - /** Returns the name of the event - */ - type?: string; - - /** Returns the recurrence rule value. - */ - recurrenceRule?: string; -} -} - -class Gantt extends ej.Widget { - static fn: Gantt; - constructor(element: JQuery | Element, options?: Gantt.Model); - static Locale: any; - model: Gantt.Model; - defaults: Gantt.Model; - - /** To add a new item in Gantt - * @param {any} Item to add in Gantt row. - * @param {string} Defines in which position the row wants to add - * @returns {void} - */ - addRecord(data: any, rowPosition: string): void; - - /** To select cell based on the cell and row index dynamically. - * @param {Array} array of cell indexes to be select - * @param {boolean} Defines that we need to preserve the previously selected cells of not - * @returns {void} - */ - selectCells(Indexes: any[], preservePreviousSelectedCell: boolean): void; - - /** Positions the splitter by the specified column index. - * @param {number} Set the splitter position based on column index. - * @returns {void} - */ - setSplitterIndex(index: number): void; - - /** To cancel the edited state of an item in Gantt - * @returns {void} - */ - cancelEdit(): void; - - /** To collapse all the parent items in Gantt - * @returns {void} - */ - collapseAllItems(): void; - - /** To delete a selected item in Gantt - * @returns {void} - */ - deleteItem(): void; - - /** destroy the Gantt widget all events bound using this._on will be unbind automatically and bring the control to pre-init state. - * @returns {void} - */ - destroy(): void; - - /** To Expand all the parent items in Gantt - * @returns {void} - */ - expandAllItems(): void; - - /** To expand and collapse an item in Gantt using item's ID - * @param {number} Expand or Collapse a record based on task id. - * @returns {void} - */ - expandCollapseRecord(taskId: number): void; - - /** To hide the column by using header text - * @param {string} you can pass a header text of a column to hide - * @returns {void} - */ - hideColumn(headerText: string): void; - - /** To indent a selected item in Gantt - * @returns {void} - */ - indentItem(): void; - - /** To Open the dialog to add new task to the Gantt - * @returns {void} - */ - openAddDialog(): void; - - /** To Open the dialog to edit existing task to the Gantt - * @returns {void} - */ - openEditDialog(): void; - - /** To outdent a selected item in Gantt - * @returns {void} - */ - outdentItem(): void; - - /** To save the edited state of an item in Gantt - * @returns {void} - */ - saveEdit(): void; - - /** To search an item with search string provided at the run time - * @param {string} you can pass a text to search in Gantt Control. - * @returns {void} - */ - searchItem(searchString: string): void; - - /** To set the grid width in Gantt - * @param {string} you can give either percentage or pixels value - * @returns {void} - */ - setSplitterPosition(width: string): void; - - /** To show the column by using header text - * @param {string} you can pass a header text of a column to show - * @returns {void} - */ - showColumn(headerText: string): void; -} -export namespace Gantt { - -export interface Model { - - /** Specifies the fields to be included in the add dialog in Gantt - * @Default {[]} - */ - addDialogFields?: any[]; - - /** Enables or disables the ability to resize column. - * @Default {false} - */ - allowColumnResize?: boolean; - - /** Enables or Disables Gantt chart editing in Gantt - * @Default {true} - */ - allowGanttChartEditing?: boolean; - - /** Enables or Disables Keyboard navigation in Gantt - * @Default {true} - */ - allowKeyboardNavigation?: boolean; - - /** Specifies enabling or disabling multiple sorting for Gantt columns - * @Default {false} - */ - allowMultiSorting?: boolean; - - /** Enables or disables the option for multiple exporting - * @Default {false} - */ - allowMultipleExporting?: boolean; - - /** Enables or disables the interactive selection of a row. - * @Default {true} - */ - allowSelection?: boolean; - - /** Enables or disables sorting. When enabled, we can sort the column by clicking on the column. - * @Default {false} - */ - allowSorting?: boolean; - - /** Enables or disables the ability to drag and drop the row interactively to reorder the rows - * @Default {false} - */ - allowDragAndDrop?: boolean; - - /** Enable or disable predecessor validation. When it is true, all the task's start and end dates are aligned based on its predecessors start and end dates. - * @Default {true} - */ - enablePredecessorValidation?: boolean; - - /** Specifies the baseline background color in Gantt - * @Default {#fba41c} - */ - baselineColor?: string; - - /** Specifies the mapping property path for baseline end date in datasource - */ - baselineEndDateMapping?: string; - - /** Specifies the mapping property path for baseline start date of a task in datasource - */ - baselineStartDateMapping?: string; - - /** Specifies the mapping property path for sub tasks in datasource - */ - childMapping?: string; - - /** To Specify the column fields to be displayed in the dialog while inserting a column using column menu. - * @Default {[]} - */ - columnDialogFields?: any[]; - - /** Specifies the background of connector lines in Gantt - */ - connectorLineBackground?: string; - - /** Specifies the width of the connector lines in Gantt - * @Default {1} - */ - connectorlineWidth?: number; - - /** Specify the CSS class for Gantt to achieve custom theme. - */ - cssClass?: string; - - /** Specifies the template for cell tooltip - * @Default {null} - */ - cellTooltipTemplate?: string; - - /** Option for customizing the drag tooltip while reordering the rows. - */ - dragTooltip?: DragTooltip; - - /** Collection of data or hierarchical data to represent in Gantt - * @Default {null} - */ - dataSource?: any[]; - - /** Specifies the dateFormat for Gantt , given format is displayed in tooltip , Grid . - * @Default {MM/dd/yyyy} - */ - dateFormat?: string; - - /** Specifies the mapping property path for duration of a task in datasource - */ - durationMapping?: string; - - /** Specifies the duration unit for each tasks whether days or hours or minutes - * @Default {ej.Gantt.DurationUnit.Day} - */ - durationUnit?: ej.Gantt.DurationUnit|string; - - /** Specifies the fields to be included in the edit dialog in Gantt - * @Default {[]} - */ - editDialogFields?: any[]; - - /** Enables or disables the responsiveness of Gantt - * @Default {false} - */ - isResponsive?: boolean; - - /** Option to configure the splitter position. - */ - splitterSettings?: SplitterSettings; - - /** Specifies the editSettings options in Gantt. - */ - editSettings?: EditSettings; - - /** Enables or Disables enableAltRow row effect in Gantt - * @Default {true} - */ - enableAltRow?: boolean; - - /** Enables/disables work breakdown structure column. - * @Default {false} - */ - enableWBS?: boolean; - - /** Enables/disables WBS predecessor column. - * @Default {false} - */ - enableWBSPredecessor?: boolean; - - /** Enables or disables the collapse all records when loading the Gantt. - * @Default {false} - */ - enableCollapseAll?: boolean; - - /** Specifies the data source field name to be displayed as left task label - */ - leftTaskLabelMapping?: string; - - /** Specifies the data source field name to be displayed as right task label - */ - rightTaskLabelMapping?: string; - - /** Specifies the template for left task label - */ - leftTaskLabelTemplate?: string; - - /** Specifies the template for right task label - */ - rightTaskLabelTemplate?: string; - - /** Enables or disables the contextmenu for Gantt , when enabled contextmenu appears on right clicking Gantt - * @Default {false} - */ - enableContextMenu?: boolean; - - /** Indicates whether we can edit the progress of a task interactively in Gantt. - * @Default {true} - */ - enableProgressBarResizing?: boolean; - - /** Enables or disables the option for dynamically updating the Gantt size on window resizing - * @Default {false} - */ - enableResize?: boolean; - - /** Enables or disables tooltip while editing (dragging/resizing) the taskbar. - * @Default {true} - */ - enableTaskbarDragTooltip?: boolean; - - /** Enables or disables tooltip for taskbar. - * @Default {true} - */ - enableTaskbarTooltip?: boolean; - - /** Enables/Disables virtualization for rendering Gantt items. - * @Default {false} - */ - enableVirtualization?: boolean; - - /** Specifies the mapping property path for end Date of a task in datasource - */ - endDateMapping?: string; - - /** Specifies whether to highlight the weekends in Gantt . - * @Default {true} - */ - highlightWeekends?: boolean; - - /** Collection of holidays with date, background and label information to be displayed in Gantt. - * @Default {[]} - */ - holidays?: any[]; - - /** Specifies whether to include weekends while calculating the duration of a task. - * @Default {true} - */ - includeWeekend?: boolean; - - /** Specify the locale for Gantt - * @Default {en-US} - */ - locale?: string; - - /** Specifies the mapping property path for milestone in datasource - */ - milestoneMapping?: string; - - /** Enables/disables the options for inserting , deleting and renaming columns. - * @Default {false} - */ - showColumnOptions?: boolean; - - /** Specifies the template for parent taskbar - */ - parentTaskbarTemplate?: string; - - /** Specifies the nature of a task for calculating the work, and it can fixed duration, fixed work and fixed resource unit - * @Default {ej.Gantt.TaskType.FixedUnit} - */ - taskType?: ej.Gantt.TaskType|string; - - /** Specifies the unit for the work involved in a task and it can be day, hour or minute - * @Default {ej.Gantt.WorkUnit.Hour} - */ - workUnit?: ej.Gantt.WorkUnit|string; - - /** Specifies the task scheduling mode for a project and this will be set to all the tasks available in the project - * @Default {ej.Gantt.TaskSchedulingMode.Auto} - */ - taskSchedulingMode?: ej.Gantt.TaskSchedulingMode|string; - - /** Specifies the row selection type. - * @Default {ej.Gantt.SelectionType.Single} - */ - selectionType?: ej.Gantt.SelectionType|string; - - /** Specifies the background of parent progressbar in Gantt - */ - parentProgressbarBackground?: string; - - /** Specifies the mapping property path for resource's percent effort involved in a task in datasource - */ - resourceUnitMapping?: string; - - /** Specifies the mapping property path for the task description in datasource - */ - notesMapping?: string; - - /** Specifies the mapping property path for the task scheduling mode for a task in datasource - * @Default {auto} - */ - taskSchedulingModeMapping?: string; - - /** Specifies the mapping property path for task duration unit in datasource - */ - durationUnitMapping?: string; - - /** Specifies the background of parent taskbar in Gantt - */ - parentTaskbarBackground?: string; - - /** Specifies the mapping property path for parent task Id in self reference datasource - */ - parentTaskIdMapping?: string; - - /** Specifies the mapping property path for predecessors of a task in datasource - */ - predecessorMapping?: string; - - /** Specifies the background of progressbar in Gantt - */ - progressbarBackground?: string; - - /** Specified the height of the progressbar in taskbar - * @Default {100} - */ - progressbarHeight?: number; - - /** Specifies the template for tooltip on resizing progressbar - * @Default {null} - */ - progressbarTooltipTemplate?: string; - - /** Specifies the template ID for customized tooltip for progressbar editing in Gantt - * @Default {null} - */ - progressbarTooltipTemplateId?: string; - - /** Specifies the mapping property path for progress percentage of a task in datasource - */ - progressMapping?: string; - - /** It receives query to retrieve data from the table (query is same as SQL). - * @Default {null} - */ - query?: any; - - /** Enables or Disables rendering baselines in Gantt , when enabled baseline is rendered in Gantt - * @Default {false} - */ - renderBaseline?: boolean; - - /** Enables or disables the schedule date validation while connecting a manually scheduled task with predecessor - * @Default {false} - */ - validateManualTasksOnLinking?: boolean; - - /** Specifies the mapping property name for resource ID in resource Collection in Gantt - */ - resourceIdMapping?: string; - - /** Specifies the mapping property path for resources of a task in datasource - */ - resourceInfoMapping?: string; - - /** Specifies the mapping property path for resource name of a task in Gantt - */ - resourceNameMapping?: string; - - /** Collection of data regarding resources involved in entire project - * @Default {[]} - */ - resources?: any[]; - - /** Specifies whether rounding off the day working time edits - * @Default {true} - */ - roundOffDayworkingTime?: boolean; - - /** Specifies the height of a single row in Gantt. Also, we need to set same height in the CSS style with class name e-rowcell. - * @Default {30} - */ - rowHeight?: number; - - /** Specifies end date of the Gantt schedule. By default, end date will be rounded to its next Saturday. - * @Default {null} - */ - scheduleEndDate?: string; - - /** Specifies the options for customizing schedule header. - */ - scheduleHeaderSettings?: ScheduleHeaderSettings; - - /** Specifies start date of the Gantt schedule. By default, start date will be rounded to its previous Sunday. - * @Default {null} - */ - scheduleStartDate?: string; - - /** Specifies the selected row Index in Gantt , the row with given index will highlighted - * @Default {-1} - */ - selectedRowIndex?: number; - - /** Enables or disables the column chooser. - * @Default {false} - */ - showColumnChooser?: boolean; - - /** Specifies the template for cell tooltip - * @Default {true} - */ - showGridCellTooltip?: boolean; - - /** Specifies whether to show grid cell tooltip over expander cell alone. - * @Default {true} - */ - showGridExpandCellTooltip?: boolean; - - /** Specifies whether display task progress inside taskbar. - * @Default {true} - */ - showProgressStatus?: boolean; - - /** Specifies whether to display resource names for a task beside taskbar. - * @Default {true} - */ - showResourceNames?: boolean; - - /** Specifies whether to display task name beside task bar. - * @Default {true} - */ - showTaskNames?: boolean; - - /** Specifies the size option of Gantt control. - */ - sizeSettings?: SizeSettings; - - /** Specifies the selected cell information on rendering Gantt. - */ - selectedCellIndexes?: SelectedCellIndex[]; - - /** Specifies the sorting options for Gantt. - */ - sortSettings?: SortSettings; - - /** Specifies splitter position in Gantt. - * @Default {null} - */ - splitterPosition?: string; - - /** Specifies the mapping property path for start date of a task in datasource - */ - startDateMapping?: string; - - /** Specifies the options for striplines - * @Default {[]} - */ - stripLines?: any[]; - - /** Specifies the background of the taskbar in Gantt - */ - taskbarBackground?: string; - - /** Specifies the template script for customized tooltip for taskbar editing in Gantt - */ - taskbarEditingTooltipTemplate?: string; - - /** Specifies the template Id for customized tooltip for taskbar editing in Gantt - */ - taskbarEditingTooltipTemplateId?: string; - - /** Specifies the template for tooltip on mouse action on taskbars - */ - taskbarTooltipTemplate?: string; - - /** To Specify the JsRender script Id to customize the task bar with our preference - */ - taskbarTemplate?: string; - - /** To Specify the JsRender script Id to customize the mile stone with our preference - */ - milestoneTemplate?: string; - - /** Enables or disables Gantt to read-only mode - * @Default {false} - */ - readOnly?: boolean; - - /** Specifies the template id for tooltip on mouse action on taskbars - */ - taskbarTooltipTemplateId?: string; - - /** Specifies the mapping property path for task Id in datasource - */ - taskIdMapping?: string; - - /** Specifies the mapping property path for task name in datasource - */ - taskNameMapping?: string; - - /** Specifies the toolbarSettings options. - */ - toolbarSettings?: ToolbarSettings; - - /** Specifies the tree expander column in Gantt - * @Default {0} - */ - treeColumnIndex?: number; - - /** Specifies the type of selection whether to select row or cell. - * @Default {ej.Gantt.SelectionMode.Row} - */ - selectionMode?: ej.Gantt.SelectionMode|string; - - /** Specifies the weekendBackground color in Gantt - * @Default {#F2F2F2} - */ - weekendBackground?: string; - - /** Specifies the working time schedule of day - * @Default {ej.Gantt.workingTimeScale.TimeScale8Hours} - */ - workingTimeScale?: ej.Gantt.workingTimeScale|string; - - /** Triggered for every Gantt action before its starts. */ - actionBegin?(e: ActionBeginEventArgs): void; - - /** Triggered for every Gantt action success event. */ - actionComplete?(e: ActionCompleteEventArgs): void; - - /** Triggered while enter the edit mode in the TreeGrid cell */ - beginEdit?(e: BeginEditEventArgs): void; - - /** Triggered before selecting a cell */ - cellSelecting?(e: CellSelectingEventArgs): void; - - /** Triggered after selected a cell */ - cellSelected?(e: CellSelectedEventArgs): void; - - /** Triggered while dragging a row in Gantt control */ - rowDrag?(e: RowDragEventArgs): void; - - /** Triggered while start to drag row in Gantt control */ - rowDragStart?(e: RowDragStartEventArgs): void; - - /** Triggered while drop a row in Gantt control */ - rowDragStop?(e: RowDragStopEventArgs): void; - - /** Triggered after collapsed the Gantt record */ - collapsed?(e: CollapsedEventArgs): void; - - /** Triggered while collapsing the Gantt record */ - collapsing?(e: CollapsingEventArgs): void; - - /** Triggered while Context Menu is rendered in Gantt control */ - contextMenuOpen?(e: ContextMenuOpenEventArgs): void; - - /** Triggered when Gantt is rendered completely. */ - create?(e: CreateEventArgs): void; - - /** Triggered after save the modified cellValue in Gantt. */ - endEdit?(e: EndEditEventArgs): void; - - /** Triggered after expand the record */ - expanded?(e: ExpandedEventArgs): void; - - /** Triggered while expanding the Gantt record */ - expanding?(e: ExpandingEventArgs): void; - - /** Triggered while Gantt is loaded */ - load?(e: LoadEventArgs): void; - - /** Triggered while rendering each cell in the TreeGrid */ - queryCellInfo?(e: QueryCellInfoEventArgs): void; - - /** Triggered while rendering each taskbar in the Gantt */ - queryTaskbarInfo?(e: QueryTaskbarInfoEventArgs): void; - - /** Triggered while rendering each row */ - rowDataBound?(e: RowDataBoundEventArgs): void; - - /** Triggered after the row is selected. */ - rowSelected?(e: RowSelectedEventArgs): void; - - /** Triggered before the row is going to be selected. */ - rowSelecting?(e: RowSelectingEventArgs): void; - - /** Triggered after completing the editing operation in taskbar */ - taskbarEdited?(e: TaskbarEditedEventArgs): void; - - /** Triggered while editing the Gantt chart (dragging, resizing the taskbar ) */ - taskbarEditing?(e: TaskbarEditingEventArgs): void; - - /** Triggered when taskbar item is clicked in Gantt. */ - taskbarClick?(e: TaskbarClickEventArgs): void; - - /** Triggered when toolbar item is clicked in Gantt. */ - toolbarClick?(e: ToolbarClickEventArgs): void; -} - -export interface ActionBeginEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the grid model. - */ - model?: any; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the current grouped column field name. - */ - columnName?: string; - - /** Returns request type. - */ - requestType?: string; - - /** Returns the direction of sorting ascending or descending - */ - columnSortDirection?: string; - - /** Returns the value of searching element. - */ - keyValue?: string; - - /** Returns the data of deleting element. - */ - data?: string; - - /** Returns selected record index - */ - recordIndex?: number; -} - -export interface ActionCompleteEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the grid model. - */ - model?: any; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the current grouped column field name. - */ - columnName?: string; - - /** Returns request type. - */ - requestType?: string; - - /** Returns the direction of sorting ascending or descending - */ - columnSortDirection?: string; - - /** Returns the value of searched element. - */ - keyValue?: string; - - /** Returns the data of deleted element. - */ - data?: string; - - /** Returns selected record index - */ - recordIndex?: number; -} - -export interface BeginEditEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the row element of editing cell. - */ - rowElement?: any; - - /** Returns the Element of editing cell. - */ - cellElement?: any; - - /** Returns the data of current cell record. - */ - data?: any; - - /** Returns the column Index of cell belongs. - */ - columnIndex?: number; -} - -export interface CellSelectingEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the cell index on the selection. - */ - cellIndex?: number; - - /** Returns the row index on the selection - */ - rowIndex?: number; - - /** Returns the selecting cell element - */ - targetCell?: any; - - /** Returns the selecting row element - */ - targetRow?: any; - - /** Returns the selecting record object - */ - data?: any; - - /** Returns the Gantt object Model - */ - model?: any; -} - -export interface CellSelectedEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the cell index on the selection. - */ - cellIndex?: number; - - /** Returns the row index on the selection - */ - rowIndex?: number; - - /** Returns the selecting cell element - */ - targetCell?: any; - - /** Returns the selecting row element - */ - targetRow?: any; - - /** Returns the selecting record object - */ - data?: any; - - /** Returns the Gantt object Model - */ - model?: any; - - /** Returns the previously selected row data - */ - previousData?: any; - - /** Returns the previously selected cell index - */ - previousCellIndex?: any; - - /** Returns the previously selected row index - */ - previousRowIndex?: any; - - /** Returns the previously selected cell element - */ - previousTargetCell?: any; - - /** Returns the previously selected row element - */ - previousTargetRow?: any; -} - -export interface RowDragEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the row which we start to drag. - */ - draggedRow?: any; - - /** Returns the row index which we start to drag. - */ - draggedRowIndex?: number; - - /** Returns the row on which we are dragging. - */ - targetRow?: any; - - /** Returns the row index on which we are dragging. - */ - targetRowIndex?: number; - - /** Returns that we can drop over that record or not. - */ - canDrop?: boolean; - - /** Returns the Gantt model. - */ - model?: any; - - /** Returns request type. - */ - requestType?: string; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface RowDragStartEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the row which we start to drag. - */ - draggedRow?: any; - - /** Returns the row index which we start to drag. - */ - draggedRowIndex?: boolean; - - /** Returns the Gantt model. - */ - model?: any; - - /** Returns request type. - */ - requestType?: string; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface RowDragStopEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the row which we start to drag. - */ - draggedRow?: any; - - /** Returns the row index which we start to drag. - */ - draggedRowIndex?: number; - - /** Returns the row which we are dropped to row. - */ - targetRow?: any; - - /** Returns the row index which we are dropped to row. - */ - targetRowIndex?: number; - - /** Returns the Gantt model. - */ - model?: any; - - /** Returns request type. - */ - requestType?: string; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface CollapsedEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the row index of collapsed record. - */ - recordIndex?: number; - - /** Returns the data of collapsed record. - */ - data?: any; - - /** Returns Request Type. - */ - requestType?: string; - - /** Returns state of a record whether it is in expanded or collapsed state. - */ - expanded?: boolean; -} - -export interface CollapsingEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the row index of collapsing record. - */ - recordIndex?: number; - - /** Returns the data of edited cell record.. - */ - data?: any; - - /** Returns state of a record whether it is in expanded or collapsed state. - */ - expanded?: boolean; -} - -export interface ContextMenuOpenEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the default context menu items to which we add custom items. - */ - contextMenuItems?: any[]; - - /** Returns the Gantt model. - */ - model?: any; - - /** Returns request type. - */ - requestType?: string; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface CreateEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the Gantt model - */ - model?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface EndEditEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the row element of editing cell. - */ - rowElement?: any; - - /** Returns the Element of editing cell. - */ - cellElement?: any; - - /** Returns the data of edited cell record. - */ - data?: any; - - /** Returns the column name of edited cell belongs. - */ - columnName?: string; - - /** Returns the column object of edited cell belongs. - */ - columnObject?: any; -} - -export interface ExpandedEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the row index of record. - */ - recordIndex?: number; - - /** Returns the data of expanded record. - */ - data?: any; - - /** Returns Request Type. - */ - requestType?: string; - - /** Returns state of a record whether it is in expanded or collapsed state. - */ - expanded?: boolean; -} - -export interface ExpandingEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the row index of record. - */ - recordIndex?: any; - - /** Returns the data of edited cell record.. - */ - data?: any; - - /** Returns state of a record whether it is in expanded or collapsed state. - */ - expanded?: boolean; -} - -export interface LoadEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the Gantt model - */ - model?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface QueryCellInfoEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the selecting cell element. - */ - cellElement?: any; - - /** Returns the value of cell. - */ - cellValue?: string; - - /** Returns the data of current cell record. - */ - data?: any; - - /** Returns the column of cell belongs. - */ - column?: any; -} - -export interface QueryTaskbarInfoEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the taskbar background of current item. - */ - TaskbarBackground?: string; - - /** Returns the progressbar background of current item. - */ - ProgressbarBackground?: string; - - /** Returns the parent taskbar background of current item. - */ - parentTaskbarBackground?: string; - - /** Returns the parent progressbar background of current item. - */ - parentProgressbarBackground?: string; - - /** Returns the data of the record. - */ - data?: any; -} - -export interface RowDataBoundEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the row element of rendering row. - */ - rowElement?: any; - - /** Returns the data of rendering row record.. - */ - data?: any; -} - -export interface RowSelectedEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the selecting row element. - */ - targetRow?: any; - - /** Returns the index of selecting row record. - */ - recordIndex?: number; - - /** Returns the data of selected record. - */ - data?: any; -} - -export interface RowSelectingEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the data selecting record. - */ - data?: any; - - /** Returns the index of selecting row record. - */ - recordIndex?: string; - - /** Returns the selecting row chart element. - */ - targetChartRow?: any; - - /** Returns the selecting row grid element. - */ - targetGridRow?: any; - - /** Returns the previous selected data. - */ - previousData?: any; - - /** Returns the previous selected row index. - */ - previousIndex?: string; - - /** Returns the previous selected row chart element. - */ - previousChartRow?: any; - - /** Returns the previous selected row grid element. - */ - previousGridRow?: any; -} - -export interface TaskbarEditedEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the data of edited record. - */ - data?: any; - - /** Returns the previous data value of edited record. - */ - previousData?: any; - - /** Returns 'true' if taskbar is dragged. - */ - dragging?: boolean; - - /** Returns 'true' if taskbar is left resized. - */ - leftResizing?: boolean; - - /** Returns 'true' if taskbar is right resized. - */ - rightResizing?: boolean; - - /** Returns 'true' if taskbar is progress resized. - */ - progressResizing?: boolean; - - /** Returns the field values of record being edited. - */ - editingFields?: any; - - /** Returns the Gantt model. - */ - model?: any; -} - -export interface TaskbarEditingEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the Gantt model. - */ - model?: any; - - /** Returns the row object being edited. - */ - rowData?: any; - - /** Returns the field values of record being edited. - */ - editingFields?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface TaskbarClickEventArgs { - - /** Returns currently clicked row data - */ - data?: any; - - /** Returns the current item index. - */ - index?: number; - - /** Returns the Gantt model. - */ - model?: any; - - /** Returns the clicked row element - */ - taskbarElement?: any; - - /** Returns the target element. - */ - target?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface ToolbarClickEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the current item. - */ - currentTarget?: any; - - /** Returns the Gantt model. - */ - model?: any; - - /** Returns the name of the toolbar item on which mouse click has been performed - */ - itemName?: string; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface DragTooltip { - - /** Specifies option to enable/disable tooltip while drag and drop a row. - * @Default {true} - */ - showTooltip?: boolean; - - /** Specifies the data source fields to be displayed in the drag tooltip. - * @Default {[]} - */ - tooltipItems?: any[]; - - /** Specifies the custom template for drag tooltip. - * @Default {null} - */ - tooltipTemplate?: string; -} - -export interface SplitterSettings { - - /** Specifies position of the splitter in Gantt , splitter can be placed either based on percentage values or pixel values. - */ - position?: string; - - /** Specifies the position of splitter in Gantt, based on column index in Gantt. - */ - index?: string; -} - -export interface EditSettings { - - /** Enables or disables add record icon in Gantt toolbar - * @Default {false} - */ - allowAdding?: boolean; - - /** Enables or disables delete icon in Gantt toolbar - * @Default {false} - */ - allowDeleting?: boolean; - - /** Specifies the option for enabling or disabling editing in Gantt grid part - * @Default {false} - */ - allowEditing?: boolean; - - /** Specifies the option for enabling or disabling indent action in Gantt. - * @Default {false} - */ - allowIndent?: boolean; - - /** Specifies the option for enabling or disabling outdent action in Gantt - * @Default {false} - */ - allowOutdent?: boolean; - - /** Specifies the mouse action whether single click or double click to begin the editing - * @Default {ej.Gantt.BeginEditAction.DblClick} - */ - beginEditAction?: ej.Gantt.BeginEditAction|string; - - /** Specifies the edit mode in Gantt, "normal" is for dialog editing ,"cellEditing" is for cell type editing - * @Default {normal} - */ - editMode?: string; -} - -export interface ScheduleHeaderSettings { - - /** Specified the format for day view in schedule header - * @Default {ddd} - */ - dayHeaderFormat?: string; - - /** Specified the format for Hour view in schedule header - * @Default {HH} - */ - hourHeaderFormat?: string; - - /** Specifies the number of minutes per interval - * @Default {ej.Gantt.minutesPerInterval.Auto} - */ - minutesPerInterval?: ej.Gantt.minutesPerInterval|string; - - /** Specified the format for month view in schedule header - * @Default {MMM} - */ - monthHeaderFormat?: string; - - /** Specifies the schedule mode - * @Default {ej.Gantt.ScheduleHeaderType.Week} - */ - scheduleHeaderType?: ej.Gantt.ScheduleHeaderType|string; - - /** Specifies the round-off mode for the start date in schedule header. - * @Default {ej.Gantt.TimescaleRoundMode.Auto} - */ - timescaleStartDateMode?: ej.Gantt.TimescaleRoundMode|string; - - /** Specified the background for weekends in Gantt - * @Default {#F2F2F2} - */ - weekendBackground?: string; - - /** Specified the format for week view in schedule header - * @Default {ddd} - */ - weekHeaderFormat?: string; - - /** Specified the format for year view in schedule header - * @Default {yyyy} - */ - yearHeaderFormat?: string; - - /** Specifies the size of the lowest time unit along the timescale, with minimum value as "50%" and maximum value as "500%". It is also possble to set the value in pixels. - * @Default {100%} - */ - timscaleUnitSize?: string; - - /** Specifies the start day of the week in week timescale mode - * @Default {0} - */ - weekStartDay?: number; -} - -export interface SizeSettings { - - /** Specifies the height of Gantt control - * @Default {450px} - */ - height?: string; - - /** Specifies the width of Gantt control - * @Default {1000px} - */ - width?: string; -} - -export interface SelectedCellIndex { - - /** Specifies the row index of the cell to be selected Gantt control - */ - rowIndex?: number; - - /** Specifies the cell index to be selected in the row. - * @Default { } - */ - cellIndex?: number; -} - -export interface SortSettings { - - /** Specifies the sorted columns for Gantt - * @Default {[]} - */ - sortedColumns?: any[]; -} - -export interface ToolbarSettings { - - /** Specifies the state of enabling or disabling toolbar - * @Default {true} - */ - showToolbar?: boolean; - - /** Specifies the list of toolbar items to be rendered in Gantt toolbar - * @Default {[]} - */ - toolbarItems?: any[]; -} - -enum DurationUnit { - - ///Sets the Duration Unit as day. - Day, - - ///Sets the Duration Unit as hour. - Hour, - - ///Sets the Duration Unit as minute. - Minute -} - - -enum BeginEditAction { - - ///you can begin the editing at double click - DblClick, - - ///you can begin the editing at single click - Click -} - - -enum TaskType { - - ///Resource unit remains constant while editing the work and duration values. - FixedUnit, - - ///Work value of a task remains constant while editing duration and resource unit values. - FixedWork, - - ///Duration value remains constant while editing work and resource unit values. - FixedDuration -} - - -enum WorkUnit { - - ///Displays the work involved in a task in days. - Day, - - ///Displays the work involved in a task in hours. - Hour, - - ///Displays the work involved in a task in minutes - Minute -} - - -enum TaskSchedulingMode { - - ///All the tasks in the project will be displayed in auto scheduled mode, where the tasks are scheduled automatically over non-working days and holidays. - Auto, - - ///All the tasks in the project will be displayed in manually scheduled mode. - Manual, - - ///Project consists of tasks with both auto and manually scheduled modes, based on the datasource values - Custom -} - - -enum SelectionType { - - ///you can select a single row. - Single, - - ///you can select a multiple row. - Multiple -} - - -enum minutesPerInterval { - - ///Sets the interval automatically according with schedule start and end date. - Auto, - - ///Sets one minute intervals per hour. - OneMinute, - - ///Sets Five minute intervals per hour. - FiveMinutes, - - ///Sets fifteen minute intervals per hour. - FifteenMinutes, - - ///Sets thirty minute intervals per hour. - ThirtyMinutes -} - - -enum ScheduleHeaderType { - - ///Sets year Schedule Mode. - Year, - - ///Sets month Schedule Mode. - Month, - - ///Sets week Schedule Mode. - Week, - - ///Sets day Schedule Mode. - Day, - - ///Sets hour Schedule Mode. - Hour -} - - -enum TimescaleRoundMode { - - ///The round-off value will be automatically calculated based on the data source values. - Auto, - - ///Schedule header start date will round-off to the immediate week. - Week, - - ///Schedule headers start date will round off to the immediate month - Month, - - ///Schedule headers start date will round off to the immediate year - Year -} - - -enum SelectionMode { - - ///you can select a row. - Row, - - ///you can select a cell. - Cell -} - - -enum workingTimeScale { - - ///Sets eight hour timescale. - TimeScale8Hours, - - ///Sets twenty four hour timescale. - TimeScale24Hours -} - -} - -class ReportViewer extends ej.Widget { - static fn: ReportViewer; - constructor(element: JQuery | Element, options?: ReportViewer.Model); - static Locale: any; - model: ReportViewer.Model; - defaults: ReportViewer.Model; - - /** Export the report to the specified format. - * @returns {void} - */ - exportReport(): void; - - /** Fit the report page to the container. - * @returns {void} - */ - fitToPage(): void; - - /** Fit the report page height to the container. - * @returns {void} - */ - fitToPageHeight(): void; - - /** Fit the report page width to the container. - * @returns {void} - */ - fitToPageWidth(): void; - - /** Get the available datasets name of the rdlc report. - * @returns {void} - */ - getDataSetNames(): void; - - /** Get the available parameters of the report. - * @returns {void} - */ - getParameters(): void; - - /** Navigate to first page of report. - * @returns {void} - */ - gotoFirstPage(): void; - - /** Navigate to last page of the report. - * @returns {void} - */ - gotoLastPage(): void; - - /** Navigate to next page from the current page. - * @returns {void} - */ - gotoNextPage(): void; - - /** Go to specific page index of the report. - * @returns {void} - */ - gotoPageIndex(): void; - - /** Navigate to previous page from the current page. - * @returns {void} - */ - gotoPreviousPage(): void; - - /** Print the report. - * @returns {void} - */ - print(): void; - - /** Apply print layout to the report. - * @returns {void} - */ - printLayout(): void; - - /** Refresh the report. - * @returns {void} - */ - refresh(): void; -} -export namespace ReportViewer { - -export interface Model { - - /** Gets or sets the list of data sources for the RDLC report. - * @Default {[]} - */ - dataSources?: DataSource[]; - - /** Enables or disables the page cache of report. - * @Default {false} - */ - enablePageCache?: boolean; - - /** Specifies the export settings. - */ - exportSettings?: ExportSettings; - - /** When set to true, adapts the report layout to fit the screen size of devices on which it renders. - * @Default {true} - */ - isResponsive?: boolean; - - /** Specifies the locale for report viewer. - * @Default {en-US} - */ - locale?: string; - - /** Specifies the page settings. - */ - pageSettings?: PageSettings; - - /** Gets or sets the list of parameters associated with the report. - * @Default {[]} - */ - parameters?: Parameter[]; - - /** Enables and disables the print mode. - * @Default {false} - */ - printMode?: boolean; - - /** Specifies the print option of the report. - * @Default {ej.ReportViewer.PrintOptions.Default} - */ - printOptions?: ej.ReportViewer.PrintOptions|string; - - /** Specifies the processing mode of the report. - * @Default {ej.ReportViewer.ProcessingMode.Remote} - */ - processingMode?: ej.ReportViewer.ProcessingMode|string; - - /** Specifies the render layout. - * @Default {ej.ReportViewer.RenderMode.Default} - */ - renderMode?: ej.ReportViewer.RenderMode|string; - - /** Gets or sets the path of the report file. - * @Default {empty} - */ - reportPath?: string; - - /** Gets or sets the reports server URL. - * @Default {empty} - */ - reportServerUrl?: string; - - /** Specifies the report Web API service URL. - * @Default {empty} - */ - reportServiceUrl?: string; - - /** Specifies the toolbar settings. - */ - toolbarSettings?: ToolbarSettings; - - /** Gets or sets the zoom factor for report viewer. - * @Default {1} - */ - zoomFactor?: number; - - /** Fires when the report viewer is destroyed successfully.If you want to perform any operation after destroying the reportviewer control,you can make use of the destroy event. */ - destroy?(e: DestroyEventArgs): void; - - /** Fires during drill through action done in report.If you want to perform any operation when a drill through action is performed, you can make use of the drillThrough event. */ - drillThrough?(e: DrillThroughEventArgs): void; - - /** Fires before report rendering is completed.If you want to perform any operation before the rendering of report,you can make use of the renderingBegin event. */ - renderingBegin?(e: RenderingBeginEventArgs): void; - - /** Fires after report rendering completed.If you want to perform any operation after the rendering of report,you can make use of this renderingComplete event. */ - renderingComplete?(e: RenderingCompleteEventArgs): void; - - /** Fires when any error occurred while rendering the report.If you want to perform any operation when an error occurs in the report, you can make use of the reportError event. */ - reportError?(e: ReportErrorEventArgs): void; - - /** Fires when the report is being exported.If you want to perform any operation before exporting of report, you can make use of the reportExport event. */ - reportExport?(e: ReportExportEventArgs): void; - - /** Fires when the report is loaded.If you want to perform any operation after the successful loading of report, you can make use of the reportLoaded event. */ - reportLoaded?(e: ReportLoadedEventArgs): void; - - /** Fires when click the View Report Button. */ - viewReportClick?(e: ViewReportClickEventArgs): void; -} - -export interface DestroyEventArgs { - - /** true if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the report model. - */ - model?: any; - - /** returns the name of the event. - */ - type?: string; -} - -export interface DrillThroughEventArgs { - - /** true if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the actionInfo's parameters bookmarkLink, hyperLink, reportName, parameters. - */ - actionInfo?: any; - - /** returns the report model. - */ - model?: any; - - /** returns the name of the event. - */ - type?: string; -} - -export interface RenderingBeginEventArgs { - - /** true if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the report model. - */ - model?: any; - - /** returns the name of the event. - */ - type?: string; -} - -export interface RenderingCompleteEventArgs { - - /** true if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the report model. - */ - model?: any; - - /** returns the name of the event. - */ - type?: string; - - /** returns the collection of parameters. - */ - reportParameters?: any; -} - -export interface ReportErrorEventArgs { - - /** true if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the error details. - */ - error?: string; - - /** returns the report model. - */ - model?: any; - - /** returns the name of the event. - */ - type?: string; -} - -export interface ReportExportEventArgs { - - /** true if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the report model. - */ - model?: any; - - /** returns the name of the event. - */ - type?: string; -} - -export interface ReportLoadedEventArgs { - - /** true if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the report model. - */ - model?: any; - - /** returns the name of the event. - */ - type?: string; -} - -export interface ViewReportClickEventArgs { - - /** true if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the parameter collection. - */ - parameters?: any; - - /** returns the report model. - */ - model?: any; - - /** returns the name of the event. - */ - type?: string; -} - -export interface DataSource { - - /** Gets or sets the name of the data source. - * @Default {empty} - */ - name?: string; - - /** Gets or sets the values of data source. - * @Default {[]} - */ - values?: any[]; -} - -export interface ExportSettings { - - /** Specifies the export formats. - * @Default {ej.ReportViewer.ExportOptions.All} - */ - exportOptions?: ej.ReportViewer.ExportOptions|string; - - /** Specifies the excel export format. - * @Default {ej.ReportViewer.ExcelFormats.Excel97to2003} - */ - excelFormat?: ej.ReportViewer.ExcelFormats|string; - - /** Specifies the word export format. - * @Default {ej.ReportViewer.WordFormats.Doc} - */ - wordFormat?: ej.ReportViewer.WordFormats|string; -} - -export interface PageSettings { - - /** Specifies the print layout orientation. - * @Default {null} - */ - orientation?: ej.ReportViewer.Orientation|string; - - /** Specifies the paper size of print layout. - * @Default {null} - */ - paperSize?: ej.ReportViewer.PaperSize|string; -} - -export interface Parameter { - - /** Gets or sets the parameter labels. - * @Default {null} - */ - labels?: any[]; - - /** Gets or sets the name of the parameter. - * @Default {empty} - */ - name?: string; - - /** Gets or sets whether the parameter allows nullable value or not. - * @Default {false} - */ - nullable?: boolean; - - /** Gets or sets the prompt message associated with the specified parameter. - * @Default {empty} - */ - prompt?: string; - - /** Gets or sets the parameter values. - * @Default {[]} - */ - values?: any[]; -} - -export interface ToolbarSettings { - - /** Fires when user click on toolbar item in the toolbar. - * @Default {empty} - */ - click?: string; - - /** Specifies the toolbar items. - * @Default {ej.ReportViewer.ToolbarItems.All} - */ - items?: ej.ReportViewer.ToolbarItems|string; - - /** Shows or hides the toolbar. - * @Default {true} - */ - showToolbar?: boolean; - - /** Shows or hides the tooltip of toolbar items. - * @Default {true} - */ - showTooltip?: boolean; - - /** Specifies the toolbar template ID. - * @Default {empty} - */ - templateId?: string; -} - -enum ExportOptions { - - ///Specifies the All property in ExportOptions to get all available options. - All, - - ///Specifies the PDF property in ExportOptions to get PDF option. - PDF, - - ///Specifies the Word property in ExportOptions to get Word option. - Word, - - ///Specifies the Excel property in ExportOptions to get Excel option. - Excel, - - ///Specifies the HTML property in ExportOptions to get HTML option. - HTML -} - - -enum ExcelFormats { - - ///Specifies the Excel97to2003 property in ExcelFormats to get specified version of exported format. - Excel97to2003, - - ///Specifies the Excel2007 property in ExcelFormats to get specified version of exported format. - Excel2007, - - ///Specifies the Excel2010 property in ExcelFormats to get specified version of exported format. - Excel2010, - - ///Specifies the Excel2013 property in ExcelFormats to get specified version of exported format. - Excel2013 -} - - -enum WordFormats { - - ///Specifies the Doc property in WordFormats to get specified version of exported format. - Doc, - - ///Specifies the Dot property in WordFormats to get specified version of exported format. - Dot, - - ///Specifies the DOCX property in WordFormats to get specified version of exported format. - DOCX, - - ///Specifies the Word2007 property in WordFormats to get specified version of exported format. - Word2007, - - ///Specifies the Word2010 property in WordFormats to get specified version of exported format. - Word2010, - - ///Specifies the Word2013 property in WordFormats to get specified version of exported format. - Word2013, - - ///Specifies the Word2007Dotx property in WordFormats to get specified version of exported format. - Word2007Dotx, - - ///Specifies the Word2010Dotx property in WordFormats to get specified version of exported format. - Word2010Dotx, - - ///Specifies the Word2013Dotx property in WordFormats to get specified version of exported format. - Word2013Dotx, - - ///Specifies the Word2007Docm property in WordFormats to get specified version of exported format. - Word2007Docm, - - ///Specifies the Word2010Docm property in WordFormats to get specified version of exported format. - Word2010Docm, - - ///Specifies the Word2013Docm property in WordFormats to get specified version of exported format. - Word2013Docm, - - ///Specifies the Word2007Dotm property in WordFormats to get specified version of exported format. - Word2007Dotm, - - ///Specifies the Word2010Dotm property in WordFormats to get specified version of exported format. - Word2010Dotm, - - ///Specifies the Word2013Dotm property in WordFormats to get specified version of exported format. - Word2013Dotm, - - ///Specifies the RTF property in WordFormats to get specified version of exported format. - RTF, - - ///Specifies the Txt property in WordFormats to get specified version of exported format. - Txt, - - ///Specifies the EPUB property in WordFormats to get specified version of exported format. - EPUB, - - ///Specifies the HTML property in WordFormats to get specified version of exported format. - HTML, - - ///Specifies the XML property in WordFormats to get specified version of exported format. - XML, - - ///Specifies the Automatic property in WordFormats to get specified version of exported format. - Automatic -} - - -enum Orientation { - - ///Specifies the Landscape property in pageSettings.orientation to get specified layout. - Landscape, - - ///Specifies the portrait property in pageSettings.orientation to get specified layout. - Portrait -} - - -enum PaperSize { - - ///Specifies the A3 as value in pageSettings.paperSize to get specified size. - A3, - - ///Specifies the A4 as value in pageSettings.paperSize to get specified size. - Portrait, - - ///Specifies the B4(JIS) as value in pageSettings.paperSize to get specified size. - B4_JIS, - - ///Specifies the B5(JIS) as value in pageSettings.paperSize to get specified size. - B5_JIS, - - ///Specifies the Envelope #10 as value in pageSettings.paperSize to get specified size. - Envelope_10, - - ///Specifies the Envelope as value in pageSettings.paperSize to get specified size. - Envelope_Monarch, - - ///Specifies the Executive as value in pageSettings.paperSize to get specified size. - Executive, - - ///Specifies the Legal as value in pageSettings.paperSize to get specified size. - Legal, - - ///Specifies the Letter as value in pageSettings.paperSize to get specified size. - Letter, - - ///Specifies the Tabloid as value in pageSettings.paperSize to get specified size. - Tabloid, - - ///Specifies the Custom as value in pageSettings.paperSize to get specified size. - Custom -} - - -enum PrintOptions { - - ///Specifies the Default property in printOptions. - Default, - - ///Specifies the NewTab property in printOptions. - NewTab, - - ///Specifies the None property in printOptions. - None -} - - -enum ProcessingMode { - - ///Specifies the Remote property in processingMode. - Remote, - - ///Specifies the Local property in processingMode. - Local -} - - -enum RenderMode { - - ///Specifies the Default property in RenderMode to get default output. - Default, - - ///Specifies the Mobile property in RenderMode to get specified output. - Mobile, - - ///Specifies the Desktop property in RenderMode to get specified output. - Desktop -} - - -enum ToolbarItems { - - ///Specifies the Print as value in ToolbarItems to get specified item. - Print, - - ///Specifies the Refresh as value in ToolbarItems to get specified item. - Refresh, - - ///Specifies the Zoom as value in ToolbarItems to get specified item. - Zoom, - - ///Specifies the FittoPage as value in ToolbarItems to get specified item. - FittoPage, - - ///Specifies the Export as value in ToolbarItems to get specified item. - Export, - - ///Specifies the PageNavigation as value in ToolbarItems to get specified item. - PageNavigation, - - ///Specifies the Parameters as value in ToolbarItems to get specified item. - Parameters, - - ///Specifies the PrintLayout as value in ToolbarItems to get specified item. - PrintLayout, - - ///Specifies the PageSetup as value in ToolbarItems to get specified item. - PageSetup -} - -} - -class TreeGrid extends ej.Widget { - static fn: TreeGrid; - constructor(element: JQuery | Element, options?: TreeGrid.Model); - static Locale: any; - model: TreeGrid.Model; - defaults: TreeGrid.Model; - - /** Add a new row in TreeGrid, while allowAdding is set to true - * @param {any} Item to add in TreeGrid row. - * @param {string} Defines in which position the row wants to be added - * @returns {void} - */ - addRow(data: any, rowPosition: string): void; - - /** To clear all the selection in TreeGrid - * @param {number} you can pass a row index to clear the row selection. - * @returns {void} - */ - clearSelection(index: number): void; - - /** To select cell based on the cell and row index dynamically. - * @param {Array} array of cell indexes to be select - * @param {boolean} Defines that we need to preserve the previously selected cells or not - * @returns {void} - */ - selectCells(Indexes: any[], preservePreviousSelectedCell: boolean): void; - - /** To rename a column with the specified name - * @param {number} Index of the column to be renamed - * @param {string} Header text of the column - * @returns {void} - */ - renameColumn(columnIndex: number, name: string): void; - - /** To delete the specified column - * @param {number} Index of the column to be deleted - * @returns {void} - */ - deleteColumn(columnIndex: number): void; - - /** To collapse all the parent items in tree grid - * @returns {void} - */ - collapseAll(): void; - - /** To hide the column by using header text - * @param {string} you can pass a header text of a column to hide. - * @returns {void} - */ - hideColumn(headerText: string): void; - - /** Expands the records at specific hierarchical level - * @param {number} you can pass the level as index number to expand - * @returns {void} - */ - expandAtLevel(index: number): void; - - /** Collapses the records at specific hierarchical level - * @param {number} you can pass the particular level as index. - * @returns {void} - */ - collapseAtLevel(index: number): void; - - /** To refresh the changes in tree grid - * @param {Array} Pass which data source you want to show in tree grid - * @param {any} Pass which data you want to show in tree grid - * @returns {void} - */ - refresh(dataSource: any[], query: any): void; - - /** Freeze all the columns preceding to the column specified by the field name. - * @param {string} Freeze all Columns before this field column. - * @returns {void} - */ - freezePrecedingColumns(field: string): void; - - /** Freeze/unfreeze the specified column. - * @param {string} Freeze/Unfreeze this field column. - * @param {boolean} Decides to Freeze/Unfreeze this field column. - * @returns {void} - */ - freezeColumn(field: string, isFrozen: boolean): void; - - /** To save the edited cell in TreeGrid - * @returns {void} - */ - saveCell(): void; - - /** To search an item with search string provided at the run time - * @param {string} you can pass a searchString to search the tree grid - * @returns {void} - */ - search(searchString: string): void; - - /** To show the column by using header text - * @param {string} you can pass a header text of a column to show. - * @returns {void} - */ - showColumn(headerText: string): void; - - /** To sorting the data based on the particular fields - * @param {string} you can pass a name of column to sort. - * @param {string} you can pass a sort direction to sort the column. - * @returns {void} - */ - sortColumn(columnName: string, columnSortDirection: string): void; - - /** To reorder the column with field name and target index values - * @param {string} you can pass a name of column to reorder. - * @param {string} you can pass a target column index to be inserted. - * @returns {void} - */ - reorderColumn(fieldName: string, targetIndex: string): void; -} -export namespace TreeGrid { - -export interface Model { - - /** Enables or disables the ability to resize the column width interactively. - * @Default {false} - */ - allowColumnResize?: boolean; - - /** Enables or disables the option for column reordering - * @Default {false} - */ - allowColumnReordering?: boolean; - - /** Enables or disables the ability to drag and drop the row interactively to reorder the rows. - * @Default {false} - */ - allowDragAndDrop?: boolean; - - /** Enables or disables the ability to filter the data on all the columns. Enabling this property will display a row with editor controls corresponding to each column. - * You can restrict filtering on particular column by disabling this property directly on that column instance itself. - * @Default {false} - */ - allowFiltering?: boolean; - - /** Enables or disables keyboard navigation. - * @Default {true} - */ - allowKeyboardNavigation?: boolean; - - /** Enables or disables the ability to sort the rows based on multiple columns/fields by clicking on each column header. Rows will be sorted recursively on clicking the column headers. - * @Default {false} - */ - allowMultiSorting?: boolean; - - /** Enables or disables the ability to select a row interactively. - * @Default {true} - */ - allowSelection?: boolean; - - /** Enables or disables the ability to sort the rows based on a single field/column by clicking on that column header. When enabled, rows can be sorted only by single field/column. - * @Default {false} - */ - allowSorting?: boolean; - - /** Enables/disables pagination of rows in TreeGrid - * @Default {false} - */ - allowPaging?: boolean; - - /** Specifies the id of the template that has to be applied for alternate rows. - */ - altRowTemplateID?: string; - - /** Specifies the mapping property path for sub tasks in datasource - */ - childMapping?: string; - - /** Option for adding columns; each column has the option to bind to a field in the dataSource. - */ - columns?: Column[]; - - /** To Specify the column fields to be displayed in the dialog while inserting a column using column menu. - * @Default {[]} - */ - columnDialogFields?: any[]; - - /** Options for displaying and customizing context menu items. - */ - contextMenuSettings?: ContextMenuSettings; - - /** Specify the CSS class for TreeGrid to achieve custom theme. - */ - cssClass?: string; - - /** Specifies hierarchical or self-referential data to populate the TreeGrid. - * @Default {null} - */ - dataSource?: any[]; - - /** Specifies whether to wrap the header text when it is overflown i.e., when it exceeds the header width. - * @Default {none} - */ - headerTextOverflow?: string; - - /** Options for displaying and customizing the tooltip. This tooltip will show the preview of the row that is being dragged. - */ - dragTooltip?: DragTooltip; - - /** Options for enabling and configuring the editing related operations. - */ - editSettings?: EditSettings; - - /** Specifies whether to render alternate rows in different background colors. - * @Default {true} - */ - enableAltRow?: boolean; - - /** Specifies whether to load all the rows in collapsed state when the TreeGrid is rendered for the first time. - * @Default {false} - */ - enableCollapseAll?: boolean; - - /** Specifies whether to resize TreeGrid whenever window size changes. - * @Default {false} - */ - enableResize?: boolean; - - /** Specifies whether to render only the visual elements that are visible in the UI. When you enable this property, it will reduce the loading time for loading large number of records. - * @Default {false} - */ - enableVirtualization?: boolean; - - /** Specifies the settings for column resize - */ - columnResizeSettings?: ColumnResizeSettings; - - /** Options for filtering and customizing filter actions. - */ - filterSettings?: FilterSettings; - - /** Specifies the localization information to customize the User Interface (UI) to support regional language and culture - * @Default {en-US} - */ - locale?: string; - - /** Enables or disables internal parsing of a row. When disbaled this property, row will be displayed using the defined template without any internal event bindings. - * @Default {true} - */ - parseRowTemplate?: boolean; - - /** Specifies the name of the field in the dataSource, which contains the id of that row. - */ - idMapping?: string; - - /** Enables or disables the responsiveness of TreeGrid - * @Default {false} - */ - isResponsive?: boolean; - - /** Specifies the name of the field in the dataSource, which contains the parent's id. This is necessary to form a parent-child hierarchy, if the dataSource contains self-referential data. - */ - parentIdMapping?: string; - - /** Specifies the options for customizing the pager. - */ - pageSettings?: PageSettings; - - /** Specifies the template for cell tooltip - * @Default {null} - */ - cellTooltipTemplate?: string; - - /** Specifies ej.Query to select data from the dataSource. This property is applicable only when the dataSource is ej.DataManager. - * @Default {null} - */ - query?: any; - - /** Specifies the height of a single row in tree grid. Also, we need to set same height in the CSS style with class name e-rowcell. - * @Default {30} - */ - rowHeight?: number; - - /** Specifies the id of the template to be applied for all the rows. - */ - rowTemplateID?: string; - - /** Specifies the index of the selected row. - * @Default {-1} - */ - selectedRowIndex?: number; - - /** Specifies the settings for row and cell selection. - */ - selectionSettings?: SelectionSettings; - - /** Enables/disables the options for inserting , deleting and renaming columns. - * @Default {false} - */ - showColumnOptions?: boolean; - - /** Controls the visibility of the menu button, which is displayed on the column header. Clicking on this button will show a popup menu. When you choose Columns item from this popup, - * a list box with column names will be shown, from which you can select/deselect a column name to control the visibility of the respective columns. - * @Default {false} - */ - showColumnChooser?: boolean; - - /** Specifies the visibility of details view - * @Default {false} - */ - showDetailsRow?: boolean; - - /** Specifies the visibility of the expander column which is used to expand or collapse the details view - * @Default {false} - */ - showDetailsRowInfoColumn?: boolean; - - /** Specifies the template for details view - */ - detailsTemplate?: string; - - /** Specifies the row height of the details view - * @Default {100} - */ - detailsRowHeight?: number; - - /** Specifies the visibility of summary row - * @Default {false} - */ - showSummaryRow?: boolean; - - /** Specifies the visibility of total summary row for the corresponding summary column - * @Default {false} - */ - showTotalSummary?: boolean; - - /** Specifies the summary row collection object to be displayed - * @Default {[]} - */ - summaryRows?: any[]; - - /** Specifies whether to show tooltip when mouse is hovered on the cell. - * @Default {true} - */ - showGridCellTooltip?: boolean; - - /** Specifies whether to show tooltip for the cells, which has expander button. - * @Default {true} - */ - showGridExpandCellTooltip?: boolean; - - /** Options for setting width and height for TreeGrid. - */ - sizeSettings?: SizeSettings; - - /** Options for sorting the rows. - */ - sortSettings?: SortSettings; - - /** Options for displaying and customizing the toolbar items. - */ - toolbarSettings?: ToolbarSettings; - - /** Specifies the index of the column that needs to have the expander button. By default, cells in the first column contain the expander button. - * @Default {0} - */ - treeColumnIndex?: number; - - /** Triggered before every success event of TreeGrid action. */ - actionBegin?(e: ActionBeginEventArgs): void; - - /** Triggered for every TreeGrid action success event. */ - actionComplete?(e: ActionCompleteEventArgs): void; - - /** Triggered while enter the edit mode in the TreeGrid cell */ - beginEdit?(e: BeginEditEventArgs): void; - - /** Triggered after collapsed the TreeGrid record */ - collapsed?(e: CollapsedEventArgs): void; - - /** Triggered while collapsing the TreeGrid record */ - collapsing?(e: CollapsingEventArgs): void; - - /** Triggered while clicking a row, even when allowSelection property is disabled. */ - recordClick?(e: RecordClickEventArgs): void; - - /** Triggered when you start to drag a column */ - columnDragStart?(e: ColumnDragStartEventArgs): void; - - /** Triggered while dragging a column */ - columnDrag?(e: ColumnDragEventArgs): void; - - /** Triggered when a column is dropped */ - columnDrop?(e: ColumnDropEventArgs): void; - - /** Triggered after a column resized */ - columnResized?(e: ColumnResizedEventArgs): void; - - /** Triggered while start to resize a column */ - columnResizeStart?(e: ColumnResizeStartEventArgs): void; - - /** Triggered when a column has been resized */ - columnResizeEnd?(e: ColumnResizeEndEventArgs): void; - - /** Triggered while Context Menu is rendered in TreeGrid control */ - contextMenuOpen?(e: ContextMenuOpenEventArgs): void; - - /** Triggered when TreeGrid is rendered completely */ - create?(e: CreateEventArgs): void; - - /** Triggered after saved the modified cellValue in TreeGrid */ - endEdit?(e: EndEditEventArgs): void; - - /** Triggered after expand the record */ - expanded?(e: ExpandedEventArgs): void; - - /** Triggered while expanding the TreeGrid record */ - expanding?(e: ExpandingEventArgs): void; - - /** Triggered while Treegrid is loaded */ - load?(e: LoadEventArgs): void; - - /** Triggered while rendering each cell in the TreeGrid */ - queryCellInfo?(e: QueryCellInfoEventArgs): void; - - /** Triggered while rendering each row */ - rowDataBound?(e: RowDataBoundEventArgs): void; - - /** Triggered while dragging a row in TreeGrid control */ - rowDrag?(e: RowDragEventArgs): void; - - /** Triggered while start to drag row in TreeGrid control */ - rowDragStart?(e: RowDragStartEventArgs): void; - - /** Triggered while drop a row in TreeGrid control */ - rowDragStop?(e: RowDragStopEventArgs): void; - - /** Triggered before selecting a cell */ - cellSelecting?(e: CellSelectingEventArgs): void; - - /** Triggered after selected a cell */ - cellSelected?(e: CellSelectedEventArgs): void; - - /** Triggered after the row is selected. */ - rowSelected?(e: RowSelectedEventArgs): void; - - /** Triggered before the row is going to be selected. */ - rowSelecting?(e: RowSelectingEventArgs): void; - - /** Triggered when toolbar item is clicked in TreeGrid. */ - toolbarClick?(e: ToolbarClickEventArgs): void; -} - -export interface ActionBeginEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the current grouped column field name. - */ - columnName?: string; - - /** Returns the TreeGrid model. - */ - model?: any; - - /** Returns request type. - */ - requestType?: string; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the direction of sorting ascending or descending. - */ - columnSortDirection?: string; - - /** Returns the value of expanding parent element. - */ - keyValue?: string; - - /** Returns the data or deleting element. - */ - data?: string; -} - -export interface ActionCompleteEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the grid model. - */ - model?: any; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the current grouped column field name. - */ - columnName?: string; - - /** Returns request type. - */ - requestType?: string; - - /** Returns the direction of sorting ascending or descending - */ - columnSortDirection?: string; - - /** Returns the value of searched element. - */ - keyValue?: string; - - /** Returns the data of deleted element. - */ - data?: string; - - /** Returns selected record index - */ - recordIndex?: number; -} - -export interface BeginEditEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the row element of editing cell. - */ - rowElement?: any; - - /** Returns the Element of editing cell. - */ - cellElement?: any; - - /** Returns the data of current cell record. - */ - data?: any; - - /** Returns the column Index of cell belongs. - */ - columnIndex?: number; -} - -export interface CollapsedEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the row index of collapsed record. - */ - recordIndex?: number; - - /** Returns the data of collapsed record.. - */ - data?: any; - - /** Returns Request Type. - */ - requestType?: string; - - /** Returns state of a record whether it is in expanded or collapsed state. - */ - expanded?: boolean; - - /** Returns the event type. - */ - type?: string; -} - -export interface CollapsingEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the row index of collapsing record. - */ - recordIndex?: number; - - /** Returns the data of collapsing record.. - */ - data?: any; - - /** Returns the event Type. - */ - type?: string; - - /** Returns state of a record whether it is in expanded or collapsing state. - */ - expanded?: boolean; -} - -export interface RecordClickEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the element of clicked cell. - */ - cell?: any; - - /** Returns the index of the clicked cell. - */ - cellIndex?: number; - - /** Returns the data of clicked cell. - */ - cellValue?: any; - - /** Returns the element of the clicked row. - */ - row?: any; - - /** Returns the index of the clicked row. - */ - rowIndex?: number; - - /** Returns the column name of the clicked cell. - */ - columnName?: string; -} - -export interface ColumnDragStartEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the control model values. - */ - model?: any; - - /** Returns the event Type. - */ - type?: string; - - /** Returns the column data which is dragged - */ - draggedColumn?: any; - - /** Returns the index of the column being dragged - */ - draggedColumnIndex?: number; -} - -export interface ColumnDragEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the control model values. - */ - model?: any; - - /** Returns the event Type. - */ - type?: string; - - /** Returns the column data which is dragged - */ - draggedColumn?: any; - - /** Returns the index of the column being dragged - */ - draggedColumnIndex?: number; - - /** Returns the target column data - */ - targetColumn?: any; - - /** Returns the index of the target column - */ - targetColumnIndex?: number; - - /** Returns that we can drop over the column or not. - */ - canDrop?: boolean; -} - -export interface ColumnDropEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the control model values. - */ - model?: any; - - /** Returns the event Type. - */ - type?: string; - - /** Returns the column data which is dragged - */ - draggedColumn?: any; - - /** Returns the index of the column being dragged - */ - draggedColumnIndex?: number; - - /** Returns the target column data - */ - targetColumn?: any; - - /** Returns the index of the target column - */ - targetColumnIndex?: number; -} - -export interface ColumnResizedEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the control model values. - */ - model?: any; - - /** Returns the event Type. - */ - type?: string; - - /** Returns the column data which is resized - */ - column?: any; - - /** Returns the index of the column being resized. - */ - columnIndex?: number; - - /** Returns resized column width after resized. - */ - newWidth?: number; - - /** Returns resized column width before resizing - */ - oldWidth?: number; -} - -export interface ColumnResizeStartEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the control model values. - */ - model?: any; - - /** Returns the event Type. - */ - type?: string; - - /** Returns the column data in which the resizing started - */ - column?: any; - - /** Returns the column index in which the resizing started - */ - columnIndex?: number; - - /** Returns column width before dragging - */ - oldWidth?: number; - - /** Returns initial column element object. - */ - target?: any; -} - -export interface ColumnResizeEndEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the control model values. - */ - model?: any; - - /** Returns the event Type. - */ - type?: string; - - /** Returns the column data in which the resizing started - */ - column?: any; - - /** Returns the column index in which the resizing started - */ - columnIndex?: number; - - /** Returns the column width difference, before and after the resizing - */ - extra?: number; - - /** Returns the new column width after resized - */ - newWidth?: number; - - /** Returns column width before dragging - */ - oldWidth?: number; - - /** Returns initial column element object. - */ - target?: any; -} - -export interface ContextMenuOpenEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the default context menu items to which we add custom items. - */ - contextMenuItems?: any[]; - - /** Returns the TreeGrid model. - */ - model?: any; - - /** Returns request type. - */ - requestType?: string; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface CreateEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the TreeGrid model - */ - model?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface EndEditEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the row element of editing cell. - */ - rowElement?: any; - - /** Returns the Element of editing cell. - */ - cellElement?: any; - - /** Returns the data of edited cell record. - */ - data?: any; - - /** Returns the column name of edited cell belongs. - */ - columnName?: string; - - /** Returns the column object of edited cell belongs. - */ - columnObject?: any; -} - -export interface ExpandedEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the row index of expanded record. - */ - recordIndex?: number; - - /** Returns the data of expanded record.. - */ - data?: any; - - /** Returns Request Type. - */ - requestType?: string; - - /** Returns state of a record whether it is in expanded or expanded state. - */ - expanded?: boolean; - - /** Returns the event type. - */ - type?: string; -} - -export interface ExpandingEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the row index of expanding record. - */ - recordIndex?: number; - - /** Returns the data of expanding record.. - */ - data?: any; - - /** Returns the event Type. - */ - type?: string; - - /** Returns state of a record whether it is in expanded or collapsed state. - */ - expanded?: boolean; -} - -export interface LoadEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the TreeGrid model - */ - model?: any; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface QueryCellInfoEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the selecting cell element. - */ - cellElement?: any; - - /** Returns the value of cell. - */ - cellValue?: string; - - /** Returns the data of current cell record. - */ - data?: any; - - /** Returns the column of cell belongs. - */ - column?: any; -} - -export interface RowDataBoundEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the row element of rendering row. - */ - rowElement?: any; - - /** Returns the data of rendering row record. - */ - data?: any; -} - -export interface RowDragEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the row which we start to drag. - */ - draggedRow?: any; - - /** Returns the row index which we start to drag. - */ - draggedRowIndex?: number; - - /** Returns the row on which we are dragging. - */ - targetRow?: any; - - /** Returns the row index on which we are dragging. - */ - targetRowIndex?: number; - - /** Returns that we can drop over that record or not. - */ - canDrop?: boolean; - - /** Returns the TreeGrid model. - */ - model?: any; - - /** Returns request type. - */ - requestType?: string; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface RowDragStartEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the row which we start to drag. - */ - draggedRow?: any; - - /** Returns the row index which we start to drag. - */ - draggedRowIndex?: boolean; - - /** Returns the TreeGrid model. - */ - model?: any; - - /** Returns request type. - */ - requestType?: string; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface RowDragStopEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the row which we start to drag. - */ - draggedRow?: any; - - /** Returns the row index which we start to drag. - */ - draggedRowIndex?: number; - - /** Returns the row which we are dropped to row. - */ - targetRow?: any; - - /** Returns the row index which we are dropped to row. - */ - targetRowIndex?: number; - - /** Returns the TreeGrid model. - */ - model?: any; - - /** Returns request type. - */ - requestType?: string; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface CellSelectingEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the cell index on the selection. - */ - cellIndex?: number; - - /** Returns the row index on the selection - */ - rowIndex?: number; - - /** Returns the selecting cell element - */ - targetCell?: any; - - /** Returns the selecting row element - */ - targetRow?: any; - - /** Returns the selecting record object - */ - data?: any; - - /** Returns the Gantt object Model - */ - model?: any; -} - -export interface CellSelectedEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the cell index on the selection. - */ - cellIndex?: number; - - /** Returns the row index on the selection - */ - rowIndex?: number; - - /** Returns the selecting cell element - */ - targetCell?: any; - - /** Returns the selecting row element - */ - targetRow?: any; - - /** Returns the selecting record object - */ - data?: any; - - /** Returns the Gantt object Model - */ - model?: any; - - /** Returns the previously selected row data - */ - previousData?: any; - - /** Returns the previously selected cell index - */ - previousCellIndex?: any; - - /** Returns the previously selected row index - */ - previousRowIndex?: any; - - /** Returns the previously selected cell element - */ - previousTargetCell?: any; - - /** Returns the previously selected row element - */ - previousTargetRow?: any; -} - -export interface RowSelectedEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the selecting row element. - */ - targetRow?: any; - - /** Returns the index of selecting row record. - */ - recordIndex?: number; - - /** Returns the data of selected record. - */ - data?: any; - - /** Returns the event type. - */ - type?: string; -} - -export interface RowSelectingEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the data selecting record. - */ - data?: any; - - /** Returns the index of selecting row record. - */ - recordIndex?: string; - - /** Returns the selecting row element. - */ - targetRow?: any; - - /** Returns the previous selected data. - */ - previousData?: any; - - /** Returns the previous selected row index. - */ - previousIndex?: string; - - /** Returns the previous selected row element. - */ - previousTreeGridRow?: any; -} - -export interface ToolbarClickEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the current item. - */ - currentTarget?: any; - - /** Returns the TreeGrid model. - */ - model?: any; - - /** Returns the name of the toolbar item on which mouse click has been performed - */ - itemName?: string; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface Column { - - /** Enables or disables the ability to filter the rows based on this column. - * @Default {false} - */ - allowFiltering?: boolean; - - /** Enables or disables the ability to sort the rows based on this column/field. - * @Default {false} - */ - allowSorting?: boolean; - - /** Enables/disables cell selection. - * @Default {false} - */ - allowCellSelection?: boolean; - - /** Specifies the edit type of the column. - * @Default {ej.TreeGrid.EditingType.String} - */ - editType?: ej.TreeGrid.EditingType|string; - - /** Specifies the name of the field from the dataSource to bind with this column. - */ - field?: string; - - /** Specifies the type of the editor control to be used to filter the rows. - * @Default {ej.TreeGrid.EditingType.String} - */ - filterEditType?: ej.TreeGrid.EditingType|string; - - /** Header text of the column. - * @Default {null} - */ - headerText?: string; - - /** Enables or disables the checkbox visibility in a column to make it as a checkbox column - * @Default {false} - */ - showCheckbox?: boolean; - - /** Controls the visibility of the column. - * @Default {true} - */ - visible?: boolean; - - /** Gets or sets a value for treegrid column width - */ - width?: number; - - /** Specifies the header template value for the column header - */ - headerTemplateID?: string; - - /** Specifies the display format of a column - * @Default {null} - */ - format?: any; - - /** Specifies whether the column is a template column - * @Default {false} - */ - isTemplateColumn?: boolean; - - /** Specifies the alignment of the column header text - * @Default {ej.TextAlign.Left} - */ - headerTextAlign?: ej.TextAlign|string; - - /** Specifies whether the column is frozen - * @Default {false} - */ - isFrozen?: boolean; - - /** Specifies the text alignment for the column - * @Default {ej.TextAlign.Left} - */ - textAlign?: ej.TextAlign|string; - - /** Specifies the template for the TreeGrid column - */ - templateID?: string; - - /** Enables or disables the ability to edit a row or cell. - * @Default {false} - */ - allowEditing?: boolean; - - /** Enables or disables the ability to freeze/unfreeze the columns - * @Default {false} - */ - allowFreezing?: boolean; -} - -export interface ContextMenuSettings { - - /** Option for adding items to context menu. - * @Default {[]} - */ - contextMenuItems?: any[]; - - /** Shows/hides the context menu. - * @Default {false} - */ - showContextMenu?: boolean; -} - -export interface DragTooltip { - - /** Specifies whether to show tooltip while dragging a row. - * @Default {true} - */ - showTooltip?: boolean; - - /** Option to add field names whose corresponding values in the dragged row needs to be shown in the preview tooltip. - * @Default {[]} - */ - tooltipItems?: any[]; - - /** Custom template for that tooltip that is shown while dragging a row. - * @Default {null} - */ - tooltipTemplate?: string; -} - -export interface EditSettings { - - /** Enables or disables the button to add new row in context menu as well as in toolbar. - * @Default {true} - */ - allowAdding?: boolean; - - /** Enables or disables the button to delete the selected row in context menu as well as in toolbar. - * @Default {true} - */ - allowDeleting?: boolean; - - /** Enables or disables the ability to edit a row or cell. - * @Default {false} - */ - allowEditing?: boolean; - - /** Specifies the mouse action whether single click or double click to begin the editing - * @Default {ej.TreeGrid.BeginEditAction.DblClick} - */ - beginEditAction?: ej.TreeGrid.BeginEditAction|string; - - /** specifies the edit mode in TreeGrid , "cellEditing" is for cell type editing and "rowEditing" is for entire row. - * @Default {ej.TreeGrid.EditMode.CellEditing} - */ - editMode?: ej.TreeGrid.EditMode|string; - - /** Specifies the position where the new row has to be added. - * @Default {top} - */ - rowPosition?: ej.TreeGrid.RowPosition|string; -} - -export interface ColumnResizeSettings { - - /** Specifies the mode for column resizing - * @Default {normal} - */ - columnResizeMode?: string; -} - -export interface FilterSettings { - - /** Specifies the mode on which column filtering should start - * @Default {immediate} - */ - filterBarMode?: string; - - /** Specifies the type of column filtering. - * @Default {filterbar} - */ - filterType?: string; - - /** Specifies the column collection for filtering the TreeGrid content on initial load - * @Default {[]} - */ - filteredColumns?: any[]; -} - -export interface PageSettings { - - /** Using this property we can specify the number of pages should pager contains, according to this count TreeGrid height will be updated. - * @Default {8} - */ - pageCount?: number; - - /** This specifies the number of rows to display in each page. - * @Default {12} - */ - pageSize?: number; - - /** Get the value of records which is bound to TreeGrid. The totalRecordsCount value is calculated based on the datasource bound to TreeGrid. - * @Default {null} - */ - totalRecordsCount?: number; - - /** Specifies the current page to display at load time. - * @Default {1} - */ - currentPage?: number; - - /** Specifies the mode of record count in a page, whether it should count all the records or the root to count zero level parent records. - * @Default {ej.TreeGrid.PageSizeMode.All} - */ - pageSizeMode?: ej.TreeGrid.PageSizeMode|string; - - /** Specifies the Custom template for Pager control. - * @Default {null} - */ - template?: string; -} - -export interface SelectionSettings { - - /** Specifies the type of selection whether to select row or cell. - * @Default {ej.TreeGrid.SelectionMode.Row} - */ - selectionMode?: ej.TreeGrid.SelectionMode|string; - - /** Specifies the type of selection whether single, multiple or checkbox. - * @Default {ej.TreeGrid.SelectionType.Single} - */ - selectionType?: ej.TreeGrid.SelectionType|string; - - /** Enables or disables the selection by hierarchy in check box selection - * @Default {true} - */ - enableHierarchySelection?: boolean; - - /** Toggles the visibility of the checkbox in column header, using which all the check boxes can be selected or unselected. - * @Default {true} - */ - enableSelectAll?: boolean; -} - -export interface SizeSettings { - - /** Height of the TreeGrid. - * @Default {null} - */ - height?: string; - - /** Width of the TreeGrid. - * @Default {null} - */ - width?: string; -} - -export interface SortSettings { - - /** Option to add columns based on which the rows have to be sorted recursively. - * @Default {[]} - */ - sortedColumns?: any[]; -} - -export interface ToolbarSettings { - - /** Shows/hides the toolbar. - * @Default {false} - */ - showToolbar?: boolean; - - /** Specifies the list of toolbar items to be rendered in TreeGrid toolbar - * @Default {[]} - */ - toolbarItems?: any[]; -} - -enum EditingType { - - ///It Specifies String edit type. - String, - - ///It Specifies Boolean edit type. - Boolean, - - ///It Specifies Numeric edit type. - Numeric, - - ///It Specifies Dropdown edit type. - Dropdown, - - ///It Specifies DatePicker edit type. - DatePicker, - - ///It Specifies DateTimePicker edit type. - DateTimePicker, - - ///It Specifies Maskedit edit type. - Maskedit -} - - -enum BeginEditAction { - - ///you can begin the editing at double click - DblClick, - - ///you can begin the editing at single click - Click -} - - -enum EditMode { - - ///you can edit a cell. - CellEditing, - - ///you can edit a row. - RowEditing -} - - -enum RowPosition { - - ///you can add a new row at top. - Top, - - ///you can add a new row at bottom. - Bottom, - - ///you can add a new row to above selected row. - Above, - - ///you can add a new row to below selected row. - Below, - - ///you can add a new row as a child for selected row. - Child -} - - -enum PageSizeMode { - - ///To count all the parent and child records. - All, - - ///To count the Zeroth level parent records. - Root -} - - -enum SelectionMode { - - ///you can select a row. - Row, - - ///you can select a cell. - Cell -} - - -enum SelectionType { - - ///you can select a single row. - Single, - - ///you can select a multiple row. - Multiple, - - ///you can select rows using checkbox. - Checkbox -} - -} - -class GroupButton extends ej.Widget { - static fn: GroupButton; - constructor(element: JQuery | Element, options?: GroupButton.Model); - static Locale: any; - model: GroupButton.Model; - defaults: GroupButton.Model; - - /** Remove the selection state of the specified the button element from the GroupButton - * @param {JQuery} Specific button element - * @returns {void} - */ - deselectItem(element: JQuery): void; - - /** Destroy the GroupButton widget all events bound using this._on will be unbind automatically and bring the control to pre-init state. - * @returns {void} - */ - destroy(): void; - - /** Disables the GroupButton control - * @returns {void} - */ - disable(): void; - - /** Disable the specified button element from the ejGroupButton control. - * @param {JQuery} Specific button element - * @returns {void} - */ - disableItem(element: JQuery): void; - - /** Enables the disabled ejGroupButton control. - * @returns {void} - */ - enable(): void; - - /** Enable the specified disabled button element from the ejGroupButton control. - * @param {JQuery} Specific button element - * @returns {void} - */ - enableItem(element: JQuery): void; - - /** Returns the index value for specified button element in the GroupButton control. - * @param {JQuery} Specific button element - * @returns {number} - */ - getIndex(element: JQuery): number; - - /** This method returns the list of active state button elements from the GroupButton control. - * @returns {any} - */ - getSelectedItem(): any; - - /** Hides the GroupButton control - * @returns {void} - */ - hide(): void; - - /** Hide the specified button element from the ejGroupButton control. - * @param {JQuery} Specific button element - * @returns {void} - */ - hideItem(element: JQuery): void; - - /** Returns the disabled state of the specified element button element in GroupButton as Boolean. - * @returns {boolean} - */ - isDisabled(): boolean; - - /** Returns the state of the specified button element as Boolean. - * @returns {boolean} - */ - isSelected(): boolean; - - /** Public method used to select the specified button element from the ejGroupButton control. - * @param {JQuery} Specific button element - * @returns {void} - */ - selectItem(element: JQuery): void; - - /** Shows the GroupButton control, if its hide. - * @returns {void} - */ - show(): void; - - /** Show the specified hidden button element from the ejGroupButton control. - * @param {JQuery} Specific button element - * @returns {void} - */ - showItem(element: JQuery): void; -} -export namespace GroupButton { - -export interface Model { - - /** Sets the specified class to GroupButton wrapper element, which allows for custom skinning option in ejGroupButton control. - */ - cssClass?: string; - - /** To set the local JSON data, define a JSON array and initialize the GroupButton with dataSource property. Specify the column names in the fields property. - * @Default {null} - */ - dataSource?: any; - - /** Displays the ejGroupButton in Right to Left direction. - * @Default {false} - */ - enableRTL?: boolean; - - /** Used to enable or disable the ejGroupButton control. - * @Default {true} - */ - enabled?: boolean; - - /** Gets or sets a value that indicates to display the values of the data. - * @Default {null} - */ - fields?: any; - - /** Sets the GroupButton behavior to works as Checkbox mode/ radio button mode based on the specified option. - * @Default {ej.GroupButtonMode.RadioButton} - */ - groupButtonMode?: ej.GroupButtonMode | string; - - /** Used to sets the height of the ejGroupButton control. - * @Default {28} - */ - height?: string|number; - - /** Defines the characteristics of the ejGroupButton control and extend the capability of an HTML element by adding specified attributes to element tag and by performing the related actions - * @Default {{}} - */ - htmlAttributes?: any; - - /** Specify the orientation of the GroupButton. See below to get available orientations - * @Default {ej.Orientation.Horizontal} - */ - orientation?: ej.Orientation|string; - - /** Query the dataSource from the table for Groupbutton - * @Default {null} - */ - query?: any; - - /** Sets the list of button elements to be selected. To enable this option groupButtonMode should be in “checkbox” mode. - * @Default {[]} - */ - selectedItemIndex?: number[]|string[]; - - /** Sets the rounder corner to the GroupButton, if sets as true. - * @Default {false} - */ - showRoundedCorner?: boolean; - - /** Specifies the size of the button. See available size - * @Default {ej.ButtonSize.Normal} - */ - size?: ej.ButtonSize|string; - - /** Defines the width of the ejGroupButton control. - */ - width?: string|number; - - /** Triggered before any button element in the GroupButton get selected. */ - beforeSelect?(e: BeforeSelectEventArgs): void; - - /** Fires after GroupButton control is created.If the user want to perform any operation after the button control creation then the user can make use of this create event. */ - create?(e: CreateEventArgs): void; - - /** Fires when the GroupButton is destroyed successfully.If the user want to perform any operation after the destroy button control then the user can make use of this destroy event. */ - destroy?(e: DestroyEventArgs): void; - - /** Triggered once the key is pressed, when the control is in focused state. */ - keyPress?(e: KeyPressEventArgs): void; - - /** Triggered when the button element get selected. */ - select?(e: SelectEventArgs): void; -} - -export interface BeforeSelectEventArgs { - - /** Boolean value based on whether the button element is disabled or not. - */ - disabled?: boolean; - - /** Returns the selection button element. - */ - element?: any; - - /** Event object - */ - event?: any; - - /** Return the button element ID. - */ - id?: string; - - /** Button item index. - */ - index?: number; - - /** returns the button model - */ - model?: ej.GroupButton.Model ; - - /** Boolean value based on whether the button element is selected or not. - */ - selected?: boolean; - - /** returns the name of the event - */ - type?: string; - - /** return the button state - */ - status?: boolean; -} - -export interface CreateEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the GroupButton model - */ - model?: ej.GroupButton.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface DestroyEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the GroupButton model - */ - model?: ej.GroupButton.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface KeyPressEventArgs { - - /** Boolean value based on whether the button element is disabled or not. - */ - disabled?: boolean; - - /** Returns the selection button element. - */ - element?: any; - - /** Event object - */ - event?: any; - - /** Return the button element ID. - */ - id?: string; - - /** Button item index. - */ - index?: number; - - /** returns the button model - */ - model?: ej.GroupButton.Model; - - /** Boolean value based on whether the button element is selected or not. - */ - selected?: boolean; - - /** returns the name of the event - */ - type?: string; - - /** return the button state - */ - status?: boolean; -} - -export interface SelectEventArgs { - - /** Boolean value based on whether the selected button element is disabled or not. - */ - disabled?: boolean; - - /** Returns the selection button element. - */ - element?: any; - - /** Event object - */ - event?: any; - - /** Return the selected button element ID. - */ - id?: string; - - /** Selected button item index. - */ - index?: number; - - /** returns the button model - */ - model?: ej.GroupButton.Model; - - /** Boolean value based on whether the button element is selected or not. - */ - selected?: boolean; - - /** returns the name of the event - */ - type?: string; - - /** return the button state - */ - status?: boolean; -} -} -enum GroupButtonMode { -//Sets the GroupButton to work as checkbox mode -CheckBox, -//Sets the RadioButton to work as radio button mode -RadioButton, -} - -class NavigationDrawer extends ej.Widget { - static fn: NavigationDrawer; - constructor(element: JQuery | Element, options?: NavigationDrawer.Model); - static Locale: any; - model: NavigationDrawer.Model; - defaults: NavigationDrawer.Model; - - /** To close the navigation drawer control - * @returns {void} - */ - close(): void; - - /** To load AJAX content into NavigationDrawer container. - * @returns {void} - */ - loadContent(): void; - - /** To open the navigation drawer control - * @returns {void} - */ - open(): void; - - /** To Toggle the navigation drawer control - * @returns {void} - */ - toggle(): void; -} -export namespace NavigationDrawer { - -export interface Model { - - /** Specifies the ajaxSettings option to load the content to the NavigationDrawer control. - * @Default {null} - */ - ajaxSettings?: AjaxSettings; - - /** Specifies the contentId for navigation drawer, where the AJAX content need to updated - * @Default {null} - */ - contentId?: string; - - /** Sets the root class for NavigationDrawer theme. This cssClass API helps to use custom skinning option for NavigationDrawer control. - * By defining the root class using this API, we need to include this root class in CSS. - */ - cssClass?: string; - - /** Sets the Direction for the control. See Direction - * @Default {left} - */ - direction?: ej.Direction|string; - - /** Sets the listview to be enabled or not - * @Default {false} - */ - enableListView?: boolean; - - /** Specifies the listview items as an array of object. - * @Default {[]} - */ - items?: any[]; - - /** Sets all the properties of listview to render in navigation drawer - */ - listViewSettings?: any; - - /** Specifies position whether it is in fixed or relative to the page. See Position - * @Default {normal} - */ - position?: string; - - /** Specifies the targetId for navigation drawer - */ - targetId?: string; - - /** Sets the rendering type of the control. See Type - * @Default {overlay} - */ - type?: string; - - /** Specifies the width of the control - * @Default {auto} - */ - width?: number; - - /** Navigation pane opened initially when isPaneOpen property is true. - * @Default {false} - */ - isPaneOpen?: boolean; - - /** Event triggers after the AJAX content loaded completely. */ - ajaxComplete?(e: AjaxCompleteEventArgs): void; - - /** Event triggers when the AJAX request failed. */ - ajaxError?(e: AjaxErrorEventArgs): void; - - /** Event triggers after the AJAX content loaded successfully. */ - ajaxSuccess?(e: AjaxSuccessEventArgs): void; - - /** Event triggers before the control gets closed. */ - beforeClose?(e: BeforeCloseEventArgs): void; - - /** Event triggers when the control open. */ - open?(e: OpenEventArgs): void; - - /** Event triggers when the Swipe happens. */ - swipe?(e: SwipeEventArgs): void; -} - -export interface AjaxCompleteEventArgs { - - /** returns true if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the name of the event. - */ - type?: string; - - /** returns the model value of the control. - */ - model?: ej.NavigationDrawer.Model; -} - -export interface AjaxErrorEventArgs { - - /** returns true if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the name of the event. - */ - type?: string; - - /** returns the model value of the control. - */ - model?: ej.NavigationDrawer.Model; - - /** returns the error thrown in the AJAX post. - */ - errorThrown?: any; - - /** returns the status. - */ - textStatus?: any; -} - -export interface AjaxSuccessEventArgs { - - /** returns true if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the name of the event. - */ - type?: string; - - /** returns the model value of the control. - */ - model?: ej.NavigationDrawer.Model; - - /** returns the AJAX current content. - */ - content?: string; - - /** returns the current URL of the AJAX post. - */ - URL?: string; -} - -export interface BeforeCloseEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the Navigation Drawer model - */ - model?: ej.NavigationDrawer.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface OpenEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the Navigation Drawer model - */ - model?: ej.NavigationDrawer.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface SwipeEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the Navigation Drawer model - */ - model?: ej.NavigationDrawer.Model; - - /** returns the name of the event - */ - type?: string; -} - -export interface AjaxSettings { - - /** It specifies, whether to enable or disable asynchronous request. - */ - async?: boolean; - - /** It specifies the page will be cached in the web browser. - */ - cache?: boolean; - - /** It specifies the type of data is send in the query string. - */ - contentType?: string; - - /** It specifies the data as an object, will be passed in the query string. - */ - data?: any; - - /** It specifies the type of data that you're expecting back from the response. - */ - dataType?: string; - - /** It specifies the HTTP request type. - */ - type?: string; -} -} - -class RadialMenu extends ej.Widget { - static fn: RadialMenu; - constructor(element: JQuery | Element, options?: RadialMenu.Model); - static Locale: any; - model: RadialMenu.Model; - defaults: RadialMenu.Model; - - /** To hide the radialmenu - * @returns {void} - */ - hide(): void; - - /** To hide the radialmenu items - * @returns {void} - */ - hideMenu(): void; - - /** To Show the radial menu - * @returns {void} - */ - show(): void; - - /** To show menu items - * @returns {void} - */ - showMenu(): void; - - /** To enable menu item using index - * @param {number} Index of the Radialmenu to be enabled. - * @returns {void} - */ - enableItemByIndex(itemIndex: number): void; - - /** To enable menu items using indices - * @param {Array} Index of the Radialmenu to be enabled. - * @returns {void} - */ - enableItemsByIndices(itemIndices: any[]): void; - - /** To disable menu item using index - * @param {number} Index of the Radialmenu to be disabled. - * @returns {void} - */ - disableItemByIndex(itemIndex: number): void; - - /** To disable menu items using indices - * @param {Array} items of the Radialmenu to disable. - * @returns {void} - */ - disableItemsByIndices(itemIndices: any[]): void; - - /** To enable menu item using item text - * @param {string} item of the Radialmenu item to enable. - * @returns {void} - */ - enableItem(item: string): void; - - /** To disable menu item using item text - * @param {string} item of the Radialmenu item to disable. - * @returns {void} - */ - disableItem(item: string): void; - - /** To enable menu items using item texts - * @param {Array} items of the Radialmenu item to enable. - * @returns {void} - */ - enableItems(items: any[]): void; - - /** To disable menu items using item texts - * @param {Array} items of the Radialmenu item to disable. - * @returns {void} - */ - disableItems(items: any[]): void; - - /** To update menu item badge value - * @param {number} The index value to add the given items at the specified index. If index is not specified, the given value will not be updated. - * @param {number} The Value to be updated in the badge. It will be updated based on the given index - * @returns {void} - */ - updateBadgeValue(index: number, value: number): void; - - /** To show menu item badge - * @param {number} Index of the Radialmenu item to be shown badge. - * @returns {void} - */ - showBadge(index: number): void; - - /** To hide menu item badge - * @param {number} Index of the Radialmenu item to hide the badge. - * @returns {void} - */ - hideBadge(index: number): void; -} -export namespace RadialMenu { - -export interface Model { - - /** To show the Radial in initial render. - */ - autoOpen?: boolean; - - /** Renders the back button Image for Radial using class. - */ - backImageClass?: string; - - /** Sets the root class for RadialMenu theme. This cssClass API helps to use custom skinning option for RadialMenu control. By defining the root class using this API, - * we need to include this root class in CSS. - */ - cssClass?: string; - - /** To enable Animation for Radial Menu. - */ - enableAnimation?: boolean; - - /** Renders the Image for Radial using Class. - */ - imageClass?: string; - - /** Specify the items of radial menu - */ - items?: Item[]; - - /** Specifies the radius of radial menu - */ - radius?: number; - - /** To show the Radial while clicking given target element. - */ - targetElementId?: string; - - /** To set radial render position. - */ - position?: any; - - /** Event triggers when we click an item. */ - click?(e: ClickEventArgs): void; - - /** Event triggers when the menu is opened. */ - open?(e: OpenEventArgs): void; - - /** Event triggers when the menu is closed. */ - close?(e: CloseEventArgs): void; -} - -export interface ClickEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the Radialmenu model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; - - /** returns the item of element - */ - item?: any; - - /** returns the name of item - */ - itemName?: string; -} - -export interface OpenEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the Radialmenu model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; -} - -export interface CloseEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the Radialmenu model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; -} - -export interface ItemsBadge { - - /** Specifies whether to enable radialmenu item badge or not. - */ - enabled?: boolean; - - /** Specifies the value of radial menu item badge. - */ - value?: number; -} - -export interface ItemsSliderSettings { - - /** Specifies the sliderSettings ticks values of nested radial menu items. - */ - ticks?: any[]; - - /** Specifies the sliderSettings stroke Width value. - */ - strokeWidth?: number; - - /** Specifies the value of sliderSettings labelSpace . - */ - labelSpace?: number; -} - -export interface Item { - - /** Specify the URL of the frame background image for radial menu item. - */ - imageUrl?: string; - - /** Specifies the text of RadialMenu item. - */ - text?: string; - - /** Specifies the enable state of RadialMenu item. - */ - enabled?: boolean; - - /** specify the click event to corresponding image/text for performing some specific action. - */ - click?: string; - - /** Specifies radialmenu item badges. - */ - badge?: ItemsBadge; - - /** Specifies the type of nested radial menu item. - */ - type?: string; - - /** Specifies the sliderSettings ticks for nested radial menu items. - */ - sliderSettings?: ItemsSliderSettings; - - /** Specifies to add sub level items . - */ - items?: any[]; -} -} - -class Tile extends ej.Widget { - static fn: Tile; - constructor(element: JQuery | Element, options?: Tile.Model); - static Locale: any; - model: Tile.Model; - defaults: Tile.Model; - - /** Update the image template of tile item to another one. - * @param {string} UpdateTemplate by using id - * @param {number} index of the tile - * @returns {void} - */ - updateTemplate(id: string, index: number): void; -} -export namespace Tile { - -export interface Model { - - /** Section for badge specific functionalities and it represents the notification for tile items. - */ - badge?: Badge; - - /** Section for caption specific functionalities and it represents the notification for tile items. - */ - caption?: Caption; - - /** Sets the root class for Tile theme. This cssClass API helps to use custom skinning option for Tile control. By defining the root class using this API, we need to include this root class in CSS. - */ - cssClass?: string; - - /** Saves current model value to browser cookies for state maintains. While refreshing the page retains the model value applies from browser cookies. - * @Default {false} - */ - enablePersistence?: boolean; - - /** Customize the tile size height. - * @Default {null} - */ - height?: number; - - /** Specifies Tile imageClass, using this property we can give images for each tile through CSS classes. - * @Default {null} - */ - imageClass?: string; - - /** Specifies the position of tile image. - * @Default {center} - */ - imagePosition?: ej.Tile.ImagePosition|string; - - /** Specifies the tile image in outside of template content. - * @Default {null} - */ - imageTemplateId?: string; - - /** Specifies the URL of tile image. - * @Default {null} - */ - imageUrl?: string; - - /** Set the localization culture for Tile Widget. - */ - locale?: string; - - /** Section for liveTile specific functionalities. - */ - liveTile?: LiveTile; - - /** Specifies the size of a tile. See tileSize - * @Default {small} - */ - tileSize?: ej.Tile.TileSize|string; - - /** Customize the tile size width. - * @Default {null} - */ - width?: number; - - /** Sets the rounded corner to tile. - * @Default {false} - */ - showRoundedCorner?: boolean; - - /** Sets allowSelection to tile. - * @Default {false} - */ - allowSelection?: boolean; - - /** Sets the background color to tile. - * @Default {null} - */ - backgroundColor?: string; - - /** Event triggers when the mouseDown happens in the tile */ - mouseDown?(e: MouseDownEventArgs): void; - - /** Event triggers when the mouseUp happens in the tile */ - mouseUp?(e: MouseUpEventArgs): void; -} - -export interface MouseDownEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the tile model - */ - model?: boolean; - - /** returns the name of the event - */ - type?: boolean; - - /** returns the current tile text - */ - text?: string; - - /** returns the index of current tile item - */ - index?: number; -} - -export interface MouseUpEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the tile model - */ - model?: boolean; - - /** returns the name of the event - */ - type?: boolean; - - /** returns the current tile text - */ - text?: boolean; - - /** returns the index of current tile item - */ - index?: number; -} - -export interface Badge { - - /** Specifies whether to enable badge or not. - * @Default {false} - */ - enabled?: boolean; - - /** Specifies maximum value for tile badge. - * @Default {100} - */ - maxValue?: number; - - /** Specifies minimum value for tile badge. - * @Default {1} - */ - minValue?: number; - - /** Specifies text instead of number for tile badge. - * @Default {null} - */ - text?: string; - - /** Sets value for tile badge. - * @Default {1} - */ - value?: number; - - /** Sets position for tile badge. - * @Default {“bottomright”} - */ - position?: ej.Tile.BadgePosition|string; -} - -export interface Caption { - - /** Specifies whether the tile text to be shown or hidden. - * @Default {true} - */ - enabled?: boolean; - - /** Changes the text of a tile. - * @Default {Text} - */ - text?: string; - - /** It is used to align the text of a tile. - * @Default {normal} - */ - alignment?: ej.Tile.CaptionAlignment|string; - - /** It is used to specify the caption position like Inner top, inner bottom and outer. - * @Default {Innerbottom} - */ - position?: ej.Tile.CaptionPosition|string; - - /** sets the icon instead of text. - * @Default {null} - */ - icon?: string; -} - -export interface LiveTile { - - /** Specifies whether to enable liveTile or not. - * @Default {false} - */ - enabled?: boolean; - - /** Specifies liveTile images in CSS classes. - * @Default {null} - */ - imageClass?: any[]; - - /** Specifies liveTile images in templates. - * @Default {null} - */ - imageTemplateId?: any[]; - - /** Specifies liveTile images in CSS classes. - * @Default {null} - */ - imageUrl?: any[]; - - /** Specifies liveTile type for Tile. See orientation - * @Default {flip} - */ - type?: ej.Tile.liveTileType|string; - - /** Specifies time interval between two successive liveTile animation - * @Default {2000} - */ - updateInterval?: number; - - /** Sets the text to each living tile - * @Default {Null} - */ - text?: any[]; -} - -enum BadgePosition { - - ///To set the topright position of tile badge - Topright, - - ///To set the bottomright of tile badge - Bottomright -} - - -enum CaptionAlignment { - - ///To set the normal alignment of text in tile control - Normal, - - ///To set the left alignment of text in tile control - Left, - - ///To set the right alignment of text in tile control - Right, - - ///To set the center alignment of text in tile control - Center -} - - -enum CaptionPosition { - - ///To set the inner top position of the tile text - Innertop, - - ///To set the inner bottom position of the tile text - Innerbottom, - - ///To set the outer position of the tile text - Outer -} - - -enum ImagePosition { - - ///To set the center position of tile image - Center, - - ///To set the top center position of tile image - TopCenter, - - ///To set the bottom center position of tile image - BottomCenter, - - ///To set the right center position of tile image - RightCenter, - - ///To set the left center position of tile image - LeftCenter, - - ///To set the topleft position of tile image - TopLeft, - - ///To set the topright position of tile image - TopRight, - - ///To set the bottomright position of tile image - BottomRight, - - ///To set the bottomleft position of tile image - BottomLeft, - - ///To set the fill position of tile image - Fill -} - - -enum liveTileType { - - ///To set flip type of liveTile for tile control - Flip, - - ///To set slide type of liveTile for tile control - Slide, - - ///To set carousel type of liveTile for tile control - Carousel -} - - -enum TileSize { - - ///To set the medium size for tile control - Medium, - - ///To set the small size for tile control - Small, - - ///To set the large size for tile control - Large, - - ///To set the wide size for tile control - Wide -} - -} - -class Signature extends ej.Widget { - static fn: Signature; - constructor(element: JQuery | Element, options?: Signature.Model); - static Locale: any; - model: Signature.Model; - defaults: Signature.Model; - - /** Clears the strokes in the signature. - * @returns {void} - */ - clear(): void; - - /** Destroys the signature widget. - * @returns {void} - */ - destroy(): void; - - /** Disables the signature widget. - * @returns {void} - */ - disable(): void; - - /** Enables the signature widget. - * @returns {void} - */ - enable(): void; - - /** Hides the signature widget. - * @returns {void} - */ - hide(): void; - - /** redo the last drawn stroke of the signature - * @returns {void} - */ - redo(): void; - - /** used to save the drawn image. - * @returns {void} - */ - save(): void; - - /** Used to Show the signature widget, if it is already hided. - * @returns {void} - */ - show(): void; - - /** undo the last drawn stroke of the signature. - * @returns {void} - */ - undo(): void; -} -export namespace Signature { - -export interface Model { - - /** This property is used to set the background color for the signature. - * @Default {#ffffff} - */ - backgroundColor?: string; - - /** This property is used to set the background image for the signature. - */ - backgroundImage?: string; - - /** Enables or disables the Signature textbox widget. - * @Default {true} - */ - enabled?: boolean; - - /** Sets the height of the Signature control. - * @Default {100%} - */ - height?: string; - - /** Enables/disables responsive support for the signature control (i.e) maintain the signature drawing during the window resizing time. - * @Default {false} - */ - isResponsive?: boolean; - - /** Allows the type of the image format to be saved when the signature image is saved. - */ - saveImageFormat?: ej.Signature.SaveImageFormat|string; - - /** Allows the signature image to be saved along with its background. - * @Default {false} - */ - saveWithBackground?: boolean; - - /** Enables or disables rounded corner. - * @Default {true} - */ - showRoundedCorner?: boolean; - - /** Sets the stroke color for the stroke of the signature. - * @Default {#000000} - */ - strokeColor?: string; - - /** Sets the stroke width for the stroke of the signature. - * @Default {2} - */ - strokeWidth?: number; - - /** Sets the width of the Signature control. - * @Default {100%} - */ - width?: string; - - /** Triggers when the stroke is changed. */ - change?(e: ChangeEventArgs): void; - - /** Triggered when the pointer is clicked or touched in the signature canvas. */ - mouseDown?(e: MouseDownEventArgs): void; - - /** Triggered when the pointer is moved in the signature canvas. */ - mouseMove?(e: MouseMoveEventArgs): void; - - /** Triggered when the pointer is released after click or touch in the signature canvas. */ - mouseUp?(e: MouseUpEventArgs): void; -} - -export interface ChangeEventArgs { - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Instance of the signature model object. - */ - model?: ej.Signature.Model; - - /** Name of the event. - */ - type?: string; - - /** Gives the last stored image - */ - lastImage?: string; -} - -export interface MouseDownEventArgs { - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Instance of the signature model object. - */ - model?: ej.Signature.Model; - - /** Name of the event. - */ - type?: string; - - /** returns all the event values - */ - value?: any; -} - -export interface MouseMoveEventArgs { - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Instance of the signature model object. - */ - model?: ej.Signature.Model; - - /** Name of the event. - */ - type?: string; - - /** returns all the event values - */ - value?: any; -} - -export interface MouseUpEventArgs { - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Instance of the signature model object. - */ - model?: ej.Signature.Model; - - /** Name of the event. - */ - type?: string; - - /** returns all the event values - */ - value?: any; -} - -enum SaveImageFormat { - - ///To save the signature image with PNG format only. - PNG, - - ///To save the signature image with JPG format only. - JPG, - - ///To save the signature image with BMP format only. - BMP, - - ///To save the signature image with TIFF format only. - TIFF -} - -} - -class RadialSlider extends ej.Widget { - static fn: RadialSlider; - constructor(element: JQuery | Element, options?: RadialSlider.Model); - static Locale: any; - model: RadialSlider.Model; - defaults: RadialSlider.Model; - - /** To show the radialslider - * @returns {void} - */ - show(): void; - - /** To hide the radialslider - * @returns {void} - */ - hide(): void; -} -export namespace RadialSlider { - -export interface Model { - - /** To show the RadialSlider in initial render. - * @Default {false} - */ - autoOpen?: boolean; - - /** Sets the root class for RadialSlider theme. This cssClass API helps to use custom skinning option for RadialSlider control. - * By defining the root class using this API, we need to include this root class in CSS. - */ - cssClass?: string; - - /** To enable Animation for Radial Slider. - * @Default {true} - */ - enableAnimation?: boolean; - - /** Enable/Disable the Roundoff property of RadialSlider - * @Default {true} - */ - enableRoundOff?: boolean; - - /** Specifies the endAngle value for radial slider circle. - * @Default {360} - */ - endAngle?: number; - - /** Specifies the inline for label show or not on given radius. - * @Default {false} - */ - inline?: boolean; - - /** Specifies innerCircleImageClass, using this property we can give images for center radial circle through CSS classes. - * @Default {null} - */ - innerCircleImageClass?: string; - - /** Specifies the file name of center circle icon - * @Default {null} - */ - innerCircleImageUrl?: string; - - /** Specifies the Space between the radial slider element and the label. - * @Default {30} - */ - labelSpace?: number; - - /** Specifies the radius of radial slider - * @Default {200} - */ - radius?: number; - - /** To show the RadialSlider inner circle. - * @Default {true} - */ - showInnerCircle?: boolean; - - /** Specifies the endAngle value for radial slider circle. - * @Default {0} - */ - startAngle?: number; - - /** Specifies the strokeWidth for customize the needle, outer circle and inner circle. - * @Default {2} - */ - strokeWidth?: number; - - /** Specifies the ticks value of radial slider - */ - ticks?: any[]; - - /** Specifies the value of radial slider - * @Default {10} - */ - value?: number; - - /** Event triggers when the change occurs. */ - change?(e: ChangeEventArgs): void; - - /** Event triggers when the radial slider is created. */ - create?(e: CreateEventArgs): void; - - /** Event triggers when the mouse pointer is dragged over the radial slider. */ - mouseover?(e: MouseoverEventArgs): void; - - /** Event triggers when the Radial slider slides. */ - slide?(e: SlideEventArgs): void; - - /** Event triggers when the radial slider starts. */ - start?(e: StartEventArgs): void; - - /** Event triggers when the radial slider stops. */ - stop?(e: StopEventArgs): void; -} - -export interface ChangeEventArgs { - - /** returns the Radialslider model - */ - model?: any; - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the initial value of Radial slider - */ - oldValue?: number; - - /** returns the name of the event - */ - type?: string; - - /** returns the current value of the Radial slider - */ - value?: number; -} - -export interface CreateEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the Radialslider model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; -} - -export interface MouseoverEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the Radialslider model - */ - model?: any; - - /** returns the value selected - */ - selectedValue?: number; - - /** returns the name of the event - */ - type?: string; - - /** returns the current value selected in Radial slider - */ - value?: number; -} - -export interface SlideEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the Radialslider model - */ - model?: any; - - /** returns the value selected in Radial slider - */ - selectedValue?: number; - - /** returns the name of the event - */ - type?: string; - - /** returns the currently selected value - */ - value?: number; -} - -export interface StartEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the Radialslider model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; - - /** returns the current value selected in Radial slider - */ - value?: number; -} - -export interface StopEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the Radialslider model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; - - /** returns the current value selected in Radial slider - */ - value?: number; -} -} - -class Spreadsheet extends ej.Widget { - static fn: Spreadsheet; - constructor(element: JQuery | Element, options?: Spreadsheet.Model); - static Locale: any; - model: Spreadsheet.Model; - defaults: Spreadsheet.Model; - - /** This method is used to add custom formulas in Spreadsheet. - * @param {string} Pass the name of the formula. - * @param {string} Pass the name of the function. - * @returns {void} - */ - addCustomFormula(formulaName: string, functionName: string): void; - - /** This method is used to add a new sheet in the last position of the sheet container. - * @returns {void} - */ - addNewSheet(): void; - - /** It is used to clear all the data and format in the specified range of cells in Spreadsheet. - * @param {string|Array} Optional. If range is specified, then it will clear all content in the specified range else it will use the current selected range. - * @returns {void} - */ - clearAll(range?: string|any[]): void; - - /** This property is used to clear all the formats applied in the specified range in Spreadsheet. - * @param {string|Array} Optional. If range is specified, then it will clear all format in the specified range else it will use the current selected range. - * @returns {void} - */ - clearAllFormat(range?: string|any[]): void; - - /** Used to clear the applied border in the specified range in Spreadsheet. - * @param {string|Array} Optional. If range is specified, then it will clear border in the specified range else it will use the current selected range. - * @returns {void} - */ - clearBorder(range?: string|any[]): void; - - /** This property is used to clear the contents in the specified range in Spreadsheet. - * @param {string|Array} Optional. If the range is specified, then it will clear the content in the specified range else it will use the current selected range. - * @returns {void} - */ - clearContents(range?: string|any[]): void; - - /** This method is used to remove only the data in the range denoted by the specified range name. - * @param {string} Pass the defined rangeSettings property name. - * @returns {void} - */ - clearRange(rangeName: string): void; - - /** It is used to remove data in the specified range of cells based on the defined property. - * @param {Array|string} Optional. If range is specified, it will clear data for the specified range else it will use the current selected range. - * @param {string} Optional. If property is specified, it will remove the specified property in the range else it will remove default properties - * @param {any} Optional. - * @param {boolean} Optional. pass {{'`true`' | markdownify}}, if you want to skip the hidden rows - * @param {any} Optional. Pass the status to perform undo and redo operation. - * @param {any} Optional. It specifies whether to skip element processing or not. - * @returns {void} - */ - clearRangeData(range?: any[]|string, property?: string, cells?: any, skipHiddenRow?: boolean, status?: any, skipCell?: any): void; - - /** This method is used to clear undo and redo collections in the Spreadsheet. - * @returns {void} - */ - clearUndoRedo(): void; - - /** This method is used to copy or move the sheets in Spreadsheet. - * @param {number} Pass the sheet index that you want to copy or move. - * @param {number} Pass the position index where you want to copy or move. - * @param {boolean} Pass {{'`true`' | markdownify}},If you want to copy sheet or else it will move sheet. - * @returns {void} - */ - copySheet(fromIdx: number, toIdx: number, isCopySheet: boolean): void; - - /** This method is used to delete the entire column which is selected. - * @param {number} Pass the start column index. - * @param {number} Pass the end column index. - * @returns {void} - */ - deleteEntireColumn(startCol: number, endCol: number): void; - - /** This method is used to delete the entire row which is selected. - * @param {number} Pass the start row index. - * @param {number} Pass the end row index. - * @returns {void} - */ - deleteEntireRow(startRow: number, endRow: number): void; - - /** This method is used to delete a particular sheet in the Spreadsheet. - * @param {number} Pass the sheet index to perform delete action. - * @returns {void} - */ - deleteSheet(idx: number): void; - - /** This method is used to delete the selected cells and shift the remaining cells to left. - * @param {any} Row index and column index of the starting cell. - * @param {any} Row index and column index of the ending cell. - * @returns {void} - */ - deleteShiftLeft(startCell: any, endCell: any): void; - - /** This method is used to delete the selected cells and shift the remaining cells up. - * @param {any} Row index and column index of the start cell. - * @param {any} Row index and column index of the end cell. - * @returns {void} - */ - deleteShiftUp(startCell: any, endCell: any): void; - - /** This method is used to edit data in the specified range of cells based on its corresponding rangeSettings. - * @param {string} Pass the defined rangeSettings property name. - * @param {Function} Pass the function that you want to perform range edit. - * @returns {void} - */ - editRange(rangeName: string, fn: any): void; - - /** This method is used to get the activation panel in the Spreadsheet. - * @returns {HTMLElement} - */ - getActivationPanel(): HTMLElement; - - /** This method is used to get the active cell object in Spreadsheet. It will returns object which contains rowIndex and colIndex of the active cell. - * @param {number} Optional. If sheetIdx is specified, it will return the active cell object in specified sheet index else it will use the current sheet index - * @returns {any} - */ - getActiveCell(sheetIdx?: number): any; - - /** This method is used to get the active cell element based on the given sheet index in the Spreadsheet. - * @param {number} Optional. If sheetIndex is specified, it will return the active cell element in specified sheet index else it will use the current active sheet index. - * @returns {HTMLElement} - */ - getActiveCellElem(sheetIdx?: number): HTMLElement; - - /** This method is used to get the current active sheet index in Spreadsheet. - * @returns {number} - */ - getActiveSheetIndex(): number; - - /** This method is used to get the auto fill element in Spreadsheet. - * @returns {HTMLElement} - */ - getAutoFillElem(): HTMLElement; - - /** This method is used to get the cell element based on specified row and column index in the Spreadsheet. - * @param {number} Pass the row index. - * @param {number} Pass the column index. - * @param {number} Optional. Pass the sheet index that you want to get cell. - * @returns {HTMLElement} - */ - getCell(rowIdx: number, colIdx: number, sheetIdx?: number): HTMLElement; - - /** This method is used to get the data settings in the Spreadsheet. - * @param {number} Pass the sheet index. - * @returns {number} - */ - getDataSettings(sheetIdx: number): number; - - /** This method is used to get the frozen columns index in the Spreadsheet. - * @param {number} Pass the sheet index. - * @returns {number} - */ - getFrozenColumns(sheetIdx: number): number; - - /** This method is used to get the frozen row index in Spreadsheet. - * @param {number} Pass the sheet index. - * @returns {number} - */ - getFrozenRows(sheetIdx: number): number; - - /** This method is used to get the hyperlink data as object from the specified cell in Spreadsheet. - * @param {HTMLElement} Pass the DOM element to get hyperlink - * @returns {any} - */ - getHyperlink(cell: HTMLElement): any; - - /** This method is used to get all cell elements in the specified range. - * @param {string} Pass the range that you want to get the cells. - * @param {number} Pass the index of the sheet. - * @param {boolean} Optional. Pass {{'`true`' | markdownify}}, if you want to skip the hidden rows. - * @returns {HTMLElement} - */ - getRange(range: string, sheetIdx: number, skipHiddenRow?: boolean): HTMLElement; - - /** This method is used to get the data in specified range in Spreadsheet. - * @param {any} Optional. Pass the range, property, sheetIdx, valueOnly in options. - * @returns {Array} - */ - getRangeData(options?: any): any[]; - - /** This method is used to get the range indices array based on the specified alpha range in Spreadsheet. - * @param {string} Pass the alpha range that you want to get range indices. - * @returns {Array} - */ - getRangeIndices(range: string): any[]; - - /** This method is used to get the sheet details based on the given sheet index in Spreadsheet. - * @param {number} Pass the sheet index to get the sheet object. - * @returns {any} - */ - getSheet(sheetIdx: number): any; - - /** This method is used to get the sheet content div element of Spreadsheet. - * @param {number} Pass the sheet index to get the sheet content. - * @returns {HTMLElement} - */ - getSheetElement(sheetIdx: number): HTMLElement; - - /** This method is used to get all the sheets in workbook. - * @returns {Array} - */ - getSheets(): any[]; - - /** This method is used to send a paging request to the specified sheet Index in the Spreadsheet. - * @param {number} Pass the sheet index to perform paging at specified sheet index - * @param {boolean} Pass {{'`true`' | markdownify}} to create a new sheet. If the specified sheet index is already exist, it navigate to that sheet else it create a new sheet. - * @returns {void} - */ - gotoPage(sheetIdx: number, newSheet: boolean): void; - - /** This method is used to hide the entire columns from the specified range (startCol, endCol) in Spreadsheet. - * @param {number} Index of the start column. - * @param {number} Optional. Index of the end column. - * @returns {void} - */ - hideColumn(startCol: number, endCol: number): void; - - /** This method is used to hide the formula bar in Spreadsheet. - * @returns {void} - */ - hideFormulaBar(): void; - - /** This method is used to hide the rows, based on the specified row index in Spreadsheet. - * @param {number} Index of the start row. - * @param {number} Optional. Index of the end row. - * @returns {void} - */ - hideRow(startRow: number, endRow: number): void; - - /** This method is used to hide the sheet based on the specified sheetIndex or sheet name in the Spreadsheet. - * @param {string|number} Pass the sheet name or index that you want to hide. - * @returns {void} - */ - hideSheet(sheetIdx: string|number): void; - - /** This method is used to hide the displayed waiting pop-up in Spreadsheet. - * @returns {void} - */ - hideWaitingPopUp(): void; - - /** This method is used to insert a column before the active cell's column in the Spreadsheet. - * @param {number} Pass start column. - * @param {number} Pass end column. - * @returns {void} - */ - insertEntireColumn(startCol: number, endCol: number): void; - - /** This method is used to insert a row before the active cell's row in the Spreadsheet. - * @param {number} Pass start row. - * @param {number} Pass end row. - * @returns {void} - */ - insertEntireRow(startRow: number, endRow: number): void; - - /** This method is used to insert a new sheet to the left of the current active sheet. - * @returns {void} - */ - insertSheet(): void; - - /** This method is used to insert cells in the selected or specified range and shift remaining cells to bottom. - * @param {any} Row index and column index of the start cell. - * @param {any} Row index and column index of the end cell. - * @returns {void} - */ - insertShiftBottom(startCell: any, endCell: any): void; - - /** This method is used to insert cells in the selected or specified range and shift remaining cells to right. - * @param {any} Row index and column index of the start cell. - * @param {any} Row index and column index of the end cell. - * @returns {void} - */ - insertShiftRight(startCell: any, endCell: any): void; - - /** This method is used to import excel file manually by using form data. - * @param {any} Pass the form data object to import files manually. - * @returns {void} - */ - import(importRequest: any): void; - - /** This method is used to load JSON data in Spreadsheet. - * @param {any} Pass the response that you want to load. - * @returns {void} - */ - loadFromJSON(response: any): void; - - /** This method is used to lock/unlock the range of cells in active sheet. Lock cells are activated only after the sheet is protected. Once the sheet is protected it is unable to lock/unlock cells. - * @param {string|Array} Pass the alpha range cells or array range of cells. - * @param {string} Optional. By default is {{'`true`' | markdownify}}. If it is {{'`false`' | markdownify}} locked cells are unlocked. - * @returns {void} - */ - lockCells(range: string|any[], isLocked?: string): void; - - /** This method is used to merge cells by across in the Spreadsheet. - * @param {string} Optional. To pass the cell range or selected cells are process. - * @param {boolean} Optional. If pass {{'`true`' | markdownify}} it does not show alert. - * @returns {void} - */ - mergeAcrossCells(range?: string, alertStatus?: boolean): void; - - /** This method is used to merge the selected cells in the Spreadsheet. - * @param {string|Array} Optional. To pass the cell range or selected cells are process. - * @param {boolean} Optional. If pass {{'`true`' | markdownify}} it does not show alert. - * @returns {void} - */ - mergeCells(range?: string|any[], alertStatus?: boolean): void; - - /** This method is used to select a cell or range in the Spreadsheet. - * @param {any} Pass the start cell to perform selection. - * @param {any} Pass the end cell to perform selection. - * @returns {void} - */ - performSelection(startCell: any, endCell: any): void; - - /** This method is used to protect or unprotect active sheet. - * @param {boolean} Optional. By default is `true`. If it is `false` active sheet is unprotected. - * @returns {void} - */ - protectSheet(isProtected?: boolean): void; - - /** This method is used to refresh the content in Spreadsheet. - * @param {number} Pass the index of the sheet. - * @returns {void} - */ - refreshContent(sheetIdx: number): void; - - /** This method is used to refresh the Spreadsheet. - * @returns {void} - */ - refreshSpreadsheet(): void; - - /** This method is used to remove custom formulae in Spreadsheet. - * @param {string} Pass the name of the formula. - * @param {string} Pass the name of the function. - * @returns {void} - */ - removeCustomFormula(formulaName: string, functionName: string): void; - - /** This method is used to remove the hyperlink from selected cells of current sheet. - * @param {string} Hyperlink remove from the specified range. - * @param {boolean} Optional. If it is {{'`true`' | markdownify}}, It will clear link only not format. - * @param {boolean} Optional. Pass the status to perform undo and redo operations. - * @param {any} Optional. Pass the cells that you want to remove hyperlink. - * @param {boolean} Optional. Pass {{'`true`' | markdownify}}, if you want to skip the hidden rows. - * @returns {void} - */ - removeHyperlink(range: string, isClearHLink?: boolean, status?: boolean, cells?: any, skipHiddenRow?: boolean): void; - - /** This method is used to remove the range data and its defined rangeSettings property based on the specified range name. - * @param {string} Pass the defined rangeSetting property name. - * @returns {void} - */ - removeRange(rangeName: string): void; - - /** This method is used to remove the readonly option for the specified range. - * @param {string|Array} Pass the range. - * @returns {void} - */ - removeReadOnly(range?: string|any[]): void; - - /** This method is used to save JSON data in Spreadsheet. - * @returns {any} - */ - saveAsJSON(): any; - - /** This method is used to save batch changes in Spreadsheet. - * @param {number} Pass the sheet index for Spreadsheet. - * @returns {void} - */ - saveBatchChanges(sheetIdx: number): void; - - /** This method is used to set the active cell in the Spreadsheet. - * @param {number} Pass the row index. - * @param {number} Pass the column index. - * @param {number} Pass the index of the sheet. - * @returns {void} - */ - setActiveCell(rowIdx: number, colIdx: number, sheetIdx: number): void; - - /** This method is used to set active sheet index for the Spreadsheet. - * @param {number} Pass the active sheet index for Spreadsheet. - * @returns {void} - */ - setActiveSheetIndex(sheetIdx: number): void; - - /** This method is used to set border for the specified range of cells in the Spreadsheet. - * @param {any} Pass the border properties that you want to set. - * @param {string} Optional. If range is specified, it will set border for the specified range else it will use the selected range. - * @returns {void} - */ - setBorder(property: any, range?: string): void; - - /** This method is used to set the height for the rows in the Spreadsheet. - * @param {Array|any} Pass the row index and height of the rows. - * @returns {void} - */ - setHeightToRows(heightColl: any[]|any): void; - - /** This method is used to set the hyperlink in selected cells of the current sheet. - * @param {string|Array} If range is specified, it will set the hyperlink in range of the cells. - * @param {any} Pass cellAddress or webAddress - * @param {number} If we pass cellAddress then which sheet to be navigate in the applied link. - * @returns {void} - */ - setHyperlink(range: string|any[], link: any, sheetIdx: number): void; - - /** This method is used to set the readonly option for the specified range. - * @param {string|Array} Pass the range. - * @returns {void} - */ - setReadOnly(range?: string|any[]): void; - - /** This method is used to set the focus to the Spreadsheet. - * @returns {void} - */ - setSheetFocus(): void; - - /** This method is used to set the width for the columns in the Spreadsheet. - * @param {Array|any} Pass the column index and width of the columns. - * @returns {void} - */ - setWidthToColumns(widthColl: any[]|any): void; - - /** This method is used to rename the active sheet. - * @param {string} Pass the sheet name that you want to change the current active sheet name. - * @returns {void} - */ - sheetRename(sheetName: string): void; - - /** This method is used to display the activationPanel for the specified range name. - * @param {string} Pass the range name that you want to display the activation panel. - * @returns {void} - */ - showActivationPanel(rangeName: string): void; - - /** This method is used to show the hidden columns within the specified range in the Spreadsheet. - * @param {number} Index of the start column. - * @param {number} Optional. Index of the end column. - * @returns {void} - */ - showColumn(startColIdx: number, endColIdx: number): void; - - /** This method is used to show the formula bar in Spreadsheet. - * @returns {void} - */ - showFormulaBar(): void; - - /** This method is used to show/hide gridlines in active sheet in the Spreadsheet. - * @param {boolean} Pass {{'`true`' | markdownify}} to show the gridlines - * @returns {void} - */ - showGridlines(status: boolean): void; - - /** This method is used to show/hide the headers in active sheet in the Spreadsheet. - * @param {boolean} Pass {{'`true`' | markdownify}} to show the sheet headers. - * @returns {void} - */ - showHeadings(startRow: boolean): void; - - /** This method is used to show/hide pager in the Spreadsheet. - * @param {boolean} Pass {{'`true`' | markdownify}} to show pager. - * @returns {void} - */ - showPager(status: boolean): void; - - /** This method is used to show the hidden rows in the specified range in the Spreadsheet. - * @param {number} Index of the start row. - * @param {number} Optional. Index of the end row. - * @returns {void} - */ - showRow(startRow: number, endRow: number): void; - - /** This method is used to show waiting pop-up in Spreadsheet. - * @returns {void} - */ - showWaitingPopUp(): void; - - /** This method is used to unfreeze the frozen rows and columns in the Spreadsheet. - * @returns {void} - */ - unfreezePanes(): void; - - /** This method is used to unhide the sheet based on specified sheet name or sheet index. - * @param {string|number} Pass the sheet name or index that you want to unhide. - * @returns {void} - */ - unhideSheet(sheetInfo: string|number): void; - - /** This method is used to unmerge the selected range of cells in the Spreadsheet. - * @param {string} Optional. If the range is specified, then it will un merge the specified range else it will use the current selected range. - * @returns {void} - */ - unmergeCells(range?: string): void; - - /** This method is used to unwrap the selected range of cells in the Spreadsheet. - * @param {Array|string} Optional. If the range is specified, then it will update unwrap in the specified range else it will use the current selected range. - * @returns {void} - */ - unWrapText(range?: any[]|string): void; - - /** This method is used to update the data for the specified range of cells in the Spreadsheet. - * @param {any} Pass the cells data that you want to update. - * @param {Array|string} Optional. If range is specified, it will update data for the specified range else it will use the current selected range. - * @returns {void} - */ - updateData(data: any, range?: any[]|string): void; - - /** This method is used to update the formula bar in the Spreadsheet. - * @returns {void} - */ - updateFormulaBar(): void; - - /** This method is used to update the range of cells based on the specified settings which we want to update in the Spreadsheet. - * @param {number} Pass the sheet index that you want to update. - * @param {any} Pass the dataSource, startCell and showHeader values as settings. - * @returns {void} - */ - updateRange(sheetIdx: number, settings: any): void; - - /** This method is used to update the details for custom undo and redo operations. - * @param {any} Pass the details to update undo and redo collection - * @returns {void} - */ - updateUndoRedoCollection(details: any): void; - - /** This method is used to update the unique data for the specified range of cells in Spreadsheet. - * @param {any} Pass the data that you want to update in the particular range - * @param {Array|string} Optional. If range is specified, it will update data for the specified range else it will use the current selected range. - * @param {any} Optional. It specifies whether to skip element processing or not. - * @returns {void} - */ - updateUniqueData(data: any, range?: any[]|string, skipCell?: any): void; - - /** This method is used to wrap the selected range of cells in the Spreadsheet. - * @param {Array|string} Optional. If the range is specified, then it will update wrap in the specified range else it will use the current selected range. - * @returns {void} - */ - wrapText(range?: any[]|string): void; - - XLCellType: Spreadsheet.XLCellType; - - XLCFormat: Spreadsheet.XLCFormat; - - XLChart: Spreadsheet.XLChart; - - XLClipboard: Spreadsheet.XLClipboard; - - XLComment: Spreadsheet.XLComment; - - XLCMenu: Spreadsheet.XLCMenu; - - XLDragDrop: Spreadsheet.XLDragDrop; - - XLDragFill: Spreadsheet.XLDragFill; - - XLEdit: Spreadsheet.XLEdit; - - XLExport: Spreadsheet.XLExport; - - /** This method is used to get the export properties in the Spreadsheet. - * @returns {any} - */ - getExportProps(): any; - - XLFilter: Spreadsheet.XLFilter; - - XLFormat: Spreadsheet.XLFormat; - - XLFreeze: Spreadsheet.XLFreeze; - - XLPivot: Spreadsheet.XLPivot; - - XLPrint: Spreadsheet.XLPrint; - - XLResize: Spreadsheet.XLResize; - - XLRibbon: Spreadsheet.XLRibbon; - - XLSearch: Spreadsheet.XLSearch; - - XLSelection: Spreadsheet.XLSelection; - - XLShape: Spreadsheet.XLShape; - - XLSort: Spreadsheet.XLSort; - - XLValidate: Spreadsheet.XLValidate; -} -export namespace Spreadsheet { - -export interface XLCellType { - - /** This method is used to set a cell type from the specified range of cells in the spreadsheet. - * @param {string} Pass the range where you want apply cell type. - * @param {any} Pass type of cell type and its settings. - * @param {number} Optional. Pass sheet index. - * @returns {void} - */ - addCellTypes(range: string, settings: any, sheetIdx: number): void; - - /** This method is used to remove cell type from the specified range of cells in the Spreadsheet. - * @param {string|Array} Pass the range where you want remove cell type. - * @param {number} Optional. Pass sheet index. - * @returns {void} - */ - removeCellTypes(range: string|any[], sheetIdx: number): void; -} - -export interface XLCFormat { - - /** This method is used to clear the applied conditional formatting rules in the Spreadsheet. - * @param {boolean} Pass {{'`true`' | markdownify}} if you want to clear rules from selected cells else it will clear rules from entire sheet. - * @param {Array|string} Optional. If range is specified, it will clear rules for the specified range else it will use the current selected range. - * @returns {void} - */ - clearCF(isSelected: boolean, range: any[]|string): void; - - /** This method is used to get the applied conditional formatting rules as array of objects based on the specified row Index and column Index in the Spreadsheet. - * @param {number} Pass the row index. - * @param {number} Pass the column index. - * @returns {Array} - */ - getCFRule(rowIdx: number, colIdx: number): any[]; - - /** This method is used to set the conditional formatting rule in the Spreadsheet. - * @param {any} Pass the rule to set. - * @returns {void} - */ - setCFRule(rule: any): void; -} - -export interface XLChart { - - /** This method is used to change the theme of the chart in the Spreadsheet. - * @param {string} Pass the chart id. - * @param {ej.datavisualization.Chart.Theme} Pass the chart theme which want to update. - * @returns {void} - */ - changeTheme(chartId: string, theme: ej.datavisualization.Chart.Theme): void; - - /** This method is used to change the type of the chart in the Spreadsheet. - * @param {string} Pass the chart id. - * @param {any} Pass the chart type. - * @returns {void} - */ - changeType(chartId: string, option: any): void; - - /** This method is used to change the data range of the chart in the Spreadsheet. - * @param {string} Pass the chart id. - * @param {string} X axis range of chart data. - * @param {string} Y axis range of chart data. - * @param {string} Legend range of chart data. - * @returns {void} - */ - changeDataRange(chartId: string, xRange: string, yRange: string, lRange: string): void; - - /** This method is used to create a chart for specified range in Spreadsheet. - * @param {string|Array} Optional. If range is specified, it will create chart for the specified range else it will use the current selected range. - * @param {any} Optional. To pass the type of chart and chart name. - * @returns {void} - */ - createChart(range: string|any[], options: any): void; - - /** This method is used to refresh the chart in the Spreadsheet. - * @param {string} To pass the chart Id. - * @param {any} To pass the type of chart and chart name. - * @returns {void} - */ - refreshChart(id: string, options: any): void; - - /** This method is used to resize the chart of specified id in the Spreadsheet. - * @param {string} To pass the chart id. - * @param {number} To pass height value. - * @param {number} To pass the width value. - * @returns {void} - */ - resizeChart(id: string, height: number, width: number): void; - - /** This method is used to update the chart element, such as axes, titles, data labels, grid lines and legends in the Spreadsheet. - * @param {string} Pass the chart id. - * @param {ej.Spreadsheet.ChartProperties} Pass chart element value which you want to update. - * @returns {void} - */ - updateChartElement(chartId: string, value: ej.Spreadsheet.ChartProperties): void; - - /** This method is used switch row to columns and vice versa for chart in the Spreadsheet. So that the data is displayed in the chart the way you want. - * @param {string} Pass the chart id. - * @returns {void} - */ - switchRowColumn(chartId: string): void; -} - -export interface XLClipboard { - - /** This method is used to copy the selected cells in the Spreadsheet. - * @returns {void} - */ - copy(): void; - - /** This method is used to cut the selected cells in the Spreadsheet. - * @returns {void} - */ - cut(): void; - - /** This method is used to paste the cut or copied cells data in the Spreadsheet. - * @returns {void} - */ - paste(): void; -} - -export interface XLComment { - - /** This method is used to delete the comment in the specified range in Spreadsheet. - * @param {Array|string} Optional. If range is specified, it will delete comments for the specified range else it will use the current selected range. - * @param {number} Optional. If sheetIdx is specified, it will delete comment in specified sheet else it will use active sheet. - * @param {boolean} Optional. Pass {{'`true`' | markdownify}}, if you want to skip the hidden rows data. - * @returns {void} - */ - deleteComment(range: any[]|string, sheetIdx: number, skipHiddenRow: boolean): void; - - /** This method is used to edit the comment in the target Cell in Spreadsheet. - * @param {any} Optional. Pass the row index and column index of the cell which contains comment. - * @returns {void} - */ - editComment(targetCell: any): void; - - /** This method is used to find the next comment from the active cell in Spreadsheet. - * @returns {boolean} - */ - findNextComment(): boolean; - - /** This method is used to find the previous comment from the active cell in Spreadsheet. - * @returns {boolean} - */ - findPrevComment(): boolean; - - /** This method is used to get comment data for the specified cell. - * @param {HTMLElement} Pass the DOM element to get comment data as object. - * @returns {any} - */ - getComment(cell: HTMLElement): any; - - /** This method is used to set new comment in Spreadsheet. - * @param {string|Array} Optional. If we pass the range comment will set in the range otherwise it will set with selected cells. - * @param {string} Optional. Pass the comment data. - * @param {boolean} Optional. Pass {{'`true`' | markdownify}} to show comment in edit mode - * @param {boolean} Optional. Pass {{'`true`' | markdownify}} to show the user name - * @returns {void} - */ - setComment(range: string|any[], data: string, showEditPanel: boolean, showUserName: boolean): void; - - /** This method is used to show all the comments in the Spreadsheet. - * @returns {void} - */ - showAllComments(): void; - - /** This method is used to show or hide the specific comment in the Spreadsheet. - * @param {HTMLElement} Optional. Pass the cell DOM element to show or hide its comment. If pass empty argument active cell will processed. - * @returns {void} - */ - showHideComment(targetCell: HTMLElement): void; -} - -export interface XLCMenu { - - /** This method is used to dynamically add items in the context menu. - * @param {string} Specifies the context menu type in which the item to be inserted. - * @param {Array} Pass the items to be inserted - * @param {string} Specifies the type of operation to be performed - * @returns {void} - */ - addItem(target: string, itemColl: any[], operation: string): void; - - /** This method is used to change data source in the context menu. - * @param {string} Specifies the context menu type to bind the data source. - * @param {Array} Pass the data source to be binded - * @returns {void} - */ - changeDataSource(target: string, data: any[]): void; - - /** This method is used to disable the items in the context menu. - * @param {string} Specifies the context menu type in which the item to be disabled. - * @param {Array} Specifies the Menu Item id collection to be disabled - * @returns {void} - */ - disableItem(target: string, idxColl: any[]): void; - - /** This method is used to enable the items in the context menu. - * @param {string} Specifies the context menu type in which the item to be enabled. - * @param {Array} Specifies the Menu Item id collection to be enabled - * @returns {void} - */ - enableItem(target: string, idxColl: any[]): void; - - /** This method is used to remove the items in the context menu. - * @param {string} Specifies the context menu type in which the item to be removed. - * @param {Array} Specifies the Menu Item id collection to be removed - * @returns {void} - */ - removeItem(target: string, idxColl: any[]): void; -} - -export interface XLDragDrop { - - /** This method is used to drag and drop the selected range of cells to destination range in the Spreadsheet. - * @param {any|Array} Pass the source range to perform drag and drop. - * @param {any|Array} Pass the destination range to drop the dragged cells. - * @returns {void} - */ - moveRangeTo(sourceRange: any|any[], destinationRange: any|any[]): void; -} - -export interface XLDragFill { - - /** This method is used to perform auto fill in Spreadsheet. - * @param {any} Pass the options to perform auto fill in Spreadsheet. - * @returns {void} - */ - autoFill(options: any): void; - - /** This method is used to hide the auto fill element in the Spreadsheet. - * @returns {void} - */ - hideAutoFillElement(): void; - - /** This method is used to hide the auto fill options in the Spreadsheet. - * @returns {void} - */ - hideAutoFillOptions(): void; - - /** This method is used to set position of the auto fill element in the Spreadsheet. - * @param {boolean} Pass the isDragFill option as {{'`boolean`' | markdownify}} value to show auto fill options in Spreadsheet. - * @returns {void} - */ - positionAutoFillElement(isDragFill: boolean): void; -} - -export interface XLEdit { - - /** This method is used to calculate formulas in the specified sheet. - * @param {number} Optional. If sheet index is specified, then it will calculate formulas in the specified sheet only else it will calculate formulas in all sheets. - * @returns {void} - */ - calcNow(sheetIdx: number): void; - - /** This method is used to edit a particular cell based on the row index and column index in the Spreadsheet. - * @param {number} Pass the row index to edit particular cell. - * @param {number} Pass the column index to edit particular cell. - * @param {boolean} Pass {{'`true`' | markdownify}}, if you want to maintain previous cell value. - * @returns {void} - */ - editCell(rowIdx: number, colIdx: number, oldData: boolean): void; - - /** This method is used to get the property value of particular cell, based on the row and column index in the Spreadsheet. - * @param {number} Pass the row index to get the property value. - * @param {number} Pass the column index to get the property value. - * @param {string} Optional. Pass the property name that you want("value", "value2", "type", "cFormatRule", "range", "thousandSeparator", "rule", "format", "border", "picture", - * "chart", "calcValue", "align", "hyperlink", "formats", "borders", "tformats", "tborders", "isFilterHeader", "filterState", "tableName", "comment", "formatStr", - * "decimalPlaces", "cellType"). - * @param {number} Optional. Pass the index of the sheet. - * @returns {any|string|Array} - */ - getPropertyValue(rowIdx: number, colIdx: number, prop: string, sheetIdx: number): any|string|any[]; - - /** This method is used to get the property value in specified cell in Spreadsheet. - * @param {HTMLElement} Pass the cell element to get property value. - * @param {string} Pass the property name that you want ("value", "value2", "type", "cFormatRule", "range", "thousandSeparator", "rule", "format", "border", - * "picture", "chart", "calcValue", "align", "hyperlink", "formats", "borders", "tformats", "tborders", "isFilterHeader", "filterState", "tableName", - * "comment", "formatStr", "decimalPlaces", "cellType"). - * @param {number} Pass the index of sheet. - * @returns {any|string|Array} - */ - getPropertyValueByElem(elem: HTMLElement, property: string, sheetIdx: number): any|string|any[]; - - /** This method is used to save the edited cell value in the Spreadsheet. - * @returns {void} - */ - saveCell(): void; - - /** This method is used to update a particular cell value in the Spreadsheet. - * @param {any} Pass row index and column index of the cell. - * @param {string|number} Pass the cell value. - * @returns {void} - */ - updateCell(cell: any, value: string|number): void; - - /** This method is used to update a particular cell value and its format in the Spreadsheet. - * @param {any} Pass row index and column index of the cell. - * @param {string|number} Pass the cell value. - * @param {string} Pass the class name to update format. - * @param {number} Pass sheet index. - * @returns {void} - */ - updateCellValue(cellIdx: any, val: string|number, formatClass: string, sheetIdx: number): void; -} - -export interface XLExport { - - /** This method is used to save the sheet data as Excel ,CSV or PDF document (.xls, .xlsx .csv, .pdf) in Spreadsheet. - * @param {string} Pass the export type that you want. - * @returns {void} - */ - export(type: string): void; - - /** This method is used to get the export properties in the Spreadsheet. - * @returns {any} - */ - getExportProps(): any; -} - -export interface XLFilter { - - /** This method is used to clear the filter in filtered columns in the Spreadsheet. - * @returns {void} - */ - clearFilter(): void; - - /** This method is used to apply filter for the selected range of cells in the Spreadsheet. - * @param {string|Array} Pass the range of the selected cells. - * @returns {void} - */ - filter(range: string|any[]): void; - - /** This method is used to apply filter for the column by active cell's value in the Spreadsheet. - * @returns {void} - */ - filterByActiveCell(): void; -} - -export interface XLFormat { - - /** This method is used to convert table range to normal range. - * @param {any} Pass the sheet index and table id. - * @returns {void} - */ - convertToRange(options: any): void; - - /** This method is used to create a table for the selected range of cells in the Spreadsheet. - * @param {any} Pass the table object. - * @param {string|Array} Optional. If the range is specified, then it will create table in the specified range else it will use the current selected range. - * @returns {string} - */ - createTable(tableObject: any, range: string|any[]): string; - - /** This method is used to set format style and values in a cell or range of cells. - * @param {any} Pass the formatObject which contains style, type, format, groupSeparator and decimalPlaces. - * @param {string} Pass the range to format cells. - * @returns {void} - */ - format(formatObj: any, range: string): void; - - /** This method is used to remove the style in the specified range. - * @param {Array|string} Pass the cell range . - * @param {any} Optional. Pass the options for which the style gets removed. - * @returns {void} - */ - removeStyle(range: any[]|string, options: any): void; - - /** This method is used to remove table with specified tableId in the Spreadsheet. - * @param {number} Pass the tableId that you want to remove. - * @returns {void} - */ - removeTable(tableId: number): void; - - /** This method is used to update the decimal places for numeric value for the selected range of cells in the Spreadsheet. - * @param {string} Pass the decimal places type in increment/decrement. - * @param {string|Array} Pass the range. - * @returns {void} - */ - updateDecimalPlaces(type: string, range: string|any[]): void; - - /** This method is used to update the format for the selected range of cells in the Spreadsheet. - * @param {any} Pass the format object that you want to update. - * @param {Array} Optional. If the range is specified, then it will update format in the specified range else it will use the current selected range. - * @returns {void} - */ - updateFormat(formatObj: any, range: any[]): void; - - /** This method is used to update the unique format for selected range of cells in the Spreadsheet. - * @param {string} Pass the unique format class. - * @param {Array} Optional. If the range is specified, then it will update format in the specified range else it will use the current selected range. - * @returns {void} - */ - updateUniqueFormat(formatClass: string, range: any[]): void; -} - -export interface XLFreeze { - - /** This method is used to freeze columns upto the specified column index in the Spreadsheet. - * @param {number} Index of the column to be freeze. - * @returns {void} - */ - freezeColumns(colIdx: number): void; - - /** This method is used to freeze the first column in the Spreadsheet. - * @returns {void} - */ - freezeLeftColumn(): void; - - /** This method is used to freeze rows and columns before the specified cell in the Spreadsheet. - * @param {any} Row index and column index of the cell which you want to freeze. - * @returns {void} - */ - freezePanes(cell: any): void; - - /** This method is used to freeze rows upto the specified row index in the Spreadsheet. - * @param {number} Index of the row to be freeze. - * @returns {void} - */ - freezeRows(rowIdx: number): void; - - /** This method is used to freeze the top row in the Spreadsheet. - * @returns {void} - */ - freezeTopRow(): void; -} - -export interface XLPivot { - - /** This property is used to clear the pivot table list in Spreadsheet. - * @param {string} Pass the name of the pivot table. - * @returns {void} - */ - clearPivotFieldList(pivotName: string): void; - - /** This method is used to create pivot table. - * @param {string} It specifies the range for which the pivot table is created. - * @param {string} It specifies the location in which the pivot table is created. - * @param {string} It specifies the name of the pivot table. - * @param {any} Pass the pivot table settings. - * @param {any} Pass the pivot range, sheet index, address and data source . - * @returns {string} - */ - createPivotTable(range: string, location: string, name: string, settings: any, pvt: any): string; - - /** This method is used to delete the pivot table which is selected. - * @param {string} Pass the name of the pivot table. - * @returns {void} - */ - deletePivotTable(pivotName: string): void; - - /** This method is used to refresh data in pivot table. - * @param {string} Optional. Pass the name of the pivot table. - * @param {number} Optional. Pass the index of the sheet. - * @returns {void} - */ - refreshDataSource(name: string, sheetIdx: number): void; -} - -export interface XLPrint { - - /** This method is used to print the selected contents in the Spreadsheet. - * @returns {void} - */ - printSelection(): void; - - /** This method is used to print the entire contents in the active sheet. - * @returns {void} - */ - printSheet(): void; -} - -export interface XLResize { - - /** This method is used to fit the height of rows in the Spreadsheet. - * @param {Array} Optional. Pass row index collection that you want to fit its height. - * @returns {void} - */ - fitHeight(rowIndexes: any[]): void; - - /** This method is used to fit the width of columns in the Spreadsheet. - * @param {Array} Optional. Pass column index collection that you want to fit its width. - * @returns {void} - */ - fitWidth(colIndexes: any[]): void; - - /** This method is used to get the column width of the specified column index in the Spreadsheet. - * @param {number} Pass the column index. - * @returns {number} - */ - getColWidth(colIdx: number): number; - - /** This method is used to get the row height of the specified row index in the Spreadsheet. - * @param {number} Pass the row index which you want to find its height. - * @returns {number} - */ - getRowHeight(rowIdx: number): number; - - /** This method is used to set the column width of the specified column index in the Spreadsheet. - * @param {number} Pass the column index. - * @param {number} Pass the width value that you want to set. - * @returns {void} - */ - setColWidth(colIdx: number, size: number): void; - - /** This method is used to set the row height of the specified row index in the Spreadsheet. - * @param {number} Pass the row index. - * @param {number} Pass the height value that you want to set. - * @returns {void} - */ - setRowHeight(rowIdx: number, size: number): void; -} - -export interface XLRibbon { - - /** This method is used to add a new item in the backstage. - * @param {any} Specifies the item to be added in the backstage. - * @param {number} pass the index of the item to be added in the backstage. - * @returns {void} - */ - addBackStageItem(pageItem: any, index: number): void; - - /** This method is used to dynamically add the contextual tabs in the ribbon. - * @param {any} Specifies the contextual tab set object. - * @param {number} pass the index of the contextual tab. - * @returns {void} - */ - addContextualTabs(contextualTabSet: any, index: number): void; - - /** This method is used to dynamically add the menu item in the file menu. - * @param {Array} Specifies the item to be added - * @param {number} pass the index of the menu item. - * @returns {void} - */ - addMenuItem(item: any[], index: number): void; - - /** This method is used to add a new name in the Spreadsheet name manager. - * @param {string} Pass the name that you want to define in name manager. - * @param {string} Pass the cell reference. - * @param {string} Optional. Pass comment, if you want. - * @param {number} Optional. Pass the sheet index. - * @returns {void} - */ - addNamedRange(name: string, refersTo: string, comment: string, sheetIdx: number): void; - - /** This method is used to dynamically add the tab in the ribbon. - * @param {Array} Specifies the text to be displayed in the tab. - * @param {number} pass the groups to be displayed in the ribbon tab. - * @param {number} pass the index of the tab. - * @returns {void} - */ - addTab(tabText: any[], ribbonGroups: number, index: number): void; - - /** This method is used to dynamically add the tab group in the ribbon. - * @param {number} Specifies the ribbon tab index. - * @param {any} pass the groups to be displayed in the ribbon tab. - * @param {number} pass the index of the ribbon group. - * @returns {void} - */ - addTabGroup(tabIndex: number, tabGroup: any, groupIndex: number): void; - - /** This method is used to insert the few type (SUM, MAX, MIN, AVG, COUNT) of formulas in the selected range of cells in the Spreadsheet. - * @param {string} To pass the type("SUM","MAX","MIN","AVG","COUNT"). - * @param {string|Array} If range is specified, it will apply auto sum for the specified range else it will use the current selected range. - * @returns {void} - */ - autoSum(type: string, range: string|any[]): void; - - /** This method is used to hide the file menu in the ribbon tab. - * @returns {void} - */ - hideMenu(): void; - - /** This method is used to remove the item from the backstage in the spreadsheet. - * @param {number} Specifies the index of the item to be removed from backstage. - * @returns {void} - */ - removeBackStageItem(index: number): void; - - /** This method is used to remove the menu item form file menu in spreadsheet. - * @param {number} Specifies the index of the item to be removed from the file menu. - * @returns {void} - */ - removeMenuItem(index: number): void; - - /** This method is used to delete the defined name in the Spreadsheet name manager. - * @param {string} Pass the defined name that you want to remove from name manager. - * @returns {void} - */ - removeNamedRange(name: string): void; - - /** This method is used to remove the tab form ribbon in the spreadsheet. - * @param {number} Specifies the index of the tab to be removed from the ribbon. - * @param {boolean} pass the boolean value to remove the tab from ribbon - * @returns {void} - */ - removeTab(index: number, isRemoveMenu: boolean): void; - - /** This method is used to remove the tab group form ribbon in the spreadsheet. - * @param {number} Specifies the index of the tab group to be removed from the ribbon. - * @param {string} Specifies the text to be displayed in the tab group - * @returns {void} - */ - removeTabGroup(tabIndex: number, groupText: string): void; - - /** This method is used to show the file menu in the ribbon tab. - * @returns {void} - */ - showMenu(): void; - - /** This method is used to update the menu item in the file menu. - * @param {any} Specifies the menu item to be updated in the ribbon - * @param {number} pass the index of the item to be updated - * @returns {void} - */ - updateMenuItem(item: any, index: number): void; - - /** This method is used to update the ribbon icons in the Spreadsheet. - * @returns {void} - */ - updateRibbonIcons(): void; -} - -export interface XLSearch { - - /** This method is used to find and replace all data by workbook in the Spreadsheet. - * @param {string} Pass the search data. - * @param {string} Pass the replace data. - * @param {boolean} Pass {{'`true`' | markdownify}}, if you want to match with case-sensitive. - * @param {boolean} Pass {{'`true`' | markdownify}}, if you want to match with entire cell contents. - * @returns {void} - */ - replaceAllByBook(findData: string, replaceData: string, isCSen: boolean, isEMatch: boolean): void; - - /** This method is used to find and replace all data by sheet in Spreadsheet. - * @param {string} Pass the search data. - * @param {string} Pass the replace data. - * @param {boolean} Pass {{'`true`' | markdownify}}, if you want to match with case-sensitive. - * @param {boolean} Pass {{'`true`' | markdownify}}, if you want to match with entire cell contents. - * @returns {void} - */ - replaceAllBySheet(findData: string, replaceData: string, isCSen: boolean, isEMatch: boolean): void; -} - -export interface XLSelection { - - /** This method is used to clear the selection of the active sheet in the Spreadsheet. - * @returns {void} - */ - clearAll(): void; - - /** This method is used to get the selected cells element based on specified sheet index in the Spreadsheet. - * @param {number} Pass the sheet index to get the cells element. - * @returns {HTMLElement} - */ - getSelectedCells(sheetIdx: number): HTMLElement; - - /** This method is used to refresh the selection in the Spreadsheet. - * @param {Array|string} Optional. Pass range to refresh selection. - * @returns {void} - */ - refreshSelection(range: any[]|string): void; - - /** This method is used to select a single column in the Spreadsheet. - * @param {number} Pass the column index value. - * @returns {void} - */ - selectColumn(colIdx: number): void; - - /** This method is used to select entire columns in a specified range (start index and end index) in the Spreadsheet. - * @param {number} Pass the column start index. - * @param {number} Pass the column end index. - * @returns {void} - */ - selectColumns(startIdx: number, endIdx: number): void; - - /** This method is used to select the specified range of cells in the Spreadsheet. - * @param {string} Pass range which want to select. - * @returns {void} - */ - selectRange(range: string): void; - - /** This method is used to select a single row in the Spreadsheet. - * @param {number} Pass the row index value. - * @returns {void} - */ - selectRow(rowIdx: number): void; - - /** This method is used to select entire rows in a specified range (start index and end index) in the Spreadsheet. - * @param {number} Pass the start row index. - * @param {number} Pass the end row index. - * @returns {void} - */ - selectRows(startIdx: number, endIdx: number): void; - - /** This method is used to select all cells in active sheet. - * @returns {void} - */ - selectSheet(): void; -} - -export interface XLShape { - - /** This method is used to set a picture in the Spreadsheet. - * @param {string} Pass the range of the cell. - * @param {string} Pass the path of the specified image. - * @param {number} Optional. Pass the width of the image that you want to set. - * @param {number} Optional. Pass the height of the image that you want to set. - * @param {number} Optional. Pass the top of the image that you want to set. - * @param {number} Optional. Pass the left of the image that you want to set. - * @returns {string} - */ - setPicture(range: string, url: string, width: number, height: number, top: number, left: number): string; -} - -export interface XLSort { - - /** This method is used to sort a particular range of cells based on its cell or font color in the Spreadsheet. - * @param {string} Pass {{'`PutCellColor`' | markdownify}} to sort by cell color or {{'`PutFontColor`' | markdownify}} for sort by font color. - * @param {any} Pass the HEX color code to sort. - * @param {string} Pass the range - * @returns {void} - */ - sortByColor(operation: string, color: any, range: string): void; - - /** This method is used to sort a particular range of cells based on its values in the Spreadsheet. - * @param {Array|string} Pass the range to sort. - * @param {string} Pass the column name. - * @param {any} Pass the direction to sort (ascending or descending). - * @returns {boolean} - */ - sortByRange(range: any[]|string, columnName: string, direction: any): boolean; -} - -export interface XLValidate { - - /** This method is used to apply data validation rules in a selected range of cells based on the defined condition in the Spreadsheet. - * @param {string|Array} If range is specified, it will apply rules for the specified range else it will use the current selected range. - * @param {Array} Pass the validation condition, value1 and value2. - * @param {string} Pass the data type. - * @param {boolean} Pass {{'`true`' | markdownify}} if you ignore blank values. - * @param {boolean} Pass {{'`true`' | markdownify}} if you want to show an error alert. - * @returns {void} - */ - applyDVRules(range: string|any[], values: any[], type: string, required: boolean, showErrorAlert: boolean): void; - - /** This method is used to clear the applied validation rules in a specified range of cells in the Spreadsheet. - * @param {string|Array} Optional. If range is specified, it will clear rules for the specified range else it will use the current selected range. - * @returns {void} - */ - clearDV(range: string|any[]): void; - - /** This method is used to highlight invalid data in a specified range of cells in the Spreadsheet. - * @param {string|Array} Optional. If range is specified, it will clear rules for the specified range else it will use the current selected range. - * @returns {void} - */ - highlightInvalidData(range: string|any[]): void; -} - -export interface Model { - - /** Gets or sets an active sheet index in the Spreadsheet. By defining this value, you can specify which sheet should be active in workbook. - * @Default {1} - */ - activeSheetIndex?: number; - - /** Gets or sets a value that indicates whether to enable or disable auto rendering of cell type in the Spreadsheet. - * @Default {false} - */ - allowAutoCellType?: boolean; - - /** Gets or sets a value that indicates whether to enable or disable auto fill feature in the Spreadsheet. - * @Default {true} - */ - allowAutoFill?: boolean; - - /** Gets or sets a value that indicates whether to enable or disable auto sum feature in the Spreadsheet. - * @Default {true} - */ - allowAutoSum?: boolean; - - /** Gets or sets a value that indicates whether to enable or disable cell format feature in the Spreadsheet. By enabling this, you can customize styles and number formats. - * @Default {true} - */ - allowCellFormatting?: boolean; - - /** Gets or sets a value that indicates whether to enable or disable cell type feature in the Spreadsheet. - * @Default {false} - */ - allowCellType?: boolean; - - /** Gets or sets a value that indicates whether to enable or disable chart feature in the Spreadsheet. By enabling this feature, you can create and customize charts in Spreadsheet. - * @Default {true} - */ - allowCharts?: boolean; - - /** Gets or sets a value that indicates whether to enable or disable clear feature in the Spreadsheet. - * @Default {true} - */ - allowClear?: boolean; - - /** Gets or sets a value that indicates whether to enable or disable clipboard feature in the Spreadsheet. By enabling this feature, you can perform cut/copy and paste operations in Spreadsheet. - * @Default {true} - */ - allowClipboard?: boolean; - - /** Gets or sets a value that indicates whether to enable or disable comment feature in the Spreadsheet. By enabling this, you can add/delete/modify comments in Spreadsheet. - * @Default {true} - */ - allowComments?: boolean; - - /** Gets or sets a value that indicates whether to enable or disable Conditional Format feature in the Spreadsheet. By enabling this, you can apply formatting to the selected range - * of cells based on the provided conditions (Greater than, Less than, Equal, Between, Contains, etc.). - * @Default {true} - */ - allowConditionalFormats?: boolean; - - /** Gets or sets a value that indicates whether to enable or disable data validation feature in the Spreadsheet. - * @Default {true} - */ - allowDataValidation?: boolean; - - /** Gets or sets a value that indicates whether to enable or disable the delete action in the Spreadsheet. By enabling this feature, you can delete existing rows, columns, cells and sheet. - * @Default {true} - */ - allowDelete?: boolean; - - /** Gets or sets a value that indicates whether to enable or disable drag and drop feature in the Spreadsheet. - * @Default {true} - */ - allowDragAndDrop?: boolean; - - /** Gets or sets a value that indicates whether to enable or disable the edit action in the Spreadsheet. - * @Default {true} - */ - allowEditing?: boolean; - - /** Gets or sets a value that indicates whether to enable or disable filtering feature in the Spreadsheet. Filtering can be used to limit the data displayed using required criteria. - * @Default {true} - */ - allowFiltering?: boolean; - - /** Gets or sets a value that indicates whether to enable or disable table feature in the Spreadsheet. By enabling this, you can render table in selected range. - * @Default {true} - */ - allowFormatAsTable?: boolean; - - /** Get or sets a value that indicates whether to enable or disable format painter feature in the Spreadsheet. By enabling this feature, you can copy - * the format from the selected range and apply it to another range. - * @Default {true} - */ - allowFormatPainter?: boolean; - - /** Gets or sets a value that indicates whether to enable or disable formula bar in the Spreadsheet. - * @Default {true} - */ - allowFormulaBar?: boolean; - - /** Gets or sets a value that indicates whether to enable or disable freeze pane support in Spreadsheet. After enabling this feature, - * you can use freeze top row, freeze first column and freeze panes options. - * @Default {false} - */ - allowFreezing?: boolean; - - /** Gets or sets a value that indicates whether to enable or disable hyperlink feature in the Spreadsheet. By enabling this feature, you can add hyperlink which is used to - * easily navigate to the cell reference from one sheet to another or a web page. - * @Default {true} - */ - allowHyperlink?: boolean; - - /** Gets or sets a value that indicates whether to enable or disable import feature in the Spreadsheet. By enabling this feature, you can open existing Spreadsheet documents. - * @Default {true} - */ - allowImport?: boolean; - - /** Gets or sets a value that indicates whether to enable or disable the insert action in the Spreadsheet. By enabling this feature, you can insert new rows, columns, cells and sheet. - * @Default {true} - */ - allowInsert?: boolean; - - /** Gets or sets a value that indicates whether to enable or disable keyboard navigation feature in the Spreadsheet. - * @Default {true} - */ - allowKeyboardNavigation?: boolean; - - /** Gets or sets a value that indicates whether to enable or disable lock cell feature in the Spreadsheet. - * @Default {true} - */ - allowLockCell?: boolean; - - /** Gets or sets a value that indicates whether to enable or disable merge feature in the Spreadsheet. - * @Default {true} - */ - allowMerging?: boolean; - - /** Gets or sets a value that indicates whether to enable or disable overflow feature in the Spreadsheet. - * @Default {true} - */ - allowOverflow?: boolean; - - /** Gets or sets a value that indicates whether to enable or disable resizing feature in the Spreadsheet. By enabling this feature, you can change the column width and - * row height by dragging its header boundaries. - * @Default {true} - */ - allowResizing?: boolean; - - /** Gets or sets a value that indicates whether to enable or disable find and replace feature in the Spreadsheet. By enabling this, you can easily find and replace - * a specific value in the sheet or workbook. By using goto behavior, you can select and highlight all cells that contains specific data or data types. - * @Default {true} - */ - allowSearching?: boolean; - - /** Gets or sets a value that indicates whether to enable or disable selection in the Spreadsheet. By enabling this feature, selected items will be highlighted. - * @Default {true} - */ - allowSelection?: boolean; - - /** Gets or sets a value that indicates whether to enable the sorting feature in the Spreadsheet. - * @Default {true} - */ - allowSorting?: boolean; - - /** Gets or sets a value that indicates whether to enable or disable undo and redo feature in the Spreadsheet. - * @Default {true} - */ - allowUndoRedo?: boolean; - - /** Gets or sets a value that indicates whether to enable or disable wrap text feature in the Spreadsheet. By enabling this, cell content can wrap to the next line, - * if the cell content exceeds the boundary of the cell. - * @Default {true} - */ - allowWrap?: boolean; - - /** Gets or sets a value that indicates to define the width of the activation panel in Spreadsheet. - * @Default {300} - */ - apWidth?: number; - - /** Gets or sets an object that indicates to customize the auto fill behavior in the Spreadsheet. - */ - autoFillSettings?: AutoFillSettings; - - /** Gets or sets an object that indicates to customize the chart behavior in the Spreadsheet. - */ - chartSettings?: ChartSettings; - - /** Gets or sets a value that defines the number of columns displayed in the sheet. - * @Default {21} - */ - columnCount?: number; - - /** Gets or sets a value that indicates to define the common width for each column in the Spreadsheet. - * @Default {64} - */ - columnWidth?: number; - - /** Gets or sets a value to add root CSS class for customizing Spreadsheet skins. - */ - cssClass?: string; - - /** Gets or sets a value that indicates custom formulas in Spreadsheet. - * @Default {[]} - */ - customFormulas?: any[]; - - /** Gets or sets a value that indicates whether to enable or disable context menu in the Spreadsheet. - * @Default {true} - */ - enableContextMenu?: boolean; - - /** Gets or sets a value that indicates whether to enable or disable pivot table in the Spreadsheet. - * @Default {false} - */ - enablePivotTable?: boolean; - - /** Gets or sets a value that indicates whether to enable or disable touch support in the Spreadsheet. - * @Default {true} - */ - enableTouch?: boolean; - - /** Gets or sets an object that indicates to customize the exporting behavior in Spreadsheet. - */ - exportSettings?: ExportSettings; - - /** Gets or sets an object that indicates to customize the format behavior in the Spreadsheet. - */ - formatSettings?: FormatSettings; - - /** Gets or sets an object that indicates to customize the import behavior in the Spreadsheet. - */ - importSettings?: ImportSettings; - - /** Gets or sets a value that indicates whether to enable or disable readonly support in the Spreadsheet. - * @Default {false} - */ - isReadOnly?: boolean; - - /** Gets or sets a value that indicates whether to customizing the user interface (UI) as locale-specific in order to display regional data (i.e.) - * in a language and culture specific to a particular country or region. - * @Default {en-US} - */ - locale?: string; - - /** Gets or sets an object that indicates to customize the picture behavior in the Spreadsheet. - */ - pictureSettings?: PictureSettings; - - /** Gets or sets an object that indicates to customize the print option in Spreadsheet. - */ - printSettings?: PrintSettings; - - /** Gets or sets an object that indicates to customize the ribbon settings in Spreadsheet. - */ - ribbonSettings?: RibbonSettings; - - /** Gets or sets a value that indicates whether to define the number of rows to be displayed in the sheet. - * @Default {20} - */ - rowCount?: number; - - /** Gets or sets a value that indicates to define the common height for each row in the sheet. - * @Default {20} - */ - rowHeight?: number; - - /** Gets or sets an object that indicates to customize the scroll options in the Spreadsheet. - */ - scrollSettings?: ScrollSettings; - - /** Gets or sets an object that indicates to customize the selection options in the Spreadsheet. - */ - selectionSettings?: SelectionSettings; - - /** Gets or sets a value that indicates to define the number of sheets to be created at the initial load. - * @Default {1} - */ - sheetCount?: number; - - /** Gets or sets an object that indicates to customize the sheet behavior in Spreadsheet. - */ - sheets?: Sheet[]; - - /** Gets or sets a value that indicates whether to show or hide pager in the Spreadsheet. - * @Default {true} - */ - showPager?: boolean; - - /** Gets or sets a value that indicates whether to show or hide ribbon in the Spreadsheet. - * @Default {true} - */ - showRibbon?: boolean; - - /** This is used to set the number of undo-redo steps in the Spreadsheet. - * @Default {20} - */ - undoRedoStep?: number; - - /** Define the username for the Spreadsheet which is displayed in comment. - * @Default {User Name} - */ - userName?: string; - - /** Triggered for every action before its starts. */ - actionBegin?(e: ActionBeginEventArgs): void; - - /** Triggered for every action complete. */ - actionComplete?(e: ActionCompleteEventArgs): void; - - /** Triggered when the auto fill operation begins. */ - autoFillBegin?(e: AutoFillBeginEventArgs): void; - - /** Triggered when the auto fill operation completes. */ - autoFillComplete?(e: AutoFillCompleteEventArgs): void; - - /** Triggered before the batch save. */ - beforeBatchSave?(e: BeforeBatchSaveEventArgs): void; - - /** Triggered before the cells to be formatted. */ - beforeCellFormat?(e: BeforeCellFormatEventArgs): void; - - /** Triggered before the cell selection. */ - beforeCellSelect?(e: BeforeCellSelectEventArgs): void; - - /** Triggered before the selected cells are dropped. */ - beforeDrop?(e: BeforeDropEventArgs): void; - - /** Triggered while start to edit the comment. */ - beforeEditComment?(e: BeforeEditCommentEventArgs): void; - - /** Triggered before the contextmenu is open. */ - beforeOpen?(e: BeforeOpenEventArgs): void; - - /** Triggered before the activation panel is open. */ - beforePanelOpen?(e: BeforePanelOpenEventArgs): void; - - /** Triggered when click on sheet cell. */ - cellClick?(e: CellClickEventArgs): void; - - /** Triggered when the cell is edited. */ - cellEdit?(e: CellEditEventArgs): void; - - /** Triggered while cell is formatting. */ - cellFormatting?(e: CellFormattingEventArgs): void; - - /** Triggered when mouse hover on cell in sheets. */ - cellHover?(e: CellHoverEventArgs): void; - - /** Triggered when save the edited cell. */ - cellSave?(e: CellSaveEventArgs): void; - - /** Triggered when the cell is selected. */ - cellSelected?(e: CellSelectedEventArgs): void; - - /** Triggered when click the contextmenu items. */ - contextMenuClick?(e: ContextMenuClickEventArgs): void; - - /** Triggered when the selected cells are being dragged. */ - drag?(e: DragEventArgs): void; - - /** Triggered when you start to drag the picture or chart. */ - dragShape?(e: DragShapeEventArgs): void; - - /** Triggered when the selected cells are initiated to drag. */ - dragStart?(e: DragStartEventArgs): void; - - /** Triggered when the selected cells are dropped. */ - drop?(e: DropEventArgs): void; - - /** Triggered before the range editing starts. */ - editRangeBegin?(e: EditRangeBeginEventArgs): void; - - /** Triggered after range editing completes. */ - editRangeComplete?(e: EditRangeCompleteEventArgs): void; - - /** Triggered when the key is pressed down. */ - keyDown?(e: KeyDownEventArgs): void; - - /** Triggered when the key is released. */ - keyUp?(e: KeyUpEventArgs): void; - - /** Triggered before the sheet is loaded. */ - load?(e: LoadEventArgs): void; - - /** Triggered after the sheet is loaded. */ - loadComplete?(e: LoadCompleteEventArgs): void; - - /** Triggered every click of the menu item. */ - menuClick?(e: MenuClickEventArgs): void; - - /** Triggered when a file is imported. */ - onImport?(e: OnImportEventArgs): void; - - /** Triggered when import sheet is failed to open. */ - openFailure?(e: OpenFailureEventArgs): void; - - /** Triggered when pager item is clicked in the Spreadsheet. */ - pagerClick?(e: PagerClickEventArgs): void; - - /** Triggered when you start resizing the chart, picture, row and column. */ - resizeStart?(e: ResizeStartEventArgs): void; - - /** Triggered after end of resizing the chart, picture, row and column. */ - resizeEnd?(e: ResizeEndEventArgs): void; - - /** Triggered when click on the ribbon. */ - ribbonClick?(e: RibbonClickEventArgs): void; - - /** Triggered when the chart series rendering. */ - seriesRendering?(e: SeriesRenderingEventArgs): void; - - /** Triggered when click the ribbon tab. */ - tabClick?(e: TabClickEventArgs): void; - - /** Triggered when select the ribbon tab. */ - tabSelect?(e: TabSelectEventArgs): void; -} - -export interface ActionBeginEventArgs { - - /** Returns the applied style format object. - */ - afterFormat?: any; - - /** Returns the applied style format object. - */ - beforeFormat?: any; - - /** Returns the sheet index. - */ - sheetIdx?: number; - - /** Returns the cell range. - */ - range?: any[]; - - /** Returns the action format. - */ - reqType?: string; - - /** Returns goto index while paging. - */ - gotoIdx?: number; - - /** Returns boolean value. If create new sheet it returns true. - */ - newSheet?: boolean; - - /** Return column name while sorting. - */ - columnName?: string; - - /** Returns selected columns while sorting or filtering begins. - */ - colSelected?: number; - - /** Returns sort direction while sort action begins. - */ - sortDirection?: string; -} - -export interface ActionCompleteEventArgs { - - /** Returns Spreadsheet model. - */ - model?: ej.Spreadsheet.Model; - - /** Returns the applied cell format object. - */ - selectedCell?: any[]|any; - - /** Returns the sheet index. - */ - sheetIdx?: number; - - /** Returns the request type. - */ - reqType?: string; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface AutoFillBeginEventArgs { - - /** Returns auto fill begin cell range. - */ - dataRange?: any[]; - - /** Returns which direction drag the auto fill. - */ - direction?: string; - - /** Returns fill cells range. - */ - fillRange?: any[]; - - /** Returns the auto fill type. - */ - fillType?: string; - - /** Returns the sheet index. - */ - sheetIdx?: number; - - /** Returns the Spreadsheet model. - */ - model?: ej.Spreadsheet.Model; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the cancel option value. - */ - cancel?: boolean; -} - -export interface AutoFillCompleteEventArgs { - - /** Returns auto fill begin cell range. - */ - dataRange?: any[]; - - /** Returns which direction to drag the auto fill. - */ - direction?: string; - - /** Returns fill cells range. - */ - fillRange?: any[]; - - /** Returns the auto fill type. - */ - fillType?: string; - - /** Returns the sheet index. - */ - sheetIdx?: number; - - /** Returns the Spreadsheet model. - */ - model?: ej.Spreadsheet.Model; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the cancel option value. - */ - cancel?: boolean; -} - -export interface BeforeBatchSaveEventArgs { - - /** Returns the sheet index. - */ - sheetIdx?: number; - - /** Returns the query, primary key,batch changes for the data Source. - */ - dataSetting?: any; - - /** Returns the changed record object. - */ - batchChanges?: any; -} - -export interface BeforeCellFormatEventArgs { - - /** Returns the sheet index. - */ - sheetIdx?: number; - - /** Returns the applied style format object. - */ - format?: any; - - /** Returns the selected cells. - */ - cells?: any[]|any; - - /** Returns the Spreadsheet model. - */ - model?: ej.Spreadsheet.Model; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface BeforeCellSelectEventArgs { - - /** Returns the previous cell range. - */ - prevRange?: any[]; - - /** Returns the current cell range. - */ - currRange?: any[]; - - /** Returns the Spreadsheet model. - */ - model?: ej.Spreadsheet.Model; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the cancel option value. - */ - cancel?: boolean; -} - -export interface BeforeDropEventArgs { - - /** Returns the sheet index. - */ - sheetIdx?: number; - - /** Returns the current cell row and column index. - */ - currentCell?: any; - - /** Returns the drag cells range object. - */ - dragAndDropRange?: any; - - /** Returns the cell Overwriting alert option value. - */ - preventAlert?: boolean; - - /** Returns the Spreadsheet model. - */ - model?: ej.Spreadsheet.Model; - - /** Returns the target item. - */ - target?: HTMLElement; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the cancel option value. - */ - cancel?: boolean; -} - -export interface BeforeEditCommentEventArgs { - - /** Returns the sheet index. - */ - sheetIdx?: number; - - /** Returns the comment cell index. - */ - cellIndex?: any; - - /** Returns the disable option value. - */ - disable?: boolean; - - /** Returns the Spreadsheet model. - */ - model?: any; - - /** Returns the value of the comment - */ - value?: string; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the cancel option value. - */ - cancel?: boolean; -} - -export interface BeforeOpenEventArgs { - - /** Returns the target element. - */ - target?: HTMLElement; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the Spreadsheet model. - */ - model?: ej.Spreadsheet.Model; - - /** Returns the cancel option value. - */ - cancel?: boolean; -} - -export interface BeforePanelOpenEventArgs { - - /** Returns the sheet index. - */ - sheetIdx?: number; - - /** Returns the activation panel element. - */ - activationPanel?: any; - - /** Returns the range option value. - */ - range?: any; - - /** Returns the Spreadsheet model. - */ - model?: ej.Spreadsheet.Model; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the cancel option value. - */ - cancel?: boolean; -} - -export interface CellClickEventArgs { - - /** Returns the click cell element. - */ - cell?: HTMLElement; - - /** Returns the column index of clicked cell. - */ - columnIndex?: number; - - /** Returns the row index of clicked cell. - */ - rowIndex?: number; - - /** Returns the column name of clicked cell. - */ - columnName?: string; - - /** Returns the column information. - */ - columnObject?: any; - - /** Returns the Spreadsheet model. - */ - model?: ej.Spreadsheet.Model; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the target element. - */ - target?: HTMLElement; - - /** Returns the value of the cell. - */ - value?: string; - - /** Returns the cancel option value. - */ - cancel?: boolean; -} - -export interface CellEditEventArgs { - - /** Returns the click cell element. - */ - cell?: HTMLElement; - - /** Returns the columnName of clicked cell. - */ - columnName?: string; - - /** Returns the column field information. - */ - columnObject?: any; - - /** Returns the Spreadsheet model. - */ - model?: ej.Spreadsheet.Model; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the target element. - */ - target?: HTMLElement; - - /** Returns the cancel option value. - */ - cancel?: boolean; -} - -export interface CellFormattingEventArgs { - - /** Returns the sheet index - */ - SheetIdx?: number; - - /** Returns the applied style format object - */ - Format?: any; - - /** Returns the cell index. - */ - Cell?: number; - - /** Returns the name of the CSS theme. - */ - cssClass?: string; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the target element. - */ - target?: HTMLElement; - - /** Returns the Spreadsheet model. - */ - model?: ej.Spreadsheet.Model; -} - -export interface CellHoverEventArgs { - - /** Returns the target element. - */ - target?: HTMLElement; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the Spreadsheet model. - */ - model?: ej.Spreadsheet.Model; - - /** Returns the cancel option value. - */ - cancel?: boolean; -} - -export interface CellSaveEventArgs { - - /** Returns the save cell element. - */ - cell?: HTMLElement; - - /** Returns the columnName of clicked cell. - */ - columnName?: string; - - /** Returns the column field information. - */ - columnObject?: any; - - /** Returns the index of the row. - */ - rowIndex?: number; - - /** Returns the index of the column. - */ - colIndex?: number; - - /** Returns the Spreadsheet model. - */ - model?: ej.Spreadsheet.Model; - - /** Returns the cell previous value. - */ - pValue?: string; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the target element. - */ - target?: HTMLElement; - - /** Returns the cell value. - */ - value?: string; -} - -export interface CellSelectedEventArgs { - - /** Returns the active sheet index. - */ - sheetIdx?: number; - - /** Returns the selected range. - */ - selectedRange?: any[]; - - /** Returns the target element. - */ - target?: HTMLElement; - - /** Returns Spreadsheet model. - */ - model?: ej.Spreadsheet.Model; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the cancel option value. - */ - cancel?: boolean; -} - -export interface ContextMenuClickEventArgs { - - /** Returns target element Id. - */ - Id?: string; - - /** Returns the target element. - */ - element?: HTMLElement; - - /** Returns event information. - */ - event?: any; - - /** Returns target element and event information. - */ - events?: any; - - /** Returns the Spreadsheet model. - */ - model?: ej.Spreadsheet.Model; - - /** Returns target element parent Id. - */ - parentId?: string; - - /** Returns target element parent text. - */ - parentText?: string; - - /** Returns target element text. - */ - text?: string; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the cancel option value. - */ - cancel?: boolean; -} - -export interface DragEventArgs { - - /** Returns the sheet index. - */ - sheetIdx?: number; - - /** Returns the current cell row and column index. - */ - currentCell?: any; - - /** Returns the drag cells range object. - */ - dragAndDropRange?: any; - - /** Returns the Spreadsheet model. - */ - model?: ej.Spreadsheet.Model; - - /** Returns the target item. - */ - target?: HTMLElement; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the cancel option value. - */ - cancel?: boolean; -} - -export interface DragShapeEventArgs { - - /** Returns the Spreadsheet model. - */ - model?: any; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the target element. - */ - target?: HTMLElement; - - /** Returns the cancel option value. - */ - cancel?: boolean; -} - -export interface DragStartEventArgs { - - /** Returns the sheet index. - */ - sheetIdx?: number; - - /** Returns the current cell row and column index. - */ - currentCell?: any; - - /** Returns the drag cells range object. - */ - dragAndDropRange?: any; - - /** Returns the Spreadsheet model. - */ - model?: ej.Spreadsheet.Model; - - /** Returns the target item. - */ - target?: HTMLElement; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the cancel option value. - */ - cancel?: boolean; -} - -export interface DropEventArgs { - - /** Returns the sheet index. - */ - sheetIdx?: number; - - /** Returns the current cell row and column index. - */ - currentCell?: any; - - /** Returns the drag cells range object. - */ - dragAndDropRange?: any; - - /** Returns the Spreadsheet model. - */ - model?: ej.Spreadsheet.Model; - - /** Returns the target item. - */ - target?: HTMLElement; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the cancel option value. - */ - cancel?: boolean; -} - -export interface EditRangeBeginEventArgs { - - /** Returns the sheet index. - */ - sheetIdx?: number; - - /** Returns the Spreadsheet model. - */ - model?: ej.Spreadsheet.Model; - - /** Returns the range option value. - */ - range?: any; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the cancel option value. - */ - cancel?: boolean; -} - -export interface EditRangeCompleteEventArgs { - - /** Returns the sheet index. - */ - sheetIdx?: number; - - /** Returns the Spreadsheet model. - */ - model?: ej.Spreadsheet.Model; - - /** Returns the range option value. - */ - range?: any; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the cancel option value. - */ - cancel?: boolean; -} - -export interface KeyDownEventArgs { - - /** Returns the sheet index. - */ - sheetIndex?: number; - - /** Returns the Spreadsheet model. - */ - model?: ej.Spreadsheet.Model; - - /** Returns the boolean value. - */ - isCommentEdit?: boolean; - - /** Returns the boolean value. - */ - isEdit?: boolean; - - /** Returns the boolean value. - */ - isSheetRename?: boolean; - - /** Returns the target element. - */ - target?: HTMLElement; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the cancel option value. - */ - cancel?: boolean; -} - -export interface KeyUpEventArgs { - - /** Returns the sheet index. - */ - sheetIndex?: number; - - /** Returns the Spreadsheet model. - */ - model?: ej.Spreadsheet.Model; - - /** Returns the boolean value. - */ - isCommentEdit?: boolean; - - /** Returns the boolean value. - */ - isEdit?: boolean; - - /** Returns the boolean value. - */ - isSheetRename?: boolean; - - /** Returns the target element. - */ - target?: HTMLElement; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the cancel option value. - */ - cancel?: boolean; -} - -export interface LoadEventArgs { - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the Spreadsheet model. - */ - model?: ej.Spreadsheet.Model; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the active sheet index. - */ - sheetIndex?: number; -} - -export interface LoadCompleteEventArgs { - - /** Returns the Spreadsheet model. - */ - model?: ej.Spreadsheet.Model; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the cancel option value. - */ - cancel?: boolean; -} - -export interface MenuClickEventArgs { - - /** Returns menu click element. - */ - element?: HTMLElement; - - /** Returns the event information. - */ - event?: any; - - /** Returns the Spreadsheet model. - */ - model?: ej.Spreadsheet.Model; - - /** Returns target element parent Id. - */ - parentId?: string; - - /** Returns target element parent text. - */ - parentText?: string; - - /** Returns target element text. - */ - text?: string; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the cancel option value. - */ - cancel?: boolean; -} - -export interface OnImportEventArgs { - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the Spreadsheet model. - */ - model?: ej.Spreadsheet.Model; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the imported data. - */ - importData?: any; -} - -export interface OpenFailureEventArgs { - - /** Returns the failure type. - */ - failureType?: string; - - /** Returns the status index. - */ - status?: number; - - /** Returns the status in text. - */ - statusText?: string; - - /** Returns the Spreadsheet model. - */ - model?: ej.Spreadsheet.Model; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the cancel option value. - */ - cancel?: boolean; -} - -export interface PagerClickEventArgs { - - /** Returns the active sheet index. - */ - activeSheet?: number; - - /** Returns the new sheet index. - */ - gotoSheet?: number; - - /** Returns whether new sheet icon is clicked. - */ - newSheet?: boolean; - - /** Returns the Spreadsheet model. - */ - model?: ej.Spreadsheet.Model; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the target element. - */ - target?: HTMLElement; - - /** Returns the cancel option value. - */ - cancel?: boolean; -} - -export interface ResizeStartEventArgs { - - /** Returns the column index which column you start to resize. - */ - colIndex?: number; - - /** Returns the row index which row you start to resize. - */ - rowIndex?: number; - - /** Returns the Spreadsheet model. - */ - model?: any; - - /** Returns type of the request. - */ - reqType?: string; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the cancel option value. - */ - cancel?: boolean; -} - -export interface ResizeEndEventArgs { - - /** Returns the column index which you resized. - */ - colIndex?: number; - - /** Returns old width of the column or shape. - */ - oldWidth?: number; - - /** Returns new width of the column or shape. - */ - newWidth?: number; - - /** Returns the row index which you resized. - */ - rowIndex?: number; - - /** Returns old height of the row or shape. - */ - oldHeight?: number; - - /** Returns new height of the row or shape. - */ - newHeight?: number; - - /** Returns the Spreadsheet model. - */ - model?: any; - - /** Returns type of the request. - */ - reqType?: string; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the cancel option value. - */ - cancel?: boolean; -} - -export interface RibbonClickEventArgs { - - /** Returns element Id. - */ - Id?: string; - - /** Returns target information. - */ - prop?: any; - - /** Returns the Spreadsheet model. - */ - model?: ej.Spreadsheet.Model; - - /** Returns status. - */ - status?: boolean; - - /** Returns isChecked in boolean. - */ - isChecked?: boolean; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the target element. - */ - target?: HTMLElement; - - /** Returns the cancel option value. - */ - cancel?: boolean; -} - -export interface SeriesRenderingEventArgs { - - /** Returns chart data and chart information. - */ - data?: any; - - /** Returns the chart model. - */ - model?: ej.Spreadsheet.Model; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the cancel option value. - */ - cancel?: boolean; -} - -export interface TabClickEventArgs { - - /** Returns the active tab index. - */ - activeIndex?: number; - - /** Returns active tab header element. - */ - activeHeader?: any; - - /** Returns previous active tab header element. - */ - prevActiveHeader?: any; - - /** Returns previous active tab index. - */ - prevActiveIndex?: number; - - /** Returns the Spreadsheet model. - */ - model?: ej.Spreadsheet.Model; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the target element. - */ - target?: HTMLElement; - - /** Returns the cancel option value. - */ - cancel?: boolean; -} - -export interface TabSelectEventArgs { - - /** Returns the active tab index. - */ - activeIndex?: number; - - /** Returns active tab header element. - */ - activeHeader?: any; - - /** Returns previous active tab header element. - */ - prevActiveHeader?: any; - - /** Returns previous active tab index. - */ - prevActiveIndex?: number; - - /** Returns the Spreadsheet model. - */ - model?: ej.Spreadsheet.Model; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the target element. - */ - target?: HTMLElement; - - /** Returns the cancel option value. - */ - cancel?: boolean; -} - -export interface AutoFillSettings { - - /** This property is used to set fillType unit in Spreadsheet. It has five types which are CopyCells, FillSeries, FillFormattingOnly, FillWithoutFormatting and FlashFill. - * @Default {ej.Spreadsheet.AutoFillOptions.FillSeries} - */ - fillType?: ej.Spreadsheet.AutoFillOptions|string; - - /** Gets or sets a value that indicates to enable or disable auto fill options in the Spreadsheet. - * @Default {true} - */ - showFillOptions?: boolean; -} - -export interface ChartSettings { - - /** Gets or sets a value that defines the chart height in Spreadsheet. - * @Default {220} - */ - height?: number; - - /** Gets or sets a value that defines the chart width in the Spreadsheet. - * @Default {440} - */ - width?: number; -} - -export interface ExportSettings { - - /** Gets or sets a value that indicates whether to enable or disable save feature in Spreadsheet. By enabling this feature, you can save existing Spreadsheet. - * @Default {true} - */ - allowExporting?: boolean; - - /** Gets or sets a value that indicates to define csvUrl for export to CSV format. - * @Default {null} - */ - csvUrl?: string; - - /** Gets or sets a value that indicates to define excelUrl for export to excel format. - * @Default {null} - */ - excelUrl?: string; - - /** Gets or sets a value that indicates to define password while export to excel format. - * @Default {null} - */ - password?: string; - - /** Gets or sets a value that indicates to define pdfUrl for export to PDF format. - * @Default {null} - */ - pdfUrl?: string; -} - -export interface FormatSettings { - - /** Gets or sets a value that indicates whether to enable or disable cell border feature in the Spreadsheet. - * @Default {true} - */ - allowCellBorder?: boolean; - - /** Gets or sets a value that indicates whether to enable or disable decimal places in the Spreadsheet. - * @Default {true} - */ - allowDecimalPlaces?: boolean; - - /** Gets or sets a value that indicates whether to enable or disable font family feature in Spreadsheet. - * @Default {true} - */ - allowFontFamily?: boolean; -} - -export interface ImportSettings { - - /** Sets import mapper to perform import feature in Spreadsheet. - */ - importMapper?: string; - - /** Gets or sets a value that indicates whether to enable or disable import while initial loading. - * @Default {false} - */ - importOnLoad?: boolean; - - /** Sets import URL to access the online files in the Spreadsheet. - */ - importUrl?: string; - - /** Gets or sets a value that indicates to define password while importing in the Spreadsheet. - */ - password?: string; -} - -export interface PictureSettings { - - /** Gets or sets a value that indicates whether to enable or disable picture feature in Spreadsheet. By enabling this, you can add pictures in Spreadsheet. - * @Default {true} - */ - allowPictures?: boolean; - - /** Gets or sets a value that indicates to define height to picture in the Spreadsheet. - * @Default {220} - */ - height?: number; - - /** Gets or sets a value that indicates to define width to picture in the Spreadsheet. - * @Default {440} - */ - width?: number; -} - -export interface PrintSettings { - - /** Gets or sets a value that indicates whether to enable or disable page setup support for printing in Spreadsheet. - * @Default {true} - */ - allowPageSetup?: boolean; - - /** Gets or sets a value that indicates whether to enable or disable page size support for printing in Spreadsheet. - * @Default {false} - */ - allowPageSize?: boolean; - - /** Gets or sets a value that indicates whether to enable or disable print feature in the Spreadsheet. - * @Default {true} - */ - allowPrinting?: boolean; -} - -export interface RibbonSettingsApplicationTabMenuSettings { - - /** Gets or sets a value that indicates whether to enable or disable isAppend property in ribbon settings. - * @Default {false} - */ - isAppend?: boolean; - - /** Specifies the data source to append in application tab. - * @Default {[]} - */ - dataSource?: any[]; -} - -export interface RibbonSettingsApplicationTab { - - /** Gets or sets a value that indicates to set application tab type in Spreadsheet. It has two types, Menu and Backstage. - * @Default {ej.Ribbon.ApplicationTabType.Backstage} - */ - type?: ej.Ribbon.ApplicationTabType|string; - - /** Gets or sets an object that indicates menu settings for application tab in Spreadsheet. - */ - menuSettings?: RibbonSettingsApplicationTabMenuSettings; -} - -export interface RibbonSettings { - - /** Gets or sets an object that indicates application tab settings in Spreadsheet. - */ - applicationTab?: RibbonSettingsApplicationTab; -} - -export interface ScrollSettings { - - /** Gets or sets a value that indicates whether to enable or disable scrolling in Spreadsheet. - * @Default {true} - */ - allowScrolling?: boolean; - - /** Gets or sets a value that indicates whether to enable or disable sheet on demand. By enabling this, it render only the active sheet element while paging remaining sheets are created one by one. - * @Default {false} - */ - allowSheetOnDemand?: boolean; - - /** Gets or sets a value that indicates whether to enable or disable virtual scrolling feature in the Spreadsheet. - * @Default {true} - */ - allowVirtualScrolling?: boolean; - - /** Gets or sets the value that indicates to define the height of spreadsheet. - * @Default {100%} - */ - height?: number|string; - - /** Gets or sets the value that indicates whether to enable or disable responsive mode in the Spreadsheet. - * @Default {true} - */ - isResponsive?: boolean; - - /** Gets or sets a value that indicates to set scroll mode in Spreadsheet. It has two scroll modes, Normal and Infinite. - * @Default {ej.Spreadsheet.scrollMode.Infinite} - */ - scrollMode?: ej.Spreadsheet.scrollMode|string; - - /** Gets or sets the value that indicates to define the height of the spreadsheet. - * @Default {100%} - */ - width?: number|string; -} - -export interface SelectionSettings { - - /** Gets or sets a value that indicates to define active cell in spreadsheet. - */ - activeCell?: string; - - /** Gets or sets a value that indicates to define animation time while selection in the Spreadsheet. - * @Default {0.001} - */ - animationTime?: number; - - /** Gets or sets a value that indicates to enable or disable animation while selection. - * @Default {false} - */ - enableAnimation?: boolean; - - /** Gets or sets a value that indicates to set selection type in Spreadsheet. It has three types which are Column, Row and Default. - * @Default {ej.Spreadsheet.SelectionType.Default} - */ - selectionType?: ej.Spreadsheet.SelectionType|string; - - /** Gets or sets a value that indicates to set selection unit in Spreadsheet. It has three types which are Single, Range and MultiRange. - * @Default {ej.Spreadsheet.SelectionUnit.MultiRange} - */ - selectionUnit?: ej.Spreadsheet.SelectionUnit|string; -} - -export interface SheetsBorder { - - /** - */ - type?: ej.Spreadsheet.BorderType|string; - - /** Specifies border color for range of cells in Spreadsheet. - */ - color?: string; - - /** To apply border for the specified range of cell. - */ - range?: string; -} - -export interface SheetsCFormatRule { - - /** Specifies the conditions to apply for the range of cells in Spreadsheet. - */ - action?: ej.Spreadsheet.CFormatRule|string; - - /** Specifies the color to apply for the range of cell while conditional formatting. - */ - color?: ej.Spreadsheet.CFormatHighlightColor|string; - - /** Specifies the inputs for conditional formatting in Spreadsheet. - * @Default {[]} - */ - inputs?: any[]; - - /** Specifies the range for conditional formatting in Spreadsheet. - */ - range?: string; -} - -export interface SheetsRangeSetting { - - /** Gets or sets the data to render the Spreadsheet. - * @Default {null} - */ - dataSource?: any; - - /** Specifies the header styles for the headers in datasource range. - * @Default {null} - */ - headerStyles?: any; - - /** Specifies the primary key for the datasource in Spreadsheet. - */ - primaryKey?: string; - - /** Specifies the query for the datasource in Spreadsheet. - * @Default {null} - */ - query?: any; - - /** Gets or sets a value that indicates whether to enable or disable the datasource header in Spreadsheet. - * @Default {true} - */ - showHeader?: boolean; - - /** Specifies the start cell for the datasource range in Spreadsheet. - * @Default {A1} - */ - startCell?: string; -} - -export interface SheetsRowsCellsComment { - - /** Get or sets the value that indicates whether to show or hide comments in Spreadsheet. - * @Default {false} - */ - isVisible?: boolean; - - /** Specifies the value for the comment in Spreadsheet. - */ - value?: string; -} - -export interface SheetsRowsCellsFormat { - - /** Specifies the number of decimal places for the given input. - * @Default {2} - */ - decimalPlaces?: number; - - /** Specifies the string format for the given input. - */ - formatStr?: string; - - /** Specifies the thousand separator for the given input. - * @Default {false} - */ - thousandSeparator?: boolean; - - /** Specifies the type of the format in Spreadsheet. - */ - type?: string; -} - -export interface SheetsRowsCellsHyperlink { - - /** Specifies the web address for the hyperlink of a cell. - */ - webAddr?: string; - - /** Specifies the cell address for the hyperlink of a cell. - */ - cellAddr?: string; - - /** Specifies the sheet index to which the cell is referred. - * @Default {1} - */ - sheetIndex?: number; -} - -export interface SheetsRowsCellsStyle { - - /** Specifies the background color of a cell in the Spreadsheet. - */ - backgroundColor?: string; - - /** Specifies the font color of a cell in the Spreadsheet. - */ - color?: string; - - /** Specifies the font weight of a cell in the Spreadsheet. - */ - fontWeight?: string; -} - -export interface SheetsRowsCell { - - /** Specifies the comment for a cell in Spreadsheet. - * @Default {null} - */ - comment?: SheetsRowsCellsComment; - - /** Specifies the format of a cell in Spreadsheet. - * @Default {null} - */ - format?: SheetsRowsCellsFormat; - - /** Specifies the hyperlink for a cell in Spreadsheet. - * @Default {null} - */ - hyperlink?: SheetsRowsCellsHyperlink; - - /** Specifies the index of a cell in Spreadsheet. - * @Default {0} - */ - index?: number; - - /** Specifies whether to lock or unlock a particular cell. - * @Default {false} - */ - isLocked?: boolean; - - /** Specifies the styles of a cell in Spreadsheet. - * @Default {null} - */ - style?: SheetsRowsCellsStyle; - - /** Specifies the value for a cell in Spreadsheet. - */ - value?: string; -} - -export interface SheetsRow { - - /** Gets or sets the height of a row in Spreadsheet. - * @Default {20} - */ - height?: number; - - /** Specifies the cells of a row in Spreadsheet. - * @Default {[]} - */ - cells?: SheetsRowsCell[]; - - /** Gets or sets the index of a row in Spreadsheet. - * @Default {0} - */ - index?: number; -} - -export interface Sheet { - - /** Specifies the border for the cell in the Spreadsheet. - * @Default {[]} - */ - border?: SheetsBorder[]; - - /** Specifies the conditional formatting for the range of cell in Spreadsheet. - * @Default {[]} - */ - cFormatRule?: SheetsCFormatRule[]; - - /** Gets or sets a value that indicates to define column count in the Spreadsheet. - * @Default {21} - */ - colCount?: number; - - /** Gets or sets a value that indicates to define column width in the Spreadsheet. - * @Default {64} - */ - columnWidth?: number; - - /** Gets or sets the data to render the Spreadsheet. - * @Default {null} - */ - dataSource?: any; - - /** Gets or sets a value that indicates whether to enable or disable field as column header in the Spreadsheet. - * @Default {false} - */ - fieldAsColumnHeader?: boolean; - - /** Specifies the header styles for the headers in datasource range. - * @Default {null} - */ - headerStyles?: any; - - /** To hide the specified columns in Spreadsheet. - * @Default {[]} - */ - hideColumns?: any[]; - - /** To hide the specified rows in Spreadsheet. - * @Default {[]} - */ - hideRows?: any[]; - - /** To merge specified ranges in Spreadsheet. - * @Default {[]} - */ - mergeCells?: any[]; - - /** Specifies the primary key for the datasource in Spreadsheet. - */ - primaryKey?: string; - - /** Specifies the query for the dataSource in Spreadsheet. - * @Default {null} - */ - query?: any; - - /** Specifies single range or multiple range settings for a sheet in Spreadsheet. - * @Default {[]} - */ - rangeSettings?: SheetsRangeSetting[]; - - /** Gets or sets a value that indicates to define row count in the Spreadsheet. - * @Default {20} - */ - rowCount?: number; - - /** Specifies the rows for a sheet in Spreadsheet. - * @Default {[]} - */ - rows?: SheetsRow[]; - - /** Gets or sets a value that indicates whether to show or hide grid lines in the Spreadsheet. - * @Default {true} - */ - showGridlines?: boolean; - - /** Gets or sets a value that indicates whether to enable or disable the datasource header in Spreadsheet. - * @Default {true} - */ - showHeader?: boolean; - - /** Gets or sets a value that indicates whether to show or hide headings in the Spreadsheet. - * @Default {true} - */ - showHeadings?: boolean; - - /** Specifies the start cell for the datasource range in Spreadsheet. - * @Default {A1} - */ - startCell?: string; -} - -enum AutoFillOptions { - - ///Specifies the CopyCells property in AutoFillOptions. - CopyCells, - - ///Specifies the FillSeries property in AutoFillOptions. - FillSeries, - - ///Specifies the FillFormattingOnly property in AutoFillOptions. - FillFormattingOnly, - - ///Specifies the FillWithoutFormatting property in AutoFillOptions. - FillWithoutFormatting, - - ///Specifies the FlashFill property in AutoFillOptions. - FlashFill -} - - -enum scrollMode { - - ///To enable Infinite scroll mode for Spreadsheet. - Infinite, - - ///To enable Normal scroll mode for Spreadsheet. - Normal -} - - -enum SelectionType { - - ///To select only Column in Spreadsheet. - Column, - - ///To select only Row in Spreadsheet. - Row, - - ///To select both Column/Row in Spreadsheet. - Default -} - - -enum SelectionUnit { - - ///To enable Single selection in Spreadsheet - Single, - - ///To enable Range selection in Spreadsheet - Range, - - ///To enable MultiRange selection in Spreadsheet - MultiRange -} - - -enum BorderType { - - ///To apply top border for the given range of cell. - Top, - - ///To apply left border for the given range of cell. - Left, - - ///To apply right border for the given range of cell. - Right, - - ///To apply bottom border for the given range of cell. - Bottom, - - ///To apply outside border for the given range of cell. - OutSide, - - ///To apply all border for the given range of cell. - AllBorder, - - ///To apply thick box border for the given range of cell. - ThickBox, - - ///To apply thick bottom border for the given range of cell. - ThickBottom, - - ///To apply top and bottom border for the given range of cell. - TopandBottom, - - ///To apply top and thick bottom border for the given range of cell. - TopandThickBottom -} - - -enum CFormatRule { - - ///To identify greater than values in the given range of cells. - GreaterThan, - - ///To identify less than values in the given range of cells. - LessThan, - - ///To identify in between values in the given range of cells. - Between, - - ///To identify the equal values in the given range of cells. - EqualTo, - - ///To identify the specified text in the range of cells. - TextContains, - - ///To identify the specified date in the range of cells. - DateOccurs -} - - -enum CFormatHighlightColor { - - ///Highlights red with dark red text color. - RedFillwithDarkRedText, - - ///Highlights yellow with dark yellow text color. - YellowFillwithDarkYellowText, - - ///Highlights green with dark green text color. - GreenFillwithDarkGreenText, - - ///Highlights with red fill. - RedFill, - - ///Highlights with red text. - RedText -} - - -enum ChartProperties { - - ///Specifies to make the data label center of the chart. - DataLabelCenter, - - ///Specifies to make the data label inside base of the chart. - DataLabelInsideBase, - - ///Specifies to make the data label inside end of the chart. - DataLabelInsideEnd, - - ///Specifies to make the data label none of the chart. - DataLabelNone, - - ///Specifies to make the data label outside end of the chart. - DataLabelOutsideEnd, - - ///Specifies to make the legends to bottom of the chart. - LegendsBottom, - - ///Specifies to make the legends to left of the chart. - LegendsLeft, - - ///Specifies to make the legends to none of the chart. - LegendsNone, - - ///Specifies to make the legends to right of the chart. - LegendsRight, - - ///Specifies to make the legends to top of the chart. - LegendsTop, - - ///To set the primary horizontal of the chart. - PrimaryHorizontal, - - ///To set the primary horizontal axis title of the chart. - PrimaryHorizontalAxisTitle, - - ///To set the primary major horizontal of the chart. - PrimaryMajorHorizontal, - - ///To set the primary major vertical of the chart. - PrimaryMajorVertical, - - ///To set the primary minor horizontal of the chart. - PrimaryMinorHorizontal, - - ///To set the primary minor vertical of the chart. - PrimaryMinorVertical, - - ///To set the primary vertical of the chart. - PrimaryVertical, - - ///To set the primary vertical axis title of the chart. - PrimaryVerticalAxisTitle, - - ///Specifies to make the title to center of the chart. - TitleCenter, - - ///Specifies to make the title to far of the chart. - TitleFar, - - ///Specifies to make the title to near of the chart. - TitleNear, - - ///Specifies to make the title to none of the chart. - TitleNone -} - -} - -class PdfViewer extends ej.Widget { - static fn: PdfViewer; - constructor(element: JQuery | Element, options?: PdfViewer.Model); - static Locale: any; - model: PdfViewer.Model; - defaults: PdfViewer.Model; - - /** Loads the document with the filename and displays it in PDF viewer. - * @param {string} File name to be loaded - * @returns {void} - */ - load(fileName: string): void; - - /** Shows/hides the toolbar in the PDF viewer. - * @param {boolean} shows/hides the toolbar - * @returns {void} - */ - showToolbar(show: boolean): void; - - /** Prints the PDF document. - * @returns {void} - */ - print(): void; - - /** Abort the printing function and restores the PDF viewer. - * @returns {void} - */ - abortPrint(): void; - - /** Shows/hides the print icon in the toolbar. - * @param {boolean} shows/hides print button in the toolbar - * @returns {void} - */ - showPrintTools(show: boolean): void; - - /** Downloads the PDF document being loaded in the ejPdfViewer control. - * @returns {void} - */ - download(): void; - - /** Shows/hides the download tool in the toolbar. - * @param {boolean} shows/hides download button in the toolbar - * @returns {void} - */ - showDownloadTool(show: boolean): void; - - /** Shows/hides the page navigation tools in the toolbar - * @param {boolean} shows/hides navigation tools in the toolbar - * @returns {void} - */ - showPageNavigationTools(show: boolean): void; - - /** Navigates to the specific page in the PDF document. If the page is not available for the given pageNumber, PDF viewer retains the existing page in view. - * @param {number} navigates to the page number in the PDF document - * @returns {void} - */ - goToPage(pageNumber: number): void; - - /** Navigates to the last page of the PDF document. - * @returns {void} - */ - goToLastPage(): void; - - /** Navigates to the first page of PDF document. - * @returns {void} - */ - goToFirstPage(): void; - - /** Navigates to the next page of the PDF document. - * @returns {void} - */ - goToNextPage(): void; - - /** Navigates to the previous page of the PDF document. - * @returns {void} - */ - goToPreviousPage(): void; - - /** Shows/hides the zoom tools in the toolbar. - * @param {boolean} shows/hides zoom tools in the toolbar - * @returns {void} - */ - showMagnificationTools(show: boolean): void; - - /** Scales the page to fit the page in the container in the control. - * @returns {void} - */ - fitToPage(): void; - - /** Scales the page to fit the page width to the width of the container in the control. - * @returns {void} - */ - fitToWidth(): void; - - /** Magnifies the page to the next value in the zoom drop down list. - * @returns {void} - */ - zoomIn(): void; - - /** Shrinks the page to the previous value in the magnification in the drop down list. - * @returns {void} - */ - zoomOut(): void; - - /** Scales the page to the specified percentage ranging from 50 to 400. If the given zoomValue is less than 50 or greater than 400; the PDF viewer scales the page to 50 and 400 respectively. - * @param {number} zoom value for scaling the pages in the PDF Viewer - * @returns {void} - */ - zoomTo(zoomValue: number): void; - - /** Unloads the PDF document being displayed in the PDF viewer. - * @returns {void} - */ - unload(): void; -} -export namespace PdfViewer { - -export interface Model { - - /** Specifies the locale information of the PDF viewer. - */ - locale?: string; - - /** Specifies the toolbar settings. - */ - toolbarSettings?: ToolbarSettings; - - /** Specifies the name of the action method in the server. - */ - serverActionSettings?: ServerActionSettings; - - /** Sets the PDF Web API service URL - */ - serviceUrl?: string; - - /** Sets the PDF document path for initial loading. - */ - documentPath?: string; - - /** Gets the total number of pages in PDF document. - */ - pageCount?: number; - - /** Gets the number of the page being displayed in the PDF viewer. - */ - currentPageNumber?: number; - - /** Gets the current zoom percentage of the PDF document in viewer. - */ - zoomPercentage?: number; - - /** Specifies the location of the supporting PDF service - */ - pdfService?: ej.PdfViewer.PdfService|string; - - /** Specifies the open state of the hyperlink in the PDF document. - */ - hyperlinkOpenState?: ej.PdfViewer.LinkTarget|string; - - /** Enables or disables the hyperlinks in PDF document. - */ - enableHyperlink?: boolean; - - /** Enables or disables the text selection in PDF document. - */ - enableTextSelection?: boolean; - - /** Enables or disables the responsiveness of the PDF viewer control during the window resize. - */ - isResponsive?: boolean; - - /** Checks whether the PDF document is edited. - */ - isDocumentEdited?: boolean; - - /** Enables or disables the buffering of the PDF pages in the client side. - */ - allowClientBuffering?: boolean; - - /** Gets the name of the PDF document which loaded in the ejPdfViewer control for downloading. - */ - fileName?: string; - - /** Triggers when the PDF document gets loaded and is ready to view in the Control. */ - documentLoad?(e: DocumentLoadEventArgs): void; - - /** Triggers when there is change in current page number. */ - pageChange?(e: PageChangeEventArgs): void; - - /** Triggers when there is change in the magnification value. */ - zoomChange?(e: ZoomChangeEventArgs): void; - - /** Triggers when hyperlink in the PDF Document is clicked */ - hyperlinkClick?(e: HyperlinkClickEventArgs): void; - - /** Triggers before the printing starts. */ - beforePrint?(e: BeforePrintEventArgs): void; - - /** Triggers after the printing is completed. */ - afterPrint?(e: AfterPrintEventArgs): void; - - /** Triggers when the mouse click is performed over the page of the PDF document. */ - pageClick?(e: PageClickEventArgs): void; - - /** Triggers when the client buffering process starts. */ - bufferStart?(e: BufferStartEventArgs): void; - - /** Triggers when the client buffering process ends. */ - bufferEnd?(e: BufferEndEventArgs): void; - - /** Triggers when PDF viewer control is destroyed successfully. */ - destroy?(e: DestroyEventArgs): void; -} - -export interface DocumentLoadEventArgs { - - /** true, if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** Returns the PDF viewer model - */ - model?: any; - - /** Returns the name of the event - */ - type?: string; -} - -export interface PageChangeEventArgs { - - /** true, if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** Returns the PDF viewer model - */ - model?: any; - - /** Returns the name of the event - */ - type?: string; - - /** Returns the current page number in view. - */ - currentPageNumber?: number; -} - -export interface ZoomChangeEventArgs { - - /** true, if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** Returns the PDF viewer model - */ - model?: any; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the previous zoom percentage of the PDF viewer control - */ - previousZoomPercentage?: number; - - /** Returns the current zoom percentage of the PDF viewer control - */ - currentZoomPercentage?: number; -} - -export interface HyperlinkClickEventArgs { - - /** true, if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** Returns the PDF viewer model - */ - model?: any; - - /** Returns the name of the event - */ - type?: string; - - /** Returns the clicked hyperlink - */ - hyperlink?: string; -} - -export interface BeforePrintEventArgs { - - /** True, if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** Returns the PDF viewer model - */ - model?: any; - - /** Returns the name of the event - */ - type?: string; -} - -export interface AfterPrintEventArgs { - - /** True, if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** Returns the PDF viewer model - */ - model?: any; - - /** Returns the name of the event - */ - type?: string; -} - -export interface PageClickEventArgs { - - /** True, if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** Returns the PDF viewer model - */ - model?: any; - - /** Returns the name of the event - */ - type?: string; - - /** Returns the current X position - */ - offsetX?: number; - - /** Returns the current Y position - */ - offsetY?: number; -} - -export interface BufferStartEventArgs { - - /** True, if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** Returns the PDF viewer model - */ - model?: any; - - /** Returns the name of the event - */ - type?: string; - - /** Specifies the state of the buffering - */ - isBuffering?: boolean; -} - -export interface BufferEndEventArgs { - - /** True, if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** Returns the PDF viewer model - */ - model?: any; - - /** Returns the name of the event - */ - type?: string; - - /** Specifies the state of the buffering - */ - isBuffering?: boolean; -} - -export interface DestroyEventArgs { - - /** True, if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** Returns the PDF viewer model - */ - model?: any; - - /** Returns the name of the event - */ - type?: string; -} - -export interface ToolbarSettings { - - /** Shows or hides the tooltip of the toolbar items. - */ - showToolTip?: boolean; - - /** Shows or hides the grouped items in the toolbar with the help of enum ej.PdfViewer.ToolbarItems - */ - toolbarItem?: ej.PdfViewer.ToolbarItems|string; -} - -export interface ServerActionSettings { - - /** Specifies the name of the action method used for loading the PDF document. - */ - load?: string; - - /** Specifies the name of the action method used for uploading the PDF document to the PDF viewer control. - */ - fileUpload?: string; - - /** Specifies the name of the action method used for printing the PDF document in the PDF viewer control. - */ - print?: string; - - /** Specifies the name of the action method used for downloading the PDF document from the PDF viewer control. - */ - download?: string; -} - -enum ToolbarItems { - - ///Shows only magnification tools in the toolbar. - MagnificationTools, - - ///Shows only page navigation tools in the toolbar. - PageNavigationTools, - - ///Shows only print tool in the toolbar. - PrintTools, - - ///Shows only download tool in the toolbar. - DownloadTool, - - ///Shows all the toolbar items. - All -} - - -enum PdfService { - - ///Denotes that the service is located in the local project - Local, - - ///Denotes that the service is hosted in the remote server - Remote -} - - -enum LinkTarget { - - ///Opens the hyperlink in the same tab of the browser. - Default, - - ///Opens the hyperlink in a new tab of the browser. - NewTab, - - ///Opens the hyperlink in a new window of the browser. - NewWindow -} - -} - -class SpellCheck extends ej.Widget { - static fn: SpellCheck; - constructor(element: JQuery | Element, options?: SpellCheck.Model); - static Locale: any; - model: SpellCheck.Model; - defaults: SpellCheck.Model; - - /** Open the dialog to correct the spelling of the target content. - * @returns {void} - */ - showInDialog(): void; - - /** Highlighting the error word in the target area itself and correct the spelling using the context menu. - * @returns {void} - */ - validate(): void; - - /** To get the error word highlighted string by passing the given input sentence. - * @param {string} Content to be spell check - * @param {string} Class name that contains style value to highlight the error word - * @returns {any} - */ - spellCheck(targetSentence: string, misspellWordCss: string): any; - - /** To ignore all the error word occurrences from the given input sentence. - * @param {string} Error word to ignore from the target content - * @param {string} Content to perform the ignore all operation - * @returns {any} - */ - ignoreAll(word: string, targetSentence: string): any; - - /** To ignore the error word once from the given input sentence. - * @param {string} Error word to ignore from the target content - * @param {string} Content to perform the ignore operation - * @param {number} Index of the error word present in the target content - * @returns {any} - */ - ignore(word: string, targetSentence: string, index: number): any; - - /** To change the error word once from the given input sentence. - * @param {string} Error word to change from the target content - * @param {string} Content to perform the change operation - * @param {string} Word to replace with the error word - * @param {number} Index of the error word present in the target content - * @returns {any} - */ - change(word: string, targetSentence: string, changeWord: string, index: number): any; - - /** To change all the error word occurrences from the given input sentence. - * @param {string} Error word to change from the target content - * @param {string} Content to perform the change all operation - * @param {string} Word to replace with the error word - * @returns {any} - */ - changeAll(word: string, targetSentence: string, changeWord: string): any; - - /** To add the words into the custom dictionary. - * @param {string} Word to add into the dictionary file - * @returns {any} - */ - addToDictionary(customWord: string): any; -} -export namespace SpellCheck { - -export interface Model { - - /** It includes the service method path to find the error words and its suggestions also adding the custom word into the custom dictionary. - */ - dictionarySettings?: DictionarySettings; - - /** To display the error word in a customized style. - * @Default {e-errorword} - */ - misspellWordCss?: string; - - /** Sets the specific culture to the SpellCheck. - * @Default {en-US} - */ - locale?: string; - - /** To set the maximum suggestion display count. - * @Default {6} - */ - maxSuggestionCount?: number; - - /** To ignore the words from the error word consideration. - * @Default {[]} - */ - ignoreWords?: any[]; - - /** Holds all options related to the context menu settings of SpellCheck. - */ - contextMenuSettings?: ContextMenuSettings; - - /** It helps to ignore the uppercase, mixed case words, alpha numeric words, file path and email addresses based on the property values. - */ - ignoreSettings?: IgnoreSettings; - - /** When set to true, allows the spellcheck to render based upon screen size. - * @Default {true} - */ - isResponsive?: boolean; - - /** It allows to spell check the multiple target HTML element's texts and correct its error words. - * @Default {null} - */ - controlsToValidate?: string; - - /** Triggers on the success of AJAX call request. */ - actionSuccess?(e: ActionSuccessEventArgs): void; - - /** Triggers on the AJAX call request beginning. */ - actionBegin?(e: ActionBeginEventArgs): void; - - /** Triggers when the AJAX call request failure. */ - actionFailure?(e: ActionFailureEventArgs): void; - - /** Triggers when the dialog mode spell check starting. */ - start?(e: StartEventArgs): void; - - /** Triggers when the spell check operations completed through dialog mode. */ - complete?(e: CompleteEventArgs): void; - - /** Triggers before context menu opening. */ - contextOpen?(e: ContextOpenEventArgs): void; - - /** Triggers when the context menu item clicked. */ - contextClick?(e: ContextClickEventArgs): void; - - /** Triggers before the spell check dialog opens. */ - dialogBeforeOpen?(e: DialogBeforeOpenEventArgs): void; - /** Triggers after the spell check dialog opens. */ - dialogOpen?(e: DialogOpenEventArgs): void; - - /** Triggers when the spell check dialog closed. */ - dialogClose?(e: DialogCloseEventArgs): void; - - /** Triggers when the spell check control performing the spell check operations such as ignore, ignoreAll, change, changeAll and addToDictionary. */ - validating?(e: ValidatingEventArgs): void; - - /** Triggers before loading the target HTML element text into the dialog sentence area. */ - targetUpdating?(e: TargetUpdatingEventArgs): void; -} - -export interface ActionSuccessEventArgs { - - /** Returns the error word highlighted string. - */ - resultHTML?: string; - - /** Returns the error word details of the given input. - */ - errorWordDetails?: any; - - /** Returns the request type value. - */ - requestType?: string; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the SpellCheck model. - */ - model?: ej.SpellCheck.Model; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface ActionBeginEventArgs { - - /** Returns the input string. - */ - targetSentence?: string; - - /** Returns the misspellWordCss class name. - */ - misspellWordCss?: string; - - /** Returns the request type value. - */ - requestType?: string; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the SpellCheck model. - */ - model?: ej.SpellCheck.Model; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface ActionFailureEventArgs { - - /** Returns AJAX request failure error message. - */ - errorMessage?: string; - - /** Returns the request type value. - */ - requestType?: string; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the SpellCheck model. - */ - model?: ej.SpellCheck.Model; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface StartEventArgs { - - /** Returns the input string. - */ - targetSentence?: string; - - /** Returns the error words details. - */ - errorWords?: any; - - /** Returns the request type value. - */ - requestType?: string; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the SpellCheck model. - */ - model?: ej.SpellCheck.Model; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface CompleteEventArgs { - - /** Returns the error word highlighted string. - */ - resultHTML?: string; - - /** Returns the request type value. - */ - requestType?: string; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the SpellCheck model. - */ - model?: ej.SpellCheck.Model; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface ContextOpenEventArgs { - - /** Returns the selected error word. - */ - selectedErrorWord?: string; - - /** Returns the request type value. - */ - requestType?: string; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the SpellCheck model. - */ - model?: ej.SpellCheck.Model; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface ContextClickEventArgs { - - /** Returns the selected error word. - */ - selectedValue?: string; - - /** Returns the selected option in the context menu. - */ - selectedOption?: string; - - /** Returns the input string. - */ - targetContent?: string; - - /** Returns the request type value. - */ - requestType?: string; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the SpellCheck model. - */ - model?: ej.SpellCheck.Model; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface DialogBeforeOpenEventArgs { - - /** Returns the spell check window details. - */ - spellCheckDialog?: any; - - /** Returns the request type value. - */ - requestType?: string; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the SpellCheck model. - */ - model?: ej.SpellCheck.Model; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface DialogOpenEventArgs { - - /** Returns the target input. - */ - targetText?: string; - - /** Returns the request type value. - */ - requestType?: string; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the SpellCheck model. - */ - model?: ej.SpellCheck.Model; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface DialogCloseEventArgs { - - /** Returns the error corrected string. - */ - updatedText?: string; - - /** Returns the request type value. - */ - requestType?: string; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the SpellCheck model. - */ - model?: ej.SpellCheck.Model; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface ValidatingEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the error word to ignore. - */ - ignoreWord?: string; - - /** Returns the target content. - */ - targetContent?: string; - - /** Returns the index of an error word. - */ - index?: number; - - /** Returns the SpellCheck model. - */ - model?: ej.SpellCheck.Model; - - /** Returns the validating request type. - */ - requestType?: string; - - /** Returns the name of the event. - */ - type?: string; - - /** Returns the error word to change. - */ - changeableWord?: string; - - /** Returns the change word to replace the error word. - */ - changeWord?: string; - - /** Returns the custom word to add into dictionary file. - */ - customWord?: string; -} - -export interface TargetUpdatingEventArgs { - - /** Returns the previous target element value. - */ - previousElement?: any; - - /** Returns the current target element value. - */ - currentElement?: any; - - /** Returns the target html value. - */ - targetHtml?: string; - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the SpellCheck model. - */ - model?: ej.SpellCheck.Model; - - /** Returns the name of the event. - */ - type?: string; -} - -export interface DictionarySettings { - - /** The dictionaryUrl option accepts string, which is the method path to find the error words and get the suggestions to correct the errors. - */ - dictionaryUrl?: string; - - /** The customDictionaryUrl option accepts string, which is the method path to add the error word into the custom dictionary. - */ - customDictionaryUrl?: string; -} - -export interface ContextMenuSettings { - - /** When set to true, enables the context menu options available for the SpellCheck. - * @Default {true} - */ - enable?: boolean; - - /** Contains all the default context menu options that are applicable for SpellCheck. It also supports adding custom menu items. - * All the SpellCheck related context menu items are grouped under this menu collection. - * @Default {{% highlight javascript %}[{ id: IgnoreAll, text: Ignore All },{ id: AddToDictionary, text: Add To Dictionary }]{% endhighlight %}} - */ - menuItems?: any[]; -} - -export interface IgnoreSettings { - - /** When set to true, ignoring the alphanumeric words from the error word consideration. - * @Default {true} - */ - ignoreAlphaNumericWords?: string; - - /** When set to true, ignoring the Email address from the error word consideration. - * @Default {true} - */ - ignoreEmailAddress?: boolean; - - /** When set to true, ignoring the MixedCase words from the error word consideration. - * @Default {true} - */ - ignoreMixedCaseWords?: boolean; - - /** When set to true, ignoring the UpperCase words from the error word consideration. - * @Default {true} - */ - ignoreUpperCase?: boolean; - - /** When set to true, ignoring the Url from the error word consideration. - * @Default {true} - */ - ignoreUrl?: boolean; - - /** When set to true, ignoring the file address path from the error word consideration. - * @Default {true} - */ - ignoreFileNames?: boolean; -} -} - -} -declare namespace ej.datavisualization { -class SymbolPalette extends ej.Widget { - static fn: SymbolPalette; - constructor(element: JQuery | Element, options?: SymbolPalette.Model); - static Locale: any; - model: SymbolPalette.Model; - defaults: SymbolPalette.Model; - - /** Add items to Palettes at runtime - * @param {string} name of the Palette - * @param {any} JSON for the new items to added in Palette - * @returns {void} - */ - addPaletteItem(paletteName: string, node: any): void; - - /** Remove items to Palettes at runtime - * @param {string} name of the Palette - * @param {any} JSON for the new node to removed in Palette - * @returns {void} - */ - removePaletteItem(paletteName: string, node: any): void; -} -export namespace SymbolPalette { - -export interface Model { - - /** Defines whether the symbols can be dragged from palette or not - * @Default {true} - */ - allowDrag?: boolean; - - /** Customizes the style of the symbol palette - * @Default {e-symbolpalette} - */ - cssClass?: string; - - /** Defines the default properties of nodes and connectors - */ - defaultSettings?: DefaultSettings; - - /** Sets the Id of the diagram, over which the symbols will be dropped - * @Default {null} - */ - diagramId?: string; - - /** Sets the height of the palette headers - * @Default {30} - */ - headerHeight?: number; - - /** Defines the height of the symbol palette - * @Default {400} - */ - height?: number; - - /** Defines the height of the palette items - * @Default {50} - */ - paletteItemHeight?: number; - - /** Defines the width of the palette items - * @Default {50} - */ - paletteItemWidth?: number; - - /** An array of JSON objects, where each object represents a node/connector - * @Default {[]} - */ - palettes?: Palette[]; - - /** Defines the preview height of the symbols - * @Default {100} - */ - previewHeight?: number; - - /** Defines the offset value to be left between the mouse cursor and symbol previews - * @Default {(110, 110)} - */ - previewOffset?: any; - - /** Defines the width of the symbol previews - * @Default {100} - */ - previewWidth?: number; - - /** Enable or disable the palette item text - * @Default {true} - */ - showPaletteItemText?: boolean; - - /** The width of the palette - * @Default {250} - */ - width?: number; - - /** Triggers when a palette item is selected or unselected */ - selectionChange?(e: SelectionChangeEventArgs): void; -} - -export interface SelectionChangeEventArgs { - - /** returns whether an element is selected or unselected - */ - changeType?: string; - - /** returns the node or connector that is selected or unselected - */ - element?: any; -} - -export interface DefaultSettings { - - /** Defines the default properties of the nodes - * @Default {null} - */ - node?: any; - - /** Defines the default properties of the connectors - * @Default {null} - */ - connector?: any; -} - -export interface Palette { - - /** Defines the name of the palette - * @Default {null} - */ - name?: string; - - /** Defines whether the palette must be in expanded state or in collapsed state - * @Default {true} - */ - expanded?: boolean; - - /** Defines the palette items - * @Default {[]} - */ - items?: any[]; -} -} - -class LinearGauge extends ej.Widget { - static fn: LinearGauge; - constructor(element: JQuery | Element, options?: LinearGauge.Model); - static Locale: any; - model: LinearGauge.Model; - defaults: LinearGauge.Model; - - /** destroy the linear gauge all events bound using this._on will be unbind automatically and bring the control to pre-init state. - * @returns {void} - */ - destroy(): void; - - /** To export Image - * @returns {void} - */ - exportImage(): void; - - /** To get Bar Distance From Scale in number - * @returns {any} - */ - getBarDistanceFromScale(): any; - - /** To get Bar Pointer Value in number - * @returns {any} - */ - getBarPointerValue(): any; - - /** To get Bar Width in number - * @returns {any} - */ - getBarWidth(): any; - - /** To get CustomLabel Angle in number - * @returns {any} - */ - getCustomLabelAngle(): any; - - /** To get CustomLabel Value in string - * @returns {any} - */ - getCustomLabelValue(): any; - - /** To get Label Angle in number - * @returns {any} - */ - getLabelAngle(): any; - - /** To get LabelPlacement in number - * @returns {any} - */ - getLabelPlacement(): any; - - /** To get LabelStyle in number - * @returns {any} - */ - getLabelStyle(): any; - - /** To get Label XDistance From Scale in number - * @returns {any} - */ - getLabelXDistanceFromScale(): any; - - /** To get PointerValue in number - * @returns {any} - */ - getLabelYDistanceFromScale(): any; - - /** To get Major Interval Value in number - * @returns {any} - */ - getMajorIntervalValue(): any; - - /** To get MarkerStyle in number - * @returns {any} - */ - getMarkerStyle(): any; - - /** To get Maximum Value in number - * @returns {any} - */ - getMaximumValue(): any; - - /** To get PointerValue in number - * @returns {any} - */ - getMinimumValue(): any; - - /** To get Minor Interval Value in number - * @returns {any} - */ - getMinorIntervalValue(): any; - - /** To get Pointer Distance From Scale in number - * @returns {any} - */ - getPointerDistanceFromScale(): any; - - /** To get PointerHeight in number - * @returns {any} - */ - getPointerHeight(): any; - - /** To get Pointer Placement in String - * @returns {any} - */ - getPointerPlacement(): any; - - /** To get PointerValue in number - * @returns {any} - */ - getPointerValue(): any; - - /** To get PointerWidth in number - * @returns {any} - */ - getPointerWidth(): any; - - /** To get Range Border Width in number - * @returns {any} - */ - getRangeBorderWidth(): any; - - /** To get Range Distance From Scale in number - * @returns {any} - */ - getRangeDistanceFromScale(): any; - - /** To get Range End Value in number - * @returns {any} - */ - getRangeEndValue(): any; - - /** To get Range End Width in number - * @returns {any} - */ - getRangeEndWidth(): any; - - /** To get Range Position in number - * @returns {any} - */ - getRangePosition(): any; - - /** To get Range Start Value in number - * @returns {any} - */ - getRangeStartValue(): any; - - /** To get Range Start Width in number - * @returns {any} - */ - getRangeStartWidth(): any; - - /** To get ScaleBarLength in number - * @returns {any} - */ - getScaleBarLength(): any; - - /** To get Scale Bar Size in number - * @returns {any} - */ - getScaleBarSize(): any; - - /** To get Scale Border Width in number - * @returns {any} - */ - getScaleBorderWidth(): any; - - /** To get Scale Direction in number - * @returns {any} - */ - getScaleDirection(): any; - - /** To get Scale Location in object - * @returns {any} - */ - getScaleLocation(): any; - - /** To get Scale Style in string - * @returns {any} - */ - getScaleStyle(): any; - - /** To get Tick Angle in number - * @returns {any} - */ - getTickAngle(): any; - - /** To get Tick Height in number - * @returns {any} - */ - getTickHeight(): any; - - /** To get getTickPlacement in number - * @returns {any} - */ - getTickPlacement(): any; - - /** To get Tick Style in string - * @returns {any} - */ - getTickStyle(): any; - - /** To get Tick Width in number - * @returns {any} - */ - getTickWidth(): any; - - /** To get get Tick XDistance From Scale in number - * @returns {any} - */ - getTickXDistanceFromScale(): any; - - /** To get Tick YDistance From Scale in number - * @returns {any} - */ - getTickYDistanceFromScale(): any; - - /** Specifies the scales. - * @returns {void} - */ - scales(): void; - - /** To set setBarDistanceFromScale - * @returns {void} - */ - setBarDistanceFromScale(): void; - - /** To set setBarPointerValue - * @returns {void} - */ - setBarPointerValue(): void; - - /** To set setBarWidth - * @returns {void} - */ - setBarWidth(): void; - - /** To set setCustomLabelAngle - * @returns {void} - */ - setCustomLabelAngle(): void; - - /** To set setCustomLabelValue - * @returns {void} - */ - setCustomLabelValue(): void; - - /** To set setLabelAngle - * @returns {void} - */ - setLabelAngle(): void; - - /** To set setLabelPlacement - * @returns {void} - */ - setLabelPlacement(): void; - - /** To set setLabelStyle - * @returns {void} - */ - setLabelStyle(): void; - - /** To set setLabelXDistanceFromScale - * @returns {void} - */ - setLabelXDistanceFromScale(): void; - - /** To set setLabelYDistanceFromScale - * @returns {void} - */ - setLabelYDistanceFromScale(): void; - - /** To set setMajorIntervalValue - * @returns {void} - */ - setMajorIntervalValue(): void; - - /** To set setMarkerStyle - * @returns {void} - */ - setMarkerStyle(): void; - - /** To set setMaximumValue - * @returns {void} - */ - setMaximumValue(): void; - - /** To set setMinimumValue - * @returns {void} - */ - setMinimumValue(): void; - - /** To set setMinorIntervalValue - * @returns {void} - */ - setMinorIntervalValue(): void; - - /** To set setPointerDistanceFromScale - * @returns {void} - */ - setPointerDistanceFromScale(): void; - - /** To set PointerHeight - * @returns {void} - */ - setPointerHeight(): void; - - /** To set setPointerPlacement - * @returns {void} - */ - setPointerPlacement(): void; - - /** To set PointerValue - * @returns {void} - */ - setPointerValue(): void; - - /** To set PointerWidth - * @returns {void} - */ - setPointerWidth(): void; - - /** To set setRangeBorderWidth - * @returns {void} - */ - setRangeBorderWidth(): void; - - /** To set setRangeDistanceFromScale - * @returns {void} - */ - setRangeDistanceFromScale(): void; - - /** To set setRangeEndValue - * @returns {void} - */ - setRangeEndValue(): void; - - /** To set setRangeEndWidth - * @returns {void} - */ - setRangeEndWidth(): void; - - /** To set setRangePosition - * @returns {void} - */ - setRangePosition(): void; - - /** To set setRangeStartValue - * @returns {void} - */ - setRangeStartValue(): void; - - /** To set setRangeStartWidth - * @returns {void} - */ - setRangeStartWidth(): void; - - /** To set setScaleBarLength - * @returns {void} - */ - setScaleBarLength(): void; - - /** To set setScaleBarSize - * @returns {void} - */ - setScaleBarSize(): void; - - /** To set setScaleBorderWidth - * @returns {void} - */ - setScaleBorderWidth(): void; - - /** To set setScaleDirection - * @returns {void} - */ - setScaleDirection(): void; - - /** To set setScaleLocation - * @returns {void} - */ - setScaleLocation(): void; - - /** To set setScaleStyle - * @returns {void} - */ - setScaleStyle(): void; - - /** To set setTickAngle - * @returns {void} - */ - setTickAngle(): void; - - /** To set setTickHeight - * @returns {void} - */ - setTickHeight(): void; - - /** To set setTickPlacement - * @returns {void} - */ - setTickPlacement(): void; - - /** To set setTickStyle - * @returns {void} - */ - setTickStyle(): void; - - /** To set setTickWidth - * @returns {void} - */ - setTickWidth(): void; - - /** To set setTickXDistanceFromScale - * @returns {void} - */ - setTickXDistanceFromScale(): void; - - /** To set setTickYDistanceFromScale - * @returns {void} - */ - setTickYDistanceFromScale(): void; -} -export namespace LinearGauge { - -export interface Model { - - /** Specifies the animationSpeed - * @Default {500} - */ - animationSpeed?: number; - - /** Specifies the backgroundColor for Linear gauge. - * @Default {null} - */ - backgroundColor?: string; - - /** Specifies the borderColor for Linear gauge. - * @Default {null} - */ - borderColor?: string; - - /** Specifies the animate state - * @Default {true} - */ - enableAnimation?: boolean; - - /** Specifies the animate state for marker pointer - * @Default {true} - */ - enableMarkerPointerAnimation?: boolean; - - /** Specifies the can resize state. - * @Default {false} - */ - isResponsive?: boolean; - - /** Specify frame of linear gauge - * @Default {null} - */ - frame?: Frame; - - /** Specifies the height of Linear gauge. - * @Default {400} - */ - height?: number; - - /** Specifies the labelColor for Linear gauge. - * @Default {null} - */ - labelColor?: string; - - /** Specifies the maximum value of Linear gauge. - * @Default {100} - */ - maximum?: number; - - /** Specifies the minimum value of Linear gauge. - * @Default {0} - */ - minimum?: number; - - /** Specifies the orientation for Linear gauge. - * @Default {Vertical} - */ - orientation?: string; - - /** Specify labelPosition value of Linear gauge See OuterCustomLabelPosition - * @Default {bottom} - */ - outerCustomLabelPosition?: ej.datavisualization.LinearGauge.OuterCustomLabelPosition|string; - - /** Specifies the pointerGradient1 for Linear gauge. - * @Default {null} - */ - pointerGradient1?: any; - - /** Specifies the pointerGradient2 for Linear gauge. - * @Default {null} - */ - pointerGradient2?: any; - - /** Specifies the read only state. - * @Default {true} - */ - readOnly?: boolean; - - /** Specifies the scales - * @Default {null} - */ - scales?: Scale[]; - - /** Specifies the theme for Linear gauge. See LinearGauge.Themes - * @Default {flatlight} - */ - theme?: ej.datavisualization.LinearGauge.Themes|string; - - /** Specifies the tick Color for Linear gauge. - * @Default {null} - */ - tickColor?: string; - - /** Specify tooltip options of linear gauge - * @Default {false} - */ - tooltip?: Tooltip; - - /** Specifies the value of the Gauge. - * @Default {0} - */ - value?: number; - - /** Specifies the width of Linear gauge. - * @Default {150} - */ - width?: number; - - /** Triggers while the bar pointer are being drawn on the gauge. */ - drawBarPointers?(e: DrawBarPointersEventArgs): void; - - /** Triggers while the customLabel are being drawn on the gauge. */ - drawCustomLabel?(e: DrawCustomLabelEventArgs): void; - - /** Triggers while the Indicator are being drawn on the gauge. */ - drawIndicators?(e: DrawIndicatorsEventArgs): void; - - /** Triggers while the label are being drawn on the gauge. */ - drawLabels?(e: DrawLabelsEventArgs): void; - - /** Triggers while the marker are being drawn on the gauge. */ - drawMarkerPointers?(e: DrawMarkerPointersEventArgs): void; - - /** Triggers while the range are being drawn on the gauge. */ - drawRange?(e: DrawRangeEventArgs): void; - - /** Triggers while the ticks are being drawn on the gauge. */ - drawTicks?(e: DrawTicksEventArgs): void; - - /** Triggers when the gauge is initialized. */ - init?(e: InitEventArgs): void; - - /** Triggers while the gauge start to Load. */ - load?(e: LoadEventArgs): void; - - /** Triggers when the left mouse button is clicked. */ - mouseClick?(e: MouseClickEventArgs): void; - - /** Triggers when clicking and dragging the mouse pointer over the gauge pointer. */ - mouseClickMove?(e: MouseClickMoveEventArgs): void; - - /** Triggers when the mouse click is released. */ - mouseClickUp?(e: MouseClickUpEventArgs): void; - - /** Triggers while the rendering of the gauge completed. */ - renderComplete?(e: RenderCompleteEventArgs): void; -} - -export interface DrawBarPointersEventArgs { - - /** returns the object of the gauge. - */ - object?: any; - - /** returns the cancel option value - */ - cancel?: boolean; - - /** returns the context element - */ - context?: any; - - /** returns the startX and startY of the pointer - */ - position?: any; - - /** returns the gauge model - */ - Model?: any; - - /** returns the options of the scale element. - */ - scaleElement?: any; - - /** returns the scaleIndex to which the pointer belongs. - */ - scaleIndex?: number; - - /** returns the pointer style - */ - style?: string; - - /** returns the current Bar pointer element. - */ - barElement?: any; - - /** returns the index of the bar pointer. - */ - barPointerIndex?: number; - - /** returns the value of the bar pointer. - */ - PointerValue?: number; - - /** returns the name of the event - */ - type?: any; -} - -export interface DrawCustomLabelEventArgs { - - /** returns the object of the gauge. - */ - object?: any; - - /** returns the cancel option value - */ - cancel?: boolean; - - /** returns the context element - */ - context?: any; - - /** returns the startX and startY of the customLabel - */ - position?: any; - - /** returns the gauge model - */ - Model?: any; - - /** returns the options of the scale element. - */ - scaleElement?: any; - - /** returns the scaleIndex to which the pointer belongs. - */ - scaleIndex?: number; - - /** returns the customLabel style - */ - style?: any; - - /** returns the current customLabel element. - */ - customLabelElement?: any; - - /** returns the index of the customLabel. - */ - customLabelIndex?: number; - - /** returns the name of the event - */ - type?: any; -} - -export interface DrawIndicatorsEventArgs { - - /** returns the object of the gauge. - */ - object?: any; - - /** returns the cancel option value - */ - cancel?: boolean; - - /** returns the context element - */ - context?: any; - - /** returns the startX and startY of the Indicator - */ - position?: any; - - /** returns the gauge model - */ - Model?: any; - - /** returns the options of the scale element. - */ - scaleElement?: any; - - /** returns the scaleIndex to which the pointer belongs. - */ - scaleIndex?: number; - - /** returns the Indicator style - */ - style?: string; - - /** returns the current Indicator element. - */ - IndicatorElement?: any; - - /** returns the index of the Indicator. - */ - IndicatorIndex?: number; - - /** returns the name of the event - */ - type?: any; -} - -export interface DrawLabelsEventArgs { - - /** returns the object of the gauge. - */ - object?: any; - - /** returns the cancel option value - */ - cancel?: boolean; - - /** returns the context element - */ - context?: any; - - /** returns the startX and startY of the label - */ - position?: any; - - /** returns the gauge model - */ - Model?: any; - - /** returns the options of the scale element. - */ - scaleElement?: any; - - /** returns the scaleIndex to which the label belongs. - */ - scaleIndex?: number; - - /** returns the label style - */ - style?: string; - - /** returns the angle of the label. - */ - angle?: number; - - /** returns the current label element. - */ - element?: any; - - /** returns the index of the label. - */ - index?: number; - - /** returns the label value of the label. - */ - value?: number; - - /** returns the name of the event - */ - type?: any; -} - -export interface DrawMarkerPointersEventArgs { - - /** returns the object of the gauge. - */ - object?: any; - - /** returns the cancel option value - */ - cancel?: boolean; - - /** returns the context element - */ - context?: any; - - /** returns the startX and startY of the pointer - */ - position?: any; - - /** returns the gauge model - */ - Model?: any; - - /** returns the options of the scale element. - */ - scaleElement?: any; - - /** returns the scaleIndex to which the pointer belongs. - */ - scaleIndex?: number; - - /** returns the ticks style - */ - style?: string; - - /** returns the current marker pointer element. - */ - markerElement?: any; - - /** returns the index of the marker pointer. - */ - markerPointerIndex?: number; - - /** returns the value of the marker pointer. - */ - pointerValue?: number; - - /** returns the angle of the marker pointer. - */ - pointerAngle?: number; - - /** returns the name of the event - */ - type?: any; -} - -export interface DrawRangeEventArgs { - - /** returns the object of the gauge. - */ - object?: any; - - /** returns the cancel option value - */ - cancel?: boolean; - - /** returns the context element - */ - context?: any; - - /** returns the startX and startY of the range - */ - position?: any; - - /** returns the gauge model - */ - Model?: any; - - /** returns the options of the scale element. - */ - scaleElement?: any; - - /** returns the scaleIndex to which the pointer belongs. - */ - scaleIndex?: number; - - /** returns the range style - */ - style?: string; - - /** returns the current range element. - */ - rangeElement?: any; - - /** returns the index of the range. - */ - rangeIndex?: number; - - /** returns the name of the event - */ - type?: any; -} - -export interface DrawTicksEventArgs { - - /** returns the object of the gauge. - */ - object?: any; - - /** returns the cancel option value - */ - cancel?: boolean; - - /** returns the context element - */ - context?: any; - - /** returns the startX and startY of the ticks - */ - position?: any; - - /** returns the gauge model - */ - Model?: any; - - /** returns the options of the scale element. - */ - scaleElement?: any; - - /** returns the scaleIndex to which the tick belongs. - */ - scaleIndex?: number; - - /** returns the ticks style - */ - style?: string; - - /** returns the angle of the tick. - */ - angle?: number; - - /** returns the current tick element. - */ - element?: any; - - /** returns the index of the tick. - */ - index?: number; - - /** returns the tick value of the tick. - */ - value?: number; - - /** returns the name of the event - */ - type?: any; -} - -export interface InitEventArgs { - - /** returns the object of the gauge. - */ - object?: any; - - /** returns the cancel option value - */ - cancel?: boolean; - - /** returns the gauge model - */ - Model?: any; - - /** returns the entire scale element. - */ - scaleElement?: any; - - /** returns the context element - */ - context?: any; - - /** returns the name of the event - */ - type?: string; -} - -export interface LoadEventArgs { - - /** returns the object of the gauge. - */ - object?: any; - - /** returns the cancel option value - */ - cancel?: boolean; - - /** returns the gauge model - */ - Model?: any; - - /** returns the entire scale element. - */ - scaleElement?: any; - - /** returns the context element - */ - context?: any; - - /** returns the name of the event - */ - type?: any; -} - -export interface MouseClickEventArgs { - - /** returns the object of the gauge. - */ - object?: any; - - /** returns the cancel option value - */ - cancel?: boolean; - - /** returns the gauge model - */ - model?: any; - - /** returns the name of the event - */ - type?: any; - - /** returns the scale element. - */ - scaleElement?: any; - - /** returns the scaleIndex to which the pointer belongs. - */ - scaleIndex?: number; - - /** returns the context element* @param {Object} args.markerpointer returns the context element - */ - context?: any; - - /** returns the pointer Index - */ - markerpointerindex?: number; - - /** returns the pointer element. - */ - markerpointerelement?: any; - - /** returns the value of the pointer. - */ - markerpointervalue?: number; - - /** returns the pointer style - */ - style?: string; - - /** returns the startX and startY of the pointer. - */ - position?: any; -} - -export interface MouseClickMoveEventArgs { - - /** returns the object of the gauge. - */ - object?: any; - - /** returns the cancel option value - */ - cancel?: boolean; - - /** returns the gauge model - */ - model?: any; - - /** returns the name of the event - */ - type?: any; - - /** returns the scale element. - */ - scaleElement?: any; - - /** returns the scaleIndex to which the pointer belongs. - */ - scaleIndex?: number; - - /** returns the context element - */ - context?: any; - - /** returns the pointer Index - */ - index?: number; - - /** returns the pointer element. - */ - element?: any; - - /** returns the value of the pointer. - */ - value?: number; - - /** returns the pointer style - */ - style?: string; - - /** returns the startX and startY of the pointer. - */ - position?: any; -} - -export interface MouseClickUpEventArgs { - - /** returns the object of the gauge. - */ - object?: any; - - /** returns the cancel option value - */ - cancel?: boolean; - - /** returns the gauge model - */ - model?: any; - - /** returns the name of the event - */ - type?: any; - - /** returns the scale element. - */ - scaleElement?: any; - - /** returns the scaleIndex to which the pointer belongs. - */ - scaleIndex?: number; - - /** returns the context element* @param {Object} args.markerpointer returns the context element - */ - context?: any; - - /** returns the pointer Index - */ - markerpointerIndex?: number; - - /** returns the pointer element. - */ - markerpointerElement?: any; - - /** returns the value of the pointer. - */ - markerpointerValue?: number; - - /** returns the pointer style - */ - style?: string; - - /** returns the startX and startY of the pointer. - */ - position?: any; -} - -export interface RenderCompleteEventArgs { - - /** returns the object of the gauge. - */ - object?: any; - - /** returns the cancel option value - */ - cancel?: boolean; - - /** returns the gauge model - */ - Model?: any; - - /** returns the entire scale element. - */ - scaleElement?: any; - - /** returns the context element - */ - context?: any; - - /** returns the name of the event - */ - type?: any; -} - -export interface Frame { - - /** Specifies the frame background image URL of linear gauge - * @Default {null} - */ - backgroundImageUrl?: string; - - /** Specifies the frame InnerWidth - * @Default {8} - */ - innerWidth?: number; - - /** Specifies the frame OuterWidth - * @Default {12} - */ - outerWidth?: number; -} - -export interface ScalesBarPointersBorder { - - /** Specifies the border Color of bar pointer - * @Default {null} - */ - color?: string; - - /** Specifies the border Width of bar pointer - * @Default {1.5} - */ - width?: number; -} - -export interface ScalesBarPointer { - - /** Specifies the backgroundColor of bar pointer - * @Default {null} - */ - backgroundColor?: string; - - /** Specifies the border of bar pointer - * @Default {null} - */ - border?: ScalesBarPointersBorder; - - /** Specifies the distanceFromScale of bar pointer - * @Default {0} - */ - distanceFromScale?: number; - - /** Specifies the scaleBar Gradient of bar pointer - * @Default {null} - */ - gradients?: any; - - /** Specifies the opacity of bar pointer - * @Default {1} - */ - opacity?: number; - - /** Specifies the value of bar pointer - * @Default {null} - */ - value?: number; - - /** Specifies the pointer Width of bar pointer - * @Default {width=30} - */ - width?: number; -} - -export interface ScalesBorder { - - /** Specifies the border color of the Scale. - * @Default {null} - */ - color?: string; - - /** Specifies the border width of the Scale. - * @Default {1.5} - */ - width?: number; -} - -export interface ScalesCustomLabelsFont { - - /** Specifies the fontFamily in customLabels - * @Default {Arial} - */ - fontFamily?: string; - - /** Specifies the fontStyle in customLabels. See FontStyle - * @Default {Bold} - */ - fontStyle?: ej.datavisualization.LinearGauge.FontStyle|string; - - /** Specifies the font size in customLabels - * @Default {11px} - */ - size?: string; -} - -export interface ScalesCustomLabelsPosition { - - /** Specifies the position x in customLabels - * @Default {0} - */ - x?: number; - - /** Specifies the y in customLabels - * @Default {0} - */ - y?: number; -} - -export interface ScalesCustomLabel { - - /** Specifies the label Color in customLabels - * @Default {null} - */ - color?: number; - - /** Specifies the font in customLabels - * @Default {null} - */ - font?: ScalesCustomLabelsFont; - - /** Specifies the opacity in customLabels - * @Default {0} - */ - opacity?: string; - - /** Specifies the position in customLabels - * @Default {null} - */ - position?: ScalesCustomLabelsPosition; - - /** Specifies the positionType in customLabels.See CustomLabelPositionType - * @Default {null} - */ - positionType?: any; - - /** Specifies the textAngle in customLabels - * @Default {0} - */ - textAngle?: number; - - /** Specifies the label Value in customLabels - */ - value?: string; -} - -export interface ScalesIndicatorsBorder { - - /** Specifies the border Color in bar indicators - * @Default {null} - */ - color?: string; - - /** Specifies the border Width in bar indicators - * @Default {1.5} - */ - width?: number; -} - -export interface ScalesIndicatorsFont { - - /** Specifies the fontFamily of font in bar indicators - * @Default {Arial} - */ - fontFamily?: string; - - /** Specifies the fontStyle of font in bar indicators. See FontStyle - * @Default {ej.datavisualization.LinearGauge.FontStyle.Bold} - */ - fontStyle?: ej.datavisualization.LinearGauge.FontStyle|string; - - /** Specifies the size of font in bar indicators - * @Default {11px} - */ - size?: string; -} - -export interface ScalesIndicatorsPosition { - - /** Specifies the x position in bar indicators - * @Default {0} - */ - x?: number; - - /** Specifies the y position in bar indicators - * @Default {0} - */ - y?: number; -} - -export interface ScalesIndicatorsStateRange { - - /** Specifies the backgroundColor in bar indicators state ranges - * @Default {null} - */ - backgroundColor?: string; - - /** Specifies the borderColor in bar indicators state ranges - * @Default {null} - */ - borderColor?: string; - - /** Specifies the endValue in bar indicators state ranges - * @Default {60} - */ - endValue?: number; - - /** Specifies the startValue in bar indicators state ranges - * @Default {50} - */ - startValue?: number; - - /** Specifies the text in bar indicators state ranges - */ - text?: string; - - /** Specifies the textColor in bar indicators state ranges - * @Default {null} - */ - textColor?: string; -} - -export interface ScalesIndicatorsTextLocation { - - /** Specifies the textLocation position in bar indicators - * @Default {0} - */ - x?: number; - - /** Specifies the Y position in bar indicators - * @Default {0} - */ - y?: number; -} - -export interface ScalesIndicator { - - /** Specifies the backgroundColor in bar indicators - * @Default {null} - */ - backgroundColor?: string; - - /** Specifies the border in bar indicators - * @Default {null} - */ - border?: ScalesIndicatorsBorder; - - /** Specifies the font of bar indicators - * @Default {null} - */ - font?: ScalesIndicatorsFont; - - /** Specifies the indicator Height of bar indicators - * @Default {30} - */ - height?: number; - - /** Specifies the opacity in bar indicators - * @Default {NaN} - */ - opacity?: number; - - /** Specifies the position in bar indicators - * @Default {null} - */ - position?: ScalesIndicatorsPosition; - - /** Specifies the state ranges in bar indicators - * @Default {Array} - */ - stateRanges?: ScalesIndicatorsStateRange[]; - - /** Specifies the textLocation in bar indicators - * @Default {null} - */ - textLocation?: ScalesIndicatorsTextLocation; - - /** Specifies the indicator Style of font in bar indicators - * @Default {ej.datavisualization.LinearGauge.IndicatorType.Rectangle} - */ - type?: ej.datavisualization.LinearGauge.IndicatorTypes|string; - - /** Specifies the indicator Width in bar indicators - * @Default {30} - */ - width?: number; -} - -export interface ScalesLabelsDistanceFromScale { - - /** Specifies the xDistanceFromScale of labels. - * @Default {-10} - */ - x?: number; - - /** Specifies the yDistanceFromScale of labels. - * @Default {0} - */ - y?: number; -} - -export interface ScalesLabelsFont { - - /** Specifies the fontFamily of font. - * @Default {Arial} - */ - fontFamily?: string; - - /** Specifies the fontStyle of font.See FontStyle - * @Default {ej.datavisualization.LinearGauge.FontStyle.Bold} - */ - fontStyle?: ej.datavisualization.LinearGauge.FontStyle|string; - - /** Specifies the size of font. - * @Default {11px} - */ - size?: string; -} - -export interface ScalesLabel { - - /** Specifies the angle of labels. - * @Default {0} - */ - angle?: number; - - /** Specifies the DistanceFromScale of labels. - * @Default {null} - */ - distanceFromScale?: ScalesLabelsDistanceFromScale; - - /** Specifies the font of labels. - * @Default {null} - */ - font?: ScalesLabelsFont; - - /** need to includeFirstValue. - * @Default {true} - */ - includeFirstValue?: boolean; - - /** Specifies the opacity of label. - * @Default {0} - */ - opacity?: number; - - /** Specifies the label Placement of label. See LabelPlacement - * @Default {Near} - */ - placement?: ej.datavisualization.LinearGauge.PointerPlacement|string; - - /** Specifies the textColor of font. - * @Default {null} - */ - textColor?: string; - - /** Specifies the label Style of label. See LabelType - * @Default {ej.datavisualization.LinearGauge.LabelType.Major} - */ - type?: ej.datavisualization.LinearGauge.ScaleType|string; - - /** Specifies the unitText of label. - */ - unitText?: string; - - /** Specifies the unitText Position of label.See UnitTextPlacement - * @Default {Back} - */ - unitTextPlacement?: ej.datavisualization.LinearGauge.UnitTextPlacement|string; -} - -export interface ScalesMarkerPointersBorder { - - /** Specifies the border color of marker pointer - * @Default {null} - */ - color?: string; - - /** Specifies the border of marker pointer - * @Default {number} - */ - width?: number; -} - -export interface ScalesMarkerPointer { - - /** Specifies the backgroundColor of marker pointer - * @Default {null} - */ - backgroundColor?: string; - - /** Specifies the border of marker pointer - * @Default {null} - */ - border?: ScalesMarkerPointersBorder; - - /** Specifies the distanceFromScale of marker pointer - * @Default {0} - */ - distanceFromScale?: number; - - /** Specifies the pointer Gradient of marker pointer - * @Default {null} - */ - gradients?: any; - - /** Specifies the pointer Length of marker pointer - * @Default {30} - */ - length?: number; - - /** Specifies the opacity of marker pointer - * @Default {1} - */ - opacity?: number; - - /** Specifies the pointer Placement of marker pointer See PointerPlacement - * @Default {Far} - */ - placement?: ej.datavisualization.LinearGauge.PointerPlacement|string; - - /** Specifies the marker Style of marker pointerSee MarkerType - * @Default {Triangle} - */ - type?: ej.datavisualization.LinearGauge.MarkerType|string; - - /** Specifies the value of marker pointer - * @Default {null} - */ - value?: number; - - /** Specifies the pointer Width of marker pointer - * @Default {30} - */ - width?: number; -} - -export interface ScalesPosition { - - /** Specifies the Horizontal position - * @Default {50} - */ - x?: number; - - /** Specifies the vertical position - * @Default {50} - */ - y?: number; -} - -export interface ScalesRangesBorder { - - /** Specifies the border color in the ranges. - * @Default {null} - */ - color?: string; - - /** Specifies the border width in the ranges. - * @Default {1.5} - */ - width?: number; -} - -export interface ScalesRange { - - /** Specifies the backgroundColor in the ranges. - * @Default {null} - */ - backgroundColor?: string; - - /** Specifies the border in the ranges. - * @Default {null} - */ - border?: ScalesRangesBorder; - - /** Specifies the distanceFromScale in the ranges. - * @Default {0} - */ - distanceFromScale?: number; - - /** Specifies the endValue in the ranges. - * @Default {60} - */ - endValue?: number; - - /** Specifies the endWidth in the ranges. - * @Default {10} - */ - endWidth?: number; - - /** Specifies the range Gradient in the ranges. - * @Default {null} - */ - gradients?: any; - - /** Specifies the opacity in the ranges. - * @Default {null} - */ - opacity?: number; - - /** Specifies the range Position in the ranges. See RangePlacement - * @Default {Center} - */ - placement?: ej.datavisualization.LinearGauge.PointerPlacement|string; - - /** Specifies the startValue in the ranges. - * @Default {20} - */ - startValue?: number; - - /** Specifies the startWidth in the ranges. - * @Default {10} - */ - startWidth?: number; -} - -export interface ScalesTicksDistanceFromScale { - - /** Specifies the xDistanceFromScale in the tick. - * @Default {0} - */ - x?: number; - - /** Specifies the yDistanceFromScale in the tick. - * @Default {0} - */ - y?: number; -} - -export interface ScalesTick { - - /** Specifies the angle in the tick. - * @Default {0} - */ - angle?: number; - - /** Specifies the tick Color in the tick. - * @Default {null} - */ - color?: string; - - /** Specifies the DistanceFromScale in the tick. - * @Default {null} - */ - distanceFromScale?: ScalesTicksDistanceFromScale; - - /** Specifies the tick Height in the tick. - * @Default {10} - */ - height?: number; - - /** Specifies the opacity in the tick. - * @Default {0} - */ - opacity?: number; - - /** Specifies the tick Placement in the tick. See TickPlacement - * @Default {Near} - */ - placement?: ej.datavisualization.LinearGauge.PointerPlacement|string; - - /** Specifies the tick Style in the tick. See TickType - * @Default {MajorInterval} - */ - type?: ej.datavisualization.LinearGauge.TicksType|string; - - /** Specifies the tick Width in the tick. - * @Default {3} - */ - width?: number; -} - -export interface Scale { - - /** Specifies the backgroundColor of the Scale. - * @Default {null} - */ - backgroundColor?: string; - - /** Specifies the scaleBar Gradient of bar pointer - * @Default {Array} - */ - barPointers?: ScalesBarPointer[]; - - /** Specifies the border of the Scale. - * @Default {null} - */ - border?: ScalesBorder; - - /** Specifies the customLabel - * @Default {Array} - */ - customLabels?: ScalesCustomLabel[]; - - /** Specifies the scale Direction of the Scale. See Directions - * @Default {CounterClockwise} - */ - direction?: ej.datavisualization.LinearGauge.Direction|string; - - /** Specifies the indicator - * @Default {Array} - */ - indicators?: ScalesIndicator[]; - - /** Specifies the labels. - * @Default {Array} - */ - labels?: ScalesLabel[]; - - /** Specifies the scaleBar Length. - * @Default {290} - */ - length?: number; - - /** Specifies the majorIntervalValue of the Scale. - * @Default {10} - */ - majorIntervalValue?: number; - - /** Specifies the markerPointers - * @Default {Array} - */ - markerPointers?: ScalesMarkerPointer[]; - - /** Specifies the maximum of the Scale. - * @Default {null} - */ - maximum?: number; - - /** Specifies the minimum of the Scale. - * @Default {null} - */ - minimum?: number; - - /** Specifies the minorIntervalValue of the Scale. - * @Default {2} - */ - minorIntervalValue?: number; - - /** Specifies the opacity of the Scale. - * @Default {NaN} - */ - opacity?: number; - - /** Specifies the position - * @Default {null} - */ - position?: ScalesPosition; - - /** Specifies the ranges in the tick. - * @Default {Array} - */ - ranges?: ScalesRange[]; - - /** Specifies the shadowOffset. - * @Default {0} - */ - shadowOffset?: number; - - /** Specifies the showBarPointers state. - * @Default {true} - */ - showBarPointers?: boolean; - - /** Specifies the showCustomLabels state. - * @Default {false} - */ - showCustomLabels?: boolean; - - /** Specifies the showIndicators state. - * @Default {false} - */ - showIndicators?: boolean; - - /** Specifies the showLabels state. - * @Default {true} - */ - showLabels?: boolean; - - /** Specifies the showMarkerPointers state. - * @Default {true} - */ - showMarkerPointers?: boolean; - - /** Specifies the showRanges state. - * @Default {false} - */ - showRanges?: boolean; - - /** Specifies the showTicks state. - * @Default {true} - */ - showTicks?: boolean; - - /** Specifies the ticks in the scale. - * @Default {Array} - */ - ticks?: ScalesTick[]; - - /** Specifies the scaleBar type .See ScaleType - * @Default {Rectangle} - */ - type?: ej.datavisualization.LinearGauge.ScaleType|string; - - /** Specifies the scaleBar width. - * @Default {30} - */ - width?: number; -} - -export interface Tooltip { - - /** Specify showCustomLabelTooltip value of linear gauge - * @Default {false} - */ - showCustomLabelTooltip?: boolean; - - /** Specify showLabelTooltip value of linear gauge - * @Default {false} - */ - showLabelTooltip?: boolean; - - /** Specify templateID value of linear gauge - * @Default {false} - */ - templateID?: string; -} -} -namespace LinearGauge { -enum OuterCustomLabelPosition { -//string -Left, -//string -Right, -//string -Top, -//string -Bottom, -} -} -namespace LinearGauge { -enum FontStyle { -//string -Bold, -//string -Italic, -//string -Regular, -//string -Strikeout, -//string -Underline, -} -} -namespace LinearGauge { -enum Direction { -//string -Clockwise, -//string -CounterClockwise, -} -} -namespace LinearGauge { -enum IndicatorTypes { -//string -Rectangle, -//string -Circle, -//string -RoundedRectangle, -//string -Text, -} -} -namespace LinearGauge { -enum PointerPlacement { -//string -Near, -//string -Far, -//string -Center, -} -} -namespace LinearGauge { -enum ScaleType { -//string -Major, -//string -Minor, -} -} -namespace LinearGauge { -enum UnitTextPlacement { -//string -Back, -//string -From, -} -} -namespace LinearGauge { -enum MarkerType { -//string -Rectangle, -//string -Triangle, -//string -Ellipse, -//string -Diamond, -//string -Pentagon, -//string -Circle, -//string -Star, -//string -Slider, -//string -Pointer, -//string -Wedge, -//string -Trapezoid, -//string -RoundedRectangle, -} -} -namespace LinearGauge { -enum TicksType { -//string -Majorinterval, -//string -Minorinterval, -} -} -namespace LinearGauge { -enum Themes { -//string -FlatLight, -//string -FlatDark, -} -} - -class CircularGauge extends ej.Widget { - static fn: CircularGauge; - constructor(element: JQuery | Element, options?: CircularGauge.Model); - static Locale: any; - model: CircularGauge.Model; - defaults: CircularGauge.Model; - - /** destroy the circular gauge widget. all events bound using this._on will be unbind automatically and bring the control to pre-init state. - * @returns {void} - */ - destroy(): void; - - /** To export Image - * @returns {boolean} - */ - exportImage(): boolean; - - /** To get BackNeedleLength - * @returns {any} - */ - getBackNeedleLength(): any; - - /** To get CustomLabelAngle - * @returns {any} - */ - getCustomLabelAngle(): any; - - /** To get CustomLabelValue - * @returns {any} - */ - getCustomLabelValue(): any; - - /** To get LabelAngle - * @returns {any} - */ - getLabelAngle(): any; - - /** To get LabelDistanceFromScale - * @returns {any} - */ - getLabelDistanceFromScale(): any; - - /** To get LabelPlacement - * @returns {any} - */ - getLabelPlacement(): any; - - /** To get LabelStyle - * @returns {any} - */ - getLabelStyle(): any; - - /** To get MajorIntervalValue - * @returns {any} - */ - getMajorIntervalValue(): any; - - /** To get MarkerDistanceFromScale - * @returns {any} - */ - getMarkerDistanceFromScale(): any; - - /** To get MarkerStyle - * @returns {any} - */ - getMarkerStyle(): any; - - /** To get MaximumValue - * @returns {any} - */ - getMaximumValue(): any; - - /** To get MinimumValue - * @returns {any} - */ - getMinimumValue(): any; - - /** To get MinorIntervalValue - * @returns {any} - */ - getMinorIntervalValue(): any; - - /** To get NeedleStyle - * @returns {any} - */ - getNeedleStyle(): any; - - /** To get PointerCapBorderWidth - * @returns {any} - */ - getPointerCapBorderWidth(): any; - - /** To get PointerCapRadius - * @returns {any} - */ - getPointerCapRadius(): any; - - /** To get PointerLength - * @returns {any} - */ - getPointerLength(): any; - - /** To get PointerNeedleType - * @returns {any} - */ - getPointerNeedleType(): any; - - /** To get PointerPlacement - * @returns {any} - */ - getPointerPlacement(): any; - - /** To get PointerValue - * @returns {any} - */ - getPointerValue(): any; - - /** To get PointerWidth - * @returns {any} - */ - getPointerWidth(): any; - - /** To get RangeBorderWidth - * @returns {any} - */ - getRangeBorderWidth(): any; - - /** To get RangeDistanceFromScale - * @returns {any} - */ - getRangeDistanceFromScale(): any; - - /** To get RangeEndValue - * @returns {any} - */ - getRangeEndValue(): any; - - /** To get RangePosition - * @returns {any} - */ - getRangePosition(): any; - - /** To get RangeSize - * @returns {any} - */ - getRangeSize(): any; - - /** To get RangeStartValue - * @returns {any} - */ - getRangeStartValue(): any; - - /** To get ScaleBarSize - * @returns {any} - */ - getScaleBarSize(): any; - - /** To get ScaleBorderWidth - * @returns {any} - */ - getScaleBorderWidth(): any; - - /** To get ScaleDirection - * @returns {any} - */ - getScaleDirection(): any; - - /** To get ScaleRadius - * @returns {any} - */ - getScaleRadius(): any; - - /** To get StartAngle - * @returns {any} - */ - getStartAngle(): any; - - /** To get SubGaugeLocation - * @returns {any} - */ - getSubGaugeLocation(): any; - - /** To get SweepAngle - * @returns {any} - */ - getSweepAngle(): any; - - /** To get TickAngle - * @returns {any} - */ - getTickAngle(): any; - - /** To get TickDistanceFromScale - * @returns {any} - */ - getTickDistanceFromScale(): any; - - /** To get TickHeight - * @returns {any} - */ - getTickHeight(): any; - - /** To get TickPlacement - * @returns {any} - */ - getTickPlacement(): any; - - /** To get TickStyle - * @returns {any} - */ - getTickStyle(): any; - - /** To get TickWidth - * @returns {any} - */ - getTickWidth(): any; - - /** To set includeFirstValue - * @returns {void} - */ - includeFirstValue(): void; - - /** Switching the redraw option for the gauge - * @returns {void} - */ - redraw(): void; - - /** To set BackNeedleLength - * @returns {void} - */ - setBackNeedleLength(): void; - - /** To set CustomLabelAngle - * @returns {void} - */ - setCustomLabelAngle(): void; - - /** To set CustomLabelValue - * @returns {void} - */ - setCustomLabelValue(): void; - - /** To set LabelAngle - * @returns {void} - */ - setLabelAngle(): void; - - /** To set LabelDistanceFromScale - * @returns {void} - */ - setLabelDistanceFromScale(): void; - - /** To set LabelPlacement - * @returns {void} - */ - setLabelPlacement(): void; - - /** To set LabelStyle - * @returns {void} - */ - setLabelStyle(): void; - - /** To set MajorIntervalValue - * @returns {void} - */ - setMajorIntervalValue(): void; - - /** To set MarkerDistanceFromScale - * @returns {void} - */ - setMarkerDistanceFromScale(): void; - - /** To set MarkerStyle - * @returns {void} - */ - setMarkerStyle(): void; - - /** To set MaximumValue - * @returns {void} - */ - setMaximumValue(): void; - - /** To set MinimumValue - * @returns {void} - */ - setMinimumValue(): void; - - /** To set MinorIntervalValue - * @returns {void} - */ - setMinorIntervalValue(): void; - - /** To set NeedleStyle - * @returns {void} - */ - setNeedleStyle(): void; - - /** To set PointerCapBorderWidth - * @returns {void} - */ - setPointerCapBorderWidth(): void; - - /** To set PointerCapRadius - * @returns {void} - */ - setPointerCapRadius(): void; - - /** To set PointerLength - * @returns {void} - */ - setPointerLength(): void; - - /** To set PointerNeedleType - * @returns {void} - */ - setPointerNeedleType(): void; - - /** To set PointerPlacement - * @returns {void} - */ - setPointerPlacement(): void; - - /** To set PointerValue - * @returns {void} - */ - setPointerValue(): void; - - /** To set PointerWidth - * @returns {void} - */ - setPointerWidth(): void; - - /** To set RangeBorderWidth - * @returns {void} - */ - setRangeBorderWidth(): void; - - /** To set RangeDistanceFromScale - * @returns {void} - */ - setRangeDistanceFromScale(): void; - - /** To set RangeEndValue - * @returns {void} - */ - setRangeEndValue(): void; - - /** To set RangePosition - * @returns {void} - */ - setRangePosition(): void; - - /** To set RangeSize - * @returns {void} - */ - setRangeSize(): void; - - /** To set RangeStartValue - * @returns {void} - */ - setRangeStartValue(): void; - - /** To set ScaleBarSize - * @returns {void} - */ - setScaleBarSize(): void; - - /** To set ScaleBorderWidth - * @returns {void} - */ - setScaleBorderWidth(): void; - - /** To set ScaleDirection - * @returns {void} - */ - setScaleDirection(): void; - - /** To set ScaleRadius - * @returns {void} - */ - setScaleRadius(): void; - - /** To set StartAngle - * @returns {void} - */ - setStartAngle(): void; - - /** To set SubGaugeLocation - * @returns {void} - */ - setSubGaugeLocation(): void; - - /** To set SweepAngle - * @returns {void} - */ - setSweepAngle(): void; - - /** To set TickAngle - * @returns {void} - */ - setTickAngle(): void; - - /** To set TickDistanceFromScale - * @returns {void} - */ - setTickDistanceFromScale(): void; - - /** To set TickHeight - * @returns {void} - */ - setTickHeight(): void; - - /** To set TickPlacement - * @returns {void} - */ - setTickPlacement(): void; - - /** To set TickStyle - * @returns {void} - */ - setTickStyle(): void; - - /** To set TickWidth - * @returns {void} - */ - setTickWidth(): void; -} -export namespace CircularGauge { - -export interface Model { - - /** Specifies animationSpeed of circular gauge - * @Default {500} - */ - animationSpeed?: number; - - /** Specifies the background color of circular gauge. - * @Default {null} - */ - backgroundColor?: string; - - /** Specify distanceFromCorner value of circular gauge - * @Default {center} - */ - distanceFromCorner?: number; - - /** Specify animate value of circular gauge - * @Default {true} - */ - enableAnimation?: boolean; - - /** Specify the frame of circular gauge - * @Default {Object} - */ - frame?: Frame; - - /** Specify gaugePosition value of circular gauge See GaugePosition - * @Default {center} - */ - gaugePosition?: ej.datavisualization.CircularGauge.gaugePosition|string; - - /** Specifies the height of circular gauge. - * @Default {360} - */ - height?: number; - - /** Specifies the interiorGradient of circular gauge. - * @Default {null} - */ - interiorGradient?: any; - - /** Specify isRadialGradient value of circular gauge - * @Default {false} - */ - isRadialGradient?: boolean; - - /** Specify isResponsive value of circular gauge - * @Default {false} - */ - isResponsive?: boolean; - - /** Specifies the maximum value of circular gauge. - * @Default {100} - */ - maximum?: number; - - /** Specifies the minimum value of circular gauge. - * @Default {0} - */ - minimum?: number; - - /** Specify outerCustomLabelPosition value of circular gauge See OuterCustomLabelPosition - * @Default {bottom} - */ - outerCustomLabelPosition?: ej.datavisualization.CircularGauge.CustomLabelPositionType|string; - - /** Specifies the radius of circular gauge. - * @Default {180} - */ - radius?: number; - - /** Specify readonly value of circular gauge - * @Default {true} - */ - readOnly?: boolean; - - /** Specify the pointers, ticks, labels, indicators, ranges of circular gauge - * @Default {null} - */ - scales?: Scale[]; - - /** Specify the theme of circular gauge. - * @Default {flatlight} - */ - theme?: string; - - /** Specify tooltip option of circular gauge - * @Default {object} - */ - tooltip?: Tooltip; - - /** Specifies the value of circular gauge. - * @Default {0} - */ - value?: number; - - /** Specifies the width of circular gauge. - * @Default {360} - */ - width?: number; - - /** Triggers while the custom labels are being drawn on the gauge. */ - drawCustomLabel?(e: DrawCustomLabelEventArgs): void; - - /** Triggers while the indicators are being started to drawn on the gauge. */ - drawIndicators?(e: DrawIndicatorsEventArgs): void; - - /** Triggers while the labels are being drawn on the gauge. */ - drawLabels?(e: DrawLabelsEventArgs): void; - - /** Triggers while the pointer cap is being drawn on the gauge. */ - drawPointerCap?(e: DrawPointerCapEventArgs): void; - - /** Triggers while the pointers are being drawn on the gauge. */ - drawPointers?(e: DrawPointersEventArgs): void; - - /** Triggers when the ranges begin to be getting drawn on the gauge. */ - drawRange?(e: DrawRangeEventArgs): void; - - /** Triggers while the ticks are being drawn on the gauge. */ - drawTicks?(e: DrawTicksEventArgs): void; - - /** Triggers while the gauge start to Load. */ - load?(e: LoadEventArgs): void; - - /** Triggers when the left mouse button is clicked. */ - mouseClick?(e: MouseClickEventArgs): void; - - /** Triggers when clicking and dragging the mouse pointer over the gauge pointer. */ - mouseClickMove?(e: MouseClickMoveEventArgs): void; - - /** Triggers when the mouse click is released. */ - mouseClickUp?(e: MouseClickUpEventArgs): void; - - /** Triggers when the rendering of the gauge is completed. */ - renderComplete?(e: RenderCompleteEventArgs): void; -} - -export interface DrawCustomLabelEventArgs { - - /** returns the object of the gauge. - */ - object?: any; - - /** returns the cancel option value - */ - cancel?: boolean; - - /** returns the context element - */ - context?: any; - - /** returns the startX and startY of the custom label - */ - position?: any; - - /** returns the gauge model - */ - model?: any; - - /** returns the options of the scale element. - */ - scaleElement?: any; - - /** returns the scaleIndex to which the custom label belongs. - */ - scaleIndex?: number; - - /** returns the custom label style - */ - style?: string; - - /** returns the current custom label element. - */ - customLabelElement?: any; - - /** returns the index of the custom label. - */ - customLabelIndex?: number; - - /** returns the name of the event - */ - type?: string; -} - -export interface DrawIndicatorsEventArgs { - - /** returns the object of the gauge. - */ - object?: any; - - /** returns the cancel option value - */ - cancel?: boolean; - - /** returns the context element - */ - context?: any; - - /** returns the startX and startY of the indicator - */ - position?: any; - - /** returns the gauge model - */ - model?: any; - - /** returns the options of the scale element. - */ - scaleElement?: any; - - /** returns the scaleIndex to which the indicator belongs. - */ - scaleIndex?: number; - - /** returns the indicator style - */ - style?: string; - - /** returns the current indicator element. - */ - indicatorElement?: any; - - /** returns the index of the indicator. - */ - indicatorIndex?: number; - - /** returns the name of the event - */ - type?: string; -} - -export interface DrawLabelsEventArgs { - - /** returns the object of the gauge. - */ - object?: any; - - /** returns the cancel option value - */ - cancel?: boolean; - - /** returns the context element - */ - context?: any; - - /** returns the startX and startY of the labels - */ - position?: any; - - /** returns the gauge model - */ - model?: any; - - /** returns the options of the scale element. - */ - scaleElement?: any; - - /** returns the scaleIndex to which the label belongs. - */ - scaleIndex?: number; - - /** returns the label style - */ - style?: string; - - /** returns the angle of the labels. - */ - angle?: number; - - /** returns the current label element. - */ - element?: any; - - /** returns the index of the label. - */ - index?: number; - - /** returns the value of the label. - */ - pointerValue?: number; - - /** returns the name of the event - */ - type?: string; -} - -export interface DrawPointerCapEventArgs { - - /** returns the object of the gauge. - */ - object?: any; - - /** returns the cancel option value - */ - cancel?: boolean; - - /** returns the context element - */ - context?: any; - - /** returns the options of the scale element. - */ - scaleElement?: any; - - /** returns the startX and startY of the pointer cap. - */ - position?: any; - - /** returns the gauge model - */ - model?: any; - - /** returns the pointer cap style - */ - style?: string; - - /** returns the name of the event - */ - type?: string; -} - -export interface DrawPointersEventArgs { - - /** returns the object of the gauge. - */ - object?: any; - - /** returns the cancel option value - */ - cancel?: boolean; - - /** returns the context element - */ - context?: any; - - /** returns the startX and startY of the pointer - */ - position?: any; - - /** returns the gauge model - */ - model?: any; - - /** returns the options of the scale element. - */ - scaleElement?: any; - - /** returns the scaleIndex to which the pointer belongs. - */ - scaleIndex?: number; - - /** returns the pointer style - */ - style?: string; - - /** returns the angle of the pointer. - */ - angle?: number; - - /** returns the current pointer element. - */ - element?: any; - - /** returns the index of the pointer. - */ - index?: number; - - /** returns the value of the pointer. - */ - value?: number; - - /** returns the name of the event - */ - type?: string; -} - -export interface DrawRangeEventArgs { - - /** returns the object of the gauge. - */ - object?: any; - - /** returns the cancel option value - */ - cancel?: boolean; - - /** returns the context element - */ - context?: any; - - /** returns the startX and startY of the range - */ - position?: any; - - /** returns the gauge model - */ - model?: any; - - /** returns the options of the scale element. - */ - scaleElement?: any; - - /** returns the scaleIndex to which the range belongs. - */ - scaleIndex?: number; - - /** returns the range style - */ - style?: string; - - /** returns the current range element. - */ - rangeElement?: any; - - /** returns the index of the range. - */ - rangeIndex?: number; - - /** returns the name of the event - */ - type?: string; -} - -export interface DrawTicksEventArgs { - - /** returns the object of the gauge. - */ - object?: any; - - /** returns the cancel option value - */ - cancel?: boolean; - - /** returns the context element - */ - context?: any; - - /** returns the startX and startY of the ticks - */ - position?: any; - - /** returns the gauge model - */ - model?: any; - - /** returns the options of the scale element. - */ - scaleElement?: any; - - /** returns the scaleIndex to which the tick belongs. - */ - scaleIndex?: number; - - /** returns the ticks style - */ - style?: string; - - /** returns the angle of the tick. - */ - angle?: number; - - /** returns the current tick element. - */ - element?: any; - - /** returns the index of the tick. - */ - index?: number; - - /** returns the label value of the tick. - */ - pointerValue?: number; - - /** returns the name of the event - */ - type?: string; -} - -export interface LoadEventArgs { - - /** returns the object of the gauge. - */ - object?: any; - - /** returns the cancel option value - */ - cancel?: boolean; - - /** returns the gauge model - */ - Model?: any; - - /** returns the entire scale element. - */ - scaleElement?: any; - - /** returns the context element - */ - context?: any; - - /** returns the name of the event - */ - type?: string; -} - -export interface MouseClickEventArgs { - - /** returns the object of the gauge. - */ - object?: any; - - /** returns the cancel option value - */ - cancel?: boolean; - - /** returns the gauge model - */ - model?: any; - - /** returns the name of the event - */ - type?: any; - - /** returns the scale element. - */ - scaleElement?: any; - - /** returns the scaleIndex to which the pointer belongs. - */ - scaleIndex?: number; - - /** returns the context element - */ - context?: any; - - /** returns the pointer Index - */ - index?: number; - - /** returns the pointer element. - */ - element?: any; - - /** returns the value of the pointer. - */ - value?: number; - - /** returns the angle of the pointer. - */ - angle?: number; - - /** returns the pointer style - */ - style?: string; - - /** returns the startX and startY of the pointer. - */ - position?: any; -} - -export interface MouseClickMoveEventArgs { - - /** returns the object of the gauge. - */ - object?: any; - - /** returns the cancel option value - */ - cancel?: boolean; - - /** returns the gauge model - */ - model?: any; - - /** returns the name of the event - */ - type?: any; - - /** returns the scale element. - */ - scaleElement?: any; - - /** returns the scaleIndex to which the pointer belongs. - */ - scaleIndex?: number; - - /** returns the context element - */ - context?: any; - - /** returns the pointer Index - */ - index?: number; - - /** returns the pointer element. - */ - element?: any; - - /** returns the value of the pointer. - */ - value?: number; - - /** returns the angle of the pointer. - */ - angle?: number; - - /** returns the pointer style - */ - style?: string; - - /** returns the startX and startY of the pointer. - */ - position?: any; -} - -export interface MouseClickUpEventArgs { - - /** returns the object of the gauge. - */ - object?: any; - - /** returns the cancel option value - */ - cancel?: boolean; - - /** returns the gauge model - */ - model?: any; - - /** returns the name of the event - */ - type?: any; - - /** returns the scale element. - */ - scaleElement?: any; - - /** returns the scaleIndex to which the pointer belongs. - */ - scaleIndex?: number; - - /** returns the context element - */ - context?: any; - - /** returns the pointer Index - */ - index?: number; - - /** returns the pointer element. - */ - element?: any; - - /** returns the value of the pointer. - */ - value?: number; - - /** returns the angle of the pointer. - */ - angle?: number; - - /** returns the pointer style - */ - style?: string; - - /** returns the startX and startY of the pointer. - */ - position?: any; -} - -export interface RenderCompleteEventArgs { - - /** returns the object of the gauge. - */ - object?: any; - - /** returns the cancel option value - */ - cancel?: boolean; - - /** returns the context element - */ - context?: any; - - /** returns the entire scale element. - */ - scaleElement?: any; - - /** returns the gauge model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; -} - -export interface Frame { - - /** Specify the URL of the frame background image for circular gauge - * @Default {null} - */ - backgroundImageUrl?: string; - - /** Specifies the frameType of circular gauge. See Frame - * @Default {FullCircle} - */ - frameType?: ej.datavisualization.CircularGauge.FrameType|string; - - /** Specifies the end angle for the half circular frame. - * @Default {360} - */ - halfCircleFrameEndAngle?: number; - - /** Specifies the start angle for the half circular frame. - * @Default {180} - */ - halfCircleFrameStartAngle?: number; -} - -export interface ScalesBorder { - - /** Specify border color for scales of circular gauge - * @Default {null} - */ - color?: string; - - /** Specify border width of circular gauge - * @Default {1.5} - */ - width?: number; -} - -export interface ScalesCustomLabelsPosition { - - /** Specify x-axis position of label - * @Default {0} - */ - x?: number; - - /** Specify y-axis position of labels. - * @Default {0} - */ - y?: number; -} - -export interface ScalesCustomLabelsFont { - - /** Specify font fontFamily for custom labels. - * @Default {Arial} - */ - fontFamily?: string; - - /** Specify font Style for custom labels. - * @Default {Bold} - */ - fontStyle?: string; - - /** Specify font size for custom labels. - * @Default {12px} - */ - size?: string; -} - -export interface ScalesCustomLabel { - - /** Value of the custom labels. - */ - value?: string; - - /** Color of the custom labels. - */ - color?: string; - - /** Specify position of custom labels - * @Default {Object} - */ - position?: ScalesCustomLabelsPosition; - - /** Specify font for custom labels - * @Default {Object} - */ - font?: ScalesCustomLabelsFont; -} - -export interface ScalesIndicatorsPosition { - - /** Specify x-axis of position of circular gauge - * @Default {0} - */ - x?: number; - - /** Specify y-axis of position of circular gauge - * @Default {0} - */ - y?: number; -} - -export interface ScalesIndicatorsStateRange { - - /** Specify backgroundColor for indicator of circular gauge - * @Default {null} - */ - backgroundColor?: string; - - /** Specify borderColor for indicator of circular gauge - * @Default {null} - */ - borderColor?: string; - - /** Specify end value for each specified state of circular gauge - * @Default {0} - */ - endValue?: number; - - /** Specify value of the font as the indicator when the indicator style is set with the value "text" of circular gauge - * @Default {null} - */ - font?: any; - - /** Specify start value for each specified state of circular gauge - * @Default {0} - */ - startValue?: number; - - /** Specify value of the text as the indicator when the indicator style is set with the value "text" of circular gauge - */ - text?: string; - - /** Specify value of the textColor as the indicator when the indicator style is set with the value "text" of circular gauge - * @Default {null} - */ - textColor?: string; -} - -export interface ScalesIndicator { - - /** Specify indicator height of circular gauge - * @Default {15} - */ - height?: number; - - /** Specify imageUrl of circular gauge - * @Default {null} - */ - imageUrl?: string; - - /** Specify position of circular gauge - * @Default {Object} - */ - position?: ScalesIndicatorsPosition; - - /** Specify the various states of circular gauge - * @Default {Array} - */ - stateRanges?: ScalesIndicatorsStateRange[]; - - /** Specify indicator style of circular gauge. See IndicatorType - * @Default {Circle} - */ - type?: ej.datavisualization.CircularGauge.IndicatorTypes|string; - - /** Specify indicator width of circular gauge - * @Default {15} - */ - width?: number; -} - -export interface ScalesLabelsFont { - - /** Specify font fontFamily for labels of circular gauge - * @Default {Arial} - */ - fontFamily?: string; - - /** Specify font Style for labels of circular gauge - * @Default {Bold} - */ - fontStyle?: string; - - /** Specify font size for labels of circular gauge - * @Default {11px} - */ - size?: string; -} - -export interface ScalesLabel { - - /** Specify the angle for the labels of circular gauge - * @Default {0} - */ - angle?: number; - - /** Specify labels autoAngle value of circular gauge - * @Default {false} - */ - autoAngle?: boolean; - - /** Specify label color of circular gauge - * @Default {null} - */ - color?: string; - - /** Specify distanceFromScale value for labels of circular gauge - * @Default {0} - */ - distanceFromScale?: number; - - /** Specify font for labels of circular gauge - * @Default {Object} - */ - font?: ScalesLabelsFont; - - /** Specify includeFirstValue of circular gauge - * @Default {true} - */ - includeFirstValue?: boolean; - - /** Specify opacity value for labels of circular gauge - * @Default {null} - */ - opacity?: number; - - /** Specify label placement of circular gauge. See LabelPlacement - * @Default {Near} - */ - placement?: ej.datavisualization.CircularGauge.Placement|string; - - /** Specify label Style of circular gauge. See LabelType - * @Default {Major} - */ - type?: ej.datavisualization.CircularGauge.LabelType|string; - - /** Specify unitText of circular gauge - */ - unitText?: string; - - /** Specify unitTextPosition of circular gauge. See UnitTextPosition - * @Default {Back} - */ - unitTextPosition?: ej.datavisualization.CircularGauge.UnitTextPlacement|string; -} - -export interface ScalesPointerCap { - - /** Specify cap backgroundColor of circular gauge - * @Default {null} - */ - backgroundColor?: string; - - /** Specify cap borderColor of circular gauge - * @Default {null} - */ - borderColor?: string; - - /** Specify pointerCap borderWidth value of circular gauge - * @Default {3} - */ - borderWidth?: number; - - /** Specify cap interiorGradient value of circular gauge - * @Default {null} - */ - interiorGradient?: any; - - /** Specify pointerCap Radius value of circular gauge - * @Default {7} - */ - radius?: number; -} - -export interface ScalesPointersBorder { - - /** Specify border color for pointer of circular gauge - * @Default {null} - */ - color?: string; - - /** Specify border width for pointers of circular gauge - * @Default {1.5} - */ - width?: number; -} - -export interface ScalesPointersPointerValueTextFont { - - /** Specify pointer value text font family of circular gauge. - * @Default {Arial} - */ - fontFamily?: string; - - /** Specify pointer value text font style of circular gauge. - * @Default {Bold} - */ - fontStyle?: string; - - /** Specify pointer value text size of circular gauge. - * @Default {11px} - */ - size?: string; -} - -export interface ScalesPointersPointerValueText { - - /** Specify pointer text angle of circular gauge. - * @Default {0} - */ - angle?: number; - - /** Specify pointer text auto angle of circular gauge. - * @Default {false} - */ - autoAngle?: boolean; - - /** Specify pointer value text color of circular gauge. - * @Default {#8c8c8c} - */ - color?: string; - - /** Specify pointer value text distance from pointer of circular gauge. - * @Default {20} - */ - distance?: number; - - /** Specify pointer value text font option of circular gauge. - * @Default {object} - */ - font?: ScalesPointersPointerValueTextFont; - - /** Specify pointer value text opacity of circular gauge. - * @Default {1} - */ - opacity?: number; - - /** enable pointer value text visibility of circular gauge. - * @Default {false} - */ - showValue?: boolean; -} - -export interface ScalesPointer { - - /** Specify backgroundColor for the pointer of circular gauge - * @Default {null} - */ - backgroundColor?: string; - - /** Specify backNeedleLength of circular gauge - * @Default {10} - */ - backNeedleLength?: number; - - /** Specify the border for pointers of circular gauge - * @Default {Object} - */ - border?: ScalesPointersBorder; - - /** Specify distanceFromScale value for pointers of circular gauge - * @Default {0} - */ - distanceFromScale?: number; - - /** Specify pointer gradients of circular gauge - * @Default {null} - */ - gradients?: any; - - /** Specify pointer image of circular gauge.It is applicable for both marker as well as needle type pointers. - * @Default {NULL} - */ - imageUrl?: string; - - /** Specify pointer length of circular gauge - * @Default {150} - */ - length?: number; - - /** Specify marker Style value of circular gauge. See MarkerType - * @Default {Rectangle} - */ - markerType?: ej.datavisualization.CircularGauge.MarkerType|string; - - /** Specify needle Style value of circular gauge. See NeedleType - * @Default {Triangle} - */ - needleType?: ej.datavisualization.CircularGauge.NeedleType|string; - - /** Specify opacity value for pointer of circular gauge - * @Default {1} - */ - opacity?: number; - - /** Specify radius value for pointer of circular gauge - * @Default {null} - */ - radius?: number; - - /** Specify pointer Placement value of circular gauge. See PointerPlacement - * @Default {Near} - */ - placement?: ej.datavisualization.CircularGauge.Placement|string; - - /** Specify pointer value text of circular gauge. - * @Default {Object} - */ - pointerValueText?: ScalesPointersPointerValueText; - - /** Specify showBackNeedle value of circular gauge - * @Default {false} - */ - showBackNeedle?: boolean; - - /** Specify pointer type value of circular gauge. See PointerType - * @Default {Needle} - */ - type?: ej.datavisualization.CircularGauge.PointerType|string; - - /** Specify value of the pointer of circular gauge - * @Default {null} - */ - value?: number; - - /** Specify pointer width of circular gauge - * @Default {7} - */ - width?: number; -} - -export interface ScalesRangesBorder { - - /** Specify border color for ranges of circular gauge - * @Default {#32b3c6} - */ - color?: string; - - /** Specify border width for ranges of circular gauge - * @Default {1.5} - */ - width?: number; -} - -export interface ScalesRange { - - /** Specify backgroundColor for the ranges of circular gauge - * @Default {#32b3c6} - */ - backgroundColor?: string; - - /** Specify border for ranges of circular gauge - * @Default {Object} - */ - border?: ScalesRangesBorder; - - /** Specify distanceFromScale value for ranges of circular gauge - * @Default {25} - */ - distanceFromScale?: number; - - /** Specify endValue for ranges of circular gauge - * @Default {null} - */ - endValue?: number; - - /** Specify endWidth for ranges of circular gauge - * @Default {10} - */ - endWidth?: number; - - /** Specify range gradients of circular gauge - * @Default {null} - */ - gradients?: any; - - /** Specify opacity value for ranges of circular gauge - * @Default {null} - */ - opacity?: number; - - /** Specify placement of circular gauge. See RangePlacement - * @Default {Near} - */ - placement?: ej.datavisualization.CircularGauge.Placement|string; - - /** Specify size of the range value of circular gauge - * @Default {5} - */ - size?: number; - - /** Specify startValue for ranges of circular gauge - * @Default {null} - */ - startValue?: number; - - /** Specify startWidth of circular gauge - * @Default {[Array.number] scale.ranges.startWidth = 10} - */ - startWidth?: number; -} - -export interface ScalesSubGaugesPosition { - - /** Specify x-axis position for sub-gauge of circular gauge - * @Default {0} - */ - x?: number; - - /** Specify y-axis position for sub-gauge of circular gauge - * @Default {0} - */ - y?: number; -} - -export interface ScalesSubGauge { - - /** Specify subGauge Height of circular gauge - * @Default {150} - */ - height?: number; - - /** Specify position for sub-gauge of circular gauge - * @Default {Object} - */ - position?: ScalesSubGaugesPosition; - - /** Specify subGauge Width of circular gauge - * @Default {150} - */ - width?: number; -} - -export interface ScalesTick { - - /** Specify the angle for the ticks of circular gauge - * @Default {0} - */ - angle?: number; - - /** Specify tick color of circular gauge - * @Default {null} - */ - color?: string; - - /** Specify distanceFromScale value for ticks of circular gauge - * @Default {0} - */ - distanceFromScale?: number; - - /** Specify tick height of circular gauge - * @Default {16} - */ - height?: number; - - /** Specify tick placement of circular gauge. See TickPlacement - * @Default {Near} - */ - placement?: ej.datavisualization.CircularGauge.Placement|string; - - /** Specify tick Style of circular gauge. See TickType - * @Default {Major} - */ - type?: ej.datavisualization.CircularGauge.LabelType|string; - - /** Specify tick width of circular gauge - * @Default {3} - */ - width?: number; -} - -export interface Scale { - - /** Specify backgroundColor for the scale of circular gauge - * @Default {null} - */ - backgroundColor?: string; - - /** Specify border for scales of circular gauge - * @Default {Object} - */ - border?: ScalesBorder; - - /** Specify scale direction of circular gauge. See Directions - * @Default {Clockwise} - */ - direction?: ej.datavisualization.CircularGauge.Direction|string; - - /** Specify the custom labels for the scales. - * @Default {Array} - */ - customLabels?: ScalesCustomLabel[]; - - /** Specify representing state of circular gauge - * @Default {Array} - */ - indicators?: ScalesIndicator[]; - - /** Specify the text values displayed in a meaningful manner alongside the ticks of circular gauge - * @Default {Array} - */ - labels?: ScalesLabel[]; - - /** Specify majorIntervalValue of circular gauge - * @Default {10} - */ - majorIntervalValue?: number; - - /** Specify maximum scale value of circular gauge - * @Default {null} - */ - maximum?: number; - - /** Specify minimum scale value of circular gauge - * @Default {null} - */ - minimum?: number; - - /** Specify minorIntervalValue of circular gauge - * @Default {2} - */ - minorIntervalValue?: number; - - /** Specify opacity value of circular gauge - * @Default {1} - */ - opacity?: number; - - /** Specify pointer cap of circular gauge - * @Default {Object} - */ - pointerCap?: ScalesPointerCap; - - /** Specify pointers value of circular gauge - * @Default {Array} - */ - pointers?: ScalesPointer[]; - - /** Specify scale radius of circular gauge - * @Default {170} - */ - radius?: number; - - /** Specify ranges value of circular gauge - * @Default {Array} - */ - ranges?: ScalesRange[]; - - /** Specify shadowOffset value of circular gauge - * @Default {0} - */ - shadowOffset?: number; - - /** Specify showIndicators of circular gauge - * @Default {false} - */ - showIndicators?: boolean; - - /** Specify showLabels of circular gauge - * @Default {true} - */ - showLabels?: boolean; - - /** Specify showPointers of circular gauge - * @Default {true} - */ - showPointers?: boolean; - - /** Specify showRanges of circular gauge - * @Default {false} - */ - showRanges?: boolean; - - /** Specify showScaleBar of circular gauge - * @Default {false} - */ - showScaleBar?: boolean; - - /** Specify showTicks of circular gauge - * @Default {true} - */ - showTicks?: boolean; - - /** Specify scaleBar size of circular gauge - * @Default {6} - */ - size?: number; - - /** Specify startAngle of circular gauge - * @Default {115} - */ - startAngle?: number; - - /** Specify subGauge of circular gauge - * @Default {Array} - */ - subGauges?: ScalesSubGauge[]; - - /** Specify sweepAngle of circular gauge - * @Default {310} - */ - sweepAngle?: number; - - /** Specify ticks of circular gauge - * @Default {Array} - */ - ticks?: ScalesTick[]; -} - -export interface Tooltip { - - /** enable showCustomLabelTooltip of circular gauge - * @Default {false} - */ - showCustomLabelTooltip?: boolean; - - /** enable showLabelTooltip of circular gauge - * @Default {false} - */ - showLabelTooltip?: boolean; - - /** Specify tooltip templateID of circular gauge - * @Default {false} - */ - templateID?: string; -} -} -namespace CircularGauge { -enum FrameType { -//string -FullCircle, -//string -HalfCircle, -} -} -namespace CircularGauge { -enum gaugePosition { -//string -TopLeft, -//string -TopRight, -//string -TopCenter, -//string -MiddleLeft, -//string -MiddleRight, -//string -Center, -//string -BottomLeft, -//string -BottomRight, -//string -BottomCenter, -} -} -namespace CircularGauge { -enum CustomLabelPositionType { -//string -Top, -//string -Bottom, -//string -Right, -//string -Left, -} -} -namespace CircularGauge { -enum Direction { -//string -Clockwise, -//string -CounterClockwise, -} -} -namespace CircularGauge { -enum IndicatorTypes { -//string -Rectangle, -//string -Circle, -//string -Text, -//string -RoundedRectangle, -//string -Image, -} -} -namespace CircularGauge { -enum Placement { -//string -Near, -//string -Far, -} -} -namespace CircularGauge { -enum LabelType { -//string -Major, -//string -Minor, -} -} -namespace CircularGauge { -enum UnitTextPlacement { -//string -Back, -//string -Front, -} -} -namespace CircularGauge { -enum MarkerType { -//string -Rectangle, -//string -Circle, -//string -Triangle, -//string -Ellipse, -//string -Diamond, -//string -Pentagon, -//string -Slider, -//string -Pointer, -//string -Wedge, -//string -Trapezoid, -//string -RoundedRectangle, -//string -Image, -} -} -namespace CircularGauge { -enum NeedleType { -//string -Triangle, -//string -Rectangle, -//string -Arrow, -//string -Image, -//string -Trapezoid, -} -} -namespace CircularGauge { -enum PointerType { -//string -Needle, -//string -Marker, -} -} - -class DigitalGauge extends ej.Widget { - static fn: DigitalGauge; - constructor(element: JQuery | Element, options?: DigitalGauge.Model); - static Locale: any; - model: DigitalGauge.Model; - defaults: DigitalGauge.Model; - - /** To destroy the digital gauge - * @returns {void} - */ - destroy(): void; - - /** To export Digital Gauge as Image - * @param {string} fileName for the Image - * @param {string} fileType for the Image - * @returns {boolean} - */ - exportImage(fileName: string, fileType: string): boolean; - - /** Gets the location of an item that is displayed on the gauge. - * @param {number} Position value of an item that is displayed on the gauge. - * @returns {any} - */ - getPosition(itemIndex: number): any; - - /** ClientSideMethod getValue Gets the value of an item that is displayed on the gauge - * @param {number} Index value of an item that displayed on the gauge - * @returns {any} - */ - getValue(itemIndex: number): any; - - /** Refresh the digital gauge widget - * @returns {void} - */ - refresh(): void; - - /** ClientSideMethod Set Position Sets the location of an item to be displayed in the gauge - * @param {number} Index value of the digital gauge item - * @param {any} Location value of the digital gauge - * @returns {void} - */ - setPosition(itemIndex: number, value: any): void; - - /** ClientSideMethod SetValue Sets the value of an item to be displayed in the gauge. - * @param {number} Index value of the digital gauge item - * @param {string} Text value to be displayed in the gaugeS - * @returns {void} - */ - setValue(itemIndex: number, value: string): void; -} -export namespace DigitalGauge { - -export interface Model { - - /** Specifies the frame of the Digital gauge. - * @Default {{backgroundImageUrl: null, innerWidth: 6, outerWidth: 10}} - */ - frame?: Frame; - - /** Specifies the height of the DigitalGauge. - * @Default {150} - */ - height?: number; - - /** Specifies the resize option of the DigitalGauge. - * @Default {false} - */ - isResponsive?: boolean; - - /** Specifies the items for the DigitalGauge. - * @Default {null} - */ - items?: Item[]; - - /** Specifies the matrixSegmentData for the DigitalGauge. - */ - matrixSegmentData?: any; - - /** Specifies the segmentData for the DigitalGauge. - */ - segmentData?: any; - - /** Specifies the themes for the Digital gauge. See Themes - * @Default {flatlight} - */ - themes?: string; - - /** Specifies the value to the DigitalGauge. - * @Default {text} - */ - value?: string; - - /** Specifies the width for the Digital gauge. - * @Default {400} - */ - width?: number; - - /** Triggers when the gauge is initialized. */ - init?(e: InitEventArgs): void; - - /** Triggers when the gauge item rendering. */ - itemRendering?(e: ItemRenderingEventArgs): void; - - /** Triggers when the gauge is start to load. */ - load?(e: LoadEventArgs): void; - - /** Triggers when the gauge render is completed. */ - renderComplete?(e: RenderCompleteEventArgs): void; -} - -export interface InitEventArgs { - - /** returns the object of the gauge. - */ - object?: any; - - /** returns the cancel option value - */ - cancel?: boolean; - - /** returns the all the options of the items. - */ - items?: any; - - /** returns the context element - */ - context?: any; - - /** returns the gauge model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; -} - -export interface ItemRenderingEventArgs { - - /** returns the object of the gauge. - */ - object?: any; - - /** returns the cancel option value - */ - cancel?: boolean; - - /** returns the all the options of the items. - */ - items?: any; - - /** returns the context element - */ - context?: any; - - /** returns the gauge model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; -} - -export interface LoadEventArgs { - - /** returns the object of the gauge. - */ - object?: any; - - /** returns the cancel option value - */ - cancel?: boolean; - - /** returns the all the options of the items. - */ - items?: any; - - /** returns the context element - */ - context?: any; - - /** returns the gauge model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; -} - -export interface RenderCompleteEventArgs { - - /** returns the object of the gauge. - */ - object?: any; - - /** returns the cancel option value - */ - cancel?: boolean; - - /** returns the all the options of the items. - */ - items?: any; - - /** returns the context element - */ - context?: any; - - /** returns the gauge model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; -} - -export interface Frame { - - /** Specifies the URL of an image to be displayed as background of the Digital gauge. - * @Default {null} - */ - backgroundImageUrl?: string; - - /** Specifies the inner width for the frame, when the background image has been set for the Digital gauge.. - * @Default {6} - */ - innerWidth?: number; - - /** Specifies the outer width of the frame, when the background image has been set for the Digital gauge. - * @Default {10} - */ - outerWidth?: number; -} - -export interface ItemsCharacterSettings { - - /** Specifies the CharacterCount value for the DigitalGauge. - * @Default {4} - */ - count?: number; - - /** Specifies the opacity value for the DigitalGauge. - * @Default {1} - */ - opacity?: number; - - /** Specifies the value for spacing between the characters - * @Default {2} - */ - spacing?: number; - - /** Specifies the character type for the text to be displayed. - * @Default {ej.datavisualization.DigitalGauge.CharacterType.EightCrossEightDotMatrix} - */ - type?: ej.datavisualization.DigitalGauge.CharacterType|string; -} - -export interface ItemsFont { - - /** Set the font family value - * @Default {Arial} - */ - fontFamily?: string; - - /** Set the font style for the font - * @Default {italic} - */ - fontStyle?: ej.datavisualization.DigitalGauge.FontStyle|string; - - /** Set the font size value - * @Default {11px} - */ - size?: string; -} - -export interface ItemsPosition { - - /** Set the horizontal location for the text, where it needs to be placed within the gauge. - * @Default {0} - */ - x?: number; - - /** Set the vertical location for the text, where it needs to be placed within the gauge. - * @Default {0} - */ - y?: number; -} - -export interface ItemsSegmentSettings { - - /** Set the color for the text segments. - * @Default {null} - */ - color?: string; - - /** Set the gradient for the text segments. - * @Default {null} - */ - gradient?: any; - - /** Set the length for the text segments. - * @Default {2} - */ - length?: number; - - /** Set the opacity for the text segments. - * @Default {0} - */ - opacity?: number; - - /** Set the spacing for the text segments. - * @Default {1} - */ - spacing?: number; - - /** Set the width for the text segments. - * @Default {1} - */ - width?: number; -} - -export interface Item { - - /** Specifies the Character settings for the DigitalGauge. - * @Default {null} - */ - characterSettings?: ItemsCharacterSettings; - - /** Enable/Disable the custom font to be applied to the text in the gauge. - * @Default {false} - */ - enableCustomFont?: boolean; - - /** Set the specific font for the text, when the enableCustomFont is set to true - * @Default {null} - */ - font?: ItemsFont; - - /** Set the location for the text, where it needs to be placed within the gauge. - * @Default {null} - */ - position?: ItemsPosition; - - /** Set the segment settings for the digital gauge. - * @Default {null} - */ - segmentSettings?: ItemsSegmentSettings; - - /** Set the value for enabling/disabling the blurring effect for the shadows of the text - * @Default {0} - */ - shadowBlur?: number; - - /** Specifies the color of the text shadow. - * @Default {null} - */ - shadowColor?: string; - - /** Set the x offset value for the shadow of the text, indicating the location where it needs to be displayed. - * @Default {1} - */ - shadowOffsetX?: number; - - /** Set the y offset value for the shadow of the text, indicating the location where it needs to be displayed. - * @Default {1} - */ - shadowOffsetY?: number; - - /** Set the alignment of the text that is displayed within the gauge.See TextAlign - * @Default {left} - */ - textAlign?: string; - - /** Specifies the color of the text. - * @Default {null} - */ - textColor?: string; - - /** Specifies the text value. - * @Default {null} - */ - value?: string; -} -} -namespace DigitalGauge { -enum CharacterType { -//string -SevenSegment, -//string -FourteenSegment, -//string -SixteenSegment, -//string -EightCrossEightDotMatrix, -//string -EightCrossEightSquareMatrix, -} -} -namespace DigitalGauge { -enum FontStyle { -//string -Normal, -//string -Bold, -//string -Italic, -//string -Underline, -//string -Strikeout, -} -} - -class Chart extends ej.Widget { - static fn: Chart; - constructor(element: JQuery | Element, options?: Chart.Model); - static Locale: any; - model: Chart.Model; - defaults: Chart.Model; - - /** Animates the series and/or indicators in Chart. When parameter is not passed to this method, then all the series and indicators present in Chart are animated. - * @param {any} If an array collection is passed as parameter, series and indicator objects passed in array collection are animated.ExampleIf a series - * or indicator object is passed to this method, then the specific series or indicator is animated.Example, - * @returns {void} - */ - animate(options: any): void; - - /** Exports chart as an image or to an excel file. Chart can be exported as an image only when exportCanvasRendering option is set to true. - * @param {string} Type of the export operation to be performed. Following are the two export types that are supported now,1. 'image'2. 'excel'Example - * @param {string} URL of the service, where the chart will be exported to excel.Example, - * @param {boolean} When this parameter is true, all the chart objects initialized to the same document are exported to a single excel file. - * This is an optional parameter. By default, it is false.Example, - * @returns {any} - */ - export(type: string, URL: string, exportMultipleChart: boolean): any; - - /** Redraws the entire chart. You can call this method whenever you update, add or remove points from the data source or whenever you want to refresh the UI. - * @returns {void} - */ - redraw(): void; -} -export namespace Chart { - -export interface Model { - - /** Options for adding and customizing annotations in Chart. - */ - annotations?: Annotation[]; - - /** URL of the image to be used as chart background. - * @Default {null} - */ - backGroundImageUrl?: string; - - /** Options for customizing the color, opacity and width of the chart border. - */ - border?: Border; - - /** This provides options for customizing export settings - */ - exportSettings?: ExportSettings; - - /** Options for configuring the border and background of the plot area. - */ - chartArea?: ChartArea; - - /** Options to split Chart into multiple plotting areas vertically. Each object in the collection represents a plotting area in Chart. - */ - columnDefinitions?: ColumnDefinition[]; - - /** Options for configuring the properties of all the series. You can also override the options for specific series by using series collection. - */ - commonSeriesOptions?: CommonSeriesOptions; - - /** Options for displaying and customizing the crosshair. - */ - crosshair?: Crosshair; - - /** Depth of the 3D Chart from front view of series to background wall. This property is applicable only for 3D view. - * @Default {100} - */ - depth?: number; - - /** Controls whether 3D view has to be enabled or not. 3D view is supported only for column, bar. Stacking column, stacking bar, pie and doughnut series types. - * @Default {false} - */ - enable3D?: boolean; - - /** Controls whether Chart has to be rendered as Canvas or SVG. Canvas rendering supports all functionalities in SVG rendering except 3D Charts. - * @Default {false} - */ - enableCanvasRendering?: boolean; - - /** Controls whether the series has to be rendered at initial loading of chart, this will be useful in scenarios where chart is placed at the bottom of the web page - * and we need to render the series only when the chart is visible while scrolling to the top. - * @Default {true} - */ - initSeriesRender?: boolean; - - /** Controls whether 3D view has to be rotated on dragging. This property is applicable only for 3D view. - * @Default {false} - */ - enableRotation?: boolean; - - /** Options to customize the technical indicators. - */ - indicators?: Indicator[]; - - /** Controls whether Chart has to be responsive while resizing. - * @Default {false} - */ - isResponsive?: boolean; - - /** Options to customize the legend items and legend title. - */ - legend?: Legend; - - /** Name of the culture based on which chart should be localized. Number and date time values are localized with respect to the culture name.String type properties like title text are - * not localized automatically. Provide localized text as value to string type properties. - * @Default {en-US} - */ - locale?: string; - - /** Palette is used to store the series fill color in array and apply the color to series collection in the order of series index. - * @Default {null} - */ - palette?: any[]; - - /** Options to customize the left, right, top and bottom margins of chart area. - */ - Margin?: any; - - /** Perspective angle of the 3D view. Chart appears closer when perspective angle is decreased, and distant when perspective angle is increased. - * This property is applicable only when 3D view is enabled - * @Default {90} - */ - perspectiveAngle?: number; - - /** This is a horizontal axis that contains options to configure axis and it is the primary x axis for all the series in series array. - * To override x axis for particular series, create an axis object by providing unique name by using name property and add it to axes array. - * Then, assign the name to the series’s xAxisName property to link both axis and series. - */ - primaryXAxis?: PrimaryXAxis; - - /** To override x axis for particular series, create an axis object by providing unique name by using name property and add it to axes array. - * Then, assign the name to the series’s xAxisName property to link both axis and series. - */ - axes?: Axis[]; - - /** This is a vertical axis that contains options to configure axis. This is the primary y axis for all the series in series array. - * To override y axis for particular series, create an axis object by providing unique name by using name property and add it to axes array. - * Then, assign the name to the series’s yAxisName property to link both axis and series. - */ - primaryYAxis?: PrimaryYAxis; - - /** Rotation angle of the 3D view. This property is applicable only when 3D view is enabled. - * @Default {0} - */ - rotation?: number; - - /** Options to split Chart into multiple plotting areas horizontally. Each object in the collection represents a plotting area in Chart. - */ - rowDefinitions?: RowDefinition[]; - - /** Specifies the properties used for customizing the series. - */ - series?: Series[]; - - /** Controls whether data points has to be displayed side by side or along the depth of the axis. - * @Default {false} - */ - sideBySideSeriesPlacement?: boolean; - - /** Options to customize the Chart size. - */ - size?: Size; - - /** Specifies the theme for Chart. - * @Default {Flatlight. See Theme} - */ - theme?: ej.datavisualization.Chart.Theme|string; - - /** Slope angle of 3D Chart. This property is applicable only when 3D view is enabled. - * @Default {0} - */ - tilt?: number; - - /** Options for customizing the title and subtitle of Chart. - */ - title?: Title; - - /** Width of the wall used in 3D Chart. Wall is present only in Cartesian type 3D series and not in 3D pie or Doughnut series. This property is applicable only when 3D view is enabled. - * @Default {2} - */ - wallSize?: number; - - /** Options for enabling zooming feature of chart. - */ - zooming?: Zooming; - - /** Fires after the series animation is completed. This event will be triggered for each series when animation is enabled. */ - animationComplete?(e: AnimationCompleteEventArgs): void; - - /** Fires before rendering the labels. This event is fired for each label in axis. You can use this event to add custom text to axis labels. */ - axesLabelRendering?(e: AxesLabelRenderingEventArgs): void; - - /** Fires during the initialization of axis labels. */ - axesLabelsInitialize?(e: AxesLabelsInitializeEventArgs): void; - - /** Fires during axes range calculation. This event is fired for each axis present in Chart. You can use this event to customize axis range as required. */ - axesRangeCalculate?(e: AxesRangeCalculateEventArgs): void; - - /** Fires before rendering the axis title. This event is triggered for each axis with title. You can use this event to add custom text to axis title. */ - axesTitleRendering?(e: AxesTitleRenderingEventArgs): void; - - /** Fires during the calculation of chart area bounds. You can use this event to customize the bounds of chart area. */ - chartAreaBoundsCalculate?(e: ChartAreaBoundsCalculateEventArgs): void; - - /** Fires after chart is created. */ - create?(e: CreateEventArgs): void; - - /** Fires when chart is destroyed completely. */ - destroy?(e: DestroyEventArgs): void; - - /** Fires before rendering the data labels. This event is triggered for each data label in the series. You can use this event to add custom text in data labels. */ - displayTextRendering?(e: DisplayTextRenderingEventArgs): void; - - /** Fires during the calculation of legend bounds. You can use this event to customize the bounds of legend. */ - legendBoundsCalculate?(e: LegendBoundsCalculateEventArgs): void; - - /** Fires on clicking the legend item. */ - legendItemClick?(e: LegendItemClickEventArgs): void; - - /** Fires when moving mouse over legend item. You can use this event for hit testing on legend items. */ - legendItemMouseMove?(e: LegendItemMouseMoveEventArgs): void; - - /** Fires before rendering the legend item. This event is fired for each legend item in Chart. You can use this event to customize legend item shape or add custom text to legend item. */ - legendItemRendering?(e: LegendItemRenderingEventArgs): void; - - /** Fires before loading the chart. */ - load?(e: LoadEventArgs): void; - - /** Fires after selected the data in chart. */ - rangeSelected?(e: RangeSelectedEventArgs): void; - - /** Fires on clicking a point in chart. You can use this event to handle clicks made on points. */ - pointRegionClick?(e: PointRegionClickEventArgs): void; - - /** Fires when mouse is moved over a point. */ - pointRegionMouseMove?(e: PointRegionMouseMoveEventArgs): void; - - /** Fires before rendering chart. */ - preRender?(e: PreRenderEventArgs): void; - - /** Fires after selecting a series. This event is triggered after selecting a series only if selection mode is series. */ - seriesRegionClick?(e: SeriesRegionClickEventArgs): void; - - /** Fires before rendering a series. This event is fired for each series in Chart. */ - seriesRendering?(e: SeriesRenderingEventArgs): void; - - /** Fires before rendering the marker symbols. This event is triggered for each marker in Chart. */ - symbolRendering?(e: SymbolRenderingEventArgs): void; - - /** Fires before rendering the Chart title. You can use this event to add custom text in Chart title. */ - titleRendering?(e: TitleRenderingEventArgs): void; - - /** Fires before rendering the tooltip. This event is fired when tooltip is enabled and mouse is hovered on a Chart point. You can use this event to customize tooltip before rendering. */ - toolTipInitialize?(e: ToolTipInitializeEventArgs): void; - - /** Fires before rendering crosshair tooltip in axis. This event is fired for each axis with crosshair label enabled. You can use this event to customize crosshair label before rendering */ - trackAxisToolTip?(e: TrackAxisToolTipEventArgs): void; - - /** Fires before rendering trackball tooltip. This event is fired for each series in Chart because trackball tooltip is displayed for all the series. - * You can use this event to customize the text displayed in trackball tooltip. */ - trackToolTip?(e: TrackToolTipEventArgs): void; - - /** Fires, on clicking the axis label. */ - axisLabelClick?(e: AxisLabelClickEventArgs): void; - - /** Fires on moving mouse over the axis label. */ - axisLabelMouseMove?(e: AxisLabelMouseMoveEventArgs): void; - - /** Fires, on the clicking the chart. */ - chartClick?(e: ChartClickEventArgs): void; - - /** Fires on moving mouse over the chart. */ - chartMouseMove?(e: ChartMouseMoveEventArgs): void; - - /** Fires, on double clicking the chart. */ - chartDoubleClick?(e: ChartDoubleClickEventArgs): void; - - /** Fires on clicking the annotation. */ - annotationClick?(e: AnnotationClickEventArgs): void; - - /** Fires, after the chart is resized. */ - afterResize?(e: AfterResizeEventArgs): void; - - /** Fires, when chart size is changing. */ - beforeResize?(e: BeforeResizeEventArgs): void; - - /** Fires, when error bar is rendering. */ - errorBarRendering?(e: ErrorBarRenderingEventArgs): void; - - /** Trigger, after the scrollbar position is changed. */ - scrollChanged?(e: ScrollChangedEventArgs): void; - - /** Event triggered when scroll starts */ - scrollStart?(e: ScrollStartEventArgs): void; - - /** Event triggered when scroll end */ - scrollEnd?(e: ScrollEndEventArgs): void; -} - -export interface AnimationCompleteEventArgs { - - /** Instance of the series that completed has animation. - */ - series?: any; - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the chart model object - */ - model?: any; - - /** Name of the event - */ - type?: string; -} - -export interface AxesLabelRenderingEventArgs { - - /** Instance of the corresponding axis. - */ - Axis?: any; - - /** Formatted text of the respective label. You can also add custom text to the label. - */ - LabelText?: string; - - /** Actual value of the label. - */ - LabelValue?: string; - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Instance of the chart model object. - */ - model?: any; - - /** Name of the event - */ - type?: string; -} - -export interface AxesLabelsInitializeEventArgs { - - /** Collection of axes in Chart - */ - dataAxes?: any; - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Instance of the chart model object. - */ - model?: any; - - /** Name of the event - */ - type?: string; -} - -export interface AxesRangeCalculateEventArgs { - - /** Difference between minimum and maximum value of axis range. - */ - delta?: number; - - /** Interval value of axis range. Grid lines, tick lines and axis labels are drawn based on this interval value. - */ - interval?: number; - - /** Maximum value of axis range. - */ - max?: number; - - /** Minimum value of axis range. - */ - min?: number; - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Instance of the chart model object. - */ - model?: any; - - /** Name of the event - */ - type?: string; -} - -export interface AxesTitleRenderingEventArgs { - - /** Instance of the axis whose title is being rendered - */ - axes?: any; - - /** X-coordinate of title location - */ - locationX?: number; - - /** Y-coordinate of title location - */ - locationY?: number; - - /** Axis title text. You can add custom text to the title. - */ - title?: string; - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Instance of the chart model object. - */ - model?: any; - - /** Name of the event - */ - type?: string; -} - -export interface ChartAreaBoundsCalculateEventArgs { - - /** Height of the chart area. - */ - areaBoundsHeight?: number; - - /** Width of the chart area. - */ - areaBoundsWidth?: number; - - /** X-coordinate of the chart area. - */ - areaBoundsX?: number; - - /** Y-coordinate of the chart area. - */ - areaBoundsY?: number; - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Instance of the chart model object. - */ - model?: any; - - /** Name of the event - */ - type?: string; -} - -export interface CreateEventArgs { - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Instance of the chart model object. - */ - model?: any; - - /** Name of the event - */ - type?: string; -} - -export interface DestroyEventArgs { - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Instance of the chart model object. - */ - model?: any; - - /** Name of the event - */ - type?: string; -} - -export interface DisplayTextRenderingEventArgs { - - /** Text displayed in data label. You can add custom text to the data label - */ - text?: string; - - /** X-coordinate of data label location - */ - locationX?: number; - - /** Y-coordinate of data label location - */ - locationY?: number; - - /** Index of the series in series Collection whose data label is being rendered - */ - seriesIndex?: number; - - /** Index of the point in series whose data label is being rendered - */ - pointIndex?: number; - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Instance of the chart model object. - */ - model?: any; - - /** Name of the event - */ - type?: string; -} - -export interface LegendBoundsCalculateEventArgs { - - /** Height of the legend. - */ - legendBoundsHeight?: number; - - /** Width of the legend. - */ - legendBoundsWidth?: number; - - /** Number of rows to display the legend items - */ - legendBoundsRows?: number; - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Instance of the chart model object. - */ - model?: any; - - /** Name of the event - */ - type?: string; -} - -export interface LegendItemClickEventArgs { - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the chart model object - */ - model?: any; - - /** Name of the event - */ - type?: string; - - /** X-coordinate of legend item in pixel - */ - startX?: number; - - /** Y-coordinate of legend item in pixel - */ - startY?: number; - - /** Instance of the legend item object that is about to be rendered - */ - LegendItem?: any; - - /** Options to customize the legend item styles such as border, color, size, etc…, - */ - style?: any; - - /** Instance that holds information about legend bounds and legend item bounds. - */ - Bounds?: any; - - /** Name of the legend item shape. Use this option to customize legend item shape before rendering - */ - symbolShape?: string; - - /** Instance of the series object corresponding to the legend item - */ - series?: any; -} - -export interface LegendItemMouseMoveEventArgs { - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the chart model object - */ - model?: any; - - /** Name of the event - */ - type?: string; - - /** X-coordinate of legend item in pixel - */ - startX?: number; - - /** Y-coordinate of legend item in pixel - */ - startY?: number; - - /** Instance of the legend item object that is about to be rendered - */ - LegendItem?: any; - - /** Options to customize the legend item styles such as border, color, size, etc…, - */ - style?: any; - - /** Options to customize the legend item styles such as border, color, size, etc…, - */ - Bounds?: any; - - /** Name of the legend item shape. Use this option to customize legend item shape before rendering - */ - symbolShape?: string; - - /** Instance of the series object corresponding to the legend item - */ - series?: any; -} - -export interface LegendItemRenderingEventArgs { - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the chart model object - */ - model?: any; - - /** Name of the event - */ - type?: string; - - /** X-coordinate of legend item in pixel - */ - startX?: number; - - /** Y-coordinate of legend item in pixel - */ - startY?: number; - - /** Instance of the legend item object that is about to be rendered - */ - legendItem?: any; - - /** Options to customize the legend item styles such as border, color, size, etc. - */ - style?: any; - - /** Name of the legend item shape. Use this option to customize legend item shape before rendering - */ - symbolShape?: string; -} - -export interface LoadEventArgs { - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the chart model object - */ - model?: any; - - /** Name of the event - */ - type?: string; -} - -export interface RangeSelectedEventArgs { - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the chart model object - */ - model?: any; - - /** Name of the event - */ - type?: string; - - /** Selected data collection of object - */ - data?: any; -} - -export interface PointRegionClickEventArgs { - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the chart model object - */ - model?: any; - - /** Name of the event - */ - type?: string; - - /** X-coordinate of point in pixel - */ - locationX?: number; - - /** Y-coordinate of point in pixel - */ - locationY?: number; - - /** Index of the point in series - */ - pointIndex?: number; - - /** Index of the series in series collection to which the point belongs - */ - seriesIndex?: number; -} - -export interface PointRegionMouseMoveEventArgs { - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the chart model object - */ - model?: any; - - /** Name of the event - */ - type?: string; - - /** X-coordinate of point in pixel - */ - locationX?: number; - - /** Y-coordinate of point in pixel - */ - locationY?: number; - - /** Index of the point in series - */ - pointIndex?: number; - - /** Index of the series in series collection to which the point belongs - */ - seriesIndex?: number; -} - -export interface PreRenderEventArgs { - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the chart model object - */ - model?: any; - - /** Name of the event - */ - type?: string; -} - -export interface SeriesRegionClickEventArgs { - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the chart model object - */ - model?: any; - - /** Name of the event - */ - type?: string; - - /** Instance of the selected series - */ - series?: any; - - /** Index of the selected series - */ - seriesIndex?: number; -} - -export interface SeriesRenderingEventArgs { - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the chart model object - */ - model?: any; - - /** Name of the event - */ - type?: string; - - /** Instance of the series which is about to get rendered - */ - series?: any; -} - -export interface SymbolRenderingEventArgs { - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the chart model object - */ - model?: any; - - /** Name of the event - */ - type?: string; - - /** Instance that holds the location of marker symbol - */ - location?: any; - - /** Options to customize the marker style such as color, border and size - */ - style?: any; -} - -export interface TitleRenderingEventArgs { - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the chart model object - */ - model?: any; - - /** Name of the event - */ - type?: string; - - /** Option to customize the title location in pixels - */ - location?: any; - - /** Read-only option to find the size of the title - */ - size?: any; - - /** Use this option to add custom text in title - */ - title?: string; -} - -export interface ToolTipInitializeEventArgs { - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the chart model object - */ - model?: any; - - /** Name of the event - */ - type?: string; - - /** Text to be displayed in tooltip. Set this option to customize the text displayed in tooltip - */ - currentText?: string; - - /** Index of the point on which mouse is hovered - */ - pointIndex?: number; - - /** Index of the series in series collection whose point is hovered by mouse - */ - seriesIndex?: number; -} - -export interface TrackAxisToolTipEventArgs { - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the chart model object - */ - model?: any; - - /** Name of the event - */ - type?: string; - - /** Location of the crosshair label in pixels - */ - location?: any; - - /** Index of the axis for which crosshair label is displayed - */ - axisIndex?: number; - - /** Instance of the chart axis object for which cross hair label is displayed - */ - crossAxis?: number; - - /** Text to be displayed in crosshair label. Use this option to add custom text in crosshair label - */ - currentTrackText?: string; -} - -export interface TrackToolTipEventArgs { - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the chart model object - */ - model?: any; - - /** Name of the event - */ - type?: string; - - /** Location of the trackball tooltip in pixels - */ - location?: any; - - /** Index of the point for which trackball tooltip is displayed - */ - pointIndex?: number; - - /** Index of the series in series collection - */ - seriesIndex?: number; - - /** Text to be displayed in trackball tooltip. Use this option to add custom text in trackball tooltip - */ - currentText?: string; - - /** Instance of the series object for which trackball tooltip is displayed. - */ - series?: any; -} - -export interface AxisLabelClickEventArgs { - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the chart model object - */ - model?: any; - - /** Name of the event - */ - type?: string; - - /** X and Y co-ordinate of the labels in chart area. - */ - location?: any; - - /** Index of the label. - */ - index?: number; - - /** Instance of the corresponding axis. - */ - axis?: any; - - /** Label that is clicked. - */ - text?: string; -} - -export interface AxisLabelMouseMoveEventArgs { - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the chart model object - */ - model?: any; - - /** Name of the event - */ - type?: string; - - /** X and Y co-ordinate of the labels in chart area. - */ - location?: any; - - /** Index of the label. - */ - index?: number; - - /** Instance of the corresponding axis. - */ - axis?: any; - - /** Label that is hovered. - */ - text?: string; -} - -export interface ChartClickEventArgs { - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the chart model object - */ - model?: any; - - /** Name of the event - */ - type?: string; - - /** X and Y co-ordinate of the points with respect to chart area. - */ - location?: any; - - /** ID of the target element. - */ - id?: string; - - /** Width and height of the chart. - */ - size?: any; - - /** x-coordinate of the pointer, relative to the page - */ - pageX?: number; - - /** y-coordinate of the pointer, relative to the page - */ - pageY?: number; -} - -export interface ChartMouseMoveEventArgs { - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the chart model object - */ - model?: any; - - /** Name of the event - */ - type?: string; - - /** X and Y co-ordinate of the points with respect to chart area. - */ - location?: any; - - /** ID of the target element. - */ - id?: string; - - /** Width and height of the chart. - */ - size?: any; - - /** x-coordinate of the pointer, relative to the page - */ - pageX?: number; - - /** y-coordinate of the pointer, relative to the page - */ - pageY?: number; -} - -export interface ChartDoubleClickEventArgs { - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the chart model object - */ - model?: any; - - /** Name of the event - */ - type?: string; - - /** X and Y co-ordinate of the points with respect to chart area. - */ - location?: any; - - /** ID of the target element. - */ - id?: string; - - /** Width and height of the chart. - */ - size?: any; - - /** x-coordinate of the pointer, relative to the page - */ - pageX?: number; - - /** y-coordinate of the pointer, relative to the page - */ - pageY?: number; -} - -export interface AnnotationClickEventArgs { - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the chart model object - */ - model?: any; - - /** Name of the event - */ - type?: string; - - /** X and Y co-ordinate of the annotation in chart area. - */ - location?: any; - - /** Information about the annotation, like Coordinate unit, Region, content - */ - contentData?: any; - - /** x-coordinate of the pointer, relative to the page - */ - pageX?: number; - - /** y-coordinate of the pointer, relative to the page - */ - pageY?: number; -} - -export interface AfterResizeEventArgs { - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the chart model object - */ - model?: any; - - /** Name of the event - */ - type?: string; - - /** Chart width, after resize - */ - width?: number; - - /** Chart height, after resize - */ - height?: number; - - /** Chart width, before resize - */ - prevWidth?: number; - - /** Chart height, before resize - */ - prevHeight?: number; - - /** Chart width, when the chart was first rendered - */ - originalWidth?: number; - - /** Chart height, when the chart was first rendered - */ - originalHeight?: number; -} - -export interface BeforeResizeEventArgs { - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the chart model object - */ - model?: any; - - /** Name of the event - */ - type?: string; - - /** Chart width, before resize - */ - currentWidth?: number; - - /** Chart height, before resize - */ - currentHeight?: number; - - /** Chart width, after resize - */ - newWidth?: number; - - /** Chart height, after resize - */ - newHeight?: number; -} - -export interface ErrorBarRenderingEventArgs { - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the chart model object - */ - model?: any; - - /** Name of the event - */ - type?: string; - - /** Error bar Object - */ - errorbar?: any; -} - -export interface ScrollChangedEventArgs { - - /** parameters from RangeNavigator - */ - data?: any; - - /** returns the scrollbar position old start and end range value on changing scrollbar - */ - dataoldRange?: any; - - /** returns the scrollbar position new start and end range value on changing scrollbar - */ - datanewRange?: any; - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the RangeNavigator model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; -} - -export interface ScrollStartEventArgs { - - /** parameters from RangeNavigator - */ - data?: any; - - /** returns the scrollbar position starting range value on changing scrollbar - */ - datastartRange?: string; - - /** returns the scrollbar position end range value on changing scrollbar - */ - dataendRange?: string; - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the RangeNavigator model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; -} - -export interface ScrollEndEventArgs { - - /** parameters from RangeNavigator - */ - data?: any; - - /** returns the scrollbar position old start and end range value on change end of scrollbar - */ - dataoldRange?: any; - - /** returns the scrollbar position new start and end range value on change end of scrollbar - */ - datanewRange?: any; - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the RangeNavigator model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; -} - -export interface AnnotationsMargin { - - /** Annotation is placed at the specified value above its original position. - * @Default {0} - */ - bottom?: number; - - /** Annotation is placed at the specified value from left side of its original position. - * @Default {0} - */ - left?: number; - - /** Annotation is placed at the specified value from the right side of its original position. - * @Default {0} - */ - right?: number; - - /** Annotation is placed at the specified value under its original position. - * @Default {0} - */ - top?: number; -} - -export interface Annotation { - - /** Angle to rotate the annotation in degrees. - * @Default {'0'} - */ - angle?: number; - - /** Text content or id of a HTML element to be displayed as annotation. - */ - content?: string; - - /** Specifies how annotations have to be placed in Chart. - * @Default {none. See CoordinateUnit} - */ - coordinateUnit?: ej.datavisualization.Chart.CoordinateUnit|string; - - /** Specifies the horizontal alignment of the annotation. - * @Default {middle. See HorizontalAlignment} - */ - horizontalAlignment?: ej.datavisualization.Chart.HorizontalAlignment|string; - - /** Options to customize the margin of annotation. - */ - margin?: AnnotationsMargin; - - /** Controls the opacity of the annotation. - * @Default {1} - */ - opacity?: number; - - /** Specifies whether annotation has to be placed with respect to chart or series. - * @Default {chart. See Region} - */ - region?: ej.datavisualization.Chart.Region|string; - - /** Specifies the vertical alignment of the annotation. - * @Default {middle. See VerticalAlignment} - */ - verticalAlignment?: ej.datavisualization.Chart.VerticalAlignment|string; - - /** Controls the visibility of the annotation. - * @Default {false} - */ - visible?: boolean; - - /** Represents the horizontal offset when coordinateUnit is pixels.when coordinateUnit is points, it represents the x-coordinate of axis bounded with xAxisName property - * or primary X axis when xAxisName is not provided.This property is not applicable when coordinateUnit is none. - * @Default {0} - */ - x?: number; - - /** Name of the horizontal axis to be used for positioning the annotation. This property is applicable only when coordinateUnit is points. - */ - xAxisName?: string; - - /** Represents the vertical offset when coordinateUnit is pixels.When coordinateUnit is points, it represents the y-coordinate of axis bounded with - * yAxisName property or primary Y axis when yAxisName is not provided.This property is not applicable when coordinateUnit is none. - * @Default {0} - */ - y?: number; - - /** Name of the vertical axis to be used for positioning the annotation.This property is applicable only when coordinateUnit is points. - */ - yAxisName?: string; -} - -export interface Border { - - /** Border color of the chart. - * @Default {null} - */ - color?: string; - - /** Opacity of the chart border. - * @Default {0.3} - */ - opacity?: number; - - /** Width of the Chart border. - * @Default {0} - */ - width?: number; -} - -export interface ExportSettings { - - /** Specifies the downloading filename - * @Default {chart} - */ - filename?: string; - - /** Specifies the name of the action URL - */ - action?: string; - - /** Specifies the angle for rotation - * @Default {0} - */ - angle?: number; - - /** Specifies the format of the file to export - * @Default {png} - */ - type?: ej.datavisualization.Chart.ExportingType|string; - - /** Specifies the orientation of the document - * @Default {portrait} - */ - orientation?: ej.datavisualization.Chart.ExportingOrientation|string; - - /** Specifies the mode of exporting - * @Default {client} - */ - mode?: ej.datavisualization.Chart.ExportingMode|string; - - /** Enable/ disable the multiple excel exporting - * @Default {false} - */ - multipleExport?: boolean; -} - -export interface ChartAreaBorder { - - /** Border color of the plot area. - * @Default {Gray} - */ - color?: string; - - /** Opacity of the plot area border. - * @Default {0.3} - */ - opacity?: number; - - /** Border width of the plot area. - * @Default {0.5} - */ - width?: number; -} - -export interface ChartArea { - - /** Background color of the plot area. - * @Default {transparent} - */ - background?: string; - - /** Options for customizing the border of the plot area. - */ - border?: ChartAreaBorder; -} - -export interface ColumnDefinition { - - /** Specifies the unit to measure the width of the column in plotting area. - * @Default {'pixel'. See Unit} - */ - unit?: ej.datavisualization.Chart.Unit|string; - - /** Width of the column in plotting area. Width is measured in either pixel or percentage based on the value of unit property. - * @Default {50} - */ - columnWidth?: number; - - /** Color of the line that indicates the starting point of the column in plotting area. - * @Default {transparent} - */ - lineColor?: string; - - /** Width of the line that indicates the starting point of the column in plot area. - * @Default {1} - */ - lineWidth?: number; -} - -export interface CommonSeriesOptionsBorder { - - /** Border color of all series. - * @Default {transparent} - */ - color?: string; - - /** DashArray for border of the series. - * @Default {null} - */ - dashArray?: string; - - /** Border width of all series. - * @Default {1} - */ - width?: number; -} - -export interface CommonSeriesOptionsFont { - - /** Font color of the text in all series. - * @Default {#707070} - */ - color?: string; - - /** Font Family for all the series. - * @Default {Segoe UI} - */ - fontFamily?: string; - - /** Specifies the font Style for all the series. - * @Default {normal} - */ - fontStyle?: ej.datavisualization.Chart.FontStyle|string; - - /** Specifies the font weight for all the series. - * @Default {regular} - */ - fontWeight?: ej.datavisualization.Chart.FontWeight|string; - - /** Opacity for text in all the series. - * @Default {1} - */ - opacity?: number; - - /** Font size for text in all the series. - * @Default {12px} - */ - size?: string; -} - -export interface CommonSeriesOptionsMarkerBorder { - - /** Border color of the marker shape. - * @Default {white} - */ - color?: string; - - /** Border width of the marker shape. - * @Default {3} - */ - width?: number; -} - -export interface CommonSeriesOptionsMarkerDataLabelBorder { - - /** Border color of the data label. - * @Default {null} - */ - color?: string; - - /** Border width of the data label. - * @Default {0.1} - */ - width?: number; -} - -export interface CommonSeriesOptionsMarkerDataLabelConnectorLine { - - /** Specifies when the connector has to be drawn as Bezier curve or straight line. This is applicable only for Pie and Doughnut chart types. - * @Default {line. See ConnectorLineType} - */ - type?: ej.datavisualization.Chart.ConnectorLineType|string; - - /** Width of the connector. - * @Default {0.5} - */ - width?: number; - - /** Color of the connector line. - * @Default {#565656} - */ - color?: string; - - /** Height of the connector line. - * @Default {null} - */ - height?: string; -} - -export interface CommonSeriesOptionsMarkerDataLabelFont { - - /** Font family of the data label. - * @Default {Segoe UI} - */ - fontFamily?: string; - - /** Font style of the data label. - * @Default {normal. See FontStyle} - */ - fontStyle?: ej.datavisualization.Chart.FontStyle|string; - - /** Font weight of the data label. - * @Default {regular. See FontWeight} - */ - fontWeight?: ej.datavisualization.Chart.FontWeight|string; - - /** Opacity of the text. - * @Default {1} - */ - opacity?: number; - - /** Font color of the data label text. - * @Default {null} - */ - color?: string; - - /** Font size of the data label. - * @Default {12px} - */ - size?: string; -} - -export interface CommonSeriesOptionsMarkerDataLabelMargin { - - /** Bottom margin of the text. - * @Default {5} - */ - bottom?: number; - - /** Left margin of the text. - * @Default {5} - */ - left?: number; - - /** Right margin of the text. - * @Default {5} - */ - right?: number; - - /** Top margin of the text. - * @Default {5} - */ - top?: number; -} - -export interface CommonSeriesOptionsMarkerDataLabel { - - /** Angle of the data label in degrees. Only the text gets rotated, whereas the background and border does not rotate. - * @Default {null} - */ - angle?: number; - - /** Maximum label width of the data label. - * @Default {null} - */ - maximumLabelWidth?: number; - - /** Enable the wrap option to the data label. - * @Default {false} - */ - enableWrap?: boolean; - - /** Options for customizing the border of the data label. - */ - border?: CommonSeriesOptionsMarkerDataLabelBorder; - - /** Options for displaying and customizing the line that connects point and data label. - */ - connectorLine?: CommonSeriesOptionsMarkerDataLabelConnectorLine; - - /** Background color of the data label. - * @Default {null} - */ - fill?: string; - - /** Options for customizing the data label font. - */ - font?: CommonSeriesOptionsMarkerDataLabelFont; - - /** Horizontal alignment of the data label. - * @Default {center} - */ - horizontalTextAlignment?: ej.datavisualization.Chart.HorizontalTextAlignment|string; - - /** Margin of the text to its background shape. The size of the background shape increases based on the margin applied to its text. - */ - margin?: CommonSeriesOptionsMarkerDataLabelMargin; - - /** Opacity of the data label. - * @Default {1} - */ - opacity?: number; - - /** Background shape of the data label. - * @Default {none. See Shape} - */ - shape?: ej.datavisualization.Chart.Shape|string; - - /** Custom template to format the data label content. Use “point.x” and “point.y” as a placeholder text to display the corresponding data point’s x and y value. - */ - template?: string; - - /** Name of a field in data source, where datalabel text is displayed. - */ - textMappingName?: string; - - /** Specifies the position of the data label. This property can be used only for the series such as column, bar, stacked column, stacked bar, 100% stacked column, 100% stacked bar, candle and OHLC. - * @Default {top. See TextPosition} - */ - textPosition?: ej.datavisualization.Chart.TextPosition|string; - - /** Vertical alignment of the data label. - * @Default {center} - */ - verticalTextAlignment?: ej.datavisualization.Chart.VerticalTextAlignment|string; - - /** Controls the visibility of the data labels. - * @Default {false} - */ - visible?: boolean; -} - -export interface CommonSeriesOptionsMarkerSize { - - /** Height of the marker. - * @Default {6} - */ - height?: number; - - /** Width of the marker. - * @Default {6} - */ - width?: number; -} - -export interface CommonSeriesOptionsMarker { - - /** Options for customizing the border of the marker shape. - */ - border?: CommonSeriesOptionsMarkerBorder; - - /** Options for displaying and customizing data labels. - */ - dataLabel?: CommonSeriesOptionsMarkerDataLabel; - - /** Color of the marker shape. - * @Default {null} - */ - fill?: string; - - /** The URL for the Image to be displayed as marker. In order to display image as marker, set series.marker.shape as ‘image’. - */ - imageUrl?: string; - - /** Opacity of the marker. - * @Default {1} - */ - opacity?: number; - - /** Specifies the shape of the marker. - * @Default {circle. See Shape} - */ - shape?: ej.datavisualization.Chart.Shape|string; - - /** Options for customizing the size of the marker shape. - */ - size?: CommonSeriesOptionsMarkerSize; - - /** Controls the visibility of the marker shape. - * @Default {false} - */ - visible?: boolean; -} - -export interface CommonSeriesOptionsOutlierSettingsSize { - - /** Height of the outlier shape. - * @Default {6} - */ - height?: number; - - /** Width of the outlier shape. - * @Default {6} - */ - width?: number; -} - -export interface CommonSeriesOptionsOutlierSettings { - - /** Specifies the shape of the outlier. - * @Default {circle. See Shape} - */ - shape?: ej.datavisualization.Chart.Shape|string; - - /** Options for customizing the size of the outlier shape. - */ - size?: CommonSeriesOptionsOutlierSettingsSize; -} - -export interface CommonSeriesOptionsCornerRadius { - - /** Specifies the radius for the top left corner. - * @Default {0} - */ - topLeft?: number; - - /** Specifies the radius for the top right corner. - * @Default {0} - */ - topRight?: number; - - /** Specifies the radius for the bottom left corner. - * @Default {0} - */ - bottomLeft?: number; - - /** Specifies the radius for the bottom right corner. - * @Default {0} - */ - bottomRight?: number; -} - -export interface CommonSeriesOptionsTooltipBorder { - - /** Border color of the tooltip. - * @Default {null} - */ - color?: string; - - /** Border width of the tooltip. - * @Default {1} - */ - width?: number; -} - -export interface CommonSeriesOptionsTooltip { - - /** Options for customizing the border of the tooltip. - */ - border?: CommonSeriesOptionsTooltipBorder; - - /** Customize the corner radius of the tooltip rectangle. - * @Default {0} - */ - rx?: number; - - /** Customize the corner radius of the tooltip rectangle. - * @Default {0} - */ - ry?: number; - - /** Specifies the duration, the tooltip has to be displayed. - * @Default {500ms} - */ - duration?: string; - - /** Enables/disables the animation of the tooltip when moving from one point to other. - * @Default {true} - */ - enableAnimation?: boolean; - - /** Background color of the tooltip. - * @Default {null} - */ - fill?: string; - - /** Format of the tooltip content. - * @Default {#point.x# : #point.y#} - */ - format?: string; - - /** Opacity of the tooltip. - * @Default {0.5} - */ - opacity?: number; - - /** Custom template to format the tooltip content. Use “point.x” and “point.y” as a placeholder text to display the corresponding data point’s x and y value. - * @Default {null} - */ - template?: string; - - /** Controls the visibility of the tooltip. - * @Default {false} - */ - visible?: boolean; -} - -export interface CommonSeriesOptionsEmptyPointSettingsStyleBorder { - - /** Border color of the empty point. - */ - color?: string; - - /** Border width of the empty point. - * @Default {1} - */ - width?: number; -} - -export interface CommonSeriesOptionsEmptyPointSettingsStyle { - - /** Color of the empty point. - */ - color?: string; - - /** Options for customizing border of the empty point in the series. - */ - border?: CommonSeriesOptionsEmptyPointSettingsStyleBorder; -} - -export interface CommonSeriesOptionsEmptyPointSettings { - - /** Controls the visibility of the empty point. - * @Default {true} - */ - visible?: boolean; - - /** Specifies the mode of empty point. - * @Default {gap} - */ - displayMode?: ej.datavisualization.Chart.EmptyPointMode|string; - - /** Options for customizing the color and border of the empty point in the series. - */ - style?: CommonSeriesOptionsEmptyPointSettingsStyle; -} - -export interface CommonSeriesOptionsConnectorLine { - - /** Width of the connector line. - * @Default {1} - */ - width?: number; - - /** Color of the connector line. - * @Default {#565656} - */ - color?: string; - - /** DashArray of the connector line. - * @Default {null} - */ - dashArray?: string; - - /** DashArray of the connector line. - * @Default {1} - */ - opacity?: number; -} - -export interface CommonSeriesOptionsDragSettings { - - /** drag/drop the series - * @Default {false} - */ - enable?: boolean; - - /** Specifies the type of drag settings. - * @Default {xy} - */ - type?: string; -} - -export interface CommonSeriesOptionsErrorBarCap { - - /** Show/Hides the error bar cap. - * @Default {true} - */ - visible?: boolean; - - /** Width of the error bar cap. - * @Default {1} - */ - width?: number; - - /** Length of the error bar cap. - * @Default {1} - */ - length?: number; - - /** Color of the error bar cap. - * @Default {“#000000”} - */ - fill?: string; -} - -export interface CommonSeriesOptionsErrorBar { - - /** Show/hides the error bar - * @Default {visible} - */ - visibility?: boolean; - - /** Specifies the type of error bar. - * @Default {FixedValue} - */ - type?: ej.datavisualization.Chart.ErrorBarType|string; - - /** Specifies the mode of error bar. - * @Default {vertical} - */ - mode?: ej.datavisualization.Chart.ErrorBarMode|string; - - /** Specifies the direction of error bar. - * @Default {both} - */ - direction?: ej.datavisualization.Chart.ErrorBarDirection|string; - - /** Value of vertical error bar. - * @Default {3} - */ - verticalErrorValue?: number; - - /** Value of horizontal error bar. - * @Default {1} - */ - horizontalErrorValue?: number; - - /** Value of positive horizontal error bar. - * @Default {1} - */ - horizontalPositiveErrorValue?: number; - - /** Value of negative horizontal error bar. - * @Default {1} - */ - horizontalNegativeErrorValue?: number; - - /** Value of positive vertical error bar. - * @Default {5} - */ - verticalPositiveErrorValue?: number; - - /** Value of negative vertical error bar. - * @Default {5} - */ - verticalNegativeErrorValue?: number; - - /** Fill color of the error bar. - * @Default {#000000} - */ - fill?: string; - - /** Width of the error bar. - * @Default {1} - */ - width?: number; - - /** Options for customizing the error bar cap. - */ - cap?: CommonSeriesOptionsErrorBarCap; -} - -export interface CommonSeriesOptionsTrendline { - - /** Show/hides the trendline. - */ - visibility?: boolean; - - /** Specifies the type of the trendline for the series. - * @Default {linear. See TrendlinesType} - */ - type?: string; - - /** Name for the trendlines that is to be displayed in the legend text. - * @Default {trendline} - */ - name?: string; - - /** Fill color of the trendlines. - * @Default {#0000FF} - */ - fill?: string; - - /** Width of the trendlines. - * @Default {1} - */ - width?: number; - - /** Opacity of the trendline. - * @Default {1} - */ - opacity?: number; - - /** Pattern of dashes and gaps used to stroke the trendline. - */ - dashArray?: string; - - /** Future trends of the current series. - * @Default {0} - */ - forwardForecast?: number; - - /** Past trends of the current series. - * @Default {0} - */ - backwardForecast?: number; - - /** Specifies the order of the polynomial trendlines. - * @Default {0} - */ - polynomialOrder?: number; - - /** Specifies the moving average starting period value. - * @Default {2} - */ - period?: number; -} - -export interface CommonSeriesOptionsHighlightSettingsBorder { - - /** Border color of the series/point on highlight. - */ - color?: string; - - /** Border width of the series/point on highlight. - * @Default {2} - */ - width?: string; -} - -export interface CommonSeriesOptionsHighlightSettings { - - /** Enables/disables the ability to highlight the series or data point interactively. - * @Default {false} - */ - enable?: boolean; - - /** Specifies whether the series or data point has to be highlighted. - * @Default {series. See Mode} - */ - mode?: ej.datavisualization.Chart.Mode|string; - - /** Color of the series/point on highlight. - */ - color?: string; - - /** Opacity of the series/point on highlight. - * @Default {0.6} - */ - opacity?: number; - - /** Options for customizing the border of series on highlight. - */ - border?: CommonSeriesOptionsHighlightSettingsBorder; - - /** Specifies the pattern for the series/point on highlight. - * @Default {none. See Pattern} - */ - pattern?: string; - - /** Custom pattern for the series on highlight. - */ - customPattern?: string; -} - -export interface CommonSeriesOptionsSelectionSettingsBorder { - - /** Border color of the series/point on selection. - */ - color?: string; - - /** Border width of the series/point on selection. - * @Default {2} - */ - width?: string; -} - -export interface CommonSeriesOptionsSelectionSettings { - - /** Enables/disables the ability to select a series/data point interactively. - * @Default {false} - */ - enable?: boolean; - - /** Specifies the type of selection. - * @Default {single} - */ - type?: ej.datavisualization.Chart.SelectionType|string; - - /** Specifies whether the series or data point has to be selected. - * @Default {series. See Mode} - */ - mode?: ej.datavisualization.Chart.Mode|string; - - /** Specifies the drawn rectangle type. - * @Default {xy} - */ - rangeType?: ej.datavisualization.Chart.RangeType|string; - - /** Color of the series/point on selection. - */ - color?: string; - - /** Opacity of the series/point on selection. - * @Default {0.6} - */ - opacity?: number; - - /** Options for customizing the border of the series on selection. - */ - border?: CommonSeriesOptionsSelectionSettingsBorder; - - /** Specifies the pattern for the series/point on selection. - * @Default {none. See Pattern} - */ - pattern?: string; - - /** Custom pattern for the series on selection. - */ - customPattern?: string; -} - -export interface CommonSeriesOptions { - - /** Options to customize the border of all the series. - */ - border?: CommonSeriesOptionsBorder; - - /** To render the column and bar type series in rectangle/cylinder shape. See ColumnFacet - * @Default {rectangle} - */ - columnFacet?: ej.datavisualization.Chart.ColumnFacet|string; - - /** Relative width of the columns in column type series. Value ranges from 0 to 1. Width also depends upon columnSpacing property. - * @Default {0.7} - */ - columnWidth?: number; - - /** Spacing between columns of different series. Value ranges from 0 to 1 - * @Default {0} - */ - columnSpacing?: number; - - /** Enables or disables the visibility of legend item. - * @Default {visible} - */ - visibleOnLegend?: string; - - /** Group of the stacking collection series. - */ - stackingGroup?: string; - - /** Pattern of dashes and gaps used to stroke all the line type series. - */ - dashArray?: string; - - /** Set the dataSource for all series. It can be an array of JSON objects or an instance of ej.DataManager. - * @Default {null} - */ - dataSource?: any; - - /** Controls the size of the hole in doughnut series. Value ranges from 0 to 1 - * @Default {0.4} - */ - doughnutCoefficient?: number; - - /** Controls the size of the doughnut series. Value ranges from 0 to 1. - * @Default {0.8} - */ - doughnutSize?: number; - - /** Specifies the type of series to be drawn in radar or polar series. - * @Default {line. See DrawType} - */ - drawType?: ej.datavisualization.Chart.DrawType|string; - - /** Enable/disable the animation for all the series. - * @Default {true} - */ - enableAnimation?: boolean; - - /** To avoid overlapping of data labels smartly. - * @Default {true} - */ - enableSmartLabels?: boolean; - - /** Start angle of pie/doughnut series. - * @Default {null} - */ - endAngle?: number; - - /** Explodes the pie/doughnut slices on mouse move. - * @Default {false} - */ - explode?: boolean; - - /** Explodes all the slice of pie/doughnut on render. - * @Default {false} - */ - explodeAll?: boolean; - - /** Index of the point to be exploded from pie/doughnut/pyramid/funnel. - * @Default {null} - */ - explodeIndex?: number; - - /** Specifies the distance of the slice from the center, when it is exploded. - * @Default {0.4} - */ - explodeOffset?: number; - - /** Fill color for all the series. - * @Default {null} - */ - fill?: string; - - /** Options for customizing the font of all the series. - */ - font?: CommonSeriesOptionsFont; - - /** Sets the height of the funnel in funnel series. Values can be either pixel or percentage. - * @Default {32.7%} - */ - funnelHeight?: string; - - /** Sets the width of the funnel in funnel series. Values can be either pixel or percentage. - * @Default {11.6%} - */ - funnelWidth?: string; - - /** Gap between the slices in pyramid and funnel series. - * @Default {0} - */ - gapRatio?: number; - - /** Specifies whether to join start and end point of a line/area series used in polar/radar chart to form a closed path. - * @Default {true} - */ - isClosed?: boolean; - - /** Specifies whether to stack the column series in polar/radar charts. - * @Default {false} - */ - isStacking?: boolean; - - /** Renders the chart vertically. This is applicable only for Cartesian type series. - * @Default {false} - */ - isTransposed?: boolean; - - /** Render the x mark in the center of the boxplot series type.x represents the average value of the boxplot series. - * @Default {true} - */ - showMedian?: boolean; - - /** Position of the data label in pie/doughnut/pyramid/funnel series. OutsideExtended position is not applicable for pyramid/funnel. - * @Default {inside. See LabelPosition} - */ - labelPosition?: ej.datavisualization.Chart.LabelPosition|string; - - /** Quartile calculation has been performed in three different formulas to render the boxplot series. - * @Default {exclusive} - */ - boxPlotMode?: ej.datavisualization.Chart.boxPlotMode|string; - - /** Specifies the line cap of the series. - * @Default {butt. See LineCap} - */ - lineCap?: ej.datavisualization.Chart.LineCap|string; - - /** Specifies the type of shape to be used where two lines meet. - * @Default {round. See LineJoin} - */ - lineJoin?: ej.datavisualization.Chart.LineJoin|string; - - /** Options for displaying and customizing marker for individual point in a series. Marker contains shapes and/or data labels. - */ - marker?: CommonSeriesOptionsMarker; - - /** Opacity of the series. - * @Default {1} - */ - opacity?: number; - - /** Options for customizing the outlier of the series. - */ - outlierSettings?: CommonSeriesOptionsOutlierSettings; - - /** Name of a field in data source, where the fill color for all the data points is generated. - */ - palette?: string; - - /** Controls the size of pie series. Value ranges from 0 to 1. - * @Default {0.8} - */ - pieCoefficient?: number; - - /** Name of the property in the datasource that contains fill color for the series. - * @Default {null} - */ - pointColorMappingName?: string; - - /** Specifies the mode of the pyramid series. - * @Default {linear. See PyramidMode} - */ - pyramidMode?: ej.datavisualization.Chart.PyramidMode|string; - - /** Start angle from where the pie/doughnut series renders. By default it starts from 0. - * @Default {null} - */ - startAngle?: number; - - /** Options for customizing the corner radius. cornerRadius property also takes the numeric input and applies it for all the four corners of the column. - */ - cornerRadius?: CommonSeriesOptionsCornerRadius; - - /** Options for customizing the tooltip of chart. - */ - tooltip?: CommonSeriesOptionsTooltip; - - /** Specifies the type of the series to render in chart. - * @Default {column. See Type} - */ - type?: ej.datavisualization.Chart.Type|string; - - /** Specifies the name of the x-axis that has to be associated with this series. Add an axis instance with this name to axes collection. - * @Default {null} - */ - xAxisName?: string; - - /** Name of the property in the datasource that contains x value for the series. - * @Default {null} - */ - xName?: string; - - /** Specifies the name of the y-axis that has to be associated with this series. Add an axis instance with this name to axes collection. - * @Default {null} - */ - yAxisName?: string; - - /** Name of the property in the datasource that contains y value for the series. - * @Default {null} - */ - yName?: string; - - /** Name of the property in the datasource that contains high value for the series. - * @Default {null} - */ - high?: string; - - /** Name of the property in the datasource that contains low value for the series. - * @Default {null} - */ - low?: string; - - /** Name of the property in the datasource that contains open value for the series. - * @Default {null} - */ - open?: string; - - /** Name of the property in the datasource that contains close value for the series. - * @Default {null} - */ - close?: string; - - /** Z-order of the series. - * @Default {0} - */ - zOrder?: number; - - /** Name of the property in the datasource that contains the size value for the bubble series. - * @Default {null} - */ - size?: string; - - /** Options for customizing the empty point in the series. - */ - emptyPointSettings?: CommonSeriesOptionsEmptyPointSettings; - - /** Fill color for the positive column of the waterfall. - * @Default {null} - */ - positiveFill?: string; - - /** Options for customizing the waterfall connector line. - */ - connectorLine?: CommonSeriesOptionsConnectorLine; - - /** Options to customize the drag and drop in series. - */ - dragSettings?: CommonSeriesOptionsDragSettings; - - /** Options to customize the error bar in series. - */ - errorBar?: CommonSeriesOptionsErrorBar; - - /** Option to add the trendlines to chart. - */ - trendlines?: CommonSeriesOptionsTrendline[]; - - /** Options for customizing the appearance of the series or data point while highlighting. - */ - highlightSettings?: CommonSeriesOptionsHighlightSettings; - - /** Options for customizing the appearance of the series/data point on selection. - */ - selectionSettings?: CommonSeriesOptionsSelectionSettings; -} - -export interface CrosshairTrackballTooltipSettingsBorder { - - /** Border width of the trackball tooltip. - * @Default {null} - */ - width?: number; - - /** Border color of the trackball tooltip. - * @Default {null} - */ - color?: string; -} - -export interface CrosshairTrackballTooltipSettings { - - /** Options for customizing the trackball tooltip border. - */ - border?: CrosshairTrackballTooltipSettingsBorder; - - /** Background color of the trackball tooltip. - * @Default {null} - */ - fill?: string; - - /** Rounded corner x value of the trackball tooltip. - * @Default {3} - */ - rx?: number; - - /** Rounded corner y value of the trackball tooltip. - * @Default {3} - */ - ry?: number; - - /** Opacity value of the trackball tooltip. - * @Default {1} - */ - opacity?: number; - - /** Specifies the mode of the trackball tooltip. - * @Default {float. See CrosshairMode} - */ - mode?: ej.datavisualization.Chart.CrosshairMode|string; -} - -export interface CrosshairMarkerBorder { - - /** Border width of the marker. - * @Default {3} - */ - width?: number; -} - -export interface CrosshairMarkerSize { - - /** Height of the marker. - * @Default {10} - */ - height?: number; - - /** Width of the marker. - * @Default {10} - */ - width?: number; -} - -export interface CrosshairMarker { - - /** Options for customizing the border. - */ - border?: CrosshairMarkerBorder; - - /** Opacity of the marker. - * @Default {true} - */ - opacity?: boolean; - - /** Options for customizing the size of the marker. - */ - size?: CrosshairMarkerSize; - - /** Show/hides the marker. - * @Default {true} - */ - visible?: boolean; -} - -export interface CrosshairLine { - - /** Color of the crosshair line. - * @Default {transparent} - */ - color?: string; - - /** Width of the crosshair line. - * @Default {1} - */ - width?: number; -} - -export interface Crosshair { - - /** Options for customizing the trackball tooltip. - */ - trackballTooltipSettings?: CrosshairTrackballTooltipSettings; - - /** Options for customizing the marker in crosshair. - */ - marker?: CrosshairMarker; - - /** Options for customizing the crosshair line. - */ - line?: CrosshairLine; - - /** Specifies the type of the crosshair. It can be trackball or crosshair - * @Default {crosshair. See CrosshairType} - */ - type?: ej.datavisualization.Chart.CrosshairType|string; - - /** Show/hides the crosshair/trackball visibility. - * @Default {false} - */ - visible?: boolean; -} - -export interface IndicatorsHistogramBorder { - - /** Color of the histogram border in MACD indicator. - * @Default {#9999ff} - */ - color?: string; - - /** Controls the width of histogram border line in MACD indicator. - * @Default {1} - */ - width?: number; -} - -export interface IndicatorsHistogram { - - /** Options to customize the histogram border in MACD indicator. - */ - border?: IndicatorsHistogramBorder; - - /** Color of histogram columns in MACD indicator. - * @Default {#ccccff} - */ - fill?: string; - - /** Opacity of histogram columns in MACD indicator. - * @Default {1} - */ - opacity?: number; -} - -export interface IndicatorsLowerLine { - - /** Color of lower line. - * @Default {#008000} - */ - fill?: string; - - /** Width of the lower line. - * @Default {2} - */ - width?: number; -} - -export interface IndicatorsMacdLine { - - /** Color of MACD line. - * @Default {#ff9933} - */ - fill?: string; - - /** Width of the MACD line. - * @Default {2} - */ - width?: number; -} - -export interface IndicatorsPeriodLine { - - /** Color of period line in indicator. - * @Default {blue} - */ - fill?: string; - - /** Width of the period line in indicators. - * @Default {2} - */ - width?: number; -} - -export interface IndicatorsTooltipBorder { - - /** Border color of indicator tooltip. - * @Default {null} - */ - color?: string; - - /** Border width of indicator tooltip. - * @Default {1} - */ - width?: number; -} - -export interface IndicatorsTooltip { - - /** Option to customize the border of indicator tooltip. - */ - border?: IndicatorsTooltipBorder; - - /** Specifies the animation duration of indicator tooltip. - * @Default {500ms} - */ - duration?: string; - - /** Enables/disables the tooltip animation. - * @Default {true} - */ - enableAnimation?: boolean; - - /** Format of indicator tooltip. Use “point.x” and “point.y” as a placeholder text to display the corresponding data point’s x and y value. - * @Default {#point.x# : #point.y#} - */ - format?: string; - - /** Background color of indicator tooltip. - * @Default {null} - */ - fill?: string; - - /** Opacity of indicator tooltip. - * @Default {0.95} - */ - opacity?: number; - - /** Controls the visibility of indicator tooltip. - * @Default {false} - */ - visible?: boolean; -} - -export interface IndicatorsUpperLine { - - /** Fill color of the upper line in indicators - * @Default {#ff9933} - */ - fill?: string; - - /** Width of the upper line in indicators. - * @Default {2} - */ - width?: number; -} - -export interface Indicator { - - /** The dPeriod value for stochastic indicator. - * @Default {3} - */ - dPeriod?: number; - - /** Enables/disables the animation. - * @Default {false} - */ - enableAnimation?: boolean; - - /** Color of the technical indicator. - * @Default {#00008B} - */ - fill?: string; - - /** Options to customize the histogram in MACD indicator. - */ - histogram?: IndicatorsHistogram; - - /** Specifies the k period in stochastic indicator. - * @Default {3} - */ - kPeriod?: number; - - /** Specifies the long period in MACD indicator. - * @Default {26} - */ - longPeriod?: number; - - /** Options to customize the lower line in indicators. - */ - lowerLine?: IndicatorsLowerLine; - - /** Options to customize the MACD line. - */ - macdLine?: IndicatorsMacdLine; - - /** Specifies the type of the MACD indicator. - * @Default {line. See MACDType} - */ - macdType?: string; - - /** Specifies period value in indicator. - * @Default {14} - */ - period?: number; - - /** Options to customize the period line in indicators. - */ - periodLine?: IndicatorsPeriodLine; - - /** Name of the series for which indicator has to be drawn. - */ - seriesName?: string; - - /** Specifies the short period in MACD indicator. - * @Default {13} - */ - shortPeriod?: number; - - /** Specifies the standard deviation value for Bollinger band indicator. - * @Default {2} - */ - standardDeviations?: number; - - /** Options to customize the tooltip. - */ - tooltip?: IndicatorsTooltip; - - /** Trigger value of MACD indicator. - * @Default {9} - */ - trigger?: number; - - /** Specifies the visibility of indicator. - * @Default {visible} - */ - visibility?: string; - - /** Specifies the type of indicator that has to be rendered. - * @Default {sma. See IndicatorsType} - */ - type?: string; - - /** Options to customize the upper line in indicators - */ - upperLine?: IndicatorsUpperLine; - - /** Width of the indicator line. - * @Default {2} - */ - width?: number; - - /** Name of the horizontal axis used for indicator. Primary X axis is used when x axis name is not specified. - */ - xAxisName?: string; - - /** Name of the vertical axis used for indicator. Primary Y axis is used when y axis name is not specified - */ - yAxisName?: string; -} - -export interface LegendBorder { - - /** Border color of the legend. - * @Default {transparent} - */ - color?: string; - - /** Border width of the legend. - * @Default {1} - */ - width?: number; -} - -export interface LegendFont { - - /** Font family for legend item text. - * @Default {Segoe UI} - */ - fontFamily?: string; - - /** Font style for legend item text. - * @Default {Normal. See FontStyle} - */ - fontStyle?: ej.datavisualization.Chart.FontStyle|string; - - /** Font weight for legend item text. - * @Default {Regular. See FontWeight} - */ - fontWeight?: ej.datavisualization.Chart.FontWeight|string; - - /** Font size for legend item text. - * @Default {12px} - */ - size?: string; -} - -export interface LegendItemStyleBorder { - - /** Border color of the legend items. - * @Default {transparent} - */ - color?: string; - - /** Border width of the legend items. - * @Default {1} - */ - width?: number; -} - -export interface LegendItemStyle { - - /** Options for customizing the border of legend items. - */ - border?: LegendItemStyleBorder; - - /** Height of the shape in legend items. - * @Default {10} - */ - height?: number; - - /** Width of the shape in legend items. - * @Default {10} - */ - width?: number; -} - -export interface LegendLocation { - - /** X value or horizontal offset to position the legend in chart. - * @Default {0} - */ - x?: number; - - /** Y value or vertical offset to position the legend. - * @Default {0} - */ - y?: number; -} - -export interface LegendSize { - - /** Height of the legend. Height can be specified in either pixel or percentage. - * @Default {null} - */ - height?: string; - - /** Width of the legend. Width can be specified in either pixel or percentage. - * @Default {null} - */ - width?: string; -} - -export interface LegendTitleFont { - - /** Font family for the text in legend title. - * @Default {Segoe UI} - */ - fontFamily?: string; - - /** Font style for legend title. - * @Default {normal. See FontStyle} - */ - fontStyle?: ej.datavisualization.Chart.FontStyle|string; - - /** Font weight for legend title. - * @Default {normal. See FontWeight} - */ - fontWeight?: ej.datavisualization.Chart.FontWeight|string; - - /** Font size for legend title. - * @Default {12px} - */ - size?: string; -} - -export interface LegendTitle { - - /** Options to customize the font used for legend title - */ - font?: LegendTitleFont; - - /** Text to be displayed in legend title. - */ - text?: string; - - /** Alignment of the legend title. - * @Default {center. See Alignment} - */ - textAlignment?: ej.datavisualization.Chart.Alignment|string; -} - -export interface Legend { - - /** Horizontal alignment of the legend. - * @Default {Center. See Alignment} - */ - alignment?: ej.datavisualization.Chart.Alignment|string; - - /** Background for the legend. Use this property to add a background image or background color for the legend. - */ - background?: string; - - /** Options for customizing the legend border. - */ - border?: LegendBorder; - - /** Number of columns to arrange the legend items. - * @Default {null} - */ - columnCount?: number; - - /** Controls whether legend has to use scrollbar or not. When enabled, scroll bar appears depending upon size and position properties of legend. - * @Default {true} - */ - enableScrollbar?: boolean; - - /** Fill color for the legend items. By using this property, it displays all legend item shapes in same color.Legend items representing invisible series is displayed in gray color. - * @Default {null} - */ - fill?: string; - - /** Options to customize the font used for legend item text. - */ - font?: LegendFont; - - /** Gap or padding between the legend items. - * @Default {10} - */ - itemPadding?: number; - - /** Options to customize the style of legend items. - */ - itemStyle?: LegendItemStyle; - - /** Options to customize the location of chart legend. Legend is placed in provided location only when value of position property is custom - */ - location?: LegendLocation; - - /** Opacity of the legend. - * @Default {1} - */ - opacity?: number; - - /** Places the legend at specified position. Legend can be placed at left, right, top or bottom of the chart area.To manually specify the location of legend, set custom as value to this property. - * @Default {Bottom. See Position} - */ - position?: ej.datavisualization.Chart.Position|string; - - /** Number of rows to arrange the legend items. - * @Default {null} - */ - rowCount?: number; - - /** Shape of the legend items. Default shape for pie and doughnut series is circle and all other series uses rectangle. - * @Default {None. See Shape} - */ - shape?: ej.datavisualization.Chart.Shape|string; - - /** Options to customize the size of the legend. - */ - size?: LegendSize; - - /** Options to customize the legend title. - */ - title?: LegendTitle; - - /** Specifies the action taken when the legend width is more than the textWidth. - * @Default {none. See textOverflow} - */ - textOverflow?: ej.datavisualization.Chart.TextOverflow|string; - - /** Text width for legend item. - * @Default {34} - */ - textWidth?: number; - - /** Controls the visibility of the legend. - * @Default {true} - */ - visible?: boolean; -} - -export interface PrimaryXAxisAlternateGridBandEven { - - /** Fill color for the even grid bands. - * @Default {transparent} - */ - fill?: string; - - /** Opacity of the even grid band. - * @Default {1} - */ - opacity?: number; -} - -export interface PrimaryXAxisAlternateGridBandOdd { - - /** Fill color of the odd grid bands - * @Default {transparent} - */ - fill?: string; - - /** Opacity of odd grid band - * @Default {1} - */ - opacity?: number; -} - -export interface PrimaryXAxisAlternateGridBand { - - /** Options for customizing even grid band. - */ - even?: PrimaryXAxisAlternateGridBandEven; - - /** Options for customizing odd grid band. - */ - odd?: PrimaryXAxisAlternateGridBandOdd; -} - -export interface PrimaryXAxisAxisLine { - - /** Pattern of dashes and gaps to be applied to the axis line. - * @Default {null} - */ - dashArray?: string; - - /** Padding for axis line. Normally, it is used along with plotOffset to pad the plot area. - * @Default {null} - */ - offset?: number; - - /** Show/hides the axis line. - * @Default {true} - */ - visible?: boolean; - - /** Default Value - */ - color?: string; - - /** Width of axis line. - * @Default {1} - */ - width?: number; -} - -export interface PrimaryXAxisCrosshairLabel { - - /** Show/hides the crosshair label associated with this axis. - * @Default {false} - */ - visible?: boolean; -} - -export interface PrimaryXAxisFont { - - /** Font family of labels. - * @Default {Segoe UI} - */ - fontFamily?: string; - - /** Font style of labels. - * @Default {ej.datavisualization.Chart.FontStyle.Normal. See FontStyle} - */ - fontStyle?: ej.datavisualization.Chart.FontStyle|string; - - /** Font weight of the label. - * @Default {ej.datavisualization.Chart.FontWeight.Regular. See FontWeight} - */ - fontWeight?: ej.datavisualization.Chart.FontWeight|string; - - /** Opacity of the axis labels. - * @Default {1} - */ - opacity?: number; - - /** Font size of the axis labels. - * @Default {13px} - */ - size?: string; -} - -export interface PrimaryXAxisMajorGridLines { - - /** Pattern of dashes and gaps used to stroke the major grid lines. - * @Default {null} - */ - dashArray?: string; - - /** Color of the major grid line. - * @Default {null} - */ - color?: string; - - /** Opacity of major grid lines. - * @Default {1} - */ - opacity?: number; - - /** Show/hides the major grid lines. - * @Default {true} - */ - visible?: boolean; - - /** Width of the major grid lines. - * @Default {1} - */ - width?: number; -} - -export interface PrimaryXAxisMajorTickLines { - - /** Length of the major tick lines. - * @Default {5} - */ - size?: number; - - /** Show/hides the major tick lines. - * @Default {true} - */ - visible?: boolean; - - /** Width of the major tick lines. - * @Default {1} - */ - width?: number; -} - -export interface PrimaryXAxisMinorGridLines { - - /** Patterns of dashes and gaps used to stroke the minor grid lines. - * @Default {null} - */ - dashArray?: string; - - /** Show/hides the minor grid lines. - * @Default {true} - */ - visible?: boolean; - - /** Width of the minorGridLines. - * @Default {1} - */ - width?: number; -} - -export interface PrimaryXAxisMinorTickLines { - - /** Length of the minor tick lines. - * @Default {5} - */ - size?: number; - - /** Show/hides the minor tick lines. - * @Default {true} - */ - visible?: boolean; - - /** Width of the minor tick line. - * @Default {1} - */ - width?: number; -} - -export interface PrimaryXAxisRange { - - /** Minimum value of the axis range. - * @Default {null} - */ - min?: number; - - /** Maximum value of the axis range. - * @Default {null} - */ - max?: number; - - /** Interval of the axis range. - * @Default {null} - */ - interval?: number; -} - -export interface PrimaryXAxisMultiLevelLabelsFont { - - /** Font color of the multi level labels text. - * @Default {null} - */ - color?: string; - - /** Font family of the multi level labels text. - * @Default {Segoe UI} - */ - fontFamily?: string; - - /** Font style of the multi level labels text. - * @Default {Normal} - */ - fontStyle?: ej.datavisualization.Chart.FontStyle|string; - - /** Font weight of the multi level label text. - * @Default {regular} - */ - fontWeight?: string; - - /** Opacity of the multi level label text. - * @Default {1} - */ - opacity?: number; - - /** Font size of the multi level label text. - * @Default {12px} - */ - size?: string; -} - -export interface PrimaryXAxisMultiLevelLabelsBorder { - - /** Border color of the multi level labels. - * @Default {null} - */ - color?: string; - - /** Border width of the multi level labels. - * @Default {1} - */ - width?: number; - - /** Border type of the multi level labels. - * @Default {rectangle. See Type} - */ - type?: ej.datavisualization.Chart.MultiLevelLabelsBorderType|string; -} - -export interface PrimaryXAxisMultiLevelLabel { - - /** Visibility of the multi level labels. - * @Default {false} - */ - visible?: boolean; - - /** Text of the multi level labels. - */ - text?: string; - - /** Starting value of the multi level labels. - * @Default {null} - */ - start?: number; - - /** Ending value of the multi level labels. - * @Default {null} - */ - end?: number; - - /** Specifies the level of multi level labels. - * @Default {0} - */ - level?: number; - - /** Specifies the maximum width of the text in multi level labels. - * @Default {null} - */ - maximumTextWidth?: number; - - /** Specifies the alignment of the text in multi level labels. - * @Default {center. See TextAlignment} - */ - textAlignment?: ej.datavisualization.Chart.TextAlignment|string; - - /** Specifies the handling of text over flow in multi level labels. - * @Default {center. See TextOverflow} - */ - textOverflow?: ej.datavisualization.Chart.TextOverflow|string; - - /** Options for customizing the font of the text. - */ - font?: PrimaryXAxisMultiLevelLabelsFont; - - /** Options for customizing the border of the series. - */ - border?: PrimaryXAxisMultiLevelLabelsBorder; -} - -export interface PrimaryXAxisStripLineFont { - - /** Font color of the strip line text. - * @Default {black} - */ - color?: string; - - /** Font family of the strip line text. - * @Default {Segoe UI} - */ - fontFamily?: string; - - /** Font style of the strip line text. - * @Default {Normal} - */ - fontStyle?: ej.datavisualization.Chart.FontStyle|string; - - /** Font weight of the strip line text. - * @Default {regular} - */ - fontWeight?: string; - - /** Opacity of the strip line text. - * @Default {1} - */ - opacity?: number; - - /** Font size of the strip line text. - * @Default {12px} - */ - size?: string; -} - -export interface PrimaryXAxisStripLine { - - /** Border color of the strip line. - * @Default {gray} - */ - borderColor?: string; - - /** Background color of the strip line. - * @Default {gray} - */ - color?: string; - - /** End value of the strip line. - * @Default {null} - */ - end?: number; - - /** Options for customizing the font of the text. - */ - font?: PrimaryXAxisStripLineFont; - - /** Start value of the strip line. - * @Default {null} - */ - start?: number; - - /** Indicates whether to render the strip line from the minimum/start value of the axis. This property does not work when start property is set. - * @Default {false} - */ - startFromAxis?: boolean; - - /** Specifies text to be displayed inside the strip line. - * @Default {stripLine} - */ - text?: string; - - /** Specifies the alignment of the text inside the strip line. - * @Default {middlecenter. See TextAlignment} - */ - textAlignment?: ej.datavisualization.Chart.TextAlignment|string; - - /** Show/hides the strip line. - * @Default {false} - */ - visible?: boolean; - - /** Width of the strip line. - * @Default {0} - */ - width?: number; - - /** Specifies the order where the strip line and the series have to be rendered. When Z-order is “behind”, strip line is rendered - * under the series and when it is “over”, it is rendered above the series. - * @Default {over. See ZIndex} - */ - zIndex?: ej.datavisualization.Chart.ZIndex|string; -} - -export interface PrimaryXAxisLabelBorder { - - /** Specifies the color of the label border. - * @Default {null} - */ - color?: string; - - /** Specifies the width of the label border. - * @Default {1} - */ - width?: number; -} - -export interface PrimaryXAxisTitleFont { - - /** Font family of the title text. - * @Default {Segoe UI} - */ - fontFamily?: string; - - /** Font style of the title text. - * @Default {ej.datavisualization.Chart.FontStyle.Normal} - */ - fontStyle?: ej.datavisualization.Chart.FontStyle|string; - - /** Font weight of the title text. - * @Default {ej.datavisualization.Chart.FontWeight.Regular. See FontWeight} - */ - fontWeight?: ej.datavisualization.Chart.FontWeight|string; - - /** Opacity of the axis title text. - * @Default {1} - */ - opacity?: number; - - /** Font size of the axis title. - * @Default {16px} - */ - size?: string; -} - -export interface PrimaryXAxisTitle { - - /** Specifies whether to trim the axis title when it exceeds the chart area or the maximum width of the title. - * @Default {false} - */ - enableTrim?: boolean; - - /** Options for customizing the title font. - */ - font?: PrimaryXAxisTitleFont; - - /** Maximum width of the title, when the title exceeds this width, the title gets trimmed, when enableTrim is true. - * @Default {34} - */ - maximumTitleWidth?: number; - - /** Title for the axis. - */ - text?: string; - - /** Controls the visibility of axis title. - * @Default {true} - */ - visible?: boolean; - - /** offset value for axis title. - * @Default {0} - */ - offset?: number; - - /** Specifies the position of the axis title. - * @Default {outside. See Position} - */ - position?: ej.datavisualization.Chart.LabelPosition|string; - - /** Specifies the position of the axis title. - * @Default {center. See Alignment} - */ - alignment?: ej.datavisualization.Chart.TextAlignment|string; -} - -export interface PrimaryXAxis { - - /** Options for customizing horizontal axis alternate grid band. - */ - alternateGridBand?: PrimaryXAxisAlternateGridBand; - - /** Specifies where horizontal axis should intersect the vertical axis or vice versa. Value should be provided in axis co-ordinates. - * If provided value is greater than the maximum value of crossing axis, then axis will be placed at the opposite side. - * @Default {null} - */ - crossesAt?: number; - - /** Name of the axis used for crossing. Vertical axis name should be provided for horizontal axis and vice versa. - * If the provided name does not belongs to a valid axis, then primary X axis or primary Y axis will be used for crossing - * @Default {null} - */ - crossesInAxis?: string; - - /** Category axis can also plot points based on index value of data points. Index based plotting can be enabled by setting ‘isIndexed’ property to true. - * @Default {false} - */ - isIndexed?: boolean; - - /** Options for customizing the axis line. - */ - axisLine?: PrimaryXAxisAxisLine; - - /** Specifies the index of the column where the axis is associated, when the chart area is divided into multiple plot areas by using columnDefinitions. - * @Default {null} - */ - columnIndex?: number; - - /** Specifies the number of columns or plot areas an axis has to span horizontally. - * @Default {null} - */ - columnSpan?: number; - - /** Options to customize the crosshair label. - */ - crosshairLabel?: PrimaryXAxisCrosshairLabel; - - /** With this setting, you can request axis to calculate intervals approximately equal to your desired interval. - * @Default {null} - */ - desiredIntervals?: number; - - /** Specifies the placement of labels. - * @Default {ej.datavisualization.Chart.LabelPlacement.BetweenTicks. See LabelPlacement} - */ - labelPlacement?: ej.datavisualization.Chart.LabelPlacement|string; - - /** Specifies the position of labels at the edge of the axis. - * @Default {ej.datavisualization.Chart.EdgeLabelPlacement.None. See EdgeLabelPlacement} - */ - edgeLabelPlacement?: ej.datavisualization.Chart.EdgeLabelPlacement|string; - - /** Specifies whether to trim the axis label when the width of the label exceeds the maximumLabelWidth. - * @Default {false} - */ - enableTrim?: boolean; - - /** Options for customizing the font of the axis Labels. - */ - font?: PrimaryXAxisFont; - - /** Specifies the type of interval in date time axis. - * @Default {null. See IntervalType} - */ - intervalType?: ej.datavisualization.Chart.IntervalType|string; - - /** Specifies whether to inverse the axis. - * @Default {false} - */ - isInversed?: boolean; - - /** Custom formatting for axis label and supports all standard formatting type of numerical and date time values. - * @Default {null} - */ - labelFormat?: string; - - /** Specifies the action to take when the axis labels are overlapping with each other. - * @Default {ej.datavisualization.Chart.LabelIntersectAction.None. See LabelIntersectAction} - */ - labelIntersectAction?: ej.datavisualization.Chart.LabelIntersectAction|string; - - /** Specifies the position of the axis labels. - * @Default {outside. See LabelPosition} - */ - labelPosition?: ej.datavisualization.Chart.LabelPosition|string; - - /** Specifies the position of the axis labels. - * @Default {center. See Alignment} - */ - alignment?: ej.datavisualization.Chart.LabelAlignment|string; - - /** Angle in degrees to rotate the axis labels. - * @Default {null} - */ - labelRotation?: number; - - /** Logarithmic base value. This is applicable only for logarithmic axis. - * @Default {10} - */ - logBase?: number; - - /** Options for customizing major gird lines. - */ - majorGridLines?: PrimaryXAxisMajorGridLines; - - /** Options for customizing the major tick lines. - */ - majorTickLines?: PrimaryXAxisMajorTickLines; - - /** Maximum number of labels to be displayed in every 100 pixels. - * @Default {3} - */ - maximumLabels?: number; - - /** Maximum width of the axis label. When the label exceeds the width, the label gets trimmed when the enableTrim is set to true. - * @Default {34} - */ - maximumLabelWidth?: number; - - /** Options for customizing the minor grid lines. - */ - minorGridLines?: PrimaryXAxisMinorGridLines; - - /** Options for customizing the minor tick lines. - */ - minorTickLines?: PrimaryXAxisMinorTickLines; - - /** Specifies the number of minor ticks per interval. - * @Default {null} - */ - minorTicksPerInterval?: number; - - /** Unique name of the axis. To associate an axis with the series, you have to set this name to the xAxisName/yAxisName property of the series. - * @Default {null} - */ - name?: string; - - /** Specifies whether to render the axis at the opposite side of its default position. - * @Default {false} - */ - opposedPosition?: boolean; - - /** Specifies the padding for the plot area. - * @Default {10} - */ - plotOffset?: number; - - /** Options to customize the range of the axis. - */ - range?: PrimaryXAxisRange; - - /** Specifies the padding for the axis range. - * @Default {None. See RangePadding} - */ - rangePadding?: ej.datavisualization.Chart.RangePadding|string; - - /** Rounds the number to the given number of decimals. - * @Default {null} - */ - roundingPlaces?: number; - - /** Options for customizing the multi level labels. - * @Default {[ ]} - */ - multiLevelLabels?: PrimaryXAxisMultiLevelLabel[]; - - /** Options for customizing the strip lines. - * @Default {[ ]} - */ - stripLine?: PrimaryXAxisStripLine[]; - - /** Specifies the position of the axis tick lines. - * @Default {outside. See TickLinesPosition} - */ - tickLinesPosition?: ej.datavisualization.Chart.TickLinesPosition|string; - - /** Options for customizing the border of the labels. - */ - labelBorder?: PrimaryXAxisLabelBorder; - - /** Options for customizing the axis title. - */ - title?: PrimaryXAxisTitle; - - /** Specifies the type of data the axis is handling. - * @Default {null. See ValueType} - */ - valueType?: ej.datavisualization.Chart.ValueType|string; - - /** Show/hides the axis. - * @Default {true} - */ - visible?: boolean; - - /** The axis is scaled by this factor. When zoomFactor is 0.5, the chart is scaled by 200% along this axis. Value ranges from 0 to 1. - * @Default {1} - */ - zoomFactor?: number; - - /** Position of the zoomed axis. Value ranges from 0 to 1. - * @Default {0} - */ - zoomPosition?: number; -} - -export interface AxesAlternateGridBandEven { - - /** Fill color for the even grid bands. - * @Default {transparent} - */ - fill?: string; - - /** Opacity of the even grid band. - * @Default {1} - */ - opacity?: number; -} - -export interface AxesAlternateGridBandOdd { - - /** Fill color of the odd grid bands - * @Default {transparent} - */ - fill?: string; - - /** Opacity of odd grid band - * @Default {1} - */ - opacity?: number; -} - -export interface AxesAlternateGridBand { - - /** Options for customizing even grid band. - */ - even?: AxesAlternateGridBandEven; - - /** Options for customizing odd grid band. - */ - odd?: AxesAlternateGridBandOdd; -} - -export interface AxesAxisLine { - - /** Pattern of dashes and gaps to be applied to the axis line. - * @Default {null} - */ - dashArray?: string; - - /** Padding for axis line. Normally, it is used along with plotOffset to pad the plot area. - * @Default {null} - */ - offset?: number; - - /** Show/hides the axis line. - * @Default {true} - */ - visible?: boolean; - - /** Color of axis line. - */ - color?: string; - - /** Width of axis line. - * @Default {1} - */ - width?: number; -} - -export interface AxesCrosshairLabel { - - /** Show/hides the crosshair label associated with this axis. - * @Default {false} - */ - visible?: boolean; -} - -export interface AxesFont { - - /** Font family of labels. - * @Default {Segoe UI} - */ - fontFamily?: string; - - /** Font style of labels. - * @Default {ej.datavisualization.Chart.FontStyle.Normal. See FontStyle} - */ - fontStyle?: ej.datavisualization.Chart.FontStyle|string; - - /** Font weight of the label. - * @Default {ej.datavisualization.Chart.FontWeight.Regular. See FontWeight} - */ - fontWeight?: ej.datavisualization.Chart.FontWeight|string; - - /** Opacity of the axis labels. - * @Default {1} - */ - opacity?: number; - - /** Font size of the axis labels. - * @Default {13px} - */ - size?: string; -} - -export interface AxesMajorGridLines { - - /** Pattern of dashes and gaps used to stroke the major grid lines. - * @Default {null} - */ - dashArray?: string; - - /** Color of the major grid line. - * @Default {null} - */ - color?: string; - - /** Opacity of major grid lines. - * @Default {1} - */ - opacity?: number; - - /** Show/hides the major grid lines. - * @Default {true} - */ - visible?: boolean; - - /** Width of the major grid lines. - * @Default {1} - */ - width?: number; -} - -export interface AxesMajorTickLines { - - /** Length of the major tick lines. - * @Default {5} - */ - size?: number; - - /** Show/hides the major tick lines. - * @Default {true} - */ - visible?: boolean; - - /** Width of the major tick lines. - * @Default {1} - */ - width?: number; -} - -export interface AxesMinorGridLines { - - /** Patterns of dashes and gaps used to stroke the minor grid lines. - * @Default {null} - */ - dashArray?: string; - - /** Show/hides the minor grid lines. - * @Default {true} - */ - visible?: boolean; - - /** Width of the minorGridLines. - * @Default {1} - */ - width?: number; -} - -export interface AxesMinorTickLines { - - /** Length of the minor tick lines. - * @Default {5} - */ - size?: number; - - /** Show/hides the minor tick lines. - * @Default {true} - */ - visible?: boolean; - - /** Width of the minor tick line. - * @Default {1} - */ - width?: number; -} - -export interface AxesRange { - - /** Minimum value of the axis range. - * @Default {null} - */ - min?: number; - - /** Maximum value of the axis range. - * @Default {null} - */ - max?: number; - - /** Interval of the axis range. - * @Default {null} - */ - interval?: number; -} - -export interface AxesMultiLevelLabelsFont { - - /** Font color of the multi level labels text. - * @Default {null} - */ - color?: string; - - /** Font family of the multi level labels text. - * @Default {Segoe UI} - */ - fontFamily?: string; - - /** Font style of the multi level labels text. - * @Default {Normal} - */ - fontStyle?: ej.datavisualization.Chart.FontStyle|string; - - /** Font weight of the multi level label text. - * @Default {regular} - */ - fontWeight?: string; - - /** Opacity of the multi level label text. - * @Default {1} - */ - opacity?: number; - - /** Font size of the multi level label text. - * @Default {12px} - */ - size?: string; -} - -export interface AxesMultiLevelLabelsBorder { - - /** Border color of the multi level labels. - * @Default {null} - */ - color?: string; - - /** Border width of the multi level labels. - * @Default {1} - */ - width?: number; - - /** Border type of the multi level labels. - * @Default {rectangle. See Type} - */ - type?: ej.datavisualization.Chart.MultiLevelLabelsBorderType|string; -} - -export interface AxesMultiLevelLabel { - - /** Visibility of the multi level labels. - * @Default {false} - */ - visible?: boolean; - - /** Text of the multi level labels. - */ - text?: string; - - /** Starting value of the multi level labels. - * @Default {null} - */ - start?: number; - - /** Ending value of the multi level labels. - * @Default {null} - */ - end?: number; - - /** Specifies the level of multi level labels. - * @Default {0} - */ - level?: number; - - /** Specifies the maximum width of the text in multi level labels. - * @Default {null} - */ - maximumTextWidth?: number; - - /** Specifies the alignment of the text in multi level labels. - * @Default {center. See TextAlignment} - */ - textAlignment?: ej.datavisualization.Chart.TextAlignment|string; - - /** Specifies the handling of text over flow in multi level labels. - * @Default {center. See TextOverflow} - */ - textOverflow?: ej.datavisualization.Chart.TextOverflow|string; - - /** Options for customizing the font of the text. - */ - font?: AxesMultiLevelLabelsFont; - - /** Options for customizing the border of the series. - */ - border?: AxesMultiLevelLabelsBorder; -} - -export interface AxesStripLineFont { - - /** Font color of the strip line text. - * @Default {black} - */ - color?: string; - - /** Font family of the strip line text. - * @Default {Segoe UI} - */ - fontFamily?: string; - - /** Font style of the strip line text. - * @Default {Normal} - */ - fontStyle?: ej.datavisualization.Chart.FontStyle|string; - - /** Font weight of the strip line text. - * @Default {regular} - */ - fontWeight?: string; - - /** Opacity of the strip line text. - * @Default {1} - */ - opacity?: number; - - /** Font size of the strip line text. - * @Default {12px} - */ - size?: string; -} - -export interface AxesStripLine { - - /** Border color of the strip line. - * @Default {gray} - */ - borderColor?: string; - - /** Background color of the strip line. - * @Default {gray} - */ - color?: string; - - /** End value of the strip line. - * @Default {null} - */ - end?: number; - - /** Options for customizing the font of the text. - */ - font?: AxesStripLineFont; - - /** Start value of the strip line. - * @Default {null} - */ - start?: number; - - /** Indicates whether to render the strip line from the minimum/start value of the axis. This property does not work when start property is set. - * @Default {false} - */ - startFromAxis?: boolean; - - /** Specifies text to be displayed inside the strip line. - * @Default {stripLine} - */ - text?: string; - - /** Specifies the alignment of the text inside the strip line. - * @Default {middlecenter. See TextAlignment} - */ - textAlignment?: ej.datavisualization.Chart.TextAlignment|string; - - /** Show/hides the strip line. - * @Default {false} - */ - visible?: boolean; - - /** Width of the strip line. - * @Default {0} - */ - width?: number; - - /** Specifies the order where the strip line and the series have to be rendered. When Z-order is “behind”, strip line is rendered under the series and when it is “over”, - * it is rendered above the series. - * @Default {over. See ZIndex} - */ - zIndex?: ej.datavisualization.Chart.ZIndex|string; -} - -export interface AxesLabelBorder { - - /** Specifies the color of the label border. - * @Default {null} - */ - color?: string; - - /** Specifies the width of the label border. - * @Default {1} - */ - width?: number; -} - -export interface AxesTitleFont { - - /** Font family of the title text. - * @Default {Segoe UI} - */ - fontFamily?: string; - - /** Font style of the title text. - * @Default {ej.datavisualization.Chart.FontStyle.Normal} - */ - fontStyle?: ej.datavisualization.Chart.FontStyle|string; - - /** Font weight of the title text. - * @Default {ej.datavisualization.Chart.FontWeight.Regular. See FontWeight} - */ - fontWeight?: ej.datavisualization.Chart.FontWeight|string; - - /** Opacity of the axis title text. - * @Default {1} - */ - opacity?: number; - - /** Font size of the axis title. - * @Default {16px} - */ - size?: string; -} - -export interface AxesTitle { - - /** Specifies whether to trim the axis title when it exceeds the chart area or the maximum width of the title. - * @Default {false} - */ - enableTrim?: boolean; - - /** Options for customizing the title font. - */ - font?: AxesTitleFont; - - /** Maximum width of the title, when the title exceeds this width, the title gets trimmed, when enableTrim is true. - * @Default {34} - */ - maximumTitleWidth?: number; - - /** Title for the axis. - */ - text?: string; - - /** Controls the visibility of axis title. - * @Default {true} - */ - visible?: boolean; - - /** offset value for axis title. - * @Default {0} - */ - offset?: number; - - /** Specifies the position of the axis title. - * @Default {outside. See Position} - */ - position?: ej.datavisualization.Chart.LabelPosition|string; - - /** Specifies the position of the axis title. - * @Default {center. See Alignment} - */ - alignment?: ej.datavisualization.Chart.TextAlignment|string; -} - -export interface Axis { - - /** Options for customizing axis alternate grid band. - */ - alternateGridBand?: AxesAlternateGridBand; - - /** Specifies where axis should intersect the vertical axis or vice versa. Value should be provided in axis co-ordinates. If provided value is greater than the maximum value of crossing axis, - * then axis will be placed at the opposite side. - * @Default {null} - */ - crossesAt?: number; - - /** Category axis can also plot points based on index value of data points. Index based plotting can be enabled by setting ‘isIndexed’ property to true. - * @Default {false} - */ - isIndexed?: boolean; - - /** Options for customizing the axis line. - */ - axisLine?: AxesAxisLine; - - /** Specifies the index of the column where the axis is associated, when the chart area is divided into multiple plot areas by using columnDefinitions. - * @Default {null} - */ - columnIndex?: number; - - /** Specifies the number of columns or plot areas an axis has to span horizontally. - * @Default {null} - */ - columnSpan?: number; - - /** Options to customize the crosshair label. - */ - crosshairLabel?: AxesCrosshairLabel; - - /** With this setting, you can request axis to calculate intervals approximately equal to your desired interval. - * @Default {null} - */ - desiredIntervals?: number; - - /** Specifies the placement of labels. - * @Default {ej.datavisualization.Chart.LabelPlacement.BetweenTicks. See LabelPlacement} - */ - labelPlacement?: ej.datavisualization.Chart.LabelPlacement|string; - - /** Specifies the position of labels at the edge of the axis. - * @Default {ej.datavisualization.Chart.EdgeLabelPlacement.None. See EdgeLabelPlacement} - */ - edgeLabelPlacement?: ej.datavisualization.Chart.EdgeLabelPlacement|string; - - /** Specifies whether to trim the axis label when the width of the label exceeds the maximumLabelWidth. - * @Default {false} - */ - enableTrim?: boolean; - - /** Options for customizing the font of the axis Labels. - */ - font?: AxesFont; - - /** Specifies the type of interval in date time axis. - * @Default {null. See IntervalType} - */ - intervalType?: ej.datavisualization.Chart.IntervalType|string; - - /** Specifies whether to inverse the axis. - * @Default {false} - */ - isInversed?: boolean; - - /** Custom formatting for axis label and supports all standard formatting type of numerical and date time values. - * @Default {null} - */ - labelFormat?: string; - - /** Specifies the action to take when the axis labels are overlapping with each other. - * @Default {ej.datavisualization.Chart.LabelIntersectAction.None. See LabelIntersectAction} - */ - labelIntersectAction?: ej.datavisualization.Chart.LabelIntersectAction|string; - - /** Specifies the position of the axis labels. - * @Default {outside. See LabelPosition} - */ - labelPosition?: ej.datavisualization.Chart.LabelPosition|string; - - /** Specifies the position of the axis labels. - * @Default {center. See Alignment} - */ - alignment?: ej.datavisualization.Chart.LabelAlignment|string; - - /** Angle in degrees to rotate the axis labels. - * @Default {null} - */ - labelRotation?: number; - - /** Logarithmic base value. This is applicable only for logarithmic axis. - * @Default {10} - */ - logBase?: number; - - /** Options for customizing major gird lines. - */ - majorGridLines?: AxesMajorGridLines; - - /** Options for customizing the major tick lines. - */ - majorTickLines?: AxesMajorTickLines; - - /** Maximum number of labels to be displayed in every 100 pixels. - * @Default {3} - */ - maximumLabels?: number; - - /** Maximum width of the axis label. When the label exceeds the width, the label gets trimmed when the enableTrim is set to true. - * @Default {34} - */ - maximumLabelWidth?: number; - - /** Options for customizing the minor grid lines. - */ - minorGridLines?: AxesMinorGridLines; - - /** Options for customizing the minor tick lines. - */ - minorTickLines?: AxesMinorTickLines; - - /** Specifies the number of minor ticks per interval. - * @Default {null} - */ - minorTicksPerInterval?: number; - - /** Unique name of the axis. To associate an axis with the series, you have to set this name to the xAxisName/yAxisName property of the series. - * @Default {null} - */ - name?: string; - - /** Specifies whether to render the axis at the opposite side of its default position. - * @Default {false} - */ - opposedPosition?: boolean; - - /** Specifies the padding for the plot area. - * @Default {10} - */ - plotOffset?: number; - - /** Options to customize the range of the axis. - */ - range?: AxesRange; - - /** Specifies the padding for the axis range. - * @Default {None. See RangePadding} - */ - rangePadding?: ej.datavisualization.Chart.RangePadding|string; - - /** Rounds the number to the given number of decimals. - * @Default {null} - */ - roundingPlaces?: number; - - /** Options for customizing the multi level labels. - * @Default {[ ]} - */ - multiLevelLabels?: AxesMultiLevelLabel[]; - - /** Options for customizing the strip lines. - * @Default {[ ]} - */ - stripLine?: AxesStripLine[]; - - /** Specifies the position of the axis tick lines. - * @Default {outside. See TickLinesPosition} - */ - tickLinesPosition?: ej.datavisualization.Chart.TickLinesPosition|string; - - /** Options for customizing the border of the labels. - */ - labelBorder?: AxesLabelBorder; - - /** Options for customizing the axis title. - */ - title?: AxesTitle; - - /** Specifies the type of data the axis is handling. - * @Default {null. See ValueType} - */ - valueType?: ej.datavisualization.Chart.ValueType|string; - - /** Show/hides the axis. - * @Default {true} - */ - visible?: boolean; - - /** The axis is scaled by this factor. When zoomFactor is 0.5, the chart is scaled by 200% along this axis. Value ranges from 0 to 1. - * @Default {1} - */ - zoomFactor?: number; - - /** Position of the zoomed axis. Value ranges from 0 to 1. - * @Default {0} - */ - zoomPosition?: number; -} - -export interface PrimaryYAxisAlternateGridBandEven { - - /** Fill color for the even grid bands. - * @Default {transparent} - */ - fill?: string; - - /** Opacity of the even grid band. - * @Default {1} - */ - opacity?: number; -} - -export interface PrimaryYAxisAlternateGridBandOdd { - - /** Fill color of the odd grid bands. - * @Default {transparent} - */ - fill?: string; - - /** Opacity of odd grid band. - * @Default {1} - */ - opacity?: number; -} - -export interface PrimaryYAxisAlternateGridBand { - - /** Options for customizing even grid band. - */ - even?: PrimaryYAxisAlternateGridBandEven; - - /** Options for customizing odd grid band. - */ - odd?: PrimaryYAxisAlternateGridBandOdd; -} - -export interface PrimaryYAxisAxisLine { - - /** Pattern of dashes and gaps to be applied to the axis line. - * @Default {null} - */ - dashArray?: string; - - /** Padding for axis line. Normally, it is used along with plotOffset to pad the plot area. - * @Default {null} - */ - offset?: number; - - /** Show/hides the axis line. - * @Default {true} - */ - visible?: boolean; - - /** Color of axis line. - */ - color?: string; - - /** Width of axis line. - * @Default {1} - */ - width?: number; -} - -export interface PrimaryYAxisCrosshairLabel { - - /** Show/hides the crosshair label associated with this axis. - * @Default {false} - */ - visible?: boolean; -} - -export interface PrimaryYAxisFont { - - /** Font family of labels. - * @Default {Segoe UI} - */ - fontFamily?: string; - - /** Font style of labels. - * @Default {ej.datavisualization.Chart.FontStyle.Normal. See FontStyle} - */ - fontStyle?: ej.datavisualization.Chart.FontStyle|string; - - /** Font weight of the label. - * @Default {ej.datavisualization.Chart.FontWeight.Regular. See FontWeight} - */ - fontWeight?: ej.datavisualization.Chart.FontWeight|string; - - /** Opacity of the axis labels. - * @Default {1} - */ - opacity?: number; - - /** Font size of the axis labels. - * @Default {13px} - */ - size?: string; -} - -export interface PrimaryYAxisMajorGridLines { - - /** Pattern of dashes and gaps used to stroke the major grid lines. - * @Default {null} - */ - dashArray?: string; - - /** Color of the major grid lines. - * @Default {null} - */ - color?: string; - - /** Opacity of major grid lines. - * @Default {1} - */ - opacity?: number; - - /** Show/hides the major grid lines. - * @Default {true} - */ - visible?: boolean; - - /** Width of the major grid lines. - * @Default {1} - */ - width?: number; -} - -export interface PrimaryYAxisMajorTickLines { - - /** Length of the major tick lines. - * @Default {5} - */ - size?: number; - - /** Show/hides the major tick lines. - * @Default {true} - */ - visible?: boolean; - - /** Width of the major tick lines. - * @Default {1} - */ - width?: number; -} - -export interface PrimaryYAxisMinorGridLines { - - /** Patterns of dashes and gaps used to stroke the minor grid lines. - * @Default {null} - */ - dashArray?: string; - - /** Show/hides the minor grid lines. - * @Default {true} - */ - visible?: boolean; - - /** Width of the minorGridLines. - * @Default {1} - */ - width?: number; -} - -export interface PrimaryYAxisMinorTickLines { - - /** Length of the minor tick lines. - * @Default {5} - */ - size?: number; - - /** Show/hides the minor tick lines. - * @Default {true} - */ - visible?: boolean; - - /** Width of the minor tick line - * @Default {1} - */ - width?: number; -} - -export interface PrimaryYAxisRange { - - /** Minimum value of the axis range. - * @Default {null} - */ - min?: number; - - /** Maximum value of the axis range. - * @Default {null} - */ - max?: number; - - /** Interval for the range. - * @Default {null} - */ - interval?: number; -} - -export interface PrimaryYAxisMultiLevelLabelsFont { - - /** Font color of the multi level labels text. - * @Default {null} - */ - color?: string; - - /** Font family of the multi level labels text. - * @Default {Segoe UI} - */ - fontFamily?: string; - - /** Font style of the multi level labels text. - * @Default {Normal} - */ - fontStyle?: ej.datavisualization.Chart.FontStyle|string; - - /** Font weight of the multi level label text. - * @Default {regular} - */ - fontWeight?: string; - - /** Opacity of the multi level label text. - * @Default {1} - */ - opacity?: number; - - /** Font size of the multi level label text. - * @Default {12px} - */ - size?: string; -} - -export interface PrimaryYAxisMultiLevelLabelsBorder { - - /** Border color of the multi level labels. - * @Default {null} - */ - color?: string; - - /** Border width of the multi level labels. - * @Default {1} - */ - width?: number; - - /** Border type of the multi level labels. - * @Default {rectangle. See Type} - */ - type?: ej.datavisualization.Chart.MultiLevelLabelsBorderType|string; -} - -export interface PrimaryYAxisMultiLevelLabel { - - /** Visibility of the multi level labels. - * @Default {false} - */ - visible?: boolean; - - /** Text of the multi level labels. - */ - text?: string; - - /** Starting value of the multi level labels. - * @Default {null} - */ - start?: number; - - /** Ending value of the multi level labels. - * @Default {null} - */ - end?: number; - - /** Specifies the level of multi level labels. - * @Default {0} - */ - level?: number; - - /** Specifies the maximum width of the text in multi level labels. - * @Default {null} - */ - maximumTextWidth?: number; - - /** Specifies the alignment of the text in multi level labels. - * @Default {center. See TextAlignment} - */ - textAlignment?: ej.datavisualization.Chart.TextAlignment|string; - - /** Specifies the handling of text over flow in multi level labels. - * @Default {center. See TextOverflow} - */ - textOverflow?: ej.datavisualization.Chart.TextOverflow|string; - - /** Options for customizing the font of the text. - */ - font?: PrimaryYAxisMultiLevelLabelsFont; - - /** Options for customizing the border of the series. - */ - border?: PrimaryYAxisMultiLevelLabelsBorder; -} - -export interface PrimaryYAxisStripLineFont { - - /** Font color of the strip line text. - * @Default {black} - */ - color?: string; - - /** Font family of the strip line text. - * @Default {Segoe UI} - */ - fontFamily?: string; - - /** Font style of the strip line text. - * @Default {Normal} - */ - fontStyle?: ej.datavisualization.Chart.FontStyle|string; - - /** Font weight of the strip line text. - * @Default {regular} - */ - fontWeight?: string; - - /** Opacity of the strip line text. - * @Default {1} - */ - opacity?: number; - - /** Font size of the strip line text. - * @Default {12px} - */ - size?: string; -} - -export interface PrimaryYAxisStripLine { - - /** Border color of the strip line. - * @Default {gray} - */ - borderColor?: string; - - /** Background color of the strip line. - * @Default {gray} - */ - color?: string; - - /** End value of the strip line. - * @Default {null} - */ - end?: number; - - /** Options for customizing the font of the text. - */ - font?: PrimaryYAxisStripLineFont; - - /** Start value of the strip line. - * @Default {null} - */ - start?: number; - - /** Indicates whether to render the strip line from the minimum/start value of the axis. This property won’t work when start property is set. - * @Default {false} - */ - startFromAxis?: boolean; - - /** Specifies text to be displayed inside the strip line. - * @Default {stripLine} - */ - text?: string; - - /** Specifies the alignment of the text inside the strip line. - * @Default {middlecenter. See TextAlignment} - */ - textAlignment?: ej.datavisualization.Chart.TextAlignment|string; - - /** Show/hides the strip line. - * @Default {false} - */ - visible?: boolean; - - /** Width of the strip line. - * @Default {0} - */ - width?: number; - - /** Specifies the order in which strip line and the series have to be rendered. When Z-order is “behind”, strip line is rendered below the series and - * when it is “over”, it is rendered above the series. - * @Default {over. See ZIndex} - */ - zIndex?: ej.datavisualization.Chart.ZIndex|string; -} - -export interface PrimaryYAxisLabelBorder { - - /** Specifies the color of the label border. - * @Default {null} - */ - color?: string; - - /** Specifies the width of the label border. - * @Default {1} - */ - width?: number; -} - -export interface PrimaryYAxisTitleFont { - - /** Font family of the title text. - * @Default {Segoe UI} - */ - fontFamily?: string; - - /** Font style of the title text. - * @Default {ej.datavisualization.Chart.FontStyle.Normal} - */ - fontStyle?: ej.datavisualization.Chart.FontStyle|string; - - /** Font weight of the title text. - * @Default {ej.datavisualization.Chart.FontWeight.Regular. See FontWeight} - */ - fontWeight?: ej.datavisualization.Chart.FontWeight|string; - - /** Opacity of the axis title text. - * @Default {1} - */ - opacity?: number; - - /** Font size of the axis title. - * @Default {16px} - */ - size?: string; -} - -export interface PrimaryYAxisTitle { - - /** Specifies whether to trim the axis title when it exceeds the chart area or the maximum width of the title. - * @Default {ej.datavisualization.Chart.enableTrim} - */ - enableTrim?: boolean; - - /** Options for customizing the title font. - */ - font?: PrimaryYAxisTitleFont; - - /** Maximum width of the title, when the title exceeds this width, the title gets trimmed, when enableTrim is true. - * @Default {ej.datavisualization.Chart.maximumTitleWidth.null} - */ - maximumTitleWidth?: number; - - /** Title for the axis. - */ - text?: string; - - /** Controls the visibility of axis title. - * @Default {true} - */ - visible?: boolean; - - /** offset value for axis title. - * @Default {0} - */ - offset?: number; - - /** Specifies the position of the axis title. - * @Default {outside. See Position} - */ - position?: ej.datavisualization.Chart.LabelPosition|string; - - /** Specifies the position of the axis title. - * @Default {center. See Alignment} - */ - alignment?: ej.datavisualization.Chart.TextAlignment|string; -} - -export interface PrimaryYAxis { - - /** Options for customizing vertical axis alternate grid band. - */ - alternateGridBand?: PrimaryYAxisAlternateGridBand; - - /** Options for customizing the axis line. - */ - axisLine?: PrimaryYAxisAxisLine; - - /** Specifies where horizontal axis should intersect the vertical axis or vice versa. Value should be provided in axis co-ordinates. - * If provided value is greater than the maximum value of crossing axis, then axis will be placed at the opposite side. - * @Default {null} - */ - crossesAt?: number; - - /** Name of the axis used for crossing. Vertical axis name should be provided for horizontal axis and vice versa. If the provided name does not belongs to a valid axis, - * then primary X axis or primary Y axis will be used for crossing - * @Default {null} - */ - crossesInAxis?: string; - - /** Options to customize the crosshair label. - */ - crosshairLabel?: PrimaryYAxisCrosshairLabel; - - /** With this setting, you can request axis to calculate intervals approximately equal to your desired interval. - * @Default {null} - */ - desiredIntervals?: number; - - /** Specifies the placement of labels. - * @Default {ej.datavisualization.Chart.LabelPlacement.BetweenTicks. See LabelPlacement} - */ - labelPlacement?: ej.datavisualization.Chart.LabelPlacement|string; - - /** Specifies the position of labels at the edge of the axis. - * @Default {ej.datavisualization.Chart.EdgeLabelPlacement.None. See EdgeLabelPlacement} - */ - edgeLabelPlacement?: ej.datavisualization.Chart.EdgeLabelPlacement|string; - - /** Specifies whether to trim the axis label when the width of the label exceeds the maximumLabelWidth. - * @Default {false} - */ - enableTrim?: boolean; - - /** Options for customizing the font of the axis Labels. - */ - font?: PrimaryYAxisFont; - - /** Specifies the type of interval in date time axis. - * @Default {null. See IntervalType} - */ - intervalType?: ej.datavisualization.Chart.IntervalType|string; - - /** Specifies whether to inverse the axis. - * @Default {false} - */ - isInversed?: boolean; - - /** Custom formatting for axis label and supports all standard formatting type of numerical and date time values. - * @Default {null} - */ - labelFormat?: string; - - /** Specifies the action to take when the axis labels are overlapping with each other. - * @Default {ej.datavisualization.Chart.LabelIntersectAction.None} - */ - labelIntersectAction?: ej.datavisualization.Chart.LabelIntersectAction|string; - - /** Specifies the position of the axis labels. - * @Default {outside. See LabelPosition} - */ - labelPosition?: ej.datavisualization.Chart.LabelPosition|string; - - /** Specifies the position of the axis labels. - * @Default {center. See Alignment} - */ - alignment?: ej.datavisualization.Chart.LabelAlignment|string; - - /** Logarithmic base value. This is applicable only for logarithmic axis. - * @Default {10} - */ - logBase?: number; - - /** Options for customizing major gird lines. - */ - majorGridLines?: PrimaryYAxisMajorGridLines; - - /** Options for customizing the major tick lines. - */ - majorTickLines?: PrimaryYAxisMajorTickLines; - - /** Maximum number of labels to be displayed in every 100 pixels. - * @Default {3} - */ - maximumLabels?: number; - - /** Maximum width of the axis label. When the label exceeds the width, the label gets trimmed when the enableTrim is set to true. - * @Default {ej.datavisualization.Chart.maximumLabelWidth type {int}} - */ - maximumLabelWidth?: number; - - /** Options for customizing the minor grid lines. - */ - minorGridLines?: PrimaryYAxisMinorGridLines; - - /** Options for customizing the minor tick lines. - */ - minorTickLines?: PrimaryYAxisMinorTickLines; - - /** Specifies the number of minor ticks per interval. - * @Default {null} - */ - minorTicksPerInterval?: number; - - /** Unique name of the axis. To associate an axis with the series, you have to set this name to the xAxisName/yAxisName property of the series. - * @Default {null} - */ - name?: string; - - /** Specifies whether to render the axis at the opposite side of its default position. - * @Default {false} - */ - opposedPosition?: boolean; - - /** Specifies the padding for the plot area. - * @Default {10} - */ - plotOffset?: number; - - /** Options to customize the range of the axis. - */ - range?: PrimaryYAxisRange; - - /** Specifies the padding for the axis range. - * @Default {ej.datavisualization.Chart.RangePadding.None. See RangePadding} - */ - rangePadding?: ej.datavisualization.Chart.RangePadding|string; - - /** Rounds the number to the given number of decimals. - * @Default {null} - */ - roundingPlaces?: number; - - /** Specifies the index of the row to which the axis is associated, when the chart area is divided into multiple plot areas by using rowDefinitions. - * @Default {null} - */ - rowIndex?: number; - - /** Specifies the number of row or plot areas an axis has to span vertically. - * @Default {null} - */ - rowSpan?: number; - - /** Options for customizing the multi level labels. - * @Default {[ ]} - */ - multiLevelLabels?: PrimaryYAxisMultiLevelLabel[]; - - /** Options for customizing the strip lines. - * @Default {[ ]} - */ - stripLine?: PrimaryYAxisStripLine[]; - - /** Specifies the position of the axis tick lines. - * @Default {outside. See TickLinesPosition} - */ - tickLinesPosition?: ej.datavisualization.Chart.TickLinesPosition|string; - - /** Options for customizing the border of the labels. - */ - labelBorder?: PrimaryYAxisLabelBorder; - - /** Options for customizing the axis title. - */ - title?: PrimaryYAxisTitle; - - /** Specifies the type of data the axis is handling. - * @Default {null. See ValueType} - */ - valueType?: ej.datavisualization.Chart.ValueType|string; - - /** Show/hides the axis. - * @Default {true} - */ - visible?: boolean; - - /** The axis is scaled by this factor. When zoomFactor is 0.5, the chart is scaled by 200% along this axis. Values ranges from 0 to 1. - * @Default {1} - */ - zoomFactor?: number; - - /** Position of the zoomed axis. Value ranges from 0 to 1 - * @Default {0} - */ - zoomPosition?: number; -} - -export interface RowDefinition { - - /** Specifies the unit to measure the height of the row in plotting area. - * @Default {'pixel'. See Unit} - */ - unit?: ej.datavisualization.Chart.Unit|string; - - /** Height of the row in plotting area. Height is measured in either pixel or percentage based on the value of unit property. - * @Default {50} - */ - rowHeight?: number; - - /** Color of the line that indicates the starting point of the row in plotting area. - * @Default {transparent} - */ - lineColor?: string; - - /** Width of the line that indicates the starting point of the row in plot area. - * @Default {1} - */ - lineWidth?: number; -} - -export interface SeriesBorder { - - /** Border color of the series. - * @Default {transparent} - */ - color?: string; - - /** Border width of the series. - * @Default {1} - */ - width?: number; - - /** DashArray for border of the series. - * @Default {null} - */ - dashArray?: string; -} - -export interface SeriesFont { - - /** Font color of the series text. - * @Default {#707070} - */ - color?: string; - - /** Font Family of the series. - * @Default {Segoe UI} - */ - fontFamily?: string; - - /** Font Style of the series. - * @Default {Normal} - */ - fontStyle?: ej.datavisualization.Chart.FontStyle|string; - - /** Font weight of the series. - * @Default {Regular} - */ - fontWeight?: ej.datavisualization.Chart.FontWeight|string; - - /** Opacity of series text. - * @Default {1} - */ - opacity?: number; - - /** Size of the series text. - * @Default {12px} - */ - size?: string; -} - -export interface SeriesMarkerBorder { - - /** Border color of the marker shape. - * @Default {white} - */ - color?: string; - - /** Border width of the marker shape. - * @Default {3} - */ - width?: number; -} - -export interface SeriesMarkerDataLabelBorder { - - /** Border color of the data label. - * @Default {null} - */ - color?: string; - - /** Border width of the data label. - * @Default {0.1} - */ - width?: number; -} - -export interface SeriesMarkerDataLabelConnectorLine { - - /** Specifies when the connector has to be drawn as Bezier curve or straight line. This is applicable only for Pie and Doughnut chart types. - * @Default {line. See ConnectorLineType} - */ - type?: ej.datavisualization.Chart.Type|string; - - /** Width of the connector. - * @Default {0.5} - */ - width?: number; - - /** Color of the connector. - * @Default {null} - */ - color?: string; - - /** Height of the connector. - * @Default {null} - */ - height?: number; -} - -export interface SeriesMarkerDataLabelFont { - - /** Font family of the data label. - * @Default {Segoe UI} - */ - fontFamily?: string; - - /** Font color of the data label text. - * @Default {null} - */ - color?: string; - - /** Font style of the data label. - * @Default {normal. See FontStyle} - */ - fontStyle?: ej.datavisualization.Chart.FontStyle|string; - - /** Font weight of the data label. - * @Default {regular. See FontWeight} - */ - fontWeight?: ej.datavisualization.Chart.FontWeight|string; - - /** Opacity of the text. - * @Default {1} - */ - opacity?: number; - - /** Font size of the data label. - * @Default {12px} - */ - size?: string; -} - -export interface SeriesMarkerDataLabelMargin { - - /** Bottom margin of the text. - * @Default {5} - */ - bottom?: number; - - /** Left margin of the text. - * @Default {5} - */ - left?: number; - - /** Right margin of the text. - * @Default {5} - */ - right?: number; - - /** Top margin of the text. - * @Default {5} - */ - top?: number; -} - -export interface SeriesMarkerDataLabel { - - /** Angle of the data label in degrees. Only the text gets rotated, whereas the background and border does not rotate. - * @Default {null} - */ - angle?: number; - - /** Maximum label width of the data label. - * @Default {null} - */ - maximumLabelWidth?: number; - - /** Enable the wrap option to the data label. - * @Default {false} - */ - enableWrap?: boolean; - - /** Options for customizing the border of the data label. - */ - border?: SeriesMarkerDataLabelBorder; - - /** Options for displaying and customizing the line that connects point and data label. - */ - connectorLine?: SeriesMarkerDataLabelConnectorLine; - - /** Background color of the data label. - * @Default {null} - */ - fill?: string; - - /** Options for customizing the data label font. - */ - font?: SeriesMarkerDataLabelFont; - - /** Horizontal alignment of the data label. - * @Default {center} - */ - horizontalTextAlignment?: ej.datavisualization.Chart.HorizontalTextAlignment|string; - - /** Margin of the text to its background shape. The size of the background shape increases based on the margin applied to its text. - */ - margin?: SeriesMarkerDataLabelMargin; - - /** Opacity of the data label. - * @Default {1} - */ - opacity?: number; - - /** Background shape of the data label. - * @Default {No shape is rendered by default, so its value is ‘none’. See Shape} - */ - shape?: ej.datavisualization.Chart.Shape|string; - - /** Name of a field in data source where datalabel text is displayed. - */ - textMappingName?: string; - - /** Specifies the position of the data label. This property can be used only for the series such as column, bar, stacked column, stacked bar, 100% stacked column, 100% stacked bar, candle and OHLC. - * @Default {top. See TextPosition} - */ - textPosition?: ej.datavisualization.Chart.TextPosition|string; - - /** Vertical alignment of the data label. - * @Default {'center'} - */ - verticalTextAlignment?: ej.datavisualization.Chart.VerticalTextAlignment|string; - - /** Controls the visibility of the data labels. - * @Default {false} - */ - visible?: boolean; - - /** Custom template to format the data label content. Use “point.x” and “point.y” as a placeholder text to display the corresponding data point’s x and y value. - */ - template?: string; - - /** Moves the label vertically by some offset. - * @Default {0} - */ - offset?: number; -} - -export interface SeriesMarkerSize { - - /** Height of the marker. - * @Default {6} - */ - height?: number; - - /** Width of the marker. - * @Default {6} - */ - width?: number; -} - -export interface SeriesMarker { - - /** Options for customizing the border of the marker shape. - */ - border?: SeriesMarkerBorder; - - /** Options for displaying and customizing data labels. - */ - dataLabel?: SeriesMarkerDataLabel; - - /** Color of the marker shape. - * @Default {null} - */ - fill?: string; - - /** The URL for the Image that is to be displayed as marker. In order to display image as marker, set series.marker.shape as ‘image’. - */ - imageUrl?: string; - - /** Opacity of the marker. - * @Default {1} - */ - opacity?: number; - - /** Specifies the shape of the marker. - * @Default {circle. See Shape} - */ - shape?: ej.datavisualization.Chart.Shape|string; - - /** Options for customizing the size of the marker shape. - */ - size?: SeriesMarkerSize; - - /** Controls the visibility of the marker shape. - * @Default {false} - */ - visible?: boolean; -} - -export interface SeriesOutlierSettingsSize { - - /** Height of the outlier shape. - * @Default {6} - */ - height?: number; - - /** Width of the outlier shape. - * @Default {6} - */ - width?: number; -} - -export interface SeriesOutlierSettings { - - /** Specifies the shape of the outlier. - * @Default {circle. See Shape} - */ - shape?: ej.datavisualization.Chart.Shape|string; - - /** Options for customizing the size of the outlier shape. - */ - size?: SeriesOutlierSettingsSize; -} - -export interface SeriesEmptyPointSettingsStyleBorder { - - /** Border color of the empty point. - */ - color?: string; - - /** Border width of the empty point. - * @Default {1} - */ - width?: number; -} - -export interface SeriesEmptyPointSettingsStyle { - - /** Color of the empty point. - */ - color?: string; - - /** Options for customizing border of the empty point in the series. - */ - border?: SeriesEmptyPointSettingsStyleBorder; -} - -export interface SeriesEmptyPointSettings { - - /** Controls the visibility of the empty point. - * @Default {true} - */ - visible?: boolean; - - /** Specifies the mode of empty point. - * @Default {gap} - */ - displayMode?: ej.datavisualization.Chart.EmptyPointMode|string; - - /** Options for customizing the color and border of the empty point in the series. - */ - style?: SeriesEmptyPointSettingsStyle; -} - -export interface SeriesConnectorLine { - - /** Width of the connector line. - * @Default {1} - */ - width?: number; - - /** Color of the connector line. - * @Default {#565656} - */ - color?: string; - - /** DashArray of the connector line. - * @Default {null} - */ - dashArray?: string; - - /** Opacity of the connector line. - * @Default {1} - */ - opacity?: number; -} - -export interface SeriesDragSettings { - - /** drag/drop the series - * @Default {false} - */ - enable?: boolean; - - /** Specifies the type of drag settings. - * @Default {xy} - */ - type?: string; -} - -export interface SeriesErrorBarCap { - - /** Show/Hides the error bar cap. - * @Default {true} - */ - visible?: boolean; - - /** Width of the error bar cap. - * @Default {1} - */ - width?: number; - - /** Length of the error bar cap. - * @Default {1} - */ - length?: number; - - /** Color of the error bar cap. - * @Default {#000000} - */ - fill?: string; -} - -export interface SeriesErrorBar { - - /** Show/hides the error bar - * @Default {visible} - */ - visibility?: boolean; - - /** Specifies the type of error bar. - * @Default {FixedValue} - */ - type?: ej.datavisualization.Chart.ErrorBarType|string; - - /** Specifies the mode of error bar. - * @Default {vertical} - */ - mode?: ej.datavisualization.Chart.ErrorBarMode|string; - - /** Specifies the direction of error bar. - * @Default {both} - */ - direction?: ej.datavisualization.Chart.ErrorBarDirection|string; - - /** Value of vertical error bar. - * @Default {3} - */ - verticalErrorValue?: number; - - /** Value of horizontal error bar. - * @Default {1} - */ - horizontalErrorValue?: number; - - /** Value of positive horizontal error bar. - * @Default {1} - */ - horizontalPositiveErrorValue?: number; - - /** Value of negative horizontal error bar. - * @Default {1} - */ - horizontalNegativeErrorValue?: number; - - /** Value of positive vertical error bar. - * @Default {5} - */ - verticalPositiveErrorValue?: number; - - /** Value of negative vertical error bar. - * @Default {5} - */ - verticalNegativeErrorValue?: number; - - /** Fill color of the error bar. - * @Default {#000000} - */ - fill?: string; - - /** Width of the error bar. - * @Default {1} - */ - width?: number; - - /** Options for customizing the error bar cap. - */ - cap?: SeriesErrorBarCap; -} - -export interface SeriesPointsBorder { - - /** Border color of the point. - * @Default {null} - */ - color?: string; - - /** Border width of the point. - * @Default {null} - */ - width?: number; -} - -export interface SeriesPointsMarkerBorder { - - /** Border color of the marker shape. - * @Default {white} - */ - color?: string; - - /** Border width of the marker shape. - * @Default {3} - */ - width?: number; -} - -export interface SeriesPointsMarkerDataLabelBorder { - - /** Border color of the data label. - * @Default {null} - */ - color?: string; - - /** Border width of the data label. - * @Default {0.1} - */ - width?: number; -} - -export interface SeriesPointsMarkerDataLabelConnectorLine { - - /** Specifies when the connector has to be drawn as Bezier curve or straight line. This is applicable only for Pie and Doughnut chart types. - * @Default {line. See ConnectorLineType} - */ - type?: ej.datavisualization.Chart.ConnectorLineType|string; - - /** Width of the connector. - * @Default {0.5} - */ - width?: number; -} - -export interface SeriesPointsMarkerDataLabelFont { - - /** Font family of the data label. - * @Default {Segoe UI} - */ - fontFamily?: string; - - /** Font style of the data label. - * @Default {normal. See FontStyle} - */ - fontStyle?: ej.datavisualization.Chart.FontStyle|string; - - /** Font weight of the data label. - * @Default {regular. See FontWeight} - */ - fontWeight?: ej.datavisualization.Chart.FontWeight|string; - - /** Opacity of the text. - * @Default {1} - */ - opacity?: number; - - /** Font size of the data label. - * @Default {12px} - */ - size?: string; -} - -export interface SeriesPointsMarkerDataLabelMargin { - - /** Bottom margin of the text. - * @Default {5} - */ - bottom?: number; - - /** Left margin of the text. - * @Default {5} - */ - left?: number; - - /** Right margin of the text. - * @Default {5} - */ - right?: number; - - /** Top margin of the text. - * @Default {5} - */ - top?: number; -} - -export interface SeriesPointsMarkerDataLabel { - - /** Angle of the data label in degrees. Only the text gets rotated, whereas the background and border does not rotate. - * @Default {null} - */ - angle?: number; - - /** Options for customizing the border of the data label. - */ - border?: SeriesPointsMarkerDataLabelBorder; - - /** Options for displaying and customizing the line that connects point and data label. - */ - connectorLine?: SeriesPointsMarkerDataLabelConnectorLine; - - /** Background color of the data label. - * @Default {null} - */ - fill?: string; - - /** Options for customizing the data label font. - */ - font?: SeriesPointsMarkerDataLabelFont; - - /** Horizontal alignment of the data label. - * @Default {center} - */ - horizontalTextAlignment?: ej.datavisualization.Chart.HorizontalTextAlignment|string; - - /** Margin of the text to its background shape. The size of the background shape increases based on the margin applied to its text. - */ - margin?: SeriesPointsMarkerDataLabelMargin; - - /** Opacity of the data label. - * @Default {1} - */ - opacity?: number; - - /** Background shape of the data label. - * @Default {No shape is rendered by default, so its value is ‘none’. See Shape} - */ - shape?: ej.datavisualization.Chart.Shape|string; - - /** Specifies the position of the data label. This property can be used only for the series such as column, bar, stacked column, stacked bar, 100% stacked column, 100% stacked bar, candle and OHLC. - * @Default {top. See TextPosition} - */ - textPosition?: ej.datavisualization.Chart.TextPosition|string; - - /** Vertical alignment of the data label. - * @Default {'center'} - */ - verticalTextAlignment?: ej.datavisualization.Chart.VerticalTextAlignment|string; - - /** Controls the visibility of the data labels. - * @Default {false} - */ - visible?: boolean; - - /** Custom template to format the data label content. Use “point.x” and “point.y” as a placeholder text to display the corresponding data point’s x and y value. - */ - template?: string; - - /** Moves the label vertically by specified offset. - * @Default {0} - */ - offset?: number; -} - -export interface SeriesPointsMarkerSize { - - /** Height of the marker. - * @Default {6} - */ - height?: number; - - /** Width of the marker. - * @Default {6} - */ - width?: number; -} - -export interface SeriesPointsMarker { - - /** Options for customizing the border of the marker shape. - */ - border?: SeriesPointsMarkerBorder; - - /** Options for displaying and customizing data label. - */ - dataLabel?: SeriesPointsMarkerDataLabel; - - /** Color of the marker shape. - * @Default {null} - */ - fill?: string; - - /** The URL for the Image that is to be displayed as marker. In order to display image as marker, set series.marker.shape as ‘image’. - */ - imageUrl?: string; - - /** Opacity of the marker. - * @Default {1} - */ - opacity?: number; - - /** Specifies the shape of the marker. - * @Default {circle. See Shape} - */ - shape?: ej.datavisualization.Chart.Shape|string; - - /** Options for customizing the size of the marker shape. - */ - size?: SeriesPointsMarkerSize; - - /** Controls the visibility of the marker shape. - * @Default {false} - */ - visible?: boolean; -} - -export interface SeriesPoint { - - /** Options for customizing the border of a point. This is applicable only for column type series and accumulation type series. - */ - border?: SeriesPointsBorder; - - /** Enables or disables the visibility of legend item. - * @Default {visible} - */ - visibleOnLegend?: string; - - /** To show/hide the intermediate summary from the last intermediate point. - * @Default {false} - */ - showIntermediateSum?: boolean; - - /** To show/hide the total summary of the waterfall series. - * @Default {false} - */ - showTotalSum?: boolean; - - /** Close value of the point. Close value is applicable only for financial type series. - * @Default {null} - */ - close?: number; - - /** Size of a bubble in the bubble series. This is applicable only for the bubble series. - * @Default {null} - */ - size?: number; - - /** Background color of the point. This is applicable only for column type series and accumulation type series. - * @Default {null} - */ - fill?: string; - - /** High value of the point. High value is applicable only for financial type series, range area series and range column series. - * @Default {null} - */ - high?: number; - - /** Low value of the point. Low value is applicable only for financial type series, range area series and range column series. - * @Default {null} - */ - low?: number; - - /** Options for displaying and customizing marker for a data point. Marker contains shapes and/or data labels. - */ - marker?: SeriesPointsMarker; - - /** Open value of the point. This is applicable only for financial type series. - * @Default {null} - */ - open?: number; - - /** Datalabel text for the point. - * @Default {null} - */ - text?: string; - - /** X value of the point. - * @Default {null} - */ - x?: number; - - /** Y value of the point. - * @Default {null} - */ - y?: number; -} - -export interface SeriesCornerRadius { - - /** Specifies the radius for the top left corner. - * @Default {0} - */ - topLeft?: number; - - /** Specifies the radius for the top right corner. - * @Default {0} - */ - topRight?: number; - - /** Specifies the radius for the bottom left corner. - * @Default {0} - */ - bottomLeft?: number; - - /** Specifies the radius for the bottom right corner. - * @Default {0} - */ - bottomRight?: number; -} - -export interface SeriesTooltipBorder { - - /** Border Color of the tooltip. - * @Default {null} - */ - color?: string; - - /** Border Width of the tooltip. - * @Default {1} - */ - width?: number; -} - -export interface SeriesTooltip { - - /** Options for customizing the border of the tooltip. - */ - border?: SeriesTooltipBorder; - - /** Customize the corner radius of the tooltip rectangle. - * @Default {0} - */ - rx?: number; - - /** Customize the corner radius of the tooltip rectangle. - * @Default {0} - */ - ry?: number; - - /** Specifies the duration, the tooltip has to be displayed. - * @Default {500ms} - */ - duration?: string; - - /** Enables/disables the animation of the tooltip when moving from one point to another. - * @Default {true} - */ - enableAnimation?: boolean; - - /** Background color of the tooltip. - * @Default {null} - */ - fill?: string; - - /** Format of the tooltip content. - * @Default {#point.x# : #point.y#} - */ - format?: string; - - /** Opacity of the tooltip. - * @Default {0.95} - */ - opacity?: number; - - /** Custom template to format the tooltip content. Use “point.x” and “point.y” as a placeholder text to display the corresponding data point’s x and y value. - * @Default {null} - */ - template?: string; - - /** Controls the visibility of the tooltip. - * @Default {false} - */ - visible?: boolean; -} - -export interface SeriesTrendline { - - /** Show/hides the trendline. - */ - visibility?: boolean; - - /** Specifies the type of trendline for the series. - * @Default {linear. See TrendlinesType} - */ - type?: string; - - /** Name for the trendlines that is to be displayed in legend text. - * @Default {Trendline} - */ - name?: string; - - /** Fill color of the trendlines. - * @Default {#0000FF} - */ - fill?: string; - - /** Width of the trendlines. - * @Default {1} - */ - width?: number; - - /** Opacity of the trendline. - * @Default {1} - */ - opacity?: number; - - /** Pattern of dashes and gaps used to stroke the trendline. - */ - dashArray?: string; - - /** Future trends of the current series. - * @Default {0} - */ - forwardForecast?: number; - - /** Past trends of the current series. - * @Default {0} - */ - backwardForecast?: number; - - /** Specifies the order of polynomial trendlines. - * @Default {0} - */ - polynomialOrder?: number; - - /** Specifies the moving average starting period value. - * @Default {2} - */ - period?: number; -} - -export interface SeriesHighlightSettingsBorder { - - /** Border color of the series/point on highlight. - */ - color?: string; - - /** Border width of the series/point on highlight. - * @Default {2} - */ - width?: string; -} - -export interface SeriesHighlightSettings { - - /** Enables/disables the ability to highlight series or data point interactively. - * @Default {false} - */ - enable?: boolean; - - /** Specifies whether series or data point has to be highlighted. - * @Default {series. See Mode} - */ - mode?: ej.datavisualization.Chart.Mode|string; - - /** Color of the series/point on highlight. - */ - color?: string; - - /** Opacity of the series/point on highlight. - * @Default {0.6} - */ - opacity?: number; - - /** Options for customizing the border of series on highlight. - */ - border?: SeriesHighlightSettingsBorder; - - /** Specifies the pattern for the series/point on highlight. - * @Default {none. See Pattern} - */ - pattern?: string; - - /** Custom pattern for the series on highlight. - */ - customPattern?: string; -} - -export interface SeriesSelectionSettingsBorder { - - /** Border color of the series/point on selection. - */ - color?: string; - - /** Border width of the series/point on selection. - * @Default {2} - */ - width?: string; -} - -export interface SeriesSelectionSettings { - - /** Enables/disables the ability to select a series/data point interactively. - * @Default {false} - */ - enable?: boolean; - - /** Specifies whether series or data point has to be selected. - * @Default {series. See Mode} - */ - mode?: ej.datavisualization.Chart.Mode|string; - - /** Specifies the type of selection. - * @Default {single} - */ - type?: ej.datavisualization.Chart.SelectionType|string; - - /** Specifies the drawn rectangle type. - * @Default {xy} - */ - rangeType?: ej.datavisualization.Chart.RangeType|string; - - /** Color of the series/point on selection. - */ - color?: string; - - /** Opacity of the series/point on selection. - * @Default {0.6} - */ - opacity?: number; - - /** Options for customizing the border of series on selection. - */ - border?: SeriesSelectionSettingsBorder; - - /** Specifies the pattern for the series/point on selection. - * @Default {none. See Pattern} - */ - pattern?: string; - - /** Custom pattern for the series on selection. - */ - customPattern?: string; -} - -export interface Series { - - /** Color of the point, where the close is up in financial chart. - * @Default {null} - */ - bearFillColor?: string; - - /** Options for customizing the border of the series. - */ - border?: SeriesBorder; - - /** Color of the point, where the close is down in financial chart. - * @Default {null} - */ - bullFillColor?: string; - - /** To render the column and bar type series in rectangle/cylinder shape. See ColumnFacet - * @Default {rectangle} - */ - columnFacet?: ej.datavisualization.Chart.ColumnFacet|string; - - /** Relative width of the columns in column type series. Value ranges from 0 to 1. Width also depends upon columnSpacing property. - * @Default {0.7} - */ - columnWidth?: number; - - /** Spacing between columns of different series. Value ranges from 0 to 1 - * @Default {0} - */ - columnSpacing?: number; - - /** To group the series of stacking collection. - */ - stackingGroup?: string; - - /** Pattern of dashes and gaps used to stroke the line type series. - */ - dashArray?: string; - - /** Specifies the dataSource for the series. It can be an array of JSON objects or an instance of ej.DataManager. - * @Default {null} - */ - dataSource?: any; - - /** Controls the size of the hole in doughnut series. Value ranges from 0 to 1. - * @Default {0.4} - */ - doughnutCoefficient?: number; - - /** Controls the size of the doughnut series. Value ranges from 0 to 1. - * @Default {0.8} - */ - doughnutSize?: number; - - /** Type of series to be drawn in radar or polar series. - * @Default {line. See DrawType} - */ - drawType?: ej.datavisualization.Chart.DrawType|string; - - /** Enable/disable the animation of series. - * @Default {false} - */ - enableAnimation?: boolean; - - /** To avoid overlapping of data labels smartly. - * @Default {null} - */ - enableSmartLabels?: number; - - /** End angle of pie/doughnut series. For a complete circle, it has to be 360, by default. - * @Default {null} - */ - endAngle?: number; - - /** Explodes the pie/doughnut slices on mouse move. - * @Default {false} - */ - explode?: boolean; - - /** Explodes all the slice of pie/doughnut on render. - * @Default {null} - */ - explodeAll?: boolean; - - /** Index of the point to be exploded from pie/doughnut/pyramid/funnel. - * @Default {null} - */ - explodeIndex?: number; - - /** Specifies the distance of the slice from the center, when it is exploded. - * @Default {25} - */ - explodeOffset?: number; - - /** Fill color of the series. - * @Default {null} - */ - fill?: string; - - /** Options for customizing the series font. - */ - font?: SeriesFont; - - /** Specifies the height of the funnel in funnel series. Values can be in both pixel and percentage. - * @Default {32.7%} - */ - funnelHeight?: string; - - /** Specifies the width of the funnel in funnel series. Values can be in both pixel and percentage. - * @Default {11.6%} - */ - funnelWidth?: string; - - /** Gap between the slices of pyramid/funnel series. - * @Default {0} - */ - gapRatio?: number; - - /** Specifies whether to join start and end point of a line/area series used in polar/radar chart to form a closed path. - * @Default {true} - */ - isClosed?: boolean; - - /** Specifies whether to stack the column series in polar/radar charts. - * @Default {true} - */ - isStacking?: boolean; - - /** Renders the chart vertically. This is applicable only for Cartesian type series. - * @Default {false} - */ - isTransposed?: boolean; - - /** Render the x mark in the center of the boxplot series type.x represents the average value of the boxplot series. - * @Default {true} - */ - showMedian?: boolean; - - /** Position of the data label in pie/doughnut/pyramid/funnel series. OutsideExtended position is not applicable for pyramid/funnel. - * @Default {inside. See LabelPosition} - */ - labelPosition?: ej.datavisualization.Chart.LabelPosition|string; - - /** Quartile calculation has been performed in three different formulas to render the boxplot series . - * @Default {exclusive} - */ - boxPlotMode?: ej.datavisualization.Chart.LabelPosition|string; - - /** Specifies the line cap of the series. - * @Default {Butt. See LineCap} - */ - lineCap?: ej.datavisualization.Chart.LineCap|string; - - /** Specifies the type of shape to be used where two lines meet. - * @Default {Round. See LineJoin} - */ - lineJoin?: ej.datavisualization.Chart.LineJoin|string; - - /** Options for displaying and customizing marker for individual point in a series. Marker contains shapes and/or data labels. - */ - marker?: SeriesMarker; - - /** Name of the series, that is to be displayed in the legend. - * @Default {Add a comment to this line} - */ - name?: string; - - /** Opacity of the series. - * @Default {1} - */ - opacity?: number; - - /** Options for customizing the outlier of individual series. - */ - outlierSettings?: SeriesOutlierSettings; - - /** Name of a field in data source where fill color for all the data points is generated. - */ - palette?: string; - - /** Controls the size of pie series. Value ranges from 0 to 1. - * @Default {0.8} - */ - pieCoefficient?: number; - - /** Options for customizing the empty point in the series. - */ - emptyPointSettings?: SeriesEmptyPointSettings; - - /** Fill color for the positive column of the waterfall. - * @Default {null} - */ - positiveFill?: string; - - /** Options for customizing the waterfall connector line. - */ - connectorLine?: SeriesConnectorLine; - - /** Options to customize the drag and drop in series. - */ - dragSettings?: SeriesDragSettings; - - /** Options to customize the error bar in series. - */ - errorBar?: SeriesErrorBar; - - /** Option to add data points; each point should have x and y property. Also, optionally, you can customize the points color, border, marker by using fill, border and marker options. - */ - points?: SeriesPoint[]; - - /** Specifies the mode of the pyramid series. - * @Default {linear} - */ - pyramidMode?: ej.datavisualization.Chart.PyramidMode|string; - - /** Specifies ej.Query to select data from dataSource. This property is applicable only when the dataSource is ej.DataManager. - * @Default {null} - */ - query?: any; - - /** Start angle from where the pie/doughnut series renders. It starts from 0, by default. - * @Default {null} - */ - startAngle?: number; - - /** Options for customizing the corner radius. cornerRadius property also takes the numeric input and applies it for all the four corners of the column. - */ - cornerRadius?: SeriesCornerRadius; - - /** Options for customizing the tooltip of chart. - */ - tooltip?: SeriesTooltip; - - /** Specifies the type of the series to render in chart. - * @Default {column. see Type} - */ - type?: ej.datavisualization.Chart.Type|string; - - /** Controls the visibility of the series. - * @Default {visible} - */ - visibility?: string; - - /** Enables or disables the visibility of legend item. - * @Default {visible} - */ - visibleOnLegend?: string; - - /** Specifies the name of the x-axis that has to be associated with this series. Add an axis instance with this name to axes collection. - * @Default {null} - */ - xAxisName?: string; - - /** Name of the property in the datasource that contains x value for the series. - * @Default {null} - */ - xName?: string; - - /** Specifies the name of the y-axis that has to be associated with this series. Add an axis instance with this name to axes collection. - * @Default {null} - */ - yAxisName?: string; - - /** Name of the property in the datasource that contains y value for the series. - * @Default {null} - */ - yName?: string; - - /** Name of the property in the datasource that contains high value for the series. - * @Default {null} - */ - high?: string; - - /** Name of the property in the datasource that contains low value for the series. - * @Default {null} - */ - low?: string; - - /** Name of the property in the datasource that contains open value for the series. - * @Default {null} - */ - open?: string; - - /** Name of the property in the datasource that contains close value for the series. - * @Default {null} - */ - close?: string; - - /** Name of the property in the datasource that contains fill color for the series. - * @Default {null} - */ - pointColorMappingName?: string; - - /** Z-order of the series. - * @Default {0} - */ - zOrder?: number; - - /** Name of the property in the datasource that contains the size value for the bubble series. - * @Default {null} - */ - size?: string; - - /** Option to add trendlines to chart. - */ - trendlines?: SeriesTrendline[]; - - /** Options for customizing the appearance of the series or data point while highlighting. - */ - highlightSettings?: SeriesHighlightSettings; - - /** Options for customizing the appearance of the series/data point on selection. - */ - selectionSettings?: SeriesSelectionSettings; -} - -export interface Size { - - /** Height of the Chart. Height can be specified in either pixel or percentage. - * @Default {'450'} - */ - height?: string; - - /** Width of the Chart. Width can be specified in either pixel or percentage. - * @Default {'450'} - */ - width?: string; -} - -export interface TitleBorder { - - /** Width of the title border. - * @Default {1} - */ - width?: number; - - /** color of the title border. - * @Default {transparent} - */ - color?: string; - - /** opacity of the title border. - * @Default {0.8} - */ - opacity?: number; - - /** opacity of the title border. - * @Default {0.8} - */ - cornerRadius?: number; -} - -export interface TitleFont { - - /** Font family for Chart title. - * @Default {Segoe UI} - */ - fontFamily?: string; - - /** Font style for Chart title. - * @Default {Normal. See FontStyle} - */ - fontStyle?: ej.datavisualization.Chart.FontStyle|string; - - /** Font weight for Chart title. - * @Default {Regular. See FontWeight} - */ - fontWeight?: ej.datavisualization.Chart.FontWeight|string; - - /** Opacity of the Chart title. - * @Default {0.5} - */ - opacity?: number; - - /** Font size for Chart title. - * @Default {20px} - */ - size?: string; -} - -export interface TitleSubTitleFont { - - /** Font family of sub title. - * @Default {Segoe UI} - */ - fontFamily?: string; - - /** Font style for sub title. - * @Default {Normal. See FontStyle} - */ - fontStyle?: ej.datavisualization.Chart.FontStyle|string; - - /** Font weight for sub title. - * @Default {Regular. See FontWeight} - */ - fontWeight?: ej.datavisualization.Chart.FontWeight|string; - - /** Opacity of the sub title. - * @Default {1} - */ - opacity?: number; - - /** Font size for sub title. - * @Default {12px} - */ - size?: string; -} - -export interface TitleSubTitleBorder { - - /** Width of the subtitle border. - * @Default {1} - */ - width?: number; - - /** color of the subtitle border. - * @Default {transparent} - */ - color?: string; - - /** opacity of the subtitle border. - * @Default {0.8} - */ - opacity?: number; - - /** opacity of the subtitle border. - * @Default {0.8} - */ - cornerRadius?: number; -} - -export interface TitleSubTitle { - - /** Options for customizing the font of sub title. - */ - font?: TitleSubTitleFont; - - /** Background color for the chart subtitle. - * @Default {transparent} - */ - background?: string; - - /** Options to customize the border of the title. - */ - border?: TitleSubTitleBorder; - - /** Text to be displayed in sub title. - */ - text?: string; - - /** Alignment of sub title text. - * @Default {far. See TextAlignment} - */ - textAlignment?: ej.datavisualization.Chart.Alignment|string; -} - -export interface Title { - - /** Background color for the chart title. - * @Default {transparent} - */ - background?: string; - - /** Options to customize the border of the title. - */ - border?: TitleBorder; - - /** Options for customizing the font of Chart title. - */ - font?: TitleFont; - - /** Options to customize the sub title of Chart. - */ - subTitle?: TitleSubTitle; - - /** Text to be displayed in Chart title. - */ - text?: string; - - /** Alignment of the title text. - * @Default {Center. See TextAlignment} - */ - textAlignment?: ej.datavisualization.Chart.Alignment|string; -} - -export interface Zooming { - - /** Enables or disables zooming. - * @Default {false} - */ - enable?: boolean; - - /** Enables or disables pinch zooming. - * @Default {true} - */ - enablePinching?: boolean; - - /** Enable or disables the differed zooming. When it is enabled, chart is updated only on mouse up action while zooming and panning. - * @Default {false} - */ - enableDeferredZoom?: boolean; - - /** Enables/disables the ability to zoom the chart on moving the mouse wheel. - * @Default {false} - */ - enableMouseWheel?: boolean; - - /** Specifies whether to allow zooming the chart vertically or horizontally or in both ways. - * @Default {'x,y'} - */ - type?: string; - - /** Toggles the visibility of the scrollbar, which will be displayed while zooming. - * @Default {false} - */ - enableScrollbar?: boolean; - - /** To display user specified buttons in zooming toolbar. - * @Default {[zoomIn, zoomOut, zoom, pan, reset]} - */ - toolbarItems?: any[]; -} -} -namespace Chart { -enum CoordinateUnit { -//string -None, -//string -Pixels, -//string -Points, -} -} -namespace Chart { -enum HorizontalAlignment { -//string -Left, -//string -Right, -//string -Middle, -} -} -namespace Chart { -enum Region { -//string -Chart, -//string -Series, -} -} -namespace Chart { -enum VerticalAlignment { -//string -Top, -//string -Bottom, -//string -Middle, -} -} -namespace Chart { -enum ExportingType { -//string -PNG, -//string -JPG, -//string -PDF, -//string -DOCX, -//string -XLSX, -//string -SVG, -} -} -namespace Chart { -enum ExportingOrientation { -//string -Portrait, -//string -Landscape, -} -} -namespace Chart { -enum ExportingMode { -//string -ServerSide, -//string -ClientSide, -} -} -namespace Chart { -enum Unit { -//string -Percentage, -//string -Pixel, -} -} -namespace Chart { -enum ColumnFacet { -//string -Rectangle, -//string -Cylinder, -} -} -namespace Chart { -enum DrawType { -//string -Line, -//string -Area, -//string -Column, -} -} -namespace Chart { -enum FontStyle { -//string -Normal, -//string -Italic, -} -} -namespace Chart { -enum FontWeight { -//string -Regular, -//string -Bold, -//string -Lighter, -} -} -namespace Chart { -enum LabelPosition { -//string -Inside, -//string -Outside, -//string -OutsideExtended, -} -} -namespace Chart { -enum boxPlotMode { -//string -Exclusive, -//string -Inclusive, -//string -Normal, -} -} -namespace Chart { -enum LineCap { -//string -Butt, -//string -Round, -//string -Square, -} -} -namespace Chart { -enum LineJoin { -//string -Round, -//string -Bevel, -//string -Miter, -} -} -namespace Chart { -enum ConnectorLineType { -//string -Line, -//string -Bezier, -} -} -namespace Chart { -enum HorizontalTextAlignment { -//string -Center, -//string -Near, -//string -Far, -} -} -namespace Chart { -enum Shape { -//string -None, -//string -LeftArrow, -//string -RightArrow, -//string -Circle, -//string -Cross, -//string -HorizLine, -//string -VertLine, -//string -Diamond, -//string -Rectangle, -//string -Triangle, -//string -Hexagon, -//string -Pentagon, -//string -Star, -//string -Ellipse, -//string -Trapezoid, -//string -UpArrow, -//string -DownArrow, -//string -Image, -//string -SeriesType, -} -} -namespace Chart { -enum TextPosition { -//string -Top, -//string -Bottom, -//string -Middle, -} -} -namespace Chart { -enum VerticalTextAlignment { -//string -Center, -//string -Near, -//string -Far, -} -} -namespace Chart { -enum PyramidMode { -//string -Linear, -//string -Surface, -} -} -namespace Chart { -enum Type { -//string -Area, -//string -Line, -//string -Spline, -//string -Column, -//string -Scatter, -//string -Bubble, -//string -SplineArea, -//string -StepArea, -//string -StepLine, -//string -Pie, -//string -HiLo, -//string -HiLoOpenClose, -//string -Candle, -//string -Bar, -//string -StackingArea, -//string -StackingArea100, -//string -RangeColumn, -//string -StackingColumn, -//string -StackingColumn100, -//string -StackingBar, -//string -StackingBar100, -//string -Pyramid, -//string -Funnel, -//string -Doughnut, -//string -Polar, -//string -Radar, -//string -RangeArea, -} -} -namespace Chart { -enum EmptyPointMode { -//string -Gap, -//string -Zero, -//string -Average, -} -} -namespace Chart { -enum ErrorBarType { -//string -FixedValue, -//string -Percentage, -//string -StandardDeviation, -//string -StandardError, -} -} -namespace Chart { -enum ErrorBarMode { -//string -Both, -//string -Vertical, -//string -Horizontal, -} -} -namespace Chart { -enum ErrorBarDirection { -//string -Both, -//string -Plus, -//string -Minus, -} -} -namespace Chart { -enum Mode { -//string -Series, -//string -Point, -//string -Cluster, -//string -Range, -} -} -namespace Chart { -enum SelectionType { -//string -Single, -//string -Multiple, -} -} -namespace Chart { -enum RangeType { -//string -XY, -//string -X, -//string -Y, -} -} -namespace Chart { -enum CrosshairMode { -//string -Float, -//string -Grouping, -} -} -namespace Chart { -enum CrosshairType { -//string -Crosshair, -//string -Trackball, -} -} -namespace Chart { -enum Alignment { -//string -Center, -//string -Near, -//string -Far, -} -} -namespace Chart { -enum Position { -//string -Left, -//string -Right, -//string -Top, -//string -Bottom, -} -} -namespace Chart { -enum TextOverflow { -//string -None, -//string -Trim, -//string -Wrap, -//string -WrapAndTrim, -} -} -namespace Chart { -enum LabelPlacement { -//string -OnTicks, -//string -BetweenTicks, -} -} -namespace Chart { -enum EdgeLabelPlacement { -//string -None, -//string -Shift, -//string -Hide, -} -} -namespace Chart { -enum IntervalType { -//string -Days, -//string -Hours, -//string -Seconds, -//string -Milliseconds, -//string -Minutes, -//string -Months, -//string -Years, -} -} -namespace Chart { -enum LabelIntersectAction { -//string -None, -//string -Rotate90, -//string -Rotate45, -//string -Wrap, -//string -WrapByword, -//string -Trim, -//string -Hide, -//string -MultipleRows, -} -} -namespace Chart { -enum LabelAlignment { -//string -Near, -//string -Far, -//string -Center, -} -} -namespace Chart { -enum RangePadding { -//string -Additional, -//string -Normal, -//string -None, -//string -Round, -} -} -namespace Chart { -enum MultiLevelLabelsBorderType { -//string -Rectangle, -//string -None, -//string -WithoutTopAndBottom, -//string -Brace, -//string -CurlyBrace, -} -} -namespace Chart { -enum TextAlignment { -//string -MiddleTop, -//string -MiddleCenter, -//string -MiddleBottom, -} -} -namespace Chart { -enum ZIndex { -//string -Inside, -//string -Over, -} -} -namespace Chart { -enum TickLinesPosition { -//string -Inside, -//string -Outside, -} -} -namespace Chart { -enum ValueType { -//string -Double, -//string -Category, -//string -DateTime, -//string -Logarithmic, -} -} -namespace Chart { -enum Theme { -//string -Azure, -//string -FlatLight, -//string -FlatDark, -//string -Azuredark, -//string -Lime, -//string -LimeDark, -//string -Saffron, -//string -SaffronDark, -//string -GradientLight, -//string -GradientDark, -} -} - -class RangeNavigator extends ej.Widget { - static fn: RangeNavigator; - constructor(element: JQuery | Element, options?: RangeNavigator.Model); - static Locale: any; - model: RangeNavigator.Model; - defaults: RangeNavigator.Model; - - /** destroy the range navigator widget - * @returns {void} - */ - _destroy(): void; -} -export namespace RangeNavigator { - -export interface Model { - - /** Toggles the placement of slider exactly on the place it left or on the nearest interval. - * @Default {false} - */ - allowSnapping?: boolean; - - /** Options for customizing the color, opacity and width of the chart border. - */ - border?: Border; - - /** Specifies the data source for range navigator. - */ - dataSource?: any; - - /** Specifies the properties used for customizing the range series. - */ - series?: Series[]; - - /** Toggles the redrawing of chart on moving the sliders. - * @Default {true} - */ - enableDeferredUpdate?: boolean; - - /** Enable the scrollbar option in the rangenavigator. - * @Default {false} - */ - enableScrollbar?: boolean; - - /** Toggles the direction of rendering the range navigator control. - * @Default {false} - */ - enableRTL?: boolean; - - /** Sets a value whether to make the range navigator responsive on resize. - * @Default {false} - */ - isResponsive?: boolean; - - /** Options for customizing the labels colors, font, style, size, horizontalAlignment and opacity. - */ - labelSettings?: LabelSettings; - - /** This property is to specify the localization of range navigator. - * @Default {en-US} - */ - locale?: string; - - /** Options for customizing the range navigator. - */ - navigatorStyleSettings?: NavigatorStyleSettings; - - /** Padding specifies the gap between the container and the range navigator. - * @Default {0} - */ - padding?: string; - - /** If the range is not given explicitly, range will be calculated automatically. - * @Default {none} - */ - rangePadding?: ej.datavisualization.RangeNavigator.RangePadding|string; - - /** Options for customizing the starting and ending ranges. - */ - rangeSettings?: RangeSettings; - - /** selectedData is for getting the data when the "rangeChanged" event trigger from client side. - */ - selectedData?: any; - - /** Options for customizing the start and end range values. - */ - selectedRangeSettings?: SelectedRangeSettings; - - /** Options for rendering scrollbar based on the start and end range values. - */ - scrollRangeSettings?: ScrollRangeSettings; - - /** Contains property to customize the hight and width of range navigator. - */ - sizeSettings?: SizeSettings; - - /** By specifying this property the user can change the theme of the range navigator. - * @Default {null} - */ - theme?: string; - - /** Options for customizing the tooltip in range navigator. - */ - tooltipSettings?: TooltipSettings; - - /** Options for configuring minor grid lines, major grid lines, axis line of axis. - */ - valueAxisSettings?: ValueAxisSettings; - - /** You can plot data of type date time or numeric. This property determines the type of data that this axis will handle. - * @Default {datetime} - */ - valueType?: ej.datavisualization.RangeNavigator.ValueType|string; - - /** Specifies the xName for dataSource. This is used to take the x values from dataSource - */ - xName?: any; - - /** Specifies the yName for dataSource. This is used to take the y values from dataSource - */ - yName?: any; - - /** Fires on load of range navigator. */ - load?(e: LoadEventArgs): void; - - /** Fires after range navigator is loaded. */ - loaded?(e: LoadedEventArgs): void; - - /** Fires on changing the range of range navigator. */ - rangeChanged?(e: RangeChangedEventArgs): void; - - /** Fires on changing the scrollbar position of range navigator. */ - scrollChanged?(e: ScrollChangedEventArgs): void; - - /** Fires on when starting to change the scrollbar position of range navigator. */ - scrollStart?(e: ScrollStartEventArgs): void; - - /** Fires on changes ending the scrollbar position of range navigator. */ - scrollEnd?(e: ScrollEndEventArgs): void; -} - -export interface LoadEventArgs { - - /** parameters from range navigator - */ - Data?: any; - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the range navigator model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; -} - -export interface LoadedEventArgs { - - /** parameters from range navigator - */ - Data?: any; - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the range navigator model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; -} - -export interface RangeChangedEventArgs { - - /** parameters from range navigator - */ - Data?: any; - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the range navigator model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; -} - -export interface ScrollChangedEventArgs { - - /** parameters from RangeNavigator - */ - data?: any; - - /** returns the scrollbar position old start and end range value on changing scrollbar - */ - dataoldRange?: any; - - /** returns the scrollbar position new start and end range value on changing scrollbar - */ - datanewRange?: any; - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the RangeNavigator model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; -} - -export interface ScrollStartEventArgs { - - /** parameters from RangeNavigator - */ - data?: any; - - /** returns the scrollbar position starting range value on changing scrollbar - */ - datastartRange?: string; - - /** returns the scrollbar position end range value on changing scrollbar - */ - dataendRange?: string; - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the RangeNavigator model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; -} - -export interface ScrollEndEventArgs { - - /** parameters from RangeNavigator - */ - data?: any; - - /** returns the scrollbar position old start and end range value on change end of scrollbar - */ - dataoldRange?: any; - - /** returns the scrollbar position new start and end range value on change end of scrollbar - */ - datanewRange?: any; - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the RangeNavigator model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; -} - -export interface Border { - - /** Border color of rangenavigator. When enable the scrollbar, the default color will be set as "#B4B4B4". - * @Default {transparent} - */ - color?: string; - - /** Opacity of the rangeNavigator border. - * @Default {1} - */ - opacity?: number; - - /** Width of the RangeNavigator border. - * @Default {1} - */ - width?: number; -} - -export interface Series { - - /** Name of the property in the datasource that contains x value for the series. - * @Default {null} - */ - xName?: string; - - /** Name of the property in the datasource that contains y value for the series. - * @Default {null} - */ - yName?: string; - - /** Specifies the dataSource for the series. It can be an array of JSON objects or an instance of ej.DataManager. - * @Default {null} - */ - dataSource?: any; - - /** Specifies the type of the series to render in chart. - * @Default {column. see Type} - */ - type?: ej.datavisualization.RangeNavigator.Type|string; - - /** Enable/disable the animation of series. - * @Default {false} - */ - enableAnimation?: boolean; - - /** Fill color of the series. - * @Default {null} - */ - fill?: string; -} - -export interface LabelSettingsHigherLevelBorder { - - /** Specifies the border color of grid lines. - * @Default {transparent} - */ - color?: string; - - /** Specifies the border width of grid lines. - * @Default {0.5} - */ - width?: string; -} - -export interface LabelSettingsHigherLevelGridLineStyle { - - /** Specifies the color of grid lines in higher level. - * @Default {#B5B5B5} - */ - color?: string; - - /** Specifies the dashArray of grid lines in higher level. - * @Default {20 5 0} - */ - dashArray?: string; - - /** Specifies the width of grid lines in higher level. - * @Default {#B5B5B5} - */ - width?: string; -} - -export interface LabelSettingsHigherLevelStyleFont { - - /** Specifies the label font color. Labels render with the specified font color. - * @Default {black} - */ - color?: string; - - /** Specifies the label font family. Labels render with the specified font family. - * @Default {Segoe UI} - */ - fontFamily?: string; - - /** Specifies the label font style. Labels render with the specified font style. - * @Default {Normal} - */ - fontStyle?: string; - - /** Specifies the label font weight. Labels render with the specified font weight. - * @Default {regular} - */ - fontWeight?: string; - - /** Specifies the label opacity. Labels render with the specified opacity. - * @Default {1} - */ - opacity?: number; - - /** Specifies the label font size. Labels render with the specified font size. - * @Default {12px} - */ - size?: string; -} - -export interface LabelSettingsHigherLevelStyle { - - /** Options for customizing the font properties. - */ - font?: LabelSettingsHigherLevelStyleFont; - - /** Specifies the horizontal text alignment of the text in label. - * @Default {middle} - */ - horizontalAlignment?: string; -} - -export interface LabelSettingsHigherLevel { - - /** Options for customizing the border of grid lines in higher level. - */ - border?: LabelSettingsHigherLevelBorder; - - /** Specifies the fill color of higher level labels. - * @Default {transparent} - */ - fill?: string; - - /** Options for customizing the grid line colors, width, dashArray, border. - */ - gridLineStyle?: LabelSettingsHigherLevelGridLineStyle; - - /** Specifies the intervalType for higher level labels. See IntervalType - * @Default {auto} - */ - intervalType?: ej.datavisualization.RangeNavigator.IntervalType|string; - - /** Specifies the position of the labels to render either inside or outside of plot area - * @Default {outside} - */ - labelPlacement?: ej.datavisualization.RangeNavigator.LabelPlacement|string; - - /** Specifies the position of the labels in higher level - * @Default {top} - */ - position?: ej.datavisualization.RangeNavigator.Position|string; - - /** Options for customizing the style of higher level labels. - */ - style?: LabelSettingsHigherLevelStyle; - - /** Toggles the visibility of higher level labels. - * @Default {true} - */ - visible?: boolean; -} - -export interface LabelSettingsLowerLevelBorder { - - /** Specifies the border color of grid lines. - * @Default {transparent} - */ - color?: string; - - /** Specifies the border width of grid lines. - * @Default {0.5} - */ - width?: string; -} - -export interface LabelSettingsLowerLevelGridLineStyle { - - /** Specifies the color of grid lines in lower level. - * @Default {#B5B5B5} - */ - color?: string; - - /** Specifies the dashArray of gridLines in lowerLevel. - * @Default {20 5 0} - */ - dashArray?: string; - - /** Specifies the width of grid lines in lower level. - * @Default {#B5B5B5} - */ - width?: string; -} - -export interface LabelSettingsLowerLevelStyleFont { - - /** Specifies the color of labels. Label text render in this specified color. - * @Default {black} - */ - color?: string; - - /** Specifies the font family of labels. Label text render in this specified font family. - * @Default {Segoe UI} - */ - fontFamily?: string; - - /** Specifies the font style of labels. Label text render in this specified font style. - * @Default {Normal} - */ - fontStyle?: string; - - /** Specifies the font weight of labels. Label text render in this specified font weight. - * @Default {regular} - */ - fontWeight?: string; - - /** Specifies the opacity of labels. Label text render in this specified opacity. - * @Default {12px} - */ - opacity?: string; - - /** Specifies the size of labels. Label text render in this specified size. - * @Default {12px} - */ - size?: string; -} - -export interface LabelSettingsLowerLevelStyle { - - /** Options for customizing the font of labels. - */ - font?: LabelSettingsLowerLevelStyleFont; - - /** Specifies the horizontal text alignment of the text in label. - * @Default {middle} - */ - horizontalAlignment?: string; -} - -export interface LabelSettingsLowerLevel { - - /** Options for customizing the border of grid lines in lower level. - */ - border?: LabelSettingsLowerLevelBorder; - - /** Specifies the fill color of labels in lower level. - * @Default {transparent} - */ - fill?: string; - - /** Options for customizing the grid lines in lower level. - */ - gridLineStyle?: LabelSettingsLowerLevelGridLineStyle; - - /** Specifies the intervalType of the labels in lower level.See IntervalType - * @Default {auto} - */ - intervalType?: ej.datavisualization.RangeNavigator.IntervalType|string; - - /** Specifies the position of the labels to render either inside or outside of plot area. See LabelPlacement - * @Default {outside} - */ - labelPlacement?: ej.datavisualization.RangeNavigator.LabelPlacement|string; - - /** Specifies the position of the labels in lower level.See Position - * @Default {bottom} - */ - position?: ej.datavisualization.RangeNavigator.Position|string; - - /** Options for customizing the style of labels. - */ - style?: LabelSettingsLowerLevelStyle; - - /** Toggles the visibility of labels in lower level. - * @Default {true} - */ - visible?: boolean; -} - -export interface LabelSettingsStyleFont { - - /** Specifies the label color. This color is applied to the labels in range navigator. - * @Default {#FFFFFF} - */ - color?: string; - - /** Specifies the label font family. Labels render with the specified font family. - * @Default {Segoe UI} - */ - family?: string; - - /** Specifies the label font opacity. Labels render with the specified font opacity. - * @Default {1} - */ - opacity?: number; - - /** Specifies the label font size. Labels render with the specified font size. - * @Default {1px} - */ - size?: string; - - /** Specifies the label font style. Labels render with the specified font style.. - * @Default {Normal} - */ - style?: ej.datavisualization.RangeNavigator.FontStyle|string; - - /** Specifies the label font weight - * @Default {regular} - */ - weight?: ej.datavisualization.RangeNavigator.FontWeight|string; -} - -export interface LabelSettingsStyle { - - /** Options for customizing the font of labels in range navigator. - */ - font?: LabelSettingsStyleFont; - - /** Specifies the horizontalAlignment of the label in RangeNavigator - * @Default {middle} - */ - horizontalAlignment?: ej.datavisualization.RangeNavigator.HorizontalAlignment|string; -} - -export interface LabelSettings { - - /** Options for customizing the higher level labels in range navigator. - */ - higherLevel?: LabelSettingsHigherLevel; - - /** Options for customizing the labels in lower level. - */ - lowerLevel?: LabelSettingsLowerLevel; - - /** Options for customizing the style of labels in range navigator. - */ - style?: LabelSettingsStyle; -} - -export interface NavigatorStyleSettingsBorder { - - /** Specifies the border color of range navigator. - * @Default {transparent} - */ - color?: string; - - /** Specifies the dash array of range navigator. - * @Default {null} - */ - dashArray?: string; - - /** Specifies the border width of range navigator. - * @Default {0.5} - */ - width?: number; -} - -export interface NavigatorStyleSettingsMajorGridLineStyle { - - /** Specifies the color of major grid lines in range navigator. - * @Default {#B5B5B5} - */ - color?: string; - - /** Toggles the visibility of major grid lines. - * @Default {true} - */ - visible?: boolean; -} - -export interface NavigatorStyleSettingsMinorGridLineStyle { - - /** Specifies the color of minor grid lines in range navigator. - * @Default {#B5B5B5} - */ - color?: string; - - /** Toggles the visibility of minor grid lines. - * @Default {true} - */ - visible?: boolean; -} - -export interface NavigatorStyleSettingsHighlightSettingsBorder { - - /** To set the border color to the highlight. - * @Default {null} - */ - color?: string; - - /** To set the border width to the highlight. - * @Default {1} - */ - width?: number; -} - -export interface NavigatorStyleSettingsHighlightSettings { - - /** Enable the highlight settings in range navigator. - * @Default {false} - */ - enable?: boolean; - - /** To set the color to the highlight. - * @Default {null} - */ - color?: string; - - /** To set the opacity to the highlight. - * @Default {0.5} - */ - opacity?: number; - - /** Contains the border properties for highlighting rectangle. - */ - border?: NavigatorStyleSettingsHighlightSettingsBorder; -} - -export interface NavigatorStyleSettingsSelectionSettingsBorder { - - /** To set the border color to the selection. - * @Default {null} - */ - color?: string; - - /** To set the border width to the selection. - * @Default {1} - */ - width?: number; -} - -export interface NavigatorStyleSettingsSelectionSettings { - - /** Enable the selection settings in range navigator. - * @Default {false} - */ - enable?: boolean; - - /** To set the color to the selection. - * @Default {null} - */ - color?: string; - - /** To set the opacity to the selection. - * @Default {0.5} - */ - opacity?: number; - - /** Contains the border properties for selecting the rectangle. - */ - border?: NavigatorStyleSettingsSelectionSettingsBorder; -} - -export interface NavigatorStyleSettings { - - /** Specifies the background color of range navigator. - * @Default {#dddddd} - */ - background?: string; - - /** Options for customizing the border color and width of range navigator. - */ - border?: NavigatorStyleSettingsBorder; - - /** Specifies the left side thumb template in range navigator we can give either div id or HTML string - * @Default {null} - */ - leftThumbTemplate?: string; - - /** Options for customizing the major grid lines. - */ - majorGridLineStyle?: NavigatorStyleSettingsMajorGridLineStyle; - - /** Options for customizing the minor grid lines. - */ - minorGridLineStyle?: NavigatorStyleSettingsMinorGridLineStyle; - - /** Specifies the opacity of RangeNavigator. - * @Default {1} - */ - opacity?: number; - - /** Specifies the right side thumb template in range navigator we can give either div id or HTML string - * @Default {null} - */ - rightThumbTemplate?: string; - - /** Specifies the color of the selected region in range navigator. - * @Default {#EFEFEF} - */ - selectedRegionColor?: string; - - /** Specifies the opacity of Selected Region. - * @Default {0} - */ - selectedRegionOpacity?: number; - - /** Specifies the color of the thumb in range navigator. - * @Default {#2382C3} - */ - thumbColor?: string; - - /** Specifies the radius of the thumb in range navigator. - * @Default {10} - */ - thumbRadius?: number; - - /** Specifies the stroke color of the thumb in range navigator. - * @Default {#303030} - */ - thumbStroke?: string; - - /** Specifies the color of the unselected region in range navigator. - * @Default {#5EABDE} - */ - unselectedRegionColor?: string; - - /** Specifies the opacity of Unselected Region. - * @Default {0.3} - */ - unselectedRegionOpacity?: number; - - /** Contains the options for highlighting the range navigator on mouse over. - */ - highlightSettings?: NavigatorStyleSettingsHighlightSettings; - - /** Contains the options for selection the range navigator on mouse over. - */ - selectionSettings?: NavigatorStyleSettingsSelectionSettings; -} - -export interface RangeSettings { - - /** Specifies the ending range of range navigator. - * @Default {null} - */ - end?: string; - - /** Specifies the starting range of range navigator. - * @Default {null} - */ - start?: string; -} - -export interface SelectedRangeSettings { - - /** Specifies the ending range of range navigator. - * @Default {null} - */ - end?: string; - - /** Specifies the starting range of range navigator. - * @Default {null} - */ - start?: string; -} - -export interface ScrollRangeSettings { - - /** Specifies the ending range of range navigator scrollbar and that should be greater than the rangenavigator datasource end value. - * @Default {null} - */ - end?: string; - - /** Specifies the starting range of range navigator scrollbar and that should be less than the rangenavigator datasource start value. - * @Default {null} - */ - start?: string; -} - -export interface SizeSettings { - - /** Specifies height of the range navigator. - * @Default {null} - */ - height?: string; - - /** Specifies width of the range navigator. - * @Default {null} - */ - width?: string; -} - -export interface TooltipSettingsFont { - - /** Specifies the color of text in tooltip. Tooltip text render in the specified color. - * @Default {#FFFFFF} - */ - color?: string; - - /** Specifies the font family of text in tooltip. Tooltip text render in the specified font family. - * @Default {Segoe UI} - */ - family?: string; - - /** Specifies the font style of text in tooltip. Tooltip text render in the specified font style. - * @Default {ej.datavisualization.RangeNavigator.fontStyle.Normal} - */ - fontStyle?: string; - - /** Specifies the opacity of text in tooltip. Tooltip text render in the specified opacity. - * @Default {1} - */ - opacity?: number; - - /** Specifies the size of text in tooltip. Tooltip text render in the specified size. - * @Default {10px} - */ - size?: string; - - /** Specifies the weight of text in tooltip. Tooltip text render in the specified weight. - * @Default {ej.datavisualization.RangeNavigator.weight.Regular} - */ - weight?: string; -} - -export interface TooltipSettings { - - /** Specifies the background color of tooltip. - * @Default {#303030} - */ - backgroundColor?: string; - - /** Options for customizing the font in tooltip. - */ - font?: TooltipSettingsFont; - - /** Specifies the format of text to be displayed in tooltip. - * @Default {MM/dd/yyyy} - */ - labelFormat?: string; - - /** Specifies the mode of displaying the tooltip. Neither to display the tooltip always nor on demand. - * @Default {null} - */ - tooltipDisplayMode?: string; - - /** Toggles the visibility of tooltip. - * @Default {true} - */ - visible?: boolean; -} - -export interface ValueAxisSettingsAxisLine { - - /** Toggles the visibility of axis line. - * @Default {none} - */ - visible?: string; -} - -export interface ValueAxisSettingsFont { - - /** Text in axis render with the specified size. - * @Default {0px} - */ - size?: string; -} - -export interface ValueAxisSettingsMajorGridLines { - - /** Toggles the visibility of major grid lines. - * @Default {false} - */ - visible?: boolean; -} - -export interface ValueAxisSettingsMajorTickLines { - - /** Specifies the size of the majorTickLines in range navigator - * @Default {0} - */ - size?: number; - - /** Toggles the visibility of major tick lines. - * @Default {true} - */ - visible?: boolean; - - /** Specifies width of the major tick lines. - * @Default {0} - */ - width?: number; -} - -export interface ValueAxisSettings { - - /** Options for customizing the axis line. - */ - axisLine?: ValueAxisSettingsAxisLine; - - /** Options for customizing the font of the axis. - */ - font?: ValueAxisSettingsFont; - - /** Options for customizing the major grid lines. - */ - majorGridLines?: ValueAxisSettingsMajorGridLines; - - /** Options for customizing the major tick lines in axis. - */ - majorTickLines?: ValueAxisSettingsMajorTickLines; - - /** If the range is not given explicitly, range will be calculated automatically. You can customize the automatic range calculation using rangePadding. - * @Default {none} - */ - rangePadding?: string; - - /** Toggles the visibility of axis in range navigator. - * @Default {false} - */ - visible?: boolean; -} -} -namespace RangeNavigator { -enum Type { -//string -Area, -//string -Line, -//string -Spline, -//string -StepArea, -//string -SplineArea, -//string -StepLine, -} -} -namespace RangeNavigator { -enum IntervalType { -//string -Years, -//string -Quarters, -//string -Months, -//string -Weeks, -//string -Days, -//string -Hours, -//string -Minutes, -} -} -namespace RangeNavigator { -enum LabelPlacement { -//string -Inside, -//string -Outside, -} -} -namespace RangeNavigator { -enum Position { -//string -Top, -//string -Bottom, -} -} -namespace RangeNavigator { -enum FontStyle { -//string -Normal, -//string -Bold, -//string -Italic, -} -} -namespace RangeNavigator { -enum FontWeight { -//string -Regular, -//string -Lighter, -} -} -namespace RangeNavigator { -enum HorizontalAlignment { -//string -Middle, -//string -Left, -//string -Right, -} -} -namespace RangeNavigator { -enum RangePadding { -//string -Additional, -//string -Normal, -//string -None, -//string -Round, -} -} -namespace RangeNavigator { -enum ValueType { -//string -Numeric, -//string -DateTime, -} -} - -class BulletGraph extends ej.Widget { - static fn: BulletGraph; - constructor(element: JQuery | Element, options?: BulletGraph.Model); - static Locale: any; - model: BulletGraph.Model; - defaults: BulletGraph.Model; - - /** To destroy the bullet graph - * @returns {void} - */ - destroy(): void; - - /** To redraw the bullet graph - * @returns {void} - */ - redraw(): void; - - /** To set the value for comparative measure in bullet graph. - * @returns {void} - */ - setComparativeMeasureSymbol(): void; - - /** To set the value for feature measure bar. - * @returns {void} - */ - setFeatureMeasureBarValue(): void; -} -export namespace BulletGraph { - -export interface Model { - - /** Toggles the visibility of the range stroke color of the labels. - * @Default {false} - */ - applyRangeStrokeToLabels?: boolean; - - /** Toggles the visibility of the range stroke color of the ticks. - * @Default {false} - */ - applyRangeStrokeToTicks?: boolean; - - /** Contains property to customize the caption in bullet graph. - */ - captionSettings?: CaptionSettings; - - /** Comparative measure bar in bullet graph render till the specified value. - * @Default {0} - */ - comparativeMeasureValue?: number; - - /** Toggles the animation of bullet graph. - * @Default {true} - */ - enableAnimation?: boolean; - - /** Specifies the direction of flow in bullet graph. Neither it may be backward nor forward. - * @Default {forward} - */ - flowDirection?: ej.datavisualization.BulletGraph.FlowDirection|string; - - /** Specifies the height of the bullet graph. - * @Default {90} - */ - height?: number; - - /** Sets a value whether to make the bullet graph responsive on resize. - * @Default {true} - */ - isResponsive?: boolean; - - /** Bullet graph will render in the specified orientation. - * @Default {horizontal} - */ - orientation?: ej.datavisualization.BulletGraph.Orientation|string; - - /** Contains property to customize the qualitative ranges. - */ - qualitativeRanges?: QualitativeRange[]; - - /** Size of the qualitative range depends up on the specified value. - * @Default {32} - */ - qualitativeRangeSize?: number; - - /** Length of the quantitative range depends up on the specified value. - * @Default {475} - */ - quantitativeScaleLength?: number; - - /** Contains all the properties to customize quantitative scale. - */ - quantitativeScaleSettings?: QuantitativeScaleSettings; - - /** By specifying this property the user can change the theme of the bullet graph. - * @Default {flatlight} - */ - theme?: string; - - /** Contains all the properties to customize tooltip. - */ - tooltipSettings?: TooltipSettings; - - /** Feature measure bar in bullet graph render till the specified value. - * @Default {0} - */ - value?: number; - - /** Specifies the width of the bullet graph. - * @Default {595} - */ - width?: number; - - /** Fires on rendering the caption of bullet graph. */ - drawCaption?(e: DrawCaptionEventArgs): void; - - /** Fires on rendering the category. */ - drawCategory?(e: DrawCategoryEventArgs): void; - - /** Fires on rendering the comparative measure symbol. */ - drawComparativeMeasureSymbol?(e: DrawComparativeMeasureSymbolEventArgs): void; - - /** Fires on rendering the feature measure bar. */ - drawFeatureMeasureBar?(e: DrawFeatureMeasureBarEventArgs): void; - - /** Fires on rendering the indicator of bullet graph. */ - drawIndicator?(e: DrawIndicatorEventArgs): void; - - /** Fires on rendering the labels. */ - drawLabels?(e: DrawLabelsEventArgs): void; - - /** Fires on rendering the qualitative ranges. */ - drawQualitativeRanges?(e: DrawQualitativeRangesEventArgs): void; - - /** Fires on loading bullet graph. */ - load?(e: LoadEventArgs): void; -} - -export interface DrawCaptionEventArgs { - - /** returns the object of the bullet graph. - */ - Object?: any; - - /** returns the options of the scale element. - */ - scaleElement?: HTMLElement; - - /** returns the current captionSettings element. - */ - captionElement?: HTMLElement; - - /** returns the type of the captionSettings. - */ - captionType?: string; -} - -export interface DrawCategoryEventArgs { - - /** returns the object of the bullet graph. - */ - Object?: any; - - /** returns the options of the scale element. - */ - scaleElement?: HTMLElement; - - /** returns the options of category element. - */ - categoryElement?: HTMLElement; - - /** returns the text value of the category that is drawn. - */ - Value?: string; -} - -export interface DrawComparativeMeasureSymbolEventArgs { - - /** returns the object of the bullet graph. - */ - Object?: any; - - /** returns the options of the scale element. - */ - scaleElement?: HTMLElement; - - /** returns the options of comparative measure element. - */ - targetElement?: HTMLElement; - - /** returns the value of the comparative measure symbol. - */ - Value?: number; -} - -export interface DrawFeatureMeasureBarEventArgs { - - /** returns the object of the bullet graph. - */ - Object?: any; - - /** returns the options of the scale element. - */ - scaleElement?: HTMLElement; - - /** returns the options of feature measure element. - */ - currentElement?: HTMLElement; - - /** returns the value of the feature measure bar. - */ - Value?: number; -} - -export interface DrawIndicatorEventArgs { - - /** returns an object to customize bullet graph indicator text and symbol before rendering it. - */ - indicatorSettings?: any; - - /** returns the object of bullet graph. - */ - model?: any; - - /** returns the type of event. - */ - type?: string; - - /** for canceling the event. - */ - cancel?: boolean; -} - -export interface DrawLabelsEventArgs { - - /** returns the object of the bullet graph. - */ - Object?: any; - - /** returns the options of the scale element. - */ - scaleElement?: HTMLElement; - - /** returns the current label element. - */ - tickElement?: HTMLElement; - - /** returns the label type. - */ - labelType?: string; -} - -export interface DrawQualitativeRangesEventArgs { - - /** returns the object of the bullet graph. - */ - Object?: any; - - /** returns the index of current range. - */ - rangeIndex?: number; - - /** returns the settings for current range. - */ - rangeOptions?: any; - - /** returns the end value of current range. - */ - rangeEndValue?: number; -} - -export interface LoadEventArgs { - /** Returns the cancel option value. - */ - cancel?: boolean; -} - -export interface CaptionSettingsFont { - - /** Specifies the color of the text in caption. - * @Default {null} - */ - color?: string; - - /** Specifies the fontFamily of caption. Caption text render with this fontFamily - * @Default {Segoe UI} - */ - fontFamily?: string; - - /** Specifies the fontStyle of caption - * @Default {Normal} - */ - fontStyle?: ej.datavisualization.BulletGraph.FontStyle|string; - - /** Specifies the fontWeight of caption - * @Default {regular} - */ - fontWeight?: ej.datavisualization.BulletGraph.FontWeight|string; - - /** Specifies the opacity of caption. Caption text render with this opacity. - * @Default {1} - */ - opacity?: number; - - /** Specifies the size of caption. Caption text render with this size - * @Default {12px} - */ - size?: string; -} - -export interface CaptionSettingsIndicatorFont { - - /** Specifies the color of the indicator's text. - * @Default {null} - */ - color?: string; - - /** Specifies the fontFamily of indicator. Indicator text render with this fontFamily. - * @Default {Segoe UI} - */ - fontFamily?: string; - - /** Specifies the fontStyle of indicator. Indicator text render with this fontStyle. See FontStyle - * @Default {Normal} - */ - fontStyle?: ej.datavisualization.BulletGraph.FontStyle|string; - - /** Specifies the fontWeight of indicator. Indicator text render with this fontWeight. See FontWeight - * @Default {regular} - */ - fontWeight?: ej.datavisualization.BulletGraph.FontWeight|string; - - /** Specifies the opacity of indicator text. Indicator text render with this Opacity. - * @Default {1} - */ - opacity?: number; - - /** Specifies the size of indicator. Indicator text render with this size. - * @Default {12px} - */ - size?: string; -} - -export interface CaptionSettingsIndicatorLocation { - - /** Specifies the horizontal position of the indicator. - * @Default {10} - */ - x?: number; - - /** Specifies the vertical position of the indicator. - * @Default {60} - */ - y?: number; -} - -export interface CaptionSettingsIndicatorSymbolBorder { - - /** Specifies the border color of indicator symbol. - * @Default {null} - */ - color?: string; - - /** Specifies the border width of indicator symbol. - * @Default {1} - */ - width?: number; -} - -export interface CaptionSettingsIndicatorSymbolSize { - - /** Specifies the height of indicator symbol. - * @Default {10} - */ - height?: number; - - /** Specifies the width of indicator symbol. - * @Default {10} - */ - width?: number; -} - -export interface CaptionSettingsIndicatorSymbol { - - /** Contains property to customize the border of indicator symbol. - */ - border?: CaptionSettingsIndicatorSymbolBorder; - - /** Specifies the color of indicator symbol. - * @Default {null} - */ - color?: string; - - /** Specifies the URL of image that represents indicator symbol. - */ - imageURL?: string; - - /** Specifies the opacity of indicator symbol. - * @Default {1} - */ - opacity?: number; - - /** Specifies the shape of indicator symbol. - */ - shape?: string; - - /** Contains property to customize the size of indicator symbol. - */ - size?: CaptionSettingsIndicatorSymbolSize; -} - -export interface CaptionSettingsIndicator { - - /** Contains property to customize the font of indicator. - */ - font?: CaptionSettingsIndicatorFont; - - /** Contains property to customize the location of indicator. - */ - location?: CaptionSettingsIndicatorLocation; - - /** Specifies the padding to be applied when text position is used. - * @Default {2} - */ - padding?: number; - - /** Contains property to customize the symbol of indicator. - */ - symbol?: CaptionSettingsIndicatorSymbol; - - /** Specifies the text to be displayed as indicator text. By default difference between current value and target will be displayed - */ - text?: string; - - /** Specifies the alignment of indicator with respect to scale based on text position - * @Default {'Near'} - */ - textAlignment?: ej.datavisualization.BulletGraph.TextAlignment|string; - - /** Specifies where indicator text should be anchored when indicator overlaps with other caption group text. Text will be anchored when overlapping caption group text are at same position. - * Anchoring is not applicable for float position. - * @Default {'start'} - */ - textAnchor?: ej.datavisualization.BulletGraph.TextAnchor|string; - - /** indicator text render in the specified angle. - * @Default {0} - */ - textAngle?: number; - - /** Specifies where indicator should be placed - * @Default {'float'} - */ - textPosition?: ej.datavisualization.BulletGraph.TextPosition|string; - - /** Specifies the space between indicator symbol and text. - * @Default {3} - */ - textSpacing?: number; - - /** Specifies whether indicator will be visible or not. - * @Default {false} - */ - visible?: boolean; -} - -export interface CaptionSettingsLocation { - - /** Specifies the position in horizontal direction - * @Default {17} - */ - x?: number; - - /** Specifies the position in horizontal direction - * @Default {30} - */ - y?: number; -} - -export interface CaptionSettingsSubTitleFont { - - /** Specifies the color of the subtitle's text. - * @Default {null} - */ - color?: string; - - /** Specifies the fontFamily of subtitle. Subtitle text render with this fontFamily. - * @Default {Segoe UI} - */ - fontFamily?: string; - - /** Specifies the fontStyle of subtitle. Subtitle text render with this fontStyle. See FontStyle - * @Default {Normal} - */ - fontStyle?: ej.datavisualization.BulletGraph.FontStyle|string; - - /** Specifies the fontWeight of subtitle. Subtitle text render with this fontWeight. See FontWeight - * @Default {regular} - */ - fontWeight?: ej.datavisualization.BulletGraph.FontWeight|string; - - /** Specifies the opacity of subtitle. Subtitle text render with this opacity. - * @Default {1} - */ - opacity?: number; - - /** Specifies the size of subtitle. Subtitle text render with this size. - * @Default {12px} - */ - size?: string; -} - -export interface CaptionSettingsSubTitleLocation { - - /** Specifies the horizontal position of the subtitle. - * @Default {10} - */ - x?: number; - - /** Specifies the vertical position of the subtitle. - * @Default {45} - */ - y?: number; -} - -export interface CaptionSettingsSubTitle { - - /** Contains property to customize the font of subtitle. - */ - font?: CaptionSettingsSubTitleFont; - - /** Contains property to customize the location of subtitle. - */ - location?: CaptionSettingsSubTitleLocation; - - /** Specifies the padding to be applied when text position is used. - * @Default {5} - */ - padding?: number; - - /** Specifies the text to be displayed as subtitle. - */ - text?: string; - - /** Specifies the alignment of sub title text with respect to scale. Alignment will not be applied in float position. - * @Default {'Near'} - */ - textAlignment?: ej.datavisualization.BulletGraph.TextAlignment|string; - - /** Specifies where subtitle text should be anchored when sub title text overlaps with other caption group text. Text will be anchored when overlapping - * caption group text are at same position. Anchoring is not applicable for float position. - * @Default {'start'} - */ - textAnchor?: ej.datavisualization.BulletGraph.TextAnchor|string; - - /** Subtitle render in the specified angle. - * @Default {0} - */ - textAngle?: number; - - /** Specifies where sub title text should be placed. - * @Default {'float'} - */ - textPosition?: ej.datavisualization.BulletGraph.TextPosition|string; -} - -export interface CaptionSettings { - - /** Specifies whether trim the labels will be true or false. - * @Default {true} - */ - enableTrim?: boolean; - - /** Contains property to customize the font of caption. - */ - font?: CaptionSettingsFont; - - /** Contains property to customize the indicator. - */ - indicator?: CaptionSettingsIndicator; - - /** Contains property to customize the location. - */ - location?: CaptionSettingsLocation; - - /** Specifies the padding to be applied when text position is used. - * @Default {5} - */ - padding?: number; - - /** Contains property to customize the subtitle. - */ - subTitle?: CaptionSettingsSubTitle; - - /** Specifies the text to be displayed on bullet graph. - */ - text?: string; - - /** Specifies the alignment of caption text with respect to scale. This property will not be applied when text position is float. - * @Default {'Near'} - */ - textAlignment?: ej.datavisualization.BulletGraph.TextAlignment|string; - - /** Specifies caption text anchoring when caption text overlaps with other caption group text. - * Text will be anchored when overlapping caption group text are at same position. Anchoring is not applicable for float position. - * @Default {'start'} - */ - textAnchor?: ej.datavisualization.BulletGraph.TextAnchor|string; - - /** Specifies the angel in which the caption is rendered. - * @Default {0} - */ - textAngle?: number; - - /** Specifies how caption text should be placed. - * @Default {'float'} - */ - textPosition?: ej.datavisualization.BulletGraph.TextPosition|string; -} - -export interface QualitativeRange { - - /** Specifies the ending range to which the qualitative ranges will render. - * @Default {3} - */ - rangeEnd?: number; - - /** Specifies the opacity for the qualitative ranges. - * @Default {1} - */ - rangeOpacity?: number; - - /** Specifies the stroke for the qualitative ranges. - * @Default {null} - */ - rangeStroke?: string; -} - -export interface QuantitativeScaleSettingsComparativeMeasureSettings { - - /** Specifies the stroke of the comparative measure. - * @Default {null} - */ - stroke?: number; - - /** Specifies the width of the comparative measure. - * @Default {5} - */ - width?: number; -} - -export interface QuantitativeScaleSettingsFeaturedMeasureSettings { - - /** Specifies the Stroke of the featured measure in bullet graph. - * @Default {null} - */ - stroke?: number; - - /** Specifies the width of the featured measure in bullet graph. - * @Default {2} - */ - width?: number; -} - -export interface QuantitativeScaleSettingsFeatureMeasure { - - /** Specifies the category of feature measure. - * @Default {null} - */ - category?: string; - - /** Comparative measure render till the specified value. - * @Default {null} - */ - comparativeMeasureValue?: number; - - /** Feature measure render till the specified value. - * @Default {null} - */ - value?: number; -} - -export interface QuantitativeScaleSettingsFields { - - /** Specifies the category of the bullet graph. - * @Default {null} - */ - category?: string; - - /** Comparative measure render based on the values in the specified field. - * @Default {null} - */ - comparativeMeasure?: string; - - /** Specifies the dataSource for the bullet graph. - * @Default {null} - */ - dataSource?: any; - - /** Feature measure render based on the values in the specified field. - * @Default {null} - */ - featureMeasures?: string; - - /** Specifies the query for fetching the values form data source to render the bullet graph. - * @Default {null} - */ - query?: string; - - /** Specifies the name of the table. - * @Default {null} - */ - tableName?: string; -} - -export interface QuantitativeScaleSettingsLabelSettingsFont { - - /** Specifies the fontFamily of labels in bullet graph. Labels render with this fontFamily. - * @Default {Segoe UI} - */ - fontFamily?: string; - - /** Specifies the fontStyle of labels in bullet graph. Labels render with this fontStyle. See FontStyle - * @Default {Normal} - */ - fontStyle?: ej.datavisualization.BulletGraph.FontStyle|string; - - /** Specifies the fontWeight of labels in bullet graph. Labels render with this fontWeight. See FontWeight - * @Default {regular} - */ - fontWeight?: ej.datavisualization.BulletGraph.FontWeight|string; - - /** Specifies the opacity of labels in bullet graph. Labels render with this opacity - * @Default {1} - */ - opacity?: number; -} - -export interface QuantitativeScaleSettingsLabelSettings { - - /** Contains property to customize the font of the labels in bullet graph. - */ - font?: QuantitativeScaleSettingsLabelSettingsFont; - - /** Specifies the placement of labels in bullet graph scale. - * @Default {outside} - */ - labelPlacement?: ej.datavisualization.BulletGraph.LabelPlacement|string; - - /** Specifies the prefix to be added with labels in bullet graph. - * @Default {Empty string} - */ - labelPrefix?: string; - - /** Specifies the suffix to be added after labels in bullet graph. - * @Default {Empty string} - */ - labelSuffix?: string; - - /** Specifies the horizontal/vertical padding of labels. - * @Default {15} - */ - offset?: number; - - /** Specifies the position of the labels to render either above or below the graph. See Position - * @Default {below} - */ - position?: ej.datavisualization.BulletGraph.LabelPosition|string; - - /** Specifies the Size of the labels. - * @Default {12} - */ - size?: number; - - /** Specifies the stroke color of the labels in bullet graph. - * @Default {null} - */ - stroke?: string; -} - -export interface QuantitativeScaleSettingsLocation { - - /** This property specifies the x position for rendering quantitative scale. - * @Default {10} - */ - x?: number; - - /** This property specifies the y position for rendering quantitative scale. - * @Default {10} - */ - y?: number; -} - -export interface QuantitativeScaleSettingsMajorTickSettings { - - /** Specifies the size of the major ticks. - * @Default {13} - */ - size?: number; - - /** Specifies the stroke color of the major tick lines. - * @Default {null} - */ - stroke?: string; - - /** Specifies the width of the major tick lines. - * @Default {2} - */ - width?: number; -} - -export interface QuantitativeScaleSettingsMinorTickSettings { - - /** Specifies the size of minor ticks. - * @Default {7} - */ - size?: number; - - /** Specifies the stroke color of minor ticks in bullet graph. - * @Default {null} - */ - stroke?: string; - - /** Specifies the width of the minor ticks in bullet graph. - * @Default {2} - */ - width?: number; -} - -export interface QuantitativeScaleSettings { - - /** Contains property to customize the comparative measure. - */ - comparativeMeasureSettings?: QuantitativeScaleSettingsComparativeMeasureSettings; - - /** Contains property to customize the featured measure. - */ - featuredMeasureSettings?: QuantitativeScaleSettingsFeaturedMeasureSettings; - - /** Contains property to customize the featured measure. - */ - featureMeasures?: QuantitativeScaleSettingsFeatureMeasure[]; - - /** Contains property to customize the fields. - */ - fields?: QuantitativeScaleSettingsFields; - - /** Specifies the interval for the Graph. - * @Default {1} - */ - interval?: number; - - /** Contains property to customize the labels. - */ - labelSettings?: QuantitativeScaleSettingsLabelSettings; - - /** Contains property to customize the position of the quantitative scale - */ - location?: QuantitativeScaleSettingsLocation; - - /** Contains property to customize the major tick lines. - */ - majorTickSettings?: QuantitativeScaleSettingsMajorTickSettings; - - /** Specifies the maximum value of the Graph. - * @Default {10} - */ - maximum?: number; - - /** Specifies the minimum value of the Graph. - * @Default {0} - */ - minimum?: number; - - /** Contains property to customize the minor ticks. - */ - minorTickSettings?: QuantitativeScaleSettingsMinorTickSettings; - - /** The specified number of minor ticks will be rendered per interval. - * @Default {4} - */ - minorTicksPerInterval?: number; - - /** Specifies the placement of ticks to render either inside or outside the scale. - * @Default {ej.datavisualization.BulletGraph.TickPlacement.Outside} - */ - tickPlacement?: ej.datavisualization.BulletGraph.TickPlacement|string; - - /** Specifies the position of the ticks to render either above,below or inside - * @Default {ej.datavisualization.BulletGraph.TickPosition.Far} - */ - tickPosition?: ej.datavisualization.BulletGraph.TickPosition|string; -} - -export interface TooltipSettings { - - /** Specifies template for caption tooltip - * @Default {null} - */ - captionTemplate?: string; - - /** Toggles the visibility of caption tooltip - * @Default {false} - */ - enableCaptionTooltip?: boolean; - - /** Specifies the ID of a div, which is to be displayed as tooltip. - * @Default {null} - */ - template?: string; - - /** Toggles the visibility of tooltip - * @Default {true} - */ - visible?: boolean; -} -} -namespace BulletGraph { -enum FontStyle { -//string -Normal, -//string -Italic, -//string -Oblique, -} -} -namespace BulletGraph { -enum FontWeight { -//string -Normal, -//string -Bold, -//string -Bolder, -//string -Lighter, -} -} -namespace BulletGraph { -enum TextAlignment { -//string -Near, -//string -Far, -//string -Center, -} -} -namespace BulletGraph { -enum TextAnchor { -//string -Start, -//string -Middle, -//string -End, -} -} -namespace BulletGraph { -enum TextPosition { -//string -Top, -//string -Right, -//string -Left, -//string -Bottom, -//string -Float, -} -} -namespace BulletGraph { -enum FlowDirection { -//string -Forward, -//string -Backward, -} -} -namespace BulletGraph { -enum Orientation { -//string -Horizontal, -//string -Vertical, -} -} -namespace BulletGraph { -enum LabelPlacement { -//string -Inside, -//string -Outside, -} -} -namespace BulletGraph { -enum LabelPosition { -//string -Above, -//string -Below, -} -} -namespace BulletGraph { -enum TickPlacement { -//string -Inside, -//string -Outside, -} -} -namespace BulletGraph { -enum TickPosition { -//string -Below, -//string -Above, -//string -Cross, -} -} - -class Barcode extends ej.Widget { - static fn: Barcode; - constructor(element: JQuery | Element, options?: Barcode.Model); - static Locale: any; - model: Barcode.Model; - defaults: Barcode.Model; - - /** To disable the barcode - * @returns {void} - */ - disable(): void; - - /** To enable the barcode - * @returns {void} - */ - enable(): void; -} -export namespace Barcode { - -export interface Model { - - /** Specifies the distance between the barcode and text below it. - */ - barcodeToTextGapHeight?: number; - - /** Specifies the height of bars in the Barcode. By modifying the barHeight, the entire barcode height can be customized. - * Please refer to xDimension for two dimensional barcode height customization. - */ - barHeight?: number; - - /** Specifies the dark bar color of the Barcode. One dimensional barcode contains a series of dark and light bars which are usually colored as black and white respectively. - */ - darkBarColor?: any; - - /** Specifies whether the text below the barcode is visible or hidden. - */ - displayText?: boolean; - - /** Specifies whether the control is enabled. - */ - enabled?: boolean; - - /** Specifies the start and stop encode symbol in the Barcode. In one dimensional barcodes, an additional character is added as start and stop delimiters. - * These symbols are optional and the unique of the symbol allows the reader to determine the direction of the barcode being scanned. - */ - encodeStartStopSymbol?: number; - - /** Specifies the light bar color of the Barcode. One dimensional barcode contains a series of dark and light bars which are usually colored as black and white respectively. - */ - lightBarColor?: any; - - /** Specifies the width of the narrow bars in the barcode. The dark bars in the one dimensional barcode contains random narrow and wide bars based on - * the provided input which can be specified during initialization. - */ - narrowBarWidth?: number; - - /** Specifies the width of the quiet zone. In barcode, a quiet zone is the blank margin on either side of a barcode which informs the reader where a barcode's symbology starts and stops. - * The purpose of a quiet zone is to prevent the reader from picking up unrelated information. - */ - quietZone?: QuietZone; - - /** Specifies the type of the Barcode. See SymbologyType - */ - symbologyType?: ej.datavisualization.Barcode.SymbologyType|string; - - /** Specifies the text to be encoded in the barcode. - */ - text?: string; - - /** Specifies the color of the text/data at the bottom of the barcode. - */ - textColor?: any; - - /** Specifies the width of the wide bars in the barcode. One dimensional barcode usually contains random narrow and wide bars based on the provided which can be customized during initialization. - */ - wideBarWidth?: number; - - /** Specifies the width of the narrowest element(bar or space) in a barcode. The greater the x dimension, the more easily a barcode reader will scan. - */ - xDimension?: number; - - /** Fires after Barcode control is loaded. */ - load?(e: LoadEventArgs): void; -} - -export interface LoadEventArgs { - - /** if the event should be canceled; otherwise, false. - */ - cancel?: boolean; - - /** returns the barcode model - */ - model?: any; - - /** returns the name of the event - */ - type?: string; - - /** return the barcode state - */ - status?: boolean; -} - -export interface QuietZone { - - /** Specifies the quiet zone around the Barcode. - */ - all?: number; - - /** Specifies the bottom quiet zone of the Barcode. - */ - bottom?: number; - - /** Specifies the left quiet zone of the Barcode. - */ - left?: number; - - /** Specifies the right quiet zone of the Barcode. - */ - right?: number; - - /** Specifies the top quiet zone of the Barcode. - */ - top?: number; -} -} -namespace Barcode { -enum SymbologyType { -//Represents the QR code -QRBarcode, -//Represents the Data Matrix barcode -DataMatrix, -//Represents the Code 39 barcode -Code39, -//Represents the Code 39 Extended barcode -Code39Extended, -//Represents the Code 11 barcode -Code11, -//Represents the Codabar barcode -Codabar, -//Represents the Code 32 barcode -Code32, -//Represents the Code 93 barcode -Code93, -//Represents the Code 93 Extended barcode -Code93Extended, -//Represents the Code 128 A barcode -Code128A, -//Represents the Code 128 B barcode -Code128B, -//Represents the Code 128 C barcode -Code128C, -} -} - -class Map extends ej.Widget { - static fn: Map; - constructor(element: JQuery | Element, options?: Map.Model); - static Locale: any; - model: Map.Model; - defaults: Map.Model; - - /** Method for navigating to specific shape based on latitude, longitude and zoom level. - * @param {number} Pass the latitude value for map - * @param {number} Pass the longitude value for map - * @param {number} Pass the zoom level for map - * @returns {void} - */ - navigateTo(latitude: number, longitude: number, level: number): void; - - /** Method to perform map panning - * @param {string} Pass the direction in which map should be panned - * @returns {void} - */ - pan(direction: string): void; - - /** Method to reload the map. - * @returns {void} - */ - refresh(): void; - - /** Method to reload the shapeLayers with updated values - * @returns {void} - */ - refreshLayers(): void; - - /** Method to reload the navigation control with updated values. - * @param {any} Pass the navigation control instance - * @returns {void} - */ - refreshNavigationControl(navigation: any): void; - - /** Method to perform map zooming. - * @param {number} Pass the zoom level for map to be zoomed - * @param {boolean} Pass the boolean value to enable or disable animation while zooming - * @returns {void} - */ - zoom(level: number, isAnimate: boolean): void; -} -export namespace Map { - -export interface Model { - - /** Specifies the background color for map - * @Default {transparent} - */ - background?: string; - - /** Specifies the index of the map to determine the shape layer to be displayed - * @Default {0} - */ - baseMapIndex?: number; - - /** Specify the center position where map should be displayed - * @Default {[0,0]} - */ - centerPosition?: any; - - /** Enables or Disables the map animation - * @Default {false} - */ - enableAnimation?: boolean; - - /** Enables or Disables the animation for layer change in map - * @Default {false} - */ - enableLayerChangeAnimation?: boolean; - - /** Enables or Disables the map panning - * @Default {true} - */ - enablePan?: boolean; - - /** Determines whether map need to resize when container is resized - * @Default {true} - */ - enableResize?: boolean; - - /** Enables or Disables the Zooming for map. - */ - zoomSettings?: ZoomSettings; - - /** Enables or Disables the navigation control for map to perform zooming and panning on map shapes. - */ - navigationControl?: NavigationControl; - - /** Layer for holding the map shapes - */ - layers?: Layer[]; - - /** Triggered on selecting the map markers. */ - markerSelected?(e: MarkerSelectedEventArgs): void; - - /** Triggers while leaving the hovered map shape */ - mouseleave?(e: MouseleaveEventArgs): void; - - /** Triggers while hovering the map shape. */ - mouseover?(e: MouseoverEventArgs): void; - - /** Triggers once map render completed. */ - onRenderComplete?(e: OnRenderCompleteEventArgs): void; - - /** Triggers when map panning ends. */ - panned?(e: PannedEventArgs): void; - - /** Triggered on selecting the map shapes. */ - shapeSelected?(e: ShapeSelectedEventArgs): void; - - /** Triggered when map is zoomed-in. */ - zoomedIn?(e: ZoomedInEventArgs): void; - - /** Triggers when map is zoomed out. */ - zoomedOut?(e: ZoomedOutEventArgs): void; -} - -export interface MarkerSelectedEventArgs { - - /** Returns marker object. - */ - originalEvent?: any; -} - -export interface MouseleaveEventArgs { - - /** Returns hovered map shape object. - */ - originalEvent?: any; -} - -export interface MouseoverEventArgs { - - /** Returns hovered map shape object. - */ - originalEvent?: any; -} - -export interface OnRenderCompleteEventArgs { - - /** Event parameters from map - */ - originalEvent?: any; -} - -export interface PannedEventArgs { - - /** Event parameters from map - */ - originalEvent?: any; -} - -export interface ShapeSelectedEventArgs { - - /** Returns selected shape object. - */ - originalEvent?: any; -} - -export interface ZoomedInEventArgs { - - /** Event parameters from map - */ - originalEvent?: any; - - /** Returns zoom level value for which the map is zoomed. - */ - zoomLevel?: any; -} - -export interface ZoomedOutEventArgs { - - /** Event parameters from map - */ - originalEvent?: any; - - /** Returns zoom level value for which the map is zoomed. - */ - zoomLevel?: any; -} - -export interface ZoomSettings { - - /** Enables or Disables the zooming of map - * @Default {true} - */ - enableZoom?: boolean; - - /** Enables or Disables the zoom on selecting the map shape - * @Default {false} - */ - enableZoomOnSelection?: boolean; - - /** Specifies the zoom factor for map zoom value. - * @Default {1} - */ - factor?: number; - - /** Specifies the zoom level value for which map to be zoomed - * @Default {1} - */ - level?: number; - - /** Specifies the minimum zoomSettings level of the map - * @Default {1} - */ - minValue?: number; - - /** Specifies the maximum zoom level of the map - * @Default {100} - */ - maxValue?: number; -} - -export interface NavigationControl { - - /** Set the absolutePosition for navigation control - * @Default {{x:0,y:0}} - */ - absolutePosition?: any; - - /** Specifies the navigation control template for map - * @Default {null} - */ - content?: string; - - /** Set the dockPosition value for navigation control - * @Default {centerleft} - */ - dockPosition?: ej.datavisualization.Map.Position|string; - - /** Enables or Disables the Navigation for handling zooming map - * @Default {false} - */ - enableNavigation?: boolean; - - /** Set the orientation value for navigation control - * @Default {vertical} - */ - orientation?: ej.datavisualization.Map.LabelOrientation|string; -} - -export interface LayersBubbleSettingsColorMappingsRangeColorMapping { - - /** Start range colorMappings in the bubble layer. - * @Default {null} - */ - from?: number; - - /** End range colorMappings in the bubble layer. - * @Default {null} - */ - to?: number; - - /** GradientColors in the bubble layer of map. - */ - gradientColors?: any[]; - - /** Color of the bubble layer. - * @Default {null} - */ - color?: string; -} - -export interface LayersBubbleSettingsColorMappings { - - /** Specifies the range colorMappings in the bubble layer. - * @Default {null} - */ - rangeColorMapping?: LayersBubbleSettingsColorMappingsRangeColorMapping[]; -} - -export interface LayersBubbleSettings { - - /** Specifies the bubble Opacity value of bubbles for shape layer in map - * @Default {0.9} - */ - bubbleOpacity?: number; - - /** Specifies the mouse hover color of the shape layer in map - * @Default {gray} - */ - color?: string; - - /** Specifies the colorMappings of the shape layer in map - * @Default {null} - */ - colorMappings?: LayersBubbleSettingsColorMappings; - - /** Specifies the bubble color valuePath of the shape layer in map - * @Default {null} - */ - colorValuePath?: string; - - /** Specifies the maximum size value of bubbles for shape layer in map - * @Default {20} - */ - maxValue?: number; - - /** Specifies the minimum size value of bubbles for shape layer in map - * @Default {10} - */ - minValue?: number; - - /** Specifies the showBubble visibility status map - * @Default {true} - */ - showBubble?: boolean; - - /** Specifies the tooltip visibility status of the shape layer in map - * @Default {false} - */ - showTooltip?: boolean; - - /** Specifies the bubble tooltip template of the shape layer in map - * @Default {null} - */ - tooltipTemplate?: string; - - /** Specifies the bubble valuePath of the shape layer in map - * @Default {null} - */ - valuePath?: string; -} - -export interface LayersLabelSettings { - - /** enable or disable the enableSmartLabel property - * @Default {false} - */ - enableSmartLabel?: boolean; - - /** set the labelLength property - * @Default {'2'} - */ - labelLength?: number; - - /** set the labelPath property - * @Default {null} - */ - labelPath?: string; - - /** The property specifies whether to show labels or not. - * @Default {false} - */ - showLabels?: boolean; - - /** set the smartLabelSize property - * @Default {fixed} - */ - smartLabelSize?: ej.datavisualization.Map.LabelSize|string; -} - -export interface LayersLegendSettings { - - /** Determines whether the legend should be placed outside or inside the map bounds - * @Default {false} - */ - dockOnMap?: boolean; - - /** Determines the legend placement and it is valid only when dockOnMap is true - * @Default {top} - */ - dockPosition?: ej.datavisualization.Map.DockPosition|string; - - /** height value for legend setting - * @Default {0} - */ - height?: number; - - /** to get icon value for legend setting - * @Default {rectangle} - */ - icon?: ej.datavisualization.Map.LegendIcons|string; - - /** icon height value for legend setting - * @Default {20} - */ - iconHeight?: number; - - /** icon Width value for legend setting - * @Default {20} - */ - iconWidth?: number; - - /** set the orientation of legend labels - * @Default {vertical} - */ - labelOrientation?: ej.datavisualization.Map.LabelOrientation|string; - - /** to get leftLabel value for legend setting - * @Default {null} - */ - leftLabel?: string; - - /** to get mode of legend setting - * @Default {default} - */ - mode?: ej.datavisualization.Map.Mode|string; - - /** set the position of legend settings - * @Default {topleft} - */ - position?: ej.datavisualization.Map.Position|string; - - /** x position value for legend setting - * @Default {0} - */ - positionX?: number; - - /** y position value for legend setting - * @Default {0} - */ - positionY?: number; - - /** to get rightLabel value for legend setting - * @Default {null} - */ - rightLabel?: string; - - /** Enables or Disables the showLabels - * @Default {false} - */ - showLabels?: boolean; - - /** Enables or Disables the showLegend - * @Default {false} - */ - showLegend?: boolean; - - /** to get title of legend setting - * @Default {null} - */ - title?: string; - - /** to get type of legend setting - * @Default {layers} - */ - type?: ej.datavisualization.Map.LegendType|string; - - /** width value for legend setting - * @Default {0} - */ - width?: number; -} - -export interface LayersShapeSettingsColorMappingsRangeColorMapping { - - /** Specifies the start range colorMappings in the shape layer of map. - * @Default {null} - */ - from?: number; - - /** Specifies the to range colorMappings in the shape layer of map. - * @Default {null} - */ - to?: number; - - /** Specifies the gradientColors in the shape layer of map. - * @Default {null} - */ - gradientColors?: any[]; -} - -export interface LayersShapeSettingsColorMappingsEqualColorMapping { - - /** Specifies the equalColorMapping value in the shape layer of map. - * @Default {null} - */ - value?: string; - - /** Specifies the equalColorMapping color in the shape layer of map. - * @Default {null} - */ - color?: string; -} - -export interface LayersShapeSettingsColorMappings { - - /** Specifies the range colorMappings in the shape layer of map. - * @Default {null} - */ - rangeColorMapping?: LayersShapeSettingsColorMappingsRangeColorMapping[]; - - /** Specifies the equalColorMapping in the shape layer of map. - * @Default {null} - */ - equalColorMapping?: LayersShapeSettingsColorMappingsEqualColorMapping[]; -} - -export interface LayersShapeSettings { - - /** Enables or Disables the auto fill colors for shape layer in map. When this property value set to true, shapes will be filled with palette colors. - * @Default {false} - */ - autoFill?: boolean; - - /** Specifies the colorMappings of the shape layer in map - * @Default {null} - */ - colorMappings?: LayersShapeSettingsColorMappings; - - /** Specifies the shape color palette value of the shape layer in map. Accepted colorPalette values are palette1, palette2, palette3 and custompalette. - * @Default {palette1} - */ - colorPalette?: ej.datavisualization.Map.ColorPalette|string; - - /** Specifies the shape color valuePath of the shape layer in map - * @Default {null} - */ - colorValuePath?: string; - - /** Enables or Disables the gradient colors for map shapes. - * @Default {false} - */ - enableGradient?: boolean; - - /** Specifies the shape fill color of the shape layer in map - * @Default {#E5E5E5} - */ - fill?: string; - - /** Specifies the mouse over width of the shape layer in map - * @Default {1} - */ - highlightBorderWidth?: number; - - /** Specifies the mouse hover color of the shape layer in map - * @Default {gray} - */ - highlightColor?: string; - - /** Specifies the mouse over stroke color of the shape layer in map - * @Default {#C1C1C1} - */ - highlightStroke?: string; - - /** Specifies the shape selection color of the shape layer in map - * @Default {gray} - */ - selectionColor?: string; - - /** Specifies the shape selection stroke color of the shape layer in map - * @Default {#C1C1C1} - */ - selectionStroke?: string; - - /** Specifies the shape selection stroke width of the shape layer in map - * @Default {1} - */ - selectionStrokeWidth?: number; - - /** Specifies the shape stroke color of the shape layer in map - * @Default {#C1C1C1} - */ - stroke?: string; - - /** Specifies the shape stroke thickness value of the shape layer in map - * @Default {0.2} - */ - strokeThickness?: number; - - /** Specifies the shape valuePath of the shape layer in map - * @Default {null} - */ - valuePath?: string; -} - -export interface Layer { - - /** to get the type of bing map. - * @Default {aerial} - */ - bingMapType?: ej.datavisualization.Map.BingMapType|string; - - /** Specifies the bubble settings for map - */ - bubbleSettings?: LayersBubbleSettings; - - /** Specifies the datasource for the shape layer - */ - dataSource?: any; - - /** Specifies the data path of shape - */ - shapeDataPath?: string; - - /** Specifies the data path of shape - */ - shapePropertyPath?: string; - - /** Enables or disables the shape mouse hover - * @Default {false} - */ - enableMouseHover?: boolean; - - /** Enables or disables the shape selection - * @Default {true} - */ - enableSelection?: boolean; - - /** to get the key of bing map - * @Default {null} - */ - key?: string; - - /** Options for enabling and configuring labelSettings labelPath, smartLabelSize, labelLength etc., - */ - labelSettings?: LayersLabelSettings; - - /** Specifies the map type. - * @Default {'geometry'} - */ - layerType?: ej.datavisualization.Map.LayerType|string; - - /** Options for enabling and configuring legendSettings position, height, width, mode, type etc., - */ - legendSettings?: LayersLegendSettings; - - /** Specifies the map items template for shapes. - */ - mapItemsTemplate?: string; - - /** Specify markers for shape layer. - * @Default {[]} - */ - markers?: any[]; - - /** Specifies the map marker template for map layer. - * @Default {null} - */ - markerTemplate?: string; - - /** Specify selectedMapShapes for shape layer - * @Default {[]} - */ - selectedMapShapes?: any[]; - - /** Specifies the selection mode of the map. Accepted selection mode values are Default and Multiple. - * @Default {default} - */ - selectionMode?: ej.datavisualization.Map.SelectionMode|string; - - /** Specifies the shape data for the shape layer - */ - shapeData?: any; - - /** Specifies the shape settings of map layer - */ - shapeSettings?: LayersShapeSettings; - - /** Shows or hides the map items. - * @Default {false} - */ - showMapItems?: boolean; - - /** Shows or hides the tooltip for shapes - * @Default {false} - */ - showTooltip?: boolean; - - /** Specifies the tooltip template for shapes. - */ - tooltipTemplate?: string; - - /** Specifies the URL template for the OSM type map. - * @Default {'http://a.tile.openstreetmap.org/level/tileX/tileY.png'} - */ - urlTemplate?: string; -} -} -namespace Map { -enum Position { -//specifies the none position -None, -//specifies the topleft position -Topleft, -//specifies the topcenter position -Topcenter, -//specifies the topright position -Topright, -//specifies the centerleft position -Centerleft, -//specifies the center position -Center, -//specifies the centerright position -Centerright, -//specifies the bottomleft position -Bottomleft, -//specifies the bottomcenter position -Bottomcenter, -//specifies the bottomright position -Bottomright, -} -} -namespace Map { -enum LabelOrientation { -//specifies the horizontal position -Horizontal, -//specifies the vertical position -Vertical, -} -} -namespace Map { -enum BingMapType { -//specifies the aerial type -Aerial, -//specifies the aerialwithlabel type -Aerialwithlabel, -//specifies the road type -Road, -} -} -namespace Map { -enum LabelSize { -//specifies the fixed size -Fixed, -//specifies the default size -Default, -} -} -namespace Map { -enum LayerType { -//specifies the geometry type -Geometry, -//specifies the osm type -Osm, -//specifies the bing type -Bing, -} -} -namespace Map { -enum DockPosition { -//specifies the top position -Top, -//specifies the bottom position -Bottom, -//specifies the bottom position -Right, -//specifies the left position -Left, -} -} -namespace Map { -enum LegendIcons { -//specifies the rectangle position -Rectangle, -//specifies the circle position -Circle, -} -} -namespace Map { -enum Mode { -//specifies the default mode -Default, -//specifies the interactive mode -Interactive, -} -} -namespace Map { -enum LegendType { -//specifies the layers type -Layers, -//specifies the bubbles type -Bubbles, -} -} -namespace Map { -enum SelectionMode { -//specifies the default position -Default, -//specifies the multiple position -Multiple, -} -} -namespace Map { -enum ColorPalette { -//specifies the palette1 color -Palette1, -//specifies the palette2 color -Palette2, -//specifies the palette3 color -Palette3, -//specifies the custom color -Custompalette, -} -} - -class TreeMap extends ej.Widget { - static fn: TreeMap; - constructor(element: JQuery | Element, options?: TreeMap.Model); - static Locale: any; - model: TreeMap.Model; - defaults: TreeMap.Model; - - /** Method to reload treemap with updated values. - * @returns {void} - */ - refresh(): void; -} -export namespace TreeMap { - -export interface Model { - - /** Specifies the border brush color of the treemap - * @Default {white} - */ - borderBrush?: string; - - /** Specifies the border thickness of the treemap - * @Default {1} - */ - borderThickness?: number; - - /** Specifies the uniColorMapping settings of the treemap - */ - uniColorMapping?: UniColorMapping; - - /** Specifies the desaturationColorMapping settings of the treemap - */ - desaturationColorMapping?: DesaturationColorMapping; - - /** Specifies the paletteColorMapping of the treemap - */ - paletteColorMapping?: PaletteColorMapping; - - /** Specifies the color value path of the treemap - * @Default {null} - */ - colorValuePath?: string; - - /** Specifies the datasource of the treemap - * @Default {null} - */ - dataSource?: any; - - /** Specifies the dockPosition for legend - * @Default {top} - */ - dockPosition?: ej.datavisualization.TreeMap.DockPosition|string; - - /** specifies the drillDown header color - * @Default {'null'} - */ - drillDownHeaderColor?: string; - - /** specifies the drillDown selection color - * @Default {'#000000'} - */ - drillDownSelectionColor?: string; - - /** Specifies whether datasource is hierarchical or not. - * @Default {false} - */ - isHierarchicalDatasource?: boolean; - - /** Specifies the header for parent item during drilldown. This is applicable only for hierarchical data source. - * @Default {null} - */ - header?: string; - - /** Enable/Disable the drillDown for treemap - * @Default {false} - */ - enableDrillDown?: boolean; - - /** Controls whether Treemap has to be responsive while resizing the window. - * @Default {true} - */ - isResponsive?: boolean; - - /** Specifies whether treemap need to resize when container is resized - * @Default {true} - */ - enableResize?: boolean; - - /** This property is used to select treemap items while clicking and dragging - * @Default {false} - */ - draggingOnSelection?: boolean; - - /** This property is used to select group of treemap items while clicking and dragging - * @Default {false} - */ - draggingGroupOnSelection?: boolean; - - /** Specifies the group color mapping of the treemap - * @Default {[]} - */ - groupColorMapping?: GroupColorMapping[]; - - /** Specifies the legend settings of the treemap - */ - legendSettings?: LegendSettings; - - /** Specifies the highlight border brush of treemap - * @Default {gray} - */ - highlightBorderBrush?: string; - - /** Specifies the border thickness when treemap items is highlighted in the treemap - * @Default {5} - */ - highlightBorderThickness?: number; - - /** Specifies the highlight border brush of treemap - * @Default {gray} - */ - highlightGroupBorderBrush?: string; - - /** Specifies the border thickness when treemap items is highlighted in the treemap - * @Default {5} - */ - highlightGroupBorderThickness?: number; - - /** Specifies whether treemap item need to highlighted on selection - * @Default {false} - */ - highlightGroupOnSelection?: boolean; - - /** Specifies whether treemap item need to highlighted on selection - * @Default {false} - */ - highlightOnSelection?: boolean; - - /** Specifies the items layout mode of the treemap. Accepted itemsLayoutMode values are Squarified, SliceAndDiceHorizontal, SliceAndDiceVertical and SliceAndDiceAuto - * @Default {Squarified} - */ - itemsLayoutMode?: ej.datavisualization.TreeMap.ItemsLayoutMode|string; - - /** Specifies the leaf settings of the treemap - */ - leafItemSettings?: LeafItemSettings; - - /** Specifies the rangeColorMapping settings of the treemap - * @Default {[]} - */ - rangeColorMapping?: RangeColorMapping[]; - - /** Specifies the selection mode of treemap item. Accepted selection mode values are Default and Multiple. - * @Default {default} - */ - selectionMode?: ej.datavisualization.TreeMap.selectionMode|string; - - /** Specifies the selection mode of the treemap. Accepted selection mode values are Default and Multiple. - * @Default {default} - */ - groupSelectionMode?: ej.datavisualization.TreeMap.groupSelectionMode|string; - - /** Specifies the legend visibility status of the treemap - * @Default {false} - */ - showLegend?: boolean; - - /** Specifies whether gradient color has to be applied for treemap items - * @Default {false} - */ - enableGradient?: boolean; - - /** Specifies whether treemap showTooltip need to be visible - */ - showTooltip?: boolean; - - /** Specifies the tooltip template of the treemap - * @Default {null} - */ - tooltipTemplate?: string; - - /** Hold the treeMapItems to be displayed in treemap - * @Default {[]} - */ - treeMapItems?: any[]; - - /** Specify levels of treemap for grouped visualization of data - * @Default {[]} - */ - levels?: Level[]; - - /** Specifies the weight value path of the treemap - * @Default {null} - */ - weightValuePath?: string; - - /** Triggers on treemap item selected. */ - treeMapItemSelected?(e: TreeMapItemSelectedEventArgs): void; -} - -export interface TreeMapItemSelectedEventArgs { - - /** Returns selected treeMapItem object. - */ - originalEvent?: any; -} - -export interface UniColorMapping { - - /** Specifies the uniform color mapping of the treemap - * @Default {null} - */ - color?: string; -} - -export interface DesaturationColorMapping { - - /** Specifies the to value for desaturation color mapping - * @Default {0} - */ - to?: number; - - /** Specifies the color for desaturationColorMapping - * @Default {null} - */ - color?: string; - - /** Specifies the from value for desaturation color mapping - * @Default {0} - */ - from?: number; - - /** Specifies the rangeMaximum value for desaturation color mapping - * @Default {0} - */ - rangeMaximum?: number; - - /** Specifies the rangeMinimum value for desaturation color mapping - * @Default {0} - */ - rangeMinimum?: number; -} - -export interface PaletteColorMapping { - - /** Specifies the colors of the paletteColorMapping - * @Default {[]} - */ - colors?: any[]; -} - -export interface GroupColorMapping { - - /** Specifies the groupID for GroupColorMapping. - * @Default {null} - */ - groupID?: string; -} - -export interface LegendSettings { - - /** Specifies the height for legend - * @Default {30} - */ - height?: number; - - /** Specifies the width for legend - * @Default {100} - */ - width?: number; - - /** Specifies the iconHeight for legend - * @Default {15} - */ - iconHeight?: number; - - /** Specifies the iconWidth for legend - * @Default {15} - */ - iconWidth?: number; - - /** Specifies the template for legendSettings - * @Default {null} - */ - template?: string; - - /** Specifies the mode for legendSettings whether default or interactive mode - * @Default {default} - */ - mode?: string; - - /** Specifies the title text for legend - */ - title?: string; - - /** Specifies the leftLabel text for legend - */ - leftLabel?: string; - - /** Specifies the rightLabel text for legend - */ - rightLabel?: string; - - /** Specifies the dockPosition text for legend - * @Default {top} - */ - dockPosition?: string; - - /** Specifies the alignment text for legend - * @Default {near} - */ - alignment?: string; - - /** Specifies the alignment text for legend - * @Default {0} - */ - columnCount?: number; -} - -export interface LeafItemSettings { - - /** Specifies the border brush color of the leaf item. - * @Default {white} - */ - borderBrush?: string; - - /** Specifies the border thickness of the leaf item. - * @Default {1} - */ - borderThickness?: number; - - /** Specifies the label template of the leaf item. - * @Default {null} - */ - itemTemplate?: string; - - /** Specifies the label path of the leaf item. - * @Default {null} - */ - labelPath?: string; - - /** Specifies the position of the leaf labels. - * @Default {center} - */ - labelPosition?: ej.datavisualization.TreeMap.Position|string; - - /** Specifies the mode of label visibility - * @Default {visible} - */ - labelVisibilityMode?: ej.datavisualization.TreeMap.VisibilityMode|string; - - /** Shows or hides the label of the leaf item. - * @Default {false} - */ - showLabels?: boolean; -} - -export interface RangeColorMapping { - - /** Specifies the color value for rangeColorMapping. - * @Default {null} - */ - color?: string; - - /** specifies the gradient colors for th given range value - * @Default {[]} - */ - gradientColors?: any[]; - - /** Specifies the from value for rangeColorMapping. - * @Default {-1} - */ - from?: number; - - /** Specifies the legend label value for rangeColorMapping. - * @Default {null} - */ - legendLabel?: string; - - /** Specifies the to value for rangeColorMapping. - * @Default {-1} - */ - to?: number; -} - -export interface Level { - - /** specifies the group background - * @Default {null} - */ - groupBackground?: string; - - /** Specifies the group border color for tree map level. - * @Default {null} - */ - groupBorderColor?: string; - - /** Specifies the group border thickness for tree map level. - * @Default {1} - */ - groupBorderThickness?: number; - - /** Specifies the group gap for tree map level. - * @Default {1} - */ - groupGap?: number; - - /** Specifies the group padding for tree map level. - * @Default {4} - */ - groupPadding?: number; - - /** Specifies the group path for tree map level. - */ - groupPath?: string; - - /** Specifies the header height for tree map level. - * @Default {0} - */ - headerHeight?: number; - - /** Specifies the header template for tree map level. - * @Default {null} - */ - headerTemplate?: string; - - /** Specifies the mode of header visibility - * @Default {visible} - */ - headerVisibilityMode?: ej.datavisualization.TreeMap.VisibilityMode|string; - - /** Specifies the position of the labels. - * @Default {center} - */ - labelPosition?: ej.datavisualization.TreeMap.Position|string; - - /** Specifies the label template for tree map level. - * @Default {null} - */ - labelTemplate?: string; - - /** Specifies the mode of label visibility - * @Default {visible} - */ - labelVisibilityMode?: ej.datavisualization.TreeMap.VisibilityMode|string; - - /** Shows or hides the header for tree map level. - * @Default {false} - */ - showHeader?: boolean; - - /** Shows or hides the labels for tree map level. - * @Default {false} - */ - showLabels?: boolean; -} -} -namespace TreeMap { -enum DockPosition { -//specifies the top position -Top, -//specifies the bottom position -Bottom, -//specifies the bottom position -Right, -//specifies the left position -Left, -} -} -namespace TreeMap { -enum ItemsLayoutMode { -//specifies the squarified as layout type position -Squarified, -//specifies the sliceanddicehorizontal as layout type position -Sliceanddicehorizontal, -//specifies the sliceanddicevertical as layout type position -Sliceanddicevertical, -//specifies the sliceanddiceauto as layout type position -Sliceanddiceauto, -} -} -namespace TreeMap { -enum Position { -//specifies the none position -None, -//specifies the topleft position -Topleft, -//specifies the topcenter position -Topcenter, -//specifies the topright position -Topright, -//specifies the centerleft position -Centerleft, -//specifies the center position -Center, -//specifies the centerright position -Centerright, -//specifies the bottomleft position -Bottomleft, -//specifies the bottomcenter position -Bottomcenter, -//specifies the bottomright position -Bottomright, -} -} -namespace TreeMap { -enum VisibilityMode { -//specifies the visible mode -Top, -//specifies the hide on exceeded length mode -Hideonexceededlength, -} -} -namespace TreeMap { -enum selectionMode { -//specifies the default mode -Default, -//specifies the multiple mode -Multiple, -} -} -namespace TreeMap { -enum groupSelectionMode { -//specifies the default mode -Default, -//specifies the multiple mode -Multiple, -} -} - -class Diagram extends ej.Widget { - static fn: Diagram; - constructor(element: JQuery | Element, options?: Diagram.Model); - static Locale: any; - model: Diagram.Model; - defaults: Diagram.Model; - - /** Add nodes and connectors to diagram at runtime - * @param {any} a JSON to define a node/connector or an array of nodes and connector - * @returns {boolean} - */ - add(node: any): boolean; - - /** Add a label to a node at runtime - * @param {string} name of the node to which label will be added - * @param {any} JSON for the new label to be added - * @returns {void} - */ - addLabel(nodeName: string, newLabel: any): void; - - /** Add dynamic Lanes to swimlane at runtime - * @param {any} JSON for the new lane to be added - * @param {number} Index value to add the lane in swimlane - * @returns {void} - */ - addLane(lane: any, index: number): void; - - /** Add a phase to a swimlane at runtime - * @param {string} name of the swimlane to which the phase will be added - * @param {any} JSON object to define the phase to be added - * @returns {void} - */ - addPhase(name: string, options: any): void; - - /** Add a collection of ports to the node specified by name - * @param {string} name of the node to which the ports have to be added - * @param {Array} a collection of ports to be added to the specified node - * @returns {void} - */ - addPorts(name: string, ports: any[]): void; - - /** Add the specified node to selection list - * @param {any} the node to be selected - * @param {boolean} to define whether to clear the existing selection or not - * @returns {void} - */ - addSelection(node: any, clearSelection?: boolean): void; - - /** Align the selected objects based on the reference object and direction - * @param {string} to specify the direction towards which the selected objects are to be aligned("left","right",top","bottom") - * @returns {void} - */ - align(direction: string): void; - - /** Bring the specified portion of the diagram content to the diagram viewport - * @param {any} the rectangular region that is to be brought into diagram viewport - * @returns {void} - */ - bringIntoView(rect: any): void; - - /** Bring the specified portion of the diagram content to the center of the diagram viewport - * @param {any} the rectangular region that is to be brought to the center of diagram viewport - * @returns {void} - */ - bringToCenter(rect: any): void; - - /** Visually move the selected object over all other intersected objects - * @returns {void} - */ - bringToFront(): void; - - /** Remove all the elements from diagram - * @returns {void} - */ - clear(): void; - - /** Clears the actions which is recorded to perform undo/redo operation in the diagram. - * @returns {void} - */ - clearHistory(): void; - - /** Remove the current selection in diagram - * @returns {void} - */ - clearSelection(): void; - - /** Copy the selected object to internal clipboard and get the copied object - * @returns {any} - */ - copy(): any; - - /** Cut the selected object from diagram to diagram internal clipboard - * @returns {void} - */ - cut(): void; - - /** Export the diagram as downloadable files or as data - * @param {Diagram.Options} options to export the desired region of diagram to the desired formats. - * @returns {string} - */ - exportDiagram(options?: Diagram.Options): string; - - /** Read a node/connector object by its name - * @param {string} name of the node/connector that is to be identified - * @returns {any} - */ - findNode(name: string): any; - - /** Fit the diagram content into diagram viewport - * @param {string} to set the mode of fit to command. See [Fit Mode](/api/js/global#fitmode) - * @param {string} to set whether the region to be fit will be based on diagram elements or page settings [Region](/api/js/global#region) - * @param {any} to set the required margin - * @returns {void} - */ - fitToPage(mode?: string, region?: string, margin?: any): void; - - /** Group the selected nodes and connectors - * @returns {void} - */ - group(): void; - - /** Insert a label into a node's label collection at runtime - * @param {string} name of the node to which the label has to be inserted - * @param {any} JSON to define the new label - * @param {number} index to insert the label into the node - * @returns {void} - */ - insertLabel(name: string, label: any, index?: number): void; - - /** Refresh the diagram with the specified layout - * @returns {void} - */ - layout(): void; - - /** Load the diagram - * @param {any} JSON data to load the diagram - * @returns {void} - */ - load(data: any): void; - - /** Visually move the selected object over its closest intersected object - * @returns {void} - */ - moveForward(): void; - - /** Move the selected objects by either one pixel or by the pixels specified through argument - * @param {string} specifies the direction to move the selected objects ("left","right",top","bottom") - * @param {number} specifies the number of pixels by which the selected objects have to be moved - * @returns {void} - */ - nudge(direction: string, delta?: number): void; - - /** Paste the selected object from internal clipboard to diagram - * @param {any} object to be added to diagram - * @param {boolean} to define whether the specified object is to be renamed or not - * @returns {void} - */ - paste(object?: any, rename?: boolean): void; - - /** Print the diagram as image - * @returns {void} - */ - print(): void; - - /** Restore the last action that was reverted - * @returns {void} - */ - redo(): void; - - /** Refresh the diagram at runtime - * @returns {void} - */ - refresh(): void; - - /** Remove either the given node/connector or the selected element from diagram - * @param {any} the node/connector to be removed from diagram - * @returns {void} - */ - remove(node?: any): void; - - /** Remove a particular object from selection list - * @param {any} the node/connector to be removed from selection list - * @returns {void} - */ - removeSelection(node: any): void; - - /** Scale the selected objects to the height of the first selected object - * @returns {void} - */ - sameHeight(): void; - - /** Scale the selected objects to the size of the first selected object - * @returns {void} - */ - sameSize(): void; - - /** Scale the selected objects to the width of the first selected object - * @returns {void} - */ - sameWidth(): void; - - /** Returns the diagram as serialized JSON - * @returns {any} - */ - save(): any; - - /** Bring the node into view - * @param {any} the node/connector to be brought into view - * @returns {void} - */ - scrollToNode(node: any): void; - - /** Select all nodes and connector in diagram - * @returns {void} - */ - selectAll(): void; - - /** Visually move the selected object behind its closest intersected object - * @returns {void} - */ - sendBackward(): void; - - /** Visually move the selected object behind all other intersected objects - * @returns {void} - */ - sendToBack(): void; - - /** Update the horizontal space between the selected objects as equal and within the selection boundary - * @returns {void} - */ - spaceAcross(): void; - - /** Update the vertical space between the selected objects as equal and within the selection boundary - * @returns {void} - */ - spaceDown(): void; - - /** Move the specified label to edit mode - * @param {any} node/connector that contains the label to be edited - * @param {any} to be edited - * @returns {void} - */ - startLabelEdit(node: any, label: any): void; - - /** Reverse the last action that was performed - * @returns {void} - */ - undo(): void; - - /** Ungroup the selected group - * @returns {void} - */ - ungroup(): void; - - /** Update diagram at runtime - * @param {any} JSON to specify the diagram properties that have to be modified - * @returns {void} - */ - update(options: any): void; - - /** Update Connectors at runtime - * @param {string} name of the connector to be updated - * @param {any} JSON to specify the connector properties that have to be updated - * @returns {void} - */ - updateConnector(name: string, options: any): void; - - /** Update the given label at runtime - * @param {string} the name of node/connector which contains the label to be updated - * @param {any} the label to be modified - * @param {any} JSON to specify the label properties that have to be updated - * @returns {any} - */ - updateLabel(nodeName: string, label: any, options: any): any; - - /** Update nodes at runtime - * @param {string} name of the node that is to be updated - * @param {any} JSON to specify the properties of node that have to be updated - * @returns {void} - */ - updateNode(name: string, options: any): void; - - /** Update a port with its modified properties at runtime - * @param {string} the name of node which contains the port to be updated - * @param {any} the port to be updated - * @param {any} JSON to specify the properties of the port that have to be updated - * @returns {void} - */ - updatePort(nodeName: string, port: any, options: any): void; - - /** Update the specified node as selected object - * @param {string} name of the node to be updated as selected object - * @returns {void} - */ - updateSelectedObject(name: string): void; - - /** Update the selection at runtime - * @param {boolean} to specify whether to show the user handles or not - * @returns {void} - */ - updateSelection(showUserHandles?: boolean): void; - - /** Update user handles with respect to the given node - * @param {any} node/connector with respect to which, the user handles have to be updated - * @returns {void} - */ - updateUserHandles(node: any): void; - - /** Update the diagram viewport at runtime - * @returns {void} - */ - updateViewPort(): void; - - /** Upgrade the diagram from old version - * @param {any} to be upgraded - * @returns {void} - */ - upgrade(data: any): void; - - /** Used to zoomIn/zoomOut diagram - * @param {Diagram.Zoom} options to zoom the diagram(zoom factor, zoomIn/zoomOut) - * @returns {void} - */ - zoomTo(Zoom?: Diagram.Zoom): void; -} -export namespace Diagram { - -export interface Options { - - /** name of the file to be downloaded. - */ - fileName?: string; - - /** format of the exported file/data. See [File Formats](/api/js/global#fileformats). - */ - format?: string; - - /** to set whether to export diagram as a file or as raw data. See [Export Modes](/api/js/global#exportmodes). - */ - mode?: string; - - /** to set the region of the diagram to be exported. See [Region](/api/js/global#region). - */ - region?: string; - - /** to export any custom region of diagram. - */ - bounds?: any; - - /** to set margin to the exported data. - */ - margin?: any; - - /** to set stretch to the exported data. - */ - stretch?: string; -} - -export interface Zoom { - - /** Used to increase the zoom-in or zoom-out based on the zoom factor value. - */ - zoomFactor?: number; - - /** Used to zoom-in or zoom-out the diagram. - */ - zoomCommand?: ej.datavisualization.Diagram.ZoomCommand; - - /** Used to zoom-in or zoom-out the diagram based on the point. - */ - focusPoint?: ej.datavisualization.Diagram.ConnectorsSourcePoint; -} - -export interface Model { - - /** Defines the background color of diagram elements - * @Default {transparent} - */ - backgroundColor?: string; - - /** Defines the path of the background image of diagram elements - */ - backgroundImage?: string; - - /** Sets the direction of line bridges. - * @Default {ej.datavisualization.Diagram.BridgeDirection.Top} - */ - bridgeDirection?: ej.datavisualization.Diagram.BridgeDirection|string; - - /** Defines a set of custom commands and binds them with a set of desired key gestures. - */ - commandManager?: CommandManager; - - /** A collection of JSON objects where each object represents a connector - * @Default {[]} - */ - connectors?: Connector[]; - - /** Binds the custom JSON data with connector properties - * @Default {null} - */ - connectorTemplate?: any; - - /** Enables/Disables the default behaviors of the diagram. - * @Default {ej.datavisualization.Diagram.DiagramConstraints.All} - */ - constraints?: ej.datavisualization.Diagram.DiagramConstraints|string; - - /** An object to customize the context menu of diagram - */ - contextMenu?: ContextMenu; - - /** Configures the data source that is to be bound with diagram - */ - dataSourceSettings?: DataSourceSettings; - - /** Initializes the default values for nodes and connectors - * @Default {{}} - */ - defaultSettings?: DefaultSettings; - - /** Sets the type of JSON object to be drawn through drawing tool - * @Default {{}} - */ - drawType?: any; - - /** Enables or disables auto scroll in diagram - * @Default {true} - */ - enableAutoScroll?: boolean; - - /** Enables or disables diagram context menu - * @Default {true} - */ - enableContextMenu?: boolean; - - /** Specifies the height of the diagram - * @Default {null} - */ - height?: string; - - /** Customizes the undo redo functionality - */ - historyManager?: HistoryManager; - - /** Defines the type of the rendering mode of label. - * @Default {Html} - */ - labelRenderingMode?: ej.datavisualization.Diagram.LabelRenderingMode|string; - - /** Automatically arranges the nodes and connectors in a predefined manner. - */ - layout?: Layout; - - /** Defines the current culture of diagram - * @Default {en-US} - */ - locale?: string; - - /** Array of JSON objects where each object represents a node - * @Default {[]} - */ - nodes?: Node[]; - - /** Binds the custom JSON data with node properties - * @Default {null} - */ - nodeTemplate?: any; - - /** Defines the size and appearance of diagram page - */ - pageSettings?: PageSettings; - - /** Defines the zoom value, zoom factor, scroll status and view port size of the diagram - */ - scrollSettings?: ScrollSettings; - - /** Defines the size and position of selected items and defines the appearance of selector - */ - selectedItems?: SelectedItems; - - /** Enables or disables tooltip of diagram - * @Default {true} - */ - showTooltip?: boolean; - - /** Defines the gridlines and defines how and when the objects have to be snapped - */ - snapSettings?: SnapSettings; - - /** Enables/Disables the interactive behaviors of diagram. - * @Default {ej.datavisualization.Diagram.Tool.All} - */ - tool?: ej.datavisualization.Diagram.Tool|string; - - /** An object that defines the description, appearance and alignments of tooltips - * @Default {null} - */ - tooltip?: Tooltip; - - /** Specifies the width of the diagram - * @Default {null} - */ - width?: string; - - /** Sets the factor by which we can zoom in or zoom out - * @Default {0.2} - */ - zoomFactor?: number; - - /** Triggers When auto scroll is changed */ - autoScrollChange?(e: AutoScrollChangeEventArgs): void; - - /** Triggers when a node, connector or diagram is clicked */ - click?(e: ClickEventArgs): void; - - /** Triggers when the connection is changed */ - connectionChange?(e: ConnectionChangeEventArgs): void; - - /** Triggers when the connector collection is changed */ - connectorCollectionChange?(e: ConnectorCollectionChangeEventArgs): void; - - /** Triggers when the connectors' source point is changed */ - connectorSourceChange?(e: ConnectorSourceChangeEventArgs): void; - - /** Triggers when the connectors' target point is changed */ - connectorTargetChange?(e: ConnectorTargetChangeEventArgs): void; - - /** Triggers before opening the context menu */ - contextMenuBeforeOpen?(e: ContextMenuBeforeOpenEventArgs): void; - - /** Triggers when a context menu item is clicked */ - contextMenuClick?(e: ContextMenuClickEventArgs): void; - - /** Triggers when a node, connector or diagram model is clicked twice */ - doubleClick?(e: DoubleClickEventArgs): void; - - /** Triggers while dragging the elements in diagram */ - drag?(e: DragEventArgs): void; - - /** Triggers when a symbol is dragged into diagram from symbol palette */ - dragEnter?(e: DragEnterEventArgs): void; - - /** Triggers when a symbol is dragged outside of the diagram. */ - dragLeave?(e: DragLeaveEventArgs): void; - - /** Triggers when a symbol is dragged over diagram */ - dragOver?(e: DragOverEventArgs): void; - - /** Triggers when a symbol is dragged and dropped from symbol palette to drawing area */ - drop?(e: DropEventArgs): void; - - /** Triggers when editor got focus at the time of node's label or text node editing. */ - editorFocusChange?(e: EditorFocusChangeEventArgs): void; - - /** Triggers when a child is added to or removed from a group */ - groupChange?(e: GroupChangeEventArgs): void; - - /** Triggers when a change is reverted or restored(undo/redo) */ - historyChange?(e: HistoryChangeEventArgs): void; - - /** Triggers when a diagram element is clicked */ - itemClick?(e: ItemClickEventArgs): void; - - /** Triggers when mouse enters a node/connector */ - mouseEnter?(e: MouseEnterEventArgs): void; - - /** Triggers when mouse leaves node/connector */ - mouseLeave?(e: MouseLeaveEventArgs): void; - - /** Triggers when mouse hovers over a node/connector */ - mouseOver?(e: MouseOverEventArgs): void; - - /** Triggers when node collection is changed */ - nodeCollectionChange?(e: NodeCollectionChangeEventArgs): void; - - /** Triggers when the node properties(x, y,width and height alone) are changed using nudge commands or updateNode API. */ - propertyChange?(e: PropertyChangeEventArgs): void; - - /** Triggers when the diagram elements are rotated */ - rotationChange?(e: RotationChangeEventArgs): void; - - /** Triggers when the diagram is zoomed or panned */ - scrollChange?(e: ScrollChangeEventArgs): void; - - /** Triggers when a connector segment is edited */ - segmentChange?(e: SegmentChangeEventArgs): void; - - /** Triggers when the selection is changed in diagram */ - selectionChange?(e: SelectionChangeEventArgs): void; - - /** Triggers when a node is resized */ - sizeChange?(e: SizeChangeEventArgs): void; - - /** Triggers when label editing is ended */ - textChange?(e: TextChangeEventArgs): void; - - /** Triggered when the diagram is rendered completely. */ - create?(e: CreateEventArgs): void; -} - -export interface AutoScrollChangeEventArgs { - - /** Returns the delay between subsequent auto scrolls - */ - delay?: string; - - /** parameter returns the id of the diagram - */ - diagramId?: string; -} - -export interface ClickEventArgs { - - /** parameter returns the clicked node, connector or diagram - */ - element?: any; - - /** parameter returns the object that is actually clicked - */ - actualObject?: number; - - /** parameter returns the horizontal coordinate of the mouse pointer, relative to the diagram - */ - offsetX?: number; - - /** parameter returns the vertical coordinate of the mouse pointer, relative to the diagram - */ - offsetY?: number; - - /** parameter returns the count of how many times the mouse button is pressed - */ - count?: number; - - /** parameter returns the actual click event arguments that explains which button is clicked - */ - event?: any; - - /** parameter returns the id of the diagram - */ - diagramId?: string; -} - -export interface ConnectionChangeEventArgs { - - /** parameter returns the connection that is changed between nodes, ports or points - */ - element?: any; - - /** parameter returns the new source node or target node of the connector - */ - connection?: string; - - /** parameter returns the new source port or target port of the connector - */ - port?: any; - - /** parameter defines whether to cancel the change or not - */ - cancel?: boolean; - - /** parameter returns the id of the diagram - */ - diagramId?: string; -} - -export interface ConnectorCollectionChangeEventArgs { - - /** parameter returns whether the connector is inserted or removed - */ - changeType?: string; - - /** parameter returns the connector that is to be added or deleted - */ - element?: any; - - /** parameter defines whether to cancel the collection change or not - */ - cancel?: boolean; - - /** triggers before and after adding the connector in the diagram which can be differentiated through `state` argument. We can cancel the event only before adding the connector. - */ - state?: string; - - /** parameter returns the id of the diagram - */ - diagramId?: string; -} - -export interface ConnectorSourceChangeEventArgs { - - /** returns the connector, the source point of which is being dragged - */ - element?: any; - - /** returns the source node of the element - */ - node?: any; - - /** returns the source point of the element - */ - point?: any; - - /** returns the source port of the element - */ - port?: any; - - /** returns the state of connection end point dragging(starting, dragging, completed) - */ - dragState?: string; - - /** parameter defines whether to cancel the change or not - */ - cancel?: boolean; - - /** parameter returns the id of the diagram - */ - diagramId?: string; -} - -export interface ConnectorTargetChangeEventArgs { - - /** parameter returns the connector, the target point of which is being dragged - */ - element?: any; - - /** returns the target node of the element - */ - node?: any; - - /** returns the target point of the element - */ - point?: any; - - /** returns the target port of the element - */ - port?: any; - - /** returns the state of connection end point dragging(starting, dragging, completed) - */ - dragState?: string; - - /** parameter defines whether to cancel the change or not - */ - cancel?: boolean; - - /** parameter returns the id of the diagram - */ - diagramId?: string; -} - -export interface ContextMenuBeforeOpenEventArgs { - - /** parameter returns the diagram object - */ - diagram?: any; - - /** parameter returns the actual arguments from context menu - */ - contextmenu?: any; - - /** parameter returns the object that was clicked - */ - target?: any; - - /** parameter returns the id of the diagram - */ - diagramId?: string; -} - -export interface ContextMenuClickEventArgs { - - /** parameter returns the id of the selected context menu item - */ - id?: string; - - /** parameter returns the text of the selected context menu item - */ - text?: string; - - /** parameter returns the parent id of the selected context menu item - */ - parentId?: string; - - /** parameter returns the parent text of the selected context menu item - */ - parentText?: string; - - /** parameter returns the object that was clicked - */ - target?: any; - - /** parameter defines whether to execute the click event or not - */ - canExecute?: boolean; - - /** parameter returns the id of the diagram - */ - diagramId?: string; -} - -export interface DoubleClickEventArgs { - - /** parameter returns the object that is actually clicked - */ - actualObject?: any; - - /** parameter returns the selected object - */ - element?: any; - - /** parameter returns the id of the diagram - */ - diagramId?: string; -} - -export interface DragEventArgs { - - /** parameter returns the node or connector that is being dragged - */ - element?: any; - - /** parameter returns the previous position of the node/connector - */ - oldValue?: any; - - /** parameter returns the new position of the node/connector - */ - newValue?: any; - - /** parameter returns the state of drag event (Starting, dragging, completed) - */ - dragState?: string; - - /** parameter returns whether or not to cancel the drag event - */ - cancel?: boolean; - - /** parameter returns the id of the diagram - */ - diagramId?: string; -} - -export interface DragEnterEventArgs { - - /** parameter returns the node or connector that is dragged into diagram - */ - element?: any; - - /** parameter returns whether to add or remove the symbol from diagram - */ - cancel?: boolean; - - /** parameter returns the id of the diagram - */ - diagramId?: string; -} - -export interface DragLeaveEventArgs { - - /** parameter returns the node or connector that is dragged outside of the diagram - */ - element?: any; - - /** parameter returns the id of the diagram - */ - diagramId?: string; -} - -export interface DragOverEventArgs { - - /** parameter returns the node or connector that is dragged over diagram - */ - element?: any; - - /** parameter defines whether the symbol can be dropped at the current mouse position - */ - allowDrop?: boolean; - - /** parameter returns the node/connector over which the symbol is dragged - */ - target?: any; - - /** parameter returns the previous position of the node/connector - */ - oldValue?: any; - - /** parameter returns the new position of the node/connector - */ - newValue?: any; - - /** parameter returns whether or not to cancel the dragOver event - */ - cancel?: boolean; - - /** parameter returns the id of the diagram - */ - diagramId?: string; -} - -export interface DropEventArgs { - - /** parameter returns node or connector that is being dropped - */ - element?: any; - - /** parameter returns whether or not to cancel the drop event - */ - cancel?: boolean; - - /** parameter returns the object from where the element is dragged - */ - source?: any; - - /** parameter returns the object over which the object will be dropped - */ - target?: any; - - /** parameter returns the enum which defines the type of the source - */ - sourceType?: string; - - /** parameter returns the id of the diagram - */ - diagramId?: string; -} - -export interface EditorFocusChangeEventArgs { - /** Returns the cancel option value. - */ - cancel?: boolean; -} - -export interface GroupChangeEventArgs { - - /** parameter returns the object that is added to/removed from a group - */ - element?: any; - - /** parameter returns the old parent group(if any) of the object - */ - oldParent?: any; - - /** parameter returns the new parent group(if any) of the object - */ - newParent?: any; - - /** parameter returns the cause of group change("group", unGroup") - */ - cause?: string; - - /** parameter returns the id of the diagram - */ - diagramId?: string; -} - -export interface HistoryChangeEventArgs { - - /** An array of objects, where each object represents the changes made in last undo/redo. To explore how the changes are defined, refer [Undo Redo Changes](#undo-redo-changes) - */ - changes?: any[]; - - /** A collection of objects that are changed in the last undo/redo - */ - Source?: any[]; - - /** parameter returns the id of the diagram - */ - diagramId?: string; -} - -export interface ItemClickEventArgs { - - /** parameter returns the object that was actually clicked - */ - actualObject?: any; - - /** parameter returns the object that is selected - */ - selectedObject?: any; - - /** parameter returns whether or not to cancel the drop event - */ - cancel?: boolean; - - /** parameter returns the actual click event arguments that explains which button is clicked - */ - event?: any; - - /** parameter returns the id of the diagram - */ - diagramId?: string; -} - -export interface MouseEnterEventArgs { - - /** parameter returns the target node or connector - */ - element?: any; - - /** parameter returns the object from where the selected object is dragged - */ - source?: any; - - /** parameter returns the target object over which the selected object is dragged - */ - target?: any; - - /** parameter returns the id of the diagram - */ - diagramId?: string; -} - -export interface MouseLeaveEventArgs { - - /** parameter returns the target node or connector - */ - element?: any; - - /** parameter returns the object from where the selected object is dragged - */ - source?: any; - - /** parameter returns the target object over which the selected object is dragged - */ - target?: any; - - /** parameter returns the id of the diagram - */ - diagramId?: string; -} - -export interface MouseOverEventArgs { - - /** parameter returns the target node or connector - */ - element?: any; - - /** parameter returns the object from where the element is dragged - */ - source?: any; - - /** parameter returns the object over which the element is being dragged. - */ - target?: any; - - /** parameter returns the id of the diagram - */ - diagramId?: string; -} - -export interface NodeCollectionChangeEventArgs { - - /** parameter returns whether the node is to be added or removed - */ - changeType?: string; - - /** parameter returns the node which needs to be added or deleted - */ - element?: any; - - /** parameter defines whether to cancel the collection change or not - */ - cancel?: boolean; - - /** triggers before and after adding the node in the diagram which can be differentiated through `state` argument. We can cancel the event only before adding the node - */ - state?: string; - - /** parameter returns the id of the diagram - */ - diagramId?: string; -} - -export interface PropertyChangeEventArgs { - - /** parameter returns the selected element - */ - element?: any; - - /** parameter returns the action is nudge or not - */ - cause?: string; - - /** parameter returns the new value of the node property that is being changed - */ - newValue?: any; - - /** parameter returns the old value of the property that is being changed - */ - oldValue?: any; - - /** parameter returns the name of the property that is changed - */ - propertyName?: string; - - /** parameter returns the id of the diagram - */ - diagramId?: string; -} - -export interface RotationChangeEventArgs { - - /** parameter returns the node that is rotated - */ - element?: any; - - /** parameter returns the previous rotation angle - */ - oldValue?: any; - - /** parameter returns the new rotation angle - */ - newValue?: any; - - /** parameter to specify whether or not to cancel the event - */ - cancel?: boolean; - - /** parameter returns the id of the diagram - */ - diagramId?: string; -} - -export interface ScrollChangeEventArgs { - - /** Parameter returns the new zoom value, horizontal and vertical scroll offsets. - */ - newValues?: any; - - /** parameter returns the previous zoom value, horizontal and vertical scroll offsets. - */ - oldValues?: any; - - /** parameter returns the id of the diagram - */ - diagramId?: string; -} - -export interface SegmentChangeEventArgs { - - /** Parameter returns the connector that is being edited - */ - element?: any; - - /** parameter returns the state of editing (starting, dragging, completed) - */ - dragState?: string; - - /** parameter returns the current mouse position - */ - point?: any; - - /** parameter to specify whether or not to cancel the event - */ - cancel?: boolean; - - /** parameter returns the id of the diagram - */ - diagramId?: string; -} - -export interface SelectionChangeEventArgs { - - /** parameter returns whether the item is selected or removed selection - */ - changeType?: string; - - /** parameter returns the item which is selected or to be selected - */ - element?: any; - - /** parameter returns the collection of nodes and connectors that have to be removed from selection list - */ - oldItems?: any[]; - - /** parameter returns the collection of nodes and connectors that have to be added to selection list - */ - newItems?: any[]; - - /** parameter returns the collection of nodes and connectors that will be selected after selection change - */ - selectedItems?: any[]; - - /** parameter to specify whether or not to cancel the selection change event - */ - cancel?: boolean; - - /** triggers before and after adding the selection to the object in the diagram which can be differentiated through `state` argument. We can cancel the event only before the selection of the object. - */ - state?: string; - - /** parameter returns the id of the diagram - */ - diagramId?: string; -} - -export interface SizeChangeEventArgs { - - /** parameter returns node that was resized - */ - element?: any; - - /** parameter to cancel the size change - */ - cancel?: boolean; - - /** parameter returns the new width, height, offsetX and offsetY values of the element that is being resized - */ - newValue?: any; - - /** parameter returns the previous width,height,offsetX and offsetY values of the element that is being resized - */ - oldValue?: any; - - /** parameter returns the state of resizing(starting,resizing,completed) - */ - resizeState?: string; - - /** parameter returns the difference between new and old value - */ - offset?: any; - - /** parameter returns the id of the diagram - */ - diagramId?: string; -} - -export interface TextChangeEventArgs { - - /** parameter returns the node that contains the text being edited - */ - element?: any; - - /** parameter returns the new text - */ - value?: string; - - /** parameter returns the keyCode of the key entered - */ - keyCode?: string; - - /** parameter returns the id of the diagram - */ - diagramId?: string; -} - -export interface CreateEventArgs { - - /** Returns the diagram model. - */ - model?: any; - - /** Returns the name of the event - */ - type?: string; - - /** parameter returns the id of the diagram - */ - diagramId?: string; -} - -export interface BackgroundImage { - - /** Defines how to align the background image over the diagram area. - * @Default {ej.datavisualization.Diagram.ImageAlignment.XMidYMid} - */ - alignment?: ej.datavisualization.Diagram.ImageAlignment |string; -} - -export interface CommandManagerCommandsGesture { - - /** Sets the key value, on recognition of which the command will be executed. - * @Default {ej.datavisualization.Diagram.Keys.None} - */ - key?: ej.datavisualization.Diagram.Keys|string; - - /** Sets a combination of key modifiers, on recognition of which the command will be executed. - * @Default {ej.datavisualization.Diagram.KeyModifiers.None} - */ - keyModifiers?: ej.datavisualization.Diagram.KeyModifiers|string; -} - -export interface CommandManagerCommands { - - /** A method that defines whether the command is executable at the moment or not. - */ - canExecute?: any; - - /** A method that defines what to be executed when the key combination is recognized. - */ - execute?: any; - - /** Defines a combination of keys and key modifiers, on recognition of which the command will be executed - */ - gesture?: CommandManagerCommandsGesture; - - /** Defines any additional parameters that are required at runtime - * @Default {null} - */ - parameter?: any; -} - -export interface CommandManager { - - /** An object that maps a set of command names with the corresponding command objects - * @Default {{}} - */ - commands?: CommandManagerCommands; -} - -export interface ConnectorsLabelsMargin { - - /** To set the margin of the label in right direction - * @Default {0} - */ - right?: number; - - /** To set the margin of the label in left direction - * @Default {0} - */ - left?: number; - - /** To set the margin of the label in top direction - * @Default {0} - */ - top?: number; - - /** To set the margin of the label in bottom direction - * @Default {0} - */ - bottom?: number; -} - -export interface ConnectorsLabel { - - /** Defines how the label should be aligned with respect to the segment - * @Default {ej.datavisualization.Diagram.Alignment.Center} - */ - alignment?: ej.datavisualization.Diagram.Alignment|string; - - /** Enables/disables the bold style - * @Default {false} - */ - bold?: boolean; - - /** Sets the border color of the label - * @Default {transparent} - */ - borderColor?: string; - - /** Sets the border width of the label - * @Default {0} - */ - borderWidth?: number; - - /** Defines whether the label should be aligned within the connector boundaries - * @Default {true} - */ - boundaryConstraints?: boolean; - - /** Sets the fill color of the text area - * @Default {transparent} - */ - fillColor?: string; - - /** Sets the font color of the text - * @Default {black} - */ - fontColor?: string; - - /** Sets the font family of the text - * @Default {Arial} - */ - fontFamily?: string; - - /** Defines the font size of the text - * @Default {12} - */ - fontSize?: number; - - /** Sets the horizontal alignment of the label. - * @Default {ej.datavisualization.Diagram.HorizontalAlignment.Center} - */ - horizontalAlignment?: ej.datavisualization.Diagram.HorizontalAlignment|string; - - /** Sets the hyperlink for the labels in the connectors. - * @Default {none} - */ - hyperlink?: string; - - /** Enables/disables the italic style - * @Default {false} - */ - italic?: boolean; - - /** Gets whether the label is currently being edited or not. - * @Default {ej.datavisualization.Diagram.LabelEditMode.Edit} - */ - mode?: ej.datavisualization.Diagram.LabelEditMode|string; - - /** Sets the unique identifier of the label - */ - name?: string; - - /** Sets the fraction/ratio(relative to connector) that defines the position of the label - * @Default {ej.datavisualization.Diagram.Point(0.5, 0.5)} - */ - offset?: any; - - /** Sets the fraction/ratio(relative to connector) that defines the position of the label - * @Default {ej.datavisualization.Diagram.Point(0.5, 0.5)} - */ - margin?: ConnectorsLabelsMargin; - - /** Defines the transparency of labels - * @Default {1} - */ - opacity?: number; - - /** Defines whether the label is editable or not - * @Default {false} - */ - readOnly?: boolean; - - /** Defines whether the label should be positioned whether relative to segments or connector boundaries - * @Default {ej.datavisualization.Diagram.LabelRelativeMode.SegmentPath} - */ - relativeMode?: ej.datavisualization.Diagram.LabelRelativeMode|string; - - /** Defines the angle to which the label needs to be rotated - * @Default {0} - */ - rotateAngle?: number; - - /** Sets the position of the label with respect to the total segment length - * @Default {0.5} - */ - segmentOffset?: string; - - /** Defines the label text - */ - text?: string; - - /** Defines how to align the text inside the label. - * @Default {ej.datavisualization.Diagram.TextAlign.Center} - */ - textAlign?: ej.datavisualization.Diagram.TextAlign|string; - - /** Sets how to decorate the label text. - * @Default {ej.datavisualization.Diagram.TextDecorations.None} - */ - textDecoration?: ej.datavisualization.Diagram.TextDecorations|string; - - /** Sets the vertical alignment of the label. - * @Default {ej.datavisualization.Diagram.VerticalAlignment.Center} - */ - verticalAlignment?: ej.datavisualization.Diagram.VerticalAlignment|string; - - /** Enables or disables the visibility of the label - * @Default {true} - */ - visible?: boolean; - - /** Sets the width of the label(the maximum value of label width and the connector width will be considered as label width) - * @Default {50} - */ - width?: number; - - /** Defines how the label text needs to be wrapped. - * @Default {ej.datavisualization.Diagram.TextWrapping.WrapWithOverflow} - */ - wrapping?: ej.datavisualization.Diagram.TextWrapping|string; -} - -export interface ConnectorsSegment { - - /** Sets the direction of orthogonal segment - */ - direction?: string; - - /** Describes the length of orthogonal segment - * @Default {undefined} - */ - length?: number; - - /** Describes the end point of bezier/straight segment - * @Default {Diagram.Point()} - */ - point?: ej.datavisualization.Diagram.ConnectorsSourcePoint; - - /** Defines the first control point of the bezier segment - * @Default {null} - */ - point1?: ej.datavisualization.Diagram.ConnectorsSourcePoint; - - /** Defines the second control point of bezier segment - * @Default {null} - */ - point2?: ej.datavisualization.Diagram.ConnectorsSourcePoint; - - /** Sets the type of the segment. - * @Default {ej.datavisualization.Diagram.Segments.Straight} - */ - type?: ej.datavisualization.Diagram.Segments|string; - - /** Describes the length and angle between the first control point and the start point of bezier segment - * @Default {null} - */ - vector1?: any; - - /** Describes the length and angle between the second control point and end point of bezier segment - * @Default {null} - */ - vector2?: any; -} - -export interface ConnectorsShapeMultiplicitySource { - - /** Defines the source label to connector. Applicable, if the connector is of type "UML" - * @Default {true} - */ - optional?: boolean; - - /** Defines the source label to connector. Applicable, if the connector is of type "UML" - * @Default {null} - */ - lowerBounds?: number; - - /** Defines the source label to connector. Applicable, if the connector is of type "UML" - * @Default {null} - */ - upperBounds?: number; -} - -export interface ConnectorsShapeMultiplicity { - - /** Sets the type of the multiplicity. Applicable, if the connector is of type "classifier" - * @Default {ej.datavisualization.Diagram.Multiplicity.OneToOne} - */ - type?: ej.datavisualization.Diagram.Multiplicity|string; - - /** Defines the source label to connector. Applicable, if the connector is of type "UML" - */ - source?: ConnectorsShapeMultiplicitySource; - - /** Defines the target label to connector. Applicable, if the connector is of type "UML" - * @Default {true} - */ - target?: ej.datavisualization.Diagram.ConnectorsShapeMultiplicitySource; -} - -export interface ConnectorsShape { - - /** Sets the type of the connector - * @Default {ej.datavisualization.Diagram.ConnectorShapes.BPMN} - */ - type?: ej.datavisualization.Diagram.ConnectorShapes|string; - - /** Sets the type of the flow in a BPMN Process - * @Default {ej.datavisualization.Diagram.BPMNFlows.Sequence} - */ - flow?: ej.datavisualization.Diagram.BPMNFlows|string; - - /** Sets the type of the Association in a BPMN Process - * @Default {ej.datavisualization.Diagram.AssociationFlows.Default} - */ - association?: ej.datavisualization.Diagram.AssociationFlows|string; - - /** Sets the type of the message flow. Applicable, if the connector is of type "BPMN" - * @Default {ej.datavisualization.Diagram.BPMNMessageFlows.Default} - */ - message?: ej.datavisualization.Diagram.BPMNMessageFlows|string; - - /** Sets the type of BPMN sequence flow - * @Default {ej.datavisualization.Diagram.BPMNSequenceFlows.Normal} - */ - sequence?: ej.datavisualization.Diagram.BPMNSequenceFlows|string; - - /** Defines the role of the connector in a UML Class Diagram. Applicable, if the type of the connector is "classifier". - * @Default {ej.datavisualization.Diagram.ClassifierShapes.Association} - */ - relationship?: ej.datavisualization.Diagram.ClassifierShapes|string; - - /** Defines the multiplicity option of the connector - * @Default {null} - */ - multiplicity?: ConnectorsShapeMultiplicity; - - /** Defines the shape of UMLActivity to connector. Applicable, if the connector is of type UMLActivity - * @Default {ej.datavisualization.Diagram.UMLActivityFlow.Control} - */ - ActivityFlow?: ej.datavisualization.Diagram.UMLActivityFlow|string; -} - -export interface ConnectorsSourceDecorator { - - /** Sets the border color of the source decorator - * @Default {black} - */ - borderColor?: string; - - /** Sets the border width of the decorator - * @Default {1} - */ - borderWidth?: number; - - /** Sets the fill color of the source decorator - * @Default {black} - */ - fillColor?: string; - - /** Sets the height of the source decorator - * @Default {8} - */ - height?: number; - - /** Defines the custom shape of the source decorator - */ - pathData?: string; - - /** Defines the shape of the source decorator. - * @Default {ej.datavisualization.Diagram.DecoratorShapes.Arrow} - */ - shape?: ej.datavisualization.Diagram.DecoratorShapes|string; - - /** Defines the width of the source decorator - * @Default {8} - */ - width?: number; -} - -export interface ConnectorsSourcePoint { - - /** Defines the x-coordinate of a position - * @Default {0} - */ - x?: number; - - /** Defines the y-coordinate of a position - * @Default {0} - */ - y?: number; -} - -export interface ConnectorsTargetDecorator { - - /** Sets the border color of the decorator - * @Default {black} - */ - borderColor?: string; - - /** Sets the color with which the decorator will be filled - * @Default {black} - */ - fillColor?: string; - - /** Defines the height of the target decorator - * @Default {8} - */ - height?: number; - - /** Defines the custom shape of the target decorator - */ - pathData?: string; - - /** Defines the shape of the target decorator. - * @Default {ej.datavisualization.Diagram.DecoratorShapes.Arrow} - */ - shape?: ej.datavisualization.Diagram.DecoratorShapes|string; - - /** Defines the width of the target decorator - * @Default {8} - */ - width?: number; -} - -export interface Connector { - - /** To maintain additional information about connectors - * @Default {null} - */ - addInfo?: any; - - /** Defines the width of the line bridges - * @Default {10} - */ - bridgeSpace?: number; - - /** Enables or disables the behaviors of connectors. - * @Default {ej.datavisualization.Diagram.ConnectorConstraints.Default} - */ - constraints?: ej.datavisualization.Diagram.ConnectorConstraints|string; - - /** Defines the radius of the rounded corner - * @Default {0} - */ - cornerRadius?: number; - - /** Configures the styles of shapes - */ - cssClass?: string; - - /** Sets the horizontal alignment of the connector. Applicable, if the parent of the connector is a container. - * @Default {ej.datavisualization.Diagram.HorizontalAlignment.Left} - */ - horizontalAlign?: ej.datavisualization.Diagram.HorizontalAlignment|string; - - /** A collection of JSON objects where each object represents a label. - * @Default {[]} - */ - labels?: ConnectorsLabel[]; - - /** Sets the stroke color of the connector - * @Default {black} - */ - lineColor?: string; - - /** Sets the pattern of dashes and gaps used to stroke the path of the connector - */ - lineDashArray?: string; - - /** Defines the padding value to ease the interaction with connectors - * @Default {10} - */ - lineHitPadding?: number; - - /** Sets the width of the line - * @Default {1} - */ - lineWidth?: number; - - /** Defines the minimum space to be left between the bottom of parent bounds and the connector. Applicable, if the parent is a container. - * @Default {0} - */ - marginBottom?: number; - - /** Defines the minimum space to be left between the left of parent bounds and the connector. Applicable, if the parent is a container. - * @Default {0} - */ - marginLeft?: number; - - /** Defines the minimum space to be left between the right of parent bounds and the connector. Applicable, if the parent is a container. - * @Default {0} - */ - marginRight?: number; - - /** Defines the minimum space to be left between the top of parent bounds and the connector. Applicable, if the parent is a container. - * @Default {0} - */ - marginTop?: number; - - /** Sets a unique name for the connector - */ - name?: string; - - /** Defines the transparency of the connector - * @Default {1} - */ - opacity?: number; - - /** Defines the size and preview size of the node to add that to symbol palette. To explore palette item, refer Palette Item - * @Default {null} - */ - paletteItem?: any; - - /** Sets the parent name of the connector. - */ - parent?: string; - - /** An array of JSON objects where each object represents a segment - * @Default {[ { type:straight } ]} - */ - segments?: ConnectorsSegment[]; - - /** Defines the role/meaning of the connector - * @Default {null} - */ - shape?: ConnectorsShape; - - /** Defines the source decorator of the connector - * @Default {{ shape:arrow, width: 8, height:8, borderColor:black, fillColor:black }} - */ - sourceDecorator?: ConnectorsSourceDecorator; - - /** Sets the source node of the connector - */ - sourceNode?: string; - - /** Defines the space to be left between the source node and the source point of a connector - * @Default {0} - */ - sourcePadding?: number; - - /** Describes the start point of the connector - * @Default {ej.datavisualization.Diagram.Point()} - */ - sourcePoint?: ConnectorsSourcePoint; - - /** Sets the source port of the connector - */ - sourcePort?: string; - - /** Defines the target decorator of the connector - * @Default {{ shape:arrow, width: 8, height:8, borderColor:black, fillColor:black }} - */ - targetDecorator?: ConnectorsTargetDecorator; - - /** Sets the target node of the connector - */ - targetNode?: string; - - /** Defines the space to be left between the target node and the target point of the connector - * @Default {0} - */ - targetPadding?: number; - - /** Describes the end point of the connector - * @Default {ej.datavisualization.Diagram.Point()} - */ - targetPoint?: ej.datavisualization.Diagram.ConnectorsSourcePoint; - - /** Sets the targetPort of the connector - */ - targetPort?: string; - - /** Defines the tooltip that should be shown when the mouse hovers over connector. For tooltip properties, refer Tooltip - * @Default {null} - */ - tooltip?: any; - - /** To set the vertical alignment of connector (Applicable,if the parent is group). - * @Default {ej.datavisualization.Diagram.VerticalAlignment.Top} - */ - verticalAlign?: ej.datavisualization.Diagram.VerticalAlignment|string; - - /** Enables or disables the visibility of connector - * @Default {true} - */ - visible?: boolean; - - /** Sets the z-index of the connector - * @Default {0} - */ - zOrder?: number; -} - -export interface ContextMenuItem { - - /** Defines the image url for the collection of context menu items - * @Default {null} - */ - imageUrl?: string; - - /** Defines the CssClass for the collection of context menu items - * @Default {null} - */ - cssClass?: string; -} - -export interface ContextMenu { - - /** Defines the collection of context menu items - * @Default {[]} - */ - items?: ContextMenuItem[]; - - /** To set whether to display the default context menu items or not - * @Default {false} - */ - showCustomMenuItemsOnly?: boolean; -} - -export interface DataSourceSettings { - - /** Defines the data source either as a collection of objects or as an instance of ej.DataManager - * @Default {null} - */ - dataSource?: any; - - /** Sets the unique id of the data source items - */ - id?: string; - - /** Defines the parent id of the data source item - * @Default {''} - */ - parent?: string; - - /** Describes query to retrieve a set of data from the specified datasource - * @Default {null} - */ - query?: string; - - /** Sets the unique id of the root data source item - */ - root?: string; - - /** Describes the name of the table on which the specified query has to be executed - * @Default {null} - */ - tableName?: string; -} - -export interface DefaultSettings { - - /** Initializes the default connector properties - * @Default {null} - */ - connector?: any; - - /** Initializes the default properties of groups - * @Default {null} - */ - group?: any; - - /** Initializes the default properties for nodes - * @Default {null} - */ - node?: any; -} - -export interface HistoryManager { - - /** A method that takes a history entry as argument and returns whether the specific entry can be popped or not - */ - canPop?: any; - - /** A method that ends grouping the changes - */ - closeGroupAction?: any; - - /** A method that removes the history of a recent change made in diagram - */ - pop?: any; - - /** A method that allows to track the custom changes made in diagram - */ - push?: any; - - /** Defines what should be happened while trying to restore a custom change - * @Default {null} - */ - redo?: any; - - /** The redoStack property is used to get the number of redo actions to be stored on the history manager. Its an read-only property and the collection should not be modified. - * @Default {[]} - */ - redoStack?: any[]; - - /** The stackLimit property used to restrict the undo and redo actions to a certain limit. - * @Default {null} - */ - stackLimit?: number; - - /** A method that starts to group the changes to revert/restore them in a single undo or redo - */ - startGroupAction?: any; - - /** Defines what should be happened while trying to revert a custom change - */ - undo?: any; - - /** The undoStack property is used to get the number of undo actions to be stored on the history manager. Its an read-only property and the collection should not be modified. - * @Default {[]} - */ - undoStack?: any[]; -} - -export interface Layout { - - /** Specifies the custom bounds to arrange/align the layout - * @Default {ej.datavisualization.Diagram.Rectangle()} - */ - bounds?: any; - - /** Defines the fixed node with reference to which, the layout will be arranged and fixed node will not be repositioned - */ - fixedNode?: string; - - /** Customizes the orientation of trees/sub trees. For orientations, see Chart Orientations. For chart types, see Chart Types - * @Default {null} - */ - getLayoutInfo?: any; - - /** Sets the space to be horizontally left between nodes - * @Default {30} - */ - horizontalSpacing?: number; - - /** Defines the space to be left between layout bounds and layout. - * @Default {ej.datavisualization.Diagram.Margin()} - */ - margin?: any; - - /** Defines how to horizontally align the layout within the layout bounds - * @Default {ej.datavisualization.Diagram.HorizontalAlignment.Center} - */ - horizontalAlignment?: ej.datavisualization.Diagram.HorizontalAlignment|string; - - /** Defines how to vertically align the layout within the layout bounds - * @Default {ej.datavisualization.Diagram.VerticalAlignment.Center} - */ - verticalAlignment?: ej.datavisualization.Diagram.VerticalAlignment|string; - - /** Sets the orientation/direction to arrange the diagram elements. - * @Default {ej.datavisualization.Diagram.LayoutOrientations.TopToBottom} - */ - orientation?: ej.datavisualization.Diagram.LayoutOrientations|string; - - /** Sets the type of the layout based on which the elements will be arranged. - * @Default {ej.datavisualization.Diagram.LayoutTypes.None} - */ - type?: ej.datavisualization.Diagram.LayoutTypes|string; - - /** Sets the space to be vertically left between nodes - * @Default {30} - */ - verticalSpacing?: number; -} - -export interface NodesAnnotation { - - /** Sets the angle between the BPMN shape and the annotation - * @Default {0} - */ - angle?: number; - - /** Sets the direction of the text annotation - * @Default {ej.datavisualization.Diagram.BPMNAnnotationDirections.Left} - */ - direction?: ej.datavisualization.Diagram.BPMNAnnotationDirection|string; - - /** Sets the height of the text annotation - * @Default {20} - */ - height?: number; - - /** Sets the distance between the BPMN shape and the annotation - * @Default {0} - */ - length?: number; - - /** Defines the additional information about the flow object in a BPMN Process - */ - text?: string; - - /** Sets the width of the text annotation - * @Default {20} - */ - width?: number; -} - -export interface NodesClassAttribute { - - /** Sets the name of the attribute - */ - name?: string; - - /** Sets the data type of attribute - */ - type?: string; - - /** Defines the visibility of the attribute - * @Default {ej.datavisualization.Diagram.ScopeValueDefaults.Public} - */ - scope?: string; -} - -export interface NodesClassMethod { - - /** Sets the visibility of the method. - * @Default {ej.datavisualization.Diagram.ScopeValueDefaults.Public} - */ - scope?: string; -} - -export interface NodesClass { - - /** Sets the name of class. - */ - name?: string; - - /** Defines the collection of attributes - * @Default {[]} - */ - attributes?: NodesClassAttribute[]; - - /** Defines the collection of methods of a Class. - * @Default {[]} - */ - methods?: NodesClassMethod[]; -} - -export interface NodesCollapseIcon { - - /** Sets the border color for collapse icon of node - * @Default {black} - */ - borderColor?: string; - - /** Sets the border width for collapse icon of node - * @Default {1} - */ - borderWidth?: number; - - /** Sets the fill color for collapse icon of node - * @Default {white} - */ - fillColor?: string; - - /** Defines the height for collapse icon of node - * @Default {15} - */ - height?: number; - - /** Sets the horizontal alignment of the icon. - * @Default {ej.datavisualization.Diagram.HorizontalAlignment.Center} - */ - horizontalAlignment?: ej.datavisualization.Diagram.HorizontalAlignment|string; - - /** To set the margin for the collapse icon of node - * @Default {ej.datavisualization.Diagram.Margin()} - */ - margin?: any; - - /** Sets the fraction/ratio(relative to node) that defines the position of the icon - * @Default {ej.datavisualization.Diagram.Point(0.5, 1)} - */ - offset?: any; - - /** Defines the shape of the collapsed state of the node. - * @Default {ej.datavisualization.Diagram.IconShapes.None} - */ - shape?: ej.datavisualization.Diagram.IconShapes|string; - - /** Sets the vertical alignment of the icon. - * @Default {ej.datavisualization.Diagram.VerticalAlignment.Center} - */ - verticalAlignment?: ej.datavisualization.Diagram.VerticalAlignment|string; -} - -export interface NodesContainer { - - /** Defines the orientation of the container. Applicable, if the group is a container. - * @Default {vertical} - */ - orientation?: string; - - /** Sets the type of the container. Applicable if the group is a container. - * @Default {ej.datavisualization.Diagram.ContainerType.Canvas} - */ - type?: ej.datavisualization.Diagram.ContainerType|string; -} - -export interface NodesData { - - /** Sets the type of the BPMN Data object - * @Default {ej.datavisualization.Diagram.BPMNDataObjects.None} - */ - type?: ej.datavisualization.Diagram.BPMNDataObjects|string; - - /** Defines whether the BPMN data object is a collection or not - * @Default {false} - */ - collection?: boolean; -} - -export interface NodesEnumerationMember { - - /** Sets the name of the enumeration member - */ - name?: string; -} - -export interface NodesEnumeration { - - /** Sets the name of the Enumeration - */ - name?: string; - - /** Defines the collection of enumeration members - * @Default {[]} - */ - members?: NodesEnumerationMember[]; -} - -export interface NodesExpandIcon { - - /** Sets the border color for expand icon of node - * @Default {black} - */ - borderColor?: string; - - /** Sets the border width for expand icon of node - * @Default {1} - */ - borderWidth?: number; - - /** Sets the fill color for expand icon of node - * @Default {white} - */ - fillColor?: string; - - /** Defines the height for expand icon of node - * @Default {15} - */ - height?: number; - - /** Sets the horizontal alignment of the icon. - * @Default {ej.datavisualization.Diagram.HorizontalAlignment.Center} - */ - horizontalAlignment?: ej.datavisualization.Diagram.HorizontalAlignment|string; - - /** To set the margin for the expand icon of node - * @Default {ej.datavisualization.Diagram.Margin()} - */ - margin?: any; - - /** Sets the fraction/ratio(relative to node) that defines the position of the icon - * @Default {ej.datavisualization.Diagram.Point(0.5, 1)} - */ - offset?: any; - - /** Defines the shape of the expanded state of the node. - * @Default {ej.datavisualization.Diagram.IconShapes.None} - */ - shape?: ej.datavisualization.Diagram.IconShapes|string; - - /** Sets the vertical alignment of the icon. - * @Default {ej.datavisualization.Diagram.VerticalAlignment.Center} - */ - verticalAlignment?: ej.datavisualization.Diagram.VerticalAlignment|string; -} - -export interface NodesGradientLinearGradient { - - /** Defines the different colors and the region of color transitions - * @Default {[]} - */ - stops?: any[]; - - /** Defines the left most position(relative to node) of the rectangular region that needs to be painted - * @Default {0} - */ - x1?: number; - - /** Defines the right most position(relative to node) of the rectangular region that needs to be painted - * @Default {0} - */ - x2?: number; - - /** Defines the top most position(relative to node) of the rectangular region that needs to be painted - * @Default {0} - */ - y1?: number; - - /** Defines the bottom most position(relative to node) of the rectangular region that needs to be painted - * @Default {0} - */ - y2?: number; -} - -export interface NodesGradientRadialGradient { - - /** Defines the position of the outermost circle - * @Default {0} - */ - cx?: number; - - /** Defines the outer most circle of the radial gradient - * @Default {0} - */ - cy?: number; - - /** Defines the innermost circle of the radial gradient - * @Default {0} - */ - fx?: number; - - /** Defines the innermost circle of the radial gradient - * @Default {0} - */ - fy?: number; - - /** Defines the different colors and the region of color transitions. - * @Default {[]} - */ - stops?: any[]; -} - -export interface NodesGradientStop { - - /** Sets the color to be filled over the specified region - */ - color?: string; - - /** Sets the position where the previous color transition ends and a new color transition starts - * @Default {0} - */ - offset?: number; - - /** Describes the transparency level of the region - * @Default {1} - */ - opacity?: number; -} - -export interface NodesGradient { - - /** Paints the node with linear color transitions - */ - LinearGradient?: NodesGradientLinearGradient; - - /** Paints the node with radial color transitions. A focal point defines the beginning of the gradient, and a circle defines the end point of the gradient. - */ - RadialGradient?: NodesGradientRadialGradient; - - /** Defines the color and a position where the previous color transition ends and a new color transition starts - */ - Stop?: NodesGradientStop; -} - -export interface NodesInterfaceAttribute { - - /** Sets the name of the attribute - */ - name?: string; - - /** Sets the type of the attribute - */ - type?: string; - - /** Sets the visibility of the attribute - */ - scope?: string; -} - -export interface NodesInterfaceMethod { - - /** Sets the visibility of the method - */ - scope?: string; -} - -export interface NodesInterface { - - /** Sets the name of the interface - */ - name?: string; - - /** Defines a collection of attributes of the interface - * @Default {[]} - */ - attributes?: NodesInterfaceAttribute[]; - - /** Defines the collection of public methods of an interface - * @Default {[]} - */ - methods?: NodesInterfaceMethod[]; -} - -export interface NodesLabel { - - /** Enables/disables the bold style - * @Default {false} - */ - bold?: boolean; - - /** Sets the border color of the label - * @Default {transparent} - */ - borderColor?: string; - - /** Sets the border width of the label - * @Default {0} - */ - borderWidth?: number; - - /** Sets the fill color of the text area - * @Default {transparent} - */ - fillColor?: string; - - /** Sets the font color of the text - * @Default {black} - */ - fontColor?: string; - - /** Sets the font family of the text - * @Default {Arial} - */ - fontFamily?: string; - - /** Defines the font size of the text - * @Default {12} - */ - fontSize?: number; - - /** Sets the horizontal alignment of the label. - * @Default {ej.datavisualization.Diagram.HorizontalAlignment.Center} - */ - horizontalAlignment?: ej.datavisualization.Diagram.HorizontalAlignment|string; - - /** Enables/disables the italic style - * @Default {false} - */ - italic?: boolean; - - /** To set the margin of the label - * @Default {ej.datavisualization.Diagram.Margin()} - */ - margin?: any; - - /** Gets whether the label is currently being edited or not. - * @Default {ej.datavisualization.Diagram.LabelEditMode.Edit} - */ - mode?: ej.datavisualization.Diagram.LabelEditMode|string; - - /** Sets the unique identifier of the label - */ - name?: string; - - /** Sets the fraction/ratio(relative to node) that defines the position of the label - * @Default {ej.datavisualization.Diagram.Point(0.5, 0.5)} - */ - offset?: any; - - /** Defines the transparency of the labels - * @Default {1} - */ - opacity?: number; - - /** Sets the overflowType of the labels - * @Default {ej.datavisualization.Diagram.OverflowType.Ellipsis} - */ - overflowType?: ej.datavisualization.Diagram.OverflowType|string; - - /** Defines whether the label is editable or not - * @Default {false} - */ - readOnly?: boolean; - - /** Defines the angle to which the label needs to be rotated - * @Default {0} - */ - rotateAngle?: number; - - /** Defines the label text - */ - text?: string; - - /** Defines how to align the text inside the label. - * @Default {ej.datavisualization.Diagram.TextAlign.Center} - */ - textAlign?: ej.datavisualization.Diagram.TextAlign|string; - - /** Sets how to decorate the label text. - * @Default {ej.datavisualization.Diagram.TextDecorations.None} - */ - textDecoration?: ej.datavisualization.Diagram.TextDecorations|string; - - /** Defines the overflowed content is displayed or not. - * @Default {false} - */ - textOverflow?: boolean; - - /** Sets the vertical alignment of the label. - * @Default {ej.datavisualization.Diagram.VerticalAlignment.Center} - */ - verticalAlignment?: ej.datavisualization.Diagram.VerticalAlignment|string; - - /** Enables or disables the visibility of the label - * @Default {true} - */ - visible?: boolean; - - /** Sets the width of the label(the maximum value of label width and the node width will be considered as label width) - * @Default {50} - */ - width?: number; - - /** Defines how the label text needs to be wrapped. - * @Default {ej.datavisualization.Diagram.TextWrapping.WrapWithOverflow} - */ - wrapping?: ej.datavisualization.Diagram.TextWrapping|string; -} - -export interface NodesLane { - - /** Defines the width of lane - * @Default {0} - */ - width?: number; - - /** Defines the height of lane - * @Default {0} - */ - height?: number; - - /** Defines the z-index of the lane - * @Default {0} - */ - zorder?: number; - - /** Allows to maintain additional information about lane - * @Default {{}} - */ - addInfo?: any; - - /** An array of objects where each object represents a child node of the lane - * @Default {[]} - */ - children?: any[]; - - /** Defines the fill color of the lane - * @Default {white} - */ - fillColor?: string; - - /** Defines the header of the lane - * @Default {{ text: Function, fontSize: 11 }} - */ - header?: any; - - /** Defines the object as a lane - * @Default {false} - */ - isLane?: boolean; - - /** Sets the unique identifier of the lane - */ - name?: string; - - /** Sets the orientation of the lane. - * @Default {vertical} - */ - orientation?: string; -} - -export interface NodesPaletteItem { - - /** Defines whether the symbol should be drawn at its actual size regardless of precedence factors or not - * @Default {true} - */ - enableScale?: boolean; - - /** Defines the height of the symbol - * @Default {0} - */ - height?: number; - - /** Defines the margin of the symbol item - * @Default {{ left: 4, right: 4, top: 4, bottom: 4 }} - */ - margin?: any; - - /** Defines the preview height of the symbol - * @Default {undefined} - */ - previewHeight?: number; - - /** Defines the preview width of the symbol - * @Default {undefined} - */ - previewWidth?: number; - - /** Defines the width of the symbol - * @Default {0} - */ - width?: number; -} - -export interface NodesPhase { - - /** Defines the header of the smaller regions - * @Default {null} - */ - label?: any; - - /** Defines the line color of the splitter that splits adjacent phases. - * @Default {#606060} - */ - lineColor?: string; - - /** Sets the dash array that used to stroke the phase splitter - * @Default {3,3} - */ - lineDashArray?: string; - - /** Sets the lineWidth of the phase - * @Default {1} - */ - lineWidth?: number; - - /** Sets the unique identifier of the phase - */ - name?: string; - - /** Sets the length of the smaller region(phase) of a swimlane - * @Default {100} - */ - offset?: number; - - /** Sets the orientation of the phase - * @Default {horizontal} - */ - orientation?: string; - - /** Sets the type of the object as phase - * @Default {phase} - */ - type?: string; -} - -export interface NodesPort { - - /** Sets the border color of the port - * @Default {#1a1a1a} - */ - borderColor?: string; - - /** Sets the stroke width of the port - * @Default {1} - */ - borderWidth?: number; - - /** Defines the space to be left between the port bounds and its incoming and outgoing connections. - * @Default {0} - */ - connectorPadding?: number; - - /** Defines whether connections can be created with the port - * @Default {ej.datavisualization.Diagram.PortConstraints.Connect} - */ - constraints?: ej.datavisualization.Diagram.PortConstraints|string; - - /** Sets the fill color of the port - * @Default {white} - */ - fillColor?: string; - - /** Sets the unique identifier of the port - */ - name?: string; - - /** Defines the position of the port as fraction/ ratio relative to node - * @Default {ej.datavisualization.Diagram.Point(0, 0)} - */ - offset?: any; - - /** Defines the path data to draw the port. Applicable, if the port shape is path. - */ - pathData?: string; - - /** Defines the shape of the port. - * @Default {ej.datavisualization.Diagram.PortShapes.Square} - */ - shape?: ej.datavisualization.Diagram.PortShapes|string; - - /** Defines the size of the port - * @Default {8} - */ - size?: number; - - /** Defines when the port should be visible. - * @Default {ej.datavisualization.Diagram.PortVisibility.Default} - */ - visibility?: ej.datavisualization.Diagram.PortVisibility|string; -} - -export interface NodesShadow { - - /** Defines the angle of the shadow relative to node - * @Default {45} - */ - angle?: number; - - /** Sets the distance to move the shadow relative to node - * @Default {5} - */ - distance?: number; - - /** Defines the opaque of the shadow - * @Default {0.7} - */ - opacity?: number; -} - -export interface NodesSubProcess { - - /** Defines whether the BPMN sub process is without any prescribed order or not - * @Default {false} - */ - adhoc?: boolean; - - /** Sets the boundary of the BPMN process - * @Default {ej.datavisualization.Diagram.BPMNBoundary.Default} - */ - boundary?: ej.datavisualization.Diagram.BPMNBoundary|string; - - /** Sets whether the BPMN subprocess is triggered as a compensation of a specific activity - * @Default {false} - */ - compensation?: boolean; - - /** Sets whether the BPMN subprocess is triggered as a collapsed of a specific activity - * @Default {true} - */ - collapsed?: boolean; - - /** Sets the type of the event by which the sub-process will be triggered - * @Default {ej.datavisualization.Diagram.BPMNEvents.Start} - */ - event?: ej.datavisualization.Diagram.BPMNEvents|string; - - /** Defines the collection of events that need to be appended with BPMN Sub-Process - */ - events?: any[]; - - /** Defines the loop type of a sub process. - * @Default {ej.datavisualization.Diagram.BPMNLoops.None} - */ - loop?: ej.datavisualization.Diagram.BPMNLoops|string; - - /** Defines the children for BPMN's SubProcess - * @Default {[]} - */ - Processes?: any[]; - - /** Defines the type of the event trigger - * @Default {ej.datavisualization.Diagram.BPMNTriggers.Message} - */ - trigger?: ej.datavisualization.Diagram.BPMNTriggers|string; - - /** Defines the type of a sub process - * @Default {ej.datavisualization.Diagram.BPMNSubProcessTypes.None} - */ - type?: ej.datavisualization.Diagram.BPMNSubProcessTypes|string; -} - -export interface NodesTask { - - /** To set whether the task is a global task or not - * @Default {false} - */ - call?: boolean; - - /** Sets whether the task is triggered as a compensation of another specific activity - * @Default {false} - */ - compensation?: boolean; - - /** Sets the loop type of a BPMN task. - * @Default {ej.datavisualization.Diagram.BPMNLoops.None} - */ - loop?: ej.datavisualization.Diagram.BPMNLoops|string; - - /** Sets the type of the BPMN task. - * @Default {ej.datavisualization.Diagram.BPMNTasks.None} - */ - type?: ej.datavisualization.Diagram.BPMNTasks|string; -} - -export interface Node { - - /** Defines the type of BPMN Activity. Applicable, if the node is a BPMN activity. - * @Default {ej.datavisualization.Diagram.BPMNActivity.Task} - */ - activity?: ej.datavisualization.Diagram.BPMNActivity|string; - - /** To maintain additional information about nodes - * @Default {{}} - */ - addInfo?: any; - - /** Defines the additional information of a process. It is not directly related to the message flows or sequence flows of the process. - * @Default {ej.datavisualization.Diagram.BPMNTextAnnotation()} - */ - annotation?: NodesAnnotation; - - /** Sets the border color of node - * @Default {black} - */ - borderColor?: string; - - /** Sets the pattern of dashes and gaps to stroke the border - */ - borderDashArray?: string; - - /** Sets the border width of the node - * @Default {1} - */ - borderWidth?: number; - - /** Defines whether the group can be ungrouped or not - * @Default {true} - */ - canUngroup?: boolean; - - /** Array of JSON objects where each object represents a child node/connector - * @Default {[]} - */ - children?: any[]; - - /** Sets the type of UML classifier. Applicable, if the node is a UML Class Diagram shape. - * @Default {ej.datavisualization.Diagram.ClassifierShapes.Class} - */ - classifier?: ej.datavisualization.Diagram.ClassifierShapes|string; - - /** Defines the name, attributes and methods of a Class. Applicable, if the node is a Class. - * @Default {null} - */ - class?: NodesClass; - - /** Defines the state of the node is collapsed. - */ - collapseIcon?: NodesCollapseIcon; - - /** Defines the distance to be left between a node and its connections(In coming and out going connections). - * @Default {0} - */ - connectorPadding?: number; - - /** Enables or disables the default behaviors of the node. - * @Default {ej.datavisualization.Diagram.NodeConstraints.Default} - */ - constraints?: ej.datavisualization.Diagram.NodeConstraints|string; - - /** Defines how the child objects need to be arranged(Either in any predefined manner or automatically). Applicable, if the node is a group. - * @Default {null} - */ - container?: NodesContainer; - - /** Defines the corner radius of rectangular shapes. - * @Default {0} - */ - cornerRadius?: number; - - /** Configures the styles of shapes - */ - cssClass?: string; - - /** Defines the BPMN data object - */ - data?: NodesData; - - /** Defines an Enumeration in a UML Class Diagram - * @Default {null} - */ - enumeration?: NodesEnumeration; - - /** Sets the type of the BPMN Events. Applicable, if the node is a BPMN event. - * @Default {ej.datavisualization.Diagram.BPMNEvents.Start} - */ - event?: ej.datavisualization.Diagram.BPMNEvents|string; - - /** Defines whether the node can be automatically arranged using layout or not - * @Default {false} - */ - excludeFromLayout?: boolean; - - /** Defines the state of the node is expanded or collapsed. - */ - expandIcon?: NodesExpandIcon; - - /** Defines the fill color of the node - * @Default {white} - */ - fillColor?: string; - - /** Sets the type of the BPMN Gateway. Applicable, if the node is a BPMN gateway. - * @Default {ej.datavisualization.Diagram.BPMNGateways.None} - */ - gateway?: ej.datavisualization.Diagram.BPMNGateways|string; - - /** Paints the node with a smooth transition from one color to another color - */ - gradient?: NodesGradient; - - /** Sets the type of the BPMN Shapes as group. Applicable, if the node is a BPMN. - * @Default {ej.datavisualization.Diagram.BPMNShapes} - */ - group?: any; - - /** Defines the header of a swimlane/lane - * @Default {{ text: Title, fontSize: 11 }} - */ - header?: any; - - /** Defines the height of the node - * @Default {0} - */ - height?: number; - - /** Sets the horizontal alignment of the node. Applicable, if the parent of the node is a container. - * @Default {ej.datavisualization.Diagram.HorizontalAlignment.Left} - */ - horizontalAlign?: ej.datavisualization.Diagram.HorizontalAlignment|string; - - /** A read only collection of the incoming connectors/edges of the node - * @Default {[]} - */ - inEdges?: any[]; - - /** Defines an interface in a UML Class Diagram - * @Default {null} - */ - interface?: NodesInterface; - - /** Defines whether the sub tree of the node is expanded or collapsed - * @Default {true} - */ - isExpanded?: boolean; - - /** Sets the node as a swimlane - * @Default {false} - */ - isSwimlane?: boolean; - - /** A collection of objects where each object represents a label - * @Default {[]} - */ - labels?: NodesLabel[]; - - /** An array of objects where each object represents a lane. Applicable, if the node is a swimlane. - * @Default {[]} - */ - lanes?: NodesLane[]; - - /** Defines the minimum space to be left between the bottom of parent bounds and the node. Applicable, if the parent is a container. - * @Default {0} - */ - marginBottom?: number; - - /** Defines the minimum space to be left between the left of parent bounds and the node. Applicable, if the parent is a container. - * @Default {0} - */ - marginLeft?: number; - - /** Defines the minimum space to be left between the right of the parent bounds and the node. Applicable, if the parent is a container. - * @Default {0} - */ - marginRight?: number; - - /** Defines the minimum space to be left between the top of parent bounds and the node. Applicable, if the parent is a container. - * @Default {0} - */ - marginTop?: number; - - /** Defines the maximum height limit of the node - * @Default {0} - */ - maxHeight?: number; - - /** Defines the maximum width limit of the node - * @Default {0} - */ - maxWidth?: number; - - /** Defines the minimum height limit of the node - * @Default {0} - */ - minHeight?: number; - - /** Defines the minimum width limit of the node - * @Default {0} - */ - minWidth?: number; - - /** Sets the unique identifier of the node - */ - name?: string; - - /** Defines the position of the node on X-Axis - * @Default {0} - */ - offsetX?: number; - - /** Defines the position of the node on Y-Axis - * @Default {0} - */ - offsetY?: number; - - /** Defines the opaque of the node - * @Default {1} - */ - opacity?: number; - - /** Defines the orientation of nodes. Applicable, if the node is a swimlane. - * @Default {vertical} - */ - orientation?: string; - - /** A read only collection of outgoing connectors/edges of the node - * @Default {[]} - */ - outEdges?: any[]; - - /** Defines the minimum padding value to be left between the bottom most position of a group and its children. Applicable, if the group is a container. - * @Default {0} - */ - paddingBottom?: number; - - /** Defines the minimum padding value to be left between the left most position of a group and its children. Applicable, if the group is a container. - * @Default {0} - */ - paddingLeft?: number; - - /** Defines the minimum padding value to be left between the right most position of a group and its children. Applicable, if the group is a container. - * @Default {0} - */ - paddingRight?: number; - - /** Defines the minimum padding value to be left between the top most position of a group and its children. Applicable, if the group is a container. - * @Default {0} - */ - paddingTop?: number; - - /** Defines the size and preview size of the node to add that to symbol palette - * @Default {null} - */ - paletteItem?: NodesPaletteItem; - - /** Sets the name of the parent group - */ - parent?: string; - - /** Sets the path geometry that defines the shape of a path node - */ - pathData?: string; - - /** An array of objects, where each object represents a smaller region(phase) of a swimlane. - * @Default {[]} - */ - phases?: NodesPhase[]; - - /** Sets the height of the phase headers - * @Default {0} - */ - phaseSize?: number; - - /** Sets the ratio/ fractional value relative to node, based on which the node will be transformed(positioning, scaling and rotation) - * @Default {ej.datavisualization.Diagram.Points(0.5,0.5)} - */ - pivot?: any; - - /** Defines a collection of points to draw a polygon. Applicable, if the shape is a polygon. - * @Default {[]} - */ - points?: any[]; - - /** An array of objects where each object represents a port - * @Default {[]} - */ - ports?: NodesPort[]; - - /** Sets the angle to which the node should be rotated - * @Default {0} - */ - rotateAngle?: number; - - /** Defines the opacity and the position of shadow - * @Default {ej.datavisualization.Diagram.Shadow()} - */ - shadow?: NodesShadow; - - /** Sets the shape of the node. It depends upon the type of node. - * @Default {ej.datavisualization.Diagram.BasicShapes.Rectangle} - */ - shape?: ej.datavisualization.Diagram.BasicShapes | ej.datavisualization.Diagram.FlowShapes | ej.datavisualization.Diagram.BPMNShapes | ej.datavisualization.Diagram.UMLActivityShapes|string; - - /** Sets the source path of the image. Applicable, if the type of the node is image. - */ - source?: string; - - /** Defines the sub process of a BPMN Activity. Applicable, if the type of the BPMN activity is sub process. - * @Default {ej.datavisualization.Diagram.BPMNSubProcess()} - */ - subProcess?: NodesSubProcess; - - /** Defines the task of the BPMN activity. Applicable, if the type of activity is set as task. - * @Default {ej.datavisualization.Diagram.BPMNTask()} - */ - task?: NodesTask; - - /** Sets the id of svg/html templates. Applicable, if the node is HTML or native. - */ - templateId?: string; - - /** Defines the textBlock of a text node - * @Default {null} - */ - textBlock?: any; - - /** Defines the tooltip that should be shown when the mouse hovers over node. For tooltip properties, refer Tooltip - * @Default {null} - */ - tooltip?: any; - - /** Sets the type of BPMN Event Triggers. - * @Default {ej.datavisualization.Diagram.BPMNTriggers.None} - */ - trigger?: ej.datavisualization.Diagram.BPMNTriggers|string; - - /** Defines the type of the node. - * @Default {ej.datavisualization.Diagram.Shapes.Basic} - */ - type?: ej.datavisualization.Diagram.Shapes|string; - - /** Sets the vertical alignment of a node. Applicable, if the parent of a node is a container. - * @Default {ej.datavisualization.Diagram.VerticalAlignment.Top} - */ - verticalAlign?: ej.datavisualization.Diagram.VerticalAlignment|string; - - /** Defines the visibility of the node - * @Default {true} - */ - visible?: boolean; - - /** Defines the width of the node - * @Default {0} - */ - width?: number; - - /** Defines the z-index of the node - * @Default {0} - */ - zOrder?: number; -} - -export interface PageSettings { - - /** Defines the maximum distance to be left between the object and the scroll bar to trigger auto scrolling - * @Default {{ left: 15, top: 15, right: 15, bottom: 15 }} - */ - autoScrollBorder?: any; - - /** Sets whether multiple pages can be created to fit all nodes and connectors - * @Default {false} - */ - multiplePage?: boolean; - - /** Defines the background color of diagram pages - * @Default {#ffffff} - */ - pageBackgroundColor?: string; - - /** Defines the page border color - * @Default {#565656} - */ - pageBorderColor?: string; - - /** Sets the border width of diagram pages - * @Default {0} - */ - pageBorderWidth?: number; - - /** Defines the height of a page - * @Default {null} - */ - pageHeight?: number; - - /** Defines the page margin - * @Default {24} - */ - pageMargin?: number; - - /** Sets the orientation of the page. - * @Default {ej.datavisualization.Diagram.PageOrientations.Portrait} - */ - pageOrientation?: ej.datavisualization.Diagram.PageOrientations|string; - - /** Defines the height of a diagram page - * @Default {null} - */ - pageWidth?: number; - - /** Defines the scrollable area of diagram. Applicable, if the scroll limit is "limited". - * @Default {null} - */ - scrollableArea?: any; - - /** Defines the scrollable region of diagram. - * @Default {ej.datavisualization.Diagram.ScrollLimit.Infinite} - */ - scrollLimit?: ej.datavisualization.Diagram.ScrollLimit|string; - - /** Defines the draggable region of diagram elements. - * @Default {ej.datavisualization.Diagram.BoundaryConstraints.Infinite} - */ - boundaryConstraints?: ej.datavisualization.Diagram.BoundaryConstraints|string; - - /** Enables or disables the page breaks - * @Default {false} - */ - showPageBreak?: boolean; -} - -export interface ScrollSettings { - - /** Allows to read the zoom value of diagram - * @Default {0} - */ - currentZoom?: number; - - /** Sets the horizontal scroll offset - * @Default {0} - */ - horizontalOffset?: number; - - /** Allows to extend the scrollable region that is based on the scroll limit - * @Default {{left: 0, right: 0, top:0, bottom: 0}} - */ - padding?: any; - - /** Sets the vertical scroll offset - * @Default {0} - */ - verticalOffset?: number; - - /** Allows to read the view port height of the diagram - * @Default {0} - */ - viewPortHeight?: number; - - /** Allows to read the view port width of the diagram - * @Default {0} - */ - viewPortWidth?: number; -} - -export interface SelectedItemsUserHandle { - - /** Defines the background color of the user handle - * @Default {#2382c3} - */ - backgroundColor?: string; - - /** Sets the border color of the user handle - * @Default {transparent} - */ - borderColor?: string; - - /** Defines whether the user handle should be added, when more than one element is selected - * @Default {false} - */ - enableMultiSelection?: boolean; - - /** Sets the stroke color of the user handle - * @Default {transparent} - */ - pathColor?: string; - - /** Defines the custom shape of the user handle - */ - pathData?: string; - - /** Defines the position of the user handle - * @Default {ej.datavisualization.Diagram.UserHandlePositions.BottomCenter} - */ - position?: ej.datavisualization.Diagram.UserHandlePositions |string; - - /** Defines the size of the user handle - * @Default {8} - */ - size?: number; - - /** Defines the interactive behaviors of the user handle - */ - tool?: any; - - /** Defines the visibility of the user handle - * @Default {true} - */ - visible?: boolean; -} - -export interface SelectedItems { - - /** A read only collection of the selected items - * @Default {[]} - */ - children?: any[]; - - /** Controls the visibility of selector. - * @Default {ej.datavisualization.Diagram.SelectorConstraints.All} - */ - constraints?: ej.datavisualization.Diagram.SelectorConstraints|string; - - /** Defines a method that dynamically enables/ disables the interaction with multiple selection. - * @Default {null} - */ - getConstraints?: any; - - /** Sets the height of the selected items - * @Default {0} - */ - height?: number; - - /** Sets the x position of the selector - * @Default {0} - */ - offsetX?: number; - - /** Sets the y position of the selector - * @Default {0} - */ - offsetY?: number; - - /** Sets the angle to rotate the selected items - * @Default {0} - */ - rotateAngle?: number; - - /** Sets the angle to rotate the selected items. For tooltip properties, refer Tooltip - * @Default {ej.datavisualization.Diagram.Tooltip()} - */ - tooltip?: any; - - /** A collection of frequently used commands that will be added around the selector - * @Default {[]} - */ - userHandles?: SelectedItemsUserHandle[]; - - /** Sets the width of the selected items - * @Default {0} - */ - width?: number; -} - -export interface SnapSettingsHorizontalGridLines { - - /** Defines the line color of horizontal grid lines - * @Default {lightgray} - */ - lineColor?: string; - - /** Specifies the pattern of dashes and gaps used to stroke horizontal grid lines - */ - lineDashArray?: string; - - /** A pattern of lines and gaps that defines a set of horizontal gridlines - * @Default {[1.25, 18.75, 0.25, 19.75, 0.25, 19.75, 0.25, 19.75, 0.25, 19.75]} - */ - linesInterval?: any[]; - - /** Specifies a set of intervals to snap the objects - * @Default {[20]} - */ - snapInterval?: any[]; -} - -export interface SnapSettingsVerticalGridLines { - - /** Defines the line color of horizontal grid lines - * @Default {lightgray} - */ - lineColor?: string; - - /** Specifies the pattern of dashes and gaps used to stroke horizontal grid lines - */ - lineDashArray?: string; - - /** A pattern of lines and gaps that defines a set of horizontal gridlines - * @Default {[1.25, 18.75, 0.25, 19.75, 0.25, 19.75, 0.25, 19.75, 0.25, 19.75]} - */ - linesInterval?: any[]; - - /** Specifies a set of intervals to snap the objects - * @Default {[20]} - */ - snapInterval?: any[]; -} - -export interface SnapSettings { - - /** Enables or disables snapping nodes/connectors to objects - * @Default {true} - */ - enableSnapToObject?: boolean; - - /** Defines the appearance of horizontal gridlines - */ - horizontalGridLines?: SnapSettingsHorizontalGridLines; - - /** Defines the angle by which the object needs to be snapped - * @Default {5} - */ - snapAngle?: number; - - /** Defines and sets the snapConstraints - */ - snapConstraints?: ej.datavisualization.Diagram.SnapConstraints|string; - - /** Defines the minimum distance between the selected object and the nearest object - * @Default {5} - */ - snapObjectDistance?: number; - - /** Defines the appearance of horizontal gridlines - */ - verticalGridLines?: SnapSettingsVerticalGridLines; -} - -export interface TooltipAlignment { - - /** Defines the horizontal alignment of tooltip. - * @Default {ej.datavisualization.Diagram.HorizontalAlignment.Center} - */ - horizontal?: ej.datavisualization.Diagram.HorizontalAlignment|string; - - /** Defines the vertical alignment of tooltip. - * @Default {ej.datavisualization.Diagram.VerticalAlignment.Bottom} - */ - vertical?: ej.datavisualization.Diagram.VerticalAlignment|string; -} - -export interface Tooltip { - - /** Aligns the tooltip around nodes/connectors - */ - alignment?: TooltipAlignment; - - /** Sets the margin of the tooltip - * @Default {{ left: 5, right: 5, top: 5, bottom: 5 }} - */ - margin?: any; - - /** Defines whether the tooltip should be shown at the mouse position or around node. - * @Default {ej.datavisualization.Diagram.RelativeMode.Object} - */ - relativeMode?: ej.datavisualization.Diagram.RelativeMode|string; - - /** Sets the svg/html template to be bound with tooltip - */ - templateId?: string; -} -} -namespace Diagram { -enum ImageAlignment { -//Scales the graphic content non-uniformly to the width and height of the diagram area -None, -//Used to align the image at the top left of diagram area -XMinYMin, -//Used to align the image at the left center of diagram area -XMinYMid, -//Used to align the image at the bottom left of diagram area -XMinYMax, -//Used to align the image at the top center of diagram area -XMidYMin, -//Used to align the image at the center of diagram area -XMidYMid, -//Used to align the image at the bottom center of diagram area -XMidYMax, -//Used to align the image at the top right of diagram area/node -XMaxYMin, -//Used to align the image at the right center of diagram area/node -XMaxYMid, -//Used to align the image at the bottom right of diagram area/node -XMaxYMax, -} -} -namespace Diagram { -enum BridgeDirection { -//Used to set the direction of line bridges as left -Left, -//Used to set the direction of line bridges as right -Right, -//Used to set the direction of line bridges as top -Top, -//Used to set the direction of line bridges as bottom -Bottom, -} -} -namespace Diagram { -enum Keys { -//No key pressed. -None, -//The A key. -A, -//The B key. -B, -//The C key. -C, -//The D Key. -D, -//The E key. -E, -//The F key. -F, -//The G key. -G, -//The H Key. -H, -//The I key. -I, -//The J key. -J, -//The K key. -K, -//The L Key. -L, -//The M key. -M, -//The N key. -N, -//The O key. -O, -//The P Key. -P, -//The Q key. -Q, -//The R key. -R, -//The S key. -S, -//The T Key. -T, -//The U key. -U, -//The V key. -V, -//The W key. -W, -//The X key. -X, -//The Y key. -Y, -//The Z key. -Z, -//The 0 key. -Number0, -//The 1 key. -Number1, -//The 2 key. -Number2, -//The 3 key. -Number3, -//The 4 key. -Number4, -//The 5 key. -Number5, -//The 6 key. -Number6, -//The 7 key. -Number7, -//The 8 key. -Number8, -//The 9 key. -Number9, -//The LEFT ARROW key. -Left, -//The UP ARROW key. -Up, -//The RIGHT ARROW key. -Right, -//The DOWN ARROW key. -Down, -//The ESC key. -Escape, -//The DEL key. -Delete, -//The TAB key. -Tab, -//The ENTER key. -Enter, -} -} -namespace Diagram { -enum KeyModifiers { -//No modifiers are pressed. -None, -//The ALT key. -Alt, -//The CTRL key. -Control, -//The SHIFT key. -Shift, -} -} -namespace Diagram { -enum ConnectorConstraints { -//Disable all connector Constraints -None, -//Enables connector to be selected -Select, -//Enables connector to be Deleted -Delete, -//Enables connector to be Dragged -Drag, -//Enables connectors source end to be selected -DragSourceEnd, -//Enables connectors target end to be selected -DragTargetEnd, -//Enables control point and end point of every segment in a connector for editing -DragSegmentThumb, -//Enables bridging to the connector -Bridging, -//Enables label of node to be Dragged -DragLabel, -//Enables bridging to the connector -InheritBridging, -//Enables user interaction to the connector -PointerEvents, -//Enables the contrast between clean edges of connector over rendering speed and geometric precision -CrispEdges, -//Enables all constraints -Default, -} -} -namespace Diagram { -enum HorizontalAlignment { -//Used to align text horizontally on left side of node/connector -Left, -//Used to align text horizontally on center of node/connector -Center, -//Used to align text horizontally on right side of node/connector -Right, -} -} -namespace Diagram { -enum Alignment { -//Used to align the label either top or left(before) of the connector segment -Before, -//Used to align the label at center of the connector segment -Center, -//Used to align the label either bottom or right(after) of the connector segment -After, -} -} -namespace Diagram { -enum LabelRelativeMode { -//Sets the relativeMode as SegmentPath -SegmentPath, -//Sets the relativeMode as SegmentBounds -SegmentBounds, -} -} -namespace Diagram { -enum Segments { -//Used to specify the lines as Straight -Straight, -//Used to specify the lines as Orthogonal -Orthogonal, -//Used to specify the lines as Bezier -Bezier, -} -} -namespace Diagram { -enum ConnectorShapes { -//Used to specify connector type as BPMN -BPMN, -//Used to specify connector type as UMLClassifier -UMLClassifier, -//Used to specify connector type as UMLActivity -UMLActivity, -} -} -namespace Diagram { -enum BPMNFlows { -//Used to specify the Sequence flow in a BPMN Process -Sequence, -//Used to specify the Association flow in a BPMN Process -Association, -//Used to specify the Message flow in a BPMN Process -Message, -} -} -namespace Diagram { -enum AssociationFlows { -//Used to notate default association in a BPMN Process -Default, -//Used to notate directional association in a BPMN Process -Directional, -//User to notate bi-directional association in a BPMN Process -BiDirectional, -} -} -namespace Diagram { -enum BPMNMessageFlows { -//Used to notate the default message flow in a BPMN Process -Default, -//Used to notate the instantiating message flow in a BPMN Process -InitiatingMessage, -//Used to notate the non-instantiating message flow in a BPMN Process -NonInitiatingMessage, -} -} -namespace Diagram { -enum BPMNSequenceFlows { -//Used to notate the normal sequence flow in a BPMN Process -Normal, -//Used to notate the conditional sequence flow in a BPMN Process -Conditional, -//Used to notate the default sequence flow in a BPMN Process -Default, -} -} -namespace Diagram { -enum ClassifierShapes { -//Used to define a Class -Class, -//Used to define an Interface -Interface, -//Used to define an Enumeration -Enumeration, -//Used to notate association in UML Class Diagram -Association, -//Used to notate aggregation in a UML Class Diagram -Aggregation, -//Used to notate composition in a UML Class Diagram -Composition, -//Used to notate dependency in a UML Class Diagram -Dependency, -//Used to notate inheritance in a UML Class Diagram -Inheritance, -} -} -namespace Diagram { -enum Multiplicity { -//Each entity instance is related to a single instance of another entity -OneToOne, -//An entity instance can be related to multiple instances of the other entities -OneToMany, -//Multiple instances of an entity can be related to a single instance of the other entity -ManyToOne, -//The entity instances can be related to multiple instances of each other -ManyToMany, -} -} -namespace Diagram { -enum UMLActivityFlow { -//Defines a activity flow as Object in UML Activity Diagram -Object, -//Defines a activity flow as Control in UML Activity Diagram -Control, -//Defines a activity flow as Exception in UML Activity Diagram -Exception, -} -} -namespace Diagram { -enum DecoratorShapes { -//Used to set decorator shape as none -None, -//Used to set decorator shape as Arrow -Arrow, -//Used to set decorator shape as Open Arrow -OpenArrow, -//Used to set decorator shape as Circle -Circle, -//Used to set decorator shape as Diamond -Diamond, -//Used to set decorator shape as path -Path, -} -} -namespace Diagram { -enum VerticalAlignment { -//Used to align text Vertically on left side of node/connector -Top, -//Used to align text Vertically on center of node/connector -Center, -//Used to align text Vertically on bottom of node/connector -Bottom, -} -} -namespace Diagram { -enum DiagramConstraints { -//Disables all DiagramConstraints -None, -//Enables/Disables PageEditing -PageEditable, -//Enables/Disables Bridging -Bridging, -//Enables/Disables Zooming -Zoomable, -//Enables/Disables panning on horizontal axis -PannableX, -//Enables/Disables panning on vertical axis -PannableY, -//Enables/Disables Panning -Pannable, -//Enables/Disables undo actions -Undoable, -//Enables/Disables the sharp edges -CrispEdges, -//Enables all Constraints -Default, -} -} -namespace Diagram { -enum LabelRenderingMode { -//Sets the labelRenderingMode as Html -Html, -//Sets the labelRenderingMode as Svg -Svg, -} -} -namespace Diagram { -enum LayoutOrientations { -//Used to set LayoutOrientation from top to bottom -TopToBottom, -//Used to set LayoutOrientation from bottom to top -BottomToTop, -//Used to set LayoutOrientation from left to right -LeftToRight, -//Used to set LayoutOrientation from right to left -RightToLeft, -} -} -namespace Diagram { -enum LayoutTypes { -//Used not to set any specific layout -None, -//Used to set layout type as hierarchical layout -HierarchicalTree, -//Used to set layout type as organnizational chart -OrganizationalChart, -} -} -namespace Diagram { -enum BPMNActivity { -//Used to set BPMN Activity as None -None, -//Used to set BPMN Activity as Task -Task, -//Used to set BPMN Activity as SubProcess -SubProcess, -} -} -namespace Diagram { -enum BPMNAnnotationDirection { -//Used to set the direction of BPMN Annotation as left -Left, -//Used to set the direction of BPMN Annotation as right -Right, -//Used to set the direction of BPMN Annotation as top -Top, -//Used to set the direction of BPMN Annotation as bottom -Bottom, -} -} -namespace Diagram { -enum IconShapes { -//Used to set collapse icon shape as none -None, -//Used to set collapse icon shape as Arrow(Up/Down) -Arrow, -//Used to set collapse icon shape as Plus -Plus, -//Used to set collapse icon shape as Minus -Minus, -//Used to set collapse icon shape as path -Path, -//Used to set icon shape as template -Template, -//Used to set icon shape as image -Image, -} -} -namespace Diagram { -enum NodeConstraints { -//Disable all node Constraints -None, -//Enables node to be selected -Select, -//Enables node to be Deleted -Delete, -//Enables node to be Dragged -Drag, -//Enables node to be Rotated -Rotate, -//Enables node to be connected -Connect, -//Enables node to be resize north east -ResizeNorthEast, -//Enables node to be resize east -ResizeEast, -//Enables node to be resize south east -ResizeSouthEast, -//Enables node to be resize south -ResizeSouth, -//Enables node to be resize south west -ResizeSouthWest, -//Enables node to be resize west -ResizeWest, -//Enables node to be resize north west -ResizeNorthWest, -//Enables node to be resize north -ResizeNorth, -//Enables node to be Resized -Resize, -//Enables shadow -Shadow, -//Enables label of node to be Dragged -DragLabel, -//Enables panning should be done while node dragging -AllowPan, -//Enables Proportional resize for node -AspectRatio, -//Enables the user interaction with the node -PointerEvents, -//Enables contrast between clean edges for the node over rendering speed and geometric precision -CrispEdges, -//Enables all node constraints -Default, -} -} -namespace Diagram { -enum ContainerType { -//Sets the container type as Canvas -Canvas, -//Sets the container type as Stack -Stack, -} -} -namespace Diagram { -enum BPMNDataObjects { -//Used to notate the Input type BPMN data object -Input, -//Used to notate the Output type BPMN data object -Output, -//Used to set BPMN data object type as None -None, -} -} -namespace Diagram { -enum BPMNEvents { -//Used to set BPMN Event as Start -Start, -//Used to set BPMN Event as Intermediate -Intermediate, -//Used to set BPMN Event as End -End, -//Used to set BPMN Event as NonInterruptingStart -NonInterruptingStart, -//Used to set BPMN Event as NonInterruptingIntermediate -NonInterruptingIntermediate, -//Used to set BPMN Event as ThrowingIntermediate -ThrowingIntermediate, -} -} -namespace Diagram { -enum BPMNGateways { -//Used to set BPMN Gateway as None -None, -//Used to set BPMN Gateway as Exclusive -Exclusive, -//Used to set BPMN Gateway as Inclusive -Inclusive, -//Used to set BPMN Gateway as Parallel -Parallel, -//Used to set BPMN Gateway as Complex -Complex, -//Used to set BPMN Gateway as EventBased -EventBased, -//Used to set BPMN Gateway as ExclusiveEventBased -ExclusiveEventBased, -//Used to set BPMN Gateway as ParallelEventBased -ParallelEventBased, -} -} -namespace Diagram { -enum LabelEditMode { -//Used to set label edit mode as edit -Edit, -//Used to set label edit mode as view -View, -} -} -namespace Diagram { -enum OverflowType { -//Set overflow Type as ellipsis -Ellipsis, -//Set overflow Type as Clip -Clip, -} -} -namespace Diagram { -enum TextAlign { -//Used to align text on left side of node/connector -Left, -//Used to align text on center of node/connector -Center, -//Used to align text on Right side of node/connector -Right, -} -} -namespace Diagram { -enum TextDecorations { -//Used to set text decoration of the label as Underline -Underline, -//Used to set text decoration of the label as Overline -Overline, -//Used to set text decoration of the label as LineThrough -LineThrough, -//Used to set text decoration of the label as None -None, -} -} -namespace Diagram { -enum TextWrapping { -//Disables wrapping -NoWrap, -//Enables Line-break at normal word break points -Wrap, -//Enables Line-break at normal word break points with longer word overflows -WrapWithOverflow, -} -} -namespace Diagram { -enum PortConstraints { -//Disable all constraints -None, -//Enables connections with connector -Connect, -//Enables to create the connection when mouse hover on the port. -ConnectOnDrag, -} -} -namespace Diagram { -enum PortShapes { -//Used to set port shape as X -X, -//Used to set port shape as Circle -Circle, -//Used to set port shape as Square -Square, -//Used to set port shape as Path -Path, -} -} -namespace Diagram { -enum PortVisibility { -//Set the port visibility as Visible -Visible, -//Set the port visibility as Hidden -Hidden, -//Port get visible when hover connector on node -Hover, -//Port gets visible when connect connector to node -Connect, -//Specifies the port visibility as default -Default, -} -} -namespace Diagram { -enum BasicShapes { -//Used to specify node Shape as Rectangle -Rectangle, -//Used to specify node Shape as Ellipse -Ellipse, -//Used to specify node Shape as Path -Path, -//Used to specify node Shape as Polygon -Polygon, -//Used to specify node Shape as Triangle -Triangle, -//Used to specify node Shape as Plus -Plus, -//Used to specify node Shape as Star -Star, -//Used to specify node Shape as Pentagon -Pentagon, -//Used to specify node Shape as Heptagon -Heptagon, -//Used to specify node Shape as Octagon -Octagon, -//Used to specify node Shape as Trapezoid -Trapezoid, -//Used to specify node Shape as Decagon -Decagon, -//Used to specify node Shape as RightTriangle -RightTriangle, -//Used to specify node Shape as Cylinder -Cylinder, -} -} -namespace Diagram { -enum FlowShapes { -//Used to specify node Shape as Process -Process, -//Used to specify node Shape as Decision -Decision, -//Used to specify node Shape as Document -Document, -//Used to specify node Shape as PreDefinedProcess -PreDefinedProcess, -//Used to specify node Shape as Terminator -Terminator, -//Used to specify node Shape as PaperTap -PaperTap, -//Used to specify node Shape as DirectData -DirectData, -//Used to specify node Shape as SequentialData -SequentialData, -//Used to specify node Shape as Sort -Sort, -//Used to specify node Shape as MultiDocument -MultiDocument, -//Used to specify node Shape as Collate -Collate, -//Used to specify node Shape as SummingJunction -SummingJunction, -//Used to specify node Shape as Or -Or, -//Used to specify node Shape as InternalStorage -InternalStorage, -//Used to specify node Shape as Extract -Extract, -//Used to specify node Shape as ManualOperation -ManualOperation, -//Used to specify node Shape as Merge -Merge, -//Used to specify node Shape as OffPageReference -OffPageReference, -//Used to specify node Shape as SequentialAccessStorage -SequentialAccessStorage, -//Used to specify node Shape as Annotation1 -Annotation1, -//Used to specify node Shape as Annotation2 -Annotation2, -//Used to specify node Shape as Data -Data, -//Used to specify node Shape as Card -Card, -} -} -namespace Diagram { -enum BPMNShapes { -//Used to specify node Shape as Event -Event, -//Used to specify node Shape as Gateway -Gateway, -//Used to specify node Shape as Message -Message, -//Used to specify node Shape as DataObject -DataObject, -//Used to specify node Shape as DataSource -DataSource, -//Used to specify node Shape as Activity -Activity, -//Used to specify node Shape as Group -Group, -} -} -namespace Diagram { -enum UMLActivityShapes { -//Used to set UML ActivityShapes as Action -Action, -//Used to set UML ActivityShapes as Decision -Decision, -//Used to set UML ActivityShapes as MergeNode -MergeNode, -//Used to set UML ActivityShapes as InitialNode -InitialNode, -//Used to set UML ActivityShapes as FinalNode -FinalNode, -//Used to set UML ActivityShapes as ForkNode -ForkNode, -//Used to set UML ActivityShapes as JoinNode -JoinNode, -//Used to set UML ActivityShapes as TimeEvent -TimeEvent, -//Used to set UML ActivityShapes as AcceptingEvent -AcceptingEvent, -//Used to set UML ActivityShapes as SendSignal -SendSignal, -//Used to set UML ActivityShapes as ReceiveSignal -ReceiveSignal, -//Used to set UML ActivityShapes as StructuredNode -StructuredNode, -//Used to set UML ActivityShapes as Note -Note, -} -} -namespace Diagram { -enum BPMNBoundary { -//Used to set BPMN SubProcess's Boundary as Default -Default, -//Used to set BPMN SubProcess's Boundary as Call -Call, -//Used to set BPMN SubProcess's Boundary as Event -Event, -} -} -namespace Diagram { -enum BPMNLoops { -//Used to set BPMN Activity's Loop as None -None, -//Used to set BPMN Activity's Loop as Standard -Standard, -//Used to set BPMN Activity's Loop as ParallelMultiInstance -ParallelMultiInstance, -//Used to set BPMN Activity's Loop as SequenceMultiInstance -SequenceMultiInstance, -} -} -namespace Diagram { -enum BPMNSubProcessTypes { -//Used to set BPMN SubProcess type as None -None, -//Used to set BPMN SubProcess type as Transaction -Transaction, -//Used to set BPMN SubProcess type as Event -Event, -} -} -namespace Diagram { -enum BPMNTasks { -//Used to set BPMN Task Type as None -None, -//Used to set BPMN Task Type as Service -Service, -//Used to set BPMN Task Type as Receive -Receive, -//Used to set BPMN Task Type as Send -Send, -//Used to set BPMN Task Type as InstantiatingReceive -InstantiatingReceive, -//Used to set BPMN Task Type as Manual -Manual, -//Used to set BPMN Task Type as BusinessRule -BusinessRule, -//Used to set BPMN Task Type as User -User, -//Used to set BPMN Task Type as Script -Script, -//Used to set BPMN Task Type as Parallel -Parallel, -} -} -namespace Diagram { -enum BPMNTriggers { -//Used to set Event Trigger as None -None, -//Used to set Event Trigger as Message -Message, -//Used to set Event Trigger as Timer -Timer, -//Used to set Event Trigger as Escalation -Escalation, -//Used to set Event Trigger as Link -Link, -//Used to set Event Trigger as Error -Error, -//Used to set Event Trigger as Compensation -Compensation, -//Used to set Event Trigger as Signal -Signal, -//Used to set Event Trigger as Multiple -Multiple, -//Used to set Event Trigger as Parallel -Parallel, -//Used to set Event Trigger as Conditional -Conditional, -//Used to set Event Trigger as Termination -Termination, -//Used to set Event Trigger as Cancel -Cancel, -} -} -namespace Diagram { -enum Shapes { -//Used to specify node type as Text -Text, -//Used to specify node type as Image -Image, -//Used to specify node type as Html -Html, -//Used to specify node type as Native -Native, -//Used to specify node type as Basic -Basic, -//Used to specify node type as Flow -Flow, -//Used to specify node type as BPMN -BPMN, -//Used to specify node type as UMLClassifier -UMLClassifier, -//Used to specify node type as UMLActivity -UMLActivity, -} -} -namespace Diagram { -enum PageOrientations { -//Used to set orientation as Landscape -Landscape, -//Used to set orientation as portrait -Portrait, -} -} -namespace Diagram { -enum ScrollLimit { -//Used to set scrollLimit as Infinite -Infinite, -//Used to set scrollLimit as Diagram -Diagram, -//Used to set scrollLimit as Limited -Limited, -} -} -namespace Diagram { -enum BoundaryConstraints { -//Used to set boundaryConstraints as Infinite -Infinite, -//Used to set boundaryConstraints as Diagram -Diagram, -//Used to set boundaryConstraints as Page -Page, -} -} -namespace Diagram { -enum SelectorConstraints { -//Hides the selector -None, -//Sets the visibility of rotation handle as visible -Rotator, -//Sets the visibility of resize handles as visible -Resizer, -//Sets the visibility of user handles as visible -UserHandles, -//Sets the visibility of all selection handles as visible -All, -} -} -namespace Diagram { -enum UserHandlePositions { -//Set the position of the userhandle as topleft -TopLeft, -//Set the position of the userhandle as topcenter -TopCenter, -//Set the position of the userhandle as topright -TopRight, -//Set the position of the userhandle as middleleft -MiddleLeft, -//Set the position of the userhandle as middleright -MiddleRight, -//Set the position of the userhandle as bottomleft -BottomLeft, -//Set the position of the userhandle as bottomcenter -BottomCenter, -//Set the position of the userhandle as bottom right -BottomRight, -} -} -namespace Diagram { -enum SnapConstraints { -//Enables node to be snapped to horizontal gridlines -None, -//Enables node to be snapped to vertical gridlines -SnapToHorizontalLines, -//Enables node to be snapped to horizontal gridlines -SnapToVerticalLines, -//Enables node to be snapped to gridlines -SnapToLines, -//Enable horizontal lines -ShowHorizontalLines, -//Enable vertical lines -ShowVerticalLines, -//Enable both horizontal and vertical lines -ShowLines, -//Enable all the constraints -All, -} -} -namespace Diagram { -enum Tool { -//Disables all Tools -None, -//Enables/Disables SingleSelect tool -SingleSelect, -//Enables/Disables MultiSelect tool -MultipleSelect, -//Enables/Disables ZoomPan tool -ZoomPan, -//Enables/Disables DrawOnce tool -DrawOnce, -//Enables/Disables ContinuousDraw tool -ContinuesDraw, -} -} -namespace Diagram { -enum RelativeMode { -//Shows tooltip around the node -Object, -//Shows tooltip at the mouse position -Mouse, -} -} -namespace Diagram { -enum ZoomCommand { -//Used to zoom in the Diagram -ZoomIn, -//Used to zoom out the diagram -ZoomOut, -} -} - -class HeatMap extends ej.Widget { - static fn: HeatMap; - constructor(element: JQuery | Element, options?: HeatMap.Model); - static Locale: any; - model: HeatMap.Model; - defaults: HeatMap.Model; -} -export namespace HeatMap { - -export interface Model { - - /** Specifies the width of the heat map. - * @Default {null} - */ - width?: any; - - /** Specifies the width of the heat map. - * @Default {null} - */ - height?: any; - - /** Specifies the name of the heat map. - * @Default {null} - */ - id?: number; - - /** Enables or disables tooltip of heatmap - * @Default {true} - */ - showTooltip?: boolean; - - /** Defines the tooltip that should be shown when the mouse hovers over rows/columns. - */ - tooltipSettings?: TooltipSettings; - - /** Specifies the source data of the heat map. - * @Default {[]} - */ - itemsSource?: any; - - /** Specifies the property of the heat map cell. - * @Default {Null} - */ - heatMapCell?: HeatMapCell; - - /** Specifies can enable responsive mode or not for heat map. - * @Default {false} - */ - isResponsive?: boolean; - - /** Specifies whether the virtualization can be enable or not. - * @Default {false} - */ - enableVirtualization?: boolean; - - /** Specifies the default column properties for all the column style not specified in column properties. - * @Default {[]} - */ - defaultColumnStyle?: DefaultColumnStyle; - - /** Specifies the no of legends can sync with heat map. - * @Default {[]} - */ - legendCollection?: any[]; - - /** Specifies the property and display value of the heat map column. - * @Default {[]} - */ - itemsMapping?: ItemsMapping; - - /** Specifies the color values of the heat map column data. - * @Default {[]} - */ - colorMappingCollection?: ColorMappingCollection[]; - - /** Triggered when the mouse over on the cell. */ - cellMouseOver?(e: CellMouseOverEventArgs): void; - - /** Triggered when the mouse over on the cell. */ - cellMouseEnter?(e: CellMouseEnterEventArgs): void; - - /** Triggered when the mouse over on the cell. */ - cellMouseLeave?(e: CellMouseLeaveEventArgs): void; - - /** Triggered when the mouse over on the cell. */ - cellSelected?(e: CellSelectedEventArgs): void; -} - -export interface CellMouseOverEventArgs { - - /** Value displayed on the cell - */ - cellValue?: string; - - /** Returns the HeatMap cell data - */ - source?: any; - - /** Returns the specific HeatMap cell - */ - cell?: any; -} - -export interface CellMouseEnterEventArgs { - - /** Value displayed on the cell - */ - cellValue?: string; - - /** Returns the HeatMap cell data - */ - source?: any; - - /** Returns the specific HeatMap cell - */ - cell?: any; -} - -export interface CellMouseLeaveEventArgs { - - /** Value displayed on the cell - */ - cellValue?: string; - - /** Returns the HeatMap cell data - */ - source?: any; - - /** Returns the specific HeatMap cell - */ - cell?: any; -} - -export interface CellSelectedEventArgs { - - /** Value displayed on the cell - */ - cellValue?: string; - - /** Returns the HeatMap cell data - */ - source?: any; - - /** Returns the specific HeatMap cell - */ - cell?: any; -} - -export interface TooltipSettingsPositionTarget { - - /** Sets the arrow position again popup based on horizontal(x) value - * @Default {center} - */ - horizontal?: ej.datavisualization.HeatMap.Horizontal|string; - - /** Sets the arrow position again popup based on vertical(y) value - * @Default {top} - */ - vertical?: ej.datavisualization.HeatMap.Vertical|string; -} - -export interface TooltipSettingsPositionStem { - - /** Sets the arrow position again popup based on horizontal(x) value - * @Default {center} - */ - horizontal?: ej.datavisualization.HeatMap.Horizontal|string; - - /** Sets the arrow position again popup based on vertical(y) value - * @Default {bottom} - */ - vertical?: ej.datavisualization.HeatMap.Vertical|string; -} - -export interface TooltipSettingsPosition { - - /** Sets the Tooltip position against target. - */ - target?: TooltipSettingsPositionTarget; - - /** Sets the arrow position again popup. - */ - stem?: TooltipSettingsPositionStem; -} - -export interface TooltipSettingsAnimation { - - /** Defines the animation effect for the tooltip that should be shown when the mouse hovers over rows/columns. - * @Default {none} - */ - effect?: ej.datavisualization.HeatMap.Effect|string; - - /** Defines the animation speed for the tooltip that should be shown when the mouse hovers over rows/columns. - * @Default {0} - */ - speed?: number; -} - -export interface TooltipSettings { - - /** Defines the tooltip that should be shown when the mouse hovers over rows/columns. - * @Default {null} - */ - templateId?: string; - - /** Defines the tooltip of associate that should be shown when the mouse hovers over rows/columns. - */ - associate?: ej.datavisualization.HeatMap.Associate|string; - - /** Enables/ disables the balloon for the tooltip to be shown - * @Default {true} - */ - isBalloon?: boolean; - - /** Defines various attributes of the Tooltip position - */ - position?: TooltipSettingsPosition; - - /** Defines the tooltip to be triggered. - * @Default {hover} - */ - trigger?: ej.datavisualization.HeatMap.Trigger|string; - - /** Defines the animation for the tooltip that should be shown when the mouse hovers over rows/columns. - */ - animation?: TooltipSettingsAnimation; -} - -export interface HeatMapCell { - - /** Specifies whether the cell content can be visible or not. - * @Default {ej.HeatMap.CellVisibility.Visible} - */ - showContent?: ej.datavisualization.HeatMap.CellVisibility|string; - - /** Specifies whether the cell color can be visible or not. - * @Default {true} - */ - showColor?: boolean; -} - -export interface DefaultColumnStyle { - - /** Specifies the alignment mode of the heat map column. - * @Default {ej.HeatMap.TextAlign.Center} - */ - textAlign?: any; - - /** Specifies the template id of the heat map column header. - */ - headerTemplateID?: string; - - /** Specifies the template id of all individual cell data of the heat map. - */ - templateID?: string; -} - -export interface ItemsMappingColumnStyle { - - /** Specifies the width of the heat map column. - * @Default {0} - */ - width?: number; - - /** Specifies the text align mode of the heat map column. - * @Default {ej.HeatMap.TextAlign.Center} - */ - textAlign?: string; - - /** Specifies the template id of the column header. - */ - headerTemplateID?: string; - - /** Specifies the template id of all individual cell data. - */ - templateID?: string; -} - -export interface ItemsMappingColumn { - - /** Specifies the name of the column or row. - */ - propertyName?: string; - - /** Specifies the value of the column or row. - */ - displayName?: string; -} - -export interface ItemsMappingRow { - - /** Specifies the name of the column or row. - */ - propertyName?: string; - - /** Specifies the value of the column or row. - */ - displayName?: string; -} - -export interface ItemsMappingValue { - - /** Specifies the name of the column or row. - */ - propertyName?: string; - - /** Specifies the value of the column or row. - */ - displayName?: string; -} - -export interface ItemsMappingHeaderMapping { - - /** Specifies the name of the column or row. - */ - propertyName?: string; - - /** Specifies the value of the column or row. - */ - displayName?: string; - - /** Specifies the property and display value of the header. - * @Default {null} - */ - columnStyle?: any; -} - -export interface ItemsMapping { - - /** Column settings for the individual heat map column. - * @Default {null} - */ - columnStyle?: ItemsMappingColumnStyle; - - /** Specifies the property and display value of the column. - * @Default {null} - */ - column?: ItemsMappingColumn; - - /** Specifies the property and display value of the heat map.row - * @Default {null} - */ - row?: ItemsMappingRow; - - /** Specifies the property and display value of the column value. - * @Default {null} - */ - value?: ItemsMappingValue; - - /** Specifies the property and display value of the header. - * @Default {null} - */ - headerMapping?: ItemsMappingHeaderMapping; - - /** Specifies the property and display value of the collection of column. - * @Default {[]} - */ - columnMapping?: any[]; -} - -export interface ColorMappingCollectionLabel { - - /** Enables/disables the bold style of the heat map label. - * @Default {false} - */ - bold?: boolean; - - /** Enables/disables the italic style of the heat map label. - * @Default {false} - */ - italic?: boolean; - - /** specifies the text value of the heat map label. - */ - text?: string; - - /** Specifies the text style of the heat map label. - * @Default {ej.HeatMap.TextDecoration.None} - */ - textDecoration?: ej.datavisualization.HeatMap.TextDecoration |string; - - /** Specifies the font size of the heat map label. - * @Default {10} - */ - fontSize?: number; - - /** Specifies the font family of the heat map label. - * @Default {Arial} - */ - fontFamily?: string; - - /** Specifies the font color of the heat map label. - * @Default {black} - */ - fontColor?: string; -} - -export interface ColorMappingCollection { - - /** Specifies the color of the heat map column data. - * @Default {white} - */ - color?: string; - - /** Specifies the color values of the heat map column data. - * @Default {0} - */ - value?: number; - - /** Specifies the label properties of the heat map color. - * @Default {null} - */ - label?: ColorMappingCollectionLabel; -} -} -namespace HeatMap { -enum Associate { -//Used to set the associate of tooltip as Target -Target, -//Used to set the associate of tooltip as MouseFollow -MouseFollow, -//Used to set the associate of tooltip as MouseEnter -MouseEnter, -} -} -namespace HeatMap { -enum Horizontal { -//Used to display the tooltip horizontally on left side of rows/columns -Left, -//Used to display the tooltip horizontally on center side of rows/columns -Center, -//Used to display the tooltip horizontally on right side of rows/columns -Right, -} -} -namespace HeatMap { -enum Vertical { -//Used to display the tooltip horizontally on left side of rows/columns -Top, -//Used to display the tooltip horizontally on center side of rows/columns -Center, -//Used to display the tooltip horizontally on right side of rows/columns -Bottom, -} -} -namespace HeatMap { -enum Trigger { -//Tooltip can be triggered on mouse hovers -Hover, -//Tooltip can be triggered on mouse click -Click, -} -} -namespace HeatMap { -enum Effect { -//Sets tooltip animation as None -None, -//Sets tooltip animation as Fade -Fade, -//Sets tooltip animation as Slide -Slide, -} -} -namespace HeatMap { -enum CellVisibility { -//Display the content of the cell -Visible, -//Hide the content of the cell -Hidden, -} -} -namespace HeatMap { -enum TextDecoration { -//Defines a line below the text -Underline, -//Defines a line above the text -Overline, -//Defines a line through the text -LineThrough, -//Defines a normal text. This is default -None, -} -} - -class HeatMapLegend extends ej.Widget { - static fn: HeatMapLegend; - constructor(element: JQuery | Element, options?: HeatMapLegend.Model); - static Locale: any; - model: HeatMapLegend.Model; - defaults: HeatMapLegend.Model; -} -export namespace HeatMapLegend { - -export interface Model { - - /** Specifies the width of the heatmap legend. - * @Default {null} - */ - width?: any; - - /** Specifies the height of the heatmap legend. - * @Default {null} - */ - height?: any; - - /** Specifies can enable responsive mode or not for heatmap legend. - * @Default {false} - */ - isResponsive?: boolean; - - /** Specifies whether the cell label can be shown or not. - * @Default {false} - */ - showLabel?: boolean; - - /** Specifies the color values of the column data. - * @Default {[]} - */ - colorMappingCollection?: ColorMappingCollection[]; - - /** Specifies the orientation of the heatmap legend - * @Default {ej.HeatMap.LegendOrientation.Horizontal} - */ - orientation?: ej.datavisualization.HeatMap.LegendOrientation|string; - - /** Specifies the legend mode as gradient or list. - * @Default {ej.HeatMap.LegendMode.Gradient} - */ - legendMode?: ej.datavisualization.HeatMap.LegendMode|string; -} - -export interface ColorMappingCollectionLabel { - - /** Enables/disables the bold style of the heatmap legend label. - * @Default {false} - */ - bold?: boolean; - - /** Enables/disables the italic style of the heatmap legend label. - * @Default {false} - */ - italic?: boolean; - - /** specifies the text value of the heatmap legend label. - */ - text?: string; - - /** Specifies the text style of the heatmap legend label. - * @Default {ej.HeatMap.TextDecoration.None} - */ - textDecoration?: ej.datavisualization.HeatMap.TextDecoration|string; - - /** Specifies the font size of the heatmap legend label. - * @Default {10} - */ - fontSize?: number; - - /** Specifies the font family of the heatmap legend label. - * @Default {Arial} - */ - fontFamily?: string; - - /** Specifies the font color of the heatmap legend label. - * @Default {black} - */ - fontColor?: string; -} - -export interface ColorMappingCollection { - - /** Specifies the color of the heatmap legend data. - * @Default {white} - */ - color?: string; - - /** Specifies the color values of the heatmap legend column data. - * @Default {0} - */ - value?: number; - - /** Specifies the label properties of the heatmap legend color. - * @Default {null} - */ - label?: ColorMappingCollectionLabel; -} -} -namespace HeatMap { -enum LegendOrientation { -//Scales the graphic content non-uniformly to the width and height of the diagram area -Horizontal, -//Used to align the image at the top left of diagram area -Vertical, -} -} -namespace HeatMap { -enum LegendMode { -//Scales the graphic content non-uniformly to the width and height of the diagram area -Gradient, -//Used to align the image at the top left of diagram area -List, -} -} - -class Sparkline extends ej.Widget { - static fn: Sparkline; - constructor(element: JQuery | Element, options?: Sparkline.Model); - static Locale: any; - model: Sparkline.Model; - defaults: Sparkline.Model; - - /** Redraws the entire sparkline. You can call this method whenever you update, add or remove points from the data source or whenever you want to refresh the UI. - * @returns {void} - */ - redraw(): void; -} -export namespace Sparkline { - -export interface Model { - - /** Background color of the plot area. - * @Default {transparent} - */ - background?: string; - - /** Fill color for the sparkline series. - * @Default {#33ccff} - */ - fill?: string; - - /** Border color of the series. - * @Default {null} - */ - stroke?: string; - - /** Options for customizing the color, opacity and width of the sparkline border. - */ - border?: Border; - - /** Border width of the series. - * @Default {1} - */ - width?: number; - - /** Opacity of the series. - * @Default {1} - */ - opacity?: number; - - /** Color for series high point. - * @Default {null} - */ - highPointColor?: string; - - /** Color for series low point. - * @Default {null} - */ - lowPointColor?: string; - - /** Color for series start point. - * @Default {null} - */ - startPointColor?: string; - - /** Color for series end point. - * @Default {null} - */ - endPointColor?: string; - - /** Color for series negative point. - * @Default {null} - */ - negativePointColor?: string; - - /** Options for customizing the color, opacity of the sparkline start and end range. - */ - rangeBandSettings?: RangeBandSettings; - - /** Name of a field in data source, where the fill color for all the data points is generated. - */ - palette?: string; - - /** Controls whether sparkline has to be responsive or not. - * @Default {true} - */ - isResponsive?: boolean; - - /** Controls whether Sparkline has to be rendered as Canvas or SVG.Canvas rendering supports all functionalities in SVG rendering. - * @Default {false} - */ - enableCanvasRendering?: boolean; - - /** Specifies the dataSource for the series. It can be an array of JSON objects or an instance of ej.DataManager. - * @Default {null} - */ - dataSource?: any; - - /** Name of the property in the datasource that contains x value for the series. - * @Default {null} - */ - xName?: string; - - /** Name of the property in the datasource that contains y value for the series. - * @Default {null} - */ - yName?: string; - - /** Gap or padding for sparkline. - * @Default {8} - */ - padding?: number; - - /** Specifies the type of the series to render in sparkline. - * @Default {line. See Type} - */ - type?: ej.datavisualization.Sparkline.Type|string; - - /** Specifies the theme for Sparkline. - * @Default {Flatlight. See Theme} - */ - theme?: ej.datavisualization.Sparkline.Theme|string; - - /** Options to customize the tooltip. - */ - tooltip?: Tooltip; - - /** Options for displaying and customizing marker for a data point. - */ - markerSettings?: MarkerSettings; - - /** Options to customize the Sparkline size. - */ - size?: Size; - - /** Options for customizing the color,dashArray and width of the axisLine. - */ - axisLineSettings?: AxisLineSettings; - - /** Fires before loading the sparkline. */ - load?(e: LoadEventArgs): void; - - /** Fires after loaded the sparkline. */ - loaded?(e: LoadedEventArgs): void; - - /** Fires before rendering trackball tooltip. You can use this event to customize the text displayed in trackball tooltip. */ - tooltipInitialize?(e: TooltipInitializeEventArgs): void; - - /** Fires before rendering a series. This event is fired for each series in Sparkline. */ - seriesRendering?(e: SeriesRenderingEventArgs): void; - - /** Fires when mouse is moved over a point. */ - pointRegionMouseMove?(e: PointRegionMouseMoveEventArgs): void; - - /** Fires on clicking a point in sparkline. You can use this event to handle clicks made on points. */ - pointRegionMouseClick?(e: PointRegionMouseClickEventArgs): void; - - /** Fires on moving mouse over the sparkline. */ - sparklineMouseMove?(e: SparklineMouseMoveEventArgs): void; - - /** Fires on moving mouse outside the sparkline. */ - sparklineMouseLeave?(e: SparklineMouseLeaveEventArgs): void; -} - -export interface LoadEventArgs { - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the sparkline model object - */ - model?: any; - - /** Name of the event - */ - type?: string; -} - -export interface LoadedEventArgs { - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the sparkline model object - */ - model?: any; - - /** Name of the event - */ - type?: string; -} - -export interface TooltipInitializeEventArgs { - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the sparkline model object - */ - model?: any; - - /** Name of the event - */ - type?: string; - - /** X Location of the trackball tooltip in pixels - */ - locationX?: any; - - /** Y Location of the trackball tooltip in pixels - */ - locationY?: any; - - /** Index of the point for which trackball tooltip is displayed - */ - pointIndex?: number; - - /** Text to be displayed in trackball tooltip. Use this option to add custom text in trackball tooltip - */ - currentText?: string; -} - -export interface SeriesRenderingEventArgs { - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the sparkline model object - */ - model?: any; - - /** Name of the event - */ - type?: string; - - /** Minimum x value of the data point - */ - minX?: any; - - /** Minimum y value of the data point - */ - minY?: any; - - /** Maximum x value of the data point - */ - maxX?: any; - - /** Maximum y value of the data point - */ - maxY?: any; -} - -export interface PointRegionMouseMoveEventArgs { - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the sparkline model object - */ - model?: any; - - /** Name of the event - */ - type?: string; - - /** X-coordinate of point in pixel - */ - locationX?: number; - - /** Y-coordinate of point in pixel - */ - locationY?: number; - - /** Index of the point in series - */ - pointIndex?: number; - - /** Type of the series - */ - seriesType?: string; -} - -export interface PointRegionMouseClickEventArgs { - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the sparkline model object - */ - model?: any; - - /** Name of the event - */ - type?: string; - - /** X-coordinate of point in pixel - */ - locationX?: number; - - /** Y-coordinate of point in pixel - */ - locationY?: number; - - /** Index of the point in series - */ - pointIndex?: number; - - /** Type of the series - */ - seriesType?: string; -} - -export interface SparklineMouseMoveEventArgs { - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the sparkline model object - */ - model?: any; - - /** Name of the event - */ - type?: string; -} - -export interface SparklineMouseLeaveEventArgs { - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the sparkline model object - */ - model?: any; - - /** Name of the event - */ - type?: string; -} - -export interface Border { - - /** Border color of the sparkline. - * @Default {transparent} - */ - color?: string; - - /** Width of the Sparkline border. - * @Default {1} - */ - width?: number; -} - -export interface RangeBandSettings { - - /** Start value of the range band. - * @Default {null} - */ - startRange?: number; - - /** End value of the range band. - * @Default {null} - */ - endRange?: number; - - /** Range band opacity of the series. - * @Default {1} - */ - opacity?: number; - - /** Range band color of the series. - * @Default {transparent} - */ - color?: string; -} - -export interface TooltipBorder { - - /** Border color of the tooltip. - * @Default {transparent} - */ - color?: string; - - /** Border width of the tooltip. - * @Default {1} - */ - width?: number; -} - -export interface TooltipFont { - - /** Font color of the text in the tooltip. - * @Default {#111111} - */ - color?: string; - - /** Font Family for the tooltip. - * @Default {Segoe UI} - */ - fontFamily?: string; - - /** Specifies the font Style for the tooltip. - * @Default {Normal} - */ - fontStyle?: ej.datavisualization.Sparkline.FontStyle|string; - - /** Specifies the font weight for the tooltip. - * @Default {Regular} - */ - fontWeight?: ej.datavisualization.Sparkline.FontWeight|string; - - /** Opacity for text in the tooltip. - * @Default {1} - */ - opacity?: number; - - /** Font size for text in the tooltip. - * @Default {8px} - */ - size?: string; -} - -export interface Tooltip { - - /** Show/hides the tooltip visibility. - * @Default {false} - */ - visible?: boolean; - - /** Fill color for the sparkline tooltip. - * @Default {white} - */ - fill?: string; - - /** Custom template to the tooltip. - */ - template?: string; - - /** Options for customizing the border of the tooltip. - */ - border?: TooltipBorder; - - /** Options for customizing the font of the tooltip. - */ - font?: TooltipFont; -} - -export interface MarkerSettingsBorder { - - /** Border color of the marker shape. - * @Default {transparent} - */ - color?: string; - - /** Controls the opacity of the marker border. - * @Default {1} - */ - opacity?: number; - - /** Border width of the marker shape. - * @Default {null} - */ - width?: number; -} - -export interface MarkerSettings { - - /** Controls the opacity of the marker. - * @Default {1} - */ - opacity?: number; - - /** Controls the visibility of the marker shape. - * @Default {false} - */ - visible?: boolean; - - /** width of the marker shape. - * @Default {2} - */ - width?: number; - - /** Color of the marker shape. - * @Default {white} - */ - fill?: string; - - /** Options for customizing the border of the marker shape. - */ - border?: MarkerSettingsBorder; -} - -export interface Size { - - /** Height of the Sparkline. Height can be specified in either pixel or percentage. - * @Default {''} - */ - height?: string; - - /** Width of the Sparkline. Width can be specified in either pixel or percentage. - * @Default {''} - */ - width?: string; -} - -export interface AxisLineSettings { - - /** Controls the visibility of the axis. - * @Default {false} - */ - visible?: boolean; - - /** Color of the axis line. - * @Default {'#111111'} - */ - color?: string; - - /** Width of the axis line. - * @Default {1} - */ - width?: number; - - /** Dash array of the axis line. - * @Default {1} - */ - dashArray?: number; -} -} -namespace Sparkline { -enum Type { -//string -Area, -//string -Line, -//string -Column, -//string -Pie, -//string -WinLoss, -} -} -namespace Sparkline { -enum Theme { -//string -Azure, -//string -FlatLight, -//string -FlatDark, -//string -Azuredark, -//string -Lime, -//string -LimeDark, -//string -Saffron, -//string -SaffronDark, -//string -GradientLight, -//string -GradientDark, -} -} -namespace Sparkline { -enum FontStyle { -//string -Normal, -//string -Italic, -} -} -namespace Sparkline { -enum FontWeight { -//string -Regular, -//string -Bold, -//string -Lighter, -} -} - -class SunburstChart extends ej.Widget { - static fn: SunburstChart; - constructor(element: JQuery | Element, options?: SunburstChart.Model); - static Locale: any; - model: SunburstChart.Model; - defaults: SunburstChart.Model; - - /** Redraws the entire sunburst. You can call this method whenever you update, add or remove points from the data source or whenever you want to refresh the UI. - * @returns {void} - */ - redraw(): void; - - /** destroy the sunburst - * @returns {void} - */ - _destroy(): void; -} -export namespace SunburstChart { - -export interface Model { - - /** Background color of the plot area. - * @Default {null} - */ - background?: string; - - /** Bind the data field from the data source. - * @Default {null} - */ - valueMemberPath?: string; - - /** Options for customizing the sunburst border. - */ - border?: Border; - - /** Options for customizing the sunburst segment border. - */ - segmentBorder?: SegmentBorder; - - /** Specifies the dataSource to the sunburst. - * @Default {null} - */ - dataSource?: any; - - /** Palette color for the data points. - * @Default {null} - */ - palette?: string; - - /** Parent node of the data points. - * @Default {null} - */ - parentNode?: string; - - /** Name of the property in the datasource that contains x values. - * @Default {null} - */ - xName?: string; - - /** Name of the property in the datasource that contains y values. - * @Default {null} - */ - yName?: string; - - /** Controls wheather sunburst has to be responsive or not. - * @Default {true} - */ - isResponsive?: boolean; - - /** Options to customize the Sunburst size. - */ - size?: Size; - - /** Controls the visibility of sunburst. - * @Default {true} - */ - visible?: boolean; - - /** Options to customize the Sunburst tooltip. - */ - tooltip?: Tooltip; - - /** Options for customizing sunburst points. - */ - points?: Points; - - /** Sunburst rendering will start from the specified value - * @Default {null} - */ - startAngle?: number; - - /** Sunburst rendering will end at the specified value - * @Default {null} - */ - endAngle?: number; - - /** Sunburst outer radius value - * @Default {1} - */ - radius?: number; - - /** Sunburst inner radius value - * @Default {0.4} - */ - innerRadius?: number; - - /** Options to customize the Sunburst dataLabel. - */ - dataLabelSettings?: DataLabelSettings; - - /** Options for customizing the title and subtitle of sunburst. - */ - title?: Title; - - /** Options for customizing the appearance of the levels or point while highlighting. - */ - highlightSettings?: HighlightSettings; - - /** Options for customizing the appearance of the levels or data point while selection. - */ - selectionSettings?: SelectionSettings; - - /** Specify levels of sunburst for grouped visualization of data - * @Default {[]} - */ - levels?: Level[]; - - /** Options to customize the legend items and legend title. - */ - legend?: Legend; - - /** Specifies the theme for Sunburst. - * @Default {Flatlight. See Theme} - */ - theme?: ej.datavisualization.Sunburst.SunburstTheme|string; - - /** Options to customize the left, right, top and bottom margins of sunburst area. - */ - margin?: Margin; - - /** Enable/disable the animation for all the levels. - * @Default {false} - */ - enableAnimation?: boolean; - - /** Opacity of the levels. - * @Default {1} - */ - opacity?: number; - - /** Options for enable zooming feature of chart. - */ - zoomSettings?: ZoomSettings; - - /** Animation type of sunburst - * @Default {rotation. See Alignment} - */ - animationType?: ej.datavisualization.Sunburst.Animation|string; - - /** Fires before loading. */ - load?(e: LoadEventArgs): void; - - /** Fires before rendering sunburst. */ - preRender?(e: PreRenderEventArgs): void; - - /** Fires after rendering sunburst. */ - loaded?(e: LoadedEventArgs): void; - - /** Fires before rendering the datalabel */ - dataLabelRendering?(e: DataLabelRenderingEventArgs): void; - - /** Fires before rendering each segment */ - segmentRendering?(e: SegmentRenderingEventArgs): void; - - /** Fires before rendering sunburst title. */ - titleRendering?(e: TitleRenderingEventArgs): void; - - /** Fires during initialization of tooltip. */ - tooltipInitialize?(e: TooltipInitializeEventArgs): void; - - /** Fires after clicking the point in sunburst */ - pointRegionClick?(e: PointRegionClickEventArgs): void; - - /** Fires while moving the mouse over sunburst points */ - pointRegionMousemove?(e: PointRegionMousemoveEventArgs): void; - - /** Fires when clicking the point to perform drilldown. */ - drillDownClick?(e: DrillDownClickEventArgs): void; - - /** Fires when resetting drilldown points. */ - drillDownBack?(e: DrillDownBackEventArgs): void; - - /** Fires after resetting the sunburst points */ - drillDownReset?(e: DrillDownResetEventArgs): void; -} - -export interface LoadEventArgs { - - /** Load event data - */ - data?: string; - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the sunburst model object - */ - model?: any; - - /** Name of the event - */ - type?: string; -} - -export interface PreRenderEventArgs { - - /** PreRender event data - */ - data?: string; - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the sunburst model object - */ - model?: any; - - /** Name of the event - */ - type?: string; -} - -export interface LoadedEventArgs { - - /** Loaded event data - */ - data?: string; - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the sunburst model object - */ - model?: any; - - /** Name of the event - */ - type?: string; -} - -export interface DataLabelRenderingEventArgs { - - /** Sunburst datalabel data - */ - data?: string; - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the sunburst model object - */ - model?: any; - - /** Name of the event - */ - type?: string; -} - -export interface SegmentRenderingEventArgs { - - /** Sunburst datalabel data - */ - data?: string; - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the sunburst model object - */ - model?: any; - - /** Name of the event - */ - type?: string; -} - -export interface TitleRenderingEventArgs { - - /** Sunburst title data - */ - data?: string; - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the sunburst model object - */ - model?: any; - - /** Name of the event - */ - type?: string; -} - -export interface TooltipInitializeEventArgs { - - /** Sunburst tooltip data - */ - data?: string; - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the sunburst model object - */ - model?: any; - - /** Name of the event - */ - type?: string; -} - -export interface PointRegionClickEventArgs { - - /** Includes clicked points region data - */ - data?: string; - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the sunburst model object - */ - model?: any; - - /** Name of the event - */ - type?: string; -} - -export interface PointRegionMousemoveEventArgs { - - /** Includes data of mouse moved region - */ - data?: string; - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the sunburst model object - */ - model?: any; - - /** Name of the event - */ - type?: string; -} - -export interface DrillDownClickEventArgs { - - /** Clicked point data - */ - data?: string; - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the sunburst model object - */ - model?: any; - - /** Name of the event - */ - type?: string; -} - -export interface DrillDownBackEventArgs { - - /** Drill down data of points - */ - data?: string; - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the sunburst model object - */ - model?: any; - - /** Name of the event - */ - type?: string; -} - -export interface DrillDownResetEventArgs { - - /** Drill down reset data - */ - data?: string; - - /** Set this option to true to cancel the event - */ - cancel?: boolean; - - /** Instance of the sunburst model object - */ - model?: any; - - /** Name of the event - */ - type?: string; -} - -export interface Border { - - /** Border color of the sunburst. - * @Default {null} - */ - color?: string; - - /** Width of the Sunburst border. - * @Default {2} - */ - width?: number; -} - -export interface SegmentBorder { - - /** Segment Border color of the sunburst. - * @Default {null} - */ - color?: string; - - /** Width of the Sunburst segment border. - * @Default {2} - */ - width?: number; -} - -export interface Size { - - /** Height of the Sunburst. - * @Default {''} - */ - height?: string; - - /** Width of the Sunburst. - * @Default {''} - */ - width?: string; -} - -export interface TooltipBorder { - - /** Border color of the tooltip. - * @Default {null} - */ - color?: string; - - /** Border width of the tooltip. - * @Default {5} - */ - width?: number; -} - -export interface TooltipFont { - - /** Font color of the text in the tooltip. - * @Default {null} - */ - color?: string; - - /** Font Family for the tooltip. - * @Default {Segoe UI} - */ - fontFamily?: string; - - /** Specifies the font Style for the tooltip. - * @Default {Normal} - */ - fontStyle?: ej.datavisualization.Sunburst.FontStyle|string; - - /** Specifies the font weight for the tooltip. - * @Default {Regular} - */ - fontWeight?: ej.datavisualization.Sunburst.FontWeight|string; - - /** Opacity for text in the tooltip. - * @Default {1} - */ - opacity?: number; - - /** Font size for text in the tooltip. - * @Default {12px} - */ - size?: string; -} - -export interface Tooltip { - - /** tooltip visibility of the Sunburst. - * @Default {true} - */ - visible?: boolean; - - /** Options for customizing the border of the sunburst tooltip. - */ - border?: TooltipBorder; - - /** Fill color for the sunburst tooltip. - * @Default {null} - */ - fill?: string; - - /** Options for customizing the font of the tooltip. - */ - font?: TooltipFont; - - /** Custom template to the tooltip. - * @Default {null} - */ - template?: string; -} - -export interface Points { - - /** Points x value of the sunburst. - * @Default {null} - */ - x?: string; - - /** Points y value of the sunburst. - * @Default {null} - */ - y?: number; - - /** Points text of the sunburst. - * @Default {null} - */ - text?: string; - - /** Points fill color of the sunburst. - * @Default {null} - */ - fill?: string; -} - -export interface DataLabelSettingsFont { - - /** Font family of the data label. - * @Default {Segoe UI} - */ - fontFamily?: string; - - /** Font style of the data label. - * @Default {normal. See FontStyle} - */ - fontStyle?: ej.datavisualization.Sunburst.FontStyle|string; - - /** Font weight of the data label. - * @Default {regular. See FontWeight} - */ - fontWeight?: ej.datavisualization.Sunburst.FontWeight|string; - - /** Opacity of the text. - * @Default {1} - */ - opacity?: number; - - /** Font color of the data label text. - * @Default {null} - */ - color?: string; - - /** Font size of the data label. - * @Default {12px} - */ - size?: string; -} - -export interface DataLabelSettings { - - /** Datalabel visibility of the Sunburst. - * @Default {false} - */ - visible?: boolean; - - /** Alginment of sunburst datalabel - * @Default {Angle. See DatalabelAlignment} - */ - labelRotationMode?: ej.datavisualization.Sunburst.SunburstLabelRotationMode|string; - - /** Options for customizing the data label font. - */ - font?: DataLabelSettingsFont; - - /** Custome template for datalabel - * @Default {null} - */ - template?: string; - - /** Fill color for the datalable - * @Default {null} - */ - fill?: string; - - /** Datalabel overflow mode - * @Default {Trim. See LabelOverflowMode} - */ - labelOverflowMode?: ej.datavisualization.Sunburst.SunburstLabelOverflowMode|string; -} - -export interface TitleFont { - - /** Font family for Sunburst title. - * @Default {Segoe UI} - */ - fontFamily?: string; - - /** Font style for Sunburst title. - * @Default {Normal. See FontStyle} - */ - fontStyle?: ej.datavisualization.Sunburst.FontStyle|string; - - /** Font weight for Sunburst title. - * @Default {Regular. See FontWeight} - */ - fontWeight?: ej.datavisualization.Sunburst.FontWeight|string; - - /** Opacity of the Sunburst title. - * @Default {1} - */ - opacity?: number; - - /** Font size for Sunburst title. - * @Default {20px} - */ - size?: string; -} - -export interface TitleSubtitleFont { - - /** Font family of sub title. - * @Default {Segoe UI} - */ - fontFamily?: string; - - /** Font style for sub title. - * @Default {Normal. See FontStyle} - */ - fontStyle?: ej.datavisualization.Sunburst.FontStyle|string; - - /** Font weight for sub title. - * @Default {Regular. See FontWeight} - */ - fontWeight?: ej.datavisualization.Sunburst.FontWeight|string; - - /** Opacity of the sub title. - * @Default {1} - */ - opacity?: number; - - /** Font size for sub title. - * @Default {12px} - */ - size?: string; -} - -export interface TitleSubtitle { - - /** Subtitle text for sunburst - */ - text?: string; - - /** Sub title text visibility for sunburst - * @Default {true} - */ - visible?: string; - - /** Sub title text alignment - * @Default {far. See TextAlignment} - */ - textAlignment?: ej.datavisualization.Sunburst.SunburstAlignment|string; - - /** Options for customizing the font of sub title. - */ - font?: TitleSubtitleFont; -} - -export interface Title { - - /** Title text for sunburst - */ - text?: string; - - /** Title text visibility for sunburst - * @Default {true} - */ - visible?: string; - - /** Title text alignment - * @Default {center. See TextAlignment} - */ - textAlignment?: ej.datavisualization.Sunburst.SunburstAlignment|string; - - /** Options for customizing the font of sunburst title. - */ - font?: TitleFont; - - /** Options to customize the sub title of Sunburst. - */ - subtitle?: TitleSubtitle; -} - -export interface HighlightSettings { - - /** Enables/disables the ability to highlight the levels or point interactively. - * @Default {false} - */ - enable?: boolean; - - /** Specifies whether the levels or point has to be highlighted. - * @Default {point. See Mode} - */ - mode?: ej.datavisualization.Sunburst.SunburstHighlightMode|string; - - /** Color of the levels/point on highlight. - * @Default {red} - */ - color?: string; - - /** Opacity of the levels/point on highlight. - * @Default {0.5} - */ - opacity?: number; - - /** Specifies whether the levels or data point has to be highlighted. - * @Default {opacity. See Mode} - */ - type?: ej.datavisualization.Sunburst.SunburstHighlightType|string; -} - -export interface SelectionSettings { - - /** Enables/disables the ability to select the levels or data point interactively. - * @Default {false} - */ - enable?: boolean; - - /** Specifies whether the levels or data point has to be selected. - * @Default {point. See Mode} - */ - mode?: ej.datavisualization.Sunburst.SunburstHighlightMode|string; - - /** Color of the levels/point on selection. - * @Default {green} - */ - color?: string; - - /** Opacity of the levels/point on selection. - * @Default {0.5} - */ - opacity?: number; - - /** Specifies whether the levels or data point has to be selected. - * @Default {opacity. See Mode} - */ - type?: ej.datavisualization.Sunburst.SunburstHighlightType|string; -} - -export interface Level { - - /** Specifies the group member path - * @Default {null} - */ - groupMemberPath?: string; -} - -export interface LegendBorder { - - /** Border color of the legend. - * @Default {null} - */ - color?: string; - - /** Border width of the legend. - * @Default {1} - */ - width?: number; -} - -export interface LegendFont { - - /** Font family for legend item text. - * @Default {Segoe UI} - */ - fontFamily?: string; - - /** Font style for legend item text. - * @Default {Normal. See FontStyle} - */ - fontStyle?: ej.datavisualization.Sunburst.FontStyle|string; - - /** Font weight for legend item text. - * @Default {Regular. See FontWeight} - */ - fontWeight?: ej.datavisualization.Sunburst.FontWeight|string; - - /** Font size for legend item text. - * @Default {12px} - */ - size?: string; -} - -export interface LegendItemStyle { - - /** Height of the shape in legend items. - * @Default {10} - */ - height?: number; - - /** Width of the shape in legend items. - * @Default {10} - */ - width?: number; -} - -export interface LegendLocation { - - /** X value or horizontal offset to position the legend in chart. - * @Default {0} - */ - x?: number; - - /** Y value or vertical offset to position the legend. - * @Default {0} - */ - y?: number; -} - -export interface LegendSize { - - /** Height of the legend. Height can be specified in either pixel or percentage. - * @Default {null} - */ - height?: string; - - /** Width of the legend. Width can be specified in either pixel or percentage. - * @Default {null} - */ - width?: string; -} - -export interface LegendTitleFont { - - /** Font family for the text in legend title. - * @Default {Segoe UI} - */ - fontFamily?: string; - - /** Font style for legend title. - * @Default {normal. See FontStyle} - */ - fontStyle?: ej.datavisualization.Sunburst.FontStyle|string; - - /** Font weight for legend title. - * @Default {normal. See FontWeight} - */ - fontWeight?: ej.datavisualization.Sunburst.FontWeight|string; - - /** Font size for legend title. - * @Default {12px} - */ - size?: string; -} - -export interface LegendTitle { - - /** Options to customize the font used for legend title - */ - font?: LegendTitleFont; - - /** Enables or disables the legend title. - * @Default {true} - */ - visible?: string; - - /** Text to be displayed in legend title. - */ - text?: string; - - /** Alignment of the legend title. - * @Default {center. See Alignment} - */ - textAlignment?: ej.datavisualization.Sunburst.SunburstAlignment|string; -} - -export interface Legend { - - /** Visibility of the legend. - * @Default {false} - */ - visible?: boolean; - - /** Interactive action of legend items. - * @Default {toggleSegmentVisibility. See Alignment} - */ - clickAction?: ej.datavisualization.Sunburst.SunburstClickAction|string; - - /** Horizontal alignment of the legend. - * @Default {Center. See Alignment} - */ - alignment?: ej.datavisualization.Sunburst.SunburstAlignment|string; - - /** Options for customizing the legend border. - */ - border?: LegendBorder; - - /** Number of columns to arrange the legend items. - * @Default {null} - */ - columnCount?: number; - - /** Number of rows to arrange the legend items. - * @Default {null} - */ - rowCount?: number; - - /** Options to customize the font used for legend item text. - */ - font?: LegendFont; - - /** Gap or padding between the legend items. - * @Default {10} - */ - itemPadding?: number; - - /** Options to customize the style of legend items. - */ - itemStyle?: LegendItemStyle; - - /** Options to customize the location of sunburst legend. Legend is placed in provided location only when value of position property is custom - */ - location?: LegendLocation; - - /** Places the legend at specified position. Legend can be placed at left, right, top or bottom of the chart area.To manually specify the location of legend, set custom as value to this property. - * @Default {Bottom. See Position} - */ - position?: ej.datavisualization.Sunburst.SunburstLegendPosition|string; - - /** Shape of the legend items. - * @Default {None. See Shape} - */ - shape?: ej.datavisualization.Sunburst.SunburstLegendShape|string; - - /** Options to customize the size of the legend. - */ - size?: LegendSize; - - /** Options to customize the legend title. - */ - title?: LegendTitle; -} - -export interface Margin { - - /** Spacing for the left margin of chart area. Setting positive value decreases the width of the chart area from left side. - * @Default {10} - */ - left?: number; - - /** Spacing for the right margin of chart area. Setting positive value decreases the width of the chart area from right side. - * @Default {10} - */ - right?: number; - - /** Spacing for the top margin of chart area. Setting positive value decreases the height of the chart area from the top. - * @Default {10} - */ - top?: number; - - /** Spacing for the bottom margin of the chart area. Setting positive value decreases the height of the chart area from the bottom. - * @Default {10} - */ - bottom?: number; -} - -export interface ZoomSettings { - - /** Enables or disables zooming. - * @Default {false} - */ - enable?: boolean; - - /** Toolbar horizontal alignment - * @Default {right. See Alignment} - */ - toolbarHorizontalAlignment?: ej.datavisualization.Sunburst.SunburstHorizontalAlignment|string; - - /** Toolbar vertical alignment - * @Default {top. See Alignment} - */ - toolbarVerticalAlignment?: ej.datavisualization.Sunburst.SunburstVerticalAlignment|string; -} -} -namespace Sunburst { -enum FontStyle { -//string -Normal, -//string -Italic, -} -} -namespace Sunburst { -enum FontWeight { -//string -Regular, -//string -Bold, -//string -Lighter, -} -} -namespace Sunburst { -enum SunburstLabelRotationMode { -//string -Angle, -//string -Normal, -} -} -namespace Sunburst { -enum SunburstLabelOverflowMode { -//string -Trim, -//string -Hide, -//string -None, -} -} -namespace Sunburst { -enum SunburstAlignment { -//string -Center, -//string -Near, -//string -Far, -} -} -namespace Sunburst { -enum SunburstHighlightMode { -//string -Point, -//string -Parent, -//string -Child, -//string -All, -} -} -namespace Sunburst { -enum SunburstHighlightType { -//string -Opacity, -//string -Color, -} -} -namespace Sunburst { -enum SunburstClickAction { -//string -None, -//string -ToggleSegmentVisibility, -//string -ToggleSegmentSelection, -} -} -namespace Sunburst { -enum SunburstLegendPosition { -//string -Left, -//string -Right, -//string -Top, -//string -Bottom, -} -} -namespace Sunburst { -enum SunburstLegendShape { -//string -Diamond, -//string -Pentagon, -//string -Rectangle, -//string -Circle, -//string -Cross, -//string -Triangle, -} -} -namespace Sunburst { -enum SunburstTheme { -//string -FlatLight, -//string -FlatDark, -} -} -namespace Sunburst { -enum SunburstHorizontalAlignment { -//string -Center, -//string -Left, -//string -Right, -} -} -namespace Sunburst { -enum SunburstVerticalAlignment { -//string -Top, -//string -Bottom, -//string -Middle, -} -} -namespace Sunburst { -enum Animation { -//string -Rotation, -//string -FadeIn, -} -} - -class Overview extends ej.Widget { - static fn: Overview; - constructor(element: JQuery | Element, options?: Overview.Model); - static Locale: any; - model: Overview.Model; - defaults: Overview.Model; -} -export namespace Overview { - -export interface Model { - - /** The sourceId property of overview should be set with the corresponding Diagram ID for you need the overall view. - * @Default {null} - */ - sourceID?: string; - - /** Defines the height of the overview - * @Default {400} - */ - height?: number; - - /** Defines the width of the overview - * @Default {250} - */ - width?: number; -} -} - -} - -interface JQueryXHR { - /** Returns the cancel option value. - */ - cancel?: boolean; -} -interface JQueryPromise { - /** Returns the cancel option value. - */ - cancel?: boolean; -} -interface JQueryDeferred extends JQueryPromise { - /** Returns the cancel option value. - */ - cancel?: boolean; -} -interface JQueryParam { - /** Returns the cancel option value. - */ - cancel?: boolean; -} -interface JQuery { - data(key: any): any; -} -interface Window { - ej: typeof ej; -} -interface JQuery { - -ejAccordion(options?: ej.Accordion.Model): JQuery; -ejAccordion(memberName: any, value?: any, param?: any): any; - -ejAutocomplete(options?: ej.Autocomplete.Model): JQuery; -ejAutocomplete(memberName: any, value?: any, param?: any): any; - -ejBarcode(options?: ej.datavisualization.Barcode.Model): JQuery; -ejBarcode(memberName: any, value?: any, param?: any): any; - -ejBulletGraph(options?: ej.datavisualization.BulletGraph.Model): JQuery; -ejBulletGraph(memberName: any, value?: any, param?: any): any; - -ejButton(options?: ej.Button.Model): JQuery; -ejButton(memberName: any, value?: any, param?: any): any; - -ejCaptcha(options?: ej.Captcha.Model): JQuery; -ejCaptcha(memberName: any, value?: any, param?: any): any; - -ejChart(options?: ej.datavisualization.Chart.Model): JQuery; -ejChart(memberName: any, value?: any, param?: any): any; - -ejCheckBox(options?: ej.CheckBox.Model): JQuery; -ejCheckBox(memberName: any, value?: any, param?: any): any; - -ejCircularGauge(options?: ej.datavisualization.CircularGauge.Model): JQuery; -ejCircularGauge(memberName: any, value?: any, param?: any): any; - -ejColorPicker(options?: ej.ColorPicker.Model): JQuery; -ejColorPicker(memberName: any, value?: any, param?: any): any; - -ejDatePicker(options?: ej.DatePicker.Model): JQuery; -ejDatePicker(memberName: any, value?: any, param?: any): any; - -ejDateRangePicker(options?: ej.DateRangePicker.Model): JQuery; -ejDateRangePicker(memberName: any, value?: any, param?: any): any; - -ejDateTimePicker(options?: ej.DateTimePicker.Model): JQuery; -ejDateTimePicker(memberName: any, value?: any, param?: any): any; - -ejDiagram(options?: ej.datavisualization.Diagram.Model): JQuery; -ejDiagram(memberName: any, value?: any, param?: any): any; - -ejDialog(options?: ej.Dialog.Model): JQuery; -ejDialog(memberName: any, value?: any, param?: any): any; - -ejDigitalGauge(options?: ej.datavisualization.DigitalGauge.Model): JQuery; -ejDigitalGauge(memberName: any, value?: any, param?: any): any; - -ejDocumentEditor(options?: ej.DocumentEditor.Model): JQuery; -ejDocumentEditor(memberName: any, value?: any, param?: any): any; - -ejDraggable(options?: ej.Draggable.Model): JQuery; -ejDraggable(memberName: any, value?: any, param?: any): any; - -ejDropDownList(options?: ej.DropDownList.Model): JQuery; -ejDropDownList(memberName: any, value?: any, param?: any): any; - -ejDroppable(options?: ej.Droppable.Model): JQuery; -ejDroppable(memberName: any, value?: any, param?: any): any; - -ejFileExplorer(options?: ej.FileExplorer.Model): JQuery; -ejFileExplorer(memberName: any, value?: any, param?: any): any; - -ejGantt(options?: ej.Gantt.Model): JQuery; -ejGantt(memberName: any, value?: any, param?: any): any; - -ejGrid(options?: ej.Grid.Model): JQuery; -ejGrid(memberName: any, value?: any, param?: any): any; - -ejGroupButton(options?: ej.GroupButton.Model): JQuery; -ejGroupButton(memberName: any, value?: any, param?: any): any; - -ejHeatMap(options?: ej.datavisualization.HeatMap.Model): JQuery; -ejHeatMap(memberName: any, value?: any, param?: any): any; - -ejHeatMapLegend(options?: ej.datavisualization.HeatMapLegend.Model): JQuery; -ejHeatMapLegend(memberName: any, value?: any, param?: any): any; - -ejKanban(options?: ej.Kanban.Model): JQuery; -ejKanban(memberName: any, value?: any, param?: any): any; - -ejLinearGauge(options?: ej.datavisualization.LinearGauge.Model): JQuery; -ejLinearGauge(memberName: any, value?: any, param?: any): any; - -ejListBox(options?: ej.ListBox.Model): JQuery; -ejListBox(memberName: any, value?: any, param?: any): any; - -ejListView(options?: ej.ListView.Model): JQuery; -ejListView(memberName: any, value?: any, param?: any): any; - -ejMap(options?: ej.datavisualization.Map.Model): JQuery; -ejMap(memberName: any, value?: any, param?: any): any; - -ejMaskEdit(options?: ej.MaskEdit.Model): JQuery; -ejMaskEdit(memberName: any, value?: any, param?: any): any; - -ejMenu(options?: ej.Menu.Model): JQuery; -ejMenu(memberName: any, value?: any, param?: any): any; - -ejNavigationDrawer(options?: ej.NavigationDrawer.Model): JQuery; -ejNavigationDrawer(memberName: any, value?: any, param?: any): any; - -ejOverview(options?: ej.datavisualization.Overview.Model): JQuery; -ejOverview(memberName: any, value?: any, param?: any): any; - -ejPager(options?: ej.Pager.Model): JQuery; -ejPager(memberName: any, value?: any, param?: any): any; - -ejPdfViewer(options?: ej.PdfViewer.Model): JQuery; -ejPdfViewer(memberName: any, value?: any, param?: any): any; - -ejPivotChart(options?: ej.PivotChart.Model): JQuery; -ejPivotChart(memberName: any, value?: any, param?: any): any; - -ejPivotClient(options?: ej.PivotClient.Model): JQuery; -ejPivotClient(memberName: any, value?: any, param?: any): any; - -ejPivotGauge(options?: ej.PivotGauge.Model): JQuery; -ejPivotGauge(memberName: any, value?: any, param?: any): any; - -ejPivotGrid(options?: ej.PivotGrid.Model): JQuery; -ejPivotGrid(memberName: any, value?: any, param?: any): any; - -ejPivotPager(options?: ej.PivotPager.Model): JQuery; -ejPivotPager(memberName: any, value?: any, param?: any): any; - -ejPivotSchemaDesigner(options?: ej.PivotSchemaDesigner.Model): JQuery; -ejPivotSchemaDesigner(memberName: any, value?: any, param?: any): any; - -ejPivotTreeMap(options?: ej.PivotTreeMap.Model): JQuery; -ejPivotTreeMap(memberName: any, value?: any, param?: any): any; - -ejProgressBar(options?: ej.ProgressBar.Model): JQuery; -ejProgressBar(memberName: any, value?: any, param?: any): any; - -ejRadialMenu(options?: ej.RadialMenu.Model): JQuery; -ejRadialMenu(memberName: any, value?: any, param?: any): any; - -ejRadialSlider(options?: ej.RadialSlider.Model): JQuery; -ejRadialSlider(memberName: any, value?: any, param?: any): any; - -ejRadioButton(options?: ej.RadioButton.Model): JQuery; -ejRadioButton(memberName: any, value?: any, param?: any): any; - -ejRangeNavigator(options?: ej.datavisualization.RangeNavigator.Model): JQuery; -ejRangeNavigator(memberName: any, value?: any, param?: any): any; - -ejRating(options?: ej.Rating.Model): JQuery; -ejRating(memberName: any, value?: any, param?: any): any; - -ejRecurrenceEditor(options?: ej.RecurrenceEditor.Model): JQuery; -ejRecurrenceEditor(memberName: any, value?: any, param?: any): any; - -ejReportViewer(options?: ej.ReportViewer.Model): JQuery; -ejReportViewer(memberName: any, value?: any, param?: any): any; - -ejResizable(options?: ej.Resizable.Model): JQuery; -ejResizable(memberName: any, value?: any, param?: any): any; - -ejRibbon(options?: ej.Ribbon.Model): JQuery; -ejRibbon(memberName: any, value?: any, param?: any): any; - -ejRotator(options?: ej.Rotator.Model): JQuery; -ejRotator(memberName: any, value?: any, param?: any): any; - -ejRTE(options?: ej.RTE.Model): JQuery; -ejRTE(memberName: any, value?: any, param?: any): any; - -ejSchedule(options?: ej.Schedule.Model): JQuery; -ejSchedule(memberName: any, value?: any, param?: any): any; - -ejScroller(options?: ej.Scroller.Model): JQuery; -ejScroller(memberName: any, value?: any, param?: any): any; - -ejSignature(options?: ej.Signature.Model): JQuery; -ejSignature(memberName: any, value?: any, param?: any): any; - -ejSlider(options?: ej.Slider.Model): JQuery; -ejSlider(memberName: any, value?: any, param?: any): any; - -ejSparkline(options?: ej.datavisualization.Sparkline.Model): JQuery; -ejSparkline(memberName: any, value?: any, param?: any): any; - -ejSpellCheck(options?: ej.SpellCheck.Model): JQuery; -ejSpellCheck(memberName: any, value?: any, param?: any): any; - -ejSplitButton(options?: ej.SplitButton.Model): JQuery; -ejSplitButton(memberName: any, value?: any, param?: any): any; - -ejSplitter(options?: ej.Splitter.Model): JQuery; -ejSplitter(memberName: any, value?: any, param?: any): any; - -ejSpreadsheet(options?: ej.Spreadsheet.Model): JQuery; -ejSpreadsheet(memberName: any, value?: any, param?: any): any; - -ejSunburstChart(options?: ej.datavisualization.SunburstChart.Model): JQuery; -ejSunburstChart(memberName: any, value?: any, param?: any): any; - -ejSymbolPalette(options?: ej.datavisualization.SymbolPalette.Model): JQuery; -ejSymbolPalette(memberName: any, value?: any, param?: any): any; - -ejTab(options?: ej.Tab.Model): JQuery; -ejTab(memberName: any, value?: any, param?: any): any; - -ejTagCloud(options?: ej.TagCloud.Model): JQuery; -ejTagCloud(memberName: any, value?: any, param?: any): any; - -ejNumericTextbox(options?: ej.Editor.Model): JQuery; -ejNumericTextbox(memberName: any, value?: any, param?: any): any; - -ejCurrencyTextbox(options?: ej.Editor.Model): JQuery; -ejCurrencyTextbox(memberName: any, value?: any, param?: any): any; - -ejPercentageTextbox(options?: ej.Editor.Model): JQuery; -ejPercentageTextbox(memberName: any, value?: any, param?: any): any; - -ejTile(options?: ej.Tile.Model): JQuery; -ejTile(memberName: any, value?: any, param?: any): any; - -ejTimePicker(options?: ej.TimePicker.Model): JQuery; -ejTimePicker(memberName: any, value?: any, param?: any): any; - -ejToggleButton(options?: ej.ToggleButton.Model): JQuery; -ejToggleButton(memberName: any, value?: any, param?: any): any; - -ejToolbar(options?: ej.Toolbar.Model): JQuery; -ejToolbar(memberName: any, value?: any, param?: any): any; - -ejTooltip(options?: ej.Tooltip.Model): JQuery; -ejTooltip(memberName: any, value?: any, param?: any): any; - -ejTreeGrid(options?: ej.TreeGrid.Model): JQuery; -ejTreeGrid(memberName: any, value?: any, param?: any): any; - -ejTreeMap(options?: ej.datavisualization.TreeMap.Model): JQuery; -ejTreeMap(memberName: any, value?: any, param?: any): any; - -ejTreeView(options?: ej.TreeView.Model): JQuery; -ejTreeView(memberName: any, value?: any, param?: any): any; - -ejUploadbox(options?: ej.Uploadbox.Model): JQuery; -ejUploadbox(memberName: any, value?: any, param?: any): any; - -ejWaitingPopup(options?: ej.WaitingPopup.Model): JQuery; -ejWaitingPopup(memberName: any, value?: any, param?: any): any; - -data(key: "ejAccordion"): ej.Accordion; -data(key: "ejAutocomplete"): ej.Autocomplete; -data(key: "ejBarcode"): ej.datavisualization.Barcode; -data(key: "ejBulletGraph"): ej.datavisualization.BulletGraph; -data(key: "ejButton"): ej.Button; -data(key: "ejCaptcha"): ej.Captcha; -data(key: "ejChart"): ej.datavisualization.Chart; -data(key: "ejCheckBox"): ej.CheckBox; -data(key: "ejCircularGauge"): ej.datavisualization.CircularGauge; -data(key: "ejColorPicker"): ej.ColorPicker; -data(key: "ejDatePicker"): ej.DatePicker; -data(key: "ejDateRangePicker"): ej.DateRangePicker; -data(key: "ejDateTimePicker"): ej.DateTimePicker; -data(key: "ejDiagram"): ej.datavisualization.Diagram; -data(key: "ejDialog"): ej.Dialog; -data(key: "ejDigitalGauge"): ej.datavisualization.DigitalGauge; -data(key: "ejDocumentEditor"): ej.DocumentEditor; -data(key: "ejDraggable"): ej.Draggable; -data(key: "ejDropDownList"): ej.DropDownList; -data(key: "ejDroppable"): ej.Droppable; -data(key: "ejFileExplorer"): ej.FileExplorer; -data(key: "ejGantt"): ej.Gantt; -data(key: "ejGrid"): ej.Grid; -data(key: "ejGroupButton"): ej.GroupButton; -data(key: "ejHeatMap"): ej.datavisualization.HeatMap; -data(key: "ejHeatMapLegend"): ej.datavisualization.HeatMapLegend; -data(key: "ejKanban"): ej.Kanban; -data(key: "ejLinearGauge"): ej.datavisualization.LinearGauge; -data(key: "ejListBox"): ej.ListBox; -data(key: "ejListView"): ej.ListView; -data(key: "ejMap"): ej.datavisualization.Map; -data(key: "ejMaskEdit"): ej.MaskEdit; -data(key: "ejMenu"): ej.Menu; -data(key: "ejNavigationDrawer"): ej.NavigationDrawer; -data(key: "ejOverview"): ej.datavisualization.Overview; -data(key: "ejPager"): ej.Pager; -data(key: "ejPdfViewer"): ej.PdfViewer; -data(key: "ejPivotChart"): ej.PivotChart; -data(key: "ejPivotClient"): ej.PivotClient; -data(key: "ejPivotGauge"): ej.PivotGauge; -data(key: "ejPivotGrid"): ej.PivotGrid; -data(key: "ejPivotPager"): ej.PivotPager; -data(key: "ejPivotSchemaDesigner"): ej.PivotSchemaDesigner; -data(key: "ejPivotTreeMap"): ej.PivotTreeMap; -data(key: "ejProgressBar"): ej.ProgressBar; -data(key: "ejRadialMenu"): ej.RadialMenu; -data(key: "ejRadialSlider"): ej.RadialSlider; -data(key: "ejRadioButton"): ej.RadioButton; -data(key: "ejRangeNavigator"): ej.datavisualization.RangeNavigator; -data(key: "ejRating"): ej.Rating; -data(key: "ejRecurrenceEditor"): ej.RecurrenceEditor; -data(key: "ejReportViewer"): ej.ReportViewer; -data(key: "ejResizable"): ej.Resizable; -data(key: "ejRibbon"): ej.Ribbon; -data(key: "ejRotator"): ej.Rotator; -data(key: "ejRTE"): ej.RTE; -data(key: "ejSchedule"): ej.Schedule; -data(key: "ejScroller"): ej.Scroller; -data(key: "ejSignature"): ej.Signature; -data(key: "ejSlider"): ej.Slider; -data(key: "ejSparkline"): ej.datavisualization.Sparkline; -data(key: "ejSpellCheck"): ej.SpellCheck; -data(key: "ejSplitButton"): ej.SplitButton; -data(key: "ejSplitter"): ej.Splitter; -data(key: "ejSpreadsheet"): ej.Spreadsheet; -data(key: "ejSunburstChart"): ej.datavisualization.SunburstChart; -data(key: "ejSymbolPalette"): ej.datavisualization.SymbolPalette; -data(key: "ejTab"): ej.Tab; -data(key: "ejTagCloud"): ej.TagCloud; -data(key: "ejNumericTextbox"): ej.NumericTextbox; -data(key: "ejCurrencyTextbox"): ej.CurrencyTextbox; -data(key: "ejPercentageTextbox"): ej.PercentageTextbox; -data(key: "ejTile"): ej.Tile; -data(key: "ejTimePicker"): ej.TimePicker; -data(key: "ejToggleButton"): ej.ToggleButton; -data(key: "ejToolbar"): ej.Toolbar; -data(key: "ejTooltip"): ej.Tooltip; -data(key: "ejTreeGrid"): ej.TreeGrid; -data(key: "ejTreeMap"): ej.datavisualization.TreeMap; -data(key: "ejTreeView"): ej.TreeView; -data(key: "ejUploadbox"): ej.Uploadbox; -data(key: "ejWaitingPopup"): ej.WaitingPopup; -} \ No newline at end of file diff --git a/ej.web.all/tslint.json b/ej.web.all/tslint.json deleted file mode 100644 index b0b7c81ba5..0000000000 --- a/ej.web.all/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } \ No newline at end of file diff --git a/electron-builder/electron-builder-tests.ts b/electron-builder/electron-builder-tests.ts deleted file mode 100644 index 8ae7479882..0000000000 --- a/electron-builder/electron-builder-tests.ts +++ /dev/null @@ -1,54 +0,0 @@ - - -import * as factory from "electron-builder"; -const builder = factory.init(); - -function callback(err: Error) { - const msg = err.message; -} - -builder.build({ - appPath: ".", - out: "out", - platform: "win", - config: { - osx: { - title: "myapplication", - icon: "icon.icns", - "icon-size": 80, - background: "installer.png", - contents: [ - { x: 438, y: 344, type: "link", path: "/Applications" }, - { x: 192, y: 344, type: "file" }, - ] - }, - win: { - title: "myapplication", - icon: "icon.ico" - } - } -}, callback); - -const bldr = require("electron-builder").init(); - -bldr.build({ - appPath: ".", - out: "out", - platform: "osx", - config: { - osx: { - title: "myapplication", - icon: "icon.icns", - "icon-size": 80, - background: "installer.png", - contents: [ - { x: 438, y: 344, type: "link", path: "/Applications" }, - { x: 192, y: 344, type: "file" }, - ] - }, - win: { - title: "myapplication", - icon: "icon.ico" - } - } -}, callback); diff --git a/electron-builder/index.d.ts b/electron-builder/index.d.ts deleted file mode 100644 index 3daa291b55..0000000000 --- a/electron-builder/index.d.ts +++ /dev/null @@ -1,90 +0,0 @@ -// Type definitions for electron-builder v2.0.2 -// Project: https://github.com/loopline-systems/electron-builder -// Definitions by: Maxime LUCE -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -declare namespace ElectronBuilder { - - /** Electron-builder Options. */ - export interface Options { - /** Source application path. */ - appPath: string; - - /** Platforms to build. Allowed values: win, osx, all. */ - platform: string; - - /** Path or Object. Configuration for build. */ - config: string | Config; - - /** The output directory. */ - out?: string; - - } - - /** Build configuration by platforms. */ - export interface Config { - /** Configurations for Mac OS X. */ - osx: { - /** Installer title. */ - title: string; - /** Installer background. */ - background: string; - /** Installer icon. */ - icon: string; - /** Installer icon size. */ - "icon-size": number; - /** Installer custom contents. */ - contents: [OsxContents, OsxContents] - }; - - /** Configurations for Windows. */ - win: { - /** Installer title. */ - title: string; - /** Installer icon. */ - icon: string; - }; - } - - /** OSX Installer custom contents. */ - export interface OsxContents { - /** Horizontal position on installer screen (in pixels). */ - x: number; - /** Vertical position on installer screen (in pixels). */ - y: number; - /** Content type. Allowed values are "file", "link". */ - type: string; - /** Link only. Customize link destination path. */ - path?: string; - } - - /** Electron-builder done callback. */ - export interface Callback { - /** - * Callback wich is called when electron-builder is done. - * @param err - Contains errors if any. - */ - (err: Error): void - } - - /** Prototype for electron-builder. */ - export interface Builder { - /** - * Build the installer for given platform. - * - * @param opts - Options to configure installer. - * @param callback - Callback which is called when building is done or an error occured. - */ - build(opts: Options, callback: Callback): void; - } -} - -declare module "electron-builder" { - export function init(): ElectronBuilder.Builder; -} - -interface NodeRequireFunction { - (id: "electron-builder"): { init(): ElectronBuilder.Builder }; -} diff --git a/electron-builder/tsconfig.json b/electron-builder/tsconfig.json deleted file mode 100644 index c1cf1c01eb..0000000000 --- a/electron-builder/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "electron-builder-tests.ts" - ] -} \ No newline at end of file diff --git a/electron/index.d.ts b/electron/index.d.ts deleted file mode 100644 index 0b98ae1944..0000000000 --- a/electron/index.d.ts +++ /dev/null @@ -1,6120 +0,0 @@ -// Type definitions for Electron v1.4.8 -// Project: http://electron.atom.io/ -// Definitions by: jedmao , rhysd , Milan Burda , aliib , Daniel Perez Alvarez -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -declare namespace Electron { - - interface Event { - preventDefault: Function; - sender: NodeJS.EventEmitter; - } - - type Point = { - x: number; - y: number; - } - - type Size = { - width: number; - height: number; - } - - type Rectangle = { - x: number; - y: number; - width: number; - height: number; - } - - interface Destroyable { - /** - * Destroys the object. - */ - destroy(): void; - /** - * @returns Whether the object is destroyed. - */ - isDestroyed(): boolean; - } - - // https://github.com/electron/electron/blob/master/docs/api/app.md - - type VibrancyType = 'appearance-based' | 'light' | 'dark' | 'titlebar' | 'selection' | 'menu' | 'popover' | 'sidebar' | 'medium-light' | 'ultra-dark'; - - /** - * The app module is responsible for controlling the application's lifecycle. - */ - interface App extends NodeJS.EventEmitter { - /** - * Emitted when the application has finished basic startup. - * On Windows and Linux, the will-finish-launching event - * is the same as the ready event; on macOS, this event represents - * the applicationWillFinishLaunching notification of NSApplication. - * You would usually set up listeners for the open-file and open-url events here, - * and start the crash reporter and auto updater. - * - * In most cases, you should just do everything in the ready event handler. - */ - on(event: 'will-finish-launching', listener: Function): this; - /** - * Emitted when Electron has finished initialization. - */ - on(event: 'ready', listener: (event: Event, launchInfo: Object) => void): this; - /** - * Emitted when all windows have been closed. - * - * If you do not subscribe to this event and all windows are closed, - * the default behavior is to quit the app; however, if you subscribe, - * you control whether the app quits or not. - * If the user pressed Cmd + Q, or the developer called app.quit(), - * Electron will first try to close all the windows and then emit the will-quit event, - * and in this case the window-all-closed event would not be emitted. - */ - on(event: 'window-all-closed', listener: Function): this; - /** - * Emitted before the application starts closing its windows. - * Calling event.preventDefault() will prevent the default behaviour, which is terminating the application. - */ - on(event: 'before-quit', listener: (event: Event) => void): this; - /** - * Emitted when all windows have been closed and the application will quit. - * Calling event.preventDefault() will prevent the default behaviour, which is terminating the application. - */ - on(event: 'will-quit', listener: (event: Event) => void): this; - /** - * Emitted when the application is quitting. - */ - on(event: 'quit', listener: (event: Event, exitCode: number) => void): this; - /** - * Emitted when the user wants to open a file with the application. - * The open-file event is usually emitted when the application is already open - * and the OS wants to reuse the application to open the file. - * open-file is also emitted when a file is dropped onto the dock and the application - * is not yet running. Make sure to listen for the open-file event very early - * in your application startup to handle this case (even before the ready event is emitted). - * - * You should call event.preventDefault() if you want to handle this event. - * - * Note: This is only implemented on macOS. - */ - on(event: 'open-file', listener: (event: Event, url: string) => void): this; - /** - * Emitted when the user wants to open a URL with the application. - * The URL scheme must be registered to be opened by your application. - * - * You should call event.preventDefault() if you want to handle this event. - * - * Note: This is only implemented on macOS. - */ - on(event: 'open-url', listener: (event: Event, url: string) => void): this; - /** - * Emitted when the application is activated, which usually happens when clicks on the applications’s dock icon. - * Note: This is only implemented on macOS. - */ - on(event: 'activate', listener: Function): this; - /** - * Emitted during Handoff when an activity from a different device wants to be resumed. - * You should call event.preventDefault() if you want to handle this event. - */ - on(event: 'continue-activity', listener: (event: Event, type: string, userInfo: Object) => void): this; - /** - * Emitted when a browserWindow gets blurred. - */ - on(event: 'browser-window-blur', listener: (event: Event, browserWindow: BrowserWindow) => void): this; - /** - * Emitted when a browserWindow gets focused. - */ - on(event: 'browser-window-focus', listener: (event: Event, browserWindow: BrowserWindow) => void): this; - /** - * Emitted when a new browserWindow is created. - */ - on(event: 'browser-window-created', listener: (event: Event, browserWindow: BrowserWindow) => void): this; - /** - * Emitted when a new webContents is created. - */ - on(event: 'web-contents-created', listener: (event: Event, webContents: WebContents) => void): this; - /** - * Emitted when failed to verify the certificate for url, to trust the certificate - * you should prevent the default behavior with event.preventDefault() and call callback(true). - */ - on(event: 'certificate-error', listener: (event: Event, - webContents: WebContents, - url: string, - error: string, - certificate: Certificate, - callback: (trust: boolean) => void - ) => void): this; - /** - * Emitted when a client certificate is requested. - * - * The url corresponds to the navigation entry requesting the client certificate - * and callback needs to be called with an entry filtered from the list. - * Using event.preventDefault() prevents the application from using the first certificate from the store. - */ - on(event: 'select-client-certificate', listener: (event: Event, - webContents: WebContents, - url: string, - certificateList: Certificate[], - callback: (certificate: Certificate) => void - ) => void): this; - /** - * Emitted when webContents wants to do basic auth. - * - * The default behavior is to cancel all authentications, to override this - * you should prevent the default behavior with event.preventDefault() - * and call callback(username, password) with the credentials. - */ - on(event: 'login', listener: (event: Event, - webContents: WebContents, - request: LoginRequest, - authInfo: LoginAuthInfo, - callback: (username: string, password: string) => void - ) => void): this; - /** - * Emitted when the gpu process crashes. - */ - on(event: 'gpu-process-crashed', listener: (event: Event, killed: boolean) => void): this; - /** - * Emitted when Chrome's accessibility support changes. - * - * Note: This API is only available on macOS and Windows. - */ - on(event: 'accessibility-support-changed', listener: (event: Event, accessibilitySupportEnabled: boolean) => void): this; - on(event: string, listener: Function): this; - /** - * Try to close all windows. The before-quit event will first be emitted. - * If all windows are successfully closed, the will-quit event will be emitted - * and by default the application would be terminated. - * - * This method guarantees all beforeunload and unload handlers are correctly - * executed. It is possible that a window cancels the quitting by returning - * false in beforeunload handler. - */ - quit(): void; - /** - * Exits immediately with exitCode. - * All windows will be closed immediately without asking user - * and the before-quit and will-quit events will not be emitted. - */ - exit(exitCode?: number): void; - /** - * Relaunches the app when current instance exits. - * - * By default the new instance will use the same working directory - * and command line arguments with current instance. - * When args is specified, the args will be passed as command line arguments instead. - * When execPath is specified, the execPath will be executed for relaunch instead of current app. - * - * Note that this method does not quit the app when executed, you have to call app.quit - * or app.exit after calling app.relaunch to make the app restart. - * - * When app.relaunch is called for multiple times, multiple instances - * will be started after current instance exited. - */ - relaunch(options?: { - args?: string[], - execPath?: string - }): void; - /** - * @returns Whether Electron has finished initializing. - */ - isReady(): boolean; - /** - * On Linux, focuses on the first visible window. - * On macOS, makes the application the active app. - * On Windows, focuses on the application’s first window. - */ - focus(): void; - /** - * Hides all application windows without minimizing them. - * Note: This is only implemented on macOS. - */ - hide(): void; - /** - * Shows application windows after they were hidden. Does not automatically focus them. - * Note: This is only implemented on macOS. - */ - show(): void; - /** - * Returns the current application directory. - */ - getAppPath(): string; - /** - * @returns The path to a special directory or file associated with name. - * On failure an Error would throw. - */ - getPath(name: AppPathName): string; - /** - * Overrides the path to a special directory or file associated with name. - * If the path specifies a directory that does not exist, the directory will - * be created by this method. On failure an Error would throw. - * - * You can only override paths of names defined in app.getPath. - * - * By default web pages' cookies and caches will be stored under userData - * directory, if you want to change this location, you have to override the - * userData path before the ready event of app module gets emitted. - */ - setPath(name: AppPathName, path: string): void; - /** - * @returns The version of loaded application, if no version is found in - * application's package.json, the version of current bundle or executable. - */ - getVersion(): string; - /** - * @returns The current application's name, the name in package.json would be used. - * Usually the name field of package.json is a short lowercased name, according to - * the spec of npm modules. So usually you should also specify a productName field, - * which is your application's full capitalized name, and it will be preferred over - * name by Electron. - */ - getName(): string; - /** - * Overrides the current application's name. - */ - setName(name: string): void; - /** - * @returns The current application locale. - */ - getLocale(): string; - /** - * Adds path to recent documents list. - * - * This list is managed by the system, on Windows you can visit the list from - * task bar, and on macOS you can visit it from dock menu. - * - * Note: This is only implemented on macOS and Windows. - */ - addRecentDocument(path: string): void; - /** - * Clears the recent documents list. - * - * Note: This is only implemented on macOS and Windows. - */ - clearRecentDocuments(): void; - /** - * Sets the current executable as the default handler for a protocol (aka URI scheme). - * Once registered, all links with your-protocol:// will be opened with the current executable. - * The whole link, including protocol, will be passed to your application as a parameter. - * - * On Windows you can provide optional parameters path, the path to your executable, - * and args, an array of arguments to be passed to your executable when it launches. - * - * @param protocol The name of your protocol, without ://. - * @param path Defaults to process.execPath. - * @param args Defaults to an empty array. - * - * Note: This is only implemented on macOS and Windows. - * On macOS, you can only register protocols that have been added to your app's info.plist. - */ - setAsDefaultProtocolClient(protocol: string, path?: string, args?: string[]): boolean; - /** - * Removes the current executable as the default handler for a protocol (aka URI scheme). - * - * @param protocol The name of your protocol, without ://. - * @param path Defaults to process.execPath. - * @param args Defaults to an empty array. - * - * Note: This is only implemented on macOS and Windows. - */ - removeAsDefaultProtocolClient(protocol: string, path?: string, args?: string[]): boolean; - /** - * @param protocol The name of your protocol, without ://. - * @param path Defaults to process.execPath. - * @param args Defaults to an empty array. - * - * @returns Whether the current executable is the default handler for a protocol (aka URI scheme). - * - * Note: This is only implemented on macOS and Windows. - */ - isDefaultProtocolClient(protocol: string, path?: string, args?: string[]): boolean; - /** - * Adds tasks to the Tasks category of JumpList on Windows. - * - * Note: This API is only available on Windows. - */ - setUserTasks(tasks: Task[]): boolean; - /** - * Note: This API is only available on Windows. - */ - getJumpListSettings(): JumpListSettings; - /** - * Sets or removes a custom Jump List for the application. - * - * If categories is null the previously set custom Jump List (if any) will be replaced - * by the standard Jump List for the app (managed by Windows). - * - * Note: This API is only available on Windows. - */ - setJumpList(categories: JumpListCategory[]): SetJumpListResult; - /** - * This method makes your application a Single Instance Application instead of allowing - * multiple instances of your app to run, this will ensure that only a single instance - * of your app is running, and other instances signal this instance and exit. - */ - makeSingleInstance(callback: (args: string[], workingDirectory: string) => void): boolean; - /** - * Releases all locks that were created by makeSingleInstance. This will allow - * multiple instances of the application to once again run side by side. - */ - releaseSingleInstance(): void; - /** - * Creates an NSUserActivity and sets it as the current activity. - * The activity is eligible for Handoff to another device afterward. - * - * @param type Uniquely identifies the activity. Maps to NSUserActivity.activityType. - * @param userInfo App-specific state to store for use by another device. - * @param webpageURL The webpage to load in a browser if no suitable app is - * installed on the resuming device. The scheme must be http or https. - * - * Note: This API is only available on macOS. - */ - setUserActivity(type: string, userInfo: Object, webpageURL?: string): void; - /** - * @returns The type of the currently running activity. - * - * Note: This API is only available on macOS. - */ - getCurrentActivityType(): string; - /** - * Changes the Application User Model ID to id. - * - * Note: This is only implemented on Windows. - */ - setAppUserModelId(id: string): void; - /** - * Imports the certificate in pkcs12 format into the platform certificate store. - * @param callback Called with the result of import operation, a value of 0 indicates success - * while any other value indicates failure according to chromium net_error_list. - * - * Note: This API is only available on Linux. - */ - importCertificate(options: ImportCertificateOptions, callback: (result: number) => void): void; - /** - * Disables hardware acceleration for current app. - * This method can only be called before app is ready. - */ - disableHardwareAcceleration(): void; - /** - * Sets the counter badge for current app. Setting the count to 0 will hide the badge. - * - * @returns True when the call succeeded, otherwise returns false. - * - * Note: This API is only available on macOS and Linux. - */ - setBadgeCount(count: number): boolean; - /** - * @returns The current value displayed in the counter badge. - * - * Note: This API is only available on macOS and Linux. - */ - getBadgeCount(): number; - /** - * @returns whether current desktop environment is Unity launcher. (Linux) - * - * Note: This API is only available on Linux. - */ - isUnityRunning(): boolean; - /** - * Returns a Boolean, true if Chrome's accessibility support is enabled, false otherwise. - * This API will return true if the use of assistive technologies, such as screen readers, - * has been detected. - * See https://www.chromium.org/developers/design-documents/accessibility for more details. - * - * Note: This API is only available on macOS and Windows. - */ - isAccessibilitySupportEnabled(): boolean; - /** - * @returns an Object with the login item settings of the app. - * - * Note: This API is only available on macOS and Windows. - */ - getLoginItemSettings(): LoginItemSettings; - /** - * Set the app's login item settings. - * - * Note: This API is only available on macOS and Windows. - */ - setLoginItemSettings(settings: LoginItemSettings): void; - /** - * Set the about panel options. This will override the values defined in the app's .plist file. - * See the Apple docs for more details. - * - * Note: This API is only available on macOS. - */ - setAboutPanelOptions(options: AboutPanelOptions): void; - commandLine: CommandLine; - /** - * Note: This API is only available on macOS. - */ - dock: Dock; - } - - type AppPathName = 'home'|'appData'|'userData'|'temp'|'exe'|'module'|'desktop'|'documents'|'downloads'|'music'|'pictures'|'videos'|'pepperFlashSystemPlugin'; - - interface ImportCertificateOptions { - /** - * Path for the pkcs12 file. - */ - certificate: string; - /** - * Passphrase for the certificate. - */ - password: string; - } - - interface CommandLine { - /** - * Append a switch [with optional value] to Chromium's command line. - * - * Note: This will not affect process.argv, and is mainly used by developers - * to control some low-level Chromium behaviors. - */ - appendSwitch(_switch: string, value?: string): void; - /** - * Append an argument to Chromium's command line. The argument will quoted properly. - * - * Note: This will not affect process.argv. - */ - appendArgument(value: string): void; - } - - interface Dock { - /** - * When critical is passed, the dock icon will bounce until either the - * application becomes active or the request is canceled. - * - * When informational is passed, the dock icon will bounce for one second. - * However, the request remains active until either the application becomes - * active or the request is canceled. - * - * @param type The default is informational. - * @returns An ID representing the request. - */ - bounce(type?: 'critical' | 'informational'): number; - /** - * Cancel the bounce of id. - * - * Note: This API is only available on macOS. - */ - cancelBounce(id: number): void; - /** - * Bounces the Downloads stack if the filePath is inside the Downloads folder. - * - * Note: This API is only available on macOS. - */ - downloadFinished(filePath: string): void; - /** - * Sets the string to be displayed in the dock’s badging area. - * - * Note: This API is only available on macOS. - */ - setBadge(text: string): void; - /** - * Returns the badge string of the dock. - * - * Note: This API is only available on macOS. - */ - getBadge(): string; - /** - * Hides the dock icon. - * - * Note: This API is only available on macOS. - */ - hide(): void; - /** - * Shows the dock icon. - * - * Note: This API is only available on macOS. - */ - show(): void; - /** - * @returns Whether the dock icon is visible. - * The app.dock.show() call is asynchronous so this method might not return true immediately after that call. - * - * Note: This API is only available on macOS. - */ - isVisible(): boolean; - /** - * Sets the application dock menu. - * - * Note: This API is only available on macOS. - */ - setMenu(menu: Menu): void; - /** - * Sets the image associated with this dock icon. - * - * Note: This API is only available on macOS. - */ - setIcon(icon: NativeImage | string): void; - } - - interface Task { - /** - * Path of the program to execute, usually you should specify process.execPath - * which opens current program. - */ - program: string; - /** - * The arguments of command line when program is executed. - */ - arguments: string; - /** - * The string to be displayed in a JumpList. - */ - title: string; - /** - * Description of this task. - */ - description?: string; - /** - * The absolute path to an icon to be displayed in a JumpList, it can be - * arbitrary resource file that contains an icon, usually you can specify - * process.execPath to show the icon of the program. - */ - iconPath: string; - /** - * The icon index in the icon file. If an icon file consists of two or more - * icons, set this value to identify the icon. If an icon file consists of - * one icon, this value is 0. - */ - iconIndex?: number; - } - - /** - * ok - Nothing went wrong. - * error - One or more errors occured, enable runtime logging to figure out the likely cause. - * invalidSeparatorError - An attempt was made to add a separator to a custom category in the Jump List. - * Separators are only allowed in the standard Tasks category. - * fileTypeRegistrationError - An attempt was made to add a file link to the Jump List - * for a file type the app isn't registered to handle. - * customCategoryAccessDeniedError - Custom categories can't be added to the Jump List - * due to user privacy or group policy settings. - */ - type SetJumpListResult = 'ok' | 'error' | 'invalidSeparatorError' | 'fileTypeRegistrationError' | 'customCategoryAccessDeniedError'; - - interface JumpListSettings { - /** - * The minimum number of items that will be shown in the Jump List. - */ - minItems: number; - /** - * Items that the user has explicitly removed from custom categories in the Jump List. - */ - removedItems: JumpListItem[]; - } - - interface JumpListCategory { - /** - * tasks - Items in this category will be placed into the standard Tasks category. - * frequent - Displays a list of files frequently opened by the app, the name of the category and its items are set by Windows. - * recent - Displays a list of files recently opened by the app, the name of the category and its items are set by Windows. - * custom - Displays tasks or file links, name must be set by the app. - */ - type?: 'tasks' | 'frequent' | 'recent' | 'custom'; - /** - * Must be set if type is custom, otherwise it should be omitted. - */ - name?: string; - /** - * Array of JumpListItem objects if type is tasks or custom, otherwise it should be omitted. - */ - items?: JumpListItem[]; - } - - interface JumpListItem { - /** - * task - A task will launch an app with specific arguments. - * separator - Can be used to separate items in the standard Tasks category. - * file - A file link will open a file using the app that created the Jump List. - */ - type: 'task' | 'separator' | 'file'; - /** - * Path of the file to open, should only be set if type is file. - */ - path?: string; - /** - * Path of the program to execute, usually you should specify process.execPath which opens the current program. - * Should only be set if type is task. - */ - program?: string; - /** - * The command line arguments when program is executed. Should only be set if type is task. - */ - args?: string; - /** - * The text to be displayed for the item in the Jump List. Should only be set if type is task. - */ - title?: string; - /** - * Description of the task (displayed in a tooltip). Should only be set if type is task. - */ - description?: string; - /** - * The absolute path to an icon to be displayed in a Jump List, which can be an arbitrary - * resource file that contains an icon (e.g. .ico, .exe, .dll). - * You can usually specify process.execPath to show the program icon. - */ - iconPath?: string; - /** - * The index of the icon in the resource file. If a resource file contains multiple icons - * this value can be used to specify the zero-based index of the icon that should be displayed - * for this task. If a resource file contains only one icon, this property should be set to zero. - */ - iconIndex?: number; - } - - interface LoginItemSettings { - /** - * True if the app is set to open at login. - */ - openAtLogin: boolean; - /** - * True if the app is set to open as hidden at login. This setting is only supported on macOS. - */ - openAsHidden: boolean; - /** - * True if the app was opened at login automatically. This setting is only supported on macOS. - */ - wasOpenedAtLogin?: boolean; - /** - * True if the app was opened as a hidden login item. This indicates that the app should not - * open any windows at startup. This setting is only supported on macOS. - */ - wasOpenedAsHidden?: boolean; - /** - * True if the app was opened as a login item that should restore the state from the previous session. - * This indicates that the app should restore the windows that were open the last time the app was closed. - * This setting is only supported on macOS. - */ - restoreState?: boolean; - } - - interface AboutPanelOptions { - /** - * The app's name. - */ - applicationName?: string; - /** - * The app's version. - */ - applicationVersion?: string; - /** - * Copyright information. - */ - copyright?: string; - /** - * Credit information. - */ - credits?: string; - /** - * The app's build version number. - */ - version?: string; - } - - // https://github.com/electron/electron/blob/master/docs/api/auto-updater.md - - /** - * This module provides an interface for the Squirrel auto-updater framework. - */ - interface AutoUpdater extends NodeJS.EventEmitter { - /** - * Emitted when there is an error while updating. - */ - on(event: 'error', listener: (error: Error) => void): this; - /** - * Emitted when checking if an update has started. - */ - on(event: 'checking-for-update', listener: Function): this; - /** - * Emitted when there is an available update. The update is downloaded automatically. - */ - on(event: 'update-available', listener: Function): this; - /** - * Emitted when there is no available update. - */ - on(event: 'update-not-available', listener: Function): this; - /** - * Emitted when an update has been downloaded. - * Note: On Windows only releaseName is available. - */ - on(event: 'update-downloaded', listener: (event: Event, releaseNotes: string, releaseName: string, releaseDate: Date, updateURL: string) => void): this; - on(event: string, listener: Function): this; - /** - * Set the url and initialize the auto updater. - */ - setFeedURL(url: string, requestHeaders?: Headers): void; - /** - * @returns The current update feed URL. - */ - getFeedURL(): string; - /** - * Ask the server whether there is an update, you have to call setFeedURL - * before using this API - */ - checkForUpdates(): void; - /** - * Restarts the app and installs the update after it has been downloaded. - * It should only be called after update-downloaded has been emitted. - */ - quitAndInstall(): void; - } - - // https://github.com/electron/electron/blob/master/docs/api/browser-window.md - - /** - * The BrowserWindow class gives you ability to create a browser window. - * You can also create a window without chrome by using Frameless Window API. - */ - class BrowserWindow extends NodeJS.EventEmitter implements Destroyable { - /** - * Emitted when the document changed its title, - * calling event.preventDefault() would prevent the native window’s title to change. - */ - on(event: 'page-title-updated', listener: (event: Event, title: string) => void): this; - /** - * Emitted when the window is going to be closed. It’s emitted before the beforeunload - * and unload event of the DOM. Calling event.preventDefault() will cancel the close. - */ - on(event: 'close', listener: (event: Event) => void): this; - /** - * Emitted when the window is closed. After you have received this event - * you should remove the reference to the window and avoid using it anymore. - */ - on(event: 'closed', listener: Function): this; - /** - * Emitted when the web page becomes unresponsive. - */ - on(event: 'unresponsive', listener: Function): this; - /** - * Emitted when the unresponsive web page becomes responsive again. - */ - on(event: 'responsive', listener: Function): this; - /** - * Emitted when the window loses focus. - */ - on(event: 'blur', listener: Function): this; - /** - * Emitted when the window gains focus. - */ - on(event: 'focus', listener: Function): this; - /** - * Emitted when the window is shown. - */ - on(event: 'show', listener: Function): this; - /** - * Emitted when the window is hidden. - */ - on(event: 'hide', listener: Function): this; - /** - * Emitted when the web page has been rendered and window can be displayed without visual flash. - */ - on(event: 'ready-to-show', listener: Function): this; - /** - * Emitted when window is maximized. - */ - on(event: 'maximize', listener: Function): this; - /** - * Emitted when the window exits from maximized state. - */ - on(event: 'unmaximize', listener: Function): this; - /** - * Emitted when the window is minimized. - */ - on(event: 'minimize', listener: Function): this; - /** - * Emitted when the window is restored from minimized state. - */ - on(event: 'restore', listener: Function): this; - /** - * Emitted when the window is getting resized. - */ - on(event: 'resize', listener: Function): this; - /** - * Emitted when the window is getting moved to a new position. - */ - on(event: 'move', listener: Function): this; - /** - * Emitted when the window enters full screen state. - */ - on(event: 'enter-full-screen', listener: Function): this; - /** - * Emitted when the window leaves full screen state. - */ - on(event: 'leave-full-screen', listener: Function): this; - /** - * Emitted when the window enters full screen state triggered by HTML API. - */ - on(event: 'enter-html-full-screen', listener: Function): this; - /** - * Emitted when the window leaves full screen state triggered by HTML API. - */ - on(event: 'leave-html-full-screen', listener: Function): this; - /** - * Emitted when an App Command is invoked. These are typically related - * to keyboard media keys or browser commands, as well as the "Back" / - * "Forward" buttons built into some mice on Windows. - * Note: This is only implemented on Windows. - */ - on(event: 'app-command', listener: (event: Event, command: string) => void): this; - /** - * Emitted when scroll wheel event phase has begun. - * Note: This is only implemented on macOS. - */ - on(event: 'scroll-touch-begin', listener: Function): this; - /** - * Emitted when scroll wheel event phase has ended. - * Note: This is only implemented on macOS. - */ - on(event: 'scroll-touch-end', listener: Function): this; - /** - * Emitted when scroll wheel event phase filed upon reaching the edge of element. - * Note: This is only implemented on macOS. - */ - on(event: 'scroll-touch-edge', listener: Function): this; - /** - * Emitted on 3-finger swipe. - * Note: This is only implemented on macOS. - */ - on(event: 'swipe', listener: (event: Event, direction: SwipeDirection) => void): this; - on(event: string, listener: Function): this; - /** - * Creates a new BrowserWindow with native properties as set by the options. - */ - constructor(options?: BrowserWindowOptions); - /** - * @returns All opened browser windows. - */ - static getAllWindows(): BrowserWindow[]; - /** - * @returns The window that is focused in this application. - */ - static getFocusedWindow(): BrowserWindow; - /** - * Find a window according to the webContents it owns. - */ - static fromWebContents(webContents: WebContents): BrowserWindow; - /** - * Find a window according to its ID. - */ - static fromId(id: number): BrowserWindow; - /** - * Adds devtools extension located at path. The extension will be remembered - * so you only need to call this API once, this API is not for programming use. - * @returns The extension's name. - * - * Note: This API cannot be called before the ready event of the app module is emitted. - */ - static addDevToolsExtension(path: string): string; - /** - * Remove a devtools extension. - * @param name The name of the devtools extension to remove. - * - * Note: This API cannot be called before the ready event of the app module is emitted. - */ - static removeDevToolsExtension(name: string): void; - /** - * @returns devtools extensions. - * - * Note: This API cannot be called before the ready event of the app module is emitted. - */ - static getDevToolsExtensions(): DevToolsExtensions; - /** - * The WebContents object this window owns, all web page related events and - * operations would be done via it. - * Note: Users should never store this object because it may become null when - * the renderer process (web page) has crashed. - */ - webContents: WebContents; - /** - * Get the unique ID of this window. - */ - id: number; - /** - * Force closing the window, the unload and beforeunload event won't be emitted - * for the web page, and close event would also not be emitted for this window, - * but it would guarantee the closed event to be emitted. - * You should only use this method when the renderer process (web page) has crashed. - */ - destroy(): void; - /** - * Try to close the window, this has the same effect with user manually clicking - * the close button of the window. The web page may cancel the close though, - * see the close event. - */ - close(): void; - /** - * Focus on the window. - */ - focus(): void; - /** - * Remove focus on the window. - */ - blur(): void; - /** - * @returns Whether the window is focused. - */ - isFocused(): boolean; - /** - * @returns Whether the window is destroyed. - */ - isDestroyed(): boolean; - /** - * Shows and gives focus to the window. - */ - show(): void; - /** - * Shows the window but doesn't focus on it. - */ - showInactive(): void; - /** - * Hides the window. - */ - hide(): void; - /** - * @returns Whether the window is visible to the user. - */ - isVisible(): boolean; - /** - * @returns Whether the window is a modal window. - */ - isModal(): boolean; - /** - * Maximizes the window. - */ - maximize(): void; - /** - * Unmaximizes the window. - */ - unmaximize(): void; - /** - * @returns Whether the window is maximized. - */ - isMaximized(): boolean; - /** - * Minimizes the window. On some platforms the minimized window will be - * shown in the Dock. - */ - minimize(): void; - /** - * Restores the window from minimized state to its previous state. - */ - restore(): void; - /** - * @returns Whether the window is minimized. - */ - isMinimized(): boolean; - /** - * Sets whether the window should be in fullscreen mode. - */ - setFullScreen(flag: boolean): void; - /** - * @returns Whether the window is in fullscreen mode. - */ - isFullScreen(): boolean; - /** - * This will have a window maintain an aspect ratio. - * The extra size allows a developer to have space, specified in pixels, - * not included within the aspect ratio calculations. - * This API already takes into account the difference between a window’s size and its content size. - * - * Note: This API is available only on macOS. - */ - setAspectRatio(aspectRatio: number, extraSize?: Size): void; - /** - * Uses Quick Look to preview a file at a given path. - * - * @param path The absolute path to the file to preview with QuickLook. - * @param displayName The name of the file to display on the Quick Look modal view. - * Note: This API is available only on macOS. - */ - previewFile(path: string, displayName?: string): void; - /** - * Resizes and moves the window to width, height, x, y. - */ - setBounds(options: Rectangle, animate?: boolean): void; - /** - * @returns The window's width, height, x and y values. - */ - getBounds(): Rectangle; - /** - * Resizes and moves the window's client area (e.g. the web page) to width, height, x, y. - */ - setContentBounds(options: Rectangle, animate?: boolean): void; - /** - * @returns The window's client area (e.g. the web page) width, height, x and y values. - */ - getContentBounds(): Rectangle; - /** - * Resizes the window to width and height. - */ - setSize(width: number, height: number, animate?: boolean): void; - /** - * @returns The window's width and height. - */ - getSize(): number[]; - /** - * Resizes the window's client area (e.g. the web page) to width and height. - */ - setContentSize(width: number, height: number, animate?: boolean): void; - /** - * @returns The window's client area's width and height. - */ - getContentSize(): number[]; - /** - * Sets the minimum size of window to width and height. - */ - setMinimumSize(width: number, height: number): void; - /** - * @returns The window's minimum width and height. - */ - getMinimumSize(): number[]; - /** - * Sets the maximum size of window to width and height. - */ - setMaximumSize(width: number, height: number): void; - /** - * @returns The window's maximum width and height. - */ - getMaximumSize(): number[]; - /** - * Sets whether the window can be manually resized by user. - */ - setResizable(resizable: boolean): void; - /** - * @returns Whether the window can be manually resized by user. - */ - isResizable(): boolean; - /** - * Sets whether the window can be moved by user. On Linux does nothing. - * Note: This API is available only on macOS and Windows. - */ - setMovable(movable: boolean): void; - /** - * Note: This API is available only on macOS and Windows. - * @returns Whether the window can be moved by user. On Linux always returns true. - */ - isMovable(): boolean; - /** - * Sets whether the window can be manually minimized by user. On Linux does nothing. - * Note: This API is available only on macOS and Windows. - */ - setMinimizable(minimizable: boolean): void; - /** - * Note: This API is available only on macOS and Windows. - * @returns Whether the window can be manually minimized by user. On Linux always returns true. - */ - isMinimizable(): boolean; - /** - * Sets whether the window can be manually maximized by user. On Linux does nothing. - * Note: This API is available only on macOS and Windows. - */ - setMaximizable(maximizable: boolean): void; - /** - * Note: This API is available only on macOS and Windows. - * @returns Whether the window can be manually maximized by user. On Linux always returns true. - */ - isMaximizable(): boolean; - /** - * Sets whether the maximize/zoom window button toggles fullscreen mode or maximizes the window. - */ - setFullScreenable(fullscreenable: boolean): void; - /** - * @returns Whether the maximize/zoom window button toggles fullscreen mode or maximizes the window. - */ - isFullScreenable(): boolean; - /** - * Sets whether the window can be manually closed by user. On Linux does nothing. - * Note: This API is available only on macOS and Windows. - */ - setClosable(closable: boolean): void; - /** - * Note: This API is available only on macOS and Windows. - * @returns Whether the window can be manually closed by user. On Linux always returns true. - */ - isClosable(): boolean; - /** - * Sets whether the window should show always on top of other windows. After - * setting this, the window is still a normal window, not a toolbox window - * which can not be focused on. - */ - setAlwaysOnTop(flag: boolean, level?: WindowLevel): void; - /** - * @returns Whether the window is always on top of other windows. - */ - isAlwaysOnTop(): boolean; - /** - * Moves window to the center of the screen. - */ - center(): void; - /** - * Moves window to x and y. - */ - setPosition(x: number, y: number, animate?: boolean): void; - /** - * @returns The window's current position. - */ - getPosition(): number[]; - /** - * Changes the title of native window to title. - */ - setTitle(title: string): void; - /** - * Note: The title of web page can be different from the title of the native window. - * @returns The title of the native window. - */ - getTitle(): string; - /** - * Changes the attachment point for sheets on macOS. - * Note: This API is available only on macOS. - */ - setSheetOffset(offsetY: number, offsetX?: number): void; - /** - * Starts or stops flashing the window to attract user's attention. - */ - flashFrame(flag: boolean): void; - /** - * Makes the window do not show in Taskbar. - */ - setSkipTaskbar(skip: boolean): void; - /** - * Enters or leaves the kiosk mode. - */ - setKiosk(flag: boolean): void; - /** - * @returns Whether the window is in kiosk mode. - */ - isKiosk(): boolean; - /** - * The native type of the handle is HWND on Windows, NSView* on macOS, - * and Window (unsigned long) on Linux. - * @returns The platform-specific handle of the window as Buffer. - */ - getNativeWindowHandle(): Buffer; - /** - * Hooks a windows message. The callback is called when the message is received in the WndProc. - * Note: This API is available only on Windows. - */ - hookWindowMessage(message: number, callback: Function): void; - /** - * @returns Whether the message is hooked. - */ - isWindowMessageHooked(message: number): boolean; - /** - * Unhook the window message. - */ - unhookWindowMessage(message: number): void; - /** - * Unhooks all of the window messages. - */ - unhookAllWindowMessages(): void; - /** - * Sets the pathname of the file the window represents, and the icon of the - * file will show in window's title bar. - * Note: This API is available only on macOS. - */ - setRepresentedFilename(filename: string): void; - /** - * Note: This API is available only on macOS. - * @returns The pathname of the file the window represents. - */ - getRepresentedFilename(): string; - /** - * Specifies whether the window’s document has been edited, and the icon in - * title bar will become grey when set to true. - * Note: This API is available only on macOS. - */ - setDocumentEdited(edited: boolean): void; - /** - * Note: This API is available only on macOS. - * @returns Whether the window's document has been edited. - */ - isDocumentEdited(): boolean; - focusOnWebView(): void; - blurWebView(): void; - /** - * Captures the snapshot of page within rect, upon completion the callback - * will be called. Omitting the rect would capture the whole visible page. - * Note: Be sure to read documents on remote buffer in remote if you are going - * to use this API in renderer process. - * @param callback Supplies the image that stores data of the snapshot. - */ - capturePage(rect: Rectangle, callback: (image: NativeImage) => void): void; - /** - * Captures the snapshot of page within rect, upon completion the callback - * will be called. Omitting the rect would capture the whole visible page. - * Note: Be sure to read documents on remote buffer in remote if you are going - * to use this API in renderer process. - * @param callback Supplies the image that stores data of the snapshot. - */ - capturePage(callback: (image: NativeImage) => void): void; - /** - * Same as webContents.loadURL(url). - */ - loadURL(url: string, options?: LoadURLOptions): void; - /** - * Same as webContents.reload. - */ - reload(): void; - /** - * Sets the menu as the window top menu. - * Note: This API is not available on macOS. - */ - setMenu(menu: Menu): void; - /** - * Sets the progress value in the progress bar. - * On Linux platform, only supports Unity desktop environment, you need to - * specify the *.desktop file name to desktopName field in package.json. - * By default, it will assume app.getName().desktop. - * @param progress Valid range is [0, 1.0]. If < 0, the progress bar is removed. - * If greater than 0, it becomes indeterminate. - */ - setProgressBar(progress: number, options?: { - /** - * Mode for the progress bar. - * Note: This is only implemented on Windows. - */ - mode: 'none' | 'normal' | 'indeterminate' | 'error' | 'paused' - }): void; - /** - * Sets a 16px overlay onto the current Taskbar icon, usually used to convey - * some sort of application status or to passively notify the user. - * Note: This API is only available on Windows 7 or above. - * @param overlay The icon to display on the bottom right corner of the Taskbar - * icon. If this parameter is null, the overlay is cleared - * @param description Provided to Accessibility screen readers. - */ - setOverlayIcon(overlay: NativeImage, description: string): void; - /** - * Sets whether the window should have a shadow. On Windows and Linux does nothing. - * Note: This API is available only on macOS. - */ - setHasShadow(hasShadow: boolean): void; - /** - * Note: This API is available only on macOS. - * @returns whether the window has a shadow. On Windows and Linux always returns true. - */ - hasShadow(): boolean; - /** - * Add a thumbnail toolbar with a specified set of buttons to the thumbnail image - * of a window in a taskbar button layout. - * @returns Whether the thumbnail has been added successfully. - * - * Note: This API is available only on Windows. - */ - setThumbarButtons(buttons: ThumbarButton[]): boolean; - /** - * Sets the region of the window to show as the thumbnail image displayed when hovering - * over the window in the taskbar. You can reset the thumbnail to be the entire window - * by specifying an empty region: {x: 0, y: 0, width: 0, height: 0}. - * - * Note: This API is available only on Windows. - */ - setThumbnailClip(region: Rectangle): boolean; - /** - * Sets the toolTip that is displayed when hovering over the window thumbnail in the taskbar. - * Note: This API is available only on Windows. - */ - setThumbnailToolTip(toolTip: string): boolean; - /** - * Same as webContents.showDefinitionForSelection(). - * Note: This API is available only on macOS. - */ - showDefinitionForSelection(): void; - /** - * Changes window icon. - * Note: This API is not available on macOS. - */ - setIcon(icon: NativeImage): void; - /** - * Sets whether the window menu bar should hide itself automatically. Once set - * the menu bar will only show when users press the single Alt key. - * If the menu bar is already visible, calling setAutoHideMenuBar(true) won't - * hide it immediately. - */ - setAutoHideMenuBar(hide: boolean): void; - /** - * @returns Whether menu bar automatically hides itself. - */ - isMenuBarAutoHide(): boolean; - /** - * Sets whether the menu bar should be visible. If the menu bar is auto-hide, - * users can still bring up the menu bar by pressing the single Alt key. - */ - setMenuBarVisibility(visibile: boolean): void; - /** - * @returns Whether the menu bar is visible. - */ - isMenuBarVisible(): boolean; - /** - * Sets whether the window should be visible on all workspaces. - * Note: This API does nothing on Windows. - */ - setVisibleOnAllWorkspaces(visible: boolean): void; - /** - * Note: This API always returns false on Windows. - * @returns Whether the window is visible on all workspaces. - */ - isVisibleOnAllWorkspaces(): boolean; - /** - * Makes the window ignore all mouse events. - * - * All mouse events happened in this window will be passed to the window below this window, - * but if this window has focus, it will still receive keyboard events. - */ - setIgnoreMouseEvents(ignore: boolean): void; - /** - * Prevents the window contents from being captured by other apps. - * - * On macOS it sets the NSWindow's sharingType to NSWindowSharingNone. - * On Windows it calls SetWindowDisplayAffinity with WDA_MONITOR. - */ - setContentProtection(enable: boolean): void; - /** - * Changes whether the window can be focused. - * Note: This API is available only on Windows. - */ - setFocusable(focusable: boolean): void; - /** - * Sets parent as current window's parent window, - * passing null will turn current window into a top-level window. - * Note: This API is not available on Windows. - */ - setParentWindow(parent: BrowserWindow): void; - /** - * @returns The parent window. - */ - getParentWindow(): BrowserWindow; - /** - * @returns All child windows. - */ - getChildWindows(): BrowserWindow[]; - /** - * Adds a vibrancy effect to the browser window. Passing null or - * an empty string will remove the vibrancy effect on the window. - * - * Note: This API is available only on macOS. - */ - setVibrancy(type: VibrancyType): void; - } - - type WindowLevel = 'normal' | 'floating' | 'torn-off-menu' | 'modal-panel' | 'main-menu' | 'status' | 'pop-up-menu' | 'screen-saver' | 'dock'; - type SwipeDirection = 'up' | 'right' | 'down' | 'left'; - type ThumbarButtonFlags = 'enabled' | 'disabled' | 'dismissonclick' | 'nobackground' | 'hidden' | 'noninteractive'; - - interface ThumbarButton { - icon: NativeImage | string; - click: Function; - tooltip?: string; - flags?: ThumbarButtonFlags[]; - } - - interface DevToolsExtensions { - [name: string]: { - name: string; - value: string; - } - } - - interface WebPreferences { - /** - * Whether to enable DevTools. - * If it is set to false, can not use BrowserWindow.webContents.openDevTools() to open DevTools. - * Default: true. - */ - devTools?: boolean; - /** - * Whether node integration is enabled. - * Default: true. - */ - nodeIntegration?: boolean; - /** - * Specifies a script that will be loaded before other scripts run in the page. - * This script will always have access to node APIs no matter whether node integration is turned on or off. - * The value should be the absolute file path to the script. - * When node integration is turned off, the preload script can reintroduce - * Node global symbols back to the global scope. - */ - preload?: string; - /** - * Sets the session used by the page. Instead of passing the Session object directly, - * you can also choose to use the partition option instead, which accepts a partition string. - * When both session and partition are provided, session would be preferred. - * Default: the default session. - */ - session?: Session; - /** - * Sets the session used by the page according to the session’s partition string. - * If partition starts with persist:, the page will use a persistent session available - * to all pages in the app with the same partition. if there is no persist: prefix, - * the page will use an in-memory session. By assigning the same partition, - * multiple pages can share the same session. - * Default: the default session. - */ - partition?: string; - /** - * The default zoom factor of the page, 3.0 represents 300%. - * Default: 1.0. - */ - zoomFactor?: number; - /** - * Enables JavaScript support. - * Default: true. - */ - javascript?: boolean; - /** - * When setting false, it will disable the same-origin policy (Usually using testing - * websites by people), and set allowDisplayingInsecureContent and allowRunningInsecureContent - * to true if these two options are not set by user. - * Default: true. - */ - webSecurity?: boolean; - /** - * Allow an https page to display content like images from http URLs. - * Default: false. - */ - allowDisplayingInsecureContent?: boolean; - /** - * Allow a https page to run JavaScript, CSS or plugins from http URLs. - * Default: false. - */ - allowRunningInsecureContent?: boolean; - /** - * Enables image support. - * Default: true. - */ - images?: boolean; - /** - * Make TextArea elements resizable. - * Default: true. - */ - textAreasAreResizable?: boolean; - /** - * Enables WebGL support. - * Default: true. - */ - webgl?: boolean; - /** - * Enables WebAudio support. - * Default: true. - */ - webaudio?: boolean; - /** - * Whether plugins should be enabled. - * Default: false. - */ - plugins?: boolean; - /** - * Enables Chromium’s experimental features. - * Default: false. - */ - experimentalFeatures?: boolean; - /** - * Enables Chromium’s experimental canvas features. - * Default: false. - */ - experimentalCanvasFeatures?: boolean; - /** - * Enables DirectWrite font rendering system on Windows. - * Default: true. - */ - directWrite?: boolean; - /** - * Enables scroll bounce (rubber banding) effect on macOS. - * Default: false. - */ - scrollBounce?: boolean; - /** - * A list of feature strings separated by ",", like CSSVariables,KeyboardEventKey to enable. - */ - blinkFeatures?: string; - /** - * A list of feature strings separated by ",", like CSSVariables,KeyboardEventKey to disable. - */ - disableBlinkFeatures?: string; - /** - * Sets the default font for the font-family. - */ - defaultFontFamily?: { - /** - * Default: Times New Roman. - */ - standard?: string; - /** - * Default: Times New Roman. - */ - serif?: string; - /** - * Default: Arial. - */ - sansSerif?: string; - /** - * Default: Courier New. - */ - monospace?: string; - }; - /** - * Default: 16. - */ - defaultFontSize?: number; - /** - * Default: 13. - */ - defaultMonospaceFontSize?: number; - /** - * Default: 0. - */ - minimumFontSize?: number; - /** - * Default: ISO-8859-1. - */ - defaultEncoding?: string; - /** - * Whether to throttle animations and timers when the page becomes background. - * Default: true. - */ - backgroundThrottling?: boolean; - /** - * Whether to enable offscreen rendering for the browser window. - * Default: false. - */ - offscreen?: boolean; - /** - * Whether to enable Chromium OS-level sandbox. - * Default: false. - */ - sandbox?: boolean; - } - - interface BrowserWindowOptions { - /** - * Window’s width in pixels. - * Default: 800. - */ - width?: number; - /** - * Window’s height in pixels. - * Default: 600. - */ - height?: number; - /** - * Window’s left offset from screen. - * Default: center the window. - */ - x?: number; - /** - * Window’s top offset from screen. - * Default: center the window. - */ - y?: number; - /** - * The width and height would be used as web page’s size, which means - * the actual window’s size will include window frame’s size and be slightly larger. - * Default: false. - */ - useContentSize?: boolean; - /** - * Show window in the center of the screen. - * Default: true - */ - center?: boolean; - /** - * Window’s minimum width. - * Default: 0. - */ - minWidth?: number; - /** - * Window’s minimum height. - * Default: 0. - */ - minHeight?: number; - /** - * Window’s maximum width. - * Default: no limit. - */ - maxWidth?: number; - /** - * Window’s maximum height. - * Default: no limit. - */ - maxHeight?: number; - /** - * Whether window is resizable. - * Default: true. - */ - resizable?: boolean; - /** - * Whether window is movable. - * Note: This is not implemented on Linux. - * Default: true. - */ - movable?: boolean; - /** - * Whether window is minimizable. - * Note: This is not implemented on Linux. - * Default: true. - */ - minimizable?: boolean; - /** - * Whether window is maximizable. - * Note: This is not implemented on Linux. - * Default: true. - */ - maximizable?: boolean; - /** - * Whether window is closable. - * Note: This is not implemented on Linux. - * Default: true. - */ - closable?: boolean; - /** - * Whether the window can be focused. - * On Windows setting focusable: false also implies setting skipTaskbar: true. - * On Linux setting focusable: false makes the window stop interacting with wm, - * so the window will always stay on top in all workspaces. - * Default: true. - */ - focusable?: boolean; - /** - * Whether the window should always stay on top of other windows. - * Default: false. - */ - alwaysOnTop?: boolean; - /** - * Whether the window should show in fullscreen. - * When explicitly set to false the fullscreen button will be hidden or disabled on macOS. - * Default: false. - */ - fullscreen?: boolean; - /** - * Whether the window can be put into fullscreen mode. - * On macOS, also whether the maximize/zoom button should toggle full screen mode or maximize window. - * Default: true. - */ - fullscreenable?: boolean; - /** - * Whether to show the window in taskbar. - * Default: false. - */ - skipTaskbar?: boolean; - /** - * The kiosk mode. - * Default: false. - */ - kiosk?: boolean; - /** - * Default window title. - * Default: "Electron". - */ - title?: string; - /** - * The window icon, when omitted on Windows the executable’s icon would be used as window icon. - */ - icon?: NativeImage|string; - /** - * Whether window should be shown when created. - * Default: true. - */ - show?: boolean; - /** - * Specify false to create a Frameless Window. - * Default: true. - */ - frame?: boolean; - /** - * Specify parent window. - * Default: null. - */ - parent?: BrowserWindow; - /** - * Whether this is a modal window. This only works when the window is a child window. - * Default: false. - */ - modal?: boolean; - /** - * Whether the web view accepts a single mouse-down event that simultaneously activates the window. - * Default: false. - */ - acceptFirstMouse?: boolean; - /** - * Whether to hide cursor when typing. - * Default: false. - */ - disableAutoHideCursor?: boolean; - /** - * Auto hide the menu bar unless the Alt key is pressed. - * Default: true. - */ - autoHideMenuBar?: boolean; - /** - * Enable the window to be resized larger than screen. - * Default: false. - */ - enableLargerThanScreen?: boolean; - /** - * Window’s background color as Hexadecimal value, like #66CD00 or #FFF or #80FFFFFF (alpha is supported). - * Default: #FFF (white). - */ - backgroundColor?: string; - /** - * Whether window should have a shadow. - * Note: This is only implemented on macOS. - * Default: true. - */ - hasShadow?: boolean; - /** - * Forces using dark theme for the window. - * Note: Only works on some GTK+3 desktop environments. - * Default: false. - */ - darkTheme?: boolean; - /** - * Makes the window transparent. - * Default: false. - */ - transparent?: boolean; - /** - * The type of window, default is normal window. - */ - type?: BrowserWindowType; - /** - * The style of window title bar. - */ - titleBarStyle?: 'default' | 'hidden' | 'hidden-inset'; - /** - * Use WS_THICKFRAME style for frameless windows on Windows - */ - thickFrame?: boolean; - /** - * Add a type of vibrancy effect to the window, only on macOS - */ - vibrancy?: VibrancyType; - /** - * Settings of web page’s features. - */ - webPreferences?: WebPreferences; - } - - type BrowserWindowType = BrowserWindowTypeLinux | BrowserWindowTypeMac | BrowserWindowTypeWindows; - type BrowserWindowTypeLinux = 'desktop' | 'dock' | 'toolbar' | 'splash' | 'notification'; - type BrowserWindowTypeMac = 'desktop' | 'textured'; - type BrowserWindowTypeWindows = 'toolbar'; - - // https://github.com/electron/electron/blob/master/docs/api/clipboard.md - - /** - * The clipboard module provides methods to perform copy and paste operations. - */ - interface Clipboard { - /** - * @returns The contents of the clipboard as plain text. - */ - readText(type?: ClipboardType): string; - /** - * Writes the text into the clipboard as plain text. - */ - writeText(text: string, type?: ClipboardType): void; - /** - * @returns The contents of the clipboard as markup. - */ - readHTML(type?: ClipboardType): string; - /** - * Writes markup to the clipboard. - */ - writeHTML(markup: string, type?: ClipboardType): void; - /** - * @returns The contents of the clipboard as a NativeImage. - */ - readImage(type?: ClipboardType): NativeImage; - /** - * Writes the image into the clipboard. - */ - writeImage(image: NativeImage, type?: ClipboardType): void; - /** - * @returns The contents of the clipboard as RTF. - */ - readRTF(type?: ClipboardType): string; - /** - * Writes the text into the clipboard in RTF. - */ - writeRTF(text: string, type?: ClipboardType): void; - /** - * Clears everything in clipboard. - */ - clear(type?: ClipboardType): void; - /** - * @returns Array available formats for the clipboard type. - */ - availableFormats(type?: ClipboardType): string[]; - /** - * Returns whether the clipboard supports the format of specified data. - * Note: This API is experimental and could be removed in future. - * @returns Whether the clipboard has data in the specified format. - */ - has(format: string, type?: ClipboardType): boolean; - /** - * Reads the data in the clipboard of the specified format. - * Note: This API is experimental and could be removed in future. - */ - read(format: string, type?: ClipboardType): string | NativeImage; - /** - * Writes data to the clipboard. - */ - write(data: { text: string; bookmark?: string; } | { rtf: string; } | { html: string; } | { image: NativeImage; }, type?: ClipboardType): void; - /** - * @returns An Object containing title and url keys representing the bookmark in the clipboard. - * - * Note: This API is available on macOS and Windows. - */ - readBookmark(): Bookmark; - /** - * Writes the title and url into the clipboard as a bookmark. - * - * Note: This API is available on macOS and Windows. - */ - writeBookmark(title: string, url: string, type?: ClipboardType): void; - /** - * The text on the find pasteboard. This method uses synchronous IPC when called from the renderer process. - * The cached value is reread from the find pasteboard whenever the application is activated. - * - * Note: This API is available on macOS. - */ - readFindText(): string; - /** - * Writes the text into the find pasteboard as plain text. - * This method uses synchronous IPC when called from the renderer process. - * - * Note: This API is available on macOS. - */ - writeFindText(text: string): void; - } - - type ClipboardType = '' | 'selection'; - - interface Bookmark { - title: string; - url: string; - } - - // https://github.com/electron/electron/blob/master/docs/api/content-tracing.md - - /** - * The content-tracing module is used to collect tracing data generated by the underlying Chromium content module. - * This module does not include a web interface so you need to open chrome://tracing/ - * in a Chrome browser and load the generated file to view the result. - */ - interface ContentTracing { - /** - * Get a set of category groups. The category groups can change as new code paths are reached. - * - * @param callback Called once all child processes have acknowledged the getCategories request. - */ - getCategories(callback: (categoryGroups: string[]) => void): void; - /** - * Start recording on all processes. Recording begins immediately locally and asynchronously - * on child processes as soon as they receive the EnableRecording request. - * - * @param callback Called once all child processes have acknowledged the startRecording request. - */ - startRecording(options: ContentTracingOptions, callback: Function): void; - /** - * Stop recording on all processes. Child processes typically are caching trace data and - * only rarely flush and send trace data back to the main process. That is because it may - * be an expensive operation to send the trace data over IPC, and we would like to avoid - * much runtime overhead of tracing. So, to end tracing, we must asynchronously ask all - * child processes to flush any pending trace data. - * - * @param resultFilePath Trace data will be written into this file if it is not empty, - * or into a temporary file. - * @param callback Called once all child processes have acknowledged the stopRecording request. - */ - stopRecording(resultFilePath: string, callback: (filePath: string) => void): void; - /** - * Start monitoring on all processes. Monitoring begins immediately locally and asynchronously - * on child processes as soon as they receive the startMonitoring request. - * - * @param callback Called once all child processes have acked to the startMonitoring request. - */ - startMonitoring(options: ContentTracingOptions, callback: Function): void; - /** - * Stop monitoring on all processes. - * - * @param callback Called once all child processes have acknowledged the stopMonitoring request. - */ - stopMonitoring(callback: Function): void; - /** - * Get the current monitoring traced data. Child processes typically are caching trace data - * and only rarely flush and send trace data back to the main process. That is because it may - * be an expensive operation to send the trace data over IPC, and we would like to avoid much - * runtime overhead of tracing. So, to end tracing, we must asynchronously ask all child - * processes to flush any pending trace data. - * - * @param callback Called once all child processes have acknowledged the captureMonitoringSnapshot request. - */ - captureMonitoringSnapshot(resultFilePath: string, callback: (filePath: string) => void): void; - /** - * Get the maximum usage across processes of trace buffer as a percentage of the full state. - * - * @param callback Called when the TraceBufferUsage value is determined. - */ - getTraceBufferUsage(callback: Function): void; - /** - * @param callback Called every time the given event occurs on any process. - */ - setWatchEvent(categoryName: string, eventName: string, callback: Function): void; - /** - * Cancel the watch event. This may lead to a race condition with the watch event callback if tracing is enabled. - */ - cancelWatchEvent(): void; - } - - interface ContentTracingOptions { - /** - * Filter to control what category groups should be traced. - * A filter can have an optional - prefix to exclude category groups - * that contain a matching category. Having both included and excluded - * category patterns in the same list is not supported. - * - * Examples: - * test_MyTest* - * test_MyTest*,test_OtherStuff - * -excluded_category1,-excluded_category2 - */ - categoryFilter: string; - /** - * Controls what kind of tracing is enabled, it is a comma-delimited list. - * - * Possible options are: - * record-until-full - * record-continuously - * trace-to-console - * enable-sampling - * enable-systrace - * - * The first 3 options are trace recoding modes and hence mutually exclusive. - * If more than one trace recording modes appear in the traceOptions string, - * the last one takes precedence. If none of the trace recording modes are specified, - * recording mode is record-until-full. - * - * The trace option will first be reset to the default option (record_mode set - * to record-until-full, enable_sampling and enable_systrace set to false) - * before options parsed from traceOptions are applied on it. - */ - traceOptions: string; - } - - // https://github.com/electron/electron/blob/master/docs/api/crash-reporter.md - - /** - * The crash-reporter module enables sending your app's crash reports. - */ - interface CrashReporter { - /** - * You are required to call this method before using other crashReporter APIs. - * - * Note: On macOS, Electron uses a new crashpad client, which is different from breakpad - * on Windows and Linux. To enable the crash collection feature, you are required to call - * the crashReporter.start API to initialize crashpad in the main process and in each - * renderer process from which you wish to collect crash reports. - */ - start(options: CrashReporterStartOptions): void; - /** - * @returns The crash report. When there was no crash report - * sent or the crash reporter is not started, null will be returned. - */ - getLastCrashReport(): CrashReport; - /** - * @returns All uploaded crash reports. - */ - getUploadedReports(): CrashReport[]; - } - - interface CrashReporterStartOptions { - /** - * Default: app.getName() - */ - productName?: string; - companyName: string; - /** - * URL that crash reports would be sent to as POST. - */ - submitURL: string; - /** - * Send the crash report without user interaction. - * Default: true. - */ - autoSubmit?: boolean; - /** - * Default: false. - */ - ignoreSystemCrashHandler?: boolean; - /** - * An object you can define that will be sent along with the report. - * Only string properties are sent correctly, nested objects are not supported. - */ - extra?: {[prop: string]: string}; - } - - interface CrashReport { - id: string; - date: Date; - } - - // https://github.com/electron/electron/blob/master/docs/api/desktop-capturer.md - - /** - * The desktopCapturer module can be used to get available sources - * that can be used to be captured with getUserMedia. - */ - interface DesktopCapturer { - /** - * Starts a request to get all desktop sources. - * - * Note: There is no guarantee that the size of source.thumbnail is always - * the same as the thumnbailSize in options. It also depends on the scale of the screen or window. - */ - getSources(options: DesktopCapturerOptions, callback: (error: Error, sources: DesktopCapturerSource[]) => any): void; - } - - interface DesktopCapturerOptions { - /** - * The types of desktop sources to be captured. - */ - types?: ('screen' | 'window')[]; - /** - * The suggested size that thumbnail should be scaled. - * Default: {width: 150, height: 150} - */ - thumbnailSize?: Size; - } - - interface DesktopCapturerSource { - /** - * The id of the captured window or screen used in navigator.webkitGetUserMedia. - * The format looks like window:XX or screen:XX where XX is a random generated number. - */ - id: string; - /** - * The described name of the capturing screen or window. - * If the source is a screen, the name will be Entire Screen or Screen ; - * if it is a window, the name will be the window’s title. - */ - name: string; - /** - * A thumbnail image. - */ - thumbnail: NativeImage; - } - - // https://github.com/electron/electron/blob/master/docs/api/dialog.md - - /** - * The dialog module provides APIs to show native system dialogs, such as opening files or alerting, - * so web applications can deliver the same user experience as native applications. - */ - interface Dialog { - /** - * Note: On Windows and Linux an open dialog can not be both a file selector and a directory selector, - * so if you set properties to ['openFile', 'openDirectory'] on these platforms, a directory selector will be shown. - * - * @param callback If supplied, the API call will be asynchronous. - * @returns On success, returns an array of file paths chosen by the user, - * otherwise returns undefined. - */ - showOpenDialog(browserWindow: BrowserWindow, options: OpenDialogOptions, callback?: (fileNames: string[]) => void): string[]; - /** - * Note: On Windows and Linux an open dialog can not be both a file selector and a directory selector, - * so if you set properties to ['openFile', 'openDirectory'] on these platforms, a directory selector will be shown. - * - * @param callback If supplied, the API call will be asynchronous. - * @returns On success, returns an array of file paths chosen by the user, - * otherwise returns undefined. - */ - showOpenDialog(options: OpenDialogOptions, callback?: (fileNames: string[]) => void): string[]; - /** - * @param callback If supplied, the API call will be asynchronous. - * @returns On success, returns the path of file chosen by the user, otherwise - * returns undefined. - */ - showSaveDialog(browserWindow: BrowserWindow, options: SaveDialogOptions, callback?: (fileName: string) => void): string; - /** - * @param callback If supplied, the API call will be asynchronous. - * @returns On success, returns the path of file chosen by the user, otherwise - * returns undefined. - */ - showSaveDialog(options: SaveDialogOptions, callback?: (fileName: string) => void): string; - /** - * Shows a message box. It will block until the message box is closed. - * @param callback If supplied, the API call will be asynchronous. - * @returns The index of the clicked button. - */ - showMessageBox(browserWindow: BrowserWindow, options: ShowMessageBoxOptions, callback?: (response: number) => void): number; - /** - * Shows a message box. It will block until the message box is closed. - * @param callback If supplied, the API call will be asynchronous. - * @returns The index of the clicked button. - */ - showMessageBox(options: ShowMessageBoxOptions, callback?: (response: number) => void): number; - /** - * Displays a modal dialog that shows an error message. - * - * This API can be called safely before the ready event the app module emits, - * it is usually used to report errors in early stage of startup. - * If called before the app readyevent on Linux, the message will be emitted to stderr, - * and no GUI dialog will appear. - */ - showErrorBox(title: string, content: string): void; - } - - interface OpenDialogOptions { - title?: string; - defaultPath?: string; - /** - * Custom label for the confirmation button, when left empty the default label will be used. - */ - buttonLabel?: string; - /** - * File types that can be displayed or selected. - */ - filters?: { - name: string; - /** - * Extensions without wildcards or dots (e.g. 'png' is good but '.png' and '*.png' are bad). - * To show all files, use the '*' wildcard (no other wildcard is supported). - */ - extensions: string[]; - }[]; - /** - * Contains which features the dialog should use. - */ - properties?: ('openFile' | 'openDirectory' | 'multiSelections' | 'createDirectory' | 'showHiddenFiles')[]; - } - - interface SaveDialogOptions { - title?: string; - defaultPath?: string; - /** - * Custom label for the confirmation button, when left empty the default label will be used. - */ - buttonLabel?: string; - /** - * File types that can be displayed, see dialog.showOpenDialog for an example. - */ - filters?: { - name: string; - extensions: string[]; - }[]; - } - - interface ShowMessageBoxOptions { - /** - * On Windows, "question" displays the same icon as "info", unless you set an icon using the "icon" option. - */ - type?: 'none' | 'info' | 'error' | 'question' | 'warning'; - /** - * Texts for buttons. On Windows, an empty array will result in one button labeled "OK". - */ - buttons?: string[]; - /** - * Index of the button in the buttons array which will be selected by default when the message box opens. - */ - defaultId?: number; - /** - * Title of the message box (some platforms will not show it). - */ - title?: string; - /** - * Contents of the message box. - */ - message?: string; - /** - * Extra information of the message. - */ - detail?: string; - icon?: NativeImage; - /** - * The value will be returned when user cancels the dialog instead of clicking the buttons of the dialog. - * By default it is the index of the buttons that have "cancel" or "no" as label, - * or 0 if there is no such buttons. On macOS and Windows the index of "Cancel" button - * will always be used as cancelId, not matter whether it is already specified. - */ - cancelId?: number; - /** - * On Windows Electron will try to figure out which one of the buttons are common buttons - * (like "Cancel" or "Yes"), and show the others as command links in the dialog. - * This can make the dialog appear in the style of modern Windows apps. - * If you don’t like this behavior, you can set noLink to true. - */ - noLink?: boolean; - } - - // https://github.com/electron/electron/blob/master/docs/api/download-item.md - - /** - * DownloadItem represents a download item in Electron. - */ - interface DownloadItem extends NodeJS.EventEmitter { - /** - * Emitted when the download has been updated and is not done. - */ - on(event: 'updated', listener: (event: Event, state: 'progressing' | 'interrupted') => void): this; - /** - * Emits when the download is in a terminal state. This includes a completed download, - * a cancelled download (via downloadItem.cancel()), and interrupted download that can’t be resumed. - */ - on(event: 'done', listener: (event: Event, state: 'completed' | 'cancelled' | 'interrupted') => void): this; - on(event: string, listener: Function): this; - /** - * Set the save file path of the download item. - * Note: The API is only available in session’s will-download callback function. - * If user doesn’t set the save path via the API, Electron will use the original - * routine to determine the save path (Usually prompts a save dialog). - */ - setSavePath(path: string): void; - /** - * @returns The save path of the download item. - * This will be either the path set via downloadItem.setSavePath(path) or the path selected from the shown save dialog. - */ - getSavePath(): string; - /** - * Pauses the download. - */ - pause(): void; - /** - * @returns Whether the download is paused. - */ - isPaused(): boolean; - /** - * Resumes the download that has been paused. - */ - resume(): void; - /** - * @returns Whether the download can resume. - */ - canResume(): boolean; - /** - * Cancels the download operation. - */ - cancel(): void; - /** - * @returns The origin url where the item is downloaded from. - */ - getURL(): string; - /** - * @returns The mime type. - */ - getMimeType(): string; - /** - * @returns Whether the download has user gesture. - */ - hasUserGesture(): boolean; - /** - * @returns The file name of the download item. - * Note: The file name is not always the same as the actual one saved in local disk. - * If user changes the file name in a prompted download saving dialog, - * the actual name of saved file will be different. - */ - getFilename(): string; - /** - * @returns The total size in bytes of the download item. If the size is unknown, it returns 0. - */ - getTotalBytes(): number; - /** - * @returns The received bytes of the download item. - */ - getReceivedBytes(): number; - /** - * @returns The Content-Disposition field from the response header. - */ - getContentDisposition(): string; - /** - * @returns The current state. - */ - getState(): 'progressing' | 'completed' | 'cancelled' | 'interrupted'; - } - - // https://github.com/electron/electron/blob/master/docs/api/global-shortcut.md - - /** - * The globalShortcut module can register/unregister a global keyboard shortcut - * with the operating system so that you can customize the operations for various shortcuts. - * Note: The shortcut is global; it will work even if the app does not have the keyboard focus. - * You should not use this module until the ready event of the app module is emitted. - */ - interface GlobalShortcut { - /** - * Registers a global shortcut of accelerator. - * @param accelerator Represents a keyboard shortcut. It can contain modifiers - * and key codes, combined by the "+" character. - * @param callback Called when the registered shortcut is pressed by the user. - */ - register(accelerator: string, callback: Function): void; - /** - * @param accelerator Represents a keyboard shortcut. It can contain modifiers - * and key codes, combined by the "+" character. - * @returns Whether the accelerator is registered. - */ - isRegistered(accelerator: string): boolean; - /** - * Unregisters the global shortcut of keycode. - * @param accelerator Represents a keyboard shortcut. It can contain modifiers - * and key codes, combined by the "+" character. - */ - unregister(accelerator: string): void; - /** - * Unregisters all the global shortcuts. - */ - unregisterAll(): void; - } - - // https://github.com/electron/electron/blob/master/docs/api/ipc-main.md - - /** - * The ipcMain module handles asynchronous and synchronous messages - * sent from a renderer process (web page). - * Messages sent from a renderer will be emitted to this module. - */ - interface IpcMain extends NodeJS.EventEmitter { - addListener(channel: string, listener: IpcMainEventListener): this; - on(channel: string, listener: IpcMainEventListener): this; - once(channel: string, listener: IpcMainEventListener): this; - removeListener(channel: string, listener: IpcMainEventListener): this; - removeAllListeners(channel?: string): this; - } - - type IpcMainEventListener = (event: IpcMainEvent, ...args: any[]) => void; - - interface IpcMainEvent { - /** - * Set this to the value to be returned in a synchronous message. - */ - returnValue?: any; - /** - * Returns the webContents that sent the message, you can call sender.send - * to reply to the asynchronous message. - */ - sender: WebContents; - } - - // https://github.com/electron/electron/blob/master/docs/api/ipc-renderer.md - - /** - * The ipcRenderer module provides a few methods so you can send synchronous - * and asynchronous messages from the render process (web page) to the main process. - * You can also receive replies from the main process. - */ - interface IpcRenderer extends NodeJS.EventEmitter { - addListener(channel: string, listener: IpcRendererEventListener): this; - on(channel: string, listener: IpcRendererEventListener): this; - once(channel: string, listener: IpcRendererEventListener): this; - removeListener(channel: string, listener: IpcRendererEventListener): this; - removeAllListeners(channel?: string): this; - /** - * Send ...args to the renderer via channel in asynchronous message, the main - * process can handle it by listening to the channel event of ipc module. - */ - send(channel: string, ...args: any[]): void; - /** - * Send ...args to the renderer via channel in synchronous message, and returns - * the result sent from main process. The main process can handle it by listening - * to the channel event of ipc module, and returns by setting event.returnValue. - * Note: Usually developers should never use this API, since sending synchronous - * message would block the whole renderer process. - * @returns The result sent from the main process. - */ - sendSync(channel: string, ...args: any[]): any; - /** - * Like ipc.send but the message will be sent to the host page instead of the main process. - * This is mainly used by the page in to communicate with host page. - */ - sendToHost(channel: string, ...args: any[]): void; - } - - type IpcRendererEventListener = (event: IpcRendererEvent, ...args: any[]) => void; - - interface IpcRendererEvent { - /** - * You can call sender.send to reply to the asynchronous message. - */ - sender: IpcRenderer; - } - - // https://github.com/electron/electron/blob/master/docs/api/menu-item.md - // https://github.com/electron/electron/blob/master/docs/api/accelerator.md - - /** - * The MenuItem allows you to add items to an application or context menu. - */ - class MenuItem { - /** - * Create a new menu item. - */ - constructor(options: MenuItemOptions); - - click: (menuItem: MenuItem, browserWindow: BrowserWindow, event: Event) => void; - /** - * Read-only property. - */ - type: MenuItemType; - /** - * Read-only property. - */ - role: MenuItemRole | MenuItemRoleMac; - /** - * Read-only property. - */ - accelerator: string; - /** - * Read-only property. - */ - icon: NativeImage | string; - /** - * Read-only property. - */ - submenu: Menu | MenuItemOptions[]; - - label: string; - sublabel: string; - enabled: boolean; - visible: boolean; - checked: boolean; - } - - type MenuItemType = 'normal' | 'separator' | 'submenu' | 'checkbox' | 'radio'; - type MenuItemRole = 'undo' | 'redo' | 'cut' | 'copy' | 'paste' | 'pasteandmatchstyle' | 'selectall' | 'delete' | 'minimize' | 'close' | 'quit' | 'togglefullscreen' | 'resetzoom' | 'zoomin' | 'zoomout' | 'reload' | 'toggledevtools'; - type MenuItemRoleMac = 'about' | 'hide' | 'hideothers' | 'unhide' | 'startspeaking' | 'stopspeaking' | 'front' | 'zoom' | 'window' | 'help' | 'services'; - - interface MenuItemOptions { - /** - * Callback when the menu item is clicked. - */ - click?: (menuItem: MenuItem, browserWindow: BrowserWindow) => void; - /** - * Can be normal, separator, submenu, checkbox or radio. - */ - type?: MenuItemType; - label?: string; - sublabel?: string; - /** - * An accelerator is string that represents a keyboard shortcut, it can contain - * multiple modifiers and key codes, combined by the + character. - * - * Examples: - * CommandOrControl+A - * CommandOrControl+Shift+Z - * - * Platform notice: - * On Linux and Windows, the Command key would not have any effect, - * you can use CommandOrControl which represents Command on macOS and Control on - * Linux and Windows to define some accelerators. - * - * Use Alt instead of Option. The Option key only exists on macOS, whereas - * the Alt key is available on all platforms. - * - * The Super key is mapped to the Windows key on Windows and Linux and Cmd on macOS. - * - * Available modifiers: - * Command (or Cmd for short) - * Control (or Ctrl for short) - * CommandOrControl (or CmdOrCtrl for short) - * Alt - * Option - * AltGr - * Shift - * Super - * - * Available key codes: - * 0 to 9 - * A to Z - * F1 to F24 - * Punctuations like ~, !, @, #, $, etc. - * Plus - * Space - * Tab - * Backspace - * Delete - * Insert - * Return (or Enter as alias) - * Up, Down, Left and Right - * Home and End - * PageUp and PageDown - * Escape (or Esc for short) - * VolumeUp, VolumeDown and VolumeMute - * MediaNextTrack, MediaPreviousTrack, MediaStop and MediaPlayPause - * PrintScreen - */ - accelerator?: string; - /** - * In Electron for the APIs that take images, you can pass either file paths - * or NativeImage instances. When passing null, an empty image will be used. - */ - icon?: NativeImage|string; - /** - * If false, the menu item will be greyed out and unclickable. - */ - enabled?: boolean; - /** - * If false, the menu item will be entirely hidden. - */ - visible?: boolean; - /** - * Should only be specified for 'checkbox' or 'radio' type menu items. - */ - checked?: boolean; - /** - * Should be specified for submenu type menu item, when it's specified the - * type: 'submenu' can be omitted for the menu item - */ - submenu?: Menu|MenuItemOptions[]; - /** - * Unique within a single menu. If defined then it can be used as a reference - * to this item by the position attribute. - */ - id?: string; - /** - * This field allows fine-grained definition of the specific location within - * a given menu. - */ - position?: string; - /** - * Define the action of the menu item, when specified the click property will be ignored - */ - role?: MenuItemRole | MenuItemRoleMac; - } - - // https://github.com/electron/electron/blob/master/docs/api/menu.md - - /** - * The Menu class is used to create native menus that can be used as application - * menus and context menus. This module is a main process module which can be used - * in a render process via the remote module. - * - * Each menu consists of multiple menu items, and each menu item can have a submenu. - */ - class Menu extends NodeJS.EventEmitter { - /** - * Creates a new menu. - */ - constructor(); - /** - * Sets menu as the application menu on macOS. On Windows and Linux, the menu - * will be set as each window's top menu. - */ - static setApplicationMenu(menu: Menu): void; - /** - * @returns The application menu if set, or null if not set. - */ - static getApplicationMenu(): Menu; - /** - * Sends the action to the first responder of application. - * This is used for emulating default Cocoa menu behaviors, - * usually you would just use the role property of MenuItem. - * - * Note: This method is macOS only. - */ - static sendActionToFirstResponder(action: string): void; - /** - * @param template Generally, just an array of options for constructing MenuItem. - * You can also attach other fields to element of the template, and they will - * become properties of the constructed menu items. - */ - static buildFromTemplate(template: MenuItemOptions[]): Menu; - /** - * Pops up this menu as a context menu in the browserWindow. You can optionally - * provide a (x,y) coordinate to place the menu at, otherwise it will be placed - * at the current mouse cursor position. - * @param x Horizontal coordinate where the menu will be placed. - * @param y Vertical coordinate where the menu will be placed. - */ - popup(browserWindow?: BrowserWindow, x?: number, y?: number): void; - /** - * Appends the menuItem to the menu. - */ - append(menuItem: MenuItem): void; - /** - * Inserts the menuItem to the pos position of the menu. - */ - insert(position: number, menuItem: MenuItem): void; - /** - * @returns an array containing the menu’s items. - */ - items: MenuItem[]; - } - - // https://github.com/electron/electron/blob/master/docs/api/native-image.md - - /** - * This class is used to represent an image. - */ - class NativeImage { - /** - * Creates an empty NativeImage instance. - */ - static createEmpty(): NativeImage; - /** - * Creates a new NativeImage instance from file located at path. - * This method returns an empty image if the path does not exist, cannot be read, or is not a valid image. - */ - static createFromPath(path: string): NativeImage; - /** - * Creates a new NativeImage instance from buffer. - * @param scaleFactor 1.0 by default. - */ - static createFromBuffer(buffer: Buffer, scaleFactor?: number): NativeImage; - /** - * Creates a new NativeImage instance from dataURL - */ - static createFromDataURL(dataURL: string): NativeImage; - /** - * @returns Buffer that contains the image's PNG encoded data. - */ - toPNG(): Buffer; - /** - * @returns Buffer that contains the image's JPEG encoded data. - */ - toJPEG(quality: number): Buffer; - /** - * @returns Buffer that contains a copy of the image's raw bitmap pixel data. - */ - toBitmap(): Buffer; - /** - * @returns Buffer that contains the image's raw bitmap pixel data. - * - * The difference between getBitmap() and toBitmap() is, getBitmap() does not copy the bitmap data, - * so you have to use the returned Buffer immediately in current event loop tick, - * otherwise the data might be changed or destroyed. - */ - getBitmap(): Buffer; - /** - * @returns The data URL of the image. - */ - toDataURL(): string; - /** - * The native type of the handle is NSImage* on macOS. - * Note: This is only implemented on macOS. - * @returns The platform-specific handle of the image as Buffer. - */ - getNativeHandle(): Buffer; - /** - * @returns Whether the image is empty. - */ - isEmpty(): boolean; - /** - * @returns The size of the image. - */ - getSize(): Size; - /** - * Marks the image as template image. - */ - setTemplateImage(option: boolean): void; - /** - * Returns a boolean whether the image is a template image. - */ - isTemplateImage(): boolean; - } - - // https://github.com/electron/electron/blob/master/docs/api/net.md - - /** - * The net module is a client-side API for issuing HTTP(S) requests. - * It is similar to the HTTP and HTTPS modules of Node.js but uses Chromium’s native - * networking library instead of the Node.js implementation, offering better support - * for web proxies. - * The following is a non-exhaustive list of why you may consider using the net module - * instead of the native Node.js modules: - * - Automatic management of system proxy configuration, support of the wpad protocol - * and proxy pac configuration files. - * - Automatic tunneling of HTTPS requests. - * - Support for authenticating proxies using basic, digest, NTLM, Kerberos or negotiate - * authentication schemes. - * - Support for traffic monitoring proxies: Fiddler-like proxies used for access control - * and monitoring. - * - * The net module API has been specifically designed to mimic, as closely as possible, - * the familiar Node.js API. The API components including classes, methods, - * properties and event names are similar to those commonly used in Node.js. - * - * The net API can be used only after the application emits the ready event. - * Trying to use the module before the ready event will throw an error. - */ - interface Net extends NodeJS.EventEmitter { - /** - * @param options The ClientRequest constructor options. - * @param callback A one time listener for the response event. - * - * @returns a ClientRequest instance using the provided options which are directly - * forwarded to the ClientRequest constructor. - */ - request(options: string | RequestOptions, callback?: (response: IncomingMessage) => void): ClientRequest; - } - - /** - * The RequestOptions interface allows to define various options for an HTTP request. - */ - interface RequestOptions { - /** - * The HTTP request method. Defaults to the GET method. - */ - method?: string; - /** - * The request URL. Must be provided in the absolute form with the protocol - * scheme specified as http or https. - */ - url?: string; - /** - * The Session instance with which the request is associated. - */ - session?: Session; - /** - * The name of the partition with which the request is associated. - * Defaults to the empty string. The session option prevails on partition. - * Thus if a session is explicitly specified, partition is ignored. - */ - partition?: string; - /** - * The protocol scheme in the form ‘scheme:’. Currently supported values are ‘http:’ or ‘https:’. - * Defaults to ‘http:’. - */ - protocol?: 'http:' | 'https:'; - /** - * The server host provided as a concatenation of the hostname and the port number ‘hostname:port’. - */ - host?: string; - /** - * The server host name. - */ - hostname?: string; - /** - * The server’s listening port number. - */ - port?: number; - /** - * The path part of the request URL. - */ - path?: string; - /** - * A map specifying extra HTTP header name/value. - */ - headers?: { [key: string]: any }; - } - - /** - * The ClientRequest class represents an HTTP request. - */ - class ClientRequest extends NodeJS.EventEmitter { - /** - * Emitted when an HTTP response is received for the request. - */ - on(event: 'response', listener: (response: IncomingMessage) => void): this; - /** - * Emitted when an authenticating proxy is asking for user credentials. - * The callback function is expected to be called back with user credentials. - * Providing empty credentials will cancel the request and report an authentication - * error on the response object. - */ - on(event: 'login', listener: (authInfo: LoginAuthInfo, callback: (username?: string, password?: string) => void) => void): this; - /** - * Emitted just after the last chunk of the request’s data has been written into - * the request object. - */ - on(event: 'finish', listener: () => void): this; - /** - * Emitted when the request is aborted. The abort event will not be fired if the - * request is already closed. - */ - on(event: 'abort', listener: () => void): this; - /** - * Emitted when the net module fails to issue a network request. - * Typically when the request object emits an error event, a close event will - * subsequently follow and no response object will be provided. - */ - on(event: 'error', listener: (error: Error) => void): this; - /** - * Emitted as the last event in the HTTP request-response transaction. - * The close event indicates that no more events will be emitted on either the - * request or response objects. - */ - on(event: 'close', listener: () => void): this; - on(event: string, listener: Function): this; - /** - * A Boolean specifying whether the request will use HTTP chunked transfer encoding or not. - * Defaults to false. The property is readable and writable, however it can be set only before - * the first write operation as the HTTP headers are not yet put on the wire. - * Trying to set the chunkedEncoding property after the first write will throw an error. - * - * Using chunked encoding is strongly recommended if you need to send a large request - * body as data will be streamed in small chunks instead of being internally buffered - * inside Electron process memory. - */ - chunkedEncoding: boolean; - /** - * @param options If options is a String, it is interpreted as the request URL. - * If it is an object, it is expected to be a RequestOptions. - * @param callback A one time listener for the response event. - */ - constructor(options: string | RequestOptions, callback?: (response: IncomingMessage) => void); - /** - * Adds an extra HTTP header. The header name will issued as it is without lowercasing. - * It can be called only before first write. Calling this method after the first write - * will throw an error. - * @param name An extra HTTP header name. - * @param value An extra HTTP header value. - */ - setHeader(name: string, value: string): void; - /** - * @param name Specify an extra header name. - * @returns The value of a previously set extra header name. - */ - getHeader(name: string): string; - /** - * Removes a previously set extra header name. This method can be called only before first write. - * Trying to call it after the first write will throw an error. - * @param name Specify an extra header name. - */ - removeHeader(name: string): void; - /** - * Adds a chunk of data to the request body. The first write operation may cause the - * request headers to be issued on the wire. - * After the first write operation, it is not allowed to add or remove a custom header. - * @param chunk A chunk of the request body’s data. If it is a string, it is converted - * into a Buffer using the specified encoding. - * @param encoding Used to convert string chunks into Buffer objects. Defaults to ‘utf-8’. - * @param callback Called after the write operation ends. - */ - write(chunk: string | Buffer, encoding?: string, callback?: Function): boolean; - /** - * Sends the last chunk of the request data. Subsequent write or end operations will not be allowed. - * The finish event is emitted just after the end operation. - * @param chunk A chunk of the request body’s data. If it is a string, it is converted into - * a Buffer using the specified encoding. - * @param encoding Used to convert string chunks into Buffer objects. Defaults to ‘utf-8’. - * @param callback Called after the write operation ends. - * - */ - end(chunk?: string | Buffer, encoding?: string, callback?: Function): boolean; - /** - * Cancels an ongoing HTTP transaction. If the request has already emitted the close event, - * the abort operation will have no effect. - * Otherwise an ongoing event will emit abort and close events. - * Additionally, if there is an ongoing response object,it will emit the aborted event. - */ - abort(): void - } - - /** - * An IncomingMessage represents an HTTP response. - */ - interface IncomingMessage extends NodeJS.ReadableStream { - /** - * The data event is the usual method of transferring response data into applicative code. - */ - on(event: 'data', listener: (chunk: Buffer) => void): this; - /** - * Indicates that response body has ended. - */ - on(event: 'end', listener: () => void): this; - /** - * Emitted when a request has been canceled during an ongoing HTTP transaction. - */ - on(event: 'aborted', listener: () => void): this; - /** - * Emitted when an error was encountered while streaming response data events. - * For instance, if the server closes the underlying while the response is still - * streaming, an error event will be emitted on the response object and a close - * event will subsequently follow on the request object. - */ - on(event: 'error', listener: (error: Error) => void): this; - on(event: string, listener: Function): this; - /** - * An Integer indicating the HTTP response status code. - */ - statusCode: number; - /** - * A String representing the HTTP status message. - */ - statusMessage: string; - /** - * An object representing the response HTTP headers. The headers object is formatted as follows: - * - All header names are lowercased. - * - Each header name produces an array-valued property on the headers object. - * - Each header value is pushed into the array associated with its header name. - */ - headers: { - [key: string]: string[] - }; - /** - * A string indicating the HTTP protocol version number. Typical values are ‘1.0’ or ‘1.1’. - */ - httpVersion: string; - /** - * An integer-valued read-only property that returns the HTTP major version number. - */ - httpVersionMajor: number; - /** - * An integer-valued read-only property that returns the HTTP minor version number. - */ - httpVersionMinor: number; - } - - // https://github.com/electron/electron/blob/master/docs/api/power-monitor.md - - /** - * The power-monitor module is used to monitor power state changes. - * You should not use this module until the ready event of the app module is emitted. - */ - interface PowerMonitor extends NodeJS.EventEmitter { - /** - * Emitted when the system is suspending. - */ - on(event: 'suspend', listener: Function): this; - /** - * Emitted when system is resuming. - */ - on(event: 'resume', listener: Function): this; - /** - * Emitted when the system changes to AC power. - */ - on(event: 'on-ac', listener: Function): this; - /** - * Emitted when system changes to battery power. - */ - on(event: 'on-battery', listener: Function): this; - on(event: string, listener: Function): this; - } - - // https://github.com/electron/electron/blob/master/docs/api/power-save-blocker.md - - /** - * The powerSaveBlocker module is used to block the system from entering - * low-power (sleep) mode and thus allowing the app to keep the system and screen active. - */ - interface PowerSaveBlocker { - /** - * Starts preventing the system from entering lower-power mode. - * @returns The blocker ID that is assigned to this power blocker. - * Note: prevent-display-sleep has higher has precedence over prevent-app-suspension. - */ - start(type: 'prevent-app-suspension' | 'prevent-display-sleep'): number; - /** - * @param id The power save blocker id returned by powerSaveBlocker.start. - * Stops the specified power save blocker. - */ - stop(id: number): void; - /** - * @param id The power save blocker id returned by powerSaveBlocker.start. - * @returns Whether the corresponding powerSaveBlocker has started. - */ - isStarted(id: number): boolean; - } - - // https://github.com/electron/electron/blob/master/docs/api/protocol.md - - /** - * The protocol module can register a custom protocol or intercept an existing protocol. - */ - interface Protocol { - /** - * Registers custom schemes as standard schemes. - */ - registerStandardSchemes(schemes: string[]): void; - /** - * Registers custom schemes to handle service workers. - */ - registerServiceWorkerSchemes(schemes: string[]): void; - /** - * Registers a protocol of scheme that will send the file as a response. - */ - registerFileProtocol(scheme: string, handler: FileProtocolHandler, completion?: (error: Error) => void): void; - /** - * Registers a protocol of scheme that will send a Buffer as a response. - */ - registerBufferProtocol(scheme: string, handler: BufferProtocolHandler, completion?: (error: Error) => void): void; - /** - * Registers a protocol of scheme that will send a String as a response. - */ - registerStringProtocol(scheme: string, handler: StringProtocolHandler, completion?: (error: Error) => void): void; - /** - * Registers a protocol of scheme that will send an HTTP request as a response. - */ - registerHttpProtocol(scheme: string, handler: HttpProtocolHandler, completion?: (error: Error) => void): void; - /** - * Unregisters the custom protocol of scheme. - */ - unregisterProtocol(scheme: string, completion?: (error: Error) => void): void; - /** - * The callback will be called with a boolean that indicates whether there is already a handler for scheme. - */ - isProtocolHandled(scheme: string, callback: (handled: boolean) => void): void; - /** - * Intercepts scheme protocol and uses handler as the protocol’s new handler which sends a file as a response. - */ - interceptFileProtocol(scheme: string, handler: FileProtocolHandler, completion?: (error: Error) => void): void; - /** - * Intercepts scheme protocol and uses handler as the protocol’s new handler which sends a Buffer as a response. - */ - interceptBufferProtocol(scheme: string, handler: BufferProtocolHandler, completion?: (error: Error) => void): void; - /** - * Intercepts scheme protocol and uses handler as the protocol’s new handler which sends a String as a response. - */ - interceptStringProtocol(scheme: string, handler: StringProtocolHandler, completion?: (error: Error) => void): void; - /** - * Intercepts scheme protocol and uses handler as the protocol’s new handler which sends a new HTTP request as a response. - */ - interceptHttpProtocol(scheme: string, handler: HttpProtocolHandler, completion?: (error: Error) => void): void; - /** - * Remove the interceptor installed for scheme and restore its original handler. - */ - uninterceptProtocol(scheme: string, completion?: (error: Error) => void): void; - } - - type FileProtocolHandler = (request: ProtocolRequest, callback: FileProtocolCallback) => void; - type BufferProtocolHandler = (request: ProtocolRequest, callback: BufferProtocolCallback) => void; - type StringProtocolHandler = (request: ProtocolRequest, callback: StringProtocolCallback) => void; - type HttpProtocolHandler = (request: ProtocolRequest, callback: HttpProtocolCallback) => void; - - interface ProtocolRequest { - url: string; - referrer: string; - method: string; - uploadData?: { - /** - * Content being sent. - */ - bytes: Buffer, - /** - * Path of file being uploaded. - */ - file: string, - /** - * UUID of blob data. Use session.getBlobData method to retrieve the data. - */ - blobUUID: string; - }[]; - } - - interface ProtocolCallback { - (error: number): void; - (obj: { - error: number - }): void; - (): void; - } - - interface FileProtocolCallback extends ProtocolCallback { - (filePath: string): void; - (obj: { - path: string - }): void; - } - - interface BufferProtocolCallback extends ProtocolCallback { - (buffer: Buffer): void; - (obj: { - data: Buffer, - mimeType: string, - charset?: string - }): void; - } - - interface StringProtocolCallback extends ProtocolCallback { - (str: string): void; - (obj: { - data: string, - mimeType: string, - charset?: string - }): void; - } - - interface HttpProtocolCallback extends ProtocolCallback { - (redirectRequest: { - url: string; - method: string; - session?: Object; - uploadData?: { - contentType: string; - data: string; - }; - }): void; - } - - // https://github.com/electron/electron/blob/master/docs/api/remote.md - - /** - * The remote module provides a simple way to do inter-process communication (IPC) - * between the renderer process (web page) and the main process. - */ - interface Remote extends CommonElectron { - /** - * @returns The object returned by require(module) in the main process. - */ - require(module: string): any; - /** - * @returns The BrowserWindow object which this web page belongs to. - */ - getCurrentWindow(): BrowserWindow; - /** - * @returns The WebContents object of this web page. - */ - getCurrentWebContents(): WebContents; - /** - * @returns The global variable of name (e.g. global[name]) in the main process. - */ - getGlobal(name: string): any; - /** - * Returns the process object in the main process. This is the same as - * remote.getGlobal('process'), but gets cached. - */ - process: NodeJS.Process; - } - - // https://github.com/electron/electron/blob/master/docs/api/screen.md - - /** - * The Display object represents a physical display connected to the system. - * A fake Display may exist on a headless system, or a Display may correspond to a remote, virtual display. - */ - interface Display { - /** - * Unique identifier associated with the display. - */ - id: number; - bounds: Rectangle; - workArea: Rectangle; - size: Size; - workAreaSize: Size; - /** - * Output device’s pixel scale factor. - */ - scaleFactor: number; - /** - * Can be 0, 90, 180, 270, represents screen rotation in clock-wise degrees. - */ - rotation: number; - touchSupport: 'available' | 'unavailable' | 'unknown'; - } - - type DisplayMetrics = 'bounds' | 'workArea' | 'scaleFactor' | 'rotation'; - - /** - * The screen module retrieves information about screen size, displays, cursor position, etc. - * You can not use this module until the ready event of the app module is emitted. - */ - interface Screen extends NodeJS.EventEmitter { - /** - * Emitted when newDisplay has been added. - */ - on(event: 'display-added', listener: (event: Event, newDisplay: Display) => void): this; - /** - * Emitted when oldDisplay has been removed. - */ - on(event: 'display-removed', listener: (event: Event, oldDisplay: Display) => void): this; - /** - * Emitted when one or more metrics change in a display. - */ - on(event: 'display-metrics-changed', listener: (event: Event, display: Display, changedMetrics: DisplayMetrics[]) => void): this; - on(event: string, listener: Function): this; - /** - * @returns The current absolute position of the mouse pointer. - */ - getCursorScreenPoint(): Point; - /** - * @returns The primary display. - */ - getPrimaryDisplay(): Display; - /** - * @returns An array of displays that are currently available. - */ - getAllDisplays(): Display[]; - /** - * @returns The display nearest the specified point. - */ - getDisplayNearestPoint(point: Point): Display; - /** - * @returns The display that most closely intersects the provided bounds. - */ - getDisplayMatching(rect: Rectangle): Display; - } - - // https://github.com/electron/electron/blob/master/docs/api/session.md - - /** - * The session module can be used to create new Session objects. - * You can also access the session of existing pages by using - * the session property of webContents which is a property of BrowserWindow. - */ - class Session extends NodeJS.EventEmitter { - /** - * @returns a new Session instance from partition string. - */ - static fromPartition(partition: string, options?: FromPartitionOptions): Session; - /** - * @returns the default session object of the app. - */ - static defaultSession: Session; - /** - * Emitted when Electron is about to download item in webContents. - * Calling event.preventDefault() will cancel the download - * and item will not be available from next tick of the process. - */ - on(event: 'will-download', listener: (event: Event, item: DownloadItem, webContents: WebContents) => void): this; - on(event: string, listener: Function): this; - /** - * The cookies gives you ability to query and modify cookies. - */ - cookies: SessionCookies; - /** - * @returns the session’s current cache size. - */ - getCacheSize(callback: (size: number) => void): void; - /** - * Clears the session’s HTTP cache. - */ - clearCache(callback: Function): void; - /** - * Clears the data of web storages. - */ - clearStorageData(callback: Function): void; - /** - * Clears the data of web storages. - */ - clearStorageData(options: ClearStorageDataOptions, callback: Function): void; - /** - * Writes any unwritten DOMStorage data to disk. - */ - flushStorageData(): void; - /** - * Sets the proxy settings. - */ - setProxy(config: ProxyConfig, callback: Function): void; - /** - * Resolves the proxy information for url. - */ - resolveProxy(url: URL, callback: (proxy: string) => void): void; - /** - * Sets download saving directory. - * By default, the download directory will be the Downloads under the respective app folder. - */ - setDownloadPath(path: string): void; - /** - * Emulates network with the given configuration for the session. - */ - enableNetworkEmulation(options: NetworkEmulationOptions): void; - /** - * Disables any network emulation already active for the session. - * Resets to the original network configuration. - */ - disableNetworkEmulation(): void; - /** - * Sets the certificate verify proc for session, the proc will be called - * whenever a server certificate verification is requested. - * - * Calling setCertificateVerifyProc(null) will revert back to default certificate verify proc. - */ - setCertificateVerifyProc(proc: ((hostname: string, cert: Certificate, callback: (accepted: boolean) => void) => void) | null): void; - /** - * Sets the handler which can be used to respond to permission requests for the session. - */ - setPermissionRequestHandler(handler: (webContents: WebContents, permission: Permission, callback: (allow: boolean) => void) => void): void; - /** - * Clears the host resolver cache. - */ - clearHostResolverCache(callback: Function): void; - /** - * Dynamically sets whether to always send credentials for HTTP NTLM or Negotiate authentication. - * @param domains Comma-seperated list of servers for which integrated authentication is enabled. - */ - allowNTLMCredentialsForDomains(domains: string): void; - /** - * Overrides the userAgent and acceptLanguages for this session. - * The acceptLanguages must a comma separated ordered list of language codes, for example "en-US,fr,de,ko,zh-CN,ja". - * This doesn't affect existing WebContents, and each WebContents can use webContents.setUserAgent to override the session-wide user agent. - */ - setUserAgent(userAgent: string, acceptLanguages?: string): void; - /** - * @returns The user agent for this session. - */ - getUserAgent(): string; - /** - * Returns the blob data associated with the identifier. - */ - getBlobData(identifier: string, callback: (result: Buffer) => void): void; - /** - * The webRequest API set allows to intercept and modify contents of a request at various stages of its lifetime. - */ - webRequest: WebRequest; - /** - * @returns An instance of protocol module for this session. - */ - protocol: Protocol; - } - - type Permission = 'media' | 'geolocation' | 'notifications' | 'midiSysex' | 'pointerLock' | 'fullscreen' | 'openExternal'; - - interface FromPartitionOptions { - /** - * Whether to enable cache. - */ - cache?: boolean; - } - - interface ClearStorageDataOptions { - /** - * Should follow window.location.origin’s representation scheme://host:port. - */ - origin?: string; - /** - * The types of storages to clear. - */ - storages?: ('appcache' | 'cookies' | 'filesystem' | 'indexdb' | 'localstorage' | 'shadercache' | 'websql' | 'serviceworkers')[]; - /** - * The types of quotas to clear. - */ - quotas?: ('temporary' | 'persistent' | 'syncable')[]; - } - - interface ProxyConfig { - /** - * The URL associated with the PAC file. - */ - pacScript: string; - /** - * Rules indicating which proxies to use. - */ - proxyRules: string; - /** - * Rules indicating which URLs should bypass the proxy settings. - */ - proxyBypassRules: string; - } - - interface NetworkEmulationOptions { - /** - * Whether to emulate network outage. - * Default: false. - */ - offline?: boolean; - /** - * RTT in ms. - * Default: 0, which will disable latency throttling. - */ - latency?: number; - /** - * Download rate in Bps. - * Default: 0, which will disable download throttling. - */ - downloadThroughput?: number; - /** - * Upload rate in Bps. - * Default: 0, which will disable upload throttling. - */ - uploadThroughput?: number; - } - - interface CookieFilter { - /** - * Retrieves cookies which are associated with url. Empty implies retrieving cookies of all urls. - */ - url?: string; - /** - * Filters cookies by name. - */ - name?: string; - /** - * Retrieves cookies whose domains match or are subdomains of domains. - */ - domain?: string; - /** - * Retrieves cookies whose path matches path. - */ - path?: string; - /** - * Filters cookies by their Secure property. - */ - secure?: boolean; - /** - * Filters out session or persistent cookies. - */ - session?: boolean; - } - - interface Cookie { - /** - * Emitted when a cookie is changed because it was added, edited, removed, or expired. - */ - on(event: 'changed', listener: (event: Event, cookie: Cookie, cause: CookieChangedCause) => void): this; - on(event: string, listener: Function): this; - /** - * The name of the cookie. - */ - name: string; - /** - * The value of the cookie. - */ - value: string; - /** - * The domain of the cookie. - */ - domain: string; - /** - * Whether the cookie is a host-only cookie. - */ - hostOnly: string; - /** - * The path of the cookie. - */ - path: string; - /** - * Whether the cookie is marked as secure. - */ - secure: boolean; - /** - * Whether the cookie is marked as HTTP only. - */ - httpOnly: boolean; - /** - * Whether the cookie is a session cookie or a persistent cookie with an expiration date. - */ - session: boolean; - /** - * The expiration date of the cookie as the number of seconds since the UNIX epoch. - * Not provided for session cookies. - */ - expirationDate?: number; - } - - type CookieChangedCause = 'explicit' | 'overwrite' | 'expired' | 'evicted' | 'expired-overwrite'; - - interface CookieDetails { - /** - * The URL associated with the cookie. - */ - url: string; - /** - * The name of the cookie. - * Default: empty. - */ - name?: string; - /** - * The value of the cookie. - * Default: empty. - */ - value?: string; - /** - * The domain of the cookie. - * Default: empty. - */ - domain?: string; - /** - * The path of the cookie. - * Default: empty. - */ - path?: string; - /** - * Whether the cookie should be marked as secure. - * Default: false. - */ - secure?: boolean; - /** - * Whether the cookie should be marked as HTTP only. - * Default: false. - */ - httpOnly?: boolean; - /** - * The expiration date of the cookie as the number of seconds since the UNIX epoch. - * If omitted, the cookie becomes a session cookie. - */ - expirationDate?: number; - } - - interface SessionCookies { - /** - * Sends a request to get all cookies matching filter. - */ - get(filter: CookieFilter, callback: (error: Error, cookies: Cookie[]) => void): void; - /** - * Sets the cookie with details. - */ - set(details: CookieDetails, callback: (error: Error) => void): void; - /** - * Removes the cookies matching url and name. - */ - remove(url: string, name: string, callback: (error: Error) => void): void; - } - - /** - * Each API accepts an optional filter and a listener, the listener will be called when the API's event has happened. - * Passing null as listener will unsubscribe from the event. - * - * The filter will be used to filter out the requests that do not match the URL patterns. - * If the filter is omitted then all requests will be matched. - * - * For certain events the listener is passed with a callback, - * which should be called with an response object when listener has done its work. - */ - interface WebRequest { - /** - * The listener will be called when a request is about to occur. - */ - onBeforeRequest(listener: (details: WebRequest.BeforeRequestDetails, callback: WebRequest.BeforeRequestCallback) => void): void; - /** - * The listener will be called when a request is about to occur. - */ - onBeforeRequest(filter: WebRequest.Filter, listener: (details: WebRequest.BeforeRequestDetails, callback: WebRequest.BeforeRequestCallback) => void): void; - /** - * The listener will be called before sending an HTTP request, once the request headers are available. - * This may occur after a TCP connection is made to the server, but before any http data is sent. - */ - onBeforeSendHeaders(listener: (details: WebRequest.BeforeSendHeadersDetails, callback: WebRequest.BeforeSendHeadersCallback) => void): void; - /** - * The listener will be called before sending an HTTP request, once the request headers are available. - * This may occur after a TCP connection is made to the server, but before any http data is sent. - */ - onBeforeSendHeaders(filter: WebRequest.Filter, listener: (details: WebRequest.BeforeSendHeadersDetails, callback: WebRequest.BeforeSendHeadersCallback) => void): void; - /** - * The listener will be called just before a request is going to be sent to the server, - * modifications of previous onBeforeSendHeaders response are visible by the time this listener is fired. - */ - onSendHeaders(listener: (details: WebRequest.SendHeadersDetails) => void): void; - /** - * The listener will be called just before a request is going to be sent to the server, - * modifications of previous onBeforeSendHeaders response are visible by the time this listener is fired. - */ - onSendHeaders(filter: WebRequest.Filter, listener: (details: WebRequest.SendHeadersDetails) => void): void; - /** - * The listener will be called when HTTP response headers of a request have been received. - */ - onHeadersReceived(listener: (details: WebRequest.HeadersReceivedDetails, callback: WebRequest.HeadersReceivedCallback) => void): void; - /** - * The listener will be called when HTTP response headers of a request have been received. - */ - onHeadersReceived(filter: WebRequest.Filter, listener: (details: WebRequest.HeadersReceivedDetails, callback: WebRequest.HeadersReceivedCallback) => void): void; - /** - * The listener will be called when first byte of the response body is received. - * For HTTP requests, this means that the status line and response headers are available. - */ - onResponseStarted(listener: (details: WebRequest.ResponseStartedDetails) => void): void; - /** - * The listener will be called when first byte of the response body is received. - * For HTTP requests, this means that the status line and response headers are available. - */ - onResponseStarted(filter: WebRequest.Filter, listener: (details: WebRequest.ResponseStartedDetails) => void): void; - /** - * The listener will be called when a server initiated redirect is about to occur. - */ - onBeforeRedirect(listener: (details: WebRequest.BeforeRedirectDetails) => void): void; - /** - * The listener will be called when a server initiated redirect is about to occur. - */ - onBeforeRedirect(filter: WebRequest.Filter, listener: (details: WebRequest.BeforeRedirectDetails) => void): void; - /** - * The listener will be called when a request is completed. - */ - onCompleted(listener: (details: WebRequest.CompletedDetails) => void): void; - /** - * The listener will be called when a request is completed. - */ - onCompleted(filter: WebRequest.Filter, listener: (details: WebRequest.CompletedDetails) => void): void; - /** - * The listener will be called when an error occurs. - */ - onErrorOccurred(listener: (details: WebRequest.ErrorOccurredDetails) => void): void; - /** - * The listener will be called when an error occurs. - */ - onErrorOccurred(filter: WebRequest.Filter, listener: (details: WebRequest.ErrorOccurredDetails) => void): void; - } - - namespace WebRequest { - interface Filter { - urls: string[]; - } - - interface Details { - id: number; - url: string; - method: string; - resourceType: string; - timestamp: number; - } - - interface UploadData { - /** - * Content being sent. - */ - bytes: Buffer; - /** - * Path of file being uploaded. - */ - file: string; - /** - * UUID of blob data. Use session.getBlobData method to retrieve the data. - */ - blobUUID: string; - } - - interface BeforeRequestDetails extends Details { - uploadData?: UploadData[]; - } - - type BeforeRequestCallback = (response: { - cancel?: boolean; - /** - * The original request is prevented from being sent or completed, and is instead redirected to the given URL. - */ - redirectURL?: string; - }) => void; - - interface BeforeSendHeadersDetails extends Details { - requestHeaders: Headers; - } - - type BeforeSendHeadersCallback = (response: { - cancel?: boolean; - /** - * When provided, request will be made with these headers. - */ - requestHeaders?: Headers; - }) => void; - - interface SendHeadersDetails extends Details { - requestHeaders: Headers; - } - - interface HeadersReceivedDetails extends Details { - statusLine: string; - statusCode: number; - responseHeaders: Headers; - } - - type HeadersReceivedCallback = (response: { - cancel?: boolean; - /** - * When provided, the server is assumed to have responded with these headers. - */ - responseHeaders?: Headers; - /** - * Should be provided when overriding responseHeaders to change header status - * otherwise original response header's status will be used. - */ - statusLine?: string; - }) => void; - - interface ResponseStartedDetails extends Details { - responseHeaders: Headers; - fromCache: boolean; - statusCode: number; - statusLine: string; - } - - interface BeforeRedirectDetails extends Details { - redirectURL: string; - statusCode: number; - ip?: string; - fromCache: boolean; - responseHeaders: Headers; - } - - interface CompletedDetails extends Details { - responseHeaders: Headers; - fromCache: boolean; - statusCode: number; - statusLine: string; - } - - interface ErrorOccurredDetails extends Details { - fromCache: boolean; - error: string; - } - } - - // https://github.com/electron/electron/blob/master/docs/api/shell.md - - /** - * The shell module provides functions related to desktop integration. - */ - interface Shell { - /** - * Show the given file in a file manager. If possible, select the file. - * @returns Whether the item was successfully shown. - */ - showItemInFolder(fullPath: string): boolean; - /** - * Open the given file in the desktop's default manner. - * @returns Whether the item was successfully shown. - */ - openItem(fullPath: string): boolean; - /** - * Open the given external protocol URL in the desktop's default manner - * (e.g., mailto: URLs in the default mail user agent). - * @returns Whether an application was available to open the URL. - */ - openExternal(url: string, options?: { - /** - * Bring the opened application to the foreground. - * Default: true. - */ - activate: boolean; - }): boolean; - /** - * Move the given file to trash. - * @returns Whether the item was successfully moved to the trash. - */ - moveItemToTrash(fullPath: string): boolean; - /** - * Play the beep sound. - */ - beep(): void; - /** - * Creates or updates a shortcut link at shortcutPath. - * - * Note: This API is available only on Windows. - */ - writeShortcutLink(shortcutPath: string, options: ShortcutLinkOptions): boolean; - /** - * Creates or updates a shortcut link at shortcutPath. - * - * Note: This API is available only on Windows. - */ - writeShortcutLink(shortcutPath: string, operation: 'create' | 'update' | 'replace', options: ShortcutLinkOptions): boolean; - /** - * Resolves the shortcut link at shortcutPath. - * An exception will be thrown when any error happens. - * - * Note: This API is available only on Windows. - */ - readShortcutLink(shortcutPath: string): ShortcutLinkOptions; - } - - interface ShortcutLinkOptions { - /** - * The target to launch from this shortcut. - */ - target: string; - /** - * The working directory. - * Default: empty. - */ - cwd?: string; - /** - * The arguments to be applied to target when launching from this shortcut. - * Default: empty. - */ - args?: string; - /** - * The description of the shortcut. - * Default: empty. - */ - description?: string; - /** - * The path to the icon, can be a DLL or EXE. icon and iconIndex have to be set together. - * Default: empty, which uses the target's icon. - */ - icon?: string; - /** - * The resource ID of icon when icon is a DLL or EXE. - * Default: 0. - */ - iconIndex?: number; - /** - * The Application User Model ID. - * Default: empty. - */ - appUserModelId?: string; - } - - // https://github.com/electron/electron/blob/master/docs/api/system-preferences.md - - type SystemColor = - '3d-dark-shadow' | // Dark shadow for three-dimensional display elements. - '3d-face' | // Face color for three-dimensional display elements and for dialog box backgrounds. - '3d-highlight' | // Highlight color for three-dimensional display elements. - '3d-light' | // Light color for three-dimensional display elements. - '3d-shadow' | // Shadow color for three-dimensional display elements. - 'active-border' | // Active window border. - 'active-caption' | // Active window title bar. Specifies the left side color in the color gradient of an active window's title bar if the gradient effect is enabled. - 'active-caption-gradient' | // Right side color in the color gradient of an active window's title bar. - 'app-workspace' | // Background color of multiple document interface (MDI) applications. - 'button-text' | // Text on push buttons. - 'caption-text' | // Text in caption, size box, and scroll bar arrow box. - 'desktop' | // Desktop background color. - 'disabled-text' | // Grayed (disabled) text. - 'highlight' | // Item(s) selected in a control. - 'highlight-text' | // Text of item(s) selected in a control. - 'hotlight' | // Color for a hyperlink or hot-tracked item. - 'inactive-border' | // Inactive window border. - 'inactive-caption' | // Inactive window caption. Specifies the left side color in the color gradient of an inactive window's title bar if the gradient effect is enabled. - 'inactive-caption-gradient' | // Right side color in the color gradient of an inactive window's title bar. - 'inactive-caption-text' | // Color of text in an inactive caption. - 'info-background' | // Background color for tooltip controls. - 'info-text' | // Text color for tooltip controls. - 'menu' | // Menu background. - 'menu-highlight' | // The color used to highlight menu items when the menu appears as a flat menu. - 'menubar' | // The background color for the menu bar when menus appear as flat menus. - 'menu-text' | // Text in menus. - 'scrollbar' | // Scroll bar gray area. - 'window' | // Window background. - 'window-frame' | // Window frame. - 'window-text'; // Text in windows. - - /** - * Get system preferences. - */ - interface SystemPreferences { - /** - * Note: This is only implemented on Windows. - */ - on(event: 'accent-color-changed', listener: (event: Event, newColor: string) => void): this; - /** - * Note: This is only implemented on Windows. - */ - on(event: 'color-changed', listener: (event: Event) => void): this; - /** - * Note: This is only implemented on Windows. - */ - on(event: 'inverted-color-scheme-changed', listener: ( - event: Event, - /** - * @param invertedColorScheme true if an inverted color scheme, such as a high contrast theme, is being used, false otherwise. - */ - invertedColorScheme: boolean - ) => void): this; - on(event: string, listener: Function): this; - /** - * @returns Whether the system is in Dark Mode. - * - * Note: This is only implemented on macOS. - */ - isDarkMode(): boolean; - /** - * @returns Whether the Swipe between pages setting is on. - * - * Note: This is only implemented on macOS. - */ - isSwipeTrackingFromScrollEventsEnabled(): boolean; - /** - * Posts event as native notifications of macOS. - * The userInfo contains the user information dictionary sent along with the notification. - * - * Note: This is only implemented on macOS. - */ - postNotification(event: string, userInfo: Object): void; - /** - * Posts event as native notifications of macOS. - * The userInfo contains the user information dictionary sent along with the notification. - * - * Note: This is only implemented on macOS. - */ - postLocalNotification(event: string, userInfo: Object): void; - /** - * Subscribes to native notifications of macOS, callback will be called when the corresponding event happens. - * The id of the subscriber is returned, which can be used to unsubscribe the event. - * - * Note: This is only implemented on macOS. - */ - subscribeNotification(event: string, callback: (event: Event, userInfo: Object) => void): number; - /** - * Removes the subscriber with id. - * - * Note: This is only implemented on macOS. - */ - unsubscribeNotification(id: number): void; - /** - * Same as subscribeNotification, but uses NSNotificationCenter for local defaults. - */ - subscribeLocalNotification(event: string, callback: (event: Event, userInfo: Object) => void): number; - /** - * Same as unsubscribeNotification, but removes the subscriber from NSNotificationCenter. - */ - unsubscribeLocalNotification(id: number): void; - /** - * Get the value of key in system preferences. - * - * Note: This is only implemented on macOS. - */ - getUserDefault(key: string, type: 'string' | 'boolean' | 'integer' | 'float' | 'double' | 'url' | 'array' | 'dictionary'): any; - /** - * @returns Whether DWM composition (Aero Glass) is enabled. - * - * Note: This is only implemented on Windows. - */ - isAeroGlassEnabled(): boolean; - /** - * @returns The users current system wide color preference in the form of an RGBA hexadecimal string. - * - * Note: This is only implemented on Windows. - */ - getAccentColor(): string; - /** - * @returns true if an inverted color scheme, such as a high contrast theme, is active, false otherwise. - * - * Note: This is only implemented on Windows. - */ - isInvertedColorScheme(): boolean; - /** - * @returns The system color setting in RGB hexadecimal form (#ABCDEF). See the Windows docs for more details. - * - * Note: This is only implemented on Windows. - */ - getColor(color: SystemColor): string; - } - - // https://github.com/electron/electron/blob/master/docs/api/tray.md - - /** - * A Tray represents an icon in an operating system's notification area. - */ - class Tray extends NodeJS.EventEmitter implements Destroyable { - /** - * Emitted when the tray icon is clicked. - * Note: The bounds payload is only implemented on macOS and Windows. - */ - on(event: 'click', listener: (modifiers: Modifiers, bounds: Rectangle) => void): this; - /** - * Emitted when the tray icon is right clicked. - * Note: This is only implemented on macOS and Windows. - */ - on(event: 'right-click', listener: (modifiers: Modifiers, bounds: Rectangle) => void): this; - /** - * Emitted when the tray icon is double clicked. - * Note: This is only implemented on macOS and Windows. - */ - on(event: 'double-click', listener: (modifiers: Modifiers, bounds: Rectangle) => void): this; - /** - * Emitted when the tray balloon shows. - * Note: This is only implemented on Windows. - */ - on(event: 'balloon-show', listener: Function): this; - /** - * Emitted when the tray balloon is clicked. - * Note: This is only implemented on Windows. - */ - on(event: 'balloon-click', listener: Function): this; - /** - * Emitted when the tray balloon is closed because of timeout or user manually closes it. - * Note: This is only implemented on Windows. - */ - on(event: 'balloon-closed', listener: Function): this; - /** - * Emitted when any dragged items are dropped on the tray icon. - * Note: This is only implemented on macOS. - */ - on(event: 'drop', listener: Function): this; - /** - * Emitted when dragged files are dropped in the tray icon. - * Note: This is only implemented on macOS - */ - on(event: 'drop-files', listener: (event: Event, files: string[]) => void): this; - /** - * Emitted when dragged text is dropped in the tray icon. - * Note: This is only implemented on macOS - */ - on(event: 'drop-text', listener: (event: Event, text: string) => void): this; - /** - * Emitted when a drag operation enters the tray icon. - * Note: This is only implemented on macOS - */ - on(event: 'drag-enter', listener: Function): this; - /** - * Emitted when a drag operation exits the tray icon. - * Note: This is only implemented on macOS - */ - on(event: 'drag-leave', listener: Function): this; - /** - * Emitted when a drag operation ends on the tray or ends at another location. - * Note: This is only implemented on macOS - */ - on(event: 'drag-end', listener: Function): this; - on(event: string, listener: Function): this; - /** - * Creates a new tray icon associated with the image. - */ - constructor(image: NativeImage|string); - /** - * Destroys the tray icon immediately. - */ - destroy(): void; - /** - * Sets the image associated with this tray icon. - */ - setImage(image: NativeImage|string): void; - /** - * Sets the image associated with this tray icon when pressed. - */ - setPressedImage(image: NativeImage): void; - /** - * Sets the hover text for this tray icon. - */ - setToolTip(toolTip: string): void; - /** - * Sets the title displayed aside of the tray icon in the status bar. - * Note: This is only implemented on macOS. - */ - setTitle(title: string): void; - /** - * Sets when the tray's icon background becomes highlighted. - * Note: This is only implemented on macOS. - */ - setHighlightMode(mode: 'selection' | 'always' | 'never'): void; - /** - * Displays a tray balloon. - * Note: This is only implemented on Windows. - */ - displayBalloon(options?: { - icon?: NativeImage; - title?: string; - content?: string; - }): void; - /** - * Pops up the context menu of tray icon. When menu is passed, - * the menu will showed instead of the tray's context menu. - * The position is only available on Windows, and it is (0, 0) by default. - * Note: This is only implemented on macOS and Windows. - */ - popUpContextMenu(menu?: Menu, position?: Point): void; - /** - * Sets the context menu for this icon. - */ - setContextMenu(menu: Menu): void; - /** - * @returns The bounds of this tray icon. - */ - getBounds(): Rectangle; - /** - * @returns Whether the tray icon is destroyed. - */ - isDestroyed(): boolean; - } - - interface Modifiers { - altKey: boolean; - shiftKey: boolean; - ctrlKey: boolean; - metaKey: boolean; - } - - interface DragItem { - /** - * The absolute path of the file to be dragged - */ - file: string; - /** - * The image showing under the cursor when dragging. - */ - icon: NativeImage; - } - - // https://github.com/electron/electron/blob/master/docs/api/web-contents.md - - interface WebContentsStatic { - /** - * @returns An array of all WebContents instances. This will contain web contents for all windows, - * webviews, opened devtools, and devtools extension background pages. - */ - getAllWebContents(): WebContents[]; - /** - * @returns The web contents that is focused in this application, otherwise returns null. - */ - getFocusedWebContents(): WebContents; - /** - * Find a WebContents instance according to its ID. - */ - fromId(id: number): WebContents; - } - - /** - * A WebContents is responsible for rendering and controlling a web page. - */ - interface WebContents extends NodeJS.EventEmitter { - /** - * Emitted when the navigation is done, i.e. the spinner of the tab has stopped spinning, - * and the onload event was dispatched. - */ - on(event: 'did-finish-load', listener: Function): this; - /** - * This event is like did-finish-load but emitted when the load failed or was cancelled, - * e.g. window.stop() is invoked. - */ - on(event: 'did-fail-load', listener: (event: Event, errorCode: number, errorDescription: string, validatedURL: string, isMainFrame: boolean) => void): this; - /** - * Emitted when a frame has done navigation. - */ - on(event: 'did-frame-finish-load', listener: (event: Event, isMainFrame: boolean) => void): this; - /** - * Corresponds to the points in time when the spinner of the tab started spinning. - */ - on(event: 'did-start-loading', listener: Function): this; - /** - * Corresponds to the points in time when the spinner of the tab stopped spinning. - */ - on(event: 'did-stop-loading', listener: Function): this; - /** - * Emitted when details regarding a requested resource are available. - * status indicates the socket connection to download the resource. - */ - on(event: 'did-get-response-details', listener: (event: Event, - status: boolean, - newURL: string, - originalURL: string, - httpResponseCode: number, - requestMethod: string, - referrer: string, - headers: Headers, - resourceType: string - ) => void): this; - /** - * Emitted when a redirect is received while requesting a resource. - */ - on(event: 'did-get-redirect-request', listener: (event: Event, - oldURL: string, - newURL: string, - isMainFrame: boolean, - httpResponseCode: number, - requestMethod: string, - referrer: string, - headers: Headers - ) => void): this; - /** - * Emitted when the document in the given frame is loaded. - */ - on(event: 'dom-ready', listener: (event: Event) => void): this; - /** - * Emitted when page receives favicon URLs. - */ - on(event: 'page-favicon-updated', listener: (event: Event, favicons: string[]) => void): this; - /** - * Emitted when the page requests to open a new window for a url. - * It could be requested by window.open or an external link like . - * - * By default a new BrowserWindow will be created for the url. - * - * Calling event.preventDefault() will prevent creating new windows. - */ - on(event: 'new-window', listener: (event: Event, - url: string, - frameName: string, - disposition: NewWindowDisposition, - options: BrowserWindowOptions - ) => void): this; - /** - * Emitted when a user or the page wants to start navigation. - * It can happen when the window.location object is changed or a user clicks a link in the page. - * - * This event will not emit when the navigation is started programmatically with APIs like - * webContents.loadURL and webContents.back. - * - * It is also not emitted for in-page navigations, such as clicking anchor links - * or updating the window.location.hash. Use did-navigate-in-page event for this purpose. - * - * Calling event.preventDefault() will prevent the navigation. - */ - on(event: 'will-navigate', listener: (event: Event, url: string) => void): this; - /** - * Emitted when a navigation is done. - * - * This event is not emitted for in-page navigations, such as clicking anchor links - * or updating the window.location.hash. Use did-navigate-in-page event for this purpose. - */ - on(event: 'did-navigate', listener: (event: Event, url: string) => void): this; - /** - * Emitted when an in-page navigation happened. - * - * When in-page navigation happens, the page URL changes but does not cause - * navigation outside of the page. Examples of this occurring are when anchor links - * are clicked or when the DOM hashchange event is triggered. - */ - on(event: 'did-navigate-in-page', listener: (event: Event, url: string, isMainFrame: boolean) => void): this; - /** - * Emitted when the renderer process has crashed. - */ - on(event: 'crashed', listener: (event: Event, killed: boolean) => void): this; - /** - * Emitted when a plugin process has crashed. - */ - on(event: 'plugin-crashed', listener: (event: Event, name: string, version: string) => void): this; - /** - * Emitted when webContents is destroyed. - */ - on(event: 'destroyed', listener: Function): this; - /** - * Emitted when DevTools is opened. - */ - on(event: 'devtools-opened', listener: Function): this; - /** - * Emitted when DevTools is closed. - */ - on(event: 'devtools-closed', listener: Function): this; - /** - * Emitted when DevTools is focused / opened. - */ - on(event: 'devtools-focused', listener: Function): this; - /** - * Emitted when failed to verify the certificate for url. - * The usage is the same with the "certificate-error" event of app. - */ - on(event: 'certificate-error', listener: (event: Event, - url: string, - error: string, - certificate: Certificate, - callback: (trust: boolean) => void - ) => void): this; - /** - * Emitted when a client certificate is requested. - * The usage is the same with the "select-client-certificate" event of app. - */ - on(event: 'select-client-certificate', listener: (event: Event, - url: string, - certificateList: Certificate[], - callback: (certificate: Certificate) => void - ) => void): this; - /** - * Emitted when webContents wants to do basic auth. - * The usage is the same with the "login" event of app. - */ - on(event: 'login', listener: (event: Event, - request: LoginRequest, - authInfo: LoginAuthInfo, - callback: (username: string, password: string) => void - ) => void): this; - /** - * Emitted when a result is available for webContents.findInPage request. - */ - on(event: 'found-in-page', listener: (event: Event, result: FoundInPageResult) => void): this; - /** - * Emitted when media starts playing. - */ - on(event: 'media-started-playing', listener: Function): this; - /** - * Emitted when media is paused or done playing. - */ - on(event: 'media-paused', listener: Function): this; - /** - * Emitted when a page’s theme color changes. This is usually due to encountering a meta tag: - * - */ - on(event: 'did-change-theme-color', listener: Function): this; - /** - * Emitted when mouse moves over a link or the keyboard moves the focus to a link. - */ - on(event: 'update-target-url', listener: (event: Event, url: string) => void): this; - /** - * Emitted when the cursor’s type changes. - * If the type parameter is custom, the image parameter will hold the custom cursor image - * in a NativeImage, and scale, size and hotspot will hold additional information about the custom cursor. - */ - on(event: 'cursor-changed', listener: (event: Event, type: CursorType, image?: NativeImage, scale?: number, size?: Size, hotspot?: Point) => void): this; - /** - * Emitted when there is a new context menu that needs to be handled. - */ - on(event: 'context-menu', listener: (event: Event, params: ContextMenuParams) => void): this; - /** - * Emitted when bluetooth device needs to be selected on call to navigator.bluetooth.requestDevice. - * To use navigator.bluetooth api webBluetooth should be enabled. - * If event.preventDefault is not called, first available device will be selected. - * callback should be called with deviceId to be selected, - * passing empty string to callback will cancel the request. - */ - on(event: 'select-bluetooth-device', listener: (event: Event, deviceList: BluetoothDevice[], callback: (deviceId: string) => void) => void): this; - /** - * Emitted when a new frame is generated. Only the dirty area is passed in the buffer. - */ - on(event: 'paint', listener: (event: Event, dirtyRect: Rectangle, image: NativeImage) => void): this; - on(event: string, listener: Function): this; - /** - * Loads the url in the window. - * @param url Must contain the protocol prefix (e.g., the http:// or file://). - */ - loadURL(url: string, options?: LoadURLOptions): void; - /** - * Initiates a download of the resource at url without navigating. - * The will-download event of session will be triggered. - */ - downloadURL(url: string): void; - /** - * @returns The URL of current web page. - */ - getURL(): string; - /** - * @returns The title of web page. - */ - getTitle(): string; - /** - * @returns Whether the web page is destroyed. - */ - isDestroyed(): boolean; - /** - * @returns Whether the web page is focused. - */ - isFocused(): boolean; - /** - * @returns Whether web page is still loading resources. - */ - isLoading(): boolean; - /** - * @returns Whether the main frame (and not just iframes or frames within it) is still loading. - */ - isLoadingMainFrame(): boolean; - /** - * @returns Whether web page is waiting for a first-response for the main - * resource of the page. - */ - isWaitingForResponse(): boolean; - /** - * Stops any pending navigation. - */ - stop(): void; - /** - * Reloads current page. - */ - reload(): void; - /** - * Reloads current page and ignores cache. - */ - reloadIgnoringCache(): void; - /** - * @returns Whether the web page can go back. - */ - canGoBack(): boolean; - /** - * @returns Whether the web page can go forward. - */ - canGoForward(): boolean; - /** - * @returns Whether the web page can go to offset. - */ - canGoToOffset(offset: number): boolean; - /** - * Clears the navigation history. - */ - clearHistory(): void; - /** - * Makes the web page go back. - */ - goBack(): void; - /** - * Makes the web page go forward. - */ - goForward(): void; - /** - * Navigates to the specified absolute index. - */ - goToIndex(index: number): void; - /** - * Navigates to the specified offset from the "current entry". - */ - goToOffset(offset: number): void; - /** - * @returns Whether the renderer process has crashed. - */ - isCrashed(): boolean; - /** - * Overrides the user agent for this page. - */ - setUserAgent(userAgent: string): void; - /** - * @returns The user agent for this web page. - */ - getUserAgent(): string; - /** - * Injects CSS into this page. - */ - insertCSS(css: string): void; - /** - * Evaluates code in page. - * @param code Code to evaluate. - * - * @returns Promise - */ - executeJavaScript(code: string, userGesture?: boolean, callback?: (result: any) => void): Promise; - /** - * Mute the audio on the current web page. - */ - setAudioMuted(muted: boolean): void; - /** - * @returns Whether this page has been muted. - */ - isAudioMuted(): boolean; - /** - * Changes the zoom factor to the specified factor. - * Zoom factor is zoom percent divided by 100, so 300% = 3.0. - */ - setZoomFactor(factor: number): void; - /** - * Sends a request to get current zoom factor. - */ - getZoomFactor(callback: (zoomFactor: number) => void): void; - /** - * Changes the zoom level to the specified level. - * The original size is 0 and each increment above or below represents - * zooming 20% larger or smaller to default limits of 300% and 50% of original size, respectively. - */ - setZoomLevel(level: number): void; - /** - * Sends a request to get current zoom level. - */ - getZoomLevel(callback: (zoomLevel: number) => void): void; - /** - * Sets the maximum and minimum zoom level. - */ - setVisualZoomLevelLimits(minimumLevel: number, maximumLevel: number): void; - /** - * Sets the maximum and minimum layout-based (i.e. non-visual) zoom level. - */ - setLayoutZoomLevelLimits(minimumLevel: number, maximumLevel: number): void; - /** - * Executes the editing command undo in web page. - */ - undo(): void; - /** - * Executes the editing command redo in web page. - */ - redo(): void; - /** - * Executes the editing command cut in web page. - */ - cut(): void; - /** - * Executes the editing command copy in web page. - */ - copy(): void; - /** - * Copy the image at the given position to the clipboard. - */ - copyImageAt(x: number, y: number): void; - /** - * Executes the editing command paste in web page. - */ - paste(): void; - /** - * Executes the editing command pasteAndMatchStyle in web page. - */ - pasteAndMatchStyle(): void; - /** - * Executes the editing command delete in web page. - */ - delete(): void; - /** - * Executes the editing command selectAll in web page. - */ - selectAll(): void; - /** - * Executes the editing command unselect in web page. - */ - unselect(): void; - /** - * Executes the editing command replace in web page. - */ - replace(text: string): void; - /** - * Executes the editing command replaceMisspelling in web page. - */ - replaceMisspelling(text: string): void; - /** - * Inserts text to the focused element. - */ - insertText(text: string): void; - /** - * Starts a request to find all matches for the text in the web page. - * The result of the request can be obtained by subscribing to found-in-page event. - * @returns The request id used for the request. - */ - findInPage(text: string, options?: FindInPageOptions): number; - /** - * Stops any findInPage request for the webContents with the provided action. - */ - stopFindInPage(action: StopFindInPageAtion): void; - /** - * Checks if any serviceworker is registered. - */ - hasServiceWorker(callback: (hasServiceWorker: boolean) => void): void; - /** - * Unregisters any serviceworker if present. - */ - unregisterServiceWorker(callback: (isFulfilled: boolean) => void): void; - /** - * Prints window's web page. When silent is set to false, Electron will pick up system's default printer and default settings for printing. - * Calling window.print() in web page is equivalent to call WebContents.print({silent: false, printBackground: false}). - * Note: On Windows, the print API relies on pdf.dll. If your application doesn't need print feature, you can safely remove pdf.dll in saving binary size. - */ - print(options?: PrintOptions): void; - /** - * Prints windows' web page as PDF with Chromium's preview printing custom settings. - */ - printToPDF(options: PrintToPDFOptions, callback: (error: Error, data: Buffer) => void): void; - /** - * Adds the specified path to DevTools workspace. - */ - addWorkSpace(path: string): void; - /** - * Removes the specified path from DevTools workspace. - */ - removeWorkSpace(path: string): void; - /** - * Opens the developer tools. - */ - openDevTools(options?: { - /** - * Opens the devtools with specified dock state. Defaults to last used dock state. - */ - mode?: 'right' | 'bottom' | 'undocked' | 'detach' - }): void; - /** - * Closes the developer tools. - */ - closeDevTools(): void; - /** - * Returns whether the developer tools are opened. - */ - isDevToolsOpened(): boolean; - /** - * Returns whether the developer tools are focussed. - */ - isDevToolsFocused(): boolean; - /** - * Toggle the developer tools. - */ - toggleDevTools(): void; - /** - * Starts inspecting element at position (x, y). - */ - inspectElement(x: number, y: number): void; - /** - * Opens the developer tools for the service worker context. - */ - inspectServiceWorker(): void; - /** - * Send args.. to the web page via channel in asynchronous message, the web page - * can handle it by listening to the channel event of ipc module. - * Note: - * 1. The IPC message handler in web pages do not have a event parameter, - * which is different from the handlers on the main process. - * 2. There is no way to send synchronous messages from the main process - * to a renderer process, because it would be very easy to cause dead locks. - */ - send(channel: string, ...args: any[]): void; - /** - * Enable device emulation with the given parameters. - */ - enableDeviceEmulation(parameters: DeviceEmulationParameters): void; - /** - * Disable device emulation. - */ - disableDeviceEmulation(): void; - /** - * Sends an input event to the page. - */ - sendInputEvent(event: SendInputEvent): void; - /** - * Begin subscribing for presentation events and captured frames, - * The callback will be called when there is a presentation event. - */ - beginFrameSubscription(onlyDirty: boolean, callback: BeginFrameSubscriptionCallback): void; - /** - * Begin subscribing for presentation events and captured frames, - * The callback will be called when there is a presentation event. - */ - beginFrameSubscription(callback: BeginFrameSubscriptionCallback): void; - /** - * End subscribing for frame presentation events. - */ - endFrameSubscription(): void; - /** - * @returns If the process of saving page has been initiated successfully. - */ - savePage(fullPath: string, saveType: 'HTMLOnly' | 'HTMLComplete' | 'MHTML', callback?: (eror: Error) => void): boolean; - /** - * Shows pop-up dictionary that searches the selected word on the page. - * Note: This API is available only on macOS. - */ - showDefinitionForSelection(): void; - /** - * @returns Whether offscreen rendering is enabled. - */ - isOffscreen(): boolean; - /** - * If offscreen rendering is enabled and not painting, start painting. - */ - startPainting(): void; - /** - * If offscreen rendering is enabled and painting, stop painting. - */ - stopPainting(): void; - /** - * If offscreen rendering is enabled returns whether it is currently painting. - */ - isPainting(): boolean; - /** - * If offscreen rendering is enabled sets the frame rate to the specified number. - * Only values between 1 and 60 are accepted. - */ - setFrameRate(fps: number): void; - /** - * If offscreen rendering is enabled returns the current frame rate. - */ - getFrameRate(): number; - /** - * If offscreen rendering is enabled invalidates the frame and generates a new one through the 'paint' event. - */ - invalidate(): void; - /** - * Sets the item as dragging item for current drag-drop operation. - */ - startDrag(item: DragItem): void; - /** - * Captures a snapshot of the page within rect. - */ - capturePage(callback: (image: NativeImage) => void): void; - /** - * Captures a snapshot of the page within rect. - */ - capturePage(rect: Rectangle, callback: (image: NativeImage) => void): void; - /** - * @returns The unique ID of this WebContents. - */ - id: number; - /** - * @returns The session object used by this webContents. - */ - session: Session; - /** - * @returns The WebContents that might own this WebContents. - */ - hostWebContents: WebContents; - /** - * @returns The WebContents of DevTools for this WebContents. - * Note: Users should never store this object because it may become null - * when the DevTools has been closed. - */ - devToolsWebContents: WebContents; - /** - * @returns Debugger API - */ - debugger: Debugger; - } - - interface BeginFrameSubscriptionCallback { - ( - /** - * The frameBuffer is a Buffer that contains raw pixel data. - * On most machines, the pixel data is effectively stored in 32bit BGRA format, - * but the actual representation depends on the endianness of the processor - * (most modern processors are little-endian, on machines with big-endian - * processors the data is in 32bit ARGB format). - */ - frameBuffer: Buffer, - /** - * The dirtyRect is an object with x, y, width, height properties that describes which part of the page was repainted. - * If onlyDirty is set to true, frameBuffer will only contain the repainted area. onlyDirty defaults to false. - */ - dirtyRect?: Rectangle - ): void - } - - interface ContextMenuParams { - /** - * x coordinate - */ - x: number; - /** - * y coordinate - */ - y: number; - /** - * URL of the link that encloses the node the context menu was invoked on. - */ - linkURL: string; - /** - * Text associated with the link. May be an empty string if the contents of the link are an image. - */ - linkText: string; - /** - * URL of the top level page that the context menu was invoked on. - */ - pageURL: string; - /** - * URL of the subframe that the context menu was invoked on. - */ - frameURL: string; - /** - * Source URL for the element that the context menu was invoked on. - * Elements with source URLs are images, audio and video. - */ - srcURL: string; - /** - * Type of the node the context menu was invoked on. - */ - mediaType: 'none' | 'image' | 'audio' | 'video' | 'canvas' | 'file' | 'plugin'; - /** - * Parameters for the media element the context menu was invoked on. - */ - mediaFlags: { - /** - * Whether the media element has crashed. - */ - inError: boolean; - /** - * Whether the media element is paused. - */ - isPaused: boolean; - /** - * Whether the media element is muted. - */ - isMuted: boolean; - /** - * Whether the media element has audio. - */ - hasAudio: boolean; - /** - * Whether the media element is looping. - */ - isLooping: boolean; - /** - * Whether the media element's controls are visible. - */ - isControlsVisible: boolean; - /** - * Whether the media element's controls are toggleable. - */ - canToggleControls: boolean; - /** - * Whether the media element can be rotated. - */ - canRotate: boolean; - } - /** - * Whether the context menu was invoked on an image which has non-empty contents. - */ - hasImageContents: boolean; - /** - * Whether the context is editable. - */ - isEditable: boolean; - /** - * These flags indicate whether the renderer believes it is able to perform the corresponding action. - */ - editFlags: { - /** - * Whether the renderer believes it can undo. - */ - canUndo: boolean; - /** - * Whether the renderer believes it can redo. - */ - canRedo: boolean; - /** - * Whether the renderer believes it can cut. - */ - canCut: boolean; - /** - * Whether the renderer believes it can copy - */ - canCopy: boolean; - /** - * Whether the renderer believes it can paste. - */ - canPaste: boolean; - /** - * Whether the renderer believes it can delete. - */ - canDelete: boolean; - /** - * Whether the renderer believes it can select all. - */ - canSelectAll: boolean; - } - /** - * Text of the selection that the context menu was invoked on. - */ - selectionText: string; - /** - * Title or alt text of the selection that the context was invoked on. - */ - titleText: string; - /** - * The misspelled word under the cursor, if any. - */ - misspelledWord: string; - /** - * The character encoding of the frame on which the menu was invoked. - */ - frameCharset: string; - /** - * If the context menu was invoked on an input field, the type of that field. - */ - inputFieldType: 'none' | 'plainText' | 'password' | 'other'; - /** - * Input source that invoked the context menu. - */ - menuSourceType: 'none' | 'mouse' | 'keyboard' | 'touch' | 'touchMenu'; - } - - interface BluetoothDevice { - deviceName: string; - deviceId: string; - } - - interface Headers { - [key: string]: string; - } - - type NewWindowDisposition = 'default' | 'foreground-tab' | 'background-tab' | 'new-window' | 'save-to-disk' | 'other'; - - /** - * Specifies the action to take place when ending webContents.findInPage request. - * 'clearSelection' - Clear the selection. - * 'keepSelection' - Translate the selection into a normal selection. - * 'activateSelection' - Focus and click the selection node. - */ - type StopFindInPageAtion = 'clearSelection' | 'keepSelection' | 'activateSelection'; - - type CursorType = 'default' | 'crosshair' | 'pointer' | 'text' | 'wait' | 'help' | 'e-resize' | 'n-resize' | 'ne-resize' | 'nw-resize' | 's-resize' | 'se-resize' | 'sw-resize' | 'w-resize' | 'ns-resize' | 'ew-resize' | 'nesw-resize' | 'nwse-resize' | 'col-resize' | 'row-resize' | 'm-panning' | 'e-panning' | 'n-panning' | 'ne-panning' | 'nw-panning' | 's-panning' | 'se-panning' |'sw-panning' | 'w-panning' | 'move' | 'vertical-text' | 'cell' | 'context-menu' | 'alias' | 'progress' | 'nodrop' | 'copy' | 'none' | 'not-allowed' | 'zoom-in' | 'zoom-out' | 'grab' | 'grabbing' | 'custom'; - - interface LoadURLOptions { - /** - * HTTP Referrer URL. - */ - httpReferrer?: string; - /** - * User agent originating the request. - */ - userAgent?: string; - /** - * Extra headers separated by "\n" - */ - extraHeaders?: string; - /** - * POST data - */ - postData?: (UploadRawData | UploadFileSystem | UploadBlob)[]; - } - - interface UploadRawData { - /** - * rawData - */ - type: 'rawData'; - /** - * Data to be uploaded. - */ - bytes: Buffer; - } - - interface UploadFileSystem { - /** - * fileSystem - */ - type: 'fileSystem'; - /** - * FileSystem url to read data for upload. - */ - fileSystemURL: string; - /** - * Defaults to 0. - */ - offset: number; - /** - * Number of bytes to read from offset. Defaults to 0. - */ - length: number; - /** - * Last Modification time in number of seconds sine the UNIX epoch. - */ - modificationTime: number; - } - - interface UploadBlob { - /** - * blob - */ - type: 'blob'; - /** - * UUID of blob data to upload. - */ - blobUUID: string; - } - - interface PrintOptions { - /** - * Don't ask user for print settings. - * Defaults: false. - */ - silent?: boolean; - /** - * Also prints the background color and image of the web page. - * Defaults: false. - */ - printBackground?: boolean; - } - - interface PrintToPDFOptions { - /** - * Specify the type of margins to use. - * 0 - default - * 1 - none - * 2 - minimum - * Default: 0 - */ - marginsType?: number; - /** - * Specify page size of the generated PDF. - * Default: A4. - */ - pageSize?: 'A3' | 'A4' | 'A5' | 'Legal' | 'Letter' | 'Tabloid' | Size; - /** - * Whether to print CSS backgrounds. - * Default: false. - */ - printBackground?: boolean; - /** - * Whether to print selection only. - * Default: false. - */ - printSelectionOnly?: boolean; - /** - * true for landscape, false for portrait. - * Default: false. - */ - landscape?: boolean; - } - - interface Certificate { - /** - * PEM encoded data. - */ - data: string; - /** - * Issuer principal - */ - issuer: CertificatePrincipal; - /** - * Issuer's Common Name. - */ - issuerName: string; - /** - * Issuer certificate (if not self-signed) - */ - issuerCert: Certificate; - /** - * Subject principal - */ - subject: CertificatePrincipal; - /** - * Subject's Common Name. - */ - subjectName: string; - /** - * Hex value represented string. - */ - serialNumber: string; - /** - * Start date of the certificate being valid in seconds. - */ - validStart: number; - /** - * End date of the certificate being valid in seconds. - */ - validExpiry: number; - /** - * Fingerprint of the certificate. - */ - fingerprint: string; - } - - interface CertificatePrincipal { - /** - * Common Name - */ - commonName: string; - /** - * Organization names - */ - organizations: string[]; - /** - * Organization Unit names - */ - organizationUnits: string[]; - /** - * Locality - */ - locality: string; - /** - * State or province - */ - state: string; - /** - * Country or region - */ - country: string; - } - - interface LoginRequest { - method: string; - url: string; - referrer: string; - } - - interface LoginAuthInfo { - isProxy: boolean; - scheme: string; - host: string; - port: number; - realm: string; - } - - interface FindInPageOptions { - /** - * Whether to search forward or backward, defaults to true - */ - forward?: boolean; - /** - * Whether the operation is first request or a follow up, defaults to false. - */ - findNext?: boolean; - /** - * Whether search should be case-sensitive, defaults to false. - */ - matchCase?: boolean; - /** - * Whether to look only at the start of words. defaults to false. - */ - wordStart?: boolean; - /** - * When combined with wordStart, accepts a match in the middle of a word - * if the match begins with an uppercase letter followed by a lowercase - * or non-letter. Accepts several other intra-word matches, defaults to false. - */ - medialCapitalAsWordStart?: boolean; - } - - interface FoundInPageResult { - requestId: number; - /** - * Indicates if more responses are to follow. - */ - finalUpdate: boolean; - /** - * Position of the active match. - */ - activeMatchOrdinal?: number; - /** - * Number of Matches. - */ - matches?: number; - /** - * Coordinates of first match region. - */ - selectionArea?: Rectangle; - } - - interface DeviceEmulationParameters { - /** - * Specify the screen type to emulated - * Default: desktop - */ - screenPosition?: 'desktop' | 'mobile'; - /** - * Set the emulated screen size (screenPosition == mobile) - */ - screenSize?: Size; - /** - * Position the view on the screen (screenPosition == mobile) - * Default: {x: 0, y: 0} - */ - viewPosition?: Point; - /** - * Set the device scale factor (if zero defaults to original device scale factor) - * Default: 0 - */ - deviceScaleFactor: number; - /** - * Set the emulated view size (empty means no override). - */ - viewSize?: Size; - /** - * Whether emulated view should be scaled down if necessary to fit into available space - * Default: false - */ - fitToView?: boolean; - /** - * Offset of the emulated view inside available space (not in fit to view mode) - * Default: {x: 0, y: 0} - */ - offset?: Point; - /** - * Scale of emulated view inside available space (not in fit to view mode) - * Default: 1 - */ - scale: number; - } - - interface SendInputEvent { - type: 'mouseDown' | 'mouseUp' | 'mouseEnter' | 'mouseLeave' | 'contextMenu' | 'mouseWheel' | 'mouseMove' | 'keyDown' | 'keyUp' | 'char'; - modifiers: ('shift' | 'control' | 'alt' | 'meta' | 'isKeypad' | 'isAutoRepeat' | 'leftButtonDown' | 'middleButtonDown' | 'rightButtonDown' | 'capsLock' | 'numLock' | 'left' | 'right')[]; - } - - interface SendInputKeyboardEvent extends SendInputEvent { - keyCode: string; - } - - interface SendInputMouseEvent extends SendInputEvent { - x: number; - y: number; - button?: 'left' | 'middle' | 'right'; - globalX?: number; - globalY?: number; - movementX?: number; - movementY?: number; - clickCount?: number; - } - - interface SendInputMouseWheelEvent extends SendInputEvent { - deltaX?: number; - deltaY?: number; - wheelTicksX?: number; - wheelTicksY?: number; - accelerationRatioX?: number; - accelerationRatioY?: number; - hasPreciseScrollingDeltas?: boolean; - canScroll?: boolean; - } - - /** - * Debugger API serves as an alternate transport for remote debugging protocol. - */ - interface Debugger extends NodeJS.EventEmitter { - /** - * Attaches the debugger to the webContents. - * @param protocolVersion Requested debugging protocol version. - */ - attach(protocolVersion?: string): void; - /** - * @returns Whether a debugger is attached to the webContents. - */ - isAttached(): boolean; - /** - * Detaches the debugger from the webContents. - */ - detach(): void; - /** - * Send given command to the debugging target. - * @param method Method name, should be one of the methods defined by the remote debugging protocol. - * @param commandParams JSON object with request parameters. - * @param callback Response defined by the ‘returns’ attribute of the command description in the remote debugging protocol. - */ - sendCommand(method: string, commandParams?: any, callback?: (error: Error, result: any) => void): void; - /** - * Emitted when debugging session is terminated. This happens either when - * webContents is closed or devtools is invoked for the attached webContents. - */ - on(event: 'detach', listener: (event: Event, reason: string) => void): this; - /** - * Emitted whenever debugging target issues instrumentation event. - * Event parameters defined by the ‘parameters’ attribute in the remote debugging protocol. - */ - on(event: 'message', listener: (event: Event, method: string, params: any) => void): this; - on(event: string, listener: Function): this; - } - - // https://github.com/electron/electron/blob/master/docs/api/web-frame.md - - /** - * The web-frame module allows you to customize the rendering of the current web page. - */ - interface WebFrame { - /** - * Changes the zoom factor to the specified factor, zoom factor is - * zoom percent / 100, so 300% = 3.0. - */ - setZoomFactor(factor: number): void; - /** - * @returns The current zoom factor. - */ - getZoomFactor(): number; - /** - * Changes the zoom level to the specified level, 0 is "original size", and each - * increment above or below represents zooming 20% larger or smaller to default - * limits of 300% and 50% of original size, respectively. - */ - setZoomLevel(level: number): void; - /** - * @returns The current zoom level. - */ - getZoomLevel(): number; - /** - * Sets the maximum and minimum zoom level. - */ - setVisualZoomLevelLimits(minimumLevel: number, maximumLevel: number): void; - /** - * Sets the maximum and minimum layout-based (i.e. non-visual) zoom level. - */ - setLayoutZoomLevelLimits(minimumLevel: number, maximumLevel: number): void; - /** - * Sets a provider for spell checking in input fields and text areas. - */ - setSpellCheckProvider(language: string, autoCorrectWord: boolean, provider: { - /** - * @returns Whether the word passed is correctly spelled. - */ - spellCheck: (text: string) => boolean; - }): void; - /** - * Sets the scheme as secure scheme. Secure schemes do not trigger mixed content - * warnings. For example, https and data are secure schemes because they cannot be - * corrupted by active network attackers. - */ - registerURLSchemeAsSecure(scheme: string): void; - /** - * Resources will be loaded from this scheme regardless of the current page’s Content Security Policy. - */ - registerURLSchemeAsBypassingCSP(scheme: string): void; - /** - * Registers the scheme as secure, bypasses content security policy for resources, - * allows registering ServiceWorker and supports fetch API. - */ - registerURLSchemeAsPrivileged(scheme: string, options?: RegisterURLSchemeOptions): void; - /** - * Inserts text to the focused element. - */ - insertText(text: string): void; - /** - * Evaluates `code` in page. - * In the browser window some HTML APIs like `requestFullScreen` can only be - * invoked by a gesture from the user. Setting `userGesture` to `true` will remove - * this limitation. - * - * @returns Promise - */ - executeJavaScript(code: string, userGesture?: boolean, callback?: (result: any) => void): Promise; - /** - * @returns Object describing usage information of Blink’s internal memory caches. - */ - getResourceUsage(): ResourceUsages; - /** - * Attempts to free memory that is no longer being used (like images from a previous navigation). - */ - clearCache(): void; - } - - interface ResourceUsages { - fonts: ResourceUsage; - images: ResourceUsage; - cssStyleSheets: ResourceUsage; - xslStyleSheets: ResourceUsage; - scripts: ResourceUsage; - other: ResourceUsage; - } - - interface ResourceUsage { - count: number; - decodedSize: number; - liveSize: number; - purgeableSize: number; - purgedSize: number; - size: number; - } - - interface RegisterURLSchemeOptions { - secure?: boolean; - bypassCSP?: boolean; - allowServiceWorkers?: boolean; - supportFetchAPI?: boolean; - corsEnabled?: boolean; - } - - // https://github.com/electron/electron/blob/master/docs/api/web-view-tag.md - - /** - * Use the webview tag to embed 'guest' content (such as web pages) in your Electron app. - * The guest content is contained within the webview container. - * An embedded page within your app controls how the guest content is laid out and rendered. - * - * Unlike an iframe, the webview runs in a separate process than your app. - * It doesn't have the same permissions as your web page and all interactions between your app - * and embedded content will be asynchronous. This keeps your app safe from the embedded content. - */ - interface WebViewElement extends HTMLElement { - /** - * Returns the visible URL. Writing to this attribute initiates top-level navigation. - * Assigning src its own value will reload the current page. - * The src attribute can also accept data URLs, such as data:text/plain,Hello, world!. - */ - src: string; - /** - * If "on", the webview container will automatically resize within the bounds specified - * by the attributes minwidth, minheight, maxwidth, and maxheight. - * These constraints do not impact the webview unless autosize is enabled. - * When autosize is enabled, the webview container size cannot be less than - * the minimum values or greater than the maximum. - */ - autosize: string; - /** - * If "on", the guest page in webview will have node integration and can use node APIs - * like require and process to access low level system resources. - */ - nodeintegration: string; - /** - * If "on", the guest page in webview will be able to use browser plugins. - */ - plugins: string; - /** - * Specifies a script that will be loaded before other scripts run in the guest page. - * The protocol of script's URL must be either file: or asar:, - * because it will be loaded by require in guest page under the hood. - * - * When the guest page doesn't have node integration this script will still have access to all Node APIs, - * but global objects injected by Node will be deleted after this script has finished executing. - */ - preload: string; - /** - * Sets the referrer URL for the guest page. - */ - httpreferrer: string; - /** - * Sets the user agent for the guest page before the page is navigated to. - * Once the page is loaded, use the setUserAgent method to change the user agent. - */ - useragent: string; - /** - * If "on", the guest page will have web security disabled. - */ - disablewebsecurity: string; - /** - * Sets the session used by the page. If partition starts with persist:, - * the page will use a persistent session available to all pages in the app with the same partition. - * If there is no persist: prefix, the page will use an in-memory session. - * By assigning the same partition, multiple pages can share the same session. - * If the partition is unset then default session of the app will be used. - * - * This value can only be modified before the first navigation, - * since the session of an active renderer process cannot change. - * Subsequent attempts to modify the value will fail with a DOM exception. - */ - partition: string; - /** - * If "on", the guest page will be allowed to open new windows. - */ - allowpopups: string; - /** - * A list of strings which specifies the web preferences to be set on the webview, separated by ,. - */ - webpreferences: string; - /** - * A list of strings which specifies the blink features to be enabled separated by ,. - */ - blinkfeatures: string; - /** - * A list of strings which specifies the blink features to be disabled separated by ,. - */ - disableblinkfeatures: string; - /** - * A value that links the webview to a specific webContents. - * When a webview first loads a new webContents is created and this attribute is set - * to its instance identifier. Setting this attribute on a new or existing webview connects - * it to the existing webContents that currently renders in a different webview. - * - * The existing webview will see the destroy event and will then create a new webContents when a new url is loaded. - */ - guestinstance: string; - /** - * Loads the url in the webview, the url must contain the protocol prefix, e.g. the http:// or file://. - */ - loadURL(url: string, options?: LoadURLOptions): void; - /** - * @returns URL of guest page. - */ - getURL(): string; - /** - * @returns The title of guest page. - */ - getTitle(): string; - /** - * @returns Whether the web page is destroyed. - */ - isDestroyed(): boolean; - /** - * @returns Whether the web page is focused. - */ - isFocused(): boolean; - /** - * @returns Whether guest page is still loading resources. - */ - isLoading(): boolean; - /** - * Returns a boolean whether the guest page is waiting for a first-response for the main resource of the page. - */ - isWaitingForResponse(): boolean; - /** - * Stops any pending navigation. - */ - stop(): void; - /** - * Reloads the guest page. - */ - reload(): void; - /** - * Reloads the guest page and ignores cache. - */ - reloadIgnoringCache(): void; - /** - * @returns Whether the guest page can go back. - */ - canGoBack(): boolean; - /** - * @returns Whether the guest page can go forward. - */ - canGoForward(): boolean; - /** - * @returns Whether the guest page can go to offset. - */ - canGoToOffset(offset: number): boolean; - /** - * Clears the navigation history. - */ - clearHistory(): void; - /** - * Makes the guest page go back. - */ - goBack(): void; - /** - * Makes the guest page go forward. - */ - goForward(): void; - /** - * Navigates to the specified absolute index. - */ - goToIndex(index: number): void; - /** - * Navigates to the specified offset from the "current entry". - */ - goToOffset(offset: number): void; - /** - * @returns Whether the renderer process has crashed. - */ - isCrashed(): boolean; - /** - * Overrides the user agent for the guest page. - */ - setUserAgent(userAgent: string): void; - /** - * @returns The user agent for guest page. - */ - getUserAgent(): string; - /** - * Injects CSS into the guest page. - */ - insertCSS(css: string): void; - /** - * Evaluates code in page. If userGesture is set, it will create the user gesture context in the page. - * HTML APIs like requestFullScreen, which require user action, can take advantage of this option for automation. - * - * @returns Promise - */ - executeJavaScript(code: string, userGesture?: boolean, callback?: (result: any) => void): Promise; - /** - * Opens a DevTools window for guest page. - */ - openDevTools(): void; - /** - * Closes the DevTools window of guest page. - */ - closeDevTools(): void; - /** - * @returns Whether guest page has a DevTools window attached. - */ - isDevToolsOpened(): boolean; - /** - * @returns Whether DevTools window of guest page is focused. - */ - isDevToolsFocused(): boolean; - /** - * Starts inspecting element at position (x, y) of guest page. - */ - inspectElement(x: number, y: number): void; - /** - * Opens the DevTools for the service worker context present in the guest page. - */ - inspectServiceWorker(): void; - /** - * Set guest page muted. - */ - setAudioMuted(muted: boolean): void; - /** - * @returns Whether guest page has been muted. - */ - isAudioMuted(): boolean; - /** - * Executes editing command undo in page. - */ - undo(): void; - /** - * Executes editing command redo in page. - */ - redo(): void; - /** - * Executes editing command cut in page. - */ - cut(): void; - /** - * Executes editing command copy in page. - */ - copy(): void; - /** - * Executes editing command paste in page. - */ - paste(): void; - /** - * Executes editing command pasteAndMatchStyle in page. - */ - pasteAndMatchStyle(): void; - /** - * Executes editing command delete in page. - */ - delete(): void; - /** - * Executes editing command selectAll in page. - */ - selectAll(): void; - /** - * Executes editing command unselect in page. - */ - unselect(): void; - /** - * Executes editing command replace in page. - */ - replace(text: string): void; - /** - * Executes editing command replaceMisspelling in page. - */ - replaceMisspelling(text: string): void; - /** - * Inserts text to the focused element. - */ - insertText(text: string): void; - /** - * Starts a request to find all matches for the text in the web page. - * The result of the request can be obtained by subscribing to found-in-page event. - * @returns The request id used for the request. - */ - findInPage(text: string, options?: FindInPageOptions): number; - /** - * Stops any findInPage request for the webview with the provided action. - */ - stopFindInPage(action: StopFindInPageAtion): void; - /** - * Prints webview's web page. Same with webContents.print([options]). - */ - print(options?: PrintOptions): void; - /** - * Prints webview's web page as PDF, Same with webContents.printToPDF(options, callback) - */ - printToPDF(options: PrintToPDFOptions, callback: (error: Error, data: Buffer) => void): void; - /** - * Send an asynchronous message to renderer process via channel, you can also send arbitrary arguments. - * The renderer process can handle the message by listening to the channel event with the ipcRenderer module. - * See webContents.send for examples. - */ - send(channel: string, ...args: any[]): void; - /** - * Sends an input event to the page. - * See webContents.sendInputEvent for detailed description of event object. - */ - sendInputEvent(event: SendInputEvent): void - /** - * Changes the zoom factor to the specified factor. - * Zoom factor is zoom percent divided by 100, so 300% = 3.0. - */ - setZoomFactor(factor: number): void; - /** - * Changes the zoom level to the specified level. - * The original size is 0 and each increment above or below represents - * zooming 20% larger or smaller to default limits of 300% and 50% of original size, respectively. - */ - setZoomLevel(level: number): void; - /** - * Shows pop-up dictionary that searches the selected word on the page. - * Note: This API is available only on macOS. - */ - showDefinitionForSelection(): void; - /** - * @returns The WebContents associated with this webview. - */ - getWebContents(): WebContents; - /** - * Captures a snapshot of the webview's page. Same as webContents.capturePage([rect, ]callback). - */ - capturePage(callback: (image: NativeImage) => void): void; - /** - * Captures a snapshot of the webview's page. Same as webContents.capturePage([rect, ]callback). - */ - capturePage(rect: Rectangle, callback: (image: NativeImage) => void): void; - /** - * Fired when a load has committed. This includes navigation within the current document - * as well as subframe document-level loads, but does not include asynchronous resource loads. - */ - addEventListener(type: 'load-commit', listener: (event: WebViewElement.LoadCommitEvent) => void, useCapture?: boolean): void; - /** - * Fired when the navigation is done, i.e. the spinner of the tab will stop spinning, and the onload event is dispatched. - */ - addEventListener(type: 'did-finish-load', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; - /** - * This event is like did-finish-load, but fired when the load failed or was cancelled, e.g. window.stop() is invoked. - */ - addEventListener(type: 'did-fail-load', listener: (event: WebViewElement.DidFailLoadEvent) => void, useCapture?: boolean): void; - /** - * Fired when a frame has done navigation. - */ - addEventListener(type: 'did-frame-finish-load', listener: (event: WebViewElement.DidFrameFinishLoadEvent) => void, useCapture?: boolean): void; - /** - * Corresponds to the points in time when the spinner of the tab starts spinning. - */ - addEventListener(type: 'did-start-loading', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; - /** - * Corresponds to the points in time when the spinner of the tab stops spinning. - */ - addEventListener(type: 'did-stop-loading', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; - /** - * Fired when details regarding a requested resource is available. - * status indicates socket connection to download the resource. - */ - addEventListener(type: 'did-get-response-details', listener: (event: WebViewElement.DidGetResponseDetails) => void, useCapture?: boolean): void; - /** - * Fired when a redirect was received while requesting a resource. - */ - addEventListener(type: 'did-get-redirect-request', listener: (event: WebViewElement.DidGetRedirectRequestEvent) => void, useCapture?: boolean): void; - /** - * Fired when document in the given frame is loaded. - */ - addEventListener(type: 'dom-ready', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; - /** - * Fired when page title is set during navigation. explicitSet is false when title is synthesized from file URL. - */ - addEventListener(type: 'page-title-updated', listener: (event: WebViewElement.PageTitleUpdatedEvent) => void, useCapture?: boolean): void; - /** - * Fired when page receives favicon URLs. - */ - addEventListener(type: 'page-favicon-updated', listener: (event: WebViewElement.PageFaviconUpdatedEvent) => void, useCapture?: boolean): void; - /** - * Fired when page enters fullscreen triggered by HTML API. - */ - addEventListener(type: 'enter-html-full-screen', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; - /** - * Fired when page leaves fullscreen triggered by HTML API. - */ - addEventListener(type: 'leave-html-full-screen', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; - /** - * Fired when the guest window logs a console message. - */ - addEventListener(type: 'console-message', listener: (event: WebViewElement.ConsoleMessageEvent) => void, useCapture?: boolean): void; - /** - * Fired when a result is available for webview.findInPage request. - */ - addEventListener(type: 'found-in-page', listener: (event: WebViewElement.FoundInPageEvent) => void, useCapture?: boolean): void; - /** - * Fired when the guest page attempts to open a new browser window. - */ - addEventListener(type: 'new-window', listener: (event: WebViewElement.NewWindowEvent) => void, useCapture?: boolean): void; - /** - * Emitted when a user or the page wants to start navigation. - * It can happen when the window.location object is changed or a user clicks a link in the page. - * - * This event will not emit when the navigation is started programmatically with APIs - * like .loadURL and .back. - * - * It is also not emitted during in-page navigation, such as clicking anchor links - * or updating the window.location.hash. Use did-navigate-in-page event for this purpose. - * - * Calling event.preventDefault() does NOT have any effect. - */ - addEventListener(type: 'will-navigate', listener: (event: WebViewElement.WillNavigateEvent) => void, useCapture?: boolean): void; - /** - * Emitted when a navigation is done. - * - * This event is not emitted for in-page navigations, such as clicking anchor links - * or updating the window.location.hash. Use did-navigate-in-page event for this purpose. - */ - addEventListener(type: 'did-navigate', listener: (event: WebViewElement.DidNavigateEvent) => void, useCapture?: boolean): void; - /** - * Emitted when an in-page navigation happened. - * - * When in-page navigation happens, the page URL changes but does not cause - * navigation outside of the page. Examples of this occurring are when anchor links - * are clicked or when the DOM hashchange event is triggered. - */ - addEventListener(type: 'did-navigate-in-page', listener: (event: WebViewElement.DidNavigateInPageEvent) => void, useCapture?: boolean): void; - /** - * Fired when the guest page attempts to close itself. - */ - addEventListener(type: 'close', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; - /** - * Fired when the guest page has sent an asynchronous message to embedder page. - */ - addEventListener(type: 'ipc-message', listener: (event: WebViewElement.IpcMessageEvent) => void, useCapture?: boolean): void; - /** - * Fired when the renderer process is crashed. - */ - addEventListener(type: 'crashed', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; - /** - * Fired when the gpu process is crashed. - */ - addEventListener(type: 'gpu-crashed', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; - /** - * Fired when a plugin process is crashed. - */ - addEventListener(type: 'plugin-crashed', listener: (event: WebViewElement.PluginCrashedEvent) => void, useCapture?: boolean): void; - /** - * Fired when the WebContents is destroyed. - */ - addEventListener(type: 'destroyed', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; - /** - * Emitted when media starts playing. - */ - addEventListener(type: 'media-started-playing', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; - /** - * Emitted when media is paused or done playing. - */ - addEventListener(type: 'media-paused', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; - /** - * Emitted when a page's theme color changes. This is usually due to encountering a meta tag: - * - */ - addEventListener(type: 'did-change-theme-color', listener: (event: WebViewElement.DidChangeThemeColorEvent) => void, useCapture?: boolean): void; - /** - * Emitted when mouse moves over a link or the keyboard moves the focus to a link. - */ - addEventListener(type: 'update-target-url', listener: (event: WebViewElement.UpdateTargetUrlEvent) => void, useCapture?: boolean): void; - /** - * Emitted when DevTools is opened. - */ - addEventListener(type: 'devtools-opened', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; - /** - * Emitted when DevTools is closed. - */ - addEventListener(type: 'devtools-closed', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; - /** - * Emitted when DevTools is focused / opened. - */ - addEventListener(type: 'devtools-focused', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; - addEventListener(type: string, listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; - } - - namespace WebViewElement { - type Event = ElectronPrivate.GlobalEvent; - - interface LoadCommitEvent extends Event { - url: string; - isMainFrame: boolean; - } - - interface DidFailLoadEvent extends Event { - errorCode: number; - errorDescription: string; - validatedURL: string; - isMainFrame: boolean; - } - - interface DidFrameFinishLoadEvent extends Event { - isMainFrame: boolean; - } - - interface DidGetResponseDetails extends Event { - status: boolean; - newURL: string; - originalURL: string; - httpResponseCode: number; - requestMethod: string; - referrer: string; - headers: Headers; - resourceType: string; - } - - interface DidGetRedirectRequestEvent extends Event { - oldURL: string; - newURL: string; - isMainFrame: boolean; - httpResponseCode: number; - requestMethod: string; - referrer: string; - headers: Headers; - } - - interface PageTitleUpdatedEvent extends Event { - title: string; - explicitSet: string; - } - - interface PageFaviconUpdatedEvent extends Event { - favicons: string[]; - } - - interface ConsoleMessageEvent extends Event { - level: number; - message: string; - line: number; - sourceId: string; - } - - interface FoundInPageEvent extends Event { - result: FoundInPageResult; - } - - interface NewWindowEvent extends Event { - url: string; - frameName: string; - disposition: NewWindowDisposition; - options: BrowserWindowOptions; - } - - interface WillNavigateEvent extends Event { - url: string; - } - - interface DidNavigateEvent extends Event { - url: string; - } - - interface DidNavigateInPageEvent extends Event { - url: string; - isMainFrame: boolean; - } - - interface IpcMessageEvent extends Event { - channel: string; - args: any[]; - } - - interface PluginCrashedEvent extends Event { - name: string; - version: string; - } - - interface DidChangeThemeColorEvent extends Event { - themeColor: string; - } - - interface UpdateTargetUrlEvent extends Event { - url: string; - } - } - - /** - * The BrowserWindowProxy object is returned from window.open and provides limited functionality with the child window. - */ - interface BrowserWindowProxy { - /** - * Removes focus from the child window. - */ - blur(): void; - /** - * Forcefully closes the child window without calling its unload event. - */ - close(): void; - /** - * Set to true after the child window gets closed. - */ - closed: boolean; - /** - * Evaluates the code in the child window. - */ - eval(code: string): void; - /** - * Focuses the child window (brings the window to front). - */ - focus(): void; - /** - * Sends a message to the child window with the specified origin or * for no origin preference. - * In addition to these methods, the child window implements window.opener object with no - * properties and a single method. - */ - postMessage(message: string, targetOrigin: string): void; - /** - * Invokes the print dialog on the child window. - */ - print(): void; - } - - // https://github.com/electron/electron/blob/master/docs/api/synopsis.md - - interface CommonElectron { - clipboard: Electron.Clipboard; - crashReporter: Electron.CrashReporter; - nativeImage: typeof Electron.NativeImage; - shell: Electron.Shell; - - app: Electron.App; - autoUpdater: Electron.AutoUpdater; - BrowserWindow: typeof Electron.BrowserWindow; - contentTracing: Electron.ContentTracing; - dialog: Electron.Dialog; - ipcMain: Electron.IpcMain; - globalShortcut: Electron.GlobalShortcut; - Menu: typeof Electron.Menu; - MenuItem: typeof Electron.MenuItem; - net: Electron.Net; - powerMonitor: Electron.PowerMonitor; - powerSaveBlocker: Electron.PowerSaveBlocker; - protocol: Electron.Protocol; - screen: Electron.Screen; - session: typeof Electron.Session; - systemPreferences: Electron.SystemPreferences; - Tray: typeof Electron.Tray; - webContents: Electron.WebContentsStatic; - } - - interface ElectronMainAndRenderer extends CommonElectron { - desktopCapturer: Electron.DesktopCapturer; - ipcRenderer: Electron.IpcRenderer; - remote: Electron.Remote; - webFrame: Electron.WebFrame; - } -} - -declare namespace ElectronPrivate { - type GlobalEvent = Event; -} - -interface Document { - createElement(tagName: 'webview'): Electron.WebViewElement; -} - -// https://github.com/electron/electron/blob/master/docs/api/window-open.md - -interface Window { - /** - * Creates a new window. - */ - open(url: string, frameName?: string, features?: string): Electron.BrowserWindowProxy; -} - -// https://github.com/electron/electron/blob/master/docs/api/file-object.md - -interface File { - /** - * Exposes the real path of the filesystem. - */ - path: string; -} - -// https://github.com/electron/electron/blob/master/docs/api/process.md - -declare namespace NodeJS { - - interface ProcessVersions { - /** - * Electron's version string. - */ - electron: string; - /** - * Chrome's version string. - */ - chrome: string; - } - - interface Process { - /** - * Setting this to true can disable the support for asar archives in Node's built-in modules. - */ - noAsar?: boolean; - /** - * Process's type - */ - type: 'browser' | 'renderer'; - /** - * Path to JavaScript source code. - */ - resourcesPath: string; - /** - * For Mac App Store build, this value is true, for other builds it is undefined. - */ - mas?: boolean; - /** - * If the app is running as a Windows Store app (appx), this value is true, for other builds it is undefined. - */ - windowsStore?: boolean; - /** - * When app is started by being passed as parameter to the default app, - * this value is true in the main process, otherwise it is undefined. - */ - defaultApp?: boolean; - /** - * Emitted when Electron has loaded its internal initialization script - * and is beginning to load the web page or the main script. - */ - on(event: 'loaded', listener: Function): this; - on(event: string, listener: Function): this; - /** - * Causes the main thread of the current process crash; - */ - crash(): void; - /** - * Causes the main thread of the current process hang. - */ - hang(): void; - /** - * Sets the file descriptor soft limit to maxDescriptors or the OS hard limit, - * whichever is lower for the current process. - * - * Note: This API is only available on macOS and Linux. - */ - setFdLimit(maxDescriptors: number): void; - /** - * @returns Object giving memory usage statistics about the current process. - * Note: All statistics are reported in Kilobytes. - */ - getProcessMemoryInfo(): ProcessMemoryInfo; - /** - * @returns Object giving memory usage statistics about the entire system. - * Note: All statistics are reported in Kilobytes. - */ - getSystemMemoryInfo(): SystemMemoryInfo; - } - - interface ProcessMemoryInfo { - /** - * The amount of memory currently pinned to actual physical RAM. - */ - workingSetSize: number; - /** - * The maximum amount of memory that has ever been pinned to actual physical RAM. - */ - peakWorkingSetSize: number; - /** - * The amount of memory not shared by other processes, such as JS heap or HTML content. - */ - privateBytes: number; - /** - * The amount of memory shared between processes, typically memory consumed by the Electron code itself. - */ - sharedBytes: number; - } - - interface SystemMemoryInfo { - /** - * The total amount of physical memory available to the system. - */ - total: number; - /** - * The total amount of memory not being used by applications or disk cache. - */ - free: number; - /** - * The total amount of swap memory available to the system. - */ - swapTotal: number; - /** - * The free amount of swap memory available to the system. - */ - swapFree: number; - } -} - -declare module 'electron' { - var electron: Electron.ElectronMainAndRenderer; - export = electron; -} - -interface NodeRequireFunction { - (moduleName: 'electron'): Electron.ElectronMainAndRenderer; -} diff --git a/ember/ember-tests.ts b/ember/ember-tests.ts deleted file mode 100644 index 91e1f61f6f..0000000000 --- a/ember/ember-tests.ts +++ /dev/null @@ -1,173 +0,0 @@ -var App: any; - -App = Em.Application.create(); - -App.president = Em.Object.create({ - name: 'Barack Obama' -}); -App.country = Em.Object.create({ - presidentNameBinding: 'MyApp.president.name' -}); -App.country.get('presidentName'); -App.president = Em.Object.create({ - firstName: 'Barack', - lastName: 'Obama', - fullName: function() { - return this.get('firstName') + ' ' + this.get('lastName'); - }.property() -}); -App.president.get('fullName'); - -declare class MyPerson extends Em.Object { - static createMan(): MyPerson; -} - -var Person1 = Em.Object.extend({ - say: (thing: string) => { - alert(thing); - } -}); - -declare class MyPerson2 extends Em.Object { - helloWorld(): void; -} -var tom = Person1.create({ - name: 'Tom Dale', - helloWorld() { - this.say('Hi my name is ' + this.get('name')); - } -}); -tom.helloWorld(); - -Person1.reopen({ isPerson: true }); -Person1.create().get('isPerson'); - -Person1.reopenClass({ - createMan: () => { - return Person1.create({ isMan: true }); - } -}); -// ReSharper disable once DuplicatingLocalDeclaration -declare var Person1: typeof MyPerson; -Person1.createMan().get('isMan'); - -var person = Person1.create({ - firstName: 'Yehuda', - lastName: 'Katz' -}); -person.addObserver('fullName', null, () => { }); -person.set('firstName', 'Brohuda'); - -App.todosController = Em.Object.create({ - todos: [ - Em.Object.create({ isDone: false }) - ], - remaining: (function() { - var todos = this.get('todos'); - return todos.filterProperty('isDone', false).get('length'); - }).property('todos.@each.isDone') -}); - -var todos = App.todosController.get('todos'); -var todo = todos.objectAt(0); -todo.set('isDone', true); -App.todosController.get('remaining'); -todo = Em.Object.create({ isDone: false }); -todos.pushObject(todo); -App.todosController.get('remaining'); - -App.wife = Em.Object.create({ - householdIncome: 80000 -}); -App.husband = Em.Object.create({ - householdIncomeBinding: 'App.wife.householdIncome' -}); -App.husband.get('householdIncome'); -App.husband.set('householdIncome', 90000); -App.wife.get('householdIncome'); - -App.user = Em.Object.create({ - fullName: 'Kara Gates' -}); -App.user.set('fullName', 'Krang Gates'); -App.userView.set('userName', 'Truckasaurus Gates'); -App.user.get('fullName'); - -App = Em.Application.create({ - rootElement: '#sidebar' -}); - -App.userController = Em.Object.create({ - content: Em.Object.create({ - firstName: 'Albert', - lastName: 'Hofmann', - posts: 25, - hobbies: 'Riding bicycles' - }) -}); - -Handlebars.registerHelper('highlight', (property: string, options: any) => - new Handlebars.SafeString('' + "some value" + '')); - -var coolView = App.CoolView.create(); - -var Person2 = Em.Object.extend({ - sayHello() { - console.log('Hello from ' + this.get('name')); - } -}); -var people = [ - Person2.create({ name: 'Juan' }), - Person2.create({ name: 'Charles' }), - Person2.create({ name: 'Majd' }) -]; -people.invoke('sayHello'); - -var arr = [Em.Object.create(), Em.Object.create()]; -arr.setEach('name', 'unknown'); -arr.getEach('name'); - -var Person3 = Em.Object.extend({ - name: null, - isHappy: false -}); -var people2 = [ - Person3.create({ name: 'Yehuda', isHappy: true }), - Person3.create({ name: 'Majd', isHappy: false }) -]; -people2.every((person: Em.Object) => { - return !!person.get('isHappy'); -}); -people2.some((person: Em.Object) => { - return !!person.get('isHappy'); -}); -people2.everyProperty('isHappy', true); -people2.someProperty('isHappy', true); - -// Examples taken from http://emberjs.com/api/classes/Em.RSVP.Promise.html -var promise = new Em.RSVP.Promise((resolve: Function, reject: Function) => { - // on success - resolve('ok!'); - - // on failure - reject('no-k!'); -}); - -promise.then((value: any) => { - // on fulfillment -}, (reason: any) => { - // on rejection -}); - -var mix1 = Ember.Mixin.create({ - foo: 1 -}); - -var mix2 = Ember.Mixin.create({ - bar: 2 -}); - -var component1 = Ember.Component.extend( mix1, mix2, { - lyft: Ember.inject.service(), - cars: Ember.computed.readOnly('lyft.cars') -}); diff --git a/ember/index.d.ts b/ember/index.d.ts deleted file mode 100644 index dca7004163..0000000000 --- a/ember/index.d.ts +++ /dev/null @@ -1,2512 +0,0 @@ -// Type definitions for Ember.js 2.7 -// Project: http://emberjs.com/ -// Definitions by: Jed Mao -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// -/// - -declare namespace EmberStates { - - interface Transition { - targetName: string; - urlMethod: string; - intent: any; - params: {}|any; - pivotHandler: any; - resolveIndex: number; - handlerInfos: any; - resolvedModels: {}|any; - isActive: boolean; - state: any; - queryParams: {}|any; - queryParamsOnly: boolean; - - isTransition: boolean; - - /** - The Transition's internal promise. Calling `.then` on this property - is that same as calling `.then` on the Transition object itself, but - this property is exposed for when you want to pass around a - Transition's promise, but not the Transition object itself, since - Transition object can be externally `abort`ed, while the promise - cannot. - */ - promise: Ember.RSVP.Promise; - - /** - Custom state can be stored on a Transition's `data` object. - This can be useful for decorating a Transition within an earlier - hook and shared with a later hook. Properties set on `data` will - be copied to new transitions generated by calling `retry` on this - transition. - */ - data: any; - - /** - A standard promise hook that resolves if the transition - succeeds and rejects if it fails/redirects/aborts. - - Forwards to the internal `promise` property which you can - use in situations where you want to pass around a thennable, - but not the Transition itself. - - @arg {Function} onFulfilled - @arg {Function} onRejected - @arg {String} label optional string for labeling the promise. Useful for tooling. - @return {Promise} - */ - then(onFulfilled: Function, onRejected?: Function, label?: string): Ember.RSVP.Promise; - - /** - Forwards to the internal `promise` property which you can - use in situations where you want to pass around a thennable, - but not the Transition itself. - - @method catch - @arg {Function} onRejection - @arg {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} - */ - catch(onRejection: Function, label?: string): Ember.RSVP.Promise; - - /** - Forwards to the internal `promise` property which you can - use in situations where you want to pass around a thennable, - but not the Transition itself. - - @method finally - @arg {Function} callback - @arg {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} - */ - finally(callback: Function, label?: string): Ember.RSVP.Promise; - - /** - Aborts the Transition. Note you can also implicitly abort a transition - by initiating another transition while a previous one is underway. - */ - abort(): EmberStates.Transition; - normalize(manager: Ember.StateManager, contexts: any[]): void; - - /** - Retries a previously-aborted transition (making sure to abort the - transition if it's still active). Returns a new transition that - represents the new attempt to transition. - */ - retry(): EmberStates.Transition; - - /** - Sets the URL-changing method to be employed at the end of a - successful transition. By default, a new Transition will just - use `updateURL`, but passing 'replace' to this method will - cause the URL to update using 'replaceWith' instead. Omitting - a parameter will disable the URL change, allowing for transitions - that don't update the URL at completion (this is also used for - handleURL, since the URL has already changed before the - transition took place). - - @arg {String} method the type of URL-changing method to use - at the end of a transition. Accepted values are 'replace', - falsy values, or any other non-falsy value (which is - interpreted as an updateURL transition). - - @return {Transition} this transition - */ - method(method: string): EmberStates.Transition; - - /** - Fires an event on the current list of resolved/resolving - handlers within this transition. Useful for firing events - on route hierarchies that haven't fully been entered yet. - - Note: This method is also aliased as `send` - - @arg {Boolean} [ignoreFailure=false] a boolean specifying whether unhandled events throw an error - @arg {String} name the name of the event to fire - */ - trigger(ignoreFailure: boolean, eventName: string): void; - /** - Fires an event on the current list of resolved/resolving - handlers within this transition. Useful for firing events - on route hierarchies that haven't fully been entered yet. - - Note: This method is also aliased as `send` - - @arg {String} name the name of the event to fire - */ - trigger(eventName: string): void; - - /** - Transitions are aborted and their promises rejected - when redirects occur; this method returns a promise - that will follow any redirects that occur and fulfill - with the value fulfilled by any redirecting transitions - that occur. - - @return {Promise} a promise that fulfills with the same - value that the final redirecting transition fulfills with - */ - followRedirects(): Ember.RSVP.Promise; - } - -} - -// Get an alias to the global Array type to use in inner scope below. -type GlobalArray = T[]; - -declare namespace EmberTesting { - - namespace Test { - - class Adapter { - asyncEnd(): void; - asyncStart(): void; - exception(error: string): void; - } - - class QUnitAdapter extends Adapter { } - - } - -} - -interface Function { - observes(...args: string[]): Function; - observesBefore(...args: string[]): Function; - on(...args: string[]): Function; - property(...args: string[]): Function; -} - -interface String { - camelize(): string; - capitalize(): string; - classify(): string; - dasherize(): string; - decamelize(): string; - fmt(...args: string[]): string; - htmlSafe(): typeof Handlebars.SafeString; - loc(...args: string[]): string; - underscore(): string; - w(): string[]; -} - -interface Array { - constructor(arr: any[]): void; - activate(): void; - addArrayObserver(target: any, opts?: EnumerableConfigurationOptions): any[]; - addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): any[]; - any(callback: Function, target?: any): boolean; - anyBy(key: string, value?: string): boolean; - arrayContentDidChange(startIdx: number, removeAmt: number, addAmt: number): any[]; - arrayContentWillChange(startIdx: number, removeAmt: number, addAmt: number): any[]; - someProperty(key: string, value?: any): boolean; - clear(): any[]; - compact(): any[]; - contains(obj: any): boolean; - enumerableContentDidChange(start: number, removing: Ember.Enumerable | number, adding: Ember.Enumerable | number): any; - enumerableContentDidChange(removing: Ember.Enumerable | number, adding: Ember.Enumerable | number): any; - enumerableContentWillChange(removing: Ember.Enumerable | number, adding: Ember.Enumerable | number): Ember.Enumerable; - every(callback: Function, target?: any): boolean; - everyBy(key: string, value?: string): boolean; - everyProperty(key: string, value?: any): boolean; - filter(callback: Function, target?: any): any[]; - filterBy(key: string, value?: string): any[]; - - /** - Returns the first item in the array for which the callback returns true. - This method works similar to the `filter()` method defined in JavaScript 1.6 - except that it will stop working on the array once a match is found. - The callback method you provide should have the following signature (all - parameters are optional): - ```javascript - function(item, index, enumerable); - ``` - - `item` is the current item in the iteration. - - `index` is the current index in the iteration. - - `enumerable` is the enumerable object itself. - It should return the `true` to include the item in the results, `false` - otherwise. - Note that in addition to a callback, you can also pass an optional target - object that will be set as `this` on the context. This is a good way - to give your iterator function access to the current object. - @function find - @arg callback The callback to execute - @arg {Object} [target] The target object to use - @return {Object} Found item or `undefined`. -*/ - find(callback: Function, target?: any): any; - findBy(key: string, value?: string): any; - forEach(callback: Function, target?: any): any; - getEach(key: string): any[]; - indexOf(object: any, startAt?: number): number; - insertAt(idx: number, object: any): any[]; - invoke(methodName: string, ...args: any[]): any[]; - lastIndexOf(object: any, startAt?: number): number; - map(callback: Function, target?: any): any[]; - mapBy(key: string): any[]; - nextObject(index: number, previousObject: any, context: any): any; - objectAt(idx: number): any; - objectsAt(...args: number[]): any[]; - popObject(): any; - pushObject(obj: any): any; - pushObjects(...args: any[]): any[]; - reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any; - reject: ItemIndexEnumerableCallbackTarget; - rejectBy(key: string, value?: string): any[]; - removeArrayObserver(target: any, opts: EnumerableConfigurationOptions): any[]; - removeAt(start: number, len: number): any; - removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): any[]; - replace(idx: number, amt: number, objects: any[]): void; - reverseObjects(): any[]; - setEach(key: string, value?: any): any; - setObjects(objects: any[]): any[]; - shiftObject(): any; - slice(beginIndex?: number, endIndex?: number): any[]; - some(callback: Function, target?: any): boolean; - toArray(): any[]; - uniq(): any[]; - unshiftObject(object: any): any; - unshiftObjects(objects: any[]): any[]; - without(value: any): any[]; - '[]': any[]; - '@each': Ember.EachProxy; - Boolean: boolean; - firstObject: any; - hasEnumerableObservers: boolean; - lastObject: any; - addObject(object: any): any; - addObjects(objects: Ember.Enumerable): any[]; - removeObject(object: any): any; - removeObjects(objects: Ember.Enumerable): any[]; - addObserver: ModifyObserver; - beginPropertyChanges(): any[]; - cacheFor(keyName: string): any; - decrementProperty(keyName: string, decrement?: number): number; - endPropertyChanges(): any[]; - get(keyName: string): any; - getProperties(...args: string[]): {}; - getProperties(keys: string[]): {}; - getWithDefault(keyName: string, defaultValue: any): any; - hasObserverFor(key: string): boolean; - incrementProperty(keyName: string, increment?: number): number; - notifyPropertyChange(keyName: string): any[]; - propertyDidChange(keyName: string): any[]; - propertyWillChange(keyName: string): any[]; - removeObserver(key: string, target: any, method: Function | string): Ember.Observable; - set(keyName: string, value: any): any[]; - setProperties(hash: {}): any[]; - toggleProperty(keyName: string): any; - copy(deep: boolean): any[]; - frozenCopy(): any[]; - // 1.3 - isAny(key: string, value?: string): boolean; - isEvery(key: string, value?: string): boolean; -} - -interface ApplicationCreateArguments { - customEvents?: {}; - rootElement?: string; - /** - Basic logging of successful transitions. - **/ - LOG_TRANSITIONS?: boolean; - /** - Detailed logging of all routing steps. - **/ - LOG_TRANSITIONS_INTERNAL?: boolean; -} - -type ApplicationInitializerFunction = (container: Ember.Container, application: Ember.Application) => void; - -interface ApplicationInitializerArguments { - name?: string; - initialize?: ApplicationInitializerFunction; -} - -interface CoreObjectArguments { - /** - An overridable method called when objects are instantiated. By default, does nothing unless it is - overridden during class definition. NOTE: If you do override init for a framework class like Ember.View - or Ember.ArrayController, be sure to call this._super() in your init declaration! If you don't, Ember - may not have an opportunity to do important setup work, and you'll see strange behavior in your application. - **/ - init?: Function; - /** - Override to implement teardown. - **/ - willDestroy?: Function; - - [propName: string]: any; -} - -interface EnumerableConfigurationOptions { - willChange?: boolean ; - didChange?: boolean ; -} - -type ItemIndexEnumerableCallbackTarget = (callback: ItemIndexEnumerableCallback, target?: any) => any[]; - - -type ItemIndexEnumerableCallback = (item: any, index: number, enumerable: Ember.Enumerable) => void; - - -type ReduceCallback = (previousValue: any, item: any, index: number, enumerable: Ember.Enumerable) => void; - - -interface TransitionsHash { - contexts: any[]; - exitStates: Ember.State[]; - enterStates: Ember.State[]; - resolveState: Ember.State; -} - -interface ActionsHash { - willTransition?: Function; - error?: Function; -} - -interface DisconnectOutletOptions { - outlet?: string; - parentView?: string; -} - -interface RenderOptions { - into?: string; - controller?: string; - model?: any; - outlet?: string; - view?: string; -} - -type ModifyObserver = (obj: any, path: string | null, target: Function | any, method?: Function | string) => void; - -declare namespace Ember { - /** - Alias for jQuery. - **/ - // ReSharper disable once DuplicatingLocalDeclaration - var $: JQueryStatic; - /** - Creates an Ember.NativeArray from an Array like object. Does not modify the original object. - Ember.A is not needed if Ember.EXTEND_PROTOTYPES is true (the default value). However, it is - recommended that you use Ember.A when creating addons for ember or when you can not garentee - that Ember.EXTEND_PROTOTYPES will be true. - **/ - function A(arr?: any[]): NativeArray; - /** - The Ember.ActionHandler mixin implements support for moving an actions property to an _actions - property at extend time, and adding _actions to the object's mergedProperties list. - **/ - class ActionHandlerMixin { - /** - Triggers a named action on the ActionHandler - **/ - send(name: string, ...args: any[]): void; - /** - The collection of functions, keyed by name, available on this ActionHandler as action targets. - **/ - actions: ActionsHash; - } - /** - An instance of Ember.Application is the starting point for every Ember application. It helps to - instantiate, initialize and coordinate the many objects that make up your app. - **/ - class Application extends Namespace { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - /** - Call advanceReadiness after any asynchronous setup logic has completed. - Each call to deferReadiness must be matched by a call to advanceReadiness - or the application will never become ready and routing will not begin. - **/ - advanceReadiness(): void; - /** - Use this to defer readiness until some condition is true. - - This allows you to perform asynchronous setup logic and defer - booting your application until the setup has finished. - - However, if the setup requires a loading UI, it might be better - to use the router for this purpose. - */ - deferReadiness(): void; - /** - defines an injection or typeInjection - **/ - inject(factoryNameOrType: string, property: string, injectionName: string): void; - /** - This injects the test helpers into the window's scope. If a function of the - same name has already been defined it will be cached (so that it can be reset - if the helper is removed with `unregisterHelper` or `removeTestHelpers`). - Any callbacks registered with `onInjectHelpers` will be called once the - helpers have been injected. - **/ - injectTestHelpers(): void; - /** - registers a factory for later injection - @param fullName type:name (e.g., 'model:user') - @param factory (e.g., App.Person) - **/ - register(fullName: string, factory: Function, options?: {}): void; - /** - This removes all helpers that have been registered, and resets and functions - that were overridden by the helpers. - **/ - removeTestHelpers(): void; - /** - Reset the application. This is typically used only in tests. - **/ - reset(): void; - /** - This hook defers the readiness of the application, so that you can start - the app when your tests are ready to run. It also sets the router's - location to 'none', so that the window's location will not be modified - (preventing both accidental leaking of state between tests and interference - with your testing framework). - **/ - setupForTesting(): void; - /** - The DOM events for which the event dispatcher should listen. - */ - customEvents: {}; - /** - The Ember.EventDispatcher responsible for delegating events to this application's views. - **/ - eventDispatcher: EventDispatcher; - /** - Set this to provide an alternate class to Ember.DefaultResolver - **/ - resolver: DefaultResolver; - /** - The root DOM element of the Application. This can be specified as an - element or a jQuery-compatible selector string. - - This is the element that will be passed to the Application's, eventDispatcher, - which sets up the listeners for event delegation. Every view in your application - should be a child of the element you specify here. - **/ - rootElement: HTMLElement; - /** - Called when the Application has become ready. - The call will be delayed until the DOM has become ready. - **/ - ready: Function; - /** - Application's router. - **/ - Router: Router; - registry: Registry; - } - /** - This module implements Observer-friendly Array-like behavior. This mixin is picked up by the - Array class as well as other controllers, etc. that want to appear to be arrays. - **/ - class Array implements Enumerable { - addArrayObserver(target: any, opts?: EnumerableConfigurationOptions): any[]; - addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; - any(callback: Function, target?: any): boolean; - anyBy(key: string, value?: string): boolean; - arrayContentDidChange(startIdx: number, removeAmt: number, addAmt: number): any[]; - arrayContentWillChange(startIdx: number, removeAmt: number, addAmt: number): any[]; - someProperty(key: string, value?: string): boolean; - compact(): any[]; - contains(obj: any): boolean; - enumerableContentDidChange(start: number, removing: Enumerable | number, adding: Enumerable | number): any; - enumerableContentDidChange(removing: Enumerable | number, adding: Enumerable | number): any; - enumerableContentWillChange(removing: Enumerable | number, adding: Enumerable | number): Enumerable; - every(callback: Function, target?: any): boolean; - everyBy(key: string, value?: string): boolean; - everyProperty(key: string, value?: string): boolean; - filter(callback: Function, target: any): any[]; - filterBy(key: string, value?: string): any[]; - find(callback: Function, target?: any): any; - findBy(key: string, value?: string): any; - forEach(callback: Function, target?: any): any; - getEach(key: string): any[]; - indexOf(object: any, startAt: number): number; - invoke(methodName: string, ...args: any[]): any[]; - lastIndexOf(object: any, startAt: number): number; - map: ItemIndexEnumerableCallbackTarget; - mapBy(key: string): any[]; - nextObject(index: number, previousObject: any, context: any): any; - objectAt(idx: number): any; - objectsAt(...args: number[]): any[]; - reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any; - reject: ItemIndexEnumerableCallbackTarget; - rejectBy(key: string, value?: string): any[]; - removeArrayObserver(target: any, opts: EnumerableConfigurationOptions): any[]; - removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; - setEach(key: string, value?: any): any; - slice(beginIndex?: number, endIndex?: number): any[]; - some(callback: Function, target?: any): boolean; - toArray(): any[]; - uniq(): Enumerable; - without(value: any): Enumerable; - '@each': EachProxy; - Boolean: boolean; - '[]': any[]; - firstObject: any; - hasEnumerableObservers: boolean; - lastObject: any; - length: number; - } - /** - An ArrayProxy wraps any other object that implements Ember.Array and/or Ember.MutableArray, - forwarding all requests. This makes it very useful for a number of binding use cases or other cases - where being able to swap out the underlying array is useful. - **/ - class ArrayProxy extends Object implements MutableArray { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - addArrayObserver(target: any, opts?: EnumerableConfigurationOptions): any[]; - addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; - any(callback: Function, target?: any): boolean; - anyBy(key: string, value?: string): boolean; - arrayContentDidChange(startIdx: number, removeAmt: number, addAmt: number): any[]; - arrayContentWillChange(startIdx: number, removeAmt: number, addAmt: number): any[]; - someProperty(key: string, value?: string): boolean; - clear(): any[]; - compact(): any[]; - contains(obj: any): boolean; - enumerableContentDidChange(start: number, removing: Enumerable | number, adding: Enumerable | number): any; - enumerableContentDidChange(removing: Enumerable | number, adding: Enumerable | number): any; - enumerableContentWillChange(removing: Enumerable | number, adding: Enumerable | number): Enumerable; - every(callback: Function, target?: any): boolean; - everyBy(key: string, value?: string): boolean; - everyProperty(key: string, value?: string): boolean; - filter(callback: Function, target: any): any[]; - filterBy(key: string, value?: string): any[]; - find(callback: Function, target: any): any; - findBy(key: string, value?: string): any; - forEach(callback: Function, target?: any): any; - getEach(key: string): any[]; - indexOf(object: any, startAt: number): number; - insertAt(idx: number, object: any): any[]; - invoke(methodName: string, ...args: any[]): any[]; - lastIndexOf(object: any, startAt: number): number; - map: ItemIndexEnumerableCallbackTarget; - mapBy(key: string): any[]; - nextObject(index: number, previousObject: any, context: any): any; - objectAt(idx: number): any; - objectAtContent(idx: number): any; - objectsAt(...args: number[]): any[]; - popObject(): any; - pushObject(obj: any): any; - pushObjects(...args: any[]): any[]; - reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any; - reject: ItemIndexEnumerableCallbackTarget; - rejectBy(key: string, value?: string): any[]; - removeArrayObserver(target: any, opts: EnumerableConfigurationOptions): any[]; - removeAt(start: number, len: number): any; - removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; - replace(idx: number, amt: number, objects: any[]): any; - replaceContent(idx: number, amt: number, objects: any[]): void; - reverseObjects(): any[]; - setEach(key: string, value?: any): any; - setObjects(objects: any[]): any[]; - shiftObject(): any; - slice(beginIndex?: number, endIndex?: number): any[]; - some(callback: Function, target?: any): boolean; - toArray(): any[]; - uniq(): Enumerable; - unshiftObject(object: any): any; - unshiftObjects(objects: any[]): any[]; - without(value: any): Enumerable; - '[]': any[]; - '@each': EachProxy; - Boolean: boolean; - firstObject: any; - hasEnumerableObservers: boolean; - lastObject: any; - length: number; - addObject(object: any): any; - addObjects(objects: Enumerable): MutableEnumberable; - removeObject(object: any): any; - removeObjects(objects: Enumerable): MutableEnumberable; - } - var BOOTED: boolean; - /** - Connects the properties of two objects so that whenever the value of one property changes, - the other property will be changed also. - **/ - class Binding { - constructor(toPath: string, fromPath: string); - connect(obj: any): Binding; - copy(): Binding; - disconnect(): Binding; - from(path: string): Binding; - to(path: string | any[]): Binding; - toString(): string; - } - class Button extends Component implements TargetActionSupport { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - triggerAction(opts: {}): boolean; - } - /** - The internal class used to create text inputs when the {{input}} helper is used - with type of checkbox. See Handlebars.helpers.input for usage details. - **/ - class Checkbox extends Component { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - } - /** - Implements some standard methods for comparing objects. Add this mixin to any class - you create that can compare its instances. - **/ - class Comparable { - compare(a: any, b: any): number; - } - /** - A view that is completely isolated. Property access in its templates go to the view object - and actions are targeted at the view object. There is no access to the surrounding context or - outer controller; all contextual information is passed in. - **/ - class Component extends Object { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - sendAction(action: string, context: any): void; - targetObject: Controller; - } - /** - A computed property transforms an objects function into a property. - By default the function backing the computed property will only be called once and the result - will be cached. You can specify various properties that your computed property is dependent on. - This will force the cached result to be recomputed if the dependencies are modified. - **/ - class ComputedProperty { - get(keyName: string): any; - meta(meta: {}): ComputedProperty; - property(...args: string[]): ComputedProperty; - readOnly(): ComputedProperty; - set(keyName: string, newValue: any, oldValue: string): any; - // ReSharper disable UsingOfReservedWord - volatile(): ComputedProperty; - // ReSharper restore UsingOfReservedWord - } - class Container { - constructor(parent: Container); - parent: Container; - children: any[]; - owner: any; - ownerInjection(): any; - resolver: Function; - registry: Registry; - cache: {}; - typeInjections: {}; - injections: {}; - child(): Container; - set(object: {}, key: string, value: any): void; - /** - registers a factory for later injection - @param fullName type:name (e.g., 'model:user') - @param factory (e.g., App.Person) - **/ - describe(fullName: string): string; - makeToString(factory: any, fullName: string): Function; - lookup(fullName: string, options?: {}): any; - lookupFactory(fullName: string, options?: {}): any; - destroy(): void; - reset(): void; - } - class Controller extends Object implements ControllerMixin { - replaceRoute(name: string, ...args: any[]): void; - transitionToRoute(name: string, ...args: any[]): void; - controllers: {}; - model: any; - needs: string[]; - queryParams: any; - target: any; - send(name: string, ...args: any[]): void; - actions: ActionsHash; - } - /** - Additional methods for the ControllerMixin. - **/ - class ControllerMixin extends ActionHandlerMixin { - replaceRoute(name: string, ...args: any[]): void; - transitionToRoute(name: string, ...args: any[]): void; - controllers: {}; - model: any; - needs: string[]; - queryParams: any; - target: any; - } - /** - Implements some standard methods for copying an object. Add this mixin to any object you - create that can create a copy of itself. This mixin is added automatically to the built-in array. - You should generally implement the copy() method to return a copy of the receiver. - Note that frozenCopy() will only work if you also implement Ember.Freezable. - **/ - class Copyable { - copy(deep: boolean): Copyable; - frozenCopy(): Copyable; - } - class CoreObject { - /** - An overridable method called when objects are instantiated. By default, - does nothing unless it is overridden during class definition. - @method init - **/ - init(): void; - - /** - Defines the properties that will be concatenated from the superclass (instead of overridden). - @property concatenatedProperties - @type Array - @default null - **/ - concatenatedProperties: any[]; - - /** - Destroyed object property flag. If this property is true the observers and bindings were - already removed by the effect of calling the destroy() method. - @property isDestroyed - @default false - **/ - isDestroyed: boolean; - /** - Destruction scheduled flag. The destroy() method has been called. The object stays intact - until the end of the run loop at which point the isDestroyed flag is set. - @property isDestroying - @default false - **/ - isDestroying: boolean; - - /** - Destroys an object by setting the `isDestroyed` flag and removing its - metadata, which effectively destroys observers and bindings. - If you try to set a property on a destroyed object, an exception will be - raised. - Note that destruction is scheduled for the end of the run loop and does not - happen immediately. It will set an isDestroying flag immediately. - @method destroy - @return {Ember.Object} receiver - */ - destroy(): CoreObject; - - /** - Override to implement teardown. - @method willDestroy - */ - willDestroy(): void; - - /** - Returns a string representation which attempts to provide more information than Javascript's toString - typically does, in a generic way for all Ember objects (e.g., ""). - @method toString - @return {String} string representation - **/ - toString(): string; - - static isClass: boolean; - static isMethod: boolean; - - /** - Creates a new subclass. - @method extend - @static - @param {Mixin} [mixins] - One or more Mixin classes - @param {Object} [args] - Object containing values to use within the new class - **/ - static extend(args?: CoreObjectArguments): T; - static extend(mixin1: Mixin, args?: CoreObjectArguments): T; - static extend(mixin1: Mixin, mixin2: Mixin, args?: CoreObjectArguments): T; - - /** - Creates a new subclass. - @method extend - @param {Mixin} [mixins] - One or more Mixin classes - @param {Object} [args] - Object containing values to use within the new class - Non-static method because Ember classes aren't currently 'real' TypeScript classes. - **/ - extend(mixin1 ?: Mixin, mixin2 ?: Mixin, args ?: CoreObjectArguments): T; - - /** - Equivalent to doing extend(arguments).create(). If possible use the normal create method instead. - @method createWithMixins - @static - @param [args] - **/ - static createWithMixins(args?: {}): T; - - /** - Creates an instance of the class. - @method create - @static - @param [args] - A hash containing values with which to initialize the newly instantiated object. - **/ - static create(args?: {}): T; - - /** - Augments a constructor's prototype with additional properties and functions. - To add functions and properties to the constructor itself, see reopenClass. - @method reopen - **/ - static reopen(args?: {}): T; - - /** - Augments a constructor's own properties and functions. - To add functions and properties to instances of a constructor by extending the - constructor's prototype see reopen. - @method reopenClass - **/ - static reopenClass(args?: {}): T; - - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - - /** - Returns the original hash that was passed to meta(). - @method metaForProperty - @static - @param key {String} property name - **/ - static metaForProperty(key: string): {}; - - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - - @method eachComputedProperty - @static - @param {Function} callback - @param {Object} binding - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - } - class DAG { - add(name: string): any; - map(name: string, value: any): void; - addEdge(fromName: string, toName: string): void; - topsort(fn: Function): void; - addEdges(name: string, value: any, before: any, after: any): void; - names: any[]; - vertices: {}; - } - function DEFAULT_GETTER_FUNCTION(name: string): Function; - /** - The DefaultResolver defines the default lookup rules to resolve container lookups before consulting - the container for registered items: - templates are looked up on Ember.TEMPLATES - other names are looked up on the application after converting the name. - For example, controller:post looks up App.PostController by default. - **/ - class DefaultResolver { - resolve(fullName: string): {}; - namespace: Application; - } - /** - Objects of this type can implement an interface to respond to requests to get and set. - The default implementation handles simple properties. - You generally won't need to create or subclass this directly. - **/ - class Descriptor { } - namespace ENV { - export var EXTEND_PROTOTYPES: typeof Ember.EXTEND_PROTOTYPES; - export var LOG_BINDINGS: boolean; - export var LOG_STACKTRACE_ON_DEPRECATION: boolean; - export var LOG_VERSION: boolean; - export var MODEL_FACTORY_INJECTIONS: boolean; - export var RAISE_ON_DEPRECATION: boolean; - } - namespace EXTEND_PROTOTYPES { - export var Array: boolean; - export var Function: boolean; - export var String: boolean; - } - /** - This is the object instance returned when you get the @each property on an array. It uses - the unknownProperty handler to automatically create EachArray instances for property names. - **/ - class EachProxy extends Object { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - unknownProperty(keyName: string, value: any): any[]; - } - /** - This mixin defines the common interface implemented by enumerable objects in Ember. Most of these - methods follow the standard Array iteration API defined up to JavaScript 1.8 (excluding language-specific - features that cannot be emulated in older versions of JavaScript). - This mixin is applied automatically to the Array class on page load, so you can use any of these methods - on simple arrays. If Array already implements one of these methods, the mixin will not override them. - **/ - class Enumerable { - addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; - any(callback: Function, target?: any): boolean; - anyBy(key: string, value?: string): boolean; - someProperty(key: string, value?: string): boolean; - compact(): any[]; - contains(obj: any): boolean; - enumerableContentDidChange(start: number, removing: Enumerable | number, adding: Enumerable | number): any; - enumerableContentDidChange(removing: Enumerable | number, adding: Enumerable | number): any; - enumerableContentWillChange(removing: Enumerable | number, adding: Enumerable | number): Enumerable; - every(callback: Function, target?: any): boolean; - everyBy(key: string, value?: string): boolean; - everyProperty(key: string, value?: string): boolean; - filter(callback: Function, target: any): any[]; - filterBy(key: string, value?: string): any[]; - find(callback: Function, target: any): any; - findBy(key: string, value?: string): any; - forEach(callback: Function, target?: any): any; - getEach(key: string): any[]; - invoke(methodName: string, ...args: any[]): any[]; - map: ItemIndexEnumerableCallbackTarget; - mapBy(key: string): any[]; - nextObject(index: number, previousObject: any, context: any): any; - reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any; - reject: ItemIndexEnumerableCallbackTarget; - rejectBy(key: string, value?: string): any[]; - removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; - setEach(key: string, value?: any): any; - some(callback: Function, target?: any): boolean; - toArray(): any[]; - uniq(): Enumerable; - without(value: any): Enumerable; - '[]': any[]; - firstObject: any; - hasEnumerableObservers: boolean; - lastObject: any; - } - /** - A subclass of the JavaScript Error object for use in Ember. - **/ - // Restore this to 'typeof Error' when https://github.com/Microsoft/TypeScript/issues/983 is resolved - // ReSharper disable once DuplicatingLocalDeclaration - var Error: any; // typeof Error; - /** - Handles delegating browser events to their corresponding Ember.Views. For example, when you click on - a view, Ember.EventDispatcher ensures that that view's mouseDown method gets called. - **/ - class EventDispatcher extends Object { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - events: {}; - } - /** - This mixin allows for Ember objects to subscribe to and emit events. - You can also chain multiple event subscriptions. - **/ - class Evented { - has(name: string): boolean; - off(name: string, target: any, method: Function): Evented; - on(name: string, target: any, method: Function): Evented; - one(name: string, target: any, method: Function): Evented; - trigger(name: string, ...args: string[]): void; - } - var FROZEN_ERROR: string; - class Freezable { - freeze(): Freezable; - isFrozen: boolean; - } - var GUID_KEY: string; - namespace Handlebars { - function compile(string: string): Function; - function compile(environment: any, options?: any, context?: any, asObject?: any): any; - function precompile(string: string, options: any): void; - class Compiler { } - class JavaScriptCompiler { } - function registerPartial(name: string, str: any): void; - function K(): any; - function createFrame(objec: any): any; - function Exception(message: string): void; - class SafeString { - constructor(str: string); - static toString(): string; - } - function parse(string: string): any; - function print(ast: any): void; - var logger: typeof Ember.Logger; - function log(level: string, str: string): void; - } - class HashLocation extends Object { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - } - class HistoryLocation extends Object { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - rootURL: string; - } - var IS_BINDING: RegExp; - var inject: { - controller(name?: string): Controller; - service(name?: string): Service; - }; - class Helper extends Object { - static helper( h: (a: any) => any): Helper; - compute(params: any[], hash: any): any; - recompute(params: any[], hash: any): any; - } - class Instrumentation { - getProperties(obj: any, list: any[]): {}; - getProperties(obj: any, ...args: string[]): {}; - instrument(name: string, payload: any, callback: Function, binding: any): void; - reset(): void; - subscribe(pattern: string, object: any): void; - unsubscribe(subscriber: any): void; - } - var K: Function; - var LOG_BINDINGS: boolean; - var LOG_STACKTRACE_ON_DEPRECATION: boolean; - var LOG_VERSION: boolean; - class Location { - create(options?: {}): any; - registerImplementation(name: string, implementation: any): void; - } - var Logger: { - assert(param: any): void; - debug(...args: any[]): void; - error(...args: any[]): void; - info(...args: any[]): void; - log(...args: any[]): void; - warn(...args: any[]): void; - }; - function MANDATORY_SETTER_FUNCTION(value: string): void; - var META_KEY: string; - class Map { - copy(): Map; - static create(): Map; - forEach(callback: Function, self: any): void; - get(key: any): any; - has(key: any): boolean; - set(key: any, value: any): void; - length: number; - } - class MapWithDefault extends Map { - copy(): MapWithDefault; - static create(): MapWithDefault; - } - class Mixin { - apply(obj: any): any; - /** - Creates an instance of the class. - @param arguments A hash containing values with which to initialize the newly instantiated object. - **/ - static create(...args: CoreObjectArguments[]): T; - detect(obj: any): boolean; - reopen(args?: {}): T; - } - class MutableArray implements Array, MutableEnumberable { - addArrayObserver(target: any, opts?: EnumerableConfigurationOptions): any[]; - addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; - any(callback: Function, target?: any): boolean; - anyBy(key: string, value?: string): boolean; - arrayContentDidChange(startIdx: number, removeAmt: number, addAmt: number): any[]; - arrayContentWillChange(startIdx: number, removeAmt: number, addAmt: number): any[]; - someProperty(key: string, value?: string): boolean; - clear(): any[]; - compact(): any[]; - contains(obj: any): boolean; - enumerableContentDidChange(start: number, removing: Enumerable | number, adding: Enumerable | number): any; - enumerableContentDidChange(removing: Enumerable | number, adding: Enumerable | number): any; - enumerableContentWillChange(removing: Enumerable | number, adding: Enumerable | number): Enumerable; - every(callback: Function, target?: any): boolean; - everyBy(key: string, value?: string): boolean; - everyProperty(key: string, value?: string): boolean; - filter(callback: Function, target: any): any[]; - filterBy(key: string, value?: string): any[]; - find(callback: Function, target: any): any; - findBy(key: string, value?: string): any; - forEach(callback: Function, target?: any): any; - getEach(key: string): any[]; - indexOf(object: any, startAt: number): number; - insertAt(idx: number, object: any): any[]; - invoke(methodName: string, ...args: any[]): any[]; - lastIndexOf(object: any, startAt: number): number; - map: ItemIndexEnumerableCallbackTarget; - mapBy(key: string): any[]; - nextObject(index: number, previousObject: any, context: any): any; - objectAt(idx: number): any; - objectsAt(...args: number[]): any[]; - popObject(): any; - pushObject(obj: any): any; - pushObjects(...args: any[]): any[]; - reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any; - reject: ItemIndexEnumerableCallbackTarget; - rejectBy(key: string, value?: string): any[]; - removeArrayObserver(target: any, opts: EnumerableConfigurationOptions): any[]; - removeAt(start: number, len: number): any; - removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; - replace(idx: number, amt: number, objects: any[]): any; - reverseObjects(): any[]; - setEach(key: string, value?: any): any; - setObjects(objects: any[]): any[]; - shiftObject(): any; - slice(beginIndex?: number, endIndex?: number): any[]; - some(callback: Function, target?: any): boolean; - toArray(): any[]; - uniq(): Enumerable; - unshiftObject(object: any): any; - unshiftObjects(objects: any[]): any[]; - without(value: any): Enumerable; - '[]': any[]; - '@each': EachProxy; - Boolean: boolean; - firstObject: any; - hasEnumerableObservers: boolean; - lastObject: any; - length: number; - addObject(object: any): any; - addObjects(objects: Enumerable): MutableEnumberable; - removeObject(object: any): any; - removeObjects(objects: Enumerable): MutableEnumberable; - } - class MutableEnumberable implements Enumerable { - addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; - addObject(object: any): any; - addObjects(objects: Enumerable): MutableEnumberable; - any(callback: Function, target?: any): boolean; - anyBy(key: string, value?: string): boolean; - someProperty(key: string, value?: string): boolean; - compact(): any[]; - contains(obj: any): boolean; - enumerableContentDidChange(start: number, removing: Enumerable | number, adding: Enumerable | number): any; - enumerableContentDidChange(removing: Enumerable | number, adding: Enumerable | number): any; - enumerableContentWillChange(removing: Enumerable | number, adding: Enumerable | number): Enumerable; - every(callback: Function, target?: any): boolean; - everyBy(key: string, value?: string): boolean; - everyProperty(key: string, value?: string): boolean; - filter(callback: Function, target: any): any[]; - filterBy(key: string, value?: string): any[]; - find(callback: Function, target: any): any; - findBy(key: string, value?: string): any; - forEach(callback: Function, target?: any): any; - getEach(key: string): any[]; - invoke(methodName: string, ...args: any[]): any[]; - map: ItemIndexEnumerableCallbackTarget; - mapBy(key: string): any[]; - nextObject(index: number, previousObject: any, context: any): any; - reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any; - reject: ItemIndexEnumerableCallbackTarget; - rejectBy(key: string, value?: string): any[]; - removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; - removeObject(object: any): any; - removeObjects(objects: Enumerable): MutableEnumberable; - setEach(key: string, value?: any): any; - some(callback: Function, target?: any): boolean; - toArray(): any[]; - uniq(): Enumerable; - without(value: any): Enumerable; - '[]': any[]; - firstObject: any; - hasEnumerableObservers: boolean; - lastObject: any; - } - var NAME_KEY: string; - class Namespace extends Object { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - } - class NativeArray implements MutableArray, Observable, Copyable { - constructor(arr: any[]); - static activate(): void; - addArrayObserver(target: any, opts?: EnumerableConfigurationOptions): any[]; - addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; - any(callback: Function, target?: any): boolean; - anyBy(key: string, value?: string): boolean; - arrayContentDidChange(startIdx: number, removeAmt: number, addAmt: number): any[]; - arrayContentWillChange(startIdx: number, removeAmt: number, addAmt: number): any[]; - someProperty(key: string, value?: any): boolean; - clear(): any[]; - compact(): any[]; - contains(obj: any): boolean; - enumerableContentDidChange(start: number, removing: Enumerable | number, adding: Enumerable | number): any; - enumerableContentDidChange(removing: Enumerable | number, adding: Enumerable | number): any; - enumerableContentWillChange(removing: Enumerable | number, adding: Enumerable | number): Enumerable; - every(callback: Function, target?: any): boolean; - everyBy(key: string, value?: string): boolean; - everyProperty(key: string, value?: any): boolean; - filter(callback: Function, target: any): any[]; - filterBy(key: string, value?: string): any[]; - find(callback: Function, target: any): any; - findBy(key: string, value?: string): any; - forEach(callback: Function, target?: any): any; - getEach(key: string): any[]; - indexOf(object: any, startAt: number): number; - insertAt(idx: number, object: any): any[]; - invoke(methodName: string, ...args: any[]): any[]; - lastIndexOf(object: any, startAt: number): number; - map: ItemIndexEnumerableCallbackTarget; - mapBy(key: string): any[]; - nextObject(index: number, previousObject: any, context: any): any; - objectAt(idx: number): any; - objectsAt(...args: number[]): any[]; - popObject(): any; - pushObject(obj: any): any; - pushObjects(...args: any[]): any[]; - reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any; - reject: ItemIndexEnumerableCallbackTarget; - rejectBy(key: string, value?: string): any[]; - removeArrayObserver(target: any, opts: EnumerableConfigurationOptions): any[]; - removeAt(start: number, len: number): any; - removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; - replace(idx: number, amt: number, objects: any[]): any; - reverseObjects(): any[]; - setEach(key: string, value?: any): any; - setObjects(objects: any[]): any[]; - shiftObject(): any; - slice(beginIndex?: number, endIndex?: number): any[]; - some(callback: Function, target?: any): boolean; - toArray(): any[]; - uniq(): Enumerable; - unshiftObject(object: any): any; - unshiftObjects(objects: any[]): any[]; - without(value: any): Enumerable; - '[]': any[]; - '@each': EachProxy; - Boolean: boolean; - firstObject: any; - hasEnumerableObservers: boolean; - lastObject: any; - length: number; - addObject(object: any): any; - addObjects(objects: Enumerable): MutableEnumberable; - removeObject(object: any): any; - removeObjects(objects: Enumerable): MutableEnumberable; - addObserver: ModifyObserver; - beginPropertyChanges(): Observable; - cacheFor(keyName: string): any; - decrementProperty(keyName: string, decrement?: number): number; - endPropertyChanges(): Observable; - get(keyName: string): any; - getProperties(...args: string[]): {}; - getProperties(keys: string[]): {}; - getWithDefault(keyName: string, defaultValue: any): any; - hasObserverFor(key: string): boolean; - incrementProperty(keyName: string, increment?: number): number; - notifyPropertyChange(keyName: string): Observable; - propertyDidChange(keyName: string): Observable; - propertyWillChange(keyName: string): Observable; - removeObserver(key: string, target: any, method: Function | string): void; - set(keyName: string, value: any): Observable; - setProperties(hash: {}): Observable; - toggleProperty(keyName: string): any; - copy(deep: boolean): Copyable; - frozenCopy(): Copyable; - } - class NoneLocation extends Object { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - } - var ORDER_DEFINITION: string[]; - class Object extends CoreObject implements Observable { - addObserver: ModifyObserver; - beginPropertyChanges(): Observable; - cacheFor(keyName: string): any; - decrementProperty(keyName: string, decrement?: number): number; - endPropertyChanges(): Observable; - - /** - * Retrieves the value of a property from the object - * @param keyName - * @returns {} - */ - get(keyName: string): any; - - /** - * Retrieves the value of a property from the object - * @param keyName - * @returns {} - */ - get(keyName: string): T; - - getProperties(...args: string[]): {}; - getProperties(keys: string[]): {}; - getWithDefault(keyName: string, defaultValue: any): any; - hasObserverFor(key: string): boolean; - incrementProperty(keyName: string, increment?: number): number; - notifyPropertyChange(keyName: string): Observable; - propertyDidChange(keyName: string): Observable; - propertyWillChange(keyName: string): Observable; - removeObserver(key: string, target: any, method: Function | string): Observable; - set(keyName: string, value: any): Observable; - setProperties(hash: {}): Observable; - toggleProperty(keyName: string): any; - } - class ObjectProxy extends Object { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - /** - The object whose properties will be forwarded. - **/ - content: Object; - } - class Observable { - addObserver: ModifyObserver; - beginPropertyChanges(): Observable; - cacheFor(keyName: string): any; - decrementProperty(keyName: string, decrement?: number): number; - endPropertyChanges(): Observable; - get(keyName: string): any; - getProperties(...args: string[]): {}; - getProperties(keys: string[]): {}; - getWithDefault(keyName: string, defaultValue: any): any; - hasObserverFor(key: string): boolean; - incrementProperty(keyName: string, increment?: number): number; - notifyPropertyChange(keyName: string): Observable; - propertyDidChange(keyName: string): Observable; - propertyWillChange(keyName: string): Observable; - removeObserver(key: string, target: {}, method: Function | string): void; - set(keyName: string, value: any): Observable; - setProperties(hash: {}): Observable; - /** - Set the value of a boolean property to the opposite of its current value. - */ - toggleProperty(keyName: string): boolean; - } - class OrderedSet { - add(obj: any): void; - clear(): void; - copy(): OrderedSet; - static create(): OrderedSet; - forEach(fn: Function, self: any): void; - has(obj: any): boolean; - isEmpty(): boolean; - toArray(): any[]; - } - class Registry { - constructor(options: any); - static set: typeof Ember.set; - } - - // FYI - RSVP source comes from https://github.com/tildeio/rsvp.js/blob/master/lib/rsvp/promise.js - namespace RSVP { - type PromiseResolve = (value?: T) => void; - type PromiseReject = (reason?: U) => void; - type PromiseResolverFunction = (resolve: PromiseResolve, reject: PromiseReject) => void; - - interface Thenable { - then(onFulfilled?: (value: T) => V | Thenable, onRejected?: (error: any) => X | Thenable): Thenable; - then(onFulfilled?: (value: T) => V | Thenable, onRejected?: (error: any) => void): Thenable; - } - - class Promise implements Thenable { - - /** - Promise objects represent the eventual result of an asynchronous operation. The - primary way of interacting with a promise is through its `then` method, which - registers callbacks to receive either a promise's eventual value or the reason - why the promise cannot be fulfilled. - @class RSVP.Promise - @param {function} resolver - @param {String} label optional string for labeling the promise. - Useful for tooling. - @constructor - */ - constructor(resolver: PromiseResolverFunction, label?: string); - - /** - The primary way of interacting with a promise is through its `then` method, - which registers callbacks to receive either a promise's eventual value or the - reason why the promise cannot be fulfilled. - @method then - @param {Function} onFulfilled - @param {Function} onRejected - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} - */ - then(onFulfilled?: (value: T) => V | Thenable, onRejected?: (error: any) => X | Thenable): Promise; - // tslint:disable-next-line - then(onFulfilled?: (value: T) => V | Thenable, onRejected?: (error: any) => void): Promise; - /** - `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same - as the catch block of a try/catch statement. - - @method catch - @param {Function} onRejection - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} - */ - catch(onRejection: (a: any) => U, label?: string): Promise; - - /** - `finally` will be invoked regardless of the promise's fate just as native - try/catch/finally behaves - - @method finally - @param {Function} callback - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} - */ - finally(callback: (a: T) => V, label?: string): Promise; - } - - function all(promises: GlobalArray>): Promise; - } - - /** - The `Ember.Route` class is used to define individual routes. Refer to - the [routing guide](http://emberjs.com/guides/routing/) for documentation. - */ - class Route extends Object implements ActionHandlerMixin, Evented { - - static isClass: boolean; - static isMethod: boolean; - - /** - This hook is executed when the router enters the route. It is not executed - when the model for the route changes. - @method activate - */ - activate: Function; - - /** - This hook is called after this route's model has resolved. - It follows identical async/promise semantics to `beforeModel` - but is provided the route's resolved model in addition to - the `transition`, and is therefore suited to performing - logic that can only take place after the model has already - resolved. - - Refer to documentation for `beforeModel` for a description - of transition-pausing semantics when a promise is returned - from this hook. - @method afterModel - @param {Object} resolvedModel the value returned from `model`, - or its resolved value if it was a promise - @param {Transition} transition - @return {Promise} if the value returned from this hook is - a promise, the transition will pause until the transition - resolves. Otherwise, non-promise return values are not - utilized in any way. - */ - afterModel(resolvedModel: any, transition: EmberStates.Transition): RSVP.Promise; - - /** - This hook is the first of the route entry validation hooks - called when an attempt is made to transition into a route - or one of its children. It is called before `model` and - `afterModel`, and is appropriate for cases when: - 1) A decision can be made to redirect elsewhere without - needing to resolve the model first. - 2) Any async operations need to occur first before the - model is attempted to be resolved. - This hook is provided the current `transition` attempt - as a parameter, which can be used to `.abort()` the transition, - save it for a later `.retry()`, or retrieve values set - on it from a previous hook. You can also just call - `this.transitionTo` to another route to implicitly - abort the `transition`. - You can return a promise from this hook to pause the - transition until the promise resolves (or rejects). This could - be useful, for instance, for retrieving async code from - the server that is required to enter a route. - - @method beforeModel - @param {Transition} transition - @return {Promise} if the value returned from this hook is - a promise, the transition will pause until the transition - resolves. Otherwise, non-promise return values are not - utilized in any way. - */ - beforeModel(transition: EmberStates.Transition): RSVP.Promise; - - /** - The controller associated with this route. - - @property controller - @type Ember.Controller - @since 1.6.0 - */ - controller: Controller; - - /** - Returns the controller for a particular route or name. - The controller instance must already have been created, either through entering the - associated route or using `generateController`. - - @method controllerFor - @param {String} name the name of the route or controller - @return {Ember.Controller} - */ - controllerFor(name: string): Controller; - - /** - The name of the controller to associate with this route. - By default, Ember will lookup a route's controller that matches the name - of the route (i.e. `App.PostController` for `App.PostRoute`). However, - if you would like to define a specific controller to use, you can do so - using this property. - This is useful in many ways, as the controller specified will be: - * passed to the `setupController` method. - * used as the controller for the view being rendered by the route. - * returned from a call to `controllerFor` for the route. - @property controllerName - @type String - @default null - @since 1.4.0 - */ - controllerName: string; - - /** - This hook is executed when the router completely exits this route. It is - not executed when the model for the route changes. - @method deactivate - */ - deactivate: Function; - - /** - Deserializes value of the query parameter based on defaultValueType - @method deserializeQueryParam - @param {Object} value - @param {String} urlKey - @param {String} defaultValueType - */ - deserializeQueryParam(value: any, urlKey: string, defaultValueType: string): any; - - /** - Disconnects a view that has been rendered into an outlet. - You may pass any or all of the following options to `disconnectOutlet`: - * `outlet`: the name of the outlet to clear (default: 'main') - * `parentView`: the name of the view containing the outlet to clear - (default: the view rendered by the parent route) - - @method disconnectOutlet - @param {Object|String} options the options hash or outlet name - */ - disconnectOutlet(options: DisconnectOutletOptions|string): void; - - /** - @method findModel - @param {String} type the model type - @param {Object} value the value passed to find - */ - findModel(type: string, value: any): any; - - /** - Generates a controller for a route. - If the optional model is passed then the controller type is determined automatically, - e.g., an ArrayController for arrays. - - @method generateController - @param {String} name the name of the controller - @param {Object} model the model to infer the type of the controller (optional) - */ - generateController(name: string, model: {}): Controller; - - /** - Perform a synchronous transition into another route without attempting - to resolve promises, update the URL, or abort any currently active - asynchronous transitions (i.e. regular transitions caused by - `transitionTo` or URL changes). - This method is handy for performing intermediate transitions on the - way to a final destination route, and is called internally by the - default implementations of the `error` and `loading` handlers. - @method intermediateTransitionTo - @param {String} name the name of the route - @param {...Object} models the model(s) to be used while transitioning - to the route. - @since 1.2.0 - */ - intermediateTransitionTo(name: string, ...models: any[]): void; - - /** - A hook you can implement to convert the URL into the model for - this route. - - @method model - @param {Object} params the parameters extracted from the URL - @param {Transition} transition - @return {Object|Promise} the model for this route. If - a promise is returned, the transition will pause until - the promise resolves, and the resolved value of the promise - will be used as the model for this route. - */ - model(params: {}, transition: EmberStates.Transition): any|RSVP.Promise; - - /** - Returns the model of a parent (or any ancestor) route - in a route hierarchy. During a transition, all routes - must resolve a model object, and if a route - needs access to a parent route's model in order to - resolve a model (or just reuse the model from a parent), - it can call `this.modelFor(theNameOfParentRoute)` to - retrieve it. - - @method modelFor - @param {String} name the name of the route - @return {Object} the model object - */ - modelFor(name: string): {}; - - /** - Retrieves parameters, for current route using the state.params - variable and getQueryParamsFor, using the supplied routeName. - @method paramsFor - @param {String} name - */ - paramsFor(name: string): any; - - /** - Configuration hash for this route's queryParams. - @property queryParams - @for Ember.Route - @type Hash - */ - queryParams: {}; - - /** - Refresh the model on this route and any child routes, firing the - `beforeModel`, `model`, and `afterModel` hooks in a similar fashion - to how routes are entered when transitioning in from other route. - The current route params (e.g. `article_id`) will be passed in - to the respective model hooks, and if a different model is returned, - `setupController` and associated route hooks will re-fire as well. - An example usage of this method is re-querying the server for the - latest information using the same parameters as when the route - was first entered. - Note that this will cause `model` hooks to fire even on routes - that were provided a model object when the route was initially - entered. - @method refresh - @return {Transition} the transition object associated with this - attempted transition - @since 1.4.0 - */ - redirect(): EmberStates.Transition; - - - /** - Refresh the model on this route and any child routes, firing the - `beforeModel`, `model`, and `afterModel` hooks in a similar fashion - to how routes are entered when transitioning in from other route. - The current route params (e.g. `article_id`) will be passed in - to the respective model hooks, and if a different model is returned, - `setupController` and associated route hooks will re-fire as well. - An example usage of this method is re-querying the server for the - latest information using the same parameters as when the route - was first entered. - Note that this will cause `model` hooks to fire even on routes - that were provided a model object when the route was initially - entered. - @method refresh - @return {Transition} the transition object associated with this - attempted transition - @since 1.4.0 - */ - refresh(): EmberStates.Transition; - - /** - `render` is used to render a template into a region of another template - (indicated by an `{{outlet}}`). `render` is used both during the entry - phase of routing (via the `renderTemplate` hook) and later in response to - user interaction. - - @method render - @param {String} name the name of the template to render - @param {Object} [options] the options - @param {String} [options.into] the template to render into, - referenced by name. Defaults to the parent template - @param {String} [options.outlet] the outlet inside `options.template` to render into. - Defaults to 'main' - @param {String|Object} [options.controller] the controller to use for this template, - referenced by name or as a controller instance. Defaults to the Route's paired controller - @param {Object} [options.model] the model object to set on `options.controller`. - Defaults to the return value of the Route's model hook - */ - render(name: string, options?: RenderOptions): void; - - /** - A hook you can use to render the template for the current route. - This method is called with the controller for the current route and the - model supplied by the `model` hook. By default, it renders the route's - template, configured with the controller for the route. - This method can be overridden to set up and render additional or - alternative templates. - - @method renderTemplate - @param {Object} controller the route's controller - @param {Object} model the route's model - */ - renderTemplate(controller: Controller, model: {}): void; - - /** - Transition into another route while replacing the current URL, if possible. - This will replace the current history entry instead of adding a new one. - Beside that, it is identical to `transitionTo` in all other respects. See - 'transitionTo' for additional information regarding multiple models. - - @method replaceWith - @param {String} name the name of the route or a URL - @param {...Object} models the model(s) or identifier(s) to be used while - transitioning to the route. - @return {Transition} the transition object associated with this - attempted transition - */ - replaceWith(name: string, ...models: any[]): void; - - /** - A hook you can use to reset controller values either when the model - changes or the route is exiting. - - @method resetController - @param {Controller} controller instance - @param {Boolean} isExiting - @param {Object} transition - @since 1.7.0 - */ - resetController(controller: Ember.Controller, isExiting: boolean, transition: any): void; - - /** - A hook you can implement to convert the route's model into parameters - for the URL. - - The default `serialize` method will insert the model's `id` into the - route's dynamic segment (in this case, `:post_id`) if the segment contains '_id'. - If the route has multiple dynamic segments or does not contain '_id', `serialize` - will return `Ember.getProperties(model, params)` - This method is called when `transitionTo` is called with a context - in order to populate the URL. - @method serialize - @param {Object} model the route's model - @param {Array} params an Array of parameter names for the current - route (in the example, `['post_id']`. - @return {Object} the serialized parameters - */ - serialize(model: {}, params: string[]): string; - - /** - Serializes value of the query parameter based on defaultValueType - @method serializeQueryParam - @param {Object} value - @param {String} urlKey - @param {String} defaultValueType - */ - serializeQueryParam(value: any, urlKey: string, defaultValueType: string): string; - - /** - Serializes the query parameter key - @method serializeQueryParamKey - @param {String} controllerPropertyName - */ - serializeQueryParamKey(controllerPropertyName: string): string; - - /** - A hook you can use to setup the controller for the current route. - This method is called with the controller for the current route and the - model supplied by the `model` hook. - By default, the `setupController` hook sets the `model` property of - the controller to the `model`. - If you implement the `setupController` hook in your Route, it will - prevent this default behavior. If you want to preserve that behavior - when implementing your `setupController` function, make sure to call - `_super` - @method setupController - @param {Controller} controller instance - @param {Object} model - */ - setupController(controller: Controller, model: {}): void; - - /** - Store property provides a hook for data persistence libraries to inject themselves. - By default, this store property provides the exact same functionality previously - in the model hook. - Currently, the required interface is: - `store.find(modelName, findArguments)` - @method store - @param {Object} store - */ - store(store: any): any; - - /** - The name of the template to use by default when rendering this routes - template. - This is similar with `viewName`, but is useful when you just want a custom - template without a view. - - @property templateName - @type String - @default null - @since 1.4.0 - */ - templateName: string; - - /** - Transition the application into another route. The route may - be either a single route or route path - - @method transitionTo - @param {String} name the name of the route or a URL - @param {...Object} models the model(s) or identifier(s) to be used while - transitioning to the route. - @param {Object} [options] optional hash with a queryParams property - containing a mapping of query parameters - @return {Transition} the transition object associated with this - attempted transition - */ - transitionTo(name: string, ...object: any[]): EmberStates.Transition; - - /** - The name of the view to use by default when rendering this routes template. - When rendering a template, the route will, by default, determine the - template and view to use from the name of the route itself. If you need to - define a specific view, set this property. - This is useful when multiple routes would benefit from using the same view - because it doesn't require a custom `renderTemplate` method. - @property viewName - @type String - @default null - @since 1.4.0 - */ - viewName: string; - - // ActionHandlerMixin methods - - /** - Sends an action to the router, which will delegate it to the currently - active route hierarchy per the bubbling rules explained under actions - - @method send - @param {String} actionName The action to trigger - @param {*} context a context to send with the action - */ - send(name: string, ...args: any[]): void; - - /** - The collection of functions, keyed by name, available on this - `ActionHandler` as action targets. - These functions will be invoked when a matching `{{action}}` is triggered - from within a template and the application's current route is this route. - Actions can also be invoked from other parts of your application - via `ActionHandler#send`. - The `actions` hash will inherit action handlers from - the `actions` hash defined on extended parent classes - or mixins rather than just replace the entire hash. - - Within a Controller, Route, View or Component's action handler, - the value of the `this` context is the Controller, Route, View or - Component object: - - It is also possible to call `this._super.apply(this, arguments)` from within an - action handler if it overrides a handler defined on a parent - class or mixin. - - ## Bubbling - By default, an action will stop bubbling once a handler defined - on the `actions` hash handles it. To continue bubbling the action, - you must return `true` from the handler - - @property actions - @type Hash - @default null - */ - actions: ActionsHash; - - // Evented methods - - /** - Subscribes to a named event with given function. - - An optional target can be passed in as the 2nd argument that will - be set as the "this" for the callback. This is a good way to give your - function access to the object triggering the event. When the target - parameter is used the callback becomes the third argument. - - @method on - @param {String} name The name of the event - @param {Object} [target] The "this" binding for the callback - @param {Function} method The callback to execute - @return this - */ - on(name: string, target: any, method: Function): Evented; - - /** - Subscribes a function to a named event and then cancels the subscription - after the first time the event is triggered. It is good to use ``one`` when - you only care about the first time an event has taken place. - This function takes an optional 2nd argument that will become the "this" - value for the callback. If this argument is passed then the 3rd argument - becomes the function. - - @method one - @param {String} name The name of the event - @param {Object} [target] The "this" binding for the callback - @param {Function} method The callback to execute - @return this - */ - one(name: string, target: any, method: Function): Evented; - - /** - Triggers a named event for the object. Any additional arguments - will be passed as parameters to the functions that are subscribed to the - event. - - @method trigger - @param {String} name The name of the event - @param {Object...} args Optional arguments to pass on - */ - trigger(name: string, ...args: string[]): void; - - /** - Cancels subscription for given name, target, and method. - - @method off - @param {String} name The name of the event - @param {Object} target The target of the subscription - @param {Function} method The function of the subscription - @return this - */ - off(name: string, target: any, method: Function): Evented; - - /** - Checks to see if object has any subscriptions for named event. - - @method has - @param {String} name The name of the event - @return {Boolean} does the object have a subscription for event - */ - has(name: string): boolean; - } - - class Router extends Object { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - map(callback: Function): Router; - } - class RouterDSL { - resource(name: string, options?: {}, callback?: Function): void; - resource(name: string, callback: Function): void; - route(name: string, options?: {}): void; - explicitIndex: boolean; - router: Router; - options: any; - } - class Service extends CoreObject implements Observable { - /* Observable */ - addObserver: ModifyObserver; - beginPropertyChanges(): Observable; - cacheFor(keyName: string): any; - decrementProperty(keyName: string, decrement?: number): number; - endPropertyChanges(): Observable; - get(keyName: string): any; - getProperties(...args: string[]): {}; - getProperties(keys: string[]): {}; - getWithDefault(keyName: string, defaultValue: any): any; - hasObserverFor(key: string): boolean; - incrementProperty(keyName: string, increment?: number): number; - notifyPropertyChange(keyName: string): Observable; - propertyDidChange(keyName: string): Observable; - propertyWillChange(keyName: string): Observable; - removeObserver(key: string, target: {}, method: Function | string): void; - set(keyName: string, value: any): Observable; - setProperties(hash: {}): Observable; - toggleProperty(keyName: string): boolean; - /* /Observable */ - } - var STRINGS: boolean; - class State extends Object implements Evented { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - has(name: string): boolean; - off(name: string, target: any, method: Function): State; - on(name: string, target: any, method: Function): State; - one(name: string, target: any, method: Function): State; - trigger(name: string, ...args: string[]): void; - getPathsCache(stateManager: {}, path: string): {}; - init(): void; - setPathsCache(stateManager: {}, path: string, transitions: any): void; - static transitionTo(target: string): void; - hasContext: boolean; - isLeaf: boolean; - name: string; - parentState: State; - path: string; - enter: Function; - exit: Function; - setup: Function; - } - class StateManager extends State { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - contextFreeTransition(currentState: State, path: string): TransitionsHash; - enterState(transition: TransitionsHash): void; - getState(name: string): State; - getStateByPath(root: State, path: string): State; - getStateMeta(state: State, key: string): any; - getStatesInPath(root: State, path: string): State[]; - goToState(path: string, context: any): void; - send(event: string): void; - setStateMeta(state: State, key: string, value: any): any; - stateMetaFor(state: State): {}; - transitionTo(path: string, context: any): void; - triggerSetupContext(transitions: TransitionsHash): void; - unhandledEvent(manager: StateManager, event: string): any; - currentPath: string; - currentState: State; - errorOnUnhandledEvents: boolean; - transitionEvent: string; - } - namespace String { - function camelize(str: string): string; - function capitalize(str: string): string; - function classify(str: string): string; - function dasherize(str: string): string; - function decamelize(str: string): string; - function fmt(...args: string[]): string; - function htmlSafe(str: string): void; // TODO: @returns Handlebars.SafeStringStatic; - function loc(...args: string[]): string; - function underscore(str: string): string; - function w(str: string): string[]; - } - var TEMPLATES: {}; - class TargetActionSupport { - triggerAction(opts: {}): boolean; - } - namespace Test { - class Adapter extends Ember.Object { - constructor(); - } - class Promise extends Ember.RSVP.Promise { - constructor(); - } - function oninjectHelpers(callback: Function): void; - function promise(resolver: (a: T) => any, label: string): Ember.Test.Promise; - function unregisterHelper(name: string): void; - function registerHelper(name: string, helperMethod: Function): void; - function registerAsyncHelper(name: string, helperMethod: Function): void; - - var adapter: Object; - var QUnitAdapter: Object; - - function registerWaiter(callback: Function): void; - function registerWaiter(context: any, callback: Function): void; - function unregisterWaiter(callback: Function): void; - function unregisterWaiter(context: any, callback: Function): void; - - function resolve(result: T): Ember.Test.Promise; - } - class TextArea extends Component implements TextSupport { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - cancel(event: Function): void; - focusIn(event: Function): void; - focusOut(event: Function): void; - insertNewLine(event: Function): void; - keyPress(event: Function): void; - action: string; - bubbles: boolean; - onEvent: string; - } - class TextField extends Component implements TextSupport { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - cancel(event: Function): void; - focusIn(event: Function): void; - focusOut(event: Function): void; - insertNewLine(event: Function): void; - keyPress(event: Function): void; - action: string; - bubbles: boolean; - onEvent: string; - pattern: string; - size: string; - type: string; - value: string; - } - class TextSupport { - cancel(event: Function): void; - focusIn(event: Function): void; - focusOut(event: Function): void; - insertNewLine(event: Function): void; - keyPress(event: Function): void; - action: string; - bubbles: boolean; - onEvent: string; - } - var VERSION: string; - class ViewTargetActionSupport extends Mixin { - target: any; - actionContext: any; - } - var ViewUtils: {}; // TODO: define interface - function addListener(obj: any, eventName: string, target: Function | any, method: Function | string, once?: boolean): void; - var addObserver: ModifyObserver; - /** - Ember.alias is deprecated. Please use Ember.aliasMethod or Ember.computed.alias instead. - **/ - var alias: typeof deprecateFunc; - function aliasMethod(methodName: string): Descriptor; - function assert(desc: string, test: boolean): void; - function beginPropertyChanges(): void; - function bind(obj: any, to: string, from: string): Binding; - function cacheFor(obj: any, key: string): any; - function canInvoke(obj: any, methodName: string): boolean; - function changeProperties(callback: Function, binding?: any): void; - function compare(v: any, w: any): number; - // ReSharper disable once DuplicatingLocalDeclaration - var computed: { - (...args: any[]): ComputedProperty; - alias(dependentKey: string): ComputedProperty; - and(...args: string[]): ComputedProperty; - any(...args: string[]): ComputedProperty; - bool(dependentKey: string): ComputedProperty; - defaultTo(defaultPath: string): ComputedProperty; - empty(dependentKey: string): ComputedProperty; - equal(dependentKey: string, value: any): ComputedProperty; - gt(dependentKey: string, value: number): ComputedProperty; - gte(dependentKey: string, value: number): ComputedProperty; - lt(dependentKey: string, value: number): ComputedProperty; - lte(dependentKey: string, value: number): ComputedProperty; - map(...args: string[]): ComputedProperty; - match(dependentKey: string, regexp: RegExp): ComputedProperty; - none(dependentKey: string): ComputedProperty; - not(dependentKey: string): ComputedProperty; - notEmpty(dependentKey: string): ComputedProperty; - oneWay(dependentKey: string): ComputedProperty; - or(...args: string[]): ComputedProperty; - readOnly(dependentString: string): ComputedProperty; - }; - // ReSharper restore DuplicatingLocalDeclaration - function controllerFor(container: Container, controllerName: string, lookupOptions?: {}): Controller; - function copy(obj: any, deep: boolean): any; - /** - Creates an instance of the CoreObject class. - @param arguments A hash containing values with which to initialize the newly instantiated object. - **/ - function create(arguments?: {}): CoreObject; - function debug(message: string): void; - function defineProperty(obj: any, keyName: string, desc: {}): void; - function deprecate(message: string, test?: boolean): void; - function deprecateFunc(message: string, func: Function): Function; - function destroy(obj: any): void; - /** - Ember.empty is deprecated. Please use Ember.isEmpty instead. - **/ - // ReSharper disable once DuplicatingLocalDeclaration - var empty: typeof deprecateFunc; - function endPropertyChanges(): void; - function finishChains(obj: any): void; - function generateController(container: Container, controllerName: string, context: any): Controller; - function generateGuid(obj: any, prefix?: string): string; - function get(obj: any, keyName: string): any; - /** - getPath is deprecated since get now supports paths. - **/ - var getPath: typeof deprecateFunc; - function getWithDefault(root: string, key: string, defaultValue: any): any; - function guidFor(obj: any): string; - function handleErrors(func: Function, context: any): any; - function hasListeners(context: any, name: string): boolean; - function hasOwnProperty(prop: string): boolean; - function immediateObserver(func: Function, ...propertyNames: any[]): Function; - function inspect(obj: any): string; - function instrument(name: string, payload: any, callback: Function, binding: any): void; - function isArray(obj: any): boolean; - function isEmpty(obj: any): boolean; - function isEqual(a: any, b: any): boolean; - function isGlobalPath(path: string): boolean; - var isNamespace: boolean; - function isNone(obj: any): boolean; - function isPrototypeOf(obj: {}): boolean; - function isWatching(obj: any, key: string): boolean; - function keys(obj: any): any[]; - function listenersDiff(obj: any, eventName: string, otherActions: any[]): any[]; - function listenersFor(obj: any, eventName: string): any[]; - function listenersUnion(obj: any, eventName: string, otherActions: any[]): void; - // ReSharper disable once DuplicatingLocalDeclaration - var lookup: {}; // TODO: define interface - function makeArray(obj: any): any[]; - function merge(original: any, updates: any): any; - function meta(obj: any): {}; - function mixin(obj: any, ...args: any[]): any; - /** - Ember.none is deprecated. Please use Ember.isNone instead. - **/ - var none: typeof deprecateFunc; - function observer(...args: any[]): Function; - function observersFor(obj: any, path: string): any[]; - function onLoad(name: string, callback: Function): void; - var onError: Error; - function overrideChains(obj: any, keyName: string, m: any): boolean; - // ReSharper disable once DuplicatingLocalDeclaration - var platform: { - defineProperty: boolean; - hasPropertyAccessors: boolean; - }; - function propertyDidChange(obj: any, keyName: string): void; - function propertyIsEnumerable(prop: string): boolean; - function propertyWillChange(obj: any, keyName: string): void; - function removeChainWatcher(obj: any, keyName: string, node: any): void; - function removeListener(obj: any, eventName: string, target: Function | any, method: Function | string): void; - function removeObserver(obj: any, path: string, target: any, method: Function): any; - function required(): Descriptor; - function rewatch(obj: any): void; - var run: { - (method: Function): void; - (target: any, method: Function): void; - begin(): void; - cancel(timer: any): void; - debounce(target: any, method: Function | string, ...args: any[]): void; - end(): void; - join(target: any, method: Function | string, ...args: any[]): any; - later(target: any, method: Function | string, ...args: any[]): string; - next(target: any, method: Function | string, ...args: any[]): number; - once(target: any, method: Function | string, ...args: any[]): number; - schedule(queue: string, target: any, method: Function | string, ...args: any[]): void; - scheduleOnce(queue: string, target: any, method: Function | string, ...args: any[]): void; - sync(): void; - throttle(target: any, method: Function | string, ...args: any[]): void; - queues: any[]; - }; - function runLoadHooks(name: string, object: any): void; - function sendEvent(obj: any, eventName: string, params?: any[], actions?: any[]): boolean; - function set(obj: any, keyName: string, value: any): any; - /** - setPath is deprecated since set now supports paths. - **/ - var setPath: typeof deprecateFunc; - function setProperties(self: any, hash: {}): any; - function subscribe(pattern: string, object: any): void; - function toLocaleString(): string; - function toString(): string; - function tryCatchFinally(tryable: Function, catchable: Function, finalizer: Function, binding?: any): any; - function tryInvoke(obj: any, methodName: string, args?: any[]): any; - function trySet(obj: any, path: string, value: any): void; - /** - trySetPath has been renamed to trySet. - **/ - var trySetPath: typeof deprecateFunc; - function typeOf(item: any): string; - function unwatch(obj: any, keyPath: string): void; - function unwatchKey(obj: any, keyName: string): void; - function unwatchPath(obj: any, keyPath: string): void; - // ReSharper disable once DuplicatingLocalDeclaration - var uuid: number; - function valueOf(): {}; - function warn(message: string, test?: boolean): void; - function watch(obj: any, keyPath: string): void; - function watchKey(obj: any, keyName: string): void; - function watchPath(obj: any, keyPath: string): void; - function watchedEvents(obj: {}): any[]; - function wrap(func: Function, superFunc: Function): Function; - var _ContainerProxyMixin: Mixin; - var _RegistryProxyMixin: Mixin; - function getOwner(object: any): any; - function setOwner(object: any, owner: any): void; - var testing: boolean; - var MODEL_FACTORY_INJECTIONS: boolean; - function assign(original: any, ...sources: any[]): any; -} - -import Em = Ember; - - -/** - * External ambient module - to allow "import Ember from 'ember';" to work correctly - */ - -declare module "ember" { - export default Ember; -} diff --git a/ember/tslint.json b/ember/tslint.json deleted file mode 100644 index fcd9410184..0000000000 --- a/ember/tslint.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../tslint.json", - "rules": { - // Heavy use of Function type in this older package. - "forbidden-types": false, - "no-misused-new": false, - // not sure what this means - "no-single-declare-module": false - } -} diff --git a/ember/v1/ember-tests.ts b/ember/v1/ember-tests.ts deleted file mode 100644 index 25ca3e3cc5..0000000000 --- a/ember/v1/ember-tests.ts +++ /dev/null @@ -1,209 +0,0 @@ -/// - - -var App : any; - -App = Em.Application.create(); - -App.president = Em.Object.create({ - name: 'Barack Obama' -}); -App.country = Em.Object.create({ - presidentNameBinding: 'MyApp.president.name' -}); -App.country.get('presidentName'); -App.president = Em.Object.create({ - firstName: 'Barack', - lastName: 'Obama', - fullName: function () { - return this.get('firstName') + ' ' + this.get('lastName'); - }.property() -}); -App.president.get('fullName'); - -declare class MyPerson extends Em.Object { - static createMan(): MyPerson; -} - -var Person1 = Em.Object.extend({ - say: (thing: string) => { - alert(thing); - } -}); - -declare class MyPerson2 extends Em.Object { - helloWorld(): void; -} -var tom = Person1.create({ - name: 'Tom Dale', - helloWorld: function() { - this.say('Hi my name is ' + this.get('name')); - } -}); -tom.helloWorld(); - -Person1.reopen({ isPerson: true }); -Person1.create().get('isPerson'); - -Person1.reopenClass({ - createMan: () => { - return Person1.create({ isMan: true }); - } -}); -// ReSharper disable once DuplicatingLocalDeclaration -declare var Person1: typeof MyPerson; -Person1.createMan().get('isMan'); - -var person = Person1.create({ - firstName: 'Yehuda', - lastName: 'Katz' -}); -person.addObserver('fullName', null, () => { }); -person.set('firstName', 'Brohuda'); - -App.todosController = Em.Object.create({ - todos: [ - Em.Object.create({ isDone: false }) - ], - remaining: (function() { - var todos = this.get('todos'); - return todos.filterProperty('isDone', false).get('length'); - }).property('todos.@each.isDone') -}); - -var todos = App.todosController.get('todos'); -var todo = todos.objectAt(0); -todo.set('isDone', true); -App.todosController.get('remaining'); -todo = Em.Object.create({ isDone: false }); -todos.pushObject(todo); -App.todosController.get('remaining'); - -App.wife = Em.Object.create({ - householdIncome: 80000 -}); -App.husband = Em.Object.create({ - householdIncomeBinding: 'App.wife.householdIncome' -}); -App.husband.get('householdIncome'); -App.husband.set('householdIncome', 90000); -App.wife.get('householdIncome'); - -App.user = Em.Object.create({ - fullName: 'Kara Gates' -}); -App.userView = Em.View.create({ - userNameBinding: Em.Binding.oneWay('App.user.fullName') -}); -App.user.set('fullName', 'Krang Gates'); -App.userView.set('userName', 'Truckasaurus Gates'); -App.user.get('fullName'); - -App = Em.Application.create({ - rootElement: '#sidebar' -}); - -var view = Em.View.create({ - templateName: 'say-hello', - name: 'Bob' -}); -view.appendTo('#container'); -view.append(); -view.remove(); - -App.AlertView = Em.View.extend({ - priority: 'p4', - isUrgent: true -}); - -App.ListingView = Em.View.extend({ - templateName: 'listing', - edit: (event: any) => { - event.view.set('isEditing', true); - } -}); - -App.userController = Em.Object.create({ - content: Em.Object.create({ - firstName: 'Albert', - lastName: 'Hofmann', - posts: 25, - hobbies: 'Riding bicycles' - }) -}); - -Handlebars.registerHelper('highlight', function(property: string, options: any) { - var value = Em.Handlebars.get(this, property, options); - return new Handlebars.SafeString('' + value + ''); -}); - -App.MyText = Em.TextField.extend({ - formBlurredBinding: 'App.adminController.formBlurred', - change: function() { - this.set('formBlurred', true); - } -}); - -var textArea = Em.TextArea.create({ - valueBinding: 'TestObject.value' -}); - -App.ClickableView = Em.View.extend({ - click: () => { - alert('ClickableView was clicked!'); - } -}); - -var container = Em.ContainerView.create(); -container.append(); -var coolView = App.CoolView.create(), - childViews = container.get('childViews'); -childViews.pushObject(coolView); - -var Person2 = Em.Object.extend({ - sayHello: function() { - console.log('Hello from ' + this.get('name')); - } -}); -var people = [ - Person2.create({ name: 'Juan' }), - Person2.create({ name: 'Charles' }), - Person2.create({ name: 'Majd' }) -]; -people.invoke('sayHello'); - -var arr = [Em.Object.create(), Em.Object.create()]; -arr.setEach('name', 'unknown'); -arr.getEach('name'); - -var Person3 = Em.Object.extend({ - name: null, - isHappy: false -}); -var people2 = [ - Person3.create({ name: 'Yehuda', isHappy: true }), - Person3.create({ name: 'Majd', isHappy: false }) -]; -people2.every((person: Em.Object) => { - return !!person.get('isHappy'); -}); -people2.some((person: Em.Object) => { - return !!person.get('isHappy'); -}); -people2.everyProperty('isHappy', true); -people2.someProperty('isHappy', true); - -// Examples taken from http://emberjs.com/api/classes/Ember.RSVP.Promise.html -var promise = new Ember.RSVP.Promise(function(resolve: Function, reject: Function) { - // on success - resolve('ok!'); - - // on failure - reject('no-k!'); -}); - -promise.then(function(value: any) { - // on fulfillment -}, function(reason: any) { - // on rejection -}); diff --git a/emojione/index.d.ts b/emojione/index.d.ts deleted file mode 100644 index 48b55e87cd..0000000000 --- a/emojione/index.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -// Type definitions for emojione 2.2 -// Project: https://github.com/Ranks/emojione -// Definitions by: Danilo Bargen -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export as namespace emojione; - -export var sprites: boolean; -export var imagePathPNG: string; -export var imagePathSVG: string; -export var imagePathSVGSprites: string; -export var imageType: 'png' | 'svg'; -export var unicodeAlt: boolean; -export var ascii: boolean; -export var unicodeRegexp: string; -export var cacheBustParam: string; -export function toShort(str: string): string; -export function toImage(str: string): string; -export function shortnameToImage(str: string): string; -export function unicodeToImage(str: string): string; diff --git a/emojione/tslint.json b/emojione/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/emojione/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/env-to-object/index.d.ts b/env-to-object/index.d.ts deleted file mode 100644 index 1ec7a3c994..0000000000 --- a/env-to-object/index.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -// Type definitions for env-to-object 1.1 -// Project: https://github.com/kgryte/node-env-to-object#readme -// Definitions by: TANAKA Koichi -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare namespace env { - export interface Mappings { - [enviromentVariableName: string]: Mapping; - } - - export type Mapping = IntegerMapping | BooleanMapping | GenericMapping; - - interface GenericMapping { - keypath: string; - type?: string; - [opt: string]: any; - } - - interface IntegerMapping extends GenericMapping { - type: "integer"; - radix: number; - } - - interface BooleanMapping { - type: "boolean"; - strict: boolean; - } - - export interface Parsers { - [parserName: string]: (str: string, opts: any) => any; - } - - export interface Options { - parsers: Parsers; - } -} - -declare function env(map: env.Mappings, options?: env.Options): any; -export = env; diff --git a/env-to-object/tslint.json b/env-to-object/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/env-to-object/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/enzyme/index.d.ts b/enzyme/index.d.ts deleted file mode 100644 index fc498ca78a..0000000000 --- a/enzyme/index.d.ts +++ /dev/null @@ -1,563 +0,0 @@ -// Type definitions for Enzyme 2.7 -// Project: https://github.com/airbnb/enzyme -// Definitions by: Marian Palkus -// Cap3 -// Ivo Stratev -// Tom Crockett -// jwbay -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 - -/// -import { ReactElement, Component, HTMLAttributes as ReactHTMLAttributes, SVGAttributes as ReactSVGAttributes } from "react"; - -type HTMLAttributes = ReactHTMLAttributes<{}> & ReactSVGAttributes<{}>; - -export class ElementClass extends Component { -} - -/* These are purposefully stripped down versions of React.ComponentClass and React.StatelessComponent. - * The optional static properties on them break overload ordering for wrapper methods if they're not - * all specified in the implementation. TS chooses the EnzymePropSelector overload and loses the generics - */ -interface ComponentClass { - new(props?: Props, context?: any): Component; -} - -type StatelessComponent = (props: Props, context?: any) => JSX.Element; - -/** - * Many methods in Enzyme's API accept a selector as an argument. Selectors in Enzyme can fall into one of the - * following three categories: - * - * 1. A Valid CSS Selector - * 2. A React Component Constructor - * 3. A React Component's displayName - * 4. A React Stateless component - * 5. A React component property map - */ -export interface EnzymePropSelector { - [key: string]: any; -} -export type EnzymeSelector = string | StatelessComponent | ComponentClass | EnzymePropSelector; - -interface CommonWrapper { - /** - * Returns a new wrapper with only the nodes of the current wrapper that, when passed into the provided predicate function, return true. - * @param predicate - */ - filterWhere(predicate: (wrapper: this) => boolean): this; - - /** - * Returns whether or not the current wrapper has a node anywhere in it's render tree that looks like the one passed in. - * @param node - */ - contains(node: ReactElement): boolean; - - /** - * Returns whether or not a given react element exists in the shallow render tree. - * @param node - */ - containsMatchingElement(node: ReactElement): boolean; - - /** - * Returns whether or not all the given react elements exists in the shallow render tree - * @param nodes - */ - containsAllMatchingElements(nodes: Array>): boolean; - - /** - * Returns whether or not one of the given react elements exists in the shallow render tree. - * @param nodes - */ - containsAnyMatchingElements(nodes: Array>): boolean; - - /** - * Returns whether or not the current render tree is equal to the given node, based on the expected value. - */ - equals(node: ReactElement): boolean; - - /** - * Returns whether or not a given react element matches the shallow render tree. - */ - matchesElement(node: ReactElement): boolean; - - /** - * Returns whether or not the current node has a className prop including the passed in class name. - * @param className - */ - hasClass(className: string): boolean; - - /** - * Returns whether or not the current node matches a provided selector. - * @param selector - */ - is(selector: EnzymeSelector): boolean; - - /** - * Returns whether or not the current node is empty. - */ - isEmpty(): boolean; - - /** - * Returns whether or not the current node exists. - */ - exists(): boolean; - - /** - * Returns a new wrapper with only the nodes of the current wrapper that don't match the provided selector. - * This method is effectively the negation or inverse of filter. - * @param selector - */ - not(selector: EnzymeSelector): this; - - /** - * Returns a string of the rendered text of the current render tree. This function should be looked at with - * skepticism if being used to test what the actual HTML output of the component will be. If that is what you - * would like to test, use enzyme's render function instead. - * - * Note: can only be called on a wrapper of a single node. - */ - text(): string; - - /** - * Returns a string of the rendered HTML markup of the current render tree. - * - * Note: can only be called on a wrapper of a single node. - */ - html(): string; - - /** - * Returns the node at a given index of the current wrapper. - * @param index - */ - get(index: number): ReactElement; - - /** - * Returns a wrapper around the node at a given index of the current wrapper. - * @param index - */ - at(index: number): this; - - /** - * Reduce the set of matched nodes to the first in the set. - */ - first(): this; - - /** - * Reduce the set of matched nodes to the last in the set. - */ - last(): this; - - /** - * Returns the state hash for the root node of the wrapper. Optionally pass in a prop name and it will return just that value. - * @param [key] - */ - state(): S; - state(key: K): S[K]; - state(key: string): T; - - /** - * Returns the context hash for the root node of the wrapper. Optionally pass in a prop name and it will return just that value. - */ - context(): any; - context(key: string): T; - - /** - * Returns the props hash for the current node of the wrapper. - * - * NOTE: can only be called on a wrapper of a single node. - */ - props(): P; - - /** - * Returns the prop value for the node of the current wrapper with the provided key. - * - * NOTE: can only be called on a wrapper of a single node. - * @param key - */ - prop(key: K): P[K]; - prop(key: string): T; - - /** - * Returns the key value for the node of the current wrapper. - * NOTE: can only be called on a wrapper of a single node. - */ - key(): string; - - /** - * Simulate events. - * Returns itself. - * @param event - * @param args? - */ - simulate(event: string, ...args: any[]): this; - - /** - * A method to invoke setState() on the root component instance similar to how you might in the definition of - * the component, and re-renders. This method is useful for testing your component in hard to achieve states, - * however should be used sparingly. If possible, you should utilize your component's external API in order to - * get it into whatever state you want to test, in order to be as accurate of a test as possible. This is not - * always practical, however. - * Returns itself. - * - * NOTE: can only be called on a wrapper instance that is also the root instance. - * @param state - * @param [callback] - */ - setState(state: Pick, callback?: () => void): this; - - /** - * A method that sets the props of the root component, and re-renders. Useful for when you are wanting to test - * how the component behaves over time with changing props. Calling this, for instance, will call the - * componentWillReceiveProps lifecycle method. - * - * Similar to setState, this method accepts a props object and will merge it in with the already existing props. - * Returns itself. - * - * NOTE: can only be called on a wrapper instance that is also the root instance. - * @param props - * @param [callback] - */ - setProps(props: Pick): this; - - /** - * A method that sets the context of the root component, and re-renders. Useful for when you are wanting to - * test how the component behaves over time with changing contexts. - * Returns itself. - * - * NOTE: can only be called on a wrapper instance that is also the root instance. - * @param state - */ - setContext(context: any): this; - - /** - * Gets the instance of the component being rendered as the root node passed into shallow(). - * - * NOTE: can only be called on a wrapper instance that is also the root instance. - */ - instance(): Component; - - /** - * Forces a re-render. Useful to run before checking the render output if something external may be updating - * the state of the component somewhere. - * Returns itself. - * - * NOTE: can only be called on a wrapper instance that is also the root instance. - */ - update(): this; - - /** - * Returns an html-like string of the wrapper for debugging purposes. Useful to print out to the console when - * tests are not passing when you expect them to. - */ - debug(): string; - - /** - * Returns the name of the current node of the wrapper. - */ - name(): string; - - /** - * Iterates through each node of the current wrapper and executes the provided function with a wrapper around - * the corresponding node passed in as the first argument. - * - * Returns itself. - * @param fn A callback to be run for every node in the collection. Should expect a ShallowWrapper as the first - * argument, and will be run with a context of the original instance. - */ - forEach(fn: (wrapper: this, index: number) => any): this; - - /** - * Maps the current array of nodes to another array. Each node is passed in as a ShallowWrapper to the map - * function. - * Returns an array of the returned values from the mapping function.. - * @param fn A mapping function to be run for every node in the collection, the results of which will be mapped - * to the returned array. Should expect a ShallowWrapper as the first argument, and will be run - * with a context of the original instance. - */ - map(fn: (wrapper: this, index: number) => V): V[]; - - /** - * Applies the provided reducing function to every node in the wrapper to reduce to a single value. Each node - * is passed in as a ShallowWrapper, and is processed from left to right. - * @param fn - * @param initialValue - */ - reduce(fn: (prevVal: R, wrapper: this, index: number) => R, initialValue?: R): R; - - /** - * Applies the provided reducing function to every node in the wrapper to reduce to a single value. - * Each node is passed in as a ShallowWrapper, and is processed from right to left. - * @param fn - * @param initialValue - */ - reduceRight(fn: (prevVal: R, wrapper: this, index: number) => R, initialValue?: R): R; - - /** - * Returns whether or not any of the nodes in the wrapper match the provided selector. - * @param selector - */ - some(selector: EnzymeSelector): boolean; - - /** - * Returns whether or not any of the nodes in the wrapper pass the provided predicate function. - * @param fn - */ - someWhere(fn: (wrapper: this) => boolean): boolean; - - /** - * Returns whether or not all of the nodes in the wrapper match the provided selector. - * @param selector - */ - every(selector: EnzymeSelector): boolean; - - /** - * Returns whether or not any of the nodes in the wrapper pass the provided predicate function. - * @param fn - */ - everyWhere(fn: (wrapper: this) => boolean): boolean; - - /** - * Returns true if renderer returned null - */ - isEmptyRender(): boolean; - - /** - * Renders the component to static markup and returns a Cheerio wrapper around the result. - */ - render(): Cheerio; - - /** - * Returns the type of the current node of this wrapper. If it's a composite component, this will be the - * component constructor. If it's native DOM node, it will be a string of the tag name. - * - * Note: can only be called on a wrapper of a single node. - */ - type(): string | ComponentClass

    | StatelessComponent

    ; - - length: number; -} - -export interface ShallowWrapper extends CommonWrapper { - shallow(): ShallowWrapper; - unmount(): ShallowWrapper; - - /** - * Find every node in the render tree that matches the provided selector. - * @param selector The selector to match. - */ - find(component: ComponentClass): ShallowWrapper; - find(statelessComponent: StatelessComponent): ShallowWrapper; - find(props: EnzymePropSelector): ShallowWrapper; - find(selector: string): ShallowWrapper; - - /** - * Removes nodes in the current wrapper that do not match the provided selector. - * @param selector The selector to match. - */ - filter(component: ComponentClass | StatelessComponent): this; - filter(props: Partial

    ): this; - filter(selector: string): this; - - /** - * Finds every node in the render tree that returns true for the provided predicate function. - * @param predicate - */ - findWhere(predicate: (wrapper: ShallowWrapper) => boolean): ShallowWrapper; - - /** - * Returns a new wrapper with all of the children of the node(s) in the current wrapper. Optionally, a selector - * can be provided and it will filter the children by this selector. - * @param [selector] - */ - children(component: ComponentClass): ShallowWrapper; - children(statelessComponent: StatelessComponent): ShallowWrapper; - children(selector: string): ShallowWrapper; - children(props?: EnzymePropSelector): ShallowWrapper; - - /** - * Returns a new wrapper with child at the specified index. - * @param index - */ - childAt(index: number): ShallowWrapper; - childAt(index: number): ShallowWrapper; - - /** - * Shallow render the one non-DOM child of the current wrapper, and return a wrapper around the result. - * NOTE: can only be called on wrapper of a single non-DOM component element node. - * @param [options] - */ - dive(options?: ShallowRendererProps): ShallowWrapper; - - /** - * Returns a wrapper around all of the parents/ancestors of the wrapper. Does not include the node in the - * current wrapper. Optionally, a selector can be provided and it will filter the parents by this selector. - * - * Note: can only be called on a wrapper of a single node. - * @param [selector] - */ - parents(component: ComponentClass): ShallowWrapper; - parents(statelessComponent: StatelessComponent): ShallowWrapper; - parents(selector: string): ShallowWrapper; - parents(props?: EnzymePropSelector): ShallowWrapper; - - /** - * Returns a wrapper of the first element that matches the selector by traversing up through the current node's - * ancestors in the tree, starting with itself. - * - * Note: can only be called on a wrapper of a single node. - * @param selector - */ - closest(component: ComponentClass): ShallowWrapper; - closest(statelessComponent: StatelessComponent): ShallowWrapper; - closest(props: EnzymePropSelector): ShallowWrapper; - closest(selector: string): ShallowWrapper; - - /** - * Returns a wrapper with the direct parent of the node in the current wrapper. - */ - parent(): ShallowWrapper; -} - -export interface ReactWrapper extends CommonWrapper { - unmount(): ReactWrapper; - mount(): ReactWrapper; - - /** - * Returns a wrapper of the node that matches the provided reference name. - * - * NOTE: can only be called on a wrapper instance that is also the root instance. - */ - ref(refName: string): ReactWrapper; - ref(refName: string): ReactWrapper; - - /** - * Detaches the react tree from the DOM. Runs ReactDOM.unmountComponentAtNode() under the hood. - * - * This method will most commonly be used as a "cleanup" method if you decide to use the attachTo option in mount(node, options). - * - * The method is intentionally not "fluent" (in that it doesn't return this) because you should not be doing anything with this wrapper after this method is called. - * - * Using the attachTo is not generally recommended unless it is absolutely necessary to test something. - * It is your responsibility to clean up after yourself at the end of the test if you do decide to use it, though. - */ - detach(): void; - - /** - * Find every node in the render tree that matches the provided selector. - * @param selector The selector to match. - */ - find(component: ComponentClass): ReactWrapper; - find(statelessComponent: StatelessComponent): ReactWrapper; - find(props: EnzymePropSelector): ReactWrapper; - find(selector: string): ReactWrapper; - - /** - * Finds every node in the render tree that returns true for the provided predicate function. - * @param predicate - */ - findWhere(predicate: (wrapper: ReactWrapper) => boolean): ReactWrapper; - - /** - * Removes nodes in the current wrapper that do not match the provided selector. - * @param selector The selector to match. - */ - filter(component: ComponentClass | StatelessComponent): this; - filter(props: Partial

    ): this; - filter(selector: string): this; - - /** - * Returns a new wrapper with all of the children of the node(s) in the current wrapper. Optionally, a selector - * can be provided and it will filter the children by this selector. - * @param [selector] - */ - children(component: ComponentClass): ReactWrapper; - children(statelessComponent: StatelessComponent): ReactWrapper; - children(selector: string): ReactWrapper; - children(props?: EnzymePropSelector): ReactWrapper; - - /** - * Returns a new wrapper with child at the specified index. - * @param index - */ - childAt(index: number): ReactWrapper; - childAt(index: number): ReactWrapper; - - /** - * Returns a wrapper around all of the parents/ancestors of the wrapper. Does not include the node in the - * current wrapper. Optionally, a selector can be provided and it will filter the parents by this selector. - * - * Note: can only be called on a wrapper of a single node. - * @param [selector] - */ - parents(component: ComponentClass): ReactWrapper; - parents(statelessComponent: StatelessComponent): ReactWrapper; - parents(selector: string): ReactWrapper; - parents(props?: EnzymePropSelector): ReactWrapper; - - /** - * Returns a wrapper of the first element that matches the selector by traversing up through the current node's - * ancestors in the tree, starting with itself. - * - * Note: can only be called on a wrapper of a single node. - * @param selector - */ - closest(component: ComponentClass): ReactWrapper; - closest(statelessComponent: StatelessComponent): ReactWrapper; - closest(props: EnzymePropSelector): ReactWrapper; - closest(selector: string): ReactWrapper; - - /** - * Returns a wrapper with the direct parent of the node in the current wrapper. - */ - parent(): ReactWrapper; -} - -export interface ShallowRendererProps { - /** - * Enable experimental support for full react lifecycle methods - */ - lifecycleExperimental?: boolean; - /** - * Context to be passed into the component - */ - context?: {}; -} - -export interface MountRendererProps { - /** - * Context to be passed into the component - */ - context?: {}; - /** - * DOM Element to attach the component to - */ - attachTo?: HTMLElement; - /** - * Merged contextTypes for all children of the wrapper - */ - childContextTypes?: {}; -} - -/** - * Shallow rendering is useful to constrain yourself to testing a component as a unit, and to ensure that - * your tests aren't indirectly asserting on behavior of child components. - * @param node - * @param [options] - */ -export function shallow(node: ReactElement

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

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

    - *
    UNKNOWN
    - *
    No information available about the error
    - *
    BAD_DATA_FORMAT
    - *
    The format of the request data was incorrect
    - *
    PERMISSION_DENIED
    - *
    Not permitted to perform action
    - *
    INTERNAL_ERROR
    - *
    Unexpected problem with the service
    - *
    DATA_REQUIRED
    - *
    A required parameter/field was absent
    - *
    LIMIT_REACHED
    - *
    Operation denied due to data model limit
    - *
    QUOTA_REACHED
    - *
    Operation denied due to user storage limit
    - *
    INVALID_AUTH
    - *
    Username and/or password incorrect
    - *
    AUTH_EXPIRED
    - *
    Authentication token expired
    - *
    DATA_CONFLICT
    - *
    Change denied due to data model conflict
    - *
    ENML_VALIDATION
    - *
    Content of submitted note was malformed
    - *
    SHARD_UNAVAILABLE
    - *
    Service shard with account data is temporarily down
    - *
    LEN_TOO_SHORT
    - *
    Operation denied due to data model limit, where something such - * as a string length was too short
    - *
    LEN_TOO_LONG
    - *
    Operation denied due to data model limit, where something such - * as a string length was too long
    - *
    TOO_FEW
    - *
    Operation denied due to data model limit, where there were - * too few of something.
    - *
    TOO_MANY
    - *
    Operation denied due to data model limit, where there were - * too many of something.
    - *
    UNSUPPORTED_OPERATION
    - *
    Operation denied because it is currently unsupported.
    - *
    TAKEN_DOWN
    - *
    Operation denied because access to the corresponding object is - * prohibited in response to a take-down notice.
    - *
    RATE_LIMIT_REACHED
    - *
    Operation denied because the calling application has reached - * its hourly API call limit for this user.
    - *
    - */ - enum EDAMErrorCode { - 'UNKNOWN' = 1, - 'BAD_DATA_FORMAT' = 2, - 'PERMISSION_DENIED' = 3, - 'INTERNAL_ERROR' = 4, - 'DATA_REQUIRED' = 5, - 'LIMIT_REACHED' = 6, - 'QUOTA_REACHED' = 7, - 'INVALID_AUTH' = 8, - 'AUTH_EXPIRED' = 9, - 'DATA_CONFLICT' = 10, - 'ENML_VALIDATION' = 11, - 'SHARD_UNAVAILABLE' = 12, - 'LEN_TOO_SHORT' = 13, - 'LEN_TOO_LONG' = 14, - 'TOO_FEW' = 15, - 'TOO_MANY' = 16, - 'UNSUPPORTED_OPERATION' = 17, - 'TAKEN_DOWN' = 18, - 'RATE_LIMIT_REACHED' = 19, - } - - /** - * This exception is thrown by EDAM procedures when a call fails as a result of - * a problem that a caller may be able to resolve. For example, if the user - * attempts to add a note to their account which would exceed their storage - * quota, this type of exception may be thrown to indicate the source of the - * error so that they can choose an alternate action. - * - * This exception would not be used for internal system errors that do not - * reflect user actions, but rather reflect a problem within the service that - * the user cannot resolve. - * - * errorCode: The numeric code indicating the type of error that occurred. - * must be one of the values of EDAMErrorCode. - * - * parameter: If the error applied to a particular input parameter, this will - * indicate which parameter. - */ - class EDAMUserException extends Thrift.TException { - errorCode: EDAMErrorCode; - parameter: string; - - constructor(args?: { errorCode: EDAMErrorCode; parameter?: string; }); - } - - /** - * This exception is thrown by EDAM procedures when a call fails as a result of - * a problem in the service that could not be changed through caller action. - * - * errorCode: The numeric code indicating the type of error that occurred. - * must be one of the values of EDAMErrorCode. - * - * message: This may contain additional information about the error - * - * rateLimitDuration: Indicates the minimum number of seconds that an application should - * expect subsequent API calls for this user to fail. The application should not retry - * API requests for the user until at least this many seconds have passed. Present only - * when errorCode is RATE_LIMIT_REACHED, - */ - class EDAMSystemException extends Thrift.TException { - errorCode: EDAMErrorCode; - message: string; - rateLimitDuration: number; - - constructor(args?: { errorCode: EDAMErrorCode; message?: string; rateLimitDuration?: number; }); - } - - /** - * This exception is thrown by EDAM procedures when a caller asks to perform - * an operation on an object that does not exist. This may be thrown based on an invalid - * primary identifier (e.g. a bad GUID), or when the caller refers to an object - * by another unique identifier (e.g. a User's email address). - * - * identifier: A description of the object that was not found on the server. - * For example, "Note.notebookGuid" when a caller attempts to create a note in a - * notebook that does not exist in the user's account. - * - * key: The value passed from the client in the identifier, which was not - * found. For example, the GUID that was not found. - */ - class EDAMNotFoundException extends Thrift.TException { - identifier: string; - key: string; - - constructor(args?: { identifier?: string; key?: string; }); - } - /** - * Minimum length of any string-based attribute, in Unicode chars - */ - var EDAM_ATTRIBUTE_LEN_MIN: number; - - /** - * Maximum length of any string-based attribute, in Unicode chars - */ - var EDAM_ATTRIBUTE_LEN_MAX: number; - - /** - * Any string-based attribute must match the provided regular expression. - * This excludes all Unicode line endings and control characters. - */ - var EDAM_ATTRIBUTE_REGEX: string; - - /** - * The maximum number of values that can be stored in a list-based attribute - * (e.g. see UserAttributes.recentMailedAddresses) - */ - var EDAM_ATTRIBUTE_LIST_MAX: number; - - /** - * The maximum number of entries that can be stored in a map-based attribute - * such as applicationData fields in Resources and Notes. - */ - var EDAM_ATTRIBUTE_MAP_MAX: number; - - /** - * The minimum length of a GUID generated by the Evernote service - */ - var EDAM_GUID_LEN_MIN: number; - - /** - * The maximum length of a GUID generated by the Evernote service - */ - var EDAM_GUID_LEN_MAX: number; - - /** - * GUIDs generated by the Evernote service will match the provided pattern - */ - var EDAM_GUID_REGEX: string; - - /** - * The minimum length of any email address - */ - var EDAM_EMAIL_LEN_MIN: number; - - /** - * The maximum length of any email address - */ - var EDAM_EMAIL_LEN_MAX: number; - - /** - * A regular expression that matches the part of an email address before - * the '@' symbol. - */ - var EDAM_EMAIL_LOCAL_REGEX: string; - - /** - * A regular expression that matches the part of an email address after - * the '@' symbol. - */ - var EDAM_EMAIL_DOMAIN_REGEX: string; - - /** - * A regular expression that must match any email address given to Evernote. - * Email addresses must comply with RFC 2821 and 2822. - */ - var EDAM_EMAIL_REGEX: string; - - /** - * A regular expression that must match any VAT ID given to Evernote. - * ref http://en.wikipedia.org/wiki/VAT_identification_number - * ref http://my.safaribooksonline.com/book/programming/regular-expressions/9780596802837/4dot-validation-and-formatting/id2995136 - */ - var EDAM_VAT_REGEX: string; - - /** - * The minimum length of a timezone specification string - */ - var EDAM_TIMEZONE_LEN_MIN: number; - - /** - * The maximum length of a timezone specification string - */ - var EDAM_TIMEZONE_LEN_MAX: number; - - /** - * Any timezone string given to Evernote must match the provided pattern. - * This permits either a locale-based standard timezone or a GMT offset. - * E.g.:
      - *
    • America/Los_Angeles
    • - *
    • GMT+08:00
    • - *
    - */ - var EDAM_TIMEZONE_REGEX: string; - - /** - * The minimum length of any MIME type string given to Evernote - */ - var EDAM_MIME_LEN_MIN: number; - - /** - * The maximum length of any MIME type string given to Evernote - */ - var EDAM_MIME_LEN_MAX: number; - - /** - * Any MIME type string given to Evernote must match the provided pattern. - * E.g.: image/gif - */ - var EDAM_MIME_REGEX: string; - - /** - * Canonical MIME type string for GIF image resources - */ - var EDAM_MIME_TYPE_GIF: string; - - /** - * Canonical MIME type string for JPEG image resources - */ - var EDAM_MIME_TYPE_JPEG: string; - - /** - * Canonical MIME type string for PNG image resources - */ - var EDAM_MIME_TYPE_PNG: string; - - /** - * Canonical MIME type string for WAV audio resources - */ - var EDAM_MIME_TYPE_WAV: string; - - /** - * Canonical MIME type string for MP3 audio resources - */ - var EDAM_MIME_TYPE_MP3: string; - - /** - * Canonical MIME type string for AMR audio resources - */ - var EDAM_MIME_TYPE_AMR: string; - - /** - * Canonical MIME type string for AAC audio resources - */ - var EDAM_MIME_TYPE_AAC: string; - - /** - * Canonical MIME type string for MP4 audio resources - */ - var EDAM_MIME_TYPE_M4A: string; - - /** - * Canonical MIME type string for MP4 video resources - */ - var EDAM_MIME_TYPE_MP4_VIDEO: string; - - /** - * Canonical MIME type string for Evernote Ink resources - */ - var EDAM_MIME_TYPE_INK: string; - - /** - * Canonical MIME type string for PDF resources - */ - var EDAM_MIME_TYPE_PDF: string; - - /** - * MIME type used for attachments of an unspecified type - */ - var EDAM_MIME_TYPE_DEFAULT: string; - - /** - * The set of resource MIME types that are expected to be handled - * correctly by all of the major Evernote client applications. - */ - var EDAM_MIME_TYPES: string[]; - - /** - * The set of MIME types that Evernote will parse and index for - * searching. With exception of images, and PDFs, which are - * handled in a different way. - */ - var EDAM_INDEXABLE_RESOURCE_MIME_TYPES: string[]; - - /** - * The minimum length of a user search query string in Unicode chars - */ - var EDAM_SEARCH_QUERY_LEN_MIN: number; - - /** - * The maximum length of a user search query string in Unicode chars - */ - var EDAM_SEARCH_QUERY_LEN_MAX: number; - - /** - * Search queries must match the provided pattern. This is used for - * both ad-hoc queries and SavedSearch.query fields. - * This excludes all control characters and line/paragraph separators. - */ - var EDAM_SEARCH_QUERY_REGEX: string; - - /** - * The exact length of a MD5 hash checksum, in binary bytes. - * This is the exact length that must be matched for any binary hash - * value. - */ - var EDAM_HASH_LEN: number; - - /** - * The minimum length of an Evernote username - */ - var EDAM_USER_USERNAME_LEN_MIN: number; - - /** - * The maximum length of an Evernote username - */ - var EDAM_USER_USERNAME_LEN_MAX: number; - - /** - * Any Evernote User.username field must match this pattern. This - * restricts usernames to a format that could permit use as a domain - * name component. E.g. "username.whatever.evernote.com" - */ - var EDAM_USER_USERNAME_REGEX: string; - - /** - * Minimum length of the User.name field - */ - var EDAM_USER_NAME_LEN_MIN: number; - - /** - * Maximum length of the User.name field - */ - var EDAM_USER_NAME_LEN_MAX: number; - - /** - * The User.name field must match this pattern, which excludes line - * endings and control characters. - */ - var EDAM_USER_NAME_REGEX: string; - - /** - * The minimum length of a Tag.name, in Unicode characters - */ - var EDAM_TAG_NAME_LEN_MIN: number; - - /** - * The maximum length of a Tag.name, in Unicode characters - */ - var EDAM_TAG_NAME_LEN_MAX: number; - - /** - * All Tag.name fields must match this pattern. - * This excludes control chars, commas or line/paragraph separators. - * The string may not begin or end with whitespace. - */ - var EDAM_TAG_NAME_REGEX: string; - - /** - * The minimum length of a Note.title, in Unicode characters - */ - var EDAM_NOTE_TITLE_LEN_MIN: number; - - /** - * The maximum length of a Note.title, in Unicode characters - */ - var EDAM_NOTE_TITLE_LEN_MAX: number; - - /** - * All Note.title fields must match this pattern. - * This excludes control chars or line/paragraph separators. - * The string may not begin or end with whitespace. - */ - var EDAM_NOTE_TITLE_REGEX: string; - - /** - * Minimum length of a Note.content field. - * Note.content fields must comply with the ENML DTD. - */ - var EDAM_NOTE_CONTENT_LEN_MIN: number; - - /** - * Maximum length of a Note.content field - * Note.content fields must comply with the ENML DTD. - */ - var EDAM_NOTE_CONTENT_LEN_MAX: number; - - /** - * Minimum length of an application name, which is the key in an - * applicationData LazyMap found in entities such as Resources and - * Notes. - */ - var EDAM_APPLICATIONDATA_NAME_LEN_MIN: number; - - /** - * Maximum length of an application name, which is the key in an - * applicationData LazyMap found in entities such as Resources and - * Notes. - */ - var EDAM_APPLICATIONDATA_NAME_LEN_MAX: number; - - /** - * Minimum length of an applicationData value in a LazyMap, found - * in entities such as Resources and Notes. - */ - var EDAM_APPLICATIONDATA_VALUE_LEN_MIN: number; - - /** - * Maximum length of an applicationData value in a LazyMap, found - * in entities such as Resources and Notes. Note, however, that - * the sum of the size of hte key and value is constrained by - * EDAM_APPLICATIONDATA_ENTRY_LEN_MAX, so the maximum length, in - * practice, depends upon the key value being used. - */ - var EDAM_APPLICATIONDATA_VALUE_LEN_MAX: number; - - /** - * The total length of an entry in an applicationData LazyMap, which - * is the sum of the length of the key and the value for the entry. - */ - var EDAM_APPLICATIONDATA_ENTRY_LEN_MAX: number; - - /** - * An application name must match this regex. An application - * name is the key portion of an entry in an applicationData - * map as found in entities such as Resources and Notes. - * Note that even if both the name and value regexes match, - * it is still necessary to check the sum of the lengths - * against EDAM_APPLICATIONDATA_ENTRY_LEN_MAX. - */ - var EDAM_APPLICATIONDATA_NAME_REGEX: string; - - /** - * An applicationData map value must match this regex. - * Note that even if both the name and value regexes match, - * it is still necessary to check the sum of the lengths - * against EDAM_APPLICATIONDATA_ENTRY_LEN_MAX. - */ - var EDAM_APPLICATIONDATA_VALUE_REGEX: string; - - /** - * The minimum length of a Notebook.name, in Unicode characters - */ - var EDAM_NOTEBOOK_NAME_LEN_MIN: number; - - /** - * The maximum length of a Notebook.name, in Unicode characters - */ - var EDAM_NOTEBOOK_NAME_LEN_MAX: number; - - /** - * All Notebook.name fields must match this pattern. - * This excludes control chars or line/paragraph separators. - * The string may not begin or end with whitespace. - */ - var EDAM_NOTEBOOK_NAME_REGEX: string; - - /** - * The minimum length of a Notebook.stack, in Unicode characters - */ - var EDAM_NOTEBOOK_STACK_LEN_MIN: number; - - /** - * The maximum length of a Notebook.stack, in Unicode characters - */ - var EDAM_NOTEBOOK_STACK_LEN_MAX: number; - - /** - * All Notebook.stack fields must match this pattern. - * This excludes control chars or line/paragraph separators. - * The string may not begin or end with whitespace. - */ - var EDAM_NOTEBOOK_STACK_REGEX: string; - - /** - * The minimum length of a public notebook URI component - */ - var EDAM_PUBLISHING_URI_LEN_MIN: number; - - /** - * The maximum length of a public notebook URI component - */ - var EDAM_PUBLISHING_URI_LEN_MAX: number; - - /** - * A public notebook URI component must match the provided pattern - */ - var EDAM_PUBLISHING_URI_REGEX: string; - - /** - * The set of strings that may not be used as a publishing URI - */ - var EDAM_PUBLISHING_URI_PROHIBITED: string[]; - - /** - * The minimum length of a Publishing.publicDescription field. - */ - var EDAM_PUBLISHING_DESCRIPTION_LEN_MIN: number; - - /** - * The maximum length of a Publishing.publicDescription field. - */ - var EDAM_PUBLISHING_DESCRIPTION_LEN_MAX: number; - - /** - * Any public notebook's Publishing.publicDescription field must match - * this pattern. - * No control chars or line/paragraph separators, and can't start or - * end with whitespace. - */ - var EDAM_PUBLISHING_DESCRIPTION_REGEX: string; - - /** - * The minimum length of a SavedSearch.name field - */ - var EDAM_SAVED_SEARCH_NAME_LEN_MIN: number; - - /** - * The maximum length of a SavedSearch.name field - */ - var EDAM_SAVED_SEARCH_NAME_LEN_MAX: number; - - /** - * SavedSearch.name fields must match this pattern. - * No control chars or line/paragraph separators, and can't start or - * end with whitespace. - */ - var EDAM_SAVED_SEARCH_NAME_REGEX: string; - - /** - * The minimum length of an Evernote user password - */ - var EDAM_USER_PASSWORD_LEN_MIN: number; - - /** - * The maximum length of an Evernote user password - */ - var EDAM_USER_PASSWORD_LEN_MAX: number; - - /** - * Evernote user passwords must match this regular expression - */ - var EDAM_USER_PASSWORD_REGEX: string; - - /** - * The maximum length of an Evernote Business URI - */ - var EDAM_BUSINESS_URI_LEN_MAX: number; - - /** - * The maximum number of Tags per Note - */ - var EDAM_NOTE_TAGS_MAX: number; - - /** - * The maximum number of Resources per Note - */ - var EDAM_NOTE_RESOURCES_MAX: number; - - /** - * Maximum number of Tags per account - */ - var EDAM_USER_TAGS_MAX: number; - - /** - * Maximum number of Tags per business account. - */ - var EDAM_BUSINESS_TAGS_MAX: number; - - /** - * Maximum number of SavedSearches per account - */ - var EDAM_USER_SAVED_SEARCHES_MAX: number; - - /** - * Maximum number of Notes per user - */ - var EDAM_USER_NOTES_MAX: number; - - /** - * Maximum number of Notes per business account - */ - var EDAM_BUSINESS_NOTES_MAX: number; - - /** - * Maximum number of Notebooks per user - */ - var EDAM_USER_NOTEBOOKS_MAX: number; - - /** - * Maximum number of Notebooks in a business account - */ - var EDAM_BUSINESS_NOTEBOOKS_MAX: number; - - /** - * Maximum number of recent email addresses that are maintained - * (see UserAttributes.recentMailedAddresses) - */ - var EDAM_USER_RECENT_MAILED_ADDRESSES_MAX: number; - - /** - * The number of emails of any type that can be sent by a user with a Free - * account from the service per day. If an email is sent to two different - * recipients, this counts as two emails. - */ - var EDAM_USER_MAIL_LIMIT_DAILY_FREE: number; - - /** - * The number of emails of any type that can be sent by a user with a Premium - * account from the service per day. If an email is sent to two different - * recipients, this counts as two emails. - */ - var EDAM_USER_MAIL_LIMIT_DAILY_PREMIUM: number; - - /** - * The number of bytes of new data that may be uploaded to a Free user's - * account each month. - */ - var EDAM_USER_UPLOAD_LIMIT_FREE: number; - - /** - * The number of bytes of new data that may be uploaded to a Premium user's - * account each month. - */ - var EDAM_USER_UPLOAD_LIMIT_PREMIUM: number; - - /** - * The number of bytes of new data that may be uploaded to a Business user's - * personal account each month. Note that content uploaded into the Business - * notebooks by the user does not count against this limit. - */ - var EDAM_USER_UPLOAD_LIMIT_BUSINESS: number; - - /** - * Maximum total size of a Note that can be added to a Free account. - * The size of a note is calculated as: - * ENML content length (in Unicode characters) plus the sum of all resource - * sizes (in bytes). - */ - var EDAM_NOTE_SIZE_MAX_FREE: number; - - /** - * Maximum total size of a Note that can be added to a Premium account. - * The size of a note is calculated as: - * ENML content length (in Unicode characters) plus the sum of all resource - * sizes (in bytes). - */ - var EDAM_NOTE_SIZE_MAX_PREMIUM: number; - - /** - * Maximum size of a resource, in bytes, for Free accounts - */ - var EDAM_RESOURCE_SIZE_MAX_FREE: number; - - /** - * Maximum size of a resource, in bytes, for Premium accounts - */ - var EDAM_RESOURCE_SIZE_MAX_PREMIUM: number; - - /** - * Maximum number of linked notebooks per account, for a free - * account. - */ - var EDAM_USER_LINKED_NOTEBOOK_MAX: number; - - /** - * Maximum number of linked notebooks per account, for a premium - * account. Users who are part of an active business are also - * covered under "premium". - */ - var EDAM_USER_LINKED_NOTEBOOK_MAX_PREMIUM: number; - - /** - * Maximum number of shared notebooks per notebook - */ - var EDAM_NOTEBOOK_SHARED_NOTEBOOK_MAX: number; - - /** - * The minimum length of the content class attribute of a note. - */ - var EDAM_NOTE_CONTENT_CLASS_LEN_MIN: number; - - /** - * The maximum length of the content class attribute of a note. - */ - var EDAM_NOTE_CONTENT_CLASS_LEN_MAX: number; - - /** - * The regular expression that the content class of a note must match - * to be valid. - */ - var EDAM_NOTE_CONTENT_CLASS_REGEX: string; - - /** - * The content class prefix used for all notes created by Evernote Hello. - * This prefix can be used to assemble individual content class strings, - * or can be used to create a wildcard search to get all notes created by - * Hello. When performing a wildcard search via filtered sync chunks or - * search strings, the * character must be appended to this constant. - */ - var EDAM_HELLO_APP_CONTENT_CLASS_PREFIX: string; - - /** - * The content class prefix used for all notes created by Evernote Food. - * This prefix can be used to assemble individual content class strings, - * or can be used to create a wildcard search to get all notes created by - * Food. When performing a wildcard search via filtered sync chunks or - * search strings, the * character must be appended to this constant. - */ - var EDAM_FOOD_APP_CONTENT_CLASS_PREFIX: string; - - /** - * The content class prefix used for structured notes created by Evernote - * Hello that represents an encounter with a person. When performing a - * wildcard search via filtered sync chunks or search strings, the * - * character must be appended to this constant. - */ - var EDAM_CONTENT_CLASS_HELLO_ENCOUNTER: string; - - /** - * The content class prefix used for structured notes created by Evernote - * Hello that represents the user's profile. When performing a - * wildcard search via filtered sync chunks or search strings, the * - * character must be appended to this constant. - */ - var EDAM_CONTENT_CLASS_HELLO_PROFILE: string; - - /** - * The content class prefix used for structured notes created by - * Evernote Food that captures the experience of a particular meal. - * When performing a wildcard search via filtered sync chunks or search - * strings, the * character must be appended to this constant. - */ - var EDAM_CONTENT_CLASS_FOOD_MEAL: string; - - /** - * The content class prefix used for structured notes created by Evernote - * Skitch. When performing a wildcard search via filtered sync chunks - * or search strings, the * character must be appended to this constant. - */ - var EDAM_CONTENT_CLASS_SKITCH_PREFIX: string; - - /** - * The content class value used for structured image notes created by Evernote - * Skitch. - */ - var EDAM_CONTENT_CLASS_SKITCH: string; - - /** - * The content class value used for structured PDF notes created by Evernote - * Skitch. - */ - var EDAM_CONTENT_CLASS_SKITCH_PDF: string; - - /** - * The content class prefix used for structured notes created by Evernote - * Penultimate. When performing a wildcard search via filtered sync chunks - * or search strings, the * character must be appended to this constant. - */ - var EDAM_CONTENT_CLASS_PENULTIMATE_PREFIX: string; - - /** - * The content class value used for structured notes created by Evernote - * Penultimate that represents a Penultimate notebook. - */ - var EDAM_CONTENT_CLASS_PENULTIMATE_NOTEBOOK: string; - - /** - * The minimum length of the plain text in a findRelated query, assuming that - * plaintext is being provided. - */ - var EDAM_RELATED_PLAINTEXT_LEN_MIN: number; - - /** - * The maximum length of the plain text in a findRelated query, assuming that - * plaintext is being provided. - */ - var EDAM_RELATED_PLAINTEXT_LEN_MAX: number; - - /** - * The maximum number of notes that will be returned from a findRelated() - * query. - */ - var EDAM_RELATED_MAX_NOTES: number; - - /** - * The maximum number of notebooks that will be returned from a findRelated() - * query. - */ - var EDAM_RELATED_MAX_NOTEBOOKS: number; - - /** - * The maximum number of tags that will be returned from a findRelated() query. - */ - var EDAM_RELATED_MAX_TAGS: number; - - /** - * The minimum length, in Unicode characters, of a description for a business - * notebook. - */ - var EDAM_BUSINESS_NOTEBOOK_DESCRIPTION_LEN_MIN: number; - - /** - * The maximum length, in Unicode characters, of a description for a business - * notebook. - */ - var EDAM_BUSINESS_NOTEBOOK_DESCRIPTION_LEN_MAX: number; - - /** - * All business notebook descriptions must match this pattern. - * This excludes control chars or line/paragraph separators. - * The string may not begin or end with whitespace. - */ - var EDAM_BUSINESS_NOTEBOOK_DESCRIPTION_REGEX: string; - - /** - * The maximum length of a business phone number. - */ - var EDAM_BUSINESS_PHONE_NUMBER_LEN_MAX: number; - - /** - * Minimum length of a preference name - */ - var EDAM_PREFERENCE_NAME_LEN_MIN: number; - - /** - * Maximum length of a preference name - */ - var EDAM_PREFERENCE_NAME_LEN_MAX: number; - - /** - * Minimum length of a preference value - */ - var EDAM_PREFERENCE_VALUE_LEN_MIN: number; - - /** - * Maximum length of a preference value - */ - var EDAM_PREFERENCE_VALUE_LEN_MAX: number; - - /** - * Maximum number of name/value pairs allowed - */ - var EDAM_MAX_PREFERENCES: number; - - /** - * Maximum number of values per preference name - */ - var EDAM_MAX_VALUES_PER_PREFERENCE: number; - - /** - * A preference name must match this regex. - */ - var EDAM_PREFERENCE_NAME_REGEX: string; - - /** - * A preference value must match this regex. - */ - var EDAM_PREFERENCE_VALUE_REGEX: string; - - /** - * The name of the preferences entry that contains shortcuts. - */ - var EDAM_PREFERENCE_SHORTCUTS: string; - - /** - * The maximum number of shortcuts that a user may have. - */ - var EDAM_PREFERENCE_SHORTCUTS_MAX_VALUES: number; - - /** - * Maximum length of the device identifier string associated with long sessions. - */ - var EDAM_DEVICE_ID_LEN_MAX: number; - - /** - * Regular expression for device identifier strings associated with long sessions. - */ - var EDAM_DEVICE_ID_REGEX: string; - - /** - * Maximum length of the device description string associated with long sessions. - */ - var EDAM_DEVICE_DESCRIPTION_LEN_MAX: number; - - /** - * Regular expression for device description strings associated with long sessions. - */ - var EDAM_DEVICE_DESCRIPTION_REGEX: string; - - /** - * Maximum number of search suggestions that can be returned - */ - var EDAM_SEARCH_SUGGESTIONS_MAX: number; - - /** - * Maximum length of the search suggestion prefix - */ - var EDAM_SEARCH_SUGGESTIONS_PREFIX_LEN_MAX: number; - - /** - * Minimum length of the search suggestion prefix - */ - var EDAM_SEARCH_SUGGESTIONS_PREFIX_LEN_MIN: number; - class NoteStoreClient { - seqid: number; - - /** - * Asks the NoteStore to provide information about the status of the user - * account corresponding to the provided authentication token. - */ - getSyncState(cb: Callback): void; - - /** - * Asks the NoteStore to provide information about the status of the user - * account corresponding to the provided authentication token. - * This version of 'getSyncState' allows the client to upload coarse- - * grained usage metrics to the service. - * - * @param clientMetrics see the documentation of the ClientUsageMetrics - * structure for an explanation of the fields that clients can pass to - * the service. - */ - getSyncStateWithMetrics(clientMetrics: ClientUsageMetrics, cb: Callback): void; - - /** - * Asks the NoteStore to provide the state of the account in order of - * last modification. This request retrieves one block of the server's - * state so that a client can make several small requests against a large - * account rather than getting the entire state in one big message. - * This call gives fine-grained control of the data that will - * be received by a client by omitting data elements that a client doesn't - * need. This may reduce network traffic and sync times. - * - * @param afterUSN - * The client can pass this value to ask only for objects that - * have been updated after a certain point. This allows the client to - * receive updates after its last checkpoint rather than doing a full - * synchronization on every pass. The default value of "0" indicates - * that the client wants to get objects from the start of the account. - * - * @param maxEntries - * The maximum number of modified objects that should be - * returned in the result SyncChunk. This can be used to limit the size - * of each individual message to be friendly for network transfer. - * - * @param filter - * The caller must set some of the flags in this structure to specify which - * data types should be returned during the synchronization. See - * the SyncChunkFilter structure for information on each flag. - * - * @throws EDAMUserException
      - *
    • BAD_DATA_FORMAT "afterUSN" - if negative - *
    • - *
    • BAD_DATA_FORMAT "maxEntries" - if less than 1 - *
    • - *
    - */ - getFilteredSyncChunk(afterUSN: number, maxEntries: number, filter: SyncChunkFilter, cb: Callback): void; - - /** - * Asks the NoteStore to provide information about the status of a linked - * notebook that has been shared with the caller, or that is public to the - * world. - * This will return a result that is similar to getSyncState, but may omit - * SyncState.uploaded if the caller doesn't have permission to write to - * the linked notebook. - * - * This function must be called on the shard that owns the referenced - * notebook. (I.e. the shardId in /shard/shardId/edam/note must be the - * same as LinkedNotebook.shardId.) - * - * @param authenticationToken - * This should be an authenticationToken for the guest who has received - * the invitation to the share. (I.e. this should not be the result of - * NoteStore.authenticateToSharedNotebook) - * - * @param linkedNotebook - * This structure should contain identifying information and permissions - * to access the notebook in question. - */ - getLinkedNotebookSyncState(linkedNotebook: LinkedNotebook, cb: Callback): void; - - /** - * Asks the NoteStore to provide information about the contents of a linked - * notebook that has been shared with the caller, or that is public to the - * world. - * This will return a result that is similar to getSyncChunk, but will only - * contain entries that are visible to the caller. I.e. only that particular - * Notebook will be visible, along with its Notes, and Tags on those Notes. - * - * This function must be called on the shard that owns the referenced - * notebook. (I.e. the shardId in /shard/shardId/edam/note must be the - * same as LinkedNotebook.shardId.) - * - * @param authenticationToken - * This should be an authenticationToken for the guest who has received - * the invitation to the share. (I.e. this should not be the result of - * NoteStore.authenticateToSharedNotebook) - * - * @param linkedNotebook - * This structure should contain identifying information and permissions - * to access the notebook in question. This must contain the valid fields - * for either a shared notebook (e.g. shareKey) - * or a public notebook (e.g. username, uri) - * - * @param afterUSN - * The client can pass this value to ask only for objects that - * have been updated after a certain point. This allows the client to - * receive updates after its last checkpoint rather than doing a full - * synchronization on every pass. The default value of "0" indicates - * that the client wants to get objects from the start of the account. - * - * @param maxEntries - * The maximum number of modified objects that should be - * returned in the result SyncChunk. This can be used to limit the size - * of each individual message to be friendly for network transfer. - * Applications should not request more than 256 objects at a time, - * and must handle the case where the service returns less than the - * requested number of objects in a given request even though more - * objects are available on the service. - * - * @param fullSyncOnly - * If true, then the client only wants initial data for a full sync. - * In this case, the service will not return any expunged objects, - * and will not return any Resources, since these are also provided - * in their corresponding Notes. - * - * @throws EDAMUserException
      - *
    • BAD_DATA_FORMAT "afterUSN" - if negative - *
    • - *
    • BAD_DATA_FORMAT "maxEntries" - if less than 1 - *
    • - *
    - * - * @throws EDAMNotFoundException
      - *
    • "LinkedNotebook" - if the provided information doesn't match any - * valid notebook - *
    • - *
    • "LinkedNotebook.uri" - if the provided public URI doesn't match any - * valid notebook - *
    • - *
    • "SharedNotebook.id" - if the provided information indicates a - * shared notebook that no longer exists - *
    • - *
    - */ - getLinkedNotebookSyncChunk(linkedNotebook: LinkedNotebook, afterUSN: number, maxEntries: number, fullSyncOnly: boolean, cb: Callback): void; - - /** - * Returns a list of all of the notebooks in the account. - */ - listNotebooks(cb: Callback): void; - - /** - * Returns the current state of the notebook with the provided GUID. - * The notebook may be active or deleted (but not expunged). - * - * @param guid - * The GUID of the notebook to be retrieved. - * - * @throws EDAMUserException
      - *
    • BAD_DATA_FORMAT "Notebook.guid" - if the parameter is missing - *
    • - *
    • PERMISSION_DENIED "Notebook" - private notebook, user doesn't own - *
    • - *
    - * - * @throws EDAMNotFoundException
      - *
    • "Notebook.guid" - tag not found, by GUID - *
    • - *
    - */ - getNotebook(guid: string, cb: Callback): void; - - /** - * Returns the notebook that should be used to store new notes in the - * user's account when no other notebooks are specified. - */ - getDefaultNotebook(cb: Callback): void; - - /** - * Asks the service to make a notebook with the provided name. - * - * @param notebook - * The desired fields for the notebook must be provided on this - * object. The name of the notebook must be set, and either the 'active' - * or 'defaultNotebook' fields may be set by the client at creation. - * If a notebook exists in the account with the same name (via - * case-insensitive compare), this will throw an EDAMUserException. - * - * @return - * The newly created Notebook. The server-side GUID will be - * saved in this object's 'guid' field. - * - * @throws EDAMUserException
      - *
    • BAD_DATA_FORMAT "Notebook.name" - invalid length or pattern - *
    • - *
    • BAD_DATA_FORMAT "Notebook.stack" - invalid length or pattern - *
    • - *
    • BAD_DATA_FORMAT "Publishing.uri" - if publishing set but bad uri - *
    • - *
    • BAD_DATA_FORMAT "Publishing.publicDescription" - if too long - *
    • - *
    • DATA_CONFLICT "Notebook.name" - name already in use - *
    • - *
    • DATA_CONFLICT "Publishing.uri" - if URI already in use - *
    • - *
    • DATA_REQUIRED "Publishing.uri" - if publishing set but uri missing - *
    • - *
    • LIMIT_REACHED "Notebook" - at max number of notebooks - *
    • - *
    - */ - createNotebook(notebook: Notebook, cb: Callback): void; - - /** - * Submits notebook changes to the service. The provided data must include - * the notebook's guid field for identification. - * - * @param notebook - * The notebook object containing the requested changes. - * - * @return - * The Update Sequence Number for this change within the account. - * - * @throws EDAMUserException
      - *
    • BAD_DATA_FORMAT "Notebook.name" - invalid length or pattern - *
    • - *
    • BAD_DATA_FORMAT "Notebook.stack" - invalid length or pattern - *
    • - *
    • BAD_DATA_FORMAT "Publishing.uri" - if publishing set but bad uri - *
    • - *
    • BAD_DATA_FORMAT "Publishing.publicDescription" - if too long - *
    • - *
    • DATA_CONFLICT "Notebook.name" - name already in use - *
    • - *
    • DATA_CONFLICT "Publishing.uri" - if URI already in use - *
    • - *
    • DATA_REQUIRED "Publishing.uri" - if publishing set but uri missing - *
    • - *
    - * - * @throws EDAMNotFoundException
      - *
    • "Notebook.guid" - not found, by GUID - *
    • - *
    - */ - updateNotebook(notebook: Notebook, cb: Callback): void; - - /** - * Permanently removes the notebook from the user's account. - * After this action, the notebook is no longer available for undeletion, etc. - * If the notebook contains any Notes, they will be moved to the current - * default notebook and moved into the trash (i.e. Note.active=false). - *

    - * NOTE: This function is generally not available to third party applications. - * Calls will result in an EDAMUserException with the error code - * PERMISSION_DENIED. - * - * @param guid - * The GUID of the notebook to delete. - * - * @return - * The Update Sequence Number for this change within the account. - * - * @throws EDAMUserException

      - *
    • BAD_DATA_FORMAT "Notebook.guid" - if the parameter is missing - *
    • - *
    • LIMIT_REACHED "Notebook" - trying to expunge the last Notebook - *
    • - *
    • PERMISSION_DENIED "Notebook" - private notebook, user doesn't own - *
    • - *
    - */ - expungeNotebook(guid: string, cb: Callback): void; - - /** - * Returns a list of the tags in the account. Evernote does not support - * the undeletion of tags, so this will only include active tags. - */ - listTags(cb: Callback): void; - - /** - * Returns a list of the tags that are applied to at least one note within - * the provided notebook. If the notebook is public, the authenticationToken - * may be ignored. - * - * @param notebookGuid - * the GUID of the notebook to use to find tags - * - * @throws EDAMNotFoundException
      - *
    • "Notebook.guid" - notebook not found by GUID - *
    • - *
    - */ - listTagsByNotebook(notebookGuid: string, cb: Callback): void; - - /** - * Returns the current state of the Tag with the provided GUID. - * - * @param guid - * The GUID of the tag to be retrieved. - * - * @throws EDAMUserException
      - *
    • BAD_DATA_FORMAT "Tag.guid" - if the parameter is missing - *
    • - *
    • PERMISSION_DENIED "Tag" - private Tag, user doesn't own - *
    • - *
    - * - * @throws EDAMNotFoundException
      - *
    • "Tag.guid" - tag not found, by GUID - *
    • - *
    - */ - getTag(guid: string, cb: Callback): void; - - /** - * Asks the service to make a tag with a set of information. - * - * @param tag - * The desired list of fields for the tag are specified in this - * object. The caller must specify the tag name, and may provide - * the parentGUID. - * - * @return - * The newly created Tag. The server-side GUID will be - * saved in this object. - * - * @throws EDAMUserException
      - *
    • BAD_DATA_FORMAT "Tag.name" - invalid length or pattern - *
    • - *
    • BAD_DATA_FORMAT "Tag.parentGuid" - malformed GUID - *
    • - *
    • DATA_CONFLICT "Tag.name" - name already in use - *
    • - *
    • LIMIT_REACHED "Tag" - at max number of tags - *
    • - *
    - * - * @throws EDAMNotFoundException
      - *
    • "Tag.parentGuid" - not found, by GUID - *
    • - *
    - */ - createTag(tag: Tag, cb: Callback): void; - - /** - * Submits tag changes to the service. The provided data must include - * the tag's guid field for identification. The service will apply - * updates to the following tag fields: name, parentGuid - * - * @param tag - * The tag object containing the requested changes. - * - * @return - * The Update Sequence Number for this change within the account. - * - * @throws EDAMUserException
      - *
    • BAD_DATA_FORMAT "Tag.name" - invalid length or pattern - *
    • - *
    • BAD_DATA_FORMAT "Tag.parentGuid" - malformed GUID - *
    • - *
    • DATA_CONFLICT "Tag.name" - name already in use - *
    • - *
    • DATA_CONFLICT "Tag.parentGuid" - can't set parent: circular - *
    • - *
    • PERMISSION_DENIED "Tag" - user doesn't own tag - *
    • - *
    - * - * @throws EDAMNotFoundException
      - *
    • "Tag.guid" - tag not found, by GUID - *
    • - *
    • "Tag.parentGuid" - parent not found, by GUID - *
    • - *
    - */ - updateTag(tag: Tag, cb: Callback): void; - - /** - * Removes the provided tag from every note that is currently tagged with - * this tag. If this operation is successful, the tag will still be in - * the account, but it will not be tagged on any notes. - * - * This function is not indended for use by full synchronizing clients, since - * it does not provide enough result information to the client to reconcile - * the local state without performing a follow-up sync from the service. This - * is intended for "thin clients" that need to efficiently support this as - * a UI operation. - * - * @param guid - * The GUID of the tag to remove from all notes. - * - * @throws EDAMUserException
      - *
    • BAD_DATA_FORMAT "Tag.guid" - if the guid parameter is missing - *
    • - *
    • PERMISSION_DENIED "Tag" - user doesn't own tag - *
    • - *
    - * - * @throws EDAMNotFoundException
      - *
    • "Tag.guid" - tag not found, by GUID - *
    • - *
    - */ - untagAll(guid: string, cb: Callback): void; - - /** - * Permanently deletes the tag with the provided GUID, if present. - *

    - * NOTE: This function is generally not available to third party applications. - * Calls will result in an EDAMUserException with the error code - * PERMISSION_DENIED. - * - * @param guid - * The GUID of the tag to delete. - * - * @return - * The Update Sequence Number for this change within the account. - * - * @throws EDAMUserException

      - *
    • BAD_DATA_FORMAT "Tag.guid" - if the guid parameter is missing - *
    • - *
    • PERMISSION_DENIED "Tag" - user doesn't own tag - *
    • - *
    - * - * @throws EDAMNotFoundException
      - *
    • "Tag.guid" - tag not found, by GUID - *
    • - *
    - */ - expungeTag(guid: string, cb: Callback): void; - - /** - * Returns a list of the searches in the account. Evernote does not support - * the undeletion of searches, so this will only include active searches. - */ - listSearches(cb: Callback): void; - - /** - * Returns the current state of the search with the provided GUID. - * - * @param guid - * The GUID of the search to be retrieved. - * - * @throws EDAMUserException
      - *
    • BAD_DATA_FORMAT "SavedSearch.guid" - if the parameter is missing - *
    • - *
    • PERMISSION_DENIED "SavedSearch" - private Tag, user doesn't own - *
    • - * - * @throws EDAMNotFoundException
        - *
      • "SavedSearch.guid" - not found, by GUID - *
      • - *
      - */ - getSearch(guid: string, cb: Callback): void; - - /** - * Asks the service to make a saved search with a set of information. - * - * @param search - * The desired list of fields for the search are specified in this - * object. The caller must specify the name and query for the - * search, and may optionally specify a search scope. - * The SavedSearch.format field is ignored by the service. - * - * @return - * The newly created SavedSearch. The server-side GUID will be - * saved in this object. - * - * @throws EDAMUserException
        - *
      • BAD_DATA_FORMAT "SavedSearch.name" - invalid length or pattern - *
      • - *
      • BAD_DATA_FORMAT "SavedSearch.query" - invalid length - *
      • - *
      • DATA_CONFLICT "SavedSearch.name" - name already in use - *
      • - *
      • LIMIT_REACHED "SavedSearch" - at max number of searches - *
      • - *
      - */ - createSearch(search: SavedSearch, cb: Callback): void; - - /** - * Submits search changes to the service. The provided data must include - * the search's guid field for identification. The service will apply - * updates to the following search fields: name, query, and scope. - * - * @param search - * The search object containing the requested changes. - * - * @return - * The Update Sequence Number for this change within the account. - * - * @throws EDAMUserException
        - *
      • BAD_DATA_FORMAT "SavedSearch.name" - invalid length or pattern - *
      • - *
      • BAD_DATA_FORMAT "SavedSearch.query" - invalid length - *
      • - *
      • DATA_CONFLICT "SavedSearch.name" - name already in use - *
      • - *
      • PERMISSION_DENIED "SavedSearch" - user doesn't own tag - *
      • - *
      - * - * @throws EDAMNotFoundException
        - *
      • "SavedSearch.guid" - not found, by GUID - *
      • - *
      - */ - updateSearch(search: SavedSearch, cb: Callback): number; - - /** - * Permanently deletes the saved search with the provided GUID, if present. - *

      - * NOTE: This function is generally not available to third party applications. - * Calls will result in an EDAMUserException with the error code - * PERMISSION_DENIED. - * - * @param guid - * The GUID of the search to delete. - * - * @return - * The Update Sequence Number for this change within the account. - * - * @throws EDAMUserException

        - *
      • BAD_DATA_FORMAT "SavedSearch.guid" - if the guid parameter is empty - *
      • - *
      • PERMISSION_DENIED "SavedSearch" - user doesn't own - *
      • - *
      - * - * @throws EDAMNotFoundException
        - *
      • "SavedSearch.guid" - not found, by GUID - *
      • - *
      - */ - expungeSearch(guid: string, cb: Callback): void; - - /** - * DEPRECATED. Use findNotesMetadata. - */ - findNotes(filter: NoteFilter, offset: number, maxNotes: number, cb: Callback): void; - - /** - * Finds the position of a note within a sorted subset of all of the user's - * notes. This may be useful for thin clients that are displaying a paginated - * listing of a large account, which need to know where a particular note - * sits in the list without retrieving all notes first. - * - * @param authenticationToken - * Must be a valid token for the user's account unless the NoteFilter - * 'notebookGuid' is the GUID of a public notebook. - * - * @param filter - * The list of criteria that will constrain the notes to be returned. - * - * @param guid - * The GUID of the note to be retrieved. - * - * @return - * If the note with the provided GUID is found within the matching note - * list, this will return the offset of that note within that list (where - * the first offset is 0). If the note is not found within the set of - * notes, this will return -1. - * - * @throws EDAMUserException
        - *
      • BAD_DATA_FORMAT "offset" - not between 0 and EDAM_USER_NOTES_MAX - *
      • - *
      • BAD_DATA_FORMAT "maxNotes" - not between 0 and EDAM_USER_NOTES_MAX - *
      • - *
      • BAD_DATA_FORMAT "NoteFilter.notebookGuid" - if malformed - *
      • - *
      • BAD_DATA_FORMAT "NoteFilter.tagGuids" - if any are malformed - *
      • - *
      • BAD_DATA_FORMAT "NoteFilter.words" - if search string too long - *
      • - * - * @throws EDAMNotFoundException
          - *
        • "Notebook.guid" - not found, by GUID - *
        • - *
        • "Note.guid" - not found, by GUID - *
        • - *
        - */ - findNoteOffset(filter: NoteFilter, guid: string, cb: Callback): void; - - /** - * Used to find the high-level information about a set of the notes from a - * user's account based on various criteria specified via a NoteFilter object. - *

        - * Web applications that wish to periodically check for new content in a user's - * Evernote account should consider using webhooks instead of polling this API. - * See http://dev.evernote.com/documentation/cloud/chapters/polling_notification.php - * for more information. - * - * @param authenticationToken - * Must be a valid token for the user's account unless the NoteFilter - * 'notebookGuid' is the GUID of a public notebook. - * - * @param filter - * The list of criteria that will constrain the notes to be returned. - * - * @param offset - * The numeric index of the first note to show within the sorted - * results. The numbering scheme starts with "0". This can be used for - * pagination. - * - * @param maxNotes - * The mximum notes to return in this query. The service will return a set - * of notes that is no larger than this number, but may return fewer notes - * if needed. The NoteList.totalNotes field in the return value will - * indicate whether there are more values available after the returned set. - * - * @param resultSpec - * This specifies which information should be returned for each matching - * Note. The fields on this structure can be used to eliminate data that - * the client doesn't need, which will reduce the time and bandwidth - * to receive and process the reply. - * - * @return - * The list of notes that match the criteria. - * - * @throws EDAMUserException

          - *
        • BAD_DATA_FORMAT "offset" - not between 0 and EDAM_USER_NOTES_MAX - *
        • - *
        • BAD_DATA_FORMAT "maxNotes" - not between 0 and EDAM_USER_NOTES_MAX - *
        • - *
        • BAD_DATA_FORMAT "NoteFilter.notebookGuid" - if malformed - *
        • - *
        • BAD_DATA_FORMAT "NoteFilter.tagGuids" - if any are malformed - *
        • - *
        • BAD_DATA_FORMAT "NoteFilter.words" - if search string too long - *
        • - *
        - * - * @throws EDAMNotFoundException
          - *
        • "Notebook.guid" - not found, by GUID - *
        • - *
        - */ - findNotesMetadata(filter: NoteFilter, offset: number, maxNotes: number, resultSpec: NotesMetadataResultSpec, cb: Callback): void; - - /** - * This function is used to determine how many notes are found for each - * notebook and tag in the user's account, given a current set of filter - * parameters that determine the current selection. This function will - * return a structure that gives the note count for each notebook and tag - * that has at least one note under the requested filter. Any notebook or - * tag that has zero notes in the filtered set will not be listed in the - * reply to this function (so they can be assumed to be 0). - * - * @param authenticationToken - * Must be a valid token for the user's account unless the NoteFilter - * 'notebookGuid' is the GUID of a public notebook. - * - * @param filter - * The note selection filter that is currently being applied. The note - * counts are to be calculated with this filter applied to the total set - * of notes in the user's account. - * - * @param withTrash - * If true, then the NoteCollectionCounts.trashCount will be calculated - * and supplied in the reply. Otherwise, the trash value will be omitted. - * - * @throws EDAMUserException
          - *
        • BAD_DATA_FORMAT "NoteFilter.notebookGuid" - if malformed - *
        • - *
        • BAD_DATA_FORMAT "NoteFilter.notebookGuids" - if any are malformed - *
        • - *
        • BAD_DATA_FORMAT "NoteFilter.words" - if search string too long - *
        • - * - * @throws EDAMNotFoundException
            - *
          • "Notebook.guid" - not found, by GUID - *
          • - *
          - */ - findNoteCounts(filter: NoteFilter, withTrash: boolean, cb: Callback): void; - - /** - * Returns the current state of the note in the service with the provided - * GUID. The ENML contents of the note will only be provided if the - * 'withContent' parameter is true. The service will include the meta-data - * for each resource in the note, but the binary contents of the resources - * and their recognition data will be omitted. - * If the Note is found in a public notebook, the authenticationToken - * will be ignored (so it could be an empty string). The applicationData - * fields are returned as keysOnly. - * - * @param guid - * The GUID of the note to be retrieved. - * - * @param withContent - * If true, the note will include the ENML contents of its - * 'content' field. - * - * @param withResourcesData - * If true, any Resource elements in this Note will include the binary - * contents of their 'data' field's body. - * - * @param withResourcesRecognition - * If true, any Resource elements will include the binary contents of the - * 'recognition' field's body if recognition data is present. - * - * @param withResourcesAlternateData - * If true, any Resource elements in this Note will include the binary - * contents of their 'alternateData' fields' body, if an alternate form - * is present. - * - * @throws EDAMUserException
            - *
          • BAD_DATA_FORMAT "Note.guid" - if the parameter is missing - *
          • - *
          • PERMISSION_DENIED "Note" - private note, user doesn't own - *
          • - *
          - * - * @throws EDAMNotFoundException
            - *
          • "Note.guid" - not found, by GUID - *
          • - *
          - */ - getNote(guid: string, withContent: boolean, withResourcesData: boolean, withResourcesRecognition: boolean, withResourcesAlternateData: boolean, cb: Callback): void; - - /** - * Get all of the application data for the note identified by GUID, - * with values returned within the LazyMap fullMap field. - * If there are no applicationData entries, then a LazyMap - * with an empty fullMap will be returned. If your application - * only needs to fetch its own applicationData entry, use - * getNoteApplicationDataEntry instead. - */ - getNoteApplicationData(guid: string, cb: Callback): void; - - /** - * Get the value of a single entry in the applicationData map - * for the note identified by GUID. - * - * @throws EDAMNotFoundException
            - *
          • "Note.guid" - note not found, by GUID
          • - *
          • "NoteAttributes.applicationData.key" - note not found, by key
          • - *
          - */ - getNoteApplicationDataEntry(guid: string, key: string, cb: Callback): void; - - /** - * Update, or create, an entry in the applicationData map for - * the note identified by guid. - */ - setNoteApplicationDataEntry(guid: string, key: string, value: string, cb: Callback): void; - - /** - * Remove an entry identified by 'key' from the applicationData map for - * the note identified by 'guid'. Silently ignores an unset of a - * non-existing key. - */ - unsetNoteApplicationDataEntry(guid: string, key: string, cb: Callback): void; - - /** - * Returns XHTML contents of the note with the provided GUID. - * If the Note is found in a public notebook, the authenticationToken - * will be ignored (so it could be an empty string). - * - * @param guid - * The GUID of the note to be retrieved. - * - * @throws EDAMUserException
            - *
          • BAD_DATA_FORMAT "Note.guid" - if the parameter is missing - *
          • - *
          • PERMISSION_DENIED "Note" - private note, user doesn't own - *
          • - *
          - * - * @throws EDAMNotFoundException
            - *
          • "Note.guid" - not found, by GUID - *
          • - *
          - */ - getNoteContent(guid: string, cb: Callback): void; - - /** - * Returns a block of the extracted plain text contents of the note with the - * provided GUID. This text can be indexed for search purposes by a light - * client that doesn't have capabilities to extract all of the searchable - * text content from the note and its resources. - * - * If the Note is found in a public notebook, the authenticationToken - * will be ignored (so it could be an empty string). - * - * @param guid - * The GUID of the note to be retrieved. - * - * @param noteOnly - * If true, this will only return the text extracted from the ENML contents - * of the note itself. If false, this will also include the extracted text - * from any text-bearing resources (PDF, recognized images) - * - * @param tokenizeForIndexing - * If true, this will break the text into cleanly separated and sanitized - * tokens. If false, this will return the more raw text extraction, with - * its original punctuation, capitalization, spacing, etc. - * - * @throws EDAMUserException
            - *
          • BAD_DATA_FORMAT "Note.guid" - if the parameter is missing - *
          • - *
          • PERMISSION_DENIED "Note" - private note, user doesn't own - *
          • - *
          - * - * @throws EDAMNotFoundException
            - *
          • "Note.guid" - not found, by GUID - *
          • - *
          - */ - getNoteSearchText(guid: string, noteOnly: boolean, tokenizeForIndexing: boolean, cb: Callback): void; - - /** - * Returns a block of the extracted plain text contents of the resource with - * the provided GUID. This text can be indexed for search purposes by a light - * client that doesn't have capability to extract all of the searchable - * text content from a resource. - * - * If the Resource is found in a public notebook, the authenticationToken - * will be ignored (so it could be an empty string). - * - * @param guid - * The GUID of the resource to be retrieved. - * - * @throws EDAMUserException
            - *
          • BAD_DATA_FORMAT "Resource.guid" - if the parameter is missing - *
          • - *
          • PERMISSION_DENIED "Resource" - private resource, user doesn't own - *
          • - *
          - * - * @throws EDAMNotFoundException
            - *
          • "Resource.guid" - not found, by GUID - *
          • - *
          - */ - getResourceSearchText(guid: string, cb: Callback): void; - - /** - * Returns a list of the names of the tags for the note with the provided - * guid. This can be used with authentication to get the tags for a - * user's own note, or can be used without valid authentication to retrieve - * the names of the tags for a note in a public notebook. - * - * @throws EDAMUserException
            - *
          • BAD_DATA_FORMAT "Note.guid" - if the parameter is missing - *
          • - *
          • PERMISSION_DENIED "Note" - private note, user doesn't own - *
          • - *
          - * - * @throws EDAMNotFoundException
            - *
          • "Note.guid" - not found, by GUID - *
          • - *
          - */ - getNoteTagNames(guid: string, cb: Callback): void; - - /** - * Asks the service to make a note with the provided set of information. - * - * @param note - * A Note object containing the desired fields to be populated on - * the service. - * - * @return - * The newly created Note from the service. The server-side - * GUIDs for the Note and any Resources will be saved in this object. - * - * @throws EDAMUserException
            - *
          • BAD_DATA_FORMAT "Note.title" - invalid length or pattern - *
          • - *
          • BAD_DATA_FORMAT "Note.content" - invalid length for ENML content - *
          • - *
          • BAD_DATA_FORMAT "Resource.mime" - invalid resource MIME type - *
          • - *
          • BAD_DATA_FORMAT "NoteAttributes.*" - bad resource string - *
          • - *
          • BAD_DATA_FORMAT "ResourceAttributes.*" - bad resource string - *
          • - *
          • DATA_CONFLICT "Note.deleted" - deleted time set on active note - *
          • - *
          • DATA_REQUIRED "Resource.data" - resource data body missing - *
          • - *
          • ENML_VALIDATION "*" - note content doesn't validate against DTD - *
          • - *
          • LIMIT_REACHED "Note" - at max number per account - *
          • - *
          • LIMIT_REACHED "Note.size" - total note size too large - *
          • - *
          • LIMIT_REACHED "Note.resources" - too many resources on Note - *
          • - *
          • LIMIT_REACHED "Note.tagGuids" - too many Tags on Note - *
          • - *
          • LIMIT_REACHED "Resource.data.size" - resource too large - *
          • - *
          • LIMIT_REACHED "NoteAttribute.*" - attribute string too long - *
          • - *
          • LIMIT_REACHED "ResourceAttribute.*" - attribute string too long - *
          • - *
          • PERMISSION_DENIED "Note.notebookGuid" - NB not owned by user - *
          • - *
          • QUOTA_REACHED "Accounting.uploadLimit" - note exceeds upload quota - *
          • - *
          • BAD_DATA_FORMAT "Tag.name" - Note.tagNames was provided, and one - * of the specified tags had an invalid length or pattern - *
          • - *
          • LIMIT_REACHED "Tag" - Note.tagNames was provided, and the required - * new tags would exceed the maximum number per account - *
          • - *
          - * - * @throws EDAMNotFoundException
            - *
          • "Note.notebookGuid" - not found, by GUID - *
          • - *
          - */ - createNote(note: Note, cb: Callback): void; - - /** - * Submit a set of changes to a note to the service. The provided data - * must include the note's guid field for identification. The note's - * title must also be set. - * - * @param note - * A Note object containing the desired fields to be populated on - * the service. With the exception of the note's title and guid, fields - * that are not being changed do not need to be set. If the content is not - * being modified, note.content should be left unset. If the list of - * resources is not being modified, note.resources should be left unset. - * - * @return - * The metadata (no contents) for the Note on the server after the update - * - * @throws EDAMUserException
            - *
          • BAD_DATA_FORMAT "Note.title" - invalid length or pattern - *
          • - *
          • BAD_DATA_FORMAT "Note.content" - invalid length for ENML body - *
          • - *
          • BAD_DATA_FORMAT "NoteAttributes.*" - bad resource string - *
          • - *
          • BAD_DATA_FORMAT "ResourceAttributes.*" - bad resource string - *
          • - *
          • BAD_DATA_FORMAT "Resource.mime" - invalid resource MIME type - *
          • - *
          • DATA_CONFLICT "Note.deleted" - deleted time set on active note - *
          • - *
          • DATA_REQUIRED "Resource.data" - resource data body missing - *
          • - *
          • ENML_VALIDATION "*" - note content doesn't validate against DTD - *
          • - *
          • LIMIT_REACHED "Note.tagGuids" - too many Tags on Note - *
          • - *
          • LIMIT_REACHED "Note.resources" - too many resources on Note - *
          • - *
          • LIMIT_REACHED "Note.size" - total note size too large - *
          • - *
          • LIMIT_REACHED "Resource.data.size" - resource too large - *
          • - *
          • LIMIT_REACHED "NoteAttribute.*" - attribute string too long - *
          • - *
          • LIMIT_REACHED "ResourceAttribute.*" - attribute string too long - *
          • - *
          • PERMISSION_DENIED "Note" - user doesn't own - *
          • - *
          • PERMISSION_DENIED "Note.notebookGuid" - user doesn't own destination - *
          • - *
          • QUOTA_REACHED "Accounting.uploadLimit" - note exceeds upload quota - *
          • - *
          • BAD_DATA_FORMAT "Tag.name" - Note.tagNames was provided, and one - * of the specified tags had an invalid length or pattern - *
          • - *
          • LIMIT_REACHED "Tag" - Note.tagNames was provided, and the required - * new tags would exceed the maximum number per account - *
          • - *
          - * - * @throws EDAMNotFoundException
            - *
          • "Note.guid" - note not found, by GUID - *
          • - *
          • "Note.notebookGuid" - if notebookGuid provided, but not found - *
          • - *
          - */ - updateNote(note: Note, cb: Callback): void; - - /** - * Moves the note into the trash. The note may still be undeleted, unless it - * is expunged. This is equivalent to calling updateNote() after setting - * Note.active = false - * - * @param guid - * The GUID of the note to delete. - * - * @return - * The Update Sequence Number for this change within the account. - * - * @throws EDAMUserException
            - *
          • PERMISSION_DENIED "Note" - user doesn't have permission to - * update the note. - *
          • - *
          - * - * @throws EDAMUserException
            - *
          • DATA_CONFLICT "Note.guid" - the note is already deleted - *
          • - *
          - * @throws EDAMNotFoundException
            - *
          • "Note.guid" - not found, by GUID - *
          • - *
          - */ - deleteNote(guid: string, cb: Callback): void; - - /** - * Permanently removes a Note, and all of its Resources, - * from the service. - *

          - * NOTE: This function is not available to third party applications. - * Calls will result in an EDAMUserException with the error code - * PERMISSION_DENIED. - * - * @param guid - * The GUID of the note to delete. - * - * @return - * The Update Sequence Number for this change within the account. - * - * @throws EDAMUserException

            - *
          • PERMISSION_DENIED "Note" - user doesn't own - *
          • - *
          - * - * @throws EDAMNotFoundException
            - *
          • "Note.guid" - not found, by GUID - *
          • - *
          - */ - expungeNote(guid: string, cb: Callback): void; - - /** - * Permanently removes a list of Notes, and all of their Resources, from - * the service. This should be invoked with a small number of Note GUIDs - * (e.g. 100 or less) on each call. To expunge a larger number of notes, - * call this method multiple times. This should also be used to reduce the - * number of Notes in a notebook before calling expungeNotebook() or - * in the trash before calling expungeInactiveNotes(), since these calls may - * be prohibitively slow if there are more than a few hundred notes. - * If an exception is thrown for any of the GUIDs, then none of the notes - * will be deleted. I.e. this call can be treated as an atomic transaction. - *

          - * NOTE: This function is not available to third party applications. - * Calls will result in an EDAMUserException with the error code - * PERMISSION_DENIED. - * - * @param noteGuids - * The list of GUIDs for the Notes to remove. - * - * @return - * The account's updateCount at the end of this operation - * - * @throws EDAMUserException

            - *
          • PERMISSION_DENIED "Note" - user doesn't own - *
          • - *
          - * - * @throws EDAMNotFoundException
            - *
          • "Note.guid" - not found, by GUID - *
          • - *
          - */ - expungeNotes(noteGuids: string[], cb: Callback): void; - - /** - * Permanently removes all of the Notes that are currently marked as - * inactive. This is equivalent to "emptying the trash", and these Notes - * will be gone permanently. - *

          - * This operation may be relatively slow if the account contains a large - * number of inactive Notes. - *

          - * NOTE: This function is not available to third party applications. - * Calls will result in an EDAMUserException with the error code - * PERMISSION_DENIED. - * - * @return - * The number of notes that were expunged. - */ - expungeInactiveNotes(cb: Callback): void; - - /** - * Performs a deep copy of the Note with the provided GUID 'noteGuid' into - * the Notebook with the provided GUID 'toNotebookGuid'. - * The caller must be the owner of both the Note and the Notebook. - * This creates a new Note in the destination Notebook with new content and - * Resources that match all of the content and Resources from the original - * Note, but with new GUID identifiers. - * The original Note is not modified by this operation. - * The copied note is considered as an "upload" for the purpose of upload - * transfer limit calculation, so its size is added to the upload count for - * the owner. - * - * @param noteGuid - * The GUID of the Note to copy. - * - * @param toNotebookGuid - * The GUID of the Notebook that should receive the new Note. - * - * @return - * The metadata for the new Note that was created. This will include the - * new GUID for this Note (and any copied Resources), but will not include - * the content body or the binary bodies of any Resources. - * - * @throws EDAMUserException

            - *
          • LIMIT_REACHED "Note" - at max number per account - *
          • - *
          • PERMISSION_DENIED "Notebook.guid" - destination not owned by user - *
          • - *
          • PERMISSION_DENIED "Note" - user doesn't own - *
          • - *
          • QUOTA_REACHED "Accounting.uploadLimit" - note exceeds upload quota - *
          • - *
          - * - * @throws EDAMNotFoundException
            - *
          • "Notebook.guid" - not found, by GUID - *
          • - *
          - */ - copyNote(noteGuid: string, toNotebookGuid: string, cb: Callback): void; - - /** - * Returns a list of the prior versions of a particular note that are - * saved within the service. These prior versions are stored to provide a - * recovery from unintentional removal of content from a note. The identifiers - * that are returned by this call can be used with getNoteVersion to retrieve - * the previous note. - * The identifiers will be listed from the most recent versions to the oldest. - * - * @throws EDAMUserException
            - *
          • BAD_DATA_FORMAT "Note.guid" - if the parameter is missing - *
          • - *
          • PERMISSION_DENIED "Note" - private note, user doesn't own - *
          • - *
          - * - * @throws EDAMNotFoundException
            - *
          • "Note.guid" - not found, by GUID - *
          • - *
          - */ - listNoteVersions(noteGuid: string, cb: Callback): void; - - /** - * This can be used to retrieve a previous version of a Note after it has been - * updated within the service. The caller must identify the note (via its - * guid) and the version (via the updateSequenceNumber of that version). - * to find a listing of the stored version USNs for a note, call - * listNoteVersions. - * This call is only available for notes in Premium accounts. (I.e. access - * to past versions of Notes is a Premium-only feature.) - * - * @param noteGuid - * The GUID of the note to be retrieved. - * - * @param updateSequenceNum - * The USN of the version of the note that is being retrieved - * - * @param withResourcesData - * If true, any Resource elements in this Note will include the binary - * contents of their 'data' field's body. - * - * @param withResourcesRecognition - * If true, any Resource elements will include the binary contents of the - * 'recognition' field's body if recognition data is present. - * - * @param withResourcesAlternateData - * If true, any Resource elements in this Note will include the binary - * contents of their 'alternateData' fields' body, if an alternate form - * is present. - * - * @throws EDAMUserException
            - *
          • BAD_DATA_FORMAT "Note.guid" - if the parameter is missing - *
          • - *
          • PERMISSION_DENIED "Note" - private note, user doesn't own - *
          • - *
          • PERMISSION_DENIED "updateSequenceNum" - - * The account isn't permitted to access previous versions of notes. - * (i.e. this is a Free account.) - *
          • - *
          - * - * @throws EDAMNotFoundException
            - *
          • "Note.guid" - not found, by GUID - *
          • - *
          • "Note.updateSequenceNumber" - the Note doesn't have a version with - * the corresponding USN. - *
          • - *
          - */ - getNoteVersion(noteGuid: string, updateSequenceNum: number, withResourcesData: boolean, withResourcesRecognition: boolean, withResourcesAlternateData: boolean, cb: Callback): void; - - /** - * Returns the current state of the resource in the service with the - * provided GUID. - * If the Resource is found in a public notebook, the authenticationToken - * will be ignored (so it could be an empty string). Only the - * keys for the applicationData will be returned. - * - * @param guid - * The GUID of the resource to be retrieved. - * - * @param withData - * If true, the Resource will include the binary contents of the - * 'data' field's body. - * - * @param withRecognition - * If true, the Resource will include the binary contents of the - * 'recognition' field's body if recognition data is present. - * - * @param withAttributes - * If true, the Resource will include the attributes - * - * @param withAlternateData - * If true, the Resource will include the binary contents of the - * 'alternateData' field's body, if an alternate form is present. - * - * @throws EDAMUserException
            - *
          • BAD_DATA_FORMAT "Resource.guid" - if the parameter is missing - *
          • - *
          • PERMISSION_DENIED "Resource" - private resource, user doesn't own - *
          • - *
          - * - * @throws EDAMNotFoundException
            - *
          • "Resource.guid" - not found, by GUID - *
          • - *
          - */ - getResource(guid: string, withData: boolean, withRecognition: boolean, withAttributes: boolean, withAlternateData: boolean, cb: Callback): void; - - /** - * Get all of the application data for the Resource identified by GUID, - * with values returned within the LazyMap fullMap field. - * If there are no applicationData entries, then a LazyMap - * with an empty fullMap will be returned. If your application - * only needs to fetch its own applicationData entry, use - * getResourceApplicationDataEntry instead. - */ - getResourceApplicationData(guid: string, cb: Callback): void; - - /** - * Get the value of a single entry in the applicationData map - * for the Resource identified by GUID. - * - * @throws EDAMNotFoundException
            - *
          • "Resource.guid" - Resource not found, by GUID
          • - *
          • "ResourceAttributes.applicationData.key" - Resource not found, by key
          • - *
          - */ - getResourceApplicationDataEntry(guid: string, key: string, cb: Callback): void; - - /** - * Update, or create, an entry in the applicationData map for - * the Resource identified by guid. - */ - setResourceApplicationDataEntry(guid: string, key: string, value: string, cb: Callback): void; - - /** - * Remove an entry identified by 'key' from the applicationData map for - * the Resource identified by 'guid'. - */ - unsetResourceApplicationDataEntry(guid: string, key: string, cb: Callback): void; - - /** - * Submit a set of changes to a resource to the service. This can be used - * to update the meta-data about the resource, but cannot be used to change - * the binary contents of the resource (including the length and hash). These - * cannot be changed directly without creating a new resource and removing the - * old one via updateNote. - * - * @param resource - * A Resource object containing the desired fields to be populated on - * the service. The service will attempt to update the resource with the - * following fields from the client: - *
            - *
          • guid: must be provided to identify the resource - *
          • - *
          • mime - *
          • - *
          • width - *
          • - *
          • height - *
          • - *
          • duration - *
          • - *
          • attributes: optional. if present, the set of attributes will - * be replaced. - *
          • - *
          - * - * @return - * The Update Sequence Number of the resource after the changes have been - * applied. - * - * @throws EDAMUserException
            - *
          • BAD_DATA_FORMAT "Resource.guid" - if the parameter is missing - *
          • - *
          • BAD_DATA_FORMAT "Resource.mime" - invalid resource MIME type - *
          • - *
          • BAD_DATA_FORMAT "ResourceAttributes.*" - bad resource string - *
          • - *
          • LIMIT_REACHED "ResourceAttribute.*" - attribute string too long - *
          • - *
          • PERMISSION_DENIED "Resource" - private resource, user doesn't own - *
          • - *
          - * - * @throws EDAMNotFoundException
            - *
          • "Resource.guid" - not found, by GUID - *
          • - *
          - */ - updateResource(resource: Resource, cb: Callback): void; - - /** - * Returns binary data of the resource with the provided GUID. For - * example, if this were an image resource, this would contain the - * raw bits of the image. - * If the Resource is found in a public notebook, the authenticationToken - * will be ignored (so it could be an empty string). - * - * @param guid - * The GUID of the resource to be retrieved. - * - * @throws EDAMUserException
            - *
          • BAD_DATA_FORMAT "Resource.guid" - if the parameter is missing - *
          • - *
          • PERMISSION_DENIED "Resource" - private resource, user doesn't own - *
          • - *
          - * - * @throws EDAMNotFoundException
            - *
          • "Resource.guid" - not found, by GUID - *
          • - *
          - */ - getResourceData(guid: string, cb: Callback): void; - - /** - * Returns the current state of a resource, referenced by containing - * note GUID and resource content hash. - * - * @param noteGuid - * The GUID of the note that holds the resource to be retrieved. - * - * @param contentHash - * The MD5 checksum of the resource within that note. Note that - * this is the binary checksum, for example from Resource.data.bodyHash, - * and not the hex-encoded checksum that is used within an en-media - * tag in a note body. - * - * @param withData - * If true, the Resource will include the binary contents of the - * 'data' field's body. - * - * @param withRecognition - * If true, the Resource will include the binary contents of the - * 'recognition' field's body. - * - * @param withAlternateData - * If true, the Resource will include the binary contents of the - * 'alternateData' field's body, if an alternate form is present. - * - * @throws EDAMUserException
            - *
          • DATA_REQUIRED "Note.guid" - noteGuid param missing - *
          • - *
          • DATA_REQUIRED "Note.contentHash" - contentHash param missing - *
          • - *
          • PERMISSION_DENIED "Resource" - private resource, user doesn't own - *
          • - *
          - * - * @throws EDAMNotFoundException
            - *
          • "Note" - not found, by guid - *
          • - *
          • "Resource" - not found, by hash - *
          • - *
          - */ - getResourceByHash(noteGuid: string, contentHash: string, withData: boolean, withRecognition: boolean, withAlternateData: boolean, cb: Callback): void; - - /** - * Returns the binary contents of the recognition index for the resource - * with the provided GUID. If the caller asks about a resource that has - * no recognition data, this will throw EDAMNotFoundException. - * If the Resource is found in a public notebook, the authenticationToken - * will be ignored (so it could be an empty string). - * - * @param guid - * The GUID of the resource whose recognition data should be retrieved. - * - * @throws EDAMUserException
            - *
          • BAD_DATA_FORMAT "Resource.guid" - if the parameter is missing - *
          • - *
          • PERMISSION_DENIED "Resource" - private resource, user doesn't own - *
          • - *
          - * - * @throws EDAMNotFoundException
            - *
          • "Resource.guid" - not found, by GUID - *
          • - *
          • "Resource.recognition" - resource has no recognition - *
          • - *
          - */ - getResourceRecognition(guid: string, cb: Callback): void; - - /** - * If the Resource with the provided GUID has an alternate data representation - * (indicated via the Resource.alternateData field), then this request can - * be used to retrieve the binary contents of that alternate data file. - * If the caller asks about a resource that has no alternate data form, this - * will throw EDAMNotFoundException. - * - * @param guid - * The GUID of the resource whose recognition data should be retrieved. - * - * @throws EDAMUserException
            - *
          • BAD_DATA_FORMAT "Resource.guid" - if the parameter is missing - *
          • - *
          • PERMISSION_DENIED "Resource" - private resource, user doesn't own - *
          • - *
          - * - * @throws EDAMNotFoundException
            - *
          • "Resource.guid" - not found, by GUID - *
          • - *
          • "Resource.alternateData" - resource has no recognition - *
          • - *
          - */ - getResourceAlternateData(guid: string, cb: Callback): void; - - /** - * Returns the set of attributes for the Resource with the provided GUID. - * If the Resource is found in a public notebook, the authenticationToken - * will be ignored (so it could be an empty string). - * - * @param guid - * The GUID of the resource whose attributes should be retrieved. - * - * @throws EDAMUserException
            - *
          • BAD_DATA_FORMAT "Resource.guid" - if the parameter is missing - *
          • - *
          • PERMISSION_DENIED "Resource" - private resource, user doesn't own - *
          • - *
          - * - * @throws EDAMNotFoundException
            - *
          • "Resource.guid" - not found, by GUID - *
          • - *
          - */ - getResourceAttributes(guid: string, cb: Callback): void; - - /** - *

          - * Looks for a user account with the provided userId on this NoteStore - * shard and determines whether that account contains a public notebook - * with the given URI. If the account is not found, or no public notebook - * exists with this URI, this will throw an EDAMNotFoundException, - * otherwise this will return the information for that Notebook. - *

          - *

          - * If a notebook is visible on the web with a full URL like - * http://www.evernote.com/pub/sethdemo/api - * Then 'sethdemo' is the username that can be used to look up the userId, - * and 'api' is the publicUri. - *

          - * - * @param userId - * The numeric identifier for the user who owns the public notebook. - * To find this value based on a username string, you can invoke - * UserStore.getPublicUserInfo - * - * @param publicUri - * The uri string for the public notebook, from Notebook.publishing.uri. - * - * @throws EDAMNotFoundException
            - *
          • "Publishing.uri" - not found, by URI
          • - *
          - * - * @throws EDAMSystemException
            - *
          • TAKEN_DOWN "PublicNotebook" - The specified public notebook is - * taken down (for all requesters).
          • - *
          • TAKEN_DOWN "Country" - The specified public notebook is taken - * down for the requester because of an IP-based country lookup.
          • - *
          - */ - getPublicNotebook(userId: number, publicUri: string, cb: Callback): void; - - /** - * Used to construct a shared notebook object. The constructed notebook will - * contain a "share key" which serve as a unique identifer and access token - * for a user to access the notebook of the shared notebook owner. - * - * @param sharedNotebook - * A shared notebook object populated with the email address of the share - * recipient, the notebook guid and the access permissions. All other - * attributes of the shared object are ignored. The SharedNotebook.allowPreview - * field must be explicitly set with either a true or false value. - * - * @return - * The fully populated SharedNotebook object including the server assigned - * share id and shareKey which can both be used to uniquely identify the - * SharedNotebook. - * - * @throws EDAMUserException
            - *
          • BAD_DATA_FORMAT "SharedNotebook.email" - if the email was not valid
          • - *
          • BAD_DATA_FORMAT "requireLogin" - if the SharedNotebook.allowPreview field was - * not set, and the SharedNotebook.requireLogin was also not set or was set to - * false.
          • - *
          • PERMISSION_DENIED "SharedNotebook.recipientSettings" - if - * recipientSettings is set in the sharedNotebook. Only the recipient - * can set these values via the setSharedNotebookRecipientSettings - * method. - *
          • - *
          - * @throws EDAMNotFoundException
            - *
          • Notebook.guid - if the notebookGuid is not a valid GUID for the user. - *
          • - *
          - */ - createSharedNotebook(sharedNotebook: SharedNotebook, cb: Callback): void; - - /** - * Update a SharedNotebook object. - * - * @param authenticationToken - * Must be an authentication token from the owner or a shared notebook - * authentication token or business authentication token with sufficient - * permissions to change invitations for a notebook. - * - * @param sharedNotebook - * The SharedNotebook object containing the requested changes. - * The "id" of the shared notebook must be set to allow the service - * to identify the SharedNotebook to be updated. In addition, you MUST set - * the email, permission, and allowPreview fields to the desired values. - * All other fields will be ignored if set. - * - * @return - * The Update Serial Number for this change within the account. - * - * @throws EDAMUserException
            - *
          • UNSUPPORTED_OPERATION "updateSharedNotebook" - if this service instance does not support shared notebooks.
          • - *
          • BAD_DATA_FORMAT "SharedNotebook.email" - if the email was not valid.
          • - *
          • DATA_REQUIRED "SharedNotebook.id" - if the id field was not set.
          • - *
          • DATA_REQUIRED "SharedNotebook.privilege" - if the privilege field was not set.
          • - *
          • DATA_REQUIRED "SharedNotebook.allowPreview" - if the allowPreview field was not set.
          • - *
          - * @throws EDAMNotFoundException
            - *
          • SharedNotebook.id - if no shared notebook with the specified ID was found. - *
          - */ - updateSharedNotebook(sharedNotebook: SharedNotebook, cb: Callback): void; - - /** - * Set values for the recipient settings associated with a shared notebook. Having - * update rights to the shared notebook record itself has no effect on this call; - * only the recipient of the shared notebook can can the recipient settings. - * - * If you do not wish to, or cannot, change one of the reminderNotifyEmail or - * reminderNotifyInApp fields, you must leave that field unset in recipientSettings. - * This method will skip that field for updates and leave the existing state as - * it is. - * - * @return The update sequence number of the account to which the shared notebook - * belongs, which is the account from which we are sharing a notebook. - * - * @throws EDAMNotFoundException "sharedNotebookId" - Thrown if the service does not - * have a shared notebook record for the sharedNotebookId on the given shard. If you - * receive this exception, it is probable that the shared notebook record has - * been revoked or expired, or that you accessed the wrong shard. - * - * @throws EDAMUserException
            - *
          • PEMISSION_DENIED "authenticationToken" - If you do not have permission to set - * the recipient settings for the shared notebook. Only the recipient has - * permission to do this. - *
          • DATA_CONFLICT "recipientSettings.reminderNotifyEmail" - Setting whether - * or not you want to receive reminder e-mail notifications is possible on - * a business notebook in the business to which the user belongs. All - * others can safely unset the reminderNotifyEmail field from the - * recipientSettings parameter. - *
          - */ - setSharedNotebookRecipientSettings(sharedNotebookId: number, recipientSettings: SharedNotebookRecipientSettings, cb: Callback): void; - - /** - * Send a reminder message to some or all of the email addresses that a notebook has been - * shared with. The message includes the current link to view the notebook. - * @param authenticationToken - * The auth token of the user with permissions to share the notebook - * @param notebookGuid - * The guid of the shared notebook - * @param messageText - * User provided text to include in the email - * @param recipients - * The email addresses of the recipients. If this list is empty then all of the - * users that the notebook has been shared with are emailed. - * If an email address doesn't correspond to share invite members then that address - * is ignored. - * @return - * The number of messages sent - * @throws EDAMUserException
            - *
          • LIMIT_REACHED "(recipients)" - - * The email can't be sent because this would exceed the user's daily - * email limit. - *
          • - *
          • PERMISSION_DENIED "Notebook.guid" - The user doesn't have permission to - * send a message for the specified notebook. - *
          • - *
          - * - * @throws EDAMNotFoundException
            - *
          • "Notebook.guid" - not found, by GUID - *
          • - *
          - */ - sendMessageToSharedNotebookMembers(notebookGuid: string, messageText: string, recipients: string[], cb: Callback): void; - - /** - * Lists the collection of shared notebooks for all notebooks in the - * users account. - * - * @return - * The list of all SharedNotebooks for the user - */ - listSharedNotebooks(cb: Callback): void; - - /** - * Expunges the SharedNotebooks in the user's account using the - * SharedNotebook.id as the identifier. - *

          - * NOTE: This function is generally not available to third party applications. - * Calls will result in an EDAMUserException with the error code - * PERMISSION_DENIED. - * - * @param - * sharedNotebookIds - a list of ShardNotebook.id longs identifying the - * objects to delete permanently. - * - * @return - * The account's update sequence number. - */ - expungeSharedNotebooks(sharedNotebookIds: number[], cb: Callback): void; - - /** - * Asks the service to make a linked notebook with the provided name, username - * of the owner and identifiers provided. A linked notebook can be either a - * link to a public notebook or to a private shared notebook. - * - * @param linkedNotebook - * The desired fields for the linked notebook must be provided on this - * object. The name of the linked notebook must be set. Either a username - * uri or a shard id and share key must be provided otherwise a - * EDAMUserException is thrown. - * - * @return - * The newly created LinkedNotebook. The server-side id will be - * saved in this object's 'id' field. - * - * @throws EDAMUserException

            - *
          • BAD_DATA_FORMAT "LinkedNotebook.name" - invalid length or pattern - *
          • - *
          • BAD_DATA_FORMAT "LinkedNotebook.username" - bad username format - *
          • - *
          • BAD_DATA_FORMAT "LinkedNotebook.uri" - - * if public notebook set but bad uri - *
          • - *
          • BAD_DATA_FORMAT "LinkedNotebook.shareKey" - - * if private notebook set but bad shareKey - *
          • - *
          • DATA_REQUIRED "LinkedNotebook.shardId" - - * if private notebook but shard id not provided - *
          • - *
          - */ - createLinkedNotebook(linkedNotebook: LinkedNotebook, cb: Callback): void; - - /** - * @param linkedNotebook - * Updates the name of a linked notebook. - * - * @return - * The Update Sequence Number for this change within the account. - * - * @throws EDAMUserException
            - *
          • BAD_DATA_FORMAT "LinkedNotebook.name" - invalid length or pattern - *
          • - *
          - */ - updateLinkedNotebook(linkedNotebook: LinkedNotebook, cb: Callback): void; - - /** - * Returns a list of linked notebooks - */ - listLinkedNotebooks(cb: Callback): void; - - /** - * Permanently expunges the linked notebook from the account. - *

          - * NOTE: This function is generally not available to third party applications. - * Calls will result in an EDAMUserException with the error code - * PERMISSION_DENIED. - * - * @param guid - * The LinkedNotebook.guid field of the LinkedNotebook to permanently remove - * from the account. - */ - expungeLinkedNotebook(guid: string, cb: Callback): void; - - /** - * Asks the service to produce an authentication token that can be used to - * access the contents of a shared notebook from someone else's account. - * This authenticationToken can be used with the various other NoteStore - * calls to find and retrieve notes, and if the permissions in the shared - * notebook are sufficient, to make changes to the contents of the notebook. - * - * @param shareKey - * The 'shareKey' identifier from the SharedNotebook that was granted to - * some recipient. This string internally encodes the notebook identifier - * and a security signature. - * - * @param authenticationToken - * If a non-empty string is provided, this is the full user-based - * authentication token that identifies the user who is currently logged in - * and trying to access the shared notebook. This may be required if the - * notebook was created with 'requireLogin'. - * If this string is empty, the service will attempt to authenticate to the - * shared notebook without any logged in user. - * - * @throws EDAMSystemException

            - *
          • BAD_DATA_FORMAT "shareKey" - invalid shareKey string - *
          • - *
          • INVALID_AUTH "shareKey" - bad signature on shareKey string - *
          • - *
          - * - * @throws EDAMNotFoundException
            - *
          • "SharedNotebook.id" - the shared notebook no longer exists - *
          • - *
          - * - * @throws EDAMUserException
            - *
          • DATA_REQUIRED "authenticationToken" - the share requires login, and - * no valid authentication token was provided. - *
          • - *
          • PERMISSION_DENIED "SharedNotebook.username" - share requires login, - * and another username has already been bound to this notebook. - *
          • - *
          - */ - authenticateToSharedNotebook(shareKey: string, cb: Callback): void; - - /** - * This function is used to retrieve extended information about a shared - * notebook by a guest who has already authenticated to access that notebook. - * This requires an 'authenticationToken' parameter which should be the - * resut of a call to authenticateToSharedNotebook(...). - * I.e. this is the token that gives access to the particular shared notebook - * in someone else's account -- it's not the authenticationToken for the - * owner of the notebook itself. - * - * @param authenticationToken - * Should be the authentication token retrieved from the reply of - * authenticateToSharedNotebook(), proving access to a particular shared - * notebook. - * - * @throws EDAMUserException
            - *
          • PERMISSION_DENIED "authenticationToken" - - * authentication token doesn't correspond to a valid shared notebook - *
          • - *
          - * - * @throws EDAMNotFoundException
            - *
          • "SharedNotebook.id" - the shared notebook no longer exists - *
          • - *
          - */ - getSharedNotebookByAuth(cb: Callback): void; - - /** - * Attempts to send a single note to one or more email recipients. - *

          - * NOTE: This function is generally not available to third party applications. - * Calls will result in an EDAMUserException with the error code - * PERMISSION_DENIED. - * - * @param authenticationToken - * The note will be sent as the user logged in via this token, using that - * user's registered email address. If the authenticated user doesn't - * have permission to read that note, the emailing will fail. - * - * @param parameters - * The note must be specified either by GUID (in which case it will be - * sent using the existing data in the service), or else the full Note - * must be passed to this call. This also specifies the additional - * email fields that will be used in the email. - * - * @throws EDAMUserException

            - *
          • LIMIT_REACHED "NoteEmailParameters.toAddresses" - - * The email can't be sent because this would exceed the user's daily - * email limit. - *
          • - *
          • BAD_DATA_FORMAT "(email address)" - - * email address malformed - *
          • - *
          • DATA_REQUIRED "NoteEmailParameters.toAddresses" - - * if there are no To: or Cc: addresses provided. - *
          • - *
          • DATA_REQUIRED "Note.title" - - * if the caller provides a Note parameter with no title - *
          • - *
          • DATA_REQUIRED "Note.content" - - * if the caller provides a Note parameter with no content - *
          • - *
          • ENML_VALIDATION "*" - note content doesn't validate against DTD - *
          • - *
          • DATA_REQUIRED "NoteEmailParameters.note" - - * if no guid or note provided - *
          • - *
          • PERMISSION_DENIED "Note" - private note, user doesn't own - *
          • - *
          - * - * @throws EDAMNotFoundException
            - *
          • "Note.guid" - not found, by GUID - *
          • - *
          - */ - emailNote(parameters: NoteEmailParameters, cb: Callback): void; - - /** - * If this note is not already shared (via its own direct URL), then this - * will start sharing that note. - * This will return the secret "Note Key" for this note that - * can currently be used in conjunction with the Note's GUID to gain direct - * read-only access to the Note. - * If the note is already shared, then this won't make any changes to the - * note, and the existing "Note Key" will be returned. The only way to change - * the Note Key for an existing note is to stopSharingNote first, and then - * call this function. - * - * @param guid - * The GUID of the note to be shared. - * - * @throws EDAMUserException
            - *
          • BAD_DATA_FORMAT "Note.guid" - if the parameter is missing - *
          • - *
          • PERMISSION_DENIED "Note" - private note, user doesn't own - *
          • - *
          - * - * @throws EDAMNotFoundException
            - *
          • "Note.guid" - not found, by GUID - *
          • - *
          - */ - shareNote(guid: string, cb: Callback): void; - - /** - * If this note is not already shared then this will stop sharing that note - * and invalidate its "Note Key", so any existing URLs to access that Note - * will stop working. - * If the Note is not shared, then this function will do nothing. - * - * @param guid - * The GUID of the note to be un-shared. - * - * @throws EDAMUserException
            - *
          • BAD_DATA_FORMAT "Note.guid" - if the parameter is missing - *
          • - *
          • PERMISSION_DENIED "Note" - private note, user doesn't own - *
          • - *
          - * - * @throws EDAMNotFoundException
            - *
          • "Note.guid" - not found, by GUID - *
          • - *
          - */ - stopSharingNote(guid: string, cb: Callback): void; - - /** - * Asks the service to produce an authentication token that can be used to - * access the contents of a single Note which was individually shared - * from someone's account. - * This authenticationToken can be used with the various other NoteStore - * calls to find and retrieve the Note and its directly-referenced children. - * - * @param guid - * The GUID identifying this Note on this shard. - * - * @param noteKey - * The 'noteKey' identifier from the Note that was originally created via - * a call to shareNote() and then given to a recipient to access. - * - * @param authenticationToken - * An optional authenticationToken that identifies the user accessing the - * shared note. This parameter may be required to access some shared notes. - * - * @throws EDAMUserException
            - *
          • PERMISSION_DENIED "Note" - the Note with that GUID is either not - * shared, or the noteKey doesn't match the current key for this note - *
          • - *
          • PERMISSION_DENIED "authenticationToken" - an authentication token is - * required to access this Note, but either no authentication token or a - * "non-owner" authentication token was provided. - *
          • - *
          - * - * @throws EDAMNotFoundException
            - *
          • "guid" - the note with that GUID is not found - *
          • - *
          - * - * @throws EDAMSystemException
            - *
          • TAKEN_DOWN "Note" - The specified shared note is taken down (for - * all requesters). - *
          • - *
          • TAKEN_DOWN "Country" - The specified shared note is taken down - * for the requester because of an IP-based country lookup. - *
          - *
        - */ - authenticateToSharedNote(guid: string, noteKey: string, cb: Callback): void; - - /** - * Identify related entities on the service, such as notes, - * notebooks, and tags related to notes or content. - * - * @param query - * The information about which we are finding related entities. - * - * @param resultSpec - * Allows the client to indicate the type and quantity of - * information to be returned, allowing a saving of time and - * bandwidth. - * - * @return - * The result of the query, with information considered - * to likely be relevantly related to the information - * described by the query. - * - * @throws EDAMUserException
          - *
        • BAD_DATA_FORMAT "RelatedQuery.plainText" - If you provided a - * a zero-length plain text value. - *
        • - *
        • BAD_DATA_FORMAT "RelatedQuery.noteGuid" - If you provided an - * invalid Note GUID, that is, one that does not match the constraints - * defined by EDAM_GUID_LEN_MIN, EDAM_GUID_LEN_MAX, EDAM_GUID_REGEX. - *
        • - *
        • BAD_DATA_FORMAT "NoteFilter.notebookGuid" - if malformed - *
        • - *
        • BAD_DATA_FORMAT "NoteFilter.tagGuids" - if any are malformed - *
        • - *
        • BAD_DATA_FORMAT "NoteFilter.words" - if search string too long - *
        • - *
        • PERMISSION_DENIED "Note" - If the caller does not have access to - * the note identified by RelatedQuery.noteGuid. - *
        • - *
        • DATA_REQUIRED "RelatedResultSpec" - If you did not not set any values - * in the result spec. - *
        • - *
        - * - * @throws EDAMNotFoundException
          - *
        • "RelatedQuery.noteGuid" - the note with that GUID is not - * found, if that field has been set in the query. - *
        • - *
        - */ - findRelated(query: RelatedQuery, resultSpec: RelatedResultSpec, cb: Callback): void; - } - /** - * This structure encapsulates the information about the state of the - * user's account for the purpose of "state based" synchronization. - *
        - *
        currentTime
        - *
        - * The server's current date and time. - *
        - * - *
        fullSyncBefore
        - *
        - * The cutoff date and time for client caches to be - * updated via incremental synchronization. Any clients that were last - * synched with the server before this date/time must do a full resync of all - * objects. This cutoff point will change over time as archival data is - * deleted or special circumstances on the service require resynchronization. - *
        - * - *
        updateCount
        - *
        - * Indicates the total number of transactions that have - * been committed within the account. This reflects (for example) the - * number of discrete additions or modifications that have been made to - * the data in this account (tags, notes, resources, etc.). - * This number is the "high water mark" for Update Sequence Numbers (USN) - * within the account. - *
        - * - *
        uploaded
        - *
        - * The total number of bytes that have been uploaded to - * this account in the current monthly period. This can be compared against - * Accounting.uploadLimit (from the UserStore) to determine how close the user - * is to their monthly upload limit. - * This value may not be present if the SyncState has been retrieved by - * a caller that only has read access to the account. - *
        - *
        - */ - class SyncState { - currentTime: number; - fullSyncBefore: number; - updateCount: number; - uploaded: number; - - constructor(args?: { currentTime: number; fullSyncBefore: number; updateCount: number; uploaded?: number; }); - } - - /** - * This structure is given out by the NoteStore when a client asks to - * receive the current state of an account. The client asks for the server's - * state one chunk at a time in order to allow clients to retrieve the state - * of a large account without needing to transfer the entire account in - * a single message. - * - * The server always gives SyncChunks using an ascending series of Update - * Sequence Numbers (USNs). - * - *
        - *
        currentTime
        - *
        - * The server's current date and time. - *
        - * - *
        chunkHighUSN
        - *
        - * The highest USN for any of the data objects represented - * in this sync chunk. If there are no objects in the chunk, this will not be - * set. - *
        - * - *
        updateCount
        - *
        - * The total number of updates that have been performed in - * the service for this account. This is equal to the highest USN within the - * account at the point that this SyncChunk was generated. If updateCount - * and chunkHighUSN are identical, that means that this is the last chunk - * in the account ... there is no more recent information. - *
        - * - *
        notes
        - *
        - * If present, this is a list of non-expunged notes that - * have a USN in this chunk. This will include notes that are "deleted" - * but not expunged (i.e. in the trash). The notes will include their list - * of tags and resources, but the note content, resource content, resource - * recognition data and resource alternate data will not be supplied. - *
        - * - *
        notebooks
        - *
        - * If present, this is a list of non-expunged notebooks that - * have a USN in this chunk. This will include notebooks that are "deleted" - * but not expunged (i.e. in the trash). - *
        - * - *
        tags
        - *
        - * If present, this is a list of the non-expunged tags that have a - * USN in this chunk. - *
        - * - *
        searches
        - *
        - * If present, this is a list of non-expunged searches that - * have a USN in this chunk. - *
        - * - *
        resources
        - *
        - * If present, this is a list of the non-expunged resources - * that have a USN in this chunk. This will include the metadata for each - * resource, but not its binary contents or recognition data, which must be - * retrieved separately. - *
        - * - *
        expungedNotes
        - *
        - * If present, the GUIDs of all of the notes that were - * permanently expunged in this chunk. - *
        - * - *
        expungedNotebooks
        - *
        - * If present, the GUIDs of all of the notebooks that - * were permanently expunged in this chunk. When a notebook is expunged, - * this implies that all of its child notes (and their resources) were - * also expunged. - *
        - * - *
        expungedTags
        - *
        - * If present, the GUIDs of all of the tags that were - * permanently expunged in this chunk. - *
        - * - *
        expungedSearches
        - *
        - * If present, the GUIDs of all of the saved searches - * that were permanently expunged in this chunk. - *
        - * - *
        linkedNotebooks
        - *
        - * If present, this is a list of non-expunged LinkedNotebooks that - * have a USN in this chunk. - *
        - * - *
        expungedLinkedNotebooks
        - *
        - * If present, the GUIDs of all of the LinkedNotebooks - * that were permanently expunged in this chunk. - *
        - *
        - */ - class SyncChunk { - currentTime: number; - chunkHighUSN: number; - updateCount: number; - notes: Note[]; - notebooks: Notebook[]; - tags: Tag[]; - searches: SavedSearch[]; - resources: Resource[]; - expungedNotes: string[]; - expungedNotebooks: string[]; - expungedTags: string[]; - expungedSearches: string[]; - linkedNotebooks: LinkedNotebook[]; - expungedLinkedNotebooks: string[]; - - constructor(args?: { currentTime: number; chunkHighUSN?: number; updateCount: number; notes?: Note[]; notebooks?: Notebook[]; tags?: Tag[]; searches?: SavedSearch[]; resources?: Resource[]; expungedNotes?: string[]; expungedNotebooks?: string[]; expungedTags?: string[]; expungedSearches?: string[]; linkedNotebooks?: LinkedNotebook[]; expungedLinkedNotebooks?: string[]; }); - } - - /** - * This structure is used with the 'getFilteredSyncChunk' call to provide - * fine-grained control over the data that's returned when a client needs - * to synchronize with the service. Each flag in this structure specifies - * whether to include one class of data in the results of that call. - * - *
        - *
        includeNotes
        - *
        - * If true, then the server will include the SyncChunks.notes field - *
        - * - *
        includeNoteResources
        - *
        - * If true, then the server will include the 'resources' field on all of - * the Notes that are in SyncChunk.notes. - * If 'includeNotes' is false, then this will have no effect. - *
        - * - *
        includeNoteAttributes
        - *
        - * If true, then the server will include the 'attributes' field on all of - * the Notes that are in SyncChunks.notes. - * If 'includeNotes' is false, then this will have no effect. - *
        - * - *
        includeNotebooks
        - *
        - * If true, then the server will include the SyncChunks.notebooks field - *
        - * - *
        includeTags
        - *
        - * If true, then the server will include the SyncChunks.tags field - *
        - * - *
        includeSearches
        - *
        - * If true, then the server will include the SyncChunks.searches field - *
        - * - *
        includeResources
        - *
        - * If true, then the server will include the SyncChunks.resources field. - * Since the Resources are also provided with their Note - * (in the Notes.resources list), this is primarily useful for clients that - * want to watch for changes to individual Resources due to recognition data - * being added. - *
        - * - *
        includeLinkedNotebooks
        - *
        - * If true, then the server will include the SyncChunks.linkedNotebooks field. - *
        - * - *
        includeExpunged
        - *
        - * If true, then the server will include the 'expunged' data for any type - * of included data. For example, if 'includeTags' and 'includeExpunged' - * are both true, then the SyncChunks.expungedTags field will be set with - * the GUIDs of tags that have been expunged from the server. - *
        - * - *
        includeNoteApplicationDataFullMap
        - *
        - * If true, then the values for the applicationData map will be filled - * in, assuming notes and note attributes are being returned. Otherwise, - * only the keysOnly field will be filled in. - *
        - * - *
        includeResourceApplicationDataFullMap
        - *
        - * If true, then the fullMap values for the applicationData map will be - * filled in, assuming resources and resource attributes are being returned - * (includeResources is true). Otherwise, only the keysOnly field will be - * filled in. - *
        - * - *
        includeNoteResourceApplicationDataFullMap
        - *
        - * If true, then the fullMap values for the applicationData map will be - * filled in for resources found inside of notes, assuming resources are - * being returned in notes (includeNoteResources is true). Otherwise, - * only the keysOnly field will be filled in. - *
        - * - *
        requireNoteContentClass
        - *
        - * If set, then only send notes whose content class matches this value. - * The value can be a literal match or, if the last character is an - * asterisk, a prefix match. - *
        - *
        - */ - class SyncChunkFilter { - includeNotes: boolean; - includeNoteResources: boolean; - includeNoteAttributes: boolean; - includeNotebooks: boolean; - includeTags: boolean; - includeSearches: boolean; - includeResources: boolean; - includeLinkedNotebooks: boolean; - includeExpunged: boolean; - includeNoteApplicationDataFullMap: boolean; - includeResourceApplicationDataFullMap: boolean; - includeNoteResourceApplicationDataFullMap: boolean; - requireNoteContentClass: string; - - constructor(args?: { includeNotes?: boolean; includeNoteResources?: boolean; includeNoteAttributes?: boolean; includeNotebooks?: boolean; includeTags?: boolean; includeSearches?: boolean; includeResources?: boolean; includeLinkedNotebooks?: boolean; includeExpunged?: boolean; includeNoteApplicationDataFullMap?: boolean; includeResourceApplicationDataFullMap?: boolean; includeNoteResourceApplicationDataFullMap?: boolean; requireNoteContentClass?: string; }); - } - - /** - * A list of criteria that are used to indicate which notes are desired from - * the account. This is used in queries to the NoteStore to determine - * which notes should be retrieved. - * - *
        - *
        order
        - *
        - * The NoteSortOrder value indicating what criterion should be - * used to sort the results of the filter. - *
        - * - *
        ascending
        - *
        - * If true, the results will be ascending in the requested - * sort order. If false, the results will be descending. - *
        - * - *
        words
        - *
        - * If present, a search query string that will filter the set of notes to be returned. - * Accepts the full search grammar documented in the Evernote API Overview. - *
        - * - *
        notebookGuid
        - *
        - * If present, the Guid of the notebook that must contain - * the notes. - *
        - * - *
        tagGuids
        - *
        - * If present, the list of tags (by GUID) that must be present - * on the notes. - *
        - * - *
        timeZone
        - *
        - * The zone ID for the user, which will be used to interpret - * any dates or times in the queries that do not include their desired zone - * information. - * For example, if a query requests notes created "yesterday", this - * will be evaluated from the provided time zone, if provided. - * The format must be encoded as a standard zone ID such as - * "America/Los_Angeles". - *
        - * - *
        inactive
        - *
        - * If true, then only notes that are not active (i.e. notes in - * the Trash) will be returned. Otherwise, only active notes will be returned. - * There is no way to find both active and inactive notes in a single query. - *
        - * - *
        emphasized
        - *
        - * If present, a search query string that may or may not influence the notes - * to be returned, both in terms of coverage as well as of order. Think of it - * as a wish list, not a requirement. - * Accepts the full search grammar documented in the Evernote API Overview. - *
        - *
        - */ - class NoteFilter { - order: number; - ascending: boolean; - words: string; - notebookGuid: string; - tagGuids: string[]; - timeZone: string; - inactive: boolean; - emphasized: string; - - constructor(args?: { order?: number; ascending?: boolean; words?: string; notebookGuid?: string; tagGuids?: string[]; timeZone?: string; inactive?: boolean; emphasized?: string; }); - } - - /** - * A small structure for returning a list of notes out of a larger set. - * - *
        - *
        startIndex
        - *
        - * The starting index within the overall set of notes. This - * is also the number of notes that are "before" this list in the set. - *
        - * - *
        totalNotes
        - *
        - * The number of notes in the larger set. This can be used - * to calculate how many notes are "after" this note in the set. - * (I.e. remaining = totalNotes - (startIndex + notes.length) ) - *
        - * - *
        notes
        - *
        - * The list of notes from this range. The Notes will include all - * metadata (attributes, resources, etc.), but will not include the ENML - * content of the note or the binary contents of any resources. - *
        - * - *
        stoppedWords
        - *
        - * If the NoteList was produced using a text based search - * query that included words that are not indexed or searched by the service, - * this will include a list of those ignored words. - *
        - * - *
        searchedWords
        - *
        - * If the NoteList was produced using a text based search - * query that included viable search words or quoted expressions, this will - * include a list of those words. Any stopped words will not be included - * in this list. - *
        - * - *
        updateCount
        - *
        - * Indicates the total number of transactions that have - * been committed within the account. This reflects (for example) the - * number of discrete additions or modifications that have been made to - * the data in this account (tags, notes, resources, etc.). - * This number is the "high water mark" for Update Sequence Numbers (USN) - * within the account. - *
        - *
        - */ - class NoteList { - startIndex: number; - totalNotes: number; - notes: Note[]; - stoppedWords: string[]; - searchedWords: string[]; - updateCount: number; - - constructor(args?: { startIndex: number; totalNotes: number; notes: Note[]; stoppedWords?: string[]; searchedWords?: string[]; updateCount?: number; }); - } - - /** - * This structure is used in the set of results returned by the - * findNotesMetadata function. It represents the high-level information about - * a single Note, without some of the larger deep structure. This allows - * for the information about a list of Notes to be returned relatively quickly - * with less marshalling and data transfer to remote clients. - * Most fields in this structure are identical to the corresponding field in - * the Note structure, with the exception of: - * - *
        - *
        largestResourceMime
        - *
        If set, then this will contain the MIME type of the largest Resource - * (in bytes) within the Note. This may be useful, for example, to choose - * an appropriate icon or thumbnail to represent the Note. - *
        - * - *
        largestResourceSize
        - *
        If set, this will contain the size of the largest Resource file, in - * bytes, within the Note. This may be useful, for example, to decide whether - * to ask the server for a thumbnail to represent the Note. - *
        - *
        - */ - class NoteMetadata { - guid: string; - title: string; - contentLength: number; - created: number; - updated: number; - deleted: number; - updateSequenceNum: number; - notebookGuid: string; - tagGuids: string[]; - attributes: NoteAttributes; - largestResourceMime: string; - largestResourceSize: number; - - constructor(args?: { guid: string; title?: string; contentLength?: number; created?: number; updated?: number; deleted?: number; updateSequenceNum?: number; notebookGuid?: string; tagGuids?: string[]; attributes?: NoteAttributes; largestResourceMime?: string; largestResourceSize?: number; }); - } - - /** - * This structure is returned from calls to the findNotesMetadata function to - * give the high-level metadata about a subset of Notes that are found to - * match a specified NoteFilter in a search. - * - *
        - *
        startIndex
        - *
        - * The starting index within the overall set of notes. This - * is also the number of notes that are "before" this list in the set. - *
        - * - *
        totalNotes
        - *
        - * The number of notes in the larger set. This can be used - * to calculate how many notes are "after" this note in the set. - * (I.e. remaining = totalNotes - (startIndex + notes.length) ) - *
        - * - *
        notes
        - *
        - * The list of metadata for Notes in this range. The set of optional fields - * that are set in each metadata structure will depend on the - * NotesMetadataResultSpec provided by the caller when the search was - * performed. Only the 'guid' field will be guaranteed to be set in each - * Note. - *
        - * - *
        stoppedWords
        - *
        - * If the NoteList was produced using a text based search - * query that included words that are not indexed or searched by the service, - * this will include a list of those ignored words. - *
        - * - *
        searchedWords
        - *
        - * If the NoteList was produced using a text based search - * query that included viable search words or quoted expressions, this will - * include a list of those words. Any stopped words will not be included - * in this list. - *
        - * - *
        updateCount
        - *
        - * Indicates the total number of transactions that have - * been committed within the account. This reflects (for example) the - * number of discrete additions or modifications that have been made to - * the data in this account (tags, notes, resources, etc.). - * This number is the "high water mark" for Update Sequence Numbers (USN) - * within the account. - *
        - *
        - */ - class NotesMetadataList { - startIndex: number; - totalNotes: number; - notes: NoteMetadata[]; - stoppedWords: string[]; - searchedWords: string[]; - updateCount: number; - - constructor(args?: { startIndex: number; totalNotes: number; notes: NoteMetadata[]; stoppedWords?: string[]; searchedWords?: string[]; updateCount?: number; }); - } - - /** - * This structure is provided to the findNotesMetadata function to specify - * the subset of fields that should be included in each NoteMetadata element - * that is returned in the NotesMetadataList. - * Each field on this structure is a boolean flag that indicates whether the - * corresponding field should be included in the NoteMetadata structure when - * it is returned. For example, if the 'includeTitle' field is set on this - * structure when calling findNotesMetadata, then each NoteMetadata in the - * list should have its 'title' field set. - * If one of the fields in this spec is not set, then it will be treated as - * 'false' by the server, so the default behavior is to include nothing in - * replies (but the mandatory GUID) - */ - class NotesMetadataResultSpec { - includeTitle: boolean; - includeContentLength: boolean; - includeCreated: boolean; - includeUpdated: boolean; - includeDeleted: boolean; - includeUpdateSequenceNum: boolean; - includeNotebookGuid: boolean; - includeTagGuids: boolean; - includeAttributes: boolean; - includeLargestResourceMime: boolean; - includeLargestResourceSize: boolean; - - constructor(args?: { includeTitle?: boolean; includeContentLength?: boolean; includeCreated?: boolean; includeUpdated?: boolean; includeDeleted?: boolean; includeUpdateSequenceNum?: boolean; includeNotebookGuid?: boolean; includeTagGuids?: boolean; includeAttributes?: boolean; includeLargestResourceMime?: boolean; includeLargestResourceSize?: boolean; }); - } - - /** - * A data structure representing the number of notes for each notebook - * and tag with a non-zero set of applicable notes. - * - *
        - *
        notebookCounts
        - *
        - * A mapping from the Notebook GUID to the number of - * notes (from some selection) that are in the corresponding notebook. - *
        - * - *
        tagCounts
        - *
        - * A mapping from the Tag GUID to the number of notes (from some - * selection) that have the corresponding tag. - *
        - * - *
        trashCount
        - *
        - * If this is set, then this is the number of notes that are in the trash. - * If this is not set, then the number of notes in the trash hasn't been - * reported. (I.e. if there are no notes in the trash, this will be set - * to 0.) - *
        - *
        - */ - class NoteCollectionCounts { - notebookCounts: { [k: string]: number; }; - tagCounts: { [k: string]: number; }; - trashCount: number; - - constructor(args?: { notebookCounts?: { [k: string]: number; }; tagCounts?: { [k: string]: number; }; trashCount?: number; }); - } - - /** - * Parameters that must be given to the NoteStore emailNote call. These allow - * the caller to specify the note to send, the recipient addresses, etc. - * - *
        - *
        guid
        - *
        - * If set, this must be the GUID of a note within the user's account that - * should be retrieved from the service and sent as email. If not set, - * the 'note' field must be provided instead. - *
        - * - *
        note
        - *
        - * If the 'guid' field is not set, this field must be provided, including - * the full contents of the note note (and all of its Resources) to send. - * This can be used for a Note that as not been created in the service, - * for example by a local client with local notes. - *
        - * - *
        toAddresses
        - *
        - * If provided, this should contain a list of the SMTP email addresses - * that should be included in the "To:" line of the email. - * Callers must specify at least one "to" or "cc" email address. - *
        - * - *
        ccAddresses
        - *
        - * If provided, this should contain a list of the SMTP email addresses - * that should be included in the "Cc:" line of the email. - * Callers must specify at least one "to" or "cc" email address. - *
        - * - *
        subject
        - *
        - * If provided, this should contain the subject line of the email that - * will be sent. If not provided, the title of the note will be used - * as the subject of the email. - *
        - * - *
        message
        - *
        - * If provided, this is additional personal text that should be included - * into the email as a message from the owner to the recipient(s). - *
        - *
        - */ - class NoteEmailParameters { - guid: string; - note: Note; - toAddresses: string[]; - ccAddresses: string[]; - subject: string; - message: string; - - constructor(args?: { guid?: string; note?: Note; toAddresses?: string[]; ccAddresses?: string[]; subject?: string; message?: string; }); - } - - /** - * Identifying information about previous versions of a note that are backed up - * within Evernote's servers. Used in the return value of the listNoteVersions - * call. - * - *
        - *
        updateSequenceNum
        - *
        - * The update sequence number for the Note when it last had this content. - * This serves to uniquely identify each version of the note, since USN - * values are unique within an account for each update. - *
        - *
        updated
        - *
        - * The 'updated' time that was set on the Note when it had this version - * of the content. This is the user-modifiable modification time on the - * note, so it's not reliable for guaranteeing the order of various - * versions. (E.g. if someone modifies the note, then changes this time - * manually into the past and then updates the note again.) - *
        - *
        saved
        - *
        - * A timestamp that holds the date and time when this version of the note - * was backed up by Evernote's servers. This - *
        - *
        title
        - *
        - * The title of the note when this particular version was saved. (The - * current title of the note may differ from this value.) - *
        - *
        - */ - class NoteVersionId { - updateSequenceNum: number; - updated: number; - saved: number; - title: string; - - constructor(args?: { updateSequenceNum: number; updated: number; saved: number; title: string; }); - } - - /** - * This structure is passed from clients to the Evernote service when they wish - * to relay coarse-grained usage metrics to the service to help improve - * products. - * - *
        - *
        sessions
        - *
        - * This field contains a count of the number of usage "sessions" that have - * occurred with this client which have not previously been reported to - * the service. - * A "session" is defined as one of the 96 fifteen-minute intervals of the - * day when someone used Evernote's interface at least once. - * So if a user interacts with an Evernote client at 12:18, 12:24, and 12:36, - * and then the client synchronizes at 12:39, it would report that there were - * two previously-unreported sessions (one session for the 12:15-12:30 time - * period, and one for the 12:30-12:45 period). - * If the user used Evernote again at 12:41 and synchronized at 12:43, it - * would not report any new sessions, because the 12:30-12:45 session had - * already been reported. - *
        - *
        - */ - class ClientUsageMetrics { - sessions: number; - - constructor(args?: { sessions?: number; }); - } - - /** - * A description of the thing for which we are searching for related - * entities. - * - * You must specify either noteGuid or plainText, but - * not both. filter and referenceUri are optional. - * - *
        - *
        noteGuid
        - *
        The GUID of an existing note in your account for which related - * entities will be found.
        - * - *
        plainText
        - *
        A string of plain text for which to find related entities. - * You should provide a text block with a number of characters between - * EDAM_RELATED_PLAINTEXT_LEN_MIN and EDAM_RELATED_PLAINTEXT_LEN_MAX. - *
        - * - *
        filter
        - *
        The list of criteria that will constrain the notes being considered - * related. - * Please note that some of the parameters may be ignored, such as - * order and ascending. - *
        - * - *
        referenceUri
        - *
        A URI string specifying a reference entity, around which "relatedness" - * should be based. This can be an URL pointing to a web page, for example. - *
        - *
        - */ - class RelatedQuery { - noteGuid: string; - plainText: string; - filter: NoteFilter; - referenceUri: string; - - constructor(args?: { noteGuid?: string; plainText?: string; filter?: NoteFilter; referenceUri?: string; }); - } - - /** - * The result of calling findRelated(). The contents of the notes, - * notebooks, and tags fields will be in decreasing order of expected - * relevance. It is possible that fewer results than requested will be - * returned even if there are enough distinct entities in the account - * in cases where the relevance is estimated to be low. - * - *
        - *
        notes
        - *
        If notes have been requested to be included, this will be the - * list of notes.
        - * - *
        notebooks
        - *
        If notebooks have been requested to be included, this will be the - * list of notebooks.
        - * - *
        tags
        - *
        If tags have been requested to be included, this will be the list - * of tags.
        - *
        - * - *
        containingNotebooks
        - *
        If includeContainingNotebooks is set to true - * in the RelatedResultSpec, return the list of notebooks to - * to which the returned related notes belong. The notebooks in this - * list will occur once per notebook GUID and are represented as - * NotebookDescriptor objects.
        - * - * - */ - class RelatedResult { - notes: Note[]; - notebooks: Notebook[]; - tags: Tag[]; - containingNotebooks: NotebookDescriptor[]; - - constructor(args?: { notes?: Note[]; notebooks?: Notebook[]; tags?: Tag[]; containingNotebooks?: NotebookDescriptor[]; }); - } - - /** - * A description of the thing for which the service will find related - * entities, via findRelated(), together with a description of what - * type of entities and how many you are seeking in the - * RelatedResult. - * - *
        - *
        maxNotes
        - *
        Return notes that are related to the query, but no more than - * this many. Any value greater than EDAM_RELATED_MAX_NOTES - * will be silently capped. If you do not set this field, then - * no notes will be returned.
        - * - *
        maxNotebooks
        - *
        Return notebooks that are related to the query, but no more than - * this many. Any value greater than EDAM_RELATED_MAX_NOTEBOOKS - * will be silently capped. If you do not set this field, then - * no notebooks will be returned.
        - * - *
        maxTags
        - *
        Return tags that are related to the query, but no more than - * this many. Any value greater than EDAM_RELATED_MAX_TAGS - * will be silently capped. If you do not set this field, then - * no tags will be returned.
        - *
        - * - *
        writableNotebooksOnly
        - *
        Require that all returned related notebooks are writable. - * The user will be able to create notes in all returned notebooks. - * However, individual notes returned may still belong to notebooks - * in which the user lacks the ability to create notes.
        - * - * - *
        includeContainingNotebooks
        - *
        If set to true, return the containingNotebooks field - * in the RelatedResult, which will contain the list of notebooks to - * to which the returned related notes belong.
        - * - * - */ - class RelatedResultSpec { - maxNotes: number; - maxNotebooks: number; - maxTags: number; - writableNotebooksOnly: boolean; - includeContainingNotebooks: boolean; - - constructor(args?: { maxNotes?: number; maxNotebooks?: number; maxTags?: number; writableNotebooksOnly?: boolean; includeContainingNotebooks?: boolean; }); - } - /** - * This enumeration defines the possible permission levels for a user. - * Free accounts will have a level of NORMAL and paid Premium accounts - * will have a level of PREMIUM. - */ - enum PrivilegeLevel { - 'NORMAL' = 1, - 'PREMIUM' = 3, - 'VIP' = 5, - 'MANAGER' = 7, - 'SUPPORT' = 8, - 'ADMIN' = 9, - } - - /** - * Every search query is specified as a sequence of characters. - * Currently, only the USER query format is supported. - */ - enum QueryFormat { - 'USER' = 1, - 'SEXP' = 2, - } - - /** - * This enumeration defines the possible sort ordering for notes when - * they are returned from a search result. - */ - enum NoteSortOrder { - 'CREATED' = 1, - 'UPDATED' = 2, - 'RELEVANCE' = 3, - 'UPDATE_SEQUENCE_NUMBER' = 4, - 'TITLE' = 5, - } - - /** - * This enumeration defines the possible states of a premium account - * - * NONE: the user has never attempted to become a premium subscriber - * - * PENDING: the user has requested a premium account but their charge has not - * been confirmed - * - * ACTIVE: the user has been charged and their premium account is in good - * standing - * - * FAILED: the system attempted to charge the was denied. Their premium - * privileges have been revoked. We will periodically attempt to re-validate - * their order. - * - * CANCELLATION_PENDING: the user has requested that no further charges be made - * but the current account is still active. - * - * CANCELED: the premium account was canceled either because of failure to pay - * or user cancelation. No more attempts will be made to activate the account. - */ - enum PremiumOrderStatus { - 'NONE' = 0, - 'PENDING' = 1, - 'ACTIVE' = 2, - 'FAILED' = 3, - 'CANCELLATION_PENDING' = 4, - 'CANCELED' = 5, - } - - /** - * Privilege levels for accessing shared notebooks. - * - * READ_NOTEBOOK: Recipient is able to read the contents of the shared notebook - * but does to have access to information about other recipients of the - * notebook or the activity stream information. - * - * MODIFY_NOTEBOOK_PLUS_ACTIVITY: Recipient has rights to read and modify the contents - * of the shared notebook, including the right to move notes to the trash and to create - * notes in the notebook. The recipient can also access information about other - * recipients and the activity stream. - * - * READ_NOTEBOOK_PLUS_ACTIVITY: Recipient has READ_NOTEBOOK rights and can also - * access information about other recipients and the activity stream. - * - * GROUP: If the user belongs to a group, such as a Business, that has a defined - * privilege level, use the privilege level of the group as the privilege for - * the individual. - * - * FULL_ACCESS: Recipient has full rights to the shared notebook and recipient lists, - * including privilege to revoke and create invitations and to change privilege - * levels on invitations for individuals. This privilege level is primarily intended - * for use by individual shares. - * - * BUSINESS_FULL_ACCESS: Intended for use with Business Notebooks, a - * BUSINESS_FULL_ACCESS level is FULL_ACCESS with the additional rights to - * change how the notebook will appear in the business library, including the - * rights to publish and unpublish the notebook from the library. - */ - enum SharedNotebookPrivilegeLevel { - 'READ_NOTEBOOK' = 0, - 'MODIFY_NOTEBOOK_PLUS_ACTIVITY' = 1, - 'READ_NOTEBOOK_PLUS_ACTIVITY' = 2, - 'GROUP' = 3, - 'FULL_ACCESS' = 4, - 'BUSINESS_FULL_ACCESS' = 5, - } - - /** - * Enumeration of the roles that a User can have within a sponsored group. - * - * GROUP_MEMBER: The user is a member of the group with no special privileges. - * - * GROUP_ADMIN: The user is an administrator within the group. - * - * GROUP_OWNER: The user is the owner of the group. - */ - enum SponsoredGroupRole { - 'GROUP_MEMBER' = 1, - 'GROUP_ADMIN' = 2, - 'GROUP_OWNER' = 3, - } - - /** - * Enumeration of the roles that a User can have within an Evernote Business account. - * - * ADMIN: The user is an administrator of the Evernote Business account. - * - * NORMAL: The user is a regular user within the Evernote Business account. - */ - enum BusinessUserRole { - 'ADMIN' = 1, - 'NORMAL' = 2, - } - - /** - * An enumeration describing restrictions on the domain of shared notebook - * instances that are valid for a given operation, as used, for example, in - * NotebookRestrictions. - * - * ONLY_JOINED_OR_PREVIEW: The domain consists of shared notebooks that - * "belong" to the recipient or still available for preview by any recipient. - * Shared notebooks that the recipient has joined (the username has already been - * assigned to our user) are in the domain. Additionally, shared notebooks - * that allow preview and have not yet been joined are in the domain. - * - * NO_SHARED_NOTEBOOKS: No shared notebooks are applicable to the operation. - */ - enum SharedNotebookInstanceRestrictions { - 'ONLY_JOINED_OR_PREVIEW' = 1, - 'NO_SHARED_NOTEBOOKS' = 2, - } - - /** - * An enumeration describing the configuration state related to receiving - * reminder e-mails from the service. Reminder e-mails summarize notes - * based on their Note.attributes.reminderTime values. - * - * DO_NOT_SEND: The user has selected to not receive reminder e-mail. - * - * SEND_DAILY_EMAIL: The user has selected to receive reminder e-mail for those - * days when there is a reminder. - */ - enum ReminderEmailConfig { - 'DO_NOT_SEND' = 1, - 'SEND_DAILY_EMAIL' = 2, - } - - /** - * In several places, EDAM exchanges blocks of bytes of data for a component - * which may be relatively large. For example: the contents of a clipped - * HTML note, the bytes of an embedded image, or the recognition XML for - * a large image. This structure is used in the protocol to represent - * any of those large blocks of data when they are transmitted or when - * they are only referenced their metadata. - * - *
        - *
        bodyHash
        - *
        This field carries a one-way hash of the contents of the - * data body, in binary form. The hash function is MD5
        - * Length: EDAM_HASH_LEN (exactly) - *
        - * - *
        size
        - *
        The length, in bytes, of the data body. - *
        - * - *
        body
        - *
        This field is set to contain the binary contents of the data - * whenever the resource is being transferred. If only metadata is - * being exchanged, this field will be empty. For example, a client could - * notify the service about the change to an attribute for a resource - * without transmitting the binary resource contents. - *
        - *
        - */ - class Data { - bodyHash: string; - size: number; - body: string; - - constructor(args?: { bodyHash?: string; size?: number; body?: string; }); - } - - /** - * A structure holding the optional attributes that can be stored - * on a User. These are generally less critical than the core User fields. - * - *
        - *
        defaultLocationName
        - *
        the location string that should be associated - * with the user in order to determine where notes are taken if not otherwise - * specified.
        - * Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX - *
        - * - *
        defaultLatitude
        - *
        if set, this is the latitude that should be - * assigned to any notes that have no other latitude information. - *
        - * - *
        defaultLongitude
        - *
        if set, this is the longitude that should be - * assigned to any notes that have no other longitude information. - *
        - * - *
        preactivation
        - *
        if set, the user account is not yet confirmed for - * login. I.e. the account has been created, but we are still waiting for - * the user to complete the activation step. - *
        - * - *
        viewedPromotions
        - *
        a list of promotions the user has seen. - * This list may occasionally be modified by the system when promotions are - * no longer available.
        - * Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX - *
        - * - *
        incomingEmailAddress
        - *
        if set, this is the email address that the - * user may send email to in order to add an email note directly into the - * account via the SMTP email gateway. This is the part of the email - * address before the '@' symbol ... our domain is not included. - * If this is not set, the user may not add notes via the gateway.
        - * Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX - *
        - * - *
        recentMailedAddresses
        - *
        if set, this will contain a list of email - * addresses that have recently been used as recipients - * of outbound emails by the user. This can be used to pre-populate a - * list of possible destinations when a user wishes to send a note via - * email.
        - * Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX each
        - * Max: EDAM_USER_RECENT_MAILED_ADDRESSES_MAX entries - *
        - * - *
        comments
        - *
        Free-form text field that may hold general support - * information, etc.
        - * Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX - *
        - * - *
        dateAgreedToTermsOfService
        - *
        The date/time when the user agreed to - * the terms of service. This can be used as the effective "start date" - * for the account. - *
        - * - *
        maxReferrals
        - *
        The number of referrals that the user is permitted - * to make. - *
        - * - *
        referralCount
        - *
        The number of referrals sent from this account. - *
        - * - *
        refererCode
        - *
        A code indicating where the user was sent from. AKA - * promotion code - *
        - * - *
        sentEmailDate
        - *
        The most recent date when the user sent outbound - * emails from the service. Used with sentEmailCount to limit the number - * of emails that can be sent per day. - *
        - * - *
        sentEmailCount
        - *
        The number of emails that were sent from the user - * via the service on sentEmailDate. Used to enforce a limit on the number - * of emails per user per day to prevent spamming. - *
        - * - *
        dailyEmailLimit
        - *
        If set, this is the maximum number of emails that - * may be sent in a given day from this account. If unset, the server will - * use the configured default limit. - *
        - * - *
        emailOptOutDate
        - *
        If set, this is the date when the user asked - * to be excluded from offers and promotions sent by Evernote. If not set, - * then the user currently agrees to receive these messages. - *
        - * - *
        partnerEmailOptInDate
        - *
        If set, this is the date when the user asked - * to be included in offers and promotions sent by Evernote's partners. - * If not sent, then the user currently does not agree to receive these - * emails. - *
        - * - *
        preferredLanguage
        - *
        a 2 character language codes based on: - * http://ftp.ics.uci.edu/pub/ietf/http/related/iso639.txt used for - * localization purposes to determine what language to use for the web - * interface and for other direct communication (e.g. emails). - *
        - * - *
        preferredCountry
        - *
        Preferred country code based on ISO 3166-1-alpha-2 indicating the - * users preferred country
        - * - *
        clipFullPage
        - *
        Boolean flag set to true if the user wants to clip full pages by - * default when they use the web clipper without a selection.
        - * - *
        twitterUserName
        - *
        The username of the account of someone who has chosen to enable - * Twittering into Evernote. This value is subject to change, since users - * may change their Twitter user name.
        - * - *
        twitterId
        - *
        The unique identifier of the user's Twitter account if that user - * has chosen to enable Twittering into Evernote.
        - * - *
        groupName
        - *
        A name identifier used to identify a particular set of branding and - * light customization.
        - * - *
        recognitionLanguage
        - *
        a 2 character language codes based on: - * http://ftp.ics.uci.edu/pub/ietf/http/related/iso639.txt - * If set, this is used to determine the language that should be used - * when processing images and PDF files to find text. - * If not set, then the 'preferredLanguage' will be used. - *
        - * - *
        educationalInstitution
        - *
        a flag indicating that the user is part of an educational institution which - * makes them eligible for discounts on bulk purchases - *
        - * - *
        businessAddress
        - *
        A string recording the business address of a Sponsored Account user who has requested invoicing. - *
        - * - *
        hideSponsorBilling
        - *
        A flag indicating whether to hide the billing information on a sponsored - * account owner's settings page - *
        - * - *
        taxExempt
        - *
        A flag indicating the user's sponsored group is exempt from sale tax - *
        - * - *
        useEmailAutoFiling
        - *
        A flag indicating whether the user chooses to allow Evernote to automatically - * file and tag emailed notes - *
        - * - *
        reminderEmailConfig
        - *
        Configuration state for whether or not the user wishes to receive - * reminder e-mail. This setting applies to both the reminder e-mail sent - * for personal reminder notes and for the reminder e-mail sent for reminder - * notes in the user's business notebooks that the user has configured for - * e-mail notifications. - *
        - *
        - */ - class UserAttributes { - defaultLocationName: string; - defaultLatitude: number; - defaultLongitude: number; - preactivation: boolean; - viewedPromotions: string[]; - incomingEmailAddress: string; - recentMailedAddresses: string[]; - comments: string; - dateAgreedToTermsOfService: number; - maxReferrals: number; - referralCount: number; - refererCode: string; - sentEmailDate: number; - sentEmailCount: number; - dailyEmailLimit: number; - emailOptOutDate: number; - partnerEmailOptInDate: number; - preferredLanguage: string; - preferredCountry: string; - clipFullPage: boolean; - twitterUserName: string; - twitterId: string; - groupName: string; - recognitionLanguage: string; - referralProof: string; - educationalDiscount: boolean; - businessAddress: string; - hideSponsorBilling: boolean; - taxExempt: boolean; - useEmailAutoFiling: boolean; - reminderEmailConfig: ReminderEmailConfig; - - constructor(args?: { defaultLocationName?: string; defaultLatitude?: number; defaultLongitude?: number; preactivation?: boolean; viewedPromotions?: string[]; incomingEmailAddress?: string; recentMailedAddresses?: string[]; comments?: string; dateAgreedToTermsOfService?: number; maxReferrals?: number; referralCount?: number; refererCode?: string; sentEmailDate?: number; sentEmailCount?: number; dailyEmailLimit?: number; emailOptOutDate?: number; partnerEmailOptInDate?: number; preferredLanguage?: string; preferredCountry?: string; clipFullPage?: boolean; twitterUserName?: string; twitterId?: string; groupName?: string; recognitionLanguage?: string; referralProof?: string; educationalDiscount?: boolean; businessAddress?: string; hideSponsorBilling?: boolean; taxExempt?: boolean; useEmailAutoFiling?: boolean; reminderEmailConfig?: ReminderEmailConfig; }); - } - - /** - * This represents the bookkeeping information for the user's subscription. - * - *
        - *
        uploadLimit
        - *
        The number of bytes that can be uploaded to the account - * in the current month. For new notes that are created, this is the length - * of the note content (in Unicode characters) plus the size of each resource - * (in bytes). For edited notes, this is the the difference between the old - * length and the new length (if this is greater than 0) plus the size of - * each new resource. - *
        - *
        uploadLimitEnd
        - *
        The date and time when the current upload limit - * expires. At this time, the monthly upload count reverts to 0 and a new - * limit is imposed. This date and time is exclusive, so this is effectively - * the start of the new month. - *
        - *
        uploadLimitNextMonth
        - *
        When uploadLimitEnd is reached, the service - * will change uploadLimit to uploadLimitNextMonth. If a premium account is - * canceled, this mechanism will reset the quota appropriately. - *
        - *
        premiumServiceStatus
        - *
        Indicates the phases of a premium account - * during the billing process. - *
        - *
        premiumOrderNumber
        - *
        The order number used by the commerce system to - * process recurring payments - *
        - *
        premiumServiceStart
        - *
        The start date when this premium promotion - * began (this number will get overwritten if a premium service is canceled - * and then re-activated). - *
        - *
        premiumCommerceService
        - *
        The commerce system used (paypal, Google - * checkout, etc) - *
        - *
        premiumServiceSKU
        - *
        The code associated with the purchase eg. monthly - * or annual purchase. Clients should interpret this value and localize it. - *
        - *
        lastSuccessfulCharge
        - *
        Date the last time the user was charged. - * Null if never charged. - *
        - *
        lastFailedCharge
        - *
        Date the last time a charge was attempted and - * failed. - *
        - *
        lastFailedChargeReason
        - *
        Reason provided for the charge failure - *
        - *
        nextPaymentDue
        - *
        The end of the billing cycle. This could be in the - * past if there are failed charges. - *
        - *
        premiumLockUntil
        - *
        An internal variable to manage locking operations - * on the commerce variables. - *
        - *
        updated
        - *
        The date any modification where made to this record. - *
        - *
        premiumSubscriptionNumber
        - *
        The number number identifying the - * recurring subscription used to make the recurring charges. - *
        - *
        lastRequestedCharge
        - *
        Date charge last attempted
        - *
        currency
        - *
        ISO 4217 currency code
        - *
        unitPrice
        - *
        charge in the smallest unit of the currency (e.g. cents for USD)
        - *
        businessId
        - *
        DEPRECATED:See BusinessUserInfo.
        - *
        businessName
        - *
        DEPRECATED:See BusinessUserInfo.
        - *
        businessRole
        - *
        DEPRECATED:See BusinessUserInfo.
        - *
        unitDiscount
        - *
        discount per seat in negative amount and smallest unit of the currency (e.g. cents for USD)
        - *
        nextChargeDate
        - *
        The next time the user will be charged, may or may not be the same as nextPaymentDue
        - *
        - */ - class Accounting { - uploadLimit: number; - uploadLimitEnd: number; - uploadLimitNextMonth: number; - premiumServiceStatus: PremiumOrderStatus; - premiumOrderNumber: string; - premiumCommerceService: string; - premiumServiceStart: number; - premiumServiceSKU: string; - lastSuccessfulCharge: number; - lastFailedCharge: number; - lastFailedChargeReason: string; - nextPaymentDue: number; - premiumLockUntil: number; - updated: number; - premiumSubscriptionNumber: string; - lastRequestedCharge: number; - currency: string; - unitPrice: number; - businessId: number; - businessName: string; - businessRole: BusinessUserRole; - unitDiscount: number; - nextChargeDate: number; - - constructor(args?: { uploadLimit?: number; uploadLimitEnd?: number; uploadLimitNextMonth?: number; premiumServiceStatus?: PremiumOrderStatus; premiumOrderNumber?: string; premiumCommerceService?: string; premiumServiceStart?: number; premiumServiceSKU?: string; lastSuccessfulCharge?: number; lastFailedCharge?: number; lastFailedChargeReason?: string; nextPaymentDue?: number; premiumLockUntil?: number; updated?: number; premiumSubscriptionNumber?: string; lastRequestedCharge?: number; currency?: string; unitPrice?: number; businessId?: number; businessName?: string; businessRole?: BusinessUserRole; unitDiscount?: number; nextChargeDate?: number; }); - } - - /** - * This structure is used to provide information about an Evernote Business - * membership, for members who are part of a business. - * - *
        - *
        businessId
        - *
        The ID of the Evernote Business account that the user is a member of. - *
        businessName
        - *
        The human-readable name of the Evernote Business account that the user - * is a member of.
        - *
        role
        - *
        The role of the user within the Evernote Business account that - * they are a member of.
        - *
        email
        - *
        An e-mail address that will be used by the service in the context of your - * Evernote Business activities. For example, this e-mail address will be used - * when you e-mail a business note, when you update notes in the account of - * your business, etc. The business e-mail cannot be used for identification - * purposes such as for logging into the service. - *
        - *
        - */ - class BusinessUserInfo { - businessId: number; - businessName: string; - role: BusinessUserRole; - email: string; - - constructor(args?: { businessId?: number; businessName?: string; role?: BusinessUserRole; email?: string; }); - } - - /** - * This structure is used to provide information about a user's Premium account. - *
        - *
        currentTime
        - *
        - * The server-side date and time when this data was generated. - *
        - *
        premium
        - *
        - * True if the user's account is Premium. - *
        - *
        premiumRecurring
        - *
        - * True if the user's account is Premium and has a recurring payment method. - *
        - *
        premiumExpirationDate
        - *
        - * The date when the user's Premium account expires, or the date when the - * user's account is due for payment if it has a recurring payment method. - *
        - *
        premiumExtendable
        - *
        - * True if the user is eligible for purchasing Premium account extensions. - *
        - *
        premiumPending
        - *
        - * True if the user's Premium account is pending payment confirmation - *
        - *
        premiumCancellationPending
        - *
        - * True if the user has requested that no further charges to be made; the - * Premium account will remain active until it expires. - *
        - *
        canPurchaseUploadAllowance
        - *
        - * True if the user is eligible for purchasing additional upload allowance. - *
        - *
        sponsoredGroupName
        - *
        - * The name of the sponsored group that the user is part of. - *
        - *
        sponsoredGroupRole
        - *
        - * DEPRECATED - will be removed in a future update. - *
        - *
        premiumUpgradable
        - *
        - * True if the user is eligible for purchasing Premium account upgrade. - *
        - *
        - */ - class PremiumInfo { - currentTime: number; - premium: boolean; - premiumRecurring: boolean; - premiumExpirationDate: number; - premiumExtendable: boolean; - premiumPending: boolean; - premiumCancellationPending: boolean; - canPurchaseUploadAllowance: boolean; - sponsoredGroupName: string; - sponsoredGroupRole: SponsoredGroupRole; - premiumUpgradable: boolean; - - constructor(args?: { currentTime: number; premium: boolean; premiumRecurring: boolean; premiumExpirationDate?: number; premiumExtendable: boolean; premiumPending: boolean; premiumCancellationPending: boolean; canPurchaseUploadAllowance: boolean; sponsoredGroupName?: string; sponsoredGroupRole?: SponsoredGroupRole; premiumUpgradable?: boolean; }); - } - - /** - * This represents the information about a single user account. - *
        - *
        id
        - *
        The unique numeric identifier for the account, which will not - * change for the lifetime of the account. - *
        - * - *
        username
        - *
        The name that uniquely identifies a single user account. This name - * may be presented by the user, along with their password, to log into - * their account. - * May only contain a-z, 0-9, or '-', and may not start or end with the '-' - *
        - * Length: EDAM_USER_USERNAME_LEN_MIN - EDAM_USER_USERNAME_LEN_MAX - *
        - * Regex: EDAM_USER_USERNAME_REGEX - *
        - * - *
        email
        - *
        The email address registered for the user. Must comply with - * RFC 2821 and RFC 2822.
        - * Third party applications that authenticate using OAuth do not have - * access to this field. - * Length: EDAM_EMAIL_LEN_MIN - EDAM_EMAIL_LEN_MAX - *
        - * Regex: EDAM_EMAIL_REGEX - *
        - * - *
        name
        - *
        The printable name of the user, which may be a combination - * of given and family names. This is used instead of separate "first" - * and "last" names due to variations in international name format/order. - * May not start or end with a whitespace character. May contain any - * character but carriage return or newline (Unicode classes Zl and Zp). - *
        - * Length: EDAM_USER_NAME_LEN_MIN - EDAM_USER_NAME_LEN_MAX - *
        - * Regex: EDAM_USER_NAME_REGEX - *
        - * - *
        timezone
        - *
        The zone ID for the user's default location. If present, - * this may be used to localize the display of any timestamp for which no - * other timezone is available. - * The format must be encoded as a standard zone ID such as - * "America/Los_Angeles" or "GMT+08:00" - *
        - * Length: EDAM_TIMEZONE_LEN_MIN - EDAM_TIMEZONE_LEN_MAX - *
        - * Regex: EDAM_TIMEZONE_REGEX - *
        - * - *
        privilege
        - *
        The level of access permitted for the user. - *
        - * - *
        created
        - *
        The date and time when this user account was created in the - * service. - *
        - * - *
        updated
        - *
        The date and time when this user account was last modified - * in the service. - *
        - * - *
        deleted
        - *
        If the account has been deleted from the system (e.g. as - * the result of a legal request by the user), the date and time of the - * deletion will be represented here. If not, this value will not be set. - *
        - * - *
        active
        - *
        If the user account is available for login and - * synchronization, this flag will be set to true. - *
        - * - *
        shardId
        - *
        DEPRECATED - Client applications should have no need to use this field. - *
        - * - *
        attributes
        - *
        If present, this will contain a list of the attributes - * for this user account. - *
        - * - *
        accounting
        - *
        Bookkeeping information for the user's subscription. - *
        - * - *
        premiumInfo
        - *
        If present, this will contain a set of commerce information - * relating to the user's premium service level. - *
        - * - *
        businessUserInfo
        - *
        If present, this will contain a set of business information - * relating to the user's business membership. If not present, the - * user is not currently part of a business. - *
        - *
        - */ - class User { - id: number; - username: string; - email: string; - name: string; - timezone: string; - privilege: PrivilegeLevel; - created: number; - updated: number; - deleted: number; - active: boolean; - shardId: string; - attributes: UserAttributes; - accounting: Accounting; - premiumInfo: PremiumInfo; - businessUserInfo: BusinessUserInfo; - - constructor(args?: { id?: number; username?: string; email?: string; name?: string; timezone?: string; privilege?: PrivilegeLevel; created?: number; updated?: number; deleted?: number; active?: boolean; shardId?: string; attributes?: UserAttributes; accounting?: Accounting; premiumInfo?: PremiumInfo; businessUserInfo?: BusinessUserInfo; }); - } - - /** - * A tag within a user's account is a unique name which may be organized - * a simple hierarchy. - *
        - *
        guid
        - *
        The unique identifier of this tag. Will be set by the service, - * so may be omitted by the client when creating the Tag. - *
        - * Length: EDAM_GUID_LEN_MIN - EDAM_GUID_LEN_MAX - *
        - * Regex: EDAM_GUID_REGEX - *
        - * - *
        name
        - *
        A sequence of characters representing the tag's identifier. - * Case is preserved, but is ignored for comparisons. - * This means that an account may only have one tag with a given name, via - * case-insensitive comparison, so an account may not have both "food" and - * "Food" tags. - * May not contain a comma (','), and may not begin or end with a space. - *
        - * Length: EDAM_TAG_NAME_LEN_MIN - EDAM_TAG_NAME_LEN_MAX - *
        - * Regex: EDAM_TAG_NAME_REGEX - *
        - * - *
        parentGuid
        - *
        If this is set, then this is the GUID of the tag that - * holds this tag within the tag organizational hierarchy. If this is - * not set, then the tag has no parent and it is a "top level" tag. - * Cycles are not allowed (e.g. a->parent->parent == a) and will be - * rejected by the service. - *
        - * Length: EDAM_GUID_LEN_MIN - EDAM_GUID_LEN_MAX - *
        - * Regex: EDAM_GUID_REGEX - *
        - * - *
        updateSequenceNum
        - *
        A number identifying the last transaction to - * modify the state of this object. The USN values are sequential within an - * account, and can be used to compare the order of modifications within the - * service. - *
        - *
        - */ - class Tag { - guid: string; - name: string; - parentGuid: string; - updateSequenceNum: number; - - constructor(args?: { guid?: string; name?: string; parentGuid?: string; updateSequenceNum?: number; }); - } - - /** - * A structure that wraps a map of name/value pairs whose values are not - * always present in the structure in order to reduce space when obtaining - * batches of entities that contain the map. - * - * When the server provides the client with a LazyMap, it will fill in either - * the keysOnly field or the fullMap field, but never both, based on the API - * and parameters. - * - * When a client provides a LazyMap to the server as part of an update to - * an object, the server will only update the LazyMap if the fullMap field is - * set. If the fullMap field is not set, the server will not make any changes - * to the map. - * - * Check the API documentation of the individual calls involving the LazyMap - * for full details including the constraints of the names and values of the - * map. - * - *
        - *
        keysOnly
        - *
        The set of keys for the map. This field is ignored by the - * server when set. - *
        - * - *
        fullMap
        - *
        The complete map, including all keys and values. - *
        - *
        - */ - class LazyMap { - keysOnly: string[]; - fullMap: { [k: string]: string; }; - - constructor(args?: { keysOnly?: string[]; fullMap?: { [k: string]: string; }; }); - } - - /** - * Structure holding the optional attributes of a Resource - *
        - *
        sourceURL
        - *
        the original location where the resource was hosted - *
        - * Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX - *
        - * - *
        timestamp
        - *
        the date and time that is associated with this resource - * (e.g. the time embedded in an image from a digital camera with a clock) - *
        - * - *
        latitude
        - *
        the latitude where the resource was captured - *
        - * - *
        longitude
        - *
        the longitude where the resource was captured - *
        - * - *
        altitude
        - *
        the altitude where the resource was captured - *
        - * - *
        cameraMake
        - *
        information about an image's camera, e.g. as embedded in - * the image's EXIF data - *
        - * Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX - *
        - * - *
        cameraModel
        - *
        information about an image's camera, e.g. as embedded - * in the image's EXIF data - *
        - * Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX - *
        - * - *
        clientWillIndex
        - *
        if true, then the original client that submitted - * the resource plans to submit the recognition index for this resource at a - * later time. - *
        - * - *
        recoType
        - *
        DEPRECATED - this field is no longer set by the service, so should - * be ignored. - *
        - * - *
        fileName
        - *
        if the resource came from a source that provided an - * explicit file name, the original name will be stored here. Many resources - * come from unnamed sources, so this will not always be set. - *
        - * - *
        attachment
        - *
        this will be true if the resource should be displayed as an attachment, - * or false if the resource should be displayed inline (if possible). - *
        - * - *
        applicationData
        - *
        Provides a location for applications to store a relatively small - * (4kb) blob of data associated with a Resource that is not visible to the user - * and that is opaque to the Evernote service. A single application may use at most - * one entry in this map, using its API consumer key as the map key. See the - * documentation for LazyMap for a description of when the actual map values - * are returned by the service. - *

        To safely add or modify your application's entry in the map, use - * NoteStore.setResourceApplicationDataEntry. To safely remove your application's - * entry from the map, use NoteStore.unsetResourceApplicationDataEntry.

        - * Minimum length of a name (key): EDAM_APPLICATIONDATA_NAME_LEN_MIN - *
        - * Sum max size of key and value: EDAM_APPLICATIONDATA_ENTRY_LEN_MAX - *
        - * Syntax regex for name (key): EDAM_APPLICATIONDATA_NAME_REGEX - *
        - * - *
        - */ - class ResourceAttributes { - sourceURL: string; - timestamp: number; - latitude: number; - longitude: number; - altitude: number; - cameraMake: string; - cameraModel: string; - clientWillIndex: boolean; - recoType: string; - fileName: string; - attachment: boolean; - applicationData: LazyMap; - - constructor(args?: { sourceURL?: string; timestamp?: number; latitude?: number; longitude?: number; altitude?: number; cameraMake?: string; cameraModel?: string; clientWillIndex?: boolean; recoType?: string; fileName?: string; attachment?: boolean; applicationData?: LazyMap; }); - } - - /** - * Every media file that is embedded or attached to a note is represented - * through a Resource entry. - *
        - *
        guid
        - *
        The unique identifier of this resource. Will be set whenever - * a resource is retrieved from the service, but may be null when a client - * is creating a resource. - *
        - * Length: EDAM_GUID_LEN_MIN - EDAM_GUID_LEN_MAX - *
        - * Regex: EDAM_GUID_REGEX - *
        - * - *
        noteGuid
        - *
        The unique identifier of the Note that holds this - * Resource. Will be set whenever the resource is retrieved from the service, - * but may be null when a client is creating a resource. - *
        - * Length: EDAM_GUID_LEN_MIN - EDAM_GUID_LEN_MAX - *
        - * Regex: EDAM_GUID_REGEX - *
        - * - *
        data
        - *
        The contents of the resource. - * Maximum length: The data.body is limited to EDAM_RESOURCE_SIZE_MAX_FREE - * for free accounts and EDAM_RESOURCE_SIZE_MAX_PREMIUM for premium accounts. - *
        - * - *
        mime
        - *
        The MIME type for the embedded resource. E.g. "image/gif" - *
        - * Length: EDAM_MIME_LEN_MIN - EDAM_MIME_LEN_MAX - *
        - * Regex: EDAM_MIME_REGEX - *
        - * - *
        width
        - *
        If set, this contains the display width of this resource, in - * pixels. - *
        - * - *
        height
        - *
        If set, this contains the display height of this resource, - * in pixels. - *
        - * - *
        duration
        - *
        DEPRECATED: ignored. - *
        - * - *
        active
        - *
        DEPRECATED: ignored. - *
        - * - *
        recognition
        - *
        If set, this will hold the encoded data that provides - * information on search and recognition within this resource. - *
        - * - *
        attributes
        - *
        A list of the attributes for this resource. - *
        - * - *
        updateSequenceNum
        - *
        A number identifying the last transaction to - * modify the state of this object. The USN values are sequential within an - * account, and can be used to compare the order of modifications within the - * service. - *
        - * - *
        alternateData
        - *
        Some Resources may be assigned an alternate data format by the service - * which may be more appropriate for indexing or rendering than the original - * data provided by the user. In these cases, the alternate data form will - * be available via this Data element. If a Resource has no alternate form, - * this field will be unset.
        - *
        - */ - class Resource { - guid: string; - noteGuid: string; - data: Data; - mime: string; - width: number; - height: number; - duration: number; - active: boolean; - recognition: Data; - attributes: ResourceAttributes; - updateSequenceNum: number; - alternateData: Data; - - constructor(args?: { guid?: string; noteGuid?: string; data?: Data; mime?: string; width?: number; height?: number; duration?: number; active?: boolean; recognition?: Data; attributes?: ResourceAttributes; updateSequenceNum?: number; alternateData?: Data; }); - } - - /** - * The list of optional attributes that can be stored on a note. - *
        - *
        subjectDate
        - *
        time that the note refers to - *
        - * - *
        latitude
        - *
        the latitude where the note was taken - *
        - * - *
        longitude
        - *
        the longitude where the note was taken - *
        - * - *
        altitude
        - *
        the altitude where the note was taken - *
        - * - *
        author
        - *
        the author of the content of the note - *
        - * Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX - *
        - * - *
        source
        - *
        the method that the note was added to the account, if the - * note wasn't directly authored in an Evernote desktop client. - *
        - * Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX - *
        - * - *
        sourceURL
        - *
        the original location where the resource was hosted. For web clips, - * this will be the URL of the page that was clipped. - *
        - * Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX - *
        - * - *
        sourceApplication
        - *
        an identifying string for the application that - * created this note. This string does not have a guaranteed syntax or - * structure -- it is intended for human inspection and tracking. - *
        - * Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX - *
        - * - *
        shareDate
        - *
        The date and time when this note was directly shared via its own URL. - * This is only set on notes that were individually shared - it is independent - * of any notebook-level sharing of the containing notebook. This field - * is treated as "read-only" for clients; the server will ignore changes - * to this field from an external client. - *
        - * - *
        reminderOrder
        - *
        The set of notes with this parameter set are considered - * "reminders" and are to be treated specially by clients to give them - * higher UI prominence within a notebook. The value is used to sort - * the reminder notes within the notebook with higher values - * representing greater prominence. Outside of the context of a - * notebook, the value of this parameter is undefined. The value is - * not intended to be compared to the values of reminder notes in - * other notebooks. In order to allow clients to place a note at a - * higher precedence than other notes, you should never set a value - * greater than the current time (as defined for a Timetstamp). To - * place a note at higher precedence than existing notes, set the - * value to the current time as defined for a timestamp (milliseconds - * since the epoch). Synchronizing clients must remember the time when - * the update was performed, using the local clock on the client, - * and use that value when they later upload the note to the service. - * Clients must not set the reminderOrder to the reminderTime as the - * reminderTime could be in the future. Those two fields are never - * intended to be related. The correct value for reminderOrder field - * for new notes is the "current" time when the user indicated that - * the note is a reminder. Clients may implement a separate - * "sort by date" feature to show notes ordered by reminderTime. - * Whenever a reminderDoneTime or reminderTime is set but a - * reminderOrder is not set, the server will fill in the current - * server time for the reminderOrder field.
        - * - *
        reminderDoneTime
        - *
        The date and time when a user dismissed/"marked done" the reminder - * on the note. Users typically do not manually set this value directly - * as it is set to the time when the user dismissed/"marked done" the - * reminder.
        - * - *
        reminderTime
        - *
        The date and time a user has selected to be reminded of the note. - * A note with this value set is known as a "reminder" and the user can - * be reminded, via e-mail or client-specific notifications, of the note - * when the time is reached or about to be reached. When a user sets - * a reminder time on a note that has a reminder done time, and that - * reminder time is in the future, then the reminder done time should be - * cleared. This should happen regardless of any existing reminder time - * that may have previously existed on the note.
        - * - *
        placeName
        - *
        Allows the user to assign a human-readable location name associated - * with a note. Users may assign values like 'Home' and 'Work'. Place - * names may also be populated with values from geonames database - * (e.g., a restaurant name). Applications are encouraged to normalize values - * so that grouping values by place name provides a useful result. Applications - * MUST NOT automatically add place name values based on geolocation without - * confirmation from the user; that is, the value in this field should be - * more useful than a simple automated lookup based on the note's latitude - * and longitude.
        - * - *
        contentClass
        - *
        The class (or type) of note. This field is used to indicate to - * clients that special structured information is represented within - * the note such that special rules apply when making - * modifications. If contentClass is set and the client - * application does not specifically support the specified class, - * the client MUST treat the note as read-only. In this case, the - * client MAY modify the note's notebook and tags via the - * Note.notebookGuid and Note.tagGuids fields. The client MAY also - * modify the reminderOrder field as well as the reminderTime and - * reminderDoneTime fields. - *

        Applications should set contentClass only when they are creating notes - * that contain structured information that needs to be maintained in order - * for the user to be able to use the note within that application. - * Setting contentClass makes a note read-only in other applications, so - * there is a trade-off when an application chooses to use contentClass. - * Applications that set contentClass when creating notes must use a contentClass - * string of the form CompanyName.ApplicationName to ensure uniqueness.

        - * Length restrictions: EDAM_NOTE_CONTENT_CLASS_LEN_MIN, EDAM_NOTE_CONTENT_CLASS_LEN_MAX - *
        - * Regex: EDAM_NOTE_CONTENT_CLASS_REGEX - *
        - * - *
        applicationData
        - *
        Provides a location for applications to store a relatively small - * (4kb) blob of data that is not meant to be visible to the user and - * that is opaque to the Evernote service. A single application may use at most - * one entry in this map, using its API consumer key as the map key. See the - * documentation for LazyMap for a description of when the actual map values - * are returned by the service. - *

        To safely add or modify your application's entry in the map, use - * NoteStore.setNoteApplicationDataEntry. To safely remove your application's - * entry from the map, use NoteStore.unsetNoteApplicationDataEntry.

        - * Minimum length of a name (key): EDAM_APPLICATIONDATA_NAME_LEN_MIN - *
        - * Sum max size of key and value: EDAM_APPLICATIONDATA_ENTRY_LEN_MAX - *
        - * Syntax regex for name (key): EDAM_APPLICATIONDATA_NAME_REGEX - *
        - * - *
        creatorId
        - *
        The numeric user ID of the user who originally created the note.
        - * - *
        lastEditedBy
        - *
        An indication of who made the last change to the note. If you are - * accessing the note via a shared notebook to which you have modification - * rights, or if you are the owner of the notebook to which the note belongs, - * then you have access to the value. In this case, the value will be - * unset if the owner of the notebook containing the note was the last to - * make the modification, else it will be a string describing the - * guest who made the last edit. If you do not have access to this value, - * it will be left unset. This field is read-only by clients. The server - * will ignore all values set by clients into this field.
        - * - *
        lastEditorId
        - *
        The numeric user ID of the user described in lastEditedBy.
        - * - *
        classifications
        - *
        A map of classifications applied to the note by clients or by the - * Evernote service. The key is the string name of the classification type, - * and the value is a constant that begins with CLASSIFICATION_.
        - * - *
        - */ - class NoteAttributes { - subjectDate: number; - latitude: number; - longitude: number; - altitude: number; - author: string; - source: string; - sourceURL: string; - sourceApplication: string; - shareDate: number; - reminderOrder: number; - reminderDoneTime: number; - reminderTime: number; - placeName: string; - contentClass: string; - applicationData: LazyMap; - lastEditedBy: string; - classifications: { [k: string]: string; }; - creatorId: number; - lastEditorId: number; - - constructor(args?: { subjectDate?: number; latitude?: number; longitude?: number; altitude?: number; author?: string; source?: string; sourceURL?: string; sourceApplication?: string; shareDate?: number; reminderOrder?: number; reminderDoneTime?: number; reminderTime?: number; placeName?: string; contentClass?: string; applicationData?: LazyMap; lastEditedBy?: string; classifications?: { [k: string]: string; }; creatorId?: number; lastEditorId?: number; }); - } - - /** - * Represents a single note in the user's account. - * - *
        - *
        guid
        - *
        The unique identifier of this note. Will be set by the - * server, but will be omitted by clients calling NoteStore.createNote() - *
        - * Length: EDAM_GUID_LEN_MIN - EDAM_GUID_LEN_MAX - *
        - * Regex: EDAM_GUID_REGEX - *
        - * - *
        title
        - *
        The subject of the note. Can't begin or end with a space. - *
        - * Length: EDAM_NOTE_TITLE_LEN_MIN - EDAM_NOTE_TITLE_LEN_MAX - *
        - * Regex: EDAM_NOTE_TITLE_REGEX - *
        - * - *
        content
        - *
        The XHTML block that makes up the note. This is - * the canonical form of the note's contents, so will include abstract - * Evernote tags for internal resource references. A client may create - * a separate transformed version of this content for internal presentation, - * but the same canonical bytes should be used for transmission and - * comparison unless the user chooses to modify their content. - *
        - * Length: EDAM_NOTE_CONTENT_LEN_MIN - EDAM_NOTE_CONTENT_LEN_MAX - *
        - * - *
        contentHash
        - *
        The binary MD5 checksum of the UTF-8 encoded content - * body. This will always be set by the server, but clients may choose to omit - * this when they submit a note with content. - *
        - * Length: EDAM_HASH_LEN (exactly) - *
        - * - *
        contentLength
        - *
        The number of Unicode characters in the content of - * the note. This will always be set by the service, but clients may choose - * to omit this value when they submit a Note. - *
        - * - *
        created
        - *
        The date and time when the note was created in one of the - * clients. In most cases, this will match the user's sense of when - * the note was created, and ordering between notes will be based on - * ordering of this field. However, this is not a "reliable" timestamp - * if a client has an incorrect clock, so it cannot provide a true absolute - * ordering between notes. Notes created directly through the service - * (e.g. via the web GUI) will have an absolutely ordered "created" value. - *
        - * - *
        updated
        - *
        The date and time when the note was last modified in one of - * the clients. In most cases, this will match the user's sense of when - * the note was modified, but this field may not be absolutely reliable - * due to the possibility of client clock errors. - *
        - * - *
        deleted
        - *
        If present, the note is considered "deleted", and this - * stores the date and time when the note was deleted by one of the clients. - * In most cases, this will match the user's sense of when the note was - * deleted, but this field may be unreliable due to the possibility of - * client clock errors. - *
        - * - *
        active
        - *
        If the note is available for normal actions and viewing, - * this flag will be set to true. - *
        - * - *
        updateSequenceNum
        - *
        A number identifying the last transaction to - * modify the state of this note (including changes to the note's attributes - * or resources). The USN values are sequential within an account, - * and can be used to compare the order of modifications within the service. - *
        - * - *
        notebookGuid
        - *
        The unique identifier of the notebook that contains - * this note. If no notebookGuid is provided on a call to createNote(), the - * default notebook will be used instead. - *
        - * Length: EDAM_GUID_LEN_MIN - EDAM_GUID_LEN_MAX - *
        - * Regex: EDAM_GUID_REGEX - *
        - * - *
        tagGuids
        - *
        A list of the GUID identifiers for tags that are applied to this note. - * This may be provided in a call to createNote() to unambiguously - * the tags that should be assigned to the new note. Alternately, clients - * may pass the names of desired tags via the 'tagNames' field during - * note creation. - * If the list of tags are omitted on a call to createNote(), then - * the server will assume that no changes have been made to the resources. - * Maximum: EDAM_NOTE_TAGS_MAX tags per note - *
        - * - *
        resources
        - *
        The list of resources that are embedded within this note. - * If the list of resources are omitted on a call to updateNote(), then - * the server will assume that no changes have been made to the resources. - * The binary contents of the resources must be provided when the resource - * is first sent to the service, but it will be omitted by the service when - * the Note is returned in the future. - * Maximum: EDAM_NOTE_RESOURCES_MAX resources per note - *
        - * - *
        attributes
        - *
        A list of the attributes for this note. - * If the list of attributes are omitted on a call to updateNote(), then - * the server will assume that no changes have been made to the resources. - *
        - * - *
        tagNames
        - *
        May be provided by clients during calls to createNote() as an - * alternative to providing the tagGuids of existing tags. If any tagNames - * are provided during createNote(), these will be found, or created if they - * don't already exist. Created tags will have no parent (they will be at - * the top level of the tag panel). - *
        - *
        - */ - class Note { - guid: string; - title: string; - content: string; - contentHash: string; - contentLength: number; - created: number; - updated: number; - deleted: number; - active: boolean; - updateSequenceNum: number; - notebookGuid: string; - tagGuids: string[]; - resources: Resource[]; - attributes: NoteAttributes; - tagNames: string[]; - - constructor(args?: { guid?: string; title?: string; content?: string; contentHash?: string; contentLength?: number; created?: number; updated?: number; deleted?: number; active?: boolean; updateSequenceNum?: number; notebookGuid?: string; tagGuids?: string[]; resources?: Resource[]; attributes?: NoteAttributes; tagNames?: string[]; }); - } - - /** - * If a Notebook has been opened to the public, the Notebook will have a - * reference to one of these structures, which gives the location and optional - * description of the externally-visible public Notebook. - *
        - *
        uri
        - *
        If this field is present, then the notebook is published for - * mass consumption on the Internet under the provided URI, which is - * relative to a defined base publishing URI defined by the service. - * This field can only be modified via the web service GUI ... publishing - * cannot be modified via an offline client. - *
        - * Length: EDAM_PUBLISHING_URI_LEN_MIN - EDAM_PUBLISHING_URI_LEN_MAX - *
        - * Regex: EDAM_PUBLISHING_URI_REGEX - *
        - * - *
        order
        - *
        When the notes are publicly displayed, they will be sorted - * based on the requested criteria. - *
        - * - *
        ascending
        - *
        If this is set to true, then the public notes will be - * displayed in ascending order (e.g. from oldest to newest). Otherwise, - * the notes will be displayed in descending order (e.g. newest to oldest). - *
        - * - *
        publicDescription
        - *
        This field may be used to provide a short - * description of the notebook, which may be displayed when (e.g.) the - * notebook is shown in a public view. Can't begin or end with a space. - *
        - * Length: EDAM_PUBLISHING_DESCRIPTION_LEN_MIN - - * EDAM_PUBLISHING_DESCRIPTION_LEN_MAX - *
        - * Regex: EDAM_PUBLISHING_DESCRIPTION_REGEX - *
        - * - *
        - */ - class Publishing { - uri: string; - order: NoteSortOrder; - ascending: boolean; - publicDescription: string; - - constructor(args?: { uri?: string; order?: NoteSortOrder; ascending?: boolean; publicDescription?: string; }); - } - - /** - * If a Notebook contained in an Evernote Business account has been published - * the to business library, the Notebook will have a reference to one of these - * structures, which specifies how the Notebook will be represented in the - * library. - * - *
        - *
        notebookDescription
        - *
        A short description of the notebook's content that will be displayed - * in the business library user interface. The description may not begin - * or end with whitespace. - *
        - * Length: EDAM_BUSINESS_NOTEBOOK_DESCRIPTION_LEN_MIN - - * EDAM_BUSINESS_NOTEBOOK_DESCRIPTION_LEN_MAX - *
        - * Regex: EDAM_BUSINESS_NOTEBOOK_DESCRIPTION_REGEX - *
        - * - *
        privilege
        - *
        The privileges that will be granted to users who join the notebook through - * the business library. - *
        - * - *
        recommended
        - *
        Whether the notebook should be "recommended" when displayed in the business - * library user interface. - *
        - *
        - */ - class BusinessNotebook { - notebookDescription: string; - privilege: SharedNotebookPrivilegeLevel; - recommended: boolean; - - constructor(args?: { notebookDescription?: string; privilege?: SharedNotebookPrivilegeLevel; recommended?: boolean; }); - } - - /** - * A structure defining the scope of a SavedSearch. - * - *
        - *
        includeAccount
        - *
        The search should include notes from the account that contains the SavedSearch.
        - * - *
        includePersonalLinkedNotebooks
        - *
        The search should include notes within those shared notebooks - * that the user has joined that are NOT business notebooks.
        - * - *
        includeBusinessLinkedNotebooks
        - *
        The search should include notes within those shared notebooks - * that the user has joined that are business notebooks in the business that - * the user is currently a member of.
        - *
        - */ - class SavedSearchScope { - includeAccount: boolean; - includePersonalLinkedNotebooks: boolean; - includeBusinessLinkedNotebooks: boolean; - - constructor(args?: { includeAccount?: boolean; includePersonalLinkedNotebooks?: boolean; includeBusinessLinkedNotebooks?: boolean; }); - } - - /** - * A named search associated with the account that can be quickly re-used. - *
        - *
        guid
        - *
        The unique identifier of this search. Will be set by the - * service, so may be omitted by the client when creating. - *
        - * Length: EDAM_GUID_LEN_MIN - EDAM_GUID_LEN_MAX - *
        - * Regex: EDAM_GUID_REGEX - *
        - * - *
        name
        - *
        The name of the saved search to display in the GUI. The - * account may only contain one search with a given name (case-insensitive - * compare). Can't begin or end with a space. - *
        - * Length: EDAM_SAVED_SEARCH_NAME_LEN_MIN - EDAM_SAVED_SEARCH_NAME_LEN_MAX - *
        - * Regex: EDAM_SAVED_SEARCH_NAME_REGEX - *
        - * - *
        query
        - *
        A string expressing the search to be performed. - *
        - * Length: EDAM_SAVED_SEARCH_QUERY_LEN_MIN - EDAM_SAVED_SEARCH_QUERY_LEN_MAX - *
        - * - *
        format
        - *
        The format of the query string, to determine how to parse - * and process it. - *
        - * - *
        updateSequenceNum
        - *
        A number identifying the last transaction to - * modify the state of this object. The USN values are sequential within an - * account, and can be used to compare the order of modifications within the - * service. - *
        - * - *
        scope
        - *

        Specifies the set of notes that should be included in the search, if - * possible.

        - *

        Clients are expected to search as much of the desired scope as possible, - * with the understanding that a given client may not be able to cover the full - * specified scope. For example, when executing a search that includes notes in both - * the owner's account and business notebooks, a mobile client may choose to only - * search within the user's account because it is not capable of searching both - * scopes simultaneously. When a search across multiple scopes is not possible, - * a client may choose which scope to search based on the current application - * context. If a client cannot search any of the desired scopes, it should refuse - * to execute the search.

        - *
        - *
        - */ - class SavedSearch { - guid: string; - name: string; - query: string; - format: QueryFormat; - updateSequenceNum: number; - scope: SavedSearchScope; - - constructor(args?: { guid?: string; name?: string; query?: string; format?: QueryFormat; updateSequenceNum?: number; scope?: SavedSearchScope; }); - } - - /** - * Settings meant for the recipient of a shared notebook, such as - * for indicating which types of notifications the recipient wishes - * for reminders, etc. - * - * The reminderNotifyEmail and reminderNotifyInApp fields have a - * 3-state read value but a 2-state write value. On read, it is - * possible to observe "unset", true, or false. The initial state is - * "unset". When you choose to set a value, you may set it to either - * true or false, but you cannot unset the value. Once one of these - * members has a true/false value, it will always have a true/false - * value. - * - *
        - *
        reminderNotifyEmail
        - *
        Indicates that the user wishes to receive daily e-mail notifications - * for reminders associated with the shared notebook. This may be - * true only for business notebooks that belong to the business of - * which the user is a member. You may only set this value on a - * notebook in your business.
        - *
        reminderNotifyInApp
        - *
        Indicates that the user wishes to receive notifications for - * reminders by applications that support providing such - * notifications. The exact nature of the notification is defined - * by the individual applications.
        - *
        - * - */ - class SharedNotebookRecipientSettings { - reminderNotifyEmail: boolean; - reminderNotifyInApp: boolean; - - constructor(args?: { reminderNotifyEmail?: boolean; reminderNotifyInApp?: boolean; }); - } - - /** - * Shared notebooks represent a relationship between a notebook and a single - * share invitation recipient. - *
        - *
        id
        - *
        the primary identifier of the share
        - * - *
        userId
        - *
        the user id of the owner of the notebook
        - * - *
        notebookGuid
        - *
        the GUID of the associated notebook shared.
        - * - *
        email
        - *
        the email address of the recipient - used by the notebook - * owner to identify who they shared with.
        - * - *
        notebookModifiable
        - *
        (DEPRECATED) a flag indicating the share is read/write -otherwise it's read - * only. This field is deprecated in favor of the new "privilege" field.
        - * - *
        requireLogin
        - *
        (DEPRECATED) indicates that a user must login to access the share. This - * field is deprecated and will be "true" for all new shared notebooks. It - * is read-only and ignored when creating or modifying a shared notebook, - * except that a shared notebook can be modified to require login. - * See "allowPreview" for information on privileges and shared notebooks.
        - * - *
        serviceCreated
        - *
        the date the owner first created the share with the specific email - * address
        - * - *
        serviceUpdated
        - *
        the date the shared notebook was last updated on the service. This - * will be updated when authenticateToSharedNotebook is called the first - * time with a shared notebook requiring login (i.e. when the username is - * bound to that shared notebook).
        - * - *
        username
        - *
        the username of the user who can access this share. - * Once it's assigned it cannot be changed.
        - * - *
        privilege
        - *
        The privilege level granted to the notebook, activity stream, and - * invitations. See the corresponding enumeration for details.
        - * - *
        allowPreview
        - *
        Whether or not to grant "READ_NOTEBOOK" privilege without an - * authentication token, for authenticateToSharedNotebook(...). With - * the change to "requireLogin" always being true for new shared - * notebooks, this is the only way to access a shared notebook without - * an authorization token. This setting expires after the first use - * of authenticateToSharedNotebook(...) with a valid authentication - * token.
        - * - *
        recipientSettings
        - *
        Settings intended for use only by the recipient of this shared - * notebook. You should skip setting this value unless you want - * to change the value contained inside the structure, and only if - * you are the recipient.
        - *
        - */ - class SharedNotebook { - id: number; - userId: number; - notebookGuid: string; - email: string; - notebookModifiable: boolean; - requireLogin: boolean; - serviceCreated: number; - serviceUpdated: number; - shareKey: string; - username: string; - privilege: SharedNotebookPrivilegeLevel; - allowPreview: boolean; - recipientSettings: SharedNotebookRecipientSettings; - - constructor(args?: { id?: number; userId?: number; notebookGuid?: string; email?: string; notebookModifiable?: boolean; requireLogin?: boolean; serviceCreated?: number; serviceUpdated?: number; shareKey?: string; username?: string; privilege?: SharedNotebookPrivilegeLevel; allowPreview?: boolean; recipientSettings?: SharedNotebookRecipientSettings; }); - } - - /** - * This structure captures information about the types of operations - * that cannot be performed on a given notebook with a type of - * authenticated access and credentials. The values filled into this - * structure are based on then-current values in the server database - * for shared notebooks and notebook publishing records, as well as - * information related to the authentication token. Information from - * the authentication token includes the application that is accessing - * the server, as defined by the permissions granted by consumer (api) - * key, and the method used to obtain the token, for example via - * authenticateToSharedNotebook, authenticateToBusiness, etc. Note - * that changes to values in this structure that are the result of - * shared notebook or publishing record changes are communicated to - * the client via a change in the notebook USN during sync. It is - * important to use the same access method, parameters, and consumer - * key in order obtain correct results from the sync engine. - * - * The server has the final say on what is allowed as values may - * change between calls to obtain NotebookRestrictions instances - * and to operate on data on the service. - * - * If the following are set and true, then the given restriction is - * in effect, as accessed by the same authentication token from which - * the values were obtained. - * - *
        noReadNotes
        - *
        The client is not able to read notes from the service and - * the notebook is write-only. - *
        - *
        noCreateNotes
        - *
        The client may not create new notes in the notebook. - *
        - *
        noUpdateNotes
        - *
        The client may not update notes currently in the notebook. - *
        - *
        noExpungeNotes
        - *
        The client may not expunge notes currently in the notebook. - *
        - *
        noShareNotes
        - *
        The client may not share notes in the notebook via the - * shareNote method. - *
        - *
        noEmailNotes
        - *
        The client may not e-mail notes via the Evernote service by - * using the emailNote method. - *
        - *
        noSendMessageToRecipients
        - *
        The client may not send messages to the share recipients of - * the notebook. - *
        - *
        noUpdateNotebook
        - *
        The client may not update the Notebook object itself, for - * example, via the updateNotebook method. - *
        - *
        noExpungeNotebook
        - *
        The client may not expunge the Notebook object itself, for - * example, via the expungeNotebook method. - *
        - *
        noSetDefaultNotebook
        - *
        The client may not set this notebook to be the default notebook. - * The caller should leave Notebook.defaultNotebook unset. - *
        - *
        noSetNotebookStack
        - *
        If the client is able to update the Notebook, the Notebook.stack - * value may not be set. - *
        - *
        noPublishToPublic
        - *
        The client may not change the publish the notebook to the public. - * For example, business notebooks may not be shared publicly. - *
        - *
        noPublishToBusinessLibrary
        - *
        The client may not publish the notebook to the business library. - *
        - *
        noCreateTags
        - *
        The client may not complete an operation that results in a new tag - * being created in the owner's account. - *
        - *
        noUpdateTags
        - *
        The client may not update tags in the owner's account. - *
        - *
        noExpungeTags
        - *
        The client may not expunge tags in the owner's account. - *
        - *
        noSetParentTag
        - *
        If the client is able to create or update tags in the owner's account, - * then they will not be able to set the parent tag. Leave the value unset. - *
        - *
        noCreateSharedNotebooks
        - *
        The client is unable to create shared notebooks for the notebook. - *
        - *
        updateWhichSharedNotebookRestrictions
        - *
        Restrictions on which shared notebook instances can be updated. If the - * value is not set or null, then the client can update any of the shared notebooks - * associated with the notebook on which the NotebookRestrictions are defined. - * See the enumeration for further details. - *
        - *
        expungeWhichSharedNotebookRestrictions
        - *
        Restrictions on which shared notebook instances can be expunged. If the - * value is not set or null, then the client can expunge any of the shared notebooks - * associated with the notebook on which the NotebookRestrictions are defined. - * See the enumeration for further details. - *
        - */ - class NotebookRestrictions { - noReadNotes: boolean; - noCreateNotes: boolean; - noUpdateNotes: boolean; - noExpungeNotes: boolean; - noShareNotes: boolean; - noEmailNotes: boolean; - noSendMessageToRecipients: boolean; - noUpdateNotebook: boolean; - noExpungeNotebook: boolean; - noSetDefaultNotebook: boolean; - noSetNotebookStack: boolean; - noPublishToPublic: boolean; - noPublishToBusinessLibrary: boolean; - noCreateTags: boolean; - noUpdateTags: boolean; - noExpungeTags: boolean; - noSetParentTag: boolean; - noCreateSharedNotebooks: boolean; - updateWhichSharedNotebookRestrictions: SharedNotebookInstanceRestrictions; - expungeWhichSharedNotebookRestrictions: SharedNotebookInstanceRestrictions; - - constructor(args?: { noReadNotes?: boolean; noCreateNotes?: boolean; noUpdateNotes?: boolean; noExpungeNotes?: boolean; noShareNotes?: boolean; noEmailNotes?: boolean; noSendMessageToRecipients?: boolean; noUpdateNotebook?: boolean; noExpungeNotebook?: boolean; noSetDefaultNotebook?: boolean; noSetNotebookStack?: boolean; noPublishToPublic?: boolean; noPublishToBusinessLibrary?: boolean; noCreateTags?: boolean; noUpdateTags?: boolean; noExpungeTags?: boolean; noSetParentTag?: boolean; noCreateSharedNotebooks?: boolean; updateWhichSharedNotebookRestrictions?: SharedNotebookInstanceRestrictions; expungeWhichSharedNotebookRestrictions?: SharedNotebookInstanceRestrictions; }); - } - - /** - * A unique container for a set of notes. - *
        - *
        guid
        - *
        The unique identifier of this notebook. - *
        - * Length: EDAM_GUID_LEN_MIN - EDAM_GUID_LEN_MAX - *
        - * Regex: EDAM_GUID_REGEX - *
        - * - *
        name
        - *
        A sequence of characters representing the name of the - * notebook. May be changed by clients, but the account may not contain two - * notebooks with names that are equal via a case-insensitive comparison. - * Can't begin or end with a space. - *
        - * Length: EDAM_NOTEBOOK_NAME_LEN_MIN - EDAM_NOTEBOOK_NAME_LEN_MAX - *
        - * Regex: EDAM_NOTEBOOK_NAME_REGEX - *
        - * - *
        updateSequenceNum
        - *
        A number identifying the last transaction to - * modify the state of this object. The USN values are sequential within an - * account, and can be used to compare the order of modifications within the - * service. - *
        - * - *
        defaultNotebook
        - *
        If true, this notebook should be used for new notes - * whenever the user has not (or cannot) specify a desired target notebook. - * For example, if a note is submitted via SMTP email. - * The service will maintain at most one defaultNotebook per account. - * If a second notebook is created or updated with defaultNotebook set to - * true, the service will automatically update the prior notebook's - * defaultNotebook field to false. If the default notebook is deleted - * (i.e. "active" set to false), the "defaultNotebook" field will be - * set to false by the service. If the account has no default notebook - * set, the service will use the most recent notebook as the default. - *
        - * - *
        serviceCreated
        - *
        The time when this notebook was created on the - * service. This will be set on the service during creation, and the service - * will provide this value when it returns a Notebook to a client. - * The service will ignore this value if it is sent by clients. - *
        - * - *
        serviceUpdated
        - *
        The time when this notebook was last modified on the - * service. This will be set on the service during creation, and the service - * will provide this value when it returns a Notebook to a client. - * The service will ignore this value if it is sent by clients. - *
        - * - *
        publishing
        - *
        If the Notebook has been opened for public access, or - * business users shared with their business (i.e. if 'published' is - * set to true), then this will point to the set of publishing - * information for the Notebook (URI, description, etc.). A - * Notebook cannot be published without providing this information, - * but it will persist for later use if publishing is ever disabled - * on the Notebook. Clients that do not wish to change the - * publishing behavior of a Notebook should not set this value when - * calling NoteStore.updateNotebook(). - *
        - * - *
        published
        - *
        If this is set to true, then the Notebook will be - * accessible either to the public, or for business users to their business, - * via the 'publishing' specification, which must also be set. If this is set - * to false, the Notebook will not be available to the public (or business). - * Clients that do not wish to change the publishing behavior of a Notebook - * should not set this value when calling NoteStore.updateNotebook(). - *
        - * - *
        stack
        - *
        If this is set, then the notebook is visually contained within a stack - * of notebooks with this name. All notebooks in the same account with the - * same 'stack' field are considered to be in the same stack. - * Notebooks with no stack set are "top level" and not contained within a - * stack. - *
        - * - *
        sharedNotebookIds
        - *
        DEPRECATED - replaced by sharedNotebooks.
        - * - *
        sharedNotebooks
        - *
        The list of recipients to whom this notebook has been shared - * (one SharedNotebook object per recipient email address). This field will - * be unset if you do not have permission to access this data. If you are - * accessing the notebook as the owner or via a shared notebook that is - * modifiable, then you have access to this data and the value will be set. - * This field is read-only. Clients may not make changes to shared notebooks - * via this field. - *
        - * - *
        businessNotebook
        - *
        If the notebook is part of a business account and has been published to the - * business library, this will contain information for the library listing. - * The presence or absence of this field is not a reliable test of whether a given - * notebook is in fact a business notebook - the field is only used when a notebook is or - * has been published to the business library. - *
        - * - *
        contact
        - *
        Intended for use with Business accounts, this field identifies the user who - * has been designated as the "contact". For notebooks created in business - * accounts, the server will automatically set this value to the user who created - * the notebook unless Notebook.contact.username has been set, in which that value - * will be used. When updating a notebook, it is common to leave Notebook.contact - * field unset, indicating that no change to the value is being requested and that - * the existing value, if any, should be preserved. - *
        - * - *
        - */ - class Notebook { - guid: string; - name: string; - updateSequenceNum: number; - defaultNotebook: boolean; - serviceCreated: number; - serviceUpdated: number; - publishing: Publishing; - published: boolean; - stack: string; - sharedNotebookIds: number[]; - sharedNotebooks: SharedNotebook[]; - businessNotebook: BusinessNotebook; - contact: User; - restrictions: NotebookRestrictions; - - constructor(args?: { guid?: string; name?: string; updateSequenceNum?: number; defaultNotebook?: boolean; serviceCreated?: number; serviceUpdated?: number; publishing?: Publishing; published?: boolean; stack?: string; sharedNotebookIds?: number[]; sharedNotebooks?: SharedNotebook[]; businessNotebook?: BusinessNotebook; contact?: User; restrictions?: NotebookRestrictions; }); - } - - /** - * A link in an users account that refers them to a public or individual share in - * another user's account. - * - *
        - *
        shareName
        - *
        the display name of the shared notebook. - * The link owner can change this.
        - * - *
        username
        - *
        the username of the user who owns the shared or public notebook
        - * - *
        shardId
        - *
        the shard ID of the notebook if the notebook is not public - * - *
        shareKey
        - *
        the secret key that provides access to the shared notebook
        - * - *
        uri
        - *
        the identifier of the public notebook
        - * - *
        guid
        - *
        The unique identifier of this linked notebook. Will be set whenever - * a linked notebook is retrieved from the service, but may be null when a client - * is creating a linked notebook. - *
        - * Length: EDAM_GUID_LEN_MIN - EDAM_GUID_LEN_MAX - *
        - * Regex: EDAM_GUID_REGEX - *
        - * - *
        updateSequenceNum
        - *
        A number identifying the last transaction to - * modify the state of this object. The USN values are sequential within an - * account, and can be used to compare the order of modifications within the - * service. - *
        - * - *
        noteStoreUrl
        - *
        - * This field will contain the full URL that clients should use to make - * NoteStore requests to the server shard that contains that notebook's data. - * I.e. this is the URL that should be used to create the Thrift HTTP client - * transport to send messages to the NoteStore service for the account. - *
        - * - *
        webApiUrlPrefix:
        - *
        - * This field will contain the initial part of the URLs that should be used - * to make requests to Evernote's thin client "web API", which provide - * optimized operations for clients that aren't capable of manipulating - * the full contents of accounts via the full Thrift data model. Clients - * should concatenate the relative path for the various servlets onto the - * end of this string to construct the full URL, as documented on our - * developer web site. - *
        - * - *
        stack
        - *
        If this is set, then the notebook is visually contained within a stack - * of notebooks with this name. All notebooks in the same account with the - * same 'stack' field are considered to be in the same stack. - * Notebooks with no stack set are "top level" and not contained within a - * stack. The link owner can change this and this field is for the benefit - * of the link owner. - *
        - * - *
        businessId
        - *
        If set, this will be the unique identifier for the business that owns - * the notebook to which the linked notebook refers. - * - *
        - */ - class LinkedNotebook { - shareName: string; - username: string; - shardId: string; - shareKey: string; - uri: string; - guid: string; - updateSequenceNum: number; - noteStoreUrl: string; - webApiUrlPrefix: string; - stack: string; - businessId: number; - - constructor(args?: { shareName?: string; username?: string; shardId?: string; shareKey?: string; uri?: string; guid?: string; updateSequenceNum?: number; noteStoreUrl?: string; webApiUrlPrefix?: string; stack?: string; businessId?: number; }); - } - - /** - * A structure that describes a notebook or a user's relationship with - * a notebook. NotebookDescriptor is expected to remain a lighter-weight - * structure when compared to Notebook. - *
        - *
        guid
        - *
        The unique identifier of the notebook. - *
        - * - *
        notebookDisplayName
        - *
        A sequence of characters representing the name of the - * notebook. - *
        - * - *
        contactName
        - *
        The User.name value of the notebook's "contact". - *
        - * - *
        hasSharedNotebook
        - *
        Whether a SharedNotebook record exists between the calling user and this - * notebook. - *
        - * - *
        joinedUserCount
        - *
        The number of users who have joined this notebook. - *
        - * - *
        - */ - class NotebookDescriptor { - guid: string; - notebookDisplayName: string; - contactName: string; - hasSharedNotebook: boolean; - joinedUserCount: number; - - constructor(args?: { guid?: string; notebookDisplayName?: string; contactName?: string; hasSharedNotebook?: boolean; joinedUserCount?: number; }); - } - - /** - * A value for the "recipe" key in the "classifications" map in NoteAttributes - * that indicates the user has classified a note as being a non-recipe. - */ - var CLASSIFICATION_RECIPE_USER_NON_RECIPE: string; - - /** - * A value for the "recipe" key in the "classifications" map in NoteAttributes - * that indicates the user has classified a note as being a recipe. - */ - var CLASSIFICATION_RECIPE_USER_RECIPE: string; - - /** - * A value for the "recipe" key in the "classifications" map in NoteAttributes - * that indicates the Evernote service has classified a note as being a recipe. - */ - var CLASSIFICATION_RECIPE_SERVICE_RECIPE: string; - - /** - * Standardized value for the 'source' NoteAttribute for notes that - * were clipped from the web in some manner. - */ - var EDAM_NOTE_SOURCE_WEB_CLIP: string; - - /** - * Standardized value for the 'source' NoteAttribute for notes that - * were clipped from an email message. - */ - var EDAM_NOTE_SOURCE_MAIL_CLIP: string; - - /** - * Standardized value for the 'source' NoteAttribute for notes that - * were created via email sent to Evernote's email interface. - */ - var EDAM_NOTE_SOURCE_MAIL_SMTP_GATEWAY: string; - /** - * Service: UserStore - *

        - * The UserStore service is primarily used by EDAM clients to establish - * authentication via username and password over a trusted connection (e.g. - * SSL). A client's first call to this interface should be checkVersion() to - * ensure that the client's software is up to date. - *

        - * All calls which require an authenticationToken may throw an - * EDAMUserException for the following reasons: - *
          - *
        • AUTH_EXPIRED "authenticationToken" - token has expired - *
        • BAD_DATA_FORMAT "authenticationToken" - token is malformed - *
        • DATA_REQUIRED "authenticationToken" - token is empty - *
        • INVALID_AUTH "authenticationToken" - token signature is invalid - *
        - */ - class UserStoreClient { - seqid: number; - - /** - * This should be the first call made by a client to the EDAM service. It - * tells the service what protocol version is used by the client. The - * service will then return true if the client is capable of talking to - * the service, and false if the client's protocol version is incompatible - * with the service, so the client must upgrade. If a client receives a - * false value, it should report the incompatibility to the user and not - * continue with any more EDAM requests (UserStore or NoteStore). - * - * @param clientName - * This string provides some information about the client for - * tracking/logging on the service. It should provide information about - * the client's software and platform. The structure should be: - * application/version; platform/version; [ device/version ] - * E.g. "Evernote Windows/3.0.1; Windows/XP SP3". - * - * @param edamVersionMajor - * This should be the major protocol version that was compiled by the - * client. This should be the current value of the EDAM_VERSION_MAJOR - * constant for the client. - * - * @param edamVersionMinor - * This should be the major protocol version that was compiled by the - * client. This should be the current value of the EDAM_VERSION_MINOR - * constant for the client. - */ - checkVersion(clientName: string, edamVersionMajor: number, edamVersionMinor: number, cb: Callback): void; - - /** - * This provides bootstrap information to the client. Various bootstrap - * profiles and settings may be used by the client to configure itself. - * - * @param locale - * The client's current locale, expressed in language[_country] - * format. E.g., "en_US". See ISO-639 and ISO-3166 for valid - * language and country codes. - * - * @return - * The bootstrap information suitable for this client. - */ - getBootstrapInfo(locale: string, cb: Callback): void; - - /** - * Revoke an existing long lived authentication token. This can be used to - * revoke OAuth tokens or tokens created by calling authenticateLongSession, - * and allows a user to effectively log out of Evernote from the perspective - * of the application that holds the token. The authentication token that is - * passed is immediately revoked and may not be used to call any authenticated - * EDAM function. - * - * @param authenticationToken the authentication token to revoke. - * - * @throws EDAMUserException
          - *
        • DATA_REQUIRED "authenticationToken" - no authentication token provided - *
        • BAD_DATA_FORMAT "authenticationToken" - the authentication token is not well formed - *
        • INVALID_AUTH "authenticationToken" - the authentication token is invalid - *
        • AUTH_EXPIRED "authenticationToken" - the authentication token is expired or - * is already revoked. - *
        - */ - revokeLongSession(cb: Callback): void; - - /** - * This is used to take an existing authentication token that grants access - * to an individual user account (returned from 'authenticate', - * 'authenticateLongSession' or an OAuth authorization) and obtain an additional - * authentication token that may be used to access business notebooks if the user - * is a member of an Evernote Business account. - * - * The resulting authentication token may be used to make NoteStore API calls - * against the business using the NoteStore URL returned in the result. - * - * @param authenticationToken - * The authentication token for the user. This may not be a shared authentication - * token (returned by NoteStore.authenticateToSharedNotebook or - * NoteStore.authenticateToSharedNote) or a business authentication token. - * - * @return - * The result of the authentication, with the token granting access to the - * business in the result's 'authenticationToken' field. The URL that must - * be used to access the business account NoteStore will be returned in the - * result's 'noteStoreUrl' field. The 'User' field will - * not be set in the result. - * - * @throws EDAMUserException
          - *
        • PERMISSION_DENIED "authenticationToken" - the provided authentication token - * is a shared or business authentication token.
        • - *
        • PERMISSION_DENIED "Business" - the user identified by the provided - * authentication token is not currently a member of a business.
        • - *
        • PERMISSION_DENIED "Business.status" - the business that the user is a - * member of is not currently in an active status.
        • - *
        - */ - authenticateToBusiness(cb: Callback): void; - - /** - * Returns the User corresponding to the provided authentication token, - * or throws an exception if this token is not valid. - * The level of detail provided in the returned User structure depends on - * the access level granted by the token, so a web service client may receive - * fewer fields than an integrated desktop client. - */ - getUser(cb: Callback): void; - - /** - * Asks the UserStore about the publicly available location information for - * a particular username. - * - * @throws EDAMUserException
          - *
        • DATA_REQUIRED "username" - username is empty - *
        - */ - getPublicUserInfo(username: string, cb: Callback): void; - - - /** - * Returns the URL that should be used to talk to the NoteStore for the - * account represented by the provided authenticationToken. - * This method isn't needed by most clients, who can retrieve the correct - * NoteStore URL from the AuthenticationResult returned from the authenticate - * or refreshAuthentication calls. This method is typically only needed - * to look up the correct URL for a long-lived session token (e.g. for an - * OAuth web service). - */ - getNoteStoreUrl(cb: Callback): void; - } - /** - * This structure is used to provide publicly-available user information - * about a particular account. - *
        - *
        userId:
        - *
        - * The unique numeric user identifier for the user account. - *
        - *
        shardId:
        - *
        - * DEPRECATED - Client applications should have no need to use this field. - *
        - *
        privilege:
        - *
        - * The privilege level of the account, to determine whether - * this is a Premium or Free account. - *
        - *
        noteStoreUrl:
        - *
        - * This field will contain the full URL that clients should use to make - * NoteStore requests to the server shard that contains that user's data. - * I.e. this is the URL that should be used to create the Thrift HTTP client - * transport to send messages to the NoteStore service for the account. - *
        - *
        webApiUrlPrefix:
        - *
        - * This field will contain the initial part of the URLs that should be used - * to make requests to Evernote's thin client "web API", which provide - * optimized operations for clients that aren't capable of manipulating - * the full contents of accounts via the full Thrift data model. Clients - * should concatenate the relative path for the various servlets onto the - * end of this string to construct the full URL, as documented on our - * developer web site. - *
        - *
        - */ - class PublicUserInfo { - userId: number; - shardId: string; - privilege: PrivilegeLevel; - username: string; - noteStoreUrl: string; - webApiUrlPrefix: string; - - constructor(args?: { userId: number; shardId: string; privilege?: PrivilegeLevel; username?: string; noteStoreUrl?: string; webApiUrlPrefix?: string; }); - } - - /** - * When an authentication (or re-authentication) is performed, this structure - * provides the result to the client. - *
        - *
        currentTime:
        - *
        - * The server-side date and time when this result was - * generated. - *
        - *
        authenticationToken:
        - *
        - * Holds an opaque, ASCII-encoded token that can be - * used by the client to perform actions on a NoteStore. - *
        - *
        expiration:
        - *
        - * Holds the server-side date and time when the - * authentication token will expire. - * This time can be compared to "currentTime" to produce an expiration - * time that can be reconciled with the client's local clock. - *
        - *
        user:
        - *
        - * Holds the information about the account which was - * authenticated if this was a full authentication. May be absent if this - * particular authentication did not require user information. - *
        - *
        publicUserInfo:
        - *
        - * If this authentication result was achieved without full permissions to - * access the full User structure, this field may be set to give back - * a more limited public set of data. - *
        - *
        noteStoreUrl:
        - *
        - * This field will contain the full URL that clients should use to make - * NoteStore requests to the server shard that contains that user's data. - * I.e. this is the URL that should be used to create the Thrift HTTP client - * transport to send messages to the NoteStore service for the account. - *
        - *
        webApiUrlPrefix:
        - *
        - * This field will contain the initial part of the URLs that should be used - * to make requests to Evernote's thin client "web API", which provide - * optimized operations for clients that aren't capable of manipulating - * the full contents of accounts via the full Thrift data model. Clients - * should concatenate the relative path for the various servlets onto the - * end of this string to construct the full URL, as documented on our - * developer web site. - *
        - *
        secondFactorRequired:
        - *
        - * If set to true, this field indicates that the user has enabled two-factor - * authentication and must enter their second factor in order to complete - * authentication. In this case the value of authenticationResult will be - * a short-lived authentication token that may only be used to make a - * subsequent call to completeTwoFactorAuthentication. - *
        - *
        secondFactorDeliveryHint:
        - *
        - * When secondFactorRequired is set to true, this field may contain a string - * describing the second factor delivery method that the user has configured. - * This will typically be an obfuscated mobile device number, such as - * "(xxx) xxx-x095". This string can be displayed to the user to remind them - * how to obtain the required second factor. - * TODO do we need to differentiate between SMS and voice delivery? - *
        - *
        - */ - class AuthenticationResult { - currentTime: number; - authenticationToken: string; - expiration: number; - user: User; - publicUserInfo: PublicUserInfo; - noteStoreUrl: string; - webApiUrlPrefix: string; - secondFactorRequired: boolean; - secondFactorDeliveryHint: string; - - constructor(args?: { currentTime: number; authenticationToken: string; expiration: number; user?: User; publicUserInfo?: PublicUserInfo; noteStoreUrl?: string; webApiUrlPrefix?: string; secondFactorRequired?: boolean; secondFactorDeliveryHint?: string; }); - } - - /** - * This structure describes a collection of bootstrap settings. - *
        - *
        serviceHost:
        - *
        - * The hostname and optional port for composing Evernote web service URLs. - * This URL can be used to access the UserStore and related services, - * but must not be used to compose the NoteStore URL. Client applications - * must handle serviceHost values that include only the hostname - * (e.g. www.evernote.com) or both the hostname and port (e.g. www.evernote.com:8080). - * If no port is specified, or if port 443 is specified, client applications must - * use the scheme "https" when composing URLs. Otherwise, a client must use the - * scheme "http". - *
        - *
        marketingUrl:
        - *
        - * The URL stem for the Evernote corporate marketing website, e.g. http://www.evernote.com. - * This stem can be used to compose website URLs. For example, the URL of the Evernote - * Trunk is composed by appending "/about/trunk/" to the value of marketingUrl. - *
        - *
        supportUrl:
        - *
        - * The full URL for the Evernote customer support website, e.g. https://support.evernote.com. - *
        - *
        accountEmailDomain:
        - *
        - * The domain used for an Evernote user's incoming email address, which allows notes to - * be emailed into an account. E.g. m.evernote.com. - *
        - *
        enableFacebookSharing:
        - *
        - * Whether the client application should enable sharing of notes on Facebook. - *
        - *
        enableGiftSubscriptions:
        - *
        - * Whether the client application should enable gift subscriptions. - *
        - *
        enableSupportTickets:
        - *
        - * Whether the client application should enable in-client creation of support tickets. - *
        - *
        enableSharedNotebooks:
        - *
        - * Whether the client application should enable shared notebooks. - *
        - *
        enableSingleNoteSharing:
        - *
        - * Whether the client application should enable single note sharing. - *
        - *
        enableSponsoredAccounts:
        - *
        - * Whether the client application should enable sponsored accounts. - *
        - *
        enableTwitterSharing:
        - *
        - * Whether the client application should enable sharing of notes on Twitter. - *
        - *
        - */ - class BootstrapSettings { - serviceHost: string; - marketingUrl: string; - supportUrl: string; - accountEmailDomain: string; - enableFacebookSharing: boolean; - enableGiftSubscriptions: boolean; - enableSupportTickets: boolean; - enableSharedNotebooks: boolean; - enableSingleNoteSharing: boolean; - enableSponsoredAccounts: boolean; - enableTwitterSharing: boolean; - enableLinkedInSharing: boolean; - enablePublicNotebooks: boolean; - - constructor(args?: { serviceHost: string; marketingUrl: string; supportUrl: string; accountEmailDomain: string; enableFacebookSharing?: boolean; enableGiftSubscriptions?: boolean; enableSupportTickets?: boolean; enableSharedNotebooks?: boolean; enableSingleNoteSharing?: boolean; enableSponsoredAccounts?: boolean; enableTwitterSharing?: boolean; enableLinkedInSharing?: boolean; enablePublicNotebooks?: boolean; }); - } - - /** - * This structure describes a collection of bootstrap settings. - *
        - *
        name:
        - *
        - * The unique name of the profile, which is guaranteed to remain consistent across - * calls to getBootstrapInfo. - *
        - *
        settings:
        - *
        - * The settings for this profile. - *
        - *
        - */ - class BootstrapProfile { - name: string; - settings: BootstrapSettings; - - constructor(args?: { name: string; settings: BootstrapSettings; }); - } - - /** - * This structure describes a collection of bootstrap profiles. - *
        - *
        profiles:
        - *
        - * List of one or more bootstrap profiles, in descending - * preference order. - *
        - *
        - */ - class BootstrapInfo { - profiles: BootstrapProfile[]; - - constructor(args?: { profiles: BootstrapProfile[]; }); - } - - /** - * The major version number for the current revision of the EDAM protocol. - * Clients pass this to the service using UserStore.checkVersion at the - * beginning of a session to confirm that they are not out of date. - */ - var EDAM_VERSION_MAJOR: number; - - /** - * The minor version number for the current revision of the EDAM protocol. - * Clients pass this to the service using UserStore.checkVersion at the - * beginning of a session to confirm that they are not out of date. - */ - var EDAM_VERSION_MINOR: number; - -} diff --git a/expect/index.d.ts b/expect/index.d.ts deleted file mode 100644 index 7b4e95e2b5..0000000000 --- a/expect/index.d.ts +++ /dev/null @@ -1,99 +0,0 @@ -// Type definitions for Expect 1.20 -// Project: https://github.com/mjackson/expect -// Definitions by: Justin Reidy , Risto Keravuori -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare namespace expect { - export type CompareValues = (a: T, b: T) => boolean; - export type Comparator = (target: {}, key: string) => boolean; - export type KeyType = string | number; - - export class Expectation { - constructor(actual: any); - toExist(message?: string): Expectation; - toBeTruthy(message?: string): Expectation; - toNotExist(message?: string): Expectation; - toBeFalsy(message?: string): Expectation; - - toBe(value: T, message?: string): Expectation; - toNotBe(value: any, message?: string): Expectation; - toEqual(value: any, message?: string): Expectation; - toNotEqual(value: any, message?: string): Expectation; - toThrow(error?: {}, message?: string): Expectation; - toNotThrow(error?: {}, message?: string): Expectation; - - toBeA(value: string | {}, message?: string): Expectation; - toBeAn(value: string | {}, message?: string): Expectation; - toNotBeA(value: string | {}, message?: string): Expectation; - toNotBeAn(value: string | {}, message?: string): Expectation; - toMatch(value: string | RegExp | {}, message?: string): Expectation; - toNotMatch(value: string | RegExp | {}, message?: string): Expectation; - - toBeLessThan(value: number, message?: string): Expectation; - toBeLessThanOrEqualTo(value: number, messasge?: string): Expectation; - toBeFewerThan(value: number, message?: string): Expectation; - toBeGreaterThan(value: number, message?: string): Expectation; - toBeGreaterThanOrEqualTo(value: number, messasge?: string): Expectation; - toBeMoreThan(value: number, message?: string): Expectation; - - toInclude(value: any, compareValues?: CompareValues, message?: string): Expectation; - toContain(value: any, compareValues?: CompareValues, message?: string): Expectation; - toExclude(value: any, compareValues?: CompareValues, message?: string): Expectation; - toNotContain(value: any, compareValues?: CompareValues, message?: string): Expectation; - - toIncludeKeys(keys: KeyType[], comparator?: Comparator, message?: string): Expectation; - toContainKeys(keys: KeyType[], comparator?: Comparator, message?: string): Expectation; - toExcludeKeys(keys: KeyType[], comparator?: Comparator, message?: string): Expectation; - toNotContainKeys(keys: KeyType[], comparator?: Comparator, message?: string): Expectation; - toNotIncludeKeys(keys: KeyType[], comparator?: Comparator, message?: string): Expectation; - toIncludeKey(key: KeyType, comparator?: Comparator, message?: string): Expectation; - toContainKey(key: KeyType, comparator?: Comparator, message?: string): Expectation; - toExcludeKey(key: KeyType, comparator?: Comparator, message?: string): Expectation; - toNotContainKey(key: KeyType, comparator?: Comparator, message?: string): Expectation; - toNotIncludeKey(key: KeyType, comparator?: Comparator, message?: string): Expectation; - - toHaveBeenCalled(message?: string): Expectation; - toNotHaveBeenCalled(message?: string): Expectation; - toHaveBeenCalledWith(...args: any[]): Expectation; - - // deprecated - withContext(context: any): Expectation; - withArgs(...args: any[]): Expectation; - } - - export interface Extension { - [name: string]: (args?: any[]) => void; - } - - export interface Call { - context: T; - arguments: any[]; - } - - export interface Spy { - (...args: any[]): void; - __isSpy: boolean; - calls: Array>; - andCall(fn: (...args: any[]) => any): Spy; - andCallThrough(): Spy; - andThrow(object: {}): Spy; - andReturn(value: any): Spy; - getLastCall(): Call; - restore(): void; - destroy(): void; - reset(): void; - } - - - export function createSpy(fn?: (...args: any[]) => any, restore?: (...args: any[]) => any): Spy; - export function spyOn(object: T, methodName: string): Spy; - export function isSpy(object: {}): boolean; - export function restoreSpies(): void; - export function assert(condition: boolean, messageFormat: string, ...extraArgs: any[]): void; - export function extend(extension: Extension): void; - -} - -declare function expect(actual: T): expect.Expectation; - -export = expect; diff --git a/expect/tslint.json b/expect/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/expect/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/expr-eval/index.d.ts b/expr-eval/index.d.ts deleted file mode 100644 index cab8333186..0000000000 --- a/expr-eval/index.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -// Type definitions for expr-eval 1.0 -// Project: https://github.com/silentmatt/expr-eval#readme -// Definitions by: Connor Peet -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -type Value = number - | string - | ((...args: Value[]) => Value) - | { [propertyName: string]: Value }; - -interface Values { - [propertyName: string]: Value; -} - -export class Parser { - constructor(options?: { allowMemberAccess?: boolean }); - parse(expression: string): Expression; - evaluate(expression: string, values?: Values): number; - - static parse(expression: string): Expression; - static evaluate(expression: string, values?: Values): number; -} - -export interface Expression { - simplify(values?: Values): Expression; - evaluate(values?: Values): number; - substitute(values: Values): Expression; - symbols(): string[]; - variables(): string[]; - toJSFunction(params: string, values?: Values): (...args: Value[]) => number; -} diff --git a/expr-eval/tslint.json b/expr-eval/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/expr-eval/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/express-mysql-session/index.d.ts b/express-mysql-session/index.d.ts deleted file mode 100644 index 0e86b9b077..0000000000 --- a/express-mysql-session/index.d.ts +++ /dev/null @@ -1,136 +0,0 @@ -// Type definitions for express-mysql-session 1.2 -// Project: https://github.com/chill117/express-mysql-session#readme -// Definitions by: Akim95 -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export = MySQLStore; - -declare namespace MySQLStore { - interface Options { - host?: string; - port?: number; - user?: string; - password?: string; - database?: string; - checkExpirationInterval?: number; - expiration?: number; - createDatabaseTable?: boolean; - connectionLimit?: number; - schema?: Schema; - } - interface Schema { - tableName: string; - columnNames: ColumnNames; - } - interface ColumnNames { - session_id: string; - expires: string; - data: string; - } -} - -declare class MySQLStore { - - /** - * @param {MySQLStore.Options} options - * @param {any} connection? - * @param {(error:any)=>void} callback? - */ - constructor(options: MySQLStore.Options, connection?: any, callback?: (error: any) => void); - - /** - * @returns void - */ - setDefaultOptions(): void; - - /** - * @param {(error:any)=>void} callback? - * @returns void - */ - createDatabaseTable(callback?: (error: any) => void): void; - - /** - * @param {string} sessionId - * @param {(error:any,session:any)=>void} callback? - * @returns void - */ - get(sessionId: string, callback?: (error: any, session: any) => void): void; - - /** - * @param {string} sessionId - * @param {any} data - * @param {(error:any)=>void} callback? - * @returns void - */ - set(sessionId: string, data: any, callback?: (error: any) => void): void; - - /** - * @param {string} sessionId - * @param {any} data - * @param {(error:any)=>void} callback? - * @returns void - */ - touch(sessionId: string, data: any, callback?: (error: any) => void): void; - - /** - * @param {string} sessionId - * @param {(error:any)=>void} callback? - * @returns void - */ - destroy(sessionId: string, callback?: (error: any) => void): void; - - /** - * @param {(error:any,count:any)=>void} callback? - * @returns void - */ - length(callback?: (error: any, count: any) => void): void; - - /** - * @param {(error:any)=>void} callback? - * @returns void - */ - clear(callback?: (error: any) => void): void; - - /** - * @param {(error:any)=>void} callback? - * @returns void - */ - clearExpiredSessions(callback?: (error: any) => void): void; - - /** - * @param {number} interval - * @returns void - */ - setExpirationInterval(interval: number): void; - - /** - * @returns void - */ - clearExpirationInterval(): void; - - /** - * @param {()=>void} callback? - * @returns void - */ - close(callback?: () => void): void; - - /** - * @param {any} object - * @param {any} defaultValues - * @param {any} options? - * @returns void - */ - default(object: any, defaultValues: any, options?: any): void; - - /** - * @param {any} object - * @returns void - */ - clone(object: any): void; - - /** - * @param {any} value - * @returns void - */ - isObject(value: any): void; -} diff --git a/express-mysql-session/tslint.json b/express-mysql-session/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/express-mysql-session/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/express-rate-limit/index.d.ts b/express-rate-limit/index.d.ts deleted file mode 100644 index 38ef8f8b29..0000000000 --- a/express-rate-limit/index.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -// Type definitions for express-rate-limit 2.6 -// Project: https://github.com/nfriedly/express-rate-limit -// Definitions by: Cyril Schumacher -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -import express = require("express"); - -declare namespace RateLimit { - type StoreIncrementCallback = (err?: {}, hits?: number) => void; - - export interface Store { - incr: (key: string, cb: StoreIncrementCallback) => void; - resetAll: () => void; - resetKey: (key: string) => void; - } - - export interface Options { - delayAfter?: number; - delayMs?: number; - handlers?: () => any; - headers?: boolean; - keyGenerator?: () => string; - max?: number; - message?: string; - skip?: () => boolean; - statusCode?: number; - store?: Store; - windowMs?: number; - } -} - -interface RateLimitStatic { - new(options: RateLimit.Options): express.RequestHandler; -} - -declare var RateLimit: RateLimitStatic; -export = RateLimit; diff --git a/express-rate-limit/tslint.json b/express-rate-limit/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/express-rate-limit/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/express-serve-static-core/index.d.ts b/express-serve-static-core/index.d.ts deleted file mode 100644 index a4ce9612e7..0000000000 --- a/express-serve-static-core/index.d.ts +++ /dev/null @@ -1,1113 +0,0 @@ -// Type definitions for Express 4.x -// Project: http://expressjs.com -// Definitions by: Boris Yankov -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// This extracts the core definitions from express to prevent a circular dependency between express and serve-static -/// - -declare global { - namespace Express { - - // These open interfaces may be extended in an application-specific manner via declaration merging. - // See for example method-override.d.ts (https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/method-override/method-override.d.ts) - export interface Request { } - export interface Response { } - export interface Application { } - } -} - -import * as http from "http"; - -interface NextFunction { - (err?: any): void; -} - -interface RequestHandler { - (req: Request, res: Response, next: NextFunction): any; -} - -interface ErrorRequestHandler { - (err: any, req: Request, res: Response, next: NextFunction): any; -} - -type PathParams = string | RegExp | (string | RegExp)[]; - -type RequestHandlerParams = RequestHandler | ErrorRequestHandler | (RequestHandler | ErrorRequestHandler)[]; - -interface IRouterMatcher { - (path: PathParams, ...handlers: RequestHandler[]): T; - (path: PathParams, ...handlers: RequestHandlerParams[]): T; -} - -interface IRouterHandler { - (...handlers: RequestHandler[]): T; - (...handlers: RequestHandlerParams[]): T; -} - -interface IRouter extends RequestHandler { - /** - * Map the given param placeholder `name`(s) to the given callback(s). - * - * Parameter mapping is used to provide pre-conditions to routes - * which use normalized placeholders. For example a _:user_id_ parameter - * could automatically load a user's information from the database without - * any additional code, - * - * The callback uses the samesignature as middleware, the only differencing - * being that the value of the placeholder is passed, in this case the _id_ - * of the user. Once the `next()` function is invoked, just like middleware - * it will continue on to execute the route, or subsequent parameter functions. - * - * app.param('user_id', function(req, res, next, id){ - * User.find(id, function(err, user){ - * if (err) { - * next(err); - * } else if (user) { - * req.user = user; - * next(); - * } else { - * next(new Error('failed to load user')); - * } - * }); - * }); - * - * @param name - * @param fn - */ - param(name: string, handler: RequestParamHandler): this; - // Alternatively, you can pass only a callback, in which case you have the opportunity to alter the app.param() API - // deprecated since express 4.11.0 - param(callback: (name: string, matcher: RegExp) => RequestParamHandler): this; - - /** - * Special-cased "all" method, applying the given route `path`, - * middleware, and callback to _every_ HTTP method. - * - * @param path - * @param fn - */ - all: IRouterMatcher; - get: IRouterMatcher; - post: IRouterMatcher; - put: IRouterMatcher; - delete: IRouterMatcher; - patch: IRouterMatcher; - options: IRouterMatcher; - head: IRouterMatcher; - - checkout: IRouterMatcher; - copy: IRouterMatcher; - lock: IRouterMatcher; - merge: IRouterMatcher; - mkactivity: IRouterMatcher; - mkcol: IRouterMatcher; - move: IRouterMatcher; - "m-search": IRouterMatcher; - notify: IRouterMatcher; - purge: IRouterMatcher; - report: IRouterMatcher; - search: IRouterMatcher; - subscribe: IRouterMatcher; - trace: IRouterMatcher; - unlock: IRouterMatcher; - unsubscribe: IRouterMatcher; - - use: IRouterHandler & IRouterMatcher; - - route(prefix: PathParams): IRoute; - /** - * Stack of configured routes - */ - stack: any[]; -} - -interface IRoute { - path: string; - stack: any; - all: IRouterHandler; - get: IRouterHandler; - post: IRouterHandler; - put: IRouterHandler; - delete: IRouterHandler; - patch: IRouterHandler; - options: IRouterHandler; - head: IRouterHandler; - - checkout: IRouterHandler; - copy: IRouterHandler; - lock: IRouterHandler; - merge: IRouterHandler; - mkactivity: IRouterHandler; - mkcol: IRouterHandler; - move: IRouterHandler; - "m-search": IRouterHandler; - notify: IRouterHandler; - purge: IRouterHandler; - report: IRouterHandler; - search: IRouterHandler; - subscribe: IRouterHandler; - trace: IRouterHandler; - unlock: IRouterHandler; - unsubscribe: IRouterHandler -} - -export interface Router extends IRouter { } - -interface CookieOptions { - maxAge?: number; - signed?: boolean; - expires?: Date | boolean; - httpOnly?: boolean; - path?: string; - domain?: string; - secure?: boolean | 'auto'; -} - -interface Errback { (err: Error): void; } - -interface Request extends http.IncomingMessage, Express.Request { - - /** - * Return request header. - * - * The `Referrer` header field is special-cased, - * both `Referrer` and `Referer` are interchangeable. - * - * Examples: - * - * req.get('Content-Type'); - * // => "text/plain" - * - * req.get('content-type'); - * // => "text/plain" - * - * req.get('Something'); - * // => undefined - * - * Aliased as `req.header()`. - * - * @param name - */ - get(name: string): string; - - header(name: string): string; - - headers: { [key: string]: string; }; - - /** - * Check if the given `type(s)` is acceptable, returning - * the best match when true, otherwise `undefined`, in which - * case you should respond with 406 "Not Acceptable". - * - * The `type` value may be a single mime type string - * such as "application/json", the extension name - * such as "json", a comma-delimted list such as "json, html, text/plain", - * or an array `["json", "html", "text/plain"]`. When a list - * or array is given the _best_ match, if any is returned. - * - * Examples: - * - * // Accept: text/html - * req.accepts('html'); - * // => "html" - * - * // Accept: text/*, application/json - * req.accepts('html'); - * // => "html" - * req.accepts('text/html'); - * // => "text/html" - * req.accepts('json, text'); - * // => "json" - * req.accepts('application/json'); - * // => "application/json" - * - * // Accept: text/*, application/json - * req.accepts('image/png'); - * req.accepts('png'); - * // => undefined - * - * // Accept: text/*;q=.5, application/json - * req.accepts(['html', 'json']); - * req.accepts('html, json'); - * // => "json" - */ - accepts(): string[]; - accepts(type: string): string | boolean; - accepts(type: string[]): string | boolean; - accepts(...type: string[]): string | boolean; - - /** - * Returns the first accepted charset of the specified character sets, - * based on the request's Accept-Charset HTTP header field. - * If none of the specified charsets is accepted, returns false. - * - * For more information, or if you have issues or concerns, see accepts. - * @param charset - */ - acceptsCharsets(): string[]; - acceptsCharsets(charset: string): string | boolean; - acceptsCharsets(charset: string[]): string | boolean; - acceptsCharsets(...charset: string[]): string | boolean; - - /** - * Returns the first accepted encoding of the specified encodings, - * based on the request's Accept-Encoding HTTP header field. - * If none of the specified encodings is accepted, returns false. - * - * For more information, or if you have issues or concerns, see accepts. - * @param encoding - */ - acceptsEncodings(): string[]; - acceptsEncodings(encoding: string): string | boolean; - acceptsEncodings(encoding: string[]): string | boolean; - acceptsEncodings(...encoding: string[]): string | boolean; - - /** - * Returns the first accepted language of the specified languages, - * based on the request's Accept-Language HTTP header field. - * If none of the specified languages is accepted, returns false. - * - * For more information, or if you have issues or concerns, see accepts. - * - * @param lang - */ - acceptsLanguages(): string[]; - acceptsLanguages(lang: string): string | boolean; - acceptsLanguages(lang: string[]): string | boolean; - acceptsLanguages(...lang: string[]): string | boolean; - - /** - * Parse Range header field, - * capping to the given `size`. - * - * Unspecified ranges such as "0-" require - * knowledge of your resource length. In - * the case of a byte range this is of course - * the total number of bytes. If the Range - * header field is not given `null` is returned, - * `-1` when unsatisfiable, `-2` when syntactically invalid. - * - * NOTE: remember that ranges are inclusive, so - * for example "Range: users=0-3" should respond - * with 4 users when available, not 3. - * - * @param size - */ - range(size: number): any[]; - - /** - * Return an array of Accepted media types - * ordered from highest quality to lowest. - */ - accepted: MediaType[]; - - /** - * @deprecated Use either req.params, req.body or req.query, as applicable. - * - * Return the value of param `name` when present or `defaultValue`. - * - * - Checks route placeholders, ex: _/user/:id_ - * - Checks body params, ex: id=12, {"id":12} - * - Checks query string params, ex: ?id=12 - * - * To utilize request bodies, `req.body` - * should be an object. This can be done by using - * the `connect.bodyParser()` middleware. - * - * @param name - * @param defaultValue - */ - param(name: string, defaultValue?: any): string; - - /** - * Check if the incoming request contains the "Content-Type" - * header field, and it contains the give mime `type`. - * - * Examples: - * - * // With Content-Type: text/html; charset=utf-8 - * req.is('html'); - * req.is('text/html'); - * req.is('text/*'); - * // => true - * - * // When Content-Type is application/json - * req.is('json'); - * req.is('application/json'); - * req.is('application/*'); - * // => true - * - * req.is('html'); - * // => false - * - * @param type - */ - is(type: string): boolean; - - /** - * Return the protocol string "http" or "https" - * when requested with TLS. When the "trust proxy" - * setting is enabled the "X-Forwarded-Proto" header - * field will be trusted. If you're running behind - * a reverse proxy that supplies https for you this - * may be enabled. - */ - protocol: string; - - /** - * Short-hand for: - * - * req.protocol == 'https' - */ - secure: boolean; - - /** - * Return the remote address, or when - * "trust proxy" is `true` return - * the upstream addr. - */ - ip: string; - - /** - * When "trust proxy" is `true`, parse - * the "X-Forwarded-For" ip address list. - * - * For example if the value were "client, proxy1, proxy2" - * you would receive the array `["client", "proxy1", "proxy2"]` - * where "proxy2" is the furthest down-stream. - */ - ips: string[]; - - /** - * Return subdomains as an array. - * - * Subdomains are the dot-separated parts of the host before the main domain of - * the app. By default, the domain of the app is assumed to be the last two - * parts of the host. This can be changed by setting "subdomain offset". - * - * For example, if the domain is "tobi.ferrets.example.com": - * If "subdomain offset" is not set, req.subdomains is `["ferrets", "tobi"]`. - * If "subdomain offset" is 3, req.subdomains is `["tobi"]`. - */ - subdomains: string[]; - - /** - * Short-hand for `url.parse(req.url).pathname`. - */ - path: string; - - /** - * Parse the "Host" header field hostname. - */ - hostname: string; - - /** - * @deprecated Use hostname instead. - */ - host: string; - - /** - * Check if the request is fresh, aka - * Last-Modified and/or the ETag - * still match. - */ - fresh: boolean; - - /** - * Check if the request is stale, aka - * "Last-Modified" and / or the "ETag" for the - * resource has changed. - */ - stale: boolean; - - /** - * Check if the request was an _XMLHttpRequest_. - */ - xhr: boolean; - - //body: { username: string; password: string; remember: boolean; title: string; }; - body: any; - - //cookies: { string; remember: boolean; }; - cookies: any; - - method: string; - - params: any; - - /** - * Clear cookie `name`. - * - * @param name - * @param options - */ - clearCookie(name: string, options?: any): Response; - - query: any; - - route: any; - - signedCookies: any; - - originalUrl: string; - - url: string; - - baseUrl: string; - - app: Application; -} - -interface MediaType { - value: string; - quality: number; - type: string; - subtype: string; -} - -interface Send { - (status: number, body?: any): Response; - (body?: any): Response; -} - -interface Response extends http.ServerResponse, Express.Response { - /** - * Set status `code`. - * - * @param code - */ - status(code: number): Response; - - /** - * Set the response HTTP status code to `statusCode` and send its string representation as the response body. - * @link http://expressjs.com/4x/api.html#res.sendStatus - * - * Examples: - * - * res.sendStatus(200); // equivalent to res.status(200).send('OK') - * res.sendStatus(403); // equivalent to res.status(403).send('Forbidden') - * res.sendStatus(404); // equivalent to res.status(404).send('Not Found') - * res.sendStatus(500); // equivalent to res.status(500).send('Internal Server Error') - * - * @param code - */ - sendStatus(code: number): Response; - - /** - * Set Link header field with the given `links`. - * - * Examples: - * - * res.links({ - * next: 'http://api.example.com/users?page=2', - * last: 'http://api.example.com/users?page=5' - * }); - * - * @param links - */ - links(links: any): Response; - - /** - * Send a response. - * - * Examples: - * - * res.send(new Buffer('wahoo')); - * res.send({ some: 'json' }); - * res.send('

        some html

        '); - * res.send(404, 'Sorry, cant find that'); - * res.send(404); - */ - send: Send; - - /** - * Send JSON response. - * - * Examples: - * - * res.json(null); - * res.json({ user: 'tj' }); - * res.json(500, 'oh noes!'); - * res.json(404, 'I dont have that'); - */ - json: Send; - - /** - * Send JSON response with JSONP callback support. - * - * Examples: - * - * res.jsonp(null); - * res.jsonp({ user: 'tj' }); - * res.jsonp(500, 'oh noes!'); - * res.jsonp(404, 'I dont have that'); - */ - jsonp: Send; - - /** - * Transfer the file at the given `path`. - * - * Automatically sets the _Content-Type_ response header field. - * The callback `fn(err)` is invoked when the transfer is complete - * or when an error occurs. Be sure to check `res.sentHeader` - * if you wish to attempt responding, as the header and some data - * may have already been transferred. - * - * Options: - * - * - `maxAge` defaulting to 0 (can be string converted by `ms`) - * - `root` root directory for relative filenames - * - `headers` object of headers to serve with file - * - `dotfiles` serve dotfiles, defaulting to false; can be `"allow"` to send them - * - * Other options are passed along to `send`. - * - * Examples: - * - * The following example illustrates how `res.sendFile()` may - * be used as an alternative for the `static()` middleware for - * dynamic situations. The code backing `res.sendFile()` is actually - * the same code, so HTTP cache support etc is identical. - * - * app.get('/user/:uid/photos/:file', function(req, res){ - * var uid = req.params.uid - * , file = req.params.file; - * - * req.user.mayViewFilesFrom(uid, function(yes){ - * if (yes) { - * res.sendFile('/uploads/' + uid + '/' + file); - * } else { - * res.send(403, 'Sorry! you cant see that.'); - * } - * }); - * }); - * - * @api public - */ - sendFile(path: string): void; - sendFile(path: string, options: any): void; - sendFile(path: string, fn: Errback): void; - sendFile(path: string, options: any, fn: Errback): void; - - /** - * @deprecated Use sendFile instead. - */ - sendfile(path: string): void; - /** - * @deprecated Use sendFile instead. - */ - sendfile(path: string, options: any): void; - /** - * @deprecated Use sendFile instead. - */ - sendfile(path: string, fn: Errback): void; - /** - * @deprecated Use sendFile instead. - */ - sendfile(path: string, options: any, fn: Errback): void; - - /** - * Transfer the file at the given `path` as an attachment. - * - * Optionally providing an alternate attachment `filename`, - * and optional callback `fn(err)`. The callback is invoked - * when the data transfer is complete, or when an error has - * ocurred. Be sure to check `res.headerSent` if you plan to respond. - * - * This method uses `res.sendfile()`. - */ - download(path: string): void; - download(path: string, filename: string): void; - download(path: string, fn: Errback): void; - download(path: string, filename: string, fn: Errback): void; - - /** - * Set _Content-Type_ response header with `type` through `mime.lookup()` - * when it does not contain "/", or set the Content-Type to `type` otherwise. - * - * Examples: - * - * res.type('.html'); - * res.type('html'); - * res.type('json'); - * res.type('application/json'); - * res.type('png'); - * - * @param type - */ - contentType(type: string): Response; - - /** - * Set _Content-Type_ response header with `type` through `mime.lookup()` - * when it does not contain "/", or set the Content-Type to `type` otherwise. - * - * Examples: - * - * res.type('.html'); - * res.type('html'); - * res.type('json'); - * res.type('application/json'); - * res.type('png'); - * - * @param type - */ - type(type: string): Response; - - /** - * Respond to the Acceptable formats using an `obj` - * of mime-type callbacks. - * - * This method uses `req.accepted`, an array of - * acceptable types ordered by their quality values. - * When "Accept" is not present the _first_ callback - * is invoked, otherwise the first match is used. When - * no match is performed the server responds with - * 406 "Not Acceptable". - * - * Content-Type is set for you, however if you choose - * you may alter this within the callback using `res.type()` - * or `res.set('Content-Type', ...)`. - * - * res.format({ - * 'text/plain': function(){ - * res.send('hey'); - * }, - * - * 'text/html': function(){ - * res.send('

        hey

        '); - * }, - * - * 'appliation/json': function(){ - * res.send({ message: 'hey' }); - * } - * }); - * - * In addition to canonicalized MIME types you may - * also use extnames mapped to these types: - * - * res.format({ - * text: function(){ - * res.send('hey'); - * }, - * - * html: function(){ - * res.send('

        hey

        '); - * }, - * - * json: function(){ - * res.send({ message: 'hey' }); - * } - * }); - * - * By default Express passes an `Error` - * with a `.status` of 406 to `next(err)` - * if a match is not made. If you provide - * a `.default` callback it will be invoked - * instead. - * - * @param obj - */ - format(obj: any): Response; - - /** - * Set _Content-Disposition_ header to _attachment_ with optional `filename`. - * - * @param filename - */ - attachment(filename?: string): Response; - - /** - * Set header `field` to `val`, or pass - * an object of header fields. - * - * Examples: - * - * res.set('Foo', ['bar', 'baz']); - * res.set('Accept', 'application/json'); - * res.set({ Accept: 'text/plain', 'X-API-Key': 'tobi' }); - * - * Aliased as `res.header()`. - */ - set(field: any): Response; - set(field: string, value?: string): Response; - - header(field: any): Response; - header(field: string, value?: string): Response; - - // Property indicating if HTTP headers has been sent for the response. - headersSent: boolean; - - /** - * Get value for header `field`. - * - * @param field - */ - get(field: string): string; - - /** - * Clear cookie `name`. - * - * @param name - * @param options - */ - clearCookie(name: string, options?: any): Response; - - /** - * Set cookie `name` to `val`, with the given `options`. - * - * Options: - * - * - `maxAge` max-age in milliseconds, converted to `expires` - * - `signed` sign the cookie - * - `path` defaults to "/" - * - * Examples: - * - * // "Remember Me" for 15 minutes - * res.cookie('rememberme', '1', { expires: new Date(Date.now() + 900000), httpOnly: true }); - * - * // save as above - * res.cookie('rememberme', '1', { maxAge: 900000, httpOnly: true }) - */ - cookie(name: string, val: string, options: CookieOptions): Response; - cookie(name: string, val: any, options: CookieOptions): Response; - cookie(name: string, val: any): Response; - - /** - * Set the location header to `url`. - * - * The given `url` can also be the name of a mapped url, for - * example by default express supports "back" which redirects - * to the _Referrer_ or _Referer_ headers or "/". - * - * Examples: - * - * res.location('/foo/bar').; - * res.location('http://example.com'); - * res.location('../login'); // /blog/post/1 -> /blog/login - * - * Mounting: - * - * When an application is mounted and `res.location()` - * is given a path that does _not_ lead with "/" it becomes - * relative to the mount-point. For example if the application - * is mounted at "/blog", the following would become "/blog/login". - * - * res.location('login'); - * - * While the leading slash would result in a location of "/login": - * - * res.location('/login'); - * - * @param url - */ - location(url: string): Response; - - /** - * Redirect to the given `url` with optional response `status` - * defaulting to 302. - * - * The resulting `url` is determined by `res.location()`, so - * it will play nicely with mounted apps, relative paths, - * `"back"` etc. - * - * Examples: - * - * res.redirect('/foo/bar'); - * res.redirect('http://example.com'); - * res.redirect(301, 'http://example.com'); - * res.redirect('http://example.com', 301); - * res.redirect('../login'); // /blog/post/1 -> /blog/login - */ - redirect(url: string): void; - redirect(status: number, url: string): void; - redirect(url: string, status: number): void; - - /** - * Render `view` with the given `options` and optional callback `fn`. - * When a callback function is given a response will _not_ be made - * automatically, otherwise a response of _200_ and _text/html_ is given. - * - * Options: - * - * - `cache` boolean hinting to the engine it should cache - * - `filename` filename of the view being rendered - */ - render(view: string, options?: Object, callback?: (err: Error, html: string) => void): void; - render(view: string, callback?: (err: Error, html: string) => void): void; - - locals: any; - - charset: string; - - /** - * Adds the field to the Vary response header, if it is not there already. - * Examples: - * - * res.vary('User-Agent').render('docs'); - * - */ - vary(field: string): Response; - - app: Application; -} - -interface Handler extends RequestHandler { } - -interface RequestParamHandler { - (req: Request, res: Response, next: NextFunction, value: any, name: string): any; -} - -type ApplicaitonRequestHandler = IRouterHandler & IRouterMatcher & { - (...handlers: RequestHandlerParams[]): T; -}; - -interface Application extends IRouter, Express.Application { - /** - * Express instance itself is a request handler, which could be invoked without - * third argument. - */ - (req: Request, res: Response): any; - - /** - * Initialize the server. - * - * - setup default configuration - * - setup default middleware - * - setup route reflection methods - */ - init(): void; - - /** - * Initialize application configuration. - */ - defaultConfiguration(): void; - - /** - * Register the given template engine callback `fn` - * as `ext`. - * - * By default will `require()` the engine based on the - * file extension. For example if you try to render - * a "foo.jade" file Express will invoke the following internally: - * - * app.engine('jade', require('jade').__express); - * - * For engines that do not provide `.__express` out of the box, - * or if you wish to "map" a different extension to the template engine - * you may use this method. For example mapping the EJS template engine to - * ".html" files: - * - * app.engine('html', require('ejs').renderFile); - * - * In this case EJS provides a `.renderFile()` method with - * the same signature that Express expects: `(path, options, callback)`, - * though note that it aliases this method as `ejs.__express` internally - * so if you're using ".ejs" extensions you dont need to do anything. - * - * Some template engines do not follow this convention, the - * [Consolidate.js](https://github.com/visionmedia/consolidate.js) - * library was created to map all of node's popular template - * engines to follow this convention, thus allowing them to - * work seamlessly within Express. - */ - engine(ext: string, fn: Function): Application; - - /** - * Assign `setting` to `val`, or return `setting`'s value. - * - * app.set('foo', 'bar'); - * app.get('foo'); - * // => "bar" - * app.set('foo', ['bar', 'baz']); - * app.get('foo'); - * // => ["bar", "baz"] - * - * Mounted servers inherit their parent server's settings. - * - * @param setting - * @param val - */ - set(setting: string, val: any): Application; - get: { (name: string): any; } & IRouterMatcher; - - param(name: string | string[], handler: RequestParamHandler): this; - // Alternatively, you can pass only a callback, in which case you have the opportunity to alter the app.param() API - param(callback: (name: string, matcher: RegExp) => RequestParamHandler): this; - - /** - * Return the app's absolute pathname - * based on the parent(s) that have - * mounted it. - * - * For example if the application was - * mounted as "/admin", which itself - * was mounted as "/blog" then the - * return value would be "/blog/admin". - */ - path(): string; - - /** - * Check if `setting` is enabled (truthy). - * - * app.enabled('foo') - * // => false - * - * app.enable('foo') - * app.enabled('foo') - * // => true - */ - enabled(setting: string): boolean; - - /** - * Check if `setting` is disabled. - * - * app.disabled('foo') - * // => true - * - * app.enable('foo') - * app.disabled('foo') - * // => false - * - * @param setting - */ - disabled(setting: string): boolean; - - /** - * Enable `setting`. - * - * @param setting - */ - enable(setting: string): Application; - - /** - * Disable `setting`. - * - * @param setting - */ - disable(setting: string): Application; - - /** - * Configure callback for zero or more envs, - * when no `env` is specified that callback will - * be invoked for all environments. Any combination - * can be used multiple times, in any order desired. - * - * Examples: - * - * app.configure(function(){ - * // executed for all envs - * }); - * - * app.configure('stage', function(){ - * // executed staging env - * }); - * - * app.configure('stage', 'production', function(){ - * // executed for stage and production - * }); - * - * Note: - * - * These callbacks are invoked immediately, and - * are effectively sugar for the following: - * - * var env = process.env.NODE_ENV || 'development'; - * - * switch (env) { - * case 'development': - * ... - * break; - * case 'stage': - * ... - * break; - * case 'production': - * ... - * break; - * } - * - * @param env - * @param fn - */ - configure(fn: Function): Application; - configure(env0: string, fn: Function): Application; - configure(env0: string, env1: string, fn: Function): Application; - configure(env0: string, env1: string, env2: string, fn: Function): Application; - configure(env0: string, env1: string, env2: string, env3: string, fn: Function): Application; - configure(env0: string, env1: string, env2: string, env3: string, env4: string, fn: Function): Application; - - /** - * Render the given view `name` name with `options` - * and a callback accepting an error and the - * rendered template string. - * - * Example: - * - * app.render('email', { name: 'Tobi' }, function(err, html){ - * // ... - * }) - * - * @param name - * @param options or fn - * @param fn - */ - render(name: string, options?: Object, callback?: (err: Error, html: string) => void): void; - render(name: string, callback: (err: Error, html: string) => void): void; - - - /** - * Listen for connections. - * - * A node `http.Server` is returned, with this - * application (which is a `Function`) as its - * callback. If you wish to create both an HTTP - * and HTTPS server you may do so with the "http" - * and "https" modules as shown here: - * - * var http = require('http') - * , https = require('https') - * , express = require('express') - * , app = express(); - * - * http.createServer(app).listen(80); - * https.createServer({ ... }, app).listen(443); - */ - listen(port: number, hostname: string, backlog: number, callback?: Function): http.Server; - listen(port: number, hostname: string, callback?: Function): http.Server; - listen(port: number, callback?: Function): http.Server; - listen(path: string, callback?: Function): http.Server; - listen(handle: any, listeningListener?: Function): http.Server; - - router: string; - - settings: any; - - resource: any; - - map: any; - - locals: any; - - /** - * The app.routes object houses all of the routes defined mapped by the - * associated HTTP verb. This object may be used for introspection - * capabilities, for example Express uses this internally not only for - * routing but to provide default OPTIONS behaviour unless app.options() - * is used. Your application or framework may also remove routes by - * simply by removing them from this object. - */ - routes: any; - - /** - * Used to get all registered routes in Express Application - */ - _router: any; - - use: ApplicaitonRequestHandler; -} - -interface Express extends Application { - request: Request; - - response: Response; -} diff --git a/extended-listbox/extended-listbox-tests.ts b/extended-listbox/extended-listbox-tests.ts deleted file mode 100644 index 0ca2f862b1..0000000000 --- a/extended-listbox/extended-listbox-tests.ts +++ /dev/null @@ -1,179 +0,0 @@ - - - -var $test = $("#test"); - -// Create Listbox with defaults -var instance: ExtendedListboxInstance = $test.listbox(); - - -// Create with options -var options = {}; -options.multiple = true; -options.searchBar = false; -options.searchBarWatermark = "Search"; -options.searchBarButton = { icon: "fa fa-search", visible: true, onClick: function () { alert(); } }; -options.getItems = function (): any[] { - return ["Test1"]; -}; -options.onItemsChanged = (event: ListboxEvent): void => { - console.log(event.eventName); - console.log(event.args); - console.log(event.target); -}; -options.onFilterChanged = (event: ListboxEvent): void => { - console.log(event.args); -}; -options.onValueChanged = function (event: ListboxEvent): void { - console.log(event.args); -}; -options.onItemDoubleClicked = function (event: ListboxEvent): void { - console.log(event.args); -}; -options.onItemEnterPressed = function (event: ListboxEvent): void { - console.log(event.args); -}; - -instance = $test.listbox(options); - - -/////// NEW API /////// - -// Add string item -var id = instance.addItem("Test2"); - - -// Add item -var item: ListboxItem = {}; -item.selected = true; -item.disabled = false; -item.childItems = ["Test4"]; -item.groupHeader = false; -item.id = "ouetioreit"; -item.index = 0; -item.text = "Test3"; -id = instance.addItem(item); - - -// Remove item -instance.removeItem(id); - - -// Get item -var i: ListboxItem = instance.getItem(id); - - -// Get items -var allItems: ListboxItem[] = instance.getItems(); - -// Get selected items -var allItems: ListboxItem[] = instance.getSelection(); - - -// Move item up -var newIndex: number = instance.moveItemUp(i.id); - - -// Move item down -newIndex = instance.moveItemDown(i.id); - - -// Move item to top -var newIndex: number = instance.moveItemToTop(i.id); - - -// Move item to bottom -newIndex = instance.moveItemToBottom(i.id); - - -// Clear selection -instance.clearSelection(); - - -// Enable -instance.enable(false); - - -// Destroy -instance.destroy(); - - -// onValueChanged -instance.onValueChanged((event: ListboxEvent) => { - console.log(event.args); -}); - - -// onItemsChanged -instance.onItemsChanged((event: ListboxEvent) => { - console.log(event.args); -}); - - -// onFilterChanged -instance.onFilterChanged((event: ListboxEvent) => { - console.log(event.args); -}); - - -// onItemEnterPressed -instance.onItemEnterPressed((event: ListboxEvent) => { - console.log(event.args); -}); - - -// onItemDoubleClicked -instance.onItemDoubleClicked((event: ListboxEvent) => { - console.log(event.args); -}); - - - -/////// LEGACY API /////// - -// Add string item -instance.target.listbox("addItem", "Test2"); - - -// Add item -var item: ListboxItem = {}; -item.selected = true; -item.disabled = false; -item.childItems = ["Test4"]; -item.groupHeader = false; -item.id = "ouetioreit"; -item.index = 0; -item.text = "Test3"; -var id: string = instance.target.listbox("addItem", item); - - -// Remove item -instance.target.listbox("removeItem", id); - - -// Get item -var i: ListboxItem = instance.target.listbox("getItem", id); - - -// Get items -var allItems: ListboxItem[] = instance.target.listbox("getItems"); - - -// Move item up -var newIndex: number = instance.target.listbox("moveItemUp", i.id); - - -// Move item down -newIndex = instance.target.listbox("moveItemDown", i.id); - - -// Clear selection -instance.target.listbox("clearSelection"); - - -// Enable -instance.target.listbox("enable", false); - - -// Destroy -instance.target.listbox("destroy"); diff --git a/extended-listbox/index.d.ts b/extended-listbox/index.d.ts deleted file mode 100644 index eb5f0eec04..0000000000 --- a/extended-listbox/index.d.ts +++ /dev/null @@ -1,183 +0,0 @@ -// Type definitions for extended-listbox 1.1.x -// Project: https://github.com/code-chris/extended-listbox -// Definitions by: Christian Kotzbauer -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -interface ListboxItem { - /** display text */ - text?: string; - - /** unique identifier, if not set it will be generated */ - id?: string; - - /** index position from the item in the list; only used for manual addItem api calls */ - index?: number; - - /** determines if the item should be clickable */ - disabled?: boolean; - - /** determines if the item is selected */ - selected?: boolean; - - /** determines if the item has childItems */ - groupHeader?: boolean; - - /** display text or id of the parent; only used for manual addItem api calls */ - parentGroupId?: string; - - /** list of childItems */ - childItems?: any[]; -} - -interface ListboxSearchBarButtonOptions { - /** determines if the button is visible */ - visible?: boolean; - - /** css class for the i-tag of the button */ - icon?: string; - - /** callback for button click */ - onClick?: () => void; -} - -interface ListBoxOptions { - /** determines if the searchBar is visible */ - searchBar?: boolean; - - /** watermark (placeholder) for the searchBar */ - searchBarWatermark?: string; - - /** settings for the searchBar button */ - searchBarButton?: ListboxSearchBarButtonOptions; - - /** determines if multiple items can be selected */ - multiple?: boolean; - - /** function which returns a array of items */ - getItems?: () => any; - - /** callback for selection changes */ - onValueChanged?: (event: ListboxEvent) => void; - - /** callback for searchBar text changes */ - onFilterChanged?: (event: ListboxEvent) => void; - - /** callback for item changes (item added, item removed, item order) */ - onItemsChanged?: (event: ListboxEvent) => void; - - /** callback for enter keyPress event on an item */ - onItemEnterPressed?: (event: ListboxEvent) => void; - - /** callback for doubleClick event on an item */ - onItemDoubleClicked?: (event: ListboxEvent) => void; -} - -interface ListboxEvent { - /** unique event name */ - eventName: string; - - /** target object for which event is triggered */ - target: JQuery; - - /** any object */ - args: any; -} - -interface ExtendedListboxInstance { - /** DOM element of the listbox root */ - target: JQuery; - - /** Adds a new item to the list */ - addItem(item: string|ListboxItem): string; - - /** Removes a item from the list */ - removeItem(identifier: string): void; - - /** Reverts all changes from the DOM */ - destroy(): void; - - /** Resets the selection state of all items */ - clearSelection(): void; - - /** Returns a item object for the given id or display text */ - getItem(identifier: string): ListboxItem; - - /** Returns all item objects */ - getItems(): ListboxItem[]; - - /** Returns all ListboxItem's which are selected */ - getSelection(): ListboxItem[]; - - /** Decreases the index of the matching item by one */ - moveItemUp(identifier: string): number; - - /** Increases the index of the matching item by one */ - moveItemDown(identifier: string): number; - - /** Moves item to the bottom of the list */ - moveItemToBottom(identifier: string): number; - - /** Moves item to the top of the list */ - moveItemToTop(identifier: string): number; - - /** Enables or disables the whole list and all childs */ - enable(state: boolean): void; - - /** callback for selection changes */ - onValueChanged(callback: (event: ListboxEvent) => void): void; - - /** callback for item changes (item added, item removed, item order) */ - onItemsChanged(callback: (event: ListboxEvent) => void): void; - - /** callback for searchBar text changes */ - onFilterChanged(callback: (event: ListboxEvent) => void): void; - - /** callback for enter keyPress event on an item */ - onItemEnterPressed(callback: (event: ListboxEvent) => void): void; - - /** callback for doubleClick event on an item */ - onItemDoubleClicked(callback: (event: ListboxEvent) => void): void; -} - -interface JQuery { - /** constructs a new instance of Listbox on the given DOM item or returns existing */ - listbox(): ExtendedListboxInstance|ExtendedListboxInstance[]; - - /** constructs a new instance of Listbox on the given DOM item */ - listbox(options: ListBoxOptions): ExtendedListboxInstance|ExtendedListboxInstance[]; - - /** @deprecated: use method in ExtendedListboxInstance */ - listbox(methodName: 'addItem'): string; - - /** @deprecated: use method in ExtendedListboxInstance */ - listbox(methodName: 'removeItem'): void; - - /** @deprecated: use method in ExtendedListboxInstance */ - listbox(methodName: 'destroy'): void; - - /** @deprecated: use method in ExtendedListboxInstance */ - listbox(methodName: 'getItem'): ListboxItem; - - /** @deprecated: use method in ExtendedListboxInstance */ - listbox(methodName: 'getItems'): ListboxItem[]; - - /** @deprecated: use method in ExtendedListboxInstance */ - listbox(methodName: 'moveItemUp'): number; - - /** @deprecated: use method in ExtendedListboxInstance */ - listbox(methodName: 'moveItemDown'): number; - - /** @deprecated: use method in ExtendedListboxInstance */ - listbox(methodName: 'clearSelection'): void; - - /** @deprecated: use method in ExtendedListboxInstance */ - listbox(methodName: 'enable'): void; - - /** @deprecated: use method in ExtendedListboxInstance */ - listbox(methodName: string): any; - - /** @deprecated: use method in ExtendedListboxInstance */ - listbox(methodName: string, methodParameter: any): any; -} diff --git a/extract-zip/index.d.ts b/extract-zip/index.d.ts deleted file mode 100644 index 52ce40094f..0000000000 --- a/extract-zip/index.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -// Type definitions for extract-zip 1.6 -// Project: https://github.com/maxogden/extract-zip -// Definitions by: Mizunashi Mana -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare namespace extract { - export interface Options { - dir?: string; - defaultDirMode?: number; - defaultFileMode?: number; - onEntry?: (entry: any, zipfile: any) => void; - } -} - -declare function extract( - zipPath: string, - opts: extract.Options, - cb: (err?: Error) => void, -): void; - -export = extract; diff --git a/extract-zip/tslint.json b/extract-zip/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/extract-zip/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/f1/index.d.ts b/f1/index.d.ts deleted file mode 100644 index 82c5cf8c4d..0000000000 --- a/f1/index.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -// Type definitions for f1 8.0 -// Project: https://github.com/jam3/f1 -// Definitions by: Neo -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -interface F1Options { - onState?: (...args: any[]) => void; - onUpdate?: (...args: any[]) => void; - - name: string; - - targets: any; - states: any; - transitions: any[]; - parsers: any; -} - -interface F1 extends NodeJS.EventEmitter { - targets(targets: any): F1; - states(states: any): F1; - transitions(transitions: any[]): F1; - parsers(parser: any): F1; - init(initState: string): F1; - - destroy(): void; - apply(pathToTarget: string, target: any, parserDefinition: any): void; - - go(state: string, callback?: (state: any, currentState: any) => void): F1; - set(state: string): F1; - step(deltaTime: number): F1; - update(): F1; -} - -declare function F1(settings?: F1Options): F1; - -export = F1; diff --git a/f1/tslint.json b/f1/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/f1/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/fabric/fabric-tests.ts b/fabric/fabric-tests.ts deleted file mode 100644 index 923b29d896..0000000000 --- a/fabric/fabric-tests.ts +++ /dev/null @@ -1,1047 +0,0 @@ -import * as fabric from "fabric"; - -function sample1() { - var canvas = new fabric.Canvas('c', { - hoverCursor: 'pointer', - selection: false, - }); - - canvas.on('object:moving', (e: fabric.IEvent) => { - e.target.opacity = 0.5; - }); - canvas.on('object:modified', (e: fabric.IEvent) => { - e.target.opacity = 1; - }); - - for (var i = 0, len = 15; i < len; i++) { - fabric.Image.fromURL('../assets/ladybug.png', img => { - img.set({ - left: fabric.util.getRandomInt(0, 600), - top: fabric.util.getRandomInt(0, 500), - angle: fabric.util.getRandomInt(0, 90) - }); - - img.perPixelTargetFind = true; - // img.targetFindTolerance = 4; - img.hasControls = img.hasBorders = false; - - img.scale(fabric.util.getRandomInt(50, 100) / 100); - - canvas.add(img); - }); - } -} - -function sample2() { - - var dot: fabric.Circle, i: number, - t1: number, t2: number, - startTimer = () => { - t1 = new Date().getTime(); - return t1; - }, - stopTimer = () => { - t2 = new Date().getTime(); - return t2 - t1; - }, - getRandomInt = fabric.util.getRandomInt, - rainbow = ["#ffcc66", "#ccff66", "#66ccff", "#ff6fcf", "#ff6666"], - rainbowEnd = rainbow.length - 1; - - // - // Rendering canvas #1 - // - var canvas1 = new fabric.Canvas('c1', { backgroundColor: "#000" }), - results1 = document.getElementById('results-c1'); - - startTimer(); - for (i = 100; i >= 0; i--) { - dot = new fabric.Circle({ - left: getRandomInt(0, 400), - top: getRandomInt(0, 350), - radius: 3, - fill: rainbow[getRandomInt(0, rainbowEnd)] - }); - canvas1.add(dot); - } - results1.innerHTML = 'Regular rendering of 100 elements in ' + stopTimer() + 'ms'; - - - // - // Rendering canvas #2 - // - var canvas2 = new fabric.Canvas('c2', { backgroundColor: "#000", renderOnAddRemove: false }), - results2 = document.getElementById('results-c2'); - - startTimer(); - for (i = 1000; i >= 0; i--) { - dot = new fabric.Circle({ - left: getRandomInt(0, 400), - top: getRandomInt(0, 350), - radius: 3, - fill: rainbow[getRandomInt(0, rainbowEnd)] - }); - canvas2.add(dot); - } - canvas2.renderAll(); // Note, calling renderAll() is important in this case - results2.innerHTML = 'Rendering 1000 elements using canvas.renderOnAddRemove = false in ' + stopTimer() + 'ms'; -} - -function sample3() { - - var $: (id: string) => HTMLElement = (id: string) => document.getElementById(id); - - function applyFilter(index: number, filter: any) { - var obj: fabric.Image = canvas.getActiveObject(); - obj.filters[index] = filter; - obj.applyFilters(canvas.renderAll.bind(canvas)); - } - - function applyFilterValue(index: number, prop: string, value: any) { - var obj: fabric.Image = canvas.getActiveObject(); - if (obj.filters[index]) { - obj.applyFilters(canvas.renderAll.bind(canvas)); - } - } - - var canvas = new fabric.Canvas('c', { backgroundImage: '../lib/bg.png' }), - f = fabric.Image.filters; - - canvas.on({ - 'object:selected': () => { - fabric.util.toArray(document.getElementsByTagName('input')).forEach(el => { el.disabled = false; }); - - var filters = ['grayscale', 'invert', 'remove-white', 'sepia', 'sepia2', 'brightness', - 'noise', 'gradient-transparency', 'pixelate', 'blur', 'sharpen']; - - for (var i = 0; i < filters.length; i++) { - var checkBox = $(filters[i]); - var image = canvas.getActiveObject(); - checkBox.checked = !!image.filters[i]; - } - }, - 'selection:cleared': () => { - fabric.util.toArray(document.getElementsByTagName('input')).forEach(el => { el.disabled = true; }); - } - }); - - fabric.Image.fromURL('../assets/printio.png', img => { - var oImg = img.set({ left: 300, top: 300, angle: -15 }).scale(0.9); - canvas.add(oImg).renderAll(); - canvas.setActiveObject(oImg); - }); - - $('grayscale').onclick = function(this: HTMLInputElement) { - applyFilter(0, this.checked && new f.Grayscale()); - }; - $('invert').onclick = function(this: HTMLInputElement) { - applyFilter(1, this.checked && new f.Invert()); - }; - $('remove-white').onclick = function(this: HTMLInputElement) { - applyFilter(2, this.checked && new f.RemoveWhite({ - threshold: parseInt(( $('remove-white-threshold')).value, 10), - distance: parseInt(( $('remove-white-distance')).value, 10) - })); - }; - $('remove-white-threshold').onchange = function(this: HTMLInputElement) { - applyFilterValue(2, 'threshold', this.value); - }; - $('remove-white-distance').onchange = function(this: HTMLInputElement) { - applyFilterValue(2, 'distance', this.value); - }; - $('sepia').onclick = function(this: HTMLInputElement) { - applyFilter(3, this.checked && new f.Sepia()); - }; - $('sepia2').onclick = function(this: HTMLInputElement) { - applyFilter(4, this.checked && new f.Sepia2()); - }; - $('brightness').onclick = function(this: HTMLInputElement) { - applyFilter(5, this.checked && new f.Brightness({ - brightness: parseInt(( $('brightness-value')).value, 10) - })); - }; - $('brightness-value').onchange = function(this: HTMLInputElement) { - applyFilterValue(5, 'brightness', parseInt(this.value, 10)); - }; - $('noise').onclick = function(this: HTMLInputElement) { - applyFilter(6, this.checked && new f.Noise({ - noise: parseInt(( $('noise-value')).value, 10) - })); - }; - $('noise-value').onchange = function(this: HTMLInputElement) { - applyFilterValue(6, 'noise', parseInt(this.value, 10)); - }; - $('gradient-transparency').onclick = function(this: HTMLInputElement) { - applyFilter(7, this.checked && new f.GradientTransparency({ - threshold: parseInt(( $('gradient-transparency-value')).value, 10) - })); - }; - $('gradient-transparency-value').onchange = function(this: HTMLInputElement) { - applyFilterValue(7, 'threshold', parseInt(this.value, 10)); - }; - $('pixelate').onclick = function(this: HTMLInputElement) { - applyFilter(8, this.checked && new f.Pixelate({ - blocksize: parseInt(( $('pixelate-value')).value, 10) - })); - }; - $('pixelate-value').onchange = function(this: HTMLInputElement) { - applyFilterValue(8, 'blocksize', parseInt(this.value, 10)); - }; - $('blur').onclick = function(this: HTMLInputElement) { - applyFilter(9, this.checked && new f.Convolute({ - matrix: [1 / 9, 1 / 9, 1 / 9, - 1 / 9, 1 / 9, 1 / 9, - 1 / 9, 1 / 9, 1 / 9] - })); - }; - $('sharpen').onclick = function(this: HTMLInputElement) { - applyFilter(10, this.checked && new f.Convolute({ - matrix: [0, -1, 0, - -1, 5, -1, - 0, -1, 0] - })); - }; - $('emboss').onclick = function(this: HTMLInputElement) { - applyFilter(11, this.checked && new f.Convolute({ - matrix: [1, 1, 1, - 1, 0.7, -1, - -1, -1, -1] - })); - }; -} - -function sample4() { - - var canvas = new fabric.Canvas('c'); - var $: (id: string) => HTMLElement = id => document.getElementById(id); - - var rect = new fabric.Rect({ - width: 100, - height: 100, - top: 150, - left: 150, - fill: 'rgba(255,0,0,0.5)' - }); - - canvas.add(rect); - - var angleControl = $('angle-control'); - angleControl.onchange = function(this: HTMLInputElement) { - rect.setAngle(+this.value).setCoords(); - canvas.renderAll(); - }; - - var scaleControl = $('scale-control'); - scaleControl.onchange = function(this: HTMLInputElement) { - rect.scale(+this.value).setCoords(); - canvas.renderAll(); - }; - - var topControl = $('top-control'); - topControl.onchange = function(this: HTMLInputElement) { - rect.setTop(+this.value).setCoords(); - canvas.renderAll(); - }; - - var leftControl = $('left-control'); - leftControl.onchange = function(this: HTMLInputElement) { - rect.setLeft(+this.value).setCoords(); - canvas.renderAll(); - }; - - function updateControls() { - - scaleControl.value = rect.getScaleX().toString(); - angleControl.value = rect.getAngle().toString(); - leftControl.value = rect.getLeft().toString(); - topControl.value = rect.getTop().toString(); - } - canvas.on({ - 'object:moving': updateControls, - 'object:scaling': updateControls, - 'object:resizing': updateControls - }); -} - - -declare module "fabric" { - export interface CircleWithLineInfos extends Circle { - line1?: Line; - line2?: Line; - line3?: Line; - line4?: Line; - } -} - -function sample5() { - var makeCircle = (left: number, top: number, line1?: fabric.Line, line2?: fabric.Line, line3?: fabric.Line, line4?: fabric.Line): fabric.Circle => { - var c = new fabric.Circle({ - left, - top, - strokeWidth: 5, - radius: 12, - fill: '#fff', - stroke: '#666' - }); - - c.line1 = line1; - c.line2 = line2; - c.line3 = line3; - c.line4 = line4; - c.hasControls = c.hasBorders = false; - return c; - }; - - function makeLine(coords: number[]) { - return new fabric.Line(coords, { - fill: 'red', - strokeWidth: 5, - selectable: false - }); - } - - var canvas = new fabric.Canvas('c', { selection: false }); - - var line = makeLine([250, 125, 250, 175]), - line2 = makeLine([250, 175, 250, 250]), - line3 = makeLine([250, 250, 300, 350]), - line4 = makeLine([250, 250, 200, 350]), - line5 = makeLine([250, 175, 175, 225]), - line6 = makeLine([250, 175, 325, 225]); - - canvas.add(line, line2, line3, line4, line5, line6); - - canvas.add( - makeCircle(line.x1, line.y1, null, line), - makeCircle(line.x2, line.y2, line, line2, line5, line6), - makeCircle(line2.x2, line2.y2, line2, line3, line4), - makeCircle(line3.x2, line3.y2, line3), - makeCircle(line4.x2, line4.y2, line4), - makeCircle(line5.x2, line5.y2, line5), - makeCircle(line6.x2, line6.y2, line6) - ); - - canvas.on('object:moving', e => { - var p = e.target; - p.line1 && p.line1.set({ 'x2': p.left, 'y2': p.top }); - p.line2 && p.line2.set({ 'x1': p.left, 'y1': p.top }); - p.line3 && p.line3.set({ 'x1': p.left, 'y1': p.top }); - p.line4 && p.line4.set({ 'x1': p.left, 'y1': p.top }); - canvas.renderAll(); - }); -} - -function sample6() { - var canvas = new fabric.Canvas('c'); - fabric.loadSVGFromURL('../assets/135.svg', objects => { - var obj = objects[0].scale(0.25); - canvas.centerObject(obj); - canvas.add(obj); - - canvas.add(obj.clone(() => { }).set({ left: 100, top: 100, angle: -15 })); - canvas.add(obj.clone(() => { }).set({ left: 480, top: 100, angle: 15 })); - canvas.add(obj.clone(() => { }).set({ left: 100, top: 400, angle: -15 })); - canvas.add(obj.clone(() => { }).set({ left: 480, top: 400, angle: 15 })); - - canvas.on('mouse:move', options => { - var p = canvas.getPointer(options.e); - - canvas.forEachObject(obj => { - var distX = Math.abs(p.x - obj.left), - distY = Math.abs(p.y - obj.top), - dist = Math.round(Math.sqrt(Math.pow(distX, 2) + Math.pow(distY, 2))); - obj.setOpacity(1 / (dist / 20)); - }); - - }); - - }); -} - -declare module "fabric" { - export interface ImageWithInfo extends Image { - movingLeft: boolean; - } -} - -function sample7() { - - var canvas = new fabric.Canvas('c', { selection: false }); - - setInterval(() => { - fabric.Image.fromURL('../assets/ladybug.png', obj => { - var img = obj; - img.set('left', fabric.util.getRandomInt(200, 600)).set('top', -50); - img.movingLeft = !!Math.round(Math.random()); - canvas.add(img); - }); - }, 1000); - - - var animate = (function animate() { - canvas.forEachObject(obj => { - var img = obj; - img.left += (img.movingLeft ? -1 : 1); - img.top += 1; - if (img.left > 900 || img.top > 500) { - canvas.remove(img); - } else { - img.setAngle(img.getAngle() + 2); - } - }); - canvas.renderAll(); - window.requestAnimationFrame(animate); - }); - - animate(); -} - -function sample8() { - - function pad(str: string, length: number): string { - while (str.length < length) { - str = '0' + str; - } - return str; - } - - var getRandomInt = fabric.util.getRandomInt; - - function getRandomColor() { - return ( - pad(getRandomInt(0, 255).toString(16), 2) + - pad(getRandomInt(0, 255).toString(16), 2) + - pad(getRandomInt(0, 255).toString(16), 2) - ); - } - - function getRandomNum(min: number, max: number): number { - return Math.random() * (max - min) + min; - } - - if (/(iPhone|iPod|iPad)/i.test(navigator.userAgent)) { - (fabric.Object.prototype as any).cornersize = 30; - } - - var canvas = new fabric.Canvas('canvas'); - // canvas.controlsAboveOverlay = true; - - function updateComplexity() { - setTimeout(() => { - var element = document.getElementById('complexity').childNodes[1]; - element.innerHTML = ' ' + canvas.complexity(); - }, 100); - } - - document.getElementById('commands').onclick = (ev: any) => { - var ev: any = ev || window.event; - - if (ev.preventDefault) { - ev.preventDefault(); - } else if (ev.returnValue) { - ev.returnValue = false; - } - - var element: any = ev.target || ev.srcElement; - if (element.nodeName.toLowerCase() === 'strong') { - element = element.parentNode; - } - - var className = element.className, - offset = 50, - left = fabric.util.getRandomInt(0 + offset, 700 - offset), - top = fabric.util.getRandomInt(0 + offset, 500 - offset), - angle = fabric.util.getRandomInt(-20, 40), - width = fabric.util.getRandomInt(30, 50), - opacity = ((min: number, max: number) => Math.random() * (max - min) + min)(0.5, 1); - - - switch (className) { - case 'rect': - canvas.add(new fabric.Rect({ - left, - top, - fill: '#' + getRandomColor(), - width: 50, - height: 50, - opacity: 0.8 - })); - break; - - case 'circle': - canvas.add(new fabric.Circle({ - left, - top, - fill: '#' + getRandomColor(), - radius: 50, - opacity: 0.8 - })); - break; - - case 'triangle': - canvas.add(new fabric.Triangle({ - left, - top, - fill: '#' + getRandomColor(), - width: 50, - height: 50, - opacity: 0.8 - })); - break; - - case 'image1': - fabric.Image.fromURL('../assets/pug.jpg', image => { - image.set({ - left, - top, - angle, - padding: 10, - cornersize: 10 - }); - image.scale(getRandomNum(0.1, 0.25)).setCoords(); - canvas.add(image); - }); - break; - - case 'image2': - fabric.Image.fromURL('../assets/logo.png', image => { - image.set({ - left, - top, - angle, - padding: 10, - cornersize: 10 - }); - image.scale(getRandomNum(0.1, 1)).setCoords(); - canvas.add(image); - updateComplexity(); - }); - break; - - case 'shape': - var id: any = element.id; - const match = /\d+$/.exec(id); - if (match) { - fabric.loadSVGFromURL('../assets/' + match[0] + '.svg', (objects, options) => { - var loadedObject = fabric.util.groupSVGElements(objects, options); - - loadedObject.set({ - left, - top, - angle, - padding: 10, - cornersize: 10 - }); - loadedObject/*.scaleToWidth(300)*/.setCoords(); - - // loadedObject.hasRotatingPoint = true; - - canvas.add(loadedObject); - updateComplexity(); - canvas.calcOffset(); - }); - } - break; - - case 'clear': - if (confirm('Are you sure?')) { - canvas.clear(); - } - } - updateComplexity(); - }; - - document.getElementById('execute').onclick = () => { - var code = ( document.getElementById('canvas-console')).value; - if (!(/^\s+$/).test(code)) { - eval(code); // tslint:disable-line:no-eval - } - }; - - - document.getElementById('rasterize').onclick = () => { - if (!fabric.Canvas.supports('toDataURL')) { - alert('This browser doesn\'t provide means to serialize canvas to an image'); - } else { - window.open(canvas.toDataURL('png')); - } - }; - - var removeSelectedEl = document.getElementById('remove-selected'); - removeSelectedEl.onclick = () => { - var activeObject = canvas.getActiveObject(), - activeGroup = canvas.getActiveGroup(); - if (activeObject) { - canvas.remove(activeObject); - } else if (activeGroup) { - var objectsInGroup = activeGroup.getObjects(); - canvas.discardActiveGroup(); - objectsInGroup.forEach(object => { - canvas.remove(object); - }); - } - }; - - var supportsInputOfType = (type: string) => { - return () => { - var el = document.createElement('input'); - try { - el.type = type; - } catch (err) { } - return el.type === type; - }; - }; - - var supportsSlider = supportsInputOfType('range'), - supportsColorpicker = supportsInputOfType('color'); - - if (supportsSlider()) { - (() => { - var controls = document.getElementById('controls'); - - var sliderLabel = document.createElement('label'); - sliderLabel.htmlFor = 'opacity'; - sliderLabel.innerHTML = 'Opacity: '; - - var slider = document.createElement('input'); - - try { slider.type = 'range'; } catch (err) { } - - slider.id = 'opacity'; - slider.value = "100"; - - controls.appendChild(sliderLabel); - controls.appendChild(slider); - - canvas.calcOffset(); - - slider.onchange = function() { - var activeObject = canvas.getActiveObject(), - activeGroup = canvas.getActiveGroup(); - - if (activeObject || activeGroup) { - (activeObject || activeGroup).setOpacity(parseInt(this.value, 10) / 100); - canvas.renderAll(); - } - }; - })(); - } - - if (supportsColorpicker()) { - (() => { - var controls = document.getElementById('controls'); - - var label = document.createElement('label'); - label.htmlFor = 'color'; - label.innerHTML = 'Color: '; - label.style.marginLeft = '10px'; - - var colorpicker = document.createElement('input'); - colorpicker.type = 'color'; - colorpicker.id = 'color'; - colorpicker.style.width = '40px'; - - controls.appendChild(label); - controls.appendChild(colorpicker); - - canvas.calcOffset(); - - colorpicker.onchange = function() { - var activeObject = canvas.getActiveObject(), - activeGroup = canvas.getActiveGroup(); - - if (activeObject || activeGroup) { - (activeObject || activeGroup).setFill(this.value); - canvas.renderAll(); - } - }; - })(); - } - - var lockHorizontallyEl = document.getElementById('lock-horizontally'); - lockHorizontallyEl.onclick = () => { - var activeObject: any = canvas.getActiveObject(); - if (activeObject) { - activeObject.lockMovementX = !activeObject.lockMovementX; - lockHorizontallyEl.innerHTML = activeObject.lockMovementX - ? 'Unlock horizontal movement' - : 'Lock horizontal movement'; - } - }; - - var lockVerticallyEl = document.getElementById('lock-vertically'); - lockVerticallyEl.onclick = () => { - var activeObject: any = canvas.getActiveObject(); - if (activeObject) { - activeObject.lockMovementY = !activeObject.lockMovementY; - lockVerticallyEl.innerHTML = activeObject.lockMovementY - ? 'Unlock vertical movement' - : 'Lock vertical movement'; - } - }; - - var lockScalingXEl = document.getElementById('lock-scaling-x'); - lockScalingXEl.onclick = () => { - var activeObject: any = canvas.getActiveObject(); - if (activeObject) { - activeObject.lockScalingX = !activeObject.lockScalingX; - lockScalingXEl.innerHTML = activeObject.lockScalingX - ? 'Unlock horizontal scaling' - : 'Lock horizontal scaling'; - } - }; - - var lockScalingYEl = document.getElementById('lock-scaling-y'); - lockScalingYEl.onclick = () => { - var activeObject: any = canvas.getActiveObject(); - if (activeObject) { - activeObject.lockScalingY = !activeObject.lockScalingY; - lockScalingYEl.innerHTML = activeObject.lockScalingY - ? 'Unlock vertical scaling' - : 'Lock vertical scaling'; - } - }; - - var lockRotationEl = document.getElementById('lock-rotation'); - lockRotationEl.onclick = () => { - var activeObject: any = canvas.getActiveObject(); - if (activeObject) { - activeObject.lockRotation = !activeObject.lockRotation; - lockRotationEl.innerHTML = activeObject.lockRotation - ? 'Unlock rotation' - : 'Lock rotation'; - } - }; - - var gradientifyBtn = document.getElementById('gradientify'); - - var activeObjectButtons = [ - lockHorizontallyEl, - lockVerticallyEl, - lockScalingXEl, - lockScalingYEl, - lockRotationEl, - removeSelectedEl, - gradientifyBtn - ]; - - var opacityEl = document.getElementById('opacity'); - if (opacityEl) { - activeObjectButtons.push(opacityEl); - } - var colorEl = document.getElementById('color'); - if (colorEl) { - activeObjectButtons.push(colorEl); - } - - for (var i = activeObjectButtons.length; i--; ) { - activeObjectButtons[i]; - } - - canvas.on('object:selected', onObjectSelected); - canvas.on('group:selected', onObjectSelected); - - function onObjectSelected(e: fabric.IEvent) { - var selectedObject = e.target; - - for (var i = activeObjectButtons.length; i--; ) { - activeObjectButtons[i]; - } - - lockHorizontallyEl.innerHTML = (selectedObject.lockMovementX ? 'Unlock horizontal movement' : 'Lock horizontal movement'); - lockVerticallyEl.innerHTML = (selectedObject.lockMovementY ? 'Unlock vertical movement' : 'Lock vertical movement'); - lockScalingXEl.innerHTML = (selectedObject.lockScalingX ? 'Unlock horizontal scaling' : 'Lock horizontal scaling'); - lockScalingYEl.innerHTML = (selectedObject.lockScalingY ? 'Unlock vertical scaling' : 'Lock vertical scaling'); - lockRotationEl.innerHTML = (selectedObject.lockRotation ? 'Unlock rotation' : 'Lock rotation'); - } - - canvas.on('selection:cleared', e => { - for (var i = activeObjectButtons.length; i--; ) { - activeObjectButtons[i]; - } - }); - - var drawingModeEl = document.getElementById('drawing-mode'), - drawingOptionsEl = document.getElementById('drawing-mode-options'), - drawingColorEl = document.getElementById('drawing-color'), - drawingLineWidthEl = document.getElementById('drawing-line-width'); - - drawingModeEl.onclick = () => { - var canvasWithDrawingMode: any = canvas; - canvasWithDrawingMode.isDrawingMode = !canvasWithDrawingMode.isDrawingMode; - if (canvasWithDrawingMode.isDrawingMode) { - drawingModeEl.innerHTML = 'Cancel drawing mode'; - drawingModeEl.className = 'is-drawing'; - drawingOptionsEl.style.display = ''; - } else { - drawingModeEl.innerHTML = 'Enter drawing mode'; - drawingModeEl.className = ''; - drawingOptionsEl.style.display = 'none'; - } - }; - - canvas.on('path:created', () => { - updateComplexity(); - }); - - drawingColorEl.onchange = () => { - canvas.freeDrawingColor = drawingColorEl.value; - }; - drawingLineWidthEl.onchange = () => { - canvas.freeDrawingLineWidth = parseInt(drawingLineWidthEl.value, 10) || 1; // disallow 0, NaN, etc. - }; - - canvas.freeDrawingColor = drawingColorEl.value; - canvas.freeDrawingLineWidth = parseInt(drawingLineWidthEl.value, 10) || 1; - - - var text = 'Lorem ipsum dolor sit amet,\nconsectetur adipisicing elit,\nsed do eiusmod tempor incididunt\nut labore et dolore magna aliqua.\n' + - 'Ut enim ad minim veniam,\nquis nostrud exercitation ullamco\nlaboris nisi ut aliquip ex ea commodo consequat.'; - - document.getElementById('add-text').onclick = () => { - var textSample = new fabric.Text(text.slice(0, getRandomInt(0, text.length)), { - left: getRandomInt(350, 400), - top: getRandomInt(350, 400), - fontFamily: 'helvetica', - angle: getRandomInt(-10, 10), - fill: '#' + getRandomColor(), - scaleX: 0.5, - scaleY: 0.5, - fontWeight: '' - }); - canvas.add(textSample); - updateComplexity(); - }; - - - document.onkeydown = e => { - var obj = canvas.getActiveObject() || canvas.getActiveGroup(); - if (obj && e.keyCode === 8) { - // this is horrible. need to fix, so that unified interface can be used - if (obj.type === 'group') { - // var groupObjects = obj.getObjects(); - // canvas.discardActiveGroup(); - // groupObjects.forEach(function(obj) { - // canvas.remove(obj); - // }); - } else { - // canvas.remove(obj); - } - canvas.renderAll(); - // return false; - } - }; - - setTimeout(() => { - canvas.calcOffset(); - }, 100); - - if (document.location.search.indexOf('guidelines') > -1) { - // initCenteringGuidelines(canvas); - // initAligningGuidelines(canvas); - } - - gradientifyBtn.onclick = () => { - var obj = canvas.getActiveObject(); - if (obj) { - obj.setGradient("fill", { - x2: (getRandomInt(0, 1) ? 0 : obj.width), - y2: (getRandomInt(0, 1) ? 0 : obj.height), - colorStops: { - 0: '#' + getRandomColor(), - 1: '#' + getRandomColor() - } - }); - canvas.renderAll(); - } - }; - - var textEl = document.getElementById('text'); - if (textEl) { - textEl.onfocus = function() { - var activeObject = canvas.getActiveObject(); - - if (activeObject && activeObject.type === 'text') { - this.value = ( activeObject).text; - } - }; - textEl.onkeyup = function(e) { - var activeObject = canvas.getActiveObject(); - if (activeObject) { - if (!this.value) { - canvas.discardActiveObject(); - } else { - ( activeObject).text = this.value; - } - canvas.renderAll(); - } - }; - } - - var cmdUnderlineBtn = document.getElementById('text-cmd-underline'); - if (cmdUnderlineBtn) { - activeObjectButtons.push(cmdUnderlineBtn); - cmdUnderlineBtn.onclick = function() { - var activeObject = canvas.getActiveObject(); - if (activeObject && activeObject.type === 'text') { - activeObject.textDecoration = (activeObject.textDecoration === 'underline' ? '' : 'underline'); - this.className = activeObject.textDecoration ? 'selected' : ''; - canvas.renderAll(); - } - }; - } - - var cmdLinethroughBtn = document.getElementById('text-cmd-linethrough'); - if (cmdLinethroughBtn) { - activeObjectButtons.push(cmdLinethroughBtn); - cmdLinethroughBtn.onclick = function() { - var activeObject = canvas.getActiveObject(); - if (activeObject && activeObject.type === 'text') { - activeObject.textDecoration = (activeObject.textDecoration === 'line-through' ? '' : 'line-through'); - this.className = activeObject.textDecoration ? 'selected' : ''; - canvas.renderAll(); - } - }; - } - - var cmdOverlineBtn = document.getElementById('text-cmd-overline'); - if (cmdOverlineBtn) { - activeObjectButtons.push(cmdOverlineBtn); - cmdOverlineBtn.onclick = function() { - var activeObject = canvas.getActiveObject(); - if (activeObject && activeObject.type === 'text') { - activeObject.textDecoration = (activeObject.textDecoration === 'overline' ? '' : 'overline'); - this.className = activeObject.textDecoration ? 'selected' : ''; - canvas.renderAll(); - } - }; - } - - var cmdBoldBtn = document.getElementById('text-cmd-bold'); - if (cmdBoldBtn) { - activeObjectButtons.push(cmdBoldBtn); - cmdBoldBtn.onclick = function() { - var activeObject = canvas.getActiveObject(); - if (activeObject && activeObject.type === 'text') { - activeObject.fontWeight = (activeObject.fontWeight === 'bold' ? '' : 'bold'); - this.className = activeObject.fontWeight ? 'selected' : ''; - canvas.renderAll(); - } - }; - } - - var cmdItalicBtn = document.getElementById('text-cmd-italic'); - if (cmdItalicBtn) { - activeObjectButtons.push(cmdItalicBtn); - cmdItalicBtn.onclick = function() { - var activeObject = canvas.getActiveObject(); - if (activeObject && activeObject.type === 'text') { - activeObject.fontStyle = (activeObject.fontStyle === 'italic' ? '' : 'italic'); - this.className = activeObject.fontStyle ? 'selected' : ''; - canvas.renderAll(); - } - }; - } - - var cmdShadowBtn = document.getElementById('text-cmd-shadow'); - if (cmdShadowBtn) { - activeObjectButtons.push(cmdShadowBtn); - cmdShadowBtn.onclick = function() { - var activeObject = canvas.getActiveObject(); - if (activeObject && activeObject.type === 'text') { - activeObject.shadow = !activeObject.shadow ? 'rgba(0,0,0,0.2) 2px 2px 10px' : ''; - this.className = activeObject.shadow ? 'selected' : ''; - canvas.renderAll(); - } - }; - } - - var textAlignSwitch = document.getElementById('text-align'); - if (textAlignSwitch) { - activeObjectButtons.push(textAlignSwitch); - textAlignSwitch.onchange = function(this: HTMLInputElement) { - var activeObject = canvas.getActiveObject(); - if (activeObject && activeObject.type === 'text') { - activeObject.textAlign = this.value.toLowerCase(); - canvas.renderAll(); - } - }; - } - - var fontFamilySwitch = document.getElementById('font-family'); - if (fontFamilySwitch) { - activeObjectButtons.push(fontFamilySwitch); - fontFamilySwitch.onchange = function(this: HTMLInputElement) { - var activeObject = canvas.getActiveObject(); - if (activeObject && activeObject.type === 'text') { - activeObject.fontFamily = this.value; - canvas.renderAll(); - } - }; - } - - var bgColorField = document.getElementById('text-bg-color'); - if (bgColorField) { - bgColorField.onchange = function(this: HTMLInputElement) { - var activeObject = canvas.getActiveObject(); - if (activeObject && activeObject.type === 'text') { - activeObject.backgroundColor = this.value; - canvas.renderAll(); - } - }; - } - - var strokeColorField = document.getElementById('text-stroke-color'); - if (strokeColorField) { - strokeColorField.onchange = function(this: HTMLInputElement) { - var activeObject = canvas.getActiveObject(); - if (activeObject && activeObject.type === 'text') { - activeObject.stroke = this.value; - canvas.renderAll(); - } - }; - } - - if (supportsSlider) { - (() => { - var container = document.getElementById('text-controls'); - var slider = document.createElement('input'); - var label = document.createElement('label'); - label.innerHTML = 'Line height: '; - try { slider.type = 'range'; } catch (err) { } - slider.min = "0"; - slider.max = "10"; - slider.step = "0.1"; - slider.value = "1.5"; - container.appendChild(label); - label.appendChild(slider); - slider.title = "Line height"; - slider.onchange = function() { - var activeObject = canvas.getActiveObject(); - if (activeObject && activeObject.type === 'text') { - activeObject.lineHeight = +this.value; - canvas.renderAll(); - } - }; - - canvas.on('object:selected', (e: fabric.IEvent) => { - slider.value = String(( e.target).lineHeight); - }); - })(); - } - - document.getElementById('load-svg').onclick = () => { - var svg = ( document.getElementById('svg-console')).value; - fabric.loadSVGFromString(svg, (objects, options) => { - var obj = fabric.util.groupSVGElements(objects, options); - canvas.add(obj).centerObject(obj).renderAll(); - obj.setCoords(); - }); - }; -} - -function sample9() { - var canvas = new fabric.Canvas('c'); - canvas.setBackgroundImage('yolo.jpg', () => { "a"; }, { opacity: 45 }); - canvas.setBackgroundImage('yolo.jpg', () => { "a"; }); -} diff --git a/fabric/index.d.ts b/fabric/index.d.ts deleted file mode 100644 index 881be190bd..0000000000 --- a/fabric/index.d.ts +++ /dev/null @@ -1,4527 +0,0 @@ -// Type definitions for FabricJS 1.5 -// Project: http://fabricjs.com/ -// Definitions by: Oliver Klemencic , Joseph Livecchi , Michael Randolph -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export as namespace fabric; - -export var isLikelyNode: boolean; -export var isTouchSupported: boolean; - -///////////////////////////////////////////////////////////// -// farbic Functions -///////////////////////////////////////////////////////////// - -export function createCanvasForNode(width: number, height: number): Canvas; - -// Parse -// ---------------------------------------------------------- -/** - * Creates markup containing SVG referenced elements like patterns, gradients etc. - * @param {fabric.Canvas} canvas instance of fabric.Canvas - */ -export function createSVGRefElementsMarkup(canvas: StaticCanvas): string; -/** - * Creates markup containing SVG font faces - * @param {Array} objects Array of fabric objects - */ -export function createSVGFontFacesMarkup(objects: Object[]): string; -/** - * Takes string corresponding to an SVG document, and parses it into a set of fabric objects - * @param {String} string - * @param {Function} callback - * @param {Function} [reviver] Method for further parsing of SVG elements, called after each fabric object created. - */ -export function loadSVGFromString(string: string, callback: (results: Object[], options: any) => void, reviver?: Function): void; -/** - * Takes url corresponding to an SVG document, and parses it into a set of fabric objects. - * Note that SVG is fetched via XMLHttpRequest, so it needs to conform to SOP (Same Origin Policy) - * @param {String} url - * @param {Function} callback - * @param {Function} [reviver] Method for further parsing of SVG elements, called after each fabric object created. - */ -export function loadSVGFromURL(url: string, callback: (results: Object[], options: any) => void, reviver?: Function): void; -/** - * Returns CSS rules for a given SVG document - * @param {SVGDocument} doc SVG document to parse - */ -export function getCSSRules(doc: SVGElement): any; - -export function parseElements(elements: any[], callback: Function, options: any, reviver?: Function): void; -/** - * Parses "points" attribute, returning an array of values - * @param {String} points points attribute string - */ -export function parsePointsAttribute(points: string): any[]; -/** - * Parses "style" attribute, retuning an object with values - * @param {SVGElement} element Element to parse - */ -export function parseStyleAttribute(element: SVGElement): any; -/** - * Transforms an array of svg elements to corresponding fabric.* instances - * @param {Array} elements Array of elements to parse - * @param {Function} callback Being passed an array of fabric instances (transformed from SVG elements) - * @param {Object} [options] Options object - * @param {Function} [reviver] Method for further parsing of SVG elements, called after each fabric object created. - */ -export function parseElements(elements: any[], callback: Function, options?: any, reviver?: Function): void; -/** - * Returns an object of attributes' name/value, given element and an array of attribute names; - * Parses parent "g" nodes recursively upwards. - * @param {DOMElement} element Element to parse - * @param {Array} attributes Array of attributes to parse - */ -export function parseAttributes(element: HTMLElement, attributes: string[], svgUid?: string): { [key: string]: string }; -/** - * Parses an SVG document, returning all of the gradient declarations found in it - * @param {SVGDocument} doc SVG document to parse - */ -export function getGradientDefs(doc: SVGElement): { [key: string]: any }; -/** - * Parses a short font declaration, building adding its properties to a style object - * @param {String} value font declaration - * @param {Object} oStyle definition - */ -export function parseFontDeclaration(value: string, oStyle: any): void; -/** - * Parses an SVG document, converts it to an array of corresponding fabric.* instances and passes them to a callback - * @param {SVGDocument} doc SVG document to parse - * @param {Function} callback Callback to call when parsing is finished; It's being passed an array of elements (parsed from a document). - * @param {Function} [reviver] Method for further parsing of SVG elements, called after each fabric object created. - */ -export function parseSVGDocument(doc: SVGElement, callback: (results: Object[], options: any) => void, reviver?: Function): void; -/** - * Parses "transform" attribute, returning an array of values - * @param {String} attributeValue String containing attribute value - */ -export function parseTransformAttribute(attributeValue: string): number[]; - -// fabric Log -// --------------- -/** - * Wrapper around `console.log` (when available) - */ -export function log(...values: any[]): void; -/** - * Wrapper around `console.warn` (when available) - */ -export function warn(...values: any[]): void; - -/////////////////////////////////////////////////////////////////////////////// -// Data Object Interfaces - These intrface are not specific part of fabric, -// They are just helpful for for defining function paramters -////////////////////////////////////////////////////////////////////////////// -interface IDataURLOptions { - /** - * The format of the output image. Either "jpeg" or "png" - */ - format?: string; - /** - * Quality level (0..1). Only used for jpeg - */ - quality?: number; - /** - * Multiplier to scale by - */ - multiplier?: number; - /** - * Cropping left offset. Introduced in v1.2.14 - */ - left?: number; - /** - * Cropping top offset. Introduced in v1.2.14 - */ - top?: number; - /** - * Cropping width. Introduced in v1.2.14 - */ - width?: number; - /** - * Cropping height. Introduced in v1.2.14 - */ - height?: number; -} - -interface IEvent { - e: Event; - target?: Object; -} - -interface IFillOptions { - /** - * options.source Pattern source - */ - source: string | HTMLImageElement; - /** - * Repeat property of a pattern (one of repeat, repeat-x, repeat-y or no-repeat) - */ - repeat?: string; - /** - * Pattern horizontal offset from object's left/top corner - */ - offsetX?: number; - /** - * Pattern vertical offset from object's left/top corner - */ - offsetY?: number; -} - -interface IToSVGOptions { - /** - * If true xml tag is not included - */ - suppressPreamble: boolean; - /** - * SVG viewbox object - */ - viewBox: IViewBox; - /** - * Encoding of SVG output - */ - encoding: string; -} - -interface IViewBox { - /** - * x-cooridnate of viewbox - */ - x: number; - /** - * y-coordinate of viewbox - */ - y: number; - /** - * Width of viewbox - */ - width: number; - /** - * Height of viewbox - */ - height: number; -} - -/////////////////////////////////////////////////////////////////////////////// -// Mixins Interfaces -////////////////////////////////////////////////////////////////////////////// -interface ICollection { - /** - * Adds objects to collection, then renders canvas (if `renderOnAddRemove` is not `false`) - * Objects should be instances of (or inherit from) fabric.Object - * @param {...fabric.Object} object Zero or more fabric instances - */ - add(...object: Object[]): T; - - /** - * Inserts an object into collection at specified index, then renders canvas (if `renderOnAddRemove` is not `false`) - * An object should be an instance of (or inherit from) fabric.Object - * @param {Object} object Object to insert - * @param {Number} index Index to insert object at - * @param {Boolean} nonSplicing When `true`, no splicing (shifting) of objects occurs - * @return {Self} thisArg - * @chainable - */ - insertAt(object: Object, index: number, nonSplicing: boolean): T; - - /** - * Removes objects from a collection, then renders canvas (if `renderOnAddRemove` is not `false`) - * @param {...fabric.Object} object Zero or more fabric instances - * @return {Self} thisArg - * @chainable - */ - remove(...object: Object[]): T; - - /** - * Executes given function for each object in this group - * @param {Function} callback - * @param {Object} context Context (aka thisObject) - * @return {Self} thisArg - */ - forEachObject(callback: (element: Object, index: number, array: Object[]) => any, context?: any): T; - - /** - * Returns an array of children objects of this instance - * Type parameter introduced in 1.3.10 - * @param {String} [type] When specified, only objects of this type are returned - * @return {Array} - */ - getObjects(type?: string): Object[]; - - /** - * Returns object at specified index - * @param {Number} index - * @return {Self} thisArg - */ - item(index: number): T; - - /** - * Returns true if collection contains no objects - * @return {Boolean} true if collection is empty - */ - isEmpty(): boolean; - - /** - * Returns a size of a collection (i.e: length of an array containing its objects) - * @return {Number} Collection size - */ - size(): number; - - /** - * Returns true if collection contains an object - * @param {Object} object Object to check against - * @return {Boolean} `true` if collection contains an object - */ - contains(object: Object): boolean; - - /** - * Returns number representation of a collection complexity - * @return {Number} complexity - */ - complexity(): number; -} - -interface IObservable { - /** - * Observes specified event - * @param eventName Event name (eg. 'after:render') - * @param handler Function that receives a notification when an event of the specified type occurs - */ - on(eventName: string, handler: (e: IEvent) => any): T; - - /** - * Observes specified event - * @param eventName Object with key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler}) - */ - on(eventName: {[key: string]: Function}): T; - /** - * Fires event with an optional options object - * @param {String} eventName Event name to fire - * @param {Object} [options] Options object - */ - trigger(eventName: string, options?: any): T; - /** - * Stops event observing for a particular event handler. Calling this method - * without arguments removes all handlers for all events - * @param eventName Event name (eg. 'after:render') or object with key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler}) - * @param handler Function to be deleted from EventListeners - */ - off(eventName?: string|any, handler?: (e: IEvent) => any): T; -} - -// animation mixin -// ---------------------------------------------------- -interface ICanvasAnimation { - FX_DURATION: number; - /** - * Centers object horizontally with animation. - * @param {fabric.Object} object Object to center - * @param {Object} [callbacks] Callbacks object with optional "onComplete" and/or "onChange" properties - * @param {Function} [callbacks.onComplete] Invoked on completion - * @param {Function} [callbacks.onChange] Invoked on every step of animation - */ - fxCenterObjectH(object: Object, callbacks?: { onComplete: Function; onChange: Function; }): T; - - /** - * Centers object vertically with animation. - * @param {fabric.Object} object Object to center - * @param {Object} [callbacks] Callbacks object with optional "onComplete" and/or "onChange" properties - * @param {Function} [callbacks.onComplete] Invoked on completion - * @param {Function} [callbacks.onChange] Invoked on every step of animation - */ - fxCenterObjectV(object: Object, callbacks?: { onComplete: Function; onChange: Function; }): T; - - /** - * Same as `fabric.Canvas#remove` but animated - * @param {fabric.Object} object Object to remove - * @param {Object} [callbacks] Callbacks object with optional "onComplete" and/or "onChange" properties - * @param {Function} [callbacks.onComplete] Invoked on completion - * @param {Function} [callbacks.onChange] Invoked on every step of animation - * @return {fabric.Canvas} thisArg - * @chainable - */ - fxRemove(object: Object, callbacks?: { onComplete: Function; onChange: Function; }): T; -} -interface IObjectAnimation { - /** - * Animates object's properties - * object.animate('left', ..., {duration: ...}); - * @param property Property to animate - * @param value Value to animate property - * @param options The animation options - */ - animate(property: string, value: number|string, options?: IAnimationOptions): Object; - /** - * Animates object's properties - * object.animate({ left: ..., top: ... }, { duration: ... }); - * @param properties Properties to animate - * @param value Options object - */ - animate(properties: any, options?: IAnimationOptions): Object; -} -interface IAnimationOptions { - /** - * Allows to specify starting value of animatable property (if we don't want current value to be used). - */ - from?: string|number; - /** - * Defaults to 500 (ms). Can be used to change duration of an animation. - */ - duration?: number; - /** - * Callback; invoked on every value change - */ - onChange?: Function; - /** - * Callback; invoked when value change is completed - */ - onComplete?: Function; - - /** - * Easing function. Default: fabric.util.ease.easeInSine - */ - easing?: Function; - /** - * Value to modify the property by, default: end - start - */ - by?: number; -} - -/////////////////////////////////////////////////////////////////////////////// -// General Fabric Interfaces -////////////////////////////////////////////////////////////////////////////// -export class Color { - /** - * Color class - * The purpose of Color is to abstract and encapsulate common color operations; - * @param {String} color optional in hex or rgb(a) format - */ - constructor(color?: string); - - /** - * Returns source of this color (where source is an array representation; ex: [200, 200, 100, 1]) - */ - getSource(): number[]; - - /** - * Sets source of this color (where source is an array representation; ex: [200, 200, 100, 1]) - */ - setSource(source: number[]): void; - - /** - * Returns color represenation in RGB format ex: rgb(0-255,0-255,0-255) - */ - toRgb(): string; - - /** - * Returns color represenation in RGBA format ex: rgba(0-255,0-255,0-255,0-1) - */ - toRgba(): string; - - /** - * Returns color represenation in HSL format ex: hsl(0-360,0%-100%,0%-100%) - */ - toHsl(): string; - - /** - * Returns color represenation in HSLA format ex: hsla(0-360,0%-100%,0%-100%,0-1) - */ - toHsla(): string; - - /** - * Returns color represenation in HEX format ex: FF5555 - */ - toHex(): string; - - /** - * Gets value of alpha channel for this color - */ - getAlpha(): number; - - /** - * Sets value of alpha channel for this color - * @param {Number} alpha Alpha value 0-1 - */ - setAlpha(alpha: number): void; - - /** - * Transforms color to its grayscale representation - */ - toGrayscale(): Color; - - /** - * Transforms color to its black and white representation - * @param {Number} threshold - */ - toBlackWhite(threshold: number): Color; - /** - * Overlays color with another color - * @param {String|fabric.Color} otherColor - */ - overlayWith(otherColor: string|Color): Color; - - /** - * Returns new color object, when given a color in RGB format - * @param {String} color Color value ex: rgb(0-255,0-255,0-255) - */ - static fromRgb(color: string): Color; - /** - * Returns new color object, when given a color in RGBA format - * @param {String} color Color value ex: rgb(0-255,0-255,0-255) - */ - static fromRgba(color: string): Color; - /** - * Returns array represenatation (ex: [100, 100, 200, 1]) of a color that's in RGB or RGBA format - * @param {String} color Color value ex: rgb(0-255,0-255,0-255), rgb(0%-100%,0%-100%,0%-100%) - */ - static sourceFromRgb(color: string): number[]; - /** - * Returns new color object, when given a color in HSL format - * @param {String} color Color value ex: hsl(0-260,0%-100%,0%-100%) - */ - static fromHsl(color: string): Color; - /** - * Returns new color object, when given a color in HSLA format - * @param {String} color Color value ex: hsl(0-260,0%-100%,0%-100%) - */ - static fromHsla(color: string): Color; - /** - * Returns array represenatation (ex: [100, 100, 200, 1]) of a color that's in HSL or HSLA format. - * @param {String} color Color value ex: hsl(0-360,0%-100%,0%-100%) or hsla(0-360,0%-100%,0%-100%, 0-1) - */ - static sourceFromHsl(color: string): number[]; - /** - * Returns new color object, when given a color in HEX format - * @param {String} color Color value ex: FF5555 - */ - static fromHex(color: string): Color; - - /** - * Returns array represenatation (ex: [100, 100, 200, 1]) of a color that's in HEX format - * @param {String} color ex: FF5555 - */ - static sourceFromHex(color: string): number[]; - /** - * Returns new color object, when given color in array representation (ex: [200, 100, 100, 0.5]) - * @param {Array} source - */ - static fromSource(source: number[]): Color; -} - -interface IGradientOptions { - /** - * @param {String} [options.type] Type of gradient 'radial' or 'linear' - */ - type?: string; - /** - * x-coordinate of start point - */ - x1?: number; - /** - * y-coordinate of start point - */ - y1?: number; - /** - * x-coordinate of end point - */ - x2?: number; - /** - * y-coordinate of end point - */ - y2?: number; - /** - * Radius of start point (only for radial gradients) - */ - r1?: number; - /** - * Radius of end point (only for radial gradients) - */ - r2?: number; - /** - * Color stops object eg. {0:string; 1:string; - */ - colorStops?: any; -} -interface IGradient extends IGradientOptions { - /** - * Adds another colorStop - * @param {Object} colorStop Object with offset and color - */ - addColorStop(colorStop: any): IGradient; - /** - * Returns object representation of a gradient - */ - toObject(): any; - /** - * Returns SVG representation of an gradient - * @param {Object} object Object to create a gradient for - * @param {Boolean} normalize Whether coords should be normalized - * @return {String} SVG representation of an gradient (linear/radial) - */ - toSVG(object: Object, normalize?: boolean): string; - - /** - * Returns an instance of CanvasGradient - * @param {CanvasRenderingContext2D} ctx Context to render on - */ - toLive(ctx: CanvasRenderingContext2D, object?: PathGroup): CanvasGradient; -} -interface IGrandientStatic { - new (options?: IGradientOptions): IGradient; - /** - * Returns instance from an SVG element - * @param {SVGGradientElement} el SVG gradient element - * @param {fabric.Object} instance - */ - fromElement(el: SVGGradientElement, instance: Object): IGradient; - /** - * Returns instance from its object representation - * @param {Object} obj - * @param {Object} [options] Options object - */ - fromObject(obj: any, options: any[]): IGradient; -} - -export class Intersection { - constructor(status?: string); - - /** - * Appends a point to intersection - */ - appendPoint(point: Point): void; - /** - * Appends points to intersection - */ - appendPoints(points: Point[]): void; - - /** - * Checks if polygon intersects another polygon - */ - static intersectPolygonPolygon(points1: Point[], points2: Point[]): Intersection; - /** - * Checks if line intersects polygon - */ - static intersectLinePolygon(a1: Point, a2: Point, points: Point[]): Intersection; - /** - * Checks if one line intersects another - */ - static intersectLineLine(a1: Point, a2: Point, b1: Point, b2: Point): Intersection; - /** - * Checks if polygon intersects rectangle - */ - static intersectPolygonRectangle(points: Point[], r1: number, r2: number): Intersection; -} - -interface IPatternOptions { - /** - * Repeat property of a pattern (one of repeat, repeat-x, repeat-y or no-repeat) - */ - repeat: string; - - /** - * Pattern horizontal offset from object's left/top corner - */ - offsetX: number; - - /** - * Pattern vertical offset from object's left/top corner - */ - offsetY: number; - /** - * The source for the pattern - */ - source: string|HTMLImageElement; -} -export interface Pattern extends IPatternOptions {} -export class Pattern { - constructor(options?: IPatternOptions); - - initialise(options?: IPatternOptions): Pattern; - /** - * Returns an instance of CanvasPattern - */ - toLive(ctx: CanvasRenderingContext2D): Pattern; - - /** - * Returns object representation of a pattern - */ - toObject(): any; - /** - * Returns SVG representation of a pattern - * @param {fabric.Object} object - */ - toSVG(object: Object): string; -} - -export class Point { - x: number; - y: number; - - constructor(x: number, y: number); - - /** - * Adds another point to this one and returns another one - * @param {fabric.Point} that - */ - add(that: Point): Point; - - /** - * Adds another point to this one - * @param {fabric.Point} that - */ - addEquals(that: Point): Point; - - /** - * Adds value to this point and returns a new one - * @param {Number} scalar - */ - scalarAdd(scalar: number): Point; - - /** - * Adds value to this point - * @param {Number} scalar - */ - scalarAddEquals(scalar: number): Point; - - /** - * Subtracts another point from this point and returns a new one - * @param {fabric.Point} that - */ - subtract(that: Point): Point; - - /** - * Subtracts another point from this point - * @param {fabric.Point} that - */ - subtractEquals(that: Point): Point; - - /** - * Subtracts value from this point and returns a new one - * @param {Number} scalar - */ - scalarSubtract(scalar: number): Point; - - /** - * Subtracts value from this point - * @param {Number} scalar - */ - scalarSubtractEquals(scalar: number): Point; - - /** - * Miltiplies this point by a value and returns a new one - * @param {Number} scalar - */ - multiply(scalar: number): Point; - - /** - * Miltiplies this point by a value - * @param {Number} scalar - */ - multiplyEquals(scalar: number): Point; - - /** - * Divides this point by a value and returns a new one - * @param {Number} scalar - */ - divide(scalar: number): Point; - - /** - * Divides this point by a value - * @param {Number} scalar - */ - divideEquals(scalar: number): Point; - - /** - * Returns true if this point is equal to another one - * @param {fabric.Point} that - */ - eq(that: Point): Point; - - /** - * Returns true if this point is less than another one - * @param {fabric.Point} that - */ - lt(that: Point): Point; - - /** - * Returns true if this point is less than or equal to another one - * @param {fabric.Point} that - */ - lte(that: Point): Point; - - /** - * Returns true if this point is greater another one - * @param {fabric.Point} that - */ - gt(that: Point): Point; - - /** - * Returns true if this point is greater than or equal to another one - * @param {fabric.Point} that - */ - gte(that: Point): Point; - - /** - * Returns new point which is the result of linear interpolation with this one and another one - * @param {fabric.Point} that - * @param {Number} t - */ - lerp(that: Point, t: number): Point; - - /** - * Returns distance from this point and another one - * @param {fabric.Point} that - */ - distanceFrom(that: Point): number; - - /** - * Returns the point between this point and another one - * @param {fabric.Point} that - */ - midPointFrom(that: Point): Point; - - /** - * Returns a new point which is the min of this and another one - * @param {fabric.Point} that - */ - min(that: Point): Point; - - /** - * Returns a new point which is the max of this and another one - * @param {fabric.Point} that - */ - max(that: Point): Point; - - /** - * Returns string representation of this point - */ - toString(): string; - - /** - * Sets x/y of this point - * @param {Number} x - * @param {Number} y - */ - setXY(x: number, y: number): Point; - - /** - * Sets x/y of this point from another point - * @param {fabric.Point} that - */ - setFromPoint(that: Point): Point; - - /** - * Swaps x/y of this point and another point - * @param {fabric.Point} that - */ - swap(that: Point): Point; -} - -interface IShadowOptions { - /** - * Whether the shadow should affect stroke operations - */ - affectStrike: boolean; - /** - * Shadow blur - */ - blur: number; - /** - * Shadow color - */ - color: string; - /** - * Indicates whether toObject should include default values - */ - includeDefaultValues: boolean; - /** - * Shadow horizontal offset - */ - offsetX: number; - /** - * Shadow vertical offset - */ - offsetY: number; -} -export interface IShadow extends IShadowOptions {} -export class IShadow { - constructor(options?: IShadowOptions); - initialize(options?: IShadowOptions|string): IShadow; - /** - * Returns object representation of a shadow - */ - toObject(): Object; - /** - * Returns a string representation of an instance, CSS3 text-shadow declaration - */ - toString(): string; - /** - * Returns SVG representation of a shadow - * @param {fabric.Object} object - */ - toSVG(object: Object): string; - - /** - * Regex matching shadow offsetX, offsetY and blur, Static - */ - reOffsetsAndBlur: RegExp; - - static reOffsetsAndBlur: RegExp; -} - -/////////////////////////////////////////////////////////////////////////////// -// Canvas Interfaces -////////////////////////////////////////////////////////////////////////////// -interface ICanvasDimensions { - /** - * Width of canvas element - */ - width: number; - /** - * Height of canvas element - */ - height: number; -} -interface ICanvasDimensionsOptions { - /** - * Set the given dimensions only as canvas backstore dimensions - */ - backstoreOnly?: boolean; - /** - * Set the given dimensions only as css dimensions - */ - cssOnly?: boolean; -} - -interface IStaticCanvasOptions { - /** - * Indicates whether the browser can be scrolled when using a touchscreen and dragging on the canvas - */ - allowTouchScrolling?: boolean; - /** - * Indicates whether this canvas will use image smoothing, this is on by default in browsers - */ - imageSmoothingEnabled?: boolean; - - /** - * Indicates whether objects should remain in current stack position when selected. - * When false objects are brought to top and rendered as part of the selection group - */ - preserveObjectStacking?: boolean; - - /** - * The transformation (in the format of Canvas transform) which focuses the viewport - */ - viewportTransform?: number[]; - - freeDrawingColor?: string; - freeDrawingLineWidth?: number; - - /** - * Background color of canvas instance. - * Should be set via setBackgroundColor - */ - backgroundColor?: string|Pattern; - /** - * Background image of canvas instance. - * Should be set via setBackgroundImage - * Backwards incompatibility note: The "backgroundImageOpacity" and "backgroundImageStretch" properties are deprecated since 1.3.9. - */ - backgroundImage?: Image | string; - backgroundImageOpacity?: number; - backgroundImageStretch?: number; - /** - * Function that determines clipping of entire canvas area - * Being passed context as first argument. See clipping canvas area - */ - clipTo?: (context: CanvasRenderingContext2D) => void; - - /** - * Indicates whether object controls (borders/controls) are rendered above overlay image - */ - controlsAboveOverlay?: boolean; - - /** - * Indicates whether toObject/toDatalessObject should include default values - */ - includeDefaultValues?: boolean; - /** - * Overlay color of canvas instance. - * Should be set via setOverlayColor - */ - overlayColor?: string|Pattern; - /** - * Overlay image of canvas instance. - * Should be set via setOverlayImage - * Backwards incompatibility note: The "overlayImageLeft" and "overlayImageTop" properties are deprecated since 1.3.9. - */ - overlayImage?: Image; - overlayImageLeft?: number; - overlayImageTop?: number; - /** - * Indicates whether add, insertAt and remove should also re-render canvas. - * Disabling this option could give a great performance boost when adding/removing a lot of objects to/from canvas at once - * (followed by a manual rendering after addition/deletion) - */ - renderOnAddRemove?: boolean; - /** - * Indicates whether objects' state should be saved - */ - stateful?: boolean; -} -export interface StaticCanvas extends IObservable, IStaticCanvasOptions, ICollection, ICanvasAnimation {} -export class StaticCanvas { - /** - * Constructor - * @param {HTMLElement|String} element element to initialize instance on - * @param {Object} [options] Options object - */ - constructor(element: HTMLCanvasElement|string, options?: ICanvasOptions); - - /** - * Calculates canvas element offset relative to the document - * This method is also attached as "resize" event handler of window - */ - calcOffset(): StaticCanvas; - - /** - * Sets {@link fabric.StaticCanvas#overlayImage|overlay image} for this canvas - * @param {(fabric.Image|String)} image fabric.Image instance or URL of an image to set overlay to - * @param {Function} callback callback to invoke when image is loaded and set as an overlay - * @param {Object} [options] Optional options to set for the {@link fabric.Image|overlay image}. - */ - setOverlayImage(image: Image|string, callback: Function, options?: IObjectOptions): StaticCanvas; - - /** - * Sets {@link fabric.StaticCanvas#backgroundImage|background image} for this canvas - * @param {(fabric.Image|String)} image fabric.Image instance or URL of an image to set background to - * @param {Function} callback Callback to invoke when image is loaded and set as background - * @param {Object} [options] Optional options to set for the {@link fabric.Image|background image}. - */ - setBackgroundImage(image: Image|string, callback: Function, options?: IObjectOptions): StaticCanvas; - - /** - * Sets {@link fabric.StaticCanvas#overlayColor|background color} for this canvas - * @param {(String|fabric.Pattern)} overlayColor Color or pattern to set background color to - * @param {Function} callback Callback to invoke when background color is set - */ - setOverlayColor(overlayColor: string|Pattern, callback: Function): StaticCanvas; - - /** - * Sets {@link fabric.StaticCanvas#backgroundColor|background color} for this canvas - * @param {(String|fabric.Pattern)} backgroundColor Color or pattern to set background color to - * @param {Function} callback Callback to invoke when background color is set - */ - setBackgroundColor(backgroundColor: string|Pattern, callback: Function): StaticCanvas; - - /** - * Returns canvas width (in px) - */ - getWidth(): number; - - /** - * Returns canvas height (in px) - */ - getHeight(): number; - - /** - * Sets width of this canvas instance - * @param {Number|String} value Value to set width to - * @param {Object} [options] Options object - */ - setWidth(value: number|string, options?: ICanvasDimensionsOptions): StaticCanvas - - /** - * Sets height of this canvas instance - * @param {Number|String} value Value to set height to - * @param {Object} [options] Options object - */ - setHeight(value: number|string, options?: ICanvasDimensionsOptions): StaticCanvas; - - /** - * Sets dimensions (width, height) of this canvas instance. when options.cssOnly flag active you should also supply the unit of measure (px/%/em) - * @param {Object} dimensions Object with width/height properties - * @param {Object} [options] Options object - */ - setDimensions(dimensions: ICanvasDimensions, options?: ICanvasDimensionsOptions): StaticCanvas; - - /** - * Returns canvas zoom level - */ - getZoom(): number; - - /** - * Sets viewport transform of this canvas instance - * @param {Array} vpt the transform in the form of context.transform - */ - setViewportTransform(vpt: number[]): StaticCanvas; - - /** - * Sets zoom level of this canvas instance, zoom centered around point - * @param {fabric.Point} point to zoom with respect to - * @param {Number} value to set zoom to, less than 1 zooms out - */ - zoomToPoint(point: Point, value: number): StaticCanvas; - - /** - * Sets zoom level of this canvas instance - * @param {Number} value to set zoom to, less than 1 zooms out - */ - setZoom(value: number): StaticCanvas; - - /** - * Pan viewport so as to place point at top left corner of canvas - * @param {fabric.Point} point to move to - */ - absolutePan(point: Point): StaticCanvas; - - /** - * Pans viewpoint relatively - * @param {fabric.Point} point (position vector) to move by - */ - relativePan(point: Point): StaticCanvas; - - /** - * Returns element corresponding to this instance - */ - getElement(): HTMLCanvasElement; - - /** - * Returns currently selected object, if any - */ - getActiveObject(): Object; - - /** - * Returns currently selected group of object, if any - */ - getActiveGroup(): Group; - - /** - * Clears specified context of canvas element - * @param {CanvasRenderingContext2D} ctx Context to clear - * @chainable - */ - clearContext(ctx: CanvasRenderingContext2D): StaticCanvas; - - /** - * Returns context of canvas where objects are drawn - */ - getContext(): CanvasRenderingContext2D; - - /** - * Clears all contexts (background, main, top) of an instance - */ - clear(): StaticCanvas; - - /** - * Renders both the top canvas and the secondary container canvas. - * @param {Boolean} [allOnTop] Whether we want to force all images to be rendered on the top canvas - * @chainable - */ - renderAll(allOnTop?: boolean): StaticCanvas; - - /** - * Method to render only the top canvas. - * Also used to render the group selection box. - * @chainable - */ - renderTop(): StaticCanvas; - - /** - * Returns coordinates of a center of canvas. - * Returned value is an object with top and left properties - */ - getCenter(): { top: number; left: number; }; - /** - * Centers object horizontally. - * You might need to call `setCoords` on an object after centering, to update controls area. - * @param {fabric.Object} object Object to center horizontally - */ - centerObjectH(object: Object): StaticCanvas; - - /** - * Centers object vertically. - * You might need to call `setCoords` on an object after centering, to update controls area. - * @param {fabric.Object} object Object to center vertically - */ - centerObjectV(object: Object): StaticCanvas; - - /** - * Centers object vertically and horizontally. - * You might need to call `setCoords` on an object after centering, to update controls area. - * @param {fabric.Object} object Object to center vertically and horizontally - */ - centerObject(object: Object): StaticCanvas; - - /** - * Returs dataless JSON representation of canvas - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output - */ - toDatalessJSON(propertiesToInclude?: any[]): string; - - /** - * Returns object representation of canvas - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output - */ - toObject(propertiesToInclude?: any[]): any; - - /** - * Returns dataless object representation of canvas - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output - */ - toDatalessObject(propertiesToInclude?: any[]): any; - - /** - * When true, getSvgTransform() will apply the StaticCanvas.viewportTransform to the SVG transformation. When true, - * a zoomed canvas will then produce zoomed SVG output. - */ - svgViewportTransformation: boolean; - - /** - * Returns SVG representation of canvas - * @param {Object} [options] Options object for SVG output - * @param {Function} [reviver] Method for further parsing of svg elements, called after each fabric object converted into svg representation. - */ - toSVG(options: IToSVGOptions, reviver?: Function): string; - - /** - * Moves an object to the bottom of the stack of drawn objects - * @param {fabric.Object} object Object to send to back - * @chainable - */ - sendToBack(object: Object): StaticCanvas; - - /** - * Moves an object to the top of the stack of drawn objects - * @param {fabric.Object} object Object to send - * @chainable - */ - bringToFront(object: Object): StaticCanvas; - - /** - * Moves an object down in stack of drawn objects - * @param {fabric.Object} object Object to send - * @param {Boolean} [intersecting] If `true`, send object behind next lower intersecting object - * @chainable - */ - sendBackwards(object: Object): StaticCanvas; - - /** - * Moves an object up in stack of drawn objects - * @param {fabric.Object} object Object to send - * @param {Boolean} [intersecting] If `true`, send object in front of next upper intersecting object - * @chainable - */ - bringForward(object: Object): StaticCanvas; - /** - * Moves an object to specified level in stack of drawn objects - * @param {fabric.Object} object Object to send - * @param {Number} index Position to move to - * @chainable - */ - moveTo(object: Object, index: number): StaticCanvas; - - /** - * Clears a canvas element and removes all event listeners - */ - dispose(): StaticCanvas; - - /** - * Returns a string representation of an instance - */ - toString(): string; - - /** - * Exports canvas element to a dataurl image. Note that when multiplier is used, cropping is scaled appropriately - * @param {Object} [options] Options object - */ - toDataURL(options?: IDataURLOptions): string; - - /** - * Provides a way to check support of some of the canvas methods - * (either those of HTMLCanvasElement itself, or rendering context) - * @param {String} methodName Method to check support for; Could be one of "getImageData", "toDataURL", "toDataURLWithQuality" or "setLineDash" - * @return {Boolean | null} `true` if method is supported (or at least exists), null` if canvas element or context can not be initialized - */ - supports(methodName: string): boolean; - - /** - * Populates canvas with data from the specified JSON. - * JSON format must conform to the one of toJSON formats - * @param {String|Object} json JSON string or object - * @param {Function} callback Callback, invoked when json is parsed - * and corresponding objects (e.g: {@link fabric.Image}) - * are initialized - * @param {Function} [reviver] Method for further parsing of JSON elements, called after each fabric object created. - */ - loadFromJSON(json: string|any, callback: Function, reviver?: Function): Canvas; - /** - * Clones canvas instance - * @param {Object} [callback] Receives cloned instance as a first argument - * @param {Array} [properties] Array of properties to include in the cloned canvas and children - */ - clone(callback: (canvas: StaticCanvas) => any, properties?: any[]): void; - - /** - * Clones canvas instance without cloning existing data. - * This essentially copies canvas dimensions, clipping properties, etc. - * but leaves data empty (so that you can populate it with your own) - * @param {Object} [callback] Receives cloned instance as a first argument - */ - cloneWithoutData(callback: (canvas: StaticCanvas) => any): void; - - /** - * Callback; invoked right before object is about to be scaled/rotated - */ - onBeforeScaleRotate(target: Object): void; - - // Functions from object straighten mixin - // -------------------------------------------------------------------------------------------------------------------------------- - - /** - * Straightens object, then rerenders canvas - * @param {fabric.Object} object Object to straighten - */ - straightenObject(object: Object): StaticCanvas - - /** - * Same as straightenObject, but animated - * @param {fabric.Object} object Object to straighten - */ - fxStraightenObject(object: Object): StaticCanvas - - - static EMPTY_JSON: string; - /** - * Provides a way to check support of some of the canvas methods - * (either those of HTMLCanvasElement itself, or rendering context) - * @param {String} methodName Method to check support for; Could be one of "getImageData", "toDataURL", "toDataURLWithQuality" or "setLineDash" - */ - static supports(methodName: string): boolean; - /** - * Returns JSON representation of canvas - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output - */ - static toJSON(propertiesToInclude?: any[]): string; -} - -interface ICanvasOptions extends IStaticCanvasOptions { - /** - * When true, objects can be transformed by one side (unproportionally) - */ - uniScaleTransform?: boolean; - - /** - * When true, objects use center point as the origin of scale transformation. - * Backwards incompatibility note: This property replaces "centerTransform" (Boolean). - */ - centeredScaling?: boolean; - - /** - * When true, objects use center point as the origin of rotate transformation. - * Backwards incompatibility note: This property replaces "centerTransform" (Boolean). - */ - centeredRotation?: boolean; - - /** - * Indicates that canvas is interactive. This property should not be changed. - */ - interactive?: boolean; - - /** - * Indicates whether group selection should be enabled - */ - selection?: boolean; - - /** - * Color of selection - */ - selectionColor?: string; - - /** - * Default dash array pattern - * If not empty the selection border is dashed - */ - selectionDashArray?: any[]; - - /** - * Color of the border of selection (usually slightly darker than color of selection itself) - */ - selectionBorderColor?: string; - - /** - * Width of a line used in object/group selection - */ - selectionLineWidth?: number; - - /** - * Default cursor value used when hovering over an object on canvas - */ - hoverCursor?: string; - - /** - * Default cursor value used when moving an object on canvas - */ - moveCursor?: string; - - /** - * Default cursor value used for the entire canvas - */ - defaultCursor?: string; - - /** - * Cursor value used during free drawing - */ - freeDrawingCursor?: string; - - /** - * Cursor value used for rotation point - */ - rotationCursor?: string; - - /** - * Default element class that's given to wrapper (div) element of canvas - */ - containerClass?: string; - - /** - * When true, object detection happens on per-pixel basis rather than on per-bounding-box - */ - perPixelTargetFind?: boolean; - - /** - * Number of pixels around target pixel to tolerate (consider active) during object detection - */ - targetFindTolerance?: number; - - /** - * When true, target detection is skipped when hovering over canvas. This can be used to improve performance. - */ - skipTargetFind?: boolean; - - /** - * When true, mouse events on canvas (mousedown/mousemove/mouseup) result in free drawing. - * After mousedown, mousemove creates a shape, - * and then mouseup finalizes it and adds an instance of `fabric.Path` onto canvas. - */ - isDrawingMode?: boolean; -} -export interface Canvas extends StaticCanvas {} -export interface Canvas extends ICanvasOptions {} -export class Canvas { - /** - * Constructor - * @param {HTMLElement|String} element element to initialize instance on - * @param {Object} [options] Options object - */ - constructor(element: HTMLCanvasElement | string, options?: ICanvasOptions); - - _objects: Object[]; - - /** - * Checks if point is contained within an area of given object - * @param {Event} e Event object - * @param {fabric.Object} target Object to test against - */ - containsPoint(e: Event, target: Object): boolean; - /** - * Deactivates all objects on canvas, removing any active group or object - * @return {fabric.Canvas} thisArg - */ - deactivateAll(): Canvas; - /** - * Deactivates all objects and dispatches appropriate events - * @param {Event} [e] Event (passed along when firing) - * @return {fabric.Canvas} thisArg - */ - deactivateAllWithDispatch(e?: Event): Canvas; - /** - * Discards currently active group - * @param {Event} [e] Event (passed along when firing) - * @return {fabric.Canvas} thisArg - */ - discardActiveGroup(e?: Event): Canvas; - /** - * Discards currently active object - * @param {Event} [e] Event (passed along when firing) - * @return {fabric.Canvas} thisArg - * @chainable - */ - discardActiveObject(e?: Event): Canvas; - /** - * Draws objects' controls (borders/controls) - * @param {CanvasRenderingContext2D} ctx Context to render controls on - */ - drawControls(ctx: CanvasRenderingContext2D): void; - /** - * Method that determines what object we are clicking on - * @param {Event} e mouse event - * @param {Boolean} skipGroup when true, group is skipped and only objects are traversed through - */ - findTarget(e: MouseEvent, skipGroup: boolean): Canvas; - /** - * Returns currently active group - * @return {fabric.Group} Current group - */ - getActiveGroup(): Group; - /** - * Returns currently active object - * @return {fabric.Object} active object - */ - getActiveObject(): Object; - /** - * Returns pointer coordinates relative to canvas. - * @param {Event} e - * @return {Object} object with "x" and "y" number values - */ - getPointer(e: Event, ignoreZoom?: boolean, upperCanvasEl?: CanvasRenderingContext2D): { x: number; y: number; }; - /** - * Returns context of canvas where object selection is drawn - * @return {CanvasRenderingContext2D} - */ - getSelectionContext(): CanvasRenderingContext2D; - /** - * Returns element on which object selection is drawn - * @return {HTMLCanvasElement} - */ - getSelectionElement(): HTMLCanvasElement; - /** - * Returns true if object is transparent at a certain location - * @param {fabric.Object} target Object to check - * @param {Number} x Left coordinate - * @param {Number} y Top coordinate - */ - isTargetTransparent(target: Object, x: number, y: number): boolean; - /** - * Sets active group to a speicified one - * @param {fabric.Group} group Group to set as a current one - * @param {Event} [e] Event (passed along when firing) - */ - setActiveGroup(group: Group, e?: Event): Canvas; - /** - * Sets given object as the only active object on canvas - * @param {fabric.Object} object Object to set as an active one - * @param {Event} [e] Event (passed along when firing "object:selected") - */ - setActiveObject(object: Object, e?: Event): Canvas; - /** - * Set the cursor type of the canvas element - * @param {String} value Cursor type of the canvas element. - * @see http://www.w3.org/TR/css3-ui/#cursor - */ - setCursor(value: string): void; - - /** - * Removes all event listeners - */ - removeListeners(): void - - static EMPTY_JSON: string; - /** - * Provides a way to check support of some of the canvas methods - * (either those of HTMLCanvasElement itself, or rendering context) - * @param {String} methodName Method to check support for; Could be one of "getImageData", "toDataURL", "toDataURLWithQuality" or "setLineDash" - */ - static supports(methodName: string): boolean; - /** - * Returns JSON representation of canvas - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output - */ - static toJSON(propertiesToInclude?: any[]): string; -} - -/////////////////////////////////////////////////////////////////////////////// -// Shape Interfaces -////////////////////////////////////////////////////////////////////////////// - -interface ICircleOptions extends IObjectOptions { - /** - * Radius of this circle - */ - radius?: number; - /** - * Start angle of the circle, moving clockwise - */ - startAngle?: number; - - /** - * End angle of the circle - */ - endAngle?: number; -} -export interface Circle extends Object, ICircleOptions {} -export class Circle { - constructor(options?: ICircleOptions); - - /** - * Returns complexity of an instance - * @return {Number} complexity of this instance - */ - complexity(): number; - /** - * Returns horizontal radius of an object (according to how an object is scaled) - * @return {Number} - */ - getRadiusX(): number; - /** - * Returns vertical radius of an object (according to how an object is scaled) - * @return {Number} - */ - getRadiusY(): number; - /** - * Sets radius of an object (and updates width accordingly) - * @return {Number} - */ - setRadius(value: number): number; - - /** - * Returns object representation of an instance - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output - * @return {Object} object representation of an instance - */ - toObject(propertiesToInclude?: any[]): any; - /** - * Returns svg representation of an instance - * @param {Function} [reviver] Method for further parsing of svg representation. - * @return {String} svg representation of an instance - */ - toSVG(reviver?: Function): string; - - /** - * List of attribute names to account for when parsing SVG element (used by {@link fabric.Circle.fromElement}) - */ - static ATTRIBUTE_NAMES: string[]; - /** - * Returns Circle instance from an SVG element - * @param {SVGElement} element Element to parse - * @param {Object} [options] Options object - */ - static fromElement(element: SVGElement, options: ICircleOptions): Circle; - /** - * Returns Circle instance from an object representation - * @param {Object} object Object to create an instance from - */ - static fromObject(object: any): Circle; -} - -interface IEllipseOptions extends IObjectOptions { - /** - * Horizontal radius - */ - rx?: number; - /** - * Vertical radius - */ - ry?: number; -} -export interface Ellipse extends Object, IEllipseOptions {} -export class Ellipse { - constructor(options?: IEllipseOptions); - - /** - * Returns horizontal radius of an object (according to how an object is scaled) - * @return {Number} - */ - getRx(): number; - - /** - * Returns Vertical radius of an object (according to how an object is scaled) - * @return {Number} - */ - getRy(): number; - /** - * Returns object representation of an instance - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output - * @return {Object} object representation of an instance - */ - toObject(propertiesToInclude?: any[]): any; - /** - * Returns svg representation of an instance - * @param {Function} [reviver] Method for further parsing of svg representation. - * @return {String} svg representation of an instance - */ - toSVG(reviver?: Function): string; - /** - * Returns complexity of an instance - * @return {Number} complexity - */ - complexity(): number; - - /** - * List of attribute names to account for when parsing SVG element (used by {@link fabric.Ellipse.fromElement}) - */ - static ATTRIBUTE_NAMES: string[]; - - /** - * Returns Ellipse instance from an SVG element - * @param {SVGElement} element Element to parse - * @param {Object} [options] Options object - */ - static fromElement(element: SVGElement, options?: IEllipseOptions): Ellipse; - - /** - * Returns Ellipse instance from an object representation - * @param {Object} object Object to create an instance from - */ - static fromObject(object: any): Ellipse; -} - -export interface Group extends Object, ICollection {} -export class Group { - /** - * Constructor - * @param {Object} objects Group objects - * @param {Object} [options] Options object - */ - constructor(items?: any[], options?: IObjectOptions); - - activateAllObjects(): Group; - /** - * Adds an object to a group; Then recalculates group's dimension, position. - * @param {Object} object - * @return {fabric.Group} thisArg - * @chainable - */ - addWithUpdate(object: Object): Group; - containsPoint(point: Point): boolean; - /** - * Destroys a group (restoring state of its objects) - * @return {fabric.Group} thisArg - * @chainable - */ - destroy(): Group; - /** - * Returns requested property - * @param {String} prop Property to get - * @return {Any} - */ - get(prop: string): any; - /** - * Checks whether this group was moved (since `saveCoords` was called last) - * @return {Boolean} true if an object was moved (since fabric.Group#saveCoords was called) - */ - hasMoved(): boolean; - /** - * Removes an object from a group; Then recalculates group's dimension, position. - * @param {Object} object - * @return {fabric.Group} thisArg - * @chainable - */ - removeWithUpdate(object: Object): Group; - /** - * Renders instance on a given context - * @param {CanvasRenderingContext2D} ctx context to render instance on - */ - render(ctx: CanvasRenderingContext2D): void; - /** - * Removes objects from a collection, then renders canvas (if `renderOnAddRemove` is not `false`) - * @param {...fabric.Object} object Zero or more fabric instances - * @return {Self} thisArg - * @chainable - */ - remove(...object: Object[]): Group; - /** - * Saves coordinates of this instance (to be used together with `hasMoved`) - * @saveCoords - * @return {fabric.Group} thisArg - * @chainable - */ - saveCoords(): Group; - /** - * Sets coordinates of all group objects - * @return {fabric.Group} thisArg - * @chainable - */ - setObjectsCoords(): Group; - /** - * Returns object representation of an instance - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output - * @return {Object} object representation of an instance - */ - toObject(propertiesToInclude?: any[]): any; - /** - * Returns string represenation of a group - * @return {String} - */ - toString(): string; - /** - * Returns svg representation of an instance - * @param {Function} [reviver] Method for further parsing of svg representation. - * @return {String} svg representation of an instance - */ - toSVG(reviver?: Function): string; - - /** - * Returns {@link fabric.Group} instance from an object representation - * @param {Object} object Object to create a group from - * @param {Function} [callback] Callback to invoke when an group instance is created - */ - static fromObject(object: any, callback: (group: Group) => any): void; -} - -interface IImageOptions extends IObjectOptions { - /** - * crossOrigin value (one of "", "anonymous", "allow-credentials") - */ - crossOrigin: string; - - /** - * AlignX value, part of preserveAspectRatio (one of "none", "mid", "min", "max") - * This parameter defines how the picture is aligned to its viewport when image element width differs from image width. - */ - alignX: string; - - /** - * AlignY value, part of preserveAspectRatio (one of "none", "mid", "min", "max") - * This parameter defines how the picture is aligned to its viewport when image element height differs from image height. - */ - alignY: string; - - /** - * meetOrSlice value, part of preserveAspectRatio (one of "meet", "slice"). - * if meet the image is always fully visibile, if slice the viewport is always filled with image. - * @see http://www.w3.org/TR/SVG/coords.html#PreserveAspectRatioAttribute - */ - meetOrSlice: string; - - /** - * Image filter array - */ - filters: IBaseFilter[]; -} -interface Image extends Object, IImageOptions {} -export class Image { - /** - * Constructor - * @param {HTMLImageElement | String} element Image element - * @param {Object} [options] Options object - */ - constructor(element: HTMLImageElement, objObjects: IObjectOptions); - - initialize(element?: string|HTMLImageElement, options?: IImageOptions): void; - /** - * Applies filters assigned to this image (from "filters" array) - * @param {Function} callback Callback is invoked when all filters have been applied and new image is generated - */ - applyFilters(callback: Function): void; - /** - * Returns a clone of an instance - * @param {Function} callback Callback is invoked with a clone as a first argument - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output - */ - clone(callback?: Function, propertiesToInclude?: any[]): Object; - /** - * Returns complexity of an instance - * @return {Number} complexity of this instance - */ - complexity(): number; - /** - * Returns image element which this instance if based on - * @return {HTMLImageElement} Image element - */ - getElement(): HTMLImageElement; - /** - * Returns original size of an image - * @return {Object} Object with "width" and "height" properties - */ - getOriginalSize(): { width: number; height: number; }; - /** - * Returns source of an image - * @return {String} Source of an image - */ - getSrc(): string; - render(ctx: CanvasRenderingContext2D, noTransform: boolean): void; - - /** - * Sets image element for this instance to a specified one. - * If filters defined they are applied to new image. - * You might need to call `canvas.renderAll` and `object.setCoords` after replacing, to render new image and update controls area. - * @param {HTMLImageElement} element - * @param {Function} [callback] Callback is invoked when all filters have been applied and new image is generated - * @param {Object} [options] Options object - */ - setElement(element: HTMLImageElement, callback: Function, options: IImageOptions): Image; - /** - * Sets crossOrigin value (on an instance and corresponding image element) - */ - setCrossOrigin(value: string): Image; - /** - * Returns object representation of an instance - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output - * @return {Object} Object representation of an instance - */ - toObject(propertiesToInclude?: any[]): any; - /** - * Returns string representation of an instance - * @return {String} String representation of an instance - */ - toString(): string; - /** - * Returns SVG representation of an instance - * @param {Function} [reviver] Method for further parsing of svg representation. - * @return {String} svg representation of an instance - */ - toSVG(reviver?: Function): string; - /** - * Sets source of an image - * @param {String} src Source string (URL) - * @param {Function} [callback] Callback is invoked when image has been loaded (and all filters have been applied) - * @param {Object} [options] Options object - */ - setSrc(src: string, callback: Function, options: IImageOptions): Image; - - /** - * Creates an instance of fabric.Image from an URL string - * @param {String} url URL to create an image from - * @param {Function} [callback] Callback to invoke when image is created (newly created image is passed as a first argument) - * @param {Object} [imgOptions] Options object - */ - static fromURL(url: string, callback?: (image: Image) => any, objObjects?: IObjectOptions): Image; - /** - * Creates an instance of fabric.Image from its object representation - * @static - * @param {Object} object Object to create an instance from - * @param {Function} [callback] Callback to invoke when an image instance is created - */ - static fromObject(object: any, callback: (image: Image) => {}): void; - /** - * Returns Image instance from an SVG element - * @param {SVGElement} element Element to parse - * @param {Function} callback Callback to execute when fabric.Image object is created - * @param {Object} [options] Options object - */ - static fromElement(element: SVGElement, callback: Function, options?: IImageOptions): void; - /** - * Default CSS class name for canvas - */ - static CSS_CANVAS: string; - - static filters: IAllFilters; -} - -interface ILineOptions extends IObjectOptions { - /** - * x value or first line edge - */ - x1: number; - /** - * x value or second line edge - */ - x2: number; - /** - * y value or first line edge - */ - y1: number; - /** - * y value or second line edge - */ - y2: number; -} -export interface Line extends Object, ILineOptions {} -export class Line { - /** - * Constructor - * @param {Array} [points] Array of points - * @param {Object} [options] Options object - */ - constructor(points?: number[], objObjects?: IObjectOptions); - /** - * Returns complexity of an instance - * @return {Number} complexity - */ - complexity(): number; - initialize(points?: number[], options?: ILineOptions): Line; - /** - * Returns object representation of an instance - * @methd toObject - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output - * @return {Object} object representation of an instance - */ - toObject(propertiesToInclude: any[]): any; - /** - * Returns SVG representation of an instance - * @param {Function} [reviver] Method for further parsing of svg representation. - * @return {String} svg representation of an instance - */ - toSVG(reviver?: Function): string; - - static ATTRIBUTE_NAMES: string[]; - /** - * Returns fabric.Line instance from an SVG element - * @param {SVGElement} element Element to parse - * @param {Object} [options] Options object - */ - static fromElement(element: SVGElement, options?: ILineOptions): Line; - /** - * Returns fabric.Line instance from an object representation - * @param {Object} object Object to create an instance from - */ - static fromObject(object: any): Line; -} - -interface IObjectOptions { - /** - * Type of an object (rect, circle, path, etc.). - * Note that this property is meant to be read-only and not meant to be modified. - * If you modify, certain parts of Fabric (such as JSON loading) won't work correctly. - */ - type?: string; - - /** - * Horizontal origin of transformation of an object (one of "left", "right", "center") - */ - originX?: string; - - /** - * Vertical origin of transformation of an object (one of "top", "bottom", "center") - */ - originY?: string; - - /** - * Top position of an object. Note that by default it's relative to object center. You can change this by setting originY={top/center/bottom} - */ - top?: number; - - /** - * Left position of an object. Note that by default it's relative to object center. You can change this by setting originX={left/center/right} - */ - left?: number; - - /** - * Object width - */ - width?: number; - - /** - * Object height - */ - height?: number; - - /** - * Object scale factor (horizontal) - */ - scaleX?: number; - - /** - * Object scale factor (vertical) - */ - scaleY?: number; - - /** - * When true, an object is rendered as flipped horizontally - */ - flipX?: boolean; - - /** - * When true, an object is rendered as flipped vertically - */ - flipY?: boolean; - - /** - * Opacity of an object - */ - opacity?: number; - - /** - * Angle of rotation of an object (in degrees) - */ - angle?: number; - - /** - * Size of object's controlling corners (in pixels) - */ - cornerSize?: number; - - /** - * When true, object's controlling corners are rendered as transparent inside (i.e. stroke instead of fill) - */ - transparentCorners?: boolean; - - /** - * Default cursor value used when hovering over this object on canvas - */ - hoverCursor?: string; - - /** - * Padding between object and its controlling borders (in pixels) - */ - padding?: number; - - /** - * Color of controlling borders of an object (when it's active) - */ - borderColor?: string; - - /** - * Color of controlling corners of an object (when it's active) - */ - cornerColor?: string; - - /** - * When true, this object will use center point as the origin of transformation - * when being scaled via the controls. - * Backwards incompatibility note: This property replaces "centerTransform" (Boolean). - */ - centeredScaling?: boolean; - - /** - * When true, this object will use center point as the origin of transformation - * when being rotated via the controls. - * Backwards incompatibility note: This property replaces "centerTransform" (Boolean). - */ - centeredRotation?: boolean; - - /** - * Color of object's fill - */ - fill?: string; - - /** - * Fill rule used to fill an object - * accepted values are nonzero, evenodd - * Backwards incompatibility note: This property was used for setting globalCompositeOperation until v1.4.12, use `globalCompositeOperation` instead - */ - fillRule?: string; - - /** - * Composite rule used for canvas globalCompositeOperation - */ - globalCompositeOperation?: string; - - /** - * Background color of an object. Only works with text objects at the moment. - */ - backgroundColor?: string; - - /** - * When defined, an object is rendered via stroke and this property specifies its color - */ - stroke?: string; - - /** - * Width of a stroke used to render this object - */ - strokeWidth?: number; - - /** - * Array specifying dash pattern of an object's stroke (stroke must be defined) - */ - strokeDashArray?: any[]; - - /** - * Line endings style of an object's stroke (one of "butt", "round", "square") - */ - strokeLineCap?: string; - - /** - * Corner style of an object's stroke (one of "bevil", "round", "miter") - */ - strokeLineJoin?: string; - - /** - * Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke - */ - strokeMiterLimit?: number; - - /** - * Shadow object representing shadow of this shape - */ - shadow?: IShadow|string; - - /** - * Opacity of object's controlling borders when object is active and moving - */ - borderOpacityWhenMoving?: number; - - /** - * Scale factor of object's controlling borders - */ - borderScaleFactor?: number; - - /** - * Transform matrix (similar to SVG's transform matrix) - */ - transformMatrix?: any[]; - - /** - * Minimum allowed scale value of an object - */ - minScaleLimit?: number; - - /** - * When set to `false`, an object can not be selected for modification (using either point-click-based or group-based selection). - * But events still fire on it. - */ - selectable?: boolean; - - /** - * When set to `false`, an object can not be a target of events. All events propagate through it. Introduced in v1.3.4 - */ - evented?: boolean; - - /** - * When set to `false`, an object is not rendered on canvas - */ - visible?: boolean; - - /** - * When set to `false`, object's controls are not displayed and can not be used to manipulate object - */ - hasControls?: boolean; - - /** - * When set to `false`, object's controlling borders are not rendered - */ - hasBorders?: boolean; - - /** - * When set to `false`, object's controlling rotating point will not be visible or selectable - */ - hasRotatingPoint?: boolean; - - /** - * Offset for object's controlling rotating point (when enabled via `hasRotatingPoint`) - */ - rotatingPointOffset?: number; - - /** - * When set to `true`, objects are "found" on canvas on per-pixel basis rather than according to bounding box - */ - perPixelTargetFind?: boolean; - - /** - * When `false`, default object's values are not included in its serialization - */ - includeDefaultValues?: boolean; - - /** - * Function that determines clipping of an object (context is passed as a first argument) - * Note that context origin is at the object's center point (not left/top corner) - * @type Function - */ - clipTo?: Function; - - /** - * When `true`, object horizontal movement is locked - */ - lockMovementX?: boolean; - - /** - * When `true`, object vertical movement is locked - */ - lockMovementY?: boolean; - - /** - * When `true`, object rotation is locked - */ - lockRotation?: boolean; - - /** - * When `true`, object horizontal scaling is locked - */ - lockScalingX?: boolean; - - /** - * When `true`, object vertical scaling is locked - */ - lockScalingY?: boolean; - - /** - * When `true`, object non-uniform scaling is locked - */ - lockUniScaling?: boolean; - - /** - * When `true`, object cannot be flipped by scaling into negative values - */ - lockScalingFlip?: boolean; - - /** - * Not used by fabric, just for convenience - */ - name?: string; - - /** - * Not used by fabric, just for convenience - */ - data?: any; -} -export interface Object extends IObservable, IObjectOptions, IObjectAnimation {} -export class Object { - getCurrentWidth(): number; - getCurrentHeight(): number; - - getAngle(): number; - setAngle(value: number): Object; - - getBorderColor(): string; - setBorderColor(value: string): Object; - - getBorderScaleFactor(): number; - - getCornersize(): number; - setCornersize(value: number): Object; - - getFill(): string; - setFill(value: string): Object; - - getFillRule(): string; - setFillRule(value: string): Object; - - getFlipX(): boolean; - setFlipX(value: boolean): Object; - - getFlipY(): boolean; - setFlipY(value: boolean): Object; - - getHeight(): number; - setHeight(value: number): Object; - - getLeft(): number; - setLeft(value: number): Object; - - getOpacity(): number; - setOpacity(value: number): Object; - - overlayFill: string; - getOverlayFill(): string; - setOverlayFill(value: string): Object; - - getScaleX(): number; - setScaleX(value: number): Object; - - getScaleY(): number; - setScaleY(value: number): Object; - - setShadow(options: any): Object; - getShadow(): Object; - - stateProperties: any[]; - getTop(): number; - setTop(value: number): Object; - - getWidth(): number; - setWidth(value: number): Object; - - /* * Sets object's properties from options - * @param {Object} [options] Options object - */ - setOptions(options: any): void; - - /** - * Transforms context when rendering an object - * @param {CanvasRenderingContext2D} ctx Context - * @param {Boolean} fromLeft When true, context is transformed to object's top/left corner. This is used when rendering text on Node - */ - transform(ctx: CanvasRenderingContext2D, fromLeft: boolean): void; - - /** - * Returns an object representation of an instance - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output - */ - toObject(propertiesToInclude?: any[]): any; - - /** - * Returns (dataless) object representation of an instance - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output - */ - toDatalessObject(propertiesToInclude?: any[]): any; - - /** - * Returns a string representation of an instance - */ - toString(): string; - - /** - * Basic getter - * @param {String} property Property name - */ - get(property: string): any; - - /** - * Sets property to a given value. - * When changing position/dimension -related properties (left, top, scale, angle, etc.) `set` does not update position of object's borders/controls. - * If you need to update those, call `setCoords()`. - * @param {String} key Property name - * @param {Object|Function} value Property value (if function, the value is passed into it and its return value is used as a new one) - */ - set(key: string, value: any|Function): Object; - /** - * Sets property to a given value. - * When changing position/dimension -related properties (left, top, scale, angle, etc.) `set` does not update position of object's borders/controls. - * If you need to update those, call `setCoords()`. - * @param Object key Property object, iterate over the object properties - */ - set(key: any): Object; - - /** - * Toggles specified property from `true` to `false` or from `false` to `true` - * @param {String} property Property to toggle - */ - toggle(property: string): Object; - - /** - * Sets sourcePath of an object - * @param {String} value Value to set sourcePath to - */ - setSourcePath(value: string): Object; - - /** - * Retrieves viewportTransform from Object's canvas if possible - */ - getViewportTransform(): boolean; - - /** - * Renders an object on a specified context - * @param {CanvasRenderingContext2D} ctx Context to render on - * @param {Boolean} [noTransform] When true, context is not transformed - */ - render(ctx: CanvasRenderingContext2D, noTransform?: boolean): void; - - /** - * Clones an instance - * @param {Function} callback Callback is invoked with a clone as a first argument - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output - */ - clone(callback: Function, propertiesToInclude?: any[]): Object; - - /** - * Creates an instance of fabric.Image out of an object - * @param {Function} callback callback, invoked with an instance as a first argument - */ - cloneAsImage(callback: (image: Image) => any): Object; - - /** - * Converts an object into a data-url-like string - * @param options Options object - */ - toDataURL(options: IDataURLOptions): string; - - /** - * Returns true if specified type is identical to the type of an instance - * @param {String} type Type to check against - */ - isType(type: string): boolean; - - /** - * Returns complexity of an instance - */ - complexity(): number; - - /** - * Returns a JSON representation of an instance - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output - */ - toJSON(propertiesToInclude?: any[]): any; - - /** - * Sets gradient (fill or stroke) of an object - * Backwards incompatibility note: This method was named "setGradientFill" until v1.1.0 - * @param {String} property Property name 'stroke' or 'fill' - * @param {Object} [options] Options object - */ - setGradient(property: string, options: IGradientOptions): Object; - /** - * Sets pattern fill of an object - * @param {Object} options Options object - */ - setPatternFill(options: IFillOptions): Object; - - /** - * Sets shadow of an object - * @param {String} [options] Options object or string (e.g. "2px 2px 10px rgba(0,0,0,0.2)") - */ - setShadow(options?: string): Object; - /** - * Sets shadow of an object - * @param [options] Options object - */ - setShadow(options: IShadow): Object; - - /** - * Sets "color" of an instance (alias of `set('fill', …)`) - * @param {String} color Color value - */ - setColor(color: string): Object; - - /** - * Sets "angle" of an instance - * @param {Number} angle Angle value - */ - setAngle(angle: number): Object; - - /** - * Sets "angle" of an instance - * @param {Number} angle Angle value - */ - rotate(angle: number): Object; - - /** - * Centers object horizontally on canvas to which it was added last. - * You might need to call `setCoords` on an object after centering, to update controls area. - */ - centerH(): void; - - /** - * Centers object vertically on canvas to which it was added last. - * You might need to call `setCoords` on an object after centering, to update controls area. - */ - centerV(): void; - - /** - * Centers object vertically and horizontally on canvas to which is was added last - * You might need to call `setCoords` on an object after centering, to update controls area. - */ - center(): void; - - /** - * Removes object from canvas to which it was added last - */ - remove(): Object; - - /** - * Returns coordinates of a pointer relative to an object - * @param {Event} e Event to operate upon - * @param {Object} [pointer] Pointer to operate upon (instead of event) - */ - getLocalPointer(e: Event, pointer: any): any; - - /** - * Sets object's properties from options - * @param {Object} [options] Options object - */ - setOptions(options: any): void; - /** - * Sets sourcePath of an object - * @param {String} value Value to set sourcePath to - */ - setSourcePath(value: string): Object; - // functions from object svg export mixin - // ----------------------------------------------------------------------------------------------------------------------------------- - /** - * Returns styles-string for svg-export - */ - getSvgStyles(): string; - /** - * Returns transform-string for svg-export - */ - getSvgTransform(): string; - /** - * Returns transform-string for svg-export from the transform matrix of single elements - */ - getSvgTransformMatrix(): string; - - // functions from stateful mixin - // ----------------------------------------------------------------------------------------------------------------------------------- - /** - * Returns true if object state (one of its state properties) was changed - */ - hasStateChanged(): boolean; - /** - * Saves state of an object - * @param {Object} [options] Object with additional `stateProperties` array to include when saving state - * @return {fabric.Object} thisArg - */ - saveState(options?: { stateProperties: any[] }): Object; - /** - * Setups state of an object - */ - setupState(): Object; - // functions from object straightening mixin - // ----------------------------------------------------------------------------------------------------------------------------------- - /** - * Straightens an object (rotating it from current angle to one of 0, 90, 180, 270, etc. depending on which is closer) - */ - straighten(): Object; - /** - * Same as straighten but with animation - * @param {Object} callbacks Object with callback functions - * @param {Function} [callbacks.onComplete] Invoked on completion - * @param {Function} [callbacks.onChange] Invoked on every step of animation - */ - fxStraighten(callbacks: { onComplete?: Function; onChange: Function }): Object; - - // functions from object stacking mixin - // ----------------------------------------------------------------------------------------------------------------------------------- - /** - * Moves an object up in stack of drawn objects - * @param {Boolean} [intersecting] If `true`, send object in front of next upper intersecting object - */ - bringForward(intersecting?: boolean): Object; - /** - * Moves an object to the top of the stack of drawn objects - */ - bringToFront(): Object; - /** - * Moves an object down in stack of drawn objects - * @param {Boolean} [intersecting] If `true`, send object behind next lower intersecting object - */ - sendBackwards(intersecting?: boolean): Object; - /** - * Moves an object to the bottom of the stack of drawn objects - */ - sendToBack(): Object; - /** - * Moves an object to specified level in stack of drawn objects - * @param {Number} index New position of object - */ - moveTo(index: number): Object; - - // functions from object origin mixin - // ----------------------------------------------------------------------------------------------------------------------------------- - /** - * Translates the coordinates from origin to center coordinates (based on the object's dimensions) - * @param {fabric.Point} point The point which corresponds to the originX and originY params - * @param {String} originX Horizontal origin: 'left', 'center' or 'right' - * @param {String} originY Vertical origin: 'top', 'center' or 'bottom' - */ - translateToCenterPoint(point: Point, originX: string, originY: string): Point; - - /** - * Translates the coordinates from center to origin coordinates (based on the object's dimensions) - * @param {fabric.Point} center The point which corresponds to center of the object - * @param {String} originX Horizontal origin: 'left', 'center' or 'right' - * @param {String} originY Vertical origin: 'top', 'center' or 'bottom' - */ - translateToOriginPoint(center: Point, originX: string, originY: string): Point; - /** - * Returns the real center coordinates of the object - */ - getCenterPoint(): Point; - - /** - * Returns the coordinates of the object as if it has a different origin - * @param {String} originX Horizontal origin: 'left', 'center' or 'right' - * @param {String} originY Vertical origin: 'top', 'center' or 'bottom' - */ - getPointByOrigin(): Point; - - /** - * Returns the point in local coordinates - * @param {fabric.Point} point The point relative to the global coordinate system - * @param {String} originX Horizontal origin: 'left', 'center' or 'right' - * @param {String} originY Vertical origin: 'top', 'center' or 'bottom' - */ - toLocalPoint(point: Point, originX: string, originY: string): Point; - - /** - * Sets the position of the object taking into consideration the object's origin - * @param {fabric.Point} pos The new position of the object - * @param {String} originX Horizontal origin: 'left', 'center' or 'right' - * @param {String} originY Vertical origin: 'top', 'center' or 'bottom' - * @return {void} - */ - setPositionByOrigin(pos: Point, originX: string, originY: string): void; - - /** - * @param {String} to One of 'left', 'center', 'right' - */ - adjustPosition(to: string): void; - - // functions from interactivity mixin - // ----------------------------------------------------------------------------------------------------------------------------------- - /**- - * Draws borders of an object's bounding box. - * Requires public properties: width, height - * Requires public options: padding, borderColor - * @param {CanvasRenderingContext2D} ctx Context to draw on - */ - drawBorders(context: CanvasRenderingContext2D): Object; - - /** - * Draws corners of an object's bounding box. - * Requires public properties: width, height - * Requires public options: cornerSize, padding - * @param {CanvasRenderingContext2D} ctx Context to draw on - */ - drawCorners(context: CanvasRenderingContext2D): Object; - - /** - * Returns true if the specified control is visible, false otherwise. - * @param {String} controlName The name of the control. Possible values are 'tl', 'tr', 'br', 'bl', 'ml', 'mt', 'mr', 'mb', 'mtr'. - */ - isControlVisible(controlName: string): boolean; - /** - * Sets the visibility of the specified control. - * @param {String} controlName The name of the control. Possible values are 'tl', 'tr', 'br', 'bl', 'ml', 'mt', 'mr', 'mb', 'mtr'. - * @param {Boolean} visible true to set the specified control visible, false otherwise - */ - setControlVisible(controlName: string, visible: boolean): Object; - - /** - * Sets the visibility state of object controls. - * @param {Object} [options] Options object - */ - setControlsVisibility(options?: { - bl?: boolean; - br?: boolean; - mb?: boolean; - ml?: boolean; - mr?: boolean; - mt?: boolean; - tl?: boolean; - tr?: boolean; - mtr?: boolean; }): Object; - - // functions from geometry mixin - // ------------------------------------------------------------------------------------------------------------------------------- - /** - * Sets corner position coordinates based on current angle, width and height - * See https://github.com/kangax/fabric.js/wiki/When-to-call-setCoords - */ - setCoords(): Object; - /** - * Returns coordinates of object's bounding rectangle (left, top, width, height) - * @return {Object} Object with left, top, width, height properties - */ - getBoundingRect(): { left: number; top: number; width: number; height: number }; - /** - * Checks if object is fully contained within area of another object - * @param {Object} other Object to test - */ - isContainedWithinObject(other: Object): boolean; - /** - * Checks if object is fully contained within area formed by 2 points - * @param {Object} pointTL top-left point of area - * @param {Object} pointBR bottom-right point of area - */ - isContainedWithinRect(pointTL: any, pointBR: any): boolean; - /** - * Checks if point is inside the object - * @param {fabric.Point} point Point to check against - */ - containsPoint(point: Point): boolean; - /** - * Scales an object (equally by x and y) - * @param {Number} value Scale factor - * @return {fabric.Object} thisArg - */ - scale(value: number): Object; - /** - * Scales an object to a given height, with respect to bounding box (scaling by x/y equally) - * @param {Number} value New height value - */ - scaleToHeight(value: number): Object; - /** - * Scales an object to a given width, with respect to bounding box (scaling by x/y equally) - * @param {Number} value New width value - */ - scaleToWidth(value: number): Object; - /** - * Checks if object intersects with another object - * @param {Object} other Object to test - */ - intersectsWithObject(other: Object): boolean; - /** - * Checks if object intersects with an area formed by 2 points - * @param {Object} pointTL top-left point of area - * @param {Object} pointBR bottom-right point of area - */ - intersectsWithRect(pointTL: any, pointBR: any): boolean; -} - -interface IPathOptions extends IObjectOptions { - /** - * Array of path points - */ - path?: any[]; - - /** - * Minimum X from points values, necessary to offset points - */ - minX?: number; - - /** - * Minimum Y from points values, necessary to offset points - */ - minY?: number; -} -export interface IPath extends Object, IPathOptions {} -export class IPath { - /** - * Constructor - * @param {Array|String} path Path data (sequence of coordinates and corresponding "command" tokens) - * @param {Object} [options] Options object - */ - constructor(path?: string|any[], options?: IPathOptions); - - initialize(path?: any[], options?: IPathOptions): IPath; - - /** - * Returns number representation of an instance complexity - * @return {Number} complexity of this instance - */ - complexity(): number; - - /** - * Renders path on a specified context - * @param {CanvasRenderingContext2D} ctx context to render path on - * @param {Boolean} [noTransform] When true, context is not transformed - */ - render(ctx: CanvasRenderingContext2D, noTransform: boolean): void; - /** - * Returns dataless object representation of an instance - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output - * @return {Object} object representation of an instance - */ - toDatalessObject(propertiesToInclude?: any[]): any; - /** - * Returns object representation of an instance - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output - * @return {Object} object representation of an instance - */ - toObject(propertiesToInclude?: any[]): any; - /** - * Returns string representation of an instance - * @return {String} string representation of an instance - */ - toString(): string; - /** - * Returns svg representation of an instance - * @param {Function} [reviver] Method for further parsing of svg representation. - * @return {String} svg representation of an instance - */ - toSVG(reviver?: Function): string; - - /** - * Creates an instance of fabric.Path from an SVG element - * @param {SVGElement} element to parse - * @param {Function} callback Callback to invoke when an fabric.Path instance is created - * @param {Object} [options] Options object - */ - static fromElement(element: SVGElement, callback: (path: IPath) => any, options?: IPathOptions): void; - /** - * Creates an instance of fabric.Path from an object - * @param {Object} object - * @param {Function} callback Callback to invoke when an fabric.Path instance is created - */ - static fromObject(object: any, callback: (path: IPath) => any): void; -} - -export class PathGroup extends Object { - /** - * Constructor - * @param {Array} paths - * @param {Object} [options] Options object - */ - constructor(paths: IPath[], options?: IObjectOptions); - - initialize(paths: IPath[], options?: IObjectOptions): void; - /** - * Returns number representation of object's complexity - * @return {Number} complexity - */ - complexity(): number; - /** - * Returns true if all paths in this group are of same color - * @return {Boolean} true if all paths are of the same color (`fill`) - */ - isSameColor(): boolean; - /** - * Renders this group on a specified context - * @param {CanvasRenderingContext2D} ctx Context to render this instance on - */ - render(ctx: CanvasRenderingContext2D): void; - /** - * Returns dataless object representation of this path group - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output - * @return {Object} dataless object representation of an instance - */ - toDatalessObject(propertiesToInclude?: any[]): any; - /** - * Returns object representation of this path group - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output - * @return {Object} object representation of an instance - */ - toObject(propertiesToInclude?: any[]): any; - /** - * Returns a string representation of this path group - * @return {String} string representation of an object - */ - toString(): string; - /** - * Returns svg representation of an instance - * @param {Function} [reviver] Method for further parsing of svg representation. - * @return {String} svg representation of an instance - */ - toSVG(reviver?: Function): string; - /** - * Returns all paths in this path group - * @return {Array} array of path objects included in this path group - */ - getObjects(): IPath[]; - - static fromObject(object: any): PathGroup; - /** - * Creates fabric.PathGroup instance from an object representation - * @static - * @memberOf fabric.PathGroup - * @param {Object} object Object to create an instance from - * @param {Function} callback Callback to invoke when an fabric.PathGroup instance is created - */ - static fromObject(object: any, callback: (group: PathGroup) => any): void; -} - -interface IPolygonOptions extends IObjectOptions { - /** - * Points array - */ - points?: Point[]; - - /** - * Minimum X from points values, necessary to offset points - */ - minX?: number; - - /** - * Minimum Y from points values, necessary to offset points - */ - minY?: number; -} -export interface Polygon extends IPolygonOptions {} -export class Polygon extends Object { - /** - * Constructor - * @param {Array} points Array of points - * @param {Object} [options] Options object - */ - constructor(points: Array<{ x: number; y: number }>, options?: IObjectOptions, skipOffset?: boolean); - - /** - * Returns complexity of an instance - * @return {Number} complexity of this instance - */ - complexity(): number; - - /** - * Returns object representation of an instance - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output - * @return {Object} object representation of an instance - */ - toObject(propertiesToInclude?: any[]): any; - /** - * Returns svg representation of an instance - * @param {Function} [reviver] Method for further parsing of svg representation. - * @return {String} svg representation of an instance - */ - toSVG(reviver?: Function): string; - - /** - * List of attribute names to account for when parsing SVG element (used by `fabric.Polygon.fromElement`) - */ - static ATTRIBUTE_NAMES: string[]; - - /** - * Returns Polygon instance from an SVG element - * @param {SVGElement} element Element to parse - * @param {Object} [options] Options object - */ - static fromElement(element: SVGElement, options?: IPolygonOptions): Polygon; - /** - * Returns fabric.Polygon instance from an object representation - * @param {Object} object Object to create an instance from - */ - static fromObject(object: any): Polygon; -} - -interface IPolylineOptions extends IObjectOptions { - /** - * Points array - */ - points?: Point[]; - - /** - * Minimum X from points values, necessary to offset points - */ - minX?: number; - - /** - * Minimum Y from points values, necessary to offset points - */ - minY?: number; -} -export interface Polyline extends IPolylineOptions {} -export class Polyline extends Object { - /** - * Constructor - * @param {Array} points Array of points (where each point is an object with x and y) - * @param {Object} [options] Options object - * @param {Boolean} [skipOffset] Whether points offsetting should be skipped - */ - constructor(points: Array<{ x: number; y: number }>, options?: IPolylineOptions); - initialize(points: Point[], options?: IPolylineOptions): void; - /** - * Returns complexity of an instance - * @return {Number} complexity of this instance - */ - complexity(): number; - /** - * Returns object representation of an instance - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output - * @return {Object} Object representation of an instance - */ - toObject(propertiesToInclude?: any[]): any; - /** - * Returns SVG representation of an instance - * @param {Function} [reviver] Method for further parsing of svg representation. - * @return {String} svg representation of an instance - */ - toSVG(reviver?: Function): string; - - /** - * List of attribute names to account for when parsing SVG element (used by `fabric.Polygon.fromElement`) - */ - static ATTRIBUTE_NAMES: string[]; - - /** - * Returns Polyline instance from an SVG element - * @param {SVGElement} element Element to parse - * @param {Object} [options] Options object - */ - static fromElement(element: SVGElement, options?: IPolylineOptions): Polyline; - /** - * Returns fabric.Polyline instance from an object representation - * @param {Object} object Object to create an instance from - */ - static fromObject(object: any): Polyline; -} - -interface IRectOptions extends IObjectOptions { - x?: number; - y?: number; - /** - * Horizontal border radius - */ - rx?: number; - - /** - * Vertical border radius - */ - ry?: number; - -} -export interface Rect extends IRectOptions {} -export class Rect extends Object { - /** - * Constructor - * @param {Object} [options] Options object - */ - constructor(options?: IRectOptions); - initialize(points?: number[], options?: any): Rect; - /** - * Returns complexity of an instance - * @return {Number} complexity - */ - complexity(): number; - /** - * Returns object representation of an instance - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output - * @return {Object} object representation of an instance - */ - toObject(propertiesToInclude: any[]): any; - /** - * Returns svg representation of an instance - * @param {Function} [reviver] Method for further parsing of svg representation. - * @return {String} svg representation of an instance - */ - toSVG(reviver?: Function): string; - - /** - * List of attribute names to account for when parsing SVG element (used by `fabric.Rect.fromElement`) - */ - static ATTRIBUTE_NAMES: string[]; - /** - * Returns Rect instance from an SVG element - * @param {SVGElement} element Element to parse - * @param {Object} [options] Options object - */ - static fromElement(element: SVGElement, options?: IRectOptions): Rect; - /** - * Returns Rect instance from an object representation - * @param {Object} object Object to create an instance from - */ - static fromObject(object: any): Rect; -} - -interface ITextOptions extends IObjectOptions { - /** - * Font size (in pixels) - */ - fontSize?: number; - /** - * Font weight (e.g. bold, normal, 400, 600, 800) - */ - fontWeight?: number|string; - /** - * Font family - */ - fontFamily?: string; - /** - * Text decoration Possible values?: "", "underline", "overline" or "line-through". - */ - textDecoration?: string; - /** - * Text alignment. Possible values?: "left", "center", or "right". - */ - textAlign?: string; - /** - * Font style . Possible values?: "", "normal", "italic" or "oblique". - */ - fontStyle?: string; - /** - * Line height - */ - lineHeight?: number; - /** - * When defined, an object is rendered via stroke and this property specifies its color. - * Backwards incompatibility note?: This property was named "strokeStyle" until v1.1.6 - */ - stroke?: string; - /** - * Shadow object representing shadow of this shape. - * Backwards incompatibility note?: This property was named "textShadow" (String) until v1.2.11 - */ - shadow?: IShadow|string; - /** - * Background color of text lines - */ - textBackgroundColor?: string; - - path?: string; - useNative?: Boolean; - text?: string; -} -export interface Text extends ITextOptions {} -export class Text extends Object { - /** - * Constructor - * @param {String} text Text string - * @param {Object} [options] Options object - */ - constructor(text: string, options?: ITextOptions); - /** - * Returns complexity of an instance - */ - complexity(): number; - /** - * Returns string representation of an instance - */ - toString(): string; - /** - * Renders text instance on a specified context - * @param {CanvasRenderingContext2D} ctx Context to render on - */ - render(ctx: CanvasRenderingContext2D, noTransform: boolean): void; - /** - * Returns object representation of an instance - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output - */ - toObject(propertiesToInclude?: any[]): Object; - /** - * Returns SVG representation of an instance - * @param {Function} [reviver] Method for further parsing of svg representation. - */ - toSVG(reviver?: Function): string; - /** - * Retrieves object's fontSize - */ - getFontSize(): number; - /** - * Sets object's fontSize - * @param {Number} fontSize Font size (in pixels) - */ - setFontSize(fontSize: number): Text; - /** - * Retrieves object's fontWeight - */ - getFontWeight(): number|string; - /** - * Sets object's fontWeight - * @param {(Number|String)} fontWeight Font weight - */ - setFontWeight(fontWeight: string|number): Text; - /** - * Retrieves object's fontFamily - */ - getFontFamily(): string; - /** - * Sets object's fontFamily - * @param {String} fontFamily Font family - */ - setFontFamily(fontFamily: string): Text; - /** - * Retrieves object's text - */ - getText(): string; - /** - * Sets object's text - * @param {String} text Text - */ - setText(text: string): Text; - /** - * Retrieves object's textDecoration - */ - getTextDecoration(): string; - /** - * Sets object's textDecoration - * @param {String} textDecoration Text decoration - */ - setTextDecoration(textDecoration: string): Text; - /** - * Retrieves object's fontStyle - */ - getFontStyle(): string; - /** - * Sets object's fontStyle - * @param {String} fontStyle Font style - */ - setFontStyle(fontStyle: string): Text; - /** - * Retrieves object's lineHeight - */ - getLineHeight(): number; - /** - * Sets object's lineHeight - * @param {Number} lineHeight Line height - */ - setLineHeight(lineHeight: number): Text; - /** - * Retrieves object's textAlign - */ - getTextAlign(): string; - /** - * Sets object's textAlign - * @param {String} textAlign Text alignment - */ - setTextAlign(textAlign: string): Text; - /** - * Retrieves object's textBackgroundColor - */ - getTextBackgroundColor(): string; - /** - * Sets object's textBackgroundColor - * @param {String} textBackgroundColor Text background color - */ - setTextBackgroundColor(textBackgroundColor: string): Text; - - /** - * List of attribute names to account for when parsing SVG element (used by `fabric.Text.fromElement`) - */ - static ATTRIBUTE_NAMES: string[]; - /** - * Default SVG font size - */ - static DEFAULT_SVG_FONT_SIZE: number; - - /** - * Returns fabric.Text instance from an SVG element (not yet implemented) - * @param {SVGElement} element Element to parse - * @param {Object} [options] Options object - */ - static fromElement(element: SVGElement, options?: ITextOptions): Text; - /** - * Returns fabric.Text instance from an object representation - * @param {Object} object Object to create an instance from - */ - static fromObject(object: any): Text; -} - -interface IITextOptions extends IObjectOptions, ITextOptions { - /** - * Index where text selection starts (or where cursor is when there is no selection) - */ - selectionStart?: number; - - /** - * Index where text selection ends - */ - selectionEnd?: number; - - /** - * Color of text selection - */ - selectionColor?: string; - - /** - * Indicates whether text is in editing mode - */ - isEditing?: boolean; - - /** - * Indicates whether a text can be edited - */ - editable?: boolean; - - /** - * Border color of text object while it's in editing mode - */ - editingBorderColor?: string; - - /** - * Width of cursor (in px) - */ - cursorWidth?: number; - - /** - * Color of default cursor (when not overwritten by character style) - */ - cursorColor?: string; - - /** - * Delay between cursor blink (in ms) - */ - cursorDelay?: number; - - /** - * Duration of cursor fadein (in ms) - */ - cursorDuration?: number; - - /** - * Object containing character styles - * (where top-level properties corresponds to line number and 2nd-level properties -- to char number in a line) - */ - styles?: any; - - /** - * Indicates whether internal text char widths can be cached - */ - caching?: boolean; -} -export interface IText extends Text, IITextOptions {} -export class IText extends Object { - /** - * Constructor - * @param {String} text Text string - * @param {Object} [options] Options object - */ - constructor(text: string, options?: IITextOptions); - /** - * Returns true if object has no styling - */ - isEmptyStyles(): boolean; - render(ctx: CanvasRenderingContext2D, noTransform: boolean): void; - /** - * Returns object representation of an instance - * @method toObject - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output - * @return {Object} object representation of an instance - */ - toObject(propertiesToInclude?: any[]): Object; - - setText(value: string): Text; - /** - * Sets selection start (left boundary of a selection) - * @param {Number} index Index to set selection start to - */ - setSelectionStart(index: number): void; - /** - * Sets selection end (right boundary of a selection) - * @param {Number} index Index to set selection end to - */ - setSelectionEnd(index: number): void; - /** - * Gets style of a current selection/cursor (at the start position) - * @param {Number} [startIndex] Start index to get styles at - * @param {Number} [endIndex] End index to get styles at - * @return {Object} styles Style object at a specified (or current) index - */ - getSelectionStyles(startIndex: number, endIndex: number): any; - /** - * Sets style of a current selection - * @param {Object} [styles] Styles object - * @return {fabric.IText} thisArg - * @chainable - */ - setSelectionStyles(styles: any): Text; - - /** - * Renders cursor or selection (depending on what exists) - */ - renderCursorOrSelection(): void; - - /** - * Returns 2d representation (lineIndex and charIndex) of cursor (or selection start) - * @param {Number} [selectionStart] Optional index. When not given, current selectionStart is used. - */ - get2DCursorLocation(selectionStart?: number): void; - /** - * Returns complete style of char at the current cursor - * @param {Number} lineIndex Line index - * @param {Number} charIndex Char index - * @return {Object} Character style - */ - getCurrentCharStyle(lineIndex: number, charIndex: number): any; - - /** - * Returns fontSize of char at the current cursor - * @param {Number} lineIndex Line index - * @param {Number} charIndex Char index - * @return {Number} Character font size - */ - getCurrentCharFontSize(lineIndex: number, charIndex: number): number; - - /** - * Returns color (fill) of char at the current cursor - * @param {Number} lineIndex Line index - * @param {Number} charIndex Char index - * @return {String} Character color (fill) - */ - getCurrentCharColor(lineIndex: number, charIndex: number): string; - /** - * Renders cursor - * @param {Object} boundaries - */ - renderCursor(boundaries: any): void; - - /** - * Renders text selection - * @param {Array} chars Array of characters - * @param {Object} boundaries Object with left/top/leftOffset/topOffset - */ - renderSelection(chars: string[], boundaries: any): void; - - // functions from itext behavior mixin - // ------------------------------------------------------------------------------------------------------------------------ - /** - * Initializes all the interactive behavior of IText - */ - initBehavior(): void; - - /** - * Initializes "selected" event handler - */ - initSelectedHandler(): void; - - /** - * Initializes "added" event handler - */ - initAddedHandler(): void; - - initRemovedHandler(): void; - - /** - * Initializes delayed cursor - */ - initDelayedCursor(restart: boolean): void; - - /** - * Aborts cursor animation and clears all timeouts - */ - abortCursorAnimation(): void; - - /** - * Selects entire text - */ - selectAll(): void; - - /** - * Returns selected text - */ - getSelectedText(): string; - - /** - * Find new selection index representing start of current word according to current selection index - * @param {Number} startFrom Surrent selection index - * @return {Number} New selection index - */ - findWordBoundaryLeft(startFrom: number): number; - - /** - * Find new selection index representing end of current word according to current selection index - * @param {Number} startFrom Current selection index - * @return {Number} New selection index - */ - findWordBoundaryRight(startFrom: number): number; - - /** - * Find new selection index representing start of current line according to current selection index - * @param {Number} startFrom Current selection index - */ - findLineBoundaryLeft(startFrom: number): number; - - /** - * Find new selection index representing end of current line according to current selection index - * @param {Number} startFrom Current selection index - */ - findLineBoundaryRight(startFrom: number): number; - - /** - * Returns number of newlines in selected text - */ - getNumNewLinesInSelectedText(): number; - - /** - * Finds index corresponding to beginning or end of a word - * @param {Number} selectionStart Index of a character - * @param {Number} direction: 1 or -1 - */ - searchWordBoundary(selectionStart: number, direction: number): number; - - /** - * Selects a word based on the index - * @param {Number} selectionStart Index of a character - */ - selectWord(selectionStart: number): void; - /** - * Selects a line based on the index - * @param {Number} selectionStart Index of a character - */ - selectLine(selectionStart: number): void; - - /** - * Enters editing state - */ - enterEditing(): IText; - - /** - * Initializes "mousemove" event handler - */ - initMouseMoveHandler(): void; - /** - * Exits from editing state - * @return {fabric.IText} thisArg - * @chainable - */ - exitEditing(): IText; - - /** - * Inserts a character where cursor is (replacing selection if one exists) - * @param {String} _chars Characters to insert - */ - insertChars(_chars: string, useCopiedStyle?: boolean): void; - /** - * Inserts new style object - * @param {Number} lineIndex Index of a line - * @param {Number} charIndex Index of a char - * @param {Boolean} isEndOfLine True if it's end of line - */ - insertNewlineStyleObject(lineIndex: number, charIndex: number, isEndOfLine: boolean): void; - - /** - * Inserts style object for a given line/char index - * @param {Number} lineIndex Index of a line - * @param {Number} charIndex Index of a char - * @param {Object} [style] Style object to insert, if given - */ - insertCharStyleObject(lineIndex: number, charIndex: number, isEndOfLine: boolean): void; - - /** - * Inserts style object(s) - * @param {String} _chars Characters at the location where style is inserted - * @param {Boolean} isEndOfLine True if it's end of line - * @param {Boolean} [useCopiedStyle] Style to insert - */ - insertStyleObjects(_chars: string, isEndOfLine: boolean, useCopiedStyle?: boolean): void; - - /** - * Shifts line styles up or down - * @param {Number} lineIndex Index of a line - * @param {Number} offset Can be -1 or +1 - */ - shiftLineStyles(lineIndex: number, offset: number): void; - - /** - * Removes style object - * @param {Boolean} isBeginningOfLine True if cursor is at the beginning of line - * @param {Number} [index] Optional index. When not given, current selectionStart is used. - */ - removeStyleObject(isBeginningOfLine: boolean, index?: number): void; - /** - * Inserts new line - */ - insertNewline(): void; - - /** - * Returns fabric.IText instance from an object representation - * @param {Object} object Object to create an instance from - */ - static fromObject(object: any): IText; -} - -interface ITriangleOptions extends IObjectOptions { } -export class Triangle extends Object { - /** - * Constructor - * @param {Object} [options] Options object - */ - constructor(options?: ITriangleOptions); - - /** - * Returns complexity of an instance - * @return {Number} complexity of this instance - */ - complexity(): number; - /** - * Returns SVG representation of an instance - * @param {Function} [reviver] Method for further parsing of svg representation. - * @return {String} svg representation of an instance - */ - toSVG(reviver?: Function): string; - - /** - * Returns Triangle instance from an object representation - * @param {Object} object Object to create an instance from - */ - static fromObject(object: any): Triangle; -} - -//////////////////////////////////////////////////////////// -// Filters -//////////////////////////////////////////////////////////// -interface IAllFilters { - BaseFilter: { - /** - * Constructor - * @param {Object} [options] Options object - */ - new (options?: any): IBaseFilter; - }; - Blend: { - /** - * Constructor - * @param {Object} [options] Options object - */ - new (options?: { color?: string; mode?: string; alpha?: number; image?: Image }): IBlendFilter; - /** - * Returns filter instance from an object representation - * @param {Object} object Object to create an instance from - */ - fromObject(object: any): IBlendFilter - }; - Brightness: { - /** - * Constructor - * @param {Object} [options] Options object - * @param {Number} [options.brightness=0] Value to brighten the image up (0..255) - */ - new (options?: { brightness: number }): IBrightnessFilter; - /** - * Returns filter instance from an object representation - * @param {Object} object Object to create an instance from - */ - fromObject(object: any): IBrightnessFilter - }; - Convolute: { - /** - * Constructor - * @param {Object} [options] Options object - * @param {Boolean} [options.opaque=false] Opaque value (true/false) - * @param {Array} [options.matrix] Filter matrix - */ - new (options?: { opaque?: boolean; matrix?: number[] }): IConvoluteFilter; - /** - * Returns filter instance from an object representation - * @param {Object} object Object to create an instance from - */ - fromObject(object: any): IConvoluteFilter - }; - GradientTransparency: { - /** - * Constructor - * @param {Object} [options] Options object - * @param {Number} [options.threshold=100] Threshold value - */ - new (options?: { threshold?: number; }): IGradientTransparencyFilter; - /** - * Returns filter instance from an object representation - * @param {Object} object Object to create an instance from - */ - fromObject(object: any): IGradientTransparencyFilter - }; - Grayscale: { - /** - * Constructor - * @param {Object} [options] Options object - */ - new (options?: any): IGrayscaleFilter; - /** - * Returns filter instance from an object representation - * @param {Object} object Object to create an instance from - */ - fromObject(object: any): IGrayscaleFilter - }; - Invert: { - /** - * Constructor - * @param {Object} [options] Options object - */ - new (options?: any): IInvertFilter; - /** - * Returns filter instance from an object representation - * @param {Object} object Object to create an instance from - */ - fromObject(object: any): IInvertFilter - }; - Mask: { - /** - * Constructor - * @param {Object} [options] Options object - * @param {fabric.Image} [options.mask] Mask image object - * @param {Number} [options.channel=0] Rgb channel (0, 1, 2 or 3) - */ - new (options?: { mask?: Image; channel: number; }): IMaskFilter; - /** - * Returns filter instance from an object representation - * @param {Object} object Object to create an instance from - */ - fromObject(object: any): IMaskFilter - }; - Multiply: { - /** - * Constructor - * @param {Object} [options] Options object - * @param {Number} [options.color=#000000] Color to multiply the image pixels with - */ - new (options?: { color: string; }): IMultiplyFilter; - /** - * Returns filter instance from an object representation - * @param {Object} object Object to create an instance from - */ - fromObject(object: any): IMultiplyFilter - }; - Noise: { - /** - * Constructor - * @param {Object} [options] Options object - * @param {Number} [options.noise=0] Noise value - */ - new (options?: { noise: number; }): INoiseFilter; - /** - * Returns filter instance from an object representation - * @param {Object} object Object to create an instance from - */ - fromObject(object: any): INoiseFilter - }; - Pixelate: { - /** - * Constructor - * @param {Object} [options] Options object - * @param {Number} [options.blocksize=4] Blocksize for pixelate - */ - new (options?: { blocksize?: number; }): IPixelateFilter; - /** - * Returns filter instance from an object representation - * @param {Object} object Object to create an instance from - */ - fromObject(object: any): IPixelateFilter - }; - RemoveWhite: { - /** - * Constructor - * @param {Object} [options] Options object - * @param {Number} [options.threshold=30] Threshold value - * @param {Number} [options.distance=20] Distance value - */ - new (options?: { threshold?: number; distance?: number; }): IRemoveWhiteFilter; - /** - * Returns filter instance from an object representation - * @param {Object} object Object to create an instance from - */ - fromObject(object: any): IRemoveWhiteFilter - }; - Resize: { - /** - * Constructor - * @param {Object} [options] Options object - */ - new (options?: any): IResizeFilter; - /** - * Returns filter instance from an object representation - * @param {Object} object Object to create an instance from - */ - fromObject(object: any): IResizeFilter - }; - Sepia2: { - /** - * Constructor - * @param {Object} [options] Options object - */ - new (options?: any): ISepia2Filter; - /** - * Returns filter instance from an object representation - * @param {Object} object Object to create an instance from - */ - fromObject(object: any): ISepia2Filter - }; - Sepia: { - /** - * Constructor - * @param {Object} [options] Options object - */ - new (options?: any): ISepiaFilter; - /** - * Returns filter instance from an object representation - * @param {Object} object Object to create an instance from - */ - fromObject(object: any): ISepiaFilter - }; - Tint: { - /** - * Constructor - * @param {Object} [options] Options object - * @param {String} [options.color=#000000] Color to tint the image with - * @param {Number} [options.opacity] Opacity value that controls the tint effect's transparency (0..1) - */ - new (options?: { color?: string; opacity?: number; }): ITintFilter; - /** - * Returns filter instance from an object representation - * @param {Object} object Object to create an instance from - */ - fromObject(object: any): ITintFilter - }; -} -interface IBaseFilter { - /** - * Sets filter's properties from options - * @param {Object} [options] Options object - */ - setOptions(options?: any): void; - /** - * Returns object representation of an instance - */ - toObject(): any; - /** - * Returns a JSON representation of an instance - */ - toJSON(): string; -} -interface IBlendFilter extends IBaseFilter { - /** - * Applies filter to canvas element - * @param {Object} canvasEl Canvas element to apply filter to - */ - applyTo(canvasEl: HTMLCanvasElement): void; -} -interface IBrightnessFilter extends IBaseFilter { - /** - * Applies filter to canvas element - * @param {Object} canvasEl Canvas element to apply filter to - */ - applyTo(canvasEl: HTMLCanvasElement): void; -} -interface IConvoluteFilter extends IBaseFilter { - /** - * Applies filter to canvas element - * @param {Object} canvasEl Canvas element to apply filter to - */ - applyTo(canvasEl: HTMLCanvasElement): void; -} -interface IGradientTransparencyFilter { - /** - * Applies filter to canvas element - * @param {Object} canvasEl Canvas element to apply filter to - */ - applyTo(canvasEl: HTMLCanvasElement): void; -} -interface IGrayscaleFilter { - /** - * Applies filter to canvas element - * @param {Object} canvasEl Canvas element to apply filter to - */ - applyTo(canvasEl: HTMLCanvasElement): void; -} -interface IInvertFilter { - /** - * Applies filter to canvas element - * @param {Object} canvasEl Canvas element to apply filter to - */ - applyTo(canvasEl: HTMLCanvasElement): void; -} -interface IMaskFilter { - /** - * Applies filter to canvas element - * @param {Object} canvasEl Canvas element to apply filter to - */ - applyTo(canvasEl: HTMLCanvasElement): void; -} -interface IMultiplyFilter { - /** - * Applies filter to canvas element - * @param {Object} canvasEl Canvas element to apply filter to - */ - applyTo(canvasEl: HTMLCanvasElement): void; -} -interface INoiseFilter { - /** - * Applies filter to canvas element - * @param {Object} canvasEl Canvas element to apply filter to - */ - applyTo(canvasEl: HTMLCanvasElement): void; -} -interface IPixelateFilter { - /** - * Applies filter to canvas element - * @param {Object} canvasEl Canvas element to apply filter to - */ - applyTo(canvasEl: HTMLCanvasElement): void; -} -interface IRemoveWhiteFilter { - /** - * Applies filter to canvas element - * @param {Object} canvasEl Canvas element to apply filter to - */ - applyTo(canvasEl: HTMLCanvasElement): void; -} -interface IResizeFilter { - /** - * Resize type - */ - resizeType: string; - - /** - * Scale factor for resizing, x axis - */ - scaleX: number; - - /** - * Scale factor for resizing, y axis - */ - scaleY: number; - - /** - * LanczosLobes parameter for lanczos filter - */ - lanczosLobes: number; - /** - * Applies filter to canvas element - * @param {Object} canvasEl Canvas element to apply filter to - */ - applyTo(canvasEl: HTMLCanvasElement): void; -} -interface ISepiaFilter { - /** - * Applies filter to canvas element - * @param {Object} canvasEl Canvas element to apply filter to - */ - applyTo(canvasEl: HTMLCanvasElement): void; -} -interface ISepia2Filter { - /** - * Applies filter to canvas element - * @param {Object} canvasEl Canvas element to apply filter to - */ - applyTo(canvasEl: HTMLCanvasElement): void; -} -interface ITintFilter { - /** - * Applies filter to canvas element - * @param {Object} canvasEl Canvas element to apply filter to - */ - applyTo(canvasEl: HTMLCanvasElement): void; -} - -//////////////////////////////////////////////////////////// -// Brushes -//////////////////////////////////////////////////////////// -export class BaseBrush { - /** - * Color of a brush - */ - color: string; - - /** - * Width of a brush - */ - width: number; - - /** - * Shadow object representing shadow of this shape. - * Backwards incompatibility note: This property replaces "shadowColor" (String), "shadowOffsetX" (Number), - * "shadowOffsetY" (Number) and "shadowBlur" (Number) since v1.2.12 - */ - shadow: IShadow|string; - /** - * Line endings style of a brush (one of "butt", "round", "square") - */ - strokeLineCap: string; - - /** - * Corner style of a brush (one of "bevil", "round", "miter") - */ - strokeLineJoin: string; - - /** - * Stroke Dash Array. - */ - strokeDashArray: any[]; - - /** - * Sets shadow of an object - * @param {Object|String} [options] Options object or string (e.g. "2px 2px 10px rgba(0,0,0,0.2)") - */ - setShadow(options: string|any): BaseBrush; - -} -export class CircleBrush extends BaseBrush { - /** - * Width of a brush - */ - width: number; - /** - * Invoked inside on mouse down and mouse move - * @param {Object} pointer - */ - drawDot(pointer: any): void; - - /** - * @param {Object} pointer - * @return {fabric.Point} Just added pointer point - */ - addPoint(pointer: any): Point -} -export class SprayBrush extends BaseBrush { - /** - * Width of a brush - */ - width: number; - /** - * Density of a spray (number of dots per chunk) - */ - density: number; - - /** - * Width of spray dots - */ - dotWidth: number; - /** - * Width variance of spray dots - */ - dotWidthVariance: number; - - /** - * Whether opacity of a dot should be random - */ - randomOpacity: boolean; - /** - * Whether overlapping dots (rectangles) should be removed (for performance reasons) - */ - optimizeOverlapping: boolean; - /** - * @param {Object} pointer - */ - addSprayChunk(pointer: any): void -} -export class PatternBrush extends PencilBrush { - getPatternSrc(): HTMLCanvasElement; - - getPatternSrcFunction(): string; - - /** - * Creates "pattern" instance property - */ - getPattern(): any; - /** - * Creates path - */ - createPath(pathData: string): IPath; -} -export class PencilBrush extends BaseBrush { - /** - * Converts points to SVG path - * @param {Array} points Array of points - * @param {Number} minX - * @param {Number} minY - */ - convertPointsToSVGPath(points: Array<{ x: number; y: number }>, minX?: number, minY?: number): string[]; - - /** - * Creates fabric.Path object to add on canvas - * @param {String} pathData Path data - */ - createPath(pathData: string): IPath; -} - -/////////////////////////////////////////////////////////////////////////////// -// Fabric util Interface -////////////////////////////////////////////////////////////////////////////// -interface IUtilAnimationOptions { - /** - * Starting value - */ - startValue?: number; - /** - * Ending value - */ - endValue?: number; - /** - * Value to modify the property by - */ - byValue: number; - /** - * Duration of change (in ms) - */ - duration?: number; - /** - * Callback; invoked on every value change - */ - onChange?: Function; - /** - * Callback; invoked when value change is completed - */ - onComplete?: Function; - /** - * Easing function - */ - easing?: Function; -} -interface IUtilAnimation { - /** - * Changes value from one to another within certain period of time, invoking callbacks as value is being changed. - * @param {Object} [options] Animation options - */ - animate(options?: IUtilAnimationOptions): void; - /** - * requestAnimationFrame polyfill based on http://paulirish.com/2011/requestanimationframe-for-smart-animating/ - * In order to get a precise start time, `requestAnimFrame` should be called as an entry into the method - * @param {Function} callback Callback to invoke - */ - requestAnimFrame(callback: Function): void; -} - -type IUtilAminEaseFunction = (t: number, b: number, c: number, d: number) => number; - -interface IUtilAnimEase { - easeInBack: IUtilAminEaseFunction; - easeInBounce: IUtilAminEaseFunction; - easeInCirc: IUtilAminEaseFunction; - easeInCubic: IUtilAminEaseFunction; - easeInElastic: IUtilAminEaseFunction; - easeInExpo: IUtilAminEaseFunction; - easeInOutBack: IUtilAminEaseFunction; - easeInOutBounce: IUtilAminEaseFunction; - easeInOutCirc: IUtilAminEaseFunction; - easeInOutCubic: IUtilAminEaseFunction; - easeInOutElastic: IUtilAminEaseFunction; - easeInOutExpo: IUtilAminEaseFunction; - easeInOutQuad: IUtilAminEaseFunction; - easeInOutQuart: IUtilAminEaseFunction; - easeInOutQuint: IUtilAminEaseFunction; - easeInOutSine: IUtilAminEaseFunction; - easeInQuad: IUtilAminEaseFunction; - easeInQuart: IUtilAminEaseFunction; - easeInQuint: IUtilAminEaseFunction; - easeInSine: IUtilAminEaseFunction; - easeOutBack: IUtilAminEaseFunction; - easeOutBounce: IUtilAminEaseFunction; - easeOutCirc: IUtilAminEaseFunction; - easeOutCubic: IUtilAminEaseFunction; - easeOutElastic: IUtilAminEaseFunction; - easeOutExpo: IUtilAminEaseFunction; - easeOutQuad: IUtilAminEaseFunction; - easeOutQuart: IUtilAminEaseFunction; - easeOutQuint: IUtilAminEaseFunction; - easeOutSine: IUtilAminEaseFunction; -} - -interface IUtilArc { - /** - * Draws arc - * @param {CanvasRenderingContext2D} ctx - * @param {Number} fx - * @param {Number} fy - * @param {Array} coords - */ - drawArc(ctx: CanvasRenderingContext2D, fx: number, fy: number, coords: number[]): void; - /** - * Calculate bounding box of a elliptic-arc - * @param {Number} fx start point of arc - * @param {Number} fy - * @param {Number} rx horizontal radius - * @param {Number} ry vertical radius - * @param {Number} rot angle of horizontal axe - * @param {Number} large 1 or 0, whatever the arc is the big or the small on the 2 points - * @param {Number} sweep 1 or 0, 1 clockwise or counterclockwise direction - * @param {Number} tx end point of arc - * @param {Number} ty - */ - getBoundsOfArc(fx: number, fy: number, rx: number, ry: number, rot: number, large: number, sweep: number, tx: number, ty: number): Point[]; - /** - * Calculate bounding box of a beziercurve - * @param {Number} x0 starting point - * @param {Number} y0 - * @param {Number} x1 first control point - * @param {Number} y1 - * @param {Number} x2 secondo control point - * @param {Number} y2 - * @param {Number} x3 end of beizer - * @param {Number} y3 - */ - getBoundsOfCurve(x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, x3: number, y3: number): Point[]; - -} - -interface IUtilDomEvent { - /** - * Cross-browser wrapper for getting event's coordinates - * @param {Event} event Event object - * @param {HTMLCanvasElement} upperCanvasEl <canvas> element on which object selection is drawn - */ - getPointer(event: Event, upperCanvasEl: HTMLCanvasElement): Point; - - /** - * Adds an event listener to an element - * @param {HTMLElement} element - * @param {String} eventName - * @param {Function} handler - */ - addListener(element: HTMLElement, eventName: string, handler: Function): void; - - /** - * Removes an event listener from an element - * @param {HTMLElement} element - * @param {String} eventName - * @param {Function} handler - */ - removeListener(element: HTMLElement, eventName: string, handler: Function): void; -} - -interface IUtilDomMisc { - /** - * Takes id and returns an element with that id (if one exists in a document) - * @param {String|HTMLElement} id - */ - getById(id: string|HTMLElement): HTMLElement; - /** - * Converts an array-like object (e.g. arguments or NodeList) to an array - * @param {Object} arrayLike - */ - toArray(arrayLike: any): any[]; - /** - * Creates specified element with specified attributes - * @memberOf fabric.util - * @param {String} tagName Type of an element to create - * @param {Object} [attributes] Attributes to set on an element - * @return {HTMLElement} Newly created element - */ - makeElement(tagName: string, attributes?: any): HTMLElement; - /** - * Adds class to an element - * @param {HTMLElement} element Element to add class to - * @param {String} className Class to add to an element - */ - addClass(element: HTMLElement, classname: string): void; - /** - * Wraps element with another element - * @param {HTMLElement} element Element to wrap - * @param {HTMLElement|String} wrapper Element to wrap with - * @param {Object} [attributes] Attributes to set on a wrapper - */ - wrapElement(element: HTMLElement, wrapper: HTMLElement|string, attributes?: any): HTMLElement; - /** - * Returns element scroll offsets - * @param {HTMLElement} element Element to operate on - * @param {HTMLElement} upperCanvasEl Upper canvas element - */ - getScrollLeftTop(element: HTMLElement, upperCanvasEl: HTMLElement): { left: number; right: number; }; - /** - * Returns offset for a given element - * @param {HTMLElement} element Element to get offset for - */ - getElementOffset(element: HTMLElement): { left: number; right: number; }; - /** - * Returns style attribute value of a given element - * @param {HTMLElement} element Element to get style attribute for - * @param {String} attr Style attribute to get for element - */ - getElementStyle(elment: HTMLElement, attr: string): string; - /** - * Inserts a script element with a given url into a document; invokes callback, when that script is finished loading - * @memberOf fabric.util - * @param {String} url URL of a script to load - * @param {Function} callback Callback to execute when script is finished loading - */ - getScript(url: string, callback: Function): void; - /** - * Makes element unselectable - * @param {HTMLElement} element Element to make unselectable - */ - makeElementUnselectable(element: HTMLElement): HTMLElement; - /** - * Makes element selectable - * @param {HTMLElement} element Element to make selectable - */ - makeElementSelectable(element: HTMLElement): HTMLElement; -} - -interface IUtilDomRequest { - /** - * Cross-browser abstraction for sending XMLHttpRequest - * @param {String} url URL to send XMLHttpRequest to - * @param {Object} [options] Options object - * @param {String} [options.method="GET"] - * @param {Function} options.onComplete Callback to invoke when request is completed - */ - request(url: string, options?: { method?: string; onComplete: Function }): XMLHttpRequest; -} - -interface IUtilDomStyle { - /** - * Cross-browser wrapper for setting element's style - * @param {HTMLElement} element - * @param {Object} styles - */ - setStyle(element: HTMLElement, styles: any): HTMLElement; -} - -interface IUtilArray { - /** - * Invokes method on all items in a given array - * @param {Array} array Array to iterate over - * @param {String} method Name of a method to invoke - */ - invoke(array: any[], method: string): any[]; - /** - * Finds minimum value in array (not necessarily "first" one) - * @param {Array} array Array to iterate over - * @param {String} byProperty - */ - min(array: any[], byProperty: string): any; - /** - * Finds maximum value in array (not necessarily "first" one) - * @param {Array} array Array to iterate over - * @param {String} byProperty - */ - max(array: any[], byProperty: string): any; -} - -interface IUtilClass { - /** - * Helper for creation of "classes". - * @param {Function} [parent] optional "Class" to inherit from - * @param {Object} [properties] Properties shared by all instances of this class - * (be careful modifying objects defined here as this would affect all instances) - */ - createClass(parent: Function, properties?: any): void; - /** - * Helper for creation of "classes". - * @param {Object} [properties] Properties shared by all instances of this class - * (be careful modifying objects defined here as this would affect all instances) - */ - createClass(properties?: any): void; - -} - -interface IUtilObject { - /** - * Copies all enumerable properties of one object to another - * @param {Object} destination Where to copy to - * @param {Object} source Where to copy from - */ - extend(destination: any, source: any): any; - - /** - * Creates an empty object and copies all enumerable properties of another object to it - * @memberOf fabric.util.object - * @param {Object} object Object to clone - * @return {Object} - */ - clone(object: any): any; -} - -interface IUtilString { - /** - * Camelizes a string - * @param {String} string String to camelize - */ - camelize(string: string): string; - - /** - * Capitalizes a string - * @param {String} string String to capitalize - * @param {Boolean} [firstLetterOnly] If true only first letter is capitalized - * and other letters stay untouched, if false first letter is capitalized - * and other letters are converted to lowercase. - */ - capitalize(string: string, firstLetterOnly: boolean): string; - - /** - * Escapes XML in a string - * @param {String} string String to escape - */ - escapeXml(string: string): string; -} - -interface IUtilMisc { - /** - * Removes value from an array. - * Presence of value (and its position in an array) is determined via `Array.prototype.indexOf` - * @param {Array} array - * @param {Any} value - */ - removeFromArray(array: any[], value: any): any[]; - - /** - * Returns random number between 2 specified ones. - * @param {Number} min lower limit - * @param {Number} max upper limit - */ - getRandomInt(min: number, max: number): number; - - /** - * Transforms degrees to radians. - * @param {Number} degrees value in degrees - */ - degreesToRadians(degrees: number): number; - - /** - * Transforms radians to degrees. - * @memberOf fabric.util - * @param {Number} radians value in radians - */ - radiansToDegrees(radians: number): number; - - /** - * Rotates `point` around `origin` with `radians` - * @param {fabric.Point} point The point to rotate - * @param {fabric.Point} origin The origin of the rotation - * @param {Number} radians The radians of the angle for the rotation - */ - rotatePoint(point: Point, origin: Point, radians: number): Point; - - /** - * Apply transform t to point p - * @param {fabric.Point} p The point to transform - * @param {Array} t The transform - * @param {Boolean} [ignoreOffset] Indicates that the offset should not be applied - */ - transformPoint(p: Point, t: any[], ignoreOffset?: boolean): Point; - - /** - * Invert transformation t - * @param {Array} t The transform - */ - invertTransform(t: any[]): any[]; - - /** - * A wrapper around Number#toFixed, which contrary to native method returns number, not string. - * @param {Number|String} number number to operate on - * @param {Number} fractionDigits number of fraction digits to "leave" - */ - toFixed(number: number, fractionDigits: number): number; - - /** - * Converts from attribute value to pixel value if applicable. - * Returns converted pixels or original value not converted. - * @param {Number|String} value number to operate on - */ - parseUnit(value: number|string, fontSize?: number): number|string; - - /** - * Function which always returns `false`. - */ - falseFunction(): boolean; - - /** - * Returns klass "Class" object of given namespace - * @param {String} type Type of object (eg. 'circle') - * @param {String} namespace Namespace to get klass "Class" object from - */ - getKlass(type: string, namespace: string): any; - - /** - * Returns object of given namespace - * @param {String} namespace Namespace string e.g. 'fabric.Image.filter' or 'fabric' - */ - resolveNamespace(namespace: string): any; - - /** - * Loads image element from given url and passes it to a callback - * @param {String} url URL representing an image - * @param {Function} callback Callback; invoked with loaded image - * @param {Any} [context] Context to invoke callback in - * @param {Object} [crossOrigin] crossOrigin value to set image element to - */ - loadImage(url: string, callback: (image: HTMLImageElement) => {}, context?: any, crossOrigin?: boolean): void; - - /** - * Creates corresponding fabric instances from their object representations - * @param {Array} objects Objects to enliven - * @param {Function} callback Callback to invoke when all objects are created - * @param {String} namespace Namespace to get klass "Class" object from - * @param {Function} reviver Method for further parsing of object elements, called after each fabric object created. - */ - enlivenObjects(objects: any[], callback: Function, namespace: string, reviver?: Function): void; - - /** - * Groups SVG elements (usually those retrieved from SVG document) - * @param {Array} elements SVG elements to group - * @param {Object} [options] Options object - */ - groupSVGElements(elements: any[], options?: any, path?: any): PathGroup; - - /** - * Populates an object with properties of another object - * @param {Object} source Source object - * @param {Object} destination Destination object - * @param {Array} properties Propertie names to include - */ - populateWithProperties(source: any, destination: any, properties: any): void; - - /** - * Draws a dashed line between two points - * This method is used to draw dashed line around selection area. - * @param {CanvasRenderingContext2D} ctx context - * @param {Number} x start x coordinate - * @param {Number} y start y coordinate - * @param {Number} x2 end x coordinate - * @param {Number} y2 end y coordinate - * @param {Array} da dash array pattern - */ - drawDashedLine(ctx: CanvasRenderingContext2D, x: number, y: number, x2: number, y2: number, da: any[]): void; - - /** - * Creates canvas element and initializes it via excanvas if necessary - * @param {CanvasElement} [canvasEl] optional canvas element to initialize; - * when not given, element is created implicitly - */ - createCanvasElement(canvasEl?: HTMLCanvasElement): HTMLCanvasElement; - - /** - * Creates image element (works on client and node) - */ - createImage(): HTMLImageElement; - - /** - * Creates accessors (getXXX, setXXX) for a "class", based on "stateProperties" array - * @param {Object} klass "Class" to create accessors for - */ - createAccessors(klass: any): any; - - /** - * @param {fabric.Object} receiver Object implementing `clipTo` method - * @param {CanvasRenderingContext2D} ctx Context to clip - */ - clipContext(receiver: Object, ctx: CanvasRenderingContext2D): void; - - /** - * Multiply matrix A by matrix B to nest transformations - * @param {Array} a First transformMatrix - * @param {Array} b Second transformMatrix - */ - multiplyTransformMatrices(a: any[], b: any[]): any[]; - - /** - * Returns string representation of function body - * @param {Function} fn Function to get body of - */ - getFunctionBody(fn: Function): string; - - /** - * Returns true if context has transparent pixel - * at specified location (taking tolerance into account) - * @param {CanvasRenderingContext2D} ctx context - * @param {Number} x x coordinate - * @param {Number} y y coordinate - * @param {Number} tolerance Tolerance - */ - isTransparent(ctx: CanvasRenderingContext2D, x: number, y: number, tolerance: number): boolean; -} - -export var util: IUtil; -interface IUtil extends IUtilAnimation, IUtilArc, IObservable, IUtilDomEvent, IUtilDomMisc, - IUtilDomRequest, IUtilDomStyle, IUtilClass, IUtilMisc { - ease: IUtilAnimEase; - array: IUtilArray; - object: IUtilObject; - string: IUtilString; -} diff --git a/fabric/tslint.json b/fabric/tslint.json deleted file mode 100644 index 525190cf34..0000000000 --- a/fabric/tslint.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../tslint.json", - "rules": { - "adjacent-overload-signatures": false, - "forbidden-types": false, - "interface-name": false, - "no-empty-interface": false, - "unified-signatures": false - } -} diff --git a/facebook-js-sdk/index.d.ts b/facebook-js-sdk/index.d.ts deleted file mode 100644 index a7b78e73b0..0000000000 --- a/facebook-js-sdk/index.d.ts +++ /dev/null @@ -1,206 +0,0 @@ -// Type definitions for the Facebook Javascript SDK 2.8 -// Project: https://developers.facebook.com/docs/javascript -// Definitions by: Amrit Kahlon -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -import fb = facebook; -declare var FB: fb.FacebookStatic; -declare namespace facebook { - - interface FacebookStatic { - api: any; - AppEvents: any; - Canvas: any; - Event: any; - - /** - * The method FB.getAuthResponse() is a synchronous accessor for the current authResponse. - * The synchronous nature of this method is what sets it apart from the other login methods. - * - * @param callback function to handle the response. - */ - getAuthResponse(callback: (response: AuthResponse) => void): void; - /** - * FB.getLoginStatus() allows you to determine if a user is - * logged in to Facebook and has authenticated your app. - * - * @param callback function to handle the response. - */ - getLoginStatus(callback: (response: AuthResponse) => void, roundtrip?: boolean ): void; - /** - * The method FB.init() is used to initialize and setup the SDK. - * - * @param params params for the initialization. - */ - init(params: InitParams): void; - /** - * Use this function to log the user in - * - * Calling FB.login() results in the JS SDK attempting to open a popup window. - * As such, this method should only be called after a user click event, otherwise - * the popup window will be blocked by most browsers. - * - * @param callback function to handle the response. - * @param options optional ILoginOption to add params such as scope. - */ - login(callback: (response: AuthResponse) => void, options?: LoginOptions): void; - /** - * The method FB.logout() logs the user out of your site and, in some cases, Facebook. - * - * @param callback function to handle the response - */ - logout(callback: (response: AuthResponse) => void): void; - - /** - * @see https://developers.facebook.com/docs/sharing/reference/share-dialog - */ - ui(params: ShareDialogParams, callback: (response: ShareDialogResponse) => void): void; - - /** - * @see https://developers.facebook.com/docs/games/services/gamerequests - */ - ui(params: GameRequestDialogParams, callback: (response: GameRequestDialogResponse) => void): void; - - /** - * @see https://developers.facebook.com/docs/payments/reference/paydialog - */ - ui(params: PayDialogParams, callback: (response: PayDialogResponse) => void): void; - - /** - * @see https://developers.facebook.com/docs/videos/live-video/exploring-live - */ - ui(params: LiveDialogParams, callback: (response: LiveDialogResponse) => void): void; - - /** - * @see https://developers.facebook.com/docs/sharing/reference/send-dialog - * @see https://developers.facebook.com/docs/pages/page-tab-dialog - */ - ui(params: SendDialogParams | AddPageTabDialogParams, callback: (response: null) => void): void; - - XFBML: any; - } - - interface InitParams { - appId: string; - version?: string; - cookie?: boolean; - status?: boolean; - xfbml?: boolean; - frictionlessRequests?: boolean; - hideFlashCallback?: boolean; - } - - interface LoginOptions { - auth_type?: string; - scope?: string; - return_scopes?: boolean; - enable_profile_selector?: boolean; - profile_selector_ids?: string; - } - - //////////////////////// - // - // DIALOGS - // - //////////////////////// - - interface DialogParams { - app_id?: string; - redirect_uri?: string; - display?: 'page' | 'iframe' | 'async' | 'popup'; - } - - interface ShareDialogParams extends DialogParams { - method: 'share'; - href: string; - hashtag?: string; - quote?: string; - mobile_iframe?: boolean; - } - - interface AddPageTabDialogParams extends DialogParams { - method: 'pagetab'; - redirect_uri: string; - } - - interface GameRequestDialogParams extends DialogParams { - method: 'apprequests'; - message: string; - action_type?: 'send' | 'askfor' | 'turn'; - data?: number; - exclude_ids?: string[]; - filters?: 'app_users' | 'app_non_users' | Array<{ name: string, user_ids: string[] }>; - max_recipients?: number; - object_id?: string; - suggestions?: string[]; - title?: number; - to?: string | number; - } - - interface SendDialogParams extends DialogParams { - method: 'send'; - to?: string; - link: string; - } - - interface PayDialogParams extends DialogParams { - method: 'pay'; - action: 'purchaseitem'; - product: string; - quantity?: number; - quantity_min?: number; - quantity_max?: number; - request_id?: string; - test_currency?: string; - } - - interface LiveDialogParams extends DialogParams { - method: 'live_broadcast'; - display: 'popup' | 'iframe'; - phase: 'create' | 'publish'; - broadcast_data?: LiveDialogResponse; - } - - //////////////////////// - // - // RESPONSES - // - //////////////////////// - - interface AuthResponse { - status: string; - authResponse: { - accessToken: string; - expiresIn: number; - signedRequest: string; - userID: string; - }; - } - - interface ShareDialogResponse { - post_id?: string; - error_message?: string; - } - - interface GameRequestDialogResponse { - request: string; - to: string[]; - } - - interface PayDialogResponse { - payment_id: string; - amount: string; - currency: string; - quantity: string; - request_id: string; - status: string; - signed_request: string; - } - - interface LiveDialogResponse { - id: string; - stream_url: string; - secure_stream_url: string; - status: string; - } -} diff --git a/faker/tsconfig.json b/faker/tsconfig.json deleted file mode 100644 index c2ce14c941..0000000000 --- a/faker/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "faker-tests.ts" - ] -} \ No newline at end of file diff --git a/falcor-router/falcor-router-tests.ts b/falcor-router/falcor-router-tests.ts deleted file mode 100644 index 5f5bdca0e4..0000000000 --- a/falcor-router/falcor-router-tests.ts +++ /dev/null @@ -1,102 +0,0 @@ - - -import falcor = require('falcor'); -import Router = require('falcor-router'); - -new Router([]); -new Router([], {}); -new Router([], {debug: true}); -new Router([], {maxPaths: 10}); -new Router([], {maxRefFollow: 10}); -new Router([{route: "greeting", get: () =>({path:["greeting"], value: "Hello World"})}]); - -new falcor.Model({source: new Router([])}); - -class MyRouter extends Router.createClass([]) { - constructor() { - super({debug: true, maxPaths: 10, maxRefFollow: 10}); - } -} -new falcor.Model({source: new MyRouter()}); - -new Router([{ - route: 'todos.length', - get() { - return {path: 'todos.length', value: 10}; - }, -}]); - -new Router([{ - route: 'todos.length', - get() { - return [{path: 'todos.length', value: 10}]; - }, -}]); - -new Router([{ - route: 'todos.length', - get() { - return {json: { todos: {length : 10}}}; - } -}]); - -new Router([{ - route: 'todos.length', - get() { - return new Promise(resolve => { - resolve({path: 'todos.length', value: 10}); - }); - }, -}]); - -new Router([{ - route: 'todos.length', - get() { - return new Promise(resolve => { - resolve([{path: 'todos.length', value: 10}]); - }); - }, -}]); - -new Router([{ - route: 'todos.length', - get() { - return new Promise>(resolve => { - resolve({json: { todos: {length : 10}}}); - }); - } -}]); - -new Router([{ - route: 'todos[{integers:indicies}]', - get(pathset: Router.RoutePathSet & {indicies: number[]}) { - return pathset.indicies.map(idx => { - const id = 'id' + idx; - return { - path: `todos[${idx}]`, - value: { - $type: 'ref', - value: `todosById.${id}` - } - } - }); - } -}]); - -new Router([{ - route: 'todos[{integers:number}]', - set(jsonGraph) { - return {json: jsonGraph}; - } -}]); - -new Router([{ - route: 'todos.push', - call(callpath, args) { - return [ - {path: 'json.todos.length', value: 11}, - {path: 'json.todos[10].name', value: args[0].name} - ]; - } -}]); - diff --git a/falcor-router/index.d.ts b/falcor-router/index.d.ts deleted file mode 100644 index 659f45767f..0000000000 --- a/falcor-router/index.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -// Type definitions for falcor-router 0.4.0 -// Project: https://github.com/Netflix/falcor-router -// Definitions by: Quramy -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// -import * as FalcorModel from 'falcor'; -import * as FalcorJsonGraph from 'falcor-json-graph'; -import DataSource = FalcorModel.DataSource; - -declare class FalcorRouter extends DataSource { - - constructor(routes: Array, options?: FalcorRouter.RouterOptions); - - /** - * When a route misses on a call, get, or set the unhandledDataSource will - * have a chance to fulfill that request. - **/ - routeUnhandledPathsTo(dataSource: DataSource): void; - - static createClass(routes?: Array): typeof FalcorRouter.CreatedRouter; -} - -declare namespace FalcorRouter { - - class CreatedRouter extends FalcorRouter { - constructor(options?: RouterOptions); - } - - interface Route { - route: string; - } - - type RoutePathSet = FalcorJsonGraph.PathSet; - - interface CallRoute extends Route { - call(callPath: RoutePathSet, args: Array): RouteResult | Promise; - } - - interface GetRoute extends Route { - get(pathset: RoutePathSet): RouteResult | Promise; - } - - interface SetRoute extends Route { - set(jsonGraph: FalcorJsonGraph.JSONGraph): RouteResult | Promise; - } - - type RouteDefinition = GetRoute | SetRoute | CallRoute; - type RouteResult = FalcorJsonGraph.PathValue | Array | FalcorJsonGraph.JSONEnvelope; - - interface RouterOptions { - debug?: boolean; - maxPaths?: number; - maxRefFollow?: number; - } -} - -export = FalcorRouter; - diff --git a/falcor/index.d.ts b/falcor/index.d.ts deleted file mode 100644 index 1bf3c9ba23..0000000000 --- a/falcor/index.d.ts +++ /dev/null @@ -1,285 +0,0 @@ -// Type definitions for falcor 0.1 -// Project: http://netflix.github.io/falcor/ -// Definitions by: Quramy -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -import { Path, PathSet, PathValue, JSONEnvelope, JSONGraph, JSONGraphEnvelope } from 'falcor-json-graph'; - -export as namespace falcor; - -///////////////////////////////////////////////////// -// Global types -///////////////////////////////////////////////////// - -export { XMlHttpSource as HttpDataSource } from "falcor-http-datasource"; -export { - Atom, - Error, - Key, - KeySet, - Path, - PathSet, - PathValue, - JSONEnvelope, - JSONGraph, - JSONGraphEnvelope, - Range, - Reference, - ref, - atom, - error, - pathValue } from "falcor-json-graph"; - -///////////////////////////////////////////////////// -// DataSource -///////////////////////////////////////////////////// - -/** - * A DataSource is an interface which can be implemented to expose JSON Graph information to a Model. - * Every DataSource is associated with a single JSON Graph object. - * Models execute JSON Graph operations (get, set, and call) to retrieve values from the DataSource’s JSON Graph object. - * DataSources may retrieve JSON Graph information from anywhere, including device memory, a remote machine, or even a lazily-run computation. - **/ -export abstract class DataSource { - - /** - * The get method retrieves values from the DataSource's associated JSONGraph object. - **/ - get(pathSets: PathSet[]): Observable; - - - /** - * The set method accepts values to set in the DataSource's associated JSONGraph object. - **/ - set(jsonGraphEnvelope: JSONGraphEnvelope): Observable; - - - /** - * Invokes a function in the DataSource's JSONGraph object. - **/ - call(functionPath: Path, args?: any[], refSuffixes?: PathSet[], thisPaths?: PathSet[]): Observable; -} - - -///////////////////////////////////////////////////// -// Model -///////////////////////////////////////////////////// - -interface ModelOptions { - source?: DataSource; - cache?: JSONGraph; - maxSize?: number; - collectRatio?: number; - errorSelector?: ModelErrorSelector; - onChange?: ModelOnChange; - comparator?: ModelComparator; -} - -/** - * This callback is invoked when the Model's cache is changed. - **/ -type ModelOnChange = () => void; - -/** - * This function is invoked on every JSONGraph Error retrieved from the DataSource. This function allows Error objects to be transformed before being stored in the Model's cache. - **/ -type ModelErrorSelector = (jsonGraphError: any) => any; - -/** - * This function is invoked every time a value in the Model cache is about to be replaced with a new value. - * If the function returns true, the existing value is replaced with a new value and the version flag on all of the value's ancestors in the tree are incremented. - **/ -type ModelComparator = (existingValue: any, newValue: any) => boolean; - -/** - * A Model object is used to execute commands against a {@link JSONGraph} object - * {@link Model}s can work with a local JSONGraph cache, or it can work with a remote {@link JSONGraph} object through a {@link DataSource}. - **/ -export class Model { - constructor(options?: ModelOptions); - - /** - * The get method retrieves several {@link Path}s or {@link PathSet}s from a {@link Model}. The get method loads each value into a JSON object and returns in a ModelResponse. - **/ - get(...path: Array): ModelResponse>; - get(...path: Array): ModelResponse>; - - /** - * Sets the value at one or more places in the JSONGraph model. - * The set method accepts one or more {@link PathValue}s, each of which is a combination of a location in the document and the value to place there. - * In addition to accepting {@link PathValue}s, the set method also returns the values after the set operation is complete. - **/ - set(...args: PathValue[]): ModelResponse>; - set(...args: PathValue[]): ModelResponse>; - set(jsonGraph: JSONGraph): ModelResponse>; - set(jsonGraph: JSONGraph): ModelResponse>; - - /** - * The preload method retrieves several {@link Path}s or {@link PathSet}s from a {@link Model} and loads them into the Model cache. - **/ - preload(...path: PathSet[]): void; - - /** - * Invokes a function in the JSON Graph. - **/ - // NOTE: In http://netflix.github.io/falcor/doc/Model.html#call, it says that refPaths should be an PathSet[]. - // However, model implementation returns an error with setting refPaths as PathSet[] and it works with refPaths as PathSet. - // So refPaths is defined as a PathSet in this .d.ts. - call(functionPath: string | Path, args?: any[], refPaths?: PathSet, thisPaths?: PathSet[]): ModelResponse>; - call(functionPath: string | Path, args?: any[], refPaths?: PathSet, thisPaths?: PathSet[]): ModelResponse>; - - /** - * The invalidate method synchronously removes several {@link Path}s or {@link PathSet}s from a {@link Model} cache. - **/ - invalidate(...path: PathSet[]): void; - - /** - * Returns a new {@link Model} bound to a location within the {@link JSONGraph}. - * The bound location is never a {@link Reference}: any {@link Reference}s encountered while resolving the bound {@link Path} are always replaced with the {@link Reference}s target value. - * For subsequent operations on the {@link Model}, all paths will be evaluated relative to the bound path. Deref allows you to: - * - Expose only a fragment of the {@link JSONGraph} to components, rather than the entire graph - * - Hide the location of a {@link JSONGraph} fragment from components - * - Optimize for executing multiple operations and path looksup at/below the same location in the {@link JSONGraph} - **/ - deref(responseObject: any): Model; - - /** - * Get data for a single {@link Path}. - **/ - getValue(path: string | Path): ModelResponse; - getValue(path: string | Path): ModelResponse; - - /** - * Set value for a single {@link Path}. - **/ - setValue(path: string | Path, value: any): ModelResponse; - setValue(path: string | Path, value: any): ModelResponse; - - /** - * Set the local cache to a {@link JSONGraph} fragment. This method can be a useful way of mocking a remote document, or restoring the local cache from a previously stored state. - **/ - setCache(jsonGraph: JSONGraph): void; - - /** - * Get the local {@link JSONGraph} cache. This method can be a useful to store the state of the cache. - **/ - getCache(...path: PathSet[]): JSONGraph; - - /** - * Retrieves a number which is incremented every single time a value is changed underneath the Model or the object at an optionally-provided Path beneath the Model. - **/ - getVersion(path?: Path): number; - - /** - * Returns a clone of the {@link Model} that enables batching. Within the configured time period, paths for get operations are collected and sent to the {@link DataSource} in a batch. - * Batching can be more efficient if the {@link DataSource} access the network, potentially reducing the number of HTTP requests to the server. - **/ - batch(schedulerOrDelay?: number | Scheduler): Model; // FIXME what's a valid type for scheduler? - - /** - * Returns a clone of the {@link Model} that disables batching. This is the default mode. Each get operation will be executed on the {@link DataSource} separately. - **/ - unbatch(): Model; - - /** - * Returns a clone of the {@link Model} that treats errors as values. Errors will be reported in the same callback used to report data. - * Errors will appear as objects in responses, rather than being sent to the {@link Observable~onErrorCallback} callback of the {@link ModelResponse}. - **/ - treatErrorsAsValues(): Model; - - /** - * Adapts a Model to the {@link DataSource} interface. - **/ - asDataSource(): DataSource; - - /** - * Returns a clone of the {@link Model} that boxes values returning the wrapper ({@link Atom}, {@link Reference}, or {@link Error}), rather than the value inside it. - * This allows any metadata attached to the wrapper to be inspected. - **/ - boxValues(): Model; - - /** - * Returns a clone of the {@link Model} that unboxes values, returning the value inside of the wrapper ({@link Atom}, {@link Reference}, or {@link Error}), rather than the wrapper itself. - * This is the default mode. - **/ - unboxValues(): Model; - - /** - * Returns a clone of the {@link Model} that only uses the local {@link JSONGraph} and never uses a {@link DataSource} to retrieve missing paths. - **/ - withoutDataSource(): Model; - - /** - * Returns the {@link Path} to the object within the JSON Graph that this Model references. - **/ - getPath(): Path; -} - - -///////////////////////////////////////////////////// -// ModelResponse -///////////////////////////////////////////////////// - -export class ModelResponse extends Observable { - constructor(observable: Observable); - progressively(): ModelResponse>; - forEach(onNext: (value: T) => void, onError?: (error: Error) => void, onCompleted?: () => void): Subscription; - then(onFulfilled?: (value: T) => any | Thenable, onRejected?: (error: any) => void): Thenable; - then(onFulfilled?: (value: T) => U | Thenable, onRejected?: (error: any) => void): Thenable; -} - -interface Thenable { - then(onFulfilled?: (value: T) => U | Thenable, onRejected?: (error: any) => U | Thenable | void): Thenable; -} - - -///////////////////////////////////////////////////// -// Observable -///////////////////////////////////////////////////// - -export class Observable{ - - /** - * The forEach method is a synonym for {@link Observable.prototype.subscribe} and triggers the execution of the Observable, causing the values within to be pushed to a callback. - * An Observable is like a pipe of water that is closed. - * When forEach is called, we open the valve and the values within are pushed at us. - * These values can be received using either callbacks or an {@link Observer} object. - **/ - forEach(onNext?: ObservableOnNextCallback, onError?: ObservableOnErrorCallback , onCompleted?: ObservableOnCompletedCallback ): Subscription; - - /** - * The subscribe method is a synonym for {@link Observable.prototype.forEach} and triggers the execution of the Observable, causing the values within to be pushed to a callback. - * An Observable is like a pipe of water that is closed. - * When forEach is called, we open the valve and the values within are pushed at us. These values can be received using either callbacks or an {@link Observer} object. - **/ - subscribe(onNext?: ObservableOnNextCallback, onError?: ObservableOnErrorCallback , onCompleted?: ObservableOnCompletedCallback ): Subscription; -} - -/** - * This callback accepts a value that was emitted while evaluating the operation underlying the {@link Observable} stream. - **/ -type ObservableOnNextCallback = (value: T) => void; - -/** - * This callback accepts an error that occurred while evaluating the operation underlying the {@link Observable} stream. - * When this callback is invoked, the {@link Observable} stream ends and no more values will be received by the {@link Observable~onNextCallback}. - **/ -type ObservableOnErrorCallback = (error: Error) => void; - -/** - * This callback is invoked when the {@link Observable} stream ends. - * When this callback is invoked the {@link Observable} stream has ended, and therefore the {@link Observable~onNextCallback} will not receive any more values. - **/ -type ObservableOnCompletedCallback = () => void; - -export class Subscription { - /** - * When this method is called on the Subscription, the Observable that created the Subscription will stop sending values to the callbacks passed when the Subscription was created. - **/ - dispose(): void; -} - -interface Scheduler { - catch(handler: (exception: any) => boolean): Scheduler; - catchException(handler: (exception: any) => boolean): Scheduler; -} diff --git a/falcor/test/index.ts b/falcor/test/index.ts deleted file mode 100644 index 2798b72645..0000000000 --- a/falcor/test/index.ts +++ /dev/null @@ -1,130 +0,0 @@ -import falcor = require('falcor'); - -declare const dataSource: falcor.DataSource; -dataSource.get([['someParam']]).subscribe(jsonGraphEnvelope => { - console.log(jsonGraphEnvelope.jsonGraph); -}); -dataSource.set({ - jsonGraph: { - someParam: 'value', - }, - paths: [['someParam']] -}).subscribe(jsonGraphEnvelope => { - console.log(jsonGraphEnvelope.jsonGraph); -}); - -dataSource.call(['items', 'push']); -dataSource.call(['items', 'push'], [{id: 'i003', name: 'item003'}]); -dataSource.call(['items', 'push'], [{id: 'i003', name: 'item003'}], [['id', 'name']]); -dataSource.call(['items', 'push'], [{id: 'i003', name: 'item003'}], [['id', 'name']], [['length']]).subscribe(jsonGraphEnvelope => { - console.log(jsonGraphEnvelope.jsonGraph); - console.log(jsonGraphEnvelope.invalidate); - console.log(jsonGraphEnvelope.paths[0]); -}); - -new falcor.Model(); -new falcor.Model({}); -new falcor.Model({ - source: dataSource, - cache: {}, - maxSize: 100, - collectRatio: 0.5, - comparator: (a, b) => { - return a === b; - }, - errorSelector: (jsonGraphError: any) => { - console.error(jsonGraphError); - }, - onChange: () => { - console.log('Changed!'); - } -}); - -const model = new falcor.Model({ - cache: { - itemsById: { - i01: {id: 'i01', name: 'item 01'}, - i27: {id: 'i27', name: 'item 27'}, - }, - items: [ - {$type: 'ref', value: ['itemsById', 'i01']}, - {$type: 'ref', value: ['itemsById', 'i27']}, - ], - } -}); - -model.get('items[0].name'); -model.get(['items', 0, 'name']); -model.get(['items', {from: 0, to: 1}, 'name']); -model.get(['items', {from: 0, length: 2 }, 'name']); -model.get('items[0].name', 'items[1].name'); - -model.set({path: 'items[0].name', value: 'ITEM 01'}, {path: ['items', 1, 'name'], value: 'ITEM 27'}); -model.set({ - itemsById: { - i01: { - name: 'ITEM 01' - } - } -}); - -model.preload(); -model.preload(['items', 0, 'name']); -model.preload(['items', 0, 'name'], ['items', 1, 'name']); -model.preload(['items', {from: 0, to: 1}, 'name']); - -model.call('items.push'); -model.call(['items', 'push']); -model.call('items.push', [{id: 'i02', name: 'item02'}], ["length"]); -model.call('items.push', [{id: 'i02', name: 'item02'}], ["name", "length"], []); - -model.invalidate(); -model.invalidate(['items', 0, 'name']); -model.invalidate(['items', 0, 'name'], ['items', 1, 'name']); -model.invalidate(['items', {from: 0, to: 1}, 'name']); - -model.get('items[0].["name", "id"]').then(res => { - const derefedModel = model.deref(res.json.items[0]); - derefedModel.get('name', 'id'); -}); - -model.getValue('items[0].name').subscribe(); -model.getValue(['items', 0, 'name']).subscribe(); - -model.setValue('items[0].name', 'item001').subscribe(); -model.setValue(['items', 0, 'name'], 'item001').subscribe(); - -model.setCache({itemsById: {}}); - -const cache = model.getCache(); - -let version: number; -version = model.getVersion(); -version = model.getVersion(['items']); - -const delayedBatchingModel: falcor.Model = model.batch(100); -delayedBatchingModel.unbatch(); - -const teabModel: falcor.Model = model.treatErrorsAsValues(); - -const sourceFromModel: falcor.DataSource = model.asDataSource(); - -const boxingModel: falcor.Model = model.boxValues(); -const unboxingModel: falcor.Model = boxingModel.unboxValues(); -const noDataSourceModel: falcor.Model = model.withoutDataSource(); -const somePath: falcor.Path = model.getPath(); - -const modelResponse = model.get<{items: {length: number}}>('items.length'); - -modelResponse.subscribe(); -modelResponse.subscribe(res => res.json.items.length); -modelResponse.subscribe(res => res.json.items.length, error => console.error.bind(error)); -modelResponse.subscribe(res => res.json.items.length, error => console.error.bind(error), () => null); - -const subscription = modelResponse.subscribe(res => res); -subscription.dispose(); - -modelResponse.then(res => res.json.items.length); -modelResponse.then(res => res, error => console.error.bind(error)); -modelResponse.then(res => res.json.items.length).then((l: number) => l + 1); - diff --git a/falcor/tslint.json b/falcor/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/falcor/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/fast-json-patch/fast-json-patch-tests.ts b/fast-json-patch/fast-json-patch-tests.ts deleted file mode 100644 index 15ac0d57f1..0000000000 --- a/fast-json-patch/fast-json-patch-tests.ts +++ /dev/null @@ -1,42 +0,0 @@ -import * as jsonpatch from 'fast-json-patch' - -var myobj:{ - firstName:string, - contactDetails: { - phoneNumbers:string[] - } -} = { firstName:"Albert", contactDetails: { phoneNumbers: [ ] } }; -var patches = [ - {op:"replace", path:"/firstName", value:"Joachim" }, - {op:"add", path:"/lastName", value:"Wester" }, - {op:"add", path:"/contactDetails/phoneNumbers/0", value:{ number:"555-123" } } - ]; -jsonpatch.apply( myobj, patches ); - -var myobj2 = { firstName:"Joachim", lastName:"Wester", contactDetails: { phoneNumbers: [ { number:"555-123" }] } }; -var observer = jsonpatch.observe( myobj2 ); -myobj2.firstName = "Albert"; -myobj2.contactDetails.phoneNumbers[0].number = "123"; -myobj2.contactDetails.phoneNumbers.push({number:"456"}); -var patches2 = jsonpatch.generate(observer); - -var objA = {user: {firstName: "Albert", lastName: "Einstein"}}; -var objB = {user: {firstName: "Albert", lastName: "Collins"}}; -var diff = jsonpatch.compare(objA, objB); - -var obj = {user: {firstName: "Albert"}}; -var patches3 = [{op: "replace", path: "/user/firstName", value: "Albert"}, {op: "replace", path: "/user/lastName", value: "Einstein"}]; -var errors = jsonpatch.validate(patches, obj); -if (errors.length == 0) { - //there are no errors! -} -else { - for (var i=0; i < errors.length; i++) { - if (!errors[i]) { - console.log("Valid patch at index", i, patches[i]); - } - else { - console.error("Invalid patch at index", i, errors[i], patches[i]); - } - } -} diff --git a/fast-json-patch/index.d.ts b/fast-json-patch/index.d.ts deleted file mode 100644 index 9a4496b00c..0000000000 --- a/fast-json-patch/index.d.ts +++ /dev/null @@ -1,67 +0,0 @@ -// Type definitions for JSON-Patch v1.0.0 -// Project: https://github.com/Starcounter-Jack/JSON-Patch/releases -// Definitions by: Francis OBrien -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare namespace fastjsonpatch { - - - interface JsonPatch { - /** - * Applies an array of patch instructions to an object - */ - apply(object:any, patches:Patch[], validate?:boolean):boolean - - /** - * Observes changes made to an object, which can then be retieved using generate - */ - observe(object:T, callback?:()=>void):Observer - - /** - * Detach an observer from an object - */ - unobserve(object:T, observer:Observer):void - - /** - * Generate an array of patches from an observer - */ - generate(observer:Observer):Patch[] - - /** - * Create an array of patches from the differences in two objects - */ - compare(object1:any, object2:any):Patch[] - - /** - * Ensure a set of patch instructions is valid - */ - validate(patches:Patch[], tree?:any):JsonPatchError[] - } - - interface Observer { - object:T - patches:Patch[] - unobserve():void - } - - interface Patch { - op:string - path:string - value?:any - from?:string - } - - interface JsonPatchError { - name:string - message:string - index:number - operation:any - tree:any - } -} - -declare var jsonpatch: fastjsonpatch.JsonPatch; - -declare module "fast-json-patch" { - export = jsonpatch -} \ No newline at end of file diff --git a/fast-json-patch/tsconfig.json b/fast-json-patch/tsconfig.json deleted file mode 100644 index 08d3a2703f..0000000000 --- a/fast-json-patch/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "fast-json-patch-tests.ts" - ] -} \ No newline at end of file diff --git a/fast-simplex-noise/fast-simplex-noise-tests.ts b/fast-simplex-noise/fast-simplex-noise-tests.ts deleted file mode 100644 index 584ff3ad04..0000000000 --- a/fast-simplex-noise/fast-simplex-noise-tests.ts +++ /dev/null @@ -1,28 +0,0 @@ - -import FastSimplexNoise = require('fast-simplex-noise') - -var defaultNoiseGen: FastSimplexNoise = new FastSimplexNoise() -var emptyOptionsNoiseGen: FastSimplexNoise = new FastSimplexNoise({}) - -var noiseGen: FastSimplexNoise = new FastSimplexNoise({ - amplitude: 1, - frequency: 0.01, - max: 255, - min: 0, - octaves: 8, - persistence: 0.5, - random: Math.random -}) - -var values: number[] = [] - -values.push(noiseGen.cylindrical2D(5, 1, 1)) -values.push(noiseGen.cylindrical3D(5, 1, 1, 1)) -values.push(noiseGen.in2D(1, 1)) -values.push(noiseGen.in3D(1, 1, 1)) -values.push(noiseGen.in4D(1, 1, 1, 1)) -values.push(noiseGen.raw2D(1, 1)) -values.push(noiseGen.raw3D(1, 1, 1)) -values.push(noiseGen.raw4D(1, 1, 1, 1)) -values.push(noiseGen.spherical2D(5, 1, 1)) -values.push(noiseGen.spherical3D(5, 1, 1, 1)) diff --git a/fast-simplex-noise/index.d.ts b/fast-simplex-noise/index.d.ts deleted file mode 100644 index 14df3351ef..0000000000 --- a/fast-simplex-noise/index.d.ts +++ /dev/null @@ -1,94 +0,0 @@ -// Type definitions for FastSimplexNoise v2.1.1 -// Project: https://www.npmjs.com/package/fast-simplex-noise -// Definitions by: Tobias Cohen -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/** - * A JavaScript implementation of the improved, faster Simplex algorithm outlined in Stefan Gustavson's Simplex noise demystified. - * - * Convenience functions have been added as well, in order to avoid needing to scale and handle the raw noise data directly. - */ -declare class FastSimplexNoise { - amplitude: number; - frequency: number; - max: number; - min: number; - octaves: number; - persistence: number; - random: ()=>number; - - /** - * Options is an optional object that can contain: - * - * amplitude: float - The base amplitude (default: 1.0) - * frequency: float - The base frequency (default: 1.0) - * max: float - The maximum scaled value to return (effective default: 1.0) - * min: float - The minimum scaled value to return (effective default: -1.0) - * octaves: integer - The number of octaves to sum for noise generation (default: 1) - * persistence: float - The persistence of amplitude per octave (default: 0.5) - * random: function - A function that generates random values between 0 and 1 (default: Math.random) - */ - constructor(options?: { - amplitude?: number; - frequency?: number; - max?: number; - min?: number; - octaves?: number; - persistence?: number; - random?: ()=>number; - }); - - /** - * Get a noise value between min and max for a point (x,y) on the surface of a cylinder with circumference c. - */ - cylindrical2D(c: number, x: number, y: number): number; - - /** - * Get a noise value between min and max for a point (x, y, z) on the surface of a cylinder with circumference c. - */ - cylindrical3D(c: number, x: number, y: number, z: number): number; - - /** - * Get a noise value between min and max at the 2D coordinate (x,y) in summed octaves, using amplitude, frequency, and persistence values. - */ - in2D(x: number, y: number): number; - - /** - * Get a noise value between min and max at the 3D coordinate (x,y,z) in summed octaves, using amplitude, frequency, and persistence values. - */ - in3D(x: number, y: number, z: number): number; - - /** - * Get a noise value between min and max at the 4D coordinate (x,y,z,w) in summed octaves, using amplitude, frequency, and persistence values. - */ - in4D(x: number, y: number, z: number, w: number): number; - - /** - * Get a noise value [-1, 1] at the 2D coordinate (x,y). - */ - raw2D(x: number, y: number): number; - - /** - * Get a noise value [-1, 1] at the 3D coordinate (x,y,z). - */ - raw3D(x: number, y: number, z: number): number; - - /** - * Get a noise value [-1, 1] at the 4D coordinate (x,y,z,w). - */ - raw4D(x: number, y: number, z: number, w: number): number; - - /** - * Get a noise value between min and max for a point (x, y) on the surface of a sphere with circumference c. - */ - spherical2D(c: number, x: number, y: number): number; - - /** - * Get a noise value between min and max for a point (x, y, z) on the surface of a sphere with circumference c. - */ - spherical3D(c: number, x: number, y: number, z: number): number; -} - -declare module "fast-simplex-noise" { - export = FastSimplexNoise; -} diff --git a/fast-simplex-noise/tsconfig.json b/fast-simplex-noise/tsconfig.json deleted file mode 100644 index 396315e587..0000000000 --- a/fast-simplex-noise/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "fast-simplex-noise-tests.ts" - ] -} \ No newline at end of file diff --git a/fetch-mock/index.d.ts b/fetch-mock/index.d.ts deleted file mode 100644 index 4d69096845..0000000000 --- a/fetch-mock/index.d.ts +++ /dev/null @@ -1,398 +0,0 @@ -// Type definitions for fetch-mock 5.8 -// Project: https://github.com/wheresrhys/fetch-mock -// Definitions by: Alexey Svetliakov , Tamir Duberstein , Risto Keravuori -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// - -type MockRequest = Request | RequestInit; - -/** - * Mock matcher function - * @param url - * @param opts - */ -type MockMatcherFunction = (url: string, opts: MockRequest) => boolean; -/** - * Mock matcher. Can be one of following: - * string: Either - * an exact url to match e.g. 'http://www.site.com/page.html' - * if the string begins with a `^`, the string following the `^` must - begin the url e.g. '^http://www.site.com' would match - 'http://www.site.com' or 'http://www.site.com/page.html' - * '*' to match any url - * RegExp: A regular expression to test the url against - * Function(url, opts): A function (returning a Boolean) that is passed the - url and opts fetch() is called with (or, if fetch() was called with one, - the Request instance) - */ -type MockMatcher = string | RegExp | MockMatcherFunction; - -/** - * Mock response object - */ -interface MockResponseObject { - /** - * Set the response body - */ - body?: string | {}; - /** - * Set the response status - * @default 200 - */ - status?: number; - /** - * Set the response headers. - */ - headers?: { [key: string]: string }; - /** - * If this property is present then a Promise rejected with the value - of throws is returned - */ - throws?: boolean; - /** - * This property determines whether or not the request body should be - JSON.stringified before being sent - * @default true - */ - sendAsJson?: boolean; -} -/** - * Response: A Response instance - will be used unaltered - * number: Creates a response with this status - * string: Creates a 200 response with the string as the response body - * object: As long as the object is not a MockResponseObject it is - converted into a json string and returned as the body of a 200 response - * If MockResponseObject was given then it's used to configure response - * Function(url, opts): A function that is passed the url and opts fetch() - is called with and that returns any of the responses listed above - */ -type MockResponse = Response | Promise - | number | Promise - | string | Promise - | {} | Promise<{}> - | MockResponseObject | Promise; -/** - * Mock response function - * @param url - * @param opts - */ -type MockResponseFunction = (url: string, opts: MockRequest) => MockResponse; - -/** - * Mock options object - */ -interface MockOptions { - /** - * A unique string naming the route. Used to subsequently retrieve - references to the calls, grouped by name. - * @default matcher.toString() - * - * Note: If a non-unique name is provided no error will be thrown - (because names are optional, auto-generated ones may legitimately - clash) - */ - name?: string; - /** - * http method to match - */ - method?: string; - /** - * as specified above - */ - matcher?: MockMatcher; - /** - * as specified above - */ - response?: MockResponse | MockResponseFunction; - /** - * integer, n, limiting the number of times the matcher can be used. - If the route has already been called n times the route will be - ignored and the call to fetch() will fall through to be handled by - any other routes defined (which may eventually result in an error - if nothing matches it). - */ - times?: number; -} - -type MockCall = [string, MockRequest]; - -interface MatchedRoutes { - matched: MockCall[]; - unmatched: MockCall[]; -} - -interface MockOptionsMethodGet extends MockOptions { - method: 'GET'; -} - -interface MockOptionsMethodPost extends MockOptions { - method: 'POST'; -} - -interface MockOptionsMethodPut extends MockOptions { - method: 'PUT'; -} - -interface MockOptionsMethodDelete extends MockOptions { - method: 'DELETE'; -} - -interface MockOptionsMethodHead extends MockOptions { - method: 'HEAD'; -} - -interface FetchMockStatic { - /** - * Replaces fetch() with a stub which records its calls, grouped by - route, and optionally returns a mocked Response object or passes the - call through to fetch(). Calls to .mock() can be chained. - * @param matcher Condition for selecting which requests to mock - * @param response Configures the http response returned by the mock - * @param [options] Additional properties defining the route to mock - */ - mock(matcher: MockMatcher, response: MockResponse | MockResponseFunction, options?: MockOptions): this; - /** - * Replaces fetch() with a stub which records its calls, grouped by - route, and optionally returns a mocked Response object or passes the - call through to fetch(). Calls to .mock() can be chained. - * @param options The route to mock - */ - mock(options: MockOptions): this; - - /** - * Replaces fetch() with a stub which records its calls, grouped by - route, and optionally returns a mocked Response object or passes the - call through to fetch(). Shorthand for mock() limited to being - called one time only. Calls to .once() can be chained. - * @param matcher Condition for selecting which requests to mock - * @param response Configures the http response returned by the mock - * @param [options] Optional additional properties defining the route to mock - */ - once(matcher: MockMatcher, response: MockResponse | MockResponseFunction, options?: MockOptions): this; - - /** - * Replaces fetch() with a stub which records its calls, grouped by - route, and optionally returns a mocked Response object or passes the - call through to fetch(). Shorthand for mock() restricted to the GET - method. Calls to .get() can be chained. - * @param matcher Condition for selecting which requests to mock - * @param response Configures the http response returned by the mock - * @param [options] Additional properties defining the route to mock - */ - get(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodGet): this; - /** - * Replaces fetch() with a stub which records its calls, grouped by - route, and optionally returns a mocked Response object or passes the - call through to fetch(). Shorthand for mock() restricted to the GET - method and limited to being called one time only. Calls to .getOnce() - can be chained. - * @param matcher Condition for selecting which requests to mock - * @param response Configures the http response returned by the mock - * @param [options] Additional properties defining the route to mock - */ - getOnce(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodGet): this; - - /** - * Replaces fetch() with a stub which records its calls, grouped by - route, and optionally returns a mocked Response object or passes the - call through to fetch(). Shorthand for mock() restricted to the POST - method. Calls to .post() can be chained. - * @param matcher Condition for selecting which requests to mock - * @param response Configures the http response returned by the mock - * @param [options] Additional properties defining the route to mock - */ - post(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodPost): this; - /** - * Replaces fetch() with a stub which records its calls, grouped by - route, and optionally returns a mocked Response object or passes the - call through to fetch(). Shorthand for mock() restricted to the POST - method and limited to being called one time only. Calls to .postOnce() - can be chained. - * @param matcher Condition for selecting which requests to mock - * @param response Configures the http response returned by the mock - * @param [options] Additional properties defining the route to mock - */ - postOnce(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodPost): this; - - /** - * Replaces fetch() with a stub which records its calls, grouped by - route, and optionally returns a mocked Response object or passes the - call through to fetch(). Shorthand for mock() restricted to the PUT - method. Calls to .put() can be chained. - * @param matcher Condition for selecting which requests to mock - * @param response Configures the http response returned by the mock - * @param [options] Additional properties defining the route to mock - */ - put(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodPut): this; - /** - * Replaces fetch() with a stub which records its calls, grouped by - route, and optionally returns a mocked Response object or passes the - call through to fetch(). Shorthand for mock() restricted to the PUT - method and limited to being called one time only. Calls to .putOnce() - can be chained. - * @param matcher Condition for selecting which requests to mock - * @param response Configures the http response returned by the mock - * @param [options] Additional properties defining the route to mock - */ - putOnce(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodPut): this; - - /** - * Replaces fetch() with a stub which records its calls, grouped by - route, and optionally returns a mocked Response object or passes the - call through to fetch(). Shorthand for mock() restricted to the - DELETE method. Calls to .delete() can be chained. - * @param matcher Condition for selecting which requests to mock - * @param response Configures the http response returned by the mock - * @param [options] Additional properties defining the route to mock - */ - delete(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodDelete): this; - /** - * Replaces fetch() with a stub which records its calls, grouped by - route, and optionally returns a mocked Response object or passes the - call through to fetch(). Shorthand for mock() restricted to the - DELETE method and limited to being called one time only. Calls to - .deleteOnce() can be chained. - * @param matcher Condition for selecting which requests to mock - * @param response Configures the http response returned by the mock - * @param [options] Additional properties defining the route to mock - */ - deleteOnce(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodDelete): this; - - /** - * Replaces fetch() with a stub which records its calls, grouped by - route, and optionally returns a mocked Response object or passes the - call through to fetch(). Shorthand for mock() restricted to the HEAD - method. Calls to .head() can be chained. - * @param matcher Condition for selecting which requests to mock - * @param response Configures the http response returned by the mock - * @param [options] Additional properties defining the route to mock - */ - head(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodHead): this; - /** - * Replaces fetch() with a stub which records its calls, grouped by - route, and optionally returns a mocked Response object or passes the - call through to fetch(). Shorthand for mock() restricted to the HEAD - method and limited to being called one time only. Calls to .headOnce() - can be chained. - * @param matcher Condition for selecting which requests to mock - * @param response Configures the http response returned by the mock - * @param [options] Additional properties defining the route to mock - */ - headOnce(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodHead): this; - - /** - * Replaces fetch() with a stub which records its calls, grouped by - route, and optionally returns a mocked Response object or passes the - call through to fetch(). Shorthand for mock() restricted to the PATCH - method. Calls to .patch() can be chained. - * @param matcher Condition for selecting which requests to mock - * @param response Configures the http response returned by the mock - * @param [options] Additional properties defining the route to mock - */ - patch(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodHead): this; - /** - * Replaces fetch() with a stub which records its calls, grouped by - route, and optionally returns a mocked Response object or passes the - call through to fetch(). Shorthand for mock() restricted to the PATCH - method and limited to being called one time only. Calls to .patchOnce() - can be chained. - * @param matcher Condition for selecting which requests to mock - * @param response Configures the http response returned by the mock - * @param [options] Additional properties defining the route to mock - */ - patchOnce(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodHead): this; - - /** - * Chainable method that defines how to respond to calls to fetch that - don't match any of the defined mocks. It accepts the same types of - response as a normal call to .mock(matcher, response). It can also - take an arbitrary function to completely customise behaviour of - unmatched calls. If .catch() is called without any parameters then - every unmatched call will receive a 200 response. - * @param [response] Configures the http response returned by the mock - */ - catch(response?: MockResponse | MockResponseFunction): this; - - /** - * Chainable method that records the call history of unmatched calls, - but instead of responding with a stubbed response, the request is - passed through to native fetch() and is allowed to communicate - over the network. Similar to catch(). - */ - spy(response?: MockResponse | MockResponseFunction): this; - - /** - * Chainable method that restores fetch() to its unstubbed state and - clears all data recorded for its calls. - */ - restore(): this; - - /** - * Chainable method that clears all data recorded for fetch()'s calls - */ - reset(): this; - - /** - * Returns all calls to fetch, grouped by whether fetch-mock matched - them or not. - */ - calls(): MatchedRoutes; - /** - * Returns all calls to fetch matching matcherName. - */ - calls(matcherName?: string): MockCall[]; - - /** - * Returns a Boolean indicating whether fetch was called and a route - was matched (or a specific route if matcherName is passed). - * @param [matcherName] either the name of a route or equal to - matcher.toString() for any unnamed route - */ - called(matcherName?: string): boolean; - - /** - * Returns a Boolean indicating whether fetch was called the expected - number of times (or at least once if the route defines no expectation - is set) for every route (or for a specific route if matcherName is - passed). - * @param [matcherName] either the name of a route or equal to - matcher.toString() for any unnamed route - */ - done(matcherName?: string): boolean; - - /** - * Returns the arguments for the last matched call to fetch (or the - last call to specific route is matcherName is passed). - * @param [matcherName] either the name of a route or equal to - matcher.toString() for any unnamed route - */ - lastCall(matcherName?: string): MockCall; - - /** - * Returns the url for the last matched call to fetch (or the last - call to specific route is matcherName is passed). - * @param [matcherName] either the name of a route or equal to - matcher.toString() for any unnamed route - */ - lastUrl(matcherName?: string): string; - - /** - * Returns the options for the last matched call to fetch (or the - last call to a specific route is matcherName is passed). - * @param [matcherName] either the name of a route or equal to - matcher.toString() for any unnamed route - */ - lastOptions(matcherName?: string): MockRequest; - - /** - * Set some global config options, which include - * sendAsJson [default `true`] - by default fetchMock will - convert objects to JSON before sending. This is overrideable - for each call but for some scenarios, e.g. when dealing with a - lot of array buffers, it can be useful to default to `false` - */ - configure(opts: {}): void; -} - -declare var fetchMock: FetchMockStatic; -export = fetchMock; diff --git a/fetch-mock/tslint.json b/fetch-mock/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/fetch-mock/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/fetch.io/fetch.io-tests.ts b/fetch.io/fetch.io-tests.ts deleted file mode 100644 index 4e14a7a9a9..0000000000 --- a/fetch.io/fetch.io-tests.ts +++ /dev/null @@ -1,60 +0,0 @@ - -import Fetch from 'fetch.io' - -const request = new Fetch() - -request - .get('') - .query({}) - .json() - -request - .delete('') - .json() - -request - .head('') - .json() - -request - .options('') - .json() - -request - .put('') - .json() - -request - .config('key', 'value') - .json() - -request - .config({key: 'value'}) - .json() - -request - .config('set', 'value') - .json() - -request - .set({key: 'value'}) - .json() - -request - .type('json') - .json() - -request - .get('') - .query({}) - .text() - -request - .get('') - .query({}) - .then(() => {}) - -request - .post('') - .send({}) - .json() diff --git a/fetch.io/index.d.ts b/fetch.io/index.d.ts deleted file mode 100644 index 3c4ff7d781..0000000000 --- a/fetch.io/index.d.ts +++ /dev/null @@ -1,126 +0,0 @@ -// Type definitions for fetch.io 3.1 -// Project: https://github.com/haoxins/fetch.io -// Definitions by: newraina -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - - type TUrl = string; - - type TMethod = 'delete' | 'get' | 'head' | 'options' | 'post' | 'put'; - - interface Query { - [key: string]: number | boolean | string; - } - - interface Header { - [key: string]: string; - } - - interface Options extends RequestInit { - - prefix?: string; - - query?: Query; - - header?: Header; - - beforeRequest?(url: TUrl, body: BodyInit): boolean; - - afterResponse?(res: Response): void; - - afterJSON?(body: any): void; - } - - declare namespace FetchIo { - - class Request { - - constructor(method: TMethod, url: TUrl, options: Options) - - /** - * HTTP delete method - */ - delete: (url: TUrl) => this; - - /** - * HTTP get method - */ - get: (url: TUrl) => this; - - /** - * HTTP head method - */ - head: (url: TUrl) => this; - - /** - * HTTP options method - */ - options: (url: TUrl) => this; - - /** - * HTTP post method - */ - post: (url: TUrl) => this; - - /** - * HTTP put method - */ - put: (url: TUrl) => this; - - /** - * Set Options - */ - config(key: string, value: any): this - - config(opts: {[key: string]: any}): this - - /** - * Set Header - */ - set(key: string, value: any): this - - set(opts: {[key: string]: any}): this - - /** - * Set Content-Type - */ - type(type: 'json' | 'form' | 'urlencoded'): this - - /** - * Add query string - */ - query(object: {[key: string]: any}): this - - /** - * Send data - */ - send(data: {[key: string]: any}): this - - /** - * ppend formData - */ - append(key: string, value: string): this - - /** - * Get Response directly - */ - then(resolve: (value?: Response) => void, reject?: (reason?: any) => void): Promise - - /** - * Make Response to JSON - */ - json(strict?: boolean): Promise - - /** - * Make Response to string - */ - text(): Promise - } - - class Fetch extends Request { - constructor(options?: Options) - } -} - -export default FetchIo.Fetch; diff --git a/fetch.io/tslint.json b/fetch.io/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/fetch.io/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/fine-uploader/index.d.ts b/fine-uploader/index.d.ts deleted file mode 100644 index dab4e720ea..0000000000 --- a/fine-uploader/index.d.ts +++ /dev/null @@ -1,346 +0,0 @@ -// Type definitions for FineUploader for 5.11 -// Project: http://fineuploader.com/ -// Definitions by: Bradford Wagner -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare namespace qq { - interface BlobsOptions { - defaultName?: string; - } - - interface CameraOptions { - button?: HTMLElement; - ios?: boolean; - } - - interface ChunkingOptions { - concurrent?: ChunkingConcurrentOptions; - enabled?: boolean; // default false - mandatory?: boolean; // default false - partSize?: number; // default 2,000,000 - paramNames?: ChunkingParamNames; - success?: ChunkingSuccess; - } - - interface ChunkingConcurrentOptions { - enabled?: boolean; // default false - } - - interface ChunkingParamNames { - chunkSize?: string; // default: qqchunksize - partByteOffset?: string; // default: qqpartbyteoffset - partIndex?: string; // default: qqpartindex - totalParts?: string; // default: qqtotalparts - } - - interface ChunkingSuccess { - endpoint?: string | null; // default: null - } - - interface CorsOptions { - allowXdr?: boolean; // default: false - expected?: boolean; // default: false - sendCredentials: boolean; // default: false - } - - interface DeleteFileOptions { - customHeader?: H; // default: {} - enabled?: boolean; // default false - endpoint?: string; // default: /server/upload - method?: string; // default: DELETE - params?: P; // default: {} - } - - interface ExtraButtonsOptions { - element: HTMLElement | undefined; // default: undefined - fileInputTitle?: string; // default: file input - folders?: boolean; // default: false - multiple?: boolean; // default: true - validation?: V; // default: 'validation' - } - - interface FormOptions { - element?: string | HTMLElement; // default: qq-form - autoUpload?: boolean; // default: false - interceptSubmit?: boolean; // default: true - } - - interface MessagesOptions { - emptyError?: string; // default: {file} is empty, please select files again without it. - maxHeightImageError?: string; // default: Image is too tall. - maxWidthImageError?: string; // default: Image is too wide. - minHeightImageError?: string; // default: Image is not tall enough. - minWidthImageError?: string; // default: Image is not wide enough. - minSizeError?: string; // default: {file} is too small, minimum file size is {minSizeLimit}. - noFilesError?: string; // default: No files to upload. - onLeave?: string; // default: The files are being uploaded, if you leave now the upload will be canceled. - retryFailTooManyItemsError?: string; // default: Too many items ({netItems}) would be uploaded. Item limit is {itemLimit}. - typeError?: string; // default: {file} has an invalid extension. Valid extension(s): {extensions}. - // tslint:disable-next-line:max-line-length - unsupportedBrowserIos8Safari?: string; // default: Unrecoverable error - this browser does not permit file uploading of any kind due to serious bugs in iOS8 Safari. Please use iOS8 Chrome until Apple fixes these issues. - } - - interface PasteOptions { - defaultName?: string; // default: pasted_image - targetElement?: HTMLElement | null; // default: null - } - - interface ResumeOptions { - recordsExpireIn?: number; // default: 7 - enabled?: boolean; // default: false - paramNames?: ResumeParamNameOptions; - } - - interface ResumeParamNameOptions { - resuming: string; // default: qqresume - } - - interface RetryOptions { - autoAttemptDelay?: number; // default: 5 - enableAuto?: boolean; // default: false - maxAutoAttempts?: number; // default: 3 - preventRetryResponseProperty?: string; // default: preventRetry - } - - interface RequestOptions { - customHeaders?: H; // default: {} - endpoint?: string; // default: /server/upload - filenameParam?: string; // default: qqfilename - forceMultipart?: boolean; // default: true - inputName?: string; // default: qqfile - method?: string; // default: POST - params?: P; // default: {} - paramsInBody?: boolean; // default: true - uuid?: string; // default: qquuid - totalFileSizeName?: string; // default: qqtotalfilesize - } - - interface ScalingOptions { - customResizer?: ( - blob: File | Blob, - height: number, - image: HTMLImageElement, - sourceCanvas: HTMLCanvasElement, - targetCanvas: HTMLCanvasElement, - width: number) => Promise | undefined; // default: undefined - defaultQuality?: number; // default: 80 - defaultType?: string | null; // default: null - failureText?: string; // default: Failed to scale - includeExif?: boolean; // default: false - orient?: boolean; // default: true - sendOriginal?: boolean; // default: false - sizes?: Size[]; // default: [] - } - - /** - * From Documentation: - * An array containing size objects that describe scaled versions of each submitted image that should be generated and uploaded. - * A size object should usually contain a name String property (which will be appended to the file name of the scaled file), and must always contain a maxSize integer property. - * A type MIME string property is optional. - */ - interface Size { - name: string; - maxSize: number; - type?: string; - } - - interface SessionOptions { - customHeaders?: H; // default: {} - endpoint?: string | null; // default: null - params?: P; // default: {} - refreshOnReset?: boolean; // default: true - } - - interface TextOptions { - defaultResponseError?: string; // default: Upload failure reason unknown - fileInputTitle?: string; // default: file input - sizeSymbols?: string[]; // default: ['kB', 'MB', 'GB', 'TB', 'PB', 'EB'] - } - - interface ValidationOptions { - acceptFiles?: MimeType[] | null; // default: null - allowedExtensions?: string[]; // default: [] - itemLimit?: number; // default: 0 - minSizeLimit?: number; // default: 0 - sizeLimit?: number; // default: 0 - stopOnFirstInvalidFile?: boolean; // default: true - image?: ValidationImageOptions; - } - - interface ValidationImageOptions { - maxHeight?: number; // default: 0 - maxWidth?: number; // default: 0 - minWidth?: number; // default: 0 - minHeight?: number; // default: 0 - } - - interface WorkaroundOptions { - iosEmptyVideos?: boolean; // default: true - ios8BrowserCrash?: boolean; // default: false - ios8SafariUploads?: boolean; // default: true - } - - interface ChunkData { - partIndex: number; - startByte: number; - endByte: number; - totalParts: number; - } - - interface ValidateMetadata { - name: string; - size?: number; - } - - interface CallbackOptions { - onAutoRetry?: (id: number, name: string, attemptNumber: number) => void; - onCancel?: (id: number, name: string) => void; - onComplete?: (id: number, name: string, responseJSON: T, xhr: XMLHttpRequest) => void; // ignore xhr: XDomainRequest as it is not compatible for all versions of TypeScript - onAllComplete?: (succeeded: number[], failed: number[]) => void; - onDelete?: (id: number) => void; - onDeleteComplete?: (id: number, xhr: XMLHttpRequest, isError: boolean) => void; // ignore xhr: XDomainRequest as it is not compatible for all versions of TypeScript - onError?: (id: number, name: string, errorReason: string, xhr: XMLHttpRequest) => void; // ignore xhr: XDomainRequest as it is not compatible for all versions of TypeScript - onManualRetry?: (id: number, name: string) => boolean; // return false to prevent this and all future retries - onPasteReceived?: (blob: Blob) => void; - onProgress?: (id: number, name: string, uploadedBytes: number, totalBytes: number) => void; - onResume?: (id: number, name: string, chunkData: T) => void; - onSessionRequestComplete?: (response: T[], success: boolean, xhrOrXdr: XMLHttpRequest) => void; // ignore xhr: XDomainRequest as it is not compatible for all versions of TypeScript - onStatusChange?: (id: number, oldStatus: string, newStatus: string) => void; - onSubmit?: (id: number, name: string) => void; - onSubmitDelete?: (id: number) => void; - onSubmitted?: (id: number, name: string) => void; - onTotalProgress?: (totalUploadedBytes: number, totalBytes: number) => void; - onUpload?: (id: number, name: string) => void; - onUploadChunk?: (id: number, name: string, chunkData: ChunkData) => void; - // ignore xhr: XDomainRequest as it is not compatible for all versions of TypeScript - onUploadChunkSuccess?: (id: number, chunkData: ChunkData, responseJSON: T, xhr: XMLHttpRequest) => void; - onValidate?: (data: ValidateMetadata, buttonContainer: HTMLElement) => void; - onValidateBatch?: (fileOrBlobDataArray: ValidateMetadata[], buttomContainer: HTMLElement) => void; - } - - interface BasicOptions { - // core options - autoUpload?: boolean; // default true - button?: HTMLElement; - debug?: boolean; - disableCancelForFormUploads?: boolean; - formatFileName?: (rawFileName: string) => string; // rawFilename to display filename - maxConnections?: number; - multiple?: boolean; - - blobs?: BlobsOptions; - camera?: CameraOptions; - chunking?: ChunkingOptions; - cors?: CorsOptions; - deleteFile?: DeleteFileOptions; - extraButtons?: ExtraButtonsOptions; - form?: FormOptions; - messages?: MessagesOptions; - paste?: PasteOptions; - resume?: ResumeOptions; - retry?: RetryOptions; - request?: RequestOptions; - scaling?: ScalingOptions; - session?: SessionOptions; - text?: TextOptions; - validation?: ValidationOptions; - workarounds?: WorkaroundOptions; - - callbacks?: CallbackOptions; - } - - interface BlobWrapper { - blob: Blob; - name: string; - } - - interface CanvasWrapper { - canvas: HTMLCanvasElement; - name: string; - quality: number; // 1-100 - type: MimeType; - } - - interface ResizeInfo { - blob: File | Blob; - height: number; - image: HTMLImageElement; - sourceCanvas: HTMLCanvasElement; - targetCanvas: HTMLCanvasElement; - width: number; - } - - interface ResumableItem { - name: string; - uuid: string; - partIdx: number; - } - - interface FilterOption { - id?: number; - uuid?: string; - originalName?: string; - name?: string; - status?: string; - size?: number; - } - - interface ScaleImageOptions { - maxSize: number; - orient?: boolean; // default: true - type?: string; // default: type or reference image - quality?: number; // 0-100 - default: 80 - includeExif?: boolean; // default: false - customResizer?: (resizeInfo: ResizeInfo) => Promise; - } - - class FineUploaderBasic { - constructor(options: BasicOptions) - - addFiles(files: File[] | HTMLInputElement[] | Blob[] | BlobWrapper[] | HTMLCanvasElement[] | CanvasWrapper[] | FileList, params: T, endpoint: string): void; - addInitialFiles(initialFiles: T[]): void; - cancel(id: number): void; - cancelAll(): void; - clearStoredFiles(): void; - continueUpload(id: number): boolean; // true if successful - deleteFile(id: number): void; - - /** - * TODO: need someone who has used this to update the returned promise related fields - */ - drawThumbnail(id: number, targetContainer: HTMLElement, maxSize: number, fromServer: boolean, customResizer: (resizeInfo: ResizeInfo) => Promise): Promise - getButton(id: number): HTMLElement; - getFile(id: number): File | Blob; - getInProgress(): number; - getName(id: number): string; - getParentId(scaledFileId: number): number; - getRemainingAllowedItems(): number; - getResumableFilesData(): ResumableItem[]; - getSize(id: number): number; - getUploads(filter: FilterOption): T | T[]; - getUuid(id: number): string; - log(message: string, level: string): void; - pauseUpload(id: number): boolean; // true if successful - reset(): void; - retry(id: number): void; - scaleImage(id: number, options: ScaleImageOptions): Promise; - setCustomHeaders(customHeaders: H, id: number): void; - setEndpoint(path: string, identifier: number | HTMLElement): void; - setDeleteFileCustomHeaders(customHeaders: H, id: number): void; - setDeleteFileEndpoint(path: string, identifier: number | HTMLElement): void; - setDeleteFileParams

        (params: P, id: number): void; - setItemLimit(newItemLimit: number): void; - setForm(formElementOrId: HTMLFormElement | string): void; - setName(id: number, name: string): void; - setParams

        (params: P, id: number): void; - setUuid(id: number, uuid: string): void; - uploadStoredFiles(): void; // throws NoFilesError - - // ui - addExtraDropzone(element: HTMLElement): void; - getDropTarget(id: number): HTMLElement; - getId(element: HTMLElement): number; - getItemByFileId(id: number): HTMLElement; - removeExtraDropzone(element: HTMLElement): void; - } -} diff --git a/fine-uploader/test/blobs.ts b/fine-uploader/test/blobs.ts deleted file mode 100644 index 99e5355460..0000000000 --- a/fine-uploader/test/blobs.ts +++ /dev/null @@ -1,9 +0,0 @@ -function testBlob() { - const config: qq.BasicOptions = { - blobs: { - defaultName: "hi.png" - } - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/callbacks.ts b/fine-uploader/test/callbacks.ts deleted file mode 100644 index eba85ad2a0..0000000000 --- a/fine-uploader/test/callbacks.ts +++ /dev/null @@ -1,59 +0,0 @@ -class CallbacksTest { - constructor(private opts: qq.CallbackOptions) { - - } - - testCallbacks() { - const opts = this.opts; - - interface CustomType { - myTypeOfClass: string; - } - - opts.onAutoRetry = (id, name, attemptNumber) => {}; - - opts.onCancel = (id, name) => {}; - - opts.onComplete = (id: number, name: string, responseJSON: CustomType, xhr: XMLHttpRequest) => {}; - - opts.onAllComplete = (succeeded, failed) => {}; - - opts.onDelete = (id) => {}; - - opts.onDeleteComplete = (id, xhr, isError) => {}; - - opts.onError = (id, name, errorReason, xhr) => {}; - - opts.onManualRetry = (id, name) => { - return true; - }; - - opts.onPasteReceived = (blob) => {}; - - opts.onProgress = (id, name, uploadedBytes, totalBytes) => {}; - - opts.onResume = (id: number, name: string, chunkData: CustomType) => {}; - - opts.onSessionRequestComplete = (response: CustomType[], success: boolean, xhrOrXdr: XMLHttpRequest) => {}; - - opts.onStatusChange = (id, oldStatus, newStatus) => {}; - - opts.onSubmit = (id, name) => {}; - - opts.onSubmitDelete = (id) => {}; - - opts.onSubmitted = (id, name) => {}; - - opts.onTotalProgress = (totalUploadedBytes, totalBytes) => {}; - - opts.onUpload = (id, name) => {}; - - opts.onUploadChunk = (id, name, chunkData) => {}; - - opts.onUploadChunkSuccess = (id: number, chunkData: qq.ChunkData, responseJSON: CustomType, xhr: XMLHttpRequest) => {}; - - opts.onValidate = (data, buttonContainer) => {}; - - opts.onValidateBatch = (fileOrBlobDataArray, buttonContaine) => {}; - } -} diff --git a/fine-uploader/test/camera.ts b/fine-uploader/test/camera.ts deleted file mode 100644 index b42a080778..0000000000 --- a/fine-uploader/test/camera.ts +++ /dev/null @@ -1,14 +0,0 @@ -function cameraTest() { - const cameraButton = new HTMLButtonElement(); - - const cameraOptions: qq.CameraOptions = { - button: cameraButton, - ios: false - }; - - const config: qq.BasicOptions = { - camera: cameraOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/chunking.ts b/fine-uploader/test/chunking.ts deleted file mode 100644 index 386dd67738..0000000000 --- a/fine-uploader/test/chunking.ts +++ /dev/null @@ -1,26 +0,0 @@ -function chunkingTest() { - - const chunkingOptions: qq.ChunkingOptions = { - concurrent: { - enabled: false - }, - enabled: true, - mandatory: true, - partSize: 1000000, - paramNames: { - chunkSize: "chunkSize", - partByteOffset: "partByteOffset", - partIndex: "partIndex", - totalParts: "totalParts" - }, - success: { - endpoint: "/some/web/endpoint/yaySuccesss" - } - }; - - const config: qq.BasicOptions = { - chunking: chunkingOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/core.ts b/fine-uploader/test/core.ts deleted file mode 100644 index dbc06e95d6..0000000000 --- a/fine-uploader/test/core.ts +++ /dev/null @@ -1,17 +0,0 @@ -function testCore() { - const button: HTMLElement = new HTMLButtonElement(); - - const config: qq.BasicOptions = { - autoUpload: true, - button, - debug: true, - disableCancelForFormUploads: true, - formatFileName: (rawFileName: string) => { - return "hi"; - }, - maxConnections: 10, - multiple: true - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/cors.ts b/fine-uploader/test/cors.ts deleted file mode 100644 index 771b210208..0000000000 --- a/fine-uploader/test/cors.ts +++ /dev/null @@ -1,13 +0,0 @@ -function corsTest() { - const corsOptions: qq.CorsOptions = { - allowXdr: true, - expected: true, - sendCredentials: true - }; - - const config: qq.BasicOptions = { - cors: corsOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/deleteFile.ts b/fine-uploader/test/deleteFile.ts deleted file mode 100644 index 49c3e68890..0000000000 --- a/fine-uploader/test/deleteFile.ts +++ /dev/null @@ -1,28 +0,0 @@ -function deleteFileTest() { - interface CustomHeader { - myOption: string; - } - - interface CustomParams { - myParam: string; - } - - const deleteFileOptions: qq.DeleteFileOptions = { - customHeader: { - myOption: "ewwww" - }, - enabled: true, - endpoint: "/my/server/location/delete", - method: "POST", - params: { - myParam: "u" - } - }; - - - const config: qq.BasicOptions = { - deleteFile: deleteFileOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/extraButtons.ts b/fine-uploader/test/extraButtons.ts deleted file mode 100644 index eef709bea8..0000000000 --- a/fine-uploader/test/extraButtons.ts +++ /dev/null @@ -1,23 +0,0 @@ -function extraButtons() { - interface Validation { - myValue: string; - } - - const element: HTMLElement = new HTMLElement(); - - const extraButtonOptions: qq.ExtraButtonsOptions = { - element, - fileInputTitle: "inputTitle", - folders: true, - multiple: false, - validation: { - myValue: "ew" - } - }; - - const config: qq.BasicOptions = { - extraButtons: extraButtonOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/form.ts b/fine-uploader/test/form.ts deleted file mode 100644 index ccc08b69a1..0000000000 --- a/fine-uploader/test/form.ts +++ /dev/null @@ -1,13 +0,0 @@ -function formTest() { - const formOptions: qq.FormOptions = { - element: "qq-form", - autoUpload: true, - interceptSubmit: true - }; - - const config: qq.BasicOptions = { - form: formOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/message.ts b/fine-uploader/test/message.ts deleted file mode 100644 index 726584bf7b..0000000000 --- a/fine-uploader/test/message.ts +++ /dev/null @@ -1,21 +0,0 @@ -function messageTest() { - const messageOptions: qq.MessagesOptions = { - emptyError: "emptyError", - maxHeightImageError: "maxHeightImageError", - maxWidthImageError: "error occurred", - minHeightImageError: "error occurred", - minWidthImageError: "error occurred", - minSizeError: "error occurred", - noFilesError: "error occurred", - onLeave: "error occurred", - retryFailTooManyItemsError: "error occurred", - typeError: "error occurred", - unsupportedBrowserIos8Safari: "error occurred" - }; - - const config: qq.BasicOptions = { - messages: messageOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/method.ts b/fine-uploader/test/method.ts deleted file mode 100644 index 1adb13db81..0000000000 --- a/fine-uploader/test/method.ts +++ /dev/null @@ -1,140 +0,0 @@ -class TestMethods { - constructor(private uploader: qq.FineUploaderBasic) { - } - - testAddFiles() { - interface ParamType { - field: string; - } - - const params: ParamType = { - field: 'hiiiii' - }; - - this.uploader.addFiles( - new FileList(), - params, - "/my/happy/endpoint" - ); - } - - testAddInitialFiles() { - interface InitialFiles { - myField: number; - } - - const initialFiles: InitialFiles[] = [{ - myField: 1324 - }]; - - this.uploader.addInitialFiles(initialFiles); - } - - testDrawThumbnail() { - const promise: Promise = this.uploader.drawThumbnail( - 1234, - new HTMLElement(), - 1234565, - false, - (resizeInfo) => { - return new Promise(() => { - return new Blob(); - }); - } - ); - } - - testGetUploads() { - interface ResponseType { - hi: string; - } - const response: ResponseType | ResponseType[] = this.uploader.getUploads({ - status: "proggresssssssesees" - }); - } - - testSetCustomHeaders() { - interface CustomHeader { - customField: number; - } - - this.uploader.setCustomHeaders({ - customField: 1234 - }, 1234); - } - - testSetDeleteCustomHeaders() { - interface CustomHeader { - customField: number; - } - - this.uploader.setDeleteFileCustomHeaders({ - customField: 1234 - }, 1234); - } - - testSetDeleteFileParams() { - interface CustomParams { - paramField: boolean; - } - this.uploader.setDeleteFileParams({ - paramField: false - }, 1234); - } - - testSetParams() { - interface CustomParams { - customParams: number; - } - - this.uploader.setParams({ - customParams: 1234 - }, 1234); - } - - bulkTests() { - this.uploader.cancel(1); - this.uploader.cancelAll(); - this.uploader.clearStoredFiles(); - const shouldContinue: boolean = this.uploader.continueUpload(1234); - this.uploader.deleteFile(1234); - const elem: HTMLElement = this.uploader.getButton(1234); - const fileOrBlob: File | Blob = this.uploader.getFile(1234); - let num: number = this.uploader.getInProgress(); - let s: string = this.uploader.getName(1234); - num = this.uploader.getParentId(1234); - num = this.uploader.getRemainingAllowedItems(); - const resumables: qq.ResumableItem[] = this.uploader.getResumableFilesData(); - num = this.uploader.getSize(1234); - s = this.uploader.getUuid(1234); - this.uploader.log("why am i doing this?", "info"); - const b: boolean = this.uploader.pauseUpload(1234); - this.uploader.reset(); - this.uploader.retry(1234); - const blobPromise: Promise = this.uploader.scaleImage(1234, { - maxSize: 20, - orient: false, - type: "png", - quality: 10, - includeExif: false, - }); - this.uploader.setEndpoint("/my/path/is/my/own", 1234); - this.uploader.setEndpoint("/my/path/is/my/own", new HTMLElement()); - this.uploader.setDeleteFileEndpoint("/some/path", 1234); - this.uploader.setDeleteFileEndpoint("/some/path", new HTMLElement()); - this.uploader.setItemLimit(1234); - this.uploader.setForm(new HTMLFormElement()); - this.uploader.setForm("myFormElement"); - this.uploader.setName(1234, "myCustomName"); - this.uploader.setUuid(1234, "12341234"); - this.uploader.uploadStoredFiles(); - } - - uiTests() { - this.uploader.addExtraDropzone(new HTMLElement()); - let elem: HTMLElement = this.uploader.getDropTarget(1234); - const n: number = this.uploader.getId(elem); - elem = this.uploader.getItemByFileId(n); - this.uploader.removeExtraDropzone(elem); - } -} diff --git a/fine-uploader/test/paste.ts b/fine-uploader/test/paste.ts deleted file mode 100644 index 9b3c7d9007..0000000000 --- a/fine-uploader/test/paste.ts +++ /dev/null @@ -1,14 +0,0 @@ -function pasteTest() { - const targetElement: HTMLElement = new HTMLElement(); - - const pasteOptions: qq.PasteOptions = { - defaultName: "pasted_image", - targetElement - }; - - const config: qq.BasicOptions = { - paste: pasteOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/request.ts b/fine-uploader/test/request.ts deleted file mode 100644 index 54b29c9be9..0000000000 --- a/fine-uploader/test/request.ts +++ /dev/null @@ -1,32 +0,0 @@ -function requestTest() { - interface CustomHeader { - customHeader: string; - } - - interface CustomParam { - customParam: boolean; - } - - const requestOptions: qq.RequestOptions = { - customHeaders: { - customHeader: "my custom header hehehehee" - }, - endpoint: "/my/custom/endpoint", - filenameParam: "newFilenameParam", - forceMultipart: true, - inputName: "filenameParamMapping", - method: "POST", - params: { - customParam: false - }, - paramsInBody: false, - uuid: "asdf123456", - totalFileSizeName: "totalFileSize" - }; - - const config: qq.BasicOptions = { - request: requestOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} \ No newline at end of file diff --git a/fine-uploader/test/resume.ts b/fine-uploader/test/resume.ts deleted file mode 100644 index dc588d19f5..0000000000 --- a/fine-uploader/test/resume.ts +++ /dev/null @@ -1,15 +0,0 @@ -function resumeTest() { - const resumeOptions: qq.ResumeOptions = { - recordsExpireIn: 10, - enabled: true, - paramNames: { - resuming: "ew you" - } - }; - - const config: qq.BasicOptions = { - resume: resumeOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/retry.ts b/fine-uploader/test/retry.ts deleted file mode 100644 index 85c9f71af3..0000000000 --- a/fine-uploader/test/retry.ts +++ /dev/null @@ -1,15 +0,0 @@ -function retryTest() { - - const retryOptions: qq.RetryOptions = { - autoAttemptDelay: 1, - enableAuto: true, - maxAutoAttempts: 32, - preventRetryResponseProperty: "preventRetry" - }; - - const config: qq.BasicOptions = { - retry: retryOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} \ No newline at end of file diff --git a/fine-uploader/test/scaling.ts b/fine-uploader/test/scaling.ts deleted file mode 100644 index 5e8ff3dc51..0000000000 --- a/fine-uploader/test/scaling.ts +++ /dev/null @@ -1,29 +0,0 @@ -function scalingTest() { - const scalingOptions: qq.ScalingOptions = { - customResizer: (blob, height, image, sourceCanvas, targetCanvas, width) => { - const promise = new Promise(() => { - return blob; - }); - return promise; - }, - defaultQuality: 10, - defaultType: "JPEG", - failureText: "you have failed me for the last time", - includeExif: true, - orient: false, - sendOriginal: true, - sizes: [ - { - maxSize: 10, - name: "i am added to name", - type: "mime type" - } - ] - }; - - const config: qq.BasicOptions = { - scaling: scalingOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/session.ts b/fine-uploader/test/session.ts deleted file mode 100644 index 7d8d6069b9..0000000000 --- a/fine-uploader/test/session.ts +++ /dev/null @@ -1,26 +0,0 @@ -function sessionTest() { - interface CustomHeader { - customHeader: string; - } - - interface CustomParam { - customParam: boolean; - } - - const sessionOptions: qq.SessionOptions = { - customHeaders: { - customHeader: "customHeader" - }, - endpoint: "/mysession/endpoint", - params: { - customParam: false - }, - refreshOnReset: false - }; - - const config: qq.BasicOptions = { - session: sessionOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/text.ts b/fine-uploader/test/text.ts deleted file mode 100644 index e83ddb4bcf..0000000000 --- a/fine-uploader/test/text.ts +++ /dev/null @@ -1,13 +0,0 @@ -function textTest() { - const textOptions: qq.TextOptions = { - defaultResponseError: "you have failed me for the last time", - fileInputTitle: "file input title", - sizeSymbols: ['kb'] - }; - - const config: qq.BasicOptions = { - text: textOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/validation.ts b/fine-uploader/test/validation.ts deleted file mode 100644 index 60324157f9..0000000000 --- a/fine-uploader/test/validation.ts +++ /dev/null @@ -1,22 +0,0 @@ -function validationTest() { - - const validationOptions: qq.ValidationOptions = { - acceptFiles: [new MimeType()], - allowedExtensions: ['csv, xls'], - itemLimit: 5, - sizeLimit: 10000000, - stopOnFirstInvalidFile: false, - image: { - maxHeight: 10, - maxWidth: 10, - minHeight: 1, - minWidth: 1 - } - }; - - const config: qq.BasicOptions = { - validation: validationOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/workarounds.ts b/fine-uploader/test/workarounds.ts deleted file mode 100644 index 42fa5ceee7..0000000000 --- a/fine-uploader/test/workarounds.ts +++ /dev/null @@ -1,13 +0,0 @@ -function workaroundsTest() { - const workaroundOptions: qq.WorkaroundOptions = { - iosEmptyVideos: false, - ios8BrowserCrash: false, - ios8SafariUploads: false - }; - - const config: qq.BasicOptions = { - workarounds: workaroundOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/tsconfig.json b/fine-uploader/tsconfig.json deleted file mode 100644 index c02e485091..0000000000 --- a/fine-uploader/tsconfig.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "files": [ - "index.d.ts", - "test/blobs.ts", - "test/camera.ts", - "test/chunking.ts", - "test/core.ts", - "test/cors.ts", - "test/deleteFile.ts", - "test/extraButtons.ts", - "test/form.ts", - "test/message.ts", - "test/paste.ts", - "test/resume.ts", - "test/retry.ts", - "test/request.ts", - "test/scaling.ts", - "test/session.ts", - "test/text.ts", - "test/validation.ts", - "test/workarounds.ts", - "test/method.ts", - "test/callbacks.ts" - ], - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - } -} \ No newline at end of file diff --git a/fine-uploader/tslint.json b/fine-uploader/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/fine-uploader/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/firebase-client/index.d.ts b/firebase-client/index.d.ts deleted file mode 100644 index d2c58bb5ba..0000000000 --- a/firebase-client/index.d.ts +++ /dev/null @@ -1,76 +0,0 @@ -// Type definitions for Firebase Client 0.1.0 -// Project: https://www.github.com/jpstevens/firebase-client -// Definitions by: Andrew Breen -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -interface PushResponse { - /** - * Name ref (key) of the child resource - */ - name : string; -} - -interface FirebaseConfig { - /** - * path for the Firebase instance - */ - url : string; - - /** - * Token for authorisation - */ - auth: string; -} - -interface FirebaseClient { - /** - * Creates a new FirebaseClient given the provided configuration - */ - new (config : FirebaseConfig) : FirebaseClient; - - /** - * Retrieves all objects at the base path - */ - get() : Q.Promise; - - /** - * Retrieves an object - * @param path Relative path from the base for the resource - */ - get(path : string) : Q.Promise; - - /** - * Returns a promise of the HTTP response from setting the value at the given path - * @param path Relative path from the base for the resource - * @param data Data to be set as the value for the given path - */ - set(path : string, data : T) : Q.Promise; - - /** - * Update a node at a given path - * @param path Relative path from the base for the resource - * @param value Value of the response - */ - update(path : string, value : T) : Q.Promise; - - /** - * Deletes the resource at a given path - * @param path Relative path from the base for the resource - */ - delete(path : string) : Q.Promise; - - /** - * @param path Relative path from the base for the resource - * @param value Object to push to the path - */ - push(path : string, value : T) : Q.Promise; -} - -declare var FirebaseClient: FirebaseClient; - -declare module 'firebase-client' { - export = FirebaseClient; -} - diff --git a/firebase-client/tsconfig.json b/firebase-client/tsconfig.json deleted file mode 100644 index fdb35ab929..0000000000 --- a/firebase-client/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "firebase-client-tests.ts" - ] -} \ No newline at end of file diff --git a/flatpickr/index.d.ts b/flatpickr/index.d.ts deleted file mode 100644 index fc3de85a53..0000000000 --- a/flatpickr/index.d.ts +++ /dev/null @@ -1,68 +0,0 @@ -// Type definitions for flatpickr 2.2 -// Project: https://github.com/chmln/flatpickr -// Definitions by: James Birtles -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare class Flatpickr { - constructor(element: string | Element, options?: Flatpickr.Options); - - changeMonth(month: number, isOffset: boolean): void; - clear(): void; - close(): void; - destroy(): void; - formatDate(format: string, date: Date): string; - jumpToDate(date?: Flatpickr.DateString): void; - open(): void; - parseDate(date: string): Date; - redraw(): void; - set(option: string, value: any): void; - setDate(date: Flatpickr.DateString | Flatpickr.DateString[]): void; - toggle(): void; -} - -declare namespace Flatpickr { - interface Options { - altFormat?: string; - altInput?: boolean; - altInputClass?: string; - allowInput?: boolean; - clickOpens?: boolean; - dateFormat?: string | null; - defaultDate?: DateString | DateString[]; - disable?: DateRange[]; - enable?: DateRange[]; - enableTime?: boolean; - enableSeconds?: boolean; - hourIncrement?: number; - inline?: boolean; - maxDate?: DateString; - minDate?: DateString; - minuteIncrement?: number; - mode?: Mode; - nextArrow?: string; - noCalendar?: boolean; - onChange?: EventCallback | EventCallback[]; - onClose?: EventCallback | EventCallback[]; - onOpen?: EventCallback | EventCallback[]; - onReady?: EventCallback | EventCallback[]; - onMonthChange?: EventCallback | EventCallback[]; - onYearChange?: EventCallback | EventCallback[]; - onValueUpdate?: EventCallback | EventCallback[]; - onDayCreate?: EventCallback | EventCallback[]; - parseDate?: (date: string) => Date; - prevArrow?: string; - shorthandCurrentMonth?: boolean; - static?: boolean; - time_24hr?: boolean; - utc?: boolean; - weekNumbers?: boolean; - wrap?: boolean; - } - - type DateString = Date | string; - type DateRange = DateString | { from: DateString, to: DateString } | ((date: Date) => boolean); - type Mode = 'single' | 'multiple' | 'range'; - type EventCallback = (selectedDates: Date[], dateStr: string, instance: Flatpickr, elem: HTMLElement) => void; -} - -export = Flatpickr; diff --git a/flatpickr/tslint.json b/flatpickr/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/flatpickr/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/flot/index.d.ts b/flot/index.d.ts deleted file mode 100644 index 20fadd0a47..0000000000 --- a/flot/index.d.ts +++ /dev/null @@ -1,243 +0,0 @@ -// Type definitions for Flot -// Project: http://www.flotcharts.org/ -// Definitions by: Matt Burland -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - - -/// - -declare namespace jquery.flot { - interface plotOptions { - colors?: any[]; - series?: seriesOptions; - legend?: legendOptions; - xaxis?: axisOptions; - yaxis?: axisOptions; - xaxes?: axisOptions[]; - yaxes?: axisOptions[]; - grid?: gridOptions; - interaction?: interaction; - hooks?: hooks; - } - - interface hooks { - processOptions: { (plot: plot, options: plotOptions): void; } []; - processRawData: { (plot: plot, series: dataSeries, data: any[], datapoints: datapoints): void; }[]; - processDatapoints: { (plot: plot, series: dataSeries, datapoints: datapoints): void; }[]; - processOffset: { (plot: plot, offset: canvasPoint): void; }[]; - drawBackground: { (plot: plot, context: CanvasRenderingContext2D): void; }[]; - drawSeries: { (plot: plot, context: CanvasRenderingContext2D, series: dataSeries): void; }[]; - draw: { (plot: plot, context: CanvasRenderingContext2D): void; }[]; - bindEvents: { (plot: plot, eventHolder: JQuery): void; }[]; - drawOverlay: { (plot: plot, context: CanvasRenderingContext2D): void; }[]; - shutdown: { (plot: plot, eventHolder: JQuery): void; }[]; - } - - interface interaction { - redrawOverlayInterval?: number; - } - - interface gridOptions { - show?: boolean; - aboveData?: boolean; - color?: any; // color - backgroundColor?: any; //color/gradient or null - margin?: any; // number or margin object - labelMargin?: number; - axisMargin?: number; - markings?: any; //array of markings or (fn: axes -> array of markings) - borderWidth?: any; // number or width object - borderColor?: any; // color or null - minBorderMargin?: number; // or null - clickable?: boolean; - hoverable?: boolean; - autoHighlight?: boolean; - mouseActiveRadius?: number; - tickColor?: any; - markingsColor?: any; - markingsLineWidth?: number; - } - - interface legendOptions { - show?: boolean; - labelFormatter?: (label: string, series: any) => string; // null or (fn: string, series object -> string) - labelBoxBorderColor?: any; //color - noColumns?: number; - position?: string; //"ne" or "nw" or "se" or "sw" - margin?: any; //number of pixels or [x margin, y margin] - backgroundColor?: any; //null or color - backgroundOpacity?: number; // between 0 and 1 - container?: JQuery; // null or jQuery object/DOM element/jQuery expression - sorted?: any; //null/false, true, "ascending", "descending" or a comparator - } - - interface seriesOptions { - color?: any; // color or number - label?: string; - lines?: linesOptions; - bars?: barsOptions; - points?: pointsOptions; - xaxis?: number; - yaxis?: number; - clickable?: boolean; - hoverable?: boolean; - shadowSize?: number; - highlightColor?: any; - } - - interface dataSeries extends seriesOptions { - data: any[]; - } - - interface axisOptions { - show?: boolean; // null or true/false - position?: string; // "bottom" or "top" or "left" or "right" - mode?: string; // "time" - monthNames?: string[]; // array of month names - - color?: any; // null or color spec - tickColor?: any; // null or color spec - font?: any; // null or font spec object - - min?: number; - max?: number; - autoscaleMargin?: number; - - transform?: (v: number) => number; // null or fn: number -> number - inverseTransform?: (v: number) => number; // null or fn: number -> number - - ticks?: any; // null or number or ticks array or (fn: axis -> ticks array) - tickSize?: any; // number or array - minTickSize?: any; // number or array - tickFormatter?: (t: number, a?: axis) => string; // (fn: number, object -> string) or string - tickDecimals?: number; - - labelWidth?: number; - labelHeight?: number; - reserveSpace?: boolean; - - tickLength?: number; - - alignTicksWithAxis?: number; - } - - interface seriesTypeBase { - show?: boolean; - lineWidth?: number; - fill?: any; //boolean or number - fillColor?: any; //null or color/gradient - } - - interface linesOptions extends seriesTypeBase { - steps?: boolean; - } - - interface barsOptions extends seriesTypeBase { - barWidth?: number; - align?: string; - horizontal?: boolean; - } - - interface pointsOptions extends seriesTypeBase { - radius?: number; - symbol?: any; - } - - interface gradient { - colors: any[]; - } - - interface item { - datapoint: number[]; // the point, e.g. [0, 2] - dataIndex: number; // the index of the point in the data array - series: dataSeries; //the series object - seriesIndex: number; //the index of the series - pageX: number; - pageY: number; //the global screen coordinates of the point - } - - interface datapoints { - points: number[]; - pointsize: number; - format: datapointFormat[]; - } - - interface datapointFormat { - x?: boolean; - y?: boolean; - number: boolean; - required: boolean; - defaultValue?: number; - } - - interface point { - x: number; - y: number; - } - - interface offset { - left: number; - top: number; - } - - interface canvasPoint { - top: number; - left: number; - bottom?: number; - right?: number; - } - - interface axes { - xaxis: axis; - yaxis: axis; - x2axis?: axis; - y2axis?: axis; - } - - interface axis extends axisOptions { - options: axisOptions; - p2c(point: point):canvasPoint; - c2p(canvasPoint: canvasPoint):point; - } - - interface plugin { - init(options: plotOptions): any; - options?: any; - name?: string; - version?: string; - } - - interface plot { - highlight(series: dataSeries, datapoint: item): void; - unhighlight(): void; - unhighlight(series: dataSeries, datapoint: item): void; - setData(data: any): void; - setupGrid(): void; - draw(): void; - triggerRedrawOverlay(): void; - width(): number; - height(): number; - offset(): JQueryCoordinates; - pointOffset(point: point): offset; - resize(): void; - shutdown(): void; - getData(): dataSeries[]; - getAxes(): axes; - getXAxes(): axis[]; - getYAxes(): axis[]; - getPlaceholder(): JQuery; - getCanvas(): HTMLCanvasElement; - getPlotOffset(): canvasPoint; - getOptions(): plotOptions; - } - - interface plotStatic { - (placeholder: JQuery, data: dataSeries[], options?: plotOptions): plot; - (placeholder: JQuery, data: any[], options?: plotOptions): plot; - plugins: plugin[]; - } -} - -interface JQueryStatic { - plot: jquery.flot.plotStatic; -} diff --git a/fluxxor/index.d.ts b/fluxxor/index.d.ts deleted file mode 100644 index 64c917cdf5..0000000000 --- a/fluxxor/index.d.ts +++ /dev/null @@ -1,73 +0,0 @@ -// Type definitions for Fluxxor 1.5.2 -// Project: https://github.com/BinaryMuse/fluxxor -// Definitions by: Yuichi Murata -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 - -/// -/// - -import * as EventEmitter3 from 'eventemitter3'; -import * as React from "react"; - -declare namespace Fluxxor { - class Dispatcher { - constructor(stores: any); - addStore(name: string, store: Store): void; - dispatch(action: Function): void; - doDispatchLoop(action: Function): void; - waitForStores(store: Store, stores: string[], fn: Function): void; - } - - class Flux extends EventEmitter3.EventEmitter { - constructor(stores: any, actions: any); - addActions(actions: any): void; - addAction(...args: Array): void; - addAction(names: string[], action: Function): void; - store(name: string): any; - addStore(name: string, store: Store): void; - addStores(stores: any): void; - stores: any; - actions: any; - } - - interface Store extends EventEmitter3.EventEmitter { - bindActions(...args: Array): void; - bindActions(args: Array): void; - waitFor(stores: string[], fn: Function): void; - } - - interface StoreSpec { - initialize?(instance?: any, options?: {}): void; - actions?: any; - } - - interface StoreClass { - new (options?: {}): any; - } - - interface Context { - flux: Flux; - } - - interface FluxMixin { - getFlux(): Flux; - } - - interface FluxChildMixin { - getFlux(): Flux; - } - - interface StoreWatchMixin { - getStateFromFlux(): StoreState; - } - - function FluxMixin(react: typeof React): FluxMixin; - function FluxChildMixin(react: typeof React): FluxChildMixin; - function StoreWatchMixin(...storeNames: string[]): StoreWatchMixin; - function createStore(spec: StoreSpec): StoreClass; - var version: string; -} - -export = Fluxxor; -export as namespace Fluxxor; diff --git a/forever-monitor/index.d.ts b/forever-monitor/index.d.ts deleted file mode 100644 index 22fa4b0c61..0000000000 --- a/forever-monitor/index.d.ts +++ /dev/null @@ -1,93 +0,0 @@ -// Type definitions for forever-monitor 1.7 -// Project: https://github.com/nodejitsu/forever-monitor#readme -// Definitions by: Shun Takahashi -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// - -export interface SpawnWith { - customFds: number[]; - setsid: boolean; - uid: number; - gid: number; -} - -export interface Options { - silent?: boolean; - uid?: string; - pidFile?: string; - max?: number; - killTree?: boolean; - minUptime?: number; - spinSleepTime?: number; - command?: string; - args?: string[]; - sourceDir?: string; - watch?: boolean; - watchIgnoreDotFiles?: boolean; - watchIgnorePatters?: string[]; - watchDirectory?: string; - spawnWith?: SpawnWith; - env?: { [envKey: string]: string; }; - cwd?: string; - logFile?: string; - outFile?: string; - errFile?: string; - parser?: (command: string, args: string[]) => { command: string, args: string[] }; -} - -export function start(script: string, options?: Options): Monitor; -export function kill(pid: number, killTree?: boolean, signal?: string, callback?: () => any): void; -export function checkProcess(pid: number): boolean; -export const version: string; - -export class Monitor extends NodeJS.EventEmitter { - - /** - * @param script - Location of the target script to run. - * @param [options] - Configuration for this instance. - */ - constructor(script: string, options?: Options); - - /** - * @description Start the process that this instance is configured for - * @param [restart] - Value indicating whether this is a restart. - */ - start(restart?: boolean): this; - - /** - * @description Tries to spawn the target Forever child process. - */ - trySpawn(): boolean; - - /** - * @description Restarts the target script associated with this instance. - */ - restart(): this; - - /** - * @description Stops the target script associated with this instance. Prevents it from auto-respawning - */ - stop(): this; - - /** - * @description Kills the ChildProcess object associated with this instance - * @param [forceStop] - Value indicating whether short circuit forever auto-restart - */ - kill(forceStop?: boolean): this; - - /** - * @description Sends a message to a forked ChildProcess object associated with this instance - */ - send(msg?: any): this; - - /** - * respond with JSON for this instance - */ - toString(): string; - - /** - * @param command - Command string to parse - * @param args - Additional default arguments - */ - parseCommand(command: string, args?: string[]): (false | { command: string, args?: string[]}); -} diff --git a/forever-monitor/tslint.json b/forever-monitor/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/forever-monitor/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/format-unicorn/test/index.ts b/format-unicorn/test/index.ts deleted file mode 100644 index 101c0cc143..0000000000 --- a/format-unicorn/test/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -import 'format-unicorn'; - -// Unsafe version -var outputString: string; - -outputString = 'Hello, {name}; you have {favoriteNumber}'.formatUnicorn({ - name: "kruncher", - favoriteNumber: 42 -}); diff --git a/format-unicorn/tslint.json b/format-unicorn/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/format-unicorn/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/freeport/freeport-tests.ts b/freeport/freeport-tests.ts deleted file mode 100644 index d64a72f496..0000000000 --- a/freeport/freeport-tests.ts +++ /dev/null @@ -1,10 +0,0 @@ - -import freeport = require('freeport'); - -let num: number, - error: Error; - -freeport((err, made) => { - error = err; - num = made; -}); diff --git a/freeport/tslint.json b/freeport/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/freeport/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/fs-ext/fs-ext-tests.ts b/fs-ext/fs-ext-tests.ts deleted file mode 100644 index baba88f092..0000000000 --- a/fs-ext/fs-ext-tests.ts +++ /dev/null @@ -1,28 +0,0 @@ - -/// - -import fs = require('fs-ext'); - -var num:number; -var str:string; - -//from node.js 'fs' module -fs.appendFileSync(str, "data"); - -fs.flock(num, str, (err)=>{ -}); -fs.flockSync(num, str); - -fs.fcntl(num, str, num, (err, res)=>{ -}); -fs.fcntl(num, str, (err, res)=>{ -}); -fs.fcntlSync(num, str, num); - -fs.seek(num, num, num, (err, pos)=>{ -}); -fs.seekSync(num, num, num); - -fs.utime(str, num, num, (err)=>{ -}); -fs.utimeSync(str, num, num); diff --git a/fs-extra-promise/index.d.ts b/fs-extra-promise/index.d.ts deleted file mode 100644 index e04f0f0688..0000000000 --- a/fs-extra-promise/index.d.ts +++ /dev/null @@ -1,86 +0,0 @@ -// Type definitions for fs-extra-promise -// Project: https://github.com/overlookmotel/fs-extra-promise -// Definitions by: midknight41 , Jason Swearingen -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// -/// -/// - -import * as stream from 'stream'; -import { Stats } from 'fs'; -import * as Promise from 'bluebird'; -import { CopyFilter, CopyOptions, OpenOptions, MkdirOptions, MoveOptions } from 'fs-extra'; - -export * from 'fs-extra'; - -//promisified versions -export declare function copyAsync(src: string, dest: string): Promise; -export declare function copyAsync(src: string, dest: string, filter: CopyFilter): Promise; -export declare function copyAsync(src: string, dest: string, options: CopyOptions): Promise; - -export declare function createFileAsync(file: string): Promise; - -export declare function mkdirsAsync(dir: string, options?: MkdirOptions): Promise; -export declare function mkdirpAsync(dir: string, options?: MkdirOptions): Promise; - -export declare function moveAsync(src: string, dest: string, options?: MoveOptions): Promise; - -export declare function outputFileAsync(file: string, data: any): Promise; - -export declare function outputJsonAsync(file: string, data: any): Promise; -export declare function outputJSONAsync(file: string, data: any): Promise; - -export declare function readJsonAsync(file: string): Promise; -export declare function readJsonAsync(file: string, options?: OpenOptions): Promise; -export declare function readJSONAsync(file: string): Promise; -export declare function readJSONAsync(file: string, options?: OpenOptions): Promise; - -export declare function removeAsync(dir: string): Promise; - -export declare function writeJsonAsync(file: string, object: any): Promise; -export declare function writeJsonAsync(file: string, object: any, options?: OpenOptions): Promise; -export declare function writeJSONAsync(file: string, object: any): Promise; -export declare function writeJSONAsync(file: string, object: any, options?: OpenOptions): Promise; - -export declare function renameAsync(oldPath: string, newPath: string): Promise; -export declare function truncateAsync(fd: number, len: number): Promise; -export declare function chownAsync(path: string, uid: number, gid: number): Promise; -export declare function fchownAsync(fd: number, uid: number, gid: number): Promise; -export declare function lchownAsync(path: string, uid: number, gid: number): Promise; -export declare function chmodAsync(path: string, mode: number): Promise; -export declare function chmodAsync(path: string, mode: string): Promise; -export declare function fchmodAsync(fd: number, mode: number): Promise; -export declare function fchmodAsync(fd: number, mode: string): Promise; -export declare function lchmodAsync(path: string, mode: string): Promise; -export declare function lchmodAsync(path: string, mode: number): Promise; -export declare function statAsync(path: string): Promise; -export declare function lstatAsync(path: string): Promise; -export declare function fstatAsync(fd: number): Promise; -export declare function linkAsync(srcpath: string, dstpath: string): Promise; -export declare function symlinkAsync(srcpath: string, dstpath: string, type?: string): Promise; -export declare function readlinkAsync(path: string): Promise; -export declare function realpathAsync(path: string): Promise; -export declare function realpathAsync(path: string, cache: { [path: string]: string }): Promise; -export declare function unlinkAsync(path: string): Promise; -export declare function rmdirAsync(path: string): Promise; -export declare function mkdirAsync(path: string, mode?: number): Promise; -export declare function mkdirAsync(path: string, mode?: string): Promise; -export declare function readdirAsync(path: string): Promise; -export declare function closeAsync(fd: number): Promise; -export declare function openAsync(path: string, flags: string, mode?: string): Promise; -export declare function utimesAsync(path: string, atime: number, mtime: number): Promise; -export declare function futimesAsync(fd: number, atime: number, mtime: number): Promise; -export declare function fsyncAsync(fd: number): Promise; -export declare function writeAsync(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number): Promise<[number, NodeBuffer]>; -export declare function readAsync(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number): Promise<[number, NodeBuffer]>; -export declare function readFileAsync(filename: string, encoding: string): Promise; -export declare function readFileAsync(filename: string, options: OpenOptions): Promise; -export declare function readFileAsync(filename: string): Promise; -export declare function writeFileAsync(filename: string, data: any, encoding?: string): Promise; -export declare function writeFileAsync(filename: string, data: any, options?: OpenOptions): Promise; -export declare function appendFileAsync(filename: string, data: any, encoding?: string): Promise; -export declare function appendFileAsync(filename: string, data: any, option?: OpenOptions): Promise; - -export declare function existsAsync(path: string): Promise; -export declare function ensureDirAsync(path: string): Promise; diff --git a/fs-extra/fs-extra-tests.ts b/fs-extra/fs-extra-tests.ts deleted file mode 100644 index 896d6411f7..0000000000 --- a/fs-extra/fs-extra-tests.ts +++ /dev/null @@ -1,136 +0,0 @@ - -/// - -import fs = require('fs-extra'); -import * as Path from 'path' - -var src: string; -var dest: string; -var file: string; -var dir: string; -var path: string; -var data: any; -var object: Object; -var errorCallback: (err: Error) => void; -var openOpts: fs.OpenOptions; - -fs.copy(src, dest, errorCallback); -fs.copy(src, dest, (src: string) => { - return false; -}, errorCallback); -fs.copy(src, dest, - { - clobber: true, - preserveTimestamps: true, - filter: (src: string) => {return false} - }, - errorCallback -); -fs.copy(src, dest, - { - clobber: true, - preserveTimestamps: true, - filter: /.*/ - }, - errorCallback -); -fs.copySync(src, dest); -fs.copySync(src, dest, (src: string) => { - return false; -}); -fs.copySync(src, dest, /.*/); -fs.copySync(src, dest, - { - clobber: true, - preserveTimestamps: true, - filter: (src: string) => {return false} - } -); -fs.copySync(src, dest, - { - clobber: true, - preserveTimestamps: true, - filter: /.*/ - } -); -fs.createFile(file, errorCallback); -fs.createFileSync(file); - -fs.mkdirs(dir, errorCallback); -fs.mkdirs(dir, {}, errorCallback); -fs.mkdirsSync(dir); -fs.mkdirsSync(dir, {}); -fs.mkdirp(dir, errorCallback); -fs.mkdirp(dir, {}, errorCallback); -fs.mkdirpSync(dir); -fs.mkdirpSync(dir, {}); - -fs.outputFile(file, data, errorCallback); -fs.outputFileSync(file, data); -fs.outputJson(file, data, errorCallback); -fs.outputJSON(file, data, errorCallback); - -fs.outputJsonSync(file, data); -fs.outputJSONSync(file, data); - -fs.readJson(file, (error: Error, jsonObject: any) => {}); -fs.readJson(file, openOpts, (error: Error, jsonObject: any) => {}); -fs.readJSON(file, (error: Error, jsonObject: any) => {}); -fs.readJSON(file, openOpts, (error: Error, jsonObject: any) => {}); - -fs.readJsonSync(file, openOpts); -fs.readJSONSync(file, openOpts); - -fs.remove(dir, errorCallback); -fs.removeSync(dir); - -fs.writeJson(file, object, errorCallback); -fs.writeJson(file, object, openOpts, errorCallback); -fs.writeJSON(file, object, errorCallback); -fs.writeJSON(file, object, openOpts, errorCallback); - -fs.writeJsonSync(file, object, openOpts); -fs.writeJSONSync(file, object, openOpts); - -fs.ensureDir(path, errorCallback); -fs.ensureDirSync(path); -fs.ensureFile(path, errorCallback); -fs.ensureFileSync(path); -fs.ensureLink(path, errorCallback); -fs.ensureLinkSync(path); -fs.ensureSymlink(path, errorCallback); -fs.ensureSymlinkSync(path); -fs.emptyDir(path, errorCallback); -fs.emptyDirSync(path); - -var items: string[]; -fs.walk("my-path") - .on('data', function (item) { - items.push(item.path); - }) - .on('end', function () { - console.dir(items); - }); - -const ignoreHiddenFiles = (item: string): boolean => { - const basename = Path.basename(item) - return basename === '.' || basename[0] !== '.' -} - -const sortPaths = (left: string, right: string) => left.localeCompare(right); - -const options = { - filter: ignoreHiddenFiles, - pathSorter: sortPaths -} - -fs.walk(path, options) - .on('readable', function (this: fs.PathEntryStream) { - let item: fs.PathEntry | undefined - while ((item = this.read())) { - items.push(item.path) - } - }) - .on('end', function () { - - }) diff --git a/fs-extra/index.d.ts b/fs-extra/index.d.ts deleted file mode 100644 index 2cc47724c8..0000000000 --- a/fs-extra/index.d.ts +++ /dev/null @@ -1,158 +0,0 @@ -// Type definitions for fs-extra -// Project: https://github.com/jprichardson/node-fs-extra -// Definitions by: midknight41 -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -// Imported from: https://github.com/soywiz/typescript-node-definitions/fs-extra.d.ts - -/// - -import { Stats } from "fs"; - -export * from "fs"; - -export declare function copy(src: string, dest: string, callback?: (err: Error) => void): void; -export declare function copy(src: string, dest: string, filter: CopyFilter, callback?: (err: Error) => void): void; -export declare function copy(src: string, dest: string, options: CopyOptions, callback?: (err: Error) => void): void; - -export declare function copySync(src: string, dest: string): void; -export declare function copySync(src: string, dest: string, filter: CopyFilter): void; -export declare function copySync(src: string, dest: string, options: CopyOptions): void; - -export declare function move(src: string, dest: string, callback?: (err: Error) => void): void; -export declare function move(src: string, dest: string, options: MoveOptions, callback?: (err: Error) => void): void; - -export declare function createFile(file: string, callback?: (err: Error) => void): void; -export declare function createFileSync(file: string): void; - -export declare function mkdirs(dir: string, callback?: (err: Error) => void): void; -export declare function mkdirp(dir: string, callback?: (err: Error) => void): void; -export declare function mkdirs(dir: string, options?: MkdirOptions, callback?: (err: Error) => void): void; -export declare function mkdirp(dir: string, options?: MkdirOptions, callback?: (err: Error) => void): void; -export declare function mkdirsSync(dir: string, options?: MkdirOptions): void; -export declare function mkdirpSync(dir: string, options?: MkdirOptions): void; - -export declare function outputFile(file: string, data: any, callback?: (err: Error) => void): void; -export declare function outputFileSync(file: string, data: any): void; - -export declare function outputJson(file: string, data: any, callback?: (err: Error) => void): void; -export declare function outputJSON(file: string, data: any, callback?: (err: Error) => void): void; -export declare function outputJsonSync(file: string, data: any): void; -export declare function outputJSONSync(file: string, data: any): void; - -export declare function readJson(file: string, callback: (err: Error, jsonObject: any) => void): void; -export declare function readJson(file: string, options: OpenOptions, callback: (err: Error, jsonObject: any) => void): void; -export declare function readJSON(file: string, callback: (err: Error, jsonObject: any) => void): void; -export declare function readJSON(file: string, options: OpenOptions, callback: (err: Error, jsonObject: any) => void): void; - -export declare function readJsonSync(file: string, options?: OpenOptions): any; -export declare function readJSONSync(file: string, options?: OpenOptions): any; - -export declare function remove(dir: string, callback?: (err: Error) => void): void; -export declare function removeSync(dir: string): void; - -export declare function writeJson(file: string, object: any, callback?: (err: Error) => void): void; -export declare function writeJson(file: string, object: any, options?: OpenOptions, callback?: (err: Error) => void): void; -export declare function writeJSON(file: string, object: any, callback?: (err: Error) => void): void; -export declare function writeJSON(file: string, object: any, options?: OpenOptions, callback?: (err: Error) => void): void; - -export declare function writeJsonSync(file: string, object: any, options?: OpenOptions): void; -export declare function writeJSONSync(file: string, object: any, options?: OpenOptions): void; - -export declare function ensureDir(path: string, cb: (err: Error) => void): void; -export declare function ensureDirSync(path: string): void; - -export declare function ensureFile(path: string, cb: (err: Error) => void): void; -export declare function ensureFileSync(path: string): void; - -export declare function ensureLink(path: string, cb: (err: Error) => void): void; -export declare function ensureLinkSync(path: string): void; - -export declare function ensureSymlink(path: string, cb: (err: Error) => void): void; -export declare function ensureSymlinkSync(path: string): void; - -export declare function emptyDir(path: string, callback?: (err: Error) => void): void; -export declare function emptyDirSync(path: string): boolean; - -export interface WalkEventEmitter extends NodeJS.ReadableStream { - on(event: 'data', callback: (file: WalkEventFile) => void): this; - on(event: 'readable', callback: (this: PathEntryStream) => void): this; - on(event: 'error', callback: (error: Error, item: PathEntry) => void): this; - on(event: 'end', callback: () => void): this; - on(event: string | symbol, callback: Function): this; -} - -export interface WalkEventFile { - path: string; - stats: Stats; -} - -export interface WalkOptions { - /** - * Control how results are enumerated from `readdir`: - * - 'shift' will return the first element from the array. - * - 'pop' will return the last element from the array. - * - * If not specified, the default behaviour is 'shift' - */ - queueMethod?: 'pop' | 'shift'; - /** - * Provide a function to sort the paths before they are enumerated - */ - pathSorter?: (left: string, right: string) => number; - /** - * An optional object to override the default `fs` APIs for testing purposes - */ - fs?: Object; - /** - * Provide a function to exclude certain file paths. The function should - * return true when the element should be kept, and false otherwise. - */ - filter?: (path: string, index: number, array: Array) => boolean; -} - -export type PathEntry = { - path: string; - stats: Stats; -} - -export type PathEntryStream = { - read(): PathEntry | null -} - -export function walk(path: string, options?: WalkOptions): WalkEventEmitter; -export function walkSync(path: string): ReadonlyArray; - -export interface CopyFilterFunction { - (src: string): boolean -} - -export type CopyFilter = CopyFilterFunction | RegExp; - -export interface CopyOptions { - clobber?: boolean - preserveTimestamps?: boolean - dereference?: boolean - filter?: CopyFilter - recursive?: boolean -} - -export interface MoveOptions { - clobber? : boolean; - limit?: number; -} - -export interface MoveOptions { - clobber? : boolean; - limit?: number; -} - -export interface OpenOptions { - encoding?: string; - flag?: string; -} - -export interface MkdirOptions { - fs?: any; - mode?: number; -} diff --git a/fs-promise/index.d.ts b/fs-promise/index.d.ts deleted file mode 100644 index 2038190ca1..0000000000 --- a/fs-promise/index.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -// Type definitions for fs-promise 1.0 -// Project: https://github.com/kevinbeaty/fs-promise#readme -// Definitions by: Thiago de Arruda -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -export * from "mz/fs"; - -export interface WriteOptions { - encoding?: string; - mode?: number; - flag?: string; -} - -type JsonReplacerArray = Array; - -type JsonReplacerFunction = (key: string, value: any) => any; - -type JsonReplacer = JsonReplacerArray | JsonReplacerFunction; - -export interface WriteJsonOptions extends WriteOptions { - spaces?: number; - replacer?: JsonReplacer; -} - -export interface ReadJsonOptions { - encoding: string; - flag?: string; - reviver: (key: any, value: any) => any; -} - -export function copy(src: string, dst: string): Promise; -export function emptyDir(dir: string): Promise; -export function ensureFile(file: string): Promise; -export function ensureDir(dir: string): Promise; -export function ensureLink(srcpath: string, dstpath: string): Promise; -export function ensureSymlink(srcpath: string, dstpath: string, type?: "dir" | "file" | "junction"): Promise; -export function mkdirs(dir: string): Promise; -export function move(src: string, dst: string): Promise; -export function outputFile(file: string, data: string | Buffer, options?: WriteOptions): Promise; -export function outputJson(file: string, data: any, options?: WriteJsonOptions): Promise; -export function readJson(file: string, options?: ReadJsonOptions): Promise; -export function remove(path: string): Promise; -export function walk(dir: string): Promise; -export function writeJson(file: string, data: any, options?: WriteJsonOptions): Promise; - -// aliases -export { - emptyDir as emptydir, - ensureFile as createFile, - ensureLink as createLink, - ensureSymlink as createSymlink, - mkdirs as mkdirp, - outputJson as outputJSON, - readJson as readJSON, - writeJson as writeJSON -}; diff --git a/fs-promise/tslint.json b/fs-promise/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/fs-promise/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/fullcalendar/fullcalendar-tests.ts b/fullcalendar/fullcalendar-tests.ts deleted file mode 100644 index 7640c85db6..0000000000 --- a/fullcalendar/fullcalendar-tests.ts +++ /dev/null @@ -1,909 +0,0 @@ -/// -/// - -import * as FullCalendar from 'fullcalendar'; -import * as moment from 'moment'; - -// All examples from http://arshaw.com/fullcalendar/docs/ - -$('#calendar').fullCalendar({}); - -$('#calendar').fullCalendar({ - weekends: false -}); - -$('#calendar').fullCalendar({ - dayClick() { - alert('a day has been clicked!'); - } -}); - -$('#calendar').fullCalendar('next'); - -$('#calendar').fullCalendar({ - events: 'http://www.google.com/your_feed_url/' -}); - -$('#calendar').fullCalendar({ - events: { - url: 'http://www.google.com/your_feed_url/', - className: 'gcal-event', // an option! - currentTimezone: 'America/Chicago' // an option! - } -}); - -$('#calendar').fullCalendar({ - eventSources: [ - - // source with no options - "http://www.google.com/your_feed_url1/", - - // source with no options - "http://www.google.com/your_feed_url2/", - - // source WITH options - { - url: "http://www.google.com/your_feed_url3/", - className: 'nice-event' - } - ] -}); - -$('#calendar').fullCalendar({ - height: 650 -}); - -$('#calendar').fullCalendar('option', 'height', 700); - -$('#calendar').fullCalendar({ - contentHeight: 600 -}); - -$('#calendar').fullCalendar('option', 'contentHeight', 650); - -$('#calendar').fullCalendar({ - aspectRatio: 2 -}); - -$('#calendar').fullCalendar('option', 'aspectRatio', 1.8); - -$('#calendar').fullCalendar({ - viewRender(view) { - alert('The new title of the view is ' + view.title); - } -}); - -$('#calendar').fullCalendar({ - windowResize(view) { - alert('The calendar has adjusted to a window resize'); - } -}); - -$('#calendar').fullCalendar('render'); - -$('#calendar').fullCalendar({ - dragOpacity: .5 -}); - -var view = $('#calendar').fullCalendar('getView'); -alert("The view's title is " + view.title); - -$(document).ready(() => { - - var date = new Date(); - var d = date.getDate(); - var m = date.getMonth(); - var y = date.getFullYear(); - - $('#calendar').fullCalendar({ - header: { - left: 'prev,next today', - center: 'title', - right: 'month,basicWeek,basicDay' - }, - editable: true, - events: [ - { - title: 'All Day Event', - start: new Date(y, m, 1) - }, - { - title: 'Long Event', - start: new Date(y, m, d - 5), - end: new Date(y, m, d - 2) - }, - { - id: 999, - title: 'Repeating Event', - start: new Date(y, m, d - 3, 16, 0), - allDay: false - }, - { - id: 999, - title: 'Repeating Event', - start: new Date(y, m, d + 4, 16, 0), - allDay: false - }, - { - title: 'Meeting', - start: new Date(y, m, d, 10, 30), - allDay: false - }, - { - title: 'Lunch', - start: new Date(y, m, d, 12, 0), - end: new Date(y, m, d, 14, 0), - allDay: false - }, - { - title: 'Birthday Party', - start: new Date(y, m, d + 1, 19, 0), - end: new Date(y, m, d + 1, 22, 30), - allDay: false - }, - { - title: 'Click for Google', - start: new Date(y, m, 28), - end: new Date(y, m, 29), - url: 'http://google.com/' - } - ] - }); - -}); - -$(document).ready(() => { - - var date = new Date(); - var d = date.getDate(); - var m = date.getMonth(); - var y = date.getFullYear(); - - $('#calendar').fullCalendar({ - header: { - left: 'prev,next today', - center: 'title', - right: 'month,basicWeek,basicDay' - }, - defaultView: 'basicWeek', - editable: true, - events: [ - { - title: 'All Day Event', - start: new Date(y, m, 1) - }, - { - title: 'Long Event', - start: new Date(y, m, d - 5), - end: new Date(y, m, d - 2) - }, - { - id: 999, - title: 'Repeating Event', - start: new Date(y, m, d - 3, 16, 0), - allDay: false - }, - { - id: 999, - title: 'Repeating Event', - start: new Date(y, m, d + 4, 16, 0), - allDay: false - }, - { - title: 'Meeting', - start: new Date(y, m, d, 10, 30), - allDay: false - }, - { - title: 'Lunch', - start: new Date(y, m, d, 12, 0), - end: new Date(y, m, d, 14, 0), - allDay: false - }, - { - title: 'Birthday Party', - start: new Date(y, m, d + 1, 19, 0), - end: new Date(y, m, d + 1, 22, 30), - allDay: false - }, - { - title: 'Click for Google', - start: new Date(y, m, 28), - end: new Date(y, m, 29), - url: 'http://google.com/' - } - ] - }); - -}); - -$(document).ready(() => { - - var date = new Date(); - var d = date.getDate(); - var m = date.getMonth(); - var y = date.getFullYear(); - - $('#calendar').fullCalendar({ - header: { - left: 'prev,next today', - center: 'title', - right: 'month,basicWeek,basicDay' - }, - defaultView: 'basicDay', - editable: true, - events: [ - { - id: 1, - title: "Long Event", - start: new Date(y, m, d, 14, 0), - end: new Date(y, m, d + 3), - allDay: false - }, - { - id: 2, - title: "Repeating Event", - start: new Date(y, m, d - 1), - allDay: true - }, - { - id: 2, - title: "Repeating Event", - start: new Date(y, m, d + 6), - allDay: true - }, - { - id: 3, - title: "Meeting", - start: new Date(y, m, d, 9, 0), - allDay: false - }, - { - id: 4, - title: "Click for Facebook", - start: new Date(y, m, d, 16), - end: new Date(y, m, d), - url: "http://facebook.com/", - allDay: false - } - ] - }); - -}); - -$(document).ready(() => { - - var date = new Date(); - var d = date.getDate(); - var m = date.getMonth(); - var y = date.getFullYear(); - - $('#calendar').fullCalendar({ - editable: true, - header: { - left: 'prev,next today', - center: 'title', - right: 'month,agendaWeek,agendaDay' - }, - defaultView: 'agendaWeek', - events: [ - { - title: 'All Day Event', - start: new Date(y, m, 1) - }, - { - title: 'Long Event', - start: new Date(y, m, d - 5), - end: new Date(y, m, d - 2) - }, - { - id: 999, - title: 'Repeating Event', - start: new Date(y, m, d - 3, 16, 0), - allDay: false - }, - { - id: 999, - title: 'Repeating Event', - start: new Date(y, m, d + 4, 16, 0), - allDay: false - }, - { - title: 'Meeting', - start: new Date(y, m, d, 10, 30), - allDay: false - }, - { - title: 'Lunch', - start: new Date(y, m, d, 12, 0), - end: new Date(y, m, d, 14, 0), - allDay: false - }, - { - title: 'Birthday Party', - start: new Date(y, m, d + 1, 19, 0), - end: new Date(y, m, d + 1, 22, 30), - allDay: false - }, - { - title: 'Click for Google', - start: new Date(y, m, 28), - end: new Date(y, m, 29), - url: 'http://google.com/' - } - ] - }); - -}); - -$(document).ready(() => { - - var date = new Date(); - var d = date.getDate(); - var m = date.getMonth(); - var y = date.getFullYear(); - - $('#calendar').fullCalendar({ - header: { - left: 'prev,next today', - center: 'title', - right: 'month,agendaWeek,agendaDay' - }, - defaultView: 'agendaDay', - editable: true, - events: [ - { - id: 1, - title: "Long Event", - start: new Date(y, m, d), - end: new Date(y, m, d + 3), - allDay: true - }, - { - id: 2, - title: "Repeating Event", - start: new Date(y, m, d - 1), - allDay: true - }, - { - id: 2, - title: "Repeating Event", - start: new Date(y, m, d + 6), - allDay: true - }, - { - id: 3, - title: "Meeting", - start: new Date(y, m, d, 10, 0), - allDay: false - }, - { - id: 4, - title: "Click for Facebook", - start: new Date(y, m, d, 11, 30), - end: new Date(y, m, d), - url: "http://facebook.com/", - allDay: false - } - ] - }); - -}); - -$('#my-prev-button').click(() => { - $('#calendar').fullCalendar('prev'); -}); - -$('#my-next-button').click(() => { - $('#calendar').fullCalendar('next'); -}); - -$('#my-today-button').click(() => { - $('#calendar').fullCalendar('today'); -}); - -$('#calendar').fullCalendar('gotoDate', 1, 0, 1); - -$('#my-button').click(() => { - var d = $('#calendar').fullCalendar('getDate'); - alert("The current date of the calendar is " + d); -}); - -$('#calendar').fullCalendar({ - events: [ - { - title: 'My Event', - start: '2010-01-01T14:30:00', - allDay: false - } - // other events here... - ], - timeFormat: 'H(:mm)' // uppercase H for 24-hour clock -}); - -$('#calendar').fullCalendar({ - buttonText: { - prev: '<', - next: '>' - } -}); - -$('#calendar').fullCalendar({ - dayClick(date, allDay, jsEvent, view) { - - if (allDay) { - alert('Clicked on the entire day: ' + date); - } else { - alert('Clicked on the slot: ' + date); - } - - alert('Coordinates: ' + jsEvent.pageX + ',' + jsEvent.pageY); - - alert('Current view: ' + view.name); - - // change the day's background color just for fun - $(this).css('background-color', 'red'); - - } -}); - -$('#calendar').fullCalendar({ - eventClick(calEvent, jsEvent, view) { - - alert('Event: ' + calEvent.title); - alert('Coordinates: ' + jsEvent.pageX + ',' + jsEvent.pageY); - alert('View: ' + view.name); - - // change the border color just for fun - $(this).css('border-color', 'red'); - - } -}); - -$('#calendar').fullCalendar({ - events: [ - { - title: 'My Event', - start: '2010-01-01', - url: 'http://google.com/' - } - // other events here - ], - eventClick(event) { - if (event.url) { - window.open(event.url); - return false; - } - } -}); - -$('#calendar').fullCalendar({ - - eventSources: [ - - // your event source - { - url: '/myfeed.php', - type: 'POST', - data: { - custom_param1: 'something', - custom_param2: 'somethingelse' - }, - error() { - alert('there was an error while fetching events!'); - }, - color: 'yellow', // a non-ajax option - textColor: 'black' // a non-ajax option - } - - // any other sources... - - ] - -}); - -$('#calendar').fullCalendar({ - - events: { - url: '/myfeed.php', - type: 'POST', - data: { - custom_param1: 'something', - custom_param2: 'somethingelse' - }, - error() { - alert('there was an error while fetching events!'); - }, - color: 'yellow', // a non-ajax option - textColor: 'black' // a non-ajax option - } - -}); - -$('#calendar').fullCalendar({ - - events: { - url: '/myfeed.php', - cache: true - } - -}); - -$('#calendar').fullCalendar({ - - eventSources: [ - - // your event source - { - url: '/myfeed.php', // use the `url` property - color: 'yellow', // an option! - textColor: 'black' // an option! - } - - // any other sources... - - ] - -}); - -$('#calendar').fullCalendar({ - events: '/myfeed.php' -}); - -$('#calendar').fullCalendar({ - events: [ - { - title: 'event1', - start: '2010-01-01' - }, - { - title: 'event2', - start: '2010-01-05', - end: '2010-01-07' - }, - { - title: 'event3', - start: '2010-01-09 12:30:00', - allDay: false // will make the time show - } - ] -}); - -$('#calendar').fullCalendar({ - - eventSources: [ - - // your event source - { - events: [ // put the array in the `events` property - { - title: 'event1', - start: '2010-01-01' - }, - { - title: 'event2', - start: '2010-01-05', - end: '2010-01-07' - }, - { - title: 'event3', - start: '2010-01-09 12:30:00', - } - ], - color: 'black', // an option! - textColor: 'yellow' // an option! - } - - // any other event sources... - - ] - -}); - -$('#calendar').fullCalendar({ - events(start: moment.Moment, end: moment.Moment, timezone: string | boolean, callback: (events: FullCalendar.EventObject[]) => void) { - $.ajax({ - url: 'myxmlfeed.php', - dataType: 'xml', - data: { - // our hypothetical feed requires UNIX timestamps - start: Math.round(start.toDate().getTime() / 1000), - end: Math.round(end.toDate().getTime() / 1000) - }, - success(doc) { - var events: any[] = []; - $(doc).find('event').each(() => { - events.push({ - title: $(this).attr('title'), - start: $(this).attr('start') // will be parsed - }); - }); - callback(events); - } - }); - } -}); - -$('#calendar').fullCalendar({ - - eventSources: [ - - // your event source - { - events(start: moment.Moment, end: moment.Moment, timezone: string | boolean, callback: (events: FullCalendar.EventObject[]) => void) { - // ... - }, - color: 'yellow', // an option! - textColor: 'black' // an option! - } - - // any other sources... - - ] - -}); - -$('#calendar').fullCalendar({ - eventSources: [ - '/feed1.php', - '/feed2.php' - ] -}); - -$('#calendar').fullCalendar({ - eventClick(event, element) { - - event.title = "CLICKED!"; - - $('#calendar').fullCalendar('updateEvent', event); - - } -}); - -$('#calendar').fullCalendar({ - events: [ - // my event data - ], - eventColor: '#378006' -}); - -interface EventWithDescription extends FullCalendar.EventObject { - description: string; -} -interface JQuery { - qtip: any; // dummy plugin interface -} - -$('#calendar').fullCalendar({ - events: [ - { - title: 'My Event', - start: '2010-01-01', - description: 'This is a cool event' - } - // more events here - ], - eventRender(event: EventWithDescription, element: any, view: any) { - element.qtip({ - content: event.description - }); - } -}); -$('#my-draggable').draggable({ - revert: true, // immediately snap back to original position - revertDuration: 0 // -}); - -$('#calendar').fullCalendar({ - droppable: true, - drop(date, allDay) { - alert("Dropped on " + date + " with allDay=" + allDay); - } -}); - -$('#calendar').fullCalendar({ - droppable: true, - dropAccept: '.cool-event', - drop() { - alert('dropped!'); - } -}); - -$('#draggable1').draggable(); -$('#draggable2').draggable(); - -$(document).ready(() => { - - var date = new Date(); - var d = date.getDate(); - var m = date.getMonth(); - var y = date.getFullYear(); - - $('#calendar').fullCalendar({ - theme: true, - header: { - left: 'prev,next today', - center: 'title', - right: 'month,agendaWeek,agendaDay' - }, - editable: true, - events: [ - { - title: 'All Day Event', - start: new Date(y, m, 1) - }, - { - title: 'Long Event', - start: new Date(y, m, d - 5), - end: new Date(y, m, d - 2) - }, - { - id: 999, - title: 'Repeating Event', - start: new Date(y, m, d - 3, 16, 0), - allDay: false - }, - { - id: 999, - title: 'Repeating Event', - start: new Date(y, m, d + 4, 16, 0), - allDay: false - }, - { - title: 'Meeting', - start: new Date(y, m, d, 10, 30), - allDay: false - }, - { - title: 'Lunch', - start: new Date(y, m, d, 12, 0), - end: new Date(y, m, d, 14, 0), - allDay: false - }, - { - title: 'Birthday Party', - start: new Date(y, m, d + 1, 19, 0), - end: new Date(y, m, d + 1, 22, 30), - allDay: false - }, - { - title: 'Click for Google', - start: new Date(y, m, 28), - end: new Date(y, m, 29), - url: 'http://google.com/' - } - ] - }); - -}); - -$(document).ready(() => { - /* initialize the external events - -----------------------------------------------------------------*/ - $('#external-events div.external-event').each(() => { - - // create an Event Object (http://arshaw.com/fullcalendar/docs/event_data/Event_Object/) - // it doesn't need to have a start or end - var eventObject = { - title: $.trim($(this).text()) // use the element's text as the event title - }; - - // store the Event Object in the DOM element so we can get to it later - $(this).data('eventObject', eventObject); - - // make the event draggable using jQuery UI - $(this).draggable({ - zIndex: 999, - revert: true, // will cause the event to go back to its - revertDuration: 0 // original position after the drag - }); - - }); - /* initialize the calendar - -----------------------------------------------------------------*/ - - $('#calendar').fullCalendar({ - header: { - left: 'prev,next today', - center: 'title', - right: 'month,agendaWeek,agendaDay' - }, - editable: true, - droppable: true, // this allows things to be dropped onto the calendar !!! - drop(date, allDay) { // this function is called when something is dropped - - // retrieve the dropped element's stored Event Object - var originalEventObject = $(this).data('eventObject'); - - // we need to copy it, so that multiple events don't have a reference to the same object - var copiedEventObject: any = $.extend({}, originalEventObject); - - // assign it the date that was reported - copiedEventObject.start = date; - copiedEventObject.allDay = allDay; - - // render the event on the calendar - // the last `true` argument determines if the event "sticks" (http://arshaw.com/fullcalendar/docs/event_rendering/renderEvent/) - $('#calendar').fullCalendar('renderEvent', copiedEventObject, true); - - // is the "remove after drop" checkbox checked? - if ($('#drop-remove').is(':checked')) { - // if so, remove the element from the "Draggable Events" list - $(this).remove(); - } - } - }); -}); - -$(document).ready(() => { - var date = new Date(); - var d = date.getDate(); - var m = date.getMonth(); - var y = date.getFullYear(); - - $('#calendar').fullCalendar({ - theme: true, - header: { - left: 'prev,next today', - center: 'title', - right: 'month,agendaWeek,agendaDay' - }, - editable: true, - events: [{ - id: 'test1', - title: 'event full of features', - start: new Date(y, m, 1), - startEditable: true, - allDay: false, - url: 'http://www.google.com', - className: 'gcal-event', - editable: false, - durationEditable: false, - rendering: 'background', - overlap: false, - constraint: { - start: '10:00', - end: '18:00', - dow: [ 1, 2 ], - // days of week. an array of zero-based day of week integers (0=Sunday) - // (Monday-Tuesday in this example) - }, - color: 'white', - backgroundColor: 'black', - borderColor: 'grey', - textColor: 'white', - }], - }); - - $('#calendar').fullCalendar({ - theme: true, - header: { - left: 'prev,next today', - center: 'title', - right: 'month,agendaWeek,agendaDay' - }, - editable: true, - events: [{ - id: 'test2', - title: 'just an event', - start: new Date(y, m, 1), - }], - eventConstraint: 'businessHours', - eventLimit: true, - businessHours: [{ - start: '10:00', - end: '18:00', - dow: [ 1, 2 ], - // days of week. an array of zero-based day of week integers (0=Sunday) - // (Monday-Tuesday in this example) - }, { - start: '09:00', - end: '19:00', - dow: [ 3, 4 ], - }], - }); - - $('#calendar').fullCalendar('refetchEventSources', 'http://www.google.com/your_feed_url1/'); -}); - -$('#calendar').fullCalendar('refetchEvents'); diff --git a/fullcalendar/index.d.ts b/fullcalendar/index.d.ts deleted file mode 100644 index 5d6401b9df..0000000000 --- a/fullcalendar/index.d.ts +++ /dev/null @@ -1,439 +0,0 @@ -// Type definitions for FullCalendar 2.7 -// Project: http://fullcalendar.io/ -// Definitions by: Neil Stalker , Marcelo Camargo , Patrick Niemann -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -import * as moment from 'moment'; - -export as namespace FC; - -export interface Calendar { - /** - * Gets the version of Fullcalendar - */ - version: string; -} - -export interface BusinessHours { - start: moment.Duration | string | Date; - end: moment.Duration | string | Date; - dow: number[]; -} - -export interface Timespan { - start: moment.Moment | string | Date; - end?: moment.Moment | string | Date; -} - -export interface Header { - left: string; - center: string; - right: string; -} - -export interface Options extends AgendaOptions, EventDraggingResizingOptions, DroppingExternalElementsOptions, SelectionOptions { - // General display - http://fullcalendar.io/docs/display/ - - header?: boolean | Header; - theme?: boolean; - buttonIcons?: { - prev: string; - next: string; - }; - firstDay?: number; - isRTL?: boolean; - weekends?: boolean; - hiddenDays?: number[]; - weekMode?: string; - weekNumbers?: boolean; - weekNumberCalculation?: any; // String/Function - businessHours?: boolean | BusinessHours | BusinessHours[]; - height?: number; - contentHeight?: number; - aspectRatio?: number; - handleWindowResize?: boolean; - views?: ViewSpecificOptions; - viewRender?: (view: ViewObject, element: JQuery) => void; - viewDestroy?: (view: ViewObject, element: JQuery) => void; - dayRender?: (date: Date, cell: HTMLTableDataCellElement) => void; - windowResize?: (view: ViewObject) => void; - - // Timezone - timezone?: string | boolean; - now?: moment.Moment | Date | string | (() => moment.Moment); - - // Views - http://fullcalendar.io/docs/views/ - - defaultView?: string; - - // Current Date - http://fullcalendar.io/docs/current_date/ - - defaultDate?: moment.Moment | Date | string; - year?: number; - month?: number; - date?: number; - - // Text/Time Customization - http://fullcalendar.io/docs/text/ - - timeFormat?: any; // String - columnFormat?: any; // String - titleFormat?: any; // String - - buttonText?: ButtonTextObject; - monthNames?: string[]; - monthNamesShort?: string[]; - dayNames?: string[]; - dayNamesShort?: string[]; - weekNumberTitle?: string; - - // Clicking & Hovering - http://fullcalendar.io/docs/mouse/ - - dayClick?: (date: Date, allDay: boolean, jsEvent: MouseEvent, view: ViewObject) => void; - eventClick?: (event: EventObject, jsEvent: MouseEvent, view: ViewObject) => any; // return type boolean or void - eventMouseover?: (event: EventObject, jsEvent: MouseEvent, view: ViewObject) => void; - eventMouseout?: (event: EventObject, jsEvent: MouseEvent, view: ViewObject) => void; - - // Event Data - http://fullcalendar.io/docs/event_data/ - - /** - * This has one of the following types: - * - * - EventObject[] - * - string (JSON feed) - * - (start: moment.Moment, end: moment.Moment, timezone: string | boolean, callback: {(events: EventObject[]) => void;}) => void; - */ - events?: any; - - /** - * An array, each element being one of the following types: - * - * - EventSource - * - EventObject[] - * - string (JSON feed) - * - (start: moment.Moment, end: moment.Moment, timezone: string | boolean, callback: {(events: EventObject[]) => void;}) => void; - */ - eventSources?: any[]; - - allDayDefault?: boolean; - startParam?: string; - endParam?: string; - lazyFetching?: boolean; - eventDataTransform?: (eventData: any) => EventObject; - loading?: (isLoading: boolean, view: ViewObject) => void; - eventLimit?: boolean; - - // Event Rendering - http://fullcalendar.io/docs/event_rendering/ - - eventColor?: string; - eventBackgroundColor?: string; - eventBorderColor?: string; - eventTextColor?: string; - eventRender?: (event: EventObject, element: HTMLDivElement, view: ViewObject) => void; - eventAfterRender?: (event: EventObject, element: HTMLDivElement, view: ViewObject) => void; - eventAfterAllRender?: (view: ViewObject) => void; - eventDestroy?: (event: EventObject, element: JQuery, view: ViewObject) => void; - - // scheduler options - resourceAreaWidth?: number; - schedulerLicenseKey?: string; - customButtons?: any; - resourceLabelText?: any; - resourceColumns?: any; - displayEventTime?: any; -} - -/** - * Agenda Options - http://fullcalendar.io/docs/agenda/ - */ -export interface AgendaOptions { - allDaySlot?: boolean; - allDayText?: string; - slotDuration?: moment.Duration; - slotLabelFormat?: string; - slotLabelInterval?: moment.Duration; - snapDuration?: moment.Duration; - scrollTime?: moment.Duration; - minTime?: moment.Duration; // Integer/String - maxTime?: moment.Duration; // Integer/String - slotEventOverlap?: boolean; -} - -/* -* Event Dragging & Resizing -*/ -export interface EventDraggingResizingOptions { - editable?: boolean; - eventStartEditable?: boolean; - eventDurationEditable?: boolean; - dragRevertDuration?: number; // integer, milliseconds - dragOpacity?: number; // float - dragScroll?: boolean; - eventOverlap?: boolean | ((stillEvent: EventObject, movingEvent: EventObject) => boolean); - eventConstraint?: "businessHours" | BusinessHours | Timespan; - eventDragStart?: (event: EventObject, jsEvent: MouseEvent, ui: any, view: ViewObject) => void; - eventDragStop?: (event: EventObject, jsEvent: MouseEvent, ui: any, view: ViewObject) => void; - eventDrop?: (event: EventObject, delta: moment.Duration, revertFunc: Function, jsEvent: Event, ui: any, view: ViewObject) => void; - eventResizeStart?: (event: EventObject, jsEvent: MouseEvent, ui: any, view: ViewObject) => void; - eventResizeStop?: (event: EventObject, jsEvent: MouseEvent, ui: any, view: ViewObject) => void; - eventResize?: (event: EventObject, delta: moment.Duration, revertFunc: Function, jsEvent: Event, ui: any, view: ViewObject) => void; -} -/* - * Selection - http://fullcalendar.io/docs/selection/ -*/ -export interface SelectionOptions { - selectable?: boolean; - selectHelper?: boolean | ((start: moment.Moment, end: moment.Moment) => HTMLElement); - unselectAuto?: boolean; - unselectCancel?: string; - selectOverlap?: boolean | ((event: EventObject) => boolean); - selectConstraint?: Timespan | BusinessHours; - select?: (start: moment.Moment, end: moment.Moment, jsEvent: MouseEvent, view: ViewObject, resource?: any) => void; - unselect?: (view: ViewObject, jsEvent: Event) => void; -} - -export interface DroppingExternalElementsOptions { - droppable?: boolean; - dropAccept?: string | ((draggable: any) => boolean); - drop?: (date: moment.Moment, jsEvent: MouseEvent, ui: any) => void; - eventReceive?: (event: EventObject) => void; -} - -export interface ButtonTextObject { - prev?: string; - next?: string; - prevYear?: string; - nextYear?: string; - today?: string; - month?: string; - week?: string; - day?: string; -} - -/* Refer to http://fullcalendar.io/docs/event_data/Event_Object/ */ -export interface EventObject extends Timespan { - id?: any; // String/number - title: string; - allDay?: boolean; - url?: string; - className?: string | string[]; - editable?: boolean; - startEditable?: boolean; - durationEditable?: boolean; - rendering?: string; - overlap?: boolean; - constraint?: Timespan | BusinessHours; - source?: EventSource; - color?: string; - backgroundColor?: string; - borderColor?: string; - textColor?: string; -} - -export interface ViewObject extends Timespan { - name: string; - title: string; - intervalStart: moment.Moment; - intervalEnd: moment.Moment; -} - -export interface EventSource extends JQueryAjaxSettings { - /** - * This has one of the following types: - * - * - EventObject[] - * - string (JSON feed) - * - (start: moment.Moment, end: moment.Moment, timezone: string | boolean, callback: {(events: EventObject[]) => void;}) => void; - */ - events?: any; - - color?: string; - backgroundColor?: string; - borderColor?: string; - textColor?: string; - className?: any; // string/string[] - editable?: boolean; - allDayDefault?: boolean; - ignoreTimezone?: boolean; - eventTransform?: any; - startParam?: string; - endParam?: string; -} - -/* -* View Specific Options - http://fullcalendar.io/docs/views/View-Specific-Options/ -*/ -export interface ViewSpecificOptions { - basic?: Options; - agenda?: Options; - week?: Options; - day?: Options; - month?: Options; - basicWeek?: Options; - basicDay?: Options; - agendaWeek?: Options; - agendaDay?: Options; -} -declare global { - interface JQuery { - /** - * Get/Set option value - */ - fullCalendar(method: 'option', option: string, value?: any): void; - - /** - * Immediately forces the calendar to render and/or readjusts its size. - */ - fullCalendar(method: 'render'): void; - - /** - * Restores the element to the state before FullCalendar was initialized. - */ - fullCalendar(method: 'destroy'): void; - - /** - * Returns the View Object for the current view. - */ - fullCalendar(method: 'getView'): ViewObject; - - /** - * Immediately switches to a different view. - */ - fullCalendar(method: 'changeView', viewName: string): void; - - /** - * Moves the calendar one step back (either by a month, week, or day). - */ - fullCalendar(method: 'prev'): void; - - /** - * Moves the calendar one step forward (either by a month, week, or day). - */ - fullCalendar(method: 'next'): void; - - /** - * Moves the calendar back one year. - */ - fullCalendar(method: 'prevYear'): void; - - /** - * Moves the calendar forward one year. - */ - fullCalendar(method: 'nextYear'): void; - - /** - * Moves the calendar to the current date. - */ - fullCalendar(method: 'today'): void; - - /** - * Moves the calendar to an arbitrary year/month/date. - */ - fullCalendar(method: 'gotoDate', year: number, month?: number, date?: number): void; - - /** - * Moves the calendar to an arbitrary date. - */ - fullCalendar(method: 'gotoDate', date: moment.Moment | Date | string): void; - - /** - * Moves the calendar forward/backward an arbitrary amount of time. - */ - fullCalendar(method: 'incrementDate', year: number, month?: number, date?: number): void; - - /** - * Returns a Date object for the current date of the calendar. - */ - fullCalendar(method: 'getDate'): Date; - - /** - * A method for programmatically selecting a period of time. - */ - fullCalendar(method: 'select', startDate: Date, endDate: Date, allDay: boolean): void; - - /** - * A method for programmatically clearing the current selection. - */ - fullCalendar(method: 'unselect'): void; - - /** - * Reports changes to an event and renders them on the calendar. - */ - fullCalendar(method: 'updateEvent', event: EventObject): void; - - /** - * Reports changes for multiple events and renders them on the calendar. - */ - fullCalendar(method: 'updateEvents', events: EventObject[]): void; - - /** - * Retrieves events that FullCalendar has in memory. - */ - fullCalendar(method: 'clientEvents', idOrfilter?: any): EventObject[]; - - /** - * Retrieves events that FullCalendar has in memory. - */ - fullCalendar(method: 'clientEvents', idOrfilter?: (e: EventObject) => boolean): EventObject[]; - - /** - * Removes events from the calendar. - */ - fullCalendar(method: 'removeEvents', idOrfilter?: any): void; - - /** - * Removes events from the calendar. - */ - fullCalendar(method: 'removeEvents', idOrfilter?: (e: EventObject) => boolean): void; - - /** - * Refetches events from all sources and rerenders them on the screen. - */ - fullCalendar(method: 'refetchEvents'): void; - - /** - * Dynamically adds an event source. - */ - fullCalendar(method: 'addEventSource', source: any): void; - - /** - * Dynamically removes an event source. - */ - fullCalendar(method: 'removeEventSource', source: any): void; - - /** - * Renders a new event on the calendar. - */ - fullCalendar(method: 'renderEvent', event: EventObject, stick?: boolean): void; - - /** - * Renders new events on the calendar. - */ - fullCalendar(method: 'renderEvents', events: EventObject[], stick?: boolean): void; - - /** - * Rerenders all events on the calendar. - */ - fullCalendar(method: 'rerenderEvents'): void; - - /** - * Refetches one or more specific event sources. - */ - fullCalendar(method: 'refetchEventSources', source: any): void; - - /** - * Create calendar object - */ - fullCalendar(options: Options): JQuery; - - /** - * Generic method function - */ - fullCalendar(method: string, arg1: any, arg2: any, arg3: any): void; - } - - interface JQueryStatic { - fullCalendar: Calendar; - } -} diff --git a/fullcalendar/tslint.json b/fullcalendar/tslint.json deleted file mode 100644 index fe03bea79d..0000000000 --- a/fullcalendar/tslint.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../tslint.json", - "rules": { - "forbidden-types": false, - "unified-signatures": false - } -} diff --git a/fullcalendar/v1/fullcalendar-tests.ts b/fullcalendar/v1/fullcalendar-tests.ts deleted file mode 100644 index 56a9eb0024..0000000000 --- a/fullcalendar/v1/fullcalendar-tests.ts +++ /dev/null @@ -1,836 +0,0 @@ -/// -/// -/// - -// All examples from http://arshaw.com/fullcalendar/docs/ - -$('#calendar').fullCalendar({}); - -$('#calendar').fullCalendar({ - weekends: false -}); - -$('#calendar').fullCalendar({ - dayClick: () => { - alert('a day has been clicked!'); - } -}); - -$('#calendar').fullCalendar('next'); - -$('#calendar').fullCalendar({ - events: 'http://www.google.com/your_feed_url/' -}); - -$('#calendar').fullCalendar({ - events: { - url: 'http://www.google.com/your_feed_url/', - className: 'gcal-event', // an option! - currentTimezone: 'America/Chicago' // an option! - } -}); - -$('#calendar').fullCalendar({ - eventSources: [ - - // source with no options - "http://www.google.com/your_feed_url1/", - - // source with no options - "http://www.google.com/your_feed_url2/", - - // source WITH options - { - url: "http://www.google.com/your_feed_url3/", - className: 'nice-event' - } - ] -}); - -$('#calendar').fullCalendar({ - height: 650 -}); - -$('#calendar').fullCalendar('option', 'height', 700); - -$('#calendar').fullCalendar({ - contentHeight: 600 -}); - -$('#calendar').fullCalendar('option', 'contentHeight', 650); - -$('#calendar').fullCalendar({ - aspectRatio: 2 -}); - -$('#calendar').fullCalendar('option', 'aspectRatio', 1.8); - -$('#calendar').fullCalendar({ - viewRender: view => { - alert('The new title of the view is ' + view.title); - } -}); - -$('#calendar').fullCalendar({ - windowResize: view => { - alert('The calendar has adjusted to a window resize'); - } -}); - -$('#calendar').fullCalendar('render'); - -$('#calendar').fullCalendar({ - dragOpacity: .5 -}); - -var view = $('#calendar').fullCalendar('getView'); -alert("The view's title is " + view.title); - -$(document).ready(() => { - - var date = new Date(); - var d = date.getDate(); - var m = date.getMonth(); - var y = date.getFullYear(); - - $('#calendar').fullCalendar({ - header: { - left: 'prev,next today', - center: 'title', - right: 'month,basicWeek,basicDay' - }, - editable: true, - events: [ - { - title: 'All Day Event', - start: new Date(y, m, 1) - }, - { - title: 'Long Event', - start: new Date(y, m, d - 5), - end: new Date(y, m, d - 2) - }, - { - id: 999, - title: 'Repeating Event', - start: new Date(y, m, d - 3, 16, 0), - allDay: false - }, - { - id: 999, - title: 'Repeating Event', - start: new Date(y, m, d + 4, 16, 0), - allDay: false - }, - { - title: 'Meeting', - start: new Date(y, m, d, 10, 30), - allDay: false - }, - { - title: 'Lunch', - start: new Date(y, m, d, 12, 0), - end: new Date(y, m, d, 14, 0), - allDay: false - }, - { - title: 'Birthday Party', - start: new Date(y, m, d + 1, 19, 0), - end: new Date(y, m, d + 1, 22, 30), - allDay: false - }, - { - title: 'Click for Google', - start: new Date(y, m, 28), - end: new Date(y, m, 29), - url: 'http://google.com/' - } - ] - }); - -}); - -$(document).ready(() => { - - var date = new Date(); - var d = date.getDate(); - var m = date.getMonth(); - var y = date.getFullYear(); - - $('#calendar').fullCalendar({ - header: { - left: 'prev,next today', - center: 'title', - right: 'month,basicWeek,basicDay' - }, - defaultView: 'basicWeek', - editable: true, - events: [ - { - title: 'All Day Event', - start: new Date(y, m, 1) - }, - { - title: 'Long Event', - start: new Date(y, m, d - 5), - end: new Date(y, m, d - 2) - }, - { - id: 999, - title: 'Repeating Event', - start: new Date(y, m, d - 3, 16, 0), - allDay: false - }, - { - id: 999, - title: 'Repeating Event', - start: new Date(y, m, d + 4, 16, 0), - allDay: false - }, - { - title: 'Meeting', - start: new Date(y, m, d, 10, 30), - allDay: false - }, - { - title: 'Lunch', - start: new Date(y, m, d, 12, 0), - end: new Date(y, m, d, 14, 0), - allDay: false - }, - { - title: 'Birthday Party', - start: new Date(y, m, d + 1, 19, 0), - end: new Date(y, m, d + 1, 22, 30), - allDay: false - }, - { - title: 'Click for Google', - start: new Date(y, m, 28), - end: new Date(y, m, 29), - url: 'http://google.com/' - } - ] - }); - -}); - -$(document).ready(() => { - - var date = new Date(); - var d = date.getDate(); - var m = date.getMonth(); - var y = date.getFullYear(); - - $('#calendar').fullCalendar({ - header: { - left: 'prev,next today', - center: 'title', - right: 'month,basicWeek,basicDay' - }, - defaultView: 'basicDay', - editable: true, - events: [ - { - id: 1, - title: "Long Event", - start: new Date(y, m, d, 14, 0), - end: new Date(y, m, d + 3), - allDay: false - }, - { - id: 2, - title: "Repeating Event", - start: new Date(y, m, d - 1), - allDay: true - }, - { - id: 2, - title: "Repeating Event", - start: new Date(y, m, d + 6), - allDay: true - }, - { - id: 3, - title: "Meeting", - start: new Date(y, m, d, 9, 0), - allDay: false - }, - { - id: 4, - title: "Click for Facebook", - start: new Date(y, m, d, 16), - end: new Date(y, m, d), - url: "http://facebook.com/", - allDay: false - } - ] - }); - -}); - -$(document).ready(() => { - - var date = new Date(); - var d = date.getDate(); - var m = date.getMonth(); - var y = date.getFullYear(); - - $('#calendar').fullCalendar({ - editable: true, - header: { - left: 'prev,next today', - center: 'title', - right: 'month,agendaWeek,agendaDay' - }, - defaultView: 'agendaWeek', - events: [ - { - title: 'All Day Event', - start: new Date(y, m, 1) - }, - { - title: 'Long Event', - start: new Date(y, m, d - 5), - end: new Date(y, m, d - 2) - }, - { - id: 999, - title: 'Repeating Event', - start: new Date(y, m, d - 3, 16, 0), - allDay: false - }, - { - id: 999, - title: 'Repeating Event', - start: new Date(y, m, d + 4, 16, 0), - allDay: false - }, - { - title: 'Meeting', - start: new Date(y, m, d, 10, 30), - allDay: false - }, - { - title: 'Lunch', - start: new Date(y, m, d, 12, 0), - end: new Date(y, m, d, 14, 0), - allDay: false - }, - { - title: 'Birthday Party', - start: new Date(y, m, d + 1, 19, 0), - end: new Date(y, m, d + 1, 22, 30), - allDay: false - }, - { - title: 'Click for Google', - start: new Date(y, m, 28), - end: new Date(y, m, 29), - url: 'http://google.com/' - } - ] - }); - -}); - -$(document).ready(() => { - - var date = new Date(); - var d = date.getDate(); - var m = date.getMonth(); - var y = date.getFullYear(); - - $('#calendar').fullCalendar({ - header: { - left: 'prev,next today', - center: 'title', - right: 'month,agendaWeek,agendaDay' - }, - defaultView: 'agendaDay', - editable: true, - events: [ - { - id: 1, - title: "Long Event", - start: new Date(y, m, d), - end: new Date(y, m, d + 3), - allDay: true - }, - { - id: 2, - title: "Repeating Event", - start: new Date(y, m, d - 1), - allDay: true - }, - { - id: 2, - title: "Repeating Event", - start: new Date(y, m, d + 6), - allDay: true - }, - { - id: 3, - title: "Meeting", - start: new Date(y, m, d, 10, 0), - allDay: false - }, - { - id: 4, - title: "Click for Facebook", - start: new Date(y, m, d, 11, 30), - end: new Date(y, m, d), - url: "http://facebook.com/", - allDay: false - } - ] - }); - -}); - -$('#my-prev-button').click(() => { - $('#calendar').fullCalendar('prev'); -}); - -$('#my-next-button').click(() => { - $('#calendar').fullCalendar('next'); -}); - -$('#my-today-button').click(() => { - $('#calendar').fullCalendar('today'); -}); - -$('#calendar').fullCalendar('gotoDate', 1, 0, 1); - -$('#my-button').click(() => { - var d = $('#calendar').fullCalendar('getDate'); - alert("The current date of the calendar is " + d); -}); - -$('#calendar').fullCalendar({ - events: [ - { - title: 'My Event', - start: '2010-01-01T14:30:00', - allDay: false - } - // other events here... - ], - timeFormat: 'H(:mm)' // uppercase H for 24-hour clock -}); - -$('#calendar').fullCalendar({ - buttonText: { - prev: '<', - next: '>' - } -}); - -$('#calendar').fullCalendar({ - dayClick(date, allDay, jsEvent, view) { - - if (allDay) { - alert('Clicked on the entire day: ' + date); - } else { - alert('Clicked on the slot: ' + date); - } - - alert('Coordinates: ' + jsEvent.pageX + ',' + jsEvent.pageY); - - alert('Current view: ' + view.name); - - // change the day's background color just for fun - $(this).css('background-color', 'red'); - - } -}); - -$('#calendar').fullCalendar({ - eventClick(calEvent, jsEvent, view) { - - alert('Event: ' + calEvent.title); - alert('Coordinates: ' + jsEvent.pageX + ',' + jsEvent.pageY); - alert('View: ' + view.name); - - // change the border color just for fun - $(this).css('border-color', 'red'); - - } -}); - -$('#calendar').fullCalendar({ - events: [ - { - title: 'My Event', - start: '2010-01-01', - url: 'http://google.com/' - } - // other events here - ], - eventClick(event) { - if (event.url) { - window.open(event.url); - return false; - } - } -}); - -$('#calendar').fullCalendar({ - - eventSources: [ - - // your event source - { - url: '/myfeed.php', - type: 'POST', - data: { - custom_param1: 'something', - custom_param2: 'somethingelse' - }, - error: () => { - alert('there was an error while fetching events!'); - }, - color: 'yellow', // a non-ajax option - textColor: 'black' // a non-ajax option - } - - // any other sources... - - ] - -}); - -$('#calendar').fullCalendar({ - - events: { - url: '/myfeed.php', - type: 'POST', - data: { - custom_param1: 'something', - custom_param2: 'somethingelse' - }, - error: () => { - alert('there was an error while fetching events!'); - }, - color: 'yellow', // a non-ajax option - textColor: 'black' // a non-ajax option - } - -}); - -$('#calendar').fullCalendar({ - - events: { - url: '/myfeed.php', - cache: true - } - -}); - -$('#calendar').fullCalendar({ - - eventSources: [ - - // your event source - { - url: '/myfeed.php', // use the `url` property - color: 'yellow', // an option! - textColor: 'black' // an option! - } - - // any other sources... - - ] - -}); - -$('#calendar').fullCalendar({ - events: '/myfeed.php' -}); - -$('#calendar').fullCalendar({ - events: [ - { - title: 'event1', - start: '2010-01-01' - }, - { - title: 'event2', - start: '2010-01-05', - end: '2010-01-07' - }, - { - title: 'event3', - start: '2010-01-09 12:30:00', - allDay: false // will make the time show - } - ] -}); - -$('#calendar').fullCalendar({ - - eventSources: [ - - // your event source - { - events: [ // put the array in the `events` property - { - title: 'event1', - start: '2010-01-01' - }, - { - title: 'event2', - start: '2010-01-05', - end: '2010-01-07' - }, - { - title: 'event3', - start: '2010-01-09 12:30:00', - } - ], - color: 'black', // an option! - textColor: 'yellow' // an option! - } - - // any other event sources... - - ] - -}); - -$('#calendar').fullCalendar({ - events(start: any, end: any, callback: any) { - $.ajax({ - url: 'myxmlfeed.php', - dataType: 'xml', - data: { - // our hypothetical feed requires UNIX timestamps - start: Math.round(start.getTime() / 1000), - end: Math.round(end.getTime() / 1000) - }, - success(doc) { - var events: any[] = []; - $(doc).find('event').each(() => { - events.push({ - title: $(this).attr('title'), - start: $(this).attr('start') // will be parsed - }); - }); - callback(events); - } - }); - } -}); - -$('#calendar').fullCalendar({ - - eventSources: [ - - // your event source - { - events(start: any, end: any, callback: any) { - // ... - }, - color: 'yellow', // an option! - textColor: 'black' // an option! - } - - // any other sources... - - ] - -}); - -$('#calendar').fullCalendar({ - eventSources: [ - '/feed1.php', - '/feed2.php' - ] -}); - -$('#calendar').fullCalendar({ - eventClick(event, element) { - - event.title = "CLICKED!"; - - $('#calendar').fullCalendar('updateEvent', event); - - } -}); - -$('#calendar').fullCalendar({ - events: [ - // my event data - ], - eventColor: '#378006' -}); - -interface EventWithDescription extends FullCalendar.EventObject { - description: string; -} -interface JQuery { - qtip: any; // dummy plugin interface -} - -$('#calendar').fullCalendar({ - events: [ - { - title: 'My Event', - start: '2010-01-01', - description: 'This is a cool event' - } - // more events here - ], - eventRender(event: EventWithDescription, element: any) { - element.qtip({ - content: event.description - }); - } -}); -$('#my-draggable').draggable({ - revert: true, // immediately snap back to original position - revertDuration: 0 // -}); - -$('#calendar').fullCalendar({ - droppable: true, - drop(date, allDay) { - alert("Dropped on " + date + " with allDay=" + allDay); - } -}); - -$('#calendar').fullCalendar({ - droppable: true, - dropAccept: '.cool-event', - drop: () => { - alert('dropped!'); - } -}); - -$('#draggable1').draggable(); -$('#draggable2').draggable(); - -$(document).ready(() => { - - var date = new Date(); - var d = date.getDate(); - var m = date.getMonth(); - var y = date.getFullYear(); - - $('#calendar').fullCalendar({ - theme: true, - header: { - left: 'prev,next today', - center: 'title', - right: 'month,agendaWeek,agendaDay' - }, - editable: true, - events: [ - { - title: 'All Day Event', - start: new Date(y, m, 1) - }, - { - title: 'Long Event', - start: new Date(y, m, d - 5), - end: new Date(y, m, d - 2) - }, - { - id: 999, - title: 'Repeating Event', - start: new Date(y, m, d - 3, 16, 0), - allDay: false - }, - { - id: 999, - title: 'Repeating Event', - start: new Date(y, m, d + 4, 16, 0), - allDay: false - }, - { - title: 'Meeting', - start: new Date(y, m, d, 10, 30), - allDay: false - }, - { - title: 'Lunch', - start: new Date(y, m, d, 12, 0), - end: new Date(y, m, d, 14, 0), - allDay: false - }, - { - title: 'Birthday Party', - start: new Date(y, m, d + 1, 19, 0), - end: new Date(y, m, d + 1, 22, 30), - allDay: false - }, - { - title: 'Click for Google', - start: new Date(y, m, 28), - end: new Date(y, m, 29), - url: 'http://google.com/' - } - ] - }); - -}); - -$(document).ready(() => { - /* initialize the external events - -----------------------------------------------------------------*/ - $('#external-events div.external-event').each(() => { - - // create an Event Object (http://arshaw.com/fullcalendar/docs/event_data/Event_Object/) - // it doesn't need to have a start or end - var eventObject = { - title: $.trim($(this).text()) // use the element's text as the event title - }; - - // store the Event Object in the DOM element so we can get to it later - $(this).data('eventObject', eventObject); - - // make the event draggable using jQuery UI - $(this).draggable({ - zIndex: 999, - revert: true, // will cause the event to go back to its - revertDuration: 0 // original position after the drag - }); - - }); - /* initialize the calendar - -----------------------------------------------------------------*/ - - $('#calendar').fullCalendar({ - header: { - left: 'prev,next today', - center: 'title', - right: 'month,agendaWeek,agendaDay' - }, - editable: true, - droppable: true, // this allows things to be dropped onto the calendar !!! - drop(date, allDay) { // this function is called when something is dropped - - // retrieve the dropped element's stored Event Object - var originalEventObject = $(this).data('eventObject'); - - // we need to copy it, so that multiple events don't have a reference to the same object - var copiedEventObject: any = $.extend({}, originalEventObject); - - // assign it the date that was reported - copiedEventObject.start = date; - copiedEventObject.allDay = allDay; - - // render the event on the calendar - // the last `true` argument determines if the event "sticks" (http://arshaw.com/fullcalendar/docs/event_rendering/renderEvent/) - $('#calendar').fullCalendar('renderEvent', copiedEventObject, true); - - // is the "remove after drop" checkbox checked? - if ($('#drop-remove').is(':checked')) { - // if so, remove the element from the "Draggable Events" list - $(this).remove(); - } - } - }); -}); - -$('#calendar').fullCalendar('refetchEvents'); diff --git a/fullcalendar/v1/index.d.ts b/fullcalendar/v1/index.d.ts deleted file mode 100644 index 9f521ca8fc..0000000000 --- a/fullcalendar/v1/index.d.ts +++ /dev/null @@ -1,433 +0,0 @@ -// Type definitions for FullCalendar 1.6 -// Project: http://arshaw.com/fullcalendar/ -// Definitions by: Neil Stalker , Marcelo Camargo -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// -import * as moment from "moment"; - -declare global { - namespace FullCalendar { - export interface Calendar { - - /** - * Formats a Date object into a string. - */ - formatDate(date: Date, format: string, options?: Options): string; - - /** - * Formats a date range (two Date objects) into a string. - */ - formatDates(date1: Date, date2: Date, format: string, options?: Options): string; - - /** - * Parses a string into a Date object. - */ - parseDate(dateString: string, ignoreTimezone?: boolean): Date; - - /** - * Parses an ISO8601 string into a Date object. - */ - parseISO8601(dateString: string, ignoreTimezone?: boolean): Date; - - /** - * Gets the version of Fullcalendar - */ - version: string; - } - - export interface BusinessHours { - start: moment.Duration; - end: moment.Duration; - dow: number[]; - } - - export interface Timespan { - start: moment.Moment; - end: moment.Moment; - } - - export interface Options extends AgendaOptions, EventDraggingResizingOptions, DroppingExternalElementsOptions, SelectionOptions { - - // General display - http://arshaw.com/fullcalendar/docs/display/ - - header?: { - left: string; - center: string; - right: string; - }; - theme?: boolean; - buttonIcons?: { - prev: string; - next: string; - }; - firstDay?: number; - isRTL?: boolean; - weekends?: boolean; - hiddenDays?: number[]; - weekMode?: string; - weekNumbers?: boolean; - weekNumberCalculation?: any; // String/Function - businessHours?: boolean | BusinessHours; - height?: number; - contentHeight?: number; - aspectRatio?: number; - handleWindowResize?: boolean; - viewRender?: (view: ViewObject, element: JQuery) => void; - viewDestroy?: (view: ViewObject, element: JQuery) => void; - dayRender?: (date: Date, cell: HTMLTableDataCellElement) => void; - windowResize?: (view: ViewObject) => void; - - // Timezone - timezone?: string | boolean; - now?: moment.Moment | Date | string | (() => moment.Moment); - - // Views - http://arshaw.com/fullcalendar/docs/views/ - - defaultView?: string; - - // Current Date - http://arshaw.com/fullcalendar/docs/current_date/ - - defaultDate?: moment.Moment | Date | string; - year?: number; - month?: number; - date?: number; - - // Text/Time Customization - http://arshaw.com/fullcalendar/docs/text/ - - timeFormat?: any; // String/ViewOptionHash - columnFormat?: any; // String/ViewOptionHash - titleFormat?: any; // String/ViewOptionHash - - buttonText?: ButtonTextObject; - monthNames?: string[]; - monthNamesShort?: string[]; - dayNames?: string[]; - dayNamesShort?: string[]; - weekNumberTitle?: string; - - // Clicking & Hovering - http://arshaw.com/fullcalendar/docs/mouse/ - - dayClick?: (date: Date, allDay: boolean, jsEvent: MouseEvent, view: ViewObject) => void; - eventClick?: (event: EventObject, jsEvent: MouseEvent, view: ViewObject) => any; // return type boolean or void - eventMouseover?: (event: EventObject, jsEvent: MouseEvent, view: ViewObject) => void; - eventMouseout?: (event: EventObject, jsEvent: MouseEvent, view: ViewObject) => void; - - // Event Data - http://arshaw.com/fullcalendar/docs/event_data/ - - /** - * This has one of the following types: - * - * - EventObject[] - * - string (JSON feed) - * - (start: Date | string, end: Date | string, callback: {(events: EventObject[]) => void;}) => void; - */ - events?: any; - - /** - * An array, each element being one of the following types: - * - * - EventSource - * - EventObject[] - * - string (JSON feed) - * - (start: Date | string, end: Date | string, callback: {(events: EventObject[]) => void;}) => void; - */ - eventSources?: any[]; - - allDayDefault?: boolean; - ignoreTimezone?: boolean; - startParam?: string; - endParam?: string; - lazyFetching?: boolean; - eventDataTransform?: (eventData: any) => EventObject; - loading?: (isLoading: boolean, view: ViewObject) => void; - - // Event Rendering - http://arshaw.com/fullcalendar/docs/event_rendering/ - - eventColor?: string; - eventBackgroundColor?: string; - eventBorderColor?: string; - eventTextColor?: string; - eventRender?: (event: EventObject, element: HTMLDivElement, view: ViewObject) => void; - eventAfterRender?: (event: EventObject, element: HTMLDivElement, view: ViewObject) => void; - eventAfterAllRender?: (view: ViewObject) => void; - eventDestroy?: (event: EventObject, element: JQuery, view: ViewObject) => void; - - - } - - export interface ViewOptionHash { - month?: any; - week?: any; - day?: any; - agenda?: any; - agendaDay?: any; - agendaWeek?: any; - basic?: any; - basicDay?: any; - basicWeek?: any; - ''?: any; - } - - /** - * Agenda Options - http://arshaw.com/fullcalendar/docs/agenda/ - */ - export interface AgendaOptions { - allDaySlot?: boolean; - allDayText?: string; - slotDuration?: moment.Duration; - slotLabelFormat?: string; - slotLabelInterval?: moment.Duration; - snapDuration?: moment.Duration; - scrollTime?: moment.Duration; - minTime?: moment.Duration; // Integer/String - maxTime?: moment.Duration; // Integer/String - slotEventOverlap?: boolean; - } - - /* - * Event Dragging & Resizing - */ - export interface EventDraggingResizingOptions { - editable?: boolean; - eventStartEditable?: boolean; - eventDurationEditable?: boolean; - dragRevertDuration?: number; // integer, milliseconds - dragOpacity?: number; // float - dragScroll?: boolean; - eventOverlap?: boolean | ((stillEvent: EventObject, movingEvent: EventObject) => boolean); - eventConstraint?: BusinessHours | Timespan; - eventDragStart?: (event: EventObject, jsEvent: MouseEvent, ui: any, view: ViewObject) => void; - eventDragStop?: (event: EventObject, jsEvent: MouseEvent, ui: any, view: ViewObject) => void; - eventDrop?: (event: EventObject, delta: moment.Duration, revertFunc: Function, jsEvent: Event, ui: any, view: ViewObject) => void; - eventResizeStart?: (event: EventObject, jsEvent: MouseEvent, ui: any, view: ViewObject) => void; - eventResizeStop?: (event: EventObject, jsEvent: MouseEvent, ui: any, view: ViewObject) => void; - eventResize?: (event: EventObject, delta: moment.Duration, revertFunc: Function, jsEvent: Event, ui: any, view: ViewObject) => void; - } - /* - * Selection - http://arshaw.com/fullcalendar/docs/selection/ - */ - export interface SelectionOptions { - selectable?: boolean; - selectHelper?: boolean | ((start: moment.Moment, end: moment.Moment) => HTMLElement); - unselectAuto?: boolean; - unselectCancel?: string; - selectOverlap?: boolean | ((event: EventObject) => boolean); - selectConstraint?: Timespan | BusinessHours; - select?: (start: moment.Moment, end: moment.Moment, jsEvent: MouseEvent, view: ViewObject, resource?: any) => void; - unselect?: (view: ViewObject, jsEvent: Event) => void; - } - - export interface DroppingExternalElementsOptions { - droppable?: boolean; - dropAccept?: string | ((draggable: any) => boolean); - drop?: (date: moment.Moment, jsEvent: MouseEvent, ui: any) => void; - eventReceive?: (event: EventObject) => void; - } - - export interface ButtonTextObject { - prev?: string; - next?: string; - prevYear?: string; - nextYear?: string; - today?: string; - month?: string; - week?: string; - day?: string; - } - - export interface EventObject extends Timespan { - id?: any; // String/number - title: string; - allDay?: boolean; - url?: string; - className?: any; // string/Array - editable?: boolean; - source?: EventSource; - color?: string; - backgroundColor?: string; - borderColor?: string; - textColor?: string; - rendering?: string; - } - - export interface ViewObject extends Timespan { - name: string; - title: string; - intervalStart: moment.Moment; - intervalEnd: moment.Moment; - } - - export interface EventSource extends JQueryAjaxSettings { - - /** - * This has one of the following types: - * - * - EventObject[] - * - string (JSON feed) - * - (start: Date | string, end: Date | string, callback: {(events: EventObject[]) => void;}) => void; - */ - events?: any; - - color?: string; - backgroundColor?: string; - borderColor?: string; - textColor?: string; - className?: any; // string/Array - editable?: boolean; - allDayDefault?: boolean; - ignoreTimezone?: boolean; - eventTransform?: any; - startParam?: string; - endParam?: string; - } - - } - - interface JQuery { - - /** - * Get/Set option value - */ - fullCalendar(method: 'option', option: string, value?: any): void; - - /** - * Immediately forces the calendar to render and/or readjusts its size. - */ - fullCalendar(method: 'render'): void; - - /** - * Restores the element to the state before FullCalendar was initialized. - */ - fullCalendar(method: 'destroy'): void; - - /** - * Returns the View Object for the current view. - */ - fullCalendar(method: 'getView'): FullCalendar.ViewObject; - - /** - * Immediately switches to a different view. - */ - fullCalendar(method: 'changeView', viewName: string): void; - - /** - * Moves the calendar one step back (either by a month, week, or day). - */ - fullCalendar(method: 'prev'): void; - - /** - * Moves the calendar one step forward (either by a month, week, or day). - */ - fullCalendar(method: 'next'): void; - - /** - * Moves the calendar back one year. - */ - fullCalendar(method: 'prevYear'): void; - - /** - * Moves the calendar forward one year. - */ - fullCalendar(method: 'nextYear'): void; - - /** - * Moves the calendar to the current date. - */ - fullCalendar(method: 'today'): void; - - /** - * Moves the calendar to an arbitrary year/month/date. - */ - fullCalendar(method: 'gotoDate', year: number, month?: number, date?: number): void; - - /** - * Moves the calendar to an arbitrary date. - */ - fullCalendar(method: 'gotoDate', date: Date | string): void; - - /** - * Moves the calendar forward/backward an arbitrary amount of time. - */ - fullCalendar(method: 'incrementDate', year: number, month?: number, date?: number): void; - - /** - * Returns a Date object for the current date of the calendar. - */ - fullCalendar(method: 'getDate'): Date; - - /** - * A method for programmatically selecting a period of time. - */ - fullCalendar(method: 'select', startDate: Date, endDate: Date, allDay: boolean): void; - - /** - * A method for programmatically clearing the current selection. - */ - fullCalendar(method: 'unselect'): void; - - /** - * Reports changes to an event and renders them on the calendar. - */ - fullCalendar(method: 'updateEvent', event: FullCalendar.EventObject): void; - - /** - * Retrieves events that FullCalendar has in memory. - */ - fullCalendar(method: 'clientEvents', idOrfilter?: any): FullCalendar.EventObject[]; - - /** - * Retrieves events that FullCalendar has in memory. - */ - fullCalendar(method: 'clientEvents', idOrfilter?: (e: FullCalendar.EventObject) => boolean): FullCalendar.EventObject[]; - - /** - * Removes events from the calendar. - */ - fullCalendar(method: 'removeEvents', idOrfilter?: any): void; - - /** - * Removes events from the calendar. - */ - fullCalendar(method: 'removeEvents', idOrfilter?: (e: FullCalendar.EventObject) => boolean): void; - - /** - * Refetches events from all sources and rerenders them on the screen. - */ - fullCalendar(method: 'refetchEvents'): void; - - /** - * Dynamically adds an event source. - */ - fullCalendar(method: 'addEventSource', source: any): void; - - /** - * Dynamically removes an event source. - */ - fullCalendar(method: 'removeEventSource', source: any): void; - - /** - * Renders a new event on the calendar. - */ - fullCalendar(method: 'renderEvent', event: FullCalendar.EventObject, stick?: boolean): void; - - /** - * Rerenders all events on the calendar. - */ - fullCalendar(method: 'rerenderEvents'): void; - - /** - * Create calendar object - */ - fullCalendar(options: FullCalendar.Options): JQuery; - - /** - * Generic method function - */ - fullCalendar(method: string, arg1: any, arg2: any, arg3: any): void; - } - - interface JQueryStatic { - fullCalendar: FullCalendar.Calendar; - } -} diff --git a/fullcalendar/v1/tslint.json b/fullcalendar/v1/tslint.json deleted file mode 100644 index fe03bea79d..0000000000 --- a/fullcalendar/v1/tslint.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../tslint.json", - "rules": { - "forbidden-types": false, - "unified-signatures": false - } -} diff --git a/fusioncharts/fusioncharts.charts.d.ts b/fusioncharts/fusioncharts.charts.d.ts deleted file mode 100644 index f06060a054..0000000000 --- a/fusioncharts/fusioncharts.charts.d.ts +++ /dev/null @@ -1,7 +0,0 @@ - -import { FusionChartStatic } from "fusioncharts"; - -declare var charts: (H: FusionChartStatic) => FusionChartStatic; -export = charts; -export as namespace charts; - diff --git a/fusioncharts/fusioncharts.gantt.d.ts b/fusioncharts/fusioncharts.gantt.d.ts deleted file mode 100644 index d29fa26f78..0000000000 --- a/fusioncharts/fusioncharts.gantt.d.ts +++ /dev/null @@ -1,7 +0,0 @@ - -import { FusionChartStatic } from "fusioncharts"; - -declare var gantt: (H: FusionChartStatic) => FusionChartStatic; -export = gantt; -export as namespace gantt; - diff --git a/fusioncharts/fusioncharts.maps.d.ts b/fusioncharts/fusioncharts.maps.d.ts deleted file mode 100644 index 1894383758..0000000000 --- a/fusioncharts/fusioncharts.maps.d.ts +++ /dev/null @@ -1,7 +0,0 @@ - -import { FusionChartStatic } from "fusioncharts"; - -declare var maps: (H: FusionChartStatic) => FusionChartStatic; -export = maps; -export as namespace maps; - diff --git a/fusioncharts/fusioncharts.powercharts.d.ts b/fusioncharts/fusioncharts.powercharts.d.ts deleted file mode 100644 index 46178c8b8f..0000000000 --- a/fusioncharts/fusioncharts.powercharts.d.ts +++ /dev/null @@ -1,7 +0,0 @@ - -import { FusionChartStatic } from "fusioncharts"; - -declare var powercharts: (H: FusionChartStatic) => FusionChartStatic; -export = powercharts; -export as namespace powercharts; - diff --git a/fusioncharts/fusioncharts.ssgrid.d.ts b/fusioncharts/fusioncharts.ssgrid.d.ts deleted file mode 100644 index b44f5336c1..0000000000 --- a/fusioncharts/fusioncharts.ssgrid.d.ts +++ /dev/null @@ -1,7 +0,0 @@ - -import { FusionChartStatic } from "fusioncharts"; - -declare var ssgrid: (H: FusionChartStatic) => FusionChartStatic; -export = ssgrid; -export as namespace ssgrid; - diff --git a/fusioncharts/fusioncharts.treemap.d.ts b/fusioncharts/fusioncharts.treemap.d.ts deleted file mode 100644 index c555a627bc..0000000000 --- a/fusioncharts/fusioncharts.treemap.d.ts +++ /dev/null @@ -1,7 +0,0 @@ - -import { FusionChartStatic } from "fusioncharts"; - -declare var treemap: (H: FusionChartStatic) => FusionChartStatic; -export = treemap; -export as namespace treemap; - diff --git a/fusioncharts/fusioncharts.widgets.d.ts b/fusioncharts/fusioncharts.widgets.d.ts deleted file mode 100644 index a4547b99b7..0000000000 --- a/fusioncharts/fusioncharts.widgets.d.ts +++ /dev/null @@ -1,7 +0,0 @@ - -import { FusionChartStatic } from "fusioncharts"; - -declare var widgets: (H: FusionChartStatic) => FusionChartStatic; -export = widgets; -export as namespace widgets; - diff --git a/fusioncharts/fusioncharts.zoomscatter.d.ts b/fusioncharts/fusioncharts.zoomscatter.d.ts deleted file mode 100644 index 106908b6df..0000000000 --- a/fusioncharts/fusioncharts.zoomscatter.d.ts +++ /dev/null @@ -1,7 +0,0 @@ - -import { FusionChartStatic } from "fusioncharts"; - -declare var zoomscatter: (H: FusionChartStatic) => FusionChartStatic; -export = zoomscatter; -export as namespace zoomscatter; - diff --git a/fusioncharts/index.d.ts b/fusioncharts/index.d.ts deleted file mode 100644 index 9c46955075..0000000000 --- a/fusioncharts/index.d.ts +++ /dev/null @@ -1,297 +0,0 @@ -// Type definitions for fusioncharts 3.11 -// Project: http://www.fusioncharts.com -// Definitions by: Rohit Kumar , Shivaraj KV -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - - -declare namespace FusionCharts { - - type ChartDataFormats = 'json' | 'jsonurl' | 'csv' | 'xml' | 'xmlurl'; - - type ImageHAlign = 'left' | 'right' | 'middle'; - - type ImageVAlign = 'top' | 'bottom' | 'middle'; - - interface EventObject { - type: string; - - eventId: number; - - sender: FusionCharts; - - cancelled: boolean; - - stopPropagation: () => void; - - prevented: boolean; - - preventDefault: () => void; - - detached: boolean; - - detachHandler: () => void; - } - - interface ChartObject { - - type?: string; - - id?: string; - - width?: number | string; - - height?: number | string; - - renderAt?: string; - - dataFormat?: ChartDataFormats; - - dataSource?: string | {}; - - events?: {}; - - link?: {}; - - showDataLoadingMessage?: boolean; - - showChartLoadingMessage?: boolean; - - baseChartMessageFont?: string; - - baseChartMessageFontSize?: string; - - baseChartMessageColor?: string; - - dataLoadStartMessage?: string; - - dataLoadErrorMessage?: string; - - dataInvalidMessage?: string; - - dataEmptyMessage?: string; - - typeNotSupportedMessage?: string; - - loadMessage?: string; - - renderErrorMessage?: string; - - containerBackgroundColor?: string; - - containerBackgroundOpacity?: number; - - containerClassName?: string; - - baseChartMessageImageHAlign?: ImageHAlign; - - dataLoadErrorMessageImageVAlign?: ImageVAlign; - - dataLoadErrorMessageImageAlpha?: number; - - dataLoadErrorMessageImageScale?: number; - - dataLoadStartMessageImageHAlign?: ImageHAlign; - - dataLoadStartMessageImageVAlign?: ImageVAlign; - - dataLoadStartMessageImageAlpha?: number; - - dataLoadStartMessageImageScale?: number; - - dataInvalidMessageImageHAlign?: ImageHAlign; - - dataInvalidMessageImageVAlign?: ImageVAlign; - - dataInvalidMessageImageAlpha?: number; - - dataInvalidMessageImageScale?: number; - - dataEmptyMessageImageHAlign?: ImageHAlign; - - dataEmptyMessageImageVAlign?: ImageVAlign; - - dataEmptyMessageImageAlpha?: number; - - dataEmptyMessageImageScale?: number; - - renderErrorMessageImageHAlign?: ImageHAlign; - - renderErrorMessageImageVAlign?: ImageVAlign; - - renderErrorMessageImageAlpha?: number; - - renderErrorMessageImageScale?: number; - - loadMessageImageHAlign?: ImageHAlign; - - loadMessageImageVAlign?: ImageVAlign; - - loadMessageImageAlpha?: number; - - loadMessageImageScale?: number; - } - - interface Debugger { - outputFormat(format: any): void; - - outputTo(callback: (message: any) => any): void; - - enable(state: any, outputTo?: (message: any) => any, outputFormat?: any): void; - - enableFirebugLite(): any; - } - - interface FusionCharts { - clone(overrides?: {}, argsOnly?: boolean): any; - - isActive(): boolean; - - chartType(value?: string, options?: any): string; - - addEventListener(type: string | string[], listener: (eventObject?: EventObject, eventArgs?: {}) => void): void; - - removeEventListener(type: string | string[], listener: (eventObject?: EventObject, eventArgs?: {}) => void): void; - - configureLink(param: {} | any[], level?: number): void; - - setChartAttribute(attributes: ChartObject | string, value?: string): void; - - getChartAttribute(attribute?: string | string[]): ChartObject; - - getXMLData(): any; - - setXMLData(data: string | {}): void; - - setXMLUrl(url: string): void; - - setChartDataUrl(url: string, format: ChartDataFormats): void; - - setChartData(data: string | {}, format: ChartDataFormats): void; - - getChartData(format: ChartDataFormats): any; - - dataReady(available?: boolean): boolean; - - feedData(stream: string): void; - - getData(): any; - - getDataWithId(): any; - - setData(value: number, label: string): void; - - stopUpdate(): void; - - restartUpdate(): void; - - isUpdateActive(): boolean; - - clearChart(): void; - - getSWFHTML(): any; - - addVariable(): void; - - getXML(): any; - - setDataXML(data: string | {}): void; - - setDataURL(url: string): void; - - hasRendered(): boolean; - - setTransparent(transparency?: boolean): void; - - isPlotItemSliced(index: number): boolean; - - slicePlotItem(index: number, slice: boolean): void; - - centerLabel(labelText: string, options?: {}): void; - - startingAngle(angle?: number, relative?: boolean): void; - - zoomOut(): void; - - zoomTo(startIndex: number, endIndex: number): void; - - resetChart(): void; - - setZoomMode(yes: boolean): void; - - getViewStartIndex(): number; - - getViewEndIndex(): number; - - print(options?: {}): void; - - exportChart(options?: {}): void; - - getSVGString(): string; - - lockResize(state: boolean): boolean; - - showChartMessage(text: string, modal?: boolean, cancelable?: boolean): void; - - getJSONData(): JSON; - - setJSONData(data: string | {}): void; - - setJSONUrl(url: string): void; - - getCSVData(): any; - - getDataAsCSV(): any; - - render(containerElement?: string | Element, insertMode?: string, callback?: () => any): FusionCharts; - - resizeTo(width: number | string, height: number | string): any; - - dispose(): void; - - configure(options: {}): void; - - ref: {}; - - } - - interface FusionChartStatic { - new (chartObject: ChartObject|{}): FusionCharts; - - (chartId: string): FusionCharts; - - getObjectReference(elementId: string): Element; - - addEventListener(type: string | string[], listener: (eventObject?: EventObject, eventArgs?: {}) => void): void; - - removeEventListener(type: string | string[], listener: (eventObject?: EventObject, eventArgs?: {}) => void): void; - - ready(callback: (fusionChartStatic?: FusionChartStatic) => any, context?: any): FusionChartStatic; - - transcodeData(data: string | {}, source: ChartDataFormats, target: ChartDataFormats, advanced: boolean): any; - - batchExport(options: {}): void; - - formatNumber(num: number, type?: string, config?: {}): Element; - - setCurrentRenderer(name: string): void; - - getCurrentRenderer(): string; - - render(options?: ChartObject, callback?: () => any): FusionCharts; - - version: string[]; - - items: {}; - - options: {}; - - debugger: Debugger; - - - } - -} - -declare var FusionCharts: FusionCharts.FusionChartStatic; -export = FusionCharts; -export as namespace FusionCharts; diff --git a/fusioncharts/maps/fusioncharts.usa.d.ts b/fusioncharts/maps/fusioncharts.usa.d.ts deleted file mode 100644 index 16ed0d6c91..0000000000 --- a/fusioncharts/maps/fusioncharts.usa.d.ts +++ /dev/null @@ -1,7 +0,0 @@ - -import { FusionChartStatic } from "fusioncharts"; - -declare var usa: (H: FusionChartStatic) => FusionChartStatic; -export = usa; -export as namespace usa; - diff --git a/fusioncharts/maps/fusioncharts.world.d.ts b/fusioncharts/maps/fusioncharts.world.d.ts deleted file mode 100644 index 3e545e2556..0000000000 --- a/fusioncharts/maps/fusioncharts.world.d.ts +++ /dev/null @@ -1,7 +0,0 @@ - -import { FusionChartStatic } from "fusioncharts"; - -declare var world: (H: FusionChartStatic) => FusionChartStatic; -export = world; -export as namespace world; - diff --git a/fusioncharts/themes/fusioncharts.theme.carbon.d.ts b/fusioncharts/themes/fusioncharts.theme.carbon.d.ts deleted file mode 100644 index 79ba171231..0000000000 --- a/fusioncharts/themes/fusioncharts.theme.carbon.d.ts +++ /dev/null @@ -1,7 +0,0 @@ - -import { FusionChartStatic } from "fusioncharts"; - -declare var carbon: (H: FusionChartStatic) => FusionChartStatic; -export = carbon; -export as namespace carbon; - diff --git a/fusioncharts/themes/fusioncharts.theme.fint.d.ts b/fusioncharts/themes/fusioncharts.theme.fint.d.ts deleted file mode 100644 index cee08aa6b2..0000000000 --- a/fusioncharts/themes/fusioncharts.theme.fint.d.ts +++ /dev/null @@ -1,7 +0,0 @@ - -import { FusionChartStatic } from "fusioncharts"; - -declare var fint: (H: FusionChartStatic) => FusionChartStatic; -export = fint; -export as namespace fint; - diff --git a/fusioncharts/themes/fusioncharts.theme.ocean.d.ts b/fusioncharts/themes/fusioncharts.theme.ocean.d.ts deleted file mode 100644 index 8b7e3828c0..0000000000 --- a/fusioncharts/themes/fusioncharts.theme.ocean.d.ts +++ /dev/null @@ -1,7 +0,0 @@ - -import { FusionChartStatic } from "fusioncharts"; - -declare var ocean: (H: FusionChartStatic) => FusionChartStatic; -export = ocean; -export as namespace ocean; - diff --git a/fusioncharts/themes/fusioncharts.theme.zune.d.ts b/fusioncharts/themes/fusioncharts.theme.zune.d.ts deleted file mode 100644 index 06ab4c1787..0000000000 --- a/fusioncharts/themes/fusioncharts.theme.zune.d.ts +++ /dev/null @@ -1,7 +0,0 @@ - -import { FusionChartStatic } from "fusioncharts"; - -declare var zune: (H: FusionChartStatic) => FusionChartStatic; -export = zune; -export as namespace zune; - diff --git a/fusioncharts/tslint.json b/fusioncharts/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/fusioncharts/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/fuzzaldrin/tslint.json b/fuzzaldrin/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/fuzzaldrin/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/gapi.auth2/gapi.auth2-tests.ts b/gapi.auth2/gapi.auth2-tests.ts deleted file mode 100644 index 621ca6f056..0000000000 --- a/gapi.auth2/gapi.auth2-tests.ts +++ /dev/null @@ -1,61 +0,0 @@ - - -function test_init(){ - var auth = gapi.auth2.init({ - client_id: 'my-id', - cookie_policy: 'single_host_origin', - scope: 'https://www.googleapis.com/auth/plus.login', - fetch_basic_profile: true - }); -} - -function test_getAuthInstance(){ - gapi.auth2.init({ - client_id: 'my-id', - cookie_policy: 'single_host_origin', - scope: 'https://www.googleapis.com/auth/plus.login', - fetch_basic_profile: true - }); - var auth = gapi.auth2.getAuthInstance(); -} - -function test_signIn(){ - gapi.auth2.getAuthInstance().signIn({ - scope: 'email profile', - prompt: 'content' - }); -} - -function test_signInOptionsBuild(){ - var options = new gapi.auth2.SigninOptionsBuilder(); - options.setAppPackageName('com.example.app'); - options.setFetchBasicProfile(true); - options.setPrompt('select_account'); - options.setScope('profile').setScope('email'); - gapi.auth2.getAuthInstance().signIn(options); -} - -function test_getAuthResponse(){ - var user = gapi.auth2.getAuthInstance().currentUser.get(); - var authResponse = user.getAuthResponse(); - var authResponseWithAuth = user.getAuthResponse(true); -} - -function test_render(){ - var success = (googleUser: gapi.auth2.GoogleUser): void => { - console.log(googleUser); - }; - var failure = (): void => { - console.log('Failure callback'); - }; - - gapi.signin2.render('testId', { - scope: 'https://www.googleapis.com/auth/plus.login', - width: 250, - height: 50, - longtitle: true, - theme: 'dark', - onsuccess: success, - onfailure: failure - }); -} diff --git a/gapi.auth2/index.d.ts b/gapi.auth2/index.d.ts deleted file mode 100644 index 6146a87e28..0000000000 --- a/gapi.auth2/index.d.ts +++ /dev/null @@ -1,293 +0,0 @@ -// Type definitions for Google Sign-In API -// Project: https://developers.google.com/identity/sign-in/web/ -// Definitions by: Derek Lawless -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -declare namespace gapi.auth2 { - - /** - * GoogleAuth is a singleton class that provides methods to allow the user to sign in with a Google account, - * get the user's current sign-in status, get specific data from the user's Google profile, - * request additional scopes, and sign out from the current account. - */ - export class GoogleAuth { - isSignedIn: IsSignedIn; - - currentUser: CurrentUser; - - /** - * Calls the onInit function when the GoogleAuth object is fully initialized, or calls the onFailure function if - * initialization fails. - */ - then(onInit: () => any, onFailure: (reason: string) => any): any; - - /** - * Signs in the user with the options specified to gapi.auth2.init(). - */ - signIn(): any; - - /** - * Signs in the user using the specified options. - */ - signIn(options?: SigninOptions | SigninOptionsBuilder): any; - - /** - * Signs out all accounts from the application. - */ - signOut(): any; - - /** - * Revokes all of the scopes that the user granted. - */ - disconnect(): any; - - /** - * Get permission from the user to access the specified scopes offline. - */ - grantOfflineAccess(options: { - scope?: string; - redirect_uri?: string; - }): any; - - /** - * Attaches the sign-in flow to the specified container's click handler. - */ - attachClickHandler(container: any, options: SigninOptions, - onsuccess: (googleUser: GoogleUser) => any, onfailure: (reason: string) => any): any; - } - - export interface IsSignedIn{ - /** - * Returns whether the current user is currently signed in. - */ - get(): boolean; - - /** - * Listen for changes in the current user's sign-in state. - */ - listen(listener: (signedIn: boolean) => any): void; - } - - export interface CurrentUser { - /** - * Returns a GoogleUser object that represents the current user. Note that in a newly-initialized - * GoogleAuth instance, the current user has not been set. Use the currentUser.listen() method or the - * GoogleAuth.then() to get an initialized GoogleAuth instance. - */ - get(): GoogleUser; - - /** - * Listen for changes in currentUser. - */ - listen(listener: (user: GoogleUser) => any): void; - } - - export interface SigninOptions { - /** - * The package name of the Android app to install over the air. - * See Android app installs from your web site: - * https://developers.google.com/identity/sign-in/web/android-app-installs - */ - app_package_name?: string; - /** - * Fetch users' basic profile information when they sign in. - * Adds 'profile', 'email' and 'openid' to the requested scopes. - * True if unspecified. - */ - fetch_basic_profile?: boolean; - /** - * Specifies whether to prompt the user for re-authentication. - * See OpenID Connect Request Parameters: - * https://openid.net/specs/openid-connect-basic-1_0.html#RequestParameters - */ - prompt?: string; - /** - * The scopes to request, as a space-delimited string. - * Optional if fetch_basic_profile is not set to false. - */ - scope?: string; - } - - export class SigninOptionsBuilder { - setAppPackageName(name: string): any; - setFetchBasicProfile(fetch: boolean): any; - setPrompt(prompt: string): any; - setScope(scope: string): any; - } - - export interface BasicProfile { - getId(): string; - getName(): string; - getGivenName(): string; - getFamilyName(): string; - getImageUrl(): string; - getEmail(): string; - } - - export interface AuthResponse { - access_token: string; - id_token: string; - login_hint: string; - scope: string; - expires_in: string; - first_issued_at: string; - expires_at: string; - } - - /** - * A GoogleUser object represents one user account. - */ - export interface GoogleUser { - /** - * Get the user's unique ID string. - */ - getId(): string; - - /** - * Returns true if the user is signed in. - */ - isSignedIn(): boolean; - - /** - * Get the user's Google Apps domain if the user signed in with a Google Apps account. - */ - getHostedDomain(): string; - - /** - * Get the scopes that the user granted as a space-delimited string. - */ - getGrantedScopes(): string; - - /** - * Get the user's basic profile information. - */ - getBasicProfile(): BasicProfile; - - /** - * Get the response object from the user's auth session. - */ - getAuthResponse(includeAuthorizationData?: boolean): AuthResponse; - - /** - * Returns true if the user granted the specified scopes. - */ - hasGrantedScopes(scopes: string): boolean; - - /** - * Signs in the user. Use this method to request additional scopes for incremental - * authorization or to sign in a user after the user has signed out. - * When you use GoogleUser.signIn(), the sign-in flow skips the account chooser step. - * See GoogleAuth.signIn(). - */ - signIn(options?: SigninOptions | SigninOptionsBuilder): any; - - /** - * See GoogleUser.signIn() - */ - grant(options?: SigninOptions | SigninOptionsBuilder): any; - - /** - * Get permission from the user to access the specified scopes offline. - * When you use GoogleUser.grantOfflineAccess(), the sign-in flow skips the account chooser step. - * See GoogleUser.grantOfflineAccess(). - */ - grantOfflineAccess(scopes: string): void; - - /** - * Revokes all of the scopes that the user granted. - */ - disconnect(): void; - } - - - export function init(params: { - /** - * The app's client ID, found and created in the Google Developers Console. - */ - client_id?: string; - - /** - * The domains for which to create sign-in cookies. Either a URI, single_host_origin, or none. - * Defaults to single_host_origin if unspecified. - */ - cookie_policy?: string; - - /** - * The scopes to request, as a space-delimited string. Optional if fetch_basic_profile is not set to false. - */ - scope?: string; - - /** - * Fetch users' basic profile information when they sign in. Adds 'profile' and 'email' to the requested scopes. True if unspecified. - */ - fetch_basic_profile?: boolean; - - /** - * The Google Apps domain to which users must belong to sign in. This is susceptible to modification by clients, - * so be sure to verify the hosted domain property of the returned user. Use GoogleUser.getHostedDomain() on the client, - * and the hd claim in the ID Token on the server to verify the domain is what you expected. - */ - hosted_domain?: string; - - /** - * Used only for OpenID 2.0 client migration. Set to the value of the realm that you are currently using for OpenID 2.0, - * as described in OpenID 2.0 (Migration). - */ - openid_realm?: string; - }): GoogleAuth; - - /** - * Returns the GoogleAuth object. You must initialize the GoogleAuth object with gapi.auth2.init() before calling this method. - */ - export function getAuthInstance(): GoogleAuth; -} - -declare namespace gapi.signin2 { - - export function render(id: any, options: { - /** - * The auth scope or scopes to authorize. Auth scopes for individual APIs can be found in their documentation. - */ - scope?: string; - - /** - * The width of the button in pixels (default: 120). - */ - width?: number; - - /** - * The height of the button in pixels (default: 36). - */ - height?: number; - - /** - * Display long labels such as "Sign in with Google" rather than "Sign in" (default: false). - */ - longtitle?: boolean; - - /** - * The color theme of the button: either light or dark (default: light). - */ - theme?: string; - - /** - * The callback function to call when a user successfully signs in. - * This function must take one argument: an instance of gapi.auth2.GoogleUser (default: none). - */ - onsuccess?: any; - - /** - * The callback function to call when sign-in fails. This function takes no arguments (default: none). - */ - onfailure?: any; - - /** - * The package name of the Android app to install over the air. See - * Android app installs from your web site. - * Optional. (default: none) - */ - app_package_name?: string; - }): void; -} diff --git a/gapi/index.d.ts b/gapi/index.d.ts deleted file mode 100644 index 28d5c990bc..0000000000 --- a/gapi/index.d.ts +++ /dev/null @@ -1,294 +0,0 @@ -// Type definitions for Google API Client -// Project: https://code.google.com/p/google-api-javascript-client/ -// Definitions by: Frank M -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - - -/** - * The OAuth 2.0 token object represents the OAuth 2.0 token and any associated data. - */ -interface GoogleApiOAuth2TokenObject { - /** - * The OAuth 2.0 token. Only present in successful responses - */ - access_token: string; - /** - * Details about the error. Only present in error responses - */ - error: string; - /** - * The duration, in seconds, the token is valid for. Only present in successful responses - */ - expires_in: string; - /** - * The Google API scopes related to this token - */ - state: string; -} - -/** - * Fix for #8215 - * https://github.com/DefinitelyTyped/DefinitelyTyped/issues/8215 - * - * Usage example: - * https://developers.google.com/identity/sign-in/web/session-state - */ -declare namespace gapi { - - /** - * Pragmatically initialize gapi class member. - */ - export function load(object: string, fn: any) : any; - -} - -declare namespace gapi.auth { - /** - * Initiates the OAuth 2.0 authorization process. The browser displays a popup window prompting the user authenticate and authorize. After the user authorizes, the popup closes and the callback function fires. - * @param params A key/value map of parameters for the request. If the key is not one of the expected OAuth 2.0 parameters, it is added to the URI as a query parameter. - * @param callback The function to call once the login process is complete. The function takes an OAuth 2.0 token object as its only parameter. - */ - export function authorize(params: { - /** - * The application's client ID. - */ - client_id?: string; - /** - * If true, then login uses "immediate mode", which means that the token is refreshed behind the scenes, and no UI is shown to the user. - */ - immediate?: boolean; - /** - * The OAuth 2.0 response type property. Default: token - */ - response_type?: string; - /** - * The auth scope or scopes to authorize. Auth scopes for individual APIs can be found in their documentation. - */ - scope?: any; - /** - * The user to sign in as. -1 to toggle a multi-account chooser, 0 to default to the user's current account, and 1 to automatically sign in if the user is signed into Google Plus. - */ - authuser?: number; - }, callback: (token: GoogleApiOAuth2TokenObject) => any): void; - /** - * Initializes the authorization feature. Call this when the client loads to prevent popup blockers from blocking the auth window on gapi.auth.authorize calls. - * @param callback A callback to execute when the auth feature is ready to make authorization calls. - */ - export function init(callback: () => any): void; - /** - * Retrieves the OAuth 2.0 token for the application. - * @return The OAuth 2.0 token. - */ - export function getToken(): GoogleApiOAuth2TokenObject; - /** - * Sets the OAuth 2.0 token for the application. - * @param token The token to set. - */ - export function setToken(token: GoogleApiOAuth2TokenObject): void; - /** - * Initiates the client-side Google+ Sign-In OAuth 2.0 flow. - * When the method is called, the OAuth 2.0 authorization dialog is displayed to the user and when they accept, the callback function is called. - * @param params - */ - export function signIn(params: { - /** - * Your OAuth 2.0 client ID that you obtained from the Google Developers Console. - */ - clientid?: string; - /** - * Directs the sign-in button to store user and session information in a session cookie and HTML5 session storage on the user's client for the purpose of minimizing HTTP traffic and distinguishing between multiple Google accounts a user might be signed into. - */ - cookiepolicy?: string; - /** - * A function in the global namespace, which is called when the sign-in button is rendered and also called after a sign-in flow completes. - */ - callback?: Function; - /** - * If true, all previously granted scopes remain granted in each incremental request, for incremental authorization. The default value true is correct for most use cases; use false only if employing delegated auth, where you pass the bearer token to a less-trusted component with lower programmatic authority. - */ - includegrantedscopes?: boolean; - /** - * If your app will write moments, list the full URI of the types of moments that you intend to write. - */ - requestvisibleactions?: any; - /** - * The OAuth 2.0 scopes for the APIs that you would like to use as a space-delimited list. - */ - scope?: any; - /** - * If you have an Android app, you can drive automatic Android downloads from your web sign-in flow. - */ - apppackagename?: string; - }): void; - /** - * Signs a user out of your app without logging the user out of Google. This method will only work when the user is signed in with Google+ Sign-In. - */ - export function signOut(): void; -} - -declare namespace gapi.client { - interface RequestOptions { - /** - * The URL to handle the request - */ - path: string; - /** - * The HTTP request method to use. Default is GET - */ - method?: string; - /** - * URL params in key-value pair form - */ - params?: any; - /** - * Additional HTTP request headers - */ - headers?: any; - /** - * The HTTP request body (applies to PUT or POST). - */ - body?: any; - /** - * If supplied, the request is executed immediately and no gapi.client.HttpRequest object is returned - */ - callback?: () => any; - } - - /** - * Loads the client library interface to a particular API. If a callback is not provided, a promise is returned. - * @param name The name of the API to load. - * @param version The version of the API to load. - * @return promise The promise that get's resolved after the request is finished. - */ - export function load(name: string, version: string): Promise - - /** - * Loads the client library interface to a particular API. The new API interface will be in the form gapi.client.api.collection.method. - * @param name The name of the API to load. - * @param version The version of the API to load - * @param callback the function that is called once the API interface is loaded - * @param url optional, the url of your app - if using Google's APIs, don't set it - */ - export function load(name: string, version: string, callback: () => any, url?: string): void; - /** - * Creates a HTTP request for making RESTful requests. - * An object encapsulating the various arguments for this method. - */ - export function request(args: RequestOptions): HttpRequest; - /** - * Creates an RPC Request directly. The method name and version identify the method to be executed and the RPC params are provided upon RPC creation. - * @param method The method to be executed. - * @param version The version of the API which defines the method to be executed. Defaults to v1 - * @param rpcParams A key-value pair of the params to supply to this RPC - */ - export function rpcRequest(method: string, version?: string, rpcParams?: any): RpcRequest; - /** - * Sets the API key for the application. - * @param apiKey The API key to set - */ - export function setApiKey(apiKey: string): void; - - /** - * An object encapsulating an HTTP request. This object is not instantiated directly, rather it is returned by gapi.client.request. - */ - export class HttpRequest { - /** - * Executes the request and runs the supplied callback on response. - * @param callback The callback function which executes when the request succeeds or fails. - */ - execute(callback: ( - /** - * contains the response parsed as JSON. If the response is not JSON, this field will be false. - */ - jsonResp: T, - /** - * is the HTTP response. It is JSON, and can be parsed to an object - */ - rawResp: { - body: string; - headers: any[]; - status: number; - statusText: string; - } - ) => any):void; - /** - * HttpRequest supports promises. - */ - then(success:(response:{ - result:T; - body:string; - headers?: any[]; - status?: number; - statusText?: string - })=>void, - failure:(response:{ - result:T; - body:string; - headers?: any[]; - status?: number; - statusText?: string - })=>void): void; - } - /** - * Represents an HTTP Batch operation. Individual HTTP requests are added with the add method and the batch is executed using execute. - */ - export class HttpBatch { - /** - * Adds a gapi.client.HttpRequest to the batch. - * @param httpRequest The HTTP request to add to this batch. - * @param opt_params extra parameters for this batch entry. - */ - add(httpRequest: HttpRequest, opt_params?: { - /** - * Identifies the response for this request in the map of batch responses. If one is not provided, the system generates a random ID. - */ - id: string; - callback: ( - /** - * is the response for this request only. Its format is defined by the API method being called. - */ - individualResponse: any, - /** - * is the raw batch ID-response map as a string. It contains all responses to all requests in the batch. - */ - rawBatchResponse: any - ) => any - }):void; - /** - * Executes all requests in the batch. The supplied callback is executed on success or failure. - * @param callback The callback to execute when the batch returns. - */ - execute(callback: ( - /** - * is an ID-response map of each requests response. - */ - responseMap: any, - /** - * is the same response, but as an unparsed JSON-string. - */ - rawBatchResponse: string - ) => any):void; - } - - /** - * Similar to gapi.client.HttpRequest except this object encapsulates requests generated by registered methods. - */ - export class RpcRequest { - - /** - * Executes the request and runs the supplied callback with the response. - * @param callback The callback function which executes when the request succeeds or fails. - */ - callback(callback: ( - /** - * contains the response parsed as JSON. If the response is not JSON, this field will be false. - */ - jsonResp: any, - /** - * is the same as jsonResp, except it is a raw string that has not been parsed. It is typically used when the response is not JSON. - */ - rawResp: string - ) => void ):void; - } - -} diff --git a/gaussian/index.d.ts b/gaussian/index.d.ts deleted file mode 100644 index f0012597cb..0000000000 --- a/gaussian/index.d.ts +++ /dev/null @@ -1,65 +0,0 @@ -// Type definitions for gaussian 1.1 -// Project: https://github.com/errcw/gaussian -// Definitions by: Scott Cooper -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare function gaussian(mean: number, variance: number): gaussian.Gaussian; - -export = gaussian; -export as namespace gaussian; - -declare namespace gaussian { - export interface Gaussian { - /** - * the mean (μ) of the distribution - */ - mean: number; - /** - * the variance (σ^2) of the distribution - */ - variance: number; - /** - * the standard deviation (σ) of the distribution - */ - standardDeviation: number; - /** - * the probability density function, which describes the - * probability of a random variable taking on the value x - */ - pdf(x: number): number; - /** - * the cumulative distribution function, which describes the - * probability of a random variable falling in the interval (−∞, x] - */ - cdf(x: number): number; - /** - * the percent point function, the inverse of cdf - */ - ppf(x: number): number; - /** - * returns the product distribution of this and the given - * distribution; equivalent to scale(d) when d is a constant - */ - mul(x: number | Gaussian): number; - /** - * returns the quotient distribution of this and the given - * distribution; equivalent to scale(1/d) when d is a constant - */ - div(x: number | Gaussian): number; - /** - * returns the result of adding this and the given - * distribution's means and variances - */ - add(x: Gaussian): number; - /** - * returns the result of subtracting this and the given - * distribution's means and variances - */ - sub(x: Gaussian): number; - /** - * returns the result of scaling this distribution by the - * given constant - */ - scale(x: number): number; - } -} diff --git a/gaussian/tslint.json b/gaussian/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/gaussian/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/geodesy/index.d.ts b/geodesy/index.d.ts deleted file mode 100644 index d5436f073d..0000000000 --- a/geodesy/index.d.ts +++ /dev/null @@ -1,149 +0,0 @@ -// Type definitions for geodesy 1.1 -// Project: https://github.com/chrisveness/geodesy -// Definitions by: Denis Carriere -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export type format = 'd' | 'dm' | 'dms'; -export type datum = 'ED50'| 'Irl1975'| 'NAD27'| 'NAD83'| 'NTF'| 'OSGB36'| 'Potsdam'| 'TokyoJapan'| 'WGS72'| 'WGS84'; -export type hemisphere = 'N' | 'S'; -export type ellipsoid = 'WGS84' | 'Airy1830' | 'AiryModified' | 'Bessel1841' | 'Clarke1866' | 'Clarke1880IGN' | 'GRS80' | 'Intl1924' | 'WGS72'; -export type transform = [number, number, number, number, number, number, number]; -export type LatLon = LatLonEllipsoidal; - -export interface Datum { - ellipsoid: Ellipsoid; - transform: [number, number, number, number, number, number, number]; -} - -export interface Datums { - ED50: Datum; - Irl1975: Datum; - NAD27: Datum; - NAD83: Datum; - NTF: Datum; - OSGB36: Datum; - Potsdam: Datum; - TokyoJapan: Datum; - WGS72: Datum; - WGS84: Datum; -} - -export interface Ellipsoid { - a: number; - b: number; - f: number; -} - -export interface Ellipsoids { - WGS84: Ellipsoid; - GRS80: Ellipsoid; - Airy1830: Ellipsoid; - AiryModified: Ellipsoid; - Intl1924: Ellipsoid; - Bessel1841: Ellipsoid; -} - -export declare class Mgrs { - zone: number; - band: string; - e100k: string; - n100k: string; - easting: number; - northing: number; - datum: datum; - latBands: string; - e100kLetters: string; - n100kLetters: string; - constructor( - zone: number, - band: string, - e100k: string, - n100k: string, - easting: number, - northing: number, - datum?: datum - ) - static parse(mgrsGridRef: string): Mgrs; - toUtm(): Utm; - toString(digits?: 2 | 4 | 6 | 8 | 10): string; -} - -export declare class Utm { - zone: number; - hemisphere: hemisphere; - easting: number; - northing: number; - datum: Datum; - convergence: number; - scale: number; - constructor( - zone: number, - hemisphere: hemisphere, - easting: number, - northing: number, - datum?: datum, - convergence?: number, - scale?: number - ); - static parse(utmCoord: string, datum?: datum): Utm; - toLatLonE(): LatLon; - toMgrs(): Mgrs; - toString(digits?: number): string; -} - -export declare namespace Dms { - export let separator: string; -} - -export declare class Dms { - static parseDMS(dmsStr: string): number; - static toDMS(deg: number, format?: format, dp?: 0 | 2 | 4): string; - static toLat(deg: number, format?: format, dp?: 0 | 2 | 4): string; - static toLon(deg: number, format?: format, dp?: 0 | 2 | 4): string; - static toBrng(deg: number, format?: format, dp?: 0 | 2 | 4): string; - static compassPoint(bearing: number, precision?: 1 | 2 | 3): string; -} - -export declare class Vector3d { - x: number; - y: number; - z: number; - constructor(x: number, y: number, z: number); - plus(v: Vector3d): Vector3d; - minus(v: Vector3d): Vector3d; - times(x: number): Vector3d; - dividedBy(x: number): Vector3d; - dot(v: Vector3d): number; - cross(v: Vector3d): Vector3d; - negate(): Vector3d; - length(): number; - unit(): Vector3d; - angleTo(v: Vector3d, n?: Vector3d): number; - rotateAround(axis: Vector3d, theta: number): Vector3d; - toString(precision?: number): string; - toLatLonE(datum: Datum): LatLon; - applyTransform(t: number[]): Vector3d; -} - -export declare class OsGridRef { - easting: number; - northing: number; - constructor(easting: number, northing: number); - static latLonToOsGrid(p: LatLon): OsGridRef; - static osGridToLatLon(gridref: OsGridRef, datum?: Datum): LatLon; - static parse(gridref: string): OsGridRef; - toString(digits?: number): string; -} - -export declare class LatLonEllipsoidal { - lat: number; - lon: number; - datum: Datum; - constructor(lat: number, lon: number, datum?: Datum); - toUtm(): Utm; - convertDatum(toDatum: Datum): LatLon; - toCartesian(): Vector3d; - toString(format?: format, dp?: 0 | 2 | 4): string; - static datum: Datums; - static ellipsoid: Ellipsoids; -} diff --git a/geodesy/tslint.json b/geodesy/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/geodesy/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/geojson/index.d.ts b/geojson/index.d.ts deleted file mode 100644 index 7c825d2541..0000000000 --- a/geojson/index.d.ts +++ /dev/null @@ -1,126 +0,0 @@ -// Type definitions for GeoJSON Format Specification Revision 1.0 -// Project: http://geojson.org/ -// Definitions by: Jacob Bruun -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare namespace GeoJSON { - - /*** - * http://geojson.org/geojson-spec.html#geojson-objects - */ - export interface GeoJsonObject { - type: string; - bbox?: number[]; - crs?: CoordinateReferenceSystem; - } - - /*** - * http://geojson.org/geojson-spec.html#positions - */ - export type Position = number[]; - - /*** - * http://geojson.org/geojson-spec.html#geometry-objects - */ - interface DirectGeometryObject extends GeoJsonObject { - coordinates: Position[][][] | Position[][] | Position[] | Position; - } - /** - * GeometryObject supports geometry collection as well - */ - export type GeometryObject = DirectGeometryObject | GeometryCollection; - - /*** - * http://geojson.org/geojson-spec.html#point - */ - export interface Point extends DirectGeometryObject { - type: 'Point'; - coordinates: Position; - } - - /*** - * http://geojson.org/geojson-spec.html#multipoint - */ - export interface MultiPoint extends DirectGeometryObject { - type: 'MultiPoint'; - coordinates: Position[]; - } - - /*** - * http://geojson.org/geojson-spec.html#linestring - */ - export interface LineString extends DirectGeometryObject { - type: 'LineString'; - coordinates: Position[]; - } - - /*** - * http://geojson.org/geojson-spec.html#multilinestring - */ - export interface MultiLineString extends DirectGeometryObject { - type: 'MultiLineString'; - coordinates: Position[][]; - } - - /*** - * http://geojson.org/geojson-spec.html#polygon - */ - export interface Polygon extends DirectGeometryObject { - type: 'Polygon'; - coordinates: Position[][]; - } - - /*** - * http://geojson.org/geojson-spec.html#multipolygon - */ - export interface MultiPolygon extends DirectGeometryObject { - type: 'MultiPolygon'; - coordinates: Position[][][]; - } - - /*** - * http://geojson.org/geojson-spec.html#geometry-collection - */ - export interface GeometryCollection extends GeoJsonObject { - type: 'GeometryCollection'; - geometries: GeometryObject[]; - } - - /*** - * http://geojson.org/geojson-spec.html#feature-objects - */ - export interface Feature extends GeoJsonObject { - type: 'Feature'; - geometry: T; - properties: {} | null; - id?: string; - } - - /*** - * http://geojson.org/geojson-spec.html#feature-collection-objects - */ - export interface FeatureCollection extends GeoJsonObject { - type: 'FeatureCollection'; - features: Array>; - } - - /*** - * http://geojson.org/geojson-spec.html#coordinate-reference-system-objects - */ - export interface CoordinateReferenceSystem { - type: string; - properties: any; - } - - export interface NamedCoordinateReferenceSystem extends CoordinateReferenceSystem { - properties: { name: string }; - } - - export interface LinkedCoordinateReferenceSystem extends CoordinateReferenceSystem { - properties: { href: string; type: string }; - } -} - -declare module 'geojson' { - export = GeoJSON; -} diff --git a/geojson/tslint.json b/geojson/tslint.json deleted file mode 100644 index 0b14fdec0d..0000000000 --- a/geojson/tslint.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "../tslint.json", - "rules": { - "no-single-declare-module": false - } -} diff --git a/geolib/index.d.ts b/geolib/index.d.ts deleted file mode 100644 index 69a6c99353..0000000000 --- a/geolib/index.d.ts +++ /dev/null @@ -1,199 +0,0 @@ -// Type definitions for geolib 2.0 -// Project: https://github.com/manuelbieh/Geolib -// Definitions by: Vladimir Venegas , Alex Efimov -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare namespace geolib { - export interface PositionAsDecimal { - latitude: number; - longitude: number; - } - - export interface PositionAsSexadecimal { - latitude: string; - longitude: string; - } - - export interface PositionWithElevation extends PositionAsDecimal { - elevation?: number; - } - - export interface PositionInTime extends PositionAsDecimal { - time: number; - } - - export interface Bound { - minLat: number; - maxLat: number; - minLng: number; - maxLng: number; - minElev?: number; - maxElev?: number; - } - - export interface CompassDirection { - rough: string; - exact: string; - } - - export interface Distance { - latitude: number; - longitude: number; - distance: number; - key: string; - } - - export interface SpeedOption { - unit: string; - } - - /** Calculates the distance between two geo coordinates - * - * Return value is always float and represents the distance in meters. - */ - function getDistance(start: PositionAsDecimal|PositionAsSexadecimal, end: PositionAsDecimal|PositionAsSexadecimal, accuracy?: number, precision?: number): number; - - /** Calculates the distance between two geo coordinates but this method is far more inaccurate as compared to getDistance. - * It can take up 2 to 3 arguments. start, end and accuracy can be defined in the same as in getDistance. - * - * Return value is always float that represents the distance in meters. - */ - function getDistanceSimple(start: PositionAsDecimal|PositionAsSexadecimal, end: PositionAsDecimal|PositionAsSexadecimal, accuracy?: number): number; - - - /** Calculates the geographical center of all points in a collection of geo coordinates - * Takes an object or array of coordinates and calculates the center of it. - */ - function getCenter(coords: PositionAsDecimal[]): PositionAsDecimal; - - - /** Calculates the center of the bounds of geo coordinates. Takes an array of coordinates, - * calculate the border of those, and gives back the center of that rectangle. On polygons - * like political borders (eg. states), this may gives a closer result to human expectation, - * than getCenter, because that function can be disturbed by uneven distribution of point in - * different sides. Imagine the US state Oklahoma: getCenter on that gives a southern point, - * because the southern border contains a lot more nodes, than the others. - */ - function getCenterOfBounds(coords: PositionAsDecimal[]): PositionAsDecimal; - - - /** Calculates the bounds of geo coordinates. - * - * Returns maximum and minimum, latitude, longitude, and elevation (if provided) in form of an object - */ - function getBounds(coords: PositionWithElevation[]): Bound; - - - /** Checks whether a point is inside of a polygon or not. Note: the polygon coords must be in correct order! - * - * Returns true or false - */ - function isPointInside(latlng: PositionAsDecimal, polygon: PositionAsDecimal[]): boolean; - - - /** Similar to is point inside: checks whether a point is inside of a circle or not. - * - * Returns true or false - */ - function isPointInCircle(latlng: PositionAsDecimal, center: PositionAsDecimal, radius: number): boolean; - - - /** Gets rhumb line bearing of two points. Find out about the difference between rhumb line and great circle bearing on Wikipedia. - * Rhumb line should be fine in most cases: http://en.wikipedia.org/wiki/Rhumb_line#General_and_mathematical_description Function - * is heavily based on Doug Vanderweide's great PHP version (licensed under GPL 3.0) - * http://www.dougv.com/2009/07/13/calculating-the-bearing-and-compass-rose-direction-between-two-latitude-longitude-coordinates-in-php/ - * - * Returns calculated bearing as integer. - */ - function getRhumbLineBearing(originLL: PositionAsDecimal, destLL: PositionAsDecimal): number; - - - /** Gets great circle bearing of two points. See description of getRhumbLineBearing for more information. - * - * Returns calculated bearing as integer - */ - function getBearing(originLL: PositionAsDecimal, destLL: PositionAsDecimal): number; - - - /** Gets the compass direction from an origin coordinate (originLL) to a destination coordinate (destLL). - * Bearing mode. Can be either circle or rhumbline (default). - * - * Returns an object with a rough (NESW) and an exact direction (NNE, NE, ENE, E, ESE, etc). - */ - function getCompassDirection(originLL: PositionAsDecimal, destLL: PositionAsDecimal, bearingMode?: string): CompassDirection; - - - /** Sorts an object or array of coords by distance from a reference coordinate */ - function orderByDistance(latlng: PositionAsDecimal, coords: PositionAsDecimal[]): Distance[]; - - - /** Finds the nearest coordinate to a reference coordinate. */ - function findNearest(latlng: PositionAsDecimal, coords: PositionAsDecimal[], offset?: number, limit?: number): Distance[]; - - - /** Calculates the length of a collection of coordinates. - * - * Returns the length of the path in meters */ - function getPathLength(coords: PositionAsDecimal[]): number; - - /** Calculates the speed between two points within a given time span. - * - * Returns the speed in options.unit (default is km/h). - */ - function getSpeed(coords: PositionInTime[], option?: SpeedOption): number; - - - /** Calculates if given point lies in a line formed by start and end */ - function isPointInLine(point: PositionAsDecimal, start: PositionAsDecimal, end: PositionAsDecimal): boolean; - - - /** Converts a given distance (in meters) to another unit. - * distance distance to be converted (source must be in meter). unit can be one of: - * - m (meter) - * - km (kilometers) - * - cm (centimeters) - * - mm (millimeters) - * - mi (miles) - * - sm (seamiles) - * - ft (foot) - * - in (inch) - * - yd (yards) - */ - function convertUnit(unit: string, distance: number, round?: number): number; - - - /** Converts a sexagesimal coordinate to decimal format */ - function sexagesimal2decimal(coord: string): number; - - - /** Converts a decimal coordinate to sexagesimal format */ - function decimal2sexagesimal(coord: number): string; - - /** Returns the latitude for a given point and converts it to decimal. - * Works with: latitude, lat, 1 (GeoJSON array) - */ - function latitude(latlng: any): number; - - /** Returns the longitude for a given point and converts it to decimal. - * Works with: longitude, lng, lon, 0 (GeoJSON array) - */ - function longitude(latlng: any): number; - - /** Returns the elevation for a given point and converts it to decimal. - * Works with: elevation, elev, alt, altitude, 2 (GeoJSON array) - */ - function elevation(latlng: any): number; - - - /** Checks if a coordinate is already in decimal format and, if not, converts it to */ - function useDecimal(latlng: string|number): number; - - - /** Computes the destination point given an initial point, a distance (in meters) and a bearing (in degrees). - * If no radius is given it defaults to the mean earth radius of 6371000 meter. - * - * Returns an object: `{"latitude": destLat, "longitude": destLng}` - * (Attention: this formula is not *100%* accurate (but very close though)) - */ - function computeDestinationPoint(start: PositionAsDecimal, distance: number, bearing: number, radius?: number): PositionAsDecimal; -} diff --git a/geolib/tslint.json b/geolib/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/geolib/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/geopattern/geopattern-tests.ts b/geopattern/geopattern-tests.ts deleted file mode 100644 index 957da81c20..0000000000 --- a/geopattern/geopattern-tests.ts +++ /dev/null @@ -1,6 +0,0 @@ -/// - -var pattern = GeoPattern.generate('GitHub'); -pattern.toDataUrl(); - -$('#geopattern').geopattern('GitHub'); diff --git a/geopattern/tslint.json b/geopattern/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/geopattern/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/get-stdin/index.d.ts b/get-stdin/index.d.ts deleted file mode 100644 index 9539b520b9..0000000000 --- a/get-stdin/index.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Type definitions for get-stdin 5.0 -// Project: https://github.com/sindresorhus/get-stdin -// Definitions by: Daniel Rosenwasser -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -declare function getStdin(): Promise; -declare namespace getStdin { - export function buffer(): Promise; -} - -export = getStdin; diff --git a/get-stdin/tslint.json b/get-stdin/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/get-stdin/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/gettext.js/index.d.ts b/gettext.js/index.d.ts deleted file mode 100644 index 5096490721..0000000000 --- a/gettext.js/index.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -// Type definitions for gettext.js 0.5 -// Project: https://github.com/guillaumepotier/gettext.js -// Definitions by: Julien Crouzet -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export type PluralForm = (n: number) => number; - -export type GettextStatic = (options?: GettextOptions) => Gettext; - -export interface GettextOptions { - domain?: string; - locale?: string; - plural_func?: PluralForm; - ctxt_delimiter?: string; -} - -export interface JsonDataHeader { - locale: string; - "plural-forms": string; -} - -export interface JsonDataMessages { - [key: string]: string | string[] | JsonDataHeader; -} - -export interface JsonData extends JsonDataMessages { - "": JsonDataHeader; -} - -export interface Gettext { - setMessages: (domain: string, locale: string, messages: JsonDataMessages, plural_forms?: PluralForm) => Gettext; - loadJSON: (jsonData: JsonData, domain?: string) => Gettext; - setLocale: (locale: string) => Gettext; - getLocale: () => string; - textdomain: (domain?: string) => Gettext | string; - gettext: (msgid: string, ...args: any[]) => string; - ngettext: (msgid: string, msgid_plural: string, n: number, ...args: any[]) => string; - pgettext: (msgctxt: string, msgid: string, ...args: any[]) => string; - dcnpgettext: (domain: string, msgctxt: string, msgid: string, msgid_plural: string, n: number, ...args: any[]) => string; - __: (msgid: string, ...args: any[]) => string; - _n: (msgid: string, msgid_plural: string, n: number, ...args: any[]) => string; - _p: (msgctxt: string, msgid: string, ...args: any[]) => string; -} - -export const i18n: GettextStatic; diff --git a/gettext.js/tslint.json b/gettext.js/tslint.json deleted file mode 100644 index 2221e40e4a..0000000000 --- a/gettext.js/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } \ No newline at end of file diff --git a/git-remote-origin-url/tslint.json b/git-remote-origin-url/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/git-remote-origin-url/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/github/github-tests.ts b/github/github-tests.ts deleted file mode 100644 index cc27c0cb5e..0000000000 --- a/github/github-tests.ts +++ /dev/null @@ -1,27 +0,0 @@ -import GitHubApi = require("github"); - -let github = new GitHubApi({ - // optional args - debug: true, - protocol: "https", - host: "github.my-GHE-enabled-company.com", // should be api.github.com for GitHub - pathPrefix: "/api/v3", // for some GHEs; none for GitHub - headers: { - "user-agent": "My-Cool-GitHub-App" // GitHub is happy with a unique user agent - }, - Promise: null as any, - followRedirects: false, // default: true; there's currently an issue with non-get redirects, so allow ability to disable follow-redirects - timeout: 5000 -}); - -// TODO: optional authentication here depending on desired endpoints. See below in README. - -github.users.getFollowingForUser({ - // optional: - // headers: { - // "cookie": "blahblah" - // }, - user: "defunkt" -}, (err: any, res: any) => { - console.log(JSON.stringify(res)); -}); diff --git a/github/index.d.ts b/github/index.d.ts deleted file mode 100644 index c48a24a345..0000000000 --- a/github/index.d.ts +++ /dev/null @@ -1,326 +0,0 @@ -// Type definitions for github -// Project: https://github.com/mikedeboer/node-github -// Definitions by: vvakame -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export = Client; - -declare class Client { - authorization: Authorization; - events: Events; - gists: Gists; - gitdata: GitData; - gitignore: GitIgnore; - issues: Issues; - markdown: Markdown; - misc: Misc; - orgs: Orgs; - pullRequests: PullRequests; - releases: Releases; - repos: Repos; - search: Search; - statues: Statues; - users: User; - - constructor(options: Options); - - authenticate(...args: any[]): any; - getFirstPage(...args: any[]): any; - getLastPage(...args: any[]): any; - getNextPage(...args: any[]): any; - getPreviousPage(...args: any[]): any; - hasFirstPage(...args: any[]): any; - hasLastPage(...args: any[]): any; - hasNextPage(...args: any[]): any; - hasPreviousPage(...args: any[]): any; - httpSend(...args: any[]): any; - setupRoutes(...args: any[]): any; -} -declare namespace Client { } - -interface Options { - version?: string; - debug?: boolean; - protocol?: string; - host?: string; - pathPrefix?: string; - timeout?: number; - headers?: { [name: string]: any; }; - followRedirects?: boolean; - Promise?: typeof Promise; -} - -interface Authorization { - create(msg: AuthorizationCreateMessage, callback: Function): void; - delete: Function; - get: Function; - getAll: Function; - update: Function; -} - -interface AuthorizationCreateMessage { - headers?: { [name: string]: string; }; - scopes?: string[]; - note?: string; - note_url?: string; - client_id?: string; - client_secret?: string; - fingerprint?: string; -} - -interface Events { - get(...args: any[]): any; - getFromOrg(...args: any[]): any; - getFromRepo(...args: any[]): any; - getFromRepoIssues(...args: any[]): any; - getFromRepoNetwork(...args: any[]): any; - getFromUser(...args: any[]): any; - getFromUserOrg(...args: any[]): any; - getFromUserPublic(...args: any[]): any; - getReceived(...args: any[]): any; - getReceivedPublic(...args: any[]): any; -} - -interface Gists { - checkStar(...args: any[]): any; - create(...args: any[]): any; - createComment(...args: any[]): any; - delete(...args: any[]): any; - deleteComment(...args: any[]): any; - deleteStar(...args: any[]): any; - edit(...args: any[]): any; - editComment(...args: any[]): any; - fork(...args: any[]): any; - get(...args: any[]): any; - getAll(...args: any[]): any; - getComment(...args: any[]): any; - getComments(...args: any[]): any; - getFromUser(...args: any[]): any; - public(...args: any[]): any; - star(...args: any[]): any; - starred(...args: any[]): any; -} - -interface GitData { - createBlob(...args: any[]): any; - createCommit(...args: any[]): any; - createReference(...args: any[]): any; - createTag(...args: any[]): any; - createTree(...args: any[]): any; - deleteReference(...args: any[]): any; - getAllReferences(...args: any[]): any; - getBlob(...args: any[]): any; - getCommit(...args: any[]): any; - getReference(...args: any[]): any; - getTag(...args: any[]): any; - getTree(...args: any[]): any; - updateReference(...args: any[]): any; -} - -interface GitIgnore { - template(...args: any[]): any; - templates(...args: any[]): any; -} - -interface Issues { - create(...args: any[]): any; - createComment(...args: any[]): any; - createLabel(...args: any[]): any; - createMilestone(...args: any[]): any; - deleteComment(...args: any[]): any; - deleteLabel(...args: any[]): any; - deleteMilestone(...args: any[]): any; - edit(...args: any[]): any; - editComment(...args: any[]): any; - getAll(...args: any[]): any; - getAllMilestones(...args: any[]): any; - getComment(...args: any[]): any; - getComments(...args: any[]): any; - getEvent(...args: any[]): any; - getEvents(...args: any[]): any; - getIssueLabels(...args: any[]): any; - getLabel(...args: any[]): any; - getLabels(...args: any[]): any; - getMilestone(...args: any[]): any; - getRepoEvents(...args: any[]): any; - getRepoIssue(...args: any[]): any; - repoComments(...args: any[]): any; - repoIssues(...args: any[]): any; - updateLabel(...args: any[]): any; - updateMilestone(...args: any[]): any; -} - -interface Markdown { - render(...args: any[]): any; -} - -interface Misc { - emojis(...args: any[]): any; - meta(...args: any[]): any; - rateLimit(...args: any[]): any; -} - -interface Orgs { - addTeamMember(...args: any[]): any; - addTeamRepo(...args: any[]): any; - concealMembership(...args: any[]): any; - createTeam(...args: any[]): any; - deleteTeam(...args: any[]): any; - deleteTeamMember(...args: any[]): any; - deleteTeamRepo(...args: any[]): any; - get(...args: any[]): any; - getFromUser(...args: any[]): any; - getMember(...args: any[]): any; - getMembers(...args: any[]): any; - getPublicMember(...args: any[]): any; - getPublicMembers(...args: any[]): any; - getTeam(...args: any[]): any; - getTeamMember(...args: any[]): any; - getTeamMembers(...args: any[]): any; - getTeamRepo(...args: any[]): any; - getTeamRepos(...args: any[]): any; - getTeams(...args: any[]): any; - publicizeMembership(...args: any[]): any; - removeMember(...args: any[]): any; - update(...args: any[]): any; - updateTeam(...args: any[]): any; -} - -interface PullRequests { - create(...args: any[]): any; - createComment(...args: any[]): any; - createCommentReply(...args: any[]): any; - createFromIssue(...args: any[]): any; - deleteComment(...args: any[]): any; - get(...args: any[]): any; - getAll(...args: any[]): any; - getComment(...args: any[]): any; - getComments(...args: any[]): any; - getCommits(...args: any[]): any; - getFiles(...args: any[]): any; - getMerged(...args: any[]): any; - merge(...args: any[]): any; - update(...args: any[]): any; - updateComment(...args: any[]): any; -} - -interface Releases { - createRelease(...args: any[]): any; - deleteAsset(...args: any[]): any; - deleteRelease(...args: any[]): any; - editAsset(...args: any[]): any; - editRelease(...args: any[]): any; - getAsset(...args: any[]): any; - getRelease(...args: any[]): any; - listAssets(...args: any[]): any; - listReleases(...args: any[]): any; -} - -interface Repos { - addCollaborator(...args: any[]): any; - compareCommits(...args: any[]): any; - create(...args: any[]): any; - createCommitComment(...args: any[]): any; - createContent(...args: any[]): any; - createFile(...args: any[]): any; - createFromOrg(...args: any[]): any; - createHook(...args: any[]): any; - createKey(...args: any[]): any; - delete(...args: any[]): any; - deleteCommitComment(...args: any[]): any; - deleteDownload(...args: any[]): any; - deleteFile(...args: any[]): any; - deleteHook(...args: any[]): any; - deleteKey(...args: any[]): any; - fork(...args: any[]): any; - get(...args: any[]): any; - getAll(...args: any[]): any; - getAllCommitComments(...args: any[]): any; - getArchiveLink(...args: any[]): any; - getBranch(...args: any[]): any; - getBranches(...args: any[]): any; - getCollaborator(...args: any[]): any; - getCollaborators(...args: any[]): any; - getCommit(...args: any[]): any; - getCommitComment(...args: any[]): any; - getCommitComments(...args: any[]): any; - getCommits(...args: any[]): any; - getContent(...args: any[]): any; - getContributors(...args: any[]): any; - getDownload(...args: any[]): any; - getDownloads(...args: any[]): any; - getForks(...args: any[]): any; - getFromOrg(...args: any[]): any; - getFromUser(...args: any[]): any; - getHook(...args: any[]): any; - getHooks(...args: any[]): any; - getKey(...args: any[]): any; - getKeys(...args: any[]): any; - getLanguages(...args: any[]): any; - getReadme(...args: any[]): any; - getStargazers(...args: any[]): any; - getStarred(...args: any[]): any; - getStarredFromUser(...args: any[]): any; - getStarring(...args: any[]): any; - getStatsCodeFrequency(...args: any[]): any; - getStatsCommitActivity(...args: any[]): any; - getStatsContributors(...args: any[]): any; - getStatsParticipation(...args: any[]): any; - getStatsPunchCard(...args: any[]): any; - getTags(...args: any[]): any; - getTeams(...args: any[]): any; - getWatched(...args: any[]): any; - getWatchedFromUser(...args: any[]): any; - getWatchers(...args: any[]): any; - getWatching(...args: any[]): any; - merge(...args: any[]): any; - one(...args: any[]): any; - removeCollaborator(...args: any[]): any; - star(...args: any[]): any; - testHook(...args: any[]): any; - unStar(...args: any[]): any; - unWatch(...args: any[]): any; - update(...args: any[]): any; - updateCommitComment(...args: any[]): any; - updateFile(...args: any[]): any; - updateHook(...args: any[]): any; - updateKey(...args: any[]): any; - watch(...args: any[]): any; -} - -interface Search { - email(...args: any[]): any; - issues(...args: any[]): any; - repos(...args: any[]): any; - users(...args: any[]): any; -} - -interface Statues { - create(...args: any[]): any; - get(...args: any[]): any; - getCombined(...args: any[]): any; -} - -interface User { - user(...args: any[]): any; - addEmails(...args: any[]): any; - createKey(...args: any[]): any; - deleteEmails(...args: any[]): any; - deleteKey(...args: any[]): any; - followUser(...args: any[]): any; - get(...args: any[]): any; - getEmails(...args: any[]): any; - getFollowers(...args: any[]): any; - getFollowing(...args: any[]): any; - getFollowingFromUser(...args: any[]): any; - getFollowingForUser(...args: any[]): any; - getFrom(...args: any[]): any; - getKey(...args: any[]): any; - getKeys(...args: any[]): any; - getKeysFromUser(...args: any[]): any; - getOrgs(...args: any[]): any; - getTeams(...args: any[]): any; - unFollowUser(...args: any[]): any; - update(...args: any[]): any; - updateKey(...args: any[]): any; -} diff --git a/github/tsconfig.json b/github/tsconfig.json deleted file mode 100644 index 34008249b9..0000000000 --- a/github/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "github-tests.ts" - ] -} \ No newline at end of file diff --git a/globule/index.d.ts b/globule/index.d.ts deleted file mode 100644 index 4add1d4461..0000000000 --- a/globule/index.d.ts +++ /dev/null @@ -1,87 +0,0 @@ -// Type definitions for globule 1.1 -// Project: https://github.com/cowboy/node-globule -// Definitions by: Dusan Radovanovic -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -import minimatch = require('minimatch'); -import glob = require('glob'); - -interface FindOptions extends glob.IOptions { - src?: string; - filter?: string | ((filepath?: string, options?: any) => boolean); - nonull?: boolean; - matchBase?: boolean; - srcBase?: string; - prefixBase?: boolean; -} - -interface MappingOptions extends FindOptions { - srcBase?: string; - destBase?: string; - ext?: string; - extDot?: 'first' | 'last'; - flatten?: boolean; - rename?: (p: string) => string; -} - -interface OneMapping { - src: string[]; - dest: string; -} - -interface GlobuleStatic { - /** - * Match one or more globbing patterns against one or more file paths. - * Returns a uniqued array of all file paths that match any of the specified globbing patterns. - */ - match(patterns: string | string[], filepaths: string | string[], options?: minimatch.IOptions): string[]; - - /** - * Tests pattern(s) against against one or more file paths and returns true if any files were matched, otherwise false. - */ - isMatch(patterns: string | string[], filepaths: string | string[], options?: minimatch.IOptions): boolean; - - /** - * Returns a unique array of all file or directory paths that match the given globbing pattern(s) - */ - find(pattern: string | string[], options?: FindOptions): string[]; - - /** - * Returns a unique array of all file or directory paths that match the given globbing pattern(s) - */ - find(options: FindOptions): string[]; - - /** - * Returns a unique array of all file or directory paths that match the given globbing pattern(s) - */ - find(pattern: string | string[], pattern2: string | string[], options?: FindOptions): string[]; - - /** - * Returns a unique array of all file or directory paths that match the given globbing pattern(s) - */ - find(pattern: string, pattern2: string, pattern3: string | string[], options?: FindOptions): string[]; - - /** - * Given a set of source file paths, returns an array of src-dest file mapping objects - */ - mapping(filepaths: string[], options?: MappingOptions): OneMapping[]; - - /** - * Given a set of source file paths, returns an array of src-dest file mapping objects - */ - mapping(options: MappingOptions): OneMapping[]; - - /** - * Given a set of source file paths, returns an array of src-dest file mapping objects - */ - mapping(filepaths: string[], filepaths2: string[], options?: MappingOptions): OneMapping[]; - - /** - * Given a set of source file paths, returns an array of src-dest file mapping objects - */ - mapping(filepaths: string[], filepaths2: string[], filepaths3: string[], options?: MappingOptions): OneMapping[]; -} - -declare var globule: GlobuleStatic; -export = globule; - diff --git a/globule/tslint.json b/globule/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/globule/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/google-protobuf/google-protobuf-tests.ts b/google-protobuf/google-protobuf-tests.ts deleted file mode 100644 index 76d4f19fcc..0000000000 --- a/google-protobuf/google-protobuf-tests.ts +++ /dev/null @@ -1,139 +0,0 @@ -import * as jspb from "google-protobuf"; - -/* This is a typescript version of a simple generated class from a proto file that is shown below. In order to make - this ES5 JS file into TypeScript there have been quite a few modifications, but the same calls are made to the library - classes. - - // FILE: simple.proto - syntax = "proto3"; - - package examplecom; - - message MySimple { - string my_string = 1; - bool my_bool = 2; - repeated string some_labels = 3; - } -*/ - -class MySimple extends jspb.Message { - constructor(opt_data?: any) { - super(); // This isn't actually called in the JS version of this file, but it's required by TS - jspb.Message.initialize(this, opt_data, 0, -1, MySimple.repeatedFields_, null); - }; - - static repeatedFields_ = [3]; - - toObject(opt_includeInstance: boolean): {} { - return MySimple.toObject(opt_includeInstance, this); - }; - - static toObject(includeInstance: boolean, msg: MySimple): {} { - const obj: {} = { - myString: jspb.Message.getFieldWithDefault(msg, 1, ""), - myBool: jspb.Message.getFieldWithDefault(msg, 2, false), - someLabelsList: jspb.Message.getField(msg, 3), - }; - - if (includeInstance) { - // This is commented out because it's not valid in TS, but it's a simple append to an object - // obj['$jspbMessageInstance'] = msg; - } - return obj; - }; - - static deserializeBinary(bytes: Uint8Array) { - const reader = new jspb.BinaryReader(bytes); - const msg = new MySimple(); - return MySimple.deserializeBinaryFromReader(msg, reader); - }; - - static deserializeBinaryFromReader(msg: MySimple, reader: jspb.BinaryReader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - const field = reader.getFieldNumber(); - switch (field) { - case 1: - const value1 = (reader.readString()); - msg.setMyString(value1); - break; - case 2: - const value2 = (reader.readBool()); - msg.setMyBool(value2); - break; - case 3: - const value3 = (reader.readString()); - msg.addSomeLabels(value3); - break; - default: - reader.skipField(); - break; - } - } - return msg; - }; - - serializeBinary(): Uint8Array { - const writer = new jspb.BinaryWriter(); - MySimple.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); - }; - - static serializeBinaryToWriter(message: MySimple, writer: jspb.BinaryWriter) { - let f1 = message.getMyString(); - if (f1.length > 0) { - writer.writeString( - 1, - f1, - ); - } - const f2 = message.getMyBool(); - if (f2) { - writer.writeBool( - 2, - f2, - ); - } - const f3 = message.getSomeLabelsList(); - if (f3.length > 0) { - writer.writeRepeatedString( - 3, - f3, - ); - } - } - - getMyString(): string { - return jspb.Message.getFieldWithDefault(this, 1, ""); - } - - setMyString(value: string) { - jspb.Message.setField(this, 1, value); - } - - getMyBool(): boolean { - return jspb.Message.getFieldWithDefault(this, 2, false); - } - - setMyBool(value: boolean) { - jspb.Message.setField(this, 2, value); - } - - getSomeLabelsList(): string[] { - return jspb.Message.getField(this, 3); - } - - setSomeLabelsList(value: string[]) { - jspb.Message.setField(this, 3, value || []); - } - - addSomeLabels(value: string, opt_index?: number) { - jspb.Message.addToRepeatedField(this, 3, value, opt_index); - } - - clearSomeLabelsList() { - this.setSomeLabelsList([]); - } -} diff --git a/google-protobuf/index.d.ts b/google-protobuf/index.d.ts deleted file mode 100644 index cf6a7e218a..0000000000 --- a/google-protobuf/index.d.ts +++ /dev/null @@ -1,687 +0,0 @@ -// Type definitions for google-protobuf 3.2 -// Project: https://github.com/google/google-protobuf -// Definitions by: Marcus Longmuir -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -type ByteSource = ArrayBuffer|Uint8Array|number[]|string; -type ScalarFieldType = boolean|number|string; -type RepeatedFieldType = ScalarFieldType[] | Uint8Array[]; -type AnyFieldType = ScalarFieldType | RepeatedFieldType | Uint8Array; -type FieldValue = (string|number|boolean|Uint8Array|any/*This should be Array, but that isn't allowed*/|undefined) - -export abstract class Message { - getJsPbMessageId(): (string | undefined); - static initialize(msg: Message, - data: Message.MessageArray, - messageId: (string | number), - suggestedPivot: number, - repeatedFields: number[], - oneofFields?: number[][] | null): void; - static toObjectList(field: T[], - toObjectFn: (includeInstance: boolean, - data: T) => {}, - includeInstance?: boolean): {}[]; - static toObjectExtension(msg: Message, - obj: {}, - extensions: {[key: number]: ExtensionFieldInfo}, - getExtensionFn: (fieldInfo: ExtensionFieldInfo) => Message, - includeInstance?: boolean): void; - serializeBinaryExtensions(proto: Message, - writer: BinaryWriter, - extensions: {[key: number]: ExtensionFieldBinaryInfo}, - getExtensionFn: (fieldInfo: ExtensionFieldInfo) => T): void - readBinaryExtension(proto: Message, - reader: BinaryReader, - extensions: {[key: number]: ExtensionFieldBinaryInfo}, - setExtensionFn: (fieldInfo: ExtensionFieldInfo, - val: T) => void): void - static getField(msg: Message, - fieldNumber: number): FieldValue|null; - static getOptionalFloatingPointField(msg: Message, - fieldNumber: number): (number | undefined); - static getRepeatedFloatingPointField(msg: Message, - fieldNumber: number): number[]; - static bytesAsB64(bytes: Uint8Array): string; - static bytesAsU8(str: string): Uint8Array; - static bytesListAsB64(bytesList: Uint8Array[]): string[]; - static bytesListAsU8(strList: string[]): Uint8Array[]; - static getFieldWithDefault(msg: Message, - fieldNumber: number, - defaultValue: T): T; - static getMapField(msg: Message, - fieldNumber: number, - noLazyCreate: boolean, - valueCtor: typeof Message): Map; - static setField(msg: Message, - fieldNumber: number, - value: FieldValue): void; - static addToRepeatedField(msg: Message, - fieldNumber: number, - value: any, - index?: number): void; - static setOneofField(msg: Message, - fieldNumber: number, - oneof: number[], - value: FieldValue): void; - static computeOneofCase(msg: Message, - oneof: number[]): number; - static getWrapperField(msg: Message, - ctor: typeof Message, - fieldNumber: number, - required?: number): Message; - static getRepeatedWrapperField(msg: Message, - ctor: typeof Message, - fieldNumber: number): Message[]; - static setWrapperField(msg: Message, - fieldNumber: number, - value?: (Message|Map)): void; - static setOneofWrapperField(msg: Message, - fieldNumber: number, - oneof: number[], - value: any): void; - static setRepeatedWrapperField(msg: Message, - fieldNumber: number, - value: any): void; - static addToRepeatedWrapperField(msg: Message, - fieldNumber: number, - value: any, - ctor: typeof Message, - index: number): any; - static toMap(field: any[], - mapKeyGetterFn: (field: any) => string, - toObjectFn?: Message.StaticToObject, - includeInstance?: boolean): void; - toArray(): Message.MessageArray; - toString(): string; - getExtension(fieldInfo: ExtensionFieldInfo): T; - setExtension(fieldInfo: ExtensionFieldInfo, - value: T): void; - static difference(m1: T, - m2: T): T; - static equals(m1: Message, - m2: Message): boolean; - static compareExtensions(extension1: {}, - extension2: {}): boolean; - static compareFields(field1: any, - field2: any): boolean; - cloneMessage(): Message; - clone(): Message; - static clone(msg: T): T; - static cloneMessage(msg: T): T; - static copyInto(fromMessage: Message, - toMessage: Message): void; - static registerMessageType(id: number, - constructor: typeof Message): void; - - abstract serializeBinary(): Uint8Array; - abstract toObject(includeInstance?: boolean): {}; - - // These are `abstract static`, but that isn't allowed. Subclasses of Message will have these methods and properties - // and not having them on Message makes using this class for its intended purpose quite difficult. - static deserializeBinary(bytes: Uint8Array): Message; - static deserializeBinaryFromReader(message: Message, reader: BinaryReader): Message; - static serializeBinaryToWriter(message: Message, writer: BinaryWriter): void; - static toObject(includeInstance: boolean, msg: Message): {}; - static extensions: {[key: number]: ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: ExtensionFieldBinaryInfo}; -} - -export namespace Message { - export type MessageArray = any[]; // This type needs to reference itself - interface StaticToObject { - (includeInstance: boolean, - msg: Message): {}; - } -} - -export class ExtensionFieldInfo { - fieldIndex: number; - fieldName: number; - ctor: typeof Message; - toObjectFn: Message.StaticToObject; - isRepeated: number; - constructor(fieldIndex: number, - fieldName: {[key: string]: number}, - ctor: typeof Message, - toObjectFn: Message.StaticToObject, - isRepeated: number); - isMessageType(): boolean; -} - -export class ExtensionFieldBinaryInfo { - fieldInfo: ExtensionFieldInfo; - binaryReaderFn: BinaryRead; - binaryWriterFn: BinaryWrite; - opt_binaryMessageSerializeFn: (msg: Message, - writer: BinaryWriter) => void; - opt_binaryMessageDeserializeFn: (msg: Message, - reader: BinaryReader) => Message; - opt_isPacked: boolean; - constructor(fieldInfo: ExtensionFieldInfo, - binaryReaderFn: BinaryRead, - binaryWriterFn: BinaryWrite, - opt_binaryMessageSerializeFn: (msg: Message, - writer: BinaryWriter) => void, - opt_binaryMessageDeserializeFn: (msg: Message, - reader: BinaryReader) => Message, - opt_isPacked: boolean); -} - -export class Map { - constructor(arr: Array<[K, V]>, - valueCtor?: {new(init: any): V}); - toArray(): Array<[K, V]>; - toObject(includeInstance: boolean, - valueToObject: (includeInstance: boolean) => any): Array<[K, V]>; - static fromObject(entries: Array<[K, V]>, - valueCtor: any, - valueFromObject: any): Map; - getLength(): number; - clear(): void; - del(key: K): boolean; - getEntryList(): Array<[K, V]>; - entries(): Map.Iterator<[K, V]>; - keys(): Map.Iterator; - forEach(callback: (entry: V, - key: K) => void, - thisArg?: {}): void; - set(key: K, - value: V): void; - get(key: K): (V | undefined); - has(key: K): boolean; -} - -export namespace Map { - // This is implemented by jspb.Map.ArrayIteratorIterable_, but that class shouldn't be exported - interface Iterator { - next(): IteratorResult; - } - type IteratorResult = { - done: boolean, - value: T, - } -} - -interface BinaryReadReader { - (msg: any, - binaryReader: BinaryReader): void; -} - -interface BinaryRead { - (msg: any, - reader: BinaryReadReader): void; -} - -interface BinaryWriteCallback { - (value: any, - binaryWriter: BinaryWriter): void; -} - -interface BinaryWrite { - (fieldNumber: number, - value: any, - writerCallback: BinaryWriteCallback): void; -} - -export class BinaryReader { - constructor(bytes?: ByteSource, - start?: number, - length?: number); - static alloc(bytes?: ByteSource, - start?: number, - length?: number): BinaryReader; - alloc(bytes?: ByteSource, - start?: number, - length?: number): BinaryReader; - free(): void; - getFieldCursor(): number; - getCursor(): number; - getBuffer(): Uint8Array; - getFieldNumber(): number; - getWireType(): BinaryConstants.WireType; - isEndGroup(): boolean; - getError(): boolean; - setBlock(bytes?: ByteSource, - start?: number, - length?: number): void; - reset(): void; - advance(count: number): void; - nextField(): boolean; - unskipHeader(): void; - skipMatchingFields(): void; - skipVarintField(): void; - skipDelimitedField(): void; - skipFixed32Field(): void; - skipFixed64Field(): void; - skipGroup(): void; - skipField(): void; - registerReadCallback(callbackName: string, - callback: (binaryReader: BinaryReader) => any): void; - runReadCallback(callbackName: string): any; - readAny(fieldType: BinaryConstants.FieldType): AnyFieldType; - readMessage: BinaryRead; - readGroup(field: number, - message: Message, - reader: BinaryReadReader): void; - getFieldDecoder(): BinaryDecoder; - readInt32(): number; - readInt32String(): string; - readInt64(): number; - readInt64String(): string; - readUint32(): number; - readUint32String(): string; - readUint64(): number; - readUint64String(): string; - readSint32(): number; - readSint64(): number; - readSint64String(): string; - readFixed32(): number; - readFixed64(): number; - readFixed64String(): string; - readSfixed32(): number; - readSfixed32String(): string; - readSfixed64(): number; - readSfixed64String(): string; - readFloat(): number; - readDouble(): number; - readBool(): boolean; - readEnum(): number; - readString(): string; - readBytes(): Uint8Array; - readVarintHash64(): string; - readFixedHash64(): string; - readPackedInt32(): number[]; - readPackedInt32String(): string[]; - readPackedInt64(): number[]; - readPackedInt64String(): string[]; - readPackedUint32(): number[]; - readPackedUint32String(): string[]; - readPackedUint64(): number[]; - readPackedUint64String(): string[]; - readPackedSint32(): number[]; - readPackedSint64(): number[]; - readPackedSint64String(): string[]; - readPackedFixed32(): number[]; - readPackedFixed64(): number[]; - readPackedFixed64String(): string[]; - readPackedSfixed32(): number[]; - readPackedSfixed64(): number[]; - readPackedSfixed64String(): string[]; - readPackedFloat(): number[]; - readPackedDouble(): number[]; - readPackedBool(): boolean[]; - readPackedEnum(): number[]; - readPackedVarintHash64(): string[]; - readPackedFixedHash64(): string[]; -} - -export class BinaryWriter { - constructor(); - writeSerializedMessage(bytes: Uint8Array, - start: number, - end: number): void; - maybeWriteSerializedMessage(bytes?: Uint8Array, - start?: number, - end?: number): void; - reset(): void; - getResultBuffer(): Uint8Array; - getResultBase64String(): string; - beginSubMessage(field: number): void; - endSubMessage(field: number): void; - writeAny(fieldType: BinaryConstants.FieldType, - field: number, - value: AnyFieldType): void; - writeInt32(field: number, - value?: number): void; - writeInt32String(field: number, - value?: string): void; - writeInt64(field: number, - value?: number): void; - writeInt64String(field: number, - value?: string): void; - writeUint32(field: number, - value?: number): void; - writeUint32String(field: number, - value?: string): void; - writeUint64(field: number, - value?: number): void; - writeUint64String(field: number, - value?: string): void; - writeSint32(field: number, - value?: number): void; - writeSint64(field: number, - value?: number): void; - writeSint64String(field: number, - value?: string): void; - writeFixed32(field: number, - value?: number): void; - writeFixed64(field: number, - value?: number): void; - writeFixed64String(field: number, - value?: string): void; - writeSfixed32(field: number, - value?: number): void; - writeSfixed64(field: number, - value?: number): void; - writeSfixed64String(field: number, - value?: string): void; - writeFloat(field: number, - value?: number): void; - writeDouble(field: number, - value?: number): void; - writeBool(field: number, - value?: boolean): void; - writeEnum(field: number, - value?: number): void; - writeString(field: number, - value?: string): void; - writeBytes(field: number, - value?: ByteSource): void; - writeMessage: BinaryWrite; - writeGroup(field: number, - value: any, - writeCallback: BinaryWriteCallback): void; - writeFixedHash64(field: number, - value?: string): void; - writeVarintHash64(field: number, - value?: string): void; - writeRepeatedInt32(field: number, - value?: number[]): void; - writeRepeatedInt32String(field: number, - value?: string[]): void; - writeRepeatedInt64(field: number, - value?: number[]): void; - writeRepeatedInt64String(field: number, - value?: string[]): void; - writeRepeatedUint32(field: number, - value?: number[]): void; - writeRepeatedUint32String(field: number, - value?: string[]): void; - writeRepeatedUint64(field: number, - value?: number[]): void; - writeRepeatedUint64String(field: number, - value?: string[]): void; - writeRepeatedSint32(field: number, - value?: number[]): void; - writeRepeatedSint64(field: number, - value?: number[]): void; - writeRepeatedSint64String(field: number, - value?: string[]): void; - writeRepeatedFixed32(field: number, - value?: number[]): void; - writeRepeatedFixed64(field: number, - value?: number[]): void; - writeRepeatedFixed64String(field: number, - value?: string[]): void; - writeRepeatedSfixed32(field: number, - value?: number[]): void; - writeRepeatedSfixed64(field: number, - value?: number[]): void; - writeRepeatedSfixed64String(field: number, - value?: string[]): void; - writeRepeatedFloat(field: number, - value?: number[]): void; - writeRepeatedDouble(field: number, - value?: number[]): void; - writeRepeatedBool(field: number, - value?: boolean[]): void; - writeRepeatedEnum(field: number, - value?: number[]): void; - writeRepeatedString(field: number, - value?: string[]): void; - writeRepeatedBytes(field: number, - value?: ByteSource[]): void; - writeRepeatedMessage(field: number, - value: Message[], - writerCallback: BinaryWriteCallback): void; - writeRepeatedGroup(field: number, - value: Message[], - writerCallback: BinaryWriteCallback): void; - writeRepeatedFixedHash64(field: number, - value?: string[]): void; - writeRepeatedVarintHash64(field: number, - value?: string[]): void; - writePackedInt32(field: number, - value?: number[]): void; - writePackedInt32String(field: number, - value?: string[]): void; - writePackedInt64(field: number, - value?: number[]): void; - writePackedInt64String(field: number, - value?: string[]): void; - writePackedUint32(field: number, - value?: number[]): void; - writePackedUint32String(field: number, - value?: string[]): void; - writePackedUint64(field: number, - value?: number[]): void; - writePackedUint64String(field: number, - value?: string[]): void; - writePackedSint32(field: number, - value?: number[]): void; - writePackedSint64(field: number, - value?: number[]): void; - writePackedSint64String(field: number, - value?: string[]): void; - writePackedFixed32(field: number, - value?: number[]): void; - writePackedFixed64(field: number, - value?: number[]): void; - writePackedFixed64String(field: number, - value?: string[]): void; - writePackedSfixed32(field: number, - value?: number[]): void; - writePackedSfixed64(field: number, - value?: number[]): void; - writePackedSfixed64String(field: number, - value?: string[]): void; - writePackedFloat(field: number, - value?: number[]): void; - writePackedDouble(field: number, - value?: number[]): void; - writePackedBool(field: number, - value?: boolean[]): void; - writePackedEnum(field: number, - value?: number[]): void; - writePackedFixedHash64(field: number, - value?: string[]): void; - writePackedVarintHash64(field: number, - value?: string[]): void; -} - -export class BinaryEncoder { - constructor(); - length(): number; - end(): number[]; - writeSplitVarint64(lowBits: number, - highBits: number): void; - writeSplitFixed64(lowBits: number, - highBits: number): void; - writeUnsignedVarint32(value: number): void; - writeSignedVarint32(value: number): void; - writeUnsignedVarint64(value: number): void; - writeSignedVarint64(value: number): void; - writeZigzagVarint32(value: number): void; - writeZigzagVarint64(value: number): void; - writeZigzagVarint64String(value: string): void; - writeUint8(value: number): void; - writeUint16(value: number): void; - writeUint32(value: number): void; - writeUint64(value: number): void; - writeInt8(value: number): void; - writeInt16(value: number): void; - writeInt32(value: number): void; - writeInt64(value: number): void; - writeInt64String(value: string): void; - writeFloat(value: number): void; - writeDouble(value: number): void; - writeBool(value: boolean): void; - writeEnum(value: number): void; - writeBytes(bytes: Uint8Array): void; - writeVarintHash64(hash: string): void; - writeFixedHash64(hash: string): void; - writeString(value: string): number; -} - -export class BinaryDecoder { - constructor(bytes?: ByteSource, - start?: number, - length?: number) - static alloc(bytes?: ByteSource, - start?: number, - length?: number): BinaryDecoder; - free(): void; - clone(): BinaryDecoder; - clear(): void; - getBuffer(): Uint8Array; - setBlock(data: ByteSource, - start?: number, - length?: number): void; - getEnd(): number; - setEnd(end: number): void; - reset(): void; - getCursor(): number; - setCursor(cursor: number): void; - advance(count: number): void; - atEnd(): boolean; - pastEnd(): boolean; - getError(): boolean; - skipVarint(): void; - unskipVarint(value: number): void; - readUnsignedVarint32(): number; - readSignedVarint32(): number; - readUnsignedVarint32String(): number; - readSignedVarint32String(): number; - readZigzagVarint32(): number; - readUnsignedVarint64(): number; - readUnsignedVarint64String(): number; - readSignedVarint64(): number; - readSignedVarint64String(): number; - readZigzagVarint64(): number; - readZigzagVarint64String(): number; - readUint8(): number; - readUint16(): number; - readUint32(): number; - readUint64(): number; - readUint64String(): string; - readInt8(): number; - readInt16(): number; - readInt32(): number; - readInt64(): number; - readInt64String(): string; - readFloat(): number; - readDouble(): number; - readBool(): boolean; - readEnum(): number; - readString(length: number): string; - readStringWithLength(): string; - readBytes(length: number): Uint8Array; - readVarintHash64(): string; - readFixedHash64(): string; -} - -export class BinaryIterator { - constructor(decoder?: BinaryDecoder, - next?: () => number|boolean|string|null, - elements?: Array) - static alloc(decoder?: BinaryDecoder, - next?: () => number|boolean|string|null, - elements?: Array): BinaryIterator; - free(): void; - clear(): void; - get(): (ScalarFieldType | null); - atEnd(): boolean; - next(): (ScalarFieldType | null); -} - -export namespace BinaryConstants { - export enum FieldType { - INVALID = -1, - DOUBLE = 1, - FLOAT = 2, - INT64 = 3, - UINT64 = 4, - INT32 = 5, - FIXED64 = 6, - FIXED32 = 7, - BOOL = 8, - STRING = 9, - GROUP = 10, - MESSAGE = 11, - BYTES = 12, - UINT32 = 13, - ENUM = 14, - SFIXED32 = 15, - SFIXED64 = 16, - SINT32 = 17, - SINT64 = 18, - FHASH64 = 30, - VHASH64 = 31, - } - - export enum WireType { - INVALID = -1, - VARINT = 0, - FIXED64 = 1, - DELIMITED = 2, - START_GROUP = 3, - END_GROUP = 4, - FIXED32 = 5, - } - - const FieldTypeToWireType: (fieldType: FieldType) => WireType; - - const INVALID_FIELD_NUMBER: number; - const FLOAT32_EPS: number; - const FLOAT32_MIN: number; - const FLOAT32_MAX: number; - const FLOAT64_EPS: number; - const FLOAT64_MIN: number; - const FLOAT64_MAX: number; - const TWO_TO_20: number; - const TWO_TO_23: number; - const TWO_TO_31: number; - const TWO_TO_32: number; - const TWO_TO_52: number; - const TWO_TO_63: number; - const TWO_TO_64: number; - const ZERO_HASH: string; -} - -export namespace arith { - export class UInt64 { - lo: number; - hi: number; - constructor(lo: number, - hi: number); - cmp(other: UInt64): number; - rightShift(): UInt64; - leftShift(): UInt64; - msb(): boolean; - lsb(): boolean; - zero(): boolean; - add(other: UInt64): UInt64; - sub(other: UInt64): UInt64; - static mul32x32(a: number, - b: number): UInt64; - mul(a: number): UInt64; - div(divisor: number): [UInt64, UInt64]; - toString(): string; - static fromString(str: string): UInt64; - clone(): UInt64; - } - - export class Int64 { - lo: number; - hi: number; - constructor(lo: number, - hi: number); - add(other: Int64): Int64; - sub(other: Int64): Int64; - clone(): Int64; - toString(): string; - static fromString(str: string): Int64; - } -} - -// jspb.utils package excluded as it likely shouldn't be called by user code \ No newline at end of file diff --git a/google-protobuf/tsconfig.json b/google-protobuf/tsconfig.json deleted file mode 100644 index 269fec20d9..0000000000 --- a/google-protobuf/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "google-protobuf-tests.ts" - ] -} \ No newline at end of file diff --git a/google-protobuf/tslint.json b/google-protobuf/tslint.json deleted file mode 100644 index fdc7cdc370..0000000000 --- a/google-protobuf/tslint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../tslint.json" -} \ No newline at end of file diff --git a/google.analytics/index.d.ts b/google.analytics/index.d.ts deleted file mode 100644 index 0f86e0be40..0000000000 --- a/google.analytics/index.d.ts +++ /dev/null @@ -1,106 +0,0 @@ -// Type definitions for Google Analytics (Classic and Universal) -// Project: https://developers.google.com/analytics/devguides/collection/gajs/, https://developers.google.com/analytics/devguides/collection/analyticsjs/method-reference -// Definitions by: Ronnie Haakon Hegelund , Pat Kujawa -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare class Tracker { - _trackPageview(): void; - _getName(): string; - _getAccount(): string; - _getVersion(): string; - _getVisitorCustomVar(index: number): string; - _setAccount(): string; - _setCustomVar(index: number, name: string, value: string, opt_scope?: number): boolean; - _setSampleRate(newRate: string): void; - _setSessionCookieTimeout(cookieTimeoutMillis: number): void; - _setSiteSpeedSampleRate(sampleRate: number): void; - _setVisitorCookieTimeout(milliseconds: number): void; - _trackPageLoadTime(): void; -} - -interface GoogleAnalyticsCode { - push(commandArray: string[]): void; - push(func: Function): void; -} - -interface GoogleAnalyticsTracker { - _getTracker(account: string): Tracker; - _createTracker(opt_account: string, opt_name?: string): Tracker; - _getTrackerByName(opt_name?: string): Tracker; - _anonymizeIp(): void; -} - -interface GoogleAnalytics { - type: string; - src: string; - async: boolean; -} - -declare namespace 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: '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 { - get(fieldName: string): T; - send(hitType: string, opt_fieldObject?: {}): void; - set(fieldName: string, value: string): void; - set(fieldName: string, value: {}): void; - set(fieldName: string, value: number): void; - set(fieldName: string, value: boolean): void; - } -} - -declare var gaClassic: GoogleAnalytics; -declare var ga: UniversalAnalytics.ga; -declare var _gaq: GoogleAnalyticsCode; -declare var _gat: GoogleAnalyticsTracker; diff --git a/google.analytics/tslint.json b/google.analytics/tslint.json deleted file mode 100644 index e8bc207e33..0000000000 --- a/google.analytics/tslint.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "../tslint.json", - "rules": { - "dt-header": false, - "forbidden-types": false, - "unified-signatures": false - } -} diff --git a/google.picker/index.d.ts b/google.picker/index.d.ts deleted file mode 100644 index 97efc2f2db..0000000000 --- a/google.picker/index.d.ts +++ /dev/null @@ -1,224 +0,0 @@ -// Type definitions for Google Picker API -// Project: https://developers.google.com/picker/ -// Definitions by: grapswiz -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare namespace google { - namespace picker { - export class PickerBuilder { - constructor(); - - // Add a View to the navigation pane. - addView(viewOrId:any):PickerBuilder; - - // Add a ViewGroup to the top-level navigation pane. - addViewGroup(viewGroup:any):PickerBuilder; - - // Disable a picker feature. - disableFeature(feature:string):PickerBuilder; - - // Enable a picker feature. - enableFeature(feature:string):PickerBuilder; - - // Get the relay URL, used for gadgets.rpc. - getRelayUrl():string; - - // Get the dialog title. - getTitle():string; - - // Disable the title bar from being shown. To re-enable, call setTitle with a non-empty title or undefined. - hideTitleBar():PickerBuilder; - - // Check if a picker Feature is enabled. - isFeatureEnabled(feature:string):boolean; - - // Sets the Google Drive App ID needed to allow application to access the user's files via the Google Drive API. - setAppId(appId:string):PickerBuilder; - - // Set the callback method called when the user picks and item (or items), or cancels. The callback method receives a single callback object. The structure of the callback object is described in the JSON Guide. - setCallback(method:Function):PickerBuilder; - - // Sets the Browser API key obtained from Google Developers Console. See the Developer's Guide for details on how to obtain the Browser API key. - setDeveloperKey(key:string):PickerBuilder; - - // Set the document. - setDocument(document:string):PickerBuilder; - - // ISO 639 language code. If the language is not supported, en-US is used. This method provides an alternative to setting the locale at google.load() time. See the Developer's Guide for a list of supported locales. - setLocale(locale:string):PickerBuilder; - - // Sets an OAuth token to use for authenticating the current user. Depending on the scope of the token, only certain views will display data. Valid scopes are Google Docs, Drive, Photos, YouTube. - setOAuthToken(token:string):PickerBuilder; - - // Sets the origin of picker dialog. The origin should be set to the window.location.protocol + '//' + window.location.host of the top-most page, if your application is running in an iframe. - setOrigin(origin:string):PickerBuilder; - - // Set the relay URL, used for gadgets.rpc. - setRelayUrl(url:string):PickerBuilder; - - // Set the list of MIME types which will be selectable. Use commas to separate MIME types if more than one is required. - setSelectableMimeTypes(type:string):PickerBuilder; - - // Set the preferred dialog size. The dialog will be auto-centered. It has a minimum size of (566,350) and a maximum size of (1051,650). - setSize():PickerBuilder; - - // Set the dialog title. - setTitle(title:string):PickerBuilder; - - // Specify an album ID for photo uploads. See Picasa Web Albums Data API documentation for more information about albums. - setUploadToAlbumId(albumId:string):PickerBuilder; - - // Returns the URI generated by this builder. - toUri():string; - - // Construct the Picker object. The Picker object is returned. - build():Picker; - } - - /** - * Picker is the top level object representing the UI action with the user. These objects are not created directly, but instead use the PickerBuilder object. - */ - export interface Picker { - isVisible(): boolean; - setCallback():Picker; - setRelayUrl(url:string):Picker; - setVisible(visible:boolean):Picker; - } - - /** - * Use DocsUploadView to upload documents to Google Drive. - */ - export class DocsUploadView { - constructor(); - - // Allows the user to select a folder in Google Drive to upload to. - setIncludeFolders(included:boolean):DocsUploadView; - - // Sets the upload destination to the specified folder. This overrides ".setIncludeFolders" to false. - setParent(parentId:string):DocsUploadView; - } - - /** - * DocsView is a subclass of View that can be used for Google Drive views. - */ - export class DocsView { - // Constructor. The ViewId must be one of the Google Drive views. Default is ViewId.DOCS. - constructor(viewId?:string); - - // Show folders in the view items. - setIncludeFolders(included:boolean):DocsView; - - // Allows the user to select a folder in Google Drive. - setSelectFolderEnabled(enabled:boolean):DocsView; - - // Selects which mode the view will use to display the documents. - setMode(mode:string):DocsView; - - // Filters the documents based on whether they are owned by the user, or shared with the user. - setOwnedByMe(me?:boolean):DocsView; - - // Sets the initial parent folder to display. - setParent(parentId:string):DocsView; - - // Filters the documents based on whether they are starred by the user. - setStarred(starred:boolean):DocsView; - } - - /** - * DocsViewMode is an enumerated type for displaying data within a DocsView. Use these values in calls to DocsView.setMode. - */ - export var DocsViewMode:{ - // Display documents in a thumbnail grid. - GRID: string; - // Display documents in a detailed list. - LIST: string; - }; - - export var Feature:{ - // Show only documents owned by the user when showing items from Google Drive. - MINE_ONLY: string; - - // Allow user to choose more than one item. - MULTISELECT_ENABLED: string; - - // Hide the navigation pane. If the navigation pane is hidden, users can only select from the first view chosen. - NAV_HIDDEN: string; - - // For photo uploads, controls whether per-photo selection (as opposed to per-album) selection is enabled. - SIMPLE_UPLOAD_ENABLED: string; - }; - - export var ViewId:{ - DOCS: string; - DOCS_IMAGES: string; - DOCS_IMAGES_AND_VIDEOS: string; - DOCS_VIDEOS: string; - DOCUMENTS: string; - DRAWINGS: string; - FOLDERS: string; - FORMS: string; - IMAGE_SEARCH: string; - MAPS: string; - PDFS: string; - PHOTOS: string; - PHOTO_ALBUMS: string; - PHOTO_UPLOAD: string; - PRESENTATIONS: string; - RECENTLY_PICKED: string; - SPREADSHEETS: string; - VIDEO_SEARCH: string; - WEBCAM: string; - YOUTUBE: string; - }; - - export var Action:{ - CANCEL: string; - PICKED: string; - }; - - /** - * Document is an enumerated type used to convey information about a specific picked item. Only fields which are relevant to the selected item are returned. This value will be in the Response.DOCUMENTS field in the callback data. - */ - export var Document:{ - ADDRESS_LINES: string; - AUDIENCE: string; - DESCRIPTION: string; - DURATION: string; - EMBEDDABLE_URL: string; - ICON_URL: string; - ID: string; - IS_NEW: string; - LAST_EDITED_UTC: string; - LATITUDE: string; - LONGITUDE: string; - MIME_TYPE: string; - NAME: string; - NUM_CHILDREN: string; - PARENT_ID: string; - PHONE_NUMBERS: string; - SERVICE_ID: string; - THUMBNAILS: string; - TYPE: string; - URL: string; - }; - - /** - * Response is an enumerated type used to convey information about the user's picked items. - */ - export var Response:{ - ACTION: string; - DOCUMENTS: string; - PARENTS: string; - VIEW: string; - }; - - export var Type:{ - ALBUM: string; - DOCUMENT: string; - LOCATION: string; - PHOTO: string; - URL: string; - VIDEO: string; - }; - } -} diff --git a/google.visualization/index.d.ts b/google.visualization/index.d.ts deleted file mode 100644 index 83b08296f8..0000000000 --- a/google.visualization/index.d.ts +++ /dev/null @@ -1,1410 +0,0 @@ -// Type definitions for Google Visualisation Apis -// Project: https://developers.google.com/chart/ -// Definitions by: Dan Ludwig , Gregory Moore , Dan Manastireanu -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare namespace google { - - function load(visualization: string, version: string, packages: any): void; - function setOnLoadCallback(handler: Function): void; - function setOnLoadCallback(handler: () => void): void; - - // https://developers.google.com/chart/interactive/docs/basic_load_libs - namespace charts { - function load(version: string, packages: Object): void; - function setOnLoadCallback(handler: Function): void; - } - - //https://developers.google.com/chart/interactive/docs/reference - namespace visualization { - - export interface ChartSpecs { - chartType: string; - containerId?: string; - options?: Object; - dataTable?: Object; - dataSourceUrl?: string; - query?: string; - refreshInterval?: number; - view?: any; - } - - export interface ErrorEventObject { - id: string; - message: string; - detailedMessage?: string; - options?: any; - } - - //#region ChartWrapper - - // https://developers.google.com/chart/interactive/docs/reference#chartwrapperobject - export class ChartWrapper { - constructor(spec?: ChartSpecs); - draw(container_ref?: HTMLElement): void; - toJSON(): string; - clone():ChartWrapper; - getDataSourceUrl(): string; - getDataTable(): DataTable; - getChartType(): string; - getChartName(): string; - getChart(): any; - getContainerId(): string; - getQuery(): string; - getRefreshInterval(): number; - getOption(key: string, default_val?: string): any; - getOptions(): Object; - getView(): any; - setDataSourceUrl(url: string): void; - setDataTable(table: DataTable): void; - setChartType(type: string): void; - setChartName(name: string): void; - setContainerId(id: string): void; - setQuery(query: string): void; - setRefreshInterval(interval: number): void; - setOption(key: string, value: any): void; - setOptions(options: Object): void; - setView(view_spec: string): void; - } - - //#endregion - //#region DataTable - - // https://developers.google.com/chart/interactive/docs/reference#DataTable - export class DataTable { - constructor(data?: any, version?: any); - addColumn(type: string, label?: string, id?: string): number; - addColumn(descriptionObject: DataTableColumnDescription): number; - addRow(cellObject: DataObjectCell): number; - addRow(cellArray?: any[]): number; - addRows(numberOfEmptyRows: number): number; - addRows(rows: DataObjectCell[][]): number; - addRows(rows: any[][]): number; - clone(): DataTable; - getColumnId(columnIndex: number): string; - getColumnLabel(columnIndex: number): string; - getColumnPattern(columnIndex: number): string; - getColumnProperties(columnIndex: number): Properties; - getColumnProperty(columnIndex: number, name: string): any; - getColumnRange(columnIndex: number): { min: any; max: any }; - getColumnRole(columnIndex: string): string; - getColumnType(columnIndex: number): string; - getDistinctValues(columnIndex: number): any[]; - getFilteredRows(filters: DataTableCellFilter[]): number[]; - getFormattedValue(rowIndex: number, columnIndex: number): string; - getNumberOfColumns(): number; - getNumberOfRows(): number; - getProperty(rowIndex: number, columnIndex: number, name: string): any; - getProperties(rowIndex: number, columnIndex: number): Properties; - getRowProperties(rowIndex: number): Properties; - getRowProperty(rowIndex: number, name: string): Properties; - getSortedRows(sortColumn: number): number[]; - getSortedRows(sortColumn: SortByColumn): number[]; - getSortedRows(sortColumns: number[]): number[]; - getSortedRows(sortColumns: SortByColumn[]): number[]; - getTableProperties(): Properties; - getTableProperty(name: string): any; - getValue(rowIndex: number, columnIndex: number): any; - insertColumn(columnIndex: number, type: string, label?: string, id?: string): void; - insertRows(rowIndex: number, numberOfEmptyRows: number): void; - insertRows(rowIndex: number, rows: DataObjectCell[][]): void; - insertRows(rowIndex: number, rows: any[][]): void; - removeColumn(columnIndex: number): void; - removeColumns(columnIndex: number, numberOfColumns: number): void; - removeRow(rowIndex: number): void; - removeRows(rowIndex: number, numberOfRows: number): void; - setCell(rowIndex: number, columnIndex: number, value?: any, formattedValue?: string, properties?: Properties): void; - setColumnLabel(columnIndex: number, label: string): void; - setColumnProperty(columnIndex: number, name: string, value: any): void; - setColumnProperties(columnIndex: number, properties: Properties): void; - setFormattedValue(rowIndex: number, columnIndex: number, formattedValue: string): void; - setProperty(rowIndex: number, columnIndex: number, name: string, value: any): void; - setProperties(rowIndex: number, columnIndex: number, properties: Properties): void; - setRowProperty(rowIndex: number, name: string, value: any): void; - setRowProperties(rowIndex: number, properties: Properties): void; - setTableProperty(name: string, value: any): void; - setTableProperties(properties: Properties): void; - setValue(rowIndex: number, columnIndex: number, value: any): void; - sort(sortColumn: number): number[]; - sort(sortColumn: SortByColumn): number[]; - sort(sortColumns: number[]): number[]; - sort(sortColumns: SortByColumn[]): number[]; - toJSON(): string; - } - - export interface Properties { - [property: string]: any - } - - export interface SortByColumn { - column: number; - desc: boolean; - } - - export interface DataTableColumnDescription { - type?: string; - label?: string; - id?: string; - role?: string; - pattern?: string; - p?: any; - } - - export interface DataObject { - cols: DataObjectColumn[]; - rows: DataObjectRow[]; - p: any; - } - - export interface DataObjectColumn { - type: string; - id?: string; - label?: string; - pattern?: string; - p?: any; - } - - export interface DataObjectRow { - c: DataObjectCell[]; - p?: any; - } - - export interface DataTableCellFilter { - column: number; - value?: any; - minValue?: any; - maxValue?: any; - } - - export interface DataObjectCell { - v?: any; - f?: string; - p?: any; - } - - export interface DataTableCellValueFilter extends DataTableCellFilter { - value: any; - } - - export interface DataTableCellRangeFilter extends DataTableCellFilter { - minValue?: any; - maxValue?: any; - } - - function arrayToDataTable(data: any[], firstRowIsData?: boolean): DataTable; - - //#endregion - //#region Query - - // https://developers.google.com/chart/interactive/docs/reference#query - export class Query { - constructor(dataSourceUrl: string, options?: QueryOptions); - - abort(): void; - - setRefreshInterval(intervalSeconds: number): void; - setTimeout(timeoutSeconds: number): void; - setQuery(queryString:string): void; - - send(callback: (response: QueryResponse) => void): void; - } - - export interface QueryOptions { - sendMethod?: string, - makeRequestParams?: Object - } - - //#endregion - //#region QueryResponse - - // https://developers.google.com/chart/interactive/docs/reference#queryresponse - export class QueryResponse { - constructor(responseObject: Object); - - getDataTable(): DataTable; - getDetailedMessage(): string; - getMessage(): string; - getReasons(): string[]; - hasWarning(): boolean; - isError(): boolean; - } - - //#endregion - //#region DataView - - // https://developers.google.com/chart/interactive/docs/reference#DataView - export class DataView { - constructor(data: DataTable); - constructor(data: DataView); - - getColumnId(columnIndex: number): String; - getColumnLabel(columnIndex: number): string; - getColumnPattern(columnIndex: number): string; - getColumnProperty(columnIndex: number, name: string): any; - getColumnRange(columnIndex: number): { min: any; max: any }; - getColumnType(columnIndex: number): string; - getDistinctValues(columnIndex: number): any[]; - getFilteredRows(filters: DataTableCellFilter[]): number[]; - getFormattedValue(rowIndex: number, columnIndex: number): string; - getNumberOfColumns(): number; - getNumberOfRows(): number; - getProperty(rowIndex: number, columnIndex: number, name: string): any; - getProperties(rowIndex: number, columnIndex: number): Properties; - getRowProperty(rowIndex: number, name: string): Properties; - getSortedRows(sortColumn: number): number[]; - getSortedRows(sortColumn: SortByColumn): number[]; - getSortedRows(sortColumns: number[]): number[]; - getSortedRows(sortColumns: SortByColumn[]): number[]; - getTableProperty(name: string): any; - getValue(rowIndex: number, columnIndex: number): any; - getTableColumnIndex(viewColumnIndex: number): number; - getTableRowIndex(viewRowIndex: number): number; - getViewColumnIndex(tableColumnIndex: number): number; - getViewColumns(): number[]; - getViewRowIndex(tableRowIndex: number): number; - getViewRows(): number[]; - - hideColumns(columnIndexes: number[]): void; - hideRows(min: number, max: number): void; - hideRows(rowIndexes: number[]): void; - - setColumns(columnIndexes: number[]): void; - setColumns(columnIndexes: ColumnSpec[]): void; - setColumns(columnIndexes: any[]): void; - setRows(min: number, max: number): void; - setRows(rowIndexes: number[]): void; - - toDataTable(): DataTable; - toJSON(): string; - } - - export interface ColumnSpec { - calc: (dataTable: DataTable, row: number) => any; - type: string; - label?: string; - id?: string; - sourceColumn?: number; - properties?: Properties; - role?: string; - } - - //#endregion - //#region GeoChart - - //https://google-developers.appspot.com/chart/interactive/docs/gallery/geochart - export class GeoChart extends ChartBase { - draw(data: DataTable, options: GeoChartOptions): void; - } - - // https://developers.google.com/chart/interactive/docs/gallery/geochart?hl=fr&csw=1#Configuration_Options - export interface GeoChartOptions { - backgroundColor?: any; - colorAxis?: ChartColorAxis; - datalessRegionColor?: string; - displayMode?: string; - enableRegionInteractivity?: boolean; - height?: number; - keepAspectRatio?: boolean; - legend?: ChartLegend; - region?: string; - magnifyingGlass?: GeoChartMagnifyingGlass; - markerOpacity?: number; - resolution?: string; - sizeAxis?: ChartSizeAxis; - tooltip?: ChartTooltip; - width?: number; - } - export interface GeoChartMagnifyingGlass { - enable?: boolean; - zoomFactor?: number; - } - export interface GeoChartRegionClickEvent { - region: string; - } - export interface GeoChartSelection { - row: number; - } - - //#endregion - //#region Common - - export interface ChartAnnotations { - boxStyle?: ChartBoxStyle; - textStyle?: ChartTextStyle; - datum?: ChartStemAndStyle; - domain?: ChartStemAndStyle; - highContrast?: boolean; - stem?: ChartStem; - style?: string; // 'line' or 'point' - } - - export interface ChartBarColumnAnnotations extends ChartAnnotations { - alwaysOutside?: boolean; - } - - export interface ChartStemAndStyle { - stem?: ChartStem; - style?: string; - } - - export interface ChartStem { - color?: string; - length?: number; - } - - export interface ChartBoxStyle { - stroke?: string; - strokeWidth?: number; - rx?: number; - ry?: number; - gradient?: { - color1: string; - color2: string; - x1: string; - y1: string; - x2: string; - y2: string; - useObjectBoundingBoxUnits?: boolean; - } - } - - export interface ChartTextStyle { - fontName?: string; - fontSize?: number; - bold?: boolean; - italic?: boolean; - color?: string; - auraColor?: string; - opacity?: number; - } - - export interface ChartCrosshair { - color?: string; - focused?: { - color?: string; - opacity?: number; - } - opacity?: number; - orientation?: string; - selected?: { - color?: string; - opacity?: number; - } - trigger?: string; - } - - export interface ChartExplorer { - actions?: string[]; - axis?: string; - keepInBounds?: boolean; - maxZoomIn?: number; - maxZoomOut?: number; - zoomDelta?: number; - } - - export interface ChartStroke { - stroke: string; - strokeWidth: number; - fill: string; - } - - export interface ChartArea { - top?: any; - left?: any; - width?: any; - height?: any; - } - - export interface ChartLegend { - alignment?: string; - maxLines?: number; - position?: string; - textStyle?: ChartTextStyle; - numberFormat?: string; - } - - // https://google-developers.appspot.com/chart/interactive/docs/animation - export interface TransitionAnimation { - duration?: number; - easing?: string; // linear, in, out, inAndOut - startup?: boolean; - } - - export interface ChartAxis { - baseline?: number; // This option is only supported for a continuous axis. https://google-developers.appspot.com/chart/interactive/docs/customizing_axes#Terminology - baselineColor?: string; // google's documentation on this is wrong, specifies it as a number. The color of the baseline for the horizontal axis. Can be any HTML color string, for example: 'red' or '#00cc00' - direction?: number; // The direction in which the values along the horizontal axis grow. Specify -1 to reverse the order of the values. - format?: string; // icu pattern set http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details - gridlines?: ChartGridlines; - minorGridlines?: ChartGridlines; - logScale?: boolean; - textPosition?: string; - textStyle?: ChartTextStyle; - ticks?: any[]; - title?: string; - titleTextStyle?: ChartTextStyle; - allowContainerBoundaryTextCufoff?: boolean; - slantedText?: boolean; - slantedTextAngle?: number; - maxAlternation?: number; - maxTextLines?: number; - minTextSpacing?: number; - showTextEvery?: number; - maxValue?: number; - minValue?: number; - viewWindowMode?: string; - viewWindow?: ChartViewWindow; - } - - export interface ChartGridlines { - color?: string; - count?: number; - } - - export interface ChartViewWindow { - max?: number; - min?: number; - } - - export interface ChartTooltip { - isHtml?: boolean; - showColorCode?: boolean; - textStyle?: ChartTextStyle; - trigger?: string; - } - - export interface ChartBoundingBox { - left: number; - top: number; - width: number; - height: number; - } - - export interface ChartColorAxis { - minValue?: number; - maxValue?: number; - values?: number[]; - colors?: string[]; - legend?: ChartLegend; - } - - export interface ChartLayoutInterface { - getBoundingBox(id: string): ChartBoundingBox; - getChartAreaBoundingBox(): ChartBoundingBox; - getHAxisValue(position: number, axisIndex?: number): number; - getVAxisValue(position: number, axisIndex?: number): number; - getXLocation(position: number, axisIndex?: number): number; - getYLocation(position: number, axisIndex?: number): number; - } - - export interface GroupWidth { - groupWidth: any; // number | string - } - - export interface VisualizationSelectionArray { - column?: number; - row?: number; - } - - export interface Candlestick { - hollowIsRising?: boolean; - fallingColor?: ChartStroke; - risingColor?: ChartStroke; - } - - class ChartBase { - constructor(element: Element); - getSelection(): VisualizationSelectionArray[]; - setSelection(selection: VisualizationSelectionArray[]): void; - clearChart(): void; - getImageURI(): string; - } - - class CoreChartBase extends ChartBase { - getBoundingBox(id: string): ChartBoundingBox; - getChartAreaBoundingBox(): ChartBoundingBox; - getChartLayoutInterface(): ChartLayoutInterface; - getHAxisValue(position: number, axisIndex?: number): number; - getVAxisValue(position: number, axisIndex?: number): number; - getXLocation(position: number, axisIndex?: number): number; - getYLocation(position: number, axisIndex?: number): number; - } - - //#endregion - //#region ScatterChart - - // https://google-developers.appspot.com/chart/interactive/docs/gallery/scatterchart - export class ScatterChart extends CoreChartBase { - draw(data: DataTable, options?: ScatterChartOptions): void; - draw(data: DataView, options?: ScatterChartOptions): void; - } - - export interface ScatterChartOptions { - aggregationTarget?: string; - animation?: TransitionAnimation; - annotations?: ChartAnnotations; - axisTitlesPosition?: string; // in, out, none - backgroundColor?: any; - chartArea?: ChartArea; - colors?: string[]; - crosshair?: ChartCrosshair; - curveType?: string; - dataOpacity?: number; - enableInteractivity?: boolean; - explorer?: ChartExplorer; - fontSize?: number; - fontName?: string; - forceIFrame?: boolean; - hAxis?: ChartAxis; - height?: number; - legend?: ChartLegend; - lineWidth?: number; - pointSize?: number; - selectionMode?: string; - series?: any; - theme?: string; - title?: string; - titlePosition?: string; - titleTextStyle?: ChartTextStyle; - tooltip?: ChartTooltip; - vAxis?: ChartAxis; - width?: number; - } - - //#endregion - //#region ColumnChart - - // https://google-developers.appspot.com/chart/interactive/docs/gallery/columnchart - export class ColumnChart extends CoreChartBase { - draw(data: DataTable, options: ColumnChartOptions): void; - draw(data: DataView, options: ColumnChartOptions): void; - } - - // https://google-developers.appspot.com/chart/interactive/docs/gallery/columnchart#Configuration_Options - export interface ColumnChartOptions { - aggregationTarget?: string; - animation?: TransitionAnimation; - annotations?: ChartBarColumnAnnotations; - axisTitlesPosition?: string; // in, out, none - backgroundColor?: any; - bar?: GroupWidth; - chartArea?: ChartArea; - colors?: string[]; - enableInteractivity?: boolean; - focusTarget?: string; - fontSize?: number; - fontName?: string; - hAxis?: ChartAxis; - height?: number; - isStacked?: boolean; - legend?: ChartLegend; - reverseCategories?: boolean; - selectionMode?: string // single / multiple - series?: any; - theme?: string; - title?: string; - titlePosition?: string; - titleTextStyle?: ChartTextStyle; - tooltip?: ChartTooltip; - vAxes?: any; - vAxis?: ChartAxis; - width?: number; - } - - //#endregion - //#region LineChart - - // https://google-developers.appspot.com/chart/interactive/docs/gallery/linechart - export class LineChart extends CoreChartBase { - draw(data: DataTable, options: LineChartOptions): void; - draw(data: DataView, options: LineChartOptions): void; - } - - // https://google-developers.appspot.com/chart/interactive/docs/gallery/linechart#Configuration_Options - export interface LineChartOptions { - aggregationTarget?: string; - animation?: TransitionAnimation; - annotations?: ChartAnnotations; - axisTitlesPosition?: string; - backgroundColor?: any; - chartArea?: ChartArea; - colors?: string[]; - crosshair?: ChartCrosshair; - curveType?: string; - dataOpacity?: number; - enableInteractivity?: boolean; - explorer?: ChartExplorer; - focusTarget?: string; - fontSize?: number; - fontName?: string; - hAxis?: ChartAxis; - height?: number; - interpolateNulls?: boolean; - legend?: ChartLegend; - lineWidth?: number; - orientation?: string; - pointSize?: number; - reverseCategories?: boolean; - selectionMode?: string // single / multiple - series?: any; - theme?: string; - title?: string; - titlePosition?: string; - titleTextStyle?: ChartTextStyle; - tooltip?: ChartTooltip; - vAxes?: any; - vAxis?: ChartAxis; - width?: number; - } - - //#endregion - //#region BarChart - - // https://google-developers.appspot.com/chart/interactive/docs/gallery/barchart#Configuration_Options - export interface BarChartOptions { - aggregationTarget?: string; - animation?: TransitionAnimation; - annotations?: ChartBarColumnAnnotations; - axisTitlesPosition?: string; // in, out, none - backgroundColor?: any; - bar?: GroupWidth; - chartArea?: ChartArea; - colors?: string[]; - dataOpacity?: number; - enableInteractivity?: boolean; - focusTarget?: string; - fontSize?: number; - fontName?: string; - hAxes?: any; - hAxis?: ChartAxis; - height?: number; - isStacked?: boolean; - legend?: ChartLegend; - reverseCategories?: boolean; - series?: any; - theme?: string; - title?: string; - titlePosition?: string; - titleTextStyle?: ChartTextStyle; - tooltip?: ChartTooltip; - vAxes?: any; - vAxis?: ChartAxis; - width?: number; - } - - // https://google-developers.appspot.com/chart/interactive/docs/gallery/barchart - export class BarChart extends CoreChartBase { - draw(data: DataTable, options: BarChartOptions): void; - draw(data: DataView, options: BarChartOptions): void; - } - - //#endregion - //#region Histogram - - // https://google-developers.appspot.com/chart/interactive/docs/gallery/histogram - export class Histogram extends CoreChartBase { - draw(data: DataTable, options: HistogramOptions): void; - draw(data: DataView, options: HistogramOptions): void; - } - - // https://google-developers.appspot.com/chart/interactive/docs/gallery/histogram#Configuration_Options - export interface HistogramOptions { - animation?: TransitionAnimation; - axisTitlesPosition?: string; // in, out, none - backgroundColor?: any; - bar?: GroupWidth; - chartArea?: ChartArea; - colors?: string[]; - dataOpacity?: number; - enableInteractivity?: boolean; - focusTarget?: string; - fontSize?: number; - fontName?: string; - hAxis?: ChartAxis; - histogram?: HistogramHistogramOptions; - height?: number; - interpolateNulls?: boolean; - isStacked?: boolean; - legend?: ChartLegend; - orientation?: string; - reverseCategories?: boolean; - series?: any; - theme?: string; - title?: string; - titlePosition?: string; - titleTextStyle?: ChartTextStyle; - tooltip?: ChartTooltip; - vAxes?: any; - vAxis?: ChartAxis; - width?: number; - } - - export interface HistogramHistogramOptions { - bucketSize?: number; - hideBucketItems?: boolean; - lastBucketPercentile?: number; - } - - //#endregion - //#region AreaChart - - // https://google-developers.appspot.com/chart/interactive/docs/gallery/areachart - export class AreaChart extends CoreChartBase { - draw(data: DataTable, options: AreaChartOptions): void; - draw(data: DataView, options: AreaChartOptions): void; - } - - // https://google-developers.appspot.com/chart/interactive/docs/gallery/areachart#Configuration_Options - export interface AreaChartOptions { - aggregationTarget?: string; - animation?: TransitionAnimation; - annotations?: ChartAnnotations; - areaOpacity?: number; - axisTitlesPosition?: string; - backgroundColor?: any; - chartArea?: ChartArea; - colors?: string[]; - crosshair?: ChartCrosshair; - dataOpacity?: number; - enableInteractivity?: boolean; - explorer?: ChartExplorer; - focusTarget?: string; - fontSize?: number; - fontName?: string; - hAxis?: ChartAxis; - height?: number; - interpolateNulls?: boolean; - isStacked?: boolean; - legend?: ChartLegend; - lineWidth?: number; - orientation?: string; - pointSize?: number; - reverseCategories?: boolean; - selectionMode?: string // single / multiple - series?: any; - theme?: string; - title?: string; - titlePosition?: string; - titleTextStyle?: ChartTextStyle; - tooltip?: ChartTooltip; - vAxes?: any; - vAxis?: ChartAxis; - width?: number; - } - - //#endregion - //#region AnnotationChart - - // https://developers.google.com/chart/interactive/docs/gallery/annotationchart - export class AnnotationChart extends CoreChartBase - { - draw(data: DataTable, options: AnnotationChartOptions): void; - draw(data: DataView, options: AnnotationChartOptions): void; - setVisibleChartRange(start: Date, end: Date): void; - getVisibleChartRange(): {start: Date; end: Date }; - hideDataColumns(columnIndexes: number | number[]): void; - showDataColumns(columnIndexes: number | number[]): void; - } - - // https://developers.google.com/chart/interactive/docs/gallery/annotationchart#Configuration_Options - export interface AnnotationChartOptions - { - allowHtml?: boolean; - allValuesSuffix?: string; - annotationsWidth?: number; - colors?: string[]; - dateFormat?: string; - displayAnnotations?: boolean; - displayAnnotationsFilter?: boolean; - displayDateBarSeparator?: boolean; - displayExactValues?: boolean; - displayLegendDots?: boolean; - displayLegendValues?: boolean; - displayRangeSelector?: boolean; - displayZoomButtons?: boolean; - fill?: number; - legendPosition?: string; - max?: number; - min?: number; - numberFormats?: any; - scaleColumns?: number[]; - scaleFormat?: string; - scaleType?: string; - thickness?: number; - zoomEndTime?: Date; - zoomStartTime?: Date; - } - - //#endregion - //#region SteppedAreaChart - - // https://google-developers.appspot.com/chart/interactive/docs/gallery/areachart - export class SteppedAreaChart extends CoreChartBase { - draw(data: DataTable, options: SteppedAreaChartOptions): void; - draw(data: DataView, options: SteppedAreaChartOptions): void; - } - - // https://google-developers.appspot.com/chart/interactive/docs/gallery/areachart#Configuration_Options - export interface SteppedAreaChartOptions { - aggregationTarget?: string; - animation?: TransitionAnimation; - areaOpacity?: number; - axisTitlesPosition?: string; - backgroundColor?: any; - chartArea?: ChartArea; - colors?: string[]; - connectSteps?: boolean; - enableInteractivity?: boolean; - focusTarget?: string; - fontSize?: number; - fontName?: string; - hAxis?: ChartAxis; - height?: number; - interpolateNulls?: boolean; - isStacked?: boolean; - legend?: ChartLegend; - reverseCategories?: boolean; - selectionMode?: string // single / multiple - series?: any; - theme?: string; - title?: string; - titlePosition?: string; - titleTextStyle?: ChartTextStyle; - tooltip?: ChartTooltip; - vAxes?: any; - vAxis?: ChartAxis; - width?: number; - } - - //#endregion - //#region PieChart - - // https://google-developers.appspot.com/chart/interactive/docs/gallery/piechart - export class PieChart extends CoreChartBase { - draw(data: DataTable, options: PieChartOptions): void; - draw(data: DataView, options: PieChartOptions): void; - } - - // https://google-developers.appspot.com/chart/interactive/docs/gallery/piechart#Configuration_Options - export interface PieChartOptions { - backgroundColor?: any; - chartArea?: ChartArea; - colors?: string[]; - enableInteractivity?: boolean; - fontSize?: number; - fontName?: string; - height?: number; - is3D?: boolean; - legend?: ChartLegend; - pieHole?: number; - pieSliceBorderColor?: string; - pieSliceText?: string; - pieSliceTextStyle?: ChartTextStyle; - pieStartAngle?: number; - reverseCategories?: boolean; - pieResidueSliceColor?: string; - pieResidueSliceLabel?: string; - slices?: any; - sliceVisibilityThreshold?: number; - title?: string; - titleTextStyle?: ChartTextStyle; - tooltip?: ChartTooltip; - width?: number; - } - - //#endregion - //#region BubbleChart - - // https://google-developers.appspot.com/chart/interactive/docs/gallery/scatterchart - export class BubbleChart extends CoreChartBase { - draw(data: DataTable, options?: BubbleChartOptions): void; - draw(data: DataView, options?: BubbleChartOptions): void; - } - - export interface BubbleChartOptions { - animation?: TransitionAnimation; - axisTitlesPosition?: string; // in, out, none - backgroundColor?: any; - bubble?: ChartBubble; - chartArea?: ChartArea; - colors?: string[]; - colorAxis?: ChartColorAxis; - enableInteractivity?: boolean; - explorer?: ChartExplorer; - fontSize?: number; - fontName?: string; - forceIFrame?: boolean; - hAxis?: ChartAxis; - height?: number; - legend?: ChartLegend; - selectionMode?: string; - series?: any; - sizeAxis?: ChartSizeAxis; - sortBubblesBySize?: boolean; - theme?: string; - title?: string; - titlePosition?: string; - titleTextStyle?: ChartTextStyle; - tooltip?: ChartTooltip; - vAxis?: ChartAxis; - width?: number; - } - - export interface ChartBubble { - opacity?: number; - stroke?: string; - textStyle?: ChartTextStyle; - } - - export interface ChartSizeAxis { - maxSize?: number; - maxValue?: number; - minSize?: number; - minValue?: number; - } - - //#endregion - //#region TreeMap - - // https://google-developers.appspot.com/chart/interactive/docs/gallery/treemap - export class TreeMap extends ChartBase { - draw(data: DataTable, options?: TreeMapOptions): void; - draw(data: DataView, options?: TreeMapOptions): void; - goUpAndDraw(): void; - getMaxPossibleDepth(): number; - } - - // https://google-developers.appspot.com/chart/interactive/docs/gallery/treemap#Configuration_Options - export interface TreeMapOptions { - fontColor?: string; - fontFamily?: string; - fontSize?: number; - forceIFrame?: boolean; - headerColor?: string; - headerHeight?: number; - headerHighlightColor?: string; - hintOpacity?: number; - maxColor?: string; - maxDepth?: number; - maxHighlightColor?: string; - maxPostDepth?: number; - maxColorValue?: number; - midColor?: string; - midHighlightColor?: string; - minColor?: string; - minHighlightColor?: string; - minColorValue?: number; - showScale?: boolean; - showTooltips?: boolean; - textStyle?: ChartTextStyle; - title?: string; - titleTextStyle?: ChartTextStyle; - useWeightedAverageForAggregation?: boolean; - } - - //#endregion - //#region Table - - // https://google-developers.appspot.com/chart/interactive/docs/gallery/table - export class Table extends ChartBase { - draw(data: DataTable, options?: TableOptions): void; - draw(data: DataView, options?: TableOptions): void; - } - - // https://google-developers.appspot.com/chart/interactive/docs/gallery/table#Configuration_Options - export interface TableOptions { - allowHtml?: boolean; - alternatingRowStyle?: boolean; - cssClassName?: CssClassNames; - firstRowNumber?: number; - height?: string; - page?: string; - pageSize?: number; - rtlTable?: boolean; - scrollLeftStartPosition?: number; - showRowNumber?: boolean; - sort?: string; - sortAscending?: boolean; - sortColumn?: number; - startPage?: number; - width?: string; - } - - export interface CssClassNames { - headerRow?: string; - tableRow?: string; - oddTableRow?: string; - selectedTableRow?: string; - hoverTableRow?: string; - headerCell?: string; - tableCell?: string; - rowNumberCell?: string; - } - - //#endregion - //#region Timeline - - // https://google-developers.appspot.com/chart/interactive/docs/gallery/timeline - export class Timeline { - constructor(element: Element); - draw(data: DataTable, options?: TimelineOptions): void; - draw(data: DataView, options?: TimelineOptions): void; - clearChart(): void; - } - - // https://google-developers.appspot.com/chart/interactive/docs/gallery/timeline#Configuration_Options - export interface TimelineOptions { - avoidOverlappingGridLines?: boolean; - backgroundColor?: any; - colors?: string[]; - enableInteractivity?: boolean; - forceIFrame?: boolean; - height?: number; - timeline?: { - barLabelStyle?: LabelStyle; - colorByRowLabel?: boolean; - groupByRowLabel?: boolean; - rowLabelStyle?: LabelStyle; - showRowLabels?: boolean; - singleColor?: string; - } - width?: number; - } - - export interface LabelStyle { - color: string; - fontName: string; - fontSize: string; - } - - //#endregion - //#region CandlestickChart - - // https://google-developers.appspot.com/chart/interactive/docs/gallery/candlestickchart - export class CandlestickChart extends CoreChartBase { - draw(data: DataTable, options: CandlestickChartOptions): void; - draw(data: DataView, options: CandlestickChartOptions): void; - } - - // https://google-developers.appspot.com/chart/interactive/docs/gallery/candlestickchart#Configuration_Options - export interface CandlestickChartOptions { - aggregationTarget?: string; - animation?: TransitionAnimation; - axisTitlesPosition?: string; - backgroundColor?: any; - bar?: GroupWidth; - candlestick?: Candlestick; - chartArea?: ChartArea; - colors?: string[]; - enableInteractivity?: boolean; - focusTarget?: string; - fontSize?: number; - fontName?: string; - hAxis?: ChartAxis; - height?: number; - legend?: ChartLegend; - orientation?: string; - reverseCategories?: boolean; - selectionMode?: string // single / multiple - series?: any; - theme?: string; - title?: string; - titlePosition?: string; - titleTextStyle?: ChartTextStyle; - tooltip?: ChartTooltip; - vAxes?: any; - vAxis?: ChartAxis; - width?: number; - } - - //#endregion - //#region ComboChart - - // https://google-developers.appspot.com/chart/interactive/docs/gallery/combochart - export class ComboChart extends CoreChartBase { - draw(data: DataTable, options: ComboChartOptions): void; - draw(data: DataView, options: ComboChartOptions): void; - } - - // https://google-developers.appspot.com/chart/interactive/docs/gallery/combochart#configuration-options - export interface ComboChartOptions { - aggregationTarget?: string; - animation?: TransitionAnimation; - annotations?: ChartAnnotations; - areaOpacity?: number; - axisTitlesPosition?: string; // in, out, none - backgroundColor?: any; - bar?: GroupWidth; - candlestick?: Candlestick; - chartArea?: ChartArea; - colors?: string[]; - crosshair?: ChartCrosshair; - curveType?: string; - dataOpacity?: number; - enableInteractivity?: boolean; - focusTarget?: string; - fontSize?: number; - fontName?: string; - forceIFrame?: boolean; - hAxis?: ChartAxis; - height?: number; - interpolateNulls?: boolean; - isStacked?: boolean; - legend?: ChartLegend; - lineDashStyle?: number[]; - lineWidth?: number; - orientation?: string; - pointShape?: string; - pointSize?: number; - pointsVisible?: boolean; - reverseCategories?: boolean; - selectionMode?: string;// single / multiple - series?: any; - seriesType?: string; - theme?: string; - title?: string; - titlePosition?: string; - titleTextStyle?: ChartTextStyle; - tooltip?: ChartTooltip; - vAxes?: any; - vAxis?: ChartAxis; - width?: number; - } - - //#endregion - //#region Events - - namespace events { - function addListener(visualization: any, eventName: string, callback: Function): any; - function addListener(visualization: any, eventName: string, callback: (...args: any[]) => void): any; - function removeListener(listener: any): void; - function removeAllListeners(visualization: any): void; - function trigger(visualization: any, eventName: string, args?: any): void; - } - - //#endregion - //#region Formatter - - class DefaultFormatter { - /** - * Reformats the data in the specified column. - * - * @param data - A DataTable containing the data to reformat. You cannot use a DataView here. - * @param columnIndex - The zero-based index of the column to format. To format multiple columns, you must call this method multiple times, with different colIndex values. - */ - format(data: DataTable, columnIndex: number): void; - } - - export interface ArrowFormatOptions { - /** - * A number indicating the base value, used to compare against the cell value. If the cell value is higher, the cell will include a green up arrow; if the cell value is lower, it will include a red down arrow; if the same, no arrow. - */ - base?: number; - } - - /** - * Adds an up or down arrow, indicating whether the cell value is above or below a specified value. - */ - export class ArrowFormat extends DefaultFormatter { - constructor(options?: ArrowFormatOptions); - } - - export interface BarFormatOptions { - /** - * A number that is the base value to compare the cell value against. If the cell value is higher, it will be drawn to the right of the base; if lower, it will be drawn to the left. Default value is 0. - */ - base?: number; - /** - * A string indicating the negative value section of bars. Possible values are 'red', 'green' and 'blue'; default value is 'red'. - */ - colorNegative?: string; - /** - * A string indicating the color of the positive value section of bars. Possible values are 'red', 'green' and 'blue'. Default is 'blue'. - */ - colorPositive?: string; - /** - * A boolean indicating if to draw a 1 pixel dark base line when negative values are present. The dark line is there to enhance visual scanning of the bars. Default value is 'false'. - */ - drawZeroLine?: boolean; - /** - * The maximum number value for the bar range. Default value is the highest value in the table. - */ - max?: number; - /** - * The minimum number value for the bar range. Default value is the lowest value in the table. - */ - min?: number; - /** - * If true, shows values and bars; if false, shows only bars. Default value is true. - */ - showValue?: boolean; - /** - * Thickness of each bar, in pixels. Default value is 100. - */ - width?: number; - } - - /** - * Adds a colored bar, the direction and color of which indicates whether the cell value is above or below a specified value. - */ - export class BarFormat extends DefaultFormatter { - constructor(options?: BarFormatOptions); - } - - /** - * Colors a cell according to whether the values fall within a specified range. - */ - export class ColorFormat extends DefaultFormatter { - constructor(); - /** - * Specifies a foreground color and/or background color to a cell, depending on the cell value. Any cell with a value in the specified from—to range will be assigned color and bgcolor. It is important to realize that the range is non-inclusive, because creating a range from 1—1,000 and a second from 1,000— 2,000 will not cover the value 1,000! - * - * @param from - [String, Number, Date, DateTime, or TimeOfDay] The lower boundary (inclusive) of the range, or null. If null, it will match -∞. String boundaries are compared alphabetically against string values. - * @param to - [String, Number, Date, DateTime, or TimeOfDay] The high boundary (non-inclusive) of the range, or null. If null, it will match +∞. String boundaries are compared alphabetically against string values. - * @param color - The color to apply to text in matching cells. Values can be either '#RRGGBB' values or defined color constants, (example: '#FF0000' or 'red'). - * @param bgcolor - The color to apply to the background of matching cells. Values can be either '#RRGGBB' values or defined color constants, (example: '#FF0000' or 'red'). - */ - addRange(from: any, to: any, color: string, bgcolor: string): void; - /** - * Assigns a background color from a range, according to the cell value. The color is scaled to match the cell's value within a range from a lower boundary color to an upper boundary color. Note that this method cannot compare string values, as addRange() can. Tip: Color ranges are often hard for viewers to gauge accurately; the simplest and easiest to read range is from a fully saturated color to white (e.g., #FF0000—FFFFFF). - * - * @param from - [Number, Date, DateTime, or TimeOfDay] The lower boundary (inclusive) of the range, or null. If null, it will match -∞. - * @param to - [Number, Date, DateTime, or TimeOfDay] The higher boundary (non-inclusive) of the range, or null. If null, it will match +∞. - * @param color - The color to apply to text in matching cells. This color is the same for all cells, no matter what their value. - * @param fromBgColor - The background color for cells holding values at the low end of the gradient. Values can be either '#RRGGBB' values or defined color constants, (example: '#FF0000' or 'red'). - * @param toBgColor - The background color for cells holding values at the high end of the gradient. Values can be either '#RRGGBB' values or defined color constants, (example: '#FF0000' or 'red'). - */ - addGradientRange(from: any, to: any, color: string, fromBgColor: string, toBgColor: string): void; - } - - export interface DateFormatOptions { - /** - * A quick formatting option for the date. The following string values are supported, reformatting the date February 28, 2016 as shown: - * - 'short' - Short format: e.g., "2/28/16" - * - 'medium' - Medium format: e.g., "Feb 28, 2016" - * - 'long' - Long format: e.g., "February 28, 2016" - * You cannot specify both formatType and pattern. - */ - formatType?: string; - /** - * A custom format pattern to apply to the value, similar to the ICU date and time format. - * You cannot specify both formatType and pattern. - * @example - * var formatter3 = new google.visualization.DateFormat({pattern: "EEE, MMM d, ''yy"}); - */ - pattern?: string; - /** - * The time zone in which to display the date value. This is a numeric value, indicating GMT + this number of time zones (can be negative). Date object are created by default with the assumed time zone of the computer on which they are created; this option is used to display that value in a different time zone. For example, if you created a Date object of 5pm noon on a computer located in Greenwich, England, and specified timeZone to be -5 (options['timeZone'] = -5, or Eastern Pacific Time in the US), the value displayed would be 12 noon. - */ - timeZone?: number; - } - - /** - * Formats a Date or DateTime value in several different ways, including "January 1, 2009," "1/1/09" and "Jan 1, 2009." - */ - export class DateFormat extends DefaultFormatter { - constructor(options: DateFormatOptions); - /** - * Returns the formatted value of a given value. This method does not require a DataTable. - */ - formatValue(value: Date): string; - } - - export interface NumberFormatOptions { - /** - * A character to use as the decimal marker. The default is a dot (.). - */ - decimalSymbol?: string; - /** - * A number specifying how many digits to display after the decimal. The default is 2. If you specify more digits than the number contains, it will display zeros for the smaller values. Truncated values will be rounded (5 rounded up). - */ - fractionDigits?: number; - /** - * A character to be used to group digits to the left of the decimal into sets of three. Default is a comma (,). - */ - groupingSymbol?: string; - /** - * The text color for negative values. No default value. Values can be any acceptable HTML color value, such as "red" or "#FF0000". - */ - negativeColor?: string; - /** - * A boolean, where true indicates that negative values should be surrounded by parentheses. Default is true. - */ - negativeParens?: boolean; - /** - * A format string. When provided, all other options are ignored, except negativeColor. - * The format string is a subset of the ICU pattern set. For instance, {pattern:'#,###%'} will result in output values "1,000%", "750%", and "50%" for values 10, 7.5, and 0.5. - */ - pattern?: string; - /** - * A string prefix for the value, for example "$". - */ - prefix?: string; - /** - * A string suffix for the value, for example "%". - */ - suffix?: string; - } - - /** - * Formats various aspects of numeric values. - */ - export class NumberFormat extends DefaultFormatter { - constructor(options?: NumberFormatOptions); - /** - * Returns the formatted value of a given value. This method does not require a DataTable. - */ - formatValue(value: number): string; - } - - /** - * Concatenates cell values on the same row into a specified cell, along with arbitrary text. - */ - export class PatternFormat { - /** - * Constructor. - * Does not take an options object. Instead, it takes a string pattern parameter. - * This is a string that describes which column values to put into the destination column, along with any arbitrary text. Embed placeholders in your string to indicate a value from another column to embed. The placeholders are {#}, where # is a the index of a source column to use. The index is an index in the srcColumnIndices array from the format() method below. To include a literal { or } character, escape it like this: \{ or \}. To include a literal \ mark, escape it as \\. - */ - constructor(pattern: string); - /** - * The standard formatting call, with a few additional parameters - * - * @param dataTable - The DataTable on which to operate. - * @param srcColumnIndices - An array of one or more (zero-based) column indices to pull as the sources from the underlying DataTable. This will be used as a data source for the pattern parameter in the constructor. The column numbers do not have to be in sorted order. - * @param opt_dstColumnIndex - The destination column to place the output of the pattern manipulation. If not specified, the first element in srcColumIndices will be used as the destination. - */ - format(dataTable: DataTable, srcColumnIndices: number[], opt_dstColumnIndex?: number): void; - } - - //#endregion - //#region OrgChart - - // https://google-developers.appspot.com/chart/interactive/docs/gallery/orgchart - export class OrgChart extends CoreChartBase { - draw(data: DataTable, options: OrgChartOptions): void; - draw(data: DataView, options: OrgChartOptions): void; - collapse(row: number, collapsed: boolean): void; - getChildrenIndexes(row: number): number[]; - getCollapsedNodes(): number[]; - } - - // https://google-developers.appspot.com/chart/interactive/docs/gallery/orgchart#Configuration_Options - export interface OrgChartOptions { - allowCollapse?: boolean; - allowHtml?: boolean; - color?: string; - nodeClass?: string; - selectedNodeClass?: string; - selectionColor?: string; - /** - * Chart size - * @type {('small'|'medium'|'large')} - * @default 'medium' - */ - size?: string; - } - - //#endregion - } -} diff --git a/googlemaps/index.d.ts b/googlemaps/index.d.ts deleted file mode 100644 index 60e0a92dfc..0000000000 --- a/googlemaps/index.d.ts +++ /dev/null @@ -1,2526 +0,0 @@ -// Type definitions for Google Maps JavaScript API 3.26 -// Project: https://developers.google.com/maps/ -// Definitions by: Folia A/S , Chris Wrench , Kiarash Ghiaseddin , Grant Hutchins , Denis Atyasov -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/* -The MIT License - -Copyright (c) 2012 Folia A/S. http://www.folia.dk - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ - -declare namespace google.maps { - /***** Map *****/ - export class Map extends MVCObject { - constructor(mapDiv: Element|null, opts?: MapOptions); - fitBounds(bounds: LatLngBounds|LatLngBoundsLiteral): void; - getBounds(): LatLngBounds; - getCenter(): LatLng; - getDiv(): Element; - getHeading(): number; - getMapTypeId(): MapTypeId|string; - getProjection(): Projection; - getStreetView(): StreetViewPanorama; - getTilt(): number; - getZoom(): number; - panBy(x: number, y: number): void; - panTo(latLng: LatLng|LatLngLiteral): void; - panToBounds(latLngBounds: LatLngBounds|LatLngBoundsLiteral): void; - setCenter(latlng: LatLng|LatLngLiteral): void; - setHeading(heading: number): void; - setMapTypeId(mapTypeId: MapTypeId|string): void; - setOptions(options: MapOptions): void; - setStreetView(panorama: StreetViewPanorama): void; - setTilt(tilt: number): void; - setZoom(zoom: number): void; - controls: MVCArray[]; //Array> - data: Data; - mapTypes: MapTypeRegistry; - overlayMapTypes: MVCArray; // MVCArray - } - - export interface MapOptions { - /** - * Color used for the background of the Map div. This color will be visible when - * tiles have not yet loaded as the user pans. This option can only be set when - * the map is initialized. - */ - backgroundColor?: string; - /** The initial Map center. Required. */ - center?: LatLng|LatLngLiteral; - /** - * When false, map icons are not clickable. A map icon represents a point of - * interest, also known as a POI. By default map icons are clickable. - */ - clickableIcons?: boolean - /** Enables/disables all default UI. May be overridden individually. */ - disableDefaultUI?: boolean; - /** Enables/disables zoom and center on double click. Enabled by default. */ - disableDoubleClickZoom?: boolean; - /** If false, prevents the map from being dragged. Dragging is enabled by default. */ - draggable?: boolean; - /** - * The name or url of the cursor to display when mousing over a draggable map. - * This property uses the css cursor attribute to change the icon. As with the - * css property, you must specify at least one fallback cursor that is not a URL. - * For example: draggableCursor: 'url(http://www.example.com/icon.png), auto;'. - */ - draggableCursor?: string; - /** - * The name or url of the cursor to display when the map is being dragged. This - * property uses the css cursor attribute to change the icon. As with the css - * property, you must specify at least one fallback cursor that is not a URL. - * For example: draggingCursor: 'url(http://www.example.com/icon.png), auto;'. - */ - draggingCursor?: string; - /** The enabled/disabled state of the Fullscreen control. */ - fullscreenControl?: boolean; - /** The display options for the Fullscreen control. */ - fullscreenControlOptions?: FullscreenControlOptions; - /** - * The heading for aerial imagery in degrees measured clockwise from cardinal - * direction North. Headings are snapped to the nearest available angle for - * which imagery is available. - */ - heading?: number; - /** - * If false, prevents the map from being controlled by the keyboard. Keyboard - * shortcuts are enabled by default. - */ - keyboardShortcuts?: boolean; - /** The initial enabled/disabled state of the Map type control. */ - mapTypeControl?: boolean; - /** The initial display options for the Map type control. */ - mapTypeControlOptions?: MapTypeControlOptions; - /** The initial Map mapTypeId. Defaults to ROADMAP. */ - mapTypeId?: MapTypeId; - /** - * The maximum zoom level which will be displayed on the map. If omitted, or set - * to null, the maximum zoom from the current map type is used instead. Valid - * values: Integers between zero, and up to the supported maximum zoom level. - */ - maxZoom?: number; - /** - * The minimum zoom level which will be displayed on the map. If omitted, or set - * to null, the minimum zoom from the current map type is used instead. Valid - * values: Integers between zero, and up to the supported maximum zoom level. - */ - minZoom?: number; - /** If true, do not clear the contents of the Map div. */ - noClear?: boolean; - overviewMapControl?: boolean; - overviewMapControlOptions?: OverviewMapControlOptions; - /** - * The enabled/disabled state of the Pan control. - * Note: The Pan control is not available in the new set of controls introduced - * in v3.22 of the Google Maps JavaScript API. While using v3.22 and v3.23, you - * can choose to use the earlier set of controls rather than the new controls, - * thus making the Pan control available as part of the old control set. - * See {@link https://developers.google.com/maps/articles/v322-controls-diff|What's New in the v3.22 Map Controls}. - */ - panControl?: boolean; - /** - * The display options for the Pan control. - * Note: The Pan control is not available in the new set of controls introduced - * in v3.22 of the Google Maps JavaScript API. While using v3.22 and v3.23, you - * can choose to use the earlier set of controls rather than the new controls, - * thus making the Pan control available as part of the old control set. - * See {@link https://developers.google.com/maps/articles/v322-controls-diff|What's New in the v3.22 Map Controls}. - */ - panControlOptions?: PanControlOptions; - /** The enabled/disabled state of the Rotate control. */ - rotateControl?: boolean; - /** The display options for the Rotate control. */ - rotateControlOptions?: RotateControlOptions; - /** The initial enabled/disabled state of the Scale control. */ - scaleControl?: boolean; - /** The initial display options for the Scale control. */ - scaleControlOptions?: ScaleControlOptions; - /** If false, disables scrollwheel zooming on the map. The scrollwheel is enabled by default. */ - scrollwheel?: boolean; - /** - * The enabled/disabled state of the sign in control. This option only applies if - * signed_in=true has been passed as a URL parameter in the bootstrap request. - * You may want to use this option to hide the map's sign in control if you have - * provided another way for your users to sign in, such as the Google Sign-In - * button. This option does not affect the visibility of the Google avatar shown - * when the user is already signed in. - */ - signInControl?: boolean; - /** - * A StreetViewPanorama to display when the Street View pegman is dropped on the - * map. If no panorama is specified, a default StreetViewPanorama will be - * displayed in the map's div when the pegman is dropped. - */ - streetView?: StreetViewPanorama; - /** - * The initial enabled/disabled state of the Street View Pegman control. This - * control is part of the default UI, and should be set to false when displaying - * a map type on which the Street View road overlay should not appear - * (e.g. a non-Earth map type). - */ - streetViewControl?: boolean; - /** The initial display options for the Street View Pegman control. */ - streetViewControlOptions?: StreetViewControlOptions; - /** - * Styles to apply to each of the default map types. Note that for - * satellite/hybrid and terrain modes, these styles will only apply to labels - * and geometry. - */ - styles?: MapTypeStyle[]; - /** - * Controls the automatic switching behavior for the angle of incidence of the - * map. The only allowed values are 0 and 45. The value 0 causes the map to - * always use a 0° overhead view regardless of the zoom level and viewport. The - * value 45 causes the tilt angle to automatically switch to 45 whenever 45° - * imagery is available for the current zoom level and viewport, and switch back - * to 0 whenever 45° imagery is not available (this is the default behavior). - * 45° imagery is only available for satellite and hybrid map types, within some - * locations, and at some zoom levels. Note: getTilt returns the current tilt - * angle, not the value specified by this option. Because getTilt and this option - * refer to different things, do not bind() the tilt property; doing so may yield - * unpredictable effects. - */ - tilt?: number; - /** - * The initial Map zoom level. Required. Valid values: Integers between zero, and - * up to the supported maximum zoom level. - */ - zoom?: number; - /** The enabled/disabled state of the Zoom control. */ - zoomControl?: boolean; - /** The display options for the Zoom control. */ - zoomControlOptions?: ZoomControlOptions; - } - - /** - * Identifiers for common MapTypes. Specify these by value, or by using the - * constant's name. For example, 'satellite' or google.maps.MapTypeId.SATELLITE. - */ - export enum MapTypeId { - /** This map type displays a transparent layer of major streets on satellite images. */ - HYBRID, - /** This map type displays a normal street map. */ - ROADMAP, - /** This map type displays satellite images. */ - SATELLITE, - /** This map type displays maps with physical features such as terrain and vegetation. */ - TERRAIN - } - - /***** Controls *****/ - /** Options for the rendering of the map type control. */ - export interface MapTypeControlOptions { - /** IDs of map types to show in the control. */ - mapTypeIds?: (MapTypeId|string)[]; - /** - * Position id. Used to specify the position of the control on the map. - * The default position is TOP_RIGHT. - */ - position?: ControlPosition; - /** Style id. Used to select what style of map type control to display. */ - style?: MapTypeControlStyle; - } - - export enum MapTypeControlStyle { - DEFAULT, - DROPDOWN_MENU, - HORIZONTAL_BAR - } - - export interface OverviewMapControlOptions { - opened?: boolean; - } - - /** Options for the rendering of the pan control. */ - export interface PanControlOptions { - /** - * Position id. Used to specify the position of the control on the map. - * The default position is TOP_LEFT. - */ - position?: ControlPosition; - } - - /** Options for the rendering of the rotate control. */ - export interface RotateControlOptions { - /** - * Position id. Used to specify the position of the control on the map. - * The default position is TOP_LEFT. - */ - position?: ControlPosition; - } - - /** Options for the rendering of the scale control. */ - export interface ScaleControlOptions { - /** Style id. Used to select what style of scale control to display. */ - style?: ScaleControlStyle; - } - - export enum ScaleControlStyle { - DEFAULT - } - - /** Options for the rendering of the Street View pegman control on the map. */ - export interface StreetViewControlOptions { - /** - * Position id. Used to specify the position of the control on the map. The - * default position is embedded within the navigation (zoom and pan) controls. - * If this position is empty or the same as that specified in the - * zoomControlOptions or panControlOptions, the Street View control will be - * displayed as part of the navigation controls. Otherwise, it will be displayed - * separately. - */ - position?: ControlPosition; - } - - /** Options for the rendering of the zoom control. */ - export interface ZoomControlOptions { - /** - * Position id. Used to specify the position of the control on the map. - * The default position is TOP_LEFT. - */ - position?: ControlPosition; - style?: ZoomControlStyle; - } - - export enum ZoomControlStyle { - DEFAULT, - LARGE, - SMALL - } - - /** - * Identifiers used to specify the placement of controls on the map. Controls are - * positioned relative to other controls in the same layout position. Controls that - * are added first are positioned closer to the edge of the map. - */ - export enum ControlPosition { - /** Elements are positioned in the center of the bottom row. */ - BOTTOM_CENTER, - /** - * Elements are positioned in the bottom left and flow towards the middle. - * Elements are positioned to the right of the Google logo. - */ - BOTTOM_LEFT, - /** - * Elements are positioned in the bottom right and flow towards the middle. - * Elements are positioned to the left of the copyrights. - */ - BOTTOM_RIGHT, - /** - * Elements are positioned on the left, above bottom-left elements, and flow upwards. - */ - LEFT_BOTTOM, - /** Elements are positioned in the center of the left side. */ - LEFT_CENTER, - /** - * Elements are positioned on the left, below top-left elements, and flow downwards. - */ - LEFT_TOP, - /** - * Elements are positioned on the right, above bottom-right elements, and flow upwards. - */ - RIGHT_BOTTOM, - /** Elements are positioned in the center of the right side. */ - RIGHT_CENTER, - /** Elements are positioned on the right, below top-right elements, and flow downwards. */ - RIGHT_TOP, - /** Elements are positioned in the center of the top row. */ - TOP_CENTER, - /** Elements are positioned in the top left and flow towards the middle. */ - TOP_LEFT, - /** Elements are positioned in the top right and flow towards the middle. */ - TOP_RIGHT - } - - /***** Data *****/ - export class Data extends MVCObject { - constructor(options?: Data.DataOptions); - add(feature: Data.Feature|Data.FeatureOptions): Data.Feature; - addGeoJson(geoJson: Object, options?: Data.GeoJsonOptions): Data.Feature[]; - contains(feature: Data.Feature): boolean; - forEach(callback: (feature: Data.Feature) => void): void; - getControlPosition(): ControlPosition; - getControls(): string[]; - getDrawingMode(): string; - getFeatureById(id: number|string): Data.Feature; - getMap(): Map; - getStyle(): Data.StylingFunction|Data.StyleOptions; - loadGeoJson(url: string, options?: Data.GeoJsonOptions, callback?: (features: Data.Feature[]) => void): void; - overrideStyle(feature: Data.Feature, style: Data.StyleOptions): void; - remove(feature: Data.Feature): void; - revertStyle(feature?: Data.Feature): void; - setControlPosition(controlPosition: ControlPosition): void; - setControls(controls: string[]): void; - setDrawingMode(drawingMode: string): void; - setMap(map: Map): void; - setStyle(style: Data.StylingFunction|Data.StyleOptions): void; - toGeoJson(callback: (feature: Object) => void): void; - } - - export module Data { - export interface DataOptions { - controlPosition?: ControlPosition; - controls?: string[]; - drawingMode?: string; - featureFactory?: (geometry: Data.Geometry) => Data.Feature; - map?: Map; - style?: Data.StylingFunction|Data.StyleOptions; - } - - export interface GeoJsonOptions { - idPropertyName?: string; - } - - export interface StyleOptions { - clickable?: boolean; - cursor?: string; - draggable?: boolean; - editable?: boolean; - fillColor?: string; - fillOpacity?: number; - icon?: string|Icon|Symbol; - shape?: MarkerShape; - strokeColor?: string; - strokeOpacity?: number; - strokeWeight?: number; - title?: string; - visible?: boolean; - zIndex?: number; - } - - export type StylingFunction = (feature: Data.Feature) => Data.StyleOptions; - - export class Feature { - constructor(options?: Data.FeatureOptions); - forEachProperty(callback: (value: any, name: string) => void): void; - getGeometry(): Data.Geometry; - getId(): number|string; - getProperty(name: string): any; - removeProperty(name: string): void; - setGeometry(newGeometry: Data.Geometry|LatLng|LatLngLiteral): void; - setProperty(name: string, newValue: any): void; - toGeoJson(callback: (feature: Object) => void): void; - } - - export interface FeatureOptions { - geometry?: Data.Geometry|LatLng|LatLngLiteral; - id?: number|string; - properties?: Object; - } - - export class Geometry { - getType(): string; - } - - export class Point extends Data.Geometry { - constructor(latLng: LatLng|LatLngLiteral); - get(): LatLng; - } - - export class MultiPoint extends Data.Geometry { - constructor(elements: (LatLng|LatLngLiteral)[]); - getArray(): LatLng[]; - getAt(n: number): LatLng; - getLength(): number; - } - - export class LineString extends Data.Geometry { - constructor(elements: (LatLng|LatLngLiteral)[]); - getArray(): LatLng[]; - getAt(n: number): LatLng; - getLength(): number; - } - - export class MultiLineString extends Data.Geometry { - constructor(elements: (Data.LineString|(LatLng|LatLngLiteral)[])[]); - getArray(): Data.LineString[]; - getAt(n: number): Data.LineString; - getLength(): number; - } - - export class LinearRing extends Data.Geometry { - constructor(elements: (LatLng|LatLngLiteral)[]); - getArray(): LatLng[]; - getAt(n: number): LatLng; - getLength(): number; - } - - export class Polygon extends Data.Geometry { - constructor(elements: (Data.LinearRing|(LatLng|LatLngLiteral)[])[]); - getArray(): Data.LinearRing[]; - getAt(n: number): Data.LinearRing; - getLength(): number; - } - - export class MultiPolygon extends Data.Geometry { - constructor(elements: (Data.Polygon|(LinearRing|(LatLng|LatLngLiteral)[])[])[]); - getArray(): Data.Polygon[]; - getAt(n: number): Data.Polygon; - getLength(): number; - } - - export class GeometryCollection extends Data.Geometry { - constructor(elements: (Data.Geometry[]|LatLng[]|LatLngLiteral)[]); - getArray(): Data.Geometry[]; - getAt(n: number): Data.Geometry; - getLength(): number; - } - - export interface MouseEvent extends google.maps.MouseEvent { - feature: Data.Feature; - } - - export interface AddFeatureEvent { - feature: Data.Feature; - } - - export interface RemoveFeatureEvent { - feature: Data.Feature; - } - - export interface SetGeometryEvent { - feature: Data.Feature; - newGeometry: Data.Geometry; - oldGeometry: Data.Geometry; - } - - export interface SetPropertyEvent { - feature: Data.Feature; - name: string; - newValue: any; - oldValue: any; - } - - export interface RemovePropertyEvent { - feature: Data.Feature; - name: string; - oldValue: any; - } - } - - /***** Overlays *****/ - export class Marker extends MVCObject { - static MAX_ZINDEX: number; - constructor(opts?: MarkerOptions); - getAnimation(): Animation; - getAttribution(): Attribution; - getClickable(): boolean; - getCursor(): string; - getDraggable(): boolean; - getIcon(): string|Icon|Symbol; - getLabel(): MarkerLabel; - getMap(): Map|StreetViewPanorama; - getOpacity(): number; - getPlace(): Place; - getPosition(): LatLng; - getShape(): MarkerShape; - getTitle(): string; - getVisible(): boolean; - getZIndex(): number; - setAnimation(animation: Animation|null): void; - setAttribution(attribution: Attribution): void; - setClickable(flag: boolean): void; - setCursor(cursor: string): void; - setDraggable(flag: boolean): void; - setIcon(icon: string|Icon|Symbol): void; - setLabel(label: string|MarkerLabel): void; - setMap(map: Map|StreetViewPanorama|null): void; - setOpacity(opacity: number): void; - setOptions(options: MarkerOptions): void; - setPlace(place: Place): void; - setPosition(latlng: LatLng|LatLngLiteral): void; - setShape(shape: MarkerShape): void; - setTitle(title: string): void; - setVisible(visible: boolean): void; - setZIndex(zIndex: number): void; - } - - export interface MarkerOptions { - /** - * The offset from the marker's position to the tip of an InfoWindow - * that has been opened with the marker as anchor. - */ - anchorPoint?: Point; - /** Which animation to play when marker is added to a map. */ - animation?: Animation; - /** - * If true, the marker receives mouse and touch events. - * @default true - */ - clickable?: boolean; - /** Mouse cursor to show on hover. */ - cursor?: string; - /** - * If true, the marker can be dragged. - * @default false - */ - draggable?: boolean; - /** - * Icon for the foreground. - * If a string is provided, it is treated as though it were an Icon with the string as url. - * @type {(string|Icon|Symbol)} - */ - icon?: string|Icon|Symbol; - /** - * Adds a label to the marker. The label can either be a string, or a MarkerLabel object. - * Only the first character of the string will be displayed. - * @type {(string|MarkerLabel)} - */ - label?: string|MarkerLabel; - /** - * Map on which to display Marker. - * @type {(Map|StreetViewPanorama)} - * - */ - map?: Map|StreetViewPanorama; - /** The marker's opacity between 0.0 and 1.0. */ - opacity?: number; - /** - * Optimization renders many markers as a single static element. - * Optimized rendering is enabled by default. - * Disable optimized rendering for animated GIFs or PNGs, or when each - * marker must be rendered as a separate DOM element (advanced usage - * only). - */ - optimized?: boolean; - /** - * Place information, used to identify and describe the place - * associated with this Marker. In this context, 'place' means a - * business, point of interest or geographic location. To allow a user - * to save this place, open an info window anchored on this marker. - * The info window will contain information about the place and an - * option for the user to save it. Only one of position or place can - * be specified. - */ - place?: Place; - /** - * Marker position. Required. - */ - position: LatLng|LatLngLiteral; - /** Image map region definition used for drag/click. */ - shape?: MarkerShape; - /** Rollover text. */ - title?: string; - /** If true, the marker is visible. */ - visible?: boolean; - /** - * All markers are displayed on the map in order of their zIndex, - * with higher values displaying in front of markers with lower values. - * By default, markers are displayed according to their vertical position on screen, - * with lower markers appearing in front of markers further up the screen. - */ - zIndex?: number; - } - - export interface Icon { - /** - * The position at which to anchor an image in correspondence to the - * location of the marker on the map. By default, the anchor is - * located along the center point of the bottom of the image. - */ - anchor?: Point; - /** - * The origin of the label relative to the top-left corner of the icon - * image, if a label is supplied by the marker. By default, the origin - * is located in the center point of the image. - */ - labelOrigin?: Point; - /** - * The position of the image within a sprite, if any. By default, the - * origin is located at the top left corner of the image (0, 0). - */ - origin?: Point; - /** - * The size of the entire image after scaling, if any. Use this - * property to stretch/ shrink an image or a sprite. - */ - scaledSize?: Size; - /** - * The display size of the sprite or image. When using sprites, you - * must specify the sprite size. If the size is not provided, it will - * be set when the image loads. - */ - size?: Size; - /** The URL of the image or sprite sheet. */ - url?: string; - } - - export interface MarkerLabel { - /** The color of the label text. Default color is black. */ - color?: string; - /** The font family of the label text (equivalent to the CSS font-family property). */ - fontFamily?: string; - /** The font size of the label text (equivalent to the CSS font-size property). Default size is 14px. */ - fontSize?: string; - /** The font weight of the label text (equivalent to the CSS font-weight property). */ - fontWeight?: string; - /** The text to be displayed in the label. Only the first character of this string will be shown. */ - text?: string; - } - - export interface MarkerShape { - coords?: number[]; - type?: string; - } - - export interface Symbol { - /** - * The position of the symbol relative to the marker or polyline. - * The coordinates of the symbol's path are translated left and up by the anchor's x and y coordinates respectively. - * By default, a symbol is anchored at (0, 0). - * The position is expressed in the same coordinate system as the symbol's path. - */ - anchor?: Point; - /** - * The symbol's fill color. - * All CSS3 colors are supported except for extended named colors. For symbol markers, this defaults to 'black'. - * For symbols on polylines, this defaults to the stroke color of the corresponding polyline. - */ - fillColor?: string; - /** - * The symbol's fill opacity. - * @default 0 - */ - fillOpacity?: number; - /** - * The symbol's path, which is a built-in symbol path, or a custom path expressed using SVG path notation. Required. - * @type {(SymbolPath|string)} - */ - path?: SymbolPath|string; - /** - * The angle by which to rotate the symbol, expressed clockwise in degrees. - * Defaults to 0. - * A symbol in an IconSequence where fixedRotation is false is rotated relative to the angle of the edge on which it lies. - */ - rotation?: number; - /** - * The amount by which the symbol is scaled in size. - * For symbol markers, this defaults to 1; after scaling, the symbol may be of any size. - * For symbols on a polyline, this defaults to the stroke weight of the polyline; - * after scaling, the symbol must lie inside a square 22 pixels in size centered at the symbol's anchor. - */ - scale?: number; - /** - * The symbol's stroke color. All CSS3 colors are supported except for extended named colors. - * For symbol markers, this defaults to 'black'. - * For symbols on a polyline, this defaults to the stroke color of the polyline. - */ - strokeColor?: string; - /** - * The symbol's stroke opacity. For symbol markers, this defaults to 1. - * For symbols on a polyline, this defaults to the stroke opacity of the polyline. - */ - strokeOpacity?: number; - /** The symbol's stroke weight. Defaults to the scale of the symbol.v*/ - strokeWeight?: number; - } - - /** Built-in symbol paths. */ - export enum SymbolPath { - /** A backward-pointing closed arrow. */ - BACKWARD_CLOSED_ARROW, - /** A backward-pointing open arrow. */ - BACKWARD_OPEN_ARROW, - /** A circle. */ - CIRCLE, - /** A forward-pointing closed arrow. */ - FORWARD_CLOSED_ARROW, - /** A forward-pointing open arrow. */ - FORWARD_OPEN_ARROW - } - - export enum Animation { - BOUNCE, - DROP - } - - /** - * An overlay that looks like a bubble and is often connected to a marker. - * This class extends MVCObject. - */ - export class InfoWindow extends MVCObject { - /** - * Creates an info window with the given options. An InfoWindow can be - * placed on a map at a particular position or above a marker, - * depending on what is specified in the options. Unless auto-pan is - * disabled, an InfoWindow will pan the map to make itself visible - * when it is opened. After constructing an InfoWindow, you must call - * open to display it on the map. The user can click the close button - * on the InfoWindow to remove it from the map, or the developer can - * call close() for the same effect. - */ - constructor(opts?: InfoWindowOptions); - /** Closes this InfoWindow by removing it from the DOM structure. */ - close(): void; - getContent(): string|Element; - getPosition(): LatLng; - getZIndex(): number; - /** - * Opens this InfoWindow on the given map. Optionally, an InfoWindow can be associated with an anchor. - * In the core API, the only anchor is the Marker class. - * However, an anchor can be any MVCObject that exposes a LatLng position property and optionally - * a Point anchorPoint property for calculating the pixelOffset (see InfoWindowOptions). - * The anchorPoint is the offset from the anchor's position to the tip of the InfoWindow. - */ - open(map?: Map|StreetViewPanorama, anchor?: MVCObject): void; - setContent(content: string|Node): void; - setOptions(options: InfoWindowOptions): void; - setPosition(position: LatLng|LatLngLiteral): void; - setZIndex(zIndex: number): void; - } - - export interface InfoWindowOptions { - /** - * Content to display in the InfoWindow. This can be an HTML element, a plain-text string, or a string containing HTML. - * The InfoWindow will be sized according to the content. - * To set an explicit size for the content, set content to be a HTML element with that size. - * @type {(string|Node)} - */ - content?: string|Node; - /** - * Disable auto-pan on open. By default, the info window will pan the map so that it is fully visible when it opens. - */ - disableAutoPan?: boolean; - /** - * Maximum width of the infowindow, regardless of content's width. - * This value is only considered if it is set before a call to open. - * To change the maximum width when changing content, call close, setOptions, and then open. - */ - maxWidth?: number; - /** - * The offset, in pixels, of the tip of the info window from the point on the map - * at whose geographical coordinates the info window is anchored. - * If an InfoWindow is opened with an anchor, the pixelOffset will be calculated from the anchor's anchorPoint property. - */ - pixelOffset?: Size; - /** - * The LatLng at which to display this InfoWindow. If the InfoWindow is opened with an anchor, the anchor's position will be used instead. - */ - position?: LatLng|LatLngLiteral; - /** - * All InfoWindows are displayed on the map in order of their zIndex, - * with higher values displaying in front of InfoWindows with lower values. - * By default, InfoWindows are displayed according to their latitude, - * with InfoWindows of lower latitudes appearing in front of InfoWindows at higher latitudes. - * InfoWindows are always displayed in front of markers. - */ - zIndex?: number; - } - - export class Polyline extends MVCObject { - constructor(opts?: PolylineOptions); - getDraggable(): boolean; - getEditable(): boolean; - getMap(): Map; - getPath(): MVCArray; // MVCArray - getVisible(): boolean; - setDraggable(draggable: boolean): void; - setEditable(editable: boolean): void; - setMap(map: Map): void; - setOptions(options: PolylineOptions): void; - setPath(path: MVCArray|LatLng[]|LatLngLiteral[]): void; // MVCArray|Array - setVisible(visible: boolean): void; - } - - export interface PolylineOptions { - clickable?: boolean; - draggable?: boolean; - editable?: boolean; - geodesic?: boolean; - icons?: IconSequence[]; - map?: Map; - path?: MVCArray|LatLng[]|LatLngLiteral[]; // MVCArray|Array - strokeColor?: string; - strokeOpacity?: number; - strokeWeight?: number; - visible?: boolean; - zIndex?: number; - } - - export interface IconSequence { - fixedRotation?: boolean; - icon?: Symbol; - offset?: string; - repeat?: string; - } - - export class Polygon extends MVCObject { - constructor(opts?: PolygonOptions); - getDraggable(): boolean; - getEditable(): boolean; - getMap(): Map; - getPath(): MVCArray; // MVCArray - getPaths(): MVCArray; // MVCArray> - getVisible(): boolean; - setDraggable(draggable: boolean): void; - setEditable(editable: boolean): void; - setMap(map: Map): void; - setOptions(options: PolygonOptions): void; - setPath(path: MVCArray|LatLng[]|LatLngLiteral[]): void; - setPaths(paths: MVCArray): void; - setPaths(paths: MVCArray[]): void; - setPaths(path: LatLng[]): void; - setPaths(path: LatLng[][]): void; - setPaths(path: LatLngLiteral[]): void; - setPaths(path: LatLngLiteral[][]): void; - setVisible(visible: boolean): void; - } - - export interface PolygonOptions { - /** Indicates whether this Polygon handles mouse events. Defaults to true. */ - clickable?: boolean; - /** - * If set to true, the user can drag this shape over the map. - * The geodesic property defines the mode of dragging. Defaults to false. - */ - draggable?: boolean; - /** - * If set to true, the user can edit this shape by dragging the control points - * shown at the vertices and on each segment. Defaults to false. - */ - editable?: boolean; - /** The fill color. All CSS3 colors are supported except for extended named colors. */ - fillColor?: string; - /** The fill opacity between 0.0 and 1.0 */ - fillOpacity?: number; - /** - * When true, edges of the polygon are interpreted as geodesic and will follow - * the curvature of the Earth. When false, edges of the polygon are rendered as - * straight lines in screen space. Note that the shape of a geodesic polygon may - * appear to change when dragged, as the dimensions are maintained relative to - * the surface of the earth. Defaults to false. - */ - geodesic?: boolean; - /** Map on which to display Polygon. */ - map?: Map; - /** - * The ordered sequence of coordinates that designates a closed loop. Unlike - * polylines, a polygon may consist of one or more paths. As a result, the paths - * property may specify one or more arrays of LatLng coordinates. Paths are - * closed automatically; do not repeat the first vertex of the path as the last - * vertex. Simple polygons may be defined using a single array of LatLngs. More - * complex polygons may specify an array of arrays. Any simple arrays are - * converted into MVCArrays. Inserting or removing LatLngs from the MVCArray - * will automatically update the polygon on the map. - */ - paths?: any[]; // MVCArray>|MVCArray|Array>|Array - /** - * The stroke color. - * All CSS3 colors are supported except for extended named colors. - */ - strokeColor?: string; - /** The stroke opacity between 0.0 and 1.0 */ - strokeOpacity?: number; - /** - * The stroke position. Defaults to CENTER. - * This property is not supported on Internet Explorer 8 and earlier. - */ - strokePosition?: StrokePosition; - /** The stroke width in pixels. */ - strokeWeight?: number; - /** Whether this polygon is visible on the map. Defaults to true. */ - visible?: boolean; - /** The zIndex compared to other polys. */ - zIndex?: number; - } - - export interface PolyMouseEvent extends MouseEvent { - edge?: number; - path?: number; - vertex?: number; - } - - export class Rectangle extends MVCObject { - constructor(opts?: RectangleOptions); - getBounds(): LatLngBounds; - getDraggable(): boolean; - getEditable(): boolean; - getMap(): Map; - getVisible(): boolean; - setBounds(bounds: LatLngBounds|LatLngBoundsLiteral): void; - setDraggable(draggable: boolean): void; - setEditable(editable: boolean): void; - setMap(map: Map): void; - setOptions(options: RectangleOptions): void; - setVisible(visible: boolean): void; - } - - export interface RectangleOptions { - bounds?: LatLngBounds | LatLngBoundsLiteral; - clickable?: boolean; - draggable?: boolean; - editable?: boolean; - fillColor?: string; - fillOpacity?: number; - map?: Map; - strokeColor?: string; - strokeOpacity?: number; - strokePosition?: StrokePosition; - strokeWeight?: number; - visible?: boolean; - zIndex?: number; - } - - export class Circle extends MVCObject { - constructor(opts?: CircleOptions); - getBounds(): LatLngBounds; - getCenter(): LatLng; - getDraggable(): boolean; - getEditable(): boolean; - getMap(): Map; - getRadius(): number; - getVisible(): boolean; - setCenter(center: LatLng|LatLngLiteral): void; - setDraggable(draggable: boolean): void; - setEditable(editable: boolean): void; - setMap(map: Map): void; - setOptions(options: CircleOptions): void; - setRadius(radius: number): void; - setVisible(visible: boolean): void; - } - - export interface CircleOptions { - center?: LatLng; - clickable?: boolean; - draggable?: boolean; - editable?: boolean; - fillColor?: string; - fillOpacity?: number; - map?: Map; - radius?: number; - strokeColor?: string; - strokeOpacity?: number; - strokePosition?: StrokePosition; - strokeWeight?: number; - visible?: boolean; - zIndex?: number; - } - - /** - * The possible positions of the stroke on a polygon. - */ - export enum StrokePosition { - /** - * The stroke is centered on the polygon's path, with half the stroke inside - * the polygon and half the stroke outside the polygon. - */ - CENTER, - /** The stroke lies inside the polygon. */ - INSIDE, - /** The stroke lies outside the polygon. */ - OUTSIDE - } - - export class GroundOverlay extends MVCObject { - constructor(url: string, bounds: LatLngBounds|LatLngBoundsLiteral, opts?: GroundOverlayOptions); - getBounds(): LatLngBounds; - getMap(): Map; - getOpacity(): number; - getUrl(): string; - setMap(map: Map): void; - setOpacity(opacity: number): void; - } - - export interface GroundOverlayOptions { - clickable?: boolean; - map?: Map; - opacity?: number; - } - - export class OverlayView extends MVCObject { - draw(): void; - getMap(): Map|StreetViewPanorama; - getPanes(): MapPanes; - getProjection(): MapCanvasProjection; - onAdd(): void; - onRemove(): void; - setMap(map: Map|StreetViewPanorama): void; - } - - export interface MapPanes { - floatPane: Element; - floatShadow: Element; - mapPane: Element; - markerLayer: Element; - overlayImage: Element; - overlayLayer: Element; - overlayMouseTarget: Element; - overlayShadow: Element; - } - - export class MapCanvasProjection extends MVCObject { - fromContainerPixelToLatLng(pixel: Point, nowrap?: boolean): LatLng; - fromDivPixelToLatLng(pixel: Point, nowrap?: boolean): LatLng; - fromLatLngToContainerPixel(latLng: LatLng): Point; - fromLatLngToDivPixel(latLng: LatLng): Point; - getWorldWidth(): number; - } - - /***** Services *****/ - export class Geocoder { - geocode(request: GeocoderRequest, callback: (results: GeocoderResult[], status: GeocoderStatus) => void ): void; - } - - export interface GeocoderRequest { - address?: string; - bounds?: LatLngBounds|LatLngBoundsLiteral; - componentRestrictions?: GeocoderComponentRestrictions; - location?: LatLng|LatLngLiteral; - placeId?: string; - region?: string; - } - - export interface GeocoderComponentRestrictions { - administrativeArea?: string; - country?: string; - locality?: string; - postalCode?: string; - route?: string; - } - - export enum GeocoderStatus { - ERROR, - INVALID_REQUEST, - OK, - OVER_QUERY_LIMIT, - REQUEST_DENIED, - UNKNOWN_ERROR, - ZERO_RESULTS - } - - export interface GeocoderResult { - address_components: GeocoderAddressComponent[]; - formatted_address: string; - geometry: GeocoderGeometry; - partial_match: boolean; - place_id: string; - postcode_localities: string[]; - types: string[]; - } - - export interface GeocoderAddressComponent { - long_name: string; - short_name: string; - types: string[]; - } - - export interface GeocoderGeometry { - bounds: LatLngBounds; - location: LatLng; - location_type: GeocoderLocationType; - viewport: LatLngBounds; - } - - export enum GeocoderLocationType { - APPROXIMATE, - GEOMETRIC_CENTER, - RANGE_INTERPOLATED, - ROOFTOP - } - - export class DirectionsRenderer extends MVCObject { - constructor(opts?: DirectionsRendererOptions); - getDirections(): DirectionsResult; - getMap(): Map; - getPanel(): Element; - getRouteIndex(): number; - setDirections(directions: DirectionsResult): void; - setMap(map: Map): void; - setOptions(options: DirectionsRendererOptions): void; - setPanel(panel: Element): void; - setRouteIndex(routeIndex: number): void; - } - - export interface DirectionsRendererOptions { - directions?: DirectionsResult; - draggable?: boolean; - hideRouteList?: boolean; - infoWindow?: InfoWindow; - map?: Map; - markerOptions?: MarkerOptions; - panel?: Element; - polylineOptions?: PolylineOptions; - preserveViewport?: boolean; - routeIndex?: number; - suppressBicyclingLayer?: boolean; - suppressInfoWindows?: boolean; - suppressMarkers?: boolean; - suppressPolylines?: boolean; - } - - export class DirectionsService { - route(request: DirectionsRequest, callback: (result: DirectionsResult, status: DirectionsStatus) => void ): void; - } - - export interface DirectionsRequest { - avoidFerries?: boolean; - avoidHighways?: boolean; - avoidTolls?: boolean; - destination?: string|LatLng|Place; - durationInTraffic?: boolean; /* Deprecated. Use drivingOptions field instead */ - drivingOptions?: DrivingOptions; - optimizeWaypoints?: boolean; - origin?: string|LatLng|Place; - provideRouteAlternatives?: boolean; - region?: string; - transitOptions?: TransitOptions; - travelMode?: TravelMode; - unitSystem?: UnitSystem; - waypoints?: DirectionsWaypoint[]; - } - - export enum TravelMode { - BICYCLING, - DRIVING, - TRANSIT, - WALKING - } - - export enum UnitSystem { - IMPERIAL, - METRIC - } - - export interface TransitOptions { - arrivalTime?: Date; - departureTime?: Date; - modes: TransitMode[]; - routingPreference: TransitRoutePreference; - } - - export enum TransitMode { - BUS, - RAIL, - SUBWAY, - TRAIN, - TRAM - } - - export enum TransitRoutePreference - { - FEWER_TRANSFERS, - LESS_WALKING - } - - export interface TransitFare { } - - export interface DrivingOptions { - departureTime: Date; - trafficModel: TrafficModel - } - - export enum TrafficModel - { - BEST_GUESS, - OPTIMISTIC, - PESSIMISTIC - } - - export interface DirectionsWaypoint { - location: LatLng|LatLngLiteral|string; - stopover: boolean; - } - - export enum DirectionsStatus { - INVALID_REQUEST, - MAX_WAYPOINTS_EXCEEDED, - NOT_FOUND, - OK, - OVER_QUERY_LIMIT, - REQUEST_DENIED, - UNKNOWN_ERROR, - ZERO_RESULTS - } - - export interface DirectionsResult { - routes: DirectionsRoute[]; - } - - export interface DirectionsRoute { - bounds: LatLngBounds; - copyrights: string; - fare: TransitFare; - legs: DirectionsLeg[]; - overview_path: LatLng[]; - overview_polyline: string; - warnings: string[]; - waypoint_order: number[]; - } - - export interface DirectionsLeg { - arrival_time: Time; - departure_time: Time; - distance: Distance; - duration: Duration; - duration_in_traffic: Duration; - end_address: string; - end_location: LatLng; - start_address: string; - start_location: LatLng; - steps: DirectionsStep[]; - via_waypoints: LatLng[]; - } - - export interface DirectionsStep { - distance: Distance; - duration: Duration; - end_location: LatLng; - instructions: string; - path: LatLng[]; - start_location: LatLng; - steps: DirectionsStep; - transit: TransitDetails; - travel_mode: TravelMode; - } - - export interface Distance { - text: string; - value: number; - } - - export interface Duration { - text: string; - value: number; - } - - export interface Time { - text: string; - time_zone: string; - value: Date; - } - - export interface TransitDetails { - arrival_stop: TransitStop; - arrival_time: Time; - departure_stop: TransitStop; - departure_time: Time; - headsign: string; - headway: number; - line: TransitLine; - num_stops: number; - } - - export interface TransitStop { - location: LatLng; - name: string; - } - - export interface TransitLine { - agencies: TransitAgency[]; - color: string; - icon: string; - name: string; - short_name: string; - text_color: string; - url: string; - vehicle: TransitVehicle; - } - - export interface TransitAgency { - name: string; - phone: string; - url: string; - } - - export interface TransitVehicle { - icon: string; - local_icon: string; - name: string; - type: VehicleType; - } - - export enum VehicleType - { - BUS, - CABLE_CAR, - COMMUTER_TRAIN, - FERRY, - FUNICULAR, - GONDOLA_LIFT, - HEAVY_RAIL, - HIGH_SPEED_TRAIN, - INTERCITY_BUS, - METRO_RAIL, - MONORAIL, - OTHER, - RAIL, - SHARE_TAXI, - SUBWAY, - TRAM, - TROLLEYBUS - } - - export class ElevationService { - getElevationAlongPath(request: PathElevationRequest, callback: (results: ElevationResult[], status: ElevationStatus) => void ): void; - getElevationForLocations(request: LocationElevationRequest, callback: (results: ElevationResult[], status: ElevationStatus) => void ): void; - } - - export interface LocationElevationRequest { - locations: LatLng[]; - } - - export interface PathElevationRequest { - path?: LatLng[]; - samples?: number; - } - - export interface ElevationResult { - elevation: number; - location: LatLng; - resolution: number; - } - - export enum ElevationStatus { - INVALID_REQUEST, - OK, - OVER_QUERY_LIMIT, - REQUEST_DENIED, - UNKNOWN_ERROR - } - - export class MaxZoomService { - getMaxZoomAtLatLng(latlng: LatLng|LatLngLiteral, callback: (result: MaxZoomResult) => void ): void; - } - - export interface MaxZoomResult { - status: MaxZoomStatus; - zoom: number; - } - - export enum MaxZoomStatus { - ERROR, - OK - } - - export class DistanceMatrixService { - getDistanceMatrix(request: DistanceMatrixRequest, callback: (response: DistanceMatrixResponse, status: DistanceMatrixStatus) => void ): void; - } - - export interface DistanceMatrixRequest { - avoidFerries?: boolean; - avoidHighways?: boolean; - avoidTolls?: boolean; - destinations?: string[]|LatLng[]|Place[]; - drivingOptions?: DrivingOptions; - durationInTraffic?: boolean; - origins?: string[]|LatLng[]|Place[]; - region?: string; - transitOptions?: TransitOptions; - travelMode?: TravelMode; - unitSystem?: UnitSystem; - } - - export interface DistanceMatrixResponse { - destinationAddresses: string[]; - originAddresses: string[]; - rows: DistanceMatrixResponseRow[]; - } - - export interface DistanceMatrixResponseRow { - elements: DistanceMatrixResponseElement[]; - } - - export interface DistanceMatrixResponseElement { - distance: Distance; - duration: Duration; - duration_in_traffic: Duration; - fare: TransitFare; - status: DistanceMatrixElementStatus; - } - - export enum DistanceMatrixStatus { - INVALID_REQUEST, - MAX_DIMENSIONS_EXCEEDED, - MAX_ELEMENTS_EXCEEDED, - OK, - OVER_QUERY_LIMIT, - REQUEST_DENIED, - UNKNOWN_ERROR - } - - export enum DistanceMatrixElementStatus { - NOT_FOUND, - OK, - ZERO_RESULTS - } - - /***** Save to Google Maps *****/ - export interface Attribution { - iosDeepLinkId?: string; - source?: string; - webUrl?: string; - } - - export interface Place { - location?: LatLng|LatLngLiteral; - placeId?: string; - query?: string; - } - - export class SaveWidget { - constructor(container: Node, opts?: SaveWidgetOptions); - getAttribution(): Attribution; - getPlace(): Place; - setAttribution(attribution: Attribution): void; - setOptions(opts: SaveWidgetOptions): void; - setPlace(place: Place): void; - } - - export interface SaveWidgetOptions{ - attribution?: Attribution; - place?: Place; - } - - /***** Map Types *****/ - export interface MapType { - getTile(tileCoord: Point, zoom: number, ownerDocument: Document): Element; - releaseTile(tile: Element): void; - alt?: string; - maxZoom?: number; - minZoom?: number; - name?: string; - projection?: Projection; - radius?: number; - tileSize?: Size; - } - - export class MapTypeRegistry extends MVCObject { - constructor(); - set(id: string, mapType: MapType): void; - } - - export interface Projection { - fromLatLngToPoint(latLng: LatLng, point?: Point): Point; - fromPointToLatLng(pixel: Point, noWrap?: boolean): LatLng; - } - - export class ImageMapType extends MVCObject implements MapType { - constructor(opts: ImageMapTypeOptions); - getOpacity(): number; - getTile(tileCoord: Point, zoom: number, ownerDocument: Document): Element; - releaseTile(tile: Element): void; - setOpacity(opacity: number): void; - } - - export interface ImageMapTypeOptions { - alt?: string; - getTileUrl(tileCoord: Point, zoom: number): string; - maxZoom?: number; - minZoom?: number; - name?: string; - opacity?: number; - tileSize?: Size; - } - - export class StyledMapType extends MVCObject implements MapType { - constructor(styles: MapTypeStyle[], options?: StyledMapTypeOptions); - getTile(tileCoord: Point, zoom: number, ownerDocument: Document): Element; - releaseTile(tile: Element): void; - } - - export interface StyledMapTypeOptions { - alt?: string; - maxZoom?: number; - minZoom?: number; - name?: string; - } - - export interface MapTypeStyle { - elementType?: MapTypeStyleElementType; - featureType?: MapTypeStyleFeatureType; - stylers?: MapTypeStyler[]; - } - - export interface MapTypeStyleFeatureType { - administrative?: { - country?: string; - land_parcel?: string; - locality?: string; - neighborhood?: string; - province?: string; - }; - all?: string; - landscape?: { - man_made?: string; - natural?: { - landcover?: string; - terrain?: string; - }; - }; - poi?: { - attraction?: string; - business?: string; - government?: string; - medical?: string; - park?: string; - place_of_worship?: string; - school?: string; - sports_complex?: string; - }; - road?: { - arterial?: string; - highway?: { - controlled_access?: string; - }; - local?: string; - }; - transit?: { - line?: string; - station?: { - airport?: string; - bus?: string; - rail?: string; - }; - }; - water?: string; - } - - export interface MapTypeStyleElementType { - all?: string; - geometry?: { - fill?: string; - stroke?: string; - }; - labels?: { - icon?: string; - text?: { - fill?: string; - stroke?: string; - } - }; - } - - export interface MapTypeStyler { - color?: string; - gamma?: number; - hue?: string; - invert_lightness?: boolean; - lightness?: number; - saturation?: number; - visibility?: string; - weight?: number; - } - - /***** Layers *****/ - export class BicyclingLayer extends MVCObject { - constructor(); - getMap(): Map; - setMap(map: Map): void; - } - - export class FusionTablesLayer extends MVCObject { - constructor(options: FusionTablesLayerOptions); - getMap(): Map; - setMap(map: Map): void; - setOptions(options: FusionTablesLayerOptions): void; - } - - export interface FusionTablesLayerOptions { - clickable?: boolean; - heatmap?: FusionTablesHeatmap; - map?: Map; - query?: FusionTablesQuery; - styles?: FusionTablesStyle[]; - suppressInfoWindows?: boolean; - } - - export interface FusionTablesQuery { - from?: string; - limit?: number; - offset?: number; - orderBy?: string; - select?: string; - where?: string; - } - - export interface FusionTablesStyle { - markerOptions?: FusionTablesMarkerOptions; - polygonOptions?: FusionTablesPolygonOptions; - polylineOptions?: FusionTablesPolylineOptions; - where?: string; - } - - export interface FusionTablesHeatmap { - enabled: boolean; - } - - export interface FusionTablesMarkerOptions { - iconName: string; - } - - export interface FusionTablesPolygonOptions { - fillColor?: string; - fillOpacity?: number; - strokeColor?: string; - strokeOpacity?: number; - strokeWeight?: number; - } - - export interface FusionTablesPolylineOptions { - strokeColor?: string; - strokeOpacity?: number; - strokeWeight?: number; - } - - export interface FusionTablesMouseEvent { - infoWindowHtml?: string; - latLng?: LatLng; - pixelOffset?: Size; - row?: Object; // Object - } - - export interface FusionTablesCell { - columnName?: string; - value?: string; - } - - export class KmlLayer extends MVCObject { - constructor(opts?: KmlLayerOptions); - getDefaultViewport(): LatLngBounds; - getMap(): Map; - getMetadata(): KmlLayerMetadata; - getStatus(): KmlLayerStatus; - getUrl(): string; - getZIndex(): number; - setMap(map: Map): void; - setUrl(url: string): void; - setZIndez(zIndex: number): void; - } - - export interface KmlLayerOptions { - clickable?: boolean; - map?: Map; - preserveViewport?: boolean; - screenOverlays?: boolean; - suppressInfoWindows?: boolean; - url?: string; - zIndex?: number; - } - - export interface KmlLayerMetadata { - author: KmlAuthor; - description: string; - hasScreenOverlays: boolean; - name: string; - snippet: string; - } - - export enum KmlLayerStatus { - DOCUMENT_NOT_FOUND, - DOCUMENT_TOO_LARGE, - FETCH_ERROR, - INVALID_DOCUMENT, - INVALID_REQUEST, - LIMITS_EXCEEDED, - OK, - TIMED_OUT, - UNKNOWN - } - - export interface KmlMouseEvent { - featureData: KmlFeatureData; - latLng: LatLng; - pixelOffset: Size; - } - - export interface KmlFeatureData { - author: KmlAuthor; - description: string; - id: string; - infoWindowHtml: string; - name: string; - snippet: string; - } - - export interface KmlAuthor { - email: string; - name: string; - uri: string; - } - - export class TrafficLayer extends MVCObject { - constructor(opts?: TrafficLayerOptions); - getMap(): Map; - setMap(map: Map): void; - setOptions(options: TrafficLayerOptions): void; - } - - export interface TrafficLayerOptions { - autoRefresh?: boolean; - map?: Map; - } - - export class TransitLayer extends MVCObject { - constructor(); - getMap(): void; - setMap(map: Map): void; - } - - /***** Street View *****/ - export class StreetViewPanorama { - constructor(container: Element, opts?: StreetViewPanoramaOptions); - controls: MVCArray[]; // Array> - getLinks(): StreetViewLink[]; - getLocation(): StreetViewLocation; - getPano(): string; - getPhotographerPov(): StreetViewPov; - getPosition(): LatLng; - getPov(): StreetViewPov; - getStatus(): StreetViewStatus; - getVisible(): boolean; - getZoom(): number; - registerPanoProvider(provider: (input: string) => StreetViewPanoramaData): void; - setLinks(links: Array): void; - setOptions(options: StreetViewPanoramaOptions): void; - setPano(pano: string): void; - setPosition(latLng: LatLng|LatLngLiteral): void; - setPov(pov: StreetViewPov): void; - setVisible(flag: boolean): void; - setZoom(zoom: number): void; - } - - /** Options for the rendering of the fullscreen control. */ - export interface FullscreenControlOptions { - /** - * Position id. Used to specify the position of the control on the map. - * The default position is RIGHT_TOP. - */ - position?: ControlPosition; - } - - export interface StreetViewPanoramaOptions { - addressControl?: boolean; - addressControlOptions?: StreetViewAddressControlOptions; - clickToGo?: boolean; - disableDefaultUI?: boolean; - disableDoubleClickZoom?: boolean; - enableCloseButton?: boolean; - fullscreenControl?: boolean; - fullscreenControlOptions?: FullscreenControlOptions; - imageDateControl?: boolean; - linksControl?: boolean; - mode?: "html4" | "html5" |"webgl"; - panControl?: boolean; - panControlOptions?: PanControlOptions; - pano?: string; - panoProvider?: (input: string) => StreetViewPanoramaData; - position?: LatLng|LatLngLiteral; - pov?: StreetViewPov; - scrollwheel?: boolean; - visible?: boolean; - zoom?: number; - zoomControl?: boolean; - zoomControlOptions?: ZoomControlOptions; - } - - export interface StreetViewAddressControlOptions { - position?: ControlPosition; - } - - export interface StreetViewLink { - description?: string; - heading?: number; - pano?: string; - } - - export interface StreetViewPov { - heading?: number; - pitch?: number; - } - - export interface StreetViewPanoramaData { - copyright?: string; - imageDate?: string; - links?: StreetViewLink[]; - location?: StreetViewLocation; - tiles?: StreetViewTileData; - } - - export interface StreetViewLocation { - description?: string; - latLng?: LatLng; - pano?: string; - shortDescription?: string; - } - - export interface StreetViewTileData { - getTileUrl(pano: string, tileZoom: number, tileX: number, tileY: number): string; - centerHeading?: number; - tileSize?: Size; - worldSize?: Size; - } - - export enum StreetViewPreference { - BEST, - NEAREST - } - - export enum StreetViewSource { - DEFAULT, - OUTDOOR - } - - export interface StreetViewLocationRequest { - location: LatLng|LatLngLiteral; - preference?: StreetViewPreference; - radius?: number; - source?: StreetViewSource; - } - - export interface StreetViewPanoRequest { - pano: string; - } - - export class StreetViewService { - getPanorama(request: StreetViewLocationRequest|StreetViewPanoRequest, cb: (data: StreetViewPanoramaData, status: StreetViewStatus) => void): void; - getPanoramaById(pano: string, callback: (streetViewPanoramaData: StreetViewPanoramaData, streetViewStatus: StreetViewStatus) => void): void; - getPanoramaByLocation(latlng: LatLng|LatLngLiteral, radius: number, callback: (streetViewPanoramaData: StreetViewPanoramaData, streetViewStatus: StreetViewStatus) => void ): void; - } - - export enum StreetViewStatus { - OK, - UNKNOWN_ERROR, - ZERO_RESULTS - } - - export class StreetViewCoverageLayer extends MVCObject { - getMap(): Map; - setMap(map: Map): void; - } - - /***** Events *****/ - export interface MapsEventListener { - /** Removes the listener. Equivalent to calling google.maps.event.removeListener(listener). */ - remove(): void; - } - - export class event { - /** - * Cross browser event handler registration. This listener is removed by calling - * removeListener(handle) for the handle that is returned by this function. - */ - static addDomListener(instance: Object, eventName: string, handler: Function, capture?: boolean): MapsEventListener; - /** - * Wrapper around addDomListener that removes the listener after the first event. - */ - static addDomListenerOnce(instance: Object, eventName: string, handler: Function, capture?: boolean): MapsEventListener; - /** - * Adds the given listener function to the given event name for the given object - * instance. Returns an identifier for this listener that can be used with - * removeListener(). - */ - static addListener(instance: Object, eventName: string, handler: Function): MapsEventListener; - /** - * Like addListener, but the handler removes itself after handling the first event. - */ - static addListenerOnce(instance: Object, eventName: string, handler: Function): MapsEventListener; - /** - * Removes all listeners for all events for the given instance. - */ - static clearInstanceListeners(instance: Object): void; - /** - * Removes all listeners for the given event for the given instance. - */ - static clearListeners(instance: Object, eventName: string): void; - /** - * Removes the given listener, which should have been returned by addListener above. - * Equivalent to calling listener.remove(). - */ - static removeListener(listener: MapsEventListener): void; - /** - * Triggers the given event. All arguments after eventName are passed as arguments to - * the listeners. - */ - static trigger(instance: any, eventName: string, ...args: any[]): void; - } - - export interface MouseEvent { - stop(): void; - latLng: LatLng; - } - - /* **** Base **** */ - - /** - * A LatLng is a point in geographical coordinates: latitude and longitude. - * - * * Latitude ranges between -90 and 90 degrees, inclusive. Values above or - * below this range will be clamped to the range [-90, 90]. This means - * that if the value specified is less than -90, it will be set to -90. - * And if the value is greater than 90, it will be set to 90. - * * Longitude ranges between -180 and 180 degrees, inclusive. Values above - * or below this range will be wrapped so that they fall within the - * range. For example, a value of -190 will be converted to 170. A value - * of 190 will be converted to -170. This reflects the fact that - * longitudes wrap around the globe. - * - * Although the default map projection associates longitude with the - * x-coordinate of the map, and latitude with the y-coordinate, the - * latitude coordinate is always written first, followed by the longitude. - * Notice that you cannot modify the coordinates of a LatLng. If you want - * to compute another point, you have to create a new one. - */ - export class LatLng { - /** - * Creates a LatLng object representing a geographic point. - * Note the ordering of latitude and longitude. - * @param lat Latitude is specified in degrees within the range [-90, 90]. - * @param lng Longitude is specified in degrees within the range [-180, 180]. - * @param noWrap Set noWrap to true to enable values outside of this range. - */ - constructor(lat: number, lng: number, noWrap?: boolean); - /** Comparison function. */ - equals(other: LatLng): boolean; - /** Returns the latitude in degrees. */ - lat(): number; - /** Returns the longitude in degrees. */ - lng(): number; - /** Converts to string representation. */ - toString(): string; - /** Returns a string of the form "lat,lng". We round the lat/lng values to 6 decimal places by default. */ - toUrlValue(precision?: number): string; - /** Converts to JSON representation. This function is intended to be used via JSON.stringify. */ - toJSON(): LatLngLiteral; - } - - export type LatLngLiteral = { lat: number; lng: number } - export type LatLngBoundsLiteral = { east: number; north: number; south: number; west: number } - - export class LatLngBounds { - constructor(sw?: LatLng|LatLngLiteral, ne?: LatLng|LatLngLiteral); - contains(latLng: LatLng|LatLngLiteral): boolean; - equals(other: LatLngBounds|LatLngBoundsLiteral): boolean; - extend(point: LatLng|LatLngLiteral): LatLngBounds; - getCenter(): LatLng; - getNorthEast(): LatLng; - getSouthWest(): LatLng; - intersects(other: LatLngBounds|LatLngBoundsLiteral): boolean; - isEmpty(): boolean; - toJSON(): LatLngBoundsLiteral; - toSpan(): LatLng; - toString(): string; - toUrlValue(precision?: number): string; - union(other: LatLngBounds|LatLngBoundsLiteral): LatLngBounds; - } - - export class Point { - /** A point on a two-dimensional plane. */ - constructor(x: number, y: number); - /** The X coordinate */ - x: number; - /** The Y coordinate */ - y: number; - /** Compares two Points */ - equals(other: Point): boolean; - /** Returns a string representation of this Point. */ - toString(): string; - } - - export class Size { - constructor(width: number, height: number, widthUnit?: string, heightUnit?: string); - height: number; - width: number; - equals(other: Size): boolean; - toString(): string; - } - - /***** MVC *****/ - export class MVCObject { - constructor(); - addListener(eventName: string, handler: (...args: any[]) => void): MapsEventListener; - bindTo(key: string, target: MVCObject, targetKey?: string, noNotify?: boolean): void; - changed(key: string): void; - get(key: string): any; - notify(key: string): void; - set(key: string, value: any): void; - setValues(values: any): void; - unbind(key: string): void; - unbindAll(): void; - } - - export class MVCArray extends MVCObject { - constructor(array?: any[]); - clear(): void; - forEach(callback: (elem: any, i: number) => void): void; - getArray(): any[]; - getAt(i: number): any; - getLength(): number; - insertAt(i: number, elem: any): void; - pop(): any; - push(elem: any): number; - removeAt(i: number): any; - setAt(i: number, elem: any): void; - } - - /***** Geometry Library *****/ - export module geometry { - export class encoding { - static decodePath(encodedPath: string): LatLng[]; - static encodePath(path: any[]): string; // LatLng[]|MVCArray - } - - /** - * Utility functions for computing geodesic angles, distances and areas. - * The default radius is Earth's radius of 6378137 meters. - */ - export class spherical { - /** - * Returns the area of a closed path. - * The computed area uses the same units as the radius. - * The radius defaults to the Earth's radius in meters, - * in which case the area is in square meters. - */ - static computeArea(path: any[], radius?: number): number; // LatLng[]|MVCArray - /** - * Returns the distance, in meters, between two LatLngs. - * You can optionally specify a custom radius. - * The radius defaults to the radius of the Earth. - */ - static computeDistanceBetween(from: LatLng, to: LatLng, radius?: number): number; - /** - * Returns the heading from one LatLng to another LatLng. - * Headings are expressed in degrees clockwise from North within the range [-180,180). - */ - static computeHeading(from: LatLng, to: LatLng): number; - /** - * Returns the length of the given path. - */ - static computeLength(path: any[], radius?: number): number; // LatLng[]|MVCArray - /** - * Returns the LatLng resulting from moving a distance from an origin in the - * specified heading (expressed in degrees clockwise from north). - */ - static computeOffset(from: LatLng, distance: number, heading: number, radius?: number): LatLng; - /** - * Returns the location of origin when provided with a LatLng destination, meters - * travelled and original heading. Headings are expressed in degrees clockwise from - * North. This function returns null when no solution is available. - */ - static computeOffsetOrigin(to: LatLng, distance: number, heading: number, radius?: number): LatLng; - /** - * Returns the signed area of a closed path. The signed area may be used to determine - * the orientation of the path. The computed area uses the same units as the radius. - * The radius defaults to the Earth's radius in meters, in which case the area is in - * square meters. - */ - static computeSignedArea(loop: any[], radius?: number): number; // LatLng[]|MVCArray - /** - * Returns the LatLng which lies the given fraction of the way between the origin - * LatLng and the destination LatLng. - */ - static interpolate(from: LatLng, to: LatLng, fraction: number): LatLng; - } - - export class poly { - static containsLocation(point: LatLng, polygon: Polygon): boolean; - static isLocationOnEdge(point: LatLng, poly: Polygon|Polyline, tolerance?: number): boolean; - } - } - - /***** AdSense Library *****/ - export module adsense { - export class AdUnit extends MVCObject { - constructor(container: Element, opts: AdUnitOptions); - getBackgroundColor(): string; - getBorderColor(): string; - getChannelNumber(): string; - getContainer(): Element; - getFormat(): AdFormat; - getMap(): Map; - getPosition(): ControlPosition; - getPublisherId(): string; - getTextColor(): string; - getTitleColor(): string; - getUrlColor(): string; - setBackgroundColor(backgroundColor: string): void; - setBorderColor(borderColor: string): void; - setChannelNumber(channelNumber: string): void; - setFormat(format: AdFormat): void; - setMap(map: Map): void; - setPosition(position: ControlPosition): void; - setTextColor(textColor: string): void; - setTitleColor(titleColor: string): void; - setUrlColor(urlColor: string): void; - } - - export interface AdUnitOptions { - backgroundColor?: string; - borderColor?: string; - channelNumber?: string; - format?: AdFormat; - map?: Map; - position?: ControlPosition; - publisherId?: string; - textColor?: string; - titleColor?: string; - urlColor?: string; - } - - export enum AdFormat { - BANNER, - BUTTON, - HALF_BANNER, - LARGE_HORIZONTAL_LINK_UNIT, - LARGE_RECTANGLE, - LARGE_VERTICAL_LINK_UNIT, - LEADERBOARD, - MEDIUM_RECTANGLE, - MEDIUM_VERTICAL_LINK_UNIT, - SKYSCRAPER, - SMALL_HORIZONTAL_LINK_UNIT, - SMALL_RECTANGLE, - SMALL_SQUARE, - SMALL_VERTICAL_LINK_UNIT, - SQUARE, - VERTICAL_BANNER, - WIDE_SKYSCRAPER, - X_LARGE_VERTICAL_LINK_UNIT - } - } - - /***** Places Library *****/ - export module places { - export class Autocomplete extends MVCObject { - constructor(inputField: HTMLInputElement, opts?: AutocompleteOptions); - getBounds(): LatLngBounds; - getPlace(): PlaceResult; - setBounds(bounds: LatLngBounds|LatLngBoundsLiteral): void; - setComponentRestrictions(restrictions: ComponentRestrictions): void; - setTypes(types: string[]): void; - } - - export interface AutocompleteOptions { - bounds?: LatLngBounds|LatLngBoundsLiteral; - componentRestrictions?: ComponentRestrictions; - placeIdOnly?: boolean; - strictBounds?: boolean; - types?: string[]; - } - - export interface AutocompletePrediction { - description: string; - matched_substrings: PredictionSubstring[]; - place_id: string; - terms: PredictionTerm[]; - types: string[]; - } - - export interface PredictionTerm { - offset: number; - value: string; - } - - export interface PredictionSubstring { - length: number; - offset: number; - } - - export class AutocompleteService { - constructor(); - getPlacePredictions(request: AutocompletionRequest, callback: (result: AutocompletePrediction[], status: PlacesServiceStatus) => void): void; - getQueryPredictions(request: QueryAutocompletionRequest, callback: (result: QueryAutocompletePrediction[], status: PlacesServiceStatus) => void): void; - } - - export interface AutocompletionRequest { - bounds?: LatLngBounds|LatLngBoundsLiteral; - componentRestrictions?: ComponentRestrictions; - input: string; - location?: LatLng; - offset?: number; - radius?: number; - types?: string[]; - } - - export interface ComponentRestrictions { - country: string; - } - - export interface PlaceAspectRating { - rating: number; - type: string; - } - - export interface PlaceDetailsRequest { - placeId: string; - } - - export interface PlaceGeometry { - location: LatLng; - viewport: LatLngBounds; - } - - export interface PlacePhoto { - height: number; - html_attributions: string[]; - width: number; - getUrl(opts: PhotoOptions): string; - } - - export interface PhotoOptions { - maxHeight?: number; - maxWidth?: number; - } - - export interface PlaceResult { - address_components: GeocoderAddressComponent[]; - aspects: PlaceAspectRating[]; /* Deprecated. Will be removed May 2, 2017 */ - formatted_address: string; - formatted_phone_number: string; - geometry: PlaceGeometry; - html_attributions: string[]; - icon: string; - international_phone_number: string; - name: string; - permanently_closed: boolean; - photos: PlacePhoto[]; - place_id: string; - price_level: number; - rating: number; - reviews: PlaceReview[]; - types: string[]; - url: string; - vicinity: string; - website: string; - } - - export interface PlaceReview { - aspects: PlaceAspectRating[]; - author_name: string; - author_url: string; - language: string; - text: string; - } - - export interface PlaceSearchPagination { - nextPage(): void; - hasNextPage: boolean; - } - - export interface PlaceSearchRequest { - bounds?: LatLngBounds|LatLngBoundsLiteral; - keyword?: string; - location?: LatLng|LatLngLiteral; - maxPriceLevel?: number; - minPriceLevel?: number; - name?: string; - openNow?: boolean; - radius?: number; - rankBy?: RankBy; - types?: string[]; /* Deprecated. Will be removed February 16, 2017 */ - type?: string; - } - - export class PlacesService { - constructor(attrContainer: HTMLDivElement|Map); - getDetails(request: PlaceDetailsRequest, callback: (result: PlaceResult, status: PlacesServiceStatus) => void): void; - nearbySearch(request: PlaceSearchRequest, callback: (results: PlaceResult[], status: PlacesServiceStatus, pagination: PlaceSearchPagination) => void): void; - radarSearch(request: RadarSearchRequest, callback: (results: PlaceResult[], status: PlacesServiceStatus) => void): void; - textSearch(request: TextSearchRequest, callback: (results: PlaceResult[], status: PlacesServiceStatus) => void): void; - } - - export enum PlacesServiceStatus { - INVALID_REQUEST, - OK, - OVER_QUERY_LIMIT, - REQUEST_DENIED, - UNKNOWN_ERROR, - ZERO_RESULTS - } - - export interface QueryAutocompletePrediction { - description: string; - matched_substrings: PredictionSubstring[]; - place_id: string; - terms: PredictionTerm[]; - } - - export interface QueryAutocompletionRequest { - bounds?: LatLngBounds|LatLngBoundsLiteral; - input?: string; - location?: LatLng; - offset?: number; - radius?: number; - } - - export interface RadarSearchRequest { - bounds?: LatLngBounds|LatLngBoundsLiteral; - keyword?: string; - location?: LatLng|LatLngLiteral; - name?: string; - radius?: number; - types?: string[]; /* Deprecated. Will be removed February 16, 2017 */ - type?: string; - } - - export enum RankBy { - DISTANCE, - PROMINENCE - } - - export class SearchBox extends MVCObject { - constructor(inputField: HTMLInputElement, opts?: SearchBoxOptions); - getBounds(): LatLngBounds; - getPlaces(): PlaceResult[]; - setBounds(bounds: LatLngBounds|LatLngBoundsLiteral): void; - } - - export interface SearchBoxOptions { - bounds: LatLngBounds|LatLngBoundsLiteral; - } - - export interface TextSearchRequest { - bounds?: LatLngBounds|LatLngBoundsLiteral; - location?: LatLng|LatLngLiteral; - query: string; - radius?: number; - types?: string[]; /* Deprecated. Will be removed February 16, 2017 */ - type?: string; - } - } - - /***** Drawing Library *****/ - export module drawing { - export class DrawingManager extends MVCObject { - constructor(options?: DrawingManagerOptions); - getDrawingMode(): OverlayType; - getMap(): Map; - setDrawingMode(drawingMode: OverlayType): void; - setMap(map: Map): void; - setOptions(options: DrawingManagerOptions): void; - } - - export interface DrawingManagerOptions { - circleOptions?: CircleOptions; - drawingControl?: boolean; - drawingControlOptions?: DrawingControlOptions; - drawingMode?: OverlayType; - map?: Map; - markerOptions?: MarkerOptions; - polygonOptions?: PolygonOptions; - polylineOptions?: PolylineOptions; - rectangleOptions?: RectangleOptions; - } - - export interface DrawingControlOptions { - drawingModes?: OverlayType[]; - position?: ControlPosition; - } - - export interface OverlayCompleteEvent { - overlay: Marker|Polygon|Polyline|Rectangle|Circle; - type: OverlayType; - } - - export enum OverlayType { - CIRCLE, - MARKER, - POLYGON, - POLYLINE, - RECTANGLE - } - } - - /***** Visualization Library *****/ - export module visualization { - export class MapsEngineLayer extends MVCObject { - constructor(options: MapsEngineLayerOptions); - getLayerId(): string; - getLayerKey(): string; - getMap(): Map; - getMapId(): string; - getOpacity(): number; - getProperties(): MapsEngineLayerProperties; - getStatus(): MapsEngineStatus; - getZIndex(): number; - setLayerId(layerId: string): void; - setLayerKey(layerKey: string): void; - setMap(map: Map): void; - setMapId(mapId: string): void; - setOpacity(opacity: number): void; - setOptions(options: MapsEngineLayerOptions): void; - setZIndex(zIndex: number): void; - } - - export interface MapsEngineLayerOptions { - accessToken?: string; - clickable?: boolean; - fitBounds?: boolean; - layerId?: string; - layerKey?: string; - map?: Map; - mapId?: string; - opacity?: number; - suppressInfoWindows?: boolean; - zIndex?: number; - } - - export interface MapsEngineLayerProperties { - name: string; - } - - export interface MapsEngineMouseEvent { - featureId?: string; - infoWindowHtml?: string; - latLng?: LatLng; - pixelOffset?: Size; - } - - export enum MapsEngineStatus { - INVALID_LAYER, - OK, - UNKNOWN_ERROR - } - - export class HeatmapLayer extends MVCObject { - constructor(opts?: HeatmapLayerOptions); - getData(): MVCArray; - getMap(): Map; - setData(data: MVCArray): void; - setData(data: LatLng[]): void; - setData(data: WeightedLocation[]): void; - setMap(map: Map): void; - } - - export interface HeatmapLayerOptions { - data: any; - dissipating?: boolean; - gradient?: string[]; - map?: Map; - maxIntensity?: number; - opacity?: number; - radius?: number; - } - - export interface WeightedLocation { - location: LatLng; - weight: number; - } - - export class MouseEvent { - stop(): void; - } - - export class MapsEventListener { - - } - } -} diff --git a/graphene-pk11/index.d.ts b/graphene-pk11/index.d.ts deleted file mode 100644 index 6807897107..0000000000 --- a/graphene-pk11/index.d.ts +++ /dev/null @@ -1,2274 +0,0 @@ -// Type definitions for graphene-pk11 v2.0.3 -// Project: https://github.com/PeculiarVentures/graphene -// Definitions by: Stepan Miroshin -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// -/// - -/** - * A simple layer for interacting with PKCS #11 / PKCS11 / CryptoKI for Node - * v2.0.3 - */ - -import * as pkcs11 from "pkcs11js"; - -type Handle = Buffer; -type CryptoData = string | Buffer; - -declare class Pkcs11Error extends Error { - code: number; - func: string; - constructor(code: number, func: string); -} - -declare class BaseObject { - protected lib: pkcs11.PKCS11; - constructor(lib?: pkcs11.PKCS11); -} - -declare class HandleObject extends BaseObject { - /** - * handle to pkcs11 object - */ - handle: Handle; - - constructor(handle: Handle, lib: pkcs11.PKCS11); - - protected getInfo(): void; -} - -declare class Collection extends BaseObject { - - protected items_: Array; - protected classType: any; - - /** - * returns length of collection - */ - length: number; - - constructor(items: Array, lib: pkcs11.PKCS11, classType: any); - - /** - * returns item from collection by index - * @param {number} index of element in collection `[0..n]` - */ - items(index: number): T; -} - -declare function isString(v: any): boolean; -declare function isNumber(v: any): boolean; -declare function isBoolean(v: any): boolean; -declare function isUndefined(v: any): boolean; -declare function isNull(v: any): boolean; -declare function isEmpty(v: any): boolean; -declare function isFunction(v: any): boolean; -declare function isObject(v: any): boolean; -declare function isArray(v: any): boolean; -declare function isFlag(v: any, fv: number): boolean; -declare function dateFromString(text: string): Date; - -// ========== Crypto ========== - -declare class Cipher extends BaseObject { - - session: Session; - - constructor(session: Session, alg: MechanismType, key: Key, lib: pkcs11.PKCS11); - - protected init(alg: MechanismType, key: Key): void; - - update(data: CryptoData): Buffer; - final(): Buffer; - once(data: CryptoData, enc: Buffer): Buffer; - once(data: CryptoData, enc: Buffer, cb: (error: Error, data: Buffer) => void): void; -} - -declare class Decipher extends BaseObject { - - protected session: Session; - protected blockSize: number; - - constructor(session: Session, alg: MechanismType, key: Key, blockSize: number, lib: pkcs11.PKCS11); - - protected init(alg: MechanismType, key: Key): void; - - update(data: Buffer): Buffer; - final(): Buffer; - once(data: Buffer, dec: Buffer): Buffer; - once(data: Buffer, dec: Buffer, cb: (error: Error, data: Buffer) => void): void; -} - -declare class Digest extends BaseObject { - - session: Session; - - constructor(session: Session, alg: MechanismType, lib: pkcs11.PKCS11); - - protected init(alg: MechanismType): void; - - update(data: CryptoData): void; - final(): Buffer; - once(data: CryptoData): Buffer; - once(data: CryptoData, cb: (error: Error, data: Buffer) => void): void; -} - -declare class Sign extends BaseObject { - - session: Session; - - constructor(session: Session, alg: MechanismType, key: Key, lib: pkcs11.PKCS11); - - protected init(alg: MechanismType, key: Key): void; - - update(data: CryptoData): void; - final(): Buffer; - once(data: CryptoData): Buffer; - once(data: CryptoData, cb: (error: Error, data: Buffer) => void): void; -} - -declare class Verify extends BaseObject { - - session: Session; - - constructor(session: Session, alg: MechanismType, key: Key, lib: pkcs11.PKCS11); - - protected init(alg: MechanismType, key: Key): void; - - update(data: CryptoData): void; - final(signature: Buffer): boolean; - once(data: CryptoData, signature: Buffer): boolean; - once(data: CryptoData, signature: Buffer, cb: (error: Error, valid: boolean) => void): void; -} - -// ========== Keys ========== - -interface IParams { - toCKI(): any; -} - -declare enum MechParams { - AesCBC, - AesCCM, - AesGCM, - RsaOAEP, - RsaPSS, - EcDH, -} - -// AES - -declare class AesCbcParams implements IParams, pkcs11.AesCBC { - /** - * initialization vector - * - must have a fixed size of 16 bytes - */ - iv: Buffer; - /** - * the data - */ - data: Buffer; - type: MechParams; - constructor(iv: Buffer, data?: Buffer); - toCKI(): Buffer; -} - -declare class AesCcmParams implements IParams { - /** - * length of the data where 0 <= dataLength < 2^8L - */ - dataLength: number; - /** - * the nonce - */ - nonce: Buffer; - /** - * the additional authentication data - * - This data is authenticated but not encrypted - */ - aad: Buffer; - /** - * length of authentication tag (output following cipher text) in bits. - * - Can be any value between 0 and 128 - */ - macLength: number; - type: MechParams; - constructor(dataLength: number, nonce: Buffer, aad?: Buffer, macLength?: number); - toCKI(): pkcs11.AesCCM; -} - -declare class AesGcmParams implements IParams { - /** - * initialization vector - * - The length of the initialization vector can be any number between 1 and 256. - * 96-bit (12 byte) IV values can be processed more efficiently, - * so that length is recommended for situations in which efficiency is critical. - */ - iv: Buffer; - /** - * pointer to additional authentication data. - * This data is authenticated but not encrypted. - */ - aad: Buffer; - /** - * length of authentication tag (output following cipher text) in bits. - * Can be any value between 0 and 128. Default 128 - */ - tagBits: number; - type: MechParams; - constructor(iv: Buffer, aad?: Buffer, tagBits?: number); - toCKI(): pkcs11.AesGCM; -} - -// EC - -interface INamedCurve { - name: string; - oid: string; - value: Buffer; - size: number; -} - -declare class NamedCurve { - static getByName(name: string): INamedCurve; - static getByOid(oid: string): INamedCurve; -} - -declare enum EcKdf { - NULL, - SHA1, - SHA224, - SHA256, - SHA384, - SHA512, -} - -declare class EcdhParams implements IParams, pkcs11.ECDH1 { - /** - * key derivation function used on the shared secret value - */ - kdf: EcKdf; - /** - * some data shared between the two parties - */ - sharedData: Buffer; - /** - * other party's EC public key value - */ - publicData: Buffer; - type: MechParams; - /** - * Creates an instance of EcdhParams. - * - * @param {EcKdf} kdf key derivation function used on the shared secret value - * @param {Buffer} [sharedData=null] some data shared between the two parties - * @param {Buffer} [publicData=null] other party's EC public key value - */ - constructor(kdf: EcKdf, sharedData?: Buffer, publicData?: Buffer); - toCKI(): pkcs11.ECDH1; -} - -// Rsa - -declare enum RsaMgf { - MGF1_SHA1, - MGF1_SHA224, - MGF1_SHA256, - MGF1_SHA384, - MGF1_SHA512, -} - -declare class RsaOaepParams implements IParams { - hashAlgorithm: MechanismEnum; - mgf: RsaMgf; - source: number; - sourceData: Buffer; - type: MechParams; - constructor(hashAlg?: MechanismEnum, mgf?: RsaMgf, sourceData?: Buffer); - toCKI(): pkcs11.RsaOAEP; -} - -declare class RsaPssParams implements IParams { - /** - * hash algorithm used in the PSS encoding; - * - if the signature mechanism does not include message hashing, - * then this value must be the mechanism used by the application to generate - * the message hash; - * - if the signature mechanism includes hashing, - * then this value must match the hash algorithm indicated - * by the signature mechanism - */ - hashAlgorithm: MechanismEnum; - /** - * mask generation function to use on the encoded block - */ - mgf: RsaMgf; - /** - * length, in bytes, of the salt value used in the PSS encoding; - * - typical values are the length of the message hash and zero - */ - saltLength: number; - type: MechParams; - constructor(hashAlg?: MechanismEnum, mgf?: RsaMgf, saltLen?: number); - toCKI(): pkcs11.RsaPSS; -} - -// ========== Objects ========== - -declare enum ObjectClass { - DATA, - CERTIFICATE, - PUBLIC_KEY, - PRIVATE_KEY, - SECRET_KEY, - HW_FEATURE, - DOMAIN_PARAMETERS, - MECHANISM, - OTP_KEY, -} - -declare class SessionObject extends HandleObject { - /** - * Session - */ - session: Session; - /** - * gets the size of an object in bytes - * - * @readonly - * @type {number} - */ - size: number; - class: ObjectClass; - - /** - * Creates an instance of SessionObject. - * - * @param {SessionObject} object - */ - constructor(object: SessionObject); - /** - * Creates an instance of SessionObject. - * - * @param {Handle} handle - * @param {Session} session - * @param {pkcs11.PKCS11} lib - */ - constructor(handle: Handle, session: Session, lib: pkcs11.PKCS11); - constructor(handle: SessionObject); - - /** - * copies an object, creating a new object for the copy - * - * @param {ITemplate} template template for the new object - * @returns {SessionObject} - */ - copy(template: ITemplate): SessionObject; - /** - * destroys an object - */ - destroy(): void; - getAttribute(attr: string): ITemplate; - getAttribute(attrs: ITemplate): ITemplate; - setAttribute(attrs: string, value: any): void; - setAttribute(attrs: ITemplate): void; - get(name: string): any; - set(name: string, value: any): void; - toType(): T; -} - -declare class SessionObjectCollection extends Collection { - session: Session; - - constructor(items: Array, session: Session, lib: pkcs11.PKCS11, classType?: any); - - items(index: number): SessionObject; -} - -declare class Storage extends SessionObject { - /** - * `true` if object is a token object; - * `false` if object is a session object. Default is `false`. - */ - token: boolean; - /** - * `true` if object is a private object; - * `false` if object is a public object. - * Default value is token-specific, and may depend on the values of other attributes of the object. - */ - private: boolean; - /** - * `true` if object can be modified. Default is `false` - */ - modifiable: boolean; - /** - * Description of the object (default empty) - */ - label: string; -} - -/** - * Data objects (object declare class `CKO_DATA`) hold information defined by an application. - * Other than providing access to it, Cryptoki does not attach any special meaning to a data object - * - * @export - * @declare class Data - * @extends {Storage} - */ -declare class Data extends Storage { - /** - * Description of the application that manages the object (default empty) - * - * @type {string} - */ - application: string; - /** - * DER-encoding of the object identifier indicating the data object type (default empty) - * - * @type {Buffer} - */ - objectId: Buffer; - /** - * Value of the object (default empty) - * - * @type {Buffer} - */ - value: Buffer; -} - -declare class DomainParameters extends Storage { - /** - * Type of key the domain parameters can be used to generate. - */ - keyType: KeyType; - /** - * `CK_TRUE` only if domain parameters were either * generated locally (i.e., on the token) - * with a `C_GenerateKey` * created with a `C_CopyObject` call as a copy of domain parameters - * which had its `CKA_LOCAL` attribute set to `CK_TRUE` - */ - local: boolean; -} - -declare enum KeyType { - RSA, - DSA, - DH, - ECDSA, - EC, - X9_42_DH, - KEA, - GENERIC_SECRET, - RC2, - RC4, - DES, - DES2, - DES3, - CAST, - CAST3, - CAST5, - CAST128, - RC5, - IDEA, - SKIPJACK, - BATON, - JUNIPER, - CDMF, - AES, - GOSTR3410, - GOSTR3411, - GOST28147, - BLOWFISH, - TWOFISH, - SECURID, - HOTP, - ACTI, - CAMELLIA, - ARIA, -} -declare enum KeyGenMechanism { - AES, - RSA, - RSA_X9_31, - DSA, - DH_PKCS, - DH_X9_42, - GOSTR3410, - GOST28147, - RC2, - RC4, - DES, - DES2, - SECURID, - ACTI, - CAST, - CAST3, - CAST5, - CAST128, - RC5, - IDEA, - GENERIC_SECRET, - SSL3_PRE_MASTER, - CAMELLIA, - ARIA, - SKIPJACK, - KEA, - BATON, - ECDSA, - EC, - JUNIPER, - TWOFISH, -} - -/** - * Definition for the base key object declare class - * - defines the object declare class `CKO_PUBLIC_KEY`, `CKO_PRIVATE_KEY` and `CKO_SECRET_KEY` for type `CK_OBJECT_CLASS` - * as used in the `CKA_CLASS` attribute of objects - */ -declare class Key extends Storage { - /** - * Type of key - * - Must be specified when object is created with `C_CreateObject` - * - Must be specified when object is unwrapped with `C_UnwrapKey` - */ - type: KeyType; - /** - * Key identifier for key (default empty) - * - May be modified after object is created with a `C_SetAttributeValue` call, - * or in the process of copying object with a `C_CopyObject` call. - * However, it is possible that a particular token may not permit modification - * of the attribute during the course of a `C_CopyObject` call. - */ - id: Buffer; - /** - * Start date for the key (default empty) - * - May be modified after object is created with a `C_SetAttributeValue` call, - * or in the process of copying object with a `C_CopyObject` call. - * However, it is possible that a particular token may not permit modification - * of the attribute during the course of a `C_CopyObject` call. - */ - startDate: Date; - /** - * End date for the key (default empty) - * - May be modified after object is created with a `C_SetAttributeValue` call, - * or in the process of copying object with a `C_CopyObject` call. - * However, it is possible that a particular token may not permit modification - * of the attribute during the course of a `C_CopyObject` call. - */ - endDate: Date; - /** - * `CK_TRUE` if key supports key derivation - * (i.e., if other keys can be derived from this one (default `CK_FALSE`) - * - May be modified after object is created with a `C_SetAttributeValue` call, - * or in the process of copying object with a `C_CopyObject` call. - * However, it is possible that a particular token may not permit modification - * of the attribute during the course of a `C_CopyObject` call. - * @returns boolean - */ - derive: boolean; - /** - * `CK_TRUE` only if key was either * generated locally (i.e., on the token) - * with a `C_GenerateKey` or `C_GenerateKeyPair` call * created with a `C_CopyObject` call - * as a copy of a key which had its `CKA_LOCAL` attribute set to `CK_TRUE` - * - Must not be specified when object is created with `C_CreateObject`. - * - Must not be specified when object is generated with `C_GenerateKey` or `C_GenerateKeyPair`. - * - Must not be specified when object is unwrapped with `C_UnwrapKey`. - */ - local: boolean; - /** - * Identifier of the mechanism used to generate the key material. - * - Must not be specified when object is created with `C_CreateObject`. - * - Must not be specified when object is generated with `C_GenerateKey` or `C_GenerateKeyPair`. - * - Must not be specified when object is unwrapped with `C_UnwrapKey`. - */ - mechanism: KeyGenMechanism; - allowedMechanisms: void; -} - -/** - * Private key objects (object declare class `CKO_PRIVATE_KEY`) hold private keys - */ -declare class PrivateKey extends Key { - /** - * DER-encoding of the key subject name (default empty) - * - May be modified after object is created with a `C_SetAttributeValue` call, - * or in the process of copying object with a `C_CopyObject` call. - * However, it is possible that a particular token may not permit modification of the attribute - * during the course of a `C_CopyObject` call. - */ - subject: Buffer; - /** - * `CK_TRUE` if key is sensitive - * - May be modified after object is created with a `C_SetAttributeValue` call, - * or in the process of copying object with a `C_CopyObject` call. - * However, it is possible that a particular token may not permit modification of the attribute - * during the course of a `C_CopyObject` call. - * - Attribute cannot be changed once set to CK_TRUE. It becomes a read only attribute. - * - Default value is token-specific, and may depend on the values of other attributes. - */ - sensitive: boolean; - /** - * `CK_TRUE` if key supports decryption - * - May be modified after object is created with a `C_SetAttributeValue` call, - * or in the process of copying object with a `C_CopyObject` call. - * However, it is possible that a particular token may not permit modification of the attribute - * during the course of a `C_CopyObject` call. - * - Default value is token-specific, and may depend on the values of other attributes. - */ - decrypt: boolean; - /** - * `CK_TRUE` if key supports signatures where the signature is an appendix to the data - * - May be modified after object is created with a `C_SetAttributeValue` call, - * or in the process of copying object with a `C_CopyObject` call. - * However, it is possible that a particular token may not permit modification of the attribute - * during the course of a `C_CopyObject` call. - * - Default value is token-specific, and may depend on the values of other attributes. - */ - sign: boolean; - /** - * `CK_TRUE` if key supports signatures where the data can be recovered from the signature - * - May be modified after object is created with a `C_SetAttributeValue` call, - * or in the process of copying object with a `C_CopyObject` call. - * However, it is possible that a particular token may not permit modification of the attribute - * during the course of a `C_CopyObject` call. - * - Default value is token-specific, and may depend on the values of other attributes. - */ - signRecover: boolean; - /** - * `CK_TRUE` if key supports unwrapping (i.e., can be used to unwrap other keys) - * - May be modified after object is created with a `C_SetAttributeValue` call, - * or in the process of copying object with a `C_CopyObject` call. - * However, it is possible that a particular token may not permit modification of the attribute - * during the course of a `C_CopyObject` call. - * - Default value is token-specific, and may depend on the values of other attributes. - */ - unwrap: boolean; - /** - * `CK_TRUE` if key is extractable and can be wrapped - * - May be modified after object is created with a `C_SetAttributeValue` call, - * or in the process of copying object with a `C_CopyObject` call. - * However, it is possible that a particular token may not permit modification of the attribute - * during the course of a `C_CopyObject` call. - * - Attribute cannot be changed once set to `CK_FALSE`. It becomes a read only attribute. - * - Default value is token-specific, and may depend on the values of other attributes. - */ - extractable: boolean; - /** - * `CK_TRUE` if key has always had the `CKA_SENSITIVE` attribute set to `CK_TRUE` - * - Must not be specified when object is created with `C_CreateObject`. - * - Must not be specified when object is generated with `C_GenerateKey` or `C_GenerateKeyPair`. - * - Must not be specified when object is unwrapped with `C_UnwrapKey`. - */ - alwaysSensitive: boolean; - /** - * `CK_TRUE` if key has never had the `CKA_EXTRACTABLE` attribute set to `CK_TRUE` - * - Must not be specified when object is created with `C_CreateObject`. - * - Must not be specified when object is generated with `C_GenerateKey` or `C_GenerateKeyPair`. - * - Must not be specified when object is unwrapped with `C_UnwrapKey`. - */ - neverExtractable: boolean; - /** - * `CK_TRUE` if the key can only be wrapped with a wrapping key - * that has `CKA_TRUSTED` set to `CK_TRUE`. Default is `CK_FALSE`. - * - Attribute cannot be changed once set to `CK_TRUE`. It becomes a read only attribute. - */ - wrapTrusted: boolean; - /** - * For wrapping keys. The attribute template to apply to any keys unwrapped - * using this wrapping key. Any user supplied template is applied after this template - * as if the object has already been created. - */ - template: void; - alwaysAuthenticate: boolean; -} - -/** - * Public key objects (object declare class CKO_PUBLIC_KEY) hold public keys - */ -declare class PublicKey extends Key { - /** - * DER-encoding of the key subject name (default empty) - * - May be modified after object is created with a `C_SetAttributeValue` call, - * or in the process of copying object with a `C_CopyObject` call. - * However, it is possible that a particular token may not permit modification of the attribute - * during the course of a `C_CopyObject` call. - */ - subject: Buffer; - /** - * `CK_TRUE` if key supports encryption - * - May be modified after object is created with a `C_SetAttributeValue` call, - * or in the process of copying object with a `C_CopyObject` call. - * However, it is possible that a particular token may not permit modification of the attribute - * during the course of a `C_CopyObject` call. - * - Default value is token-specific, and may depend on the values of other attributes. - */ - encrypt: boolean; - /** - * `CK_TRUE` if key supports verification where the signature is an appendix to the data - * - May be modified after object is created with a `C_SetAttributeValue` call, - * or in the process of copying object with a `C_CopyObject` call. - * However, it is possible that a particular token may not permit modification of the attribute - * during the course of a `C_CopyObject` call. - * - Default value is token-specific, and may depend on the values of other attributes. - */ - verify: boolean; - /** - * `CK_TRUE` if key supports verification where the data is recovered from the signature - * - May be modified after object is created with a `C_SetAttributeValue` call, - * or in the process of copying object with a `C_CopyObject` call. - * However, it is possible that a particular token may not permit modification of the attribute - * during the course of a `C_CopyObject` call. - * - Default value is token-specific, and may depend on the values of other attributes. - */ - verifyRecover: boolean; - /** - * `CK_TRUE` if key supports wrapping (i.e., can be used to wrap other keys) - * - May be modified after object is created with a `C_SetAttributeValue` call, - * or in the process of copying object with a `C_CopyObject` call. - * However, it is possible that a particular token may not permit modification of the attribute - * during the course of a `C_CopyObject` call. - * - Default value is token-specific, and may depend on the values of other attributes. - */ - wrap: boolean; - /** - * The key can be trusted for the application that it was created. - * - The wrapping key can be used to wrap keys with `CKA_WRAP_WITH_TRUSTED` set to `CK_TRUE`. - * - Can only be set to CK_TRUE by the SO user. - */ - trusted: boolean; - /** - * For wrapping keys. The attribute template to match against any keys wrapped using this wrapping key. - * Keys that do not match cannot be wrapped. - */ - template: void; -} - -/** - * Secret key objects (object declare class `CKO_SECRET_KEY`) hold secret keys. - */ -declare class SecretKey extends Key { - /** - * `CK_TRUE` if key is sensitive - * - May be modified after object is created with a `C_SetAttributeValue` call, - * or in the process of copying object with a `C_CopyObject` call. - * However, it is possible that a particular token may not permit modification of the attribute - * during the course of a `C_CopyObject` call. - * - Attribute cannot be changed once set to `CK_TRUE`. It becomes a read only attribute. - */ - sensitive: boolean; - /** - * `CK_TRUE` if key supports encryption - * - May be modified after object is created with a `C_SetAttributeValue` call, - * or in the process of copying object with a `C_CopyObject` call. - * However, it is possible that a particular token may not permit modification of the attribute - * during the course of a `C_CopyObject` call. - * - Default value is token-specific, and may depend on the values of other attributes. - */ - encrypt: boolean; - /** - * `CK_TRUE` if key supports decryption - * - May be modified after object is created with a `C_SetAttributeValue` call, - * or in the process of copying object with a `C_CopyObject` call. - * However, it is possible that a particular token may not permit modification of the attribute - * during the course of a `C_CopyObject` call. - * - Default value is token-specific, and may depend on the values of other attributes. - */ - decrypt: boolean; - /** - * `CK_TRUE` if key supports verification (i.e., of authentication codes) where the signature is an appendix to the data - * - May be modified after object is created with a `C_SetAttributeValue` call, - * or in the process of copying object with a `C_CopyObject` call. - * However, it is possible that a particular token may not permit modification of the attribute - * during the course of a `C_CopyObject` call. - * - Default value is token-specific, and may depend on the values of other attributes. - */ - verify: boolean; - /** - * `CK_TRUE` if key supports signatures (i.e., authentication codes) where the signature is an appendix to the data - * - May be modified after object is created with a `C_SetAttributeValue` call, - * or in the process of copying object with a `C_CopyObject` call. - * However, it is possible that a particular token may not permit modification of the attribute - * during the course of a `C_CopyObject` call. - * - Default value is token-specific, and may depend on the values of other attributes. - */ - sign: boolean; - /** - * `CK_TRUE` if key supports wrapping (i.e., can be used to wrap other keys) - * - May be modified after object is created with a `C_SetAttributeValue` call, - * or in the process of copying object with a `C_CopyObject` call. - * However, it is possible that a particular token may not permit modification of the attribute - * during the course of a `C_CopyObject` call. - * - Default value is token-specific, and may depend on the values of other attributes. - */ - wrap: boolean; - /** - * `CK_TRUE` if key supports unwrapping (i.e., can be used to unwrap other keys) - * - May be modified after object is created with a `C_SetAttributeValue` call, - * or in the process of copying object with a `C_CopyObject` call. - * However, it is possible that a particular token may not permit modification of the attribute - * during the course of a `C_CopyObject` call. - * - Default value is token-specific, and may depend on the values of other attributes. - */ - unwrap: boolean; - /** - * `CK_TRUE` if key is extractable and can be wrapped - * - May be modified after object is created with a `C_SetAttributeValue` call, - * or in the process of copying object with a `C_CopyObject` call. - * However, it is possible that a particular token may not permit modification of the attribute - * during the course of a `C_CopyObject` call. - * - Attribute cannot be changed once set to `CK_FALSE`. It becomes a read only attribute. - * - Default value is token-specific, and may depend on the values of other attributes. - */ - extractable: boolean; - /** - * `CK_TRUE` if key has always had the `CKA_SENSITIVE` attribute set to `CK_TRUE` - * - Must not be specified when object is created with `C_CreateObject`. - * - Must not be specified when object is generated with `C_GenerateKey` or `C_GenerateKeyPair`. - * - Must not be specified when object is unwrapped with `C_UnwrapKey`. - */ - alwaysSensitive: boolean; - /** - * `CK_TRUE` if key has never had the `CKA_EXTRACTABLE` attribute set to `CK_TRUE` - * - Must not be specified when object is created with `C_CreateObject`. - * - Must not be specified when object is generated with `C_GenerateKey` or `C_GenerateKeyPair`. - * - Must not be specified when object is unwrapped with `C_UnwrapKey`. - */ - neverExtractable: boolean; - /** - * Key checksum - */ - checkValue: Buffer; - /** - * `CK_TRUE` if the key can only be wrapped with a wrapping key - * that has `CKA_TRUSTED` set to `CK_TRUE`. Default is `CK_FALSE`. - * - Attribute cannot be changed once set to `CK_TRUE`. It becomes a read only attribute. - */ - wrapTrusted: boolean; - /** - * The wrapping key can be used to wrap keys with `CKA_WRAP_WITH_TRUSTED` set to `CK_TRUE`. - * - Can only be set to CK_TRUE by the SO user. - */ - trusted: boolean; - /** - * For wrapping keys. - * The attribute template to match against any keys wrapped using this wrapping key. - * Keys that do not match cannot be wrapped. - */ - wrapTemplate: void; - /** - * For wrapping keys. - * The attribute template to apply to any keys unwrapped using this wrapping key. - * Any user supplied template is applied after this template as if the object has already been created. - */ - unwrapTemplate: void; -} - -declare enum CertificateType { - X_509, - X_509_ATTR_CERT, - WTLS, -} - -declare enum CertificateCategory { - Unspecified, - TokenUser, - Authority, - OtherEntity, -} - -/** - * Certificate objects (object declare class CKO_CERTIFICATE) hold public-key or attribute certificates - */ -declare class Certificate extends Storage { - /** - * Type of certificate - */ - type: CertificateType; - /** - * The certificate can be trusted for the application that it was created. - */ - trusted: boolean; - /** - * Categorization of the certificate - */ - category: CertificateCategory; - /** - * Checksum - */ - checkValue: Buffer; - /** - * Start date for the certificate (default empty) - */ - startDate: Date; - /** - * End date for the certificate (default empty) - */ - endDate: Date; -} - -/** - * X.509 attribute certificate objects (certificate type `CKC_X_509_ATTR_CERT`) hold X.509 attribute certificates - */ -declare class AttributeCertificate extends Certificate { - /** - * DER-encoding of the attribute certificate's subject field. - * This is distinct from the `CKA_SUBJECT` attribute contained in `CKC_X_509` certificates - * because the `ASN.1` syntax and encoding are different. - * - Must be specified when the object is created - */ - owner: Buffer; - /** - * DER-encoding of the attribute certificate's issuer field. - * This is distinct from the `CKA_ISSUER` attribute contained in `CKC_X_509` certificates - * because the ASN.1 syntax and encoding are different. (default empty) - */ - issuer: Buffer; - /** - * DER-encoding of the certificate serial number (default empty) - */ - serialNumber: Buffer; - /** - * BER-encoding of a sequence of object identifier values corresponding - * to the attribute types contained in the certificate. - * When present, this field offers an opportunity for applications - * to search for a particular attribute certificate without fetching - * and parsing the certificate itself. (default empty) - */ - types: Buffer; - /** - * BER-encoding of the certificate - * - Must be specified when the object is created. - */ - value: Buffer; -} - -/** - * WTLS certificate objects (certificate type `CKC_WTLS`) hold WTLS public key certificates - */ -declare class WtlsCertificate extends Certificate { - /** - * WTLS-encoding (Identifier type) of the certificate subject - * - Must be specified when the object is created. - * - Can only be empty if `CKA_VALUE` is empty. - */ - subject: Buffer; - /** - * WTLS-encoding (Identifier type) of the certificate issuer (default empty) - */ - issuer: Buffer; - /** - * Key identifier for public/private key pair (default empty) - */ - id: Buffer; - /** - * WTLS-encoding of the certificate - * - Must be specified when the object is created. - * - Must be non-empty if `CKA_URL` is empty. - */ - value: Buffer; - /** - * If not empty this attribute gives the URL where the complete certificate - * can be obtained (default empty) - * - Must be non-empty if `CKA_VALUE` is empty - */ - url: string; - /** - * DER-encoding of the certificate serial number (default empty) - */ - serialNumber: Buffer; - /** - * SHA-1 hash of the subject public key (default empty) - * - Can only be empty if `CKA_URL` is empty. - */ - subjetcKeyIdentifier: Buffer; - /** - * SHA-1 hash of the issuer public key (default empty) - * - Can only be empty if `CKA_URL` is empty. - */ - authorityKeyIdentifier: Buffer; -} - -declare enum JavaMIDP { - Unspecified, - Manufacturer, - Operator, - ThirdParty, -} - -/** - * X.509 certificate objects (certificate type `CKC_X_509`) hold X.509 public key certificates - */ -declare class X509Certificate extends Certificate { - /** - * DER-encoding of the certificate subject name - * - Must be specified when the object is created. - * - Must be non-empty if `CKA_URL` is empty. - */ - subject: Buffer; - /** - * Key identifier for public/private key pair (default empty) - */ - id: Buffer; - /** - * DER-encoding of the certificate issuer name (default empty) - */ - issuer: Buffer; - /** - * HEX-encoding of the certificate serial number (default empty) - */ - serialNumber: string; - /** - * BER-encoding of the certificate - * - Must be specified when the object is created. - * - Must be non-empty if `CKA_URL` is empty. - */ - value: Buffer; - /** - * If not empty this attribute gives the URL where the complete certificate - * can be obtained (default empty) - * - Must be non-empty if `CKA_VALUE` is empty - */ - url: string; - /** - * SHA-1 hash of the subject public key (default empty) - * - Can only be empty if `CKA_URL` is empty. - */ - subjetcKeyIdentifier: Buffer; - /** - * SHA-1 hash of the issuer public key (default empty) - * - Can only be empty if `CKA_URL` is empty. - */ - authorityKeyIdentifier: Buffer; - /** - * Java MIDP security domain - */ - java: JavaMIDP; -} - -interface IAlgorithm { - name: string; - params: Buffer | IParams; -} - -type MechanismType = MechanismEnum | KeyGenMechanism | IAlgorithm | string; - -declare enum MechanismFlag { - /** - * `True` if the mechanism is performed by the device; `false` if the mechanism is performed in software - */ - HW, - /** - * `True` if the mechanism can be used with encrypt function - */ - ENCRYPT, - /** - * `True` if the mechanism can be used with decrypt function - */ - DECRYPT, - /** - * `True` if the mechanism can be used with digest function - */ - DIGEST, - /** - * `True` if the mechanism can be used with sign function - */ - SIGN, - /** - * `True` if the mechanism can be used with sign recover function - */ - SIGN_RECOVER, - /** - * `True` if the mechanism can be used with verify function - */ - VERIFY, - /** - * `True` if the mechanism can be used with verify recover function - */ - VERIFY_RECOVER, - /** - * `True` if the mechanism can be used with geberate function - */ - GENERATE, - /** - * `True` if the mechanism can be used with generate key pair function - */ - GENERATE_KEY_PAIR, - /** - * `True` if the mechanism can be used with wrap function - */ - WRAP, - /** - * `True` if the mechanism can be used with unwrap function - */ - UNWRAP, - /** - * `True` if the mechanism can be used with derive function - */ - DERIVE, -} - -declare class Mechanism extends BaseObject { - - protected handle: number; - protected slotHandle: Handle; - - /** - * the minimum size of the key for the mechanism - * _whether this is measured in bits or in bytes is mechanism-dependent_ - */ - minKeySize: number; - /** - * the maximum size of the key for the mechanism - * _whether this is measured in bits or in bytes is mechanism-dependent_ - */ - maxKeySize: number; - /** - * bit flag specifying mechanism capabilities - */ - flags: number; - /** - * returns string name from MechanismEnum - */ - name: string; - - constructor(handle: number, slotHandle: Handle, lib: pkcs11.PKCS11); - - protected getInfo(): void; - - static create(alg: MechanismType): pkcs11.Mechanism; - static vendor(jsonFile: string): void; - static vendor(name: string, value: number): void; -} - -declare class MechanismCollection extends Collection { - - protected slotHandle: Handle; - - constructor(items: Array, slotHandle: Handle, lib: pkcs11.PKCS11, classType?: typeof Mechanism); - /** - * returns item from collection by index - * @param {number} index of element in collection `[0..n]` - */ - items(index: number): Mechanism; -} - -declare enum MechanismEnum { - RSA_PKCS_KEY_PAIR_GEN, - RSA_PKCS, - RSA_9796, - RSA_X_509, - MD2_RSA_PKCS, - MD5_RSA_PKCS, - SHA1_RSA_PKCS, - RIPEMD128_RSA_PKCS, - RIPEMD160_RSA_PKCS, - RSA_PKCS_OAEP, - RSA_X9_31_KEY_PAIR_GEN, - RSA_X9_31, - SHA1_RSA_X9_31, - RSA_PKCS_PSS, - SHA1_RSA_PKCS_PSS, - DSA_KEY_PAIR_GEN, - DSA, - DSA_SHA1, - DSA_SHA224, - DSA_SHA256, - DSA_SHA384, - DSA_SHA512, - DH_PKCS_KEY_PAIR_GEN, - DH_PKCS_DERIVE, - X9_42_DH_KEY_PAIR_GEN, - X9_42_DH_DERIVE, - X9_42_DH_HYBRID_DERIVE, - X9_42_MQV_DERIVE, - SHA256_RSA_PKCS, - SHA384_RSA_PKCS, - SHA512_RSA_PKCS, - SHA256_RSA_PKCS_PSS, - SHA384_RSA_PKCS_PSS, - SHA512_RSA_PKCS_PSS, - SHA224_RSA_PKCS, - SHA224_RSA_PKCS_PSS, - RC2_KEY_GEN, - RC2_ECB, - RC2_CBC, - RC2_MAC, - RC2_MAC_GENERAL, - RC2_CBC_PAD, - RC4_KEY_GEN, - RC4, - DES_KEY_GEN, - DES_ECB, - DES_CBC, - DES_MAC, - DES_MAC_GENERAL, - DES_CBC_PAD, - DES2_KEY_GEN, - DES3_KEY_GEN, - DES3_ECB, - DES3_CBC, - DES3_MAC, - DES3_MAC_GENERAL, - DES3_CBC_PAD, - CDMF_KEY_GEN, - CDMF_ECB, - CDMF_CBC, - CDMF_MAC, - CDMF_MAC_GENERAL, - CDMF_CBC_PAD, - DES_OFB64, - DES_OFB8, - DES_CFB64, - DES_CFB8, - MD2, - MD2_HMAC, - MD2_HMAC_GENERAL, - MD5, - MD5_HMAC, - MD5_HMAC_GENERAL, - SHA1, - SHA, - SHA_1, - SHA_1_HMAC, - SHA_1_HMAC_GENERAL, - RIPEMD128, - RIPEMD128_HMAC, - RIPEMD128_HMAC_GENERAL, - RIPEMD160, - RIPEMD160_HMAC, - RIPEMD160_HMAC_GENERAL, - SHA256, - SHA256_HMAC, - SHA256_HMAC_GENERAL, - SHA224, - SHA224_HMAC, - SHA224_HMAC_GENERAL, - SHA384, - SHA384_HMAC, - SHA384_HMAC_GENERAL, - SHA512, - SHA512_HMAC, - SHA512_HMAC_GENERAL, - SECURID_KEY_GEN, - SECURID, - HOTP_KEY_GEN, - HOTP, - ACTI, - ACTI_KEY_GEN, - CAST_KEY_GEN, - CAST_ECB, - CAST_CBC, - CAST_MAC, - CAST_MAC_GENERAL, - CAST_CBC_PAD, - CAST3_KEY_GEN, - CAST3_ECB, - CAST3_CBC, - CAST3_MAC, - CAST3_MAC_GENERAL, - CAST3_CBC_PAD, - CAST5_KEY_GEN, - CAST128_KEY_GEN, - CAST5_ECB, - CAST128_ECB, - CAST5_CBC, - CAST128_CBC, - CAST5_MAC, - CAST128_MAC, - CAST5_MAC_GENERAL, - CAST128_MAC_GENERAL, - CAST5_CBC_PAD, - CAST128_CBC_PAD, - RC5_KEY_GEN, - RC5_ECB, - RC5_CBC, - RC5_MAC, - RC5_MAC_GENERAL, - RC5_CBC_PAD, - IDEA_KEY_GEN, - IDEA_ECB, - IDEA_CBC, - IDEA_MAC, - IDEA_MAC_GENERAL, - IDEA_CBC_PAD, - GENERIC_SECRET_KEY_GEN, - CONCATENATE_BASE_AND_KEY, - CONCATENATE_BASE_AND_DATA, - CONCATENATE_DATA_AND_BASE, - XOR_BASE_AND_DATA, - EXTRACT_KEY_FROM_KEY, - SSL3_PRE_MASTER_KEY_GEN, - SSL3_MASTER_KEY_DERIVE, - SSL3_KEY_AND_MAC_DERIVE, - SSL3_MASTER_KEY_DERIVE_DH, - TLS_PRE_MASTER_KEY_GEN, - TLS_MASTER_KEY_DERIVE, - TLS_KEY_AND_MAC_DERIVE, - TLS_MASTER_KEY_DERIVE_DH, - TLS_PRF, - SSL3_MD5_MAC, - SSL3_SHA1_MAC, - MD5_KEY_DERIVATION, - MD2_KEY_DERIVATION, - SHA1_KEY_DERIVATION, - SHA256_KEY_DERIVATION, - SHA384_KEY_DERIVATION, - SHA512_KEY_DERIVATION, - SHA224_KEY_DERIVATION, - PBE_MD2_DES_CBC, - PBE_MD5_DES_CBC, - PBE_MD5_CAST_CBC, - PBE_MD5_CAST3_CBC, - PBE_MD5_CAST5_CBC, - PBE_MD5_CAST128_CBC, - PBE_SHA1_CAST5_CBC, - PBE_SHA1_CAST128_CBC, - PBE_SHA1_RC4_128, - PBE_SHA1_RC4_40, - PBE_SHA1_DES3_EDE_CBC, - PBE_SHA1_DES2_EDE_CBC, - PBE_SHA1_RC2_128_CBC, - PBE_SHA1_RC2_40_CBC, - PKCS5_PBKD2, - PBA_SHA1_WITH_SHA1_HMAC, - WTLS_PRE_MASTER_KEY_GEN, - WTLS_MASTER_KEY_DERIVE, - WTLS_MASTER_KEY_DERIVE_DH_ECC, - WTLS_PRF, - WTLS_SERVER_KEY_AND_MAC_DERIVE, - WTLS_CLIENT_KEY_AND_MAC_DERIVE, - KEY_WRAP_LYNKS, - KEY_WRAP_SET_OAEP, - CAMELLIA_KEY_GEN, - CAMELLIA_ECB, - CAMELLIA_CBC, - CAMELLIA_MAC, - CAMELLIA_MAC_GENERAL, - CAMELLIA_CBC_PAD, - CAMELLIA_ECB_ENCRYPT_DATA, - CAMELLIA_CBC_ENCRYPT_DATA, - CAMELLIA_CTR, - ARIA_KEY_GEN, - ARIA_ECB, - ARIA_CBC, - ARIA_MAC, - ARIA_MAC_GENERAL, - ARIA_CBC_PAD, - ARIA_ECB_ENCRYPT_DATA, - ARIA_CBC_ENCRYPT_DATA, - SKIPJACK_KEY_GEN, - SKIPJACK_ECB64, - SKIPJACK_CBC64, - SKIPJACK_OFB64, - SKIPJACK_CFB64, - SKIPJACK_CFB32, - SKIPJACK_CFB16, - SKIPJACK_CFB8, - SKIPJACK_WRAP, - SKIPJACK_PRIVATE_WRAP, - SKIPJACK_RELAYX, - KEA_KEY_PAIR_GEN, - KEA_KEY_DERIVE, - FORTEZZA_TIMESTAMP, - BATON_KEY_GEN, - BATON_ECB128, - BATON_ECB96, - BATON_CBC128, - BATON_COUNTER, - BATON_SHUFFLE, - BATON_WRAP, - ECDSA_KEY_PAIR_GEN, - EC_KEY_PAIR_GEN, - ECDSA, - ECDSA_SHA1, - ECDSA_SHA224, - ECDSA_SHA256, - ECDSA_SHA384, - ECDSA_SHA512, - ECDH1_DERIVE, - ECDH1_COFACTOR_DERIVE, - ECMQV_DERIVE, - JUNIPER_KEY_GEN, - JUNIPER_ECB128, - JUNIPER_CBC128, - JUNIPER_COUNTER, - JUNIPER_SHUFFLE, - JUNIPER_WRAP, - FASTHASH, - AES_KEY_GEN, - AES_ECB, - AES_CBC, - AES_MAC, - AES_MAC_GENERAL, - AES_CBC_PAD, - AES_CTR, - AES_CMAC, - AES_CMAC_GENERAL, - BLOWFISH_KEY_GEN, - BLOWFISH_CBC, - TWOFISH_KEY_GEN, - TWOFISH_CBC, - AES_GCM, - AES_CCM, - AES_KEY_WRAP, - AES_KEY_WRAP_PAD, - DES_ECB_ENCRYPT_DATA, - DES_CBC_ENCRYPT_DATA, - DES3_ECB_ENCRYPT_DATA, - DES3_CBC_ENCRYPT_DATA, - AES_ECB_ENCRYPT_DATA, - AES_CBC_ENCRYPT_DATA, - GOSTR3410_KEY_PAIR_GEN, - GOSTR3410, - GOSTR3410_WITH_GOSTR3411, - GOSTR3410_KEY_WRAP, - GOSTR3410_DERIVE, - GOSTR3411, - GOSTR3411_HMAC, - GOST28147_KEY_GEN, - GOST28147_ECB, - GOST28147, - GOST28147_MAC, - GOST28147_KEY_WRAP, - DSA_PARAMETER_GEN, - DH_PKCS_PARAMETER_GEN, - X9_42_DH_PARAMETER_GEN, - VENDOR_DEFINED, -} - -declare enum SessionFlag { - /** - * `True` if the session is read/write; `false` if the session is read-only - */ - RW_SESSION, - /** - * This flag is provided for backward compatibility, and should always be set to `true` - */ - SERIAL_SESSION, -} - -declare enum UserType { - /** - * Security Officer - */ - SO, - /** - * User - */ - USER, - /** - * Context specific - */ - CONTEXT_SPECIFIC, -} - -interface IKeyPair { - privateKey: PrivateKey; - publicKey: PublicKey; -} - -/** - * provides information about a session - * - * @export - * @declare class Session - * @extends {core.HandleObject} - */ -declare class Session extends HandleObject { - - constructor(handle: Handle, slot: Slot, lib: pkcs11.PKCS11); - /** - * Slot - * - * @type {Slot} - */ - slot: Slot; - /** - * the state of the session - * - * @type {number} - */ - state: number; - /** - * bit flags that define the type of session - * - * @type {number} - */ - flags: number; - /** - * an error code defined by the cryptographic device. Used for errors not covered by Cryptoki - * - * @type {number} - */ - deviceError: number; - - protected getInfo(): void; - - /** - * closes a session between an application and a token - */ - close(): void; - /** - * initializes the normal user's PIN - * @param {string} pin the normal user's PIN - */ - initPin(pin: string): void; - /** - * modifies the PIN of the user who is logged in - * @param {string} oldPin - * @param {string} newPin - */ - setPin(oldPin: string, newPin: string): void; - /** - * obtains a copy of the cryptographic operations state of a session, encoded as a string of bytes - */ - getOperationState(): Buffer; - /** - * restores the cryptographic operations state of a session - * from a string of bytes obtained with getOperationState - * @param {Buffer} state the saved state - * @param {number} encryptionKey holds key which will be used for an ongoing encryption - * or decryption operation in the restored session - * (or 0 if no encryption or decryption key is needed, - * either because no such operation is ongoing in the stored session - * or because all the necessary key information is present in the saved state) - * @param {number} authenticationKey holds a handle to the key which will be used for an ongoing signature, - * MACing, or verification operation in the restored session - * (or 0 if no such key is needed, either because no such operation is ongoing in the stored session - * or because all the necessary key information is present in the saved state) - */ - setOperationState(state: Buffer, encryptionKey?: number, authenticationKey?: number): void; - /** - * logs a user into a token - * @param {string} pin the user's PIN. - * - This standard allows PIN values to contain any valid `UTF8` character, - * but the token may impose subset restrictions - * @param {} userType the user type. Default is `USER` - */ - login(pin: string, userType?: UserType): void; - /** - * logs a user out from a token - */ - logout(): void; - /** - * creates a new object - * - Only session objects can be created during a read-only session. - * - Only public objects can be created unless the normal user is logged in. - * @param {ITemplate} template the object's template - * @returns {SessionObject} - */ - create(template: ITemplate): SessionObject; - /** - * Copies an object, creating a new object for the copy - * @param {SessionObject} object the copied object - * @param {ITemplate} template template for new object - * @returns {SessionObject} - */ - copy(object: SessionObject, template: ITemplate): SessionObject; - /** - * removes all session objects matched to template - * - if template is null, removes all session objects - * - returns a number of destroied session objects - * @param {ITemplate} template template - */ - destroy(template: ITemplate): number; - /** - * @param {SessionObject} object - */ - destroy(object: SessionObject): number; - destroy(): number; - /** - * removes all session objects - * - returns a number of destroied session objects - */ - clear(): number; - /** - * returns a collection of session objects mached to template - * @param template template - * @param callback optional callback function wich is called for each founded object - * - if callback function returns false, it breaks find function. - */ - find(callback?: (obj: SessionObject) => any): SessionObjectCollection; - find(template: ITemplate, callback?: (obj: SessionObject, index: number) => any): SessionObjectCollection; - /** - * Returns object from session by handle - * @param {number} handle handle of object - * @returns T - */ - getObject(handle: Handle): T; - /** - * generates a secret key or set of domain parameters, creating a new object. - * @param mechanism generation mechanism - * @param template template for the new key or set of domain parameters - */ - generateKey(mechanism: MechanismType, template?: ITemplate): SecretKey; - generateKey(mechanism: MechanismType, template: ITemplate, callback: (err: Error, key: SecretKey) => void): void; - generateKeyPair(mechanism: MechanismType, publicTemplate: ITemplate, privateTemplate: ITemplate): IKeyPair; - generateKeyPair(mechanism: MechanismType, publicTemplate: ITemplate, privateTemplate: ITemplate, callback: (err: Error, keys: IKeyPair) => void): void; - createSign(alg: MechanismType, key: Key): Sign; - createVerify(alg: MechanismType, key: Key): Verify; - createCipher(alg: MechanismType, key: Key): Cipher; - createDecipher(alg: MechanismType, key: Key, blockSize?: number): Decipher; - createDigest(alg: MechanismType): Digest; - wrapKey(alg: MechanismType, wrappingKey: Key, key: Key): Buffer; - wrapKey(alg: MechanismType, wrappingKey: Key, key: Key, callback: (err: Error, wkey: Buffer) => void): void; - unwrapKey(alg: MechanismType, unwrappingKey: Key, wrappedKey: Buffer, template: ITemplate): Key; - unwrapKey(alg: MechanismType, unwrappingKey: Key, wrappedKey: Buffer, template: ITemplate, callback: (err: Error, key: Key) => void): void; - /** - * derives a key from a base key, creating a new key object - * @param {MechanismType} alg key deriv. mech - * @param {Key} baseKey base key - * @param {ITemplate} template new key template - */ - deriveKey(alg: MechanismType, baseKey: Key, template: ITemplate): SecretKey; - deriveKey(alg: MechanismType, baseKey: Key, template: ITemplate, callback: (err: Error, key: Key) => void): void; - /** - * generates random data - * @param {number} size \# of bytes to generate - */ - generateRandom(size: number): Buffer; -} - -interface ITemplate { - /** - * CKA_CLASS - */ - class?: number; - /** - * CKA_TOKEN - */ - token?: boolean; - /** - * CKA_PRIVATE - */ - private?: boolean; - /** - * CKA_LABEL - */ - label?: string; - /** - * CKA_APPLICATION - */ - application?: string; - /** - * CKA_VALUE - */ - value?: Buffer; - /** - * CKA_OBJECT_ID - */ - objectId?: Buffer; - /** - * CKA_CERTIFICATE_TYPE - */ - certType?: number; - /** - * CKA_ISSUER - */ - issuer?: Buffer; - /** - * CKA_SERIAL_NUMBER - */ - serial?: Buffer; - /** - * CKA_AC_ISSUER - */ - issuerAC?: Buffer; - /** - * CKA_OWNER - */ - owner?: Buffer; - /** - * CKA_ATTR_TYPES - */ - attrTypes?: Buffer; - /** - * CKA_TRUSTED - */ - trusted?: boolean; - /** - * CKA_CERTIFICATE_CATEGORY - */ - certCategory?: number; - /** - * CKA_JAVA_MIDP_SECURITY_DOMAIN - */ - javaDomain?: number; - /** - * CKA_URL - */ - url?: string; - /** - * CKA_HASH_OF_SUBJECT_PUBLIC_KEY - */ - ski?: Buffer; - /** - * CKA_HASH_OF_ISSUER_PUBLIC_KEY - */ - aki?: Buffer; - /** - * CKA_NAME_HASH_ALGORITHM - */ - digestName?: number; - /** - * CKA_CHECK_VALUE - */ - checkValue?: Buffer; - /** - * CKA_KEY_TYPE - */ - keyType?: number; - /** - * CKA_SUBJECT - */ - subject?: Buffer; - /** - * CKA_ID - */ - id?: Buffer; - /** - * CKA_SENSITIVE - */ - sensitive?: boolean; - /** - * CKA_ENCRYPT - */ - encrypt?: boolean; - /** - * CKA_DECRYPT - */ - decrypt?: boolean; - /** - * CKA_WRAP - */ - wrap?: boolean; - /** - * CKA_UNWRAP - */ - unwrap?: boolean; - /** - * CKA_SIGN - */ - sign?: boolean; - /** - * CKA_SIGN_RECOVER - */ - signRecover?: boolean; - /** - * CKA_VERIFY - */ - verify?: boolean; - /** - * CKA_VERIFY_RECOVER - */ - verifyRecover?: boolean; - /** - * CKA_DERIVE - */ - derive?: boolean; - /** - * CKA_START_DATE - */ - startDate?: Date; - /** - * CKA_END_DATE - */ - endDate?: Date; - /** - * CKA_MODULUS - */ - modulus?: Buffer; - /** - * CKA_MODULUS_BITS - */ - modulusBits?: number; - /** - * CKA_PUBLIC_EXPONENT - */ - publicExponent?: Buffer; - /** - * CKA_PRIVATE_EXPONEN - */ - privateExponent?: Buffer; - /** - * CKA_PRIME_1 - */ - prime1?: Buffer; - /** - * CKA_PRIME_2 - */ - prime2?: Buffer; - /** - * CKA_EXPONENT_1 - */ - exp1?: Buffer; - /** - * CKA_EXPONENT_2 - */ - exp2?: Buffer; - /** - * CKA_COEFFICIEN - */ - coefficient?: Buffer; - /** - * CKA_PRIME - */ - prime?: Buffer; - /** - * CKA_SUBPRIME - */ - subprime?: Buffer; - /** - * CKA_BASE - */ - base?: Buffer; - /** - * CKA_PRIME_BITS - */ - primeBits?: number; - /** - * CKA_SUBPRIME_BITS - */ - subprimeBits?: number; - /** - * CKA_VALUE_BITS - */ - valueBits?: number; - /** - * CKA_VALUE_LEN - */ - valueLen?: number; - /** - * CKA_EXTRACTABLE - */ - extractable?: boolean; - /** - * CKA_LOCAL - */ - local?: boolean; - /** - * CKA_NEVER_EXTRACTABLE - */ - neverExtractable?: boolean; - /** - * CKA_ALWAYS_SENSITIVE - */ - alwaysSensitive?: boolean; - /** - * CKA_KEY_GEN_MECHANISM - */ - keyGenMechanism?: number; - /** - * CKA_MODIFIABLE - */ - modifiable?: boolean; - /** - * CKA_COPYABLE - */ - copyable?: boolean; - /** - * CKA_ECDSA_PARAMS - */ - paramsECDSA?: Buffer; - paramsEC?: Buffer; - /** - * CKA_EC_POINT - */ - pointEC?: Buffer; - /** - * CKA_SECONDARY_AUTH - */ - secondaryAuth?: boolean; - /** - * CKA_AUTH_PIN_FLAGS - */ - authPinFlags?: Buffer; - /** - * CKA_ALWAYS_AUTHENTICATE - */ - alwaysAuth?: boolean; - /** - * CKA_WRAP_WITH_TRUSTED - */ - wrapWithTrusted?: boolean; - /** - * CKA_WRAP_TEMPLATE - */ - wrapTemplate?: any; - /** - * CKA_UNWRAP_TEMPLATE - */ - unwrapTemplate?: any; - /** - * CKA_OTP_FORMAT - */ - otpFormat?: any; - /** - * CKA_OTP_LENGTH - */ - otpLength?: any; - /** - * CKA_OTP_TIME_INTERVAL - */ - otpTimeInterval?: any; - /** - * CKA_OTP_USER_FRIENDLY_MODE - */ - otpUserFriendlyMode?: any; - /** - * CKA_OTP_CHALLENGE_REQUIREMENT - */ - otpChallengeReq?: any; - /** - * CKA_OTP_TIME_REQUIREMENT - */ - otpTimeReq?: any; - /** - * CKA_OTP_COUNTER_REQUIREMENT - */ - otpCounterReq?: any; - /** - * CKA_OTP_PIN_REQUIREMENT - */ - otppinReq?: any; - /** - * CKA_OTP_COUNTER - */ - otpCounter?: any; - /** - * CKA_OTP_TIME - */ - otpTime?: any; - /** - * CKA_OTP_USER_IDENTIFIER - */ - otpUserId?: any; - /** - * CKA_OTP_SERVICE_IDENTIFIER - */ - otpServiceId?: any; - /** - * CKA_OTP_SERVICE_LOGO - */ - otpServiceLogo?: any; - /** - * CKA_OTP_SERVICE_LOGO_TYPE - */ - otpServiceLogoType?: any; - /** - * CKA_HW_FEATURE_TYPE - */ - hwFeatureType?: any; - /** - * CKA_RESET_ON_INIT - */ - resetOnInit?: any; - /** - * CKA_HAS_RESET - */ - hasReset?: any; - /** - * CKA_PIXEL_X - */ - pixelX?: any; - /** - * CKA_PIXEL_Y - */ - pixelY?: any; - /** - * CKA_RESOLUTION - */ - resolution?: any; - /** - * CKA_CHAR_ROWS - */ - charRows?: any; - /** - * CKA_CHAR_COLUMNS - */ - charCols?: any; - /** - * CKA_COLOR - */ - color?: any; - /** - * CKA_BITS_PER_PIXEL - */ - bitsPerPixel?: any; - /** - * CKA_CHAR_SETS - */ - charSets?: any; - /** - * CKA_ENCODING_METHODS - */ - encMethod?: any; - /** - * CKA_MIME_TYPES - */ - mimeTypes?: any; - /** - * CKA_MECHANISM_TYPE - */ - mechanismType?: any; - /** - * CKA_REQUIRED_CMS_ATTRIBUTES - */ - requiredCmsAttrs?: any; - /** - * CKA_DEFAULT_CMS_ATTRIBUTES - */ - defaultCmsAttrs?: any; - /** - * CKA_SUPPORTED_CMS_ATTRIBUTES - */ - suportedCmsAttrs?: any; - /** - * CKA_ALLOWED_MECHANISMS - */ - allowedMechanisms?: any; -} - -declare class Template { - static toPkcs11(tmpl: ITemplate): pkcs11.Attribute[]; - static fromPkcs11(tmpl: pkcs11.Template): ITemplate; -} - -declare enum SlotFlag { - /** - * `True` if a token is present in the slot (e.g., a device is in the reader) - */ - TOKEN_PRESENT, - /** - * `True` if the reader supports removable devices - */ - REMOVABLE_DEVICE, - /** - * True if the slot is a hardware slot, as opposed to a software slot implementing a "soft token" - */ - HW_SLOT, -} -declare class Slot extends HandleObject { - - slotDescription: string; - manufacturerID: string; - flags: number; - hardwareVersion: pkcs11.Version; - firmwareVersion: pkcs11.Version; - module: Module; - - constructor(handle: Handle, module: Module, lib: pkcs11.PKCS11); - - /** - * Recieve information about Slot - * - * @protected - */ - protected getInfo(): void; - - /** - * Returns information about token - * - * @returns {Token} - */ - getToken(): Token; - /** - * returns list of `MechanismInfo` - * - * @returns {MechanismCollection} - */ - getMechanisms(): MechanismCollection; - /** - * initializes a token - * - * @param {string} pin the SO's initial PIN - * @returns {string} - */ - initToken(pin: string): string; - /** - * opens a session between an application and a token in a particular slot - * - * @param {SessionFlag} [flags=session.SessionFlag.SERIAL_SESSION] indicates the type of session - * @returns {Session} - */ - open(flags?: SessionFlag): Session; - /** - * closes all sessions an application has with a token - */ - closeAll(): void; -} - -/** - * Collection of slots - * - * @export - * @declare class SlotCollection - * @extends {core.Collection} - */ -declare class SlotCollection extends Collection { - module: Module; - items(index: number): Slot; - constructor(items: Array, module: Module, lib: pkcs11.PKCS11, classType?: any); -} - -declare enum TokenFlag { - RNG, - WRITE_PROTECTED, - LOGIN_REQUIRED, - USER_PIN_INITIALIZED, - RESTORE_KEY_NOT_NEEDED, - CLOCK_ON_TOKEN, - PROTECTED_AUTHENTICATION_PATH, - DUAL_CRYPTO_OPERATIONS, - TOKEN_INITIALIZED, - SECONDARY_AUTHENTICATION, - USER_PIN_COUNT_LOW, - USER_PIN_FINAL_TRY, - USER_PIN_LOCKED, - USER_PIN_TO_BE_CHANGED, - SO_PIN_COUNT_LOW, - SO_PIN_FINAL_TRY, - SO_PIN_LOCKED, - SO_PIN_TO_BE_CHANGED, - ERROR_STATE, -} - -declare class Token extends HandleObject { - /** - * application-defined label, assigned during token initialization. - * - Must be padded with the blank character (' '). - * - Should __not__ be null-terminated. - */ - label: string; - /** - * ID of the device manufacturer. - * - Must be padded with the blank character (' '). - * - Should __not__ be null-terminated. - */ - manufacturerID: string; - /** - * model of the device. - * - Must be padded with the blank character (' '). - * - Should __not__ be null-terminated. - */ - model: string; - /** - * character-string serial number of the device. - * - Must be padded with the blank character (' '). - * - Should __not__ be null-terminated. - */ - serialNumber: string; - /** - * bit flags indicating capabilities and status of the device - */ - flags: number; - /** - * maximum number of sessions that can be opened with the token at one time by a single application - */ - maxSessionCount: number; - /** - * number of sessions that this application currently has open with the token - */ - sessionCount: number; - /** - * maximum number of read/write sessions that can be opened - * with the token at one time by a single application - */ - maxRwSessionCount: number; - /** - * number of read/write sessions that this application currently has open with the token - */ - rwSessionCount: number; - /** - * maximum length in bytes of the PIN - */ - maxPinLen: number; - /** - * minimum length in bytes of the PIN - */ - minPinLen: number; - /** - * the total amount of memory on the token in bytes in which public objects may be stored - */ - totalPublicMemory: number; - /** - * the amount of free (unused) memory on the token in bytes for public objects - */ - freePublicMemory: number; - /** - * the total amount of memory on the token in bytes in which private objects may be stored - */ - totalPrivateMemory: number; - /** - * the amount of free (unused) memory on the token in bytes for private objects - */ - freePrivateMemory: number; - /** - * version number of hardware - */ - hardwareVersion: pkcs11.Version; - /** - * version number of firmware - */ - firmwareVersion: pkcs11.Version; - /** - * current time as a character-string of length 16, - * represented in the format YYYYMMDDhhmmssxx - */ - utcTime: Date; - - constructor(handle: Handle, lib: pkcs11.PKCS11); - - protected getInfo(): void; -} - -declare class Module extends BaseObject { - libFile: string; - libName: string; - /** - * Cryptoki interface version - */ - cryptokiVersion: pkcs11.Version; - /** - * blank padded manufacturer ID - */ - manufacturerID: string; - /** - * must be zero - */ - flags: number; - /** - * blank padded library description - */ - libraryDescription: string; - /** - * version of library - */ - libraryVersion: pkcs11.Version; - constructor(lib: pkcs11.PKCS11); - protected getInfo(): void; - /** - * initializes the Cryptoki library - */ - initialize(): void; - /** - * indicates that an application is done with the Cryptoki library - */ - finalize(): void; - /** - * obtains a list of slots in the system - * @param {number} index index of an element in collection - * @param {number} tokenPresent only slots with tokens. Default `True` - */ - getSlots(index: number, tokenPresent?: boolean): Slot; - /** - * @param {number} tokenPresent only slots with tokens. Default `True` - */ - getSlots(tokenPresent?: boolean): SlotCollection; - /** - * loads pkcs11 lib - * @param libFile path to PKCS11 library - * @param libName name of PKCS11 library - */ - static load(libFile: string, libName?: string): Module; -} diff --git a/graphite-udp/index.d.ts b/graphite-udp/index.d.ts deleted file mode 100644 index 218888b39a..0000000000 --- a/graphite-udp/index.d.ts +++ /dev/null @@ -1,97 +0,0 @@ -// Type definitions for graphite-udp 1.2 -// Project: https://github.com/fermads/graphite-udp -// Definitions by: Eric Byers -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - - -interface ClientOptions { - /** - * graphite server host or ip - * Defaults to 127.0.0.1 - */ - host?: string; - - /** - * graphite server udp port - * Defaults to 2003 - */ - port?: number; - - /** - * udp type (udp4 or udp6) - * Defaults to udp4 - */ - type?: 'udp4' | 'udp6'; - - /** - * split into smaller UDP packets - * Defaults to 4096 - */ - maxPacketSize?: number; - - /** - * Prefix for each metric name - * Defaults to '' - */ - prefix?: string; - - /** - * Suffix for each metrtic name - * Defaults to '' - */ - suffix?: string; - - /** - * Interval to group metrics by in milliseconds - * Defaults to 5000 (5s) - */ - interval?: number; - - /** - * log messages to console - * Defaults to false - */ - verbose?: boolean; - - /** - * called when metrics are sent - * Defaults to null - * - * @param {error} Error - * @param {metrics} - * @return void - */ - callback?: (error: Error, metrics: any) => void; -} - -export class Client { - - constructor(clientOptions?: ClientOptions); - - /** - * During the interval time option, if 2 or more metrics with the same name are sent, metrics will be added (summed) - * - * @param {name} - * @param {value} number - * @return void - */ - add(name: string, value: number): void; - - /** - * During the interval time option, if 2 or more metrics with the same name are sent, the last one will be used - * - * @param {name} metric name (my.test.metric) - * @param {value} number - * @return void - */ - put(name: string, value: number): void; - - /** - * Close the underlying UDP client socket - * - * @return void - */ - close(): void; -} - -export function createClient(clientOptions?: ClientOptions): Client; diff --git a/graphite-udp/tslint.json b/graphite-udp/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/graphite-udp/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/graphlib/index.d.ts b/graphlib/index.d.ts deleted file mode 100644 index 773cb621d1..0000000000 --- a/graphlib/index.d.ts +++ /dev/null @@ -1,601 +0,0 @@ -// Type definitions for graphlib 2.1.1 -// Project: https://github.com/cpettitt/graphlib -// Definitions by: Dan Vanderkam , Dan Mironenko -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - - -declare module "graphlib" { - export interface GraphOptions { - directed?: boolean; // default: true. - multigraph?: boolean; // default: false. - compound?: boolean; // default: false. - } - - export interface Edge { - v: string; - w: string; - /** The name that uniquely identifies a multi-edge. */ - name?: string; - } - - export class Graph { - constructor(options?: GraphOptions); - - /** - * Sets the default node label. This label will be assigned as default label - * in case if no label was specified while setting a node. - * Complexity: O(1). - * - * @argument label - default node label. - * @returns the graph, allowing this to be chained with other functions. - */ - setDefaultNodeLabel(label: any): Graph; - - /** - * Sets the default node label factory function. This function will be invoked - * each time when setting a node with no label specified and returned value - * will be used as a label for node. - * Complexity: O(1). - * - * @argument labelFn - default node label factory function. - * @returns the graph, allowing this to be chained with other functions. - */ - setDefaultNodeLabel(labelFn: (v: string) => any): Graph; - - /** - * Creates or updates the value for the node v in the graph. If label is supplied - * it is set as the value for the node. If label is not supplied and the node was - * created by this call then the default node label will be assigned. - * Complexity: O(1). - * - * @argument name - node name. - * @argument label - value to set for node. - * @returns the graph, allowing this to be chained with other functions. - */ - setNode(name: string, label?: any): Graph; - - /** - * Invokes setNode method for each node in names list. - * Complexity: O(|names|). - * - * @argument names - list of nodes names to be set. - * @argument label - value to set for each node in list. - * @returns the graph, allowing this to be chained with other functions. - */ - setNodes(names: string[], label?: any): Graph; - - /** - * Sets node p as a parent for node v. Method throws an exception in case of - * invoking it in context of noncompound graph. - * Average-case complexity: O(1). - * - * @argument v - node to be child for p. - * @argument p - node to be parent for v. - * @returns the graph, allowing this to be chained with other functions. - */ - setParent(v: string, p: string): Graph; - - /** - * Gets parent node for node v. - * Complexity: O(1). - * - * @argument v - node to get parent of. - * @returns parent node name or void if v has no parent. - */ - parent(v: string): string | void; - - /** - * Gets list of direct children of node v. - * Complexity: O(1). - * - * @argument v - node to get children of. - * @returns children nodes names list. - */ - children(v: string): string[]; - - /** - * Creates new graph with nodes filtered via filter. Edges incident to rejected node - * are also removed. In case of compound graph, if parent is rejected by filter, - * than all its children are rejected too. - * Average-case complexity: O(|E|+|V|). - * - * @argument filter - filtration function detecting whether the node should stay or not. - * @returns new graph made from current and nodes filtered. - */ - filterNodes(filter: (v: string) => boolean): Graph; - - /** - * Sets the default edge label. This label will be assigned as default label - * in case if no label was specified while setting an edge. - * Complexity: O(1). - * - * @argument label - default edge label. - * @returns the graph, allowing this to be chained with other functions. - */ - setDefaultEdgeLabel(label: any): Graph; - - /** - * Sets the default edge label factory function. This function will be invoked - * each time when setting an edge with no label specified and returned value - * will be used as a label for edge. - * Complexity: O(1). - * - * @argument labelFn - default edge label factory function. - * @returns the graph, allowing this to be chained with other functions. - */ - setDefaultEdgeLabel(labelFn: (v: string) => any): Graph; - - /** - * Establish an edges path over the nodes in nodes list. If some edge is already - * exists, it will update its label, otherwise it will create an edge between pair - * of nodes with label provided or default label if no label provided. - * Complexity: O(|nodes|). - * - * @argument nodes - list of nodes to be connected in series. - * @argument label - value to set for each edge between pairs of nodes. - * @returns the graph, allowing this to be chained with other functions. - */ - setPath(nodes: string[], label?: any): Graph; - - /** - * Detects whether graph has a node with specified name or not. - - * - * @argument name - name of the node. - * @returns true if graph has node with specified name, false - otherwise. - */ - hasNode(name: string): boolean; - - /** - * Remove the node with the name from the graph or do nothing if the node is not in - * the graph. If the node was removed this function also removes any incident - * edges. - * Complexity: O(1). - * - * @argument name - name of the node. - * @returns the graph, allowing this to be chained with other functions. - */ - removeNode(name: string): Graph; - - /** - * Gets all nodes of the graph. Note, the in case of compound graph subnodes are - * not included in list. - * Complexity: O(1). - * - * @returns list of graph nodes. - */ - nodes(): string[]; - - /** - * Gets the label of node with specified name. - * Complexity: O(|V|). - * - * @returns label value of the node. - */ - node(name: string): any; - - /** - * Creates or updates the label for the edge (v, w) with the optionally supplied - * name. If label is supplied it is set as the value for the edge. If label is not - * supplied and the edge was created by this call then the default edge label will - * be assigned. The name parameter is only useful with multigraphs. - * Complexity: O(1). - * - * @argument v - edge source node. - * @argument w - edge sink node. - * @argument label - value to associate with the edge. - * @argument name - unique name of the edge in order to identify it in multigraph. - * @returns the graph, allowing this to be chained with other functions. - */ - setEdge(v: string, w: string, label?: any, name?: string): Graph; - - /** - * Creates or updates the label for the specified edge. If label is supplied it is - * set as the value for the edge. If label is not supplied and the edge was created - * by this call then the default edge label will be assigned. The name parameter is - * only useful with multigraphs. - * Complexity: O(1). - * - * @argument edge - edge descriptor. - * @argument label - value to associate with the edge. - * @returns the graph, allowing this to be chained with other functions. - */ - setEdge(edge: Edge, label?: any): Graph; - - /** - * Gets edges of the graph. In case of compound graph subgraphs are not considered. - * Complexity: O(|E|). - * - * @return graph edges list. - */ - edges(): Edge[]; - - /** - * Gets the label for the specified edge. - * Complexity: O(1). - * - * @argument v - edge source node. - * @argument w - edge sink node. - * @argument name - name of the edge (actual for multigraph). - * @returns value associated with specified edge. - */ - edge(v: string, w: string, name?: string): any; - - /** - * Gets the label for the specified edge. - * Complexity: O(1). - * - * @argument edge - edge descriptor. - * @returns value associated with specified edge. - */ - edge(e: Edge): any; - - /** - * Detects whether the graph contains specified edge or not. No subgraphs are considered. - * Complexity: O(1). - * - * @argument v - edge source node. - * @argument w - edge sink node. - * @argument name - name of the edge (actual for multigraph). - * @returns whether the graph contains the specified edge or not. - */ - hasEdge(v: string, w: string, name?: string): boolean; - - /** - * Detects whether the graph contains specified edge or not. No subgraphs are considered. - * Complexity: O(1). - * - * @argument edge - edge descriptor. - * @returns whether the graph contains the specified edge or not. - */ - hasEdge(edge: Edge): boolean; - - /** - * Removes the specified edge from the graph. No subgraphs are considered. - * Complexity: O(1). - * - * @argument edge - edge descriptor. - * @returns the graph, allowing this to be chained with other functions. - */ - removeEdge(edge: Edge): Graph; - - /** - * Removes the specified edge from the graph. No subgraphs are considered. - * Complexity: O(1). - * - * @argument v - edge source node. - * @argument w - edge sink node. - * @argument name - name of the edge (actual for multigraph). - * @returns the graph, allowing this to be chained with other functions. - */ - removeEdge(v: string, w: string, name?: string): Graph; - - /** - * Return all edges that point to the node v. Optionally filters those edges down to just those - * coming from node u. Behavior is undefined for undirected graphs - use nodeEdges instead. - * Complexity: O(|E|). - * - * @argument v - edge sink node. - * @argument w - edge source node. - * @returns edges descriptors list if v is in the graph, or undefined otherwise. - */ - inEdges(v: string, w?: string): void | Edge[]; - - /** - * Return all edges that are pointed at by node v. Optionally filters those edges down to just - * those point to w. Behavior is undefined for undirected graphs - use nodeEdges instead. - * Complexity: O(|E|). - * - * @argument v - edge source node. - * @argument w - edge sink node. - * @returns edges descriptors list if v is in the graph, or undefined otherwise. - */ - outEdges(v: string, w?: string): void | Edge[]; - - /** - * Returns all edges to or from node v regardless of direction. Optionally filters those edges - * down to just those between nodes v and w regardless of direction. - * Complexity: O(|E|). - * - * @argument v - edge adjacent node. - * @argument w - edge adjacent node. - * @returns edges descriptors list if v is in the graph, or undefined otherwise. - */ - nodeEdges(v: string, w?: string): void | Edge[]; - - /** - * Return all nodes that are predecessors of the specified node or undefined if node v is not in - * the graph. Behavior is undefined for undirected graphs - use neighbors instead. - * Complexity: O(|V|). - * - * @argument v - node identifier. - * @returns node identifiers list or undefined if v is not in the graph. - */ - predecessors(v: string): void | string[]; - - /** - * Return all nodes that are successors of the specified node or undefined if node v is not in - * the graph. Behavior is undefined for undirected graphs - use neighbors instead. - * Complexity: O(|V|). - * - * @argument v - node identifier. - * @returns node identifiers list or undefined if v is not in the graph. - */ - successors(v: string): void | string[]; - - /** - * Return all nodes that are predecessors or successors of the specified node or undefined if - * node v is not in the graph. - * Complexity: O(|V|). - * - * @argument v - node identifier. - * @returns node identifiers list or undefined if v is not in the graph. - */ - - neighbors(v: string): void | string[]; - - /** - * Whether graph was created with 'directed' flag set to true or not. - * - * @returns whether the graph edges have an orientation. - */ - isDirected(): boolean; - - /** - * Whether graph was created with 'multigraph' flag set to true or not. - * - * @returns whether the pair of nodes of the graph can have multiple edges. - */ - isMultigraph(): boolean; - - /** - * Whether graph was created with 'compound' flag set to true or not. - * - * @returns whether a node of the graph can have subnodes. - */ - isCompound(): boolean; - - /** - * Sets the label of the graph. - * - * @argument label - label value. - * @returns the graph, allowing this to be chained with other functions. - */ - setGraph(label: string): Graph; - - /** - * Gets the graph label. - * - * @returns currently assigned label for the graph or undefined if no label assigned. - */ - graph(): void | string; - - /** - * Gets the number of nodes in the graph. - * Complexity: O(1). - * - * @returns nodes count. - */ - nodeCount(): number; - - /** - * Gets the number of edges in the graph. - * Complexity: O(1). - * - * @returns edges count. - */ - edgeCount(): number; - - /** - * Gets list of nodes without in-edges. - * Complexity: O(|V|). - * - * @returns the graph source nodes. - */ - sources(): string[]; - - /** - * Gets list of nodes without out-edges. - * Complexity: O(|V|). - * - * @returns the graph source nodes. - */ - sinks(): string[]; - } - - export namespace json { - /** - * Creates a JSON representation of the graph that can be serialized to a string with - * JSON.stringify. The graph can later be restored using json.read. - * - * @argument graph - target to create JSON representation of. - * @returns JSON serializable graph representation - */ - function write(graph: Graph): Object; - - /** - * Takes JSON as input and returns the graph representation. - * - * @example - * var g2 = graphlib.json.read(JSON.parse(str)); - * g2.nodes(); - * // ['a', 'b'] - * g2.edges() - * // [ { v: 'a', w: 'b' } ] - * - * @argument json - JSON serializable graph representation - * @returns graph constructed acccording to specified representation - */ - function read(json: Object): Graph; - } - - export interface Path { - distance: number; - predecessor: string; - } - - export namespace alg { - /** - * Finds all connected components in a graph and returns an array of these components. - * Each component is itself an array that contains the ids of nodes in the component. - * Complexity: O(|V|). - * - * @argument graph - graph to find components in. - * @returns array of nodes list representing components - */ - function components(graph: Graph): string[][]; - - /** - * This function is an implementation of Dijkstra's algorithm which finds the shortest - * path from source to all other nodes in graph. This function returns a map of - * v -> { distance, predecessor }. The distance property holds the sum of the weights - * from source to v along the shortest path or Number.POSITIVE_INFINITY if there is no path - * from source. The predecessor property can be used to walk the individual elements of the - * path from source to v in reverse order. - * Complexity: O((|E| + |V|) * log |V|). - * - * @argument graph - graph where to search pathes. - * @argument source - node to start pathes from. - * @argument weightFn - function which takes edge e and returns the weight of it. If no weightFn - * is supplied then each edge is assumed to have a weight of 1. This function throws an - * Error if any of the traversed edges have a negative edge weight. - * @argument edgeFn - function which takes a node v and returns the ids of all edges incident to it - * for the purposes of shortest path traversal. By default this function uses the graph.outEdges. - * @returns shortest pathes map that starts from node source - */ - function dijkstra( - graph: Graph, - source: string, - weightFn?: (e: Edge) => number, - edgeFn?: (v: string) => Edge[] - ): { [node: string]: Path }; - - /** - * This function finds the shortest path from each node to every other reachable node in - * the graph. It is similar to alg.dijkstra, but instead of returning a single-source - * array, it returns a mapping of source -> alg.dijksta(g, source, weightFn, edgeFn). - * Complexity: O(|V| * (|E| + |V|) * log |V|). - * - * @argument graph - graph where to search pathes. - * @argument weightFn - function which takes edge e and returns the weight of it. If no weightFn - * is supplied then each edge is assumed to have a weight of 1. This function throws an - * Error if any of the traversed edges have a negative edge weight. - * @argument edgeFn - function which takes a node v and returns the ids of all edges incident to it - * for the purposes of shortest path traversal. By default this function uses the graph.outEdges. - * @returns shortest pathes map. - */ - function dijkstraAll( - graph: Graph, - weightFn?: (e: Edge) => number, - edgeFn?: (v: string) => Edge[] - ): { [source: string]: { [node: string]: Path } }; - - /** - * Given a Graph, graph, this function returns all nodes that are part of a cycle. As there - * may be more than one cycle in a graph this function return an array of these cycles, - * where each cycle is itself represented by an array of ids for each node involved in - * that cycle. Method alg.isAcyclic is more efficient if you only need to determine whether a graph has a - * cycle or not. - * Complexity: O(|V| + |E|). - * - * @argument graph - graph where to search cycles. - * @returns cycles list. - */ - function findCycles(graph: Graph): string[][]; - - /** - * Given a Graph, graph, this function returns true if the graph has no cycles and returns false if it - * does. This algorithm returns as soon as it detects the first cycle. You can use alg.findCycles - * to get the actual list of cycles in the graph. - * - * @argument graph - graph to detect whether it acyclic ot not. - * @returns whether graph contain cycles or not. - */ - function isAcyclic(graph: Graph): boolean; - - /** - * This function is an implementation of the Floyd-Warshall algorithm, which finds the - * shortest path from each node to every other reachable node in the graph. It is similar - * to alg.dijkstraAll, but it handles negative edge weights and is more efficient for some types - * of graphs. This function returns a map of source -> { target -> { distance, predecessor }. - * The distance property holds the sum of the weights from source to target along the shortest - * path of Number.POSITIVE_INFINITY if there is no path from source. The predecessor property - * can be used to walk the individual elements of the path from source to target in reverse - * order. - * Complexity: O(|V|^3). - * - * @argument graph - graph where to search pathes. - * @argument weightFn - function which takes edge e and returns the weight of it. If no weightFn - * is supplied then each edge is assumed to have a weight of 1. This function throws an - * Error if any of the traversed edges have a negative edge weight. - * @argument edgeFn - function which takes a node v and returns the ids of all edges incident to it - * for the purposes of shortest path traversal. By default this function uses the graph.outEdges. - * @returns shortest pathes map. - */ - function floydWarshall( - graph: Graph, - weightFn?: (e: Edge) => number, - edgeFn?: (v: string) => Edge[] - ): { [source: string]: { [node: string]: Path } }; - - /** - * Prim's algorithm takes a connected undirected graph and generates a minimum spanning tree. This - * function returns the minimum spanning tree as an undirected graph. This algorithm is derived - * from the description in "Introduction to Algorithms", Third Edition, Cormen, et al., Pg 634. - * Complexity: O(|E| * log |V|); - * - * @argument graph - graph to generate a minimum spanning tree of. - * @argument weightFn - function which takes edge e and returns the weight of it. It throws an Error if - * the graph is not connected. - * @returns minimum spanning tree of graph. - */ - function prim(graph: Graph, weightFn: (e: Edge) => number): Graph; - - /** - * This function is an implementation of Tarjan's algorithm which finds all strongly connected - * components in the directed graph g. Each strongly connected component is composed of nodes that - * can reach all other nodes in the component via directed edges. A strongly connected component - * can consist of a single node if that node cannot both reach and be reached by any other - * specific node in the graph. Components of more than one node are guaranteed to have at least - * one cycle. - * Complexity: O(|V| + |E|). - * - * @argument graph - graph to find all strongly connected components of. - * @return an array of components. Each component is itself an array that contains - * the ids of all nodes in the component. - */ - function tarjan(graph: Graph): string[][]; - - /** - * Given a Graph graph this function applies topological sorting to it. - * If the graph has a cycle it is impossible to generate such a list and CycleException is thrown. - * Complexity: O(|V| + |E|). - * - * @argument graph - graph to apply topological sorting to. - * @returns an array of nodes such that for each edge u -> v, u appears before v in the array. - */ - function topsort(graph: Graph): string[]; - - /** - * Performs pre-order depth first traversal on the input graph. If the graph is - * undirected then this algorithm will navigate using neighbors. If the graph - * is directed then this algorithm will navigate using successors. - * - * @argument graph - depth first traversal target. - * @argument vs - nodes list to traverse. - * @returns the nodes in the order they were visited as a list of their names. - */ - function preorder(graph: Graph, vs: string[]): string[] - - /** - * Performs post-order depth first traversal on the input graph. If the graph is - * undirected then this algorithm will navigate using neighbors. If the graph - * is directed then this algorithm will navigate using successors. - * - * @argument graph - depth first traversal target. - * @argument vs - nodes list to traverse. - * @returns the nodes in the order they were visited as a list of their names. - */ - function postorder(graph: Graph, vs: string[]): string[] - } -} diff --git a/graphql-date/tslint.json b/graphql-date/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/graphql-date/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/graphql-relay/index.d.ts b/graphql-relay/index.d.ts deleted file mode 100644 index 3672a2d1c0..0000000000 --- a/graphql-relay/index.d.ts +++ /dev/null @@ -1,310 +0,0 @@ -// Type definitions for graphql-relay 0.4 -// Project: https://github.com/graphql/graphql-relay-js -// Definitions by: Arvitaly , nitintutlani , Grelinfo -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - - -import { - GraphQLBoolean, - GraphQLInt, - GraphQLNonNull, - GraphQLList, - GraphQLObjectType, - GraphQLString, - GraphQLFieldConfig, - GraphQLInputFieldConfigMap, - GraphQLFieldConfigMap, - GraphQLFieldConfigArgumentMap, - GraphQLResolveInfo, - GraphQLInterfaceType, - GraphQLInputType, - GraphQLOutputType, - GraphQLFieldResolver, - GraphQLTypeResolver, - Thunk -} from "graphql"; - -// connection/connection.js - -/** - * Returns a GraphQLFieldConfigArgumentMap appropriate to include on a field - * whose return type is a connection type with forward pagination. - */ -interface ForwardConnectionArgs { - after: ConnectionCursor; - first: number; -} -export const forwardConnectionArgs: GraphQLFieldConfigArgumentMap & { - after: ConnectionCursor; - first: number; -}; - -/** - * Returns a GraphQLFieldConfigArgumentMap appropriate to include on a field - * whose return type is a connection type with backward pagination. - */ -interface BackwardConnectionArgs { - before: ConnectionCursor; - last: number; -} -export const backwardConnectionArgs: GraphQLFieldConfigArgumentMap & { - before: ConnectionCursor; - last: number; -}; - -/** - * Returns a GraphQLFieldConfigArgumentMap appropriate to include on a field - * whose return type is a connection type with bidirectional pagination. - */ -export const connectionArgs: GraphQLFieldConfigArgumentMap & ForwardConnectionArgs & BackwardConnectionArgs; - -interface ConnectionConfig { - name?: string | null; - nodeType: GraphQLObjectType; - resolveNode?: GraphQLFieldResolver | null; - resolveCursor?: GraphQLFieldResolver | null; - edgeFields?: Thunk> | null; - connectionFields?: Thunk> | null; -} - -interface GraphQLConnectionDefinitions { - edgeType: GraphQLObjectType; - connectionType: GraphQLObjectType; -} - -/** - * Returns a GraphQLObjectType for a connection with the given name, - * and whose nodes are of the specified type. - */ -export function connectionDefinitions( - config: ConnectionConfig -): GraphQLConnectionDefinitions; - -// connection/connectiontypes.js - -/** - * An flow type alias for cursors in this implementation. - */ -export type ConnectionCursor = string; - -/** - * A flow type designed to be exposed as `PageInfo` over GraphQL. - */ -export interface PageInfo { - startCursor: ConnectionCursor; - endCursor: ConnectionCursor; - hasPreviousPage: boolean; - hasNextPage: boolean; -} - -/** - * A flow type designed to be exposed as a `Connection` over GraphQL. - */ -export interface Connection { - edges: Array>; - pageInfo: PageInfo; -} - -/** - * A flow type designed to be exposed as a `Edge` over GraphQL. - */ -interface Edge { - node: T; - cursor: ConnectionCursor; -} - -/** - * A flow type describing the arguments a connection field receives in GraphQL. - */ -interface ConnectionArguments { - before?: ConnectionCursor; - after?: ConnectionCursor; - first?: number; - last?: number; -} - - -// connection/arrayconnection.js - -interface ArraySliceMetaInfo { - sliceStart: number; - arrayLength: number; -} - -/** - * A simple function that accepts an array and connection arguments, and returns - * a connection object for use in GraphQL. It uses array offsets as pagination, - * so pagination will only work if the array is static. - */ -export function connectionFromArray( - data: T[], - args: ConnectionArguments -): Connection; - -/** - * A version of `connectionFromArray` that takes a promised array, and returns a - * promised connection. - */ -export function connectionFromPromisedArray( - dataPromise: Promise, - args: ConnectionArguments -): Promise>; - -/** - * Given a slice (subset) of an array, returns a connection object for use in - * GraphQL. - * -* This function is similar to `connectionFromArray`, but is intended for use -* cases where you know the cardinality of the connection, consider it too large -* to materialize the entire array, and instead wish pass in a slice of the -* total result large enough to cover the range specified in `args`. -*/ -export function connectionFromArraySlice( - arraySlice: T[], - args: ConnectionArguments, - meta: ArraySliceMetaInfo -): Connection; - -/** - * A version of `connectionFromArraySlice` that takes a promised array slice, - * and returns a promised connection. - */ -export function connectionFromPromisedArraySlice( - dataPromise: Promise, - args: ConnectionArguments, - arrayInfo: ArraySliceMetaInfo -): Promise>; - -/** - * Creates the cursor string from an offset. - */ -export function offsetToCursor(offset: number): ConnectionCursor; - -/** - * Rederives the offset from the cursor string. - */ -export function cursorToOffset(cursor: ConnectionCursor): number; - -/** - * Return the cursor associated with an object in an array. - */ -export function cursorForObjectInConnection( - data: T[], - object: T -): ConnectionCursor; - -/** - * Given an optional cursor and a default offset, returns the offset - * to use; if the cursor contains a valid offset, that will be used, - * otherwise it will be the default. - */ -export function getOffsetWithDefault( - cursor?: ConnectionCursor, - defaultOffset?: number -): number; - -// mutation/mutation.js - -type mutationFn = ( - object: any, - ctx: any, - info: GraphQLResolveInfo -) => Promise | any; - -/** - * A description of a mutation consumable by mutationWithClientMutationId - * to create a GraphQLFieldConfig for that mutation. - * - * The inputFields and outputFields should not include `clientMutationId`, - * as this will be provided automatically. - * - * An input object will be created containing the input fields, and an - * object will be created containing the output fields. - * - * mutateAndGetPayload will receieve an Object with a key for each - * input field, and it should return an Object with a key for each - * output field. It may return synchronously, or return a Promise. - */ -interface MutationConfig { - name: string; - description?: string; - inputFields: Thunk; - outputFields: Thunk>; - mutateAndGetPayload: mutationFn; -} - -/** - * Returns a GraphQLFieldConfig for the mutation described by the - * provided MutationConfig. - */ -export function mutationWithClientMutationId( - config: MutationConfig -): GraphQLFieldConfig; - -// node/node.js - -interface GraphQLNodeDefinitions { - nodeInterface: GraphQLInterfaceType; - nodeField: GraphQLFieldConfig; -} - -type typeResolverFn = ((any: any) => GraphQLObjectType) | - ((any: any) => Promise); - -/** - * Given a function to map from an ID to an underlying object, and a function - * to map from an underlying object to the concrete GraphQLObjectType it - * corresponds to, constructs a `Node` interface that objects can implement, - * and a field config for a `node` root field. - * - * If the typeResolver is omitted, object resolution on the interface will be - * handled with the `isTypeOf` method on object types, as with any GraphQL - * interface without a provided `resolveType` method. - */ -export function nodeDefinitions( - idFetcher: ((id: string, context: TContext, info: GraphQLResolveInfo) => any), - typeResolver?: GraphQLTypeResolver -): GraphQLNodeDefinitions; - -interface ResolvedGlobalId { - type: string; - id: string; -} - -/** - * Takes a type name and an ID specific to that type name, and returns a - * "global ID" that is unique among all types. - */ -export function toGlobalId(type: string, id: string): string; - -/** - * Takes the "global ID" created by toGlobalID, and returns the type name and ID - * used to create it. - */ -export function fromGlobalId(globalId: string): ResolvedGlobalId; - -/** - * Creates the configuration for an id field on a node, using `toGlobalId` to - * construct the ID from the provided typename. The type-specific ID is fetched - * by calling idFetcher on the object, or if not provided, by accessing the `id` - * property on the object. - */ -export function globalIdField( - typeName?: string, - idFetcher?: (object: any, context: any, info: GraphQLResolveInfo) => string -): GraphQLFieldConfig; - - -// node/plural.js - -interface PluralIdentifyingRootFieldConfig { - argName: string; - inputType: GraphQLInputType; - outputType: GraphQLOutputType; - resolveSingleInput: (input: any, context: any, info: GraphQLResolveInfo) => any; - description?: string; -} - -export function pluralIdentifyingRootField( - config: PluralIdentifyingRootFieldConfig -): GraphQLFieldConfig; \ No newline at end of file diff --git a/graphql-relay/tslint.json b/graphql-relay/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/graphql-relay/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/graphql/index.d.ts b/graphql/index.d.ts deleted file mode 100644 index 43d810de02..0000000000 --- a/graphql/index.d.ts +++ /dev/null @@ -1,127 +0,0 @@ -// Type definitions for graphql v0.8.2 -// Project: https://www.npmjs.com/package/graphql -// Definitions by: TonyYang , Caleb Meredith , Dominic Watson -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - - -// The primary entry point into fulfilling a GraphQL request. -export { - graphql -} from './graphql'; - -/// - -// Create and operate on GraphQL type definitions and schema. -export * from './type'; - - -// Parse and operate on GraphQL language source files. -export * from './language'; - - -// Execute GraphQL queries. -export { - execute, - defaultFieldResolver, - responsePathAsArray, - ExecutionResult, -} from './execution'; - - -// Validate GraphQL queries. -export { - validate, - ValidationContext, - specifiedRules, -} from './validation'; - - -// Create and format GraphQL errors. -export { - GraphQLError, - formatError, - GraphQLFormattedError, - GraphQLErrorLocation, -} from './error'; - - -// Utilities for operating on GraphQL type schema and parsed sources. -export { - // The GraphQL query recommended for a full schema introspection. - introspectionQuery, - - // Gets the target Operation from a Document - getOperationAST, - - // Build a GraphQLSchema from an introspection result. - buildClientSchema, - - // Build a GraphQLSchema from a parsed GraphQL Schema language AST. - buildASTSchema, - - // Build a GraphQLSchema from a GraphQL schema language document. - buildSchema, - - // Extends an existing GraphQLSchema from a parsed GraphQL Schema - // language AST. - extendSchema, - - // Print a GraphQLSchema to GraphQL Schema language. - printSchema, - - // Print a GraphQLType to GraphQL Schema language. - printType, - - // Create a GraphQLType from a GraphQL language AST. - typeFromAST, - - // Create a JavaScript value from a GraphQL language AST. - valueFromAST, - - // Create a GraphQL language AST from a JavaScript value. - astFromValue, - - // A helper to use within recursive-descent visitors which need to be aware of - // the GraphQL type system. - TypeInfo, - - // Determine if JavaScript values adhere to a GraphQL type. - isValidJSValue, - - // Determine if AST values adhere to a GraphQL type. - isValidLiteralValue, - - // Concatenates multiple AST together. - concatAST, - - // Separates an AST into an AST per Operation. - separateOperations, - - // Comparators for types - isEqualType, - isTypeSubTypeOf, - doTypesOverlap, - - // Asserts a string is a valid GraphQL name. - assertValidName, - - BreakingChange, - - IntrospectionDirective, - IntrospectionEnumType, - IntrospectionEnumValue, - IntrospectionField, - IntrospectionInputObjectType, - IntrospectionInputValue, - IntrospectionInterfaceType, - IntrospectionListTypeRef, - IntrospectionNamedTypeRef, - IntrospectionNonNullTypeRef, - IntrospectionObjectType, - IntrospectionQuery, - IntrospectionScalarType, - IntrospectionSchema, - IntrospectionType, - IntrospectionTypeRef, - IntrospectionUnionType, -} from './utilities'; diff --git a/graphql/utilities/buildASTSchema.d.ts b/graphql/utilities/buildASTSchema.d.ts deleted file mode 100644 index cf782a30ec..0000000000 --- a/graphql/utilities/buildASTSchema.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { DocumentNode, Location } from '../language/ast'; -import { Source } from '../language/source'; -import { GraphQLSchema } from '../type/schema'; - - -/** - * This takes the ast of a schema document produced by the parse function in - * src/language/parser.js. - * - * If no schema definition is provided, then it will look for types named Query - * and Mutation. - * - * Given that AST it constructs a GraphQLSchema. The resulting schema - * has no resolve methods, so execution will use default resolvers. - */ -export function buildASTSchema(ast: DocumentNode): GraphQLSchema; - -/** - * Given an ast node, returns its string description based on a contiguous - * block full-line of comments preceding it. - */ -export function getDescription(node: { loc?: Location }): string; - -/** - * A helper function to build a GraphQLSchema directly from a source - * document. -*/ -export function buildSchema(source: string | Source): GraphQLSchema; - -/** - * Given an ast node, returns its string description based on a contiguous - * block full-line of comments preceding it. - */ -export function getDescription(node: { loc?: Location }): string; - -/** - * A helper function to build a GraphQLSchema directly from a source - * document. - */ -export function buildSchema(source: string | Source): GraphQLSchema; diff --git a/graphql/utilities/index.d.ts b/graphql/utilities/index.d.ts deleted file mode 100644 index 47cfd70ff9..0000000000 --- a/graphql/utilities/index.d.ts +++ /dev/null @@ -1,75 +0,0 @@ -// The GraphQL query recommended for a full schema introspection. -export { introspectionQuery } from './introspectionQuery'; -export { - IntrospectionQuery, - IntrospectionSchema, - IntrospectionType, - IntrospectionScalarType, - IntrospectionObjectType, - IntrospectionInterfaceType, - IntrospectionUnionType, - IntrospectionEnumType, - IntrospectionInputObjectType, - IntrospectionTypeRef, - IntrospectionNamedTypeRef, - IntrospectionListTypeRef, - IntrospectionNonNullTypeRef, - IntrospectionField, - IntrospectionInputValue, - IntrospectionEnumValue, - IntrospectionDirective, -} from './introspectionQuery'; - -// Gets the target Operation from a Document -export { getOperationAST } from './getOperationAST'; - -// Build a GraphQLSchema from an introspection result. -export { buildClientSchema } from './buildClientSchema'; - -// Build a GraphQLSchema from GraphQL Schema language. -export { buildASTSchema, buildSchema } from './buildASTSchema'; - -// Extends an existing GraphQLSchema from a parsed GraphQL Schema language AST. -export { extendSchema } from './extendSchema'; - -// Print a GraphQLSchema to GraphQL Schema language. -export { printSchema, printType, printIntrospectionSchema } from './schemaPrinter'; - -// Create a GraphQLType from a GraphQL language AST. -export { typeFromAST } from './typeFromAST'; - -// Create a JavaScript value from a GraphQL language AST. -export { valueFromAST } from './valueFromAST'; - -// Create a GraphQL language AST from a JavaScript value. -export { astFromValue } from './astFromValue'; - -// A helper to use within recursive-descent visitors which need to be aware of -// the GraphQL type system. -export { TypeInfo } from './TypeInfo'; - -// Determine if JavaScript values adhere to a GraphQL type. -export { isValidJSValue } from './isValidJSValue'; - -// Determine if AST values adhere to a GraphQL type. -export { isValidLiteralValue } from './isValidLiteralValue'; - -// Concatenates multiple AST together. -export { concatAST } from './concatAST'; - -// Separates an AST into an AST per Operation. -export { separateOperations } from './separateOperations'; - -// Comparators for types -export { - isEqualType, - isTypeSubTypeOf, - doTypesOverlap -} from './typeComparators'; - -// Asserts that a string is a valid GraphQL name -export { assertValidName } from './assertValidName'; - -// Compares two GraphQLSchemas and detects breaking changes. -export { findBreakingChanges } from './findBreakingChanges'; -export { BreakingChange } from './findBreakingChanges'; diff --git a/grecaptcha/index.d.ts b/grecaptcha/index.d.ts deleted file mode 100644 index 3759512322..0000000000 --- a/grecaptcha/index.d.ts +++ /dev/null @@ -1,80 +0,0 @@ -// Type definitions for Google Recaptcha 2.0 -// Project: https://www.google.com/recaptcha -// Definitions by: Kristof Mattei -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare var grecaptcha: ReCaptchaV2.ReCaptcha; - -declare namespace ReCaptchaV2 -{ - class ReCaptcha - { - /** - * Renders the container as a reCAPTCHA widget and returns the ID of the newly created widget. - * @param container The HTML element to render the reCAPTCHA widget. Specify either the ID of the container (string) or the DOM element itself. - * @param parameters An object containing parameters as key=value pairs, for example, {"sitekey": "your_site_key", "theme": "light"}. See @see render parameters. - * @return the ID of the newly created widget. - **/ - render(container: (string | HTMLElement), parameters?: Parameters): number; - /** - * Resets the reCAPTCHA widget. - * @param opt_widget_id Optional widget ID, defaults to the first widget created if unspecified. - **/ - reset(opt_widget_id?: number): void; - /** - * Gets the response for the reCAPTCHA widget. - * @param opt_widget_id Optional widget ID, defaults to the first widget created if unspecified. - * @return the response of the reCAPTCHA widget. - **/ - getResponse(opt_widget_id?: number): string; - } - - type Theme = "light" | "dark"; - type Type = "image" | "audio"; - type Size = "normal" | "compact"; - - interface Parameters - { - /** - * Your sitekey. - **/ - sitekey: string; - /** - * Optional. The color theme of the widget. - * Accepted values: "light", "dark" - * @default "light" - * @type {Theme} - **/ - theme?: Theme; - /** - * Optional. The type of CAPTCHA to serve. - * Accepted values: "audio", "image" - * @default "image" - * @type {Type} - **/ - type?: Type; - /** - * Optional. The size of the widget. - * Accepted values: "compact", "normal" - * @default "compact" - * @type {Size} - */ - size?: Size; - /** - * Optional. The tabindex of the widget and challenge. - * If other elements in your page use tabindex, it should be set to make user navigation easier. - **/ - tabindex?: number; - /** - * Optional. Your callback function that's executed when the user submits a successful CAPTCHA response. - * The user's response, g-recaptcha-response, will be the input for your callback function. - **/ - callback?: (response: string) => void; - /** - * Optional. Your callback function that's executed when the recaptcha response expires and the user needs to solve a new CAPTCHA. - **/ - // Notice to the reader - // I need to surround this object with quotes, this will however break intellisense in VS 2013. - "expired-callback"?: () => void; - } -} diff --git a/griddle-react/griddle-react-tests.tsx b/griddle-react/griddle-react-tests.tsx deleted file mode 100644 index 5f241feeb5..0000000000 --- a/griddle-react/griddle-react-tests.tsx +++ /dev/null @@ -1,78 +0,0 @@ -/* -Licensed under the MIT License (MIT) - -Copyright (c) 2016 David Hara -*/ - -import * as React from 'react'; -import { render } from 'react-dom'; -import Griddle, { CustomColumnComponentProps } from 'griddle-react'; -import CustomColumnComponentGrid from './test/CustomColumnComponent'; -import CustomHeaderComponentGrid from './test/CustomHeaderComponent'; -import CustomFilterComponentGrid from './test/CustomFilterComponent'; - -interface MyCustomResult { - name: string, - test: string -} - -class LinkComponent extends React.Component, any> { - render() { - var url = "speakers/" + this.props.rowData.test + "/" + this.props.data; - return {this.props.data} - } -} - -const StatelessFunctionComponent = (props: CustomColumnComponentProps) => { - var url = "speakers/" + props.rowData.test + "/" + props.data; - return {props.data} -}; - -var columnMeta = [ - { - columnName: "name", - order: 1, - locked: false, - visible: true, - customComponent: StatelessFunctionComponent - }]; - -var results: MyCustomResult[] = [ - { - name: 'David Hara', - test: 'blah' - }, - { - name: 'Hara, David', - test: 'blah2' - } -]; - -var rowMetaData = { - bodyCssClassName: (rowData: MyCustomResult) => { - return rowData.test; - } -}; - -type TypedGriddle = new () => Griddle; -const TypedGriddle = Griddle as TypedGriddle; - -render( -

        -

        Custom Column Component Grid

        - -

        Custom Header Component Grid

        - -

        Custom Filter Component Grid

        - - } - sortDescendingComponent={} - customRowComponent={LinkComponent} - /> -
        , - document.getElementById('root') -); diff --git a/griddle-react/index.d.ts b/griddle-react/index.d.ts deleted file mode 100644 index e5d3e560bb..0000000000 --- a/griddle-react/index.d.ts +++ /dev/null @@ -1,170 +0,0 @@ -// Type definitions for griddle-react 0.7 -// Project: https://github.com/griddlegriddle/griddle -// Definitions by: David Hara -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 - -/* -The MIT License (MIT) - -Copyright (c) 2016 David Hara - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -import * as React from 'react'; - -type ReactClass = React.ComponentClass | React.StatelessComponent - -export interface CustomColumnComponentProps { - data: any; - rowData: T; - metaData: ColumnMetaData; -} - -export interface CustomRowComponentProps { - data: T; -} - -export interface CustomGridComponentProps { - data: T[]; -} - -export interface CustomPagerComponentProps { - currentPage: number; - maxPage: number; - nextText: string; - previousText: string; - next(): void; - previous(): void; - setPage(number: number): void; -} - -export interface CustomHeaderComponentProps { - filterByColumn?(filter: string, columnName: string): void; - columnName: string; - displayName: string; -} - -export interface CustomFilterComponentProps { - placeholderText?: string; - changeFilter(val: any): void; -} - -export interface ColumnMetaData { - columnName: string; - cssClassName?: string; - customComponent?: ReactClass>; - customHeaderComponent?: ReactClass; - customHeaderComponentProps?: {}; - displayName?: string; - locked?: boolean; - order?: number; - sortable?: boolean; - visible?: boolean; -} - -export interface BodyCssClassNameFunction { - (rowData: T): string; -} - -export interface RowMetaData { - bodyCssClassName?: BodyCssClassNameFunction | string; -} - -export interface GriddleProps { - columns?: string[]; - columnMetadata?: ColumnMetaData[]; - rowMetadata?: RowMetaData; - results?: T[]; - resultsPerPage?: number; - initialSort?: string; - initialSortAscending?: boolean; - gridClassName?: string; - tableClassName?: string; - customFormatClassName?: string; - settingsText?: string; - filterPlaceholderText?: string; - nextText?: string; - previousText?: string; - maxRowsText?: string; - enableCustomFormatText?: string; - childrenColumnName?: string; - metadataColumns?: string[]; - showFilter?: boolean; - showSettings?: boolean; - useCustomRowComponent?: boolean; - useCustomGridComponent?: boolean; - useCustomPagerComponent?: boolean; - useCustomFilterer?: boolean; - useCustomFilterComponent?: boolean; - useGriddleStyles?: boolean; - customRowComponent?: ReactClass> - customGridComponent?: ReactClass> - customPagerComponent?: ReactClass - customFilterComponent?: ReactClass - customFilterer?(items: T[], query: any): T[]; - enableToggleCustom?: boolean; - noDataMessage?: string; - noDataClassName?: string; - customNoDataComponent?: ReactClass - showTableHeading?: boolean; - showPager?: boolean; - useFixedHeader?: boolean; - useExternal?: boolean; - externalSetPage?(index: number): void; - externalChangeSort?(sort: string, sortAscending: boolean): void; - externalSetFilter?(filter: string): void; - externalSetPageSize?(size: number): void; - externalMaxPage?: number; - externalCurrentPage?: number; - externalSortColumn?: string; - externalSortAscending?: boolean; - externalLoadingComponent?: ReactClass - externalIsLoading?: boolean; - enableInfiniteScroll?: boolean; - bodyHeight?: number; - paddingHeight?: number; - rowHeight?: number; - infiniteScrollLoadTreshold?: number; - useFixedLayout?: boolean; - isSubGriddle?: boolean; - enableSort?: boolean; - sortAscendingClassName?: string; - sortDescendingClassName?: string; - parentRowCollapsedClassName?: string; - parentRowExpandedClassName?: string; - settingsToggleClassName?: string; - nextClassName?: string; - previousClassName?: string; - sortAscendingComponent?: string | React.ReactElement; - sortDescendingComponent?: string | React.ReactElement; - sortDefaultComponent?: string | React.ReactElement; - parentRowCollapsedComponent?: string | React.ReactElement; - parentRowExpandedComponent?: string | React.ReactElement; - settingsIconComponent?: string | React.ReactElement; - nextIconComponent?: string | React.ReactElement; - previousIconComponent?: string | React.ReactElement; - onRowClick?(): void; -} - -declare class Griddle extends React.Component, any> { -} - -export default Griddle; diff --git a/griddle-react/tsconfig.json b/griddle-react/tsconfig.json deleted file mode 100644 index 5dd6f9d98b..0000000000 --- a/griddle-react/tsconfig.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "jsx": "preserve", - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "griddle-react-tests.tsx", - "test/CustomColumnComponent.tsx", - "test/CustomFilterComponent.tsx", - "test/CustomHeaderComponent.tsx" - ] -} diff --git a/griddle-react/tslint.json b/griddle-react/tslint.json deleted file mode 100644 index f9e30021f4..0000000000 --- a/griddle-react/tslint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../tslint.json" -} diff --git a/gridstack/gridstack-tests.ts b/gridstack/gridstack-tests.ts deleted file mode 100644 index 96aa14b19f..0000000000 --- a/gridstack/gridstack-tests.ts +++ /dev/null @@ -1,20 +0,0 @@ -/// - - - -// Type definitions for Gridstack -// Project: http://troolee.github.io/gridstack.js/ -// Definitions by: Pascal Senn -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -var options = { - float: true -}; -var gridstack:GridStack = $(document).gridstack(options); - -gridstack.addWidget("test", 1, 2, 3, 4, true); -gridstack.batchUpdate(); -gridstack.cellHeight();; -gridstack.cellHeight(2); -gridstack.cellWidth(); -gridstack.getCellFromPixel({ left:20, top: 20 }); diff --git a/gridstack/index.d.ts b/gridstack/index.d.ts deleted file mode 100644 index 12c3600f6a..0000000000 --- a/gridstack/index.d.ts +++ /dev/null @@ -1,241 +0,0 @@ -// Type definitions for Gridstack -// Project: http://troolee.github.io/gridstack.js/ -// Definitions by: Pascal Senn -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -interface JQuery { - gridstack (options: IGridstackOptions):GridStack -} - -interface GridStack { - /** - * Creates new widget and returns it. - * - * Widget will be always placed even if result height is more than actual grid height. You need to use willItFit method before calling addWidget for additional check. - * - * @param {string} el widget to add - * @param {number} x widget position x - * @param {number} y widget position y - * @param {number} width widget dimension width - * @param {number} height widget dimension height - * @param {boolean} autoPosition if true then x, y parameters will be ignored and widget will be places on the first available position - */ - addWidget(el: string, x?: number, y?: number, width?: number, height?: number, autoPosition?: boolean, minWidth?: number, maxWidth?: number, minHeight?: number, maxHeight?: number, id?: number): JQuery - /** - * Initializes batch updates. You will see no changes until commit method is called. - */ - batchUpdate():void - /** - * Gets current cell height. - */ - cellHeight():number - /** - * Update current cell height. This method rebuilds an internal CSS style sheet. Note: You can expect performance issues if call this method too often. - * @param {number} val the cell height - */ - cellHeight(val:number):void - /** - * Gets current cell width. - */ - cellWidth():number - /** - * Finishes batch updates. Updates DOM nodes. You must call it after batchUpdate. - */ - commit():void - /** - * Destroys a grid instance. - */ - destroy(): void - /* - * Disables widgets moving/resizing. - */ - disable(): void - /* - * Enables widgets moving/resizing. - */ - enable(): void - /* - * Get the position of the cell under a pixel on screen. - * @param {MousePosition} position the position of the pixel to resolve in absolute coordinates, as an object with top and leftproperties - */ - getCellFromPixel(position: MousePosition): CellPosition, - /* - * Checks if specified area is empty. - * @param {number} x the position x. - * @param {number} y the position y. - * @param {number} width the width of to check - * @param {number} height the height of to check - */ - isAreaEmpty(x: number, y: number, width: number, height: number): void - /* - * Locks/unlocks widget. - * @param {HTMLElement} el widget to modify. - * @param {boolean} val if true widget will be locked. - */ - locked(el: HTMLElement, val: boolean): void - /* - * Set the minWidth for a widget. - * @param {HTMLElement} el widget to modify. - * @param {number} val A numeric value of the number of columns - */ - minWidth(el: HTMLElement, val: number): void - /* - * Set the minHeight for a widget. - * @param {HTMLElement} el widget to modify. - * @param {number} val A numeric value of the number of rows - */ - minHeight(el: HTMLElement, val: number): void - /* - * Enables/Disables moving. - * @param {HTMLElement} el widget to modify. - * @param {number} val if true widget will be draggable. - */ - movable(el: HTMLElement, val: boolean): void - /** - * Changes widget position - * @param {HTMLElement} el widget to modify - * @param {number} x new position x. If value is null or undefined it will be ignored. - * @param {number} y new position y. If value is null or undefined it will be ignored. - * - */ - move(el: HTMLElement, x: number, y: number): void - /** - * Removes widget from the grid. - * @param {HTMLElement} el widget to modify - * @param {boolean} detachNode if false DOM node won't be removed from the tree (Optional. Default true). - */ - removeWidget(el: HTMLElement, detachNode?: boolean): void - /** - * Removes all widgets from the grid. - */ - removeAll(): void - /** - * Changes widget size - * @param {HTMLElement} el widget to modify - * @param {number} width new dimensions width. If value is null or undefined it will be ignored. - * @param {number} height new dimensions height. If value is null or undefined it will be ignored. - */ - resize(el: HTMLElement, width: number, height: number): void - /** - * Enables/Disables resizing. - * @param {HTMLElement} el widget to modify - * @param {boolean} val if true widget will be resizable. - */ - resizable(el: HTMLElement, val: boolean): void - /** - * Toggle the grid static state. Also toggle the grid-stack-static class. - * @param {boolean} staticValue if true the grid become static. - */ - setStatic(staticValue: boolean): void - /** - * Updates widget position/size. - * @param {HTMLElement} el widget to modify - * @param {number} x new position x. If value is null or undefined it will be ignored. - * @param {number} y new position y. If value is null or undefined it will be ignored. - * @param {number} width new dimensions width. If value is null or undefined it will be ignored. - * @param {number} height new dimensions height. If value is null or undefined it will be ignored. - */ - update(el: HTMLElement, x: number, y: number, width: number, height: number): void - /** - * Returns true if the height of the grid will be less the vertical constraint. Always returns true if grid doesn't have height constraint. - * @param {number} x new position x. If value is null or undefined it will be ignored. - * @param {number} y new position y. If value is null or undefined it will be ignored. - * @param {number} width new dimensions width. If value is null or undefined it will be ignored. - * @param {number} height new dimensions height. If value is null or undefined it will be ignored. - * @param {boolean} autoPosition if true then x, y parameters will be ignored and widget will be places on the first available position - */ - willItFit(x: number, y: number, width: number, height: number, autoPosition:boolean):boolean - - -} -/** -* Defines the coordiantes of a object -*/ -interface MousePosition { - top: number, - left:number, -} -/** -* Defines the position of a cell inside the grid -*/ -interface CellPosition { - x: number, - y:number -} -declare namespace GridStackUI { - interface Utils { - /** - * Sorts array of nodes - *@param nodes array to sort - *@param dir 1 for asc, -1 for desc (optional) - *@param width width of the grid. If undefined the width will be calculated automatically (optional). - **/ - sort(nodes: HTMLElement[], dir: number, width: number): void - } -} -/** -* Gridstack Options -* Defines the options for a Gridstack -*/ -interface IGridstackOptions { - /** - * if true the resizing handles are shown even if the user is not hovering over the widget (default: false) - */ - alwaysShowResizeHandle?: boolean; - /** - * turns animation on (default: true) - */ - animate?: boolean; - /** - * if false gridstack will not initialize existing items (default: true) - */ - auto?: boolean; - /** - * one cell height (default: 60) - */ - cellHeight?: number; - /** - * allows to override jQuery UI draggable options. (default: { handle: '.grid-stack-item-content', scroll: true, appendTo: 'body' }) - */ - draggable?: {}; - /** - * draggable handle selector (default: '.grid-stack-item-content') - */ - handle?: string; - /** - * maximum rows amount.Default is 0 which means no maximum rows - */ - height?: number; - /** - * enable floating widgets (default: false) See example - */ - float?: boolean; - /** - * widget class (default: 'grid-stack-item') - */ - itemClass?: string; - /** - * minimal width.If window width is less, grid will be shown in one - column mode (default: 768) - */ - minWidth?: number; - /** - * class for placeholder (default: 'grid-stack-placeholder') - */ - placeholderClass?: string; - /** - * allows to override jQuery UI resizable options. (default: { autoHide: true, handles: 'se' }) - */ - resizable?: {}; - /** - * makes grid static (default false).If true widgets are not movable/ resizable.You don't even need jQueryUI draggable/resizable. A CSS class grid-stack-static is also added to the container. - */ - staticGrid?: boolean; - /** - * vertical gap size (default: 20) - */ - verticalMargin?: number; - /** - * amount of columns (default: 12) - */ - width?: number; -} diff --git a/gsap/tslint.json b/gsap/tslint.json deleted file mode 100644 index 0b14fdec0d..0000000000 --- a/gsap/tslint.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "../tslint.json", - "rules": { - "no-single-declare-module": false - } -} diff --git a/gulp-angular-templatecache/tsconfig.json b/gulp-angular-templatecache/tsconfig.json deleted file mode 100644 index eda0469b48..0000000000 --- a/gulp-angular-templatecache/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-angular-templatecache-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-autoprefixer/tsconfig.json b/gulp-autoprefixer/tsconfig.json deleted file mode 100644 index 955f890f2b..0000000000 --- a/gulp-autoprefixer/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-autoprefixer-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-cache/tsconfig.json b/gulp-cache/tsconfig.json deleted file mode 100644 index 3126e1ef38..0000000000 --- a/gulp-cache/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-cache-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-cached/tsconfig.json b/gulp-cached/tsconfig.json deleted file mode 100644 index 32f3759409..0000000000 --- a/gulp-cached/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-cached-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-changed/tsconfig.json b/gulp-changed/tsconfig.json deleted file mode 100644 index 4185d001ef..0000000000 --- a/gulp-changed/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-changed-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-cheerio/tsconfig.json b/gulp-cheerio/tsconfig.json deleted file mode 100644 index 254698a94e..0000000000 --- a/gulp-cheerio/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": false, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-cheerio-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-coffeeify/tsconfig.json b/gulp-coffeeify/tsconfig.json deleted file mode 100644 index 54406ca98a..0000000000 --- a/gulp-coffeeify/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-coffeeify-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-coffeelint/tsconfig.json b/gulp-coffeelint/tsconfig.json deleted file mode 100644 index 2cc883884b..0000000000 --- a/gulp-coffeelint/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": false, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-coffeelint-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-concat/tsconfig.json b/gulp-concat/tsconfig.json deleted file mode 100644 index 1f4acfd285..0000000000 --- a/gulp-concat/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-concat-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-copy/tsconfig.json b/gulp-copy/tsconfig.json deleted file mode 100644 index cc4c620b9f..0000000000 --- a/gulp-copy/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-copy-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-csso/tsconfig.json b/gulp-csso/tsconfig.json deleted file mode 100644 index 706fd106af..0000000000 --- a/gulp-csso/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-csso-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-debug/tsconfig.json b/gulp-debug/tsconfig.json deleted file mode 100644 index accf822a92..0000000000 --- a/gulp-debug/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-debug-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-dtsm/tsconfig.json b/gulp-dtsm/tsconfig.json deleted file mode 100644 index 6003ac335b..0000000000 --- a/gulp-dtsm/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-dtsm-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-espower/tsconfig.json b/gulp-espower/tsconfig.json deleted file mode 100644 index 1140a956aa..0000000000 --- a/gulp-espower/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-espower-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-file-include/tsconfig.json b/gulp-file-include/tsconfig.json deleted file mode 100644 index d166690ec5..0000000000 --- a/gulp-file-include/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-file-include-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-filter/tsconfig.json b/gulp-filter/tsconfig.json deleted file mode 100644 index f217497fa9..0000000000 --- a/gulp-filter/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-filter-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-flatten/tsconfig.json b/gulp-flatten/tsconfig.json deleted file mode 100644 index 484a4e3aef..0000000000 --- a/gulp-flatten/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-flatten-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-gh-pages/tsconfig.json b/gulp-gh-pages/tsconfig.json deleted file mode 100644 index a6f5d411b1..0000000000 --- a/gulp-gh-pages/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-gh-pages-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-gzip/tsconfig.json b/gulp-gzip/tsconfig.json deleted file mode 100644 index 07e07f0cf5..0000000000 --- a/gulp-gzip/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-gzip-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-help-doc/tsconfig.json b/gulp-help-doc/tsconfig.json deleted file mode 100644 index 646e8ad141..0000000000 --- a/gulp-help-doc/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-help-doc-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-help/tsconfig.json b/gulp-help/tsconfig.json deleted file mode 100644 index d0647ad22a..0000000000 --- a/gulp-help/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-help-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-html-replace/tsconfig.json b/gulp-html-replace/tsconfig.json deleted file mode 100644 index 25eff60770..0000000000 --- a/gulp-html-replace/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-html-replace-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-htmlmin/tsconfig.json b/gulp-htmlmin/tsconfig.json deleted file mode 100644 index 5d12b48035..0000000000 --- a/gulp-htmlmin/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-htmlmin-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-if/tsconfig.json b/gulp-if/tsconfig.json deleted file mode 100644 index f9db5297cf..0000000000 --- a/gulp-if/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-if-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-inject/tsconfig.json b/gulp-inject/tsconfig.json deleted file mode 100644 index 0201da00d9..0000000000 --- a/gulp-inject/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-inject-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-insert/tsconfig.json b/gulp-insert/tsconfig.json deleted file mode 100644 index e548f022fa..0000000000 --- a/gulp-insert/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-insert-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-install/tsconfig.json b/gulp-install/tsconfig.json deleted file mode 100644 index 0b4494f7cd..0000000000 --- a/gulp-install/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-install-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-istanbul/tsconfig.json b/gulp-istanbul/tsconfig.json deleted file mode 100644 index f7ca4e96c7..0000000000 --- a/gulp-istanbul/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-istanbul-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-jade/tsconfig.json b/gulp-jade/tsconfig.json deleted file mode 100644 index b746e232bf..0000000000 --- a/gulp-jade/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-jade-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-jasmine-browser/tsconfig.json b/gulp-jasmine-browser/tsconfig.json deleted file mode 100644 index e5b112e90f..0000000000 --- a/gulp-jasmine-browser/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-jasmine-browser-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-json-editor/tsconfig.json b/gulp-json-editor/tsconfig.json deleted file mode 100644 index 85846b46fd..0000000000 --- a/gulp-json-editor/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-json-editor-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-jspm/tsconfig.json b/gulp-jspm/tsconfig.json deleted file mode 100644 index fbf318afab..0000000000 --- a/gulp-jspm/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-jspm-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-less/tsconfig.json b/gulp-less/tsconfig.json deleted file mode 100644 index be38992302..0000000000 --- a/gulp-less/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-less-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-load-plugins/tsconfig.json b/gulp-load-plugins/tsconfig.json deleted file mode 100644 index 77238a0e61..0000000000 --- a/gulp-load-plugins/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-load-plugins-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-minify-css/tsconfig.json b/gulp-minify-css/tsconfig.json deleted file mode 100644 index 2d59793675..0000000000 --- a/gulp-minify-css/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-minify-css-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-minify-html/tsconfig.json b/gulp-minify-html/tsconfig.json deleted file mode 100644 index 3e37896bd2..0000000000 --- a/gulp-minify-html/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-minify-html-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-mocha/tsconfig.json b/gulp-mocha/tsconfig.json deleted file mode 100644 index aef5d2d758..0000000000 --- a/gulp-mocha/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-mocha-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-newer/tsconfig.json b/gulp-newer/tsconfig.json deleted file mode 100644 index ac02863c9b..0000000000 --- a/gulp-newer/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-newer-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-ng-annotate/tsconfig.json b/gulp-ng-annotate/tsconfig.json deleted file mode 100644 index 16f68955bb..0000000000 --- a/gulp-ng-annotate/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-ng-annotate-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-nodemon/tsconfig.json b/gulp-nodemon/tsconfig.json deleted file mode 100644 index dc91f8e066..0000000000 --- a/gulp-nodemon/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-nodemon-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-plumber/tsconfig.json b/gulp-plumber/tsconfig.json deleted file mode 100644 index 878facc1f7..0000000000 --- a/gulp-plumber/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-plumber-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-protractor/tsconfig.json b/gulp-protractor/tsconfig.json deleted file mode 100644 index 1141cf2042..0000000000 --- a/gulp-protractor/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-protractor-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-remember/tsconfig.json b/gulp-remember/tsconfig.json deleted file mode 100644 index e8ecc18bdc..0000000000 --- a/gulp-remember/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-remember-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-rename/tsconfig.json b/gulp-rename/tsconfig.json deleted file mode 100644 index 8a3a2c34dd..0000000000 --- a/gulp-rename/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-rename-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-replace/tsconfig.json b/gulp-replace/tsconfig.json deleted file mode 100644 index 5624a977d3..0000000000 --- a/gulp-replace/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-replace-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-rev-replace/tsconfig.json b/gulp-rev-replace/tsconfig.json deleted file mode 100644 index b3fb130952..0000000000 --- a/gulp-rev-replace/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-rev-replace-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-rev/tsconfig.json b/gulp-rev/tsconfig.json deleted file mode 100644 index ea7647e39a..0000000000 --- a/gulp-rev/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-rev-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-ruby-sass/tsconfig.json b/gulp-ruby-sass/tsconfig.json deleted file mode 100644 index 9465184b37..0000000000 --- a/gulp-ruby-sass/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-ruby-sass-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-sass/tsconfig.json b/gulp-sass/tsconfig.json deleted file mode 100644 index 26e1b2af4c..0000000000 --- a/gulp-sass/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-sass-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-shell/tsconfig.json b/gulp-shell/tsconfig.json deleted file mode 100644 index 81356de73d..0000000000 --- a/gulp-shell/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-shell-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-size/tsconfig.json b/gulp-size/tsconfig.json deleted file mode 100644 index b1be4ca1dc..0000000000 --- a/gulp-size/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-size-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-sort/tsconfig.json b/gulp-sort/tsconfig.json deleted file mode 100644 index 87097c7ad2..0000000000 --- a/gulp-sort/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-sort-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-sourcemaps/tsconfig.json b/gulp-sourcemaps/tsconfig.json deleted file mode 100644 index e9c6d80281..0000000000 --- a/gulp-sourcemaps/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-sourcemaps-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-strip-debug/tsconfig.json b/gulp-strip-debug/tsconfig.json deleted file mode 100644 index db20e2db69..0000000000 --- a/gulp-strip-debug/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-strip-debug-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-svg-sprite/tsconfig.json b/gulp-svg-sprite/tsconfig.json deleted file mode 100644 index 381d78b150..0000000000 --- a/gulp-svg-sprite/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-svg-sprite-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-task-listing/tsconfig.json b/gulp-task-listing/tsconfig.json deleted file mode 100644 index 1f3b796968..0000000000 --- a/gulp-task-listing/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-task-listing-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-tsd/tsconfig.json b/gulp-tsd/tsconfig.json deleted file mode 100644 index a5738eb561..0000000000 --- a/gulp-tsd/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-tsd-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-tslint/tsconfig.json b/gulp-tslint/tsconfig.json deleted file mode 100644 index 91d3edf8a3..0000000000 --- a/gulp-tslint/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-tslint-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-typedoc/tsconfig.json b/gulp-typedoc/tsconfig.json deleted file mode 100644 index 9d0f620269..0000000000 --- a/gulp-typedoc/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-typedoc-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-typescript/gulp-typescript-tests.ts b/gulp-typescript/gulp-typescript-tests.ts deleted file mode 100644 index 491d6790d2..0000000000 --- a/gulp-typescript/gulp-typescript-tests.ts +++ /dev/null @@ -1,65 +0,0 @@ -import gulp = require("gulp"); -import typescript = require("gulp-typescript"); - -function merge(streams: NodeJS.ReadWriteStream[]): NodeJS.ReadWriteStream { - return null; -} - -gulp.task('scripts', function() { - var tsResult = gulp.src('lib/*.ts') - .pipe(typescript({ - declarationFiles: true, - noExternalResolve: true, - skipLibCheck: true - })); - - return merge([ - tsResult.dts.pipe(gulp.dest('release/definitions')), - tsResult.js.pipe(gulp.dest('release/js'))] - ); -}); - - -var tsProject = typescript.createProject({ - declarationFiles: true, - noExternalResolve: true -}); - -gulp.task('scripts', function() { - var tsResult = tsProject.src() - .pipe(typescript(tsProject)); - - return tsResult.js.pipe(gulp.dest('release')); -}); - -var mainTscProject = typescript.createProject("tsconfig.json", { - target: "es6" -}); - -gulp.task('scripts', function() { - var tsResult = gulp.src('lib/*.ts') - .pipe(typescript(tsProject)); - - return merge([ // Merge the two output streams, so this task is finished when the IO of both operations are done. - tsResult.dts.pipe(gulp.dest('release/definitions')), - tsResult.js.pipe(gulp.dest('release/js'))] - ); -}); -gulp.task('watch', ['scripts'], function() { - gulp.watch('lib/*.ts', ['scripts']); -}); - -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/index.d.ts b/gulp-typescript/index.d.ts deleted file mode 100644 index 121abc325b..0000000000 --- a/gulp-typescript/index.d.ts +++ /dev/null @@ -1,73 +0,0 @@ -// Type definitions for gulp-typescript -// Project: https://github.com/ivogabe/gulp-typescript -// Definitions by: Asana , Thomas Corbière -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - - -declare function GulpTypescript(params?: GulpTypescript.Params, filters?: GulpTypescript.FilterSettings, reporter?: GulpTypescript.Reporter): GulpTypescript.CompilationStream; - -declare namespace GulpTypescript { - export function createProject(params?: Params): Project; - export function createProject(file: string, params?: Params): Project; - export function filter(filters: FilterSettings): CompilationStream; - interface Params { - declarationFiles?: boolean; - module?: string; - noEmitOnError?: boolean; - noExternalResolve?: boolean; - noImplicitAny?: boolean; - noLib?: boolean; - removeComments?: boolean; - 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; - skipLibCheck?: boolean; - } - - interface TsConfig { - files?: string[]; - exclude?: string[]; - compilerOptions?: any; - } - - interface Project { - config: TsConfig; - src(): NodeJS.ReadWriteStream; - } - - interface FilterSettings { - referencedFrom?: string[]; - } - - interface Reporter { - error(error: any): void; - } - - interface CompilationStream extends NodeJS.ReadWriteStream { - dts: NodeJS.ReadWriteStream; - js: NodeJS.ReadWriteStream; - } - - namespace reporter { - function nullReporter(): Reporter; - function defaultReporter(): Reporter; - function fullReporter(showFullFilename?: boolean): Reporter; - } -} - -export = GulpTypescript; diff --git a/gulp-typescript/tsconfig.json b/gulp-typescript/tsconfig.json deleted file mode 100644 index fa6cbbc908..0000000000 --- a/gulp-typescript/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-typescript-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-uglify/tsconfig.json b/gulp-uglify/tsconfig.json deleted file mode 100644 index 43db40e019..0000000000 --- a/gulp-uglify/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-uglify-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-useref/tsconfig.json b/gulp-useref/tsconfig.json deleted file mode 100644 index 132913f9d8..0000000000 --- a/gulp-useref/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-useref-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-util/tsconfig.json b/gulp-util/tsconfig.json deleted file mode 100644 index 06b269e0ed..0000000000 --- a/gulp-util/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": false, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-util-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp-watch/tsconfig.json b/gulp-watch/tsconfig.json deleted file mode 100644 index 7062be6f7e..0000000000 --- a/gulp-watch/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-watch-tests.ts" - ] -} \ No newline at end of file diff --git a/gulp/index.d.ts b/gulp/index.d.ts deleted file mode 100644 index 9f3e7d96ba..0000000000 --- a/gulp/index.d.ts +++ /dev/null @@ -1,365 +0,0 @@ -// Type definitions for Gulp v4.0.x -// Project: http://gulpjs.com -// Definitions by: Drew Noakes , Juan Arroyave -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// -/// -/// - - -import Orchestrator = require("orchestrator"); -import VinylFile = require("vinyl"); - -declare type Strings = string|string[]; - -declare namespace gulp { - interface Gulp extends Orchestrator { - /** - * Define a task - * @param name The name of the task. - * @param deps An array of task names to be executed and completed before your task will run. - * @param fn The function that performs the task's operations. For asynchronous tasks, you need to provide a hint when the task is complete: - *
          - *
        • Take in a callback
        • - *
        • Return a stream or a promise
        • - *
        - */ - task: Orchestrator.AddMethod; - /** - * Takes a number of task names or functions and returns a function of the composed tasks or functions - * When the returned function is executed, the tasks or functions will be executed in series, - * each waiting for the prior to finish. If an error occurs, execution will stop. - * @param A task name, a function or an array of either. - *
          - *
        • Take in a callback
        • - *
        • Return a stream or a promise
        • - *
        - */ - series: SeriesMethod; - /** - * Takes a number of task names or functions and returns a function of the composed tasks or functions - * When the returned function is executed, the tasks or functions will be executed in parallel, - * all being executed at the same time. If an error occurs, all execution will complete. - * @param A task name, a function or an array of either. - *
          - *
        • Take in a callback
        • - *
        • Return a stream or a promise
        • - *
        - */ - parallel: ParallelMethod; - /** - * Emits files matching provided glob or an array of globs. Returns a stream of Vinyl files that can be piped to plugins. - * @param glob Glob or array of globs to read. - * @param opt Options to pass to node-glob through glob-stream. - */ - src: SrcMethod; - /** - * Can be piped to and it will write files. Re-emits all data passed to it so you can pipe to multiple folders. - * Folders that don't exist will be created. - * - * @param outFolder The path (output folder) to write files to. Or a function that returns it, the function will be provided a vinyl File instance. - * @param opt - */ - dest: DestMethod; - /** - * Watch files and do something when a file changes. This always returns an EventEmitter that emits change events. - * - * @param glob a single glob or array of globs that indicate which files to watch for changes. - * @param opt options, that are passed to the gaze library. - * @param fn a callback or array of callbacks to be called on each change, or names of task(s) to run when a file changes, added with task(). - */ - watch: WatchMethod; - } - - interface GulpPlugin { - (...args: any[]): NodeJS.ReadWriteStream; - } - - interface WatchMethod { - /** - * Watch files and do something when a file changes. This always returns an EventEmitter that emits change events. - * - * @param glob a single glob or array of globs that indicate which files to watch for changes. - * @param fn a callback or array of callbacks to be called on each change, or names of task(s) to run when a file changes, added with task(). - */ - (glob: string|string[], fn: (WatchCallback|string)): NodeJS.EventEmitter; - /** - * Watch files and do something when a file changes. This always returns an EventEmitter that emits change events. - * - * @param glob a single glob or array of globs that indicate which files to watch for changes. - * @param fn a callback or array of callbacks to be called on each change, or names of task(s) to run when a file changes, added with task(). - */ - (glob: string|string[], fn: (WatchCallback|string)[]): NodeJS.EventEmitter; - /** - * Watch files and do something when a file changes. This always returns an EventEmitter that emits change events. - * - * @param glob a single glob or array of globs that indicate which files to watch for changes. - * @param opt options, that are passed to the gaze library. - * @param fn a callback or array of callbacks to be called on each change, or names of task(s) to run when a file changes, added with task(). - */ - (glob: string|string[], opt: WatchOptions, fn: (WatchCallback|string)): NodeJS.EventEmitter; - /** - * Watch files and do something when a file changes. This always returns an EventEmitter that emits change events. - * - * @param glob a single glob or array of globs that indicate which files to watch for changes. - * @param opt options, that are passed to the gaze library. - * @param fn a callback or array of callbacks to be called on each change, or names of task(s) to run when a file changes, added with task(). - */ - (glob: string|string[], opt: WatchOptions, fn: (WatchCallback|string)[]): NodeJS.EventEmitter; - - } - - interface DestMethod { - /** - * Can be piped to and it will write files. Re-emits all data passed to it so you can pipe to multiple folders. - * Folders that don't exist will be created. - * - * @param outFolder The path (output folder) to write files to. Or a function that returns it, the function will be provided a vinyl File instance. - * @param opt - */ - (outFolder: string|((file: VinylFile) => string), opt?: DestOptions): NodeJS.ReadWriteStream; - } - - interface SrcMethod { - /** - * Emits files matching provided glob or an array of globs. Returns a stream of Vinyl files that can be piped to plugins. - * @param glob Glob or array of globs to read. - * @param opt Options to pass to node-glob through glob-stream. - */ - (glob: string|string[], opt?: SrcOptions): NodeJS.ReadWriteStream; - } - interface SeriesMethod { - /** - * Takes a number of task names or functions and returns a function of the composed tasks or functions. - * When using task names, the task should already be registered. - * When the returned function is executed, the tasks or functions will be executed in series, - * each waiting for the prior to finish. If an error occurs, execution will stop. - * @param tasks, string, function or array of both. - */ - (...tasks: string[]): NodeJS.EventEmitter; - - (...tasks: Function[]): NodeJS.EventEmitter; - - (task: string|string[], ...fn: Function[]): NodeJS.EventEmitter; - - //TODO: TypeScript cannot express varargs followed by callback as a last argument... - (task1: Strings, task2: Strings, cb?: (error?: any) => any): Function; - (task1: Strings, task2: Strings, task3: Strings, cb?: (error?: any) => any): NodeJS.EventEmitter; - (task1: Strings, task2: Strings, task3: Strings, task4: Strings, cb?: (error?: any) => any): NodeJS.EventEmitter; - (task1: Strings, task2: Strings, task3: Strings, task4: Strings, task5: Strings, cb?: (error?: any) => any): NodeJS.EventEmitter; - (task1: Strings, task2: Strings, task3: Strings, task4: Strings, task5: Strings, task6: Strings, cb?: (error?: any) => any): NodeJS.EventEmitter; - - } - - interface ParallelMethod { - /** - * Takes a number of task names or functions and returns a function of the composed tasks or functions. - * When using task names, the task should already be registered. - * When the returned function is executed, the tasks or functions will be executed in parallel, - * all being executed at the same time. If an error occurs, all execution will complete. - * @param tasks, string, function or array of both. - */ - (...tasks: string[]): NodeJS.EventEmitter; - - (...tasks: Function[]): NodeJS.EventEmitter; - - (task: string|string[], ...fn: Function[]): NodeJS.EventEmitter; - - //TODO: TypeScript cannot express varargs followed by callback as a last argument... - (task1: Strings, task2: Strings, cb?: (error?: any) => any): Function; - (task1: Strings, task2: Strings, task3: Strings, cb?: (error?: any) => any): NodeJS.EventEmitter; - (task1: Strings, task2: Strings, task3: Strings, task4: Strings, cb?: (error?: any) => any): NodeJS.EventEmitter; - (task1: Strings, task2: Strings, task3: Strings, task4: Strings, task5: Strings, cb?: (error?: any) => any): NodeJS.EventEmitter; - (task1: Strings, task2: Strings, task3: Strings, task4: Strings, task5: Strings, task6: Strings, cb?: (error?: any) => any): NodeJS.EventEmitter; - - } - - /** - * Options to pass to node-glob through glob-stream. - * Specifies two options in addition to those used by node-glob: - * https://github.com/isaacs/node-glob#options - */ - interface SrcOptions { - /** - * Setting this to false will return file.contents as null - * and not read the file at all. - * Default: true. - */ - read?: boolean; - - /** - * Setting this to false will return file.contents as a stream and not buffer files. - * This is useful when working with large files. - * Note: Plugins might not implement support for streams. - * Default: true. - */ - buffer?: boolean; - - /** - * The base path of a glob. - * - * Default is everything before a glob starts. - */ - base?: string; - - /** - * The current working directory in which to search. - * Defaults to process.cwd(). - */ - cwd?: string; - - /** - * The place where patterns starting with / will be mounted onto. - * Defaults to path.resolve(options.cwd, "/") (/ on Unix systems, and C:\ or some such on Windows.) - */ - root?: string; - - /** - * Include .dot files in normal matches and globstar matches. - * Note that an explicit dot in a portion of the pattern will always match dot files. - */ - dot?: boolean; - - /** - * Set to match only fles, not directories. Set this flag to prevent copying empty directories - */ - nodir?: boolean; - - /** - * By default, a pattern starting with a forward-slash will be "mounted" onto the root setting, so that a valid - * filesystem path is returned. Set this flag to disable that behavior. - */ - nomount?: boolean; - - /** - * Add a / character to directory matches. Note that this requires additional stat calls. - */ - mark?: boolean; - - /** - * Don't sort the results. - */ - nosort?: boolean; - - /** - * Set to true to stat all results. This reduces performance somewhat, and is completely unnecessary, unless - * readdir is presumed to be an untrustworthy indicator of file existence. It will cause ELOOP to be triggered one - * level sooner in the case of cyclical symbolic links. - */ - stat?: boolean; - - /** - * When an unusual error is encountered when attempting to read a directory, a warning will be printed to stderr. - * Set the silent option to true to suppress these warnings. - */ - silent?: boolean; - - /** - * When an unusual error is encountered when attempting to read a directory, the process will just continue on in - * search of other matches. Set the strict option to raise an error in these cases. - */ - strict?: boolean; - - /** - * See cache property above. Pass in a previously generated cache object to save some fs calls. - */ - cache?: boolean; - - /** - * A cache of results of filesystem information, to prevent unnecessary stat calls. - * While it should not normally be necessary to set this, you may pass the statCache from one glob() call to the - * options object of another, if you know that the filesystem will not change between calls. - */ - statCache?: boolean; - - /** - * Perform a synchronous glob search. - */ - sync?: boolean; - - /** - * In some cases, brace-expanded patterns can result in the same file showing up multiple times in the result set. - * By default, this implementation prevents duplicates in the result set. Set this flag to disable that behavior. - */ - nounique?: boolean; - - /** - * Set to never return an empty set, instead returning a set containing the pattern itself. - * This is the default in glob(3). - */ - nonull?: boolean; - - /** - * Perform a case-insensitive match. Note that case-insensitive filesystems will sometimes result in glob returning - * results that are case-insensitively matched anyway, since readdir and stat will not raise an error. - */ - nocase?: boolean; - - /** - * Set to enable debug logging in minimatch and glob. - */ - debug?: boolean; - - /** - * Set to enable debug logging in glob, but not minimatch. - */ - globDebug?: boolean; - } - - interface DestOptions { - /** - * The output folder. Only has an effect if provided output folder is relative. - * Default: process.cwd() - */ - cwd?: string; - - /** - * Octal permission string specifying mode for any folders that need to be created for output folder. - * Default: 0777. - */ - mode?: string; - } - - /** - * Options that are passed to gaze. - * https://github.com/shama/gaze - */ - interface WatchOptions { - /** Interval to pass to fs.watchFile. */ - interval?: number; - /** Delay for events called in succession for the same file/event. */ - debounceDelay?: number; - /** Force the watch mode. Either 'auto' (default), 'watch' (force native events), or 'poll' (force stat polling). */ - mode?: string; - /** The current working directory to base file patterns from. Default is process.cwd().. */ - cwd?: string; - } - - interface WatchEvent { - /** The type of change that occurred, either added, changed or deleted. */ - type: string; - /** The path to the file that triggered the event. */ - path: string; - } - - /** - * Callback to be called on each watched file change. - */ - interface WatchCallback { - (event: WatchEvent): void; - } - - interface TaskCallback { - /** - * Defines a task. - * Tasks may be made asynchronous if they are passing a callback or return a promise or a stream. - * @param cb callback used to signal asynchronous completion. Caller includes err in case of error. - */ - (cb?: (err?: any) => void): any; - } -} - -declare var gulp: gulp.Gulp; - -export = gulp; diff --git a/gulp/tsconfig.json b/gulp/tsconfig.json deleted file mode 100644 index f6670453d1..0000000000 --- a/gulp/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-tests.ts" - ] -} \ No newline at end of file diff --git a/halogen/index.d.ts b/halogen/index.d.ts deleted file mode 100644 index 5735737f41..0000000000 --- a/halogen/index.d.ts +++ /dev/null @@ -1,83 +0,0 @@ -// Type definitions for halogen 0.2 -// Project: https://github.com/yuanyan/halogen -// Definitions by: Vincent Rouffiat -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 - -import * as react from "react"; - -type VerticalAlign = "baseline" | "length" | "sub" | "super" | "top" | "text-top" | "middle" | "bottom" | "text-bottom" | "initial" | "inherit"; - -interface HalogenCommonProps { - loading?: boolean; - color?: string; - id?: string; - className?: string; - verticalAlign?: VerticalAlign; -} - -interface SizeLoaderProps extends HalogenCommonProps { - size?: string; -} - -interface MarginLoaderProps extends HalogenCommonProps { - margin?: T; - size?: T; -} - -interface RadiusLoaderProps extends MarginLoaderProps { - height?: string; - width?: string; - radius?: string; -} - -/** - * React components - */ -type PulseLoader = react.Component, {}>; -export const PulseLoader: react.ComponentClass>; - -type RotateLoader = react.Component, {}>; -export const RotateLoader: react.ComponentClass>; - -type BeatLoader = react.Component, {}>; -export const BeatLoader: react.ComponentClass>; - -type RiseLoader = react.Component, {}>; -export const RiseLoader: react.ComponentClass>; - -type SyncLoader = react.Component, {}>; -export const SyncLoader: react.ComponentClass>; - -type GridLoader = react.Component, {}>; -export const GridLoader: react.ComponentClass>; - -type ClipLoader = react.Component; -export const ClipLoader: react.ComponentClass; - -type SquareLoader = react.Component; -export const SquareLoader: react.ComponentClass; - -type DotLoader = react.Component; -export const DotLoader: react.ComponentClass; - -type PacmanLoader = react.Component, {}>; -export const PacmanLoader: react.ComponentClass>; - -type MoonLoader = react.Component; -export const MoonLoader: react.ComponentClass; - -type RingLoader = react.Component; -export const RingLoader: react.ComponentClass; - -type BounceLoader = react.Component; -export const BounceLoader: react.ComponentClass; - -type SkewLoader = react.Component; -export const SkewLoader: react.ComponentClass; - -type FadeLoader = react.Component; -export const FadeLoader: react.ComponentClass; - -type ScaleLoader = react.Component; -export const ScaleLoader: react.ComponentClass; diff --git a/halogen/tslint.json b/halogen/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/halogen/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/handsontable/handsontable-tests.ts b/handsontable/handsontable-tests.ts deleted file mode 100644 index eb48441244..0000000000 --- a/handsontable/handsontable-tests.ts +++ /dev/null @@ -1,291 +0,0 @@ - - -function test_HandsontableInit() { - var elem = document.createElement('div'); - var hot = new Handsontable(elem, { - allowEmpty: true, - allowInsertColumn: true, - allowInsertRow: true, - allowInvalid: true, - allowRemoveColumn: true, - allowRemoveRow: true, - autoColumnSize: true, - autoComplete: [], - autoRowSize: true, - autoWrapCol: true, - autoWrapRow: true, - bindRowsWithHeaders: 'foo', - cell: [], - cells: function() {}, - checkedTemplate: true, - className: [], - colHeaders: true, - collapsibleColumns: true, - columnHeaderHeight: 123, - columns: [], - columnSorting: {}, - columnSummary: {}, - colWidths: 123, - commentedCellClassName: 'foo', - comments: [], - contextMenu: true, - contextMenuCopyPaste: {}, - copyable: true, - copyColsLimit: 123, - copyPaste: true, - copyRowsLimit: 123, - correctFormat: true, - currentColClassName: 'foo', - currentRowClassName: 'foo', - customBorders: true, - data: [], - dataSchema: {}, - dateFormat: 'foo', - debug: true, - defaultDate: 'foo', - disableVisualSelection: true, - dropdownMenu: [], - editor: true, - enterBeginsEditing: true, - enterMoves: {}, - fillHandle: true, - filter: true, - filteringCaseSensitive: true, - filters: false, - fixedColumnsLeft: 123, - fixedRowsBottom: 123, - fixedRowsTop: 123, - format: 'foo', - fragmentSelection: true, - ganttChart: {}, - headerTooltips: true, - height: 123, - hiddenColumns: true, - hiddenRows: {}, - invalidCellClassName: 'foo', - label: {}, - language: 'foo', - manualColumnFreeze: true, - manualColumnMove: true, - manualColumnResize: true, - manualRowMove: true, - manualRowResize: true, - maxCols: 123, - maxRows: 123, - mergeCells: true, - minCols: 123, - minRows: 123, - minSpareCols: 123, - minSpareRows: 123, - multiSelect: true, - nestedHeaders: [], - noWordWrapClassName: 'foo', - observeChanges: true, - observeDOMVisibility: true, - outsideClickDeselects: true, - pasteMode: 'foo', - persistentState: true, - placeholder: 123, - placeholderCellClassName: 'foo', - preventOverflow: true, - readOnly: true, - readOnlyCellClassName: 'foo', - renderAllRows: true, - renderer: 'foo', - rowHeaders: true, - rowHeaderWidth: 123, - rowHeights: 123, - search: true, - selectOptions: [], - skipColumnOnPaste: true, - sortByRelevance: true, - sortFunction: function() {}, - sortIndicator: true, - source: [], - startCols: 123, - startRows: 123, - stretchH: 'foo', - strict: true, - tableClassName: 'foo', - tabMoves: {}, - title: 'foo', - trimDropdown: true, - trimWhitespace: true, - type: 'foo', - uncheckedTemplate: true, - undo: true, - validator: function() {}, - viewportColumnRenderingOffset: 123, - viewportRowRenderingOffset: 123, - visibleRows: 123, - width: 1232, - wordWrap: true, - - // Hooks - afterAutofillApplyValues: function() {}, - afterCellMetaReset: function() {}, - afterChange: function() {}, - afterChangesObserved: function() {}, - afterColumnMove: function() {}, - afterColumnResize: function() {}, - afterColumnSort: function() {}, - afterContextMenuDefaultOptions: function() {}, - afterContextMenuHide: function() {}, - afterContextMenuShow: function() {}, - afterCopyLimit: function() {}, - afterCreateCol: function() {}, - afterCreateRow: function() {}, - afterDeselect: function() {}, - afterDestroy: function() {}, - afterDocumentKeyDown: function() {}, - afterFilter: function() {}, - afterGetCellMeta: function() {}, - afterGetColHeader: function() {}, - afterGetColumnHeaderRenderers: function() {}, - afterGetRowHeader: function() {}, - afterGetRowHeaderRenderers: function() {}, - afterInit: function() {}, - afterLoadData: function() {}, - afterMomentumScroll: function() {}, - afterOnCellCornerMouseDown: function() {}, - afterOnCellMouseDown: function() {}, - afterOnCellMouseOver: function() {}, - afterRemoveCol: function() {}, - afterRemoveRow: function() {}, - afterRender: function() {}, - afterRenderer: function() {}, - afterRowMove: function() {}, - afterRowResize: function() {}, - afterScrollHorizontally: function() {}, - afterScrollVertically: function() {}, - afterSelection: function() {}, - afterSelectionByProp: function() {}, - afterSelectionEnd: function() {}, - afterSelectionEndByProp: function() {}, - afterSetCellMeta: function() {}, - afterUpdateSettings: function() {}, - afterValidate: function() {}, - beforeAutofill: function() {}, - beforeCellAlignment: function() {}, - beforeChange: function() {}, - beforeChangeRender: function() {}, - beforeColumnMove: function() {}, - beforeColumnResize: function() {}, - beforeColumnSort: function() {}, - beforeDrawBorders: function() {}, - beforeFilter: function() {}, - beforeGetCellMeta: function() {}, - beforeInit: function() {}, - beforeInitWalkontable: function() {}, - beforeKeyDown: function() {}, - beforeOnCellMouseDown: function() {}, - beforeRemoveCol: function() {}, - beforeRemoveRow: function() {}, - beforeRender: function() {}, - beforeRenderer: function() {}, - beforeRowMove: function() {}, - beforeRowResize: function() {}, - beforeSetRangeEnd: function() {}, - beforeStretchingColumnWidth: function() {}, - beforeTouchScroll: function() {}, - beforeValidate: function() {}, - construct: function() {}, - init: function() {}, - modifyCol: function() {}, - modifyColHeader: function() {}, - modifyColWidth: function() {}, - modifyCopyableRange: function() {}, - modifyRow: function() {}, - modifyRowHeader: function() {}, - modifyRowHeight: function() {}, - persistentStateLoad: function() {}, - persistentStateReset: function() {}, - persistentStateSave: function() {}, - unmodifyCol: function() {} - }); -} - -function test_HandsontableMethods() { - var elem = document.createElement('div'); - var hot = new Handsontable(elem, {}); - hot.addHook('foo', []); - hot.addHookOnce('foo', []); - hot.alter('foo', 123, 123, 'foo', true); - hot.clear(); - hot.colOffset(); - hot.colToProp(123); - hot.countCols(); - hot.countEmptyCols(true); - hot.countEmptyRows(true); - hot.countRenderedCols(); - hot.countRenderedRows(); - hot.countRows(); - hot.countSourceRows(); - hot.countVisibleCols(); - hot.countVisibleRows(); - hot.deselectCell(); - hot.destroy(); - hot.destroyEditor(true); - hot.getActiveEditor(); - hot.getCell(123, 123, true); - hot.getCellEditor(123, 123); - hot.getCellMeta(123, 123); - hot.getCellRenderer(123, 123); - hot.getCellValidator(123, 123); - hot.getColHeader(123); - hot.getColWidth(123); - hot.getCoords(elem.querySelector('td')); - hot.getCopyableData(123, 123); - hot.getCopyableText(123, 123, 123, 123); - hot.getData(123, 123, 123, 123); - hot.getDataAtCell(123, 123); - hot.getDataAtCol(123); - hot.getDataAtProp(123); - hot.getDataAtRow(123); - hot.getDataAtRowProp(123, 'foo'); - hot.getDataType(123, 123, 123, 123); - hot.getInstance(); - hot.getPlugin('foo'); - hot.getRowHeader(123); - hot.getRowHeight(123); - hot.getSchema(); - hot.getSelected(); - const range: ht.Range = hot.getSelectedRange(); - hot.getSettings(); - hot.getSourceData(123, 123, 123, 123); - hot.getSourceDataAtCell(123, 123); - hot.getSourceDataAtCol(123); - hot.getSourceDataAtRow(123); - hot.getValue(); - hot.hasColHeaders(); - hot.hasHook('foo'); - hot.hasRowHeaders(); - hot.isEmptyCol(123); - hot.isEmptyRow(123); - hot.isListening(); - hot.listen(); - hot.loadData([]); - hot.populateFromArray(123, 123, [], 123, 123, 'foo', 'foo', 'foo', []); - hot.propToCol('foo'); - hot.propToCol(123); - hot.removeCellMeta(123, 123, 'foo'); - hot.removeHook('foo', function() {}); - hot.render(); - hot.rowOffset(); - hot.runHooks('foo', 123, 'foo', true, {}, [], function() {}); - hot.selectCell(123, 123, 123, 123, true, true); - hot.selectCellByProp(123, 'foo', 123, 'foo', true); - hot.setCellMeta(123, 123, 'foo', 'foo'); - hot.setCellMetaObject(123, 123, {}); - hot.setDataAtCell(123, 123, 'foo', 'foo'); - hot.setDataAtRowProp(123, 'foo', 'foo', 'foo'); - hot.spliceCol(123, 123, 123, 'foo'); - hot.spliceRow(123, 123, 123, 'foo'); - hot.unlisten(); - hot.updateSettings({}, true); - hot.validateCells(function() {}); - - Handsontable.renderers.NumericRenderer(hot, new HTMLTableDataCellElement(), 0, 0, "prop", 1.235, {}); - Handsontable.renderers.TextRenderer(hot, new HTMLTableDataCellElement(), 0, 0, "prop", 1.235, {}); - Handsontable.Dom.addEvent(new HTMLElement(), "eventName", () => {}); -} diff --git a/handsontable/index.d.ts b/handsontable/index.d.ts deleted file mode 100644 index eeef57394e..0000000000 --- a/handsontable/index.d.ts +++ /dev/null @@ -1,362 +0,0 @@ -// Type definitions for Handsontable 0.24.3 -// Project: https://handsontable.com/ -// Definitions by: Handsoncode sp. z o.o. -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped\ - -declare namespace ht { - interface Options { - allowEmpty?: boolean; - allowInsertColumn?: boolean; - allowInsertRow?: boolean; - allowInvalid?: boolean; - allowRemoveColumn?: boolean; - allowRemoveRow?: boolean; - autoColumnSize?: Object|boolean; - autoComplete?: any[]; - autoRowSize?: Object|boolean; - autoWrapCol?: boolean; - autoWrapRow?: boolean; - bindRowsWithHeaders?: boolean|string; - cell?: any[]; - cells?: Function; - checkedTemplate?: boolean|string; - className?: string|any[]; - colHeaders?: boolean|any[]|Function; - collapsibleColumns?: boolean|any[]; - columnHeaderHeight?: number|any[]; - columns?: any[]; - columnSorting?: boolean|Object; - columnSummary?: Object; - colWidths?: any[]|Function|number|string; - commentedCellClassName?: string; - comments?: boolean|any[]; - contextMenu?: boolean|any[]|Object; - contextMenuCopyPaste?: Object; - copyable?: boolean; - copyColsLimit?: number; - copyPaste?: boolean; - copyRowsLimit?: number; - correctFormat?: boolean; - currentColClassName?: string; - currentRowClassName?: string; - customBorders?: boolean|any[]; - data?: any[]|Function; - dataSchema?: Object; - dateFormat?: string; - debug?: boolean; - defaultDate?: string; - disableVisualSelection?: boolean|string|any[]; - dropdownMenu?: boolean|Object|any[]; - editor?: string|Function|boolean; - enterBeginsEditing?: boolean; - enterMoves?: Object|Function; - fillHandle?: boolean|string|Object; - filter?: boolean; - filteringCaseSensitive?: boolean; - filters?: boolean; - fixedColumnsLeft?: number; - fixedRowsBottom?: number; - fixedRowsTop?: number; - format?: string; - fragmentSelection?: boolean|string; - ganttChart?: Object; - headerTooltips?: boolean|Object; - height?: number|Function; - hiddenColumns?: boolean|Object; - hiddenRows?: boolean|Object; - invalidCellClassName?: string; - label?: Object; - language?: string; - manualColumnFreeze?: boolean; - manualColumnMove?: boolean|any[]; - manualColumnResize?: boolean|any[]; - manualRowMove?: boolean|any[]; - manualRowResize?: boolean|any[]; - maxCols?: number; - maxRows?: number; - mergeCells?: boolean|any[]; - minCols?: number; - minRows?: number; - minSpareCols?: number; - minSpareRows?: number; - multiSelect?: boolean; - nestedHeaders?: any[]; - noWordWrapClassName?: string; - observeChanges?: boolean; - observeDOMVisibility?: boolean; - outsideClickDeselects?: boolean; - pasteMode?: string; - persistentState?: boolean; - placeholder?: any; - placeholderCellClassName?: string; - preventOverflow?: string|boolean; - readOnly?: boolean; - readOnlyCellClassName?: string; - renderAllRows?: boolean; - renderer?: string|Function; - rowHeaders?: boolean|any[]|Function; - rowHeaderWidth?: number|any[]; - rowHeights?: any[]|Function|number|string; - search?: boolean; - selectOptions?: any[]; - skipColumnOnPaste?: boolean; - sortByRelevance?: boolean; - sortFunction?: Function; - sortIndicator?: boolean; - source?: any[]|Function; - startCols?: number; - startRows?: number; - stretchH?: string; - strict?: boolean; - tableClassName?: string|any[]; - tabMoves?: Object; - title?: string; - trimDropdown?: boolean; - trimWhitespace?: boolean; - type?: string; - uncheckedTemplate?: boolean|string; - undo?: boolean; - validator?: Function|RegExp; - viewportColumnRenderingOffset?: number|string; - viewportRowRenderingOffset?: number|string; - visibleRows?: number; - width?: number|Function; - wordWrap?: boolean; - isEmptyCol?: (col: number) => boolean; - isEmptyRow?: (row: number) => boolean; - - // hooks - afterAutofillApplyValues?: (startArea: any[], entireArea: any[]) => void; - afterCellMetaReset?: () => void; - afterChange?: (changes: any[], source: string) => void; - afterChangesObserved?: () => void; - afterColumnMove?: (startColumn: number, endColumn: number) => void; - afterColumnResize?: (currentColumn: number, newSize: number, isDoubleClick: boolean) => void; - afterColumnSort?: (column: number, order: boolean) => void; - afterContextMenuDefaultOptions?: (predefinedItems: any[]) => void; - afterContextMenuHide?: (context: Object) => void; - afterContextMenuShow?: (context: Object) => void; - afterCopyLimit?: (selectedRows: number, selectedColumnds: number, copyRowsLimit: number, copyColumnsLimit: number) => void; - afterCreateCol?: (index: number, amount: number) => void; - afterCreateRow?: (index: number, amount: number) => void; - afterDeselect?: () => void; - afterDestroy?: () => void; - afterDocumentKeyDown?: (event: Event) => void; - afterFilter?: (formulasStack: any[]) => void; - afterGetCellMeta?: (row: number, col: number, cellProperties: Object) => void; - afterGetColHeader?: (col: number, TH: Element) => void; - afterGetColumnHeaderRenderers?: (array: any[]) => void; - afterGetRowHeader?: (row: number, TH: Element) => void; - afterGetRowHeaderRenderers?: (array: any[]) => void; - afterInit?: () => void; - afterLoadData?: (firstTime: boolean) => void; - afterMomentumScroll?: () => void; - afterOnCellCornerMouseDown?: (event: Object) => void; - afterOnCellMouseDown?: (event: Object, coords: Object, TD: Element) => void; - afterOnCellMouseOver?: (event: Object, coords: Object, TD: Element) => void; - afterRemoveCol?: (index: number, amount: number) => void; - afterRemoveRow?: (index: number, amount: number) => void; - afterRender?: (isForced: boolean) => void; - afterRenderer?: (TD: Element, row: number, col: number, prop: string|number, value: string, cellProperties: Object) => void; - afterRowMove?: (startRow: number, endRow: number) => void; - afterRowResize?: (currentRow: number, newSize: number, isDoubleClick: boolean) => void; - afterScrollHorizontally?: () => void; - afterScrollVertically?: () => void; - afterSelection?: (r: number, c: number, r2: number, c2: number) => void; - afterSelectionByProp?: (r: number, p: string, r2: number, p2: string) => void; - afterSelectionEnd?: (r: number, c: number, r2: number, c2: number) => void; - afterSelectionEndByProp?: (r: number, p: string, r2: number, p2: string) => void; - afterSetCellMeta?: (row: number, col: number, key: string, value: any) => void; - afterUpdateSettings?: () => void; - afterValidate?: (isValid: boolean, value: any, row: number, prop: string|number, source: string) => void|boolean; - beforeAutofill?: (start: Object, end: Object, data: any[]) => void; - beforeCellAlignment?: (stateBefore: any, range: any, type: string, alignmentClass: string) => void; - beforeChange?: (changes: any[], source: string) => void; - beforeChangeRender?: (changes: any[], source: string) => void; - beforeColumnMove?: (startColumn: number, endColumn: number) => void; - beforeColumnResize?: (currentColumn: number, newSize: number, isDoubleClick: boolean) => void; - beforeColumnSort?: (column: number, order: boolean) => void; - beforeDrawBorders?: (corners: any[], borderClassName: string) => void; - beforeFilter?: (formulasStack: any[]) => void; - beforeGetCellMeta?: (row: number, col: number, cellProperties: Object) => void; - beforeInit?: () => void; - beforeInitWalkontable?: (walkontableConfig: Object) => void; - beforeKeyDown?: (event: Event) => void; - beforeOnCellMouseDown?: (event: Event, coords: Object, TD: Element) => void; - beforeRemoveCol?: (index: number, amount: number, logicalCols?: any[]) => void; - beforeRemoveRow?: (index: number, amount: number, logicalRows?: any[]) => void; - beforeRender?: (isForced: boolean) => void; - beforeRenderer?: (TD: Element, row: number, col: number, prop: string|number, value: string, cellProperties: Object) => void; - beforeRowMove?: (startRow: number, endRow: number) => void; - beforeRowResize?: (currentRow: number, newSize: number, isDoubleClick: boolean) => any; - beforeSetRangeEnd?: (coords: any[]) => void; - beforeStretchingColumnWidth?: (stretchedWidth: number, column: number) => void; - beforeTouchScroll?: () => void; - beforeValidate?: (value: any, row: number, prop: string|number, source: string) => void; - construct?: () => void; - init?: () => void; - modifyCol?: (col: number) => void; - modifyColHeader?: (column: number) => void; - modifyColWidth?: (width: number, col: number) => void; - modifyCopyableRange?: (copyableRanges: any[]) => void; - modifyRow?: (row: number) => void; - modifyRowHeader?: (row: number) => void; - modifyRowHeight?: (height: number, row: number) => void; - persistentStateLoad?: (key: string, valuePlaceholder: Object) => void; - persistentStateReset?: (key: string) => void; - persistentStateSave?: (key: string, value: any) => void; - unmodifyCol?: (col: number) => void; - } - interface Methods { - addHook(key: string, callback: Function|any[]): void; - addHookOnce(key: string, callback: Function|any[]): void; - alter(action: string, index: number, amount?: number, source?: string, keepEmptyRows?: boolean): void; - clear(): void; - colOffset(): number; - colToProp(col: number): string|number; - countCols(): number; - countEmptyCols(ending?: boolean): number; - countEmptyRows(ending?: boolean): number; - countRenderedCols(): number; - countRenderedRows(): number; - countRows(): number; - countSourceRows(): number; - countVisibleCols(): number; - countVisibleRows(): number; - deselectCell(): void; - destroy(): void; - destroyEditor(revertOriginal?: boolean): void; - getActiveEditor(): Object; - getCell(row: number, col: number, topmost?: boolean): Element; - getCellEditor(row: number, col: number): Object; - getCellMeta(row: number, col: number): Object; - getCellRenderer(row: number, col: number): Function; - getCellValidator(row: number, col: number): any; - getColHeader(col?: number): any[]|string; - getColWidth(col: number): number; - getCoords(elem: Element): Object; - getCopyableData(row: number, column: number): string; - getCopyableText(startRow: number, startCol: number, endRow: number, endCol: number): string; - getData(r?: number, c?: number, r2?: number, c2?: number): any[]; - getDataAtCell(row: number, col: number): any; - getDataAtCol(col: number): any[]; - getDataAtProp(prop: string|number): any[]; - getDataAtRow(row: number): any[]; - getDataAtRowProp(row: number, prop: string): any; - getDataType(rowFrom: number, columnFrom: number, rowTo: number, columnTo: number): string; - getInstance(): any; - getPlugin(pluginName: string): any; - getRowHeader(row?: number): any[]|string; - getRowHeight(row: number): number; - getSchema(): Object; - getSelected(): any[]; - getSelectedRange(): Range; - getSettings(): Object; - getSourceData(r?: number, c?: number, r2?: number, c2?: number): any[]; - getSourceDataAtCell(row: number, column: number): any; - getSourceDataAtCol(column: number): any[]; - getSourceDataAtRow(row: number): any[]|Object; - getValue(): any; - hasColHeaders(): boolean; - hasHook(key: string): boolean; - hasRowHeaders(): boolean; - isEmptyCol(col: number): boolean; - isEmptyRow(row: number): boolean; - isListening(): boolean; - listen(): void; - loadData(data: any[]): void; - populateFromArray(row: number, col: number, input: any[], endRow?: number, endCol?: number, source?: string, method?: string, direction?: string, deltas?: any[]): any; - propToCol(prop: string | number): number; - removeCellMeta(row: number, col: number, key: string): void; - removeHook(key: string, callback: Function): void; - render(): void; - rowOffset(): number; - runHooks(key: string, p1?: any, p2?: any, p3?: any, p4?: any, p5?: any, p6?: any): any; - selectCell(row: number, col: number, endRow?: number, endCol?: number, scrollToCell?: boolean, changeListener?: boolean): boolean; - selectCellByProp(row: number, prop: string, endRow?: number, endProp?: string, scrollToCell?: boolean): boolean; - setCellMeta(row: number, col: number, key: string, val: string): void; - setCellMetaObject(row: number, col: number, prop: Object): void; - setDataAtCell(row: number|any[], col: number, value: string, source?: string): void; - setDataAtRowProp(row: number|any[], prop: string, value: string, source?: string): void; - spliceCol(col: number, index: number, amount: number, elements?: any): void; - spliceRow(row: number, index: number, amount: number, elements?: any): void; - unlisten(): void; - updateSettings(settings: Object, init: boolean): void; - validateCells(callback: Function): void; - } - - interface Selection { - start: CellPosition; - end: CellPosition; - } - - interface Range { - from: CellPosition; - to: CellPosition; - } - - interface HandsontableRegisterer { - getInstance(id: string): Methods; - registerInstance(id: string, instance: Methods): void; - removeInstance(id: string): void; - } - - interface ColumnProperties extends CellProperties { - data?: string; - editor?: string; - selectOptions?: any[]; - } - - interface CellProperties { - renderer?: ( - instance: Methods, - td: HTMLTableDataCellElement, - row: number, - col: number, - prop: string, - value: any, - tdCellProperties: Object) => void; - type?: string; - readOnly?: boolean; - language?: string; - format?: string; - validator?: (value: string, callback: (condition: boolean) => void) => void; - } - - interface CellPosition { - row: number; - col: number; - } -} - - -declare var Handsontable: { - new (element: Element, options: ht.Options): ht.Methods; - renderers: { - TextRenderer( - instance: any, - td: HTMLTableCellElement, - row: number, - col: number, - prop: string, - value: any, - cellProperties: any): void; - NumericRenderer( - instance: any, - td: HTMLTableCellElement, - row: number, - col: number, - prop: string, - value: any, - cellProperties: any): void; - } - Dom: { - addEvent(element: HTMLElement, eventName: string, callback: Function): void; - } -}; - -declare module "handsontable" { - export var Handsontable: { - new (element: Element, options: ht.Options): ht.Methods; - }; -} diff --git a/handsontable/tsconfig.json b/handsontable/tsconfig.json deleted file mode 100644 index fd32d1d335..0000000000 --- a/handsontable/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "handsontable-tests.ts" - ] -} \ No newline at end of file diff --git a/hapi-auth-jwt2/index.d.ts b/hapi-auth-jwt2/index.d.ts deleted file mode 100644 index 1bcbbc817e..0000000000 --- a/hapi-auth-jwt2/index.d.ts +++ /dev/null @@ -1,126 +0,0 @@ -// Type definitions for hapi-auth-jwt2 7.0 -// Project: http://github.com/dwyl/hapi-auth-jwt2 -// Definitions by: Warren Seymour -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -import {Request, Response} from 'hapi'; - -/** - * A key lookup function - * - * @param decoded the *decoded* but *unverified* JWT received from client - * @param callback the key lookup callback - */ -type KeyLookup = (decoded: any, callback: KeyLookupCallback) => void; - -/** - * Called when key lookup function has completed - * - * @param err an internal error - * @param key the secret key - * @param extraInfo any additional information that you would like - * to use in `validateFunc` which can be accessed via - * `request.plugins['hapi-auth-jwt2'].extraInfo` - */ -type KeyLookupCallback = (err: any, key: string, extraInfo?: any) => void; - -/** - * Called when Validation has completed - * - * @param err an internal error - * @param valid `true` if the JWT was valid, otherwise `false` - * @param credentials alternative credentials to be set instead of `decoded` - */ -type ValidateCallback = (err: any, valid: boolean, credentials?: any) => void; - -/** - * Options passed to `hapi.auth.strategy` when this plugin is used - */ -export interface Options { - /** - * The secret key used to check the signature of the token *or* a *key lookup function* - */ - key?: string | KeyLookup; - - /** - * The function which is run once the Token has been decoded - * - * @param decoded the *decoded* and *verified* JWT received from the client in *request.headers.authorization* - * @param request the original *request* received from the client - * @param callback the validation callback - */ - validateFunc(decoded: {}, request: Request, callback: ValidateCallback): void; - - /** - * Settings to define how tokens are verified by the jsonwebtoken library - */ - verifyOptions?: { - /** - * Ignore expired tokens - */ - ignoreExpiration?: boolean; - - /** - * Do not enforce token audience - */ - audience?: boolean; - - /** - * Do not require the issuer to be valid - */ - issuer?: boolean; - - /** - * List of allowed algorithms - */ - algorithms?: string[]; - }; - - /** - * function called to decorate the response with authentication headers - * before the response headers or payload is written - * - * @param request the Request object - * @param reply is called if an error occurred - */ - responseFunc?(request: Request, reply: (err: any, response: Response) => void): void; - - /** - * If you prefer to pass your token via url, simply add a token url - * parameter to your request or use a custom parameter by setting `urlKey. - * To disable the url parameter set urlKey to `false` or ''. - * @default 'token' - */ - urlKey?: string | boolean; - - /** - * If you prefer to set your own cookie key or your project has a cookie - * called 'token' for another purpose, you can set a custom key for your - * cookie by setting `options.cookieKey='yourkeyhere'`. To disable cookies - * set cookieKey to `false` or ''. - * @default 'token' - */ - cookieKey?: string | boolean; - - /** - * If you want to set a custom key for your header token use the - * `headerKey` option. To disable header token set headerKey to `false` or - * ''. - * @default 'authorization' - */ - headerKey?: string | boolean; - - /** - * Allow custom token type, e.g. `Authorization: 12345678` - */ - tokenType?: string; - - /** - * Set to `true` to receive the complete token (`decoded.header`, - * `decoded.payload` and `decoded.signature`) as decoded argument to key - * lookup and `verifyFunc` callbacks (*not `validateFunc`*) - * @default false - */ - complete?: boolean; -} - -export default function hapiAuthJwt2(): void; diff --git a/hapi-auth-jwt2/tslint.json b/hapi-auth-jwt2/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/hapi-auth-jwt2/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/hapi/hapi-tests.ts b/hapi/hapi-tests.ts deleted file mode 100644 index 97c4a77b44..0000000000 --- a/hapi/hapi-tests.ts +++ /dev/null @@ -1,203 +0,0 @@ - - -import Hapi = require("hapi"); - -// Create a server with a host and port -var server = new Hapi.Server(); -server.connection({ - host: "localhost", - port: 8000 -}); - -// Add plugins -var plugin: any = { - register: function (plugin: Object, options: Object, next: Function) { - next(); - } -}; - -plugin.register.attributes = { - name: "test", - version: "1.0.0" -}; - -// optional options parameter -server.register({}, function (err) { -}); -// optional callback function with and without options -server.register({}).then((res: any) => { - console.log(res); -}); -server.register({}, {select: "api", routes: {prefix: "/prefix"}}).then((res: any) => { - console.log(res); -}); - -// optional options.routes.vhost parameter -server.register({}, {select: "api", routes: {prefix: "/prefix"}}, function (err) { -}); - -//server.pack.register(plugin, (err: Object) => { -// if (err) { throw err; } -//}); - -//server.pack.register([plugin], (err: Object) => { -// if (err) { throw err; } -//}); - -// Add server method -var add = function (a: number, b: number, next: (err: any, result?: any, ttl?: number) => void) { - next(null, a + b); -}; - -server.method("sum", add);//, { cache: { expiresIn: 2000 } }); - -server.methods["sum"](4, 5, (err: any, result: any) => { - console.log(result); -}); - -var addArray = function (array: Array, next: (err: any, result?: any, ttl?: number) => void) { - var sum: number = 0; - array.forEach((item: number) => { - sum += item; - }); - next(null, sum); -}; - -server.method("sumObj", addArray, { - //cache: { expiresIn: 2000 }, - generateKey: (array: Array) => { - return array.join(','); - } -}); - -server.methods["sumObj"]([5, 6], (err: any, result: any) => { - console.log(result); -}); - -// Add the route -server.route({ - method: 'GET', - path: '/hello', - handler: function (request: Hapi.Request, reply: Function) { - request.log('info', { route: '/hello' }, Date.now()); - reply('hello world'); - } -}); - -server.route([{ - method: 'GET', - path: '/hello2', - handler: function (request: Hapi.Request, reply: Function) { - reply('hello world2'); - } -}]); - -server.route([{ - method: 'GET', - path: '/hello3', - handler: function (request: Hapi.Request, reply: Hapi.IReply) { - reply('hello world2'); - } -}]); - -interface IHello { - msg: string -} - -server.route([{ - method: 'GET', - path: '/hello4', - handler: function (request: Hapi.Request, reply: Hapi.IStrictReply) { - reply({ msg: 'hello world' }) - } -}]); - -// Implict handler -server.route({ - method: 'GET', - path: '/hello6', - handler: function (request: Hapi.Request, reply: Hapi.IReply) { - request.log('info', { route: '/hello' }, Date.now()); - reply('hello world'); - } -}); - -// config.validate parameters should be optional -server.route([{ - method: 'GET', - path: '/hello2', - handler: function (request: Hapi.Request, reply: Function) { - reply('hello world2'); - }, - config: { - validate: {} - } -}]); - -// Should be able to chain reply options -server.route([{ - method: 'GET', - path: '/chained-notation', - handler: function (request: Hapi.Request, reply: Hapi.IReply) { - reply.state('cookie_key', 'cookie_value'); - reply('chained-notation') - .bytes(16) - .code(200) - .type('text/plain') - .unstate('cookie_to_remove') - .header('X-Custom', 'some-value'); - } -}]); - -// Start the server -server.start(); - -// server startup may now return a promise -server.start() - .then(() => { - console.log('Started!'); - }); - -//inject a request into connection -server.inject({ - method: 'GET', - url: '/hello' -}).then(response => { - console.log(response.statusCode); -}); - -//the same but this time using callback -server.inject({ - method: 'GET', - url: '/hello' -}, response => { - console.log(response.statusCode); -}); - -//tests for server initialization -server.initialize() - .then(() => { - console.log('Initialized!') - }); - -//and the same but with callback -server.initialize(err => { - if (err) { - console.log(err); - } -}); - -//server stopping may now return a promise -server.stop() - .then(() => { - console.log('Stopped!'); - }); - -//decorate can take an optional options argument -server.decorate('hello', 'world', () => { -}, { - apply: true -}); - -server.decorate('hello2', 'world2', () => { -}); diff --git a/hapi/index.d.ts b/hapi/index.d.ts deleted file mode 100644 index 9d8f8f0120..0000000000 --- a/hapi/index.d.ts +++ /dev/null @@ -1,2494 +0,0 @@ -// Type definitions for hapi 16.0.0 -// Project: http://github.com/spumko/hapi -// Definitions by: Jason Swearingen -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -//Note/Disclaimer: This .d.ts was created against hapi v8.x but has been incrementally upgraded to 13.x. Some newer features/changes may be missing. YMMV. - -/// - -import http = require("http"); -import stream = require("stream"); -import Events = require("events"); -import url = require("url"); - -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; -} - -export interface IHeaderOptions { - append?: boolean; - separator?: string; - override?: boolean; - duplicate?: boolean; -} - -/** Boom Module for errors. https://github.com/hapijs/boom - * boom provides a set of utilities for returning HTTP errors. Each utility returns a Boom error response object (instance of Error) which includes the following properties: */ -export interface IBoom extends Error { - /** if true, indicates this is a Boom object instance. */ - isBoom: boolean; - /** convenience bool indicating status code >= 500. */ - isServer: boolean; - /** the error message. */ - message: string; - /** the formatted response.Can be directly manipulated after object construction to return a custom error response.Allowed root keys: */ - output: { - /** the HTTP status code (typically 4xx or 5xx). */ - statusCode: number; - /** an object containing any HTTP headers where each key is a header name and value is the header content. */ - headers: IDictionary; - /** the formatted object used as the response payload (stringified).Can be directly manipulated but any changes will be lost if reformat() is called.Any content allowed and by default includes the following content: */ - payload: { - /** the HTTP status code, derived from error.output.statusCode. */ - statusCode: number; - /** the HTTP status message (e.g. 'Bad Request', 'Internal Server Error') derived from statusCode. */ - error: string; - /** the error message derived from error.message. */ - message: string; - }; - }; - /** reformat()rebuilds error.output using the other object properties. */ - reformat(): void; - -} - -/** 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; -} - - /** policy configuration for the "CatBox" module and server method options. */ - export interface ICatBoxCachePolicyOptions { - /** the cache name configured in server.cache. Defaults to the default cache. */ - cache?: string; - /** string segment name, used to isolate cached items within the cache partition. When called within a plugin, defaults to '!name' where 'name' is the plugin name. When called within a server method, defaults to '#name' where 'name' is the server method name. Required when called outside of a plugin. */ - segment?: string; - /** if true, allows multiple cache provisions to share the same segment. Default to false. */ - shared?: boolean; - /** 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 expire. Uses local time. Cannot be used together with expiresIn. */ - expiresAt?: number; - /** a function used to generate a new cache item if one is not found in the cache when calling get(). The method's signature is function(id, next) where: - id - the id string or object provided to the get() method. - next - the method called when the new item is returned with the signature function(err, value, ttl) where: - err - an error condition. - value - the new value generated. - ttl - the cache ttl value in milliseconds. Set to 0 to skip storing in the cache. Defaults to the cache global policy. */ - generateFunc?: Function; - /** number of milliseconds to mark an item stored in cache as stale and attempt to regenerate it when generateFunc is provided. Must be less than expiresIn. */ - staleIn?: number; - /** number of milliseconds to wait before checking if an item is stale. */ - staleTimeout?: number; - /** number of milliseconds to wait before returning a timeout error when the generateFunc function takes too long to return a value. When the value is eventually returned, it is stored in the cache for future requests. Required if generateFunc is present. Set to false to disable timeouts which may cause all get() requests to get stuck forever. */ - generateTimeout?: number; - /** if true, an error or timeout in the generateFunc causes the stale value to be evicted from the cache. Defaults to true */ - dropOnError?: boolean; - /** if false, an upstream cache read error will stop the cache.get() method from calling the generate function and will instead pass back the cache error. Defaults to true. */ - generateOnReadError?: boolean; - /** if false, an upstream cache write error when calling cache.get() will be passed back with the generated value when calling. Defaults to true. */ - generateIgnoreWriteError?: boolean; - /** number of milliseconds while generateFunc call is in progress for a given id, before a subsequent generateFunc call is allowed. Defaults to 0 (no blocking of concurrent generateFunc calls beyond staleTimeout). */ - pendingGenerateTimeout?: number; - } - - -/** 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; - /** if false, response content encoding is disabled. Defaults to true */ - compression?: boolean; - /** 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; - /** sets up server-side caching. Every server includes a default cache for storing application state. By default, a simple memory-based cache is created which has limited capacity and capabilities. hapi uses catbox for its cache which includes support for common storage solutions (e.g. Redis, MongoDB, Memcached, and Riak). Caching is only utilized if methods and plugins explicitly store their state in the cache. The server cache configuration only defines the storage container itself. cache can be assigned: - a prototype function (usually obtained by calling require() on a catbox strategy such as require('catbox-redis')). - a configuration object with the following options: - enginea prototype function or catbox engine object. - namean identifier used later when provisioning or configuring caching for server methods or plugins. Each cache name must be unique. A single item may omit the name option which defines the default cache. If every cache includes a name, a default memory cache is provisions as well. - sharedif true, allows multiple cache users to share the same segment (e.g. multiple methods using the same cache storage container). Default to false. - other options passed to the catbox strategy used. - an array of the above object for configuring multiple cache instances, each with a unique name. When an array of objects is provided, multiple cache connections are established and each array item (except one) must include a name. */ - cache?: string | ICatBoxCacheOptions | Array | any; - /** sets the default connections configuration which can be overridden by each connection where: */ - connections?: IConnectionConfigurationServerDefaults; - /** determines which logged events are sent to the console (this should only be used for development and does not affect which events are actually logged internally and recorded). Set to false to disable all console logging, or to an object*/ - debug?: boolean | { - /** - a string array of server log tags to be displayed via console.error() when the events are logged via server.log() as well as internally generated server logs. For example, to display all errors, set the option to ['error']. To turn off all console debug messages set it to false. Defaults to uncaught errors thrown in external code (these errors are handled automatically and result in an Internal Server Error response) or runtime errors due to developer error. */ - log: string[]; - /** - a string array of request log tags to be displayed via console.error() when the events are logged via request.log() as well as internally generated request logs. For example, to display all errors, set the option to ['error']. To turn off all console debug messages set it to false. Defaults to uncaught errors thrown in external code (these errors are handled automatically and result in an Internal Server Error response) or runtime errors due to developer error.*/ - request: string[]; - }; - /** file system related settings*/ - files?: { - /** sets the maximum number of file etag hash values stored in the etags cache. Defaults to 10000.*/ - etagsCacheMaxSize?: number; - }; - /** process load monitoring*/ - load?: { - /** the frequency of sampling in milliseconds. Defaults to 0 (no sampling).*/ - sampleInterval?: number; - }; - - /** 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 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; - - /**layout - if set to true or a layout filename, layout support is enabled.A layout is a single template file used as the parent template for other view templates in the same engine.If true, the layout template name must be 'layout.ext' where 'ext' is the engine's extension. Otherwise, the provided filename is suffixed with the engine's extension and loaded.Disable layout when using Jade as it will handle including any layout files independently.Defaults to false.*/ - layout?: boolean | string; - /**layoutPath - the root file path where layout templates are located (using the relativeTo prefix if present). Defaults to path.*/ - layoutPath?: string; - /**layoutKeyword - the key used by the template engine to denote where primary template content should go.Defaults to 'content'.*/ - layoutKeywork?: string; - /**encoding - the text encoding used by the templates when reading the files and outputting the result.Defaults to 'utf8'.*/ - encoding?: string; - /**isCached - if set to false, templates will not be cached (thus will be read from file on every use).Defaults to true.*/ - isCached?: boolean; - /**allowAbsolutePaths - if set to true, allows absolute template paths passed to reply.view().Defaults to false.*/ - allowAbsolutePaths?: boolean; - /**allowInsecureAccess - if set to true, allows template paths passed to reply.view() to contain '../'.Defaults to false.*/ - allowInsecureAccess?: boolean; - /**compileOptions - options object passed to the engine's compile function. Defaults to empty options {}.*/ - compileOptions?: any; - /**runtimeOptions - options object passed to the returned function from the compile operation.Defaults to empty options {}.*/ - runtimeOptions?: any; - /**contentType - the content type of the engine results.Defaults to 'text/html'.*/ - contentType?: string; - /**compileMode - specify whether the engine compile() method is 'sync' or 'async'.Defaults to 'sync'.*/ - compileMode?: string; - /**context - a global context used with all templates.The global context option can be either an object or a function that takes no arguments and returns a context object.When rendering views, the global context will be merged with any context object specified on the handler or using reply.view().When multiple context objects are used, values from the global context always have lowest precedence.*/ - context?: any; -} - -export interface IServerViewsEnginesOptions extends IServerViewsAdditionalOptions { - /**- 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; - }; -} - -/**Initializes the server views manager - var Hapi = require('hapi'); - var server = new Hapi.Server(); - - server.views({ -engines: { -html: require('handlebars'), -jade: require('jade') -}, -path: '/static/templates' -}); - When server.views() is called within a plugin, the views manager is only available to plugins methods. - */ -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; -} - - -interface IReplyMethods { - /** 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; - - /** Transmits a file from the file system. The 'Content-Type' header defaults to the matching mime type based on filename extension. The response flow control rules do not apply. */ - file(/** the file path. */ - path: string, - /** optional settings: */ - options?: { - /** - an optional filename to specify if sending a 'Content-Disposition' header, defaults to the basename of path*/ - filename?: string; - /** specifies whether to include the 'Content-Disposition' header with the response. Available values: - false - header is not included. This is the default value. - 'attachment' - 'inline'*/ - mode?: boolean | string; - /** if true, looks for the same filename with the '.gz' suffix for a pre-compressed version of the file to serve if the request supports content encoding. Defaults to false. */ - lookupCompressed: boolean; - }): void; - /** Concludes the handler activity by returning control over to the router with a templatized view response. - the response flow control rules apply. */ - view(/** the template filename and path, relative to the templates path configured via the server views manager. */ - template: string, - /** optional object used by the template to render context-specific result. Defaults to no context {}. */ - context?: {}, - /** optional object used to override the server's views manager configuration for this response. Cannot override isCached, partialsPath, or helpersPath which are only loaded at initialization. */ - options?: any): Response; - /** Sets a header on the response */ - header(name: string, value: string, options?: IHeaderOptions): Response; - - /** 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; - /** 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; - /** Redirects the client to the specified uri. Same as calling reply().redirect(uri). - he response flow control rules apply. */ - redirect(uri: string): ResponseRedirect; - - /** Replies with the specified response */ - response(result: any): Response; - - /** Sets a cookie on the response */ - state(name: string, value: any, options?: any): void; - - /** Clears a cookie on the response */ - unstate(name: string, options?: any): void; -} - -/** Concludes the handler activity by setting a response and returning control over to the framework where: - erran optional error response. - result an optional response payload. - Since an request can only have one response regardless if it is an error or success, the reply() method can only result in a single response value. This means that passing both an err and result will only use the err. There is no requirement for either err or result to be (or not) an Error object. The framework will simply use the first argument if present, otherwise the second. The method supports two arguments to be compatible with the common callback pattern of error first. - FLOW CONTROL: - When calling reply(), the framework waits until process.nextTick() to continue processing the request and transmit the response. This enables making changes to the returned response object before the response is sent. This means the framework will resume as soon as the handler method exits. To suspend this behavior, the returned response object supports the following methods: hold(), send() */ -export interface IReply extends IReplyMethods { - (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; -} - -/** Concludes the handler activity by setting a response and returning control over to the framework where: - erran optional error response. - result an optional response payload. - Since an request can only have one response regardless if it is an error or success, the reply() method can only result in a single response value. This means that passing both an err and result will only use the err. There is no requirement for either err or result to be (or not) an Error object. The framework will simply use the first argument if present, otherwise the second. The method supports two arguments to be compatible with the common callback pattern of error first. - FLOW CONTROL: - When calling reply(), the framework waits until process.nextTick() to continue processing the request and transmit the response. This enables making changes to the returned response object before the response is sent. This means the framework will resume as soon as the handler method exits. To suspend this behavior, the returned response object supports the following methods: hold(), send() */ -export interface IStrictReply extends IReplyMethods { - (err: Error, - result?: 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: IPromise | T): Response; -} - -export interface ISessionHandler { - (request: Request, reply: IReply): void; - } - - export interface IStrictSessionHandler { - (request: Request, reply: IStrictReply): 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; - /** 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; - /** a function used to map the request URI to the proxied URI. Cannot be used together with host, port, protocol, or uri. The function signature is function(request, callback) where: - request - is the incoming request object. - callback - is function(err, uri, headers) where: - err - internal error condition. - uri - the absolute proxy URI. - headers - optional object where each key is an HTTP request header and the value is the header content.*/ - mapUri?: (request: Request, callback: (err: any, uri: string, headers?: { [key: string]: string }) => void) => void; - /** a custom function for processing the response from the upstream service before sending to the client. Useful for custom error handling of responses from the proxied endpoint or other payload manipulation. Function signature is function(err, res, request, reply, settings, ttl) where: - err - internal or upstream error returned from attempting to contact the upstream proxy. - res - the node response object received from the upstream service. res is a readable stream (use the wreck module read method to easily convert it to a Buffer or string). - request - is the incoming request object. - reply - the reply interface function. - settings - the proxy handler configuration. - ttl - the upstream TTL in milliseconds if proxy.ttl it set to 'upstream' and the upstream response included a valid 'Cache-Control' header with 'max-age'.*/ - onResponse?: (err: any, - res: http.ServerResponse, - req: Request, - reply: IReply, - settings: IProxyHandlerConfig, - ttl: number) => void; - /** if set to 'upstream', applies the upstream response caching policy to the response using the response.ttl() method (or passed as an argument to the onResponse method if provided).*/ - ttl?: number; - /** - a node http(s) agent to be used for connections to upstream server. see https://nodejs.org/api/http.html#http_class_http_agent */ - agent?: http.Agent; - /** sets the maximum number of sockets available per outgoing proxy host connection. false means use the wreck module default value (Infinity). Does not affect non-proxy outgoing client connections. Defaults to Infinity.*/ - maxSockets?: boolean | number; -} -/** TODO: fill in joi definition */ -export interface IJoi { - -} -/** 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; -} - -/** Each route can be customize to change the default behavior of the request lifecycle using the following options: */ -export interface IRouteAdditionalConfigurationOptions { - /** application specific configuration.Should not be used by plugins which should use plugins[name] instead. */ - app?: any; - /** authentication configuration.Value can be: false to disable authentication if a default strategy is set. - a string with the name of an authentication strategy registered with server.auth.strategy(). - an object */ - auth?: boolean | string | - { - /** the authentication mode.Defaults to 'required' if a server authentication strategy is configured, otherwise defaults to no authentication.Available values: - 'required'authentication is required. - 'optional'authentication is optional (must be valid if present). - 'try'same as 'optional' but allows for invalid authentication. */ - mode?: string; - /** a string array of strategy names in order they should be attempted.If only one strategy is used, strategy can be used instead with the single string value.Defaults to the default authentication strategy which is available only when a single strategy is configured. */ - strategies?: string | Array; - /** if set, the payload (in requests other than 'GET' and 'HEAD') is authenticated after it is processed.Requires a strategy with payload authentication support (e.g.Hawk).Cannot be set to a value other than 'required' when the scheme sets the options.payload to true.Available values: - falseno payload authentication.This is the default value. - 'required'payload authentication required.This is the default value when the scheme sets options.payload to true. - 'optional'payload authentication performed only when the client includes payload authentication information (e.g.hash attribute in Hawk). */ - payload?: string; - /** the application scope required to access the route.Value can be a scope string or an array of scope strings.The authenticated credentials object scope property must contain at least one of the scopes defined to access the route.Set to false to remove scope requirements.Defaults to no scope required. */ - scope?: string | Array | boolean; - /** the required authenticated entity type.If set, must match the entity value of the authentication credentials.Available values: - anythe authentication can be on behalf of a user or application.This is the default value. - userthe authentication must be on behalf of a user. - appthe authentication must be on behalf of an application. */ - entity?: string; - /** - * an object or array of objects specifying the route access rules. Each rule is evaluated against an incoming - * request and access is granted if at least one rule matches. Each rule object must include at least one of: - */ - access?: IRouteAdditionalConfigurationAuthAccess | IRouteAdditionalConfigurationAuthAccess[]; - }; - /** an object passed back to the provided handler (via this) when called. */ - bind?: any; - /** if the route method is 'GET', the route can be configured to include caching directives in the response using the following options */ - cache?: { - /** 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; - }; - - /** an alternative location for the route handler option. */ - handler?: ISessionHandler | IStrictSessionHandler | 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; - /** 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; - /** determines how to handle payload parsing errors. Allowed values are: - 'error'return a Bad Request (400) error response. This is the default value. - 'log'report the error but continue processing the request. - 'ignore'take no action and continue processing the request. */ - failAction?: string; - }; - /** pluginspecific configuration.plugins is an object where each key is a plugin name and the value is the plugin configuration. */ - plugins?: IDictionary; - /** an array with [route prerequisites] methods which are executed in serial or in parallel before the handler is called. */ - pre?: any[]; - /** validation rules for the outgoing response payload (response body).Can only validate object response: */ - response?: { - /** the default HTTP status code when the payload is empty. Value can be 200 or 204. - Note that a 200 status code is converted to a 204 only at the time or response transmission - (the response status code will remain 200 throughout the request lifecycle unless manually set). Defaults to 200. */ - emptyStatusCode?: number; - /** the default response object validation rules (for all non-error responses) expressed as one of: - true - any payload allowed (no validation performed). This is the default. - false - no payload allowed. - a Joi validation object. - a validation function using the signature function(value, options, next) where: - value - the object containing the response object. - options - the server validation options. - next(err) - the callback function called when validation is completed. */ - schema?: boolean | any; - /** HTTP status- codespecific validation rules.The status key is set to an object where each key is a 3 digit HTTP status code and the value has the same definition as schema.If a response status code is not present in the status object, the schema definition is used, expect for errors which are not validated by default. */ - status?: { [statusCode: number]: boolean | any }; - /** the percent of responses validated (0100).Set to 0 to disable all validation.Defaults to 100 (all responses). */ - sample?: number; - /** defines what to do when a response fails validation.Options are: - errorreturn an Internal Server Error (500) error response.This is the default value. - loglog the error but send the response. */ - failAction?: string; - /** if true, applies the validation rule changes to the response.Defaults to false. */ - modify?: boolean; - /** options to pass to Joi.Useful to set global options such as stripUnknown or abortEarly (the complete list is available here: https://github.com/hapijs/joi#validatevalue-schema-options-callback ).Defaults to no options. */ - options?: any; - }; - /** sets common security headers (disabled by default).To enable set security to true or to an object with the following options */ - security?: boolean | { - /** controls the 'Strict-Transport-Security' header.If set to true the header will be set to max- age=15768000, if specified as a number the maxAge parameter will be set to that number.Defaults to true.You may also specify an object with the following fields: */ - hsts?: boolean | number | { - /** the max- age portion of the header, as a number.Default is 15768000. */ - maxAge?: number; - /** a boolean specifying whether to add the includeSubdomains flag to the header. */ - includeSubdomains?: boolean; - /** a boolean specifying whether to add the 'preload' flag (used to submit domains inclusion in Chrome's HTTP Strict Transport Security (HSTS) preload list) to the header. */ - preload?: boolean; - }; - /** controls the 'X-Frame-Options' header.When set to true the header will be set to DENY, you may also specify a string value of 'deny' or 'sameorigin'.To use the 'allow-from' rule, you must set this to an object with the following fields: */ - xframe?: { - /** either 'deny', 'sameorigin', or 'allow-from' */ - rule: string; - /** when rule is 'allow-from' this is used to form the rest of the header, otherwise this field is ignored.If rule is 'allow-from' but source is unset, the rule will be automatically changed to 'sameorigin'. */ - source: string; - }; - /** boolean that controls the 'X-XSS-PROTECTION' header for IE.Defaults to true which sets the header to equal '1; mode=block'.NOTE: This setting can create a security vulnerability in versions of IE below 8, as well as unpatched versions of IE8.See here and here for more information.If you actively support old versions of IE, it may be wise to explicitly set this flag to false. */ - xss?: boolean; - /** boolean controlling the 'X-Download-Options' header for IE, preventing downloads from executing in your context.Defaults to true setting the header to 'noopen'. */ - noOpen?: boolean; - /** boolean controlling the 'X-Content-Type-Options' header.Defaults to true setting the header to its only and default option, 'nosniff'. */ - noSniff?: boolean; - }; - /** HTTP state management (cookies) allows the server to store information on the client which is sent back to the server with every request (as defined in RFC 6265).state supports the following options: */ - state?: { - /** determines if incoming 'Cookie' headers are parsed and stored in the request.state object.Defaults to true. */ - parse: boolean; - /** 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?: { - /** validation rules for incoming request headers.Values allowed: - * trueany headers allowed (no validation performed).This is the default. - falseno headers allowed (this will cause all valid HTTP requests to fail). - a Joi validation object. - a validation function using the signature function(value, options, next) where: - valuethe object containing the request headers. - optionsthe server validation options. - next(err, value)the callback function called when validation is completed. - */ - headers?: boolean | IJoi | IValidationFunction; - - - /** validation rules for incoming request path parameters, after matching the path against the route and extracting any parameters then stored in request.params.Values allowed: - trueany path parameters allowed (no validation performed).This is the default. - falseno path variables allowed. - a Joi validation object. - a validation function using the signature function(value, options, next) where: - valuethe object containing the path parameters. - optionsthe server validation options. - next(err, value)the callback function called when validation is completed. */ - params?: boolean | IJoi | IValidationFunction; - /** validation rules for an incoming request URI query component (the key- value part of the URI between '?' and '#').The query is parsed into its individual key- value pairs (using the qs module) and stored in request.query prior to validation.Values allowed: - trueany query parameters allowed (no validation performed).This is the default. - falseno query parameters allowed. - a Joi validation object. - a validation function using the signature function(value, options, next) where: - valuethe object containing the query parameters. - optionsthe server validation options. - next(err, value)the callback function called when validation is completed. */ - query?: boolean | IJoi | IValidationFunction; - /** validation rules for an incoming request payload (request body).Values allowed: - trueany payload allowed (no validation performed).This is the default. - falseno payload allowed. - a Joi validation object. - a validation function using the signature function(value, options, next) where: - valuethe object containing the payload object. - optionsthe server validation options. - next(err, value)the callback function called when validation is completed. */ - payload?: boolean | IJoi | IValidationFunction; - /** an optional object with error fields copied into every validation error response. */ - errorFields?: any; - /** determines how to handle invalid requests.Allowed values are: - 'error'return a Bad Request (400) error response.This is the default value. - 'log'log the error but continue processing the request. - 'ignore'take no action. - OR a custom error handler function with the signature 'function(request, reply, source, error)` where: - requestthe request object. - replythe continuation reply interface. - sourcethe source of the invalid field (e.g. 'path', 'query', 'payload'). - errorthe error object prepared for the client response (including the validation function error under error.data). */ - failAction?: string | IRouteFailFunction; - /** options to pass to Joi.Useful to set global options such as stripUnknown or abortEarly (the complete list is available here: https://github.com/hapijs/joi#validatevalue-schema-options-callback ).Defaults to no options. */ - options?: any; - }; - /** define timeouts for processing durations: */ - timeout?: { - /** response timeout in milliseconds.Sets the maximum time allowed for the server to respond to an incoming client request before giving up and responding with a Service Unavailable (503) error response.Disabled by default (false). */ - server: boolean | number; - /** by default, node sockets automatically timeout after 2 minutes.Use this option to override this behavior.Defaults to undefined which leaves the node default unchanged.Set to false to disable socket timeouts. */ - socket: boolean | number; - }; - - /** ONLY WHEN ADDING NEW ROUTES (not when setting defaults). - *route description used for generating documentation (string). - */ - description?: string; - /** ONLY WHEN ADDING NEW ROUTES (not when setting defaults). - *route notes used for generating documentation (string or array of strings). - */ - notes?: string | string[]; - /** ONLY WHEN ADDING NEW ROUTES (not when setting defaults). - *route tags used for generating documentation (array of strings). - */ - tags?: string[]; - - /** Enable logging of routes - */ - log?: boolean; -} - -/** - * 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). - Realms are a limited version of a sandbox where plugins can maintain state used by the framework when adding routes, extensions, and other properties. - The server.realm object should be considered read-only and must not be changed directly except for the plugins property can be directly manipulated by the plugins (each setting its own under plugins[name]). - exports.register = function (server, options, next) { -console.log(server.realm.modifiers.route.prefix); -return next(); -}; - */ -export interface IServerRealm { - /** when the server object is provided as an argument to the plugin register() method, modifiers provides the registration preferences passed the server.register() method */ - modifiers: { - /** routes preferences: */ - route: { - /** - the route path prefix used by any calls to server.route() from the server. */ - prefix: string; - /** the route virtual host settings used by any calls to server.route() from the server. */ - vhost: string; - }; - - }; - /** the active plugin name (empty string if at the server root). */ - plugin: string; - /** plugin-specific state to be shared only among activities sharing the same active state. plugins is an object where each key is a plugin name and the value is the plugin state. */ - plugins: IDictionary; - /** settings overrides */ - settings: { - files: { - relativeTo: any; - }; - bind: any; - } -} -/** server.state(name, [options]) http://hapijs.com/api#serverstatename-options - HTTP state management uses client cookies to persist a state across multiple requests. Registers a cookie definitions where:*/ -export interface IServerState { - /** - the cookie name string. */name: string; - - /** - are the optional cookie settings: */options: { - /** - time - to - live in milliseconds.Defaults to null (session time- life - cookies are deleted when the browser is closed).*/ttl: number; - /** - sets the 'Secure' flag.Defaults to false.*/isSecure: boolean; - /** - sets the 'HttpOnly' flag.Defaults to false.*/isHttpOnly: boolean - /** - the path scope.Defaults to null (no path).*/path: any; - /** - the domain scope.Defaults to null (no domain). */domain: any; - /** if present and the cookie was not received from the client or explicitly set by the route handler, the cookie is automatically added to the response with the provided value. The value can be a function with signature function(request, next) where: - request - the request object. - next - the continuation function using the function(err, value) signature.*/ - autoValue: (request: Request, next: (err: any, value: any) => void) => void; - /** - encoding performs on the provided value before serialization. Options are: - 'none' - no encoding. When used, the cookie value must be a string. This is the default value. - 'base64' - string value is encoded using Base64. - 'base64json' - object value is JSON-stringified than encoded using Base64. - 'form' - object value is encoded using the x-www-form-urlencoded method. - 'iron' - Encrypts and sign the value using iron.*/ - encoding: string; - /** - an object used to calculate an HMAC for cookie integrity validation.This does not provide privacy, only a mean to verify that the cookie value was generated by the server.Redundant when 'iron' encoding is used.Options are:*/sign: { - /** - algorithm options.Defaults to require('iron').defaults.integrity.*/integrity: any; - /** - password used for HMAC key generation.*/password: string; - }; - /** - password used for 'iron' encoding.*/password: string; - /** - options for 'iron' encoding.Defaults to require('iron').defaults.*/iron: any; - /** - if false, errors are ignored and treated as missing cookies.*/ignoreErrors: boolean; - /** - if true, automatically instruct the client to remove invalid cookies.Defaults to false.*/clearInvalid: boolean; - /** - if false, allows any cookie value including values in violation of RFC 6265. Defaults to true.*/strictHeader: boolean; - /** - overrides the default proxy localStatePassThrough setting.*/passThrough: any; - }; -} - -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; -} - -/**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 { - /** 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; - /** directory - generates a directory endpoint for serving static content from a directory. Routes using the directory handler must include a path parameter at the end of the path string (e.g. /path/to/somewhere/{param} where the parameter name does not matter). The path parameter can use any of the parameter options (e.g. {param} for one level files only, {param?} for one level files or the directory root, {param*} for any level, or {param*3} for a specific level). If additional path parameters are present, they are ignored for the purpose of selecting the file system resource. The directory handler is an object with the following options: - path - (required) the directory root path (relative paths are resolved based on the route files configuration). Value can be: - a single path string used as the prefix for any resources requested by appending the request path parameter to the provided string. - an array of path strings. Each path will be attempted in order until a match is found (by following the same process as the single path string). - a function with the signature function(request) which returns the path string or an array of path strings. If the function returns an error, the error is passed back to the client in the response. - index - optional boolean|string|string[], determines if an index file will be served if found in the folder when requesting a directory. The given string or strings specify the name(s) of the index file to look for. If true, looks for 'index.html'. Any falsy value disables index file lookup. Defaults to true. - listing - optional boolean, determines if directory listing is generated when a directory is requested without an index document. Defaults to false. - showHidden - optional boolean, determines if hidden files will be shown and served. Defaults to false. - redirectToSlash - optional boolean, determines if requests for a directory without a trailing slash are redirected to the same path with the missing slash. Useful for ensuring relative links inside the response are resolved correctly. Disabled when the server config router.stripTrailingSlash is true.Defaults to false. - lookupCompressed - optional boolean, instructs the file processor to look for the same filename with the '.gz' suffix for a pre-compressed version of the file to serve if the request supports content encoding. Defaults to false. - defaultExtension - optional string, appended to file requests if the requested file is not found. Defaults to no extension.*/ - directory?: { - path: string | Array | IRequestHandler | IRequestHandler>; - index?: boolean | string | string[]; - listing?: boolean; - showHidden?: boolean; - redirectToSlash?: boolean; - lookupCompressed?: boolean; - defaultExtension?: string; - }; - proxy?: IProxyHandlerConfig; - view?: string | { - template: string; - context: { - payload: any; - params: any; - query: any; - pre: any; - } - }; - config?: { - handler: any; - bind: any; - app: any; - plugins: { - [name: string]: any; - }; - pre: Array<() => void>; - validate: { - headers: any; - params: any; - query: any; - payload: any; - errorFields?: any; - failAction?: string | IFailAction; - }; - payload: { - output: { - data: any; - stream: any; - file: any; - }; - parse?: any; - allow?: string | Array; - override?: string; - maxBytes?: number; - uploads?: number; - failAction?: string; - }; - response: { - schema: any; - sample: number; - failAction: string; - }; - cache: { - privacy: string; - expiresIn: number; - expiresAt: number; - }; - auth: string | boolean | { - mode: string; - strategies: Array; - payload?: boolean | string; - tos?: boolean | string; - scope?: string | Array; - entity: string; - }; - cors?: boolean; - jsonp?: string; - description?: string; - notes?: string | Array; - tags?: Array; - }; -} -/** 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; - /** - (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 | IStrictSessionHandler | 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; -} - -export interface IServerAuthScheme { - /** authenticate(request, reply) - required function called on each incoming request configured with the authentication scheme where: - request - the request object. - reply - the reply interface the authentication method must call when done authenticating the request where: - reply(err, response, result) - is called if authentication failed where: - err - any authentication error. - response - any authentication response action such as redirection. Ignored if err is present, otherwise required. - result - an object containing: - credentials - the authenticated credentials. - artifacts - optional authentication artifacts. - reply.continue(result) - is called if authentication succeeded where: - result - same object as result above. - When the scheme authenticate() method implementation calls reply() with an error condition, the specifics of the error affect whether additional authentication strategies will be attempted if configured for the route. - .If the err returned by the reply() method includes a message, no additional strategies will be attempted. - If the err does not include a message but does include a scheme name (e.g. Boom.unauthorized(null, 'Custom')), additional strategies will be attempted in order of preference. - var server = new Hapi.Server(); - server.connection({ port: 80 }); - var scheme = function (server, options) { - return { - authenticate: function (request, reply) { - var req = request.raw.req; - var authorization = req.headers.authorization; - if (!authorization) { - return reply(Boom.unauthorized(null, 'Custom')); - } - return reply(null, { credentials: { user: 'john' } }); - } - }; - }; - server.auth.scheme('custom', scheme);*/ - authenticate(request: Request, reply: IReply): void; - authenticate(request: Request, reply: IStrictReply): void; - /** payload(request, reply) - optional function called to authenticate the request payload where: - request - the request object. - reply(err, response) - is called if authentication failed where: - err - any authentication error. - response - any authentication response action such as redirection. Ignored if err is present, otherwise required. - reply.continue() - is called if payload authentication succeeded. - When the scheme payload() method returns an error with a message, it means payload validation failed due to bad payload. If the error has no message but includes a scheme name (e.g. Boom.unauthorized(null, 'Custom')), authentication may still be successful if the route auth.payload configuration is set to 'optional'.*/ - payload?(request: Request, reply: IReply): void; - payload?(request: Request, reply: IStrictReply): 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; - response?(request: Request, reply: IStrictReply): void; - /** an optional object */ - options?: { - /** if true, requires payload validation as part of the scheme and forbids routes from disabling payload auth validation. Defaults to false.*/ - payload: boolean; - } -} - -/**the response object where: - statusCode - the HTTP status code. - headers - an object containing the headers set. - payload - the response payload string. - rawPayload - the raw response payload buffer. - raw - an object with the injection request and response objects: - req - the simulated node request object. - res - the simulated node response object. - result - the raw handler response (e.g. when not a stream or a view) before it is serialized for transmission. If not available, the value is set to payload. Useful for inspection and reuse of the internal objects returned (instead of parsing the response string). - request - the request object.*/ -export interface IServerInjectResponse { - statusCode: number; - headers: IDictionary; - payload: string; - rawPayload: Buffer; - raw: { - req: http.IncomingMessage; - res: http.ServerResponse - }; - result: string; - request: Request; -} - -export interface IServerInject { - (options: string | IServerInjectOptions, callback: (res: IServerInjectResponse) => void): void; - (options: string | IServerInjectOptions): IPromise; -} - -export interface IServerInjectOptions { - /** the request HTTP method (e.g. 'POST'). Defaults to 'GET'.*/ - method: string; - /** the request URL. If the URI includes an authority (e.g. 'example.com:8080'), it is used to automatically set an HTTP 'Host' header, unless one was specified in headers.*/ - url: string; - /** an object with optional request headers where each key is the header name and the value is the header content. Defaults to no additions to the default Shot headers.*/ - headers?: IDictionary; - /** n optional string, buffer or object containing the request payload. In case of an object it will be converted to a string for you. Defaults to no payload. Note that payload processing defaults to 'application/json' if no 'Content-Type' header provided.*/ - payload?: string | {} | Buffer; - /** an optional credentials object containing authentication information. The credentials are used to bypass the default authentication strategies, and are validated directly as if they were received via an authentication scheme. Defaults to no credentials.*/ - credentials?: any; - /** an optional artifacts object containing authentication artifact information. The artifacts are used to bypass the default authentication strategies, and are validated directly as if they were received via an authentication scheme. Ignored if set without credentials. Defaults to no artifacts.*/ - artifacts?: any; - /** sets the initial value of request.app*/ - app?: any; - /** sets the initial value of request.plugins*/ - plugins?: any; - /** allows access to routes with config.isInternal set to true. Defaults to false.*/ - allowInternals?: boolean; - /** sets the remote address for the incoming connection.*/ - remoteAddress?: boolean; - /**object with options used to simulate client request stream conditions for testing: - error - if true, emits an 'error' event after payload transmission (if any). Defaults to false. - close - if true, emits a 'close' event after payload transmission (if any). Defaults to false. - end - if false, does not end the stream. Defaults to true.*/ - simulate?: { - error: boolean; - close: boolean; - end: boolean; - }; -} - - -/** host - optional host to filter routes matching a specific virtual host. Defaults to all virtual hosts. - The return value is an array where each item is an object containing: - info - the connection.info the connection the table was generated for. - labels - the connection labels. - table - an array of routes where each route contains: - settings - the route config with defaults applied. - method - the HTTP method in lower case. - path - the route path.*/ -export interface IConnectionTable { - info: any; - labels: any; - table: IRoute[]; -} - -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; - /** - 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; - /** - 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; -} - -/** method - the method function with the signature is one of: - function(arg1, arg2, ..., argn, next) where: - arg1, arg2, etc. - the method function arguments. - next - the function called when the method is done with the signature function(err, result, ttl) where: - err - error response if the method failed. - result - the return value. - ttl - 0 if result is valid but cannot be cached. Defaults to cache policy. - function(arg1, arg2, ..., argn) where: - arg1, arg2, etc. - the method function arguments. - the callback option is set to false. - the method must returns a value (result, Error, or a promise) or throw an Error.*/ -export interface IServerMethod { - //(): void; - //(next: (err: any, result: any, ttl: number) => void): void; - //(arg1: any): void; - //(arg1: any, arg2: any, next: (err: any, result: any, ttl: number) => void): void; - //(arg1: any, arg2: any): void; - (...args: any[]): void; - -} -/** 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?: ICatBoxCachePolicyOptions; - callback?: boolean; - generateKey?(args: any[]): string; -} -/** Request object - - The request object is created internally for each incoming request. It is different from the node.js request object received from the HTTP server callback (which is available in request.raw.req). The request object methods and properties change throughout the request lifecycle. - Request events - - The request object supports the following events: - - 'peek' - emitted for each chunk of payload data read from the client connection. The event method signature is function(chunk, encoding). - 'finish' - emitted when the request payload finished reading. The event method signature is function (). - 'disconnect' - emitted when a request errors or aborts unexpectedly. - var Crypto = require('crypto'); - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ port: 80 }); - - server.ext('onRequest', function (request, reply) { - -var hash = Crypto.createHash('sha1'); -request.on('peek', function (chunk) { - -hash.update(chunk); -}); - -request.once('finish', function () { - -console.log(hash.digest('hex')); -}); - -request.once('disconnect', function () { - -console.error('request aborted'); -}); - -return reply.continue(); -});*/ -export class Request extends Events.EventEmitter { - /** application-specific state. Provides a safe place to store application data without potential conflicts with the framework. Should not be used by plugins which should use plugins[name].*/ - app: any; - /** authentication information*/ - auth: { - /** true is the request has been successfully authenticated, otherwise false.*/ - isAuthenticated: boolean; - /** the credential object received during the authentication process. The presence of an object does not mean successful authentication. can be set in the validate function's callback.*/ - credentials: any; - /** an artifact object received from the authentication strategy and used in authentication-related actions.*/ - artifacts: any; - /** the route authentication mode.*/ - mode: any; - /** the authentication error is failed and mode set to 'try'.*/ - error: any; - }; - /** the connection used by this request*/ - connection: ServerConnection; - /** the node domain object used to protect against exceptions thrown in extensions, handlers and route prerequisites. Can be used to manually bind callback functions otherwise bound to other domains.*/ - domain: any; - /** the raw request headers (references request.raw.headers).*/ - headers: IDictionary; - /** a unique request identifier (using the format '{now}:{connection.info.id}:{5 digits counter}').*/ - id: string; - /** request information */ - info: { - /** the request preferred encoding. */ - acceptEncoding: string; - /** if CORS is enabled for the route, contains the following: */ - cors: { - isOriginMatch: boolean; /** true if the request 'Origin' header matches the configured CORS restrictions. Set to false if no 'Origin' header is found or if it does not match. Note that this is only available after the 'onRequest' extension point as CORS is configured per-route and no routing decisions are made at that point in the request lifecycle. */ - }; - /** content of the HTTP 'Host' header (e.g. 'example.com:8080'). */ - host: string; - /** the hostname part of the 'Host' header (e.g. 'example.com').*/ - hostname: string; - /** request reception timestamp. */ - received: number; - /** content of the HTTP 'Referrer' (or 'Referer') header. */ - referrer: string; - /** remote client IP address. */ - remoteAddress: string; - /** remote client port. */ - remotePort: number; - /** request response timestamp (0 is not responded yet). */ - responded: number; - }; - /** the request method in lower case (e.g. 'get', 'post'). */ - method: string; - /** the parsed content-type header. Only available when payload parsing enabled and no payload error occurred. */ - mime: string; - /** an object containing the values of params, query, and payload before any validation modifications made. Only set when input validation is performed.*/ - orig: { - params: any; - query: any; - payload: any; - }; - /** an object where each key is a path parameter name with matching value as described in Path parameters.*/ - params: IDictionary; - /** an array containing all the path params values in the order they appeared in the path.*/ - paramsArray: string[]; - /** the request URI's path component. */ - path: string; - /** the request payload based on the route payload.output and payload.parse settings.*/ - payload: stream.Readable | Buffer | any; - /** plugin-specific state. Provides a place to store and pass request-level plugin data. The plugins is an object where each key is a plugin name and the value is the state.*/ - plugins: any; - /** an object where each key is the name assigned by a route prerequisites function. The values are the raw values provided to the continuation function as argument. For the wrapped response object, use responses.*/ - pre: IDictionary; - /** the response object when set. The object can be modified but must not be assigned another object. To replace the response with another from within an extension point, use reply(response) to override with a different response. Contains null when no response has been set (e.g. when a request terminates prematurely when the client disconnects).*/ - response: Response; - /**preResponses - same as pre but represented as the response object created by the pre method.*/ - preResponses: any; - /**an object containing the query parameters.*/ - query: any; - /** an object containing the Node HTTP server objects. Direct interaction with these raw objects is not recommended.*/ - raw: { - req: http.IncomingMessage; - res: http.ServerResponse; - }; - /** the route public interface.*/ - route: IRoute; - /** the server object. */ - server: Server; - /** an object containing parsed HTTP state information (cookies) where each key is the cookie name and value is the matching cookie content after processing using any registered cookie definition. */ - state: any; - /** complex object contining details on the url */ - url: { - /** null when i tested */ - auth: any; - /** null when i tested */ - hash: any; - /** null when i tested */ - host: any; - /** null when i tested */ - hostname: any; - href: string; - path: string; - /** path without search*/ - pathname: string; - /** null when i tested */ - port: any; - /** null when i tested */ - protocol: any; - /** querystring parameters*/ - query: IDictionary; - /** querystring parameters as a string*/ - search: string; - /** null when i tested */ - slashes: any; - }; - - /** request.setUrl(url) - - Available only in 'onRequest' extension methods. - - Changes the request URI before the router begins processing the request where: - - url - the new request path value. - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ port: 80 }); - - server.ext('onRequest', function (request, reply) { - - // Change all requests to '/test' - request.setUrl('/test'); - return reply.continue(); - });*/ - setUrl(url: string | url.Url): void; - /** request.setMethod(method) - - Available only in 'onRequest' extension methods. - - Changes the request method before the router begins processing the request where: - - method - is the request HTTP method (e.g. 'GET'). - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ port: 80 }); - - server.ext('onRequest', function (request, reply) { - - // Change all requests to 'GET' - request.setMethod('GET'); - return reply.continue(); - });*/ - setMethod(method: string): void; - - /** request.log(tags, [data, [timestamp]]) - - Always available. - - Logs request-specific events. When called, the server emits a 'request' event which can be used by other listeners or plugins. The arguments are: - - data - an optional message string or object with the application data being logged. - timestamp - an optional timestamp expressed in milliseconds. Defaults to Date.now() (now). - Any logs generated by the server internally will be emitted only on the 'request-internal' channel and will include the event.internal flag set to true. - - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ port: 80 }); - - server.on('request', function (request, event, tags) { - - if (tags.error) { - console.log(event); - } - }); - - var handler = function (request, reply) { - - request.log(['test', 'error'], 'Test event'); - return reply(); - }; - */ - log(/** a string or an array of strings (e.g. ['error', 'database', 'read']) used to identify the event. Tags are used instead of log levels and provide a much more expressive mechanism for describing and filtering events.*/ - tags: string | string[], - /** an optional message string or object with the application data being logged.*/ - data?: any, - /** an optional timestamp expressed in milliseconds. Defaults to Date.now() (now).*/ - timestamp?: number): void; - - /** request.getLog([tags], [internal]) - - Always available. - - Returns an array containing the events matching any of the tags specified (logical OR) - request.getLog(); - request.getLog('error'); - request.getLog(['error', 'auth']); - request.getLog(['error'], true); - request.getLog(false);*/ - - getLog(/** is a single tag string or array of tag strings. If no tags specified, returns all events.*/ - tags?: string, - /** filters the events to only those with a matching event.internal value. If true, only internal logs are included. If false, only user event are included. Defaults to all events (undefined).*/ - internal?: boolean): string[]; - - /** request.tail([name]) - - Available until immediately after the 'response' event is emitted. - - Adds a request tail which has to complete before the request lifecycle is complete where: - - name - an optional tail name used for logging purposes. - Returns a tail function which must be called when the tail activity is completed. - - Tails are actions performed throughout the request lifecycle, but which may end after a response is sent back to the client. For example, a request may trigger a database update which should not delay sending back a response. However, it is still desirable to associate the activity with the request when logging it (or an error associated with it). - - When all tails completed, the server emits a 'tail' event. - - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ port: 80 }); - - var get = function (request, reply) { - - var dbTail = request.tail('write to database'); - - db.save('key', 'value', function () { - - dbTail(); - }); - - return reply('Success!'); - }; - - server.route({ method: 'GET', path: '/', handler: get }); - - server.on('tail', function (request) { - - console.log('Request completed including db activity'); - });*/ - tail(/** an optional tail name used for logging purposes.*/ - name?: string): Function; -} -/** Response events - - The response object supports the following events: - - 'peek' - emitted for each chunk of data written back to the client connection. The event method signature is function(chunk, encoding). - 'finish' - emitted when the response finished writing but before the client response connection is ended. The event method signature is function (). - var Crypto = require('crypto'); - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ port: 80 }); - - server.ext('onPreResponse', function (request, reply) { - -var response = request.response; -if (response.isBoom) { -return reply(); -} - -var hash = Crypto.createHash('sha1'); -response.on('peek', function (chunk) { - -hash.update(chunk); -}); - -response.once('finish', function () { - -console.log(hash.digest('hex')); -}); - -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; - /** a string indicating the type of source with available values: - 'plain' - a plain response such as string, number, null, or simple object (e.g. not a Stream, Buffer, or view). - 'buffer' - a Buffer. - 'view' - a view generated with reply.view(). - 'file' - a file generated with reply.file() of via the directory handler. - 'stream' - a Stream. - 'promise' - a Promise object. */ - variety: string; - /** application-specific state. Provides a safe place to store application data without potential conflicts with the framework. Should not be used by plugins which should use plugins[name].*/ - app: any; - /** plugin-specific state. Provides a place to store and pass request-level plugin data. The plugins is an object where each key is a plugin name and the value is the state. */ - plugins: any; - /** settings - response handling flags: - charset - the 'Content-Type' HTTP header 'charset' property. Defaults to 'utf-8'. - encoding - the string encoding scheme used to serial data into the HTTP payload when source is a string or marshals into a string. Defaults to 'utf8'. - passThrough - if true and source is a Stream, copies the statusCode and headers of the stream to the outbound response. Defaults to true. - stringify - options used for source value requiring stringification. Defaults to no replacer and no space padding. - ttl - if set, overrides the route cache expiration milliseconds value set in the route config. Defaults to no override. - varyEtag - if true, a suffix will be automatically added to the 'ETag' header at transmission time (separated by a '-' character) when the HTTP 'Vary' header is present.*/ - settings: { - charset: string; - encoding: string; - passThrough: boolean; - stringify: any; - ttl: number; - varyEtag: boolean; - } - - /** 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; - - /** 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; - - - /** 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; - - /**header(name, value, options) - sets an HTTP header where: - name - the header name. - value - the header value. - options - optional settings where: - append - if true, the value is appended to any existing header value using separator. Defaults to false. - separator - string used as separator when appending to an exiting value. Defaults to ','. - override - if false, the header value is not set if an existing value present. Defaults to true.*/ - header(name: string, value: string, options?: IHeaderOptions): Response; - - /** hold() - puts the response on hold until response.send() is called. Available only after reply() is called and until response.hold() is invoked once. */ - hold(): Response; - - /** location(uri) - sets the HTTP 'Location' header where: - uri - an absolute or relative URI used as the 'Location' header value.*/ - location(uri: string): Response; - - /** redirect(uri) - sets an HTTP redirection response (302) and decorates the response with additional methods listed below, where: - uri - an absolute or relative URI used to redirect the client to another resource. */ - redirect(uri: string): Response; - - /** replacer(method) - sets the JSON.stringify() replacer argument where: - method - the replacer function or array. Defaults to none.*/ - replacer(method: Function | Array): Response; - - /** spaces(count) - sets the JSON.stringify() space argument where: - count - the number of spaces to indent nested object keys. Defaults to no indentation. */ - spaces(count: number): Response; - - /**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; - - /** send() - resume the response which will be transmitted in the next tick. Available only after response.hold() is called and until response.send() is invoked once. */ - send(): void; - - /** sets a string suffix when the response is process via JSON.stringify().*/ - suffix(suffix: string): void; - - /** overrides the default route cache expiration rule for this response instance where: - msec - the time-to-live value in milliseconds.*/ - ttl(msec: number): void; - - /** type(mimeType) - sets the HTTP 'Content-Type' header where: - mimeType - is the mime type. Should only be used to override the built-in default for each response type. */ - type(mimeType: string): Response; - - /** clears the HTTP cookie by setting an expired value where: - name - the cookie name. - options - optional configuration for expiring cookie. If the state was previously registered with the server using server.state(), the specified keys in options override those same keys in the server definition (but not others).*/ - unstate(name: string, options?: { [key: string]: string }): Response; - - /** adds the provided header to the list of inputs affected the response generation via the HTTP 'Vary' header where: - header - the HTTP request header name.*/ - vary(header: string): void; -} -/** When using the redirect() method, the response object provides these additional methods */ -export class ResponseRedirect extends Response { - /** sets the status code to 302 or 307 (based on the rewritable() setting) where: - isTemporary - if false, sets status to permanent. Defaults to true.*/ - temporary(isTemporary: boolean): void; - - /** sets the status code to 301 or 308 (based on the rewritable() setting) where: - isPermanent - if true, sets status to temporary. Defaults to false. */ - permanent(isPermanent: boolean): void; - - /** sets the status code to 301/302 for rewritable (allows changing the request method from 'POST' to 'GET') or 307/308 for non-rewritable (does not allow changing the request method from 'POST' to 'GET'). Exact code based on the temporary() or permanent() setting. Arguments: - isRewritable - if false, sets to non-rewritable. Defaults to true. - Permanent Temporary - Rewritable 301 302(1) - Non-rewritable 308(2) 307 - Notes: 1. Default value. 2. Proposed code, not supported by all clients. */ - rewritable(isRewritable: boolean): void; -} -/** info about a server connection */ -export interface IServerConnectionInfo { - /** - a unique connection identifier (using the format '{hostname}:{pid}:{now base36}').*/ - id: string; - /** - the connection creation timestamp.*/ - created: number; - /** - the connection start timestamp (0 when stopped).*/ - started: number; - /** the connection port based on the following rules: - the configured port value before the server has been started. - the actual port assigned when no port is configured or set to 0 after the server has been started.*/ - port: number; - - /** - the host name the connection was configured to. Defaults to the operating system hostname when available, otherwise 'localhost'.*/ - host: string; - /** - the active IP address the connection was bound to after starting.Set to undefined until the server has been started or when using a non TCP port (e.g. UNIX domain socket).*/ - address: string; - /** - the protocol used: - 'http' - HTTP. - 'https' - HTTPS. - 'socket' - UNIX domain socket or Windows named pipe.*/ - protocol: string; - /** a string representing the connection (e.g. 'http://example.com:8080' or 'socket:/unix/domain/socket/path'). Contains the uri setting if provided, otherwise constructed from the available settings. If no port is available or set to 0, the uri will not include a port component.*/ - uri: string; -} -/** - * undocumented. The connection object constructed after calling server.connection(); - * can be accessed via server.connections; or request.connection; - */ -export class ServerConnection extends Events.EventEmitter { - domain: any; - _events: { route: Function, domain: Function, _events: Function, _eventsCount: Function, _maxListeners: Function }; - _eventsCount: number; - settings: IServerConnectionOptions; - server: Server; - /** ex: "tcp" */ - type: string; - _started: boolean; - /** dictionary of sockets */ - _connections: { [ip_port: string]: any }; - _onConnection: Function; - registrations: any; - _extensions: any; - _requestCounter: { value: number; min: number; max: number }; - _load: any; - states: { - settings: any; cookies: any; names: any[] - }; - auth: { connection: ServerConnection; _schemes: any; _strategies: any; settings: any; api: any; }; - _router: any; - MSPluginsCollection: any; - applicationCache: any; - addEventListener: any; - info: IServerConnectionInfo; -} - -export type RequestExtPoints = "onRequest" | "onPreResponse" | "onPreAuth" | "onPostAuth" | "onPreHandler" | "onPostHandler" | "onPreResponse"; -export type ServerExtPoints = "onPreStart" | "onPostStart" | "onPreStop" | "onPostStop"; - -/** Server http://hapijs.com/api#server - rver object is the main application container. The server manages all incoming connections along with all the facilities provided by the framework. A server can contain more than one connection (e.g. listen to port 80 and 8080). - Server events - The server object inherits from Events.EventEmitter and emits the following events: - 'log' - events logged with server.log() and server events generated internally by the framework. - 'start' - emitted when the server is started using server.start(). - 'stop' - emitted when the server is stopped using server.stop(). - 'request' - events generated by request.log(). Does not include any internally generated events. - 'request-internal' - request events generated internally by the framework (multiple events per request). - 'request-error' - emitted whenever an Internal Server Error (500) error response is sent. Single event per request. - 'response' - emitted after the response is sent back to the client (or when the client connection closed and no response sent, in which case request.response is null). Single event per request. - 'tail' - emitted when a request finished processing, including any registered tails. Single event per request. - Note that the server object should not be used to emit application events as its internal implementation is designed to fan events out to the various plugin selections and not for application events. - MORE EVENTS HERE: http://hapijs.com/api#server-events*/ -export class Server extends Events.EventEmitter { - - constructor(options?: IServerOptions); - - /** Provides a safe place to store server-specific run-time application data without potential conflicts with the framework internals. The data can be accessed whenever the server is accessible. Initialized with an empty object. - var Hapi = require('hapi'); - server = new Hapi.Server(); - server.app.key = 'value'; - var handler = function (request, reply) { - return reply(request.server.app.key); - }; */ - app: any; - /** An array containing the server's connections. When the server object is returned from server.select(), the connections array only includes the connections matching the selection criteria. - var server = new Hapi.Server(); - server.connection({ port: 80, labels: 'a' }); - server.connection({ port: 8080, labels: 'b' }); - // server.connections.length === 2 - var a = server.select('a'); - // a.connections.length === 1*/ - connections: Array; - /** When the server contains exactly one connection, info is an object containing information about the sole connection. - * When the server contains more than one connection, each server.connections array member provides its own connection.info. - var server = new Hapi.Server(); - server.connection({ port: 80 }); - // server.info.port === 80 - server.connection({ port: 8080 }); - // server.info === null - // server.connections[1].info.port === 8080 - */ - info: IServerConnectionInfo; - /** 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; - }; - /** When the server contains exactly one connection, listener is the node HTTP server object of the sole connection. - When the server contains more than one connection, each server.connections array member provides its own connection.listener. - var Hapi = require('hapi'); - var SocketIO = require('socket.io'); - var server = new Hapi.Server(); - server.connection({ port: 80 }); - var io = SocketIO.listen(server.listener); - io.sockets.on('connection', function(socket) { - socket.emit({ msg: 'welcome' }); - });*/ - listener: http.Server; - - /** server.methods - An object providing access to the server methods where each server method name is an object property. - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.method('add', function (a, b, next) { - return next(null, a + b); - }); - server.methods.add(1, 2, function (err, result) { - // result === 3 - });*/ - methods: IDictionary; - - /** server.mime - Provides access to the server MIME database used for setting content-type information. The object must not be modified directly but only through the mime server setting. - var Hapi = require('hapi'); - var options = { - mime: { - override: { - 'node/module': { - source: 'steve', - compressible: false, - extensions: ['node', 'module', 'npm'], - type: 'node/module' - } - } - } - }; - var server = new Hapi.Server(options); - // server.mime.path('code.js').type === 'application/javascript' - // server.mime.path('file.npm').type === 'node/module'*/ - mime: any; - /**server.plugins - An object containing the values exposed by each plugin registered where each key is a plugin name and the values are the exposed properties by each plugin using server.expose(). Plugins may set the value of the server.plugins[name] object directly or via the server.expose() method. - exports.register = function (server, options, next) { - server.expose('key', 'value'); - // server.plugins.example.key === 'value' - return next(); - }; - exports.register.attributes = { - name: 'example' - };*/ - plugins: IDictionary; - /** server.realm - The realm object contains server-wide or plugin-specific state that can be shared across various methods. For example, when calling server.bind(), the active realm settings.bind property is set which is then used by routes and extensions added at the same level (server root or plugin). Realms are a limited version of a sandbox where plugins can maintain state used by the framework when adding routes, extensions, and other properties. - modifiers - when the server object is provided as an argument to the plugin register() method, modifiers provides the registration preferences passed the server.register() method and includes: - route - routes preferences: - prefix - the route path prefix used by any calls to server.route() from the server. - vhost - the route virtual host settings used by any calls to server.route() from the server. - plugin - the active plugin name (empty string if at the server root). - plugins - plugin-specific state to be shared only among activities sharing the same active state. plugins is an object where each key is a plugin name and the value is the plugin state. - settings - settings overrides: - files.relativeTo - bind - The server.realm object should be considered read-only and must not be changed directly except for the plugins property can be directly manipulated by the plugins (each setting its own under plugins[name]). - exports.register = function (server, options, next) { - console.log(server.realm.modifiers.route.prefix); - return next(); - };*/ - realm: IServerRealm; - - /** server.root - The root server object containing all the connections and the root server methods (e.g. start(), stop(), connection()).*/ - root: Server; - /** server.settings - The server configuration object after defaults applied. - var Hapi = require('hapi'); - var server = new Hapi.Server({ - app: { - key: 'value' - } - }); - // server.settings.app === { key: 'value' }*/ - settings: IServerOptions; - - /** server.version - The hapi module version number. - var Hapi = require('hapi'); - var server = new Hapi.Server(); - // server.version === '8.0.0'*/ - version: string; - - /** server.after(method, [dependencies]) - Adds a method to be called after all the plugin dependencies have been registered and before the server starts (only called if the server is started) where: - after - the method with signature function(plugin, next) where: - server - server object the after() method was called on. - next - the callback function the method must call to return control over to the application and complete the registration process. The function signature is function(err) where: - err - internal error which is returned back via the server.start() callback. - dependencies - a string or array of string with the plugin names to call this method after their after() methods. There is no requirement for the other plugins to be registered. Setting dependencies only arranges the after methods in the specified order. - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ port: 80 }); - server.after(function () { - // Perform some pre-start logic - }); - server.start(function (err) { - // After method already executed - }); - server.auth.default(options)*/ - after(method: (plugin: any, next: (err: any) => void) => void, dependencies: string | string[]): void; - - auth: { - /** server.auth.api - An object where each key is a strategy name and the value is the exposed strategy API. Available on when the authentication scheme exposes an API by returning an api key in the object returned from its implementation function. - When the server contains more than one connection, each server.connections array member provides its own connection.auth.api object. - const server = new Hapi.Server(); - server.connection({ port: 80 }); - const scheme = function (server, options) { - return { - api: { - settings: { - x: 5 - } - }, - authenticate: function (request, reply) { - const req = request.raw.req; - const authorization = req.headers.authorization; - if (!authorization) { - return reply(Boom.unauthorized(null, 'Custom')); - } - return reply.continue({ credentials: { user: 'john' } }); - } - }; - }; - server.auth.scheme('custom', scheme); - server.auth.strategy('default', 'custom'); - console.log(server.auth.api.default.settings.x); // 5 - */ - api: { - [index: string]: any; - } - /** server.auth.default(options) - Sets a default strategy which is applied to every route where: - options - a string with the default strategy name or an object with a specified strategy or strategies using the same format as the route auth handler options. - The default does not apply when the route config specifies auth as false, or has an authentication strategy configured. Otherwise, the route authentication config is applied to the defaults. Note that the default only applies at time of route configuration, not at runtime. Calling default() after adding a route will have no impact on routes added prior. - The default auth strategy configuration can be accessed via connection.auth.settings.default. - var server = new Hapi.Server(); - server.connection({ port: 80 }); - server.auth.scheme('custom', scheme); - server.auth.strategy('default', 'custom'); - server.auth.default('default'); - server.route({ - method: 'GET', - path: '/', - handler: function (request, reply) { - return reply(request.auth.credentials.user); - } - });*/ - default(options: string): void; - default(options: { strategy: string }): void; - default(options: { strategies: string[] }): void; - /** server.auth.scheme(name, scheme) - Registers an authentication scheme where: - name - the scheme name. - scheme - the method implementing the scheme with signature function(server, options) where: - server - a reference to the server object the scheme is added to. - options - optional scheme settings used to instantiate a strategy.*/ - scheme(name: string, - /** When the scheme authenticate() method implementation calls reply() with an error condition, the specifics of the error affect whether additional authentication strategies will be attempted if configured for the route. If the err returned by the reply() method includes a message, no additional strategies will be attempted. If the err does not include a message but does include a scheme name (e.g. Boom.unauthorized(null, 'Custom')), additional strategies will be attempted in order of preference. - n the scheme payload() method returns an error with a message, it means payload validation failed due to bad payload. If the error has no message but includes a scheme name (e.g. Boom.unauthorized(null, 'Custom')), authentication may still be successful if the route auth.payload configuration is set to 'optional'. - server = new Hapi.Server(); - server.connection({ port: 80 }); - scheme = function (server, options) { - urn { - authenticate: function (request, reply) { - req = request.raw.req; - var authorization = req.headers.authorization; - if (!authorization) { - return reply(Boom.unauthorized(null, 'Custom')); - } - urn reply(null, { credentials: { user: 'john' } }); - } - }; - }; - */ - scheme: (server: Server, options: any) => IServerAuthScheme): void; - - /** server.auth.strategy(name, scheme, [mode], [options]) - Registers an authentication strategy where: - name - the strategy name. - scheme - the scheme name (must be previously registered using server.auth.scheme()). - mode - if true, the scheme is automatically assigned as a required strategy to any route without an auth config. Can only be assigned to a single server strategy. Value must be true (which is the same as 'required') or a valid authentication mode ('required', 'optional', 'try'). Defaults to false. - options - scheme options based on the scheme requirements. - var server = new Hapi.Server(); - server.connection({ port: 80 }); - server.auth.scheme('custom', scheme); - server.auth.strategy('default', 'custom'); - server.route({ - method: 'GET', - path: '/', - config: { - auth: 'default', - handler: function (request, reply) { - return reply(request.auth.credentials.user); - } - } - });*/ - strategy(name: string, scheme: string, mode?: boolean | string, options?: any): void; - strategy(name: string, scheme: string, mode?: boolean | string): void; - strategy(name: string, scheme: string, options?:any): void; - - /** server.auth.test(strategy, request, next) - Tests a request against an authentication strategy where: - strategy - the strategy name registered with server.auth.strategy(). - request - the request object. - next - the callback function with signature function(err, credentials) where: - err - the error if authentication failed. - credentials - the authentication credentials object if authentication was successful. - Note that the test() method does not take into account the route authentication configuration. It also does not perform payload authentication. It is limited to the basic strategy authentication execution. It does not include verifying scope, entity, or other route properties. - var server = new Hapi.Server(); - server.connection({ port: 80 }); - server.auth.scheme('custom', scheme); - server.auth.strategy('default', 'custom'); - server.route({ - method: 'GET', - path: '/', - handler: function (request, reply) { - request.server.auth.test('default', request, function (err, credentials) { - if (err) { - return reply({ status: false }); - } - return reply({ status: true, user: credentials.name }); - }); - } - });*/ - test(strategy: string, request: Request, next: (err: any, credentials: any) => void): void; - }; - - /** server.bind(context) - Sets a global context used as the default bind object when adding a route or an extension where: - context - the object used to bind this in handler and extension methods. - When setting context inside a plugin, the context is applied only to methods set up by the plugin. Note that the context applies only to routes and extensions added after it has been set. - var handler = function (request, reply) { - return reply(this.message); - }; - exports.register = function (server, options, next) { - var bind = { - message: 'hello' - }; - server.bind(bind); - server.route({ method: 'GET', path: '/', handler: handler }); - return next(); - };*/ - bind(context: any): void; - - - /** server.cache(options) - Provisions a cache segment within the server cache facility where: - options - catbox policy configuration where: - expiresIn - relative expiration expressed in the number of milliseconds since the item was saved in the cache. Cannot be used together with expiresAt. - expiresAt - time of day expressed in 24h notation using the 'HH:MM' format, at which point all cache records expire. Uses local time. Cannot be used together with expiresIn. - generateFunc - a function used to generate a new cache item if one is not found in the cache when calling get(). The method's signature is function(id, next) where: - id - the id string or object provided to the get() method. - next - the method called when the new item is returned with the signature function(err, value, ttl) where: - err - an error condition. - value - the new value generated. - ttl - the cache ttl value in milliseconds. Set to 0 to skip storing in the cache. Defaults to the cache global policy. - staleIn - number of milliseconds to mark an item stored in cache as stale and attempt to regenerate it when generateFunc is provided. Must be less than expiresIn. - staleTimeout - number of milliseconds to wait before checking if an item is stale. - generateTimeout - number of milliseconds to wait before returning a timeout error when the generateFunc function takes too long to return a value. When the value is eventually returned, it is stored in the cache for future requests. - cache - the cache name configured in 'server.cache`. Defaults to the default cache. - segment - string segment name, used to isolate cached items within the cache partition. When called within a plugin, defaults to '!name' where 'name' is the plugin name. Required when called outside of a plugin. - shared - if true, allows multiple cache provisions to share the same segment. Default to false. - var server = new Hapi.Server(); - server.connection({ port: 80 }); - var cache = server.cache({ segment: 'countries', expiresIn: 60 * 60 * 1000 }); - cache.set('norway', { capital: 'oslo' }, null, function (err) { - cache.get('norway', function (err, value, cached, log) { - // value === { capital: 'oslo' }; - }); - });*/ - cache(options: ICatBoxCachePolicyOptions): void; - - /** server.connection([options]) - Adds an incoming server connection - Returns a server object with the new connection selected. - Must be called before any other server method that modifies connections is called for it to apply to the new connection (e.g. server.state()). - Note that the options object is deeply cloned (with the exception of listener which is shallowly copied) and cannot contain any values that are unsafe to perform deep copy on. - var Hapi = require('hapi'); - var server = new Hapi.Server(); - var web = server.connection({ port: 8000, host: 'example.com', labels: ['web'] }); - var admin = server.connection({ port: 8001, host: 'example.com', labels: ['admin'] }); - // server.connections.length === 2 - // web.connections.length === 1 - // admin.connections.length === 1 */ - connection(options: IServerConnectionOptions): Server; - - /** server.decorate(type, property, method, [options]) - Extends various framework interfaces with custom methods where: - type - the interface being decorated. Supported types: - 'reply' - adds methods to the reply interface. - 'server' - adds methods to the Server object. - property - the object decoration key name. - method - the extension function. - options - if the type is 'request', supports the following optional settings: - 'apply' - if true, the method function is invoked using the signature function(request) where request is the current request object and the returned value is assigned as the decoration. - Note that decorations apply to the entire server and all its connections regardless of current selection. - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ port: 80 }); - server.decorate('reply', 'success', function () { - return this.response({ status: 'ok' }); - }); - server.route({ - method: 'GET', - path: '/', - handler: function (request, reply) { - return reply.success(); - } - });*/ - decorate(type: string, property: string, method: Function, options?: { apply: boolean }): void; - - /** server.dependency(dependencies, [after]) - Used within a plugin to declares a required dependency on other plugins where: - dependencies - a single string or array of plugin name strings which must be registered in order for this plugin to operate. Plugins listed must be registered before the server is started. Does not provide version dependency which should be implemented using npm peer dependencies. - after - an optional function called after all the specified dependencies have been registered and before the server starts. The function is only called if the server is started. If a circular dependency is detected, an exception is thrown (e.g. two plugins each has an after function to be called after the other). The function signature is function(server, next) where: - server - the server the dependency() method was called on. - next - the callback function the method must call to return control over to the application and complete the registration process. The function signature is function(err) where: - err - internal error condition, which is returned back via the server.start() callback. - exports.register = function (server, options, next) { - server.dependency('yar', after); - return next(); - }; - var after = function (server, next) { - // Additional plugin registration logic - return next(); - };*/ - dependency(dependencies: string | string[], after?: (server: Server, next: (err: any) => void) => void): void; - - - /** server.expose(key, value) - Used within a plugin to expose a property via server.plugins[name] where: - key - the key assigned (server.plugins[name][key]). - value - the value assigned. - exports.register = function (server, options, next) { - server.expose('util', function () { console.log('something'); }); - return next(); - };*/ - expose(key: string, value: any): void; - - /** server.expose(obj) - Merges a deep copy of an object into to the existing content of server.plugins[name] where: - obj - the object merged into the exposed properties container. - exports.register = function (server, options, next) { - server.expose({ util: function () { console.log('something'); } }); - return next(); - };*/ - expose(obj: any): void; - - /** server.ext(event, method, [options]) - Registers an extension function in one of the available extension points where: - event - the event name. - method - a function or an array of functions to be executed at a specified point during request processing. The required extension function signature is function(request, reply) where: - request - the request object. NOTE: Access the Response via request.response - reply - the reply interface which is used to return control back to the framework. To continue normal execution of the request lifecycle, reply.continue() must be called. To abort processing and return a response to the client, call reply(value) where value is an error or any other valid response. - this - the object provided via options.bind or the current active context set with server.bind(). - options - an optional object with the following: - before - a string or array of strings of plugin names this method must execute before (on the same event). Otherwise, extension methods are executed in the order added. - after - a string or array of strings of plugin names this method must execute after (on the same event). Otherwise, extension methods are executed in the order added. - bind - a context object passed back to the provided method (via this) when called. - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ port: 80 }); - server.ext('onRequest', function (request, reply) { - // Change all requests to '/test' - request.setUrl('/test'); - return reply.continue(); - }); - var handler = function (request, reply) { - return reply({ status: 'ok' }); - }; - server.route({ method: 'GET', path: '/test', handler: handler }); - server.start(); - // All requests will get routed to '/test'*/ - ext(event: RequestExtPoints, method: (request: Request, reply: IReply, bind?: any) => void, options?: { before: string | string[]; after: string | string[]; bind?: any }): void; - ext(event: RequestExtPoints, method: (request: Request, reply: IStrictReply, bind?: any) => void, options?: { before: string | string[]; after: string | string[]; bind?: any }): void; - ext(event: ServerExtPoints, method: (server: Server, next: (err?: any) => void, bind?: any) => void, options?: { before: string | string[]; after: string | string[]; bind?: any }): void; - - /** server.handler(name, method) - Registers a new handler type to be used in routes where: - name - string name for the handler being registered. Cannot override the built-in handler types (directory, file, proxy, and view) or any previously registered type. - method - the function used to generate the route handler using the signature function(route, options) where: - route - the route public interface object. - options - the configuration object provided in the handler config. - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ host: 'localhost', port: 8000 }); - // Defines new handler for routes on this server - server.handler('test', function (route, options) { - return function (request, reply) { - return reply('new handler: ' + options.msg); - } - }); - server.route({ - method: 'GET', - path: '/', - handler: { test: { msg: 'test' } } - }); - server.start(); - The method function can have a defaults object or function property. If the property is set to an object, that object is used as the default route config for routes using this handler. If the property is set to a function, the function uses the signature function(method) and returns the route default configuration. - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ host: 'localhost', port: 8000 }); - var handler = function (route, options) { - return function (request, reply) { - return reply('new handler: ' + options.msg); - } - }; - // Change the default payload processing for this handler - handler.defaults = { - payload: { - output: 'stream', - parse: false - } - }; - server.handler('test', handler);*/ - handler(name: string, method: (route: IRoute, options: THandlerConfig) => ISessionHandler): void; - - /** server.initialize([callback]) - Initializes the server (starts the caches, finalizes plugin registration) but does not start listening - on the connection ports, where: - - `callback` - the callback method when server initialization is completed or failed with the signature - `function(err)` where: - - `err` - any initialization error condition. - - If no `callback` is provided, a `Promise` object is returned. - - Note that if the method fails and the callback includes an error, the server is considered to be in - an undefined state and should be shut down. In most cases it would be impossible to fully recover as - the various plugins, caches, and other event listeners will get confused by repeated attempts to - start the server or make assumptions about the healthy state of the environment. It is recommended - to assert that no error has been returned after calling `initialize()` to abort the process when the - server fails to start properly. If you must try to resume after an error, call `server.stop()` - first to reset the server state. - */ - initialize(callback?: (error: any) => void): IPromise; - - /** When the server contains exactly one connection, injects a request into the sole connection simulating an incoming HTTP request without making an actual socket connection. - Injection is useful for testing purposes as well as for invoking routing logic internally without the overhead or limitations of the network stack. - Utilizes the [shot module | https://github.com/hapijs/shot ] for performing injections, with some additional options and response properties - * When the server contains more than one connection, each server.connections array member provides its own connection.inject(). - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ port: 80 }); - var handler = function (request, reply) { - return reply('Success!'); - }; - server.route({ method: 'GET', path: '/', handler: handler }); - server.inject('/', function (res) { - console.log(res.result); - }); - */ - inject: IServerInject; - - /** server.log(tags, [data, [timestamp]]) - Logs server events that cannot be associated with a specific request. When called the server emits a 'log' event which can be used by other listeners or plugins to record the information or output to the console. The arguments are: - tags - a string or an array of strings (e.g. ['error', 'database', 'read']) used to identify the event. Tags are used instead of log levels and provide a much more expressive mechanism for describing and filtering events. Any logs generated by the server internally include the 'hapi' tag along with event-specific information. - data - an optional message string or object with the application data being logged. - timestamp - an optional timestamp expressed in milliseconds. Defaults to Date.now() (now). - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ port: 80 }); - server.on('log', function (event, tags) { - if (tags.error) { - console.log(event); - } - }); - server.log(['test', 'error'], 'Test event');*/ - log(tags: string | string[], data?: string | any, timestamp?: number): void; - - /**server.lookup(id) - When the server contains exactly one connection, looks up a route configuration where: - id - the route identifier as set in the route options. - returns the route public interface object if found, otherwise null. - var server = new Hapi.Server(); - server.connection(); - server.route({ - method: 'GET', - path: '/', - config: { - handler: function (request, reply) { return reply(); }, - id: 'root' - } - }); - var route = server.lookup('root'); - When the server contains more than one connection, each server.connections array member provides its own connection.lookup() method.*/ - lookup(id: string): IRoute; - - /** server.match(method, path, [host]) - When the server contains exactly one connection, looks up a route configuration where: - method - the HTTP method (e.g. 'GET', 'POST'). - path - the requested path (must begin with '/'). - host - optional hostname (to match against routes with vhost). - returns the route public interface object if found, otherwise null. - var server = new Hapi.Server(); - server.connection(); - server.route({ - method: 'GET', - path: '/', - config: { - handler: function (request, reply) { return reply(); }, - id: 'root' - } - }); - var route = server.match('get', '/'); - When the server contains more than one connection, each server.connections array member provides its own connection.match() method.*/ - match(method: string, path: string, host?: string): IRoute; - - - /** server.method(name, method, [options]) - Registers a server method. Server methods are functions registered with the server and used throughout the application as a common utility. Their advantage is in the ability to configure them to use the built-in cache and share across multiple request handlers without having to create a common module. - Methods are registered via server.method(name, method, [options]) - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ port: 80 }); - // Simple arguments - var add = function (a, b, next) { - return next(null, a + b); - }; - server.method('sum', add, { cache: { expiresIn: 2000 } }); - server.methods.sum(4, 5, function (err, result) { - console.log(result); - }); - // Object argument - var addArray = function (array, next) { - var sum = 0; - array.forEach(function (item) { - sum += item; - }); - return next(null, sum); - }; - server.method('sumObj', addArray, { - cache: { expiresIn: 2000 }, - generateKey: function (array) { - return array.join(','); - } - }); - server.methods.sumObj([5, 6], function (err, result) { - console.log(result); - }); - // Synchronous method with cache - var addSync = function (a, b) { - return a + b; - }; - server.method('sumSync', addSync, { cache: { expiresIn: 2000 }, callback: false }); - server.methods.sumSync(4, 5, function (err, result) { - 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; - - - /**server.method(methods) - Registers a server method function as described in server.method() using a configuration object where: - methods - an object or an array of objects where each one contains: - name - the method name. - method - the method function. - options - optional settings. - var add = function (a, b, next) { - next(null, a + b); - }; - server.method({ - name: 'sum', - method: add, - options: { - cache: { - expiresIn: 2000 - } - } - });*/ - method(methods: { - name: string; method: IServerMethod; options?: IServerMethodOptions - } | Array<{ - name: string; method: IServerMethod; options?: IServerMethodOptions - }>): void; - - /**server.path(relativeTo) - Sets the path prefix used to locate static resources (files and view templates) when relative paths are used where: - relativeTo - the path prefix added to any relative file path starting with '.'. - Note that setting a path within a plugin only applies to resources accessed by plugin methods. If no path is set, the connection files.relativeTo configuration is used. The path only applies to routes added after it has been set. - exports.register = function (server, options, next) { - server.path(__dirname + '../static'); - server.route({ path: '/file', method: 'GET', handler: { file: './test.html' } }); - next(); - };*/ - path(relativeTo: string): void; - - - /** - * server.register(plugins, [options], callback) - * Registers a plugin where: - * plugins - an object or array of objects where each one is either: - * a plugin registration function. - * an object with the following: - * register - the plugin registration function. - * options - optional options passed to the registration function when called. - * options - optional registration options (different from the options passed to the registration function): - * select - a string or array of string labels used to pre-select connections for plugin registration. - * routes - modifiers applied to each route added by the plugin: - * prefix - string added as prefix to any route path (must begin with '/'). If a plugin registers a child plugin the prefix is passed on to the child or is added in front of the child-specific prefix. - * vhost - virtual host string (or array of strings) applied to every route. The outer-most vhost overrides the any nested configuration. - * callback - the callback function with signature function(err) where: - * err - an error returned from the registration function. Note that exceptions thrown by the registration function are not handled by the framework. - * - * If no callback is provided, a Promise object is returned. - */ - register(plugins: any | any[], options: { - select: string | string[]; - routes: { - prefix: string; vhost?: string | string[] - }; - }, callback: (err: any) => void): void; - register(plugins: any | any[], options: { - select: string | string[]; - routes: { - prefix: string; vhost?: string | string[] - }; - }): IPromise; - - register(plugins: any | any[], callback: (err: any) => void): void; - register(plugins: any | any[]): IPromise; - - /**server.render(template, context, [options], callback) - Utilizes the server views manager to render a template where: - template - the template filename and path, relative to the views manager templates path (path or relativeTo). - context - optional object used by the template to render context-specific result. Defaults to no context ({}). - options - optional object used to override the views manager configuration. - callback - the callback function with signature function (err, rendered, config) where: - err - the rendering error if any. - rendered - the result view string. - config - the configuration used to render the template. - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ port: 80 }); - server.views({ - engines: { html: require('handlebars') }, - path: __dirname + '/templates' - }); - var context = { - title: 'Views Example', - message: 'Hello, World' - }; - 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; - - /** server.route(options) - Adds a connection route where: - options - a route configuration object or an array of configuration objects. - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ port: 80 }); - server.route({ method: 'GET', path: '/', handler: function (request, reply) { return reply('ok'); } }); - server.route([ - { method: 'GET', path: '/1', handler: function (request, reply) { return reply('ok'); } }, - { method: 'GET', path: '/2', handler: function (request, reply) { return reply('ok'); } } - ]);*/ - route(options: IRouteConfiguration): void; - route(options: IRouteConfiguration[]): void; - - /**server.select(labels) - Selects a subset of the server's connections where: - labels - a single string or array of strings of labels used as a logical OR statement to select all the connections with matching labels in their configuration. - Returns a server object with connections set to the requested subset. Selecting again on a selection operates as a logic AND statement between the individual selections. - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ port: 80, labels: ['a'] }); - server.connection({ port: 8080, labels: ['b'] }); - server.connection({ port: 8081, labels: ['c'] }); - server.connection({ port: 8082, labels: ['c','d'] }); - var a = server.select('a'); // The server with port 80 - var ab = server.select(['a','b']); // A list of servers containing the server with port 80 and the server with port 8080 - var c = server.select('c'); // A list of servers containing the server with port 8081 and the server with port 8082 */ - select(labels: string | string[]): Server | Server[]; - - /** server.start([callback]) - Starts the server connections by listening for incoming requests on the configured port of each listener (unless the connection was configured with autoListen set to false), where: - callback - optional callback when server startup is completed or failed with the signature function(err) where: - err - any startup error condition. - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ port: 80 }); - server.start(function (err) { - console.log('Server started at: ' + server.info.uri); - });*/ - start(callback?: (err: any) => void): IPromise; - - /** server.state(name, [options]) - HTTP state management uses client cookies to persist a state across multiple requests. Registers a cookie definitions - State defaults can be modified via the server connections.routes.state configuration option. - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ port: 80 }); - // Set cookie definition - server.state('session', { - ttl: 24 * 60 * 60 * 1000, // One day - isSecure: true, - path: '/', - encoding: 'base64json' - }); - // Set state in route handler - var handler = function (request, reply) { - var session = request.state.session; - if (!session) { - session = { user: 'joe' }; - } - session.last = Date.now(); - return reply('Success').state('session', session); - }; - Registered cookies are automatically parsed when received. Parsing rules depends on the route state.parse configuration. If an incoming registered cookie fails parsing, it is not included in request.state, regardless of the state.failAction setting. When state.failAction is set to 'log' and an invalid cookie value is received, the server will emit a 'request-internal' event. To capture these errors subscribe to the 'request-internal' events and filter on 'error' and 'state' tags: - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ port: 80 }); - server.on('request-internal', function (request, event, tags) { - if (tags.error && tags.state) { - console.error(event); - } - }); */ - state(name: string, options?: ICookieSettings): void; - - /** server.stop([options], [callback]) - Stops the server's connections by refusing to accept any new connections or requests (existing connections will continue until closed or timeout), where: - options - optional object with: - timeout - overrides the timeout in millisecond before forcefully terminating a connection. Defaults to 5000 (5 seconds). - callback - optional callback method with signature function() which is called once all the connections have ended and it is safe to exit the process. - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ port: 80 }); - server.stop({ timeout: 60 * 1000 }, function () { - console.log('Server stopped'); - });*/ - stop(options?: { timeout: number }, callback?: () => void): IPromise; - - /**server.table([host]) - Returns a copy of the routing table where: - host - optional host to filter routes matching a specific virtual host. Defaults to all virtual hosts. - The return value is an array where each item is an object containing: - info - the connection.info the connection the table was generated for. - labels - the connection labels. - table - an array of routes where each route contains: - settings - the route config with defaults applied. - method - the HTTP method in lower case. - path - the route path. - Note that if the server has not been started and multiple connections use port 0, the table items will override each other and will produce an incomplete result. - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ port: 80, host: 'example.com' }); - server.route({ method: 'GET', path: '/example', handler: function (request, reply) { return reply(); } }); - var table = server.table(); - When calling connection.table() directly on each connection, the return value is the same as the array table item value of an individual connection: - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ port: 80, host: 'example.com' }); - server.route({ method: 'GET', path: '/example', handler: function (request, reply) { return reply(); } }); - var table = server.connections[0].table(); - //[ - // { - // method: 'get', - // path: '/example', - // settings: { ... } - // } - //] - */ - table(host?: any): IConnectionTable; - - /**server.views(options) - Initializes the server views manager - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.views({ - engines: { - html: require('handlebars'), - jade: require('jade') - }, - path: '/static/templates' - }); - When server.views() is called within a plugin, the views manager is only available to plugins methods.*/ - views(options: IServerViewsConfiguration): void; - -} diff --git a/har-format/index.d.ts b/har-format/index.d.ts deleted file mode 100644 index 7aaf479891..0000000000 --- a/har-format/index.d.ts +++ /dev/null @@ -1,811 +0,0 @@ -// Type definitions for HAR 1.2 -// Project: https://w3c.github.io/web-performance/specs/HAR/Overview.html -// Definitions by: Michael Mrowetz -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - - -/** - * HTTP Archive 1.2 - * - * http://www.softwareishard.com/blog/har-12-spec - */ -export interface Har { - /** This object represents the root of exported data. */ - "log": Log; -} -/** - * This object (`log`) represents the root of exported data. - * - * http://www.softwareishard.com/blog/har-12-spec/#log - */ -export interface Log { - /** - * Version number of the format. - * - * _If empty, string "1.1" is assumed by default._ - */ - version: string; - /** Name and version info of the log creator application. */ - creator: Creator; - /** Name and version info of used browser. */ - browser?: Browser; - /** - * List of all exported (tracked) pages. - * - * _Leave out this field if the application - * does not support grouping by pages._ - * - * There is one `` object for every exported web page and one - * `` object for every HTTP request. - * In case when an HTTP trace tool isn't able to group requests by a page, - * the `` object is empty and individual requests doesn't have a - * parent page. - */ - pages?: Page[]; - /** List of all exported (tracked) requests. */ - entries: Entry[]; - /** A comment provided by the user or the application. */ - comment?: string; -} -/** - * Infos about application/browser used to export the log. - * - * `Creator` and `Browser` objects share the same structure. - * - * http://www.softwareishard.com/blog/har-12-spec/#creator - */ -export interface Creator { - /** Name of the application/browser used to export the log. */ - name: string; - /** Version of the application/browser used to export the log. */ - version: string; - /** A comment provided by the user or the application. */ - comment?: string; -} -/** - * Infos about application/browser used to export the log. - * - * `Browser` and `Creator` objects share the same structure. - * - * http://www.softwareishard.com/blog/har-12-spec/#browser - */ -export interface Browser { - /** Name of the application/browser used to export the log. */ - name: string; - /** Version of the application/browser used to export the log. */ - version: string; - /** A comment provided by the user or the application. */ - comment?: string; -} -/** - * This object represents list of exported pages. - * - * http://www.softwareishard.com/blog/har-12-spec/#pages - */ -export interface Page { - /** Date and time stamp for the beginning of the page load - * - * (ISO 8601 - `YYYY-MM-DDThh:mm:ss.sTZD`, - * e.g. `2009-07-24T19:20:30.45+01:00`). - */ - startedDateTime: string; - /** - * Unique identifier of a page within the `` (HAR doc). - * Entries use it to refer the parent page. - */ - id: string; - /** Page title. */ - title: string; - /** Detailed timing info about page load */ - pageTimings: PageTiming; - /** A comment provided by the user or the application */ - comment?: string; - /** _non-standard_ */ - /** _non-standard_ */ - _adult_site?: number; - /** _non-standard_ */ - _aft?: number; - /** _non-standard_ */ - _base_page_cdn?: string; - /** _non-standard_ */ - _base_page_redirects?: number; - /** _non-standard_ */ - _base_page_ttfb?: number; - /** _non-standard_ */ - _browser_main_memory_kb?: number; - /** _non-standard_ */ - _browser_name?: string; - /** _non-standard_ */ - _browser_other_private_memory_kb?: number; - /** _non-standard_ */ - _browser_process_count?: number; - /** _non-standard_ */ - _browser_version?: string; - /** _non-standard_ */ - _browser_working_set_kb?: number; - /** _non-standard_ */ - _bytesIn?: number; - /** _non-standard_ */ - _bytesInDoc?: number; - /** _non-standard_ */ - _bytesOut?: number; - /** _non-standard_ */ - _bytesOutDoc?: number; - /** _non-standard_ */ - _cached?: number; - /** _non-standard_ */ - _certificate_bytes?: number; - /** _non-standard_ */ - _connections?: number; - /** _non-standard_ */ - _date?: number; - /** _non-standard_ */ - _docCPUms?: number; - /** _non-standard_ */ - _docCPUpct?: number; - /** _non-standard_ */ - _docTime?: number; - /** _non-standard_ */ - _domContentLoadedEventEnd?: number; - /** _non-standard_ */ - _domContentLoadedEventStart?: number; - /** _non-standard_ */ - _domElements?: number; - /** _non-standard_ */ - _domInteractive?: number; - /** _non-standard_ */ - _domLoading?: number; - /** _non-standard_ */ - _domTime?: number; - /** _non-standard_ */ - _effectiveBps?: number; - /** _non-standard_ */ - _effectiveBpsDoc?: number; - /** _non-standard_ */ - _eventName?: string; - /** _non-standard_ */ - _firstPaint?: number; - /** _non-standard_ */ - _fixed_viewport?: number; - /** _non-standard_ */ - _fullyLoaded?: number; - /** _non-standard_ */ - _fullyLoadedCPUms?: number; - /** _non-standard_ */ - _fullyLoadedCPUpct?: number; - /** _non-standard_ */ - _gzip_savings?: number; - /** _non-standard_ */ - _gzip_total?: number; - /** _non-standard_ */ - _image_savings?: number; - /** _non-standard_ */ - _image_total?: number; - /** _non-standard_ */ - _isResponsive?: number; - /** _non-standard_ */ - _lastVisualChange?: number; - /** _non-standard_ */ - _loadEventEnd?: number; - /** _non-standard_ */ - _loadEventStart?: number; - /** _non-standard_ */ - _loadTime?: number; - /** _non-standard_ */ - _minify_savings?: number; - /** _non-standard_ */ - _minify_total?: number; - /** _non-standard_ */ - _optimization_checked?: number; - /** _non-standard_ */ - _pageSpeedVersion?: string; - /** _non-standard_ */ - _render?: number; - /** _non-standard_ */ - _requests?: number; - /** _non-standard_ */ - _requestsDoc?: number; - /** _non-standard_ */ - _requestsFull?: number; - /** _non-standard_ */ - _responses_200?: number; - /** _non-standard_ */ - _responses_404?: number; - /** _non-standard_ */ - _responses_other?: number; - /** _non-standard_ */ - _result?: number; - /** _non-standard_ */ - _run?: number; - /** _non-standard_ */ - _score_cache?: number; - /** _non-standard_ */ - _score_cdn?: number; - /** _non-standard_ */ - _score_combine?: number; - /** _non-standard_ */ - _score_compress?: number; - /** _non-standard_ */ - _score_cookies?: number; - /** _non-standard_ */ - _score_etags?: number; - /** _non-standard_ */ - _score_gzip?: number; - /** _non-standard_ */ - "_score_keep-alive"?: number; - /** _non-standard_ */ - _score_minify?: number; - /** _non-standard_ */ - _score_progressive_jpeg?: number; - /** _non-standard_ */ - _server_count?: number; - /** _non-standard_ */ - _server_rtt?: number; - /** _non-standard_ */ - _SpeedIndex?: number; - /** _non-standard_ */ - _step?: number; - /** _non-standard_ */ - _title?: string; - /** _non-standard_ */ - _titleTime?: number; - /** _non-standard_ */ - _TTFB?: number; - /** _non-standard_ */ - _URL?: string; - /** _non-standard_ */ - _visualComplete?: number; -} -/** - * This object describes timings for various events (states) fired during the - * page load. - * - * All times are specified in milliseconds. - * - * If a time info is not available appropriate field is set to `-1`. - * - * http://www.softwareishard.com/blog/har-12-spec/#pageTimings - */ -export interface PageTiming { - /** Content of the page loaded. Number of milliseconds since page load - * started (`page.startedDateTime`). - * - * Use `-1` if the timing does not apply to the current request. - */ - onContentLoad?: number; - /** Page is loaded (`onLoad` event fired). Number of milliseconds since - * page load started (`page.startedDateTime`). - * - * Use `-1` if the timing does not apply to the current request. - */ - onLoad?: number; - /** A comment provided by the user or the application */ - comment?: string; - _startRender?: number; -} -/** - * This object represents an array with all exported HTTP requests. Sorting - * entries by `startedDateTime` (starting from the oldest) is preferred way how - * to export data since it can make importing faster. - * However the reader application should always make sure the array is sorted - * (if required for the import). - * - * http://www.softwareishard.com/blog/har-12-spec/#entries - */ -export interface Entry { - /** - * Reference to the parent page. Leave out this field if the application - * does not support grouping by pages. - */ - pageref?: string; - /** - * Date and time stamp of the request start - * - * (ISO 8601 - `YYYY-MM-DDThh:mm:ss.sTZD`). - */ - startedDateTime: string; - /** - * Total elapsed time of the request in milliseconds. - * - * This is the sum of all timings available in the timings object - * (i.e. not including `-1` values). - */ - time: number; - /** Detailed info about the request. */ - request: Request; - /** Detailed info about the response. */ - response: Response; - /** Info about cache usage. */ - cache: Cache; - /** Detailed timing info about request/response round trip. */ - timings: Timings; - /** - * IP address of the server that was connected - * (result of DNS resolution). - */ - serverIPAddress?: string; - /** - * Unique ID of the parent TCP/IP connection, can be the client or server - * port number. - * - * Note that a port number doesn't have to be unique identifier - * in cases where the port is shared for more connections. - * - * If the port isn't available for the application, any other unique - * connection ID can be used instead (e.g. connection index). Leave out - * this field if the application doesn't support this info. - */ - connection?: string; - /** A comment provided by the user or the application */ - comment?: string; - /** _non-standard_ */ - _all_end?: number | string; - /** _non-standard_ */ - _all_ms?: number | string; - /** _non-standard_ */ - _all_start?: number | string; - /** _non-standard_ */ - _bytesIn?: number | string; - /** _non-standard_ */ - _bytesOut?: number | string; - /** _non-standard_ */ - _cacheControl?: string; - /** _non-standard_ */ - _cache_time?: number | string; - /** _non-standard_ */ - _cdn_provider?: string; - /** _non-standard_ */ - _certificate_bytes?: number | string; - /** _non-standard_ */ - _client_port?: number | string; - /** _non-standard_ */ - _connect_end?: number | string; - /** _non-standard_ */ - _connect_ms?: number | string; - /** _non-standard_ */ - _connect_start?: number | string; - /** _non-standard_ */ - _contentEncoding?: string; - /** _non-standard_ */ - _contentType?: string; - /** _non-standard_ */ - _dns_end?: number | string; - /** _non-standard_ */ - _dns_ms?: number | string; - /** _non-standard_ */ - _dns_start?: number | string; - /** _non-standard_ */ - _download_end?: number | string; - /** _non-standard_ */ - _download_ms?: number | string; - /** _non-standard_ */ - _download_start?: number | string; - /** _non-standard_ */ - _expires?: string; - /** _non-standard_ */ - _full_url?: string; - /** _non-standard_ */ - _gzip_save?: number | string; - /** _non-standard_ */ - _gzip_total?: number | string; - /** _non-standard_ */ - _host?: string; - /** _non-standard_ */ - _http2_stream_dependency?: number | string; - /** _non-standard_ */ - _http2_stream_exclusive?: number | string; - /** _non-standard_ */ - _http2_stream_id?: number | string; - /** _non-standard_ */ - _http2_stream_weight?: number | string; - /** _non-standard_ */ - _image_save?: number | string; - /** _non-standard_ */ - _image_total?: number | string; - /** _non-standard_ */ - _index?: number; - /** _non-standard_ */ - _initiator?: string; - /** _non-standard_ */ - _initiator_column?: string; - /** _non-standard_ */ - _initiator_detail?: string; - /** _non-standard_ */ - _initiator_function?: string; - /** _non-standard_ */ - _initiator_line?: string; - /** _non-standard_ */ - _initiator_type?: string; - /** _non-standard_ */ - _ip_addr?: string; - /** _non-standard_ */ - _is_secure?: number | string; - /** _non-standard_ */ - _jpeg_scan_count?: number | string; - /** _non-standard_ */ - _load_end?: number | string; - /** _non-standard_ */ - _load_ms?: number | string; - /** _non-standard_ */ - _load_start?: number | string; - /** _non-standard_ */ - _method?: string; - /** _non-standard_ */ - _minify_save?: number | string; - /** _non-standard_ */ - _minify_total?: number | string; - /** _non-standard_ */ - _number?: number; - /** _non-standard_ */ - _objectSize?: number | string; - /** _non-standard_ */ - _objectSizeUncompressed?: number | string; - /** _non-standard_ */ - _priority?: string; - /** _non-standard_ */ - _protocol?: number | string; - /** _non-standard_ */ - _request_id?: number | string; - /** _non-standard_ */ - _responseCode?: number | string; - /** _non-standard_ */ - _score_cache?: number | string; - /** _non-standard_ */ - _score_cdn?: number | string; - /** _non-standard_ */ - _score_combine?: number | string; - /** _non-standard_ */ - _score_compress?: number | string; - /** _non-standard_ */ - _score_cookies?: number | string; - /** _non-standard_ */ - _score_etags?: number | string; - /** _non-standard_ */ - _score_gzip?: number | string; - /** _non-standard_ */ - "_score_keep-alive"?: number | string; - /** _non-standard_ */ - _score_minify?: number | string; - /** _non-standard_ */ - _score_progressive_jpeg?: number; - /** _non-standard_ */ - _server_count?: number | string; - /** _non-standard_ */ - _server_rtt?: number | string; - /** _non-standard_ */ - _socket?: number | string; - /** _non-standard_ */ - _ssl_end?: number | string; - /** _non-standard_ */ - _ssl_ms?: number | string; - /** _non-standard_ */ - _ssl_start?: number | string; - /** _non-standard_ */ - _ttfb_end?: number | string; - /** _non-standard_ */ - _ttfb_ms?: number | string; - /** _non-standard_ */ - _ttfb_start?: number | string; - /** _non-standard_ */ - _type?: number | string; - /** _non-standard_ */ - _url?: string; - /** _non-standard_ */ - _was_pushed?: number | string; - /** _non-standard_ */ - _initialPriority?: string; -} -/** - * This object contains detailed info about performed request. - * - * http://www.softwareishard.com/blog/har-12-spec/#request - */ -export interface Request { - /** Request method (`GET`, `POST`, ...). */ - method: string; - /** Absolute URL of the request (fragments are not included). */ - url: string; - /** Request HTTP Version. */ - httpVersion: string; - /** List of cookie objects. */ - cookies: Cookie[]; - /** List of header objects. */ - headers: Header[]; - /** List of query parameter objects. */ - queryString: QueryString[]; - /** Posted data info. */ - postData?: PostData; - /** - * Total number of bytes from the start of the HTTP request message until - * (and including) the double CRLF before the body. - * - * Set to `-1` if the info is not available. - */ - headersSize: number; - /** - * Size of the request body (POST data payload) in bytes. - * - * Set to `-1` if the info is not available. - */ - bodySize: number; - /** A comment provided by the user or the application */ - comment?: string; -} -/** - * This object contains detailed info about the response. - * - * http://www.softwareishard.com/blog/har-12-spec/#response - */ -export interface Response { - /** Response status. */ - status: number; - /** Response status description. */ - statusText: string; - /** Response HTTP Version. */ - httpVersion: string; - /** List of cookie objects. */ - cookies: Cookie[]; - /** List of header objects. */ - headers: Header[]; - /** Details about the response body. */ - content: Content; - /** Redirection target URL from the Location response header. */ - redirectURL: string; - /** - * Total number of bytes from the start of the HTTP response message until - * (and including) the double CRLF before the body. - * - * Set to `-1` if the info is not available. - * - * _The size of received response-headers is computed only from headers - * that are really received from the server. Additional headers appended by - * the browser are not included in this number, but they appear in the list - * of header objects._ - */ - headersSize: number; - /** Size of the received response body in bytes. - * - * - Set to zero in case of responses coming from the cache (`304`). - * - Set to `-1` if the info is not available. - */ - bodySize: number; - /** A comment provided by the user or the application */ - comment?: string; - /** _non-standard_ */ - _transferSize?: number; -} -/** - * This object contains list of all cookies (used in `request` and `response` - * objects). - * - * http://www.softwareishard.com/blog/har-12-spec/#cookies - */ -export interface Cookie { - /** The name of the cookie. */ - name: string; - /** The cookie value. */ - value: string; - /** The path pertaining to the cookie. */ - path?: string; - /** The host of the cookie. */ - domain?: string; - /** - * Cookie expiration time. - * (ISO 8601 - `YYYY-MM-DDThh:mm:ss.sTZD`, - * e.g. `2009-07-24T19:20:30.123+02:00`). - */ - expires?: string | Date | null; - /** Set to true if the cookie is HTTP only, false otherwise. */ - httpOnly?: boolean; - /** True if the cookie was transmitted over ssl, false otherwise. */ - secure?: boolean; - /** A comment provided by the user or the application */ - comment?: string; -} - -/** - * This object represents a headers (used in `request` and `response` objects). - * - * http://www.softwareishard.com/blog/har-12-spec/#headers - */ -export interface Header { - name: string; - value: string; - /** A comment provided by the user or the application */ - comment?: string; -} -/** - * This object represents a parameter & value parsed from a query string, - * if any (embedded in `request` object). - * - * http://www.softwareishard.com/blog/har-12-spec/#queryString - */ -export interface QueryString { - name: string; - value: string; - /** A comment provided by the user or the application */ - comment?: string; -} -/** - * This object describes posted data, if any (embedded in `request` object). - * - * http://www.softwareishard.com/blog/har-12-spec/#postData - */ -export interface PostData { - /** Mime type of posted data. */ - mimeType: string; - /** List of posted parameters (in case of URL encoded parameters). - * - * _`text` and `params` fields are mutually exclusive._ - */ - params: Param[]; - /** Plain text posted data - * - * _`params` and `text` fields are mutually exclusive._ - */ - text: string; - /** A comment provided by the user or the application */ - comment?: string; -} -/** - * List of posted parameters, if any (embedded in `postData` object). - * - * http://www.softwareishard.com/blog/har-12-spec/#params - */ -export interface Param { - /** name of a posted parameter. */ - name: string; - /** value of a posted parameter or content of a posted file */ - value?: string; - /** name of a posted file. */ - fileName?: string; - /** content type of a posted file. */ - contentType?: string; - /** A comment provided by the user or the application */ - comment?: string; -} -/** - * This object describes details about response content - * (embedded in `response` object). - * - * http://www.softwareishard.com/blog/har-12-spec/#content - */ -export interface Content { - /** - * Length of the returned content in bytes. - * - * Should be equal to `response.bodySize` if there is no compression and - * bigger when the content has been compressed. - */ - size: number; - /** - * Number of bytes saved. Leave out this field if the information is not - * available. - */ - compression?: number; - /** - * MIME type of the response text (value of the Content-Type response - * header). - * - * The charset attribute of the MIME type is included (if available). - */ - mimeType: string; - /** - * Response body sent from the server or loaded from the browser cache. - * - * This field is populated with textual content only. - * - * The text field is either HTTP decoded text or a encoded (e.g. `base64`) - * representation of the response body. - * - * Leave out this field if the information is not available. - */ - text?: string; - /** - * Encoding used for response text field e.g `base64`. - * - * Leave out this field if the text field is HTTP decoded - * (decompressed & unchunked), than trans-coded from its original character - * set into UTF-8. - */ - encoding?: string; - /** A comment provided by the user or the application */ - comment?: string; -} -/** - * This objects contains info about a request coming from browser cache. - * - * http://www.softwareishard.com/blog/har-12-spec/#cache - */ -export interface Cache { - /** - * State of a cache entry before the request. - * - * Leave out this field if the information is not available. - */ - beforeRequest?: CacheDetails; - /** - * State of a cache entry after the request. - * - * Leave out this field if the information is not available. - */ - afterRequest?: CacheDetails; - /** A comment provided by the user or the application */ - comment?: string; -} -export interface CacheDetails { - /** Expiration time of the cache entry. - * - * _(Format not documente but assumingly ISO 8601 - - * `YYYY-MM-DDThh:mm:ss.sTZD`)_ - */ - expires?: string; - /** The last time the cache entry was opened. - * * - * _(Format not documente but assumingly ISO 8601 - - * `YYYY-MM-DDThh:mm:ss.sTZD`)_ - */ - lastAccess: string; - /** Etag */ - eTag: string; - /** The number of times the cache entry has been opened. */ - hitCount: number; - /** A comment provided by the user or the application */ - comment?: string; -} -/** - * This object describes various phases within request-response round trip. - * - * All times are specified in milliseconds. - * - * http://www.softwareishard.com/blog/har-12-spec/#timings - */ -export interface Timings { - /** - * Time spent in a queue waiting for a network connection. - * - * Use `-1` if the timing does not apply to the current request. - */ - blocked?: number; - /** - * DNS resolution time. The time required to resolve a host name. - * - * Use `-1` if the timing does not apply to the current request. - */ - dns?: number; - /** - * Time required to create TCP connection. - * - * Use `-1` if the timing does not apply to the current request. - */ - connect?: number; - /** - * Time required to send HTTP request to the server. - * - * _Not optional and must have non-negative values._ - */ - send?: number; - /** - * Waiting for a response from the server. - * - * _Not optional and must have non-negative values._ - */ - wait: number; - /** - * Time required to read entire response from the server (or cache). - * - * _Not optional and must have non-negative values._ - */ - receive: number; - /** - * Time required for SSL/TLS negotiation. - * - * If this field is defined then the time is also included in the connect - * field (to ensure backward compatibility with HAR 1.1). - * - * Use `-1` if the timing does not apply to the current request. - */ - ssl?: number; - /** A comment provided by the user or the application */ - comment?: string; -} diff --git a/har-format/tslint.json b/har-format/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/har-format/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/heatmap.js/index.d.ts b/heatmap.js/index.d.ts deleted file mode 100644 index d6907abe7b..0000000000 --- a/heatmap.js/index.d.ts +++ /dev/null @@ -1,140 +0,0 @@ -// Type definitions for heatmap.js v2.0 -// Project: https://github.com/pa7/heatmap.js/ -// Definitions by: Yang Guan -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -/* - * Configuration object of a heatmap - */ -interface HeatmapConfiguration { - - /* - * A background color string in form of hexcode, color name, or rgb(a) - */ - backgroundColor?: string; - - /* - * The blur factor that will be applied to all datapoints. The higher the - * blur factor is, the smoother the gradients will be - * Default value: 0.85 - */ - blur?: number; - - /* - * An object that represents the gradient - */ - gradient?: any; - - /* - * The property name of your latitude coordinate in a datapoint - * Default value: 'x' - */ - latField?: string; - - /* - * The property name of your longitude coordinate in a datapoint - * Default value: 'y' - */ - lngField?: string; - - /* - * The maximal opacity the highest value in the heatmap will have. (will be - * overridden if opacity set) - * Default value: 0.6 - */ - maxOpacity?: number; - - /* - * The minimum opacity the lowest value in the heatmap will have (will be - * overridden if opacity set) - */ - minOpacity?: number; - - /* - * A global opacity for the whole heatmap. This overrides maxOpacity and - * minOpacity if set - */ - opacity?: number; - - /* - * The radius each datapoint will have (if not specified on the datapoint - * itself) - */ - radius?: number; - - /** - * Scales the radius based on map zoom. - */ - scaleRadius?: boolean; - - /* - * Indicate whether the heatmap should use a global extrema or a local - * extrema (the maximum and minimum of the currently displayed viewport) - */ - useLocalExtrema?: boolean; - - /* - * The property name of the value/weight in a datapoint - * Default value: 'value' - */ - valueField?: string; -} - -/* - * A single data point on a heatmap. The keys are specified by - * HeatmapConfig.latField, HeatmapConfig.lngField and HeatmapConfig.valueField - */ -interface HeatmapDataPoint { - [index: string]: number; -} - -/* - * An object representing the set of data points on a heatmap - */ -interface HeatmapData { - - /* - * An array of HeatmapDataPoints - */ - data: HeatmapDataPoint[]; - - /* - * Max value of the valueField - */ - max?: number; - - /* - * Min value of the valueField - */ - min?: number; -} - -/* - * The overlay layer to be added onto leaflet map - */ -declare class HeatmapOverlay { - - /* - * Initialization function - */ - constructor(configuration: HeatmapConfiguration) - - /* - * Create DOM elements for an overlay, adding them to map panes and puts - * listeners on relevant map events - */ - onAdd(map: L.Map): void; - - /* - * Remove the overlay's elements from the DOM and remove listeners - * previously added by onAdd() - */ - onRemove(map: L.Map): void; - - /* - * Initialize a heatmap instance with the given dataset - */ - setData(data: HeatmapData): void; -} diff --git a/heatmap.js/package.json b/heatmap.js/package.json deleted file mode 100644 index 711ba15e43..0000000000 --- a/heatmap.js/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "dependencies": { - "@types/leaflet": "^0.7" - } -} \ No newline at end of file diff --git a/heatmap.js/tsconfig.json b/heatmap.js/tsconfig.json deleted file mode 100644 index 1fd9be0a9c..0000000000 --- a/heatmap.js/tsconfig.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "heatmap.js-tests.ts" - ] -} \ No newline at end of file diff --git a/hellosign-embedded/index.d.ts b/hellosign-embedded/index.d.ts deleted file mode 100644 index ec77a92b92..0000000000 --- a/hellosign-embedded/index.d.ts +++ /dev/null @@ -1,270 +0,0 @@ -// Type definitions for hellosign-embedded v1.2.0 -// Project: https://github.com/HelloFax/hellosign-embedded -// Definitions by: Brian Surowiec -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare module HelloSign { - interface SignedMessageEvent { - event: 'signature_request_signed'; - signature_id: string; - } - - interface DeclinedMessageEvent { - event: 'signature_request_declined'; - signature_id: string; - } - - interface CanceledMessageEvent { - event: 'signature_request_canceled'; - } - - interface SentMessageEvent { - event: 'signature_request_sent'; - signature_request_id: string; - signature_request_info: { - title: string; - message: string; - signatures: Array<{ - signature_id: string; - signer_email_address: string; - signer_name: string; - order: number; - status_code: string; - signed_at: number; - last_viewed_at: number; - last_reminded_at: number; - has_pin: boolean; - }>; - cc_email_addresses: Array; - }; - } - - interface TemplateCreatedMessageEvent { - event: 'template_created'; - template_id: string; - template_info: { - title: string; - message: string; - signer_roles: Array<{ - name: string; - order: number; - }>; - cc_roles: Array<{ - name: string; - }>; - }; - } - - interface ErrorMessageEvent { - event: 'error'; - description: string; - } - - type MessageEvent = SignedMessageEvent | DeclinedMessageEvent | - CanceledMessageEvent | SentMessageEvent | TemplateCreatedMessageEvent | - ErrorMessageEvent; - - interface ClientCultures { - /** - * English (United States) - * - * @default en_US - */ - EN_US: string; - - /** - * French (France) - * - * @default fr_FR - */ - FR_FR: string; - - /** - * German (Germany) - * - * @default de_DE - */ - DE_DE: string; - - /** - * Swedish (Sweden) - * - * @default sv_SE - */ - SV_SE: string; - - /** - * Chinese (China) - * - * @default zh_CN - */ - ZH_CN: string; - - /** - * Danish (Denmark) - * - * @default da_DK - */ - DA_DK: string; - - /** - * Dutch (The Netherlands) - * @default nl_NL - */ - NL_NL: string; - - /** - * The available client UI cultures - */ - supportedCultures: string[]; - } - - interface OpenParameters { - /** - * The url to open in the child frame - */ - url?: string; - - /** - * Where to go after the signature is completed - */ - redirectUrl?: string; - - /** - * Whether a cancel button should be displayed - * - * @default true - */ - allowCancel?: boolean; - - /** - * A listener for X-window messages coming from the child frame - */ - messageListener?: (eventData: MessageEvent) => void; - - /** - * One of the HelloSign.CULTURES.supportedCultures - * - * @default HelloSign.CULTURES.EN_US - */ - userCulture?: string; - - /** - * When true, debugging statements will be written to the console - * - * @default false - */ - debug?: boolean; - - /** - * When true, domain verification step will be skipped if and only if the Signature Request was created with test_mode=1 - * - * @default false - */ - skipDomainVerification?: boolean; - - /** - * DOM element that will contain the iframe on the page (defaults to document.body) - */ - container?: Element; - - /** - * Height of the iFrame (only applicable when a container is specified) - */ - height?: number; - - /** - * When true, the header will be hidden. - * This is only functional for customers with embedded branding enabled. - * - * @default false - */ - hideHeader?: boolean; - - /** - * The version of the embedded user experience to display to signers (1 = legacy, 2 = responsive). - * This option is only honored if your account has accessed the API prior to Nov 14, 2015. - */ - uxVersion?: number; - - /** - * The email of the person issuing a signature request. - * Required for allowing 'Me + Others' requests - */ - requester?: string; - - /** - * An associative array to be used to customize the app's signer page - */ - whiteLabelingOptions?: Object; - } - - interface HelloSignStatic { - /** - * The available client UI cultures - */ - CULTURES: ClientCultures; - - /** - * The signature request was signed - * - * @default signature_request_signed - */ - EVENT_SIGNED: string; - - /** - * The signature request was declined - * - * @default signature_request_declined - */ - EVENT_DECLINED: string; - - /** - * The user closed the iFrame before completing - * - * @default signature_request_canceled - */ - EVENT_CANCELED: string; - - /** - * The user sent a signature request - * - * @default signature_request_sent - */ - EVENT_SENT: string; - - /** - * The template was created or edited - * - * @default template_created - */ - EVENT_TEMPLATE_CREATED: string; - - /** - * An error occurred in the iFrame - * - * @default error - */ - EVENT_ERROR: string; - - /** - * Initialize using your HelloSign API client ID. - * - * @param appClientId The API client ID the request is for. - */ - init(appClientId: string): void; - - /** - * Open the signing window. - * - * @param params The options to use when opening the signing window. - */ - open(params: OpenParameters): void; - - /** - * Close the signing window. - */ - close(): void; - } -} - -declare var HelloSign: HelloSign.HelloSignStatic; diff --git a/highcharts/index.d.ts b/highcharts/index.d.ts deleted file mode 100644 index 58f2a97a5e..0000000000 --- a/highcharts/index.d.ts +++ /dev/null @@ -1,6509 +0,0 @@ -// Type definitions for Highcharts 4.2.7 -// Project: http://www.highcharts.com/ -// Definitions by: Damiano Gambarotto , Dan Lewi Harkestad -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare namespace Highcharts { - interface Position { - align?: string; - verticalAlign?: string; - x?: number; - y?: number; - } - - interface DateTimeFormats { - /** - * @default '%H:%M:%S.%L' - */ - millisecond?: string; - /** - * @default '%H:%M:%S' - */ - second?: string; - /** - * @default '%H:%M' - */ - minute?: string; - /** - * @default '%H:%M' - */ - hour?: string; - /** - * @default '%e. %b' - */ - day?: string; - /** - * @default '%e. %b' - */ - week?: string; - /** - * @default '%b \ '%y' - */ - month?: string; - /** - * @default '%Y' - */ - year?: string; - } - - interface AxisEvent extends Event { - min: number; - max: number; - } - - interface AxisLabels { - /** - * What part of the string the given position is anchored to. Can be one of 'left', 'center' or 'right'. Defaults to - * an intelligent guess based on which side of the chart the axis is on and the rotation of the label. - * @default 'center' on xAxis, 'right' on yAxis - */ - align?: string; - /** - * For horizontal axes, the allowed degrees of label rotation to prevent overlapping labels. If there is enough - * space, labels are not rotated. As the chart gets narrower, it will start rotating the labels -45 degrees, then - * remove every second label and try again with rotations 0 and -45 etc. Set it to false to disable rotation, which - * will cause the labels to word-wrap if possible. - * @default [-45] - * @since 4.1.0 - */ - autoRotation?: number[]; - /** - * When each category width is more than this many pixels, we don't apply auto rotation. Instead, we lay out the - * axis label with word wrap. A lower limit makes sense when the label contains multiple short words that don't - * extend the available horizontal space for each label. - * @default 80 - * @since 4.1.5 - */ - autoRotationLimit?: number; - /** - * Polar charts only. The label's pixel distance from the perimeter of the plot area. - * @default 15 - */ - distance?: number; - /** - * Enable or disable the axis labels. - * @default true - */ - enabled?: boolean; - /** - * A {@link http://www.highcharts.com/docs/chart-concepts/labels-and-string-formatting|format string} for the axis label. - * @default '{value}' - * @since 3.0 - */ - format?: string; - /** - * Callback JavaScript function to format the label. The value is given by this.value. Additional properties for - * this are axis, chart, isFirst and isLast. - * @default function() {return this.value;} - */ - formatter?: () => string; - /** - * Horizontal axis only. When staggerLines is not set, maxStaggerLines defines how many lines the axis is allowed to - * add to automatically avoid overlapping X labels. Set to 1 to disable overlap detection. - * @default 5 - * @since 3.0.3 - * @deprecated - */ - maxStaggerLines?: number; - /** - * How to handle overflowing labels on horizontal axis. Can be undefined, false or 'justify'. By default it aligns - * inside the chart area. If 'justify', labels will not render outside the plot area. If false, it will not be - * aligned at all. If there is room to move it, it will be aligned to the edge, else it will be removed. - * @since 2.2.5 - * @deprecated - */ - overflow?: string | boolean; - /** - * The pixel padding for axis labels, to ensure white space between them. - * @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 - */ - rotation?: number; - /** - * Horizontal axes only. The number of lines to spread the labels over to make room or tighter labels. - * @since 2.1 - */ - staggerLines?: number; - /** - * To show only every n'th label on the axis, set the step to n. Setting the step to 2 shows every other label. By - * default, the step is calculated automatically to avoid overlap. To prevent this, set it to 1. This usually only - * happens on a category axis, and is often a sign that you have chosen the wrong axis type. - * Read more at {@link http://www.highcharts.com/docs/chart-concepts/axes|Axis docs} => What axis should I use? - * @since 2.1 - */ - step?: number; - /** - * CSS styles for the label. Use whiteSpace: 'nowrap' to prevent wrapping of category labels. Use textOverflow: - * 'none' to prevent ellipsis (dots). - * @default {'color':'#6D869F','fontWeight':'bold'}. - */ - style?: CSSObject; - /** - * Whether to use HTML to render the labels. - * @default false - */ - useHTML?: boolean; - /** - * The x position offset of the label relative to the tick position on the axis. - * @default 0 - */ - x?: number; - /** - * The y position offset of the label relative to the tick position on the axis. The default makes it adapt to the - * font size on bottom axis. - * @default null - */ - y?: number; - /** - * The Z index for the axis labels. - * @default 7 - */ - zIndex?: number; - } - - interface MousePlotEvents { - click?: (event: Event) => void; - mouseover?: (event: Event) => void; - mouseout?: (event: Event) => void; - mousemove?: (event: Event) => void; - } - - /** - * Text labels for the plot bands - */ - interface PlotLabel { - /** - * Horizontal alignment of the label. Can be one of 'left', 'center' or 'right'. - * @default 'center' - * @since 2.1 - */ - align?: string; - /** - * Rotation of the text label in degrees. - * @default 0 - * @since 2.1 - */ - rotation?: number; - /** - * CSS styles for the text label. - * @since 2.1 - */ - style?: CSSObject; - /** - * The string text itself. A subset of HTML is supported. - * @since 2.1 - */ - text?: string; - /** - * The text alignment for the label. While align determines where the texts anchor point is placed within the plot - * band, textAlign determines how the text is aligned against its anchor point. Possible values are 'left', 'center' - * and 'right'. Defaults to the same as the align option. - * @since 2.1 - */ - textAlign?: string; - /** - * Whether to {@link http://www.highcharts.com/docs/chart-concepts/labels-and-string-formatting#html|use HTML} to render the labels. - * @default false - * @since 3.0.3 - */ - useHTML?: boolean; - /** - * Vertical alignment of the label relative to the plot band. Can be one of 'top', 'middle' or 'bottom'. - * @default 'top' - * @since 2.1 - */ - verticalAlign?: string; - /** - * Horizontal position relative the alignment. Default varies by orientation. - * @since 2.1 - */ - x?: number; - /** - * Vertical position of the text baseline relative to the alignment. Default varies by orientation. - * @since 2.1 - */ - y?: number; - } - - interface PlotBands { - /** - * Border color for the plot band. Also requires borderWidth to be set. - * @default null - */ - borderColor?: Color; - /** - * Border width for the plot band. Also requires borderColor to be set. - * @default 0 - */ - borderWidth?: number; - /** - * The color of the plot band. - */ - color?: Color; - /** - * An object defining mouse events for the plot band. Supported properties are click, mouseover, mouseout, - * mousemove. - * The this keyword refers to the PlotLineOrBand object. - * @since 1.2 - */ - events?: MousePlotEvents; - /** - * The start position of the plot band in axis units. - */ - from?: number; - /** - * An id used for identifying the plot band in Axis.removePlotBand. - */ - id?: string; - /** - * In a gauge chart, this option determines the inner radius of the plot band that stretches along the perimeter. It - * can be given as a percentage string, like '100%', or as a pixel number, like 100. By default, the inner radius is - * controlled by the thickness option. - * Only defined for yAxis.plotBands - * @default null - * @since 2.3 - */ - innerRadius?: number | string; - /** - * Text labels for the plot bands - */ - label?: PlotLabel; - /** - * In a gauge chart, this option determines the outer radius of the plot band that stretches along the perimeter. It - * can be given as a percentage string, like '100%', or as a pixel number, like 100. - * Only defined for yAxis.plotBands - * @default '100%' - * @since 2.3 - */ - outerRadius?: number | string; - /** - * In a gauge chart, this option sets the width of the plot band stretching along the perimeter. It can be given as - * a percentage string, like '10%', or as a pixel number, like 10. The default value 10 is the same as the default - * tickLength, thus making the plot band act as a background for the tick markers. - * Only defined for yAxis.plotBands - * @default 10 - * @since 2.3 - */ - thickness?: number | string; - /** - * The end position of the plot band in axis units. - */ - to?: number; - /** - * The z index of the plot band within the chart, relative to other elements. Using the same z index as another - * element may give unpredictable results, as the last rendered element will be on top. Values from 0 to 20 make - * sense. - * @since 1.2 - */ - zIndex?: number; - } - - /** - * An array of lines stretching across the plot area, marking a specific value - * on one of the axes. - */ - interface PlotLines { - /** - * The color of the line. - */ - color?: string | Gradient; - /** - * The dashing or dot style for the plot line. For possible values see - * {@link http://jsfiddle.net/gh/get/jquery/1.7.1/highslide-software/highcharts.com/tree/master/samples/highcharts/plotoptions/series-dashstyle-all/|this overview}. - * (Solid ShortDash ShortDot ShortDashDot ShortDashDotDot Dot Dash LongDash DashDot LongDashDot LongDashDotDot) - * @default 'Solid' - * @since 1.2 - */ - dashStyle?: string; - /** - * An object defining mouse events for the plot line. Supported properties are click, mouseover, mouseout, - * mousemove. - * The this keyword refers to the PlotLineOrBand object. - * @since 1.2 - */ - events?: MousePlotEvents; - /** - * An id used for identifying the plot line in Axis.removePlotLine. - */ - id?: string; - /** - * Text labels for the plot lines - */ - label?: PlotLabel; - /** - * The position of the line in axis units. - */ - value?: number; - /** - * The width or thickness of the plot line. - */ - width?: number; - /** - * The z index of the plot line within the chart. - * @since 1.2 - */ - zIndex?: number; - } - - interface AxisTitle { - /** - * Alignment of the title relative to the axis values. Possible values are 'low', 'middle' or 'high'. - * @default 'middle' - */ - align?: string; - /** - * Set the text to null to disable the title. - * @default 'middle' - * @deprecated - */ - enabled?: string; - /** - * The pixel distance between the axis labels or line and the title. - * @default xAxis: 0 for horizontal axes, 10 for vertical axes, yAxis: 40 - */ - margin?: number; - /** - * The distance of the axis title from the axis line. By default, this distance is computed from the offset width of - * the labels, the labels' distance from the axis and the title's margin. However when the offset option is set, it - * overrides all this. - * @since 2.2.0 - */ - offset?: number; - /** - * The rotation of the text in degrees. 0 is horizontal, 270 is vertical reading from bottom to top. - * @default xAxis: 0, yAxis: 270 - */ - rotation?: number; - /** - * CSS styles for the title. When titles are rotated they are rendered using vector graphic techniques and not all - * styles are applicable. - * @default { 'color': '#707070', 'fontWeight': 'bold' }. - */ - style?: CSSObject; - /** - * The actual text of the axis title. It can contain basic HTML text markup like , and spans with style. - * @default xAxis: null, yAxis: 'Values' - */ - text?: string; - /** - * Horizontal pixel offset of the title position. - * @default 0 - * @since 4.1.6 - */ - x?: number; - /** - * Vertical pixel offset of the title position. - */ - y?: number; - } - - interface AxisBreak { - /** - * A number indicating how much space should be left between the start and the end of the break. The break size is - * given in axis units, so for instance on a datetime axis, a break size of 3600000 would indicate the equivalent of - * an hour. - * @default 0 - * @since 4.1.0 - */ - breakSize?: number; - /** - * The point where the break starts. - * @since 4.1.0 - */ - from?: number; - /** - * Defines an interval after which the break appears again. By default the breaks do not repeat. - * @default 0 - * @since 4.1.0 - */ - repeat?: number; - /** - * The point where the break ends. - * @since 4.1.0 - */ - to?: number; - } - - interface AxisOptions { - /** - * Whether to allow decimals in this axis' ticks. When counting integers, - * like persons or hits on a web page, decimals must be avoided in the axis - * tick labels. - * @default true - * @since 2.0 - */ - allowDecimals?: boolean; - /** - * When using an alternate grid color, a band is painted across the plot - * area between every other grid line. - */ - alternateGridColor?: string; - /** - * An array defining breaks in the axis, the sections defined will be left out and all the points shifted closer to - * each other. Requires that the broken-axis.js module is loaded. - * @since 4.1.0 - */ - breaks?: AxisBreak[]; - /** - * If categories are present for the xAxis, names are used instead of numbers for that axis. Since Highcharts 3.0, - * categories can also be extracted by giving each point a name and setting axis type to category. However, if you - * have multiple series, best practice remains defining the categories array. - * Example: - * categories: ['Apples', 'Bananas', 'Oranges'] - * @default null - */ - categories?: string[]; - /** - * The highest allowed value for automatically computed axis extremes. - * @since 4.0 - */ - ceiling?: number; - /** - * Configure a crosshair that follows either the mouse pointer or the hovered point. - */ - crosshair?: CrosshairObject | boolean; - /** - * For a datetime axis, the scale will automatically adjust to the appropriate unit. This member gives the default - * string representations used for each unit. For an overview of the replacement codes, see dateFormat. - */ - dateTimeLabelFormats?: DateTimeFormats; - /** - * Whether to force the axis to end on a tick. Use this option with the maxPadding option to control the axis end. - * @default false - */ - endOnTick?: boolean; - /** - * Event handlers for the axis - */ - events?: { - /** - * An event fired after the breaks have rendered. - * @since 4.1.0 - */ - afterBreaks?: (event: Event) => void; - /** - * As opposed to the setExtremes event, this event fires after the final min and max values are computed and - * corrected for minRange. - * The this keyword refers to the {@link AxisObject|Axis} object. - * @since 2.3 - */ - afterSetExtremes?: (event: AxisEvent) => void; - /** - * An event fired when a break from this axis occurs on a point. - * The this keyword refers to the {@link AxisObject|Axis} object. - */ - pointBreak?: (event: Event) => void; - /** - * Fires when the minimum and maximum is set for the axis, either by calling the .setExtremes() method or by - * selecting an area in the chart. One parameter, event, is passed to the function. This contains common event - * information based on jQuery or MooTools depending on which library is used as the base for Highcharts. - * - * The new user set minimum and maximum values can be found by event.min and event.max. When an axis is zoomed - * all the way out from the 'Reset zoom' button, event.min and event.max are null, and the new extremes are set - * based on this.dataMin and this.dataMax. - * - * The this keyword refers to the {@link AxisObject|Axis} object. - * @since 1.2.0 - */ - setExtremes?: (event: AxisEvent) => void; - }; - /** - * The lowest allowed value for automatically computed axis extremes. - * @default null - * @since 4.0 - */ - floor?: number; - /** - * Color of the grid lines extending the ticks across the plot area. - * @defaults to '#D8D8D8'. - */ - gridLineColor?: string; - /** - * The dash or dot style of the grid lines. For possible values, see {@http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/highcharts/plotoptions/series-dashstyle-all/|this demonstration}. Defaults to Solid. - * @since 1.2 - */ - gridLineDashStyle?: string; - /** - * The width of the grid lines extending the ticks across the plot area. - * @default 0 - */ - gridLineWidth?: number; - /** - * The Z index of the grid lines. - * @default 1 - */ - gridZIndex?: number; - /** - * An id for the axis. This can be used after render time to get a pointer to the axis object through chart.get(). - * @since 1.2.0 - */ - id?: string; - /** - * The axis labels show the number or category for each tick. - */ - labels?: AxisLabels; - /** - * The color of the line marking the axis itself. - * @default '#C0D0E0'. - */ - lineColor?: string | Gradient; - /** - * The width of the line marking the axis itself. - * @default 1 - */ - lineWidth?: number; - /** - * Index of another axis that this axis is linked to. When an axis is linked to a master axis, it will take the same - * extremes as the master, but as assigned by min or max or by setExtremes. It can be used to show additional info, - * or to ease reading the chart by duplicating the scales. - * @since 2.0.2 - */ - linkedTo?: number; - /** - * The maximum value of the axis. If null, the max value is automatically calculated. If the endOnTick option is - * true, the max value might be rounded up. The actual maximum value is also influenced by chart.alignTicks. - */ - max?: number; - /** - * Padding of the max value relative to the length of the axis. A padding of 0.05 will make a 100px axis 5px longer. - * This is useful when you don't want the highest data value to appear on the edge of the plot area. When the axis' - * max option is set or a max extreme is set using axis.setExtremes(), the maxPadding will be ignored. - * @default 0.01 - * @since 1.2.0 - */ - maxPadding?: number; - /** - * Renamed to minRange as of Highcharts 2.2. - * @deprecated - */ - maxZoom?: number; - /** - * The minimum value of the axis. If null the min value is automatically calculated. If the startOnTick option is - * true, the min value might be rounded down. - */ - min?: number; - /** - * Padding of the min value relative to the length of the axis. A padding of 0.05 will make a 100px axis 5px longer. - * This is useful when you don't want the lowest data value to appear on the edge of the plot area. When the axis' - * min option is set or a min extreme is set using axis.setExtremes(), the minPadding will be ignored. - * @default 0.01 - * @since 1.2.0 - */ - minPadding?: number; - /** - * The minimum range to display on this axis. The entire axis will not be allowed to span over a smaller interval - * than this. For example, for a datetime axis the main unit is milliseconds. If minRange is set to 3600000, you - * can't zoom in more than to one hour. - * - * The default minRange for the x axis is five times the smallest interval between any of the data points. - * - * On a logarithmic axis, the unit for the minimum range is the power. So a minRange of 1 means that the axis can be - * zoomed to 10-100, 100-1000, 1000-10000 etc. - * - * Note that the minPadding, maxPadding, startOnTick and endOnTick settings also affect how the extremes of the axis - * are computed. - */ - minRange?: number; - /** - * The minimum tick interval allowed in axis values. For example on zooming in on an axis with daily data, this can - * be used to prevent the axis from showing hours. Defaults to the closest distance between two points on the axis. - * @since 2.3.0 - */ - minTickInterval?: number; - /** - * Color of the minor, secondary grid lines. - * @default '#E0E0E0' - */ - minorGridLineColor?: string; - /** - * The dash or dot style of the minor grid lines. For possible values, see {@link http://jsfiddle.net/gh/get/jquery/1.7.1/highslide-software/highcharts.com/tree/master/samples/highcharts/plotoptions/series-dashstyle-all/|this demonstration}. - * @default 'Solid' - */ - minorGridLineDashStyle?: string; - /** - * Width of the minor, secondary grid lines. - * @default 1 - */ - minorGridLineWidth?: number; - /** - * Color for the minor tick marks. - * @default to '#A0A0A0' - */ - minorTickColor?: string; - /** - * Tick interval in scale units for the minor ticks. On a linear axis, if 'auto', the minor tick interval is - * calculated as a fifth of the tickInterval. If null, minor ticks are not shown. - * - * On logarithmic axes, the unit is the power of the value. For example, setting the minorTickInterval to 1 puts one - * tick on each of 0.1, 1, 10, 100 etc. Setting the minorTickInterval to 0.1 produces 9 ticks between 1 and 10, 10 - * and 100 etc. A minorTickInterval of 'auto' on a log axis results in a best guess, attempting to enter - * approximately 5 minor ticks between each major tick. - * - * If user settings dictate minor ticks to become too dense, they don't make sense, and will be ignored to prevent - * performance problems. - * - * On axes using categories, minor ticks are not supported. - */ - minorTickInterval?: number | string; - /** - * The pixel length of the minor tick marks. - * @default 2 - */ - minorTickLength?: number; - /** - * The position of the minor tick marks relative to the axis line. Can be one of 'inside' and 'outside'. - * @default 'outside' - */ - minorTickPosition?: string; - /** - * The pixel width of the minor tick mark. - * @default 0 - */ - minorTickWidth?: number; - /** - * The distance in pixels from the plot area to the axis line. A positive offset moves the axis with it's line, - * labels and ticks away from the plot area. This is typically used when two or more axes are displayed on the same - * side of the plot. - * @default 0 - */ - offset?: number; - /** - * Whether to display the axis on the opposite side of the normal. The normal is on the left side for vertical axes - * and bottom for horizontal, so the opposite sides will be right and top respectively. This is typically used with - * dual or multiple axes. - * @default false - */ - opposite?: boolean; - /** - * An array of colored bands stretching across the plot area marking an interval on the axis. - * - * In a gauge, a plot band on the Y axis (value axis) will stretch along the perimeter of the gauge. - */ - plotBands?: PlotBands[]; - /** - * An array of lines stretching across the plot area, marking a specific value on one of the axes. - */ - plotLines?: PlotLines[]; - /** - * Whether to reverse the axis so that the highest number is closest to the origin. If the chart is inverted, the x - * axis is reversed by default. - * @default false - */ - reversed?: boolean; - /** - * If true, the first series in a stack will be drawn on top in a positive, non-reversed Y axis. If false, the first series is in the base of the stack. - * Only used for yAxis - * @default true - * @since 3.0.10 - */ - reversedStacks?: boolean; - /** - * Whether to show the axis line and title when the axis has no data. - * @default true - * @since 1.1 - */ - showEmpty?: boolean; - /** - * Whether to show the first tick label. - * @default true - */ - showFirstLabel?: boolean; - /** - * Whether to show the last tick label. - * @default true - */ - showLastLabel?: boolean; - /** - * Show the total value for each bar in a stacked column or bar chart. - * The label will be placed on top of positive columns and below negative columns. - * In case of an inverted column chart or a bar chart the label is placed to the right of positive bars and to the left of negative bars. - * Only used for yAxis - */ - stackLabels?: { - /** - * Defines the horizontal alignment of the stack total label. Can be one of "left", "center" or "right". - * @default calculated at runtime and depends on orientation and whether the stack is positive or negative. - * @since 2.1.5 - */ - align?: string; - /** - * Enable or disable the stack total labels. - * @default false - * @since 2.1.5 - */ - enabled?: boolean; - /** - * A format string for the data label. Available variables are the same as for formatter. - * @default {total} - * @since 3.0.2 - */ - format?: string; - /** - * Callback JavaScript function to format the label. The value is given by this.total. - * @default function() { return this.total; } - * @since 2.1.5 - */ - formatter?: Function; - /** - * Rotation of the labels in degrees. - * @default 0 - * @since 2.1.5 - */ - rotation?: number; - /** - * CSS styles for the label. - * @default { "color": "#000000", "fontSize": "11px", "fontWeight": "bold", "textShadow": "0 0 6px contrast, 00 3px contrast" } - * @since 2.1.5 - */ - style?: CSSObject; - /** - * The text alignment for the label. - * While align determines where the texts anchor point is placed with regards to the stack, textAlign determines how the text is aligned against its anchor point. - * Possible values are "left", "center" and "right". - * @default calculated at runtime and depends on orientation and whether the stack is positive or negative. - * @since 2.1.5 - */ - textAlign?: string; - /** - * Whether to use HTML to render the labels. - * @default false - * @since 3.0 - */ - useHTML?: boolean; - /** - * Defines the vertical alignment of the stack total label. Can be one of "top", "middle" or "bottom". - * @default calculated at runtime and depends on orientation and whether the stack is positive or negative. - * @since 2.1.5 - */ - verticalAlign?: string; - /** - * The x position offset of the label relative to the left of the stacked bar. - * @default calculated at runtime and depends on orientation and whether the stack is positive or negative. - * @since 2.1.5 - */ - x?: number; - /** - * The y position offset of the label relative to the tick position on the axis. - * @default calculated at runtime and depends on orientation and whether the stack is positive or negative. - * @since 2.1.5 - */ - y?: number; - } - /** - * For datetime axes, this decides where to put the tick between weeks. 0 = Sunday, 1 = Monday. - * @default 1 - */ - startOfWeek?: number; - /** - * Whether to force the axis to start on a tick. Use this option with the minPadding option to control the axis - * start. - * @default false - * @since 1.2.0 - */ - startOnTick?: boolean; - /** - * Solid gauge series only. Color stops for the solid gauge. - * Use this in cases where a linear gradient between a minColor and maxColor is not sufficient. - * The stops is an array of tuples, where the first item is a float between 0 and 1 assigning the relative position in the gradient, and the second item is the color. - */ - stops?: [number, string][]; - /** - * The amount of ticks to draw on the axis. This opens up for aligning the ticks of multiple charts or panes within - * a chart. This option overrides the tickPixelInterval option. - * - * This option only has an effect on linear axes. Datetime, logarithmic or category axes are not affected. - */ - tickAmount?: number; - /** - * Color for the main tick marks. - * @default '#C0D0E0' - */ - tickColor?: string; - /** - * The interval of the tick marks in axis units. When null, the tick interval is computed to approximately follow - * the tickPixelInterval on linear and datetime axes. On categorized axes, a null tickInterval will default to 1, - * one category. Note that datetime axes are based on milliseconds, so for example an interval of one day is - * expressed as 24 * 3600 * 1000. - * - * On logarithmic axes, the tickInterval is based on powers, so a tickInterval of 1 means one tick on each of 0.1, - * 1, 10, 100 etc. A tickInterval of 2 means a tick of 0.1, 10, 1000 etc. A tickInterval of 0.2 puts a tick on 0.1, - * 0.2, 0.4, 0.6, 0.8, 1, 2, 4, 6, 8, 10, 20, 40 etc. - * - * If the tickInterval is too dense for labels to be drawn, Highcharts may remove ticks. - */ - tickInterval?: number; - /** - * The pixel length of the main tick marks. - * @default 10 - */ - tickLength?: number; - /** - * If tickInterval is null this option sets the approximate pixel interval of the tick marks. Not applicable to - * categorized axis. - * - * @default 72 for the Y axis, 100 for the X axis. - */ - tickPixelInterval?: number; - /** - * The position of the major tick marks relative to the axis line. Can be one of 'inside' and 'outside'. - * @default 'outside' - */ - tickPosition?: string; - /** - * A callback function returning array defining where the ticks are laid out on the axis. This overrides the default - * behaviour of tickPixelInterval and tickInterval. The automatic tick positions are accessible through - * this.tickPositions and can be modified by the callback. - */ - tickPositioner?: (min: number, max: number) => void; - /** - * An array defining where the ticks are laid out on the axis. This overrides the default behaviour of - * tickPixelInterval and tickInterval. - */ - tickPositions?: number[]; - /** - * The pixel width of the major tick marks. - * @default 1 - */ - tickWidth?: number; - /** - * For categorized axes only. If 'on' the tick mark is placed in the center of the category, if 'between' the tick - * mark is placed between categories. The default is 'between' if the tickInterval is 1, else 'on'. - * @default null - */ - tickmarkPlacement?: string; - /** - * The axis title, showing next to the axis line. - */ - title?: AxisTitle; - /** - * The type of axis. Can be one of 'linear', 'logarithmic', 'datetime' or 'category'. In a datetime axis, the - * numbers are given in milliseconds, and tick marks are placed on appropriate values like full hours or days. In a - * category axis, the point names of the chart's series are used for categories, if not a categories array is - * defined. - * @default 'linear' - */ - type?: string; - /** - * Datetime axis only. An array determining what time intervals the ticks are allowed to fall on. Each array item is - * an array where the first value is the time unit and the second value another array of allowed multiples. - */ - units?: [[string, [number]]]; - /** - * Whether axis, including axis title, line, ticks and labels, should be visible. - * @default true - * @since 4.1.9 - */ - visible?: boolean; - } - - interface ColorAxisDataClass { - from?: number; - to?: number; - color?: string | Gradient; - name?: string; - } - - /** - * A color axis for choropleth mapping. Visually, the color axis will appear as a gradient or as separate items inside - * the legend, depending on whether the axis is scalar or based on data classes. - * - * For supported color formats, see the docs article about colors. - * - * A scalar color axis is represented by a gradient. The colors either range between the minColor and the maxColor, or - * for more fine grained control the colors can be defined in stops. Often times, the color axis needs to be adjusted to - * get the right color spread for the data. In addition to stops, consider using a logarithmic axis type, or setting min - * and max to avoid the colors being determined by outliers. - * - * When dataClasses are used, the ranges are subdivided into separate classes like categories based on their values. - * This can be used for ranges between two values, but also for a true category. However, when your data is categorized, - * it may be as convenient to add each category to a separate series. - * - * See the Axis object for programmatic access to the axis. - */ - interface ColorAxisOptions { - /** - * Determines how to set each data class' color if no individual color is set. The default value, tween, computes - * intermediate colors between minColor and maxColor. The other possible value, category, pulls colors from the - * global or chart specific colors array. - * @default 'tween' - */ - dataClassColor?: string; - /** - * An array of data classes or ranges for the choropleth map. If none given, the color axis is scalar and values are - * distributed as a gradient between the minimum and maximum colors. - */ - dataClasses?: ColorAxisDataClass[]; - /** - * Whether to force the axis to end on a tick. Use this option with the maxPadding option to control the axis end. - * @default true - */ - endOnTick?: boolean; - events?: { - /** - * As opposed to the setExtremes event, this event fires after the final min and max values are computed and - * corrected for minRange. - * The this keyword refers to the {@link AxisObject|Axis} object. - */ - afterSetExtremes?: (event: AxisEvent) => void; - /** - * Fires when the minimum and maximum is set for the axis, either by calling the .setExtremes() method or by - * selecting an area in the chart. One parameter, event, is passed to the function. This contains common event - * information based on jQuery or MooTools depending on which library is used as the base for Highcharts. - * - * The new user set minimum and maximum values can be found by event.min and event.max. When an axis is zoomed - * all the way out from the 'Reset zoom' button, event.min and event.max are null, and the new extremes are set - * based on this.dataMin and this.dataMax. - * - * The this keyword refers to the {@link AxisObject|Axis} object. - */ - setExtremes?: (event: AxisEvent) => void; - }; - /** - * Color of the grid lines extending from the axis across the gradient. - * @default '#C0C0C0' - */ - gridLineColor?: string; - /** - * The dash or dot style of the grid lines. - * @default 'Solid' - */ - gridLineDashStyle?: string; - /** - * The width of the grid lines extending from the axis across the gradient of a scalar color axis. - * @default 1 - */ - gridLineWidth?: number; - /** - * An id for the axis. This can be used after render time to get a pointer to the axis object through chart.get(). - */ - id?: string; - /** - * The axis labels show the number for each tick. - */ - labels?: AxisLabels; - /** - * The color of the line marking the axis itself. - * @default '#C0D0E0' - */ - lineColor?: string | Gradient; - /** - * The width of the line marking the axis itself. - * @default 0 - */ - lineWidth?: number; - /** - * The triangular marker on a scalar color axis that points to the value of the hovered area. To disable the marker, - * set marker: null. - */ - marker?: { - /** - * Animation for the marker as it moves between values. Set to false to disable animation. - * @default {duration: 50} - */ - animation?: boolean | Animation; - /** - * The color of the marker. - * @default 'gray' - */ - color?: string | Gradient; - }; - /** - * The maximum value of the axis in terms of map point values. If null, the max value is automatically calculated. - * If the endOnTick option is true, the max value might be rounded up. - */ - max?: number; - /** - * The color to represent the maximum of the color axis. Unless dataClasses or stops are set, the gradient ends at - * this value. - * - * If dataClasses are set, the color is based on minColor and maxColor unless a color is set for each data class, or - * the dataClassColor is set. - * @default '#102D4C' - */ - maxColor?: string; - /** - * Padding of the max value relative to the length of the axis. A padding of 0.05 will make a 100px axis 5px longer. - * @default 0.05 - */ - maxPadding?: number; - /** - * The minimum value of the axis in terms of map point values. If null, the min value is automatically calculated. - * If the startOnTick option is true, the min value might be rounded down. - */ - min?: number; - /** - * The color to represent the minimum of the color axis. Unless dataClasses or stops are set, the gradient starts at - * this value. - * - * If dataClasses are set, the color is based on minColor and maxColor unless a color is set for each data class, or - * the dataClassColor is set. - * @default '#EFEFFF' - */ - minColor?: string; - /** - * Padding of the min value relative to the length of the axis. A padding of 0.05 will make a 100px axis 5px longer. - * @default 0.05 - */ - minPadding?: number; - /** - * Color of the minor, secondary grid lines. - * @default '#E0E0E0' - */ - minorGridLineColor?: string; - /** - * The dash or dot style of the minor grid lines. - * @default 'Solid' - */ - minorGridLineDashStyle?: string; - /** - * Width of the minor, secondary grid lines. - * @default 1 - */ - minorGridLineWidth?: number; - /** - * Color for the minor tick marks. - * @default '#A0A0A0' - */ - minorTickColor?: string; - /** - * Tick interval in scale units for the minor ticks. On a linear axis, if 'auto', the minor tick interval is - * calculated as a fifth of the tickInterval. If null, minor ticks are not shown. - * - * On logarithmic axes, the unit is the power of the value. For example, setting the minorTickInterval to 1 puts one - * tick on each of 0.1, 1, 10, 100 etc. Setting the minorTickInterval to 0.1 produces 9 ticks between 1 and 10, 10 - * and 100 etc. A minorTickInterval of 'auto' on a log axis results in a best guess, attempting to enter - * approximately 5 minor ticks between each major tick. - * - * If user settings dictate minor ticks to become too dense, they don't make sense, and will be ignored to prevent - * performance problems. - */ - minorTickInterval?: string | number; - /** - * The pixel length of the minor tick marks. - * @default 2 - */ - minorTickLength?: number; - /** - * The position of the minor tick marks relative to the axis line. Can be one of inside and outside. - * @default 'outside' - */ - minorTickPosition?: string; - /** - * The pixel width of the minor tick mark - * @default 0 - */ - minorTickWidth?: number; - /** - * Whether to reverse the axis so that the highest number is closest to the origin. Defaults to false in a - * horizontal legend and true in a vertical legend, where the smallest value starts on top. - */ - reversed?: boolean; - /** - * If labels are enabled, whether to show the first tick label. - * @default true - */ - showFirstLabel?: boolean; - /** - * If labels are enabled, whether to show the last tick label. - * @default true - */ - showLastLabel?: boolean; - /** - * Whether to force the axis to start on a tick. Use this option with the maxPadding option to control the axis - * start. - * @default true - */ - startOnTick?: boolean; - /** - * Color stops for the gradient of a scalar color axis. Use this in cases where a linear gradient between a minColor - * and maxColor is not sufficient. The stops is an array of tuples, where the first item is a float between 0 and 1 - * assigning the relative position in the gradient, and the second item is the color. - */ - stops?: [number, string][]; - /** - * Color for the main tick marks. - * @default '#C0D0E0' - */ - tickColor?: string; - /** - * The interval of the tick marks in axis units. When null, the tick interval is computed to approximately follow - * the tickPixelInterval. - */ - tickInterval?: number; - /** - * The pixel length of the main tick marks. - * @default 10 - */ - tickLength?: number; - /** - * If tickInterval is null this option sets the approximate pixel interval of the tick marks. - * @default 72 - */ - tickPixelInterval?: number; - /** - * The position of the major tick marks relative to the axis line. Can be one of 'inside' and 'outside'. - * @default 'outside' - */ - tickPosition?: string; - /** - * A callback function returning array defining where the ticks are laid out on the axis. This overrides the default - * behaviour of tickPixelInterval and tickInterval. - */ - tickPositioner?: (min: number, max: number) => void; - /** - * An array defining where the ticks are laid out on the axis. This overrides the default behaviour of - * tickPixelInterval and tickInterval. - */ - tickPositions?: number[]; - /** - * The pixel width of the major tick marks. - * @default 0 - */ - tickWidth?: number; - /** - * The type of interpolation to use for the color axis. Can be 'linear' or 'logarithmic'. - * @default 'linear' - */ - type?: string; - } - - interface Extremes { - /** - * The maximum value of the axis' associated series. - */ - dataMax: number; - /** - * The minimum value of the axis' associated series. - */ - dataMin: number; - /** - * The maximum axis value, either automatic or set manually. If the max option is not set and maxPadding is 0, this - * value will be the same as dataMax. - */ - max: number; - /** - * The minimum axis value, either automatic or set manually. If the min option is not set and minPadding is 0, this - * value will be the same as dataMin. - */ - min: number; - } - - interface Animation { - /** - * The duration of the animation in milliseconds. - */ - duration?: number; - /** - * When using jQuery as the general framework, the easing can be set to linear or swing. More easing functions are - * available with the use of jQuery plug-ins, most notably the jQuery UI suite. See the - * {@link http://api.jquery.com/animate/|jQuery docs}. When using MooTools as the general framework, use the - * property name transition instead of easing. - */ - easing?: string; - } - - interface AddSeriesEvent extends Event { - /** - * The series options that was passed to the addSeries method. - */ - options: ChartOptions; - } - - interface AxisValueOptions extends AxisOptions { - /** - * The axis value at the clicked spot - */ - value: number; - } - - interface ChartClickEvent extends Event { - /** - * Array containing the axes of each dimension and each axis' value at the clicked spot - */ - xAxis: AxisValueOptions[]; - /** - * Array containing the axes of each dimension and each axis' value at the clicked spot - */ - yAxis: AxisValueOptions[]; - } - - interface ChartDrilldownEvent extends Event { - /** - * If a category label was clicked, which index. - */ - category?: number; - /** - * The originating point. - */ - point?: PointObject; - /** - * If a category label was clicked, this array holds all points corresponing to the category. - */ - points?: PointObject[]; - /** - * Options for the new series. - */ - seriesOptions?: IndividualSeriesOptions; - } - - interface ChartSelectionEvent extends Event { - /** - * Array containing the axes of each dimension and each axis' min and max values - */ - xAxis: AxisOptions[]; - /** - * Array containing the axes of each dimension and each axis' min and max values - */ - yAxis: AxisOptions[]; - } - - interface ChartEvents { - /** - * Fires when a series is added to the chart after load time, using the addSeries method. One parameter, event, is - * passed to the function. This contains common event information based on jQuery or MooTools depending on which - * library is used as the base for Highcharts. Through event.options you can access the series options that was - * passed to the addSeries method. Returning false prevents the series from being added. - * - * The this keyword refers to the Chart object. - * @since 1.2.0 - */ - addSeries?: (event: AddSeriesEvent) => boolean | void; - /** - * Fires after a chart is printed through the context menu item or the Chart.print method. Requires the exporting - * module. - * @since 4.1.0 - */ - afterPrint?: (event: Event) => void; - /** - * Fires before a chart is printed through the context menu item or the Chart.print method. Requires the exporting - * module. - * @since 4.1.0 - */ - beforePrint?: (event: Event) => void; - /** - * Fires when clicking on the plot background. One parameter, event, is passed to the function. This contains common - * event information based on jQuery or MooTools depending on which library is used as the base for Highcharts. - * - * Information on the clicked spot can be found through event.xAxis and event.yAxis, which are arrays containing the - * axes of each dimension and each axis' value at the clicked spot. The primary axes are event.xAxis[0] and - * event.yAxis[0]. Remember the unit of a datetime axis is milliseconds since 1970-01-01 00:00:00. - * - * click: function(e) { - * console.log(Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', e.xAxis[0].value), e.yAxis[0].value); - * } - * - * The this keyword refers to the Chart object. - * @since 1.2.0 - */ - click?: (event: ChartClickEvent) => void; - /** - * Fires when a drilldown point is clicked, before the new series is added. - * @since 3.0.8 - */ - drilldown?: (event: ChartDrilldownEvent) => void; - /** - * Fires when drilling up from a drilldown series. - * @since 3.0.8 - */ - drillup?: (event: Event) => void; - /** - * Fires when the chart is finished loading. One parameter, event, is passed to the function. This contains common - * event information based on jQuery or MooTools depending on which library is used as the base for Highcharts. - * - * From version 2.0.4, there is also a second parameter to Highcharts.Chart where a callback function can be passed - * to be executed on chart.load. - * - * The this keyword refers to the Chart object. - */ - load?: (event: Event) => void; - /** - * Fires when the chart is redrawn, either after a call to chart.redraw() or after an axis, series or point is - * modified with the redraw option set to true. One parameter, event, is passed to the function. This contains - * common event information based on jQuery or MooTools depending on which library is used as the base for - * Highcharts. - * - * The this keyword refers to the Chart object. - * @since 1.2.0 - */ - redraw?: (event: Event) => void; - /** - * Fires when an area of the chart has been selected. Selection is enabled by setting the chart's zoomType. One - * parameter, event, is passed to the function. This contains common event information based on jQuery or MooTools - * depending on which library is used as the base for Highcharts. The default action for the selection event is to - * zoom the chart to the selected area. It can be prevented by calling event.preventDefault(). - * - * Information on the selected area can be found through event.xAxis and event.yAxis, which are arrays containing - * the axes of each dimension and each axis' min and max values. The primary axes are event.xAxis[0] and - * event.yAxis[0]. Remember the unit of a datetime axis is milliseconds since 1970-01-01 00:00:00. - * - * selection: function(event) { - * // log the min and max of the primary, datetime x-axis - * console.log( - * Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', event.xAxis[0].min), - * Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', event.xAxis[0].max) - * ); - * // log the min and max of the y axis - * console.log(event.yAxis[0].min, event.yAxis[0].max); - * } - */ - selection?: (event: ChartSelectionEvent) => void; - } - - interface LinearGradient { - x1: number; - y1: number; - x2: number; - y2: number; - } - - interface Gradient { - linearGradient?: LinearGradient | number[]; - radialGradient?: { - cx: number; cy: number; r: number; - }; - stops?: any[][]; - /** - * Brighten the color - * @param {number} alpha - */ - brighten?(alpha: number): Gradient; - /** - * Return the color a specified format - * @param {string} format - */ - get?(format: string): string; - /** - * The raw input - */ - raw?: string; - /** - * rgba array - */ - rgba?: number[]; - /** - * Set the color's opacity to a given alpha value - * @param {number} alpha - * @return {Gradient} - */ - setOpacity?(alpha: number): Gradient; - } - - /** - * Type equivalent to the 'Color' type mentioned throughout the documentation. - */ - type Color = string | Gradient; - - interface ChartOptions3dFrame { - /** - * The color of the panel. - * @default 'transparent' - * @since 4.0 - */ - color?: string | Gradient; - /** - * Thickness of the panel. - * @default 1 - * @since 4.0 - */ - size?: number; - } - - interface ChartOptions3d { - /** - * One of the two rotation angles for the chart. - * @default 0 - * @since 4.0 - */ - alpha?: number; - /** - * One of the two rotation angles for the chart. - * @default 0 - * @since 4.0 - */ - beta?: number; - /** - * The total depth of the chart. - * @default 100 - * @since 4.0 - */ - depth?: number; - /** - * Wether to render the chart using the 3D functionality. - * @default false - * @since 4.0 - */ - enabled?: boolean; - /** - * Provides the option to draw a frame around the charts by defining a bottom, front and back panel. - */ - frame?: { - /** - * Defines the back panel of the frame around 3D charts. - * @since 4.0 - */ - back?: ChartOptions3dFrame; - /** - * The bottom of the frame around a 3D chart. - * @since 4.0 - */ - bottom?: ChartOptions3dFrame; - /** - * The side for the frame around a 3D chart. - * @since 4.0 - */ - side?: ChartOptions3dFrame; - }; - /** - * Defines the distance the viewer is standing in front of the chart, this setting is important to calculate the - * perspective effect in column and scatter charts. It is not used for 3D pie charts. - * @default 100 - * @since 4.0 - */ - viewDistance?: number; - } - - interface Shadow { - /** - * @default 'black' - */ - color?: string | Gradient; - /** - * @default 1 - */ - offsetX?: number; - /** - * @default 1 - */ - offsetY?: number; - /** - * @default 0.15 / width - */ - opacity?: number; - /** - * @default 3 - */ - width?: number; - } - - interface ChartResetZoomButton { - /** - * The position of the button. This is an object that can hold the properties align, verticalAlign, x and y. - * @since 2.2 - */ - position?: Position; - /** - * What frame the button should be placed related to. Can be either 'plot' or 'chart'. - * @default 'plot' - * @since 2.2 - */ - relativeTo?: string; - /** - * A collection of attributes for the button. The object takes SVG attributes like fill, stroke, stroke-width or r, - * the border radius. The theme also supports style, a collection of CSS properties for the text. Equivalent - * attributes for the hover state are given in theme.states.hover. - * @since 2.2 - */ - theme?: ButtonStatesTheme; - } - - interface ButtonTheme { - display?: string; // css attr eg: 'none' - /** - * The button fill color, SVG color definition - */ - fill?: string | Gradient; - /** - * The button stroke color, SVG color definition - */ - stroke?: string; - /** - * The button stroke width - * @type {[type]} - */ - 'stroke-width'?: number; - /** - * The border radius - */ - r?: number; - /** - * CSS style - */ - style?: Object; - } - - interface ButtonStatesTheme extends ButtonTheme { - /** - * Themed button states. Only hover is supported for reset zoom button. - */ - states?: { - /** - * Attributes and styles applied when hovering. - */ - hover?: ButtonTheme; - /** - * Attributes and styles applied when button is selected (tri-state). - */ - select?: ButtonTheme; - }; - } - - interface ChartOptions { - /** - * When using multiple axis, the ticks of two or more opposite axes will automatically be aligned by adding ticks to - * the axis or axes with the least ticks. This can be prevented by setting alignTicks to false. If the grid lines - * look messy, it's a good idea to hide them for the secondary axis by setting gridLineWidth to 0. - * @default true - */ - alignTicks?: boolean; - /** - * Set the overall animation for all chart updating. Animation can be disabled throughout the chart by setting it to - * false here. It can be overridden for each individual API method as a function parameter. The only animation not - * affected by this option is the initial series animation, see plotOptions.series.animation. - * - * The animation can either be set as a boolean or a configuration object. If true, it will use the 'swing' jQuery - * easing and a duration of 500 ms. - * - * @default true - */ - animation?: boolean | Animation; - /** - * The background color or gradient for the outer chart area. - * @default '#FFFFFF' - */ - backgroundColor?: string | Gradient; - /** - * The color of the outer chart border. - * @default '#4572A7' - */ - borderColor?: string | Gradient; - /** - * The corner radius of the outer chart border. - * @default 0 - */ - borderRadius?: number; - /** - * The pixel width of the outer chart border. - * @default 0 - */ - borderWidth?: number; - /** - * A CSS class name to apply to the charts container div, allowing unique CSS styling for each chart. - */ - className?: string; - /** - * Alias of type. Defaults to line. - * @default 'line' - * @deprecated - */ - defaultSeriesType?: string; - /** - * Event listeners for the chart. - */ - events?: ChartEvents; - /** - * An explicit height for the chart. By default the height is calculated from the offset height of the containing - * element, or 400 pixels if the containing element's height is 0. - */ - height?: number; - /** - * If true, the axes will scale to the remaining visible series once one series is hidden. If false, hiding and - * showing a series will not affect the axes or the other series. For stacks, once one series within the stack is - * hidden, the rest of the stack will close in around it even if the axis is not affected. - * @default true - * @since 1.2.0 - */ - ignoreHiddenSeries?: boolean; - /** - * Whether to invert the axes so that the x axis is vertical and y axis is horizontal. When true, the x axis is - * reversed by default. If a bar series is present in the chart, it will be inverted automatically. - * @default false - */ - inverted?: boolean; - /** - * The margin between the outer edge of the chart and the plot area. The numbers in the array designate top, right, - * bottom and left respectively. Use the options marginTop, marginRight, marginBottom and marginLeft for shorthand - * setting of one option. - * - * Since version 2.1, the margin is 0 by default. The actual space is dynamically calculated from the offset of axis - * labels, axis title, title, subtitle and legend in addition to the spacingTop, spacingRight, spacingBottom and - * spacingLeft options. - */ - margin?: number | number[]; - /** - * The margin between the bottom outer edge of the chart and the plot area. Use this to set a fixed pixel value for - * the margin as opposed to the default dynamic margin. See also spacingBottom. - * @since 2.0 - */ - marginBottom?: number; - /** - * The margin between the left outer edge of the chart and the plot area. Use this to set a fixed pixel value for - * the margin as opposed to the default dynamic margin. See also spacingLeft. - * @since 2.0 - */ - marginLeft?: number; - /** - * The margin between the right outer edge of the chart and the plot area. Use this to set a fixed pixel value for - * the margin as opposed to the default dynamic margin. See also spacingRight. - * @since 2.0 - */ - marginRight?: number; - /** - * The margin between the top outer edge of the chart and the plot area. Use this to set a fixed pixel value for the - * margin as opposed to the default dynamic margin. See also spacingTop. - * @since 2.0 - */ - marginTop?: number; - /** - * Options to render charts in 3 dimensions. This feature requires highcharts-3d.js, found in the download package - * or online at {@link code.highcharts.com/highcharts-3d.js}. - */ - options3d?: ChartOptions3d; - /** - * Allows setting a key to switch between zooming and panning. - * @since 4.0.3 - */ - panKey?: string; - /** - * Allow panning in a chart. Best used with panKey to combine zooming and panning. - * @default false - * @since 4.0.3 - */ - panning?: boolean; - /** - * Equivalent to zoomType, but for multitouch gestures only. By default, the pinchType is the same as the zoomType - * setting. However, pinching can be enabled separately in some cases, for example in stock charts where a mouse - * drag pans the chart, while pinching is enabled. - * @default null - * @since 3.0 - */ - pinchType?: string; - /** - * The background color or gradient for the plot area. - */ - plotBackgroundColor?: string | Gradient; - /** - * The URL for an image to use as the plot background. To set an image as the background for the entire chart, set a - * CSS background image to the container element. Note that for the image to be applied to exported charts, its URL - * needs to be accessible by the export server. - */ - plotBackgroundImage?: string; - /** - * The color of the inner chart or plot area border. - * @default 0 - */ - plotBorderColor?: string; - /** - * The pixel width of the plot area border. - * @default 0 - */ - plotBorderWidth?: number; - /** - * Whether to apply a drop shadow to the plot area. Requires that plotBackgroundColor be set. Since 2.3 the shadow - * can be an object configuration containing color, offsetX, offsetY, opacity and width. - * @default false - */ - plotShadow?: boolean | Shadow; - /** - * When true, cartesian charts like line, spline, area and column are transformed into the polar coordinate system. - * Requires highcharts-more.js. - * @default false - * @since 2.3.0 - */ - polar?: boolean; - /** - * Whether to reflow the chart to fit the width of the container div on resizing the window. - * @default true - * @since 2.1 - */ - reflow?: boolean; - /** - * The HTML element where the chart will be rendered. If it is a string, the element by that id is used. The HTML - * element can also be passed by direct reference. - */ - renderTo?: string | HTMLElement; - /** - * The button that appears after a selection zoom, allowing the user to reset zoom. - */ - resetZoomButton?: ChartResetZoomButton; - /** - * The background color of the marker square when selecting (zooming in on) an area of the chart. - * @default 'rgba(69,114,167,0.25)' - * @since 2.1.7 - */ - selectionMarkerFill?: string; - /** - * Whether to apply a drop shadow to the outer chart area. Requires that backgroundColor be set. Since 2.3 the - * shadow can be an object configuration containing color, offsetX, offsetY, opacity and width. - * @default false - */ - shadow?: boolean | Shadow; - /** - * Whether to show the axes initially. This only applies to empty charts where series are added dynamically, as axes - * are automatically added to cartesian series. - * @default false - * @since 1.2.5 - */ - showAxes?: boolean; - /** - * The distance between the outer edge of the chart and the content, like title, legend, axis title or labels. The - * numbers in the array designate top, right, bottom and left respectively. Use the options spacingTop, - * spacingRight, spacingBottom and spacingLeft options for shorthand setting of one option. - * @default [10, 10, 15, 10] - * @since 3.0.6 - */ - spacing?: number[]; - /** - * The space between the bottom edge of the chart and the content (plot area, axis title and labels, title, subtitle - * or legend in top position). - * @default 15 - * @since 2.1 - */ - spacingBottom?: number; - /** - * The space between the left edge of the chart and the content (plot area, axis title and labels, title, subtitle - * or legend in top position). - * @default 10 - * @since 2.1 - */ - spacingLeft?: number; - /** - * The space between the right edge of the chart and the content (plot area, axis title and labels, title, subtitle - * or legend in top position). - * @default 10 - * @since 2.1 - */ - spacingRight?: number; - /** - * The space between the top edge of the chart and the content (plot area, axis title and labels, title, subtitle or - * legend in top position). - * @default 10 - * @since 2.1 - */ - spacingTop?: number; - /** - * Additional CSS styles to apply inline to the container div. Note that since the default font styles are applied - * in the renderer, it is ignorant of the individual chart options and must be set globally. - */ - style?: CSSObject; - /** - * The default series type for the chart. Can be any of the chart types listed under plotOptions. - * @default 'line' - * @since 2.1.0 - */ - type?: string; - /** - * An explicit width for the chart. By default the width is calculated from the offset width of the containing - * element. - */ - width?: number; - /** - * Decides in what dimensions the user can zoom by dragging the mouse. Can be one of x, y or xy. - */ - zoomType?: string; - } - - interface CSSObject { - background?: string; - border?: string; - color?: string | Gradient; - cursor?: string; - font?: string; - fontFamily?: string; - fontSize?: string; - fontWeight?: string; - left?: string; - opacity?: number; - padding?: string | number; - position?: string; - top?: string; - textShadow?: string; - } - - interface CreditsOptions { - /** - * Whether to show the credits text. - * @default true - */ - enabled?: boolean; - /** - * The URL for the credits label. - * @default 'http://www.highcharts.com' - */ - href?: string; - /** - * Position configuration for the credits label. Supported properties are align, verticalAlign, x and y. - */ - position?: Position; - /** - * CSS styles for the credits label. - */ - style?: Object; - /** - * The text for the credits label. - * @default 'Highcharts.com' - */ - text?: string; - } - - interface DataSeriesMapping { - [pointPropertyName: string]: number; - } - - /** - * The Data module provides a simplified interface for adding data to a chart from sources like CVS, HTML tables or grid - * views. See also the tutorial article on the Data module. - * - * It requires the modules/data.js file to be loaded. - * - * Please note that the default way of adding data in Highcharts, without the need of a module, is through the - * series.data option. - */ - interface DataOptions { - /** - * A two-dimensional array representing the input data on tabular form. This input can be used when the data is - * already parsed, for example from a grid view component. Each cell can be a string or number. If not - * switchRowsAndColumns is set, the columns are interpreted as series. - * @since 4.0 - */ - columns?: [string | number][]; - /** - * The callback that is evaluated when the data is finished loading, optionally from an external source, and parsed. - * The first argument passed is a finished chart options object, containing the series. These options can be - * extended with additional options and passed directly to the chart constructor. - * @since 4.0 - */ - complete?: (options: Options) => void; - /** - * A comma delimited string to be parsed. Related options are startRow, endRow, startColumn and endColumn to delimit - * what part of the table is used. The lineDelimiter and itemDelimiter options define the CSV delimiter formats. - * @since 4.0 - */ - csv?: string; - /** - * Which of the predefined date formats in Date.prototype.dateFormats to use to parse date values. Defaults to a - * best guess based on what format gives valid and ordered dates. - * - * Valid options include: - * 'YYYY-mm-dd' - * 'dd/mm/YYYY' - * 'mm/dd/YYYY' - * 'dd/mm/YY' - * 'mm/dd/YY' - * @since 4.0 - */ - dateFormat?: string; - /** - * The decimal point used for parsing numbers in the CSV. - * @default '.' - */ - decimalPoint?: string; - /** - * In tabular input data, the last column (indexed by 0) to use. Defaults to the last column containing data. - * @since 4.0 - */ - endColumn?: number; - /** - * In tabular input data, the last row (indexed by 0) to use. Defaults to the last row containing data. - * @since 4.0.4 - */ - endRow?: number; - /** - * Whether to use the first row in the data set as series names. - * @default true - * @since 4.1.0 - */ - firstRowAsNames?: boolean; - /** - * The key for a Google Spreadsheet to load. See {@link https://developers.google.com/gdata/samples/spreadsheet_sample|general information on GS}. - * @since 4.0 - */ - googleSpreadsheetKey?: string; - /** - * The Google Spreadsheet worksheet to use in combination with googleSpreadsheetKey. The available id's from your - * sheet can be read from https://spreadsheets.google.com/feeds/worksheets/{key}/public/basic - * @since 4.0 - */ - googleSpreadsheetWorksheet?: string; - /** - * Item or cell delimiter for parsing CSV. Defaults to the tab character \t if a tab character is found in the CSV - * string, if not it defaults to ,. - * @since 4.0 - */ - itemDelimiter?: string; - /** - * Line delimiter for parsing CSV. - * @default '\n' - * @since 4.0 - */ - lineDelimiter?: string; - /** - * A callback function to parse string representations of dates into JavaScript timestamps. Should return an integer - * timestamp on success. - * @since 4.0 - */ - parseDate?: (val: any) => number; - /** - * A callback function to access the parsed columns, the two-dimentional input data array directly, before they are - * interpreted into series data and categories. Return false to stop completion, or call this.complete() to continue - * async. - * @since 4.0 - */ - parsed?: (columns: [string | number][]) => boolean | void; - /** - * The same as the columns input option, but defining rows intead of columns. - * @since 4.0 - */ - rows?: [string | number][]; - /** - * An array containing object with Point property names along with what column id the property should be taken from. - * @since 4.0.4 - */ - seriesMapping?: DataSeriesMapping[]; - /** - * In tabular input data, the first column (indexed by 0) to use. - * @default 0 - * @since 4.0 - */ - startColumn?: number; - /** - * In tabular input data, the first row (indexed by 0) to use. - * @default 0 - * @since 4.0 - */ - startRow?: number; - /** - * Switch rows and columns of the input data, so that this.columns effectively becomes the rows of the data set, and - * the rows are interpreted as series. - * @default false - * @since 4.0 - */ - switchRowsAndColumns?: boolean; - /** - * A HTML table or the id of such to be parsed as input data. Related options are startRow, endRow, startColumn and - * endColumn to delimit what part of the table is used. - */ - table?: string | HTMLElement; - } - - /** - * Options for drill down, the concept of inspecting increasingly high resolution data through clicking on chart items - * like columns or pie slices. - * - * The drilldown feature requires the drilldown.js file to be loaded, found in the modules directory of the download - * package, or online at code.highcharts.com/modules/drilldown.js. - */ - interface DrilldownOptions { - /** - * Additional styles to apply to the X axis label for a point that has drilldown data. By default it is underlined - * and blue to invite to interaction. - * @default { cursor: 'pointer', color: '#0d233a', fontWeight: 'bold', textDecoration: 'underline' } - * @since 3.0.8 - */ - activeAxisLabelStyle?: Object; - /** - * Additional styles to apply to the data label of a point that has drilldown data. By default it is underlined and - * blue to invite to interaction. - * @default { cursor: 'pointer', color: '#0d233a', fontWeight: 'bold', textDecoration: 'underline' } - * @since 3.0.8 - */ - activeDataLabelStyle?: Object; - /** - * When this option is false, clicking a single point will drill down all points in the same category, equivalent to - * clicking the X axis label. - * @default true - * @since 4.1.7 - */ - allowPointDrilldown?: boolean; - /** - * Set the animation for all drilldown animations. Animation of a drilldown occurs when drilling between a column - * point and a column series, or a pie slice and a full pie series. Drilldown can still be used between series and - * points of different types, but animation will not occur. - * - * The animation can either be set as a boolean or a configuration object. If true, it will use the 'swing' jQuery - * easing and a duration of 500 ms. - * @since 3.0.8 - */ - animation?: boolean | Animation; - /** - * Options for the drill up button that appears when drilling down on a series. The text for the button is defined - * in lang.drillUpText. - */ - drillUpButton?: { - /** - * Positioning options for the button within the relativeTo box. Available properties are x, y, align and - * verticalAlign. - * @since 3.0.8 - */ - position?: Position; - /** - * What box to align the button to. Can be either 'plotBox' or 'spacingBox'. - * @default 'plotBox' - * @since 3.0.8 - */ - relativeTo?: string; - /** - * A collection of attributes for the button. The object takes SVG attributes like fill, stroke, stroke-width or - * r, the border radius. The theme also supports style, a collection of CSS properties for the text. Equivalent - * attributes for the hover state are given in theme.states.hover. - * @since 3.0.8 - */ - theme?: ButtonStatesTheme; - } - /** - * An array of series configurations for the drill down. Each series configuration uses the same syntax as the - * series option set. These drilldown series are hidden by default. The drilldown series is linked to the parent - * series' point by its id. - * @since 3.0.8 - */ - series?: IndividualSeriesOptions[]; - } - - interface MenuItem { - /** - * String to show in the menu item. - */ - text: string; - /** - * Callback function to run on click. - */ - onclick: () => void; - } - - interface Button { - /** - * Alignment for the buttons. - * @default 'right' - * @since 2.0 - */ - align?: string; - /** - * Whether to enable buttons. - * @default true - * @since 2.0 - */ - enabled?: boolean; - /** - * Pixel height of the buttons. - * @default 20 - * @since 2.0 - */ - height?: number; - /** - * Fill color for the symbol within the button. - * @default '#E0E0E0' - * @since 2.0 - */ - symbolFill?: string; - /** - * The pixel size of the symbol on the button. - * @default 14 - * @since 2.0 - */ - symbolSize?: number; - /** - * The color of the symbol's stroke or line. - * @default '#666' - * @since 2.0 - */ - symbolStroke?: string; - /** - * The pixel stroke width of the symbol on the button. - * @default 1 - * @since 2.0 - */ - symbolStrokeWidth?: number; - /** - * The x position of the center of the symbol inside the button. - * @default 12.5 - * @since 2.0 - */ - symbolX?: number; - /** - * The y position of the center of the symbol inside the button. - * @default 10.5 - * @since 2.0 - */ - symbolY?: number; - /** - * A text string to add to the individual button. - * @default null - * @since 3.0 - */ - text?: string; - /** - * A configuration object for the button theme. The object accepts SVG properties like stroke-width, stroke and - * fill. Tri-state button styles are supported by the states.hover and states.select objects. - * @since 3.0 - */ - theme?: ButtonStatesTheme; - /** - * The vertical alignment of the buttons. Can be one of 'top', 'middle' or 'bottom'. - * @default 'top' - * @since 2.0 - */ - verticalAlign?: string; - /** - * The pixel width of the button. - * @default 24 - * @since 2.0 - */ - width?: number; - /** - * The vertical offset of the button's position relative to its verticalAlign. - * @default 0 - * @since 2.0 - */ - y?: number; - } - - interface ExportingContextButton extends Button { - /** - * A collection of config options for the menu items. Each options object consists of a text option which is a - * string to show in the menu item, as well as an onclick parameter which is a callback function to run on click. - * - * By default, there is the 'Print' menu item plus one menu item for each of the available export types. Menu items - * can be customized by defining a new array of items and assigning null to unwanted positions. - * @since 2.0 - */ - menuItems?: MenuItem[]; - /** - * A click handler callback to use on the button directly instead of the popup menu. - * @since 2.0 - */ - onclick?: () => void; - /** - * The symbol for the button. Points to a definition function in the Highcharts.Renderer.symbols collection. The - * default exportIcon function is part of the exporting module. - * @default 'menu' - */ - symbol?: string; - /** - * The horizontal position of the button relative to the align option. - * @default -10 - */ - x?: number; - } - - interface ExportingOptions { - /** - * Experimental setting to allow HTML inside the chart (added through the useHTML options), directly in the exported - * image. This allows you to preserve complicated HTML structures like tables or bi-directional text in exported - * charts. - * - * Disclaimer: The HTML is rendered in a foreignObject tag in the generated SVG. The official export server is based - * on PhantomJS, which supports this, but other SVG clients, like Batik, does not support it. This also applies to - * downloaded SVG that you want to open in a desktop client. - * @default false - * @since 4.1.8 - */ - allowHTML?: boolean; - /** - * Options for the export related buttons, print and export. In addition to the default buttons listed here, custom - * buttons can be added. See navigation.buttonOptions for general options. - */ - buttons?: { - contextButton?: ExportingContextButton; - }; - /** - * Additional chart options to be merged into an exported chart. For example, the exported chart can be given a - * specific width and height, or a printer-friendly color scheme. - * @default null - */ - chartOptions?: Options; - /** - * Whether to enable the exporting module. Disabling the module will hide the context button, but API methods will - * still be available. - * @default true - * @since 2.0 - */ - enabled?: boolean; - /** - * Function to call if the offline-exporting module fails to export a chart on the client side, and - * fallbackToExportServer is disabled. If left undefined, an exception is thrown instead. - * @default undefined - * @since 5.0.0 - */ - error?: Function; - /** - * Whether or not to fall back to the export server if the offline-exporting module is unable to export the chart on - * the client side. - * @default true - * @since 4.1.8 - */ - fallbackToExportServer?: boolean; - /** - * The filename, without extension, to use for the exported chart. - * @default 'chart' - * @since 2.0 - */ - filename?: string; - /** - * An object containing additional attributes for the POST form that sends the SVG to the export server. For - * example, a target can be set to make sure the generated image is received in another frame, or a custom enctype - * or encoding can be set. - * @since 3.0.8 - */ - formAttributes?: any; - /** - * Path where Highcharts will look for export module dependencies to load on demand if they don't already exist on - * window. Should currently point to location of CanVG library (https://github.com/canvg/canvg) and RGBColor.js, - * required for client side export in certain browsers. - * @default 'http://code.highcharts.com/{version}/lib' - * @since 5.0.0 - */ - libUrl?: string; - /** - * When printing the chart from the menu item in the burger menu, if the on-screen chart exceeds this width, it is - * resized. After printing or cancelled, it is restored. The default width makes the chart fit into typical paper - * format. Note that this does not affect the chart when printing the web page as a whole. - * @default 780 - * @since 4.2.5 - */ - printMaxWidth?: number; - /** - * Defines the scale or zoom factor for the exported image compared to the on-screen display. While for instance a - * 600px wide chart may look good on a website, it will look bad in print. The default scale of 2 makes this chart - * export to a 1200px PNG or JPG. - * @default 2 - * @since 3.0 - */ - scale?: number; - /** - * The height of the original chart when exported, unless an explicit chart.height is set. The height exported - * raster image is then multiplied by scale. - * @since 3.0 - */ - sourceHeight?: number; - /** - * The width of the original chart when exported, unless an explicit chart.width is set. The width exported - * raster image is then multiplied by scale. - * @since 3.0 - */ - sourceWidth?: number; - /** - * Default MIME type for exporting if chart.exportChart() is called without specifying a type option. Possible - * values are image/png, image/jpeg, application/pdf and image/svg+xml. - * @default 'image/png' - * @since 2.0 - */ - type?: string; - /** - * The URL for the server module converting the SVG string to an image format. By default this points to Highslide - * Software's free web service. - * @default 'http://export.highcharts.com' - * @since 2.0 - */ - url?: string; - /** - * The pixel width of charts exported to PNG or JPG. As of Highcharts 3.0, the default pixel width is a function of - * the chart.width or exporting.sourceWidth and the exporting.scale. - * @since 2.0 - */ - width?: number; - } - - /** - * Global options that don't apply to each chart. These options, like the lang options, must be set using the - * Highcharts.setOptions method. - */ - interface GlobalObject { - /** - * A custom Date class for advanced date handling. For example, JDate can be hooked in to handle Jalali dates. - * @since 4.0.4 - */ - Date?: any; - /** - * Path to the pattern image required by VML browsers in order to draw radial gradients. - * @default 'http://code.highcharts.com/{version}/gfx/vml-radial-gradient.png' - * @since 2.3.0 - */ - VMLRadialGradientURL?: string; - /** - * The URL to the additional file to lazy load for Android 2.x devices. These devices don't support SVG, so we - * download a helper file that contains canvg, its dependency rbcolor, and our own CanVG Renderer class. To avoid - * hotlinking to our site, you can install canvas-tools.js on your own server and change this option accordingly. - * @default 'http://code.highcharts.com/{version}/modules/canvas-tools.js' - */ - canvasToolsURL?: string; - /** - * A callback to return the time zone offset for a given datetime. It takes the timestamp in terms of milliseconds - * since January 1 1970, and returns the timezone offset in minutes. This provides a hook for drawing time based - * charts in specific time zones using their local DST crossover dates, with the help of external libraries. - * @since 4.1.0 - */ - getTimezoneOffset?: (timestamp: number) => number; - /** - * The timezone offset in minutes. Positive values are west, negative values are east of UTC, as in the ECMAScript - * getTimezoneOffset method. Use this to display UTC based data in a predefined time zone. - * @default 0 - * @since 3.0.8 - */ - timezoneOffset?: number; - /** - * Whether to use UTC time for axis scaling, tickmark placement and time display in Highcharts.dateFormat. - * Advantages of using UTC is that the time displays equally regardless of the user agent's time zone settings. - * Local time can be used when the data is loaded in real time or when correct Daylight Saving Time transitions are - * required. - * @default true - */ - useUTC?: boolean; - } - - interface LabelItem { - html: string; - style: CSSObject; - } - - interface LabelsOptions { - items?: LabelItem[]; - style?: CSSObject; - } - - interface LangObject { - /** - * Exporting module menu. The tooltip title for the context menu holding print and export menu items. - * @default 'Chart context menu' - * @since 3.0 - */ - contextButtonTitle?: string; - /** - * The default decimal point used in the Highcharts.numberFormat method unless otherwise specified in the function - * arguments. - * @default '.' - * @since 1.2.2 - */ - decimalPoint?: string; - /** - * Exporting module only. The text for the JPEG download menu item. - * @default 'Download JPEG image' - * @since 2.0 - */ - downloadJPEG?: string; - /** - * Exporting module only. The text for the PDF download menu item. - * @default 'Download PDF document' - * @since 2.0 - */ - downloadPDF?: string; - /** - * Exporting module only. The text for the PNG download menu item. - * @default 'Download PNG image' - * @since 2.0 - */ - downloadPNG?: string; - /** - * Exporting module only. The text for the SVG download menu item. - * @default 'Download SVG vector image' - * @since 2.0 - */ - downloadSVG?: string; - /** - * The text for the button that appears when drilling down, linking back to the parent series. The parent series' - * name is inserted for {series.name} - * @default 'Back to {series.name}' - * @since 3.0.8 - */ - drillUpText?: string; - /** - * What to show in a date field for invalid dates. - * @default '' - * @since 4.1.8 - */ - invalidDate?: string; - /** - * The loading text that appears when the chart is set into the loading state following a call to chart.showLoading. - * @default 'Loading...' - */ - loading?: string; - /** - * An array containing the months names. Corresponds to the %B format in Highcharts.dateFormat(). - * @default ['January' , 'February' , 'March' , 'April' , 'May' , 'June' , 'July' , 'August' , 'September' , 'October' , 'November' , 'December'] - */ - months?: string[]; - /** - * The text to display when the chart contains no data. Requires the no-data module, see noData. - * @default 'No data to display' - * @since 3.0.8 - */ - noData?: string; - /** - * Metric prefixes used to shorten high numbers in axis labels. Replacing any of the positions with null causes the - * full number to be written. Setting numericSymbols to null disables shortening altogether. - * @default ['k', 'M', 'G', 'T', 'P', 'E'] - * @since 2.3.0 - */ - numericSymbols?: string[]; - /** - * Exporting module only. The text for the menu item to print the chart. - * @default 'Print chart' - * @since 3.0.1 - */ - printChart?: string; - /** - * The text for the label appearing when a chart is zoomed. - * @default 'Reset zoom' - * @since 1.2.4 - */ - resetZoom?: string; - /** - * The tooltip title for the label appearing when a chart is zoomed. - * @default 'Reset zoom level 1:1' - * @since 1.2.4 - */ - resetZoomTitle?: string; - /** - * An array containing the months names in abbreviated form. Corresponds to the %b format in - * Highcharts.dateFormat(). - * @default ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] - */ - shortMonths?: string[]; - /** - * The default thousands separator used in the Highcharts.numberFormat method unless otherwise specified in the - * function arguments. Since Highcharts 4.1 it defaults to a single space character, which is compatible with ISO - * and works across Anglo-American and continental European languages. - * @default ' ' - * @since 1.2.2 - */ - thousandsSep?: string; - /** - * An array containing the weekday names. - * @default ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] - */ - weekdays?: string[]; - } - - interface LegendNavigationOptions { - /** - * The color for the active up or down arrow in the legend page navigation. - * @default '#3E576F' - * @since 2.2.4 - */ - activeColor?: string; - /** - * How to animate the pages when navigating up or down. A value of true applies the default navigation given in the - * chart.animation option. Additional options can be given as an object containing values for easing and duration. - * @default true - * @since 2.2.4 - */ - animation?: boolean | Animation; - /** - * The pixel size of the up and down arrows in the legend paging navigation. - * @default 12 - * @since 2.2.4 - */ - arrowSize?: number; - /** - * The color of the inactive up or down arrow in the legend page navigation. - * @default '#CCC' - */ - inactiveColor?: string; - /** - * Text styles for the legend page navigation. - * @since 2.2.4 - */ - style?: CSSObject; - } - - interface LegendTitleOptions { - /** - * Generic CSS styles for the legend title. - * @default {'fontWeight':'bold'} - * @since 3.0 - */ - style?: CSSObject; - /** - * A text or HTML string for the title. - * @default null - * @since 3.0 - */ - text?: string; - } - - interface LegendOptions { - /** - * The horizontal alignment of the legend box within the chart area. Valid values are 'left', 'center' and 'right'. - * In the case that the legend is aligned in a corner position, the layout option will determine whether to place it - * above/below or on the side of the plot area. - * @default 'center' - * @since 2.0 - */ - align?: string; - /** - * The background color of the legend. - */ - backgroundColor?: string | Gradient; - /** - * The color of the drawn border around the legend. - * @default '#909090' - */ - borderColor?: string | Gradient; - /** - * The border corner radius of the legend. - * @default 0 - */ - borderRadius?: number; - /** - * The width of the drawn border around the legend. - * @default 0 - */ - borderWidth?: number; - /** - * Enable or disable the legend. - * @default true - */ - enabled?: boolean; - /** - * When the legend is floating, the plot area ignores it and is allowed to be placed below it. - * @default false - * @since 2.1 - */ - floating?: boolean; - /** - * In a legend with horizontal layout, the itemDistance defines the pixel distance between each item. - * @default 20 - * @since 3.0.3 - */ - itemDistance?: number; - /** - * CSS styles for each legend item when the corresponding series or point is hidden. Only a subset of CSS is - * supported, notably those options related to text. Properties are inherited from style unless overridden here. - * @default {color: '#CCC'} - */ - itemHiddenStyle?: CSSObject; - /** - * CSS styles for each legend item in hover mode. Only a subset of CSS is supported, notably those options related - * to text. Properties are inherited from style unless overridden here. - * @default {color: '#000'} - */ - itemHoverStyle?: CSSObject; - /** - * The pixel bottom margin for each legend item. - * @default 0 - * @since 2.2.0 - */ - itemMarginBottom?: number; - /** - * The pixel top margin for each legend item. - * @default 0 - * @since 2.2.0 - */ - itemMarginTop?: number; - /** - * CSS styles for each legend item. Only a subset of CSS is supported, notably those options related to text. - * @default { 'color': '#333333', 'cursor': 'pointer', 'fontSize': '12px', 'fontWeight': 'bold' } - */ - itemStyle?: CSSObject; - /** - * The width for each legend item. This is useful in a horizontal layout with many items when you want the items to - * align vertically. - * @since 2.0 - */ - itemWidth?: number; - /** - * A format string for each legend label. Available variables relates to properties on the series, or the point in - * case of pies. - * @default '{name}' - * @since 1.3 - */ - labelFormat?: string; - /** - * Callback function to format each of the series' labels. The this keyword refers to the series object, or the - * point object in case of pie charts. By default the series or point name is printed. - */ - labelFormatter?: () => string; - /** - * The layout of the legend items. Can be one of 'horizontal' or 'vertical'. - * @default 'horizontal' - */ - layout?: string; - /** - * Line height for the legend items. Deprecated as of 2.1. Instead, the line height for each item can be set using - * itemStyle.lineHeight, and the padding between items using itemMarginTop and itemMarginBottom. - * @default 16 - * @since 2.0 - * @deprecated - */ - lineHeight?: number; - /** - * If the plot area sized is calculated automatically and the legend is not floating, the legend margin is the space - * between the legend and the axis labels or plot area. - * @default 12 - * @since 2.1 - */ - margin?: number; - /** - * Maximum pixel height for the legend. When the maximum height is extended, navigation will show. - * @since 2.3.0 - */ - maxHeight?: number; - /** - * Options for the paging or navigation appearing when the legend is overflown. - */ - navigation?: LegendNavigationOptions; - /** - * The inner padding of the legend box. - * @default 8 - * @since 2.2.0 - */ - padding?: number; - /** - * Whether to reverse the order of the legend items compared to the order of the series or points as defined in the - * configuration object. - * @default false - * @since 1.2.5 - */ - reversed?: boolean; - /** - * Whether to show the symbol on the right side of the text rather than the left side. This is common in Arabic and - * Hebraic. - * @default false - * @since 2.2 - */ - rtl?: boolean; - /** - * Whether to apply a drop shadow to the legend. A backgroundColor also needs to be applied for this to take effect. - * Since 2.3 the shadow can be an object configuration containing color, offsetX, offsetY, opacity and width. - * @default false - */ - shadow?: boolean | Shadow; - /** - * CSS styles for the legend area. In the 1.x versions the position of the legend area was determined by CSS. In - * 2.x, the position is determined by properties like align, verticalAlign, x and y, but the styles are still parsed - * for backwards compatibility. - * @deprecated - */ - style?: CSSObject; - /** - * The pixel height of the symbol for series types that use a rectangle in the legend. Defaults to the font size of - * legend items. - * @since 3.0.8 - */ - symbolHeight?: number; - /** - * The pixel padding between the legend item symbol and the legend item text. - * @default 5 - */ - symbolPadding?: number; - /** - * The border radius of the symbol for series types that use a rectangle in the legend. - * @default 0 - * @since 3.0.8 - */ - symbolRadius?: number; - /** - * The pixel width of the legend item symbol. - * @default 16 - */ - symbolWidth?: number; - /** - * A title to be added on top of the legend. - * @since 3.0 - */ - title?: LegendTitleOptions; - /** - * Whether to use HTML to render the legend item texts. Prior to 4.1.7, when using HTML, legend.navigation was - * disabled. - * @default false - */ - useHTML?: boolean; - /** - * The vertical alignment of the legend box. Can be one of 'top', 'middle' or 'bottom'. Vertical position can be - * further determined by the y option. - * - * In the case that the legend is aligned in a corner position, the layout option will determine whether to place it - * above/below or on the side of the plot area. - * - * @default 'bottom' - * @since 2.0 - */ - verticalAlign?: string; - /** - * The width of the legend box. - * @since 2.0 - */ - width?: number; - /** - * The x offset of the legend relative to its horizontal alignment align within chart.spacingLeft and - * chart.spacingRight. Negative x moves it to the left, positive x moves it to the right. - * @default 0 - * @since 2.0 - */ - x?: number; - /** - * The vertical offset of the legend relative to it's vertical alignment verticalAlign within chart.spacingTop and - * chart.spacingBottom. Negative y moves it up, positive y moves it down. - * @default 0 - * @since 2.0 - */ - y?: number; - } - - /** - * The loading options control the appearance of the loading screen that covers the plot area on chart operations. This - * screen only appears after an explicit call to chart.showLoading(). It is a utility for developers to communicate to - * the end user that something is going on, for example while retrieving new data via an XHR connection. The - * 'Loading...' text itself is not part of this configuration object, but part of the lang object. - */ - interface LoadingOptions { - /** - * The duration in milliseconds of the fade out effect. - * @default 100 - * @since 1.2.0 - */ - hideDuration?: number; - /** - * CSS styles for the loading label span. - * @default { 'fontWeight': 'bold', 'position': 'relative', 'top': '45%' } - */ - labelStyle?: CSSObject; - /** - * The duration in milliseconds of the fade in effect. - * @default 100 - * @since 1.2.0 - */ - showDuration?: number; - /** - * CSS styles for the loading screen that covers the plot area. - * @default { position: 'absolute', backgroundColor: 'white', opacity: 0.5, textAlign: 'center' } - */ - style?: Object; - } - - /** - * A collection of options for buttons and menus appearing in the exporting module. - */ - interface NavigationOptions { - /** - * A collection of options for buttons appearing in the exporting module. - */ - buttonOptions?: Button; - /** - * CSS styles for the hover state of the individual items within the popup menu appearing by default when the export - * icon is clicked. The menu items are rendered in HTML. - * @default {background: '#4572A5', color: '#FFFFFF'} - * @since 2.0 - */ - menuItemHoverStyle?: Object; - /** - * CSS styles for the individual items within the popup menu appearing by default when the export icon is clicked. - * The menu items are rendered in HTML. - * @default { padding: '0 5px', background: NONE, color: '#303030'} - * @since 2.0 - */ - menuItemStyle?: Object; - /** - * CSS styles for the popup menu appearing by default when the export icon is clicked. This menu is rendered in - * HTML. - * @default { border: '1px solid #A0A0A0', background: '#FFFFFF' } - * @since 2.0 - */ - menuStyle?: Object; - } - - /** - * Options for displaying a message like 'No data to display'. This feature requires the file no-data-to-display.js to - * be loaded in the page. The actual text to display is set in the lang.noData option. - */ - interface NoDataOptions { - /** - * An object of additional SVG attributes for the no-data label. - * @since 3.0.8 - */ - attr?: {}; - /** - * The position of the no-data label, relative to the plot area. - * @default { 'x': 0, 'y': 0, 'align': 'center', 'verticalAlign': 'middle' } - * @since 3.0.8 - */ - position?: Position; - /** - * CSS styles for the no-data label. - * @default { 'fontSize': '12px', 'fontWeight': 'bold', 'color': '#60606a' } - */ - style?: CSSObject; - } - - interface PaneBackground { - /** - * @default {linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 }, stops: [[0, '#FFF'],[1, '#DDD']]} - */ - backgroundColor: string | Gradient; - /** - * @default 'silver' - */ - borderColor?: string | Gradient; - /** - * @default 1 - */ - borderWidth?: number; - /** - * @default 0 - */ - innerRadius?: number | string; - /** - * @default '105%' - */ - outerRadius?: number | string; - /** - * @default 'circle' - */ - shape?: string; - } - - /** - * Applies only to polar charts and angular gauges. This configuration object holds general options for the combined X - * and Y axes set. Each xAxis or yAxis can reference the pane by index. - */ - interface PaneOptions { - /** - * An object, or array of objects, for backgrounds. Sub options include backgroundColor (can be solid or gradient), - * shape ('solid', 'arc' or 'circle'), innerWidth, outerWidth, borderWidth, borderColor. - * @since 2.3.0 - */ - background?: PaneBackground | PaneBackground[]; - /** - * The center of a polar chart or angular gauge, given as an array of [x, y] positions. Positions can be given as - * integers that transform to pixels, or as percentages of the plot area size. - * @default ['50%', '50%'] - * @since 2.3.0 - */ - center?: [number | string, number | string]; - /** - * The end angle of the polar X axis or gauge value axis, given in degrees where 0 is north. - * @default startAngle + 360 - * @since 2.3.0 - */ - endAngle?: number; - /** - * The size of the pane, either as a number defining pixels, or a percentage defining a percentage of the plot are. - * @default '85%' - */ - size?: number | string; - /** - * The size of the pane, either as a number defining pixels, or a percentage defining a percentage of the plot are - * @since 2.3.0 - */ - startAngle?: number; - } - - interface DataLabels { - /** - * The alignment of the data label compared to the point. If right, the right side of the label should be touching - * the point. For points with an extent, like columns, the alignments also dictates how to align it inside the box, - * as given with the inside option. Can be one of 'left', 'center' or 'right'. - * @default 'center' - */ - align?: string; - /** - * Whether to allow data labels to overlap. To make the labels less sensitive for overlapping, the - * dataLabels.padding can be set to 0. - * @default false - * @since 4.1.0 - */ - allowOverlap?: boolean; - /** - * The background color or gradient for the data label. - * @since 2.2.1 - */ - backgroundColor?: string | Gradient; - /** - * The border color for the data label. - * @since 2.2.1 - */ - borderColor?: string | Gradient; - /** - * The border radius in pixels for the data label. - * @default 0 - * @since 2.2.1 - */ - borderRadius?: number; - /** - * The border width in pixels for the data label. - * @default 0 - * @since 2.2.1 - */ - borderWidth?: number; - /** - * A class name for the data label. Particularly in styled mode, this can be used to give each series' or point's - * data label unique styling. In addition to this option, a default color class name is added so that we can give - * the labels a contrast text shadow. - * @since 5.0.0 - */ - className?: string; - /** - * The text color for the data labels. - * @default null - */ - color?: string | Gradient; - /** - * Whether to hide data labels that are outside the plot area. By default, the data label is moved inside the plot - * area according to the overflow option. - * @default 2.3.3 - */ - crop?: boolean; - /** - * Whether to defer displaying the data labels until the initial series animation has finished. - * @default true - * @since 4.0 - */ - defer?: boolean; - /** - * Enable or disable the data labels. - * @default false - */ - enabled?: boolean; - /** - * A format string for the data label. Available variables are the same as for formatter. - * @default {y} - * @since 3.0 - */ - format?: string; - /** - * Callback JavaScript function to format the data label. Note that if a format is defined, the format takes - * precedence and the formatter is ignored. - * Available data are: - * - this.percentage Stacked series and pies only. The point's percentage of the total. - * - this.point The point object. The point name, if defined, is available through this.point.name. - * - this.series The series object. The series name is available through this.series.name. - * - this.total Stacked series only. The total value at this point's x value. - * - this.x: The x value. - * - this.y: The y value. - */ - formatter?: () => string; - /** - * For points with an extent, like columns, whether to align the data label inside the box or to the actual value - * point. Defaults to false in most cases, true in stacked columns. - * @since 3.0 - */ - inside?: boolean; - /** - * How to handle data labels that flow outside the plot area. The default is 'justify', which aligns them inside the - * plot area. For columns and bars, this means it will be moved inside the bar. To display data labels outside the - * plot area, set crop to false and overflow to 'none'. - * @default 'justify' - * @since 3.0.6 - */ - overflow?: string; - /** - * When either the borderWidth or the backgroundColor is set, this is the padding within the box. - * @default 5 - * @since 2.2.1 - */ - 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; - /** - * Text rotation in degrees. Note that due to a more complex structure, backgrounds, borders and padding will be - * lost on a rotated data label. - * @default 0 - */ - rotation?: number; - /** - * The shadow of the box. Works best with borderWidth or backgroundColor. Since 2.3 the shadow can be an object - * configuration containing color, offsetX, offsetY, opacity and width. - * @default false - */ - shadow?: boolean | Shadow; - /** - * The name of a symbol to use for the border around the label. Symbols are predefined functions on the Renderer - * object. - * @default 'square' - * @since 4.1.2 - */ - shape?: string; - /** - * Styles for the label. - * @default {'color': 'contrast', 'fontSize': '11px', 'fontWeight': 'bold', 'textShadow': '0 0 6px contrast, 0 0 3px contrast' } - * @since 4.1.0 - */ - style?: CSSObject; - /** - * Whether to {@link http://www.highcharts.com/docs/chart-concepts/labels-and-string-formatting#html|use HTML} to render the labels. - * @default false - */ - useHTML?: boolean; - /** - * The vertical alignment of a data label. Can be one of top, middle or bottom. The default value depends on the - * data, for instance in a column chart, the label is above positive values and below negative values. - * @since 2.3.3 - */ - verticalAlign?: string; - /** - * The x position offset of the label relative to the point. - * @default 0 - */ - x?: number; - /** - * The y position offset of the label relative to the point. - * @default -6 - */ - y?: number; - /** - * The Z index of the data labels. The default Z index puts it above the series. Use a Z index of 2 to display it - * behind the series. - * @default 6 - * @since 2.3.5 - */ - zIndex?: number; - } - - interface PieDataLabels extends DataLabels { - /** - * The color of the line connecting the data label to the pie slice. The default color is the same as the point's - * color. Defaults to {point.color}. - * @since 2.1 - */ - connectorColor?: string; - /** - * The distance from the data label to the connector. - * @default 5 - * @since 2.1 - */ - connectorPadding?: number; - /** - * The width of the line connecting the data label to the pie slice. - * @default 1 - * @since 2.1 - */ - connectorWidth?: number; - /** - * The distance of the data label from the pie's edge. Negative numbers put the data label on top of the pie slices. - * Connectors are only shown for data labels outside the pie. - * @default 30 - * @since 2.1 - */ - distance?: number; - /** - * Whether to render the connector as a soft arc or a line with sharp break. - * @default true - * @since 2.1.7 - */ - softConnector?: boolean; - } - - interface AreaCheckboxEvent extends Event { - /** - * The state of the checkbox - */ - checked: boolean; - /** - * The checked item - */ - item: SeriesObject | PointObject; - } - - interface AreaClickEvent extends Event { - /** - * A pointer to the nearest point on the graph - */ - point: PointObject; - } - - interface PlotEvents { - /** - * Fires after the series has finished its initial animation, or in case animation is disabled, immediately as the - * series is displayed. - * - * The this keyword refers to the Series object. - * @since 4.0 - */ - afterAnimate?: (event: Event) => void; - /** - * Fires when the checkbox next to the series' name in the legend is clicked. One parameter, event, is passed to the - * function. The state of the checkbox is found by event.checked. The checked item is found by event.item. Return - * false to prevent the default action which is to toggle the select state of the series. - * - * The this keyword refers to the Series object. - * @since 1.2.0 - */ - checkboxClick?: (event: AreaCheckboxEvent) => boolean | void; - /** - * Fires when the series is clicked. One parameter, event, is passed to the function. This contains common event - * information based on jQuery or MooTools depending on which library is used as the base for Highcharts. - * Additionally, event.point holds a pointer to the nearest point on the graph. - * - * The this keyword refers to the Series object. - */ - click?: (event: AreaClickEvent) => void; - /** - * Fires when the series is hidden after chart generation time, either by clicking the legend item or by calling - * .hide(). - * - * The this keyword refers to the Series object. - */ - hide?: () => void; - /** - * Fires when the legend item belonging to the series is clicked. One parameter, event, is passed to the function. - * This contains common event information based on jQuery or MooTools depending on which library is used as the base - * for Highcharts. The default action is to toggle the visibility of the series. This can be prevented by returning - * false or calling event.preventDefault(). - * - * The this keyword refers to the Series object. - */ - legendItemClick?: (event: Event) => boolean | void; - /** - * Fires when the mouse leaves the graph. One parameter, event, is passed to the function. This contains common - * event information based on jQuery or MooTools depending on which library is used as the base for Highcharts. If - * the stickyTracking option is true, mouseOut doesn't happen before the mouse enters another graph or leaves the - * plot area. - * - * The this keyword refers to the Series object. - */ - mouseOut?: (event: Event) => void; - /** - * Fires when the mouse enters the graph. One parameter, event, is passed to the function. This contains common - * event information based on jQuery or MooTools depending on which library is used as the base for Highcharts. - * - * The this keyword refers to the Series object. - */ - mouseOver?: (event: Event) => void; - /** - * Fires when the series is shown after chart generation time, either by clicking the legend item or by calling - * .show(). - * - * The this keyword refers to the Series object. - * @since 1.2.0 - */ - show?: () => void; - } - - interface MarkerState { - /** - * Enable or disable the point marker. If null, the markers are hidden when the data is dense, and shown for more - * widespread data points. - * @default null, true for hover and select - */ - enabled?: boolean; - /** - * The fill color of the point marker. When null, the series' or point's color is used. - */ - fillColor?: string; - /** - * The color of the point marker's outline. When null, the series' or point's color is used. - * @default '#FFFFFF', '#000000' for select state - */ - lineColor?: string | Gradient; - /** - * The width of the point marker's outline. - * @default 0 - */ - lineWidth?: number; - /** - * The radius of the point marker. - * @default 4, undefined for hover and select - */ - radius?: number; - } - - interface MarkerHoverState extends MarkerState { - /** - * The additional line width for a hovered point. - * @default 1 - * @since 4.0.3 - */ - lineWidthPlus?: number; - /** - * The number of pixels to increase the radius of the hovered point. - * @default 2 - * @since 4.0.3 - */ - radiusPlus?: number; - } - - interface Marker extends MarkerState { - /** - * Image markers only. Set the image width explicitly. When using this option, a width must also be set. - * @default null - * @since 4.0.4 - */ - height?: number; - states?: { - hover?: MarkerHoverState; - /** - * The appearance of the point marker when selected. In order to allow a point to be selected, set the - * series.allowPointSelect option to true. - */ - select?: MarkerState; - }; - /** - * A predefined shape or symbol for the marker. When null, the symbol is pulled from options.symbols. Other possible - * values are 'circle', 'square', 'diamond', 'triangle' and 'triangle-down'. - * - * Additionally, the URL to a graphic can be given on this form: 'url(graphic.png)'. Note that for the image to be - * applied to exported charts, its URL needs to be accessible by the export server. - * - * Custom callbacks for symbol path generation can also be added to Highcharts.SVGRenderer.prototype.symbols. The - * callback is then used by its method name. - */ - symbol?: string; // null, 'circle', 'square', 'diamond', 'triangle' 'triangle-down' or 'url(graphic.png)' - /** - * Image markers only. Set the image width explicitly. When using this option, a height must also be set. - * @default null. - * @since 4.0.4 - */ - width?: number; - } - - interface PointEvents { - /** - * Fires when a point is clicked. One parameter, event, is passed to the function. This contains common event - * information based on jQuery or MooTools depending on which library is used as the base for Highcharts. - * - * If the series.allowPointSelect option is true, the default action for the point's click event is to toggle the - * point's select state. Returning false cancels this action. - * - * The this keyword refers to the Point object. - */ - click?: (event: Event) => boolean; - /** - * Fires when the mouse leaves the area close to the point. One parameter, event, is passed to the function. This - * contains common event information based on jQuery or MooTools depending on which library is used as the base for - * Highcharts. - * - * The this keyword refers to the Point object. - */ - mouseOut?: (event: Event) => void; - /** - * Fires when the mouse enters the area close to the point. One parameter, event, is passed to the function. This - * contains common event information based on jQuery or MooTools depending on which library is used as the base for - * Highcharts. - * - * The this keyword refers to the Point object. - */ - mouseOver?: (event: Event) => void; - /** - * Fires when the point is removed using the .remove() method. One parameter, event, is passed to the function. - * Returning false cancels the operation. - * - * The this keyword refers to the Point object. - * @since 1.2.0 - */ - remove?: (event: Event) => boolean | void; - /** - * Fires when the point is selected either programmatically or following a click on the point. One parameter, event, - * is passed to the function. Returning false cancels the operation. - * - * The this keyword refers to the Point object. - * @since 1.2.0 - */ - select?: (event: Event) => boolean | void; - /** - * Fires when the point is unselected either programmatically or following a click on the point. One parameter, - * event, is passed to the function. Returning false cancels the operation. - * - * The this keyword refers to the Point object. - * @since 1.2.0 - */ - unselect?: (event: Event) => boolean | void; - /** - * Fires when the point is updated programmatically through the .update() method. One parameter, event, is passed to - * the function. The new point options can be accessed through event.options. Returning false cancels the operation. - * - * The this keyword refers to the Point object. - * @since 1.2.0 - */ - update?: (event: Event) => boolean | void; - /** - * Fires when the legend item belonging to the pie point (slice) is clicked. - * The this keyword refers to the point itself. One parameter, event, is passed to the function. - * This contains common event information based on jQuery or MooTools depending on which library is used as the base for Highcharts. - * The default action is to toggle the visibility of the point. This can be prevented by calling event.preventDefault(). - */ - legendItemClick?: (event: Event) => boolean | void; - - } - - interface Halo { - /** - * A collection of SVG attributes to override the appearance of the halo, for example fill, stroke and stroke-width. - * @since 4.0 - */ - attributes?: {}; - /** - * Opacity for the halo unless a specific fill is overridden using the attributes setting. Note that Highcharts is - * only able to apply opacity to colors of hex or rgb(a) formats. - * @default 0.25 - * @since 4.0 - */ - opacity?: number; - /** - * The pixel size of the halo. For point markers this is the radius of the halo. For pie slices it is the width of - * the halo outside the slice. For bubbles it defaults to 5 and is the width of the halo outside the bubble. - * Defaults to 10. - */ - size?: number; - } - - interface LineStates { - /** - * Enable separate styles for the hovered series to visualize that the user hovers either the series itself or the - * legend. - * @default true - * @since 1.2 - */ - enabled?: boolean; - /** - * Options for the halo appearing around the hovered point in line-type series as well as outside the hovered slice - * in pie charts. By default the halo is filled by the current point or series color with an opacity of 0.25. The - * halo can be disabled by setting the halo option to false. - * @since 4.0 - */ - halo?: boolean | Halo; - /** - * Pixel with of the graph line. - * @default 2 - */ - lineWidth?: number; - /** - * The additional line width for the graph of a hovered series. - * @default 1 - * @since 4.0.3 - */ - lineWidthPlus?: number; - marker?: Marker; - } - - interface BarStates { - /** - * A specific border color for the hovered point. Defaults to inherit the normal state border color. - */ - borderColor?: string | Gradient; - /** - * How much to brighten the point on interaction. Requires the main color to be defined in hex or rgb(a) format. - * @default 0.1 - */ - brightness?: number; - /** - * - */ - color?: string | Gradient; - /** - * Enable separate styles for the hovered series to visualize that the user hovers either the series itself or the - * legend. - * @default true - * @since 1.2 - */ - enabled?: boolean; - /** - * Options for the halo appearing around the hovered point in line-type series as well as outside the hovered slice - * in pie charts. By default the halo is filled by the current point or series color with an opacity of 0.25. The - * halo can be disabled by setting the halo option to false. - * @since 4.0 - */ - halo?: boolean | Halo; - } - - interface PieStates extends BarStates, LineStates { } - - interface AreaZone { - /** - * Defines the color of the series. - * @since 4.1.0 - */ - color?: string | Gradient; - /** - * A name for the dash style to use for the graph. - * @since 4.1.0 - */ - dashStyle?: string; - /** - * Defines the fill color for the series (in area type series) - * @since 4.1.0 - */ - fillColor?: string; - /** - * The value up to where the zone extends, if undefined the zones stretches to the last value in the series. - * @default undefined - * @since 4.1.0 - */ - value?: number; - } - - interface RangeDataLabels { - /** - * The alignment of the data label compared to the point. If right, the right side of the label should be touching - * the point. For points with an extent, like columns, the alignments also dictates how to align it inside the box, - * as given with the inside option. Can be one of 'left', 'center' or 'right'. - * @default 'center' - */ - align?: string; - /** - * Whether to allow data labels to overlap. To make the labels less sensitive for overlapping, the - * dataLabels.padding can be set to 0. - * @default false - * @since 4.1.0 - */ - allowOverlap?: boolean; - /** - * The background color or gradient for the data label. - * @default undefined - * @since 2.2.1 - */ - backgroundColor?: string | Gradient; - /** - * The border color for the data label. - * @default undefined - * @since 2.2.1 - */ - borderColor?: string | Gradient; - /** - * The border radius in pixels for the data label. - * @default 0 - * @since 2.2.1 - */ - borderRadius?: number; - /** - * The border width in pixels for the data label. - * @default 0 - * @since 2.2.1 - */ - borderWidth?: number; - /** - * The text color for the data labels. - * @default null - */ - color?: string | Gradient; - /** - * Whether to hide data labels that are outside the plot area. By default, the data label is moved inside the plot - * area according to the overflow option. - * @default true - * @since 2.3.3 - */ - crop?: boolean; - /** - * Whether to defer displaying the data labels until the initial series animation has finished. - * @default true - * @since 4.0 - */ - defer?: boolean; - /** - * Enable or disable the data labels. - * @default false - */ - enabled?: boolean; - /** - * A format string for the data label. Available variables are the same as for formatter. - * @default '{y}' - * @since 3.0 - */ - format?: string; - /** - * Callback JavaScript function to format the data label. Note that if a format is defined, the format takes - * precedence and the formatter is ignored. - * Available data are: - * - this.percentage Stacked series and pies only. The point's percentage of the total. - * - this.point The point object. The point name, if defined, is available through this.point.name. - * - this.series The series object. The series name is available through this.series.name. - * - this.total Stacked series only. The total value at this point's x value. - * - this.x: The x value. - * - this.y: The y value. - */ - formatter?: () => string; - /** - * For points with an extent, like columns, whether to align the data label inside the box or to the actual value - * point. Defaults to false in most cases, true in stacked columns. - * @since 3.0 - */ - inside?: boolean; - /** - * How to handle data labels that flow outside the plot area. The default is justify, which aligns them inside the - * plot area. For columns and bars, this means it will be moved inside the bar. To display data labels outside the - * plot area, set crop to false and overflow to 'none'. - * @default 'justify' - * @since 3.0.6 - */ - overflow?: string; - /** - * When either the borderWidth or the backgroundColor is set, this is the padding within the box. - * @default 5 - * @since 2.2.1 - */ - padding?: number; - /** - * Text rotation in degrees. Note that due to a more complex structure, backgrounds, borders and padding will be - * lost on a rotated data label. - * @default 0 - */ - rotation?: number; - /** - * The shadow of the box. Works best with borderWidth or backgroundColor. Since 2.3 the shadow can be an object - * configuration containing color, offsetX, offsetY, opacity and width. - * @default false - * @since 2.2.1 - */ - shadow?: boolean | Shadow; - /** - * The name of a symbol to use for the border around the label. Symbols are predefined functions on the Renderer - * object. - * @default 'square' - * @since 4.1.2 - */ - shape?: string; - /** - * Styles for the label. - * @default {'color': 'contrast', 'fontSize': '11px', 'fontWeight': 'bold', 'textShadow': '0 0 6px contrast, 0 0 3px contrast' } - * @since 4.1.0 - */ - style?: CSSObject; - /** - * Whether to {@link http://www.highcharts.com/docs/chart-concepts/labels-and-string-formatting#html|use HTML} to render the labels. - * @default false - */ - useHTML?: boolean; - /** - * The vertical alignment of a data label. Can be one of 'top', 'middle' or 'bottom'. The default value depends on the - * data, for instance in a column chart, the label is above positive values and below negative values. - * @since 2.3.3 - */ - verticalAlign?: string; - /** - * X offset of the higher data labels relative to the point value. - * @default 0 - * @since 2.3.0 - */ - xHigh?: number; - /** - * X offset of the lower data labels relative to the point value. - * @default 0 - * @since 2.3.0 - */ - xLow?: number; - /** - * Y offset of the higher data labels relative to the point value. - * @default -6 - * @since 2.3.0 - */ - yHigh?: number; - /** - * Y offset of the lower data labels relative to the point value. - * @default 16 - * @since 2.3.0 - */ - yLow?: number; - /** - * The Z index of the data labels. The default Z index puts it above the series. Use a Z index of 2 to display it - * behind the series. - * @default 6 - * @since 2.3.5 - */ - zIndex?: number; - } - - interface Dial { - /** - * The background or fill color of the gauge's dial. - * @default 'black' - * @since 2.3.0 - */ - backgroundColor?: string | Gradient; - /** - * The length of the dial's base part, relative to the total radius or length of the dial. - * @default '70%'. - * @since 2.3.0 - */ - baseLength?: string; - /** - * The pixel width of the base of the gauge dial. The base is the part closest to the pivot, defined by baseLength. - * @default 3 - * @since 2.3.0 - */ - baseWidth?: number; - /** - * The border color or stroke of the gauge's dial. By default, the borderWidth is 0, so this must be set in addition - * to a custom border color. - * @default 'silver' - * @since 2.3.0 - */ - borderColor?: string | Gradient; - /** - * The width of the gauge dial border in pixels. - * @default 0 - * @since 2.3.0 - */ - borderWidth?: number; - /** - * The radius or length of the dial, in percentages relative to the radius of the gauge itself. - * @default '80%' - * @since 2.3.0 - */ - radius?: string; - /** - * The length of the dial's rear end, the part that extends out on the other side of the pivot. Relative to the - * dial's length. - * @default '10%' - * @since 2.3.0 - */ - rearLength?: string; - /** - * The width of the top of the dial, closest to the perimeter. The pivot narrows in from the base to the top. - * @default 1 - * @since 2.3.0 - */ - topWidth?: number; - } - - interface Pivot { - /** - * The background color or fill of the pivot. - * @default 'black' - * @since 2.3.0 - */ - backgroundColor?: string | Gradient; - /** - * The border or stroke color of the pivot. In able to change this, the borderWidth must also be set to something - * other than the default 0. - * @default 'silver' - * @since 2.3.0 - */ - borderColor?: string | Gradient; - /** - * The border or stroke width of the pivot. - * @default 0 - * @since 2.3.0 - */ - borderWidth?: number; - /** - * The pixel radius of the pivot. - * @default 5 - * @since 2.3.0 - */ - radius?: number; - } - - /** - * Set options on specific levels. Takes precedence over series options, but not point options. - */ - interface TreeMapLevel { - /** - * Can set borderColor on all points which lies on the same level. - * @since 4.1.0 - */ - borderColor?: string | Gradient; - /** - * et the dash style of the border of all the point which lies on the level. - * @since 4.1.0 - */ - borderDashStyle?: string; - /** - * Can set the borderWidth on all points which lies on the same level. - * @since 4.1.0 - */ - borderWidth?: number; - /** - * Can set a color on all points which lies on the same level. - * @since 4.1.0 - */ - color?: string | Gradient; - /** - * Can set the options of dataLabels on each point which lies on the level. - * @default undefined - * @since 4.1.0 - */ - dataLabels?: DataLabels; - /** - * Can set the layoutAlgorithm option on a specific level. - * @since 4.1.0 - */ - layoutAlgorithm?: string; - /** - * Can set the layoutStartingDirection option on a specific level. - * @since 4.1.0 - */ - layoutStartingDirection?: string; - /** - * Decides which level takes effect from the options set in the levels object. - * @since 4.1.0 - */ - level?: number; - } - - /** - * General options for all series types. - */ - interface SeriesChart { - /** - * Allow this series' points to be selected by clicking on the markers, bars or pie slices. - * @default false - * @since 1.2.0 - */ - allowPointSelect?: boolean; - /** - * Enable or disable the initial animation when a series is displayed. The animation can also be set as a - * configuration object. Please note that this option only applies to the initial animation of the series itself. - * For other animations, see chart.animation and the animation parameter under the API methods. - * @default true - */ - animation?: boolean | Animation; - /** - * The main color or the series. In line type series it applies to the line and the point markers unless otherwise - * specified. In bar type series it applies to the bars unless a color is specified per point. The default value is - * pulled from the options.colors array. - */ - color?: string | Gradient; - /** - * Polar charts only. Whether to connect the ends of a line series plot across the extremes. - * @default true - * @since 2.3.0 - */ - connectEnds?: boolean; - /** - * Whether to connect a graph line across null points. - * @default false - */ - connectNulls?: boolean; - /** - * When the series contains less points than the crop threshold, all points are drawn, event if the points fall - * outside the visible plot area at the current zoom. The advantage of drawing all points (including markers and - * columns), is that animation is performed on updates. On the other hand, when the series contains more points than - * the crop threshold, the series data is cropped to only contain points that fall within the plot area. The - * advantage of cropping away invisible points is to increase performance on large series. - * @default 300 - * @since 2.2 - */ - cropThreshold?: number; - /** - * You can set the cursor to 'pointer' if you have click events attached to the series, to signal to the user that - * the points and lines can be clicked. - */ - cursor?: string; - /** - * A name for the dash style to use for the graph. Applies only to series type having a graph, like line, spline, - * area and scatter in case it has a lineWidth. The value for the dashStyle include: - * - Solid - * - ShortDash - * - ShortDot - * - ShortDashDot - * - ShortDashDotDot - * - Dot - * - Dash - * - LongDash - * - DashDot - * - LongDashDot - * - LongDashDotDot - * @default 'Solid' - */ - dashStyle?: string; - dataLabels?: DataLabels; - /** - * Enable or disable the mouse tracking for a specific series. This includes point tooltips and click events on - * graphs and points. For large datasets it improves performance. - * @default true - */ - enableMouseTracking?: boolean; - events?: PlotEvents; - /** - * Whether to use the Y extremes of the total chart width or only the zoomed area when zooming in on parts of the X - * axis. By default, the Y axis adjusts to the min and max of the visible data. Cartesian series only. - * @default false - * @since 4.1.6 - */ - getExtremesFromAll?: boolean; - /** - * An array specifying which option maps to which key in the data point array. This makes it convenient to work with - * unstructured data arrays from different sources. - * @since 4.1.6 - */ - keys?: string[]; - /** - * Pixel with of the graph line. - * @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 - * toggles the linked series. - * @since 3.0 - */ - linkedTo?: string; - marker?: Marker; - /** - * The color for the parts of the graph or points that are below the threshold. - * @default null. - * @since 3.0 - */ - negativeColor?: string; - point?: { - events: PointEvents; - }; - /** - * If no x values are given for the points in a series, pointInterval defines the interval of the x values. For - * example, if a series contains one value every decade starting from year 0, set pointInterval to 10. - * - * Since Highcharts 4.1, it can be combined with pointIntervalUnit to draw irregular intervals. - * @default 1 - */ - pointInterval?: number; - /** - * On datetime series, this allows for setting the pointInterval to the two irregular time units, month and year. - * Combine it with pointInterval to draw quarters, 6 months, 10 years etc. - * @since 4.1.0 - */ - pointIntervalUnit?: string; - /** - * Possible values: null, 'on', 'between'. - * - * In a column chart, when pointPlacement is 'on', the point will not create any padding of the X axis. In a polar - * column chart this means that the first column points directly north. If the pointPlacement is 'between', the - * columns will be laid out between ticks. This is useful for example for visualising an amount between two points - * in time or in a certain sector of a polar chart. - * - * Since Highcharts 3.0.2, the point placement can also be numeric, where 0 is on the axis value, -0.5 is between - * this value and the previous, and 0.5 is between this value and the next. Unlike the textual options, numeric - * point placement options won't affect axis padding. - * - * Note that pointPlacement needs a pointRange to work. For column series this is computed, but for line-type series - * it needs to be set. - * - * Defaults to null in cartesian charts, 'between' in polar charts. - * @since 2.3.0 - */ - pointPlacement?: string | number; - /** - * If no x values are given for the points in a series, pointStart defines on what value to start. For example, if a - * series contains one yearly value starting from 1945, set pointStart to 1945. - * @default 0 - */ - pointStart?: number; - /** - * Whether to select the series initially. If showCheckbox is true, the checkbox next to the series name will be - * checked for a selected series. - * @default false - * @since 1.2.0 - */ - selected?: boolean; - /** - * Whether to apply a drop shadow to the graph line. Since 2.3 the shadow can be an object configuration containing - * color, offsetX, offsetY, opacity and width. - * @default false - */ - shadow?: boolean | Shadow; - /** - * If true, a checkbox is displayed next to the legend item to allow selecting the series. The state of the checkbox - * is determined by the selected option. - * @default false - * @since 1.2.0 - */ - showCheckbox?: boolean; - /** - * Whether to display this particular series or series type in the legend. The default value is true for standalone - * series, false for linked series. Defaults to true. - */ - showInLegend?: boolean; - /** - * When this is true, the series will not cause the Y axis to cross the zero plane (or threshold option) unless the - * data actually crosses the plane. - * - * For example, if softThreshold is false, a series of 0, 1, 2, 3 will make the Y axis show negative values - * according to the minPadding option. If softThreshold is true, the Y axis starts at 0. - * @default true - * @since 4.1.9 - */ - softTreshold?: boolean; - /** - * Whether to stack the values of each series on top of each other. Possible values are null to disable, 'normal' to - * stack by value or 'percent'. - */ - stacking?: string; - /** - * A wrapper object for all the series options in specific states. - */ - states?: { - /** - * Options for the hovered series - */ - hover?: LineStates; - }; - /** - * Sticky tracking of mouse events. When true, the mouseOut event on a series isn't triggered until the mouse moves - * over another series, or out of the plot area. When false, the mouseOut event on a series is triggered when the - * mouse leaves the area around the series' graph or markers. This also implies the tooltip. When stickyTracking is - * false and tooltip.shared is false, the tooltip will be hidden when moving the mouse between series. Defaults to - * true for line and area type series, but to false for columns, pies etc. - * @default true - * @since 2.0 - */ - stickyTracking?: boolean; - /** - * The Y axis value to serve as the base for the area, for distinguishing between values above and below a - * threshold. If null, the area behaves like a line series with fill between the graph and the Y axis minimum. - * @default 0 - * @since 2.0 - */ - threshold?: number; - /** - * A configuration object for the tooltip rendering of each single series. Properties are inherited from tooltip, - * but only the following properties can be defined on a series level. - * @since 2.3 - */ - tooltip?: SeriesTooltipOptions; - /** - * When a series contains a data array that is longer than this, only one dimensional arrays of numbers, or two - * dimensional arrays with x and y values are allowed. Also, only the first point is tested, and the rest are - * assumed to be the same format. This saves expensive data checking and indexing in long series. Set it to 0 - * disable. - * @default 1000 - * @since 2.2 - */ - turboThreshold?: number; - /** - * Set the initial visibility of the series. - * @default true - */ - visible?: boolean; - /** - * Defines the Axis on which the zones are applied. - * @default 'y' - * @since 4.1.0 - */ - zoneAxis?: string; - /** - * An array defining zones within a series. Zones can be applied to the X axis, Y axis or Z axis for bubbles, - * according to the zoneAxis option. - */ - zones?: AreaZone[]; - } - - interface AreaChart extends SeriesChart { - /** - * Fill color or gradient for the area. When null, the series' color is used with the series' fillOpacity. - */ - fillColor?: string | Gradient; - /** - * Fill opacity for the area. Note that when you set an explicit fillColor, the fillOpacity is not applied. Instead, - * you should define the opacity in the fillColor with an rgba color definition. - * @default 0.75 - */ - fillOpacity?: number; - /** - * A separate color for the graph line. By default the line takes the color of the series, but the lineColor setting - * allows setting a separate color for the line without altering the fillColor. - */ - lineColor?: string | Gradient; - /** - * A separate color for the negative part of the area. - * @since 3.0 - */ - negativeFillColor?: string; - /** - * Whether to apply steps to the line. Possible values are left, center and right. Prior to 2.3.5, only left was - * supported. - * - * @default 'false' - * @since 1.2.5 - */ - step?: string; - /** - * Whether the whole area or just the line should respond to mouseover tooltips and other mouse or touch events. - * @default false - * @since 1.1.6 - */ - trackByArea?: boolean; - } - - interface AreaRangeChart extends AreaChart { - /** - * Extended data labels for range series types. Range series data labels have no x and y options. Instead, they have - * xLow, xHigh, yLow and yHigh options to allow the higher and lower data label sets individually. - * @since 2.3.0 - */ - dataLabels?: RangeDataLabels; - } - - interface AreaSplineChart extends AreaChart { - } - - interface AreaSplineRangeChart extends AreaRangeChart { - } - - interface BarChart extends SeriesChart { - /** - * The color of the border surrounding each column or bar. - * @default '#FFFFFF' - */ - borderColor?: string | Gradient; - /** - * The corner radius of the border surrounding each column or bar. - * @default 0 - */ - borderRadius?: number; - /** - * The width of the border surrounding each column or bar. - * @default 1 - */ - borderWidth?: number; - /** - * When using automatic point colors pulled from the options.colors collection, this option determines whether the - * chart should receive one color per series or one color per point. Defaults to false. - * @default false - * @since 2.0 - */ - colorByPoint?: boolean; - /** - * A series specific or series type specific color set to apply instead of the global colors when colorByPoint is - * true. - * @since 3.0 - */ - colors?: string[]; - /** - * Depth of the columns in a 3D column chart. Requires highcharts-3d.js. - * @default 25 - * @since 4.0 - */ - depth?: number; - /** - * 3D columns only. The color of the edges. Similar to borderColor, except it defaults to the same color as the - * column. - */ - edgeColor?: string; - /** - * 3D columns only. The width of the colored edges. - * @default 1 - */ - edgeWidth?: number; - /** - * Padding between each value groups, in x axis units. - * @default 0.2 - */ - groupPadding?: number; - /** - * The spacing between columns on the Z Axis in a 3D chart. Requires highcharts-3d.js. - * @default 1 - * @since 4.0 - */ - groupZPadding?: number; - /** - * Whether to group non-stacked columns or to let them render independent of each other. Non-grouped columns will be - * laid out individually and overlap each other. - * @default true - * @since 2.3.0 - */ - grouping?: boolean; - /** - * The maximum allowed pixel width for a column, translated to the height of a bar in a bar chart. This prevents the - * columns from becoming too wide when there is a small number of points in the chart. - * @default null - * @since 4.1.8 - */ - maxPointWidth?: number; - /** - * The minimal height for a column or width for a bar. By default, 0 values are not shown. To visualize a 0 (or - * close to zero) point, set the minimal point length to a pixel value like 3. In stacked column charts, - * minPointLength might not be respected for tightly packed values. - * @default 0 - */ - minPointLength?: number; - /** - * Padding between each column or bar, in x axis units. - * @default 0.1 - */ - pointPadding?: string | number; - /** - * The X axis range that each point is valid for. This determines the width of the column. On a categorized axis, - * the range will be 1 by default (one category unit). On linear and datetime axes, the range will be computed as - * the distance between the two closest data points. - * @since 2.3 - */ - pointRange?: number; - /** - * A pixel value specifying a fixed width for each column or bar. When null, the width is calculated from the - * pointPadding and groupPadding. - * @since 1.2.5 - */ - pointWidth?: number; - /** - * A wrapper object for all the series options in specific states. - */ - states?: { - /** - * Options for the hovered series - */ - hover?: BarStates; - }; - } - - /** - * A box plot is a convenient way of depicting groups of data through their five-number summaries: the smallest - * observation (sample minimum), lower quartile (Q1), median (Q2), upper quartile (Q3), and largest observation (sample - * maximum). - */ - interface BoxPlotChart extends ErrorBarChart { - /** - * The fill color of the box. - * @default '#FFFFFF' - * @since 3.0 - */ - fillColor?: string; - /** - * Padding between each value groups, in x axis units. - * @default 0.2 - */ - groupPadding?: number; - /** - * Whether to group non-stacked columns or to let them render independent of each other. Non-grouped columns will be - * laid out individually and overlap each other. - * @default true - * @since 2.3.0 - */ - grouping?: boolean; - /** - * 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 - * toggles the linked series. - * @since 3.0 - */ - linkedTo?: string; - /** - * The color of the median line. If null, the general series color applies. - * @default null - * @since 3.0 - */ - medianColor?: string; - /** - * The pixel width of the median line. If null, the lineWidth is used. - * @default 2 - * @since 3.0 - */ - medianWidth?: number; - } - - /** - * A bubble series is a three dimensional series type where each point renders an X, Y and Z value. Each points is drawn - * as a bubble where the position along the X and Y axes mark the X and Y values, and the size of the bubble relates to - * the Z value. - */ - interface BubbleChart extends SeriesChart { - /** - * Whether to display negative sized bubbles. The threshold is given by the zThreshold option, and negative bubbles - * can be visualized by setting negativeColor. - * @default true - * @since 3.0 - */ - displayNegative?: boolean; - /** - * Maximum bubble size. Bubbles will automatically size between the minSize and maxSize to reflect the z value of - * each bubble. Can be either pixels (when no unit is given), or a percentage of the smallest one of the plot width - * and height. - * @default '20%' - * @since 3.0 - */ - maxSize?: string | number; - /** - * Minimum bubble size. Bubbles will automatically size between the minSize and maxSize to reflect the z value of - * each bubble. Can be either pixels (when no unit is given), or a percentage of the smallest one of the plot width - * and height. - * @default 8 - * @since 3.0 - */ - minSize?: string | number; - /** - * When a point's Z value is below the zThreshold setting, this color is used. - * @default null - * @since 3.0 - */ - negativeColor?: string; - /** - * Whether the bubble's value should be represented by the area or the width of the bubble. The default, area, - * corresponds best to the human perception of the size of each bubble. - * @default 'area' - * @since 3.0.7 - */ - sizeBy?: string; - /** - * When this is true, the absolute value of z determines the size of the bubble. This means that with the default - * zThreshold of 0, a bubble of value -1 will have the same size as a bubble of value 1, while a bubble of value 0 - * will have a smaller size according to minSize. - * @default false - * @since 4.1.9 - */ - sizeByAbsoluteValues?: boolean; - /** - * The maximum for the Z value range. Defaults to the highest Z value in the data. - * @default null - * @since 4.0.3 - */ - zMax?: number; - /** - * The minimum for the Z value range. Defaults to the lowest Z value in the data. - * @default null - * @since 4.0.3 - */ - zMin?: number; - /** - * When displayNegative is false, bubbles with lower Z values are skipped. When displayNegative is true and a - * negativeColor is given, points with lower Z is colored. - * @default 0 - * @since 3.0 - */ - zThreshold?: number; - } - - interface ColumnChart extends BarChart { - } - - /** - * The column range is a cartesian series type with higher and lower Y values along an X axis. Requires - * highcharts-more.js. To display horizontal bars, set chart.inverted to true. - */ - interface ColumnRangeChart extends ColumnChart { - dataLabels?: RangeDataLabels; - } - - /** - * Error bars are a graphical representation of the variability of data and are used on graphs to indicate the error, or - * uncertainty in a reported measurement. - */ - interface ErrorBarChart extends SeriesChart { - /** - * When using automatic point colors pulled from the options.colors collection, this option determines whether the - * chart should receive one color per series or one color per point. - * @default false - * @since 2.0 - */ - colorByPoint?: boolean; - /** - * A series specific or series type specific color set to apply instead of the global colors when colorByPoint is - * true. - * @since 3.0 - */ - colors?: string[]; - /** - * Depth of the columns in a 3D column chart. Requires highcharts-3d.js. - * @default 25 - * @since 4.0 - */ - depth?: number; - /** - * 3D columns only. The color of the edges. Similar to borderColor, except it defaults to the same color as the - * column. - */ - edgeColor?: string; - /** - * 3D columns only. The width of the colored edges. - * @default 1 - */ - edgeWidth?: number; - /** - * The spacing between columns on the Z Axis in a 3D chart. Requires highcharts-3d.js. - * @default 1 - * @since 4.0 - */ - groupZPadding?: number; - /** - * The parent series of the error bar. The default value links it to the previous series. Otherwise, use the id of - * the parent series. - * @default ':previous' - * @since 3.0 - */ - linkedTo?: string; - /** - * The maximum allowed pixel width for a column, translated to the height of a bar in a bar chart. This prevents the - * columns from becoming too wide when there is a small number of points in the chart. - * @default null - * @since 4.1.8 - */ - maxPointWidth?: number; - /** - * Padding between each column or bar, in x axis units. - * @default 0.1 - */ - pointPadding?: number; - /** - * The X axis range that each point is valid for. This determines the width of the column. On a categorized axis, - * the range will be 1 by default (one category unit). On linear and datetime axes, the range will be computed as - * the distance between the two closest data points. - * @since 2.3 - */ - pointRange?: number; - /** - * A pixel value specifying a fixed width for each column or bar. When null, the width is calculated from the - * pointPadding and groupPadding. - * @since 1.2.5 - */ - pointWidth?: number; - /** - * A wrapper object for all the series options in specific states. - */ - states?: { - /** - * Options for the hovered series - */ - hover?: BarStates; - }; - /** - * The color of the stem, the vertical line extending from the box to the whiskers. If null, the series color is - * used. - * @default null - * @since 3.0 - */ - stemColor?: string; - /** - * The dash style of the stem, the vertical line extending from the box to the whiskers. - * @default 'Solid' - * @since 3.0 - */ - stemDashStyle?: string; - /** - * The width of the stem, the vertical line extending from the box to the whiskers. If null, the width is inherited - * from the lineWidth option. - * @default null - * @since 3.0 - */ - stemWidth?: number; - /** - * The color of the whiskers, the horizontal lines marking low and high values. When null, the general series color - * is used. - * @default null - * @since 3.0 - */ - whiskerColor?: string; - /** - * The length of the whiskers, the horizontal lines marking low and high values. It can be a numerical pixel value, - * or a percentage value of the box width. Set 0 to disable whiskers. - * @default '50%' - * @since 3.0 - */ - whiskerLength?: number | string; - /** - * The line width of the whiskers, the horizontal lines marking low and high values. When null, the general - * lineWidth applies. - * @default 2 - * @since 3.0 - */ - whiskerWidth?: number; - } - - /** - * Funnel charts are a type of chart often used to visualize stages in a sales project, where the top are the initial - * stages with the most clients. It requires that the modules/funnel.js file is loaded - */ - interface FunnelChart extends SeriesChart { - /** - * The color of the border surrounding each column or bar. - * @default '#FFFFFF' - */ - borderColor?: string | Gradient; - /** - * The width of the border surrounding each column or bar. - * @default 1 - */ - borderWidth?: number; - /** - * The center of the series. By default, it is centered in the middle of the plot area, so it fills the plot area - * height. - * @default ['50%', '50%'] - * @since 3.0 - */ - center?: [string | number, string | number]; - /** - * A series specific or series type specific color set to use instead of the global colors. - * @since 3.0 - */ - colors?: string[]; - dataLabels?: PieDataLabels; - /** - * The thickness of a 3D pie. Requires highcharts-3d.js - * @default 0 - * @since 4.0 - */ - depth?: number; - /** - * The height of the funnel or pyramid. If it is a number it defines the pixel height, if it is a percentage string - * it is the percentage of the plot area height. - * @since 3.0 - */ - height?: number | string; - /** - * The minimum size for a pie in response to auto margins. The pie will try to shrink to make room for data labels - * in side the plot area, but only to this size. - * @default 80 - * @since 3.0 - */ - minSize?: number; - /** - * The height of the neck, the lower part of the funnel. A number defines pixel width, a percentage string defines a - * percentage of the plot area height. - * @default '25%' - */ - neckHeight?: number | string; - /** - * The width of the neck, the lower part of the funnel. A number defines pixel width, a percentage string defines a - * percentage of the plot area width. - * @default '30%' - * @since 3.0 - */ - neckWidth?: number | string; - /** - * A reversed funnel has the widest area down. A reversed funnel with no neck width and neck height is a pyramid. - * @default false - * @since 3.0.10 - */ - reversed?: boolean; - /** - * If a point is sliced, moved out from the center, how many pixels should it be moved? - * @default 10 - */ - slicedOffset?: number; - /** - * A wrapper object for all the series options in specific states. - */ - states?: { - /** - * Options for the hovered series - */ - hover?: PieStates; - }; - /** - * The width of the funnel compared to the width of the plot area, or the pixel width if it is a number. - * @default '90%' - * @since 3.0 - */ - width?: number | string; - } - - /** - * General plotting options for the gauge series type. Requires highcharts-more.js - */ - interface GaugeChart extends SeriesChart { - /** - * Data labels for the gauge. For gauges, the data labels are enabled by default and shown in a bordered box below - * the point. - */ - datalabels?: DataLabels; - /** - * Options for the dial or arrow pointer of the gauge. - */ - dial?: Dial; - /** - * Allow the dial to overshoot the end of the perimeter axis by this many degrees. Say if the gauge axis goes from 0 - * to 60, a value of 100, or 1000, will show 5 degrees beyond the end of the axis. Defaults to 0. - * @default 0 - * @since 3.0.10 - */ - overshoot?: number; - /** - * Options for the pivot or the center point of the gauge. - * @since 2.3.0 - */ - pivot?: Pivot; - /** - * When this option is true, the dial will wrap around the axes. For instance, in a full-range gauge going from 0 to - * 360, a value of 400 will point to 40. When wrap is false, the dial stops at 360. - * @default true - * @since 3.0 - */ - wrap?: boolean; - } - - /** - * The heatmap series type. This series type is available both in Highcharts and Highmaps. - * The colors of each heat map point is usually determined by its value and controlled by settings on the colorAxis. - */ - interface HeatMapChart extends SeriesChart { - /** - * The color of the border surrounding each column or bar. - * @default '#FFFFFF' - */ - borderColor?: string | Gradient; - /** - * The corner radius of the border surrounding each column or bar. - * @default 0 - */ - borderRadius?: number; - /** - * The width of the border surrounding each column or bar. - * @default 1 - */ - borderWidth?: number; - /** - * When using automatic point colors pulled from the options.colors collection, this option determines whether the - * chart should receive one color per series or one color per point. Defaults to false. - * @default false - * @since 2.0 - */ - colorByPoint?: boolean; - /** - * A series specific or series type specific color set to apply instead of the global colors when colorByPoint is - * true. - * @since 3.0 - */ - colors?: string[]; - /** - * The columns size - how many X axis units each column in the heatmap should span. - * @default 1 - * @since 4.0 - */ - colsize?: number; - /** - * When the series contains less points than the crop threshold, all points are drawn, event if the points fall - * outside the visible plot area at the current zoom. The advantage of drawing all points (including markers and - * columns), is that animation is performed on updates. On the other hand, when the series contains more points than - * the crop threshold, the series data is cropped to only contain points that fall within the plot area. The - * advantage of cropping away invisible points is to increase performance on large series. - * @default 50 - */ - cropTreshold?: number; - /** - * The maximum allowed pixel width for a column, translated to the height of a bar in a bar chart. This prevents the - * columns from becoming too wide when there is a small number of points in the chart. - * @default null - * @since 4.1.8 - */ - maxPointWidth?: number; - /** - * The row size - how many Y axis units each heatmap row should span. - * @default 1 - * @since 4.0 - */ - rowsize?: number; - /** - * A wrapper object for all the series options in specific states. - */ - states?: { - /** - * Options for the hovered series - */ - hover?: BarStates; - } - } - - interface LineChart extends SeriesChart { - /** - * Whether to apply steps to the line. Possible values are left, center and right. Prior to 2.3.5, only left was - * supported. - * @default false - * @since 1.2.5 - */ - step?: boolean | string; - } - - /** - * A pie chart is a circular chart divided into sectors, illustrating numerical proportion. - */ - interface PieChart extends SeriesChart { - /** - * 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 | Gradient; - /** - * The width of the border surrounding each column or bar. - * @default 1 - */ - borderWidth?: number; - /** - * The center of the pie chart relative to the plot area. Can be percentages or pixel values. The default behaviour - * (as of 3.0) is to center the pie so that all slices and data labels are within the plot area. As a consequence, - * the pie may actually jump around in a chart with dynamic values, as the data labels move. In that case, the - * center should be explicitly set, for example to ['50%', '50%']. - * @default [null, null] - */ - center?: [string | number, string | number]; - /** - * A series specific or series type specific color set to use instead of the global colors. - * @since 3.0 - */ - colors?: string[]; - dataLabels?: PieDataLabels; - /** - * The thickness of a 3D pie. Requires highcharts-3d.js - * @default 0 - * @since 4.0 - */ - depth?: number; - /** - * The end angle of the pie in degrees where 0 is top and 90 is right. Defaults to startAngle plus 360. - * @default null - * @since 1.3.6 - */ - endAngle?: number; - /** - * Equivalent to chart.ignoreHiddenSeries, this option tells whether the series shall be redrawn as if the hidden - * point were null. - * - * The default value changed from false to true with Highcharts 3.0. - * - * @default true - * @since 2.3.0 - */ - ignoreHiddenPoint?: boolean; - /** - * The size of the inner diameter for the pie. A size greater than 0 renders a donut chart. Can be a percentage or - * pixel value. Percentages are relative to the pie size. Pixel values are given as integers. - * - * Note: in Highcharts < 4.1.2, the percentage was relative to the plot area, not the pie size. - * @default 0 - * @since 2.0 - */ - innerSize?: number | string; - /** - * The minimum size for a pie in response to auto margins. The pie will try to shrink to make room for data labels - * in side the plot area, but only to this size. - * @default 80 - * @since 3.0 - */ - minSize?: number; - /** - * The diameter of the pie relative to the plot area. Can be a percentage or pixel value. Pixel values are given as - * integers. The default behaviour (as of 3.0) is to scale to the plot area and give room for data labels within the - * plot area. As a consequence, the size of the pie may vary when points are updated and data labels more around. In - * that case it is best to set a fixed value, for example '75%'. - */ - size?: number | string; - /** - * If a point is sliced, moved out from the center, how many pixels should it be moved? - * @default 10 - */ - slicedOffset?: number; - /** - * The start angle of the pie slices in degrees where 0 is top and 90 right. - * @default 0 - * @since 2.3.4 - */ - startAngle?: number; - /** - * A wrapper object for all the series options in specific states. - */ - states?: { - /** - * Options for the hovered series - */ - hover?: PieStates; - }; - } - - /** - * A polygon series can be used to draw any freeform shape in the cartesian coordinate system. A fill is applied with - * the color option, and stroke is applied through lineWidth and lineColor options. Requires the highcharts-more.js - * file. - */ - interface PolygonChart extends SeriesChart { - /** - * The width of the line connecting the data points. - * @default 0 - */ - lineWidth?: number; - } - - interface PyramidChart extends SeriesChart { - /** - * The color of the border surrounding each slice - * @default '#FFFFFF' - */ - borderColor?: string | Gradient; - /** - * The width of the border surrounding each slice - * @default 1 - */ - borderWidth?: number; - /** - * The center of the series. By default, it is centered in the middle of the plot area, so it fills the plot area - * height. - * @default ['50%', '50%'] - * @since 3.0 - */ - center?: [string | number, string | number]; - /** - * A series specific or series type specific color set to use instead of the global colors. - * @since 3.0 - */ - colors?: string[]; - dataLabels?: PieDataLabels; - /** - * The thickness of a 3D pie. Requires highcharts-3d.js - * @default 0 - * @since 4.0 - */ - depth?: number; - /** - * The height of the funnel or pyramid. If it is a number it defines the pixel height, if it is a percentage string - * it is the percentage of the plot area height. - * @since 3.0 - */ - height?: number | string; - /** - * The minimum size for a pie in response to auto margins. The pie will try to shrink to make room for data labels - * in side the plot area, but only to this size. - * @default 80 - * @since 3.0 - */ - minSize?: number; - /** - * The pyramid is reversed by default, as opposed to the funnel, which shares the layout engine, and is not - * reversed. - * @default true - * @since 3.0.10 - */ - reversed?: boolean; - /** - * If a point is sliced, moved out from the center, how many pixels should it be moved? - * @default 10 - */ - slicedOffset?: number; - /** - * A wrapper object for all the series options in specific states. - */ - states?: { - /** - * Options for the hovered series - */ - hover?: PieStates; - }; - /** - * The width of the pyramid compared to the width of the plot area, or the pixel width if it is a number. - * @default '90%' - * @since 3.0 - */ - width?: number | string; - } - - interface ScatterChart extends SeriesChart { } - - /** - * A gauge showing values using a filled arc with colors indicating the value. The solid gauge plots values against the - * yAxis, which is extended with some color options, minColor, maxColor and stops, to control the color of the gauge - * itself. - */ - interface SolidGaugeChart extends SeriesChart { - /** - * Allow the dial to overshoot the end of the perimeter axis by this many degrees. Say if the gauge axis goes from 0 - * to 60, a value of 100, or 1000, will show 5 degrees beyond the end of the axis. - * @default 0 - * @since 3.0.10 - */ - overshoot?: number; - /** - * When this option is true, the dial will wrap around the axes. For instance, in a full-range gauge going from 0 to - * 360, a value of 400 will point to 40. When wrap is false, the dial stops at 360. - * @default true - * @since 3.0 - */ - wrap?: boolean; - } - - interface SplineChart extends SeriesChart { } - - /** - * The size of the point shape is determined by its value relative to its siblings values. Requires the module - * heatmap.js as well, if functionality such as the colorAxis is to be used. - */ - interface TreeMapChart extends SeriesChart { - /** - * When enabled the user can click on a point which is a parent and zoom in on its children. - * @default false - * @since 4.1.0 - */ - allowDrillToNode?: boolean; - /** - * Enabling this option will make the treemap alternate the drawing direction between vertical and horizontal. The - * next levels starting direction will always be the opposite of the previous. - * @default false - * @since 4.1.0 - */ - alternateStartingDirection?: boolean; - /** - * The color of the border surrounding each tree map item. - * @default '#E0E0E0' - */ - borderColor?: string | Gradient; - /** - * The width of the border surrounding each column or bar. - * @default 1 - */ - borderWidth?: number; - /** - * When using automatic point colors pulled from the options.colors collection, this option determines whether the - * chart should receive one color per series or one color per point. - * @default false - * @since 2.0 - */ - colorByPoint?: boolean; - /** - * A series specific or series type specific color set to apply instead of the global colors when colorByPoint is - * true. - * @since 3.0 - */ - colors?: string[]; - /** - * This option decides if the user can interact with the parent nodes or just the leaf nodes. When this option is - * undefined, it will be true by default. However when allowDrillToNode is true, then it will be false by default. - * @since 4.1.2 - */ - interactByLeaf?: boolean; - /** - * This option decides which algorithm is used for setting position and dimensions of the points. Can be one of - * 'sliceAndDice', 'stripes', 'squarified' or 'strip'. - * @default 'sliceAndDice' - * @since 4.1.0 - */ - layoutAlgorithm?: string; - /** - * Defines which direction the layout algorithm will start drawing. Possible values are 'vertical' and 'horizontal'. - * @default 'vertical' - * @since 4.1.0 - */ - layoutStartingDirection?: string; - /** - * Used together with the levels and allowDrillToNode options. When set to false the first level visible when - * drilling is considered to be level one. Otherwise the level will be the same as the tree structure. - * @default true - * @since 4.1.0 - */ - levelIsConstant?: boolean; - /** - * Set options on specific levels. Takes precedence over series options, but not point options. - */ - levels?: TreeMapLevel[]; - /** - * The maximum allowed pixel width for a column, translated to the height of a bar in a bar chart. This prevents the - * columns from becoming too wide when there is a small number of points in the chart. - * @default null - * @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. - */ - states?: { - /** - * Options for the hovered series - */ - hover?: BarStates; - } - } - - interface WaterFallChart extends BarChart { - /** - * A name for the dash style to use for the graph. Applies only to series type having a graph, like line, spline, - * area and scatter in case it has a lineWidth. The value for the dashStyle include: - * - Solid - * - ShortDash - * - ShortDot - * - ShortDashDot - * - ShortDashDotDot - * - Dot - * - Dash - * - LongDash - * - DashDot - * - LongDashDot - * - LongDashDotDot - * @default 'Dot' - */ - dashStyle?: string; - /** - * The color of the line that connects columns in a waterfall series. - * @default '#333333' - * @since 3.0 - */ - lineColor?: string | Gradient; - /** - * The color used specifically for positive point columns. When not specified, the general series color is used. - */ - upColor?: string; - } - - /** - * The plotOptions is a wrapper object for config objects for each series type. The config objects for each series can - * also be overridden for each series item as given in the series array. - * - * Configuration options for the series are given in three levels. Options for all series in a chart are given in the - * plotOptions.series object. Then options for all series of a specific type are given in the plotOptions of that type, - * for example plotOptions.line. Next, options for one single series are given in the series array. - */ - interface PlotOptions { - area?: AreaChart; - arearange?: AreaRangeChart; - areaspline?: AreaSplineChart; - areasplinerange?: AreaSplineRangeChart; - bar?: BarChart; - boxplot?: BoxPlotChart; - bubble?: BubbleChart; - column?: ColumnChart; - columnrange?: ColumnRangeChart; - errorbar?: ErrorBarChart; - funnel?: FunnelChart; - gauge?: GaugeChart; - heatmap?: HeatMapChart; - line?: LineChart; - pie?: PieChart; - polygon?: PolygonChart; - pyramid?: PyramidChart; - scatter?: ScatterChart; - series?: SeriesChart; - solidgauge?: SolidGaugeChart; - spline?: SplineChart; - treemap?: TreeMapChart; - waterfall?: WaterFallChart; - } - - /* You will rarely, if ever, want to use this interface directly. Instead it is much more useful to use one of the derived - * interfaces (AreaChartSeriesOptions, LineChartSeriesOptions, etc.) - */ - interface IndividualSeriesOptions { - type?: string; - /** - * The main color or the series. In line type series it applies to the line and the point markers unless otherwise - * specified. In bar type series it applies to the bars unless a color is specified per point. The default - * value is pulled from the options.colors array. - */ - color?: string | Gradient; - /** - * You can set the cursor to "pointer" if you have click events attached to the series, to signal to the user - * that the points and lines can be clicked. - */ - cursor?: string; - /** - * An array of data points for the series. For the area series type, points can be given in the following ways: - * - * 1. An array of numerical values. In this case, the numerical values will be interpreted as y options. The x - * values will be automatically calculated, either starting at 0 and incremented by 1, or from pointStart and - * pointInterval given in the series options. If the axis has categories, these will be used. Example: - * data: [0, 5, 3, 5] - * - * 2. An array of arrays with 2 values. In this case, the values correspond to x,y. If the first value is a string, - * it is applied as the name of the point, and the x value is inferred. - * data: [ - * [0, 9], - * [1, 7], - * [2, 6] - * ] - * - * 3. An array of objects with named values. The objects are point configuration objects as seen below. If the total - * number of data points exceeds the series' turboThreshold, this option is not available. - * data: [{ - * x: 1, - * y: 9, - * name: 'Point2', - * color: '#00FF00' - * }, { - * x: 1, - * y: 6, - * name: 'Point1', - * color: '#FF00FF' - * }] - */ - data?: number[] | [number, number][] | [string, number][] | DataPoint[]; - /** - * An id for the series. This can be used after render time to get a pointer to the series object through - * chart.get(). - */ - id?: string; - /** - * The index of the series in the chart, affecting the internal index in the chart.series array, the visible Z index - * as well as the order in the legend. - * @since 2.3.0 - */ - index?: number; - /** - * The sequential index of the series in the legend. - */ - legendIndex?: number; - /** - * The name of the series as shown in the legend, tooltip etc. - */ - name?: string; - /** - * A pixel value specifying a fixed width for each column or bar. When null, the width is calculated from - * the pointPadding and groupPadding. - */ - pointWidth?: number; - /** - * This option allows grouping series in a stacked chart. The stack option can be a string or a number or anything - * else, as long as the grouped series' stack options match each other. - * @since 2.1 - */ - stack?: any; - /** - * When using dual or multiple x axes, this number defines which xAxis the particular series is connected to. It - * refers to either the axis id or the index of the axis in the xAxis array, with 0 being the first. - * @default 0 - */ - xAxis?: string | number; - /** - * When using dual or multiple x axes, this number defines which xAxis the particular series is connected to. It - * refers to either the axis id or the index of the axis in the xAxis array, with 0 being the first. - * @default 0 - */ - yAxis?: string | number; - /** - * Define the visual z index of the series. - */ - zIndex?: number; - } - - interface SeriesOptions extends IndividualSeriesOptions, SeriesChart { } - - interface AreaChartSeriesOptions extends IndividualSeriesOptions, AreaChart { } - interface AreaRangeChartSeriesOptions extends IndividualSeriesOptions, AreaRangeChart { } - interface AreaSplineChartSeriesOptions extends IndividualSeriesOptions, AreaSplineChart { } - interface AreaSplineRangeChartSeriesOptions extends IndividualSeriesOptions, AreaSplineRangeChart { } - interface BarChartSeriesOptions extends IndividualSeriesOptions, BarChart { } - interface BoxPlotChartSeriesOptions extends IndividualSeriesOptions, BoxPlotChart { } - interface BubbleChartSeriesOptions extends IndividualSeriesOptions, BubbleChart { } - interface ColumnChartSeriesOptions extends IndividualSeriesOptions, ColumnChart { } - interface ColumnRangeChartSeriesOptions extends IndividualSeriesOptions, ColumnRangeChart { } - interface ErrorBarChartSeriesOptions extends IndividualSeriesOptions, ErrorBarChart { } - interface FunnelChartSeriesOptions extends IndividualSeriesOptions, FunnelChart { } - interface GaugeChartSeriesOptions extends IndividualSeriesOptions, GaugeChart { } - interface HeatMapSeriesOptions extends IndividualSeriesOptions, HeatMapChart { } - interface LineChartSeriesOptions extends IndividualSeriesOptions, LineChart { } - interface PieChartSeriesOptions extends IndividualSeriesOptions, PieChart { } - interface PolygonChartSeriesOptions extends IndividualSeriesOptions, PolygonChart { } - interface PyramidChartSeriesOptions extends IndividualSeriesOptions, PyramidChart { } - interface ScatterChartSeriesOptions extends IndividualSeriesOptions, ScatterChart { } - interface SolidGaugeChartSeriesOptions extends IndividualSeriesOptions, SolidGaugeChart { } - interface SplineChartSeriesOptions extends IndividualSeriesOptions, SplineChart { } - interface TreeMapChartSeriesOptions extends IndividualSeriesOptions, TreeMapChart { } - interface WaterFallChartSeriesOptions extends IndividualSeriesOptions, WaterFallChart { } - - interface DataPoint { - /** - * Individual color for the point. By default the color is pulled from the global colors array. - * @default undefined - */ - color?: string | Gradient; - /** - * Serves a purpose only if a colorAxis object is defined in the chart options. This value will decide which color - * the point gets from the scale of the colorAxis. - * @default undefined - */ - colorValue?: number; - /** - * Individual data label for each point. The options are the same as the ones for plotOptions.series.dataLabels - */ - dataLabels?: DataLabels; - /** - * The id of a series in the drilldown.series array to use for a drilldown for this point. - * @since 3.0.8 - */ - drilldown?: string; - /** - * Individual point events - */ - events?: PointEvents; - /** - * The high or maximum value for each data point. - */ - high?: number; - /** - * An id for the point. This can be used after render time to get a pointer to the point object through chart.get(). - * @since 1.2.0 - */ - id?: string; - /** - * The inner radius of an individual point in a solid gauge. Can be given as a number (pixels) or percentage string. - * @since 4.1.6 - */ - innerRadius?: number | string; - /** - * When this property is true, the points acts as a summary column for the values added or substracted since the - * last intermediate sum, or since the start of the series. The y value is ignored. - * @default false - */ - isIntermediateSum?: boolean; - /** - * When this property is true, the point display the total sum across the entire series. The y value is ignored. - * @default false - */ - isSum?: boolean; - /** - * The sequential index of the data point in the legend. - */ - legendIndex?: number; - /** - * The low or minimum value for each data point. - */ - low?: number; - marker?: Marker; - /** - * The median for each data point. This is drawn as a line through the middle area of the box. - */ - median?: number; - /** - * The name of the point as shown in the legend, tooltip, dataLabel etc. - * - * If the xAxis.type is set to category, and no categories option exists, the category will be pulled from the - * point.name of the last series defined. For multiple series, best practice however is to define xAxis.categories. - */ - name?: string; - /** - * Only for treemap. Use this option to build a tree structure. The value should be the id of the point which is the - * parent. If no points has a matching id, or this option is undefined, then the parent will be set to the root. - * @default undefined - * @since 4.1.0 - */ - parent?: string; - /** - * The lower quartile for each data point. This is the bottom of the box. - */ - q1?: number; - /** - * The higher quartile for each data point. This is the top of the box. - */ - q3?: number; - /** - * The outer radius of an individual point in a solid gauge. Can be given as a number (pixels) or percentage string. - * @since 4.1.6 - */ - radius?: number | string; - /** - * Whether the data point is selected initially. - * @default false - */ - selected?: boolean; - /** - * Whether to display a slice offset from the center. - * @default false - */ - sliced?: boolean; - /** - * The value of the point, resulting in a relative area of the point in the treemap. - */ - value?: number; - /** - * The x value of the point. For datetime axes, the X value is the timestamp in milliseconds since 1970. - */ - x?: number; - /** - * The y value of the point. - */ - y?: number; - /** - * The size value for each bubble. The bubbles' diameters are computed based on the z, and controlled by series - * options like minSize, maxSize, sizeBy, zMin and zMax. - */ - z?: number; - } - - /** - * The chart's subtitle - */ - interface SubtitleOptions { - /** - * The horizontal alignment of the subtitle. Can be one of 'left', 'center' and 'right'. - * @default 'center' - * @since 2.0 - */ - align?: string; - /** - * When the subtitle is floating, the plot area will not move to make space for it. - * @default false - * @since 2.1 - */ - floating?: boolean; - /** - * CSS styles for the title. Exact positioning of the title can be achieved by changing the margin property, or by - * adding position: 'absolute' and left and top properties. - * @default { 'color': '#555555' } - */ - style?: Object; - /** - * The subtitle of the chart. - */ - text?: string; - /** - * Whether to {@link http://www.highcharts.com/docs/chart-concepts/labels-and-string-formatting#html|use HTML} to render the text. - * @default false - */ - useHTML?: boolean; - /** - * The vertical alignment of the title. Can be one of 'top', 'middle' and 'bottom'. When a value is given, the title - * behaves as floating. - * @since 2.1 - */ - verticalAlign?: string; - /** - * The x position of the subtitle relative to the alignment within chart.spacingLeft and chart.spacingRight. - * @default 0 - * @since 2.0 - */ - x?: number; - /** - * The y position of the subtitle relative to the alignment within chart.spacingTop and chart.spacingBottom. By - * default the subtitle is laid out below the title unless the title is floating. - * @default null - * @since 2.0 - */ - y?: number; - } - - interface TitleOptions { - /** - * The horizontal alignment of the title. Can be one of 'left', 'center' and 'right'. - * @default 'center' - * @since 2.0 - */ - align?: string; - /** - * When the title is floating, the plot area will not move to make space for it. - * @default false - * @since 2.1 - */ - floating?: boolean; - /** - * The margin between the title and the plot area, or if a subtitle is present, the margin between the subtitle and - * the plot area. - * @default 15 - * @since 2.1 - */ - margin?: number; - /** - * CSS styles for the title. Exact positioning of the title can be achieved by changing the margin property, or by - * adding position: 'absolute' and left and top properties. - * @default { 'color': '#333333', 'fontSize': '18px' } - */ - style?: Object; - /** - * The title of the chart. To disable the title, set the text to null. - * @default 'Chart title' - */ - text?: string; - /** - * Whether to {@link http://www.highcharts.com/docs/chart-concepts/labels-and-string-formatting#html|use HTML} to render the text. - * @default false - */ - useHTML?: boolean; - /** - * The vertical alignment of the title. Can be one of 'top', 'middle' and 'bottom'. When a value is given, the title - * behaves as floating. - * @since 2.1 - */ - verticalAlign?: string; - /** - * The x position of the title relative to the alignment within chart.spacingLeft and chart.spacingRight. - * @default 0 - * @since 2.0 - */ - x?: number; - /** - * The y position of the title relative to the alignment within chart.spacingTop and chart.spacingBottom. By default - * it depends on the font size. - * @default null - * @since 2.0 - */ - y?: number; - } - - interface CrosshairObject { - color?: string | Gradient; - width?: number; - dashStyle?: string; //Solid ShortDash ShortDot ShortDashDot ShortDashDotDot Dot Dash LongDash DashDot LongDashDot LongDashDotDot - zIndex?: number; - } - - interface PlotPoint { - plotX: number; - plotY: number; - } - - interface TooltipOptions extends SeriesTooltipOptions { - /** - * Enable or disable animation of the tooltip. In slow legacy IE browsers the animation is disabled by default. - * @default true - * @since 2.3.0 - */ - animation?: boolean; - /** - * The background color or gradient for the tooltip. - * @default 'rgba(255, 255, 255, 0.85)' - */ - backgroundColor?: string | Gradient; - /** - * The color of the tooltip border. When null, the border takes the color of the corresponding series or point. - * @default null - */ - borderColor?: string | Gradient; - /** - * The radius of the rounded border corners. - * @default 3 - */ - borderRadius?: number; - /** - * The pixel width of the tooltip border. - * @default 1 - */ - borderWidth?: number; - /** - * Display crosshairs to connect the points with their corresponding axis values. The crosshairs can be defined as a - * boolean, an array of booleans or an object. - * - * Boolean - * If the crosshairs option is true, a single crosshair relating to the x axis will be shown. - * - * Array of booleans - * In an array of booleans, the first value turns on the x axis crosshair and the second value to the y axis - * crosshair. Use [true, true] to show complete crosshairs. - * - * Array of objects - * In an array of objects, the first value applies to the x axis crosshair and the second value to the y axis - * crosshair. For each dimension, a width, color, dashStyle and zIndex can be given. - * - * @default null - */ - crosshairs?: boolean | [boolean, boolean] | CrosshairObject | [CrosshairObject, CrosshairObject]; - /** - * Enable or disable the tooltip. - * @default true - */ - enabled?: boolean; - /** - * Callback function to format the text of the tooltip. Return false to disable tooltip for a specific point on - * series. - * - * A subset of HTML is supported. The HTML of the tooltip is parsed and converted to SVG, therefore this isn't a - * complete HTML renderer. The following tabs are supported: , , , ,
        , . Spans can be - * styled with a style attribute, but only text-related CSS that is shared with SVG is handled. - * - * Since version 2.1 the tooltip can be shared between multiple series through the shared option. The available data - * in the formatter differ a bit depending on whether the tooltip is shared or not. In a shared tooltip, all - * properties except x, which is common for all points, are kept in an array, this.points. - * - * Available data are: - * this.percentage (not shared) / this.points[i].percentage (shared) - * Stacked series and pies only. The point's percentage of the total. - * this.point (not shared) / this.points[i].point (shared) - * The point object. The point name, if defined, is available through this.point.name. - * this.points - * In a shared tooltip, this is an array containing all other properties for each point. - * this.series (not shared) / this.points[i].series (shared) - * The series object. The series name is available through this.series.name. - * this.total (not shared) / this.points[i].total (shared) - * Stacked series only. The total value at this point's x value. - * this.x - * The x value. This property is the same regardless of the tooltip being shared or not. - * this.y (not shared) / this.points[i].y (shared) - * The y value. - */ - formatter?: () => boolean | string; - /** - * A callback function to place the tooltip in a default position. The callback receives three parameters: - * labelWidth, labelHeight and point, where point contains values for plotX and plotY telling where the reference - * point is in the plot area. Add chart.plotLeft and chart.plotTop to get the full coordinates. - * - * The return should be an object containing x and y values, for example { x: 100, y: 100 }. - * @since 2.2.4 - */ - positioner?: (labelWidth: number, labelHeight: number, point: PlotPoint) => { x: number; y: number; }; - /** - * Whether to apply a drop shadow to the tooltip. - * @default true - */ - shadow?: boolean; - /** - * The name of a symbol to use for the border around the tooltip. In Highcharts 3.x and less, the shape was square. - * @default 'callout' - * @since 4.0 - */ - shape?: string; - /** - * When the tooltip is shared, the entire plot area will capture mouse movement or touch events. Tooltip texts for - * series types with ordered data (not pie, scatter, flags etc) will be shown in a single bubble. This is - * recommended for single series charts and for tablet/mobile optimized charts. - * @default false - * @since 2.1 - */ - shared?: boolean; - /** - * Proximity snap for graphs or single points. Does not apply to bars, columns and pie slices. It defaults to 10 for - * mouse-powered devices and 25 for touch devices. Note that since Highcharts 4.1 the whole plot area by default - * captures pointer events in order to show the tooltip, so for tooltip.snap to make sense, stickyTracking must be - * false. - * @since 1.2.0 - */ - snap?: number; - /** - * CSS styles for the tooltip. The tooltip can also be styled through the CSS class .highcharts-tooltip - * @default { color: '#333333', fontSize: '12px', padding: '8px' } - */ - style?: Object; - /** - * Use HTML to render the contents of the tooltip instead of SVG. Using HTML allows advanced formatting like tables - * and images in the tooltip. It is also recommended for rtl languages as it works around rtl bugs in early Firefox. - * @default false - * @since 2.2 - */ - useHTML?: boolean; - } - - interface SeriesTooltipOptions { - /** - * For series on a datetime axes, the date format in the tooltip's header will by default be guessed based on the - * closest data points. This member gives the default string representations used for each unit. - */ - dateTimeLabelFormats?: DateTimeFormats; - /** - * Whether the tooltip should follow the mouse as it moves across columns, pie slices and other point types with an - * extent. By default it behaves this way for scatter, bubble and pie series by override in the plotOptions for - * those series types. - * - * For touch moves to behave the same way, followTouchMove must be true also. - * @default false - * @since 3.0 - */ - followPointer?: boolean; - /** - * Whether the tooltip should follow the finger as it moves on a touch device. If chart.zoomType is set, it will - * override followTouchMove. - * @default true - * @since 3.0.1 - */ - followTouchMove?: boolean; - /** - * A string to append to the tooltip format. - * @default 'false' - * @since 2.2 - */ - footerFormat?: string; - /** - * The HTML of the tooltip header line. Variables are enclosed by curly brackets. Available variables are point.key, - * series.name, series.color and other members from the point and series objects. The point.key variable contains - * the category name, x value or datetime string depending on the type of axis. For datetime axes, the point.key - * date format can be set using tooltip.xDateFormat. - * - * @default '{point.key}
        ' - */ - headerFormat?: string; - /** - * The number of milliseconds to wait until the tooltip is hidden when mouse out from a point or chart. - * @default 500 - * @since 3.0 - */ - hideDelay?: number; - /** - * The HTML of the point's line in the tooltip. Variables are enclosed by curly brackets. Available variables are - * point.x, point.y, series.name and series.color and other properties on the same form. Furthermore, point.y can be - * extended by the tooltip.valuePrefix and tooltip.valueSuffix variables. This can also be overridden for each - * series, which makes it a good hook for displaying units. - * - * @default '\u25CF {series.name}: {point.y}
        ' - * @since 2.2 - */ - pointFormat?: string; - /** - * A callback function for formatting the HTML output for a single point in the tooltip. Like the pointFormat - * string, but with more flexibility. - * - * The this keyword refers to the Point object. - * @since 4.1.0 - */ - pointFormatter?: () => string; - /** - * How many decimals to show in each series' y value. This is overridable in each series' tooltip options object. - * The default is to preserve all decimals. - * @since 2.2 - */ - valueDecimals?: number; - /** - * A string to prepend to each series' y value. Overridable in each series' tooltip options object. - * @since 2.2 - */ - valuePrefix?: string; - /** - * A string to append to each series' y value. Overridable in each series' tooltip options object. - * @since 2.2 - */ - valueSuffix?: string; - /** - * The format for the date in the tooltip header if the X axis is a datetime axis. The default is a best guess based - * on the smallest distance between points in the chart. - */ - xDateFormat?: string; - } - - interface Options { - /** - * Options regarding the chart area and plot area as well as general chart options. - */ - chart?: ChartOptions; - colorAxis?: ColorAxisOptions | ColorAxisOptions[]; - /** - * An array containing the default colors for the chart's series. When all colors are used, new colors are pulled - * from the start again. - * - * Default colors can also be set on a series or series.type basis, see column.colors, pie.colors. - * - * @default ['#7cb5ec', '#434348', '#90ed7d', '#f7a35c', '#8085e9', '#f15c80', '#e4d354', '#2b908f', '#f45b5b', '#91e8e1'] - */ - colors?: string[]; - /** - * Highchart by default puts a credits label in the lower right corner of the chart. This can be changed using these options. - */ - credits?: CreditsOptions; - /** - * The Data module provides a simplified interface for adding data to a chart from sources like CVS, HTML tables or - * grid views. See also the tutorial article on the Data module. - * - * It requires the modules/data.js file to be loaded. - * - * Please note that the default way of adding data in Highcharts, without the need of a module, is through the - * series.data option. - */ - data?: DataOptions; - /** - * Options for drill down, the concept of inspecting increasingly high resolution data through clicking on chart - * items like columns or pie slices. - * - * The drilldown feature requires the drilldown.js file to be loaded, found in the modules directory of the download - * package, or online at code.highcharts.com/modules/drilldown.js. - */ - drilldown?: DrilldownOptions; - /** - * Options for the exporting module. - */ - exporting?: ExportingOptions; - /** - * HTML labels that can be positioned anywhere in the chart area. - */ - labels?: LabelsOptions; - lang?: LangObject; - /** - * The legend is a box containing a symbol and name for each series item or point item in the chart. - */ - legend?: LegendOptions; - /** - * The loading options control the appearance of the loading screen that covers the plot area on chart operations. - * This screen only appears after an explicit call to chart.showLoading(). It is a utility for developers to - * communicate to the end user that something is going on, for example while retrieving new data via an XHR - * connection. The 'Loading...' text itself is not part of this configuration object, but part of the lang object. - */ - loading?: LoadingOptions; - /** - * A collection of options for buttons and menus appearing in the exporting module. - */ - navigation?: NavigationOptions; - /** - * Options for displaying a message like 'No data to display'. This feature requires the file no-data-to-display.js - * to be loaded in the page. The actual text to display is set in the lang.noData option. - */ - noData?: NoDataOptions; - /** - * Applies only to polar charts and angular gauges. This configuration object holds general options for the combined - * X and Y axes set. Each xAxis or yAxis can reference the pane by index. - */ - pane?: PaneOptions; - /** - * The plotOptions is a wrapper object for config objects for each series type. The config objects for each series - * can also be overridden for each series item as given in the series array. - * - * Configuration options for the series are given in three levels. Options for all series in a chart are given in - * the plotOptions.series object. Then options for all series of a specific type are given in the plotOptions of - * that type, for example plotOptions.line. Next, options for one single series are given in the series array. - */ - plotOptions?: PlotOptions; - /** - * The actual series to append to the chart. In addition to the members listed below, any member of the plotOptions - * for that specific type of plot can be added to a series individually. For example, even though a general - * lineWidth is specified in plotOptions.series, an individual lineWidth can be specified for each series. - */ - series?: IndividualSeriesOptions[]; - /** - * The chart's subtitle - */ - subtitle?: SubtitleOptions; - /** - * The chart's main title. - */ - title?: TitleOptions; - /** - * Options for the tooltip that appears when the user hovers over a series or point. - */ - tooltip?: TooltipOptions; - /** - * The X axis or category axis. Normally this is the horizontal axis, though if the chart is inverted this is the - * vertical axis. In case of multiple axes, the xAxis node is an array of configuration objects. - */ - xAxis?: AxisOptions[] | AxisOptions; - /** - * The Y axis or value axis. Normally this is the vertical axis, though if the chart is inverted this is the - * horizontal axis. In case of multiple axes, the yAxis node is an array of configuration objects. - */ - yAxis?: AxisOptions[] | AxisOptions; - } - - interface GlobalOptions extends Options { - /** - * Global options that don't apply to each chart. These options, like the lang options, must be set using the - * Highcharts.setOptions method. - */ - global?: GlobalObject; - /** - * Language object. The language object is global and it can't be set on each chart initiation. Instead, use - * Highcharts.setOptions to set it before any chart is initiated. - */ - lang?: LangObject; - } - - interface DateFormatSpecifiers { - [index: string]: (timestamp: number) => string; - } - - /** - * A chart can have from 0 axes (pie chart) to multiples. In a normal, single series cartesian chart, there is one X - * axis and one Y axis. - * - * The X axis or axes are referenced by chart.xAxis, which is an array of Axis objects. If there is only one axis, it - * can be referenced through chart.xAxis[0], and multiple axes have increasing indices. The same pattern goes for Y - * axes. - * - * If you need to get the axes from a series object, use the series.xAxis andseries.yAxis properties. These are not - * arrays, as one series can only be associated to one X and one Y axis. - * - * A third way to reference the axis programmatically is by id. Add an id in the axis configuration options, and get the - * axis by chart.get(id). - * - * Configuration options for the axes are given in options.xAxis and options.yAxis. - */ - interface AxisObject { - /** - * Add a plot band after render time. - * @param {PlotBands} options A configuration object consisting of the same members as options.xAxis.plotBands - * @since 1.2.0 - */ - addPlotBand(options: PlotBands): void; - /** - * Add a plot line after render time. - * @param {PlotLines} options A configuration object consisting of the same members as options.xAxis.plotLines - * @since 1.2.0 - */ - addPlotLine(options: PlotLines): void; - /** - * Get the current extremes for the axis. - * @since 1.2.0 - */ - getExtremes(): Extremes; - /** - * Remove an axis from the chart. - * @param [boolean] redraw Defaults to true. Whether to redraw the chart following the remove. - * @since 3.0 - */ - remove(redraw?: boolean): void; - /** - * Remove a plot band by its id. - * @param {string} id The plot band's id as given in the original configuration object or in the addPlotBand method. - * @since 1.2.0 - */ - removePlotBand(id: string): void; - /** - * Remove a plot line by its id. - * @param {string} id The plot line's id as given in the original configuration object or in the addPlotLine method. - * @since 1.2.0 - */ - removePlotLine(id: string): void; - /** - * Set new categories for the axis. Redraws. - * @param {string[]} categories The new category names. - * @since 1.2.0 - */ - setCategories(categories: string[]): void; - /** - * Set new categories for the axis. - * @param {string[]} categories The new category names. - * @param {boolean} redraw Whether to redraw the axis or wait for an explicit call to chart.redraw(). - * @since 1.2.0 - */ - setCategories(categories: string[], redraw: boolean): void; - /** - * Set the minimum and maximum of the axes after render time. If the startOnTick and endOnTick options are true, the - * minimum and maximum values are rounded off to the nearest tick. To prevent this, these options can be set to - * false before calling setExtremes. Also, setExtremes will not allow a range lower than the minRange option, which - * by default is the range of five points. - * @param {number} min The new minimum value - * @param {number} max The new maximum value - * @param {boolean} redraw Whether to redraw the chart or wait for an explicit call to chart.redraw(). - * @param {boolean | Animation} animation When true, the resize will be animated with default animation options. The animation can also be a configuration object with properties duration and easing. - * @since 1.2.0 - */ - setExtremes(min?: number, max?: number, redraw?: boolean, animation?: boolean | Animation, eventArguments?: any): void; - /** - * Update the title of the axis after render time. - * @param {AxisTitle} title The new title options on the same format as given in xAxis.title. - * @param {boolean} redraw Whether to redraw the chart now or hold until the next chart.redraw() - * @since 2.2 - */ - setTitle(title: AxisTitle, redraw?: boolean): void; - /** - * Translates a value in terms of axis units in to pixels within the chart. - * @param {number} value A value in terms of axis units. - * @param {boolean} paneCoordinates Whether to return the pixel coordinate relative to the chart or just the axis/pane itself. - * @return {number} - * @since 3.0 - */ - toPixels(value: number, paneCoordinates?: boolean): number; - /** - * Translate a pixel position along the axis to a value in terms of axis units. - * @param {number} pixel A pixel position along the axis. - * @param {boolean} paneCoordinates Whether the input pixel position is relative to the chart or just the axis/pane itself. - * @return {number} - * @since 3.0 - */ - toValue(pixel: number, paneCoordinates?: boolean): number; - /** - * Update an axis object with a new set of options. The options are merged with the existing options, so only new or - * altered options need to be specified. - * @param {AxisOptions} options The new options that will be merged in with existing options on the axis. - * @param {boolean} redraw Defaults to true. Whether to redraw the chart after the new options are set. - * @since 3.0 - */ - update(options: AxisOptions, redraw?: boolean): void; - } - - /** - * The chart object is the JavaScript object representing a single chart in the web page.The pointer to your chart - * object is returned when a chart is created using the Highcharts.Chart() constructor: - * var chart1 = new Highcharts.Chart(options); - */ - interface ChartObject { - /** - * Add an axis to the chart after render time. Note that this method should never be used when adding data - * synchronously at chart render time, as it adds expense to the calculations and rendering. When adding data at the - * same time as the chart is initiated, add the axis as a configuration option instead. - * @param {AxisOptions} options The Axis options, as documented under xAxis and yAxis. - * @param [boolean] isX Whether it is an X axis or Y axis - * @param [boolean] redraw Defaults to true. Whether to redraw the chart after the series is added. See the redraw() method. - * @param [boolean | Animation] animation Defaults to true. When true, the series' updating will be animated with default animation options. The animation can also be a configuration object with properties duration and easing. - * @return {AxisObject} - * @since 3.0 - */ - addAxis(options: AxisOptions, isX?: boolean, redraw?: boolean, animation?: boolean | Animation): AxisObject; - /** - * Add a series to the chart after render time. Note that this method should never be used when adding data - * synchronously at chart render time, as it adds expense to the calculations and rendering. When adding data at the - * same time as the chart is initiated, add the series as a configuration option instead. - * @param {T} options The series options, as documented under plotOptions.series and under the plotOptions for each series type. - * @param [boolean] redraw - * @since 1.2.0 - */ - addSeries(options: T, redraw?: boolean, animation?: boolean | Animation): SeriesObject; - /** - * Add a series to the chart as drilldown from a specific point in the parent series. This method is used for async - * drilldown, when clicking a point in a series should result in loading and displaying a more high-resolution - * series. When not async, the setup is simpler using the drilldown.series options structure. - * @param {PointObject} point The existing Point object from which the drilldown will start. - * @param {IndividualSeriesOptions} seriesOptions The series options, as documented under plotOptions.series and under the plotOptions for each series type. - * @since 3.0.8 - */ - addSeriesAsDrilldown(point: PointObject, seriesOptions: IndividualSeriesOptions): void; - /** - * A reference to the containing HTML element, dynamically inserted into the element given in chart.renderTo. - * @since 1.2.5 - */ - container: HTMLElement; - /** - * Removes the chart and purges memory. This method should be called before writing a new chart into the same - * container. It is called internally on window unload to prevent leaks. - * @since 1.2.2 - */ - destroy(): void; - /** - * When the chart is drilled down to a child series, calling chart.drillUp() will drill up to the parent series. - * @since 3.0.8 - */ - drillUp(): void; - /** - * Exporting module required. Submit an SVG version of the chart to a server along with some parameters for - * conversion. - * @since 2.0 - */ - exportChart(): void; - /** - * Exporting module required. Submit an SVG version of the chart to a server along with some parameters for - * conversion. - * @param {ExportingOptions} options Exporting options. Out of the exporting options, the following options can be given as parameters to the exportChart method. All options default to the values given in the exporting config options. filename: the filename for the export without extension, url: the URL for the server module to do the conversion, width: the width of the PNG or JPEG image generated on the server, type: the MIME type of the converted image, sourceWidth: the width of the source (in-page) chart, sourceHeight: the height of the source chart. - * @since 2.0 - */ - exportChart(options: ExportingOptions): void; - /** - * Exporting module required. Submit an SVG version of the chart to a server along with some parameters for - * conversion. - * @param {ExportingOptions} options Exporting options. Out of the exporting options, the following options can be given as parameters to the exportChart method. All options default to the values given in the exporting config options. filename: the filename for the export without extension, url: the URL for the server module to do the conversion, width: the width of the PNG or JPEG image generated on the server, type: the MIME type of the converted image, sourceWidth: the width of the source (in-page) chart, sourceHeight: the height of the source chart. - * @param {Options} chartOptions Additional chart options for the exported chart. For example a different background color can be added here. - * @since 2.0 - */ - exportChart(options: ExportingOptions, chartOptions: Options): void; - /** - * Export the chart to a PNG or SVG without sending it to a server. Requires - * modules/exporting.js and modules/offline-exporting.js. - * @since 2.0 - */ - exportChartLocal(): void; - /** - * Export the chart to a PNG or SVG without sending it to a server. Requires - * modules/exporting.js and modules/offline-exporting.js. - * @param {ExportingOptions} options Exporting options. Same as - * the exportChart params. - * @since 2.0 - */ - exportChartLocal(options: ExportingOptions): void; - /** - * Export the chart to a PNG or SVG without sending it to a server. - * Requires modules/exporting.js and modules/offline-exporting.js. - * @param {ExportingOptions} options Exporting options. Same as - * the exportChart params. - * @param {Options} chartOptions Additional chart options for the - * exported chart. Same as the exportChart params. - * @since 2.0 - */ - exportChartLocal(options: ExportingOptions, chartOptions: Options): void; - /** - * Get an axis, series or point by its id as given in the configuration options. - * @param {string} id The id of the axis, series or point to get. - * @return {AxisObject|SeriesObject|PointObject} - * @since 1.2.0 - */ - get(id: string): AxisObject | SeriesObject | PointObject; - /** - * Exporting module required. Get an SVG string representing the chart. - * @param {Options} additionalOptions Chart options to add to the exported chart in addition to the options given for the original chart. For example if series.lineWidth should be greater in the exported chart than in the original, or the chart should have a different background color, this is added here. - * @return {string} - * @since 2.0 - */ - getSVG(additionalOptions?: Options): string; - /** - * Returns an array of all currently selected points in the chart. Points can be selected either programmatically by - * the point.select() method or by clicking. - * @return {PointObject[]} An array of the selected points. - * @since 1.2.0 - */ - getSelectedPoints(): PointObject[]; - /** - * Returns an array of all currently selected series in the chart. Series can be selected either programmatically by - * the series.select() method or by checking the checkbox next to the legend item if series.showCheckBox is true. - * @return {SeriesObject[]} An array of the selected Series items. - * @since 1.2.0 - */ - getSelectedSeries(): SeriesObject[]; - /** - * Hide the loading screen. Options for the loading screen are defined at options.loading. - * @since 1.2.0 - */ - hideLoading(): void; - /** - * The options structure for the chart. - * @since 1.2.0 - */ - options: Options; - /** - * Exporting module required. Clears away other elements in the page and prints the chart as it is displayed. By - * default, when the exporting module is enabled, a button at the upper left calls this method. - * @since 2.0 - */ - print(): void; - /** - * Redraw the chart after changes have been done to the data or axis extremes. All methods for updating axes, series - * or points have a parameter for redrawing the chart. This is true by default. But in many cases you want to do - * more than one operation on the chart before redrawing, for example add a number of points. In those cases it is a - * waste of resources to redraw the chart for each new point added. So you add the points and call chart.redraw() - * after. - * @param [boolean | Animation] animation Defaults to true. When true, the update will be animated with default animation options. The animation can also be a configuration object with properties duration and easing. - * @since 1.2.0 - */ - redraw(animation?: boolean | Animation): void; - /** - * Reflows the chart to its container. By default, the chart reflows automatically to its container following a - * window.resize event, as per the chart.reflow option. However, there are no reliable events for div resize, so if - * the container is resized without a window resize event, this must be called explicitly. - */ - reflow(): void; - /** - * An array of all the chart's series. - * @type {SeriesObject[]} - * @since 1.2.0 - */ - series: SeriesObject[]; - /** - * Resize the chart to a given width and height. - * @param {number} width The new pixel width of the chart. - * @param {number} height The new pixel height of the chart. - * @param {boolean | Animation} animation Defaults to true. When true, the resize will be animated with default animation options. The animation can also be a configuration object with properties duration and easing. - */ - setSize(width: number, height: number, animation?: boolean | Animation): void; - /** - * Set a new title or subtitle for the chart - * @param {TitleOptions} title A configuration object for the new title as defined at #title. - * @param [SubtitleOptions] subtitle A configuration object for the new subtitle as defined at #subtitle. - * @param [boolean] redraw Whether to redraw the chart. Defaults to true. - * @since 2.1.0 - */ - setTitle(title: TitleOptions, subtitle?: SubtitleOptions, redraw?: boolean): void; - /** - * Dim the chart's plot area and show a loading label text. Options for the loading screen are defined at - * options.loading. A custom text can be given as a parameter for loading. - * @since 2.0.5 - */ - showLoading(str?: string): void; - /** - * A generic function to update any element of the chart. Elements can be enabled and disabled, moved, re-styled, - * re-formatted etc. - * A special case is configuration objects that take arrays, for example xAxis, yAxis or series. For these collections, - * an id option is used to map the new option set to an existing object. If an existing object of the same id is not - * found, the first item is updated. So for example, running chart.update with a series item without an id, will cause - * the existing chart's first series to be updated. - * See also the responsive option set. Switching between responsive.rules basically runs chart.update under the hood. - * @param {ChartOptions} option A configuration object for the new chart options as defined in the options section of the API. - * @param [boolean] redraw Whether to redraw the chart. Defaults to true. - * @since 5.0.0 - */ - update(options: ChartOptions, redraw?: boolean): void; - /** - * This method is deprecated as of 2.0.1. Updating the chart position after a move operation is no longer necessary. - * @since 1.2.5 - * @deprecated - */ - updatePosition(): void; - /** - * An array of the chart's x axes. If only one x axis, it is referenced by chart.xAxis[0]. - * @since 1.2.0 - */ - xAxis: AxisObject[]; - /** - * An array of the chart's y axes. If only one y axis, it is referenced by chart.yAxis[0]. - * @since 1.2.0 - */ - yAxis: AxisObject[]; - - renderer: RendererObject; - - legend: LegendObject; - } - - interface Chart { - /** - * This is the constructor for creating a new chart object. - * @param {Options} options The chart options - * @return {ChartObject} - */ - new (options: Options): ChartObject; - /** - * This is the constructor for creating a new chart object. - * @param {Options} 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 {ChartObject} - */ - new (options: Options, callback: (chart: ChartObject) => void): ChartObject; - /** - * 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 {Options} options The chart options - * @return {ChartObject} - */ - new (renderTo: string | HTMLElement, options: Options): ChartObject; - /** - * 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 {Options} 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 {ChartObject} - */ - new (renderTo: string | HTMLElement, options: Options, callback: (chart: ChartObject) => void): ChartObject; - } - - /** - * The Element class is a JavaScript wrapper for SVG elements used in the rendering layer of Highchart. Combined with - * the Renderer object, these elements allows freeform annotation in the charts or even in your HTML pages without - * creating a chart at all. - */ - interface ElementObject { - /** - * Add the element to the renderer canvas. - * @param {ElementObject} parent The element can be added to a g (group) element. - * @return {ElementObject} - * @since 2.0 - */ - add(parent?: ElementObject): ElementObject; - /** - * Apply numeric attributes to the SVG/VML element by animation. See Element.attr() for more information on setting - * attributes. - * @param {any} attributes A set of attributes to apply. - * @param {any} animation Optional animation parameters that are passed over to jQuery or other framework. Valid properties depend on the library, but options like duration, easing and complete are supported by jQuery. - * @return {ElementObject} - * @since 2.0 - */ - animate(attributes: any, animation?: any): ElementObject; - /** - * Apply attributes to the SVG/VML elements. These attributes for the most parts correspond to SVG, but some are - * specific to Highcharts, like zIndex and rotation. - * - * In order to set the rotation center for rotation, set x and y to 0 and use translateX and translateY attributes - * to position the element instead. - * - * Attributes frequently used in Highcharts are fill, stroke, stroke-width. - * @param {any} hash A set of attributes to apply. - * @return {ElementObject} - * @since 2.0 - */ - attr(hash: any): ElementObject; - /** - * Apply some CSS properties to the element - * @param {Object} hash The object literal of CSS properties to apply. Properties should be hyphenated, not camelCased. - * @return {ElementObject} - * @since 2.0 - */ - css(hash: Object): ElementObject; - /** - * Destroy the element and free up memory - * @since 2.0 - */ - destroy(): void; - fadeOut(duration?: number): void; - /** - * Get the bounding box of the element - * @return An object containing x, y, width and height values for the element. - * @since 2.0 - */ - getBBox(): { x: number; y: number; height: number; width: number; }; - /** - * Apply an event handler to the element - * @param {string} eventType The event type to attach, for example 'click', 'mouseover', 'touch'. - * @param handler The event handler function. - * @return {ElementObject} - * @since 2.0 - */ - on(eventType: string, handler: () => void): ElementObject; - /** - * Bring the element to the front. Alternatively, a zIndex attribute can be given. - * @return {ElementObject} The element object - * @since 2.0 - */ - toFront(): ElementObject; - } - - /** - * Allows direct access to the Highcharts rendering layer in order to draw primitive shapes like circles, - * rectangles,paths or text directly on a chart, or independent from any chart. The Renderer represents a wrapper object - * for SVGin modern browsers and VML in IE < 8. - * - * An existing chart's renderer can be accessed through chart.renderer. To create a renderer independent from a chart, - * use var renderer = new Highcharts.Renderer(parentNode, width, height); where parentNode is the HTML element where you - * want to add it. - * - * The Renderer's methods are chained wherever possible, so you can initiate an element then call for example attr and - * css and add on that element in one statement. - */ - interface RendererObject { - /** - * Draw an arc on the renderer canvas. - * @param {number} centerX The x position of the arc's center in the SVG element. - * @param {number} centerY The y position of the arc's center in the SVG element. - * @param {number} outerRadius The outer radius of the arc. - * @param {number} innerRadius The inner radius of the arc. - * @param {number} start The starting angle of the arc in radians, where 0 is to the right and -Math.PI/2 is up. - * @param {number} end The ending angle of the arc in radians, where 0 is to the right and -Math.PI/2 is up. - * @return {ElementObject} - * @since 2.0 - */ - arc(centerX: number, centerY: number, outerRadius: number, innerRadius: number, start: number, end: number): ElementObject; - /** - * Draw circle on the renderer canvas. - * @param {number} centerX The x position of the circle's center in the SVG element. - * @param {number} centerY The y position of the circle's center in the SVG element. - * @param {number} radius [description] - * @return {ElementObject} - * @since 2.0 - */ - circle(centerX: number, centerY: number, radius: number): ElementObject; - /** - * Add an SVG/VML group. - * @param [string] name The name of the group. This will be used in the class name, which will be 'highcharts-'+ name. Other Element objects are added to the group by using the group as the first parameter in .add() for the wrappers - * @return {ElementObject} - * @since 2.0 - */ - g(name?: string): ElementObject; - /** - * Add an image from an external resource. - * @param {string} source The URL of the image. - * @param {number} x The x position of the image's upper left corner. - * @param {number} y The y position of the image's upper left corner. - * @param {number} width The width of the image. - * @param {number} height The height of the image. - * @return {ElementObject} - * @since 2.0 - */ - image(source: string, x: number, y: number, width: number, height: number): ElementObject; - /** - * Draw a label, which is an extended text element with support for border and background. Highcharts creates a g - * element with a text and a path or rect inside, to make it behave somewhat like a HTML div. Border and background - * are set through stroke, stroke-width and fill attributes using the attr method. This must be done before calling - * add. - * @param {string} str The text or HTML to draw - * @param {number} x The x position of the label's left side. - * @param {number} y The y position of the label's top side or baseline, depending on the baseline parameter. - * @param [string] shape The shape of the label's border/background, if any. Defaults to rect. - * @param [number] anchorX If the shape has a pointer, like the chevron on a callout shape, anchorX is the x position to point to. - * @param [number] anchorY If the shape has a pointer, like the chevron on a callout shape, anchorY is the y position to point to. - * @param [boolean] useHTML Use HTML to render the text of the label. - * @param [boolean] baseline Whether the label should be vertically aligned by the text baseline, which makes it behave like the text element, or by the top left side, which makes it behave like a HTML div. - * @param [string] className A class name for the g element surrounding the label. - * @return {ElementObject} - * @since 2.0 - */ - label(str: string, x: number, y: number, shape?: string, anchorX?: number, anchorY?: number, useHTML?: boolean, baseline?: boolean, className?: string): ElementObject; - /** - * Add a path based on SVG's path commands. In SVG capable browsers all path commands are supported, but in VML only - * a subset is supported: absolute moveTo (M), absolute lineTo (L), absolute curveTo (C) and close (Z). - * @param {(string|number)[]} path An SVG path split up in array form. - * @return {ElementObject} - */ - path(path: [string | number]): ElementObject; - /** - * Add a rectangle. - * @param {number} x The x position of the rectangle's upper left corner. - * @param {number} y The y position of the rectangle's upper left corner. - * @param {number} width The width of the rectangle. - * @param {number} height The height of the rectangle. - * @param {number} cornerRadius The corner radius of all the rectangle's corners. - * @return {ElementObject} - * @since 2.0 - */ - rect(x: number, y: number, width: number, height: number, cornerRadius: number): ElementObject; - /** - * Draw text. The text can contain a subset of HTML, like spans and anchors and some basic text styling of these. - * For more advanced features like border and background, use label instead. - * @param {string} str The text or HTML to draw - * @param {number} x The x position of the text's lower left corner. - * @param {number} y The y position of the text's lower left corner. - * @return {ElementObject} - * @since 2.0 - */ - text(str: string, x: number, y: number): ElementObject; - } - - interface Renderer { - new (parentNode: HTMLElement, width: number, height: number): RendererObject; - } - - interface Static { - Chart: Chart; - Renderer: Renderer; - Color(color: string | Gradient): string | Gradient; - - /** - * As Highcharts.Chart, but without need for the new keyword. - * @since 4.2.0 - */ - chart(options: Options, callback?: (chart: ChartObject) => void): ChartObject; - /** - * As Highcharts.Chart, but without need for the new keyword. - * @since 4.2.0 - */ - chart(renderTo: string | HTMLElement, options: Options, callback?: (chart: ChartObject) => void): ChartObject; - /** - * 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. - * @since 2.3.4 - */ - charts: ChartObject[]; - /** - * Formats a JavaScript date timestamp (milliseconds since Jan 1st 1970) into a human readable date string. The - * format is a subset of the formats for PHP's strftime function. Additional formats can be given in the - * Highcharts.dateFormats hook, see below. - * @param {string} format A string containing some of the formats. - * @param [number] time The JavaScript time to format. - * @param [boolean] capitalize Whether to capitalize words in the return string. - * @return {string} - */ - dateFormat(format: string, time?: number, capitalize?: boolean): string; - /** - * A hook for defining additional date format specifiers. New specifiers are defined as key-value pairs by using the - * specifier as key, and a function which takes the timestamp as value. This function returns the formatted portion - * of the date. - */ - dateFormats: DateFormatSpecifiers; - /** - * Formats a JavaScript number with grouped thousands, a fixed amount of decimals and an optional decimal point. It - * is a port of PHP's function with the same name. See PHP number_format for a full explanation of the parameters. - * @param {number} value The raw number to format. - * @param {number} decimals The desired number of decimals. - * @param {string} decimalPoint The decimal point. Defaults to '.' or to the string specified globally in options.lang.decimalPoint. - * @param {string} thousandsSep The thousands separator. Defaults to ' ' or to the string specified globally in options.lang.thousandsSep. - * @return {string} - */ - numberFormat(value: number, decimals?: number, decimalPoint?: string, thousandsSep?: string): string; - /** - * Sets the options globally for all charts created after this has been called. Takes an options JavaScript object - * structure as the argument. These options are merged with the default options and the result is returned. - * @param options The chart configuration object. - * @return {Options} - */ - setOptions(options: GlobalOptions): Options; - /** - * Get the updated default options. Until 3.0.7, merely exposing defaultOptions for outside modules - * wasn't enough because the setOptions method created a new object. - */ - getOptions(): Options; - - map(array: any[], fn: Function): any[]; - } - - /** - * The Point object is the JavaScript representation of each data point - * - * The object can be accessed in a number of ways. In all point event handlers the point object is this. In the series - * object all the points are accessed by the series.data array. - * - * Another way to reference the point programmatically is by id. Add an id in the point configuration options, and get - * the point object by chart.get(id). - */ - interface PointObject { - /** - * For categorized axes this property holds the category name for the point. For other axis it holds the x value. - * @since 1.2.0 - */ - category: string | number; - name: string; - index: number; - /** - * The percentage for points in a stacked series or pies. - * @since 1.2.0 - */ - percentage: number; - /** - * Remove the point from the series. - * @param [boolean] redraw Defaults to true. Whether to redraw the chart after the point is removed.If doing more operations on the chart, it is a good idea to set redraw to false and call chart.redraw() after. - * @param [boolean|Animation] animation Defaults to true. When true, the graph's updating will be animated with default animation options. The animation can also be a configuration object with properties duration and easing. - * @since 1.2.0 - */ - remove(redraw?: boolean, animation?: boolean | Animation): void; - /** - * Select or unselect the point. - * @param [boolean] select When true, the point is selected. When false, the point is unselected. When null or undefined, the selection state is toggled. - * @param [boolean] accumulate When true, the selection is added to other selected points. When false, other selected points are deselected. Internally in Highcharts,selected points are accumulated on Control, Shift or Cmd clicking the point. - * @since 1.2.0 - */ - select(select?: boolean, accumulate?: boolean): void; - /** - * Whether the point is selected or not. - * @since 1.2.0 - */ - selected: boolean; - /** - * The series object associated with the point. - * @since 1.2.0 - */ - series: SeriesObject; - /** - * Slice out or set back in a pie chart slice. This is the default way of Highcharts to visualize that a pie point - * is selected. - * @param [boolean] sliced When true, the point is sliced out. When false, the point is set in. When null or undefined, the sliced state is toggled. - * @param [boolean] redraw Defaults to true. Whether to redraw the chart after the point is altered. - * @param [boolean|Animation] animation Defaults to true. When true, the move will be animated with default animation options. The animation can also be a configuration object with properties duration and easing. - * @since 1.2.0 - */ - slice(sliced?: boolean, redraw?: boolean, animation?: boolean | Animation): void; - /** - * The total of a stack for stacked series, or pie in pie charts. - */ - total: number; - /** - * Update the point with new values. - * @param {number|[number,number]|DataPoint} options The point options. Point options are handled as described under the series.data item for each series type. For example for a line series, if options is a single number, the point will be given that number as the main y value. If it is an array, it will be interpreted as x and y values respectively. If it is an object, advanced options are applied. - * @param [boolean] redraw Defaults to true. Whether to redraw the chart after the point is updated.If doing more operations on the chart, it is a good idea to set redraw to false and call chart.redraw() after. - * @param {boolean|Animation} animation Defaults to true. When true, the update will be animated with default animation options. The animation can also be a configuration object with properties duration and easing. - * @since 1.2.0 - */ - update(options: number | [number, number] | DataPoint, redraw?: boolean, animation?: boolean | Animation): void; - /** - * The x value for the point. - * @since 1.2.0 - */ - x: number; - /** - * The y value for the point. - * @since 1.2.0 - */ - y: number; - } - - /** - * The Series object is the JavaScript representation of each line, area series, pie etc. - * - * The object can be accessed in a number of ways. All series and point event handlers give a reference to the series - * object. The chart object has a series property that is a collection of all the chart's series. The point objects also - * have the same reference. - * - * Another way to reference the series programmatically is by id. Add an id in the series configuration options, and get - * the series object by chart.get(id). - * - * Configuration options for the series are given in three levels. Options for all series in a chart are given in the - * plotOptions.series object. Then options for all series of a specific type are given in the plotOptions of that type, - * for example plotOptions.line. Next, options for one single series are given in the series array. - */ - interface SeriesObject { - /** - * Add a point to the series after render time. The point can be added at the end, or by giving it an X value, to - * the start or in the middle of the series. - * @param {number|[number,number]|DataPoint} The point options. If options is a single number, a point with that y value is appended to the series.If it is an array, it will be interpreted as x and y values respectively. If it is an object, advanced options as outlined under series.data are applied. - * @param [boolean=true] redraw - Whether to redraw the chart after the point is added. When adding more than one point, it is highly recommended that the redraw option be set to false, and instead chart.redraw() is explicitly called after the adding of points is finished. - * @param [boolean=false] shift - When shift is true, one point is shifted off the start of the series as one is appended to the end. Use this option for live charts monitoring a value over time. - * @param [(boolean|Animation)=false] animation - When shift is true, one point is shifted off the start of the series as one is appended to the end. Use this option for live charts monitoring a value over time. - * @since 1.2.0 - */ - addPoint(options: number | [number, number] | DataPoint, redraw?: boolean, shift?: boolean, animation?: boolean | Animation): void; - /** - * Read only. The chart that the series belongs to. - * @since 1.2.0 - */ - chart: ChartObject; - /** - * Read only. An array with the series' data point objects. - * @since 1.2.0 - */ - data: PointObject[]; - /** - * Hides the series if visible. If the chart.ignoreHiddenSeries option is true,the chart is redrawn without this - * series. - * @since 1.2.0 - */ - hide(): void; - /** - * The series' name as given in the options. - * @since 1.2.0 - */ - name: string; - /** - * Read only. The series' options. - * @since 1.2.0 - */ - options: IndividualSeriesOptions; - /** - * Remove the series from the chart. - * @param [boolean=true] redraw - Whether to redraw the chart after the series is removed.If doing more operations on the chart, it is a good idea to set redraw to false and call chart.redraw() after. - * @since 1.2.0 - */ - remove(redraw?: boolean): void; - /** - * Remove a point from the series. Unlike the Point.remove method, this can also be done on a point that is not - * instanciated because it is outside the view or subject to data grouping. - * @param {number} index - The index of the point in the data array. - * @param [boolean=true] redraw - Whether to redraw the chart after the point is added. When adding more than one point, it is highly recommended that the redraw option be set to false, and instead chart.redraw() is explicitly called after the adding of points is finished. - * @param [boolean|Animation=true] animation - When true, the graph will be animated with default animation options. The animation can also be a configuration object with properties duration and easing. - * @since 4.1.0 - */ - removePoint(index: number, redraw?: boolean, animation?: boolean | Animation): void; - /** - * Select or unselect the series. This means its selected property is set,the checkbox in the legend is toggled and - * when selected, the series is returned in the chart.getSelectedSeries() method. - * @param [boolean] selected - When true, the series is selected. When false it is unselected. When null or undefined, the series' selection state is toggled. - * @since 1.2.0 - */ - select(selected?: boolean): void; - /** - * Read only. The series' selected state as set by series.select(). - * @since 1.2.0 - */ - selected: boolean; - /** - * Apply a new set of data to the series and optionally redraw it. Note that this method throws away all points and - * creates new ones. For updating the values of existing points, use Point.update() instead. - * @param {number[]|number[][]|DataPoint[]} data - Takes an array of data in the same format as described under seriesdata for the given series type. - * @param [boolean=true] redraw - Whether to redraw the chart after the series is altered.If doing more operations on the chart, it is a good idea to set redraw to false and call chart.redraw() after. - * @param [boolean|Animation] animation - When the updated data is the same length as the existing data, points will be updated by default, and animation visualizes how the points are changed. Set false to disable animation, or a configuration object to set duration or easing. - * @param [boolean] updatePoints - When the updated data is the same length as the existing data, points will be updated instead of replace. This option prevents this, and makes setData behave like it did prior to Highcharts 3.0.10. - * @since 1.2.0 - */ - setData(data: number[] | number[][] | DataPoint[], redraw?: boolean, animation?: boolean | Animation, updatePoints?: boolean): void; - /** - * A utility function to show or hide the series with an optional redraw. - * @param [boolean] visible - Whether to show or hide the series. If undefined, the visibility is toggled. - * @param [boolean=true] redraw - Whether to redraw the chart after the series is altered.If doing more operations on the chart, it is a good idea to set redraw to false and call chart.redraw() after. - * @since 1.2.0 - */ - setVisible(visible?: boolean, redraw?: boolean): void; - /** - * Shows the series if hidden. - * @since 1.2.0 - */ - show(): void; - /** - * Read only. The series' type, like 'line', 'area' etc. - * @since 1.2.0 - */ - type: string; - /** - * Update the series with a new set of options. For a clean and precise handling of new options, all methods and - * elements from the series is removed, and it is initiated from scratch. Therefore, this method is more performance - * expensive than some other utility methods like setData or setVisible. - * @param {IndividualSeriesOptions} options New options that will be merged into the series' existing options. - * @param [boolean] redraw - Whether to redraw the chart after the series is altered. If doing more operations on the chart, it is a good idea to set redraw to false and call chart.redraw() after. - * @since 1.2.0 - */ - update(options: IndividualSeriesOptions, redraw?: boolean): void; - /** - * Read only. The series' visibility state as set by series.show(), series.hide(), or the initial configuration. - * @since 1.2.0 - */ - visible: boolean; - /** - * Read only. The unique xAxis object associated with the series. - * @since 1.2.0 - */ - xAxis: AxisObject; - /** - * Read only. The unique yAxis object associated with the series. - * @since 1.2.0 - */ - yAxis: AxisObject; - } - - interface LegendObject { - /** - * Update the legend with new options. - * @param {LegendOptions} options New options that will be merged into the legend's existing options. - * @param [boolean] redraw - Whether to redraw the chart. Defaults to true. - * @since 5.0.0 - */ - update(options: LegendOptions, redraw?: boolean): void; - } -} - -declare global { - interface JQuery { - highcharts(): Highcharts.ChartObject; - /** - * Creates a new Highcharts.Chart for the current JQuery selector; usually - * a div selected by $('#container') - * @param {Options} options Options for this chart - * @return current {JQuery} selector the current JQuery selector - **/ - highcharts(options: Highcharts.Options): JQuery; - /** - * Creates a new Highcharts.Chart for the current JQuery selector; usually - * a div selected by $('#container') - * @param {Options} options Options for this chart - * @param callback Callback function used to manipulate the constructed chart instance - * @return current {JQuery} selector the current JQuery selector - **/ - highcharts(options: Highcharts.Options, callback: (chart: Highcharts.ChartObject) => void): JQuery; - } -} - -declare var Highcharts: Highcharts.Static; -export = Highcharts; -export as namespace Highcharts; diff --git a/highcharts/test/index.ts b/highcharts/test/index.ts deleted file mode 100644 index 316e2f42a6..0000000000 --- a/highcharts/test/index.ts +++ /dev/null @@ -1,2346 +0,0 @@ -/// -import * as Highcharts from "highcharts"; // May also use /// - -function originalTests() { - Highcharts.setOptions({ - global: { - useUTC: false - } - }); - - Highcharts.setOptions({ - lang: { - months: ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre'], - weekdays: ['Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi'] - } - }); - - - var animate: Highcharts.Animation = { - duration: 200, - easing: "linear" - }; - - - var gradient: Highcharts.Gradient = { - linearGradient: { - x1: 0, - y1: 0, - x2: 500, - y2: 500 - }, - stops: [ - [0, 'rgb(255, 255, 255)'], - [1, 'rgb(200, 200, 255)'] - ] - } - - var color = "#fcfcff"; - - var chart1 = new Highcharts.Chart({ - chart: { - renderTo: "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 - }] - }); - - chart1.addSeries({ - enableMouseTracking: true, - data: [1, 2, 3, 4, 5] - }); - - console.log((chart1.series[0].options).dashStyle); - - var chart2 = new Highcharts.Chart({ - chart: { - renderTo: 'container', - width: 400, - height: 400, - spacingRight: 20 - }, - xAxis: [{ - type: 'logarithmic', - min: 1, - max: 1000, - endOnTick: true, - tickInterval: 1, - minorTickInterval: 0.1, - gridLineWidth: 1 - }], - yAxis: [{ - type: 'logarithmic', - min: 1, - max: 1000, - tickInterval: 1, - minorTickInterval: 0.1, - title: { - text: null - } - }], - legend: { - enabled: false - }, - series: [{ - data: [ - [550, 870], [738, 362], [719, 711], [547, 665], [595, 197], [332, 144], - [581, 555], [196, 862], [6, 837], [400, 924], [888, 148], [785, 730], - [374, 358], [440, 69], [704, 318], [646, 506], [238, 662], [233, 56], - [622, 572], [563, 903], [744, 672], [904, 646], [390, 325], [536, 491], - [676, 186], [467, 145], [790, 114], [437, 793], [853, 243], [947, 196], - [395, 728], [527, 148], [516, 675], [632, 562], [52, 552], [605, 580], - [790, 865], [156, 87], [584, 290], [339, 921], [383, 633], [106, 373], - [762, 863], [424, 149], [608, 959], [574, 711], [468, 664], [268, 77], - [894, 850], [171, 102], [203, 565], [592, 549], [86, 486], [526, 244], - [323, 575], [488, 842], [401, 618], [148, 43], [828, 314], [554, 711], - [685, 868], [387, 435], [469, 828], [623, 506], [436, 184], [450, 156], - [805, 517], [465, 997], [728, 802], [231, 438], [935, 438], [519, 856], - [378, 579], [73, 765], [223, 219], [359, 317], [686, 742], [17, 790], - [20, 35], [410, 644], [984, 325], [503, 882], [900, 187], [578, 968], - [27, 718], [355, 704], [395, 332], [641, 548], [964, 374], [215, 472], - [323, 66], [882, 542], [671, 327], [650, 193], [828, 632], [760, 929], - [607, 335], [928, 826], [462, 598], [631, 411] - ], - type: 'scatter' - }] - }); - - var div: HTMLDivElement; - var r = new Highcharts.Renderer(div, 20, 30); - var box = r.text("Hello", 10, 10).getBBox(); - - var highChartSettings: Highcharts.Options = { - chart: { - width: 400, - height: 400 - }, - 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] - }] - }; - - var container = $("#container").highcharts(highChartSettings, (chart) => { - chart.series[0].setVisible(true, true); - }); - - var singleYAxisOptions: Highcharts.Options = { - yAxis: {} - }; - var multipleYAxisOptions: Highcharts.Options = { - 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() { - var options: Highcharts.Options = { - chart: {}, - credits: {}, - data: {}, - drilldown: {}, - exporting: {}, - labels: {}, - legend: {}, - loading: {}, - colors: [], - navigation: {}, - noData: {}, - pane: {}, - plotOptions: {}, - series: [{}], - subtitle: {}, - title: {}, - tooltip: {}, - xAxis: {}, - yAxis: {} - }; -} - -function test_ChartOptions() { - var emptyChartOptions: Highcharts.ChartOptions = { - events: {}, - options3d: {}, - resetZoomButton: {} - }; - - var allValuesSet: Highcharts.ChartOptions = { - alignTicks: false, - animation: { - duration: 500, - easing: "linear" - }, - backgroundColor: { - linearGradient: { - x1: 0, - y1: 0, - x2: 1, - y2: 1 - }, - stops: [[0]] - }, - borderColor: "#000000", - borderRadius: 20, - borderWidth: 5, - className: "class", - defaultSeriesType: "deprecated", - events: { - addSeries: () => {}, - afterPrint: () => {}, - beforePrint: () => {}, - click: () => {}, - drilldown: () => {}, - drillup: () => {}, - load: () => {}, - redraw: () => {}, - selection: () => {} - }, - height: 200, - ignoreHiddenSeries: true, - inverted: true, - margin: [5, 5, 5, 5], - marginBottom: 10, - marginLeft: 10, - marginRight: 10, - marginTop: 10, - options3d: { - alpha: 20, - beta: 20, - depth: 50, - enabled: true, - frame: { - back: { - color: "black", - size: 2 - }, - bottom: { - color: "black", - size: 2 - }, - side: { - color: "black", - size: 2 - } - }, - viewDistance: 100 - }, - panKey: "a", - panning: true, - pinchType: "xy", - plotBackgroundColor: "white", - plotBackgroundImage: "http://image.url/image.jpg", - plotBorderColor: "grey", - plotBorderWidth: 5, - plotShadow: { - color: "magenta", - offsetX: 10, - offsetY: 10, - opacity: .5, - width: 5 - }, - polar: true, - reflow: false, - renderTo: "elementId", - resetZoomButton: { - position: { - align: "left", - verticalAlign: "top", - x: 5, - y: 5 - }, - relativeTo: "chart", - theme: { - display: "hidden", - fill: "black", - stroke: "white", - r: 2, - style: {} - } - }, - selectionMarkerFill: "rgba(100, 100, 100, .5)", - shadow: false, - showAxes: true, - spacing: [5, 5, 10, 5], - spacingBottom: 5, - spacingLeft: 5, - spacingRight: 5, - spacingTop: 5, - style: {}, - type: "spline", - width: 100, - zoomType: "x" - }; - - //alignticks example - $('#container').highcharts({ - chart: { - alignTicks: true, - type: 'line' - }, - xAxis: { - categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] - }, - yAxis: [{ - title: { - text: 'Primary Axis' - } - }, { - title: { - text: 'Secondary Axis' - }, - gridLineWidth: 0, - opposite: true - }], - legend: { - layout: 'vertical', - backgroundColor: '#FFFFFF', - floating: true, - align: 'left', - x: 100, - verticalAlign: 'top', - y: 70 - }, - tooltip: { - formatter: function () { - return '' + this.series.name + '
        ' + this.x + ': ' + this.y; - } - }, - plotOptions: {}, - 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] - }, { - data: [129.9, 271.5, 306.4, 29.2, 544.0, 376.0, 435.6, 348.5, 216.4, 294.1, 35.6, 354.4], - yAxis: 1 - }] - }); - - // animation example - $('#container').highcharts( { - chart: { - animation: { - duration: 1500, - easing: 'easeOutBounce' - } - }, - xAxis: { - categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] - }, - 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] - }] - }); - var i = 1; - $('#update').click(function () { - var chart = $('#container').highcharts(); - chart.series[0].data[0].update(i % 2 ? 200 : 0); - i += 1; - }); - - // background gradient example - $('#container').highcharts({ - chart: { - backgroundColor: { - linearGradient: [0, 0, 500, 500], - stops: [ - [0, 'rgb(255, 255, 255)'], - [1, 'rgb(200, 200, 255)'] - ] - }, - type: 'line' - }, - xAxis: { - categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] - }, - legend: { - layout: 'vertical', - backgroundColor: '#FFFFFF', - floating: true, - align: 'left', - x: 100, - verticalAlign: 'top', - y: 70 - }, - tooltip: { - formatter: function () { - return `${this.series.name}
        ${this.x}: ${this.y}`; - } - }, - 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] - }] - }); - - // border example - $('#container').highcharts({ - chart: { - borderColor: '#EBBA95', - borderRadius: 20, - borderWidth: 2, - type: 'line' - }, - xAxis: { - categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] - }, - legend: { - layout: 'vertical', - backgroundColor: '#FFFFFF', - floating: true, - align: 'left', - x: 100, - verticalAlign: 'top', - y: 70 - }, - 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] - }] - }); - - // events examples - $('#container').highcharts({ - chart: { - events: { - addSeries: function () { - var label = (this).renderer.label('A series was added, about to redraw chart', 100, 120) - .attr({ - fill: Highcharts.getOptions().colors[0], - padding: 10, - r: 5, - zIndex: 8 - }) - .css({ - color: '#FFFFFF' - }) - .add(); - - setTimeout(function () { - label.fadeOut(); - }, 1000); - } - } - }, - xAxis: { - categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] - }, - 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] - }] - }); - - // activate the button - $('#button').click(function () { - var chart = $('#container').highcharts(); - - chart.addSeries({ - data: [216.4, 194.1, 95.6, 54.4, 29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5] - }); - - $(this).attr('disabled', 'true'); - }); - - // options3d examples - $('#container').highcharts({ - chart: { - type: 'column', - margin: 75, - options3d: { - enabled: true, - alpha: 15, - beta: 15, - depth: 50, - frame: { - bottom: { - size: 1, - color: '#C0C0C0' - }, - side: { - size: 1, - color: '#C0C0C0' - }, - back: { - size: 1, - color: '#D0D0D0' - } - } - }, - }, - plotOptions: { - column: { - depth: 25 - } - }, - 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] - }] - }); - - // zoom&pan example - $('#container').highcharts({ - chart: { - type: 'line', - zoomType: 'x', - panning: true, - panKey: 'shift' - }, - title: { - text: 'Zooming and panning' - }, - subtitle: { - text: 'Click and drag to zoom in. Hold down shift key to pan.' - }, - xAxis: { - categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] - }, - 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] - }] - }); - - // reset zoom example - $('#container').highcharts({ - chart: { - zoomType: 'x', - resetZoomButton: { - position: { - x: 0, - y: -30 - }, - theme: { - fill: 'white', - stroke: 'silver', - r: 0, - states: { - hover: { - fill: '#41739D', - style: { - color: 'white' - } - } - } - } - } - }, - xAxis: { - categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] - }, - 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] - }] - }); -} - -function test_CreditsOptions() { - var allDefaults: Highcharts.CreditsOptions = {}; - - // custom url and text example - $('#container').highcharts({ - credits: { - text: 'Example.com', - href: 'http://www.example.com' - }, - xAxis: { - categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] - }, - 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] - }] - }); -} - -function test_Data() { - // all defaults - var data: Highcharts.DataOptions = {}; - - // data from table example - $('#container').highcharts({ - data: { - table: 'datatable' - }, - chart: { - type: 'column' - }, - title: { - text: 'Data extracted from a HTML table in the page' - }, - yAxis: { - allowDecimals: false, - title: { - text: 'Units' - } - } - }); - - // data from csv example - $('#container').highcharts({ - data: { - csv: document.getElementById('csv').innerHTML - }, - plotOptions: { - series: { - marker: { - enabled: false - } - } - }, - series: [ - { - lineWidth: 1 - }, - { - type: 'areaspline', - color: '#c4392d', - negativeColor: '#5679c4', - fillOpacity: 0.5 - } - ] - }); - - // limited data example - $('#container').highcharts({ - data: { - csv: document.getElementById('csv').innerHTML, - startRow: 114, - endRow: 134, - endColumn: 1, - firstRowAsNames: false - }, - xAxis: { - allowDecimals: false - }, - series: [ { - name: 'Annual mean' - }] - }); - - // delimiter example - $('#container').highcharts({ - xAxis: { - type: 'category' - }, - data: { - csv: document.getElementById('csv').innerHTML, - itemDelimiter: ';', - lineDelimiter: '\n', - decimalPoint: ',' - } - }); -} - -function test_Drilldown() { - var allDefaults: Highcharts.DrilldownOptions = {}; - - // multiseries drilldown example - $('#container').highcharts({ - chart: { - type: 'column' - }, - xAxis: { - type: 'category' - }, - plotOptions: { - series: { - borderWidth: 0, - dataLabels: { - enabled: true - } - } - }, - series: [{ - name: '2010', - data: [{ - name: 'Republican', - y: 5, - drilldown: 'republican-2010' - }, { - name: 'Democrats', - y: 2, - drilldown: 'democrats-2010' - }, { - name: 'Other', - y: 4, - drilldown: 'other-2010' - }] - }, { - name: '2014', - data: [{ - name: 'Republican', - y: 4, - drilldown: 'republican-2014' - }, { - name: 'Democrats', - y: 4, - drilldown: 'democrats-2014' - }, { - name: 'Other', - y: 4, - drilldown: 'other-2014' - }] - }], - drilldown: { - series: [{ - id: 'republican-2010', - data: [ - ['East', 4], - ['West', 2], - ['North', 1], - ['South', 4] - ] - }, { - id: 'democrats-2010', - data: [ - ['East', 6], - ['West', 2], - ['North', 2], - ['South', 4] - ] - }, { - id: 'other-2010', - data: [ - ['East', 2], - ['West', 7], - ['North', 3], - ['South', 2] - ] - }, { - id: 'republican-2014', - data: [ - ['East', 2], - ['West', 4], - ['North', 1], - ['South', 7] - ] - }, { - id: 'democrats-2014', - data: [ - ['East', 4], - ['West', 2], - ['North', 5], - ['South', 3] - ] - }, { - id: 'other-2014', - data: [ - ['East', 7], - ['West', 8], - ['North', 2], - ['South', 2] - ] - }] - } - }); - - // label and drillup example - $('#container').highcharts({ - chart: { - type: 'column' - }, - plotOptions: { - series: { - borderWidth: 0, - dataLabels: { - enabled: true - } - } - }, - series: [{ - name: 'Things', - colorByPoint: true, - data: [{ - name: 'Animals', - y: 5, - drilldown: 'animals' - }, { - name: 'Fruits', - y: 2, - drilldown: 'fruits' - }, { - name: 'Cars', - y: 4 - }] - }], - drilldown: { - activeAxisLabelStyle: { - textDecoration: 'none', - fontStyle: 'italic' - }, - activeDataLabelStyle: { - textDecoration: 'none', - fontStyle: 'italic' - }, - drillUpButton: { - relativeTo: 'spacingBox', - position: { - y: 0, - x: 0 - }, - theme: { - fill: 'white', - 'stroke-width': 1, - stroke: 'silver', - r: 0, - states: { - hover: { - fill: '#bada55' - }, - select: { - stroke: '#039', - fill: '#bada55' - } - } - } - }, - series: [{ - id: 'animals', - data: [ - ['Cats', 4], - ['Dogs', 2], - ['Cows', 1], - ['Sheep', 2], - ['Pigs', 1] - ] - }, { - id: 'fruits', - data: [ - ['Apples', 4], - ['Oranges', 2] - ] - }] - } - }); -} - -function test_Exporting() { - var allDefaults: Highcharts.ExportingOptions = {}; - - // source size example - $('#container').highcharts({ - title: { - text: 'Highcharts sourceWidth and sourceHeight demo' - }, - subtitle: { - text: 'The on-screen chart is 600x400.
        The exported chart is 800x400
        (sourceWidth and sourceHeight multiplied by scale)', - floating: true, - align: 'left', - x: 60, - y: 50 - }, - xAxis: { - categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] - }, - 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] - }], - exporting: { - sourceWidth: 400, - sourceHeight: 200, - scale: 2, - chartOptions: { - subtitle: null - } - } - }); -} - -function test_Loading() { - var allDefaults: Highcharts.LoadingOptions = {}; - - // examples - // the button handler - var isLoading = false, - $button = $('#button'), - chart: Highcharts.ChartObject; - - $button.click(function () { - if (!isLoading) { - chart.showLoading(); - $button.html('Hide loading'); - } else { - chart.hideLoading(); - $button.html('Show loading'); - } - isLoading = !isLoading; - }); - - // create the chart - $('#container').highcharts({ - loading: { - hideDuration: 1000, - showDuration: 1000, - labelStyle: { - color: 'white' - }, - style: { - backgroundColor: 'gray' - } - }, - xAxis: { - categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] - }, - 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] - }] - }); - chart = $('#container').highcharts(); -} - -function test_Navigation() { - var allDefaults: Highcharts.NavigationOptions = {}; - - // examples - $('#container').highcharts({ - xAxis: { - categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] - }, - 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] - }], - navigation: { - buttonOptions: { - align: 'center', - height: 40, - width: 48, - symbolFill: 'blue', - symbolStroke: 'blue', - symbolSize: 24, - symbolX: 23, - symbolY: 21, - symbolStrokeWidth: 2, - verticalAlign: 'bottom', - y: -20 - }, - menuItemStyle: { - borderLeft: '20px solid #E0E0E0', - fontWeight: 'normal', - background: 'none' - }, - menuItemHoverStyle: { - fontWeight: 'bold', - background: 'none', - color: 'black' - }, - menuStyle: { - background: '#E0E0E0' - } - } - }); -} - -function test_NoData() { - var allDefaults: Highcharts.NoDataOptions = {}; - - // example - $('#container').highcharts({ - title: { - text: 'No data in line chart - with custom options' - }, - series: [{ - type: 'line', - name: 'Random data', - data: [] - }], - lang: { - noData: "Nichts zu anzeigen" - }, - noData: { - style: { - fontWeight: 'bold', - fontSize: '15px', - color: '#303030' - } - } - }); -} - -function test_AreaOptions() { - var allDefaults: Highcharts.AreaChartSeriesOptions = {}; - - // examples - $('#container').highcharts({ - chart: { - type: 'area' - }, - xAxis: { - categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] - }, - plotOptions: { - series: { - fillColor: { - linearGradient: [0, 0, 0, 300], - stops: [ - [0, Highcharts.getOptions().colors[0]], - [1, (Highcharts.Color(Highcharts.getOptions().colors[0])).setOpacity(0).get('rgba')] - ] - }, - fillOpacity: 0.1, - lineColor: '#303030', - negativeFillColor: 'red', - stacking: 'normal', - step: 'right', - threshold: 100, - trackByArea: true, - stickyTracking: false // to show the difference in tracking - } - }, - 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] - }] - }); -} - -function test_AreaRange() { - var allDefaults: Highcharts.AreaRangeChartSeriesOptions = {}; - - // example - $('#container').highcharts({ - chart: { - type: "arearange", - zoomType: 'x' - }, - series: [{ - data: (function (arr: number[], len: number) { - var i: number; - for (i = 0; i < len; i = i + 1) { - arr.push(i); - } - return arr; - }([], 50)) - }] - }); - - $('#setextremes').click(function () { - $('#container').highcharts().xAxis[0].setExtremes(10, 15); - }); - - $('#unsetextremes').click(function () { - $('#container').highcharts().xAxis[0].setExtremes(); - }); - - // datalabels example - $.getJSON('http://www.highcharts.com/samples/data/jsonp.php?filename=range.json&callback=?', function (data) { - // Shorten the data - data = data.splice(181, 14); - $('#container').highcharts({ - chart: { - type: 'arearange' - }, - title: { - text: 'Temperature variation by day' - }, - xAxis: { - type: 'datetime' - }, - yAxis: { - title: { - text: null - } - }, - tooltip: { - crosshairs: true, - shared: true, - valueSuffix: '°C' - }, - legend: { - enabled: false - }, - series: [ { - name: 'Temperatures', - data: data, - dataLabels: { - enabled: true, - yHigh: 20, - yLow: -20 - } - }] - - }); - }); -} - -function test_Bar() { - var allDefaults: Highcharts.BarChartSeriesOptions = {}; - - $('#container').highcharts({ - chart: { - type: 'bar' - }, - xAxis: { - categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] - }, - plotOptions: { - series: { - borderColor: '#303030', - borderRadius: 5, - borderWidth: 2, - colorByPoint: true, - colors: ["black", "red", "blue"], - groupPadding: 1, - maxPointWidth: 50, - minPointLength: 3, - pointRange: 24 * 3600 * 1000, - pointWidth: 20, - states: { - hover: { - brightness: -0.3, // darken - enabled: true, - halo: { - size: 9, - attributes: { - fill: Highcharts.getOptions().colors[2], - 'stroke-width': 2, - stroke: Highcharts.getOptions().colors[1] - } - } - } - } - } - }, - 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] - }] - }); - - // 3d example - $('#container').highcharts({ - chart: { - type: 'column', - margin: 75, - options3d: { - enabled: true, - alpha: 15, - beta: 15, - depth: 50 - } - }, - plotOptions: { - column: { - depth: 25, - edgeColor: "black", - edgeWidth: 2, - groupZPadding: 2, - } - }, - 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] - }] - }); - - // grouping example - Highcharts.getOptions().colors = Highcharts.map(Highcharts.getOptions().colors, function (color: string) { - return (Highcharts.Color(color)) - .setOpacity(0.5) - .get('rgba'); - }); - - $('#container').highcharts({ - chart: { - type: 'bar' - }, - xAxis: { - categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] - }, - yAxis: { - min: 0, - }, - legend: { - layout: 'vertical', - backgroundColor: '#FFFFFF', - align: 'left', - verticalAlign: 'top', - x: 100, - y: 70, - floating: true, - shadow: true - }, - tooltip: { - shared: true, - valueSuffix: ' mm' - }, - plotOptions: { - column: { - grouping: false, - shadow: false - } - }, - series: [ { - name: 'Tokyo', - data: [49.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4], - pointPadding: 0 - }, { - name: 'New York', - data: [83.6, 78.8, 98.5, 93.4, 106.0, 84.5, 105.0, 104.3, 91.2, 83.5, 106.6, 92.3], - pointPadding: 0.1 - }, { - name: 'London', - data: [48.9, 38.8, 39.3, 41.4, 47.0, 48.3, 59.0, 59.6, 52.4, 65.2, 59.3, 51.2], - pointPadding: 0.2 - }, { - name: 'Berlin', - data: [42.4, 33.2, 34.5, 39.7, 52.6, 75.5, 57.4, 60.4, 47.6, 39.1, 46.8, 51.1], - pointPadding: 0.3 - }] - }); -} - -function test_BoxPlot() { - var allDefaults: Highcharts.BoxPlotChartSeriesOptions = {}; - - // boxplot example - $('#container').highcharts({ - chart: { - type: 'boxplot' - }, - title: { - text: 'Highcharts box plot styling' - }, - legend: { - enabled: false - }, - xAxis: { - categories: ['1', '2', '3', '4', '5'], - title: { - text: 'Experiment No.' - } - }, - yAxis: { - title: { - text: 'Observations' - } - }, - plotOptions: { - boxplot: { - fillColor: '#F0F0E0', - lineWidth: 2, - medianColor: '#0C5DA5', - medianWidth: 3, - stemColor: '#A63400', - stemDashStyle: 'dot', - stemWidth: 1, - whiskerColor: '#3D9200', - whiskerLength: '20%', - whiskerWidth: 3 - } - }, - series: [{ - name: 'Observations', - data: [ - [760, 801, 848, 895, 965], - [733, 853, 939, 980, 1080], - [714, 762, 817, 870, 918], - [724, 802, 806, 871, 950], - [834, 836, 864, 882, 910] - ] - }] - }); -} - -function test_Bubble() { - var allDefaults: Highcharts.BubbleChartSeriesOptions = {}; - - // bubble example - $('#container').highcharts({ - chart: { - type: 'bubble', - plotBorderWidth: 1, - zoomType: 'xy' - }, - title: { - text: 'Highcharts with negative bubbles' - }, - xAxis: { - gridLineWidth: 1 - }, - yAxis: { - startOnTick: false, - endOnTick: false - }, - plotOptions: { - bubble: { - minSize: 3, - maxSize: 50 - } - }, - series: [ { - data: [ - [9, 81, 13], - [98, 5, 39], - [51, 50, 23], - [41, 22, -36], - [58, 24, -30], - [78, 37, -16], - [55, 56, 3], - [18, 45, 20], - [42, 44, -22], - [3, 52, 9], - [31, 18, 47], - [79, 91, 13], - [93, 23, -27], - [44, 83, -28] - ], - displayNegative: true, - negativeColor: Highcharts.getOptions().colors[1], - sizeBy: "width", - zMin: 0, - zMax: 100, - zThreshold: 0 - }] - }); - - // size by absolute value example - $('#container').highcharts({ - chart: { - type: 'bubble' - }, - title: { - text: 'Size by absolute value' - }, - subtitle: { - text: 'Size is computed by absolute value on negative bubbles' - }, - series: [{ - data: [ - [-5, 0, -5], - [-4, 0, -4], - [-3, 0, -3], - [-2, 0, -2], - [-1, 0, -1], - [0, 0, 0], - [1, 0, 1], - [2, 0, 2], - [3, 0, 3], - [4, 0, 4], - [5, 0, 5] - ], - sizeByAbsoluteValues: true, - negativeColor: '#FF0000' - }] - }); -} - -function test_Column() { - var allDefaults: Highcharts.ColumnChartSeriesOptions = {}; - - // same options as bar chart -} - -function test_ColumnRange() { - var allDefaults: Highcharts.ColumnRangeChartSeriesOptions = {}; - - // same options as bar chart and datalabels from arearange -} - -function test_ErrorBar() { - var allDefaults: Highcharts.ErrorBarChartSeriesOptions = {}; - - // error bar styling example - $('#container').highcharts({ - chart: { - zoomType: 'x' - }, - title: { - text: 'Temperature' - }, - xAxis: [{ - categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] - }], - yAxis: { - labels: { - format: '{value}°C' - }, - title: { - text: 'Temperature' - } - }, - tooltip: { - shared: true - }, - series: [{ - name: 'Temperature', - type: 'spline', - data: [7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6], - marker: { - enabled: false - }, - tooltip: { - pointFormat: '{series.name}: {point.y:.1f}°C
        ' - } - }, { - color: '#FF0000', - name: 'Temperature error', - type: 'errorbar', - data: [[6, 8], [5.9, 7.6], [9.4, 10.4], [14.1, 15.9], [18.0, 20.1], [21.0, 24.0], [23.2, 25.3], [26.1, 27.8], [23.2, 23.9], [18.0, 21.1], [12.9, 14.0], [7.6, 10.0]], - tooltip: { - pointFormat: 'Error range: {point.low}-{point.high}°C' - }, - stemColor: "grey", - stemDashStyle: "Solid", - stemWidth: 3, - whiskerLength: 0 - }] - }); -} - -function test_Funnel() { - var allDefaults: Highcharts.FunnelChartSeriesOptions = {}; - - // funnel demo - $('#container').highcharts({ - chart: { - type: 'funnel', - marginRight: 100 - }, - title: { - text: 'Sales funnel', - x: -50 - }, - plotOptions: { - series: { - dataLabels: { - enabled: true, - format: '{point.name} ({point.y:,.0f})', - color: 'black', - softConnector: true - }, - neckWidth: '30%', - neckHeight: '25%', - reversed: false, - height: "10%", - width: 100 - } - }, - legend: { - enabled: false - }, - series: [{ - name: 'Unique users', - data: [ - ['Website visits', 15654], - ['Downloads', 4064], - ['Requested price list', 1987], - ['Invoice sent', 976], - ['Finalized', 846] - ] - }] - }); -} - -function test_Gauge() { - var allDefaults: Highcharts.GaugeChartSeriesOptions = {}; - - // example - $('#container').highcharts({ - chart: { - type: 'gauge' - }, - pane: { - startAngle: -150, - endAngle: 150 - }, - yAxis: { - min: 0, - max: 100 - }, - plotOptions: { - gauge: { - dial: { - radius: '100%', - backgroundColor: 'silver', - borderColor: 'black', - borderWidth: 1, - baseWidth: 10, - topWidth: 1, - baseLength: '90%', // of radius - rearLength: '50%' - }, - pivot: { - radius: 4, - borderWidth: 0, - borderColor: '#1f9fd9', - backgroundColor: '#1f9fd9' - }, - dataLabels: { - borderWidth: 2, - borderColor: '#d3e9f7', - padding: 5, - borderRadius: 2, - verticalAlign: 'center', - y: 30, - style: { - fontWeight: 'normal' - } - } - } - }, - series: [ { - data: [80], - overshoot: 5 - }] - }); -} - -function test_HeatMap() { - var allDefaults: Highcharts.HeatMapSeriesOptions = {}; - - // heatmap demo - $('#container').highcharts({ - data: { - csv: document.getElementById('csv').innerHTML - }, - chart: { - type: 'heatmap', - inverted: true - }, - title: { - text: 'Highcharts heat map', - align: 'left' - }, - subtitle: { - text: 'Temperature variation by day and hour through May 2015', - align: 'left' - }, - xAxis: { - tickPixelInterval: 50, - min: Date.UTC(2015, 4, 1), - max: Date.UTC(2015, 4, 30) - }, - yAxis: { - title: { - text: null - }, - labels: { - format: '{value}:00' - }, - minPadding: 0, - maxPadding: 0, - startOnTick: false, - endOnTick: false, - tickPositions: [0, 6, 12, 18, 24], - tickWidth: 1, - min: 0, - max: 23 - }, - colorAxis: { - stops: [ - [0, '#3060cf'], - [0.5, '#fffbbc'], - [0.9, '#c4463a'] - ], - min: -5 - }, - series: [ { - borderWidth: 0, - colsize: 24 * 36e5, // one day - tooltip: { - headerFormat: 'Temperature
        ', - pointFormat: '{point.x:%e %b, %Y} {point.y}:00: {point.value} ℃' - } - }] - }); -} - -function test_Line() { - var allDefaults: Highcharts.LineChartSeriesOptions = {}; - - // step example - $('#container').highcharts({ - title: { - text: 'Step line types, with null values in the series' - }, - xAxis: { - categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] - }, - series: [{ - data: [1, 2, 3, 4, null, 6, 7, null, 9], - step: 'right', - name: 'Right', - linecap: 'round' - }, { - data: [5, 6, 7, 8, null, 10, 11, null, 13], - step: 'center', - name: 'Center', - linecap: 'round' - }, { - data: [9, 10, 11, 12, null, 14, 15, null, 17], - step: 'left', - name: 'Left', - linecap: 'round' - }] - }); -} - -function test_Pie() { - var allDefaults: Highcharts.PieChartSeriesOptions = {}; - - // pie demo - $('#container').highcharts({ - chart: { - plotBackgroundColor: null, - plotBorderWidth: null, - plotShadow: false, - type: 'pie' - }, - title: { - text: 'Browser market shares January, 2015 to May, 2015' - }, - tooltip: { - pointFormat: '{series.name}: {point.percentage:.1f}%' - }, - plotOptions: { - pie: { - allowPointSelect: true, - center: [100, 100], - cursor: 'pointer', - dataLabels: { - enabled: true, - format: '{point.name}: {point.percentage:.1f} %', - style: { - color: 'black' - } - } - } - }, - series: [{ - name: "Brands", - colorByPoint: true, - data: [{ - name: "Microsoft Internet Explorer", - y: 56.33 - }, { - name: "Chrome", - y: 24.03, - sliced: true, - selected: true - }, { - name: "Firefox", - y: 10.38 - }, { - name: "Safari", - y: 4.77 - }, { - name: "Opera", - y: 0.91 - }, { - name: "Proprietary or Undetectable", - y: 0.2 - }] - }] - }); - - // semi circle - $('#container').highcharts({ - chart: { - plotBackgroundColor: null, - plotBorderWidth: 0, - plotShadow: false - }, - title: { - text: 'Browser
        shares
        2015', - align: 'center', - verticalAlign: 'middle', - y: 40 - }, - tooltip: { - pointFormat: '{series.name}: {point.percentage:.1f}%' - }, - plotOptions: { - pie: { - dataLabels: { - enabled: true, - distance: -50, - style: { - fontWeight: 'bold', - color: 'white', - textShadow: '0px 1px 2px black' - } - }, - startAngle: -90, - endAngle: 90, - center: ['50%', '75%'] - } - }, - series: [{ - type: 'pie', - name: 'Browser share', - innerSize: '50%', - data: [ - ['Firefox', 10.38], - ['IE', 56.33], - ['Chrome', 24.03], - ['Safari', 4.77], - ['Opera', 0.91], - { - name: 'Proprietary or Undetectable', - y: 0.2, - dataLabels: { - enabled: false - } - } - ] - }] - }); - - // slice and size - $('#container').highcharts({ - chart: { - type: 'pie' - }, - plotOptions: { - pie: { - allowPointSelect: true, - innerSize: 10, - size: 80, - slicedOffset: 20 - } - }, - series: [{ - data: [ - { - name: 'Firefox', - y: 44.2, - selected: true, - sliced: true - }, - ['IE7', 26.6], - ['IE6', 20], - ['Chrome', 3.1], - ['Other', 5.4] - ] - }] - }); -} - -function test_Polygon() { - var allDefaults: Highcharts.PolygonChartSeriesOptions = {}; - - $('#container').highcharts({ - chart: { - type: 'polygon' - }, - xAxis: { - minPadding: 0.05, - maxPadding: 0.05 - }, - plotOptions: { - polygon: { - lineWidth: 5 - } - }, - series: [{ - data: [ - [34, 29.9], - [35, 144.0], - [43, 176.0], - [46, 71.5], - [12, 106.4], - [78, 129.2] - ] - }] - }); -} - -function test_Pyramid() { - var allDefaults: Highcharts.PyramidChartSeriesOptions = {}; - - // pyramid demo - $('#container').highcharts({ - chart: { - type: 'pyramid', - marginRight: 100 - }, - title: { - text: 'Sales pyramid', - x: -50 - }, - plotOptions: { - pyramid: { - dataLabels: { - enabled: true, - format: '{point.name} ({point.y:,.0f})', - color: 'black', - softConnector: true - } - } - }, - legend: { - enabled: false - }, - series: [{ - name: 'Unique users', - data: [ - ['Website visits', 15654], - ['Downloads', 4064], - ['Requested price list', 1987], - ['Invoice sent', 976], - ['Finalized', 846] - ] - }] - }); -} - -function test_SolidGauge() { - var allDefaults: Highcharts.SolidGaugeChartSeriesOptions = {}; - - // partial solid gauge demo - var gaugeOptions: Highcharts.Options = { - chart: { - type: 'solidgauge' - }, - title: null, - pane: { - center: ['50%', '85%'], - size: '140%', - startAngle: -90, - endAngle: 90, - background: { - backgroundColor: '#EEE', - innerRadius: '60%', - outerRadius: '100%', - shape: 'arc' - } - }, - tooltip: { - enabled: false - }, - colorAxis: { - stops: [ - [0.1, '#55BF3B'], // green - [0.5, '#DDDF0D'], // yellow - [0.9, '#DF5353'] // red - ] - }, - yAxis: { - lineWidth: 0, - minorTickInterval: null, - tickPixelInterval: 400, - tickWidth: 0, - title: { - y: -70 - }, - labels: { - y: 16 - } - }, - plotOptions: { - solidgauge: { - dataLabels: { - y: 5, - borderWidth: 0, - useHTML: true - } - } - } - }; -} - -function test_TreeMap() { - var allDefaults: Highcharts.TreeMapChartSeriesOptions = {}; - - // allowDrillToNode - var treeMap: Highcharts.TreeMapChartSeriesOptions = { - type: "treemap", - layoutAlgorithm: 'squarified', - allowDrillToNode: true, - alternateStartingDirection: true, - interactByLeaf: true, - layoutStartingDirection: "horizontal", - levelIsConstant: true, - data: [{ - id: "id_1", - name: 'A' - }, { - id: "id_2", - name: 'A1', - value: 2, - parent: 'id_1' - }, { - id: "id_3", - name: 'A2', - value: 2, - parent: 'id_1' - }, { - id: "id_4", - name: 'A3', - value: 2, - parent: 'id_1' - }, { - name: 'B', - value: 6 - }, { - name: 'C', - value: 4 - }, { - name: 'D', - value: 3 - }, { - name: 'E', - value: 2 - }, { - name: 'F', - value: 2 - }, { - name: 'G', - value: 1 - }] - }; -} - -function test_Waterfall() { - var allDefaults: Highcharts.WaterFallChartSeriesOptions = {}; - - // partial waterfall demo - var series: Highcharts.WaterFallChartSeriesOptions = { - upColor: Highcharts.getOptions().colors[2], - color: Highcharts.getOptions().colors[3], - data: [{ - name: 'Start', - y: 120000 - }, { - name: 'Product Revenue', - y: 569000 - }, { - name: 'Service Revenue', - y: 231000 - }, { - name: 'Positive Balance', - isIntermediateSum: true, - color: Highcharts.getOptions().colors[1] - }, { - name: 'Fixed Costs', - y: -342000 - }, { - name: 'Variable Costs', - y: -233000 - }, { - name: 'Balance', - isSum: true, - color: Highcharts.getOptions().colors[1] - }], - dataLabels: { - enabled: true, - formatter: function () { - return Highcharts.numberFormat(this.y / 1000, 0, ',') + 'k'; - }, - style: { - color: '#FFFFFF', - fontWeight: 'bold', - textShadow: '0px 0px 3px black' - } - }, - pointPadding: 0 - }; -} - -function test_AxisOptions() { - var allDefaults: Highcharts.AxisOptions = {}; - - var axis: Highcharts.AxisOptions = { - allowDecimals: false, - alternateGridColor: '#000000', - breaks: [{ - breakSize: 1, - from: 5, - to: 10, - repeat: 2 - }], - categories: ['A', 'B'], - ceiling: 100, - dateTimeLabelFormats: { - millisecond: "ms format" - }, - endOnTick: false, - events: { - afterBreaks: () => {}, - afterSetExtremes: () => {}, - pointBreak: () => {}, - setExtremes: () => {} - }, - floor: 0, - gridLineColor: '#111111', - gridLineDashStyle: 'Solid', - gridLineWidth: 1, - gridZIndex: 1, - id: "axis1", - labels: { - align: "left", - autoRotation: [-45], - autoRotationLimit: 70, - distance: 10, - enabled: true, - format: "format", - formatter: function() { return this.value; }, - maxStaggerLines: 5, - overflow: false, - padding: 10, - rotation: 10, - staggerLines: 10, - step: 3, - style: {}, - useHTML: false, - x: 0, - y: 0 - }, - lineColor: "#C0D0E0", - lineWidth: 2, - linkedTo: 1, - max: 1200, - maxPadding: 5, - min: 0, - minPadding: 5, - minRange: 10, - minTickInterval: 5, - minorGridLineColor: "#E0E0E0", - minorGridLineDashStyle: 'Solid', - minorGridLineWidth: 2, - minorTickColor: '#A0A0A0', - minorTickInterval: 5, - minorTickLength: 3, - minorTickPosition: 'inside', - minorTickWidth: 0, - offset: 0, - opposite: false, - plotBands: [{ - borderColor: 'black', - borderWidth: 2, - color: 'gray', - events: { - click: () => {}, - mouseover: () => {}, - mouseout: () => {}, - mousemove: () => {} - }, - from: 0, - id: 'plotband1', - innerRadius: 10, - label: { - align: 'left', - rotation: 10, - style: {}, - text: 'text', - textAlign: 'left', - useHTML: false, - verticalAlign: 'bottom', - x: 0, - y: 0 - }, - outerRadius: 20, - thickness: 1, - to: 2, - zIndex: 2 - }], - plotLines: [{ - color: '#000000', - dashStyle: 'Solid', - events: { - click: () => {}, - mouseover: () => {}, - mouseout: () => {}, - mousemove: () => {} - }, - id: 'plotline1', - label: { - align: 'left', - rotation: 10, - style: {}, - text: 'text', - textAlign: 'left', - useHTML: false, - verticalAlign: 'bottom', - x: 0, - y: 0 - }, - value: 10, - width: 100, - zIndex: 2 - }], - reversed: false, - showEmpty: false, - showFirstLabel: true, - showLastLabel: true, - startOfWeek: 1, - startOnTick: false, - tickAmount: 10, - tickColor: 'black', - tickInterval: 1, - tickLength: 10, - tickPixelInterval: 100, - tickPosition: 'outside', - tickPositioner: () => {}, - tickPositions: [0, 1, 2], - tickWidth: 1, - tickmarkPlacement: 'between', - title: { - align: 'left', - rotation: 10, - style: {}, - text: 'text', - x: 0, - y: 0 - }, - type: 'linear', - units: [ - ['millisecond', [1, 2, 5, 10, 20, 25, 50, 100, 200, 500]], - ['second', [1, 2, 5, 10, 15, 30]], - ['minute', [1, 2, 5, 10, 15, 30]]], - visible: true - }; -} - -function test_AxisObject() { - var axis = $("#container").highcharts().xAxis[0]; - axis.addPlotBand({ - from: 5.5, - to: 7.5, - color: '#FCFFC5', - id: 'plot-band-1' - }); - axis.removePlotBand('plot-band-1'); - axis.addPlotLine({ - value: 5.5, - color: 'red', - width: 2, - id: 'plot-line-1' - }); - axis.removePlotLine('plot-line-1'); - var extremes = axis.getExtremes(); - console.log('dataMax: ' + extremes.dataMax + '
        ' + - 'dataMin: ' + extremes.dataMin + '
        ' + - 'max: ' + extremes.max + '
        ' + - 'min: ' + extremes.min + '
        '); - axis.remove(); - axis.remove(false); - axis.setCategories(['A', 'B', 'C']); - axis.setCategories(['A', 'B', 'C', 'D'], false); - axis.setExtremes(); - axis.setExtremes(10, 20); - axis.setExtremes(10, 20, false); - axis.setExtremes(10, 20, false, false); - axis.setExtremes(10, 20, false, {duration: 50}); - axis.setTitle({text: 'text'}); - axis.setTitle({text: 'text'}, false); - axis.toPixels(10); - axis.toPixels(10, true); - axis.toValue(10); - axis.toValue(10, true); - axis.update({}); - axis.update({}, true); -} - -function test_ChartObject() { - var chart = $("#container").highcharts(); - chart.addAxis({}); - chart.addAxis({}, true); - chart.addAxis({}, true, false); - chart.addAxis({}, true, true, false); - chart.addAxis({}, true, true, {duration: 50}); - chart.addSeries({}); - chart.addSeries({}, false); - chart.addSeries({}, false, false); - chart.addSeries({}, false, {duration: 50}); - chart.addSeriesAsDrilldown({}, {}); - var container = chart.container; - console.log(container.id); - chart.destroy(); - chart.drillUp(); - chart.exportChart({}, {}); - chart.exportChartLocal({}, {}); - var object = chart.get('axisIdOrSeriesIdOrPointId'); - var svg1 = chart.getSVG(); - var svg2 = chart.getSVG({}); - var selectedPoints = chart.getSelectedPoints(); - var selectedSeries = chart.getSelectedSeries(); - chart.hideLoading(); - var options = chart.options; - chart.print(); - chart.redraw(); - chart.redraw(false); - chart.redraw({duration: 50, easing: 'fadeIn'}); - chart.reflow(); - var series = chart.series; - chart.setSize(200, 200); - chart.setSize(200, 200, false); - chart.setSize(200, 200, {duration: 50}); - chart.setTitle({}, {}); - chart.setTitle({}, {}, false); - chart.showLoading(); - chart.showLoading("Loading label"); - var firstXAxis = chart.xAxis[0]; - var firstYAxis = chart.yAxis[0]; - var legend = chart.legend; -} - -function test_ElementObject() { - var renderer = new Highcharts.Renderer($("#container")[0], 400, 400); - var group = renderer.g().add(); - renderer - .circle(200, 150, 100) - .attr({ - fill: '#FCFFC5', - stroke: 'black', - 'stroke-width': 1 - }) - .add(group); - var rect = renderer - .rect(90, 150, 100, 100, 5) - .attr({ - fill: '#C5FFC5', - stroke: 'black', - 'stroke-width': 1 - }) - .add(group); - rect.animate({ - x: 50, - y: 50, - width: 200, - height: 20, - 'stroke-width': 10 - }); - rect.destroy(); - var styledText = renderer - .text('Series 1', 140, 140) - .attr({ - rotation: -25 - }) - .css({ - color: '#4572A7', - fontSize: '16px' - }) - .add(); - var bbox = styledText.getBBox(); - styledText.on('click', () => {}); - group.toFront(); -} - -function test_PointObject() { - var point = $('#container').highcharts().get('point1'); - var category = point.category; - var percentage = point.percentage; - point.index; - point.remove(); - point.remove(false); - point.remove(false, {duration: 50}); - point.select(); - point.select(false); - point.select(false, true); - var isSelected = point.selected; - var series = point.series; - point.slice(); - point.slice(false); - point.slice(false, false); - point.slice(false, false, false); - point.slice(false, false, {duration: 50}); - var total = point.total; - point.update(0); - point.update([0, 0]); - point.update({}); - point.update({}, false); - point.update({}, false, false); - point.update({}, false, {duration: 50}); - var x = point.x; - var y = point.y; -} - -function test_RendererObject() { - var renderer = $('#container').highcharts().renderer; - renderer.arc(0, 0, 20, 10, 0, Math.PI); - renderer.circle(0, 0, 100); - renderer.g('groupName'); - renderer.image('http://source', 20, 20, 100, 100); - renderer.label('Label', 200, 100, 'rect', 0, 0, false, false, 'class'); - renderer.path(['M', 100, 100, 'L', 100, 200]); - renderer.rect(20, 20, 100, 100, 2); - renderer.text('text', 10, 10); -} - -function test_SeriesObject() { - var series = $('#container').highcharts().get('series1'); - series.addPoint(0); - series.addPoint([0, 0]); - series.addPoint({}); - series.addPoint({}, false); - series.addPoint({}, false, true); - series.addPoint({}, false, true, false); - series.addPoint({}, false, true, {duration: 50}); - var chart = series.chart; - var data = series.data; - series.hide(); - var name = series.name; - var options = series.options; - series.remove(); - series.remove(false); - series.removePoint(0); - series.removePoint(0, false); - series.removePoint(0, false, false); - series.removePoint(0, false, {duration: 50}); - series.select(); - series.select(true); - var isSelected = series.selected; - series.setData([0, 1, 2]); - series.setData([[0, 0], [1, 1], [2, 2]]); - series.setData([{}, {}, {}]); - series.setData([0, 1, 2], false); - series.setData([0, 1, 2], false, false); - series.setData([0, 1, 2], false, {duration: 50}); - series.setData([0, 1, 2], false, false, false); - series.setVisible(); - series.setVisible(true); - series.setVisible(true, false); - series.show(); - var type = series.type; - series.update({}); - series.update({}, false); - var visible = series.visible; - var xAxis = series.xAxis; - var yAxis = series.yAxis; -} -function test_LegendObject() { - var legend = $('#container').highcharts().legend; - legend.update({}); - legend.update({}, false); -} diff --git a/highcharts/test/no-data-to-display.ts b/highcharts/test/no-data-to-display.ts deleted file mode 100644 index e2bb453714..0000000000 --- a/highcharts/test/no-data-to-display.ts +++ /dev/null @@ -1,8 +0,0 @@ -function test_NoDataToDisplay() { - var chart = $("#container").highcharts(); - var chartHasData = chart.hasData(); - chart.hideNoData(); - chart.showNoData("Custom no data message"); -} - -HighchartsNoDataToDisplay(Highcharts); \ No newline at end of file diff --git a/highcharts/tsconfig.json b/highcharts/tsconfig.json deleted file mode 100644 index 3526f42da7..0000000000 --- a/highcharts/tsconfig.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": false, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "modules/boost.d.ts", - "modules/exporting.d.ts", - "modules/no-data-to-display.d.ts", - "modules/offline-exporting.d.ts", - "highcharts-more.d.ts", - "highstock.d.ts", - "test/boost.ts", - "test/exporting.ts", - "test/highstock.ts", - "test/index.ts", - "test/more.ts", - "test/no-data-to-display.ts", - "test/offline-exporting.ts" - ] -} \ No newline at end of file diff --git a/hiredis/tslint.json b/hiredis/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/hiredis/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/hoek/index.d.ts b/hoek/index.d.ts deleted file mode 100644 index e1ea52677b..0000000000 --- a/hoek/index.d.ts +++ /dev/null @@ -1,211 +0,0 @@ -// Type definitions for hoek 4.1 -// Project: https://github.com/hapijs/hoek -// Definitions by: Prashant Tiwari -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -interface ContainOptions { - /** Perform a deep comparison of the values? */ - deep?: boolean; - /** Allow only one occurrence of each value? */ - once?: boolean; - /** Don't allow values not explicitly listed? */ - only?: boolean; - /** Allow partial match of the values? */ - part?: boolean; -} - -interface ReachOptions { - /** String to split chain path on. Defaults to ".". */ - separator?: string; - /** Value to return if the path or value is not present. Default is undefined. */ - default?: any; - /** Throw an error on missing member? Default is false. */ - strict?: boolean; - /** Allow traversing functions for properties? */ - functions?: boolean; -} - -// Object - -/** - * Clone an object or an array. - */ -export function clone(obj: T): T; - -/** - * Clone an object or array. - * */ -export function cloneWithShallow(obj: any, keys: string[]): any; - -/** - * Merge all the properties of source into target. */ -export function merge(target: T1, source: T2, isNullOverride?: boolean, isMergeArrays?: boolean): T1 & T2; - -/** - * Apply options to a copy of the defaults. - * */ -export function applyToDefaults(defaults: T1, options: T2, isNullOverride?: boolean): T1 & T2; - -/** - * Apply options to a copy of the defaults. - */ -export function applyToDefaultsWithShallow(defaults: T1, options: T2, keys?: string[]): T1 & T2; - -/** - * Perform a deep comparison of the two values. - */ -export function deepEqual(b: T, a: T, options?: any): T; - -/** - * Remove duplicate items from Array. - */ -export function unique(array: T[], key?: string): T[]; - -/** - * Convert an Array into an Object. - */ -export function mapToObject(array: any[], key?: string): any; - -/** - * Find the common unique items in two arrays. - */ -export function intersect(array1: any[], array2: any[]): any; - -/** - * Test if the reference value contains the provided values. - */ -export function contain(ref: any, values: any, options?: ContainOptions): boolean; - -/** - * Flatten an array. - */ -export function flatten(array: any[], target?: any[]): any[]; - -/** - * Convert an object key chain string to reference. - */ -export function reach(obj: any, chain: any, options?: ReachOptions): any; - -/** - * Replace string parameters ({name}) with their corresponding object key values. - */ -export function reachTemplate(obj: any, template: string, options?: ReachOptions): any; - -/** - * Transform an existing object into a new one based on the supplied obj and transform map. - */ -export function transform(obj: any, transform: any, options?: ReachOptions): any; - -/** - * Perform a shallow copy by copying the references of all the top level children. - */ -export function shallow(obj: any): any; - -/** - * Convert an object to string. Any errors are caught and reported back in the form of the returned string. - */ -export function stringify(obj: any): string; - -// Timer - -/** - * A Timer object. - */ -export class Timer { - /** The number of milliseconds elapsed since the epoch. */ - ts: number; - /** The time (ms) elapsed since the timer was created. */ - elapsed(): number; -} - -// Bench - -/** - * Same as Timer, except ts stores the internal node clock. - */ -export class Bench { - /** The number of milliseconds on the node clock elapsed since the epoch. */ - ts: number; - /** The time (ms) elapsed since the timer was created. */ - elapsed(): number; -} - -// Binary Encoding/Decoding - -/** - * Encode value of string or buffer type in Base64 or URL encoding. - */ -export function base64urlEncode(value: string): string; - -/** - * Decode string into Base64 or URL encoding. - */ -export function base64urlDecode(value: string): string; - -// Escaping Characters - -/** - * Escape html characters. - */ -export function escapeHtml(htmlString: string): string; - -/** - * Escape attribute value for use in HTTP header. - */ -export function escapeHeaderAttribute(attribute: string): string; - -/** - * Escape string for Regex construction. - */ -export function escapeRegex(regexString: string): string; - -// Errors - -/** - * Print message or throw error if condition fails. - */ -export function assert(condition: boolean, message: string | Error): void | Error; - -/** - * Throw if process.env.NODE_ENV === 'test'. Else display most recent stack and exit process. - */ -export function abort(message: string | Error): void; - -/** - * Display the trace stack. - */ -export function displayStack(slice?: any): string[]; - -/** - * Return a trace stack array. - */ -export function callStack(slice?: any): any[]; - -// Function - -/** - * Wrap fn in process.nextTick. - */ -export function nextTick(fn: () => void): () => void; - -/** - * Make sure fn is only run once. - */ -export function once(fn: () => void): () => void; - -/** - * A simple no-op function. - */ -export function ignore(): void; - -// Miscellaneous - -/** - * path to prepend to a randomly generated file name. - */ -export function uniqueFilename(path: string, extension?: string): string; - -/** - * Check value to see if it is an integer. - */ -export function isInteger(value: any): boolean; diff --git a/hoek/tslint.json b/hoek/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/hoek/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/howler/index.d.ts b/howler/index.d.ts deleted file mode 100644 index df3f6a363b..0000000000 --- a/howler/index.d.ts +++ /dev/null @@ -1,117 +0,0 @@ -// Type definitions for howler.js v2.0.0 -// Project: https://github.com/goldfire/howler.js -// Definitions by: Pedro Casaubon , Todd Dukart -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -interface HowlerGlobal { - mute(muted: boolean): void; - volume(): number; - volume(volume: number): this; - codecs(ext: string): boolean; - unload(): void; - usingWebAudio: boolean; - noAudio: boolean; - mobileAudioEnable: boolean; - autoSuspend: boolean; - ctx: AudioContext; - masterGain: GainNode; -} - -declare let Howler: HowlerGlobal; - -interface IHowlSoundSpriteDefinition { - [name: string]: [number, number]|[number, number, boolean] -} - -interface IHowlProperties { - src: string|string[]; - volume?: number; - html5?: boolean; - loop?: boolean; - preload?: boolean; - autoplay?: boolean; - mute?: boolean; - sprite?: IHowlSoundSpriteDefinition; - rate?: number; - pool?: number; - format?: string[] | string; - onload?: () => void; - onloaderror?: (soundId: number, error: any) => void; - onplay?: (soundId: number) => void; - onend?: (soundId: number) => void; - onpause?: (soundId: number) => void; - onstop?: (soundId: number) => void; - onmute?: (soundId: number) => void; - onvolume?: (soundId: number) => void; - onrate?: (soundId: number) => void; - onseek?: (soundId: number) => void; - onfade?: (soundId: number) => void; -} - -interface Howl { - play(spriteOrId?: string|number): number; // .play() is not chainable; the other methods are - pause(id?: number): this; - stop(id?: number): this; - - mute(): boolean; - mute(muted: boolean, id?: number): this; - - volume(): number; - volume(idOrSetVolume: number): this | number; - volume(volume: number, id: number): this; - - fade(from: number, to: number, duration: number, id?: number): this; - - rate(): number; - rate(idOrSetRate: number): this | number; - rate(rate: number, id: number): this; - - seek(seek?: number, id?: number): this | number; - loop(loop?: boolean, id?: number): this; - playing(id?: number): boolean; - duration(id?: number): number; - - - on(event: 'load', callback: () => void, id?: number): this; - on(event: 'loaderror', callback: (soundId: number, error: any) => void, id?: number): this; - on(event: 'play', callback: (soundId: number) => void, id?: number): this; - on(event: 'end', callback: (soundId: number) => void, id?: number): this; - on(event: 'pause', callback: (soundId: number) => void, id?: number): this; - on(event: 'stop', callback: (soundId: number) => void, id?: number): this; - on(event: 'mute', callback: (soundId: number) => void, id?: number): this; - on(event: 'volume', callback: (soundId: number) => void, id?: number): this; - on(event: 'rate', callback: (soundId: number) => void, id?: number): this; - on(event: 'seek', callback: (soundId: number) => void, id?: number): this; - on(event: 'fade', callback: (soundId: number) => void, id?: number): this; - on(event: string, callback: Function, id?: number): this; - - once(event: 'load', callback: () => void, id?: number): this; - once(event: 'loaderror', callback: (soundId: number, error: any) => void, id?: number): this; - once(event: 'play', callback: (soundId: number) => void, id?: number): this; - once(event: 'end', callback: (soundId: number) => void, id?: number): this; - once(event: 'pause', callback: (soundId: number) => void, id?: number): this; - once(event: 'stop', callback: (soundId: number) => void, id?: number): this; - once(event: 'mute', callback: (soundId: number) => void, id?: number): this; - once(event: 'volume', callback: (soundId: number) => void, id?: number): this; - once(event: 'rate', callback: (soundId: number) => void, id?: number): this; - once(event: 'seek', callback: (soundId: number) => void, id?: number): this; - once(event: 'fade', callback: (soundId: number) => void, id?: number): this; - once(event: string, callback: Function, id?: number): this; - - off(event: string, callback?: Function, id?: number): this; - - state(): 'unloaded' | 'loading' | 'loaded'; - load(): void; - unload(): void; -} - -interface HowlStatic { - new (properties: IHowlProperties): Howl; -} - -declare let Howl: HowlStatic; - -declare module "howler" { - export let Howler: HowlerGlobal; - export let Howl: HowlStatic; -} diff --git a/html-webpack-plugin/index.d.ts b/html-webpack-plugin/index.d.ts deleted file mode 100644 index 792c7a2dc0..0000000000 --- a/html-webpack-plugin/index.d.ts +++ /dev/null @@ -1,88 +0,0 @@ -// Type definitions for html-webpack-plugin 2.11 -// Project: https://github.com/ampedandwired/html-webpack-plugin -// Definitions by: Simon Hartcher , Benjamin Lim -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -import { Plugin } from 'webpack'; -import { Options as HtmlMinifierOptions } from 'html-minifier'; - -export = HtmlWebpackPlugin; - -declare class HtmlWebpackPlugin extends Plugin { - constructor(options?: HtmlWebpackPlugin.Options); -} - -declare namespace HtmlWebpackPlugin { - type MinifyOptions = HtmlMinifierOptions; - - /** - * It is assumed that each [chunk] contains at least the properties "id" - * (containing the chunk id) and "parents" (array containing the ids of the - * parent chunks). - * - * @todo define in webpack - */ - interface Chunk { - id: string; - parents: string[]; - [propName: string]: any; - } - - type ChunkComparator = (a: Chunk, b: Chunk) => number; - - interface Options { - /** `true | false` if `true` (default) try to emit the file only if it was changed. */ - cache?: boolean; - /** - * Allows to control how chunks should be sorted before they are included to the html. - * Allowed values: `'none' | 'auto' | 'dependency' | {function}` - default: `'auto'` - */ - chunksSortMode?: 'none' | 'auto' | 'dependency' | ChunkComparator; - /** Allows you to add only some chunks (e.g. only the unit-test chunk) */ - chunks?: string[]; - /** Allows you to skip some chunks (e.g. don't add the unit-test chunk) */ - excludeChunks?: string[]; - /** Adds the given favicon path to the output html. */ - favicon?: string; - /** - * The file to write the HTML to. - * Defaults to index.html. You can specify a subdirectory here too (eg: `assets/admin.html`). - */ - filename?: string; - /** - * `true | false` if `true` then append a unique webpack compilation hash to all included scripts and css files. - * This is useful for cache busting. - */ - hash?: boolean; - /** - * `true | 'head' | 'body' | false` - * Inject all assets into the given template or templateContent. - * When passing true or 'body' all javascript resources will be placed at the bottom of the body element. - * 'head' will place the scripts in the head element. - */ - inject?: 'body' | 'head' | boolean; - /** - * `{...} | false` Pass a html-minifier options object to minify the output. - * https://github.com/kangax/html-minifier#options-quick-reference - */ - minify?: false | MinifyOptions; - /** `true | false` if `true` (default) errors details will be written into the html page. */ - showErrors?: boolean; - /** Webpack require path to the template. Please see the docs for details. */ - template?: string; - /** The title to use for the generated HTML document. */ - title?: string; - /** `true | false` If `true` render the link tags as self-closing, XHTML compliant. Default is `false` */ - xhtml?: boolean; - /** - * In addition to the options actually used by this plugin, you can use this hash to pass arbitrary data through - * to your template. - */ - [option: string]: any; - } - - /** @deprecated use MinifyOptions */ - type MinifyConfig = MinifyOptions; - /** @deprecated use Options */ - type Config = Options; -} diff --git a/html-webpack-plugin/tslint.json b/html-webpack-plugin/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/html-webpack-plugin/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/html-webpack-template/tslint.json b/html-webpack-template/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/html-webpack-template/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/htmlhint/htmlhint-tests.ts b/htmlhint/htmlhint-tests.ts deleted file mode 100644 index 1a44c78888..0000000000 --- a/htmlhint/htmlhint-tests.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { HTMLHint, RuleSet } from "htmlhint"; - -const htmlHintRules: RuleSet = { - "tagname-lowercase": true, - "attr-lowercase": true, - "attr-value-double-quotes": true, - "doctype-first": true, - "tag-pair": true, - "spec-char-escape": true, - "id-unique": true, - "src-not-empty": true, - "attr-no-duplication": true, - "title-require": true -}; - -const result = HTMLHint.verify('', htmlHintRules); -const formatted = HTMLHint.format(result, { indent: 2 }); diff --git a/htmlhint/index.d.ts b/htmlhint/index.d.ts deleted file mode 100644 index 7908eaaddb..0000000000 --- a/htmlhint/index.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Type definitions for HTMLHint 0.9 -// Project: https://github.com/yaniswang/HTMLHint -// Definitions by: Alan Agius -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export interface LintResult { - evidence: string; - line: number; - col: number; - message: string; - rule: Rule; -} - -export interface FormatOptions { - indent?: number; - colors?: boolean; -} - -export interface Rule { - id: string; - description: string; - link: string; -} - -export interface RuleSet { - [id: string]: boolean; -} - -export namespace HTMLHint { - function verify(fileContent: string, ruleSet?: RuleSet): LintResult[]; - function format(arrMessages: LintResult[], options?: FormatOptions): string[]; -} diff --git a/http-assert/tslint.json b/http-assert/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/http-assert/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/http-codes/index.d.ts b/http-codes/index.d.ts deleted file mode 100644 index e106812f0c..0000000000 --- a/http-codes/index.d.ts +++ /dev/null @@ -1,67 +0,0 @@ -// Type definitions for http-codes 1.0 -// Project: https://github.com/flesler/node-http-codes -// Definitions by: Mohamed Hegazy -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export declare const ACCEPTED: number; -export declare const ALREADY_REPORTED: number; -export declare const BAD_GATEWAY: number; -export declare const BAD_REQUEST: number; -export declare const BANDWIDTH_LIMIT_EXCEEDED: number; -export declare const CONFLICT: number; -export declare const CONTINUE: number; -export declare const CREATED: number; -export declare const EXPECTATION_FAILED: number; -export declare const FAILED_DEPENDENCY: number; -export declare const FORBIDDEN: number; -export declare const FOUND: number; -export declare const GATEWAY_TIMEOUT: number; -export declare const GONE: number; -export declare const HTTP_VERSION_NOT_SUPPORTED: number; -export declare const IM_A_TEAPOT: number; -export declare const IM_USED: number; -export declare const INSUFFICIENT_STORAGE: number; -export declare const INTERNAL_SERVER_ERROR: number; -export declare const LENGTH_REQUIRED: number; -export declare const LOCKED: number; -export declare const LOOP_DETECTED: number; -export declare const METHOD_NOT_ALLOWED: number; -export declare const MISDIRECTED_REQUEST: number; -export declare const MOVED_PERMANENTLY: number; -export declare const MULTIPLE_CHOICES: number; -export declare const MULTI_STATUS: number; -export declare const NETWORK_AUTHENTICATION_REQUIRED: number; -export declare const NON_AUTHORITATIVE_INFORMATION: number; -export declare const NOT_ACCEPTABLE: number; -export declare const NOT_EXTENDED: number; -export declare const NOT_FOUND: number; -export declare const NOT_IMPLEMENTED: number; -export declare const NOT_MODIFIED: number; -export declare const NO_CONTENT: number; -export declare const OK: number; -export declare const PARTIAL_CONTENT: number; -export declare const PAYLOAD_TOO_LARGE: number; -export declare const PAYMENT_REQUIRED: number; -export declare const PERMANENT_REDIRECT: number; -export declare const PRECONDITION_FAILED: number; -export declare const PRECONDITION_REQUIRED: number; -export declare const PROCESSING: number; -export declare const PROXY_AUTHENTICATION_REQUIRED: number; -export declare const RANGE_NOT_SATISFIABLE: number; -export declare const REQUEST_HEADER_FIELDS_TOO_LARGE: number; -export declare const REQUEST_TIMEOUT: number; -export declare const RESET_CONTENT: number; -export declare const SEE_OTHER: number; -export declare const SERVICE_UNAVAILABLE: number; -export declare const SWITCHING_PROTOCOLS: number; -export declare const TEMPORARY_REDIRECT: number; -export declare const TOO_MANY_REQUESTS: number; -export declare const UNAUTHORIZED: number; -export declare const UNAVAILABLE_FOR_LEGAL_REASONS: number; -export declare const UNORDERED_COLLECTION: number; -export declare const UNPROCESSABLE_ENTITY: number; -export declare const UNSUPPORTED_MEDIA_TYPE: number; -export declare const UPGRADE_REQUIRED: number; -export declare const URI_TOO_LONG: number; -export declare const USE_PROXY: number; -export declare const VARIANT_ALSO_NEGOTIATES: number; diff --git a/http-codes/tslint.json b/http-codes/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/http-codes/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/http-errors/index.d.ts b/http-errors/index.d.ts deleted file mode 100644 index 176703f23f..0000000000 --- a/http-errors/index.d.ts +++ /dev/null @@ -1,95 +0,0 @@ -// Type definitions for http-errors v1.5.0 -// Project: https://github.com/jshttp/http-errors -// Definitions by: Tanguy Krotoff -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare module 'http-errors' { - 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; - headers?: { - [key: string]: string - }; - } - - type HttpErrorConstructor = new(msg?: string) => HttpError; - - interface CreateHttpError { - // See https://github.com/Microsoft/TypeScript/issues/227#issuecomment-50092674 - [code: string]: new (msg?: string) => HttpError; - - (...args: Array): HttpError; - - Continue: HttpErrorConstructor; - SwitchingProtocols: HttpErrorConstructor; - Processing: HttpErrorConstructor; - OK: HttpErrorConstructor; - Created: HttpErrorConstructor; - Accepted: HttpErrorConstructor; - NonAuthoritativeInformation: HttpErrorConstructor; - NoContent: HttpErrorConstructor; - ResetContent: HttpErrorConstructor; - PartialContent: HttpErrorConstructor; - MultiStatus: HttpErrorConstructor; - AlreadyReported: HttpErrorConstructor; - IMUsed: HttpErrorConstructor; - MultipleChoices: HttpErrorConstructor; - MovedPermanently: HttpErrorConstructor; - Found: HttpErrorConstructor; - SeeOther: HttpErrorConstructor; - NotModified: HttpErrorConstructor; - UseProxy: HttpErrorConstructor; - Unused: HttpErrorConstructor; - TemporaryRedirect: HttpErrorConstructor; - PermanentRedirect: HttpErrorConstructor; - BadRequest: HttpErrorConstructor; - Unauthorized: HttpErrorConstructor; - PaymentRequired: HttpErrorConstructor; - Forbidden: HttpErrorConstructor; - NotFound: HttpErrorConstructor; - MethodNotAllowed: HttpErrorConstructor; - NotAcceptable: HttpErrorConstructor; - ProxyAuthenticationRequired: HttpErrorConstructor; - RequestTimeout: HttpErrorConstructor; - Conflict: HttpErrorConstructor; - Gone: HttpErrorConstructor; - LengthRequired: HttpErrorConstructor; - PreconditionFailed: HttpErrorConstructor; - PayloadTooLarge: HttpErrorConstructor; - URITooLong: HttpErrorConstructor; - UnsupportedMediaType: HttpErrorConstructor; - RangeNotSatisfiable: HttpErrorConstructor; - ExpectationFailed: HttpErrorConstructor; - ImATeapot: HttpErrorConstructor; - MisdirectedRequest: HttpErrorConstructor; - UnprocessableEntity: HttpErrorConstructor; - Locked: HttpErrorConstructor; - FailedDependency: HttpErrorConstructor; - UnorderedCollection: HttpErrorConstructor; - UpgradeRequired: HttpErrorConstructor; - PreconditionRequired: HttpErrorConstructor; - TooManyRequests: HttpErrorConstructor; - RequestHeaderFieldsTooLarge: HttpErrorConstructor; - UnavailableForLegalReasons: HttpErrorConstructor; - InternalServerError: HttpErrorConstructor; - NotImplemented: HttpErrorConstructor; - BadGateway: HttpErrorConstructor; - ServiceUnavailable: HttpErrorConstructor; - GatewayTimeout: HttpErrorConstructor; - HTTPVersionNotSupported: HttpErrorConstructor; - VariantAlsoNegotiates: HttpErrorConstructor; - InsufficientStorage: HttpErrorConstructor; - LoopDetected: HttpErrorConstructor; - BandwidthLimitExceeded: HttpErrorConstructor; - NotExtended: HttpErrorConstructor; - NetworkAuthenticationRequired: HttpErrorConstructor; - } - } - - var createHttpError: createHttpError.CreateHttpError; - export = createHttpError; -} diff --git a/http-link-header/tslint.json b/http-link-header/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/http-link-header/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/hyco-ws/index.d.ts b/hyco-ws/index.d.ts deleted file mode 100644 index 053c7fba18..0000000000 --- a/hyco-ws/index.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -// Type definitions for hyco-ws 1.0 -// Project: https://github.com/Azure/azure-relay-node -// Definitions by: Manuel Rodrigo Cabello -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -import * as WebSocket from 'ws'; - -export class HybridConnectionWebSocketServer extends NodeJS.EventEmitter { - constructor(options: any); - close(callback: () => void): void; - listenUri: string; - closeRequested: boolean; - options: any; - path: string; - clients: WebSocket[]; - controlChannel: WebSocket; -} - -export function createRelayedServer(options: any, fn: (ws: WebSocket) => void): HybridConnectionWebSocketServer; -export function relayedConnect(address: string, fn: () => void): WebSocket; -export function createRelayToken(uri: string, key_name: string, key: string, expiry?: number): string; -export function appendRelayToken(uri: string, key_name: string, key: string, expiry?: number): string; -export function createRelayBaseUri(serviceBusNamespace: string, path: string): string; -export function createRelaySendUri(serviceBusNamespace: string, path: string, token?: any, id?: any): string; -export function createRelayListenUri(serviceBusNamespace: string, path: string, token?: any, id?: any): string; \ No newline at end of file diff --git a/hyco-ws/tslint.json b/hyco-ws/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/hyco-ws/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/hyperscript/hyperscript-tests.ts b/hyperscript/hyperscript-tests.ts deleted file mode 100644 index f4bab0550a..0000000000 --- a/hyperscript/hyperscript-tests.ts +++ /dev/null @@ -1,58 +0,0 @@ - -import * as h from 'hyperscript' - -// Test/example code adapted from https://github.com/dominictarr/hyperscript/blob/master/README.md - -// example -h('div#page', - h('div#header', - h('h1.classy', 'h', { style: {'background-color': '#22f'} })), - h('div#menu', { style: {'background-color': '#2f2'} }, - h('ul', - h('li', 'one'), - h('li', 'two'), - h('li', 'three'))), - h('h2', 'content title', { style: {'background-color': '#f22'} }), - h('p', - "so it's just like a templating engine,\n", - "but easy to use inline with javascript\n"), - h('p', - "the intension is for this to be used to create\n", - "reusable, interactive html widgets. ")) - -// event -h('a', {href: '#', - onclick: function (e: Event) { - alert('you are 1,000,000th visitor!') - e.preventDefault() - } -}, 'click here to win a prize') - -// array of children -const obj: {[id: string]: string} = { - a: 'Apple', - b: 'Banana', - c: 'Cherry', - d: 'Durian', - e: 'Elder Berry' -} -h('table', - h('tr', h('th', 'letter'), h('th', 'fruit')), - Object.keys(obj).map(function (k) { - return h('tr', - h('th', k), - h('td', obj[k]) - ) - }) -) - -// new context -const h2 = h.context() -h2('a', {href: '#', - onclick: function (e: Event) { - alert('you are 1,000,000th visitor!') - e.preventDefault() - } -}, "Click this") - -h2.cleanup() diff --git a/hyperscript/index.d.ts b/hyperscript/index.d.ts deleted file mode 100644 index 4274365404..0000000000 --- a/hyperscript/index.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Type definitions for hyperscript -// Project: https://github.com/dominictarr/hyperscript -// Definitions by: Mike Linkovich -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare module 'hyperscript' { - - interface HyperScript { - /** Creates an HTML element */ - (tagName: string, ...args: any[]): HTMLElement; - /** Cleans up any event handlers created by this hyperscript context */ - cleanup(): void; - /** Creates a new hyperscript context */ - context(): HyperScript; - } - - const h: HyperScript; - export = h; -} diff --git a/hystrixjs/index.d.ts b/hystrixjs/index.d.ts deleted file mode 100644 index d4a738b999..0000000000 --- a/hystrixjs/index.d.ts +++ /dev/null @@ -1,148 +0,0 @@ -// Type definitions for dragula v2.1.2 -// Project: https://bitbucket.org/igor_sechyn/hystrixjs -// Definitions by: Igor Sechyn -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// -/// - -declare namespace HystrixJS { - - interface HystrixProperties { - "hystrix.force.circuit.open"?: boolean, - "hystrix.force.circuit.closed"?: boolean, - "hystrix.circuit.sleepWindowInMilliseconds"?:number, - "hystrix.circuit.errorThresholdPercentage"?: number, - "hystrix.circuit.volumeThreshold"?:number, - "hystrix.circuit.volumeThreshold.forceOverride"?: boolean, - "hystrix.circuit.volumeThreshold.override"?: number, - "hystrix.execution.timeoutInMilliseconds"?: number, - "hystrix.metrics.statistical.window.timeInMilliseconds"?: number, - "hystrix.metrics.statistical.window.bucketsNumber"?: number, - "hystrix.metrics.percentile.window.timeInMilliseconds"?: number, - "hystrix.metrics.percentile.window.bucketsNumber"?: number, - "hystrix.request.volume.rejectionThreshold"?: number - } - - interface HystrixConfig { - metricsPercentileWindowBuckets(): number; - circuitBreakerForceClosed(): boolean; - circuitBreakerForceOpened(): boolean; - circuitBreakerSleepWindowInMilliseconds(): number; - circuitBreakerErrorThresholdPercentage(): number; - circuitBreakerRequestVolumeThreshold(): number; - circuitBreakerRequestVolumeThresholdForceOverride(): boolean; - circuitBreakerRequestVolumeThresholdOverride(): number; - executionTimeoutInMilliseconds(): number; - metricsStatisticalWindowBuckets(): number; - metricsStatisticalWindowInMilliseconds(): number; - metricsPercentileWindowInMilliseconds(): number; - metricsPercentileWindowBuckets(): number; - requestVolumeRejectionThreshold(): number; - resetProperties(): void; - init(properties: HystrixProperties): void; - } - - interface Command { - execute(...args: any[]): Q.Promise; - } - - interface CommandBuilder { - circuitBreakerSleepWindowInMilliseconds(value: number): CommandBuilder; - errorHandler(value: (error: any) => boolean): CommandBuilder; - timeout(value: number): CommandBuilder; - circuitBreakerRequestVolumeThreshold(value: number): CommandBuilder; - requestVolumeRejectionThreshold(value: number): CommandBuilder; - circuitBreakerForceOpened(value: boolean): CommandBuilder; - circuitBreakerForceClosed(value: boolean): CommandBuilder; - statisticalWindowNumberOfBuckets(value: number): CommandBuilder; - statisticalWindowLength(value: number): CommandBuilder; - percentileWindowNumberOfBuckets(value: number): CommandBuilder; - percentileWindowLength(value: number): CommandBuilder; - circuitBreakerErrorThresholdPercentage(value: number): CommandBuilder; - run(value: (args: any) => Q.Promise): CommandBuilder; - fallbackTo(value: (...args: any[]) => Q.Promise): CommandBuilder; - context(value: any): CommandBuilder; - build(): Command; - } - - interface CommandFactory { - getOrCreate(commandKey: string, commandGroup?: string): CommandBuilder; - resetCache(): void; - } - - interface HealthCounts { - totalCount: number; - errorCount: number; - errorPercentage: number; - } - - interface CommandMetrics { - markSuccess(): void; - markRejected(): void; - markFailure(): void; - markTimeout(): void; - markShortCircuited(): void; - incrementExecutionCount(): void; - decrementExecutionCount(): void; - getCurrentExecutionCount(): number; - addExecutionTime(value: number): void; - getRollingCount(type: any): number; - getExecutionTime(percentile: any): number; - getHealthCounts(): HealthCounts; - reset(): void; - } - - interface MetricsProperties { - commandKey: string, - commandGroup: string, - statisticalWindowTimeInMilliSeconds?: number, - statisticalWindowNumberOfBuckets?: number, - percentileWindowTimeInMilliSeconds?: number, - percentileWindowNumberOfBuckets?: number - } - - interface MetricsFactory { - getOrCreate(config: MetricsProperties): CommandMetrics; - resetCache(): void; - getAllMetrics(): Array; - } - - interface CirctuiBreakerConfig { - circuitBreakerSleepWindowInMilliseconds: number, - commandKey: string, - circuitBreakerErrorThresholdPercentage: number, - circuitBreakerRequestVolumeThreshold: number, - commandGroup: string, - circuitBreakerForceClosed: boolean, - circuitBreakerForceOpened: boolean - } - - interface CircuitBreaker { - allowRequest(): boolean; - allowSingleTest(): boolean; - isOpen(): boolean; - markSuccess(): void; - } - - interface CircuitFactory { - getOrCreate(config: CirctuiBreakerConfig): CircuitBreaker; - getCache(): Array; - resetCache(): void; - } - - interface HystrixSSEStream { - toObservable(): Rx.Observable - } -} -declare var hystrixjs: { - commandFactory: HystrixJS.CommandFactory, - metricsFactory: HystrixJS.MetricsFactory, - circuitFactory: HystrixJS.CircuitFactory, - hystrixSSEStream: HystrixJS.HystrixSSEStream, - hystrixConfig: HystrixJS.HystrixConfig -}; - -declare module "hystrixjs" { - export = hystrixjs; -} diff --git a/hystrixjs/tsconfig.json b/hystrixjs/tsconfig.json deleted file mode 100644 index c23c0c6875..0000000000 --- a/hystrixjs/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "hystrixjs-tests.ts" - ] -} \ No newline at end of file diff --git a/in-range/tslint.json b/in-range/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/in-range/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/indent-string/tslint.json b/indent-string/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/indent-string/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/inert/index.d.ts b/inert/index.d.ts deleted file mode 100644 index fdd3d91bcd..0000000000 --- a/inert/index.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -// Type definitions for inert 4.0 -// Project: https://github.com/hapijs/inert/ -// Definitions by: Steve Ognibene -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -// Note: this definition contains only enough to make TypeScript happy (hapi?) when -// importing inert. The functionality that importing inert adds to the reply -// object and its other features are implemented in the hapi definition on -// DefinitelyTyped. The inert object is never actually used in practice except to -// be passed as an extension to the server.register() method which already takes -// an `any` argument, so just using `any` here is fine. - -/// - -export var inert: any; \ No newline at end of file diff --git a/inert/inert-tests.ts b/inert/inert-tests.ts deleted file mode 100644 index e917fb9e41..0000000000 --- a/inert/inert-tests.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as HapiES6 from 'hapi'; -import * as InertES6 from 'inert'; - -const server = new HapiES6.Server({}); -server.register(InertES6, () => {}); diff --git a/inert/tslint.json b/inert/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/inert/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/inquirer/index.d.ts b/inquirer/index.d.ts deleted file mode 100644 index 618da5593d..0000000000 --- a/inquirer/index.d.ts +++ /dev/null @@ -1,296 +0,0 @@ -// Type definitions for Inquirer.js -// Project: https://github.com/SBoudrias/Inquirer.js -// Definitions by: Qubo -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -import through = require('through'); - -declare namespace inquirer { - type Prompts = { [name: string]: PromptModule }; - type ChoiceType = string | objects.ChoiceOption | objects.Separator; - type Questions = Question | Question[] | Rx.Observable; - - interface Inquirer { - restoreDefaultPrompts(): void; - /** - * Expose helper functions on the top level for easiest usage by common users - * @param name - * @param prompt - */ - registerPrompt(name: string, prompt: PromptModule): void; - /** - * Create a new self-contained prompt module. - */ - createPromptModule(): PromptModule; - /** - * Public CLI helper interface - * @param questions Questions settings array - * @param cb Callback being passed the user answers - * @return - */ - prompt(questions: Questions, cb: (answers: Answers) => any): ui.Prompt; - prompt(questions: Questions): Promise; - prompts: Prompts; - Separator: objects.SeparatorStatic; - ui: { - BottomBar: ui.BottomBar; - Prompt: ui.Prompt; - } - } - - interface PromptModule { - (questions: Questions, cb: (answers: Answers) => any): ui.Prompt; - /** - * Register a prompt type - * @param name Prompt type name - * @param prompt Prompt constructor - */ - registerPrompt(name: string, prompt: PromptModule): ui.Prompt; - /** - * Register the defaults provider prompts - */ - restoreDefaultPrompts(): void; - } - - interface Question { - /** - * Type of the prompt. - * Possible values: - *
          - *
        • input
        • - *
        • confirm
        • - *
        • list
        • - *
        • rawlist
        • - *
        • password
        • - *
        - * @defaults: 'input' - */ - type?: string; - /** - * The name to use when storing the answer in the anwers hash. - */ - name?: string; - /** - * The question to print. If defined as a function, - * the first parameter will be the current inquirer session answers. - */ - message?: string | ((answers: Answers) => string); - /** - * Default value(s) to use if nothing is entered, or a function that returns the default value(s). - * If defined as a function, the first parameter will be the current inquirer session answers. - */ - default?: any | ((answers: Answers) => any); - /** - * Choices array or a function returning a choices array. If defined as a function, - * the first parameter will be the current inquirer session answers. - * Array values can be simple strings, or objects containing a name (to display) and a value properties - * (to save in the answers hash). Values can also be a Separator. - */ - choices?: ChoiceType[] | ((answers: Answers) => ChoiceType[]); - /** - * Receive the user input and should return true if the value is valid, and an error message (String) - * otherwise. If false is returned, a default error message is provided. - */ - validate?(input: string): boolean | string; - /** - * Receive the user input and return the filtered value to be used inside the program. - * The value returned will be added to the Answers hash. - */ - filter?(input: string): string; - /** - * Receive the current user answers hash and should return true or false depending on whether or - * not this question should be asked. The value can also be a simple boolean. - */ - when?: boolean | ((answers: Answers) => boolean); - paginated?: boolean; - } - - /** - * A key/value hash containing the client answers in each prompt. - */ - interface Answers { - [key: string]: any; - } - - namespace ui { - /** - * Base interface class other can inherits from - */ - interface Prompt extends BaseUI { - new (promptModule: Prompts): Prompt; - /** - * Once all prompt are over - */ - onCompletion(): void; - processQuestion(question: Question): any; - fetchAnswer(question: Question): any; - setDefaultType(question: Question): any; - filterIfRunnable(question: Question): any; - } - - /** - * Sticky bottom bar user interface - */ - interface BottomBar extends BaseUI { - new (opt?: BottomBarOption): BottomBar; - /** - * Render the prompt to screen - * @return self - */ - render(): BottomBar; - /** - * Update the bottom bar content and rerender - * @param bottomBar Bottom bar content - * @return self - */ - updateBottomBar(bottomBar: string): BottomBar; - /** - * Rerender the prompt - * @return self - */ - writeLog(data: any): BottomBar; - /** - * Make sure line end on a line feed - * @param str Input string - * @return The input string with a final line feed - */ - enforceLF(str: string): string; - /** - * Helper for writing message in Prompt - * @param message The message to be output - */ - write(message: string): void; - log: through.ThroughStream; - } - - interface BottomBarOption { - bottomBar?: string; - } - /** - * Base interface class other can inherits from - */ - interface BaseUI { - new (opt: TOpt): void; - /** - * Handle the ^C exit - * @return {null} - */ - onForceClose(): void; - /** - * Close the interface and cleanup listeners - */ - close(): void; - /** - * Handle and propagate keypress events - */ - onKeypress(s: string, key: Key): void; - } - - interface Key { - sequence: string; - name: string; - meta: boolean; - shift: boolean; - ctrl: boolean; - } - } - - namespace objects { - /** - * Choice object - * Normalize input as choice object - * @constructor - * @param {String|Object} val Choice value. If an object is passed, it should contains - * at least one of `value` or `name` property - */ - interface Choice { - new (str: string): Choice; - new (separator: Separator): Choice; - new (option: ChoiceOption): Choice; - } - - interface ChoiceOption { - name?: string; - value?: string; - type?: string; - extra?: any; - key?: string; - checked?: boolean; - disabled?: string | ((answers: Answers) => any); - } - - /** - * Choices collection - * Collection of multiple `choice` object - * @constructor - * @param choices All `choice` to keep in the collection - */ - interface Choices { - new (choices: (string | Separator | ChoiceOption)[], answers?: Answers): Choices; - choices: Choice[]; - realChoices: Choice[]; - length: number; - realLength: number; - /** - * Get a valid choice from the collection - * @param selector The selected choice index - * @return Return the matched choice or undefined - */ - getChoice(selector: number): Choice; - /** - * Get a raw element from the collection - * @param selector The selected index value - * @return Return the matched choice or undefined - */ - get(selector: number): Choice; - /** - * Match the valid choices against a where clause - * @param whereClause Lodash `where` clause - * @return Matching choices or empty array - */ - where(whereClause: U): Choice[]; - /** - * Pluck a particular key from the choices - * @param propertyName Property name to select - * @return Selected properties - */ - pluck(propertyName: string): any[]; - forEach(application: (choice: Choice) => T): T[]; - } - - interface SeparatorStatic { - /** - * @param line Separation line content (facultative) - */ - new (line?: string): Separator; - /** - * Helper function returning false if object is a separator - * @param obj object to test against - * @return `false` if object is a separator - */ - exclude(obj: any): boolean; - } - - /** - * Separator object - * Used to space/separate choices group - * @constructor - * @param {String} line Separation line content (facultative) - */ - interface Separator { - type: string; - line: string; - /** - * Stringify separator - * @return {String} the separator display string - */ - toString(): string; - } - } -} - -declare var inquirer: inquirer.Inquirer; - -export = inquirer; diff --git a/intl-messageformat/intl-messageformat-tests.ts b/intl-messageformat/intl-messageformat-tests.ts deleted file mode 100644 index e758210bbf..0000000000 --- a/intl-messageformat/intl-messageformat-tests.ts +++ /dev/null @@ -1,45 +0,0 @@ -import IntlMessageFormat = require("intl-messageformat"); - - -var msg = new IntlMessageFormat("message", "en-us"); - - -var output = msg.format({name: "Eric"}); -console.log(output); // => "My name is Eric." - -var MESSAGES = { - 'en-US': { - NUM_PHOTOS: 'You have {numPhotos, plural, ' + - '=0 {no photos.}' + - '=1 {one photo.}' + - 'other {# photos.}}' - }, - - 'es-MX': { - NUM_PHOTOS: 'Usted {numPhotos, plural, ' + - '=0 {no tiene fotos.}' + - '=1 {tiene una foto.}' + - 'other {tiene # fotos.}}' - } -}; - -var enNumPhotos = new IntlMessageFormat(MESSAGES['en-US'].NUM_PHOTOS, 'en-US'); -output = enNumPhotos.format({numPhotos: 1000}); -console.log(output); // => "You have 1,000 photos." - -var esNumPhotos = new IntlMessageFormat(MESSAGES['es-MX'].NUM_PHOTOS, 'es-MX'); -output = esNumPhotos.format({numPhotos: 1000}); -console.log(output); // => "Usted tiene 1,000 fotos." - - -var msg = new IntlMessageFormat('The price is: {price, number, USD}', 'en-US', { - number: { - USD: { - style : 'currency', - currency: 'USD' - } - } -}); - -var output = msg.format({price: 100}); -console.log(output); // => "The price is: $100.00" \ No newline at end of file diff --git a/intl-messageformat/tslint.json b/intl-messageformat/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/intl-messageformat/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/ioredis/index.d.ts b/ioredis/index.d.ts deleted file mode 100644 index 16b33400c3..0000000000 --- a/ioredis/index.d.ts +++ /dev/null @@ -1,723 +0,0 @@ -// Type definitions for ioredis -// Project: https://github.com/luin/ioredis -// Definitions by: York Yao -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/* =================== USAGE =================== - import * as Redis from "ioredis"; - var redis = new Redis(); - =============================================== */ - -/// - -interface RedisStatic { - new (port?: number, host?: string, options?: IORedis.RedisOptions): IORedis.Redis; - new (host?: string, options?: IORedis.RedisOptions): IORedis.Redis; - new (options: IORedis.RedisOptions): IORedis.Redis; - new (url: string): IORedis.Redis; - (port?: number, host?: string, options?: IORedis.RedisOptions): IORedis.Redis; - (host?: string, options?: IORedis.RedisOptions): IORedis.Redis; - (options: IORedis.RedisOptions): IORedis.Redis; - (url: string): IORedis.Redis; - Cluster: IORedis.Cluster; -} - -declare var IORedis: RedisStatic; -export = IORedis; - -declare module IORedis { - interface Commander { - new (): Commander; - getBuiltinCommands(): string[]; - createBuiltinCommand(commandName: string): {}; - defineCommand(name: string, definition: { - numberOfKeys?: number; - lua?: string; - }): any; - sendCommand(): void; - } - - interface Redis extends NodeJS.EventEmitter, Commander { - status: string; - connect(callback?: Function): Promise; - disconnect(): void; - duplicate(): Redis; - monitor(calback: (error: Error, monitor: NodeJS.EventEmitter) => void): Promise; - - send_command(command: string, ...args: any[]): any; - auth(password: string, callback?: ResCallbackT): any; - ping(callback?: ResCallbackT): any; - append(key: string, value: string, callback?: ResCallbackT): any; - bitcount(key: string, callback?: ResCallbackT): any; - bitcount(key: string, start: number, end: number, callback?: ResCallbackT): any; - set(key: string, value: string, callback?: ResCallbackT): any; - get(key: string, callback?: ResCallbackT): any; - exists(key: string, value: string, callback?: ResCallbackT): any; - publish(channel: string, value: any): any; - subscribe(channel: string): any; - get(args: any[], callback?: ResCallbackT): any; - get(...args: any[]): any; - getBuffer(key: string, callback?: ResCallbackT): any; - set(args: any[], callback?: ResCallbackT): any; - set(...args: any[]): any; - setnx(args: any[], callback?: ResCallbackT): any; - setnx(...args: any[]): any; - setex(args: any[], callback?: ResCallbackT): any; - setex(...args: any[]): any; - append(args: any[], callback?: ResCallbackT): any; - append(...args: any[]): any; - strlen(args: any[], callback?: ResCallbackT): any; - strlen(...args: any[]): any; - del(args: any[], callback?: ResCallbackT): any; - del(...args: any[]): any; - exists(args: any[], callback?: ResCallbackT): any; - exists(...args: any[]): any; - setbit(args: any[], callback?: ResCallbackT): any; - setbit(...args: any[]): any; - getbit(args: any[], callback?: ResCallbackT): any; - getbit(...args: any[]): any; - setrange(args: any[], callback?: ResCallbackT): any; - setrange(...args: any[]): any; - getrange(args: any[], callback?: ResCallbackT): any; - getrange(...args: any[]): any; - substr(args: any[], callback?: ResCallbackT): any; - substr(...args: any[]): any; - incr(args: any[], callback?: ResCallbackT): any; - incr(...args: any[]): any; - decr(args: any[], callback?: ResCallbackT): any; - decr(...args: any[]): any; - mget(args: any[], callback?: ResCallbackT): any; - mget(...args: any[]): any; - rpush(...args: any[]): any; - lpush(args: any[], callback?: ResCallbackT): any; - lpush(...args: any[]): any; - rpushx(args: any[], callback?: ResCallbackT): any; - rpushx(...args: any[]): any; - lpushx(args: any[], callback?: ResCallbackT): any; - lpushx(...args: any[]): any; - linsert(args: any[], callback?: ResCallbackT): any; - linsert(...args: any[]): any; - rpop(args: any[], callback?: ResCallbackT): any; - rpop(...args: any[]): any; - lpop(args: any[], callback?: ResCallbackT): any; - lpop(...args: any[]): any; - brpop(args: any[], callback?: ResCallbackT): any; - brpop(...args: any[]): any; - brpoplpush(args: any[], callback?: ResCallbackT): any; - brpoplpush(...args: any[]): any; - blpop(args: any[], callback?: ResCallbackT): any; - blpop(...args: any[]): any; - llen(args: any[], callback?: ResCallbackT): any; - llen(...args: any[]): any; - lindex(args: any[], callback?: ResCallbackT): any; - lindex(...args: any[]): any; - lset(args: any[], callback?: ResCallbackT): any; - lset(...args: any[]): any; - lrange(args: any[], callback?: ResCallbackT): any; - lrange(...args: any[]): any; - ltrim(args: any[], callback?: ResCallbackT): any; - ltrim(...args: any[]): any; - lrem(args: any[], callback?: ResCallbackT): any; - lrem(...args: any[]): any; - rpoplpush(args: any[], callback?: ResCallbackT): any; - rpoplpush(...args: any[]): any; - sadd(args: any[], callback?: ResCallbackT): any; - sadd(...args: any[]): any; - srem(args: any[], callback?: ResCallbackT): any; - srem(...args: any[]): any; - smove(args: any[], callback?: ResCallbackT): any; - smove(...args: any[]): any; - sismember(args: any[], callback?: ResCallbackT): any; - sismember(...args: any[]): any; - scard(args: any[], callback?: ResCallbackT): any; - scard(...args: any[]): any; - spop(args: any[], callback?: ResCallbackT): any; - spop(...args: any[]): any; - srandmember(args: any[], callback?: ResCallbackT): any; - srandmember(...args: any[]): any; - sinter(args: any[], callback?: ResCallbackT): any; - sinter(...args: any[]): any; - sinterstore(args: any[], callback?: ResCallbackT): any; - sinterstore(...args: any[]): any; - sunion(args: any[], callback?: ResCallbackT): any; - sunion(...args: any[]): any; - sunionstore(args: any[], callback?: ResCallbackT): any; - sunionstore(...args: any[]): any; - sdiff(args: any[], callback?: ResCallbackT): any; - sdiff(...args: any[]): any; - sdiffstore(args: any[], callback?: ResCallbackT): any; - sdiffstore(...args: any[]): any; - smembers(args: any[], callback?: ResCallbackT): any; - smembers(...args: any[]): any; - zadd(args: any[], callback?: ResCallbackT): any; - zadd(...args: any[]): any; - zincrby(args: any[], callback?: ResCallbackT): any; - zincrby(...args: any[]): any; - zrem(args: any[], callback?: ResCallbackT): any; - zrem(...args: any[]): any; - zremrangebyscore(args: any[], callback?: ResCallbackT): any; - zremrangebyscore(...args: any[]): any; - zremrangebyrank(args: any[], callback?: ResCallbackT): any; - zremrangebyrank(...args: any[]): any; - zunionstore(args: any[], callback?: ResCallbackT): any; - zunionstore(...args: any[]): any; - zinterstore(args: any[], callback?: ResCallbackT): any; - zinterstore(...args: any[]): any; - zrange(args: any[], callback?: ResCallbackT): any; - zrange(...args: any[]): any; - zrangebyscore(args: any[], callback?: ResCallbackT): any; - zrangebyscore(...args: any[]): any; - zrevrangebyscore(args: any[], callback?: ResCallbackT): any; - zrevrangebyscore(...args: any[]): any; - zcount(args: any[], callback?: ResCallbackT): any; - zcount(...args: any[]): any; - zrevrange(args: any[], callback?: ResCallbackT): any; - zrevrange(...args: any[]): any; - zcard(args: any[], callback?: ResCallbackT): any; - zcard(...args: any[]): any; - zscore(args: any[], callback?: ResCallbackT): any; - zscore(...args: any[]): any; - zrank(args: any[], callback?: ResCallbackT): any; - zrank(...args: any[]): any; - zrevrank(args: any[], callback?: ResCallbackT): any; - zrevrank(...args: any[]): any; - hset(args: any[], callback?: ResCallbackT): any; - hset(...args: any[]): any; - hsetnx(args: any[], callback?: ResCallbackT): any; - hsetnx(...args: any[]): any; - hget(args: any[], callback?: ResCallbackT): any; - hget(...args: any[]): any; - hmset(args: any[], callback?: ResCallbackT): any; - hmset(key: string, hash: any, callback?: ResCallbackT): any; - hmset(...args: any[]): any; - hmget(args: any[], callback?: ResCallbackT): any; - hmget(...args: any[]): any; - hincrby(args: any[], callback?: ResCallbackT): any; - hincrby(...args: any[]): any; - hincrbyfloat(args: any[], callback?: ResCallbackT): any; - hincrbyfloat(...args: any[]): any; - hdel(args: any[], callback?: ResCallbackT): any; - hdel(...args: any[]): any; - hlen(args: any[], callback?: ResCallbackT): any; - hlen(...args: any[]): any; - hkeys(args: any[], callback?: ResCallbackT): any; - hkeys(...args: any[]): any; - hvals(args: any[], callback?: ResCallbackT): any; - hvals(...args: any[]): any; - hgetall(args: any[], callback?: ResCallbackT): any; - hgetall(...args: any[]): any; - hgetall(key: string, callback?: ResCallbackT): any; - hexists(args: any[], callback?: ResCallbackT): any; - hexists(...args: any[]): any; - incrby(args: any[], callback?: ResCallbackT): any; - incrby(...args: any[]): any; - incrbyfloat(args: any[], callback?: ResCallbackT): any; - incrbyfloat(...args: any[]): any; - decrby(args: any[], callback?: ResCallbackT): any; - decrby(...args: any[]): any; - getset(args: any[], callback?: ResCallbackT): any; - getset(...args: any[]): any; - mset(args: any[], callback?: ResCallbackT): any; - mset(...args: any[]): any; - msetnx(args: any[], callback?: ResCallbackT): any; - msetnx(...args: any[]): any; - randomkey(args: any[], callback?: ResCallbackT): any; - randomkey(...args: any[]): any; - select(args: any[], callback?: ResCallbackT): void; - select(...args: any[]): void; - move(args: any[], callback?: ResCallbackT): any; - move(...args: any[]): any; - rename(args: any[], callback?: ResCallbackT): any; - rename(...args: any[]): any; - renamenx(args: any[], callback?: ResCallbackT): any; - renamenx(...args: any[]): any; - expire(args: any[], callback?: ResCallbackT): any; - expire(...args: any[]): any; - pexpire(args: any[], callback?: ResCallbackT): any; - pexpire(...args: any[]): any; - expireat(args: any[], callback?: ResCallbackT): any; - expireat(...args: any[]): any; - pexpireat(args: any[], callback?: ResCallbackT): any; - pexpireat(...args: any[]): any; - keys(args: any[], callback?: ResCallbackT): any; - keys(...args: any[]): any; - dbsize(args: any[], callback?: ResCallbackT): any; - dbsize(...args: any[]): any; - auth(args: any[], callback?: ResCallbackT): void; - auth(...args: any[]): void; - ping(args: any[], callback?: ResCallbackT): any; - ping(...args: any[]): any; - echo(args: any[], callback?: ResCallbackT): any; - echo(...args: any[]): any; - save(args: any[], callback?: ResCallbackT): any; - save(...args: any[]): any; - bgsave(args: any[], callback?: ResCallbackT): any; - bgsave(...args: any[]): any; - bgrewriteaof(args: any[], callback?: ResCallbackT): any; - bgrewriteaof(...args: any[]): any; - shutdown(args: any[], callback?: ResCallbackT): any; - shutdown(...args: any[]): any; - lastsave(args: any[], callback?: ResCallbackT): any; - lastsave(...args: any[]): any; - type(args: any[], callback?: ResCallbackT): any; - type(...args: any[]): any; - multi(args: any[], callback?: ResCallbackT): Pipeline; - multi(...args: any[]): Pipeline; - exec(args: any[], callback?: ResCallbackT): any; - exec(...args: any[]): any; - discard(args: any[], callback?: ResCallbackT): any; - discard(...args: any[]): any; - sync(args: any[], callback?: ResCallbackT): any; - sync(...args: any[]): any; - flushdb(args: any[], callback?: ResCallbackT): any; - flushdb(...args: any[]): any; - flushall(args: any[], callback?: ResCallbackT): any; - flushall(...args: any[]): any; - sort(args: any[], callback?: ResCallbackT): any; - sort(...args: any[]): any; - info(args: any[], callback?: ResCallbackT): any; - info(...args: any[]): any; - time(args: any[], callback?: ResCallbackT): any; - time(...args: any[]): any; - monitor(args: any[], callback?: ResCallbackT): any; - monitor(...args: any[]): any; - ttl(args: any[], callback?: ResCallbackT): any; - ttl(...args: any[]): any; - persist(args: any[], callback?: ResCallbackT): any; - persist(...args: any[]): any; - slaveof(args: any[], callback?: ResCallbackT): any; - slaveof(...args: any[]): any; - debug(args: any[], callback?: ResCallbackT): any; - debug(...args: any[]): any; - config(args: any[], callback?: ResCallbackT): any; - config(...args: any[]): any; - subscribe(args: any[], callback?: ResCallbackT): any; - subscribe(...args: any[]): any; - unsubscribe(args: any[], callback?: ResCallbackT): any; - unsubscribe(...args: any[]): any; - psubscribe(args: any[], callback?: ResCallbackT): any; - psubscribe(...args: any[]): any; - punsubscribe(args: any[], callback?: ResCallbackT): any; - punsubscribe(...args: any[]): any; - publish(args: any[], callback?: ResCallbackT): any; - publish(...args: any[]): any; - watch(args: any[], callback?: ResCallbackT): any; - watch(...args: any[]): any; - unwatch(args: any[], callback?: ResCallbackT): any; - unwatch(...args: any[]): any; - cluster(args: any[], callback?: ResCallbackT): any; - cluster(...args: any[]): any; - restore(args: any[], callback?: ResCallbackT): any; - restore(...args: any[]): any; - migrate(args: any[], callback?: ResCallbackT): any; - migrate(...args: any[]): any; - dump(args: any[], callback?: ResCallbackT): any; - dump(...args: any[]): any; - object(args: any[], callback?: ResCallbackT): any; - object(...args: any[]): any; - client(args: any[], callback?: ResCallbackT): any; - client(...args: any[]): any; - eval(args: any[], callback?: ResCallbackT): any; - eval(...args: any[]): any; - evalsha(args: any[], callback?: ResCallbackT): any; - evalsha(...args: any[]): any; - script(args: any[], callback?: ResCallbackT): any; - script(...args: any[]): any; - script(key: string, callback?: ResCallbackT): any; - quit(args: any[], callback?: ResCallbackT): any; - quit(...args: any[]): any; - scan(...args: any[]): any; - scan(args: any[], callback?: ResCallbackT): any; - hscan(...args: any[]): any; - hscan(args: any[], callback?: ResCallbackT): any; - zscan(...args: any[]): any; - zscan(args: any[], callback?: ResCallbackT): any; - - pipeline(): Pipeline; - pipeline(commands: string[][]): Pipeline; - - scanStream(options?: IORedis.ScanStreamOption): NodeJS.EventEmitter; - hscanStream(key: string, options?: IORedis.ScanStreamOption): NodeJS.EventEmitter; - zscanStream(key: string, options?: IORedis.ScanStreamOption): NodeJS.EventEmitter; - } - - interface Pipeline { - exec(callback?: ResCallbackT): any; - - get(args: any[], callback?: ResCallbackT): Pipeline; - get(...args: any[]): Pipeline; - set(args: any[], callback?: ResCallbackT): Pipeline; - set(...args: any[]): Pipeline; - setnx(args: any[], callback?: ResCallbackT): Pipeline; - setnx(...args: any[]): Pipeline; - setex(args: any[], callback?: ResCallbackT): Pipeline; - setex(...args: any[]): Pipeline; - append(args: any[], callback?: ResCallbackT): Pipeline; - append(...args: any[]): Pipeline; - strlen(args: any[], callback?: ResCallbackT): Pipeline; - strlen(...args: any[]): Pipeline; - del(args: any[], callback?: ResCallbackT): Pipeline; - del(...args: any[]): Pipeline; - exists(args: any[], callback?: ResCallbackT): Pipeline; - exists(...args: any[]): Pipeline; - setbit(args: any[], callback?: ResCallbackT): Pipeline; - setbit(...args: any[]): Pipeline; - getbit(args: any[], callback?: ResCallbackT): Pipeline; - getbit(...args: any[]): Pipeline; - setrange(args: any[], callback?: ResCallbackT): Pipeline; - setrange(...args: any[]): Pipeline; - getrange(args: any[], callback?: ResCallbackT): Pipeline; - getrange(...args: any[]): Pipeline; - substr(args: any[], callback?: ResCallbackT): Pipeline; - substr(...args: any[]): Pipeline; - incr(args: any[], callback?: ResCallbackT): Pipeline; - incr(...args: any[]): Pipeline; - decr(args: any[], callback?: ResCallbackT): Pipeline; - decr(...args: any[]): Pipeline; - mget(args: any[], callback?: ResCallbackT): Pipeline; - mget(...args: any[]): Pipeline; - rpush(...args: any[]): Pipeline; - lpush(args: any[], callback?: ResCallbackT): Pipeline; - lpush(...args: any[]): Pipeline; - rpushx(args: any[], callback?: ResCallbackT): Pipeline; - rpushx(...args: any[]): Pipeline; - lpushx(args: any[], callback?: ResCallbackT): Pipeline; - lpushx(...args: any[]): Pipeline; - linsert(args: any[], callback?: ResCallbackT): Pipeline; - linsert(...args: any[]): Pipeline; - rpop(args: any[], callback?: ResCallbackT): Pipeline; - rpop(...args: any[]): Pipeline; - lpop(args: any[], callback?: ResCallbackT): Pipeline; - lpop(...args: any[]): Pipeline; - brpop(args: any[], callback?: ResCallbackT): Pipeline; - brpop(...args: any[]): Pipeline; - brpoplpush(args: any[], callback?: ResCallbackT): Pipeline; - brpoplpush(...args: any[]): Pipeline; - blpop(args: any[], callback?: ResCallbackT): Pipeline; - blpop(...args: any[]): Pipeline; - llen(args: any[], callback?: ResCallbackT): Pipeline; - llen(...args: any[]): Pipeline; - lindex(args: any[], callback?: ResCallbackT): Pipeline; - lindex(...args: any[]): Pipeline; - lset(args: any[], callback?: ResCallbackT): Pipeline; - lset(...args: any[]): Pipeline; - lrange(args: any[], callback?: ResCallbackT): Pipeline; - lrange(...args: any[]): Pipeline; - ltrim(args: any[], callback?: ResCallbackT): Pipeline; - ltrim(...args: any[]): Pipeline; - lrem(args: any[], callback?: ResCallbackT): Pipeline; - lrem(...args: any[]): Pipeline; - rpoplpush(args: any[], callback?: ResCallbackT): Pipeline; - rpoplpush(...args: any[]): Pipeline; - sadd(args: any[], callback?: ResCallbackT): Pipeline; - sadd(...args: any[]): Pipeline; - srem(args: any[], callback?: ResCallbackT): Pipeline; - srem(...args: any[]): Pipeline; - smove(args: any[], callback?: ResCallbackT): Pipeline; - smove(...args: any[]): Pipeline; - sismember(args: any[], callback?: ResCallbackT): Pipeline; - sismember(...args: any[]): Pipeline; - scard(args: any[], callback?: ResCallbackT): Pipeline; - scard(...args: any[]): Pipeline; - spop(args: any[], callback?: ResCallbackT): Pipeline; - spop(...args: any[]): Pipeline; - srandmember(args: any[], callback?: ResCallbackT): Pipeline; - srandmember(...args: any[]): Pipeline; - sinter(args: any[], callback?: ResCallbackT): Pipeline; - sinter(...args: any[]): Pipeline; - sinterstore(args: any[], callback?: ResCallbackT): Pipeline; - sinterstore(...args: any[]): Pipeline; - sunion(args: any[], callback?: ResCallbackT): Pipeline; - sunion(...args: any[]): Pipeline; - sunionstore(args: any[], callback?: ResCallbackT): Pipeline; - sunionstore(...args: any[]): Pipeline; - sdiff(args: any[], callback?: ResCallbackT): Pipeline; - sdiff(...args: any[]): Pipeline; - sdiffstore(args: any[], callback?: ResCallbackT): Pipeline; - sdiffstore(...args: any[]): Pipeline; - smembers(args: any[], callback?: ResCallbackT): Pipeline; - smembers(...args: any[]): Pipeline; - zadd(args: any[], callback?: ResCallbackT): Pipeline; - zadd(...args: any[]): Pipeline; - zincrby(args: any[], callback?: ResCallbackT): Pipeline; - zincrby(...args: any[]): Pipeline; - zrem(args: any[], callback?: ResCallbackT): Pipeline; - zrem(...args: any[]): Pipeline; - zremrangebyscore(args: any[], callback?: ResCallbackT): Pipeline; - zremrangebyscore(...args: any[]): Pipeline; - zremrangebyrank(args: any[], callback?: ResCallbackT): Pipeline; - zremrangebyrank(...args: any[]): Pipeline; - zunionstore(args: any[], callback?: ResCallbackT): Pipeline; - zunionstore(...args: any[]): Pipeline; - zinterstore(args: any[], callback?: ResCallbackT): Pipeline; - zinterstore(...args: any[]): Pipeline; - zrange(args: any[], callback?: ResCallbackT): Pipeline; - zrange(...args: any[]): Pipeline; - zrangebyscore(args: any[], callback?: ResCallbackT): Pipeline; - zrangebyscore(...args: any[]): Pipeline; - zrevrangebyscore(args: any[], callback?: ResCallbackT): Pipeline; - zrevrangebyscore(...args: any[]): Pipeline; - zcount(args: any[], callback?: ResCallbackT): Pipeline; - zcount(...args: any[]): Pipeline; - zrevrange(args: any[], callback?: ResCallbackT): Pipeline; - zrevrange(...args: any[]): Pipeline; - zcard(args: any[], callback?: ResCallbackT): Pipeline; - zcard(...args: any[]): Pipeline; - zscore(args: any[], callback?: ResCallbackT): Pipeline; - zscore(...args: any[]): Pipeline; - zrank(args: any[], callback?: ResCallbackT): Pipeline; - zrank(...args: any[]): Pipeline; - zrevrank(args: any[], callback?: ResCallbackT): Pipeline; - zrevrank(...args: any[]): Pipeline; - hset(args: any[], callback?: ResCallbackT): Pipeline; - hset(...args: any[]): Pipeline; - hsetnx(args: any[], callback?: ResCallbackT): Pipeline; - hsetnx(...args: any[]): Pipeline; - hget(args: any[], callback?: ResCallbackT): Pipeline; - hget(...args: any[]): Pipeline; - hmset(args: any[], callback?: ResCallbackT): Pipeline; - hmset(key: string, hash: any, callback?: ResCallbackT): Pipeline; - hmset(...args: any[]): Pipeline; - hmget(args: any[], callback?: ResCallbackT): Pipeline; - hmget(...args: any[]): Pipeline; - hincrby(args: any[], callback?: ResCallbackT): Pipeline; - hincrby(...args: any[]): Pipeline; - hincrbyfloat(args: any[], callback?: ResCallbackT): Pipeline; - hincrbyfloat(...args: any[]): Pipeline; - hdel(args: any[], callback?: ResCallbackT): Pipeline; - hdel(...args: any[]): Pipeline; - hlen(args: any[], callback?: ResCallbackT): Pipeline; - hlen(...args: any[]): Pipeline; - hkeys(args: any[], callback?: ResCallbackT): Pipeline; - hkeys(...args: any[]): Pipeline; - hvals(args: any[], callback?: ResCallbackT): Pipeline; - hvals(...args: any[]): Pipeline; - hgetall(args: any[], callback?: ResCallbackT): Pipeline; - hgetall(...args: any[]): Pipeline; - hgetall(key: string, callback?: ResCallbackT): Pipeline; - hexists(args: any[], callback?: ResCallbackT): Pipeline; - hexists(...args: any[]): Pipeline; - incrby(args: any[], callback?: ResCallbackT): Pipeline; - incrby(...args: any[]): Pipeline; - incrbyfloat(args: any[], callback?: ResCallbackT): Pipeline; - incrbyfloat(...args: any[]): Pipeline; - decrby(args: any[], callback?: ResCallbackT): Pipeline; - decrby(...args: any[]): Pipeline; - getset(args: any[], callback?: ResCallbackT): Pipeline; - getset(...args: any[]): Pipeline; - mset(args: any[], callback?: ResCallbackT): Pipeline; - mset(...args: any[]): Pipeline; - msetnx(args: any[], callback?: ResCallbackT): Pipeline; - msetnx(...args: any[]): Pipeline; - randomkey(args: any[], callback?: ResCallbackT): Pipeline; - randomkey(...args: any[]): Pipeline; - select(args: any[], callback?: ResCallbackT): void; - select(...args: any[]): Pipeline; - move(args: any[], callback?: ResCallbackT): Pipeline; - move(...args: any[]): Pipeline; - rename(args: any[], callback?: ResCallbackT): Pipeline; - rename(...args: any[]): Pipeline; - renamenx(args: any[], callback?: ResCallbackT): Pipeline; - renamenx(...args: any[]): Pipeline; - expire(args: any[], callback?: ResCallbackT): Pipeline; - expire(...args: any[]): Pipeline; - pexpire(args: any[], callback?: ResCallbackT): Pipeline; - pexpire(...args: any[]): Pipeline; - expireat(args: any[], callback?: ResCallbackT): Pipeline; - expireat(...args: any[]): Pipeline; - pexpireat(args: any[], callback?: ResCallbackT): Pipeline; - pexpireat(...args: any[]): Pipeline; - keys(args: any[], callback?: ResCallbackT): Pipeline; - keys(...args: any[]): Pipeline; - dbsize(args: any[], callback?: ResCallbackT): Pipeline; - dbsize(...args: any[]): Pipeline; - auth(args: any[], callback?: ResCallbackT): void; - auth(...args: any[]): void; - ping(args: any[], callback?: ResCallbackT): Pipeline; - ping(...args: any[]): Pipeline; - echo(args: any[], callback?: ResCallbackT): Pipeline; - echo(...args: any[]): Pipeline; - save(args: any[], callback?: ResCallbackT): Pipeline; - save(...args: any[]): Pipeline; - bgsave(args: any[], callback?: ResCallbackT): Pipeline; - bgsave(...args: any[]): Pipeline; - bgrewriteaof(args: any[], callback?: ResCallbackT): Pipeline; - bgrewriteaof(...args: any[]): Pipeline; - shutdown(args: any[], callback?: ResCallbackT): Pipeline; - shutdown(...args: any[]): Pipeline; - lastsave(args: any[], callback?: ResCallbackT): Pipeline; - lastsave(...args: any[]): Pipeline; - type(args: any[], callback?: ResCallbackT): Pipeline; - type(...args: any[]): Pipeline; - multi(args: any[], callback?: ResCallbackT): Pipeline; - multi(...args: any[]): Pipeline; - exec(args: any[], callback?: ResCallbackT): Pipeline; - exec(...args: any[]): Pipeline; - discard(args: any[], callback?: ResCallbackT): Pipeline; - discard(...args: any[]): Pipeline; - sync(args: any[], callback?: ResCallbackT): Pipeline; - sync(...args: any[]): Pipeline; - flushdb(args: any[], callback?: ResCallbackT): Pipeline; - flushdb(...args: any[]): Pipeline; - flushall(args: any[], callback?: ResCallbackT): Pipeline; - flushall(...args: any[]): Pipeline; - sort(args: any[], callback?: ResCallbackT): Pipeline; - sort(...args: any[]): Pipeline; - info(args: any[], callback?: ResCallbackT): Pipeline; - info(...args: any[]): Pipeline; - time(args: any[], callback?: ResCallbackT): Pipeline; - time(...args: any[]): Pipeline; - monitor(args: any[], callback?: ResCallbackT): Pipeline; - monitor(...args: any[]): Pipeline; - ttl(args: any[], callback?: ResCallbackT): Pipeline; - ttl(...args: any[]): Pipeline; - persist(args: any[], callback?: ResCallbackT): Pipeline; - persist(...args: any[]): Pipeline; - slaveof(args: any[], callback?: ResCallbackT): Pipeline; - slaveof(...args: any[]): Pipeline; - debug(args: any[], callback?: ResCallbackT): Pipeline; - debug(...args: any[]): Pipeline; - config(args: any[], callback?: ResCallbackT): Pipeline; - config(...args: any[]): Pipeline; - subscribe(args: any[], callback?: ResCallbackT): Pipeline; - subscribe(...args: any[]): Pipeline; - unsubscribe(args: any[], callback?: ResCallbackT): Pipeline; - unsubscribe(...args: any[]): Pipeline; - psubscribe(args: any[], callback?: ResCallbackT): Pipeline; - psubscribe(...args: any[]): Pipeline; - punsubscribe(args: any[], callback?: ResCallbackT): Pipeline; - punsubscribe(...args: any[]): Pipeline; - publish(args: any[], callback?: ResCallbackT): Pipeline; - publish(...args: any[]): Pipeline; - watch(args: any[], callback?: ResCallbackT): Pipeline; - watch(...args: any[]): Pipeline; - unwatch(args: any[], callback?: ResCallbackT): Pipeline; - unwatch(...args: any[]): Pipeline; - cluster(args: any[], callback?: ResCallbackT): Pipeline; - cluster(...args: any[]): Pipeline; - restore(args: any[], callback?: ResCallbackT): Pipeline; - restore(...args: any[]): Pipeline; - migrate(args: any[], callback?: ResCallbackT): Pipeline; - migrate(...args: any[]): Pipeline; - dump(args: any[], callback?: ResCallbackT): Pipeline; - dump(...args: any[]): Pipeline; - object(args: any[], callback?: ResCallbackT): Pipeline; - object(...args: any[]): Pipeline; - client(args: any[], callback?: ResCallbackT): Pipeline; - client(...args: any[]): Pipeline; - eval(args: any[], callback?: ResCallbackT): Pipeline; - eval(...args: any[]): Pipeline; - evalsha(args: any[], callback?: ResCallbackT): Pipeline; - evalsha(...args: any[]): Pipeline; - quit(args: any[], callback?: ResCallbackT): Pipeline; - quit(...args: any[]): Pipeline; - scan(...args: any[]): Pipeline; - scan(args: any[], callback?: ResCallbackT): Pipeline; - hscan(...args: any[]): Pipeline; - hscan(args: any[], callback?: ResCallbackT): Pipeline; - zscan(...args: any[]): Pipeline; - zscan(args: any[], callback?: ResCallbackT): Pipeline; - } - - interface Cluster extends NodeJS.EventEmitter, Commander { - new (nodes: { host: string; port: number; }[], options?: IORedis.ClusterOptions): Redis; - connect(callback: Function): Promise; - disconnect(): void; - nodes(role: string): Redis[]; - } - - interface ResCallbackT { - (err: Error, res: R): void; - } - - interface RedisOptions { - port?: number; - host?: string; - /** - * 4 (IPv4) or 6 (IPv6), Defaults to 4. - */ - family?: number; - /** - * Local domain socket path. If set the port, host and family will be ignored. - */ - path?: string; - /** - * TCP KeepAlive on the socket with a X ms delay before start. Set to a non-number value to disable keepAlive. - */ - keepAlive?: number; - connectionName?: string; - /** - * If set, client will send AUTH command with the value of this option when connected. - */ - password?: string; - /** - * Database index to use. - */ - db?: number; - /** - * When a connection is established to the Redis server, the server might still be loading - * the database from disk. While loading, the server not respond to any commands. - * To work around this, when this option is true, ioredis will check the status of the Redis server, - * and when the Redis server is able to process commands, a ready event will be emitted. - */ - enableReadyCheck?: boolean; - keyPrefix?: string; - retryStrategy?: (times: number) => number; - reconnectOnError?: (error: Error) => boolean; - /** - * By default, if there is no active connection to the Redis server, commands are added to a queue - * and are executed once the connection is "ready" (when enableReadyCheck is true, "ready" means - * the Redis server has loaded the database from disk, otherwise means the connection to the Redis - * server has been established). If this option is false, when execute the command when the connection - * isn't ready, an error will be returned. - */ - enableOfflineQueue?: boolean; - /** - * The milliseconds before a timeout occurs during the initial connection to the Redis server. - * default: 10000. - */ - connectTimeout?: number; - /** - * After reconnected, if the previous connection was in the subscriber mode, client will auto re-subscribe these channels. - * default: true. - */ - autoResubscribe?: boolean; - /** - * If true, client will resend unfulfilled commands(e.g. block commands) in the previous connection when reconnected. - * default: true. - */ - autoResendUnfulfilledCommands?: boolean; - lazyConnect?: boolean; - tls?: { - ca: Buffer; - }; - sentinels?: { host: string; port: number; }[]; - name?: string; - /** - * Enable READONLY mode for the connection. Only available for cluster mode. - * default: false. - */ - readOnly?: boolean; - /** - * If you are using the hiredis parser, it's highly recommended to enable this option. Create another instance with dropBufferSupport disabled for other commands that you want to return binary instead of string: - */ - dropBufferSupport?: boolean; - } - - interface ScanStreamOption { - match?: string; - count?: number; - } - - interface ClusterOptions { - clusterRetryStrategy?: (times: number) => number; - enableOfflineQueue?: boolean; - enableReadyCheck?: boolean; - scaleReads?: string; - maxRedirections?: number; - retryDelayOnFailover?: number; - retryDelayOnClusterDown?: number; - retryDelayOnTryAgain?: number; - redisOptions?: RedisOptions; - } -} diff --git a/ip-regex/tslint.json b/ip-regex/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/ip-regex/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/is-absolute-url/tslint.json b/is-absolute-url/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/is-absolute-url/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/is-archive/tslint.json b/is-archive/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/is-archive/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/is-array/tslint.json b/is-array/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/is-array/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/is-binary-path/is-binary-path-tests.ts b/is-binary-path/is-binary-path-tests.ts deleted file mode 100644 index 43505a5b32..0000000000 --- a/is-binary-path/is-binary-path-tests.ts +++ /dev/null @@ -1,5 +0,0 @@ -import isBinaryPath = require("is-binary-path"); - -const a: boolean = isBinaryPath("src/unicorn.png"); - -const b: boolean = isBinaryPath("src/unicorn.txt"); \ No newline at end of file diff --git a/is-binary-path/tslint.json b/is-binary-path/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/is-binary-path/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/is-compressed/tslint.json b/is-compressed/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/is-compressed/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/is-finite/tslint.json b/is-finite/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/is-finite/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/is-path-cwd/index.d.ts b/is-path-cwd/index.d.ts deleted file mode 100644 index c00b20dae8..0000000000 --- a/is-path-cwd/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -// Type definitions for is-path-cwd 1.0 -// Project: https://github.com/sindresorhus/is-path-cwd -// Definitions by: Daniel Rosenwasser -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare function isPathCwd(path: string): boolean; -export = isPathCwd; \ No newline at end of file diff --git a/is-path-cwd/is-path-cwd-tests.ts b/is-path-cwd/is-path-cwd-tests.ts deleted file mode 100644 index 80398a23cd..0000000000 --- a/is-path-cwd/is-path-cwd-tests.ts +++ /dev/null @@ -1,3 +0,0 @@ -import isPathCwd = require("is-path-cwd"); - -isPathCwd("unicorn"); \ No newline at end of file diff --git a/is-path-cwd/tslint.json b/is-path-cwd/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/is-path-cwd/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/is-path-in-cwd/tslint.json b/is-path-in-cwd/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/is-path-in-cwd/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/is-relative-url/tslint.json b/is-relative-url/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/is-relative-url/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/is-root-path/tslint.json b/is-root-path/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/is-root-path/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/is-root/tslint.json b/is-root/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/is-root/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/is-text-path/tslint.json b/is-text-path/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/is-text-path/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/is-windows/is-windows-tests.ts b/is-windows/is-windows-tests.ts deleted file mode 100644 index 79ada21511..0000000000 --- a/is-windows/is-windows-tests.ts +++ /dev/null @@ -1,3 +0,0 @@ -import * as isWindows from 'is-windows'; - -var bool: boolean = isWindows(); diff --git a/is-windows/tslint.json b/is-windows/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/is-windows/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/isbn-utils/index.d.ts b/isbn-utils/index.d.ts deleted file mode 100644 index fe2ac4dae9..0000000000 --- a/isbn-utils/index.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Type definitions for isbn-utils 1.1 -// Project: https://github.com/GitbookIO/isbn-utils -// Definitions by: Jørgen Elgaard Larsen -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - - -type IGroups = any; - -export class ISBNcodes { - readonly source: string; - readonly prefix: string; - readonly group: string; - readonly publisher: string; - readonly article: string; - readonly check: string; - readonly check10: string; - readonly check13: string; - readonly groupname: string; -} - -export class ISBN { - constructor(val: string, groups: IGroups); - asIsbn10(hyphenate?: boolean): string; - asIsbn13(hyphenate?: boolean): string; - codes: ISBNcodes; - isIsbn10(): boolean; - isIsbn13(): boolean; - isValid(): boolean; -} - -export function asIsbn10(isbn: string, hyphenate?: boolean): string; -export function asIsbn13(isbn: string, hyphenate?: boolean): string; -export function parse(isbn: string, groups?: IGroups): ISBN|null; -export function hyphenate(isbn: string): string; -export function isValid(isbn: string, groups?: IGroups): boolean; diff --git a/isbn-utils/tslint.json b/isbn-utils/tslint.json deleted file mode 100644 index f9e30021f4..0000000000 --- a/isbn-utils/tslint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../tslint.json" -} diff --git a/iscroll/index.d.ts b/iscroll/index.d.ts deleted file mode 100644 index cfe1824643..0000000000 --- a/iscroll/index.d.ts +++ /dev/null @@ -1,96 +0,0 @@ -// Type definitions for iScroll 5.0 -// Project: http://cubiq.org/iscroll-5-ready-for-beta-test -// Definitions by: Christiaan Rakowski -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -interface IScrollOptions { - x?: number; - y?: number; - bounce?: boolean; - bounceLock?: boolean; - momentum?: boolean; - lockDirection?: boolean; - useTransform?: boolean; - useTransition?: boolean; - topOffset?: number; - checkDOMChanges?: boolean; - handleClick?: boolean; - - // Scrollbar - hScrollbar?: boolean; - vScrollbar?: boolean; - fixedScrollbar?: boolean; - hideScrollbar?: boolean; - fadeScrollbar?: boolean; - scrollbarClass?: string; - - // Zoom - zoom?: boolean; - zoomMin?: number; - zoomMax?: number; - doubleTapZoom?: number; - mouseWheel?: boolean; - wheelAction?: string; - snap?: string | boolean; - snapThreshold?: number; - - // New in IScroll 5? - resizeIndicator?: boolean; - mouseWheelSpeed?: number; - startX?: number; - startY?: number; - scrollX?: boolean; - scrollY?: boolean; - scrollbars?: boolean | string; - shrinkScrollbars?: string; - interactiveScrollbars?: boolean; - releaseScroll?: boolean; - fadeScrollbars?: boolean; - directionLockThreshold?: number; - - bounceTime?: number; - - ///String or function - bounceEasing?: string|{ style: string, fn: (k: any) => any }; - - preventDefault?: boolean; - preventDefaultException?: Array|Object; - - HWCompositing?: boolean; - - freeScroll?: boolean; - - resizePolling?: number; - tap?: boolean; - click?: boolean; - invertWheelDirection?: boolean; - eventPassthrough?: string | boolean; - - // iScroll probe edition - probeType?: number; -} - -declare class IScroll { - constructor (element: string, options?: IScrollOptions); - constructor (element: HTMLElement, options?: IScrollOptions); - - x: number; - y: number; - - destroy(): void; - refresh(): void; - scrollTo(x: number, y: number, time?: number, relative?: boolean): void; - scrollToElement(element: string, time?: number): void; - scrollToElement(element: HTMLElement, time?: number): void; - scrollToElement(element: HTMLElement, time?: number, offsetX?: number | boolean, offsetY?: number | boolean, easing?: Function): void; - goToPage(pageX: number, pageY: number, time?: number): void; - disable(): void; - enable(): void; - stop(): void; - zoom(x: number, y: number, scale: number, time?: number): void; - isReady(): boolean; - - // Events - on(type: string, fn: (evt?: any) => void): void; - off(type: string, fn?: (evt?: any) => void): void; -} diff --git a/ityped/index.d.ts b/ityped/index.d.ts deleted file mode 100644 index 135ea870ca..0000000000 --- a/ityped/index.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -// Type definitions for ityped 0.0 -// Project: https://github.com/luisvinicius167/ityped -// Definitions by: Daniel Rosenwasser -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export interface Configuration { - strings?: string[]; - typeSpeed?: number; - pause?: number; - loop?: boolean; -} - -export function init(element: string, config: Configuration): void; - -export as namespace ityped; \ No newline at end of file diff --git a/ityped/tslint.json b/ityped/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/ityped/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/jalaali-js/tslint.json b/jalaali-js/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/jalaali-js/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/japanese-holidays/tslint.json b/japanese-holidays/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/japanese-holidays/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/jasmine-ajax/index.d.ts b/jasmine-ajax/index.d.ts deleted file mode 100644 index 6ec4020d00..0000000000 --- a/jasmine-ajax/index.d.ts +++ /dev/null @@ -1,88 +0,0 @@ -// Type definitions for jasmine-ajax 3.1 -// Project: https://github.com/jasmine/jasmine-ajax -// Definitions by: Louis Grignon -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 - -interface JasmineAjaxResponse { - status?: number; - statusText?: string; - responseText?: string; - response?: string; - contentType?: string; - responseHeaders?: { [key: string]: string }; -} - -interface JasmineAjaxRequest extends XMLHttpRequest { - url: string; - method: string; - params: any; - username: string; - password: string; - requestHeaders: { [key: string]: string }; - overriddenMimeType: string; - data: () => string; - - respondWith(response: JasmineAjaxResponse): void; -} - -interface JasmineAjaxRequestTracker { - track(request: JasmineAjaxRequest): void; - first(): JasmineAjaxRequest; - count(): number; - reset(): void; - mostRecent(): JasmineAjaxRequest; - at(index: number): JasmineAjaxRequest; - filter(urlToMatch: RegExp): JasmineAjaxRequest[]; - filter(urlToMatch: Function): JasmineAjaxRequest[]; - filter(urlToMatch: string): JasmineAjaxRequest[]; -} - -interface JasmineAjaxRequestStubReturnOptions { - status?: number; - contentType?: string; - response?: string; - responseText?: string; - responseHeaders?: { [key: string]: string }; -} - -interface JasmineAjaxRequestStub { - data?: string; - method?: string; - andReturn(options: JasmineAjaxRequestStubReturnOptions): void; - matches(fullUrl: string, data: string, method: string): boolean; -} - -interface JasmineAjaxStubTracker { - addStub(stub: JasmineAjaxRequestStub): void; - reset(): void; - findStub(url: string, data?: string, method?: string): JasmineAjaxRequestStub; -} - -interface JasmineAjaxParamParser { - test(xhr: XMLHttpRequest): boolean; - parse(paramString: string): any; -} - -declare class MockAjax { - constructor(globals: any); - - install(): void; - uninstall(): void; - - withMock(closure: () => void): void; - addCustomParamParser(parser: JasmineAjaxParamParser): void; - - stubRequest(url: RegExp, data?: string, method?: string): JasmineAjaxRequestStub; - stubRequest(url: string, data?: string, method?: string): JasmineAjaxRequestStub; - - stubRequest(url: RegExp, data?: RegExp, method?: string): JasmineAjaxRequestStub; - stubRequest(url: string, data?: RegExp, method?: string): JasmineAjaxRequestStub; - - requests: JasmineAjaxRequestTracker; - stubs: JasmineAjaxStubTracker; -} - -declare namespace jasmine { - export var Ajax: MockAjax; -} diff --git a/jasmine-ajax/tslint.json b/jasmine-ajax/tslint.json deleted file mode 100644 index fe03bea79d..0000000000 --- a/jasmine-ajax/tslint.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../tslint.json", - "rules": { - "forbidden-types": false, - "unified-signatures": false - } -} diff --git a/jasmine-data_driven_tests/tslint.json b/jasmine-data_driven_tests/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/jasmine-data_driven_tests/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/jasmine-es6-promise-matchers/index.d.ts b/jasmine-es6-promise-matchers/index.d.ts deleted file mode 100644 index 89e3146c2c..0000000000 --- a/jasmine-es6-promise-matchers/index.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -// Type definitions for jasmine-es6-promise-matchers -// Project: https://github.com/bvaughn/jasmine-es6-promise-matchers -// Definitions by: Stephen Lautier -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 - -/// - -declare namespace JasminePromiseMatchers { - export function install():void; - export function uninstall():void; -} - -declare namespace jasmine { - - interface Matchers { - /** - * Verifies that a Promise is (or has been) rejected. - */ - toBeRejected(done?: () => void): boolean; - - /** - * Verifies that a Promise is (or has been) rejected with the specified parameter. - */ - toBeRejectedWith(value: any, done?: () => void): boolean; - - /** - * Verifies that a Promise is (or has been) resolved. - */ - toBeResolved(done?: () => void): boolean; - - /** - * Verifies that a Promise is (or has been) resolved with the specified parameter. - */ - toBeResolvedWith(value: any, done?: () => void): boolean; - } -} diff --git a/jasmine-expect/index.d.ts b/jasmine-expect/index.d.ts deleted file mode 100644 index c2ee7e0ee5..0000000000 --- a/jasmine-expect/index.d.ts +++ /dev/null @@ -1,93 +0,0 @@ -// Type definitions for jasmine-expect 2.0 -// Project: https://github.com/JamieMason/Jasmine-Matchers -// Definitions by: UserPixel -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 - -/// - -declare namespace 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-fixture/index.d.ts b/jasmine-fixture/index.d.ts deleted file mode 100644 index 9a8c7b98b2..0000000000 --- a/jasmine-fixture/index.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -// Type definitions for Jasmine-fixture 1.0 -// Project: https://github.com/searls/jasmine-fixture -// Definitions by: Craig Brett -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 - -/// - -/** - * Affixes the given jquery selectors into the body and will be removed after each spec - * @param {string} selector The JQuery selector to be added to the dom - */ -declare function affix(selector: string): JQuery; - -interface JQuery { - /** Affixes the given jquery selectors into the element and will be removed after each spec - * @param {string} selector The JQuery selector to be added to the dom - */ - affix(selector: string): JQuery; -} diff --git a/jasmine-fixture/tslint.json b/jasmine-fixture/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/jasmine-fixture/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/jasmine-jquery/index.d.ts b/jasmine-jquery/index.d.ts deleted file mode 100644 index fb91e0c37b..0000000000 --- a/jasmine-jquery/index.d.ts +++ /dev/null @@ -1,389 +0,0 @@ -// Type definitions for Jasmine-JQuery 1.5.8 -// Project: https://github.com/velesin/jasmine-jquery -// Definitions by: Gregor Stamac -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 - -/// -/// - -declare function sandbox(attributes?: any): string; - -declare function readFixtures(...uls: string[]): string; -declare function preloadFixtures(...uls: string[]) : void; -declare function loadFixtures(...uls: string[]): void; -declare function appendLoadFixtures(...uls: string[]): void; -declare function setFixtures(html: string): string; -declare function appendSetFixtures(html: string) : void; - -declare function preloadStyleFixtures(...uls: string[]) : void; -declare function loadStyleFixtures(...uls: string[]) : void; -declare function appendLoadStyleFixtures(...uls: string[]) : void; -declare function setStyleFixtures(html: string) : void; -declare function appendSetStyleFixtures(html: string) : void; - -declare function loadJSONFixtures(...uls: string[]): jasmine.JSONFixtures; -declare function getJSONFixture(url: string): any; - -declare function spyOnEvent(selector: string, eventName: string): jasmine.JQueryEventSpy; - -declare namespace jasmine { - function spiedEventsKey(selector: JQuery, eventName: string): string; - - function getFixtures(): Fixtures; - function getStyleFixtures(): StyleFixtures; - function getJSONFixtures(): JSONFixtures; - - interface Fixtures { - fixturesPath: string; - containerId: string; - set(html: string): string; - appendSet(html: string): void; - preload(...uls: string[]): void; - load(...uls: string[]): void; - appendLoad(...uls: string[]): void; - read(...uls: string[]): string; - clearCache(): void; - cleanUp(): void; - sandbox(attributes?: any): string; - createContainer_(html: string) : string; - addToContainer_(html: string): void; - getFixtureHtml_(url: string): string; - loadFixtureIntoCache_(relativeUrl: string): void; - makeFixtureUrl_(relativeUrl: string): string; - proxyCallTo_(methodName: string, passedArguments: any): any; - } - - interface StyleFixtures { - fixturesPath: string; - set(html: string): string; - appendSet(html: string): void; - preload(...uls: string[]) : void; - load(...uls: string[]) : void; - appendLoad(...uls: string[]) : void; - read_(...uls: string[]): string; - clearCache() : void; - cleanUp() : void; - createStyle_(html: string) : void; - getFixtureHtml_(url: string): string; - loadFixtureIntoCache_(relativeUrl: string) : void; - makeFixtureUrl_(relativeUrl: string): string; - proxyCallTo_(methodName: string, passedArguments: any): any; - } - - interface JSONFixtures { - fixturesPath: string; - load(...uls: string[]): void; - read(...uls: string[]): string; - clearCache(): void; - getFixtureData_(url: string): any; - loadFixtureIntoCache_(relativeUrl: string): void; - proxyCallTo_(methodName: string, passedArguments: any): any; - } - - interface Matchers { - /** - * Check if DOM element has class. - * - * @param className Name of the class to check. - * - * @example - * // returns true - * expect($('
        ')).toHaveClass("some-class") - */ - toHaveClass(className: string): boolean; - - /** - * Check if DOM element has the given CSS properties. - * - * @param css Object containing the properties (and values) to check. - * - * @example - * // returns true - * expect($('
        ')).toHaveCss({display: "none", margin: "10px"}) - * - * @example - * // returns true - * expect($('
        ')).toHaveCss({margin: "10px"}) - */ - toHaveCss(css: any): boolean; - - /** - * Checks if DOM element is visible. - * Elements are considered visible if they consume space in the document. Visible elements have a width or height that is greater than zero. - */ - toBeVisible(): boolean; - /** - * Check if DOM element is hidden. - * Elements can be hidden for several reasons: - * - They have a CSS display value of none ; - * - They are form elements with type equal to hidden. - * - Their width and height are explicitly set to 0. - * - An ancestor element is hidden, so the element is not shown on the page. - */ - toBeHidden(): boolean; - - /** - * Only for tags that have checked attribute - * - * @example - * // returns true - * expect($('')).toBeSelected() - */ - toBeSelected(): boolean; - - /** - * Only for tags that have checked attribute - * @example - * // returns true - * expect($('')).toBeChecked() - */ - toBeChecked(): boolean; - - /** - * Checks for child DOM elements or text - */ - toBeEmpty(): boolean; - - /** - * Checks if element exists in or out the DOM. - */ - toExist(): boolean; - - /** - * Checks if array has the given length. - * - * @param length Expected length - */ - toHaveLength(length: number): boolean; - - /** - * Check if DOM element contains an attribute and, optionally, if the value of the attribute is equal to the expected one. - * - * @param attributeName Name of the attribute to check - * @param expectedAttributeValue Expected attribute value - */ - toHaveAttr(attributeName: string, expectedAttributeValue? : any): boolean; - - /** - * Check if DOM element contains a property and, optionally, if the value of the property is equal to the expected one. - * - * @param propertyName Property name to check - * @param expectedPropertyValue Expected property value - */ - toHaveProp(propertyName: string, expectedPropertyValue? : any): boolean; - - /** - * Check if DOM element has the given Id - * - * @param Id Expected identifier - */ - toHaveId(id: string): boolean; - - /** - * Check if DOM element has the specified HTML. - * - * @example - * // returns true - * expect($('
        ')).toHaveHtml('') - */ - toHaveHtml(html: string): boolean; - - /** - * Check if DOM element contains the specified HTML. - * - * @example - * // returns true - * expect($('

          header

          ')).toContainHtml('
            ') - */ - toContainHtml(html: string): boolean; - - /** - * Check if DOM element has the given Text. - * @param text Accepts a string or regular expression - * - * @example - * // returns true - * expect($('
            some text
            ')).toHaveText('some text') - */ - toHaveText(text: string): boolean; - /** - * Check if DOM element contains the specified text. - * - * @example - * // returns true - * expect($('

              header

              ')).toContainText('header') - */ - 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. - * - * @example - * // returns true - * expect($('')).toHaveValue('some text') - */ - toHaveValue(value : string): boolean; - - /** - * Check if DOM element has the given data. - * This can only be applied for element on with jQuery data(key) can be called. - * - */ - toHaveData(key : string, expectedValue : string): boolean; - toBe(selector: JQuery): boolean; - - /** - * Check if DOM element is matched by the given selector. - * - * @example - * // returns true - * expect($('
              ')).toContain('some-class') - */ - toContain(selector: JQuery): boolean; - - /** - * Check if DOM element exists inside the given parent element. - * - * @example - * // returns true - * expect($('
              ')).toContainElement('span.some-class') - */ - toContainElement(selector: string): boolean; - - /** - * Check to see if the set of matched elements matches the given selector - * - * @example - * expect($('').addClass('js-something')).toBeMatchedBy('.js-something') - * - * @returns {Boolean} true if DOM contains the element - */ - toBeMatchedBy(selector: string): boolean; - - /** - * Only for tags that have disabled attribute - * @example - * // returns true - * expect('').toBeDisabled() - */ - toBeDisabled(): boolean; - - /** - * Check if DOM element is focused - * @example - * // returns true - * expect($('').focus()).toBeFocused() - */ - toBeFocused(): boolean; - - /** - * Checks if DOM element handles event. - * - * @example - * // returns true - * expect($form).toHandle("submit") - */ - toHandle(eventName: string): boolean; - - /** - * Assigns a callback to an event of the DOM element. - * - * @param eventName Name of the event to assign the callback to. - * @param eventHandler Callback function to be assigned. - * - * @example - * expect($form).toHandleWith("submit", yourSubmitCallback) - */ - toHandleWith(eventName: string, eventHandler : JQueryCallback): boolean; - - /** - * Checks if event was triggered. - */ - toHaveBeenTriggered(): boolean; - - /** - * Checks if the event has been triggered on selector. - * @param selector Selector that should have triggered the event. - */ - toHaveBeenTriggeredOn(selector: string): boolean; - - /** - * Checks if the event has been triggered on selector. - * @param selector Selector that should have triggered the event. - * @param args Extra arguments to be passed to jQuery events functions. - */ - toHaveBeenTriggeredOnAndWith(selector: string, ...args: any[]): boolean; - - /** - * Checks if event propagation has been prevented. - */ - toHaveBeenPrevented(): boolean; - - /** - * Checks if event propagation has been prevented on element with selector. - * - * @param selector Selector that should have prevented the event. - */ - toHaveBeenPreventedOn(selector: string): boolean; - - /** - * Checks if event propagation has been stopped. - * - * @example - * // returns true - * var spyEvent = spyOnEvent('#some_element', 'click') - * $('#some_element').click(function (event){event.stopPropagation();}) - * $('#some_element').click() - * expect(spyEvent).toHaveBeenStopped() - */ - toHaveBeenStopped(): boolean; - - /** - * Checks if event propagation has been stopped by an element with the given selector. - * @param selector Selector of the element that should have stopped the event propagation. - * - * @example - * // returns true - * $('#some_element').click(function (event){event.stopPropagation();}) - * $('#some_element').click() - * expect('click').toHaveBeenStoppedOn('#some_element') - */ - toHaveBeenStoppedOn(selector: string): boolean; - - /** - * Checks to see if the matched element is attached to the DOM. - * @example - * expect($('#id-name')[0]).toBeInDOM() - */ - toBeInDOM(): boolean; - - } - - interface JQueryEventSpy { - selector: string; - eventName: string; - handler(eventObject: JQueryEventObject): any; - reset(): any; - } - - interface JasmineJQuery { - browserTagCaseIndependentHtml(html: string): string; - elementToString(element: JQuery): string; - matchersClass: any; - events: JasmineJQueryEvents; - } - - interface JasmineJQueryEvents { - spyOn(selector: string, eventName: string): JQueryEventSpy; - args(selector: string, eventName: string): any; - wasTriggered(selector: string, eventName: string): boolean; - wasTriggeredWith(selector: string, eventName: string, expectedArgs: any, env: jasmine.Env): boolean; - wasPrevented(selector: string, eventName: string): boolean; - wasStopped(selector: string, eventName: string): boolean; - cleanUp() : void; - } - - var JQuery: JasmineJQuery; -} diff --git a/jasmine-matchers/index.d.ts b/jasmine-matchers/index.d.ts deleted file mode 100644 index ac44d25c1c..0000000000 --- a/jasmine-matchers/index.d.ts +++ /dev/null @@ -1,70 +0,0 @@ -// Type definitions for jasmine-matchers v0.2.1 -// Project: https://github.com/uxebu/jasmine-matchers -// Definitions by: Bart van der Schoor -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 - -/* -Typings 2013 Bart van der Schoor - -TypeScript tests auto-extracted from jasmine-matchers unit test. - -Original jasmine-matchers license applies: - -Copyright (C) 2013, uxebu Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -/// - -declare namespace jasmine { - interface Matchers { - - //toBe - toBeArray(): boolean; - toBeCloseToOneOf(values: any[], isCloseToFunction: (actual: number, expected: number) => boolean): boolean; - toBeInstanceOf(Constructor: Function): boolean; - toBeInRange(min: number, max: number): boolean; - toBeNan(): boolean; - toBeNumber(): boolean; - toBeOfType(type: string): boolean; - toBeOneOf(values: any[]): boolean; - - //toContain - toContainOnce(value: any): boolean; - - //toHave - toHaveBeenCalledXTimes(count:number): boolean; - toHaveLength(length:number): boolean; - toHaveOwnProperties(...names:string[]): boolean; - toHaveOwnPropertiesWithValues(obj:Object): boolean; - toHaveProperties(...names:string[]): boolean; - toHavePropertiesWithValues(obj:Object): boolean; - toExactlyHaveProperties(...names:string[]): boolean; - - //toStartEndWith - toStartWith(value:any): boolean; - toStartWith(value:any[]): boolean; - - toEndWith(value:any): boolean; - toEndWith(values:any[]): boolean; - - toEachStartWith(searchString:string): boolean; - toSomeStartWith(searchString:string): boolean; - - toEachEndWith(searchString:string): boolean; - toSomeEndWith(searchString:string): boolean; - - toStartWithEither(...searchString:any[]): boolean; - - //toThrow - toThrowInstanceOf(klass:Function): boolean; - toThrowStartsWith(text:string): boolean; - } -} - diff --git a/jasmine-promise-matchers/index.d.ts b/jasmine-promise-matchers/index.d.ts deleted file mode 100644 index c511019b62..0000000000 --- a/jasmine-promise-matchers/index.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -// Type definitions for jasmine-promise-matchers -// Project: https://github.com/bvaughn/jasmine-promise-matchers -// Definitions by: Matthew Hill -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 - -/// - -declare function installPromiseMatchers(): void; - -declare namespace jasmine { - - interface Matchers { - /** - * Verifies that a Promise is (or has been) rejected. - */ - toBeRejected(): boolean; - - /** - * Verifies that a Promise is (or has been) rejected with the specified parameter. - */ - toBeRejectedWith(value: any): boolean; - - /** - * Verifies that a Promise is (or has been) resolved. - */ - toBeResolved(): boolean; - - /** - * Verifies that a Promise is (or has been) resolved with the specified parameter. - */ - toBeResolvedWith(value: any): boolean; - } -} diff --git a/jasmine/index.d.ts b/jasmine/index.d.ts deleted file mode 100644 index c0db55d100..0000000000 --- a/jasmine/index.d.ts +++ /dev/null @@ -1,583 +0,0 @@ -// Type definitions for Jasmine 2.5.2 -// Project: http://jasmine.github.io/ -// Definitions by: Boris Yankov , Theodore Brown , David Pärsson -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 - - -// For ddescribe / iit use : https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/karma-jasmine/karma-jasmine.d.ts - -declare function describe(description: string, specDefinitions: () => void): void; -declare function fdescribe(description: string, specDefinitions: () => void): void; -declare function xdescribe(description: string, specDefinitions: () => void): void; - -declare function it(expectation: string, assertion?: (done: DoneFn) => void, timeout?: number): void; -declare function fit(expectation: string, assertion?: (done: DoneFn) => void, timeout?: number): void; -declare function xit(expectation: string, assertion?: (done: DoneFn) => void, timeout?: number): void; - -/** If you call the function pending anywhere in the spec body, no matter the expectations, the spec will be marked pending. */ -declare function pending(reason?: string): void; - -declare function beforeEach(action: (done: DoneFn) => void, timeout?: number): void; -declare function afterEach(action: (done: DoneFn) => void, timeout?: number): void; - -declare function beforeAll(action: (done: DoneFn) => void, timeout?: number): void; -declare function afterAll(action: (done: DoneFn) => void, timeout?: number): void; - -declare function expect(spy: Function): jasmine.Matchers; -declare function expect(actual: any): jasmine.Matchers; - -declare function fail(e?: any): void; -/** Action method that should be called when the async work is complete */ -interface DoneFn extends Function { - (): void; - - /** fails the spec and indicates that it has completed. If the message is an Error, Error.message is used */ - fail: (message?: Error|string) => void; -} - -declare function spyOn(object: T, method: keyof T): jasmine.Spy; - -declare function spyOnProperty(object: T, property: keyof T, accessType: string): jasmine.Spy; - -declare function runs(asyncMethod: Function): void; -declare function waitsFor(latchMethod: () => boolean, failureMessage?: string, timeout?: number): void; -declare function waits(timeout?: number): void; - -declare namespace jasmine { - - var clock: () => Clock; - - function any(aclass: any): Any; - function anything(): Any; - function arrayContaining(sample: any[]): ArrayContaining; - function objectContaining(sample: any): ObjectContaining; - function createSpy(name: string, originalFn?: Function): Spy; - function createSpyObj(baseName: string, methodNames: any[]): any; - function createSpyObj(baseName: string, methodNames: any[]): T; - function pp(value: any): string; - function getEnv(): Env; - function addCustomEqualityTester(equalityTester: CustomEqualityTester): void; - function addMatchers(matchers: CustomMatcherFactories): void; - function stringMatching(str: string): Any; - function stringMatching(str: RegExp): Any; - function formatErrorMsg(domain: string, usage: string) : (msg: string) => string - - interface Any { - - new (expectedClass: any): any; - - jasmineMatches(other: any): boolean; - jasmineToString(): string; - } - - // taken from TypeScript lib.core.es6.d.ts, applicable to CustomMatchers.contains() - interface ArrayLike { - length: number; - [n: number]: T; - } - - interface ArrayContaining { - new (sample: any[]): any; - - asymmetricMatch(other: any): boolean; - jasmineToString(): string; - } - - interface ObjectContaining { - new (sample: any): any; - - jasmineMatches(other: any, mismatchKeys: any[], mismatchValues: any[]): boolean; - jasmineToString(): string; - } - - interface Block { - - new (env: Env, func: SpecFunction, spec: Spec): any; - - execute(onComplete: () => void): void; - } - - interface WaitsBlock extends Block { - new (env: Env, timeout: number, spec: Spec): any; - } - - interface WaitsForBlock extends Block { - new (env: Env, timeout: number, latchFunction: SpecFunction, message: string, spec: Spec): any; - } - - interface Clock { - install(): void; - uninstall(): void; - /** Calls to any registered callback are triggered when the clock is ticked forward via the jasmine.clock().tick function, which takes a number of milliseconds. */ - tick(ms: number): void; - mockDate(date?: Date): void; - withMock(func: () => void): void; - } - - interface CustomEqualityTester { - (first: any, second: any): boolean; - } - - interface CustomMatcher { - compare(actual: T, expected: T): CustomMatcherResult; - compare(actual: any, expected: any): CustomMatcherResult; - } - - interface CustomMatcherFactory { - (util: MatchersUtil, customEqualityTesters: Array): CustomMatcher; - } - - interface CustomMatcherFactories { - [index: string]: CustomMatcherFactory; - } - - interface CustomMatcherResult { - pass: boolean; - message?: string; - } - - interface MatchersUtil { - equals(a: any, b: any, customTesters?: Array): boolean; - contains(haystack: ArrayLike | string, needle: any, customTesters?: Array): boolean; - buildFailureMessage(matcherName: string, isNot: boolean, actual: any, ...expected: Array): string; - } - - interface Env { - setTimeout: any; - clearTimeout: void; - setInterval: any; - clearInterval: void; - updateInterval: number; - - currentSpec: Spec; - - matchersClass: Matchers; - - version(): any; - versionString(): string; - nextSpecId(): number; - addReporter(reporter: Reporter): void; - addReporter(reporter: CustomReporter): void; - execute(): void; - describe(description: string, specDefinitions: () => void): Suite; - // ddescribe(description: string, specDefinitions: () => void): Suite; Not a part of jasmine. Angular team adds these - beforeEach(beforeEachFunction: () => void): void; - beforeAll(beforeAllFunction: () => void): void; - currentRunner(): Runner; - afterEach(afterEachFunction: () => void): void; - afterAll(afterAllFunction: () => void): void; - xdescribe(desc: string, specDefinitions: () => void): XSuite; - it(description: string, func: () => void): Spec; - // iit(description: string, func: () => void): Spec; Not a part of jasmine. Angular team adds these - xit(desc: string, func: () => void): XSpec; - compareRegExps_(a: RegExp, b: RegExp, mismatchKeys: string[], mismatchValues: string[]): boolean; - compareObjects_(a: any, b: any, mismatchKeys: string[], mismatchValues: string[]): boolean; - equals_(a: any, b: any, mismatchKeys: string[], mismatchValues: string[]): boolean; - contains_(haystack: any, needle: any): boolean; - addCustomEqualityTester(equalityTester: CustomEqualityTester): void; - addMatchers(matchers: CustomMatcherFactories): void; - specFilter(spec: Spec): boolean; - throwOnExpectationFailure(value: boolean): void; - seed(seed: string | number): string | number; - provideFallbackReporter(reporter: Reporter): void; - throwingExpectationFailures(): boolean; - allowRespy(allow: boolean): void; - randomTests(): boolean; - randomizeTests(b: boolean): void; - clearReporters(): void; - } - - interface FakeTimer { - - new (): any; - - reset(): void; - tick(millis: number): void; - runFunctionsWithinRange(oldMillis: number, nowMillis: number): void; - scheduleFunction(timeoutKey: any, funcToCall: () => void, millis: number, recurring: boolean): void; - } - - interface HtmlReporter { - new (): any; - } - - interface HtmlSpecFilter { - new (): any; - } - - interface Result { - type: string; - } - - interface NestedResults extends Result { - description: string; - - totalCount: number; - passedCount: number; - failedCount: number; - - skipped: boolean; - - rollupCounts(result: NestedResults): void; - log(values: any): void; - getItems(): Result[]; - addResult(result: Result): void; - passed(): boolean; - } - - interface MessageResult extends Result { - values: any; - trace: Trace; - } - - interface ExpectationResult extends Result { - matcherName: string; - passed(): boolean; - expected: any; - actual: any; - message: string; - trace: Trace; - } - - interface Order { - new (options: {random: boolean, seed: string}): any; - random: boolean; - seed: string; - sort(items: T[]) : T[]; - } - - namespace errors { - class ExpectationFailed extends Error { - constructor(); - stack: any; - } - } - - interface TreeProcessor { - new (attrs: any): any; - execute: (done: Function) => void; - processTree() : any; - } - - interface Trace { - name: string; - message: string; - stack: any; - } - - interface PrettyPrinter { - - new (): any; - - format(value: any): void; - iterateObject(obj: any, fn: (property: string, isGetter: boolean) => void): void; - emitScalar(value: any): void; - emitString(value: string): void; - emitArray(array: any[]): void; - emitObject(obj: any): void; - append(value: any): void; - } - - interface StringPrettyPrinter extends PrettyPrinter { - } - - interface Queue { - - new (env: any): any; - - env: Env; - ensured: boolean[]; - blocks: Block[]; - running: boolean; - index: number; - offset: number; - abort: boolean; - - addBefore(block: Block, ensure?: boolean): void; - add(block: any, ensure?: boolean): void; - insertNext(block: any, ensure?: boolean): void; - start(onComplete?: () => void): void; - isRunning(): boolean; - next_(): void; - results(): NestedResults; - } - - interface Matchers { - - new (env: Env, actual: any, spec: Env, isNot?: boolean): any; - - env: Env; - actual: any; - spec: Env; - isNot?: boolean; - message(): any; - - toBe(expected: any, expectationFailOutput?: any): boolean; - toEqual(expected: any, expectationFailOutput?: any): boolean; - toMatch(expected: string | RegExp, expectationFailOutput?: any): boolean; - toBeDefined(expectationFailOutput?: any): boolean; - toBeUndefined(expectationFailOutput?: any): boolean; - toBeNull(expectationFailOutput?: any): boolean; - toBeNaN(): boolean; - toBeTruthy(expectationFailOutput?: any): boolean; - toBeFalsy(expectationFailOutput?: any): boolean; - toHaveBeenCalled(): boolean; - toHaveBeenCalledWith(...params: any[]): boolean; - toHaveBeenCalledTimes(expected: number): boolean; - toContain(expected: any, expectationFailOutput?: any): boolean; - toBeLessThan(expected: number, expectationFailOutput?: any): boolean; - toBeLessThanOrEqual(expected: number, expectationFailOutput?: any): boolean; - toBeGreaterThan(expected: number, expectationFailOutput?: any): boolean; - toBeGreaterThanOrEqual(expected: number, expectationFailOutput?: any): boolean; - toBeCloseTo(expected: number, precision?: any, expectationFailOutput?: any): boolean; - toThrow(expected?: any): boolean; - toThrowError(message?: string | RegExp): boolean; - toThrowError(expected?: new (...args: any[]) => Error, message?: string | RegExp): boolean; - not: Matchers; - - Any: Any; - } - - interface Reporter { - reportRunnerStarting(runner: Runner): void; - reportRunnerResults(runner: Runner): void; - reportSuiteResults(suite: Suite): void; - reportSpecStarting(spec: Spec): void; - reportSpecResults(spec: Spec): void; - log(str: string): void; - } - - interface MultiReporter extends Reporter { - addReporter(reporter: Reporter): void; - } - - interface SuiteInfo { - totalSpecsDefined: number; - } - - interface CustomReportExpectation { - matcherName: string; - message: string; - passed: boolean; - stack: string; - } - - interface FailedExpectation extends CustomReportExpectation { - actual: string; - expected: string; - } - - interface PassedExpectation extends CustomReportExpectation { - - } - - interface CustomReporterResult { - description: string, - failedExpectations?: FailedExpectation[], - fullName: string, - id: string; - passedExpectations?: PassedExpectation[], - pendingReason?: string; - status?: string; - } - - interface RunDetails { - failedExpectations: ExpectationResult[]; - order: jasmine.Order - } - - interface CustomReporter { - jasmineStarted?(suiteInfo: SuiteInfo): void; - suiteStarted?(result: CustomReporterResult): void; - specStarted?(result: CustomReporterResult): void; - specDone?(result: CustomReporterResult): void; - suiteDone?(result: CustomReporterResult): void; - jasmineDone?(runDetails: RunDetails): void; - } - - interface Runner { - - new (env: Env): any; - - execute(): void; - beforeEach(beforeEachFunction: SpecFunction): void; - afterEach(afterEachFunction: SpecFunction): void; - beforeAll(beforeAllFunction: SpecFunction): void; - afterAll(afterAllFunction: SpecFunction): void; - finishCallback(): void; - addSuite(suite: Suite): void; - add(block: Block): void; - specs(): Spec[]; - suites(): Suite[]; - topLevelSuites(): Suite[]; - results(): NestedResults; - } - - interface SpecFunction { - (spec?: Spec): void; - } - - interface SuiteOrSpec { - id: number; - env: Env; - description: string; - queue: Queue; - } - - interface Spec extends SuiteOrSpec { - - new (env: Env, suite: Suite, description: string): any; - - suite: Suite; - - afterCallbacks: SpecFunction[]; - spies_: Spy[]; - - results_: NestedResults; - matchersClass: Matchers; - - getFullName(): string; - results(): NestedResults; - log(arguments: any): any; - runs(func: SpecFunction): Spec; - addToQueue(block: Block): void; - addMatcherResult(result: Result): void; - getResult(): any; - expect(actual: any): any; - waits(timeout: number): Spec; - waitsFor(latchFunction: SpecFunction, timeoutMessage?: string, timeout?: number): Spec; - fail(e?: any): void; - getMatchersClass_(): Matchers; - addMatchers(matchersPrototype: CustomMatcherFactories): void; - finishCallback(): void; - finish(onComplete?: () => void): void; - after(doAfter: SpecFunction): void; - execute(onComplete?: () => void, enabled?: boolean): any; - addBeforesAndAftersToQueue(): void; - explodes(): void; - spyOn(obj: any, methodName: string, ignoreMethodDoesntExist: boolean): Spy; - spyOnProperty(object: any, property: string, accessType: string): Spy; - removeAllSpies(): void; - throwOnExpectationFailure: boolean; - } - - interface XSpec { - id: number; - runs(): void; - } - - interface Suite extends SuiteOrSpec { - - new (env: Env, description: string, specDefinitions: () => void, parentSuite: Suite): any; - - parentSuite: Suite; - - getFullName(): string; - finish(onComplete?: () => void): void; - beforeEach(beforeEachFunction: SpecFunction): void; - afterEach(afterEachFunction: SpecFunction): void; - beforeAll(beforeAllFunction: SpecFunction): void; - afterAll(afterAllFunction: SpecFunction): void; - results(): NestedResults; - add(suiteOrSpec: SuiteOrSpec): void; - specs(): Spec[]; - suites(): Suite[]; - children(): any[]; - execute(onComplete?: () => void): void; - } - - interface XSuite { - execute(): void; - } - - interface Spy { - (...params: any[]): any; - - identity: string; - and: SpyAnd; - calls: Calls; - mostRecentCall: { args: any[]; }; - argsForCall: any[]; - } - - interface SpyAnd { - /** By chaining the spy with and.callThrough, the spy will still track all calls to it but in addition it will delegate to the actual implementation. */ - callThrough(): Spy; - /** By chaining the spy with and.returnValue, all calls to the function will return a specific value. */ - returnValue(val: any): Spy; - /** By chaining the spy with and.returnValues, all calls to the function will return specific values in order until it reaches the end of the return values list. */ - returnValues(...values: any[]): Spy; - /** By chaining the spy with and.callFake, all calls to the spy will delegate to the supplied function. */ - callFake(fn: Function): Spy; - /** By chaining the spy with and.throwError, all calls to the spy will throw the specified value. */ - throwError(msg: string): Spy; - /** When a calling strategy is used for a spy, the original stubbing behavior can be returned at any time with and.stub. */ - stub(): Spy; - } - - interface Calls { - /** By chaining the spy with calls.any(), will return false if the spy has not been called at all, and then true once at least one call happens. **/ - any(): boolean; - /** By chaining the spy with calls.count(), will return the number of times the spy was called **/ - count(): number; - /** By chaining the spy with calls.argsFor(), will return the arguments passed to call number index **/ - argsFor(index: number): any[]; - /** By chaining the spy with calls.allArgs(), will return the arguments to all calls **/ - allArgs(): any[]; - /** By chaining the spy with calls.all(), will return the context (the this) and arguments passed all calls **/ - all(): CallInfo[]; - /** By chaining the spy with calls.mostRecent(), will return the context (the this) and arguments for the most recent call **/ - mostRecent(): CallInfo; - /** By chaining the spy with calls.first(), will return the context (the this) and arguments for the first call **/ - first(): CallInfo; - /** By chaining the spy with calls.reset(), will clears all tracking for a spy **/ - reset(): void; - } - - interface CallInfo { - /** The context (the this) for the call */ - object: any; - /** All arguments passed to the call */ - args: any[]; - /** The return value of the call */ - returnValue: any; - } - - interface Util { - inherit(childClass: Function, parentClass: Function): any; - formatException(e: any): any; - htmlEscape(str: string): string; - argsToArray(args: any): any; - extend(destination: any, source: any): any; - } - - interface JsApiReporter extends Reporter { - - started: boolean; - finished: boolean; - result: any; - messages: any; - runDetails: RunDetails - - new (): any; - - suites(): Suite[]; - summarize_(suiteOrSpec: SuiteOrSpec): any; - results(): any; - resultsForSpec(specId: any): any; - log(str: any): any; - resultsForSpecs(specIds: any): any; - summarizeResult_(result: any): any; - } - - interface Jasmine { - Spec: Spec; - clock: Clock; - util: Util; - } - - export var HtmlReporter: HtmlReporter; - export var HtmlSpecFilter: HtmlSpecFilter; - export var DEFAULT_TIMEOUT_INTERVAL: number; -} diff --git a/jasmine/jasmine-tests.ts b/jasmine/jasmine-tests.ts deleted file mode 100644 index 4632eb8b4c..0000000000 --- a/jasmine/jasmine-tests.ts +++ /dev/null @@ -1,994 +0,0 @@ -// tests based on http://jasmine.github.io/2.2/introduction.html - -describe("A suite", function () { - it("contains spec with an expectation", function () { - expect(true).toBe(true); - }); -}); - -describe("A suite is just a function", function () { - var a: boolean; - - it("and so is a spec", function () { - a = true; - expect(a).toBe(true); - }); -}); - -describe("The 'toBe' matcher compares with ===", function () { - - it("and has a positive case", function () { - expect(true).toBe(true); - }); - - it("and can have a negative case", function () { - expect(false).not.toBe(true); - }); -}); - -describe("Included matchers:", function () { - - it("The 'toBe' matcher compares with ===", function () { - var a = 12; - var b = a; - - expect(a).toBe(b); - expect(a).not.toBe(null); - }); - - describe("The 'toEqual' matcher", function () { - - it("works for simple literals and variables", function () { - var a = 12; - expect(a).toEqual(12); - }); - - it("should work for objects", function () { - var foo = { - a: 12, - b: 34 - }; - var bar = { - a: 12, - b: 34 - }; - expect(foo).toEqual(bar); - }); - }); - - it("The 'toMatch' matcher is for regular expressions", function () { - var message = "foo bar baz"; - - expect(message).toMatch(/bar/); - expect(message).toMatch("bar"); - expect(message).not.toMatch(/quux/); - }); - - it("The 'toBeDefined' matcher compares against `undefined`", function () { - var a = { - foo: "foo" - }; - - expect(a.foo).toBeDefined(); - expect((a).bar).not.toBeDefined(); - }); - - it("The `toBeUndefined` matcher compares against `undefined`", function () { - var a = { - foo: "foo" - }; - - expect(a.foo).not.toBeUndefined(); - expect((a).bar).toBeUndefined(); - }); - - it("The 'toBeNull' matcher compares against null", function () { - var a: string = null; - var foo = "foo"; - - expect(null).toBeNull(); - expect(a).toBeNull(); - expect(foo).not.toBeNull(); - }); - - it("The 'toBeTruthy' matcher is for boolean casting testing", function () { - var a: string, foo = "foo"; - - expect(foo).toBeTruthy(); - expect(a).not.toBeTruthy(); - }); - - it("The 'toBeFalsy' matcher is for boolean casting testing", function () { - var a: string, foo = "foo"; - - expect(a).toBeFalsy(); - expect(foo).not.toBeFalsy(); - }); - - it("The 'toContain' matcher is for finding an item in an Array", function () { - var a = ["foo", "bar", "baz"]; - - expect(a).toContain("bar"); - expect(a).not.toContain("quux"); - }); - - it("The 'toBeLessThan' matcher is for mathematical comparisons", function () { - var pi = 3.1415926, - e = 2.78; - - expect(e).toBeLessThan(pi); - expect(pi).not.toBeLessThan(e); - }); - - it("The 'toBeGreaterThan' is for mathematical comparisons", function () { - var pi = 3.1415926, - e = 2.78; - - expect(pi).toBeGreaterThan(e); - expect(e).not.toBeGreaterThan(pi); - }); - - it("The 'toBeCloseTo' matcher is for precision math comparison", function () { - var pi = 3.1415926, - e = 2.78; - - expect(pi).not.toBeCloseTo(e, 2); - expect(pi).toBeCloseTo(e, 0); - }); - - it("The 'toThrow' matcher is for testing if a function throws an exception", function () { - var foo = function () { - return 1 + 2; - }; - var bar = function () { - var a: any = undefined; - return a + 1; - }; - - expect(foo).not.toThrow(); - expect(bar).toThrow(); - }); - - it("The 'toThrowError' matcher is for testing a specific thrown exception", function() { - var foo = function() { - throw new TypeError("foo bar baz"); - }; - - expect(foo).toThrowError("foo bar baz"); - expect(foo).toThrowError(/bar/); - expect(foo).toThrowError(TypeError); - expect(foo).toThrowError(TypeError, "foo bar baz"); - }); -}); - -describe("A spec", function () { - it("is just a function, so it can contain any code", function () { - var foo = 0; - foo += 1; - - expect(foo).toEqual(1); - }); - - it("can have more than one expectation", function () { - var foo = 0; - foo += 1; - - expect(foo).toEqual(1); - expect(true).toEqual(true); - }); -}); - -describe("A spec (with setup and tear-down)", function () { - var foo: number; - - beforeEach(function () { - foo = 0; - foo += 1; - }); - - afterEach(function () { - foo = 0; - }); - - it("is just a function, so it can contain any code", function () { - expect(foo).toEqual(1); - }); - - it("can have more than one expectation", function () { - expect(foo).toEqual(1); - expect(true).toEqual(true); - }); -}); - -describe("A spec", function () { - var foo: number; - - beforeEach(function () { - foo = 0; - foo += 1; - }); - - afterEach(function () { - foo = 0; - }); - - it("is just a function, so it can contain any code", function () { - expect(foo).toEqual(1); - }); - - it("can have more than one expectation", function () { - expect(foo).toEqual(1); - expect(true).toEqual(true); - }); - - describe("nested inside a second describe", function () { - var bar: number; - - beforeEach(function () { - bar = 1; - }); - - it("can reference both scopes as needed", function () { - expect(foo).toEqual(bar); - }); - }); -}); - -xdescribe("A spec", function () { - var foo: number; - - beforeEach(function () { - foo = 0; - foo += 1; - }); - - it("is just a function, so it can contain any code", function () { - expect(foo).toEqual(1); - }); -}); - -describe("Pending specs", function () { - - xit("can be declared 'xit'", function () { - expect(true).toBe(false); - }); - - it("can be declared with 'it' but without a function"); - - it("can be declared by calling 'pending' in the spec body", function () { - expect(true).toBe(false); - pending(); // without reason - pending('this is why it is pending'); - }); -}); - -describe("A spy", function () { - var foo: any, bar: any = null; - - beforeEach(function () { - foo = { - setBar: function (value: any) { - bar = value; - } - }; - - spyOn(foo, 'setBar'); - - foo.setBar(123); - foo.setBar(456, 'another param'); - }); - - it("tracks that the spy was called", function () { - expect(foo.setBar).toHaveBeenCalled(); - }); - - it("tracks all the arguments of its calls", function () { - expect(foo.setBar).toHaveBeenCalledWith(123); - expect(foo.setBar).toHaveBeenCalledWith(456, 'another param'); - }); - - it("stops all execution on a function", function () { - expect(bar).toBeNull(); - }); -}); - -describe("A spy, when configured to call through", function () { - var foo: any, bar: any, fetchedBar: any; - - beforeEach(function () { - foo = { - setBar: function (value: any) { - bar = value; - }, - getBar: function () { - return bar; - } - }; - - spyOn(foo, 'getBar').and.callThrough(); - - foo.setBar(123); - fetchedBar = foo.getBar(); - }); - - it("tracks that the spy was called", function () { - expect(foo.getBar).toHaveBeenCalled(); - }); - - it("should not effect other functions", function () { - expect(bar).toEqual(123); - }); - - it("when called returns the requested value", function () { - expect(fetchedBar).toEqual(123); - }); -}); - -describe("A spy, when configured to fake a return value", function () { - var foo: any, bar: any, fetchedBar: any; - - beforeEach(function () { - foo = { - setBar: function (value: any) { - bar = value; - }, - getBar: function () { - return bar; - } - }; - - spyOn(foo, "getBar").and.returnValue(745); - - foo.setBar(123); - fetchedBar = foo.getBar(); - }); - - it("tracks that the spy was called", function () { - expect(foo.getBar).toHaveBeenCalled(); - }); - - it("should not effect other functions", function () { - expect(bar).toEqual(123); - }); - - it("when called returns the requested value", function () { - expect(fetchedBar).toEqual(745); - }); -}); - -describe("A spy, when configured to fake a series of return values", function() { - var foo: any, bar: any; - - beforeEach(function() { - foo = { - setBar: function(value: any) { - bar = value; - }, - getBar: function() { - return bar; - } - }; - - spyOn(foo, "getBar").and.returnValues("fetched first", "fetched second"); - - foo.setBar(123); - }); - - it("tracks that the spy was called", function() { - foo.getBar(123); - expect(foo.getBar).toHaveBeenCalled(); - }); - - it("should not affect other functions", function() { - expect(bar).toEqual(123); - }); - - it("when called multiple times returns the requested values in order", function() { - expect(foo.getBar()).toEqual("fetched first"); - expect(foo.getBar()).toEqual("fetched second"); - expect(foo.getBar()).toBeUndefined(); - }); -}); - -describe("A spy, when configured with an alternate implementation", function () { - var foo: any, bar: any, fetchedBar: any; - - beforeEach(function () { - foo = { - setBar: function (value: any) { - bar = value; - }, - getBar: function () { - return bar; - } - }; - - spyOn(foo, "getBar").and.callFake(function () { - return 1001; - }); - - foo.setBar(123); - fetchedBar = foo.getBar(); - }); - - it("tracks that the spy was called", function () { - expect(foo.getBar).toHaveBeenCalled(); - }); - - it("should not effect other functions", function () { - expect(bar).toEqual(123); - }); - - it("when called returns the requested value", function () { - expect(fetchedBar).toEqual(1001); - }); -}); - -describe("A spy, when configured to throw a value", function () { - var foo: any, bar: any; - - beforeEach(function () { - foo = { - setBar: function (value: any) { - bar = value; - } - }; - - spyOn(foo, "setBar").and.throwError("quux"); - }); - - it("throws the value", function () { - expect(function () { - foo.setBar(123) - }).toThrowError("quux"); - }); -}); - -describe("A spy, when configured with multiple actions", function () { - var foo: any, bar: any, fetchedBar: any; - - beforeEach(function () { - foo = { - setBar: function (value: any) { - bar = value; - }, - getBar: function () { - return bar; - } - }; - - spyOn(foo, 'getBar').and.callThrough().and.callFake(() => { - this.fakeCalled = true; - }); - - foo.setBar(123); - fetchedBar = foo.getBar(); - }); - - it("tracks that the spy was called", function () { - expect(foo.getBar).toHaveBeenCalled(); - }); - - it("should not effect other functions", function () { - expect(bar).toEqual(123); - }); - - it("when called returns the requested value", function () { - expect(fetchedBar).toEqual(123); - }); - - it("should have called the fake implementation", function () { - expect(this.fakeCalled).toEqual(true); - }); -}); - -describe("A spy", function () { - var foo: any, bar: any = null; - - beforeEach(function () { - foo = { - setBar: function (value: any) { - bar = value; - } - }; - - spyOn(foo, 'setBar').and.callThrough(); - }); - - it("can call through and then stub in the same spec", function () { - foo.setBar(123); - expect(bar).toEqual(123); - - foo.setBar.and.stub(); - bar = null; - - foo.setBar(123); - expect(bar).toBe(null); - }); -}); - -describe("A spy", function () { - var foo: any, bar: any = null; - - beforeEach(function () { - foo = { - setBar: function (value: any) { - bar = value; - } - }; - - spyOn(foo, 'setBar'); - }); - - it("tracks if it was called at all", function () { - expect(foo.setBar.calls.any()).toEqual(false); - - foo.setBar(); - - expect(foo.setBar.calls.any()).toEqual(true); - }); - - it("tracks the number of times it was called", function () { - expect(foo.setBar.calls.count()).toEqual(0); - - foo.setBar(); - foo.setBar(); - - expect(foo.setBar.calls.count()).toEqual(2); - }); - - it("tracks the arguments of each call", function () { - foo.setBar(123); - foo.setBar(456, "baz"); - - expect(foo.setBar.calls.argsFor(0)).toEqual([123]); - expect(foo.setBar.calls.argsFor(1)).toEqual([456, "baz"]); - }); - - it("tracks the arguments of all calls", function () { - foo.setBar(123); - foo.setBar(456, "baz"); - - expect(foo.setBar.calls.allArgs()).toEqual([[123], [456, "baz"]]); - }); - - it("can provide the context and arguments to all calls", function () { - foo.setBar(123); - - expect(foo.setBar.calls.all()).toEqual([{ object: foo, args: [123], returnValue: undefined }]); - }); - - it("has a shortcut to the most recent call", function () { - foo.setBar(123); - foo.setBar(456, "baz"); - - expect(foo.setBar.calls.mostRecent()).toEqual({ object: foo, args: [456, "baz"], returnValue: undefined }); - }); - - it("has a shortcut to the first call", function () { - foo.setBar(123); - foo.setBar(456, "baz"); - - expect(foo.setBar.calls.first()).toEqual({ object: foo, args: [123], returnValue: undefined }); - }); - - it("can be reset", function () { - foo.setBar(123); - foo.setBar(456, "baz"); - - expect(foo.setBar.calls.any()).toBe(true); - - foo.setBar.calls.reset(); - - expect(foo.setBar.calls.any()).toBe(false); - }); -}); - -describe("A spy, when created manually", function () { - var whatAmI: any; - - beforeEach(function () { - whatAmI = jasmine.createSpy('whatAmI'); - - whatAmI("I", "am", "a", "spy"); - }); - - it("is named, which helps in error reporting", function () { - expect(whatAmI.and.identity()).toEqual('whatAmI'); - }); - - it("tracks that the spy was called", function () { - expect(whatAmI).toHaveBeenCalled(); - }); - - it("tracks its number of calls", function () { - expect(whatAmI.calls.count()).toEqual(1); - }); - - it("tracks all the arguments of its calls", function () { - expect(whatAmI).toHaveBeenCalledWith("I", "am", "a", "spy"); - }); - - it("allows access to the most recent call", function () { - expect(whatAmI.calls.mostRecent().args[0]).toEqual("I"); - }); -}); - -describe("Multiple spies, when created manually", function () { - var tape: any; - - beforeEach(function () { - tape = jasmine.createSpyObj('tape', ['play', 'pause', 'stop', 'rewind']); - - tape.play(); - tape.pause(); - tape.rewind(0); - }); - - it("creates spies for each requested function", function () { - expect(tape.play).toBeDefined(); - expect(tape.pause).toBeDefined(); - expect(tape.stop).toBeDefined(); - expect(tape.rewind).toBeDefined(); - }); - - it("tracks that the spies were called", function () { - expect(tape.play).toHaveBeenCalled(); - expect(tape.pause).toHaveBeenCalled(); - expect(tape.rewind).toHaveBeenCalled(); - expect(tape.stop).not.toHaveBeenCalled(); - }); - - it("tracks all the arguments of its calls", function () { - expect(tape.rewind).toHaveBeenCalledWith(0); - }); -}); - -describe("jasmine.any", function () { - it("matches any value", function () { - expect({}).toEqual(jasmine.any(Object)); - expect(12).toEqual(jasmine.any(Number)); - }); - - describe("when used with a spy", function () { - it("is useful for comparing arguments", function () { - var foo = jasmine.createSpy('foo'); - foo(12, function () { - return true; - }); - - expect(foo).toHaveBeenCalledWith(jasmine.any(Number), jasmine.any(Function)); - }); - }); -}); - -describe("jasmine.objectContaining", function () { - var foo: any; - - beforeEach(function () { - foo = { - a: 1, - b: 2, - bar: "baz" - }; - }); - - it("matches objects with the expect key/value pairs", function () { - expect(foo).toEqual(jasmine.objectContaining({ - bar: "baz" - })); - expect(foo).not.toEqual(jasmine.objectContaining({ - c: 37 - })); - }); - - describe("when used with a spy", function () { - it("is useful for comparing arguments", function () { - var callback = jasmine.createSpy('callback'); - - callback({ - bar: "baz" - }); - - expect(callback).toHaveBeenCalledWith(jasmine.objectContaining({ - bar: "baz" - })); - expect(callback).not.toHaveBeenCalledWith(jasmine.objectContaining({ - c: 37 - })); - }); - }); -}); - -describe("jasmine.arrayContaining", function() { - var foo: any; - - beforeEach(function() { - foo = [1, 2, 3, 4]; - }); - - it("matches arrays with some of the values", function() { - expect(foo).toEqual(jasmine.arrayContaining([3, 1])); - expect(foo).not.toEqual(jasmine.arrayContaining([6])); - }); - - describe("when used with a spy", function() { - it("is useful when comparing arguments", function() { - var callback = jasmine.createSpy('callback'); - - callback([1, 2, 3, 4]); - - expect(callback).toHaveBeenCalledWith(jasmine.arrayContaining([4, 2, 3])); - expect(callback).not.toHaveBeenCalledWith(jasmine.arrayContaining([5, 2])); - }); - }); -}); - -describe("Manually ticking the Jasmine Clock", function () { - var timerCallback: any; - - beforeEach(function () { - timerCallback = jasmine.createSpy("timerCallback"); - jasmine.clock().install(); - }); - - afterEach(function () { - jasmine.clock().uninstall(); - }); - - it("causes a timeout to be called synchronously", function () { - setTimeout(function () { - timerCallback(); - }, 100); - - expect(timerCallback).not.toHaveBeenCalled(); - - jasmine.clock().tick(101); - - expect(timerCallback).toHaveBeenCalled(); - }); - - it("causes an interval to be called synchronously", function () { - setInterval(function () { - timerCallback(); - }, 100); - - expect(timerCallback).not.toHaveBeenCalled(); - - jasmine.clock().tick(101); - expect(timerCallback.calls.count()).toEqual(1); - - jasmine.clock().tick(50); - expect(timerCallback.calls.count()).toEqual(1); - - jasmine.clock().tick(50); - expect(timerCallback.calls.count()).toEqual(2); - }); - - describe("Mocking the Date object", function(){ - it("mocks the Date object and sets it to a given time", function() { - var baseTime = new Date(2013, 9, 23); - - jasmine.clock().mockDate(baseTime); - - jasmine.clock().tick(50); - expect(new Date().getTime()).toEqual(baseTime.getTime() + 50); - }); - }); -}); - -describe("Asynchronous specs", function () { - var value: number; - beforeEach(function (done: DoneFn) { - setTimeout(function () { - value = 0; - done(); - }, 1); - }); - - it("should support async execution of test preparation and expectations", function (done: DoneFn) { - value++; - expect(value).toBeGreaterThan(0); - done(); - }); - - describe("long asynchronous specs", function() { - beforeEach(function(done: DoneFn) { - done(); - }, 1000); - - it("takes a long time", function(done: DoneFn) { - setTimeout(function() { - done(); - }, 9000); - }, 10000); - - afterEach(function(done: DoneFn) { - done(); - }, 1000); - }); - -}); - -describe("Fail", function () { - - it("should fail test when called without arguments", function () { - fail(); - }); - - it("should fail test when called with a fail message", function () { - fail("The test failed"); - }); - - it("should fail test when called an error", function () { - fail(new Error("The test failed with this error")); - }); - -}); - -// test based on http://jasmine.github.io/2.2/custom_equality.html -describe("custom equality", function() { - var myCustomEquality: jasmine.CustomEqualityTester = function(first: any, second: any): boolean { - if (typeof first == "string" && typeof second == "string") { - return first[0] == second[1]; - } - }; - - beforeEach(function() { - jasmine.addCustomEqualityTester(myCustomEquality); - }); - - - it("should be custom equal", function() { - expect("abc").toEqual("aaa"); - }); - - it("should be custom not equal", function() { - expect("abc").not.toEqual("abc"); - }); -}); - -// test based on http://jasmine.github.io/2.2/custom_matcher.html -var customMatchers: jasmine.CustomMatcherFactories = { - toBeGoofy: function (util: jasmine.MatchersUtil, customEqualityTesters: Array) { - return { - compare: function (actual: any, expected: any): jasmine.CustomMatcherResult { - if (expected === undefined) { - expected = ''; - } - var result: jasmine.CustomMatcherResult = { pass: false }; - - result.pass = util.equals(actual.hyuk, "gawrsh" + expected, customEqualityTesters); - - if (result.pass) { - result.message = "Expected " + actual + " not to be quite so goofy"; - } else { - result.message = "Expected " + actual + " to be goofy, but it was not very goofy"; - } - - return result; - } - }; - } -}; -// add the custom matchers to interface jasmine.Matchers via TypeScript declaration merging -// if your test files import or export anything, you'll want to use: -// declare global { -// namespace jasmine { -// interface Matchers { -// ... -// } -// } -// } -declare namespace jasmine { - interface Matchers { - toBeGoofy(expected?: any): boolean; - } -} - -describe("Custom matcher: 'toBeGoofy'", function () { - beforeEach(function () { - jasmine.addMatchers(customMatchers); - }); - - it("is available on an expectation", function () { - expect({ - hyuk: 'gawrsh' - }).toBeGoofy(); - }); - - it("can take an 'expected' parameter", function () { - expect({ - hyuk: 'gawrsh is fun' - }).toBeGoofy(' is fun'); - }); - - it("can be negated", function () { - expect({ - hyuk: 'this is fun' - }).not.toBeGoofy(); - }); -}); - -// test based on http://jasmine.github.io/2.5/custom_reporter.html -var myReporter: jasmine.CustomReporter = { - jasmineStarted: function (suiteInfo: jasmine.SuiteInfo ) { - console.log("Running suite with " + suiteInfo.totalSpecsDefined); - }, - - suiteStarted: function (result: jasmine.CustomReporterResult) { - console.log("Suite started: " + result.description + " whose full description is: " + result.fullName); - }, - - specStarted: function (result: jasmine.CustomReporterResult) { - console.log("Spec started: " + result.description + " whose full description is: " + result.fullName); - }, - - specDone: function (result: jasmine.CustomReporterResult) { - console.log("Spec: " + result.description + " was " + result.status); - for (var i = 0; i < result.failedExpectations.length; i++) { - console.log("Failure: " + result.failedExpectations[i].message); - console.log("Actual: " + result.failedExpectations[i].actual); - console.log("Expected: " + result.failedExpectations[i].expected); - console.log(result.failedExpectations[i].stack); - } - console.log(result.passedExpectations.length); - }, - - suiteDone: function (result: jasmine.CustomReporterResult) { - console.log('Suite: ' + result.description + ' was ' + result.status); - for (var i = 0; i < result.failedExpectations.length; i++) { - console.log('AfterAll ' + result.failedExpectations[i].message); - console.log(result.failedExpectations[i].stack); - } - }, - - jasmineDone: function(runDetails: jasmine.RunDetails) { - console.log('Finished suite'); - console.log('Random:', runDetails.order.random); - } -}; - -jasmine.getEnv().addReporter(myReporter); - -describe("Randomize Tests", function() { - it("should allow randomization of the order of tests", function() { - expect(function() { - var env = jasmine.getEnv(); - return env.randomizeTests(true); - }).not.toThrow(); - }); - - it("should allow a seed to be passed in for randomization", function() { - expect(function() { - var env = jasmine.getEnv(); - env.randomizeTests(true); - return env.seed(1234); - }).not.toThrow(); - }); -}); - -(() => { - // from boot.js - var env = jasmine.getEnv(); - - var htmlReporter = new jasmine.HtmlReporter(); - env.addReporter(htmlReporter); - - var specFilter = new jasmine.HtmlSpecFilter(); - env.specFilter = function (spec) { - return specFilter.matches(spec.getFullName()); - }; - - var currentWindowOnload = window.onload; - window.onload = function () { - if (currentWindowOnload) { - (currentWindowOnload)(null); - } - htmlReporter.initialize(); - env.execute(); - }; - -})(); - -jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000; diff --git a/jasmine/package.json b/jasmine/package.json deleted file mode 100644 index 7e47d54c61..0000000000 --- a/jasmine/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "dependencies": { - "typescript": ">=2.1.4" - } -} \ No newline at end of file diff --git a/jasmine/v1/index.d.ts b/jasmine/v1/index.d.ts deleted file mode 100644 index 5cbb2a9f83..0000000000 --- a/jasmine/v1/index.d.ts +++ /dev/null @@ -1,389 +0,0 @@ -// Type definitions for Jasmine 1.3 -// Project: http://pivotal.github.com/jasmine/ -// Definitions by: Boris Yankov -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - - -declare function describe(description: string, specDefinitions: () => void): void; -// declare function ddescribe(description: string, specDefinitions: () => void): void; is not a part of jasmine. It is something angular adds -declare function xdescribe(description: string, specDefinitions: () => void): void; - -declare function it(expectation: string, assertion: () => void): void; -declare function it(expectation: string, assertion: (done: (err?: any) => void) => void): void; -// declare function iit(expectation: string, assertion: () => void): void; is not a part of jasmine. It is something angular adds -declare function xit(expectation: string, assertion: () => void): void; - -declare function beforeEach(action: () => void): void; -declare function afterEach(action: () => void): void; - -declare function expect(spy: Function): jasmine.Matchers; -//declare function expect(spy: jasmine.Spy): jasmine.Matchers; -declare function expect(actual: any): jasmine.Matchers; - -declare function spyOn(object: any, method: string): jasmine.Spy; - -declare function runs(asyncMethod: Function): void; -declare function waitsFor(latchMethod: () => boolean, failureMessage?: string, timeout?: number): void; -declare function waits(timeout?: number): void; - -declare namespace jasmine { - - var Clock: Clock; - - function any(aclass: any): Any; - function objectContaining(sample: any): ObjectContaining; - function createSpy(name: string, originalFn?: Function): Spy; - function createSpyObj(baseName: string, methodNames: any[]): any; - function createSpyObj(baseName: string, methodNames: any[]): T; - function pp(value: any): string; - function getEnv(): Env; - - interface Any { - - new (expectedClass: any): any; - - jasmineMatches(other: any): boolean; - jasmineToString(): string; - } - - interface ObjectContaining { - new (sample: any): any; - - jasmineMatches(other: any, mismatchKeys: any[], mismatchValues: any[]): boolean; - jasmineToString(): string; - } - - interface Block { - - new (env: Env, func: SpecFunction, spec: Spec): any; - - execute(onComplete: () => void): void; - } - - interface WaitsBlock extends Block { - new (env: Env, timeout: number, spec: Spec): any; - } - - interface WaitsForBlock extends Block { - new (env: Env, timeout: number, latchFunction: SpecFunction, message: string, spec: Spec): any; - } - - interface Clock { - reset(): void; - tick(millis: number): void; - runFunctionsWithinRange(oldMillis: number, nowMillis: number): void; - scheduleFunction(timeoutKey: any, funcToCall: () => void, millis: number, recurring: boolean): void; - useMock(): void; - installMock(): void; - uninstallMock(): void; - real: void; - assertInstalled(): void; - isInstalled(): boolean; - installed: any; - } - - interface Env { - setTimeout: any; - clearTimeout: void; - setInterval: any; - clearInterval: void; - updateInterval: number; - - currentSpec: Spec; - - matchersClass: Matchers; - - version(): any; - versionString(): string; - nextSpecId(): number; - addReporter(reporter: Reporter): void; - execute(): void; - describe(description: string, specDefinitions: () => void): Suite; - beforeEach(beforeEachFunction: () => void): void; - currentRunner(): Runner; - afterEach(afterEachFunction: () => void): void; - xdescribe(desc: string, specDefinitions: () => void): XSuite; - it(description: string, func: () => void): Spec; - xit(desc: string, func: () => void): XSpec; - compareRegExps_(a: RegExp, b: RegExp, mismatchKeys: string[], mismatchValues: string[]): boolean; - compareObjects_(a: any, b: any, mismatchKeys: string[], mismatchValues: string[]): boolean; - equals_(a: any, b: any, mismatchKeys: string[], mismatchValues: string[]): boolean; - contains_(haystack: any, needle: any): boolean; - addEqualityTester(equalityTester: (a: any, b: any, env: Env, mismatchKeys: string[], mismatchValues: string[]) => boolean): void; - specFilter(spec: Spec): boolean; - } - - interface FakeTimer { - - new (): any; - - reset(): void; - tick(millis: number): void; - runFunctionsWithinRange(oldMillis: number, nowMillis: number): void; - scheduleFunction(timeoutKey: any, funcToCall: () => void, millis: number, recurring: boolean): void; - } - - interface HtmlReporter { - new (): any; - } - - interface Result { - type: string; - } - - interface NestedResults extends Result { - description: string; - - totalCount: number; - passedCount: number; - failedCount: number; - - skipped: boolean; - - rollupCounts(result: NestedResults): void; - log(values: any): void; - getItems(): Result[]; - addResult(result: Result): void; - passed(): boolean; - } - - interface MessageResult extends Result { - values: any; - trace: Trace; - } - - interface ExpectationResult extends Result { - matcherName: string; - passed(): boolean; - expected: any; - actual: any; - message: string; - trace: Trace; - } - - interface Trace { - name: string; - message: string; - stack: any; - } - - interface PrettyPrinter { - - new (): any; - - format(value: any): void; - iterateObject(obj: any, fn: (property: string, isGetter: boolean) => void): void; - emitScalar(value: any): void; - emitString(value: string): void; - emitArray(array: any[]): void; - emitObject(obj: any): void; - append(value: any): void; - } - - interface StringPrettyPrinter extends PrettyPrinter { - } - - interface Queue { - - new (env: any): any; - - env: Env; - ensured: boolean[]; - blocks: Block[]; - running: boolean; - index: number; - offset: number; - abort: boolean; - - addBefore(block: Block, ensure?: boolean): void; - add(block: any, ensure?: boolean): void; - insertNext(block: any, ensure?: boolean): void; - start(onComplete?: () => void): void; - isRunning(): boolean; - next_(): void; - results(): NestedResults; - } - - interface Matchers { - - new (env: Env, actual: any, spec: Env, isNot?: boolean): any; - - env: Env; - actual: any; - spec: Env; - isNot?: boolean; - message(): any; - - toBe(expected: any): boolean; - toEqual(expected: any): boolean; - toMatch(expected: any): boolean; - toBeDefined(): boolean; - toBeUndefined(): boolean; - toBeNull(): boolean; - toBeNaN(): boolean; - toBeTruthy(): boolean; - toBeFalsy(): boolean; - toHaveBeenCalled(): boolean; - toHaveBeenCalledWith(...params: any[]): boolean; - toContain(expected: any): boolean; - toBeLessThan(expected: any): boolean; - toBeGreaterThan(expected: any): boolean; - toBeCloseTo(expected: any, precision: any): boolean; - toContainHtml(expected: string): boolean; - toContainText(expected: string): boolean; - toThrow(expected?: any): boolean; - not: Matchers; - - Any: Any; - } - - interface Reporter { - reportRunnerStarting(runner: Runner): void; - reportRunnerResults(runner: Runner): void; - reportSuiteResults(suite: Suite): void; - reportSpecStarting(spec: Spec): void; - reportSpecResults(spec: Spec): void; - log(str: string): void; - } - - interface MultiReporter extends Reporter { - addReporter(reporter: Reporter): void; - } - - interface Runner { - - new (env: Env): any; - - execute(): void; - beforeEach(beforeEachFunction: SpecFunction): void; - afterEach(afterEachFunction: SpecFunction): void; - finishCallback(): void; - addSuite(suite: Suite): void; - add(block: Block): void; - specs(): Spec[]; - suites(): Suite[]; - topLevelSuites(): Suite[]; - results(): NestedResults; - } - - interface SpecFunction { - (spec?: Spec): void; - } - - interface SuiteOrSpec { - id: number; - env: Env; - description: string; - queue: Queue; - } - - interface Spec extends SuiteOrSpec { - - new (env: Env, suite: Suite, description: string): any; - - suite: Suite; - - afterCallbacks: SpecFunction[]; - spies_: Spy[]; - - results_: NestedResults; - matchersClass: Matchers; - - getFullName(): string; - results(): NestedResults; - log(arguments: any): any; - runs(func: SpecFunction): Spec; - addToQueue(block: Block): void; - addMatcherResult(result: Result): void; - expect(actual: any): any; - waits(timeout: number): Spec; - waitsFor(latchFunction: SpecFunction, timeoutMessage?: string, timeout?: number): Spec; - fail(e?: any): void; - getMatchersClass_(): Matchers; - addMatchers(matchersPrototype: any): void; - finishCallback(): void; - finish(onComplete?: () => void): void; - after(doAfter: SpecFunction): void; - execute(onComplete?: () => void): any; - addBeforesAndAftersToQueue(): void; - explodes(): void; - spyOn(obj: any, methodName: string, ignoreMethodDoesntExist: boolean): Spy; - removeAllSpies(): void; - } - - interface XSpec { - id: number; - runs(): void; - } - - interface Suite extends SuiteOrSpec { - - new (env: Env, description: string, specDefinitions: () => void, parentSuite: Suite): any; - - parentSuite: Suite; - - getFullName(): string; - finish(onComplete?: () => void): void; - beforeEach(beforeEachFunction: SpecFunction): void; - afterEach(afterEachFunction: SpecFunction): void; - results(): NestedResults; - add(suiteOrSpec: SuiteOrSpec): void; - specs(): Spec[]; - suites(): Suite[]; - children(): any[]; - execute(onComplete?: () => void): void; - } - - interface XSuite { - execute(): void; - } - - interface Spy { - (...params: any[]): any; - - identity: string; - calls: any[]; - mostRecentCall: { args: any[]; }; - argsForCall: any[]; - wasCalled: boolean; - callCount: number; - - andReturn(value: any): Spy; - andCallThrough(): Spy; - andCallFake(fakeFunc: Function): Spy; - } - - interface Util { - inherit(childClass: Function, parentClass: Function): any; - formatException(e: any): any; - htmlEscape(str: string): string; - argsToArray(args: any): any; - extend(destination: any, source: any): any; - } - - interface JsApiReporter extends Reporter { - - started: boolean; - finished: boolean; - result: any; - messages: any; - - new (): any; - - suites(): Suite[]; - summarize_(suiteOrSpec: SuiteOrSpec): any; - results(): any; - resultsForSpec(specId: any): any; - log(str: any): any; - resultsForSpecs(specIds: any): any; - summarizeResult_(result: any): any; - } - - interface Jasmine { - Spec: Spec; - Clock: Clock; - util: Util; - } - - export var HtmlReporter: any; -} diff --git a/jasmine/v1/jasmine-tests.ts b/jasmine/v1/jasmine-tests.ts deleted file mode 100644 index 9177679f8a..0000000000 --- a/jasmine/v1/jasmine-tests.ts +++ /dev/null @@ -1,449 +0,0 @@ - - -describe("A suite", () => { - it("contains spec with an expectation", () => { - expect(true).toBe(true); - }); -}); - -describe("A suite is just a function", () => { - var a: boolean; - it("and so is a spec", () => { - a = true; - expect(a).toBe(true); - }); -}); - -describe("The 'toBe' matcher compares with ===", () => { - it("and has a positive case ", () => { - expect(true).toBe(true); - }); - it("and can have a negative case", () => { - expect(false).not.toBe(true); - }); -}); - -describe("Included matchers:", () => { - it("The 'toBe' matcher compares with ===", () => { - var a = 12; - var b = a; - expect(a).toBe(b); - expect(a).not.toBe(null); - }); - describe("The 'toEqual' matcher", () => { - it("works for simple literals and variables", () => { - var a = 12; - expect(a).toEqual(12); - }); - it("should work for objects", () => { - var foo = { - a: 12, - b: 34 - }; - var bar = { - a: 12, - b: 34 - }; - expect(foo).toEqual(bar); - }); - }); - - it("The 'toMatch' matcher is for regular expressions", () => { - var message = 'foo bar baz'; - expect(message).toMatch(/bar/); - expect(message).toMatch('bar'); - expect(message).not.toMatch(/quux/); - }); - - it("The 'toBeDefined' matcher compares against `undefined`", () => { - var a = { - foo: 'foo' - }; - expect(a.foo).toBeDefined(); - expect((a).bar).not.toBeDefined(); - }); - - it("The `toBeUndefined` matcher compares against `undefined`", () => { - var a = { - foo: 'foo' - }; - expect(a.foo).not.toBeUndefined(); - expect((a).bar).toBeUndefined(); - }); - - it("The 'toBeNull' matcher compares against null", () => { - var a: string = null; - var foo = 'foo'; - expect(null).toBeNull(); - expect(a).toBeNull(); - expect(foo).not.toBeNull(); - }); - - it("The 'toBeTruthy' matcher is for boolean casting testing", () => { - var a: string, foo = 'foo'; - expect(foo).toBeTruthy(); - expect(a).not.toBeTruthy(); - }); - - it("The 'toBeFalsy' matcher is for boolean casting testing", () => { - var a: string, foo = 'foo'; - expect(a).toBeFalsy(); - expect(foo).not.toBeFalsy(); - }); - - it("The 'toContain' matcher is for finding an item in an Array", () => { - var a = ['foo', 'bar', 'baz']; - expect(a).toContain('bar'); - expect(a).not.toContain('quux'); - }); - - it("The 'toBeLessThan' matcher is for mathematical comparisons", () => { - var pi = 3.1415926, e = 2.78; - expect(e).toBeLessThan(pi); - expect(pi).not.toBeLessThan(e); - }); - - it("The 'toBeGreaterThan' is for mathematical comparisons", () => { - var pi = 3.1415926, e = 2.78; - expect(pi).toBeGreaterThan(e); - expect(e).not.toBeGreaterThan(pi); - }); - - it("The 'toBeCloseTo' matcher is for precision math comparison", () => { - var pi = 3.1415926, e = 2.78; - expect(pi).not.toBeCloseTo(e, 0.1); - expect(pi).toBeCloseTo(e, 0); - }); - - it("The 'toThrow' matcher is for testing if a function throws an exception", () => { - var foo = () => { - return 1 + 2; - }; - var bar = () => { - //return a + 1; - }; - expect(foo).not.toThrow(); - expect(bar).toThrow(); - }); -}); - -describe("A spec", () => { - it("is just a function, so it can contain any code", () => { - var foo = 0; - foo += 1; - expect(foo).toEqual(1); - }); - - it("can have more than one expectation", () => { - var foo = 0; - foo += 1; - expect(foo).toEqual(1); - expect(true).toEqual(true); - }); -}); - -describe("A spec (with setup and tear-down)", () => { - var foo: number; - beforeEach(() => { - foo = 0; - foo += 1; - }); - afterEach(() => { - foo = 0; - }); - it("is just a function, so it can contain any code", () => { - expect(foo).toEqual(1); - }); - it("can have more than one expectation", () => { - expect(foo).toEqual(1); - expect(true).toEqual(true); - }); -}); - -describe("A spec", () => { - var foo: number; - beforeEach(() => { - foo = 0; - foo += 1; - }); - afterEach(() => { - foo = 0; - }); - it("is just a function, so it can contain any code", () => { - expect(foo).toEqual(1); - }); - it("can have more than one expectation", () => { - expect(foo).toEqual(1); - expect(true).toEqual(true); - }); - describe("nested inside a second describe", () => { - var bar: number; - beforeEach(() => { - bar = 1; - }); - it("can reference both scopes as needed ", () => { - expect(foo).toEqual(bar); - }); - }); -}); - -xdescribe("A spec", () => { - var foo: number; - beforeEach(() => { - foo = 0; - foo += 1; - }); - xit("is just a function, so it can contain any code", () => { - expect(foo).toEqual(1); - }); -}); - -describe("A spy", () => { - var foo: any, bar: any = null; - beforeEach(() => { - foo = { - setBar: function (value: any) { - bar = value; - } - }; - spyOn(foo, 'setBar'); - foo.setBar(123); - foo.setBar(456, 'another param'); - }); - it("tracks that the spy was called", () => { - expect(foo.setBar).toHaveBeenCalled(); - }); - it("tracks its number of calls", () => { - expect(foo.setBar.calls.length).toEqual(2); - }); - it("tracks all the arguments of its calls", () => { - expect(foo.setBar).toHaveBeenCalledWith(123); - expect(foo.setBar).toHaveBeenCalledWith(456, 'another param'); - }); - it("allows access to the most recent call", () => { - expect(foo.setBar.mostRecentCall.args[0]).toEqual(456); - }); - it("allows access to other calls", () => { - expect(foo.setBar.calls[0].args[0]).toEqual(123); - }); - it("stops all execution on a function", () => { - expect(bar).toBeNull(); - }); -}); - -describe("A spy, when configured to call through", () => { - var foo: any, bar: any, fetchedBar: any; - beforeEach(() => { - foo = { - setBar: function (value: any) { - bar = value; - }, - getBar: () => { - return bar; - } - }; - spyOn(foo, 'getBar').andCallThrough(); - foo.setBar(123); - fetchedBar = foo.getBar(); - }); - it("tracks that the spy was called", () => { - expect(foo.getBar).toHaveBeenCalled(); - }); - it("should not effect other functions", () => { - expect(bar).toEqual(123); - }); - it("when called returns the requested value", () => { - expect(fetchedBar).toEqual(123); - }); -}); - -describe("A spy, when faking a return value", () => { - var foo: any, bar: any, fetchedBar: any; - beforeEach(() => { - foo = { - setBar: function (value: any) { - bar = value; - }, - getBar: () => { - return bar; - } - }; - spyOn(foo, 'getBar').andReturn(745); - foo.setBar(123); - fetchedBar = foo.getBar(); - }); - it("tracks that the spy was called", () => { - expect(foo.getBar).toHaveBeenCalled(); - }); - it("should not effect other functions", () => { - expect(bar).toEqual(123); - }); - it("when called returns the requested value", () => { - expect(fetchedBar).toEqual(745); - }); -}); - -describe("A spy, when faking a return value", () => { - var foo: any, bar: any, fetchedBar: any; - beforeEach(() => { - foo = { - setBar: function (value: any) { - bar = value; - }, - getBar: () => { - return bar; - } - }; - spyOn(foo, 'getBar').andCallFake(() => { - return 1001; - }); - foo.setBar(123); - fetchedBar = foo.getBar(); - }); - it("tracks that the spy was called", () => { - expect(foo.getBar).toHaveBeenCalled(); - }); - it("should not effect other functions", () => { - expect(bar).toEqual(123); - }); - it("when called returns the requested value", () => { - expect(fetchedBar).toEqual(1001); - }); -}); - -describe("A spy, when created manually", () => { - var whatAmI: any; - - beforeEach(() => { - whatAmI = jasmine.createSpy('whatAmI'); - whatAmI("I", "am", "a", "spy"); - }); - it("is named, which helps in error reporting", () => { - expect(whatAmI.identity).toEqual('whatAmI') - }); - it("tracks that the spy was called", () => { - expect(whatAmI).toHaveBeenCalled(); - }); - it("tracks its number of calls", () => { - expect(whatAmI.calls.length).toEqual(1); - }); - it("tracks all the arguments of its calls", () => { - expect(whatAmI).toHaveBeenCalledWith("I", "am", "a", "spy"); - }); - it("allows access to the most recent call", () => { - expect(whatAmI.mostRecentCall.args[0]).toEqual("I"); - }); -}); - -describe("Multiple spies, when created manually", () => { - var tape: any; - beforeEach(() => { - tape = jasmine.createSpyObj('tape', ['play', 'pause', 'stop', 'rewind']); - tape.play(); - tape.pause(); - tape.rewind(0); - }); - it("creates spies for each requested function", () => { - expect(tape.play).toBeDefined(); - expect(tape.pause).toBeDefined(); - expect(tape.stop).toBeDefined(); - expect(tape.rewind).toBeDefined(); - }); - it("tracks that the spies were called", () => { - expect(tape.play).toHaveBeenCalled(); - expect(tape.pause).toHaveBeenCalled(); - expect(tape.rewind).toHaveBeenCalled(); - expect(tape.stop).not.toHaveBeenCalled(); - }); - it("tracks all the arguments of its calls", () => { - expect(tape.rewind).toHaveBeenCalledWith(0); - }); -}); - -describe("jasmine.any", () => { - it("matches any value", () => { - expect({}).toEqual(jasmine.any(Object)); - expect(12).toEqual(jasmine.any(Number)); - }); - describe("when used with a spy", () => { - it("is useful for comparing arguments", () => { - var foo = jasmine.createSpy('foo'); - foo(12, () => { - return true - }); - expect(foo).toHaveBeenCalledWith(jasmine.any(Number), jasmine.any(Function)); - }); - }); -}); - -describe("Manually ticking the Jasmine Mock Clock", () => { - var timerCallback: any; - beforeEach(() => { - timerCallback = jasmine.createSpy('timerCallback'); - jasmine.Clock.useMock(); - }); - it("causes a timeout to be called synchronously", () => { - setTimeout(() => { - timerCallback(); - }, 100); - expect(timerCallback).not.toHaveBeenCalled(); - jasmine.Clock.tick(101); - expect(timerCallback).toHaveBeenCalled(); - }); - - it("causes an interval to be called synchronously", () => { - setInterval(() => { - timerCallback(); - }, 100); - expect(timerCallback).not.toHaveBeenCalled(); - jasmine.Clock.tick(101); - expect(timerCallback.callCount).toEqual(1); - jasmine.Clock.tick(50); - expect(timerCallback.callCount).toEqual(1); - jasmine.Clock.tick(50); - expect(timerCallback.callCount).toEqual(2); - }); -}); - -describe("Asynchronous specs", () => { - var value: number, flag: any; - it("should support async execution of test preparation and exepectations", () => { - runs(() => { - flag = false; - value = 0; - setTimeout(() => { - flag = true; - }, 500); - }); - waitsFor(() => { - value++; - return flag; - }, "The Value should be incremented", 750); - runs(() => { - expect(value).toBeGreaterThan(0); - }); - }); -}); - -(() => { - var jasmineEnv = jasmine.getEnv(); - jasmineEnv.updateInterval = 250; - var htmlReporter = new jasmine.HtmlReporter(); - jasmineEnv.addReporter(htmlReporter); - jasmineEnv.specFilter = function (spec) { - return htmlReporter.specFilter(spec); - }; - var currentWindowOnload = (arg: any) => window.onload(arg); - window.onload = () => { - if (currentWindowOnload) { - currentWindowOnload(null); - } - - (document.querySelector('.version')).innerHTML = jasmineEnv.versionString(); - execJasmine(); - }; - - function execJasmine() { - jasmineEnv.execute(); - } -})(); \ No newline at end of file diff --git a/jasminewd2/index.d.ts b/jasminewd2/index.d.ts deleted file mode 100644 index 9d8ecde76e..0000000000 --- a/jasminewd2/index.d.ts +++ /dev/null @@ -1,74 +0,0 @@ -// Type definitions for jasminewd2 2.0 -// Project: https://github.com/angular/jasminewd -// Definitions by: Sammy Jelin -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 - -/// - -declare function it(expectation: string, assertion?: () => Promise, timeout?: number): void; -declare function fit(expectation: string, assertion?: () => Promise, timeout?: number): void; -declare function xit(expectation: string, assertion?: () => Promise, timeout?: number): void; -declare function beforeEach(action: () => Promise, timeout?: number): void; -declare function afterEach(action: () => Promise, timeout?: number): void; -declare function beforeAll(action: () => Promise, timeout?: number): void; -declare function afterAll(action: () => Promise, timeout?: number): void; - -declare namespace jasmine { - // The global `Promise` type is too strict and kinda wrong - interface Promise { - then(onFulfill?: (value: T) => U | Promise, onReject?: (error: any) => U | Promise): Promise; - } - - interface Matchers { - toBe(expected: any, expectationFailOutput?: any): Promise; - toEqual(expected: any, expectationFailOutput?: any): Promise; - toMatch(expected: string | RegExp | Promise, expectationFailOutput?: any): Promise; - toBeDefined(expectationFailOutput?: any): Promise; - toBeUndefined(expectationFailOutput?: any): Promise; - toBeNull(expectationFailOutput?: any): Promise; - toBeNaN(): Promise; - toBeTruthy(expectationFailOutput?: any): Promise; - toBeFalsy(expectationFailOutput?: any): Promise; - toHaveBeenCalled(): Promise; - toHaveBeenCalledWith(...params: any[]): Promise; - toHaveBeenCalledTimes(expected: number | Promise): Promise; - toContain(expected: any, expectationFailOutput?: any): Promise; - toBeLessThan(expected: number | Promise, expectationFailOutput?: any): Promise; - toBeLessThanOrEqual(expected: number | Promise, expectationFailOutput?: any): Promise; - toBeGreaterThan(expected: number | Promise, expectationFailOutput?: any): Promise; - toBeGreaterThanOrEqual(expected: number | Promise, expectationFailOutput?: any): Promise; - toBeCloseTo(expected: number | Promise, precision?: any, expectationFailOutput?: any): Promise; - toThrow(expected?: any): Promise; - toThrowError(message?: string | RegExp | Promise): Promise; - toThrowError(expected?: new (...args: any[]) => Error | Promise Error>, message?: string | RegExp | Promise): Promise; - } - - function addMatchers(matchers: AsyncCustomMatcherFactories): void; - - interface Env { - addMatchers(matchers: AsyncCustomMatcherFactories): void; - } - - interface Spec { - addMatchers(matchers: AsyncCustomMatcherFactories): void; - } - - interface AsyncCustomMatcherFactories { - [index: string]: AsyncCustomMatcherFactory; - } - - interface AsyncCustomMatcherFactory { - (util: MatchersUtil, customEqualityTesters: CustomEqualityTester[]): AsyncCustomMatcher; - } - - interface AsyncCustomMatcher { - compare(actual: T, expected: T): AsyncCustomMatcherResult; - compare(actual: any, expected: any): AsyncCustomMatcherResult; - } - - interface AsyncCustomMatcherResult { - pass: boolean | Promise; - message?: string; - } -} diff --git a/jasminewd2/tslint.json b/jasminewd2/tslint.json deleted file mode 100644 index e689d36e71..0000000000 --- a/jasminewd2/tslint.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "../tslint.json", - "rules": { - "callable-types": false, - "prefer-const": false, - "void-return": false - } -} diff --git a/jenkins/index.d.ts b/jenkins/index.d.ts deleted file mode 100644 index 5db91893a6..0000000000 --- a/jenkins/index.d.ts +++ /dev/null @@ -1,143 +0,0 @@ -// Type definitions for jenkins 0.20 -// Project: https://github.com/silas/node-jenkins -// Definitions by: rhysd -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -declare namespace create { - interface JenkinsAPI { - info(callback: (err: Error, data: any) => void): void; - build: { - get(name: string, n: number, callback: (err: Error, data: any) => void): void; - log(name: string, callback: (err: Error, data: any) => void): void; - log(name: string, n: number, callback: (err: Error, data: any) => void): void; - log(name: string, n: number, start: number, callback: (err: Error, data: any) => void): void; - log(name: string, n: number, start: number, type: 'text' | 'html', callback: (err: Error, data: any) => void): void; - log(name: string, n: number, start: number, type: 'text' | 'html', meta: boolean, callback: (err: Error, data: any) => void): void; - logStream(name: string, n: number, type?: 'text' | 'html', delay?: number): NodeJS.ReadableStream; - stop(name: string, n: number, callback: (err: Error) => void): void; - }; - job: { - build(name: string | JobBuildOptions, callback: (err: Error, data: any) => void): void; - build(name: string, parameters: any, callback: (err: Error, data: any) => void): void; - build(name: string, parameters: any, token: string, callback: (err: Error, data: any) => void): void; - config(name: string, callback: (err: Error, data: any) => void): void; - config(name: string, xml: string, callback: (err: Error, data: any) => void): void; - copy(name: string, from: string, callback: (err: Error) => void): void; - create(name: string, xml: string, callback: (err: Error) => void): void; - destroy(name: string, callback: (err: Error) => void): void; - disable(name: string, callback: (err: Error) => void): void; - enable(name: string, callback: (err: Error) => void): void; - exists(name: string, callback: (err: Error, exists: boolean) => void): void; - get(name: string, callback: (err: Error, data: any) => void): void; - list(callback: (err: Error, data: any) => void): void; - }; - node: { - config(name: string, callback: (err: Error, data: any) => void): void; - create(name: string, callback: (err: Error) => void): void; - destroy(name: string, callback: (err: Error) => void): void; - disconnect(name: string, callback: (err: Error) => void): void; - disconnect(name: string, message: string, callback: (err: Error) => void): void; - disable(name: string, callback: (err: Error) => void): void; - disable(name: string, message: string, callback: (err: Error) => void): void; - enable(name: string, callback: (err: Error) => void): void; - exists(name: string, callback: (err: Error, data: boolean) => void): void; - get(name: string, callback: (err: Error, data: any) => void): void; - list(callback: (err: Error, data: any) => void): void; - list(full: boolean, callback: (err: Error, data: any) => void): void; - }; - queue: { - list(callback: (err: Error, data: any) => void): void; - item(n: number, callback: (err: Error, data: any) => void): void; - cancel(n: number, callback: (err: Error) => void): void; - }; - view: { - config(name: string, callback: (err: Error, data: any) => void): void; - config(name: string, xml: string, callback: (err: Error, data: any) => void): void; - create(name: string, type: 'list' | 'my', callback: (err: Error) => void): void; - destroy(name: string, callback: (err: Error) => void): void; - exists(name: string, callback: (err: Error, exists: boolean) => void): void; - get(name: string, callback: (err: Error, data: any) => void): void; - list(callback: (err: Error, data: any) => void): void; - add(name: string, job: string, callback: (err: Error) => void): void; - remove(name: string, job: string, callback: (err: Error) => void): void; - }; - } - - export interface JenkinsPromisifiedAPI { - info(): Promise; - build: { - get(name: string, n: number): Promise; - log(name: string, n: number, start?: number, type?: 'text' | 'html', meta?: boolean): Promise; - logStream(name: string, n: number, type?: 'text' | 'html', delay?: number): Promise; - stop(name: string, n: number): Promise; - }; - job: { - build(name: string, parameters?: any, token?: string): Promise; - build(opts: JobBuildOptions): Promise; - config(name: string, xml?: string): Promise; - copy(name: string, from: string): Promise; - create(name: string, xml: string): Promise; - destroy(name: string): Promise; - disable(name: string): Promise; - enable(name: string): Promise; - exists(name: string): Promise; - get(name: string): Promise; - list(): Promise; - }; - node: { - config(name: string): Promise; - create(name: string): Promise; - destroy(name: string): Promise; - disconnect(name: string, message?: string): Promise; - disable(name: string, message?: string): Promise; - enable(name: string): Promise; - exists(name: string): Promise; - get(name: string): Promise; - list(full?: boolean): Promise; - }; - queue: { - list(): Promise; - item(n: number): Promise; - cancel(n: number): Promise; - }; - view: { - config(name: string, xml?: string): Promise; - create(name: string, type: 'list' | 'my'): Promise; - destroy(name: string): Promise; - exists(name: string): Promise; - get(name: string): Promise; - list(): Promise; - add(name: string, job: string): Promise; - remove(name: string, job: string): Promise; - }; - } - - interface JobBuildOptions { - name: string; - parameters?: any; - token?: string; - } - - interface JenkinsClientOptions { - baseUrl?: string; - crumbIssuer?: boolean; - headers?: any; - promisify?: boolean | ((...args: any[]) => any); - } -} - -declare function create(opts?: { - baseUrl?: string; - crumbIssuer?: boolean; - headers?: any; - promisify?: false; - }): create.JenkinsAPI; -declare function create(opts: { - baseUrl?: string; - crumbIssuer?: boolean; - headers?: any; - promisify: true; - }): create.JenkinsPromisifiedAPI; -export = create; diff --git a/jenkins/tslint.json b/jenkins/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/jenkins/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/jest/index.d.ts b/jest/index.d.ts deleted file mode 100644 index 4129dcc846..0000000000 --- a/jest/index.d.ts +++ /dev/null @@ -1,412 +0,0 @@ -// Type definitions for Jest 19.2.0 -// Project: http://facebook.github.io/jest/ -// Definitions by: Asana , Ivo Stratev , jwbay , Alexey Svetliakov -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 - -declare var beforeAll: jest.Lifecycle; -declare var beforeEach: jest.Lifecycle; -declare var afterAll: jest.Lifecycle; -declare var afterEach: jest.Lifecycle; -declare var describe: jest.Describe; -declare var fdescribe: jest.Describe; -declare var xdescribe: jest.Describe; -declare var it: jest.It; -declare var fit: jest.It; -declare var xit: jest.It; -declare var test: jest.It; -declare var xtest: jest.It; - -declare const expect: jest.Expect; - -interface NodeRequire { - /** Returns the actual module instead of a mock, bypassing all checks on whether the module should receive a mock implementation or not. */ - requireActual(moduleName: string): any; - /** Returns a mock module instead of the actual module, bypassing all checks on whether the module should be required normally or not. */ - requireMock(moduleName: string): any; -} - -declare namespace jest { - /** Provides a way to add Jasmine-compatible matchers into your Jest context. */ - function addMatchers(matchers: jasmine.CustomMatcherFactories): typeof jest; - /** Disables automatic mocking in the module loader. */ - function autoMockOff(): typeof jest; - /** Enables automatic mocking in the module loader. */ - function autoMockOn(): typeof jest; - /** - * @deprecated use resetAllMocks instead - */ - function clearAllMocks(): typeof jest; - /** Clears the mock.calls and mock.instances properties of all mocks. Equivalent to calling .mockClear() on every mocked function. */ - function resetAllMocks(): typeof jest; - /** Removes any pending timers from the timer system. If any timers have been scheduled, they will be cleared and will never have the opportunity to execute in the future. */ - function clearAllTimers(): typeof jest; - /** Indicates that the module system should never return a mocked version of the specified module, including all of the specificied module's dependencies. */ - function deepUnmock(moduleName: string): typeof jest; - /** Disables automatic mocking in the module loader. */ - function disableAutomock(): typeof jest; - /** Mocks a module with an auto-mocked version when it is being required. */ - function doMock(moduleName: string): typeof jest; - /** Indicates that the module system should never return a mocked version of the specified module from require() (e.g. that it should always return the real module). */ - function dontMock(moduleName: string): typeof jest; - /** Enables automatic mocking in the module loader. */ - function enableAutomock(): typeof jest; - /** Creates a mock function. Optionally takes a mock implementation. */ - function fn(implementation: (...args: any[]) => T): Mock; - function fn(implementation?: Function): Mock; - /** Use the automatic mocking system to generate a mocked version of the given module. */ - function genMockFromModule(moduleName: string): T; - /** Returns whether the given function is a mock function. */ - function isMockFunction(fn: any): fn is Mock; - /** Mocks a module with an auto-mocked version when it is being required. */ - function mock(moduleName: string, factory?: any, options?: MockOptions): typeof jest; - /** Resets the module registry - the cache of all required modules. This is useful to isolate modules where local state might conflict between tests. */ - function resetModuleRegistry(): typeof jest; - /** Resets the module registry - the cache of all required modules. This is useful to isolate modules where local state might conflict between tests. */ - function resetModules(): typeof jest; - /** Exhausts tasks queued by setImmediate(). */ - function runAllImmediates(): typeof jest; - /** Exhausts the micro-task queue (usually interfaced in node via process.nextTick). */ - function runAllTicks(): typeof jest; - /** Exhausts the macro-task queue (i.e., all tasks queued by setTimeout() and setInterval()). */ - function runAllTimers(): typeof jest; - /** Executes only the macro-tasks that are currently pending (i.e., only the tasks that have been queued by setTimeout() or setInterval() up to this point). - * If any of the currently pending macro-tasks schedule new macro-tasks, those new tasks will not be executed by this call. */ - function runOnlyPendingTimers(): typeof jest; - /** Executes only the macro task queue (i.e. all tasks queued by setTimeout() or setInterval() and setImmediate()). */ - function runTimersToTime(msToRun: number): typeof jest; - /** Explicitly supplies the mock object that the module system should return for the specified module. */ - function setMock(moduleName: string, moduleExports: T): typeof jest; - /** Indicates that the module system should never return a mocked version of the specified module from require() (e.g. that it should always return the real module). */ - function unmock(moduleName: string): typeof jest; - /** Instructs Jest to use fake versions of the standard timer functions. */ - function useFakeTimers(): typeof jest; - /** Instructs Jest to use the real versions of the standard timer functions. */ - function useRealTimers(): typeof jest; - - interface MockOptions { - virtual?: boolean; - } - - interface EmptyFunction { - (): void; - } - - interface DoneCallback { - (...args: any[]): any - fail(error?: string | { message: string }): any; - } - - interface ProvidesCallback { - (cb: DoneCallback): any; - } - - interface Lifecycle { - (fn: ProvidesCallback): any; - } - - /** Creates a test closure */ - interface It { - /** - * Creates a test closure. - * - * @param {string} name The name of your test - * @param {fn?} ProvidesCallback The function for your test - */ - (name: string, fn?: ProvidesCallback): void; - /** Only runs this test in the current file. */ - only: It; - skip: It; - concurrent: It; - } - - interface Describe { - (name: string, fn: EmptyFunction): void - only: Describe; - skip: Describe; - } - - interface MatcherUtils { - readonly isNot: boolean; - utils: { - readonly EXPECTED_COLOR: string; - readonly RECEIVED_COLOR: string; - ensureActualIsNumber(actual: any, matcherName?: string): void; - ensureExpectedIsNumber(actual: any, matcherName?: string): void; - ensureNoExpected(actual: any, matcherName?: string): void; - ensureNumbers(actual: any, expected: any, matcherName?: string): void; - /** get the type of a value with handling of edge cases like `typeof []` and `typeof null` */ - getType(value: any): string; - matcherHint(matcherName: string, received?: string, expected?: string, options?: { secondArgument?: string, isDirectExpectCall?: boolean }): string; - pluralize(word: string, count: number): string; - printExpected(value: any): string; - printReceived(value: any): string; - printWithType(name: string, received: any, print: (value: any) => string): string; - stringify(object: {}, maxDepth?: number): string; - } - } - - interface ExpectExtendMap { - [key: string]: (this: MatcherUtils, received: any, actual: any) => { message: () => string, pass: boolean }; - } - - /** The `expect` function is used every time you want to test a value. You will rarely call `expect` by itself. */ - interface Expect { - /** - * The `expect` function is used every time you want to test a value. You will rarely call `expect` by itself. - * - * @param {any} actual The value to apply matchers against. - */ - (actual: any): Matchers; - anything(): void; - /** Matches anything that was created with the given constructor. You can use it inside `toEqual` or `toBeCalledWith` instead of a literal value. */ - any(classType: any): void; - /** Matches any array made up entirely of elements in the provided array. You can use it inside `toEqual` or `toBeCalledWith` instead of a literal value. */ - arrayContaining(arr: any[]): void; - /** Verifies that a certain number of assertions are called during a test. This is often useful when testing asynchronous code, in order to make sure that assertions in a callback actually got called. */ - assertions(num: number): void; - /** You can use `expect.extend` to add your own matchers to Jest. */ - extend(obj: ExpectExtendMap): void; - /** Matches any object that recursively matches the provided keys. This is often handy in conjunction with other asymmetric matchers. */ - objectContaining(obj: {}): void; - /** Matches any string that contains the exact provided string */ - stringMatching(str: string | RegExp): void; - } - - interface Matchers { - /** If you know how to test something, `.not` lets you test its opposite. */ - not: Matchers; - lastCalledWith(...args: any[]): void; - /** Checks that a value is what you expect. It uses `===` to check strict equality. Don't use `toBe` with floating-point numbers. */ - toBe(expected: any): void; - /** Ensures that a mock function is called. */ - toBeCalled(): void; - /** Ensure that a mock function is called with specific arguments. */ - toBeCalledWith(...args: any[]): void; - /** Using exact equality with floating point numbers is a bad idea. Rounding means that intuitive things fail. */ - toBeCloseTo(expected: number, delta?: number): void; - /** Ensure that a variable is not undefined. */ - toBeDefined(): void; - /** When you don't care what a value is, you just want to ensure a value is false in a boolean context. */ - toBeFalsy(): void; - /** For comparing floating point numbers. */ - toBeGreaterThan(expected: number): void; - /** For comparing floating point numbers. */ - toBeGreaterThanOrEqual(expected: number): void; - /** Ensure that an object is an instance of a class. This matcher uses `instanceof` underneath. */ - toBeInstanceOf(expected: any): void - /** For comparing floating point numbers. */ - toBeLessThan(expected: number): void; - /** For comparing floating point numbers. */ - toBeLessThanOrEqual(expected: number): void; - /** This is the same as `.toBe(null)` but the error messages are a bit nicer. So use `.toBeNull()` when you want to check that something is null. */ - toBeNull(): void; - /** Use when you don't care what a value is, you just want to ensure a value is true in a boolean context. In JavaScript, there are six falsy values: `false`, `0`, `''`, `null`, `undefined`, and `NaN`. Everything else is truthy. */ - toBeTruthy(): void; - /** Used to check that a variable is undefined. */ - toBeUndefined(): void; - /** Used when you want to check that an item is in a list. For testing the items in the list, this uses `===`, a strict equality check. */ - toContain(expected: any): void; - /** Used when you want to check that an item is in a list. For testing the items in the list, this matcher recursively checks the equality of all fields, rather than checking for object identity. */ - toContainEqual(expected: any): void; - /** Used when you want to check that two objects have the same value. This matcher recursively checks the equality of all fields, rather than checking for object identity. */ - toEqual(expected: any): void; - /** Ensures that a mock function is called. */ - toHaveBeenCalled(): boolean; - /** Ensures that a mock function is called an exact number of times. */ - toHaveBeenCalledTimes(expected: number): boolean; - /** Ensure that a mock function is called with specific arguments. */ - toHaveBeenCalledWith(...params: any[]): boolean; - /** If you have a mock function, you can use `.toHaveBeenLastCalledWith` to test what arguments it was last called with. */ - toHaveBeenLastCalledWith(...params: any[]): boolean; - /** Used to check that an object has a `.length` property and it is set to a certain numeric value. */ - toHaveLength(expected: number): void; - toHaveProperty(propertyPath: string, value?: any): void; - /** Check that a string matches a regular expression. */ - toMatch(expected: string | RegExp): void; - /** Used to check that a JavaScript object matches a subset of the properties of an objec */ - toMatchObject(expected: {}): void; - /** This ensures that a value matches the most recent snapshot. Check out [the Snapshot Testing guide](http://facebook.github.io/jest/docs/snapshot-testing.html) for more information. */ - toMatchSnapshot(snapshotName?: string): void; - /** Used to test that a function throws when it is called. */ - toThrow(error?: string | Constructable | RegExp): void; - /** If you want to test that a specific error is thrown inside a function. */ - toThrowError(error?: string | Constructable | RegExp): void; - /** Used to test that a function throws a error matching the most recent snapshot when it is called. */ - toThrowErrorMatchingSnapshot(): void; - } - - interface Constructable { - new (...args: any[]): any - } - - interface Mock extends Function, MockInstance { - new (): T; - (...args: any[]): any; - } - - /** - * Wrap module with mock definitions - * @example - * jest.mock("../api"); - * import { Api } from "../api"; - * - * const myApi: jest.Mocked = new Api() as any; - * myApi.myApiMethod.mockImplementation(() => "test"); - */ - type Mocked = { - [P in keyof T]: T[P] & MockInstance; - } & T; - - interface MockInstance { - mock: MockContext; - mockClear(): void; - mockReset(): void; - mockImplementation(fn: Function): Mock; - mockImplementationOnce(fn: Function): Mock; - mockReturnThis(): Mock; - mockReturnValue(value: any): Mock; - mockReturnValueOnce(value: any): Mock; - } - - interface MockContext { - calls: any[][]; - instances: T[]; - } -} - -//Jest ships with a copy of Jasmine. They monkey-patch its APIs and divergence/deprecation are expected. -//Relevant parts of Jasmine's API are below so they can be changed and removed over time. -//This file can't reference jasmine.d.ts since the globals aren't compatible. - -declare function spyOn(object: any, method: string): jasmine.Spy; -/** If you call the function pending anywhere in the spec body, no matter the expectations, the spec will be marked pending. */ -declare function pending(reason?: string): void; -/** Fails a test when called within one. */ -declare function fail(error?: any): void; -declare namespace jasmine { - var clock: () => Clock; - function any(aclass: any): Any; - function anything(): Any; - function arrayContaining(sample: any[]): ArrayContaining; - function objectContaining(sample: any): ObjectContaining; - function createSpy(name: string, originalFn?: Function): Spy; - function createSpyObj(baseName: string, methodNames: any[]): any; - function createSpyObj(baseName: string, methodNames: any[]): T; - function pp(value: any): string; - function addCustomEqualityTester(equalityTester: CustomEqualityTester): void; - function addMatchers(matchers: CustomMatcherFactories): void; - function stringMatching(value: string | RegExp): Any; - - interface Clock { - install(): void; - uninstall(): void; - /** Calls to any registered callback are triggered when the clock is ticked forward via the jasmine.clock().tick function, which takes a number of milliseconds. */ - tick(ms: number): void; - mockDate(date?: Date): void; - } - - interface Any { - new (expectedClass: any): any; - jasmineMatches(other: any): boolean; - jasmineToString(): string; - } - - interface ArrayContaining { - new (sample: any[]): any; - asymmetricMatch(other: any): boolean; - jasmineToString(): string; - } - - interface ObjectContaining { - new (sample: any): any; - jasmineMatches(other: any, mismatchKeys: any[], mismatchValues: any[]): boolean; - jasmineToString(): string; - } - - interface Spy { - (...params: any[]): any; - identity: string; - and: SpyAnd; - calls: Calls; - mostRecentCall: { args: any[]; }; - argsForCall: any[]; - wasCalled: boolean; - } - - interface SpyAnd { - /** By chaining the spy with and.callThrough, the spy will still track all calls to it but in addition it will delegate to the actual implementation. */ - callThrough(): Spy; - /** By chaining the spy with and.returnValue, all calls to the function will return a specific value. */ - returnValue(val: any): Spy; - /** By chaining the spy with and.returnValues, all calls to the function will return specific values in order until it reaches the end of the return values list. */ - returnValues(...values: any[]): Spy; - /** By chaining the spy with and.callFake, all calls to the spy will delegate to the supplied function. */ - callFake(fn: Function): Spy; - /** By chaining the spy with and.throwError, all calls to the spy will throw the specified value. */ - throwError(msg: string): Spy; - /** When a calling strategy is used for a spy, the original stubbing behavior can be returned at any time with and.stub. */ - stub(): Spy; - } - - interface Calls { - /** By chaining the spy with calls.any(), will return false if the spy has not been called at all, and then true once at least one call happens. */ - any(): boolean; - /** By chaining the spy with calls.count(), will return the number of times the spy was called */ - count(): number; - /** By chaining the spy with calls.argsFor(), will return the arguments passed to call number index */ - argsFor(index: number): any[]; - /** By chaining the spy with calls.allArgs(), will return the arguments to all calls */ - allArgs(): any[]; - /** By chaining the spy with calls.all(), will return the context (the this) and arguments passed all calls */ - all(): CallInfo[]; - /** By chaining the spy with calls.mostRecent(), will return the context (the this) and arguments for the most recent call */ - mostRecent(): CallInfo; - /** By chaining the spy with calls.first(), will return the context (the this) and arguments for the first call */ - first(): CallInfo; - /** By chaining the spy with calls.reset(), will clears all tracking for a spy */ - reset(): void; - } - - interface CallInfo { - /** The context (the this) for the call */ - object: any; - /** All arguments passed to the call */ - args: any[]; - /** The return value of the call */ - returnValue: any; - } - - interface CustomMatcherFactories { - [index: string]: CustomMatcherFactory; - } - - interface CustomMatcherFactory { - (util: MatchersUtil, customEqualityTesters: Array): CustomMatcher; - } - - interface MatchersUtil { - equals(a: any, b: any, customTesters?: Array): boolean; - contains(haystack: ArrayLike | string, needle: any, customTesters?: Array): boolean; - buildFailureMessage(matcherName: string, isNot: boolean, actual: any, ...expected: Array): string; - } - - interface CustomEqualityTester { - (first: any, second: any): boolean; - } - - interface CustomMatcher { - compare(actual: T, expected: T): CustomMatcherResult; - compare(actual: any, expected: any): CustomMatcherResult; - } - - interface CustomMatcherResult { - pass: boolean; - message: string | (() => string); - } - - interface ArrayLike { - length: number; - [n: number]: T; - } -} diff --git a/jfs/index.d.ts b/jfs/index.d.ts deleted file mode 100644 index ba6edb26bc..0000000000 --- a/jfs/index.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -// Type definitions for jfs 0.2 -// Project: http://github.com/flosse/json-file-store -// Definitions by: Tomasz Łaziuk -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 - -declare const JsonFileStore: JsonFileStore.JsonFileStore; - -declare namespace JsonFileStore { - export interface Storable { - [key: string]: any; - } - - export interface Options { - type?: 'single' | 'memory'; - pretty?: boolean; - saveId?: boolean | string; - } - - export interface JsonFileStore { - new (name?: string, opts?: Options): Instance; - } - - export interface Instance { - save(id: K, o: V, cb?: (err?: Error, id?: K) => void): void; - save(o: V, cb?: (err?: Error, id?: string) => void): void; - - saveSync(id: K, o: V): void; - saveSync(o: V): void; - - get(id: K, cb?: (err?: Error, o?: V) => void): void; - - getSync(id: K): V | Error; - - delete(id: K, cb?: (err?: Error) => void): void; - - deleteSync(id: K): Error | void; - - all(cb: (err?: Error, all?: T) => void): void; - - allSync(): T; - } -} - -export = JsonFileStore; diff --git a/jfs/tslint.json b/jfs/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/jfs/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/jimp/index.d.ts b/jimp/index.d.ts deleted file mode 100644 index b8988e2ad4..0000000000 --- a/jimp/index.d.ts +++ /dev/null @@ -1,207 +0,0 @@ -// Type definitions for jimp 0.2 -// Project: https://github.com/oliver-moran/jimp#readme -// Definitions by: Jack Works -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -declare namespace jimp { - type Callback = (this: JimpImage, err: Error, data: T) => void; - type ResizeMode = string; - type PresetFont = string; - type FileMINE = string; - type AlignMode = number; - type FilterType = number; - - // Used in font info provided by parse-bmfont-ascii - type FontBoolean = 0 | 1; - interface FontChar { - id: number; - x: number; - y: number; - weight: number; - height: number; - xoffset: number; - yoffset: number; - xadvance: number; - page: number; - chnl: number; - } - type Font = { - common: {lineHeight: number, base: number, scaleW: number, scaleH: number, pages: number, packed: number}, - info: { - face: string, - size: number, - bold: FontBoolean, - italic: FontBoolean, - charset: string, - unicode: FontBoolean, - stretchH: number, - smooth: FontBoolean, - aa: number, - padding: [number, number, number, number], - spacing: [number, number] - }, - kernings: any, - pages: JIMP[], - chars: { - [char: number]: FontChar, - [char: string]: FontChar - } - } | PresetFont; - - - class JimpImage { - constructor(width: number, height: number, callback?: Callback); - constructor(width: number, height: number, initialColor: number, callback?: Callback); - - /* Get/set meta data */ - hash(n?: number): string; - - getExtension(): string; - getMIME(): FileMINE; - - getPixelColor(x: number, y: number): number; - setPixelColor(hex: number, x: number, y: number): void; - - /* Save */ - write(path: string, callback?: Callback): void; - getBase64(mine: FileMINE, callback?: Callback): void; - getBuffer(mine: FileMINE, callback?: Callback): void; - - /* Parameter */ - quality(n: number): JimpImage; - rgba(is: boolean): JimpImage; - filterType(type: FilterType): JimpImage; - deflateLevel(level: number): JimpImage; - - /* Operation */ - clone(): JimpImage; - print(font: Font, x: number, y: number, text: string, width?: number): JimpImage; - - /* Adv */ - color( - params: Array<{ - apply: 'lighten' | 'brighten' | 'darken' | 'desaturate' | 'saturate' | 'greyscale' | 'spin' | 'hue' | 'tint' | 'shade' | 'red' | 'green' | 'blue', - params: [number] - } | { - apply: 'mix', - params: [string, number] - } | { - apply: 'xor', - params: [string] - }>): JimpImage; - - convolution(matrix: number[][]): JimpImage; - scan(x: number, y: number, width: number, height: number, callback?: (this: JimpImage, x: number, y: number, idx: number) => void): JimpImage; - - /* Low level data */ - bitmap: {data: Buffer, readonly width: number, readonly height: number}; - readonly _originalMime: string; - - /* Resize */ - contain(width: number, height: number, callback?: Callback): JimpImage; - contain(width: number, height: number, alignBitsOrMode?: number | ResizeMode, callback?: Callback): JimpImage; - contain(width: number, height: number, alignBits: number, mode?: ResizeMode, callback?: Callback): JimpImage; - - cover(width: number, height: number, callback?: Callback): JimpImage; - cover(width: number, height: number, alignBitsOrmode?: ResizeMode | number, callback?: Callback): JimpImage; - cover(width: number, height: number, alignBits: number, mode?: ResizeMode, callback?: Callback): JimpImage; - - resize(width: number, height: number, callback?: Callback): JimpImage; - resize(width: number, height: number, mode?: ResizeMode, callback?: Callback): JimpImage; - - scale(factor: any, callback?: Callback): JimpImage; - scale(factor: any, mode?: ResizeMode, callback?: Callback): JimpImage; - - scaleToFit(width: number, height: number, callback?: Callback): JimpImage; - scaleToFit(width: number, height: number, mode?: ResizeMode, callback?: Callback): JimpImage; - - /* Crop */ - autocrop(callback?: Callback): JimpImage; - crop(x: number, y: number, width: number, height: number, callback?: Callback): JimpImage; - - /* Composing */ - blit(scr: string, x: number, y: number, callback?: Callback): JimpImage; - blit(scr: string, x: number, y: number, srcx?: number, srcy?: number, callback?: Callback): JimpImage; - blit(scr: string, x: number, y: number, srcx?: number, srcy?: number, srcw?: number, srch?: number, callback?: Callback): JimpImage; - - composite(scr: string, x: number, y: number, callback?: Callback): JimpImage; - mask(scr: string, x: number, y: number, callback?: Callback): JimpImage; - - /* Flip and rotate */ - flip(horz: any, vert: any, callback?: Callback): JimpImage; - mirror(horz: any, vert: any, callback?: Callback): JimpImage; - rotate(deg: number, callback?: Callback): JimpImage; - rotate(deg: number, mode?: any, callback?: Callback): JimpImage; - - /* Colour */ - brightness(val: number, callback?: Callback): JimpImage; - contrast(val: number, callback?: Callback): JimpImage; - dither565(callback?: Callback): JimpImage; - greyscale(callback?: Callback): JimpImage; - invert(callback?: Callback): JimpImage; - normalize(callback?: Callback): JimpImage; - - /* Alpha channel */ - fade(val: number, callback?: Callback): JimpImage; - opacity(val: number, callback?: Callback): JimpImage; - opaque(callback?: Callback): JimpImage; - background(hex: number, callback?: Callback): JimpImage; - - /* Blurs */ - gaussian(pixel: number, callback?: Callback): JimpImage; - blur(pixel: number, callback?: Callback): JimpImage; - - /* Effects */ - posterize(level: number, callback?: Callback): JimpImage; - sepia(callback?: Callback): JimpImage; - } - class JIMP extends JimpImage { - static read(path: string | Buffer, callback?: Callback): Promise; - static loadFont(path: string | PresetFont, callback?: Callback): Promise; - static rgbaToInt(r: number, g: number, b: number, alpha: number): number; - static intToRGBA(hex: number): {r: number, g: number, b: number, a: number}; - static distance(image: JimpImage, image2: JimpImage): number; - static diff(image1: JimpImage, image2: JimpImage, threshold?: number): {image: JimpImage, percent: number}; - static deflateStrategy(deflate: number): void; - - static readonly RESIZE_NEAREST_NEIGHBOR: ResizeMode; - static readonly RESIZE_BILINEAR: ResizeMode; - static readonly RESIZE_BICUBIC: ResizeMode; - static readonly RESIZE_HERMITE: ResizeMode; - static readonly RESIZE_BEZIER: ResizeMode; - - static readonly FONT_SANS_8_BLACK: PresetFont; - static readonly FONT_SANS_16_BLACK: PresetFont; - static readonly FONT_SANS_32_BLACK: PresetFont; - static readonly FONT_SANS_64_BLACK: PresetFont; - static readonly FONT_SANS_128_BLACK: PresetFont; - - static readonly FONT_SANS_8_WHITE: PresetFont; - static readonly FONT_SANS_16_WHITE: PresetFont; - static readonly FONT_SANS_32_WHITE: PresetFont; - static readonly FONT_SANS_64_WHITE: PresetFont; - static readonly FONT_SANS_128_WHITE: PresetFont; - - static readonly MIME_PNG: FileMINE; - static readonly MIME_JPEG: FileMINE; - static readonly MIME_BMP: FileMINE; - static readonly AUTO: number; - - static readonly HORIZONTAL_ALIGN_LEFT: AlignMode; - static readonly HORIZONTAL_ALIGN_CENTER: AlignMode; - static readonly HORIZONTAL_ALIGN_RIGHT: AlignMode; - static readonly VERTICAL_ALIGN_TOP: AlignMode; - static readonly VERTICAL_ALIGN_MIDDLE: AlignMode; - static readonly VERTICAL_ALIGN_BOTTOM: AlignMode; - - static readonly PNG_FILTER_AUTO: FilterType; - static readonly PNG_FILTER_NONE: FilterType; - static readonly PNG_FILTER_SUB: FilterType; - static readonly PNG_FILTER_UP: FilterType; - static readonly PNG_FILTER_AVERAGE: FilterType; - static readonly PNG_FILTER_PAETH: FilterType; - } -} -export = jimp.JIMP; diff --git a/jimp/tslint.json b/jimp/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/jimp/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/joi/index.d.ts b/joi/index.d.ts deleted file mode 100644 index fe1f0e39f8..0000000000 --- a/joi/index.d.ts +++ /dev/null @@ -1,1025 +0,0 @@ -// Type definitions for joi v10.0.0 -// Project: https://github.com/hapijs/joi -// Definitions by: Bart van der Schoor , Laurence Dougal Myers , Christopher Glantschnig , David Broder-Rodgers , Gael Magnan de Bornier -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -// TODO express type of Schema in a type-parameter (.default, .valid, .example etc) - - - -export interface ValidationOptions { - /** - * when true, stops validation on the first error, otherwise returns all the errors found. Defaults to true. - */ - abortEarly?: boolean; - /** - * when true, attempts to cast values to the required types (e.g. a string to a number). Defaults to true. - */ - convert?: boolean; - /** - * when true, allows object to contain unknown keys which are ignored. Defaults to false. - */ - allowUnknown?: boolean; - /** - * when true, ignores unknown keys with a function value. Defaults to false. - */ - skipFunctions?: boolean; - /** - * when true, unknown keys are deleted (only when value is an object). Defaults to false. - */ - stripUnknown?: boolean; - /** - * overrides individual error messages. Defaults to no override ({}). - */ - language?: Object; - /** - * sets the default presence requirements. Supported modes: 'optional', 'required', and 'forbidden'. Defaults to 'optional'. - */ - presence?: string; - /** - * provides an external data set to be used in references - */ - context?: Object; - /** - * when true, do not apply default values. Defaults to false. - */ - noDefaults?: boolean; -} - -export interface RenameOptions { - /** - * if true, does not delete the old key name, keeping both the new and old keys in place. Defaults to false. - */ - alias?: boolean; - /** - * if true, allows renaming multiple keys to the same destination where the last rename wins. Defaults to false. - */ - multiple?: boolean; - /** - * if true, allows renaming a key over an existing key. Defaults to false. - */ - override?: boolean; - /** - * if true, skip renaming of a key if it's undefined. Defaults to false. - */ - ignoreUndefined?: boolean; -} - -export interface EmailOptions { - /** - * Numerical threshold at which an email address is considered invalid - */ - errorLevel?: number | boolean; - /** - * Specifies a list of acceptable TLDs. - */ - tldWhitelist?: string[] | Object; - /** - * Number of atoms required for the domain. Be careful since some domains, such as io, directly allow email. - */ - minDomainAtoms?: number; -} - -export interface IpOptions { - /** - * One or more IP address versions to validate against. Valid values: ipv4, ipv6, ipvfuture - */ - version?: string | string[]; - /** - * Used to determine if a CIDR is allowed or not. Valid values: optional, required, forbidden - */ - cidr?: string; -} - -export type GuidVersions = 'uuidv1' | 'uuidv2' | 'uuidv3' | 'uuidv4' | 'uuidv5' - -export interface GuidOptions { - version: GuidVersions[] | GuidVersions -} - -export interface UriOptions { - /** - * Specifies one or more acceptable Schemes, should only include the scheme name. - * Can be an Array or String (strings are automatically escaped for use in a Regular Expression). - */ - scheme?: string | RegExp | Array; -} - -export interface WhenOptions { - /** - * the required condition joi type. - */ - is: T; - /** - * the alternative schema type if the condition is true. Required if otherwise is missing. - */ - then?: Schema; - /** - * the alternative schema type if the condition is false. Required if then is missing - */ - otherwise?: Schema; -} - -export interface ReferenceOptions { - separator?: string; - contextPrefix?: string; -} - -export interface IPOptions { - version?: Array; - cidr?: string -} - -export interface ValidationError extends Error { - isJoi: boolean; - details: ValidationErrorItem[]; - annotate(): string; - _object: any; -} - -export interface ValidationErrorItem { - message: string; - type: string; - path: string; - options?: ValidationOptions; - context?: any; -} - -export interface ValidationResult { - error: ValidationError; - value: T; -} - -export interface SchemaMap { - [key: string]: Schema; -} - -export interface Schema extends AnySchema { - -} - -export interface Reference extends Schema { - -} - -export interface AnySchema> { - /** - * Whitelists a value - */ - allow(value: any, ...values: any[]): T; - allow(values: any[]): T; - - /** - * Adds the provided values into the allowed whitelist and marks them as the only valid values allowed. - */ - valid(value: any, ...values: any[]): T; - valid(values: any[]): T; - only(value: any, ...values: any[]): T; - only(values: any[]): T; - equal(value: any, ...values: any[]): T; - equal(values: any[]): T; - - /** - * Blacklists a value - */ - invalid(value: any, ...values: any[]): T; - invalid(values: any[]): T; - disallow(value: any, ...values: any[]): T; - disallow(values: any[]): T; - not(value: any, ...values: any[]): T; - not(values: any[]): T; - - /** - * Marks a key as required which will not allow undefined as value. All keys are optional by default. - */ - required(): T; - - /** - * Marks a key as optional which will allow undefined as values. Used to annotate the schema for readability as all keys are optional by default. - */ - optional(): T; - - /** - * Marks a key as forbidden which will not allow any value except undefined. Used to explicitly forbid keys. - */ - forbidden(): T; - - /** - * Marks a key to be removed from a resulting object or array after validation. Used to sanitize output. - */ - strip(): T; - - /** - * Annotates the key - */ - description(desc: string): T; - - /** - * Annotates the key - */ - notes(notes: string): T; - notes(notes: string[]): T; - - /** - * Annotates the key - */ - tags(notes: string): T; - tags(notes: string[]): T; - - /** - * Attaches metadata to the key. - */ - meta(meta: Object): T; - - /** - * Annotates the key with an example value, must be valid. - */ - example(value: any): T; - - /** - * Annotates the key with an unit name. - */ - unit(name: string): T; - - /** - * Overrides the global validate() options for the current key and any sub-key. - */ - options(options: ValidationOptions): T; - - /** - * Sets the options.convert options to false which prevent type casting for the current key and any child keys. - */ - strict(isStrict?: boolean): T; - - /** - * Sets a default value if the original value is undefined. - * @param value - the value. - * value supports references. - * value may also be a function which returns the default value. - * If value is specified as a function that accepts a single parameter, that parameter will be a context - * object that can be used to derive the resulting value. This clones the object however, which incurs some - * overhead so if you don't need access to the context define your method so that it does not accept any - * parameters. - * Without any value, default has no effect, except for object that will then create nested defaults - * (applying inner defaults of that object). - * - * Note that if value is an object, any changes to the object after default() is called will change the - * reference and any future assignment. - * - * Additionally, when specifying a method you must either have a description property on your method or the - * second parameter is required. - */ - default(value: any, description?: string): T; - default(): T; - - /** - * Returns a new type that is the result of adding the rules of one type to another. - */ - concat(schema: T): T; - - /** - * Converts the type into an alternatives type where the conditions are merged into the type definition where: - */ - when(ref: string, options: WhenOptions): AlternativesSchema; - when(ref: Reference, options: WhenOptions): AlternativesSchema; - - /** - * Overrides the key name in error messages. - */ - label(name: string): T; - - /** - * Outputs the original untouched value instead of the casted value. - */ - raw(isRaw?: boolean): T; - - /** - * Considers anything that matches the schema to be empty (undefined). - * @param schema - any object or joi schema to match. An undefined schema unsets that rule. - */ - empty(schema?: any): T; - - /** - * Overrides the default joi error with a custom error if the rule fails where: - * @param err - the override error. - * - * Note that the provided error will be returned as-is, unmodified and undecorated - * with any of the normal joi error properties. If validation fails and another - * error is found before the error override, that error will be returned and the - * override will be ignored (unless the abortEarly option has been set to false). - */ - error?(err: Error): T; -} - -export interface BooleanSchema extends AnySchema { - -} - -export interface NumberSchema extends AnySchema { - /** - * Specifies the minimum value. - * It can also be a reference to another field. - */ - min(limit: number): NumberSchema; - min(limit: Reference): NumberSchema; - - /** - * Specifies the maximum value. - * It can also be a reference to another field. - */ - max(limit: number): NumberSchema; - max(limit: Reference): NumberSchema; - - /** - * Specifies that the value must be greater than limit. - * It can also be a reference to another field. - */ - greater(limit: number): NumberSchema; - greater(limit: Reference): NumberSchema; - - /** - * Specifies that the value must be less than limit. - * It can also be a reference to another field. - */ - less(limit: number): NumberSchema; - less(limit: Reference): NumberSchema; - - /** - * Requires the number to be an integer (no floating point). - */ - integer(): NumberSchema; - - /** - * Specifies the maximum number of decimal places where: - * limit - the maximum number of decimal places allowed. - */ - precision(limit: number): NumberSchema; - - /** - * Specifies that the value must be a multiple of base. - */ - multiple(base: number): NumberSchema; - - /** - * Requires the number to be positive. - */ - positive(): NumberSchema; - - /** - * Requires the number to be negative. - */ - negative(): NumberSchema; -} - -export interface StringSchema extends AnySchema { - /** - * Allows the value to match any whitelist of blacklist item in a case insensitive comparison. - */ - insensitive(): StringSchema; - - /** - * Specifies the minimum number string characters. - * @param limit - the minimum number of string characters required. It can also be a reference to another field. - * @param encoding - if specified, the string length is calculated in bytes using the provided encoding. - */ - min(limit: number, encoding?: string): StringSchema; - min(limit: Reference, encoding?: string): StringSchema; - - /** - * Specifies the maximum number of string characters. - * @param limit - the maximum number of string characters allowed. It can also be a reference to another field. - * @param encoding - if specified, the string length is calculated in bytes using the provided encoding. - */ - max(limit: number, encoding?: string): StringSchema; - max(limit: Reference, encoding?: string): StringSchema; - - /** - * Requires the number to be a credit card number (Using Lunh Algorithm). - */ - creditCard(): StringSchema; - - /** - * Specifies the exact string length required - * @param limit - the required string length. It can also be a reference to another field. - * @param encoding - if specified, the string length is calculated in bytes using the provided encoding. - */ - length(limit: number, encoding?: string): StringSchema; - length(limit: Reference, encoding?: string): StringSchema; - - /** - * Defines a regular expression rule. - * @param pattern - a regular expression object the string value must match against. - * @param name - optional name for patterns (useful with multiple patterns). Defaults to 'required'. - */ - regex(pattern: RegExp, name?: string): StringSchema; - - /** - * Replace characters matching the given pattern with the specified replacement string where: - * @param pattern - a regular expression object to match against, or a string of which all occurrences will be replaced. - * @param replacement - the string that will replace the pattern. - */ - replace(pattern: RegExp, replacement: string): StringSchema; - replace(pattern: string, replacement: string): StringSchema; - - /** - * Requires the string value to only contain a-z, A-Z, and 0-9. - */ - alphanum(): StringSchema; - - /** - * Requires the string value to only contain a-z, A-Z, 0-9, and underscore _. - */ - token(): StringSchema; - - /** - * Requires the string value to be a valid email address. - */ - email(options?: EmailOptions): StringSchema; - - /** - * Requires the string value to be a valid ip address. - */ - ip(options?: IpOptions): StringSchema; - - /** - * Requires the string value to be a valid RFC 3986 URI. - */ - uri(options?: UriOptions): StringSchema; - - /** - * Requires the string value to be a valid GUID. - */ - guid(options?: GuidOptions): StringSchema; - - /** - * Requires the string value to be a valid hexadecimal string. - */ - hex(): StringSchema; - - /** - * Requires the string value to be a valid hostname as per RFC1123. - */ - hostname(): StringSchema; - - /** - * Requires the string value to be in valid ISO 8601 date format. - */ - isoDate(): StringSchema; - - /** - * Requires the string value to be all lowercase. If the validation convert option is on (enabled by default), the string will be forced to lowercase. - */ - lowercase(): StringSchema; - - /** - * Requires the string value to be all uppercase. If the validation convert option is on (enabled by default), the string will be forced to uppercase. - */ - uppercase(): StringSchema; - - /** - * Requires the string value to contain no whitespace before or after. If the validation convert option is on (enabled by default), the string will be trimmed. - */ - trim(): StringSchema; -} - -export interface ArraySchema extends AnySchema { - /** - * Allow this array to be sparse. - * enabled can be used with a falsy value to go back to the default behavior. - */ - sparse(enabled?: any): ArraySchema; - - /** - * Allow single values to be checked against rules as if it were provided as an array. - * enabled can be used with a falsy value to go back to the default behavior. - */ - single(enabled?: any): ArraySchema; - - /** - * List the types allowed for the array values. - * type can be an array of values, or multiple values can be passed as individual arguments. - * If a given type is .required() then there must be a matching item in the array. - * If a type is .forbidden() then it cannot appear in the array. - * Required items can be added multiple times to signify that multiple items must be found. - * Errors will contain the number of items that didn't match. - * Any unmatched item having a label will be mentioned explicitly. - * - * @param type - a joi schema object to validate each array item against. - */ - items(type: Schema, ...types: Schema[]): ArraySchema; - items(types: Schema[]): ArraySchema; - - /** - * Lists the types in sequence order for the array values where: - * @param type - a joi schema object to validate against each array item in sequence order. type can be an array of values, or multiple values can be passed as individual arguments. - * If a given type is .required() then there must be a matching item with the same index position in the array. Errors will contain the number of items that didn't match. Any unmatched item having a label will be mentioned explicitly. - */ - ordered(type: Schema, ...types: Schema[]): ArraySchema; - - /** - * Specifies the minimum number of items in the array. - */ - min(limit: number): ArraySchema; - - /** - * Specifies the maximum number of items in the array. - */ - max(limit: number): ArraySchema; - - /** - * Specifies the exact number of items in the array. - */ - length(limit: number): ArraySchema; - - /** - * Requires the array values to be unique. - * Be aware that a deep equality is performed on elements of the array having a type of object, - * a performance penalty is to be expected for this kind of operation. - */ - unique(): ArraySchema; -} - -export interface ObjectSchema extends AnySchema { - /** - * Sets the allowed object keys. - */ - keys(schema?: SchemaMap): ObjectSchema; - - /** - * Specifies the minimum number of keys in the object. - */ - min(limit: number): ObjectSchema; - - /** - * Specifies the maximum number of keys in the object. - */ - max(limit: number): ObjectSchema; - - /** - * Specifies the exact number of keys in the object. - */ - length(limit: number): ObjectSchema; - - /** - * Specify validation rules for unknown keys matching a pattern. - */ - pattern(regex: RegExp, schema: Schema): ObjectSchema; - - /** - * Defines an all-or-nothing relationship between keys where if one of the peers is present, all of them are required as well. - * @param peers - the key names of which if one present, all are required. peers can be a single string value, - * an array of string values, or each peer provided as an argument. - */ - and(peer1: string, ...peers: string[]): ObjectSchema; - and(peers: string[]): ObjectSchema; - - /** - * Defines a relationship between keys where not all peers can be present at the same time. - * @param peers - the key names of which if one present, the others may not all be present. - * peers can be a single string value, an array of string values, or each peer provided as an argument. - */ - nand(peer1: string, ...peers: string[]): ObjectSchema; - nand(peers: string[]): ObjectSchema; - - /** - * Defines a relationship between keys where one of the peers is required (and more than one is allowed). - */ - or(peer1: string, ...peers: string[]): ObjectSchema; - or(peers: string[]): ObjectSchema; - - /** - * Defines an exclusive relationship between a set of keys. one of them is required but not at the same time where: - */ - xor(peer1: string, ...peers: string[]): ObjectSchema; - xor(peers: string[]): ObjectSchema; - - /** - * Requires the presence of other keys whenever the specified key is present. - */ - with(key: string, peers: string): ObjectSchema; - with(key: string, peers: string[]): ObjectSchema; - - /** - * Forbids the presence of other keys whenever the specified is present. - */ - without(key: string, peers: string): ObjectSchema; - without(key: string, peers: string[]): ObjectSchema; - - /** - * Renames a key to another name (deletes the renamed key). - */ - rename(from: string, to: string, options?: RenameOptions): ObjectSchema; - - /** - * Verifies an assertion where. - */ - assert(ref: string, schema: Schema, message?: string): ObjectSchema; - assert(ref: Reference, schema: Schema, message?: string): ObjectSchema; - - /** - * Overrides the handling of unknown keys for the scope of the current object only (does not apply to children). - */ - unknown(allow?: boolean): ObjectSchema; - - /** - * Requires the object to be an instance of a given constructor. - * - * @param constructor - the constructor function that the object must be an instance of. - * @param name - an alternate name to use in validation errors. This is useful when the constructor function does not have a name. - */ - type(constructor: Function, name?: string): ObjectSchema; - - /** - * Sets the specified children to required. - * - * @param children - can be a single string value, an array of string values, or each child provided as an argument. - * - * var schema = Joi.object().keys({ a: { b: Joi.number() }, c: { d: Joi.string() } }); - * var requiredSchema = schema.requiredKeys('', 'a.b', 'c', 'c.d'); - * - * Note that in this example '' means the current object, a is not required but b is, as well as c and d. - */ - requiredKeys(children: string): ObjectSchema; - requiredKeys(children: string[]): ObjectSchema; - requiredKeys(child: string, ...children: string[]): ObjectSchema; - - /** - * Sets the specified children to optional. - * - * @param children - can be a single string value, an array of string values, or each child provided as an argument. - * - * The behavior is exactly the same as requiredKeys. - */ - optionalKeys(children: string): ObjectSchema; - optionalKeys(children: string[]): ObjectSchema; - optionalKeys(child: string, ...children: string[]): ObjectSchema; -} - -export interface BinarySchema extends AnySchema { - /** - * Sets the string encoding format if a string input is converted to a buffer. - */ - encoding(encoding: string): BinarySchema; - - /** - * Specifies the minimum length of the buffer. - */ - min(limit: number): BinarySchema; - - /** - * Specifies the maximum length of the buffer. - */ - max(limit: number): BinarySchema; - - /** - * Specifies the exact length of the buffer: - */ - length(limit: number): BinarySchema; -} - -export interface DateSchema extends AnySchema { - - /** - * Specifies the oldest date allowed. - * Notes: 'now' can be passed in lieu of date so as to always compare relatively to the current date, - * allowing to explicitly ensure a date is either in the past or in the future. - * It can also be a reference to another field. - */ - min(date: Date): DateSchema; - min(date: number): DateSchema; - min(date: string): DateSchema; - min(date: Reference): DateSchema; - - /** - * Specifies the latest date allowed. - * Notes: 'now' can be passed in lieu of date so as to always compare relatively to the current date, - * allowing to explicitly ensure a date is either in the past or in the future. - * It can also be a reference to another field. - */ - max(date: Date): DateSchema; - max(date: number): DateSchema; - max(date: string): DateSchema; - max(date: Reference): DateSchema; - - /** - * Specifies the allowed date format: - * @param format - string or array of strings that follow the moment.js format. - */ - format(format: string): DateSchema; - format(format: string[]): DateSchema; - - /** - * Requires the string value to be in valid ISO 8601 date format. - */ - iso(): DateSchema; - - - /** - * Requires the value to be a timestamp interval from Unix Time. - * @param type - the type of timestamp (allowed values are unix or javascript [default]) - */ - timestamp(type?: 'javascript' | 'unix'): DateSchema; -} - -export interface FunctionSchema extends AnySchema { - - /** - * Specifies the arity of the function where: - * @param n - the arity expected. - */ - arity(n: number): FunctionSchema; - - - /** - * Specifies the minimal arity of the function where: - * @param n - the minimal arity expected. - */ - minArity(n: number): FunctionSchema; - - - /** - * Specifies the minimal arity of the function where: - * @param n - the minimal arity expected. - */ - maxArity(n: number): FunctionSchema; - - /** - * Requires the function to be a Joi reference. - */ - ref(): FunctionSchema; -} - -export interface AlternativesSchema extends AnySchema { - try(schemas: Schema[]): AlternativesSchema; - try(type1: Schema, type2: Schema, ...types: Schema[]): AlternativesSchema; - when(ref: string, options: WhenOptions): AlternativesSchema; - when(ref: Reference, options: WhenOptions): AlternativesSchema; -} - -export interface Terms { - value: any; - state: { - key: string, - path: string, - parent: any - }; - options: ValidationOptions; -} - -export interface Rules { - name: string; - params?: ObjectSchema | { [key: string]: Schema }; - setup?: Function; - validate?: Function; - description?: string | Function; -} - -export interface Extension { - name: string; - base?: Schema; - pre?: Function; - language?: {}; - describe?: Function; - rules?: Rules[]; -} - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -/** - * Generates a schema object that matches any data type. - */ -export declare function any(): Schema; - -/** - * Generates a schema object that matches an array data type. - */ -export declare function array(): ArraySchema; - -/** - * Generates a schema object that matches a boolean data type (as well as the strings 'true', 'false', 'yes', and 'no'). Can also be called via bool(). - */ -export declare function bool(): BooleanSchema; - -export declare function boolean(): BooleanSchema; - -/** - * Generates a schema object that matches a Buffer data type (as well as the strings which will be converted to Buffers). - */ -export declare function binary(): BinarySchema; - -/** - * Generates a schema object that matches a date type (as well as a JavaScript date string or number of milliseconds). - */ -export declare function date(): DateSchema; - -/** - * Generates a schema object that matches a function type. - */ -export declare function func(): FunctionSchema; - -/** - * Generates a schema object that matches a number data type (as well as strings that can be converted to numbers). - */ -export declare function number(): NumberSchema; - -/** - * Generates a schema object that matches an object data type (as well as JSON strings that parsed into objects). - */ -export declare function object(schema?: SchemaMap): ObjectSchema; - -/** - * Generates a schema object that matches a string data type. Note that empty strings are not allowed by default and must be enabled with allow(''). - */ -export declare function string(): StringSchema; - -/** - * Generates a type that will match one of the provided alternative schemas - */ -export function alternatives(): AlternativesSchema; -export function alternatives(types: Schema[]): AlternativesSchema; -export function alternatives(type1: Schema, type2: Schema, ...types: Schema[]): AlternativesSchema; - -/** - * Generates a placeholder schema for a schema that you would provide with the fn. - * Supports the same methods of the any() type. - * This is mostly useful for recursive schemas - */ -export declare function lazy(cb: () => Schema): Schema; - -/** - * Validates a value using the given schema and options. - */ -export function validate(value: T): ValidationResult; -export function validate(value: T, callback: (err: ValidationError, value: T) => R): R; - -export function validate(value: T, schema: Schema): ValidationResult; -export function validate(value: T, schema: Object): ValidationResult; -export function validate(value: T, schema: Schema, callback: (err: ValidationError, value: T) => R): R; -export function validate(value: T, schema: Object, callback: (err: ValidationError, value: T) => R): R; - -export function validate(value: T, schema: Schema, options: ValidationOptions): ValidationResult; -export function validate(value: T, schema: Object, options: ValidationOptions): ValidationResult; -export function validate(value: T, schema: Schema, options: ValidationOptions, callback: (err: ValidationError, value: T) => R): R; -export function validate(value: T, schema: Object, options: ValidationOptions, callback: (err: ValidationError, value: T) => R): R; -/** - * Converts literal schema definition to joi schema object (or returns the same back if already a joi schema object). - */ -export function compile(schema: Object): Schema; - -/** - * Validates a value against a schema and throws if validation fails. - * - * @param value - the value to validate. - * @param schema - the schema object. - * @param message - optional message string prefix added in front of the error message. may also be an Error object. - */ -export function assert(value: any, schema: Schema, message?: string | Error): void; - - -/** - * Validates a value against a schema, returns valid object, and throws if validation fails where: - * - * @param value - the value to validate. - * @param schema - the schema object. - * @param message - optional message string prefix added in front of the error message. may also be an Error object. - */ -export function attempt(value: T, schema: Schema, message?: string | Error): T; - - -/** - * Generates a reference to the value of the named key. - */ -export function ref(key: string, options?: ReferenceOptions): Reference; - - -/** - * Checks whether or not the provided argument is a reference. It's especially useful if you want to post-process error messages. - */ -export function isRef(ref: any): boolean; - - -/** - * Get a sub-schema of an existing schema based on a path. Path separator is a dot (.). - */ -export function reach(schema: Schema, path: string): Schema; - - -/** - * Creates a new Joi instance customized with the extension(s) you provide included. - */ -export function extend(extention: Extension): any; - -/** - * Whitelists a value - */ -export function allow(value: any, ...values: any[]): Schema; -export function allow(values: any[]): Schema; - -/** - * Adds the provided values into the allowed whitelist and marks them as the only valid values allowed. - */ -export function valid(value: any, ...values: any[]): Schema; -export function valid(values: any[]): Schema; -export function only(value: any, ...values : any[]): Schema; -export function only(values: any[]): Schema; -export function equal(value: any, ...values : any[]): Schema; -export function equal(values: any[]): Schema; - -/** - * Blacklists a value - */ -export function invalid(value: any, ...values: any[]): Schema; -export function invalid(values: any[]): Schema; -export function disallow(value: any, ...values : any[]): Schema; -export function disallow(values: any[]): Schema; -export function not(value: any, ...values : any[]): Schema; -export function not(values: any[]): Schema; - -/** - * Marks a key as required which will not allow undefined as value. All keys are optional by default. - */ -export function required(): Schema; - -/** - * Marks a key as optional which will allow undefined as values. Used to annotate the schema for readability as all keys are optional by default. - */ -export function optional(): Schema; - -/** - * Marks a key as forbidden which will not allow any value except undefined. Used to explicitly forbid keys. - */ -export function forbidden(): Schema; - -/** - * Marks a key to be removed from a resulting object or array after validation. Used to sanitize output. - */ -export function strip(): Schema; - -/** - * Annotates the key - */ -export function description(desc: string): Schema; - -/** - * Annotates the key - */ -export function notes(notes: string): Schema; -export function notes(notes: string[]): Schema; - -/** - * Annotates the key - */ -export function tags(notes: string): Schema; -export function tags(notes: string[]): Schema; - -/** - * Attaches metadata to the key. - */ -export function meta(meta: Object): Schema; - -/** - * Annotates the key with an example value, must be valid. - */ -export function example(value: any): Schema; - -/** - * Annotates the key with an unit name. - */ -export function unit(name: string): Schema; - -/** - * Overrides the global validate() options for the current key and any sub-key. - */ -export function options(options: ValidationOptions): Schema; - -/** - * Sets the options.convert options to false which prevent type casting for the current key and any child keys. - */ -export function strict(isStrict?: boolean): Schema; - -/** - * Returns a new type that is the result of adding the rules of one type to another. - */ -export function concat(schema: T): T; - -/** - * Converts the type into an alternatives type where the conditions are merged into the type definition where: - */ -export function when(ref: string, options: WhenOptions): AlternativesSchema; -export function when(ref: Reference, options: WhenOptions): AlternativesSchema; - -/** - * Overrides the key name in error messages. - */ -export function label(name: string): Schema; - -/** - * Outputs the original untouched value instead of the casted value. - */ -export function raw(isRaw?: boolean): Schema; - -/** - * Considers anything that matches the schema to be empty (undefined). - * @param schema - any object or joi schema to match. An undefined schema unsets that rule. - */ -export function empty(schema?: any) : Schema; diff --git a/joi/joi-tests.ts b/joi/joi-tests.ts deleted file mode 100644 index 3a222ff832..0000000000 --- a/joi/joi-tests.ts +++ /dev/null @@ -1,889 +0,0 @@ - -/// - -import Joi = require('joi'); - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -var x: any = null; -var value: any = null; -var num: number = 0; -var str: string = ''; -var bool: boolean = false; -var exp: RegExp = null; -var obj: Object = null; -var date: Date = null; -var bin: NodeBuffer = null; -var err: Error = null; -var func: Function = null; - -var anyArr: any[] = []; -var numArr: number[] = []; -var strArr: string[] = []; -var boolArr: boolean[] = []; -var expArr: RegExp[] = []; -var objArr: Object[] = []; -var bufArr: NodeBuffer[] = []; -var errArr: Error[] = []; -var funcArr: Function[] = []; - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -var schema: Joi.Schema = null; - -var anySchema: Joi.AnySchema = null; -var numSchema: Joi.NumberSchema = null; -var strSchema: Joi.StringSchema = null; -var arrSchema: Joi.ArraySchema = null; -var boolSchema: Joi.BooleanSchema = null; -var binSchema: Joi.BinarySchema = null; -var dateSchema: Joi.DateSchema = null; -var funcSchema: Joi.FunctionSchema = null; -var objSchema: Joi.ObjectSchema = null; -var altSchema: Joi.AlternativesSchema = null; - -var schemaArr: Joi.Schema[] = []; - -var ref: Joi.Reference = null; - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -var validOpts: Joi.ValidationOptions = null; - -validOpts = {abortEarly: bool}; -validOpts = {convert: bool}; -validOpts = {allowUnknown: bool}; -validOpts = {skipFunctions: bool}; -validOpts = {stripUnknown: bool}; -validOpts = {language: bool}; -validOpts = {presence: str}; -validOpts = {context: obj}; -validOpts = {noDefaults: bool}; - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -var renOpts: Joi.RenameOptions = null; - -renOpts = {alias: bool}; -renOpts = {multiple: bool}; -renOpts = {override: bool}; -renOpts = {ignoreUndefined: bool}; - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -var emailOpts: Joi.EmailOptions = null; - -emailOpts = {errorLevel: num}; -emailOpts = {errorLevel: bool}; -emailOpts = {tldWhitelist: strArr}; -emailOpts = {tldWhitelist: obj}; -emailOpts = {minDomainAtoms: num}; - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -var ipOpts: Joi.IpOptions = null; - -ipOpts = {version: str}; -ipOpts = {version: strArr}; -ipOpts = {cidr: str}; - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -var uriOpts: Joi.UriOptions = null; - -uriOpts = {scheme: str}; -uriOpts = {scheme: exp}; -uriOpts = {scheme: strArr}; -uriOpts = {scheme: expArr}; - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -var whenOpts: Joi.WhenOptions = null; - -whenOpts = {is: x}; -whenOpts = {is: schema, then: schema}; -whenOpts = {is: schema, otherwise: schema}; - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -var refOpts: Joi.ReferenceOptions = null; - -refOpts = {separator: str}; -refOpts = {contextPrefix: str}; - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -var validErr: Joi.ValidationError = null; -var validErrItem: Joi.ValidationErrorItem; - -validErrItem= { - message: str, - type: str, - path: str -}; - -validErrItem = { - message: str, - type: str, - path: str, - options: validOpts, - context: obj -}; - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -schema = anySchema; -schema = numSchema; -schema = strSchema; -schema = arrSchema; -schema = boolSchema; -schema = binSchema; -schema = dateSchema; -schema = funcSchema; -schema = objSchema; - -schema = ref; - -anySchema = anySchema; -anySchema = numSchema; -anySchema = strSchema; -anySchema = arrSchema; -anySchema = boolSchema; -anySchema = binSchema; -anySchema = dateSchema; -anySchema = funcSchema; -anySchema = objSchema; - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -var schemaMap: Joi.SchemaMap = null; - -schemaMap = { - a: numSchema, - b: strSchema -}; - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -anySchema = Joi.any(); - -namespace common { - anySchema = anySchema.allow(x); - anySchema = anySchema.allow(x, x); - anySchema = anySchema.allow([x, x, x]); - anySchema = anySchema.valid(x); - anySchema = anySchema.valid(x, x); - anySchema = anySchema.valid([x, x, x]); - anySchema = anySchema.only(x); - anySchema = anySchema.only(x, x); - anySchema = anySchema.only([x, x, x]); - anySchema = anySchema.equal(x); - anySchema = anySchema.equal(x, x); - anySchema = anySchema.equal([x, x, x]); - anySchema = anySchema.invalid(x); - anySchema = anySchema.invalid(x, x); - anySchema = anySchema.invalid([x, x, x]); - anySchema = anySchema.disallow(x); - anySchema = anySchema.disallow(x, x); - anySchema = anySchema.disallow([x, x, x]); - anySchema = anySchema.not(x); - anySchema = anySchema.not(x, x); - anySchema = anySchema.not([x, x, x]); - - anySchema = anySchema.default(); - anySchema = anySchema.default(x); - anySchema = anySchema.default(x, str); - - anySchema = anySchema.required(); - anySchema = anySchema.optional(); - anySchema = anySchema.forbidden(); - anySchema = anySchema.strip(); - - anySchema = anySchema.description(str); - anySchema = anySchema.notes(str); - anySchema = anySchema.notes(strArr); - anySchema = anySchema.tags(str); - anySchema = anySchema.tags(strArr); - - anySchema = anySchema.meta(obj); - anySchema = anySchema.example(obj); - anySchema = anySchema.unit(str); - - anySchema = anySchema.options(validOpts); - anySchema = anySchema.strict(); - anySchema = anySchema.strict(bool); - anySchema = anySchema.concat(x); - - altSchema = anySchema.when(str, whenOpts); - altSchema = anySchema.when(ref, whenOpts); - - anySchema = anySchema.label(str); - anySchema = anySchema.raw(); - anySchema = anySchema.raw(bool); - anySchema = anySchema.empty(); - anySchema = anySchema.empty(str); - anySchema = anySchema.empty(anySchema); - - anySchema = anySchema.error(err); -} - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -arrSchema = Joi.array(); - -arrSchema = arrSchema.sparse(); -arrSchema = arrSchema.sparse(bool); -arrSchema = arrSchema.single(); -arrSchema = arrSchema.single(bool); -arrSchema = arrSchema.ordered(anySchema); -arrSchema = arrSchema.ordered(anySchema, numSchema, strSchema, arrSchema, boolSchema, binSchema, dateSchema, funcSchema, objSchema); -arrSchema = arrSchema.min(num); -arrSchema = arrSchema.max(num); -arrSchema = arrSchema.length(num); -arrSchema = arrSchema.unique(); - - -arrSchema = arrSchema.items(numSchema); -arrSchema = arrSchema.items(numSchema, strSchema); -arrSchema = arrSchema.items([numSchema, strSchema]); - -// - - - - - - - - - -namespace common_copy_paste { - // use search & replace from any - arrSchema = arrSchema.allow(x); - arrSchema = arrSchema.allow(x, x); - arrSchema = arrSchema.allow([x, x, x]); - arrSchema = arrSchema.valid(x); - arrSchema = arrSchema.valid(x, x); - arrSchema = arrSchema.valid([x, x, x]); - arrSchema = arrSchema.only(x); - arrSchema = arrSchema.only(x, x); - arrSchema = arrSchema.only([x, x, x]); - arrSchema = arrSchema.equal(x); - arrSchema = arrSchema.equal(x, x); - arrSchema = arrSchema.equal([x, x, x]); - arrSchema = arrSchema.invalid(x); - arrSchema = arrSchema.invalid(x, x); - arrSchema = arrSchema.invalid([x, x, x]); - arrSchema = arrSchema.disallow(x); - arrSchema = arrSchema.disallow(x, x); - arrSchema = arrSchema.disallow([x, x, x]); - arrSchema = arrSchema.not(x); - arrSchema = arrSchema.not(x, x); - arrSchema = arrSchema.not([x, x, x]); - - arrSchema = arrSchema.default(x); - - arrSchema = arrSchema.required(); - arrSchema = arrSchema.optional(); - arrSchema = arrSchema.forbidden(); - - arrSchema = arrSchema.description(str); - arrSchema = arrSchema.notes(str); - arrSchema = arrSchema.notes(strArr); - arrSchema = arrSchema.tags(str); - arrSchema = arrSchema.tags(strArr); - - arrSchema = arrSchema.meta(obj); - arrSchema = arrSchema.example(obj); - arrSchema = arrSchema.unit(str); - - arrSchema = arrSchema.options(validOpts); - arrSchema = arrSchema.strict(); - arrSchema = arrSchema.concat(x); - - altSchema = arrSchema.when(str, whenOpts); - altSchema = arrSchema.when(ref, whenOpts); -} - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -boolSchema = Joi.bool(); -boolSchema = Joi.boolean(); - -namespace common_copy_paste { - boolSchema = boolSchema.allow(x); - boolSchema = boolSchema.allow(x, x); - boolSchema = boolSchema.allow([x, x, x]); - boolSchema = boolSchema.valid(x); - boolSchema = boolSchema.valid(x, x); - boolSchema = boolSchema.valid([x, x, x]); - boolSchema = boolSchema.only(x); - boolSchema = boolSchema.only(x, x); - boolSchema = boolSchema.only([x, x, x]); - boolSchema = boolSchema.equal(x); - boolSchema = boolSchema.equal(x, x); - boolSchema = boolSchema.equal([x, x, x]); - boolSchema = boolSchema.invalid(x); - boolSchema = boolSchema.invalid(x, x); - boolSchema = boolSchema.invalid([x, x, x]); - boolSchema = boolSchema.disallow(x); - boolSchema = boolSchema.disallow(x, x); - boolSchema = boolSchema.disallow([x, x, x]); - boolSchema = boolSchema.not(x); - boolSchema = boolSchema.not(x, x); - boolSchema = boolSchema.not([x, x, x]); - - boolSchema = boolSchema.default(x); - - boolSchema = boolSchema.required(); - boolSchema = boolSchema.optional(); - boolSchema = boolSchema.forbidden(); - - boolSchema = boolSchema.description(str); - boolSchema = boolSchema.notes(str); - boolSchema = boolSchema.notes(strArr); - boolSchema = boolSchema.tags(str); - boolSchema = boolSchema.tags(strArr); - - boolSchema = boolSchema.meta(obj); - boolSchema = boolSchema.example(obj); - boolSchema = boolSchema.unit(str); - - boolSchema = boolSchema.options(validOpts); - boolSchema = boolSchema.strict(); - boolSchema = boolSchema.concat(x); - - altSchema = boolSchema.when(str, whenOpts); - altSchema = boolSchema.when(ref, whenOpts); -} - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -binSchema = Joi.binary(); - -binSchema = binSchema.encoding(str); -binSchema = binSchema.min(num); -binSchema = binSchema.max(num); -binSchema = binSchema.length(num); - -namespace common { - binSchema = binSchema.allow(x); - binSchema = binSchema.allow(x, x); - binSchema = binSchema.allow([x, x, x]); - binSchema = binSchema.valid(x); - binSchema = binSchema.valid(x, x); - binSchema = binSchema.valid([x, x, x]); - binSchema = binSchema.only(x); - binSchema = binSchema.only(x, x); - binSchema = binSchema.only([x, x, x]); - binSchema = binSchema.equal(x); - binSchema = binSchema.equal(x, x); - binSchema = binSchema.equal([x, x, x]); - binSchema = binSchema.invalid(x); - binSchema = binSchema.invalid(x, x); - binSchema = binSchema.invalid([x, x, x]); - binSchema = binSchema.disallow(x); - binSchema = binSchema.disallow(x, x); - binSchema = binSchema.disallow([x, x, x]); - binSchema = binSchema.not(x); - binSchema = binSchema.not(x, x); - binSchema = binSchema.not([x, x, x]); - - binSchema = binSchema.default(x); - - binSchema = binSchema.required(); - binSchema = binSchema.optional(); - binSchema = binSchema.forbidden(); - - binSchema = binSchema.description(str); - binSchema = binSchema.notes(str); - binSchema = binSchema.notes(strArr); - binSchema = binSchema.tags(str); - binSchema = binSchema.tags(strArr); - - binSchema = binSchema.meta(obj); - binSchema = binSchema.example(obj); - binSchema = binSchema.unit(str); - - binSchema = binSchema.options(validOpts); - binSchema = binSchema.strict(); - binSchema = binSchema.concat(x); - - altSchema = binSchema.when(str, whenOpts); - altSchema = binSchema.when(ref, whenOpts); -} - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -dateSchema = Joi.date(); - -dateSchema = dateSchema.min(date); -dateSchema = dateSchema.max(date); - -dateSchema = dateSchema.min(str); -dateSchema = dateSchema.max(str); - -dateSchema = dateSchema.min(num); -dateSchema = dateSchema.max(num); - -dateSchema = dateSchema.min(ref); -dateSchema = dateSchema.max(ref); - -dateSchema = dateSchema.format(str); -dateSchema = dateSchema.format(strArr); - -dateSchema = dateSchema.iso(); - -dateSchema = dateSchema.timestamp(); -dateSchema = dateSchema.timestamp('javascript'); -dateSchema = dateSchema.timestamp('unix'); - -namespace common { - dateSchema = dateSchema.allow(x); - dateSchema = dateSchema.allow(x, x); - dateSchema = dateSchema.allow([x, x, x]); - dateSchema = dateSchema.valid(x); - dateSchema = dateSchema.valid(x, x); - dateSchema = dateSchema.valid([x, x, x]); - dateSchema = dateSchema.only(x); - dateSchema = dateSchema.only(x, x); - dateSchema = dateSchema.only([x, x, x]); - dateSchema = dateSchema.equal(x); - dateSchema = dateSchema.equal(x, x); - dateSchema = dateSchema.equal([x, x, x]); - dateSchema = dateSchema.invalid(x); - dateSchema = dateSchema.invalid(x, x); - dateSchema = dateSchema.invalid([x, x, x]); - dateSchema = dateSchema.disallow(x); - dateSchema = dateSchema.disallow(x, x); - dateSchema = dateSchema.disallow([x, x, x]); - dateSchema = dateSchema.not(x); - dateSchema = dateSchema.not(x, x); - dateSchema = dateSchema.not([x, x, x]); - - dateSchema = dateSchema.default(x); - - dateSchema = dateSchema.required(); - dateSchema = dateSchema.optional(); - dateSchema = dateSchema.forbidden(); - - dateSchema = dateSchema.description(str); - dateSchema = dateSchema.notes(str); - dateSchema = dateSchema.notes(strArr); - dateSchema = dateSchema.tags(str); - dateSchema = dateSchema.tags(strArr); - - dateSchema = dateSchema.meta(obj); - dateSchema = dateSchema.example(obj); - dateSchema = dateSchema.unit(str); - - dateSchema = dateSchema.options(validOpts); - dateSchema = dateSchema.strict(); - dateSchema = dateSchema.concat(x); - - altSchema = dateSchema.when(str, whenOpts); - altSchema = dateSchema.when(ref, whenOpts); -} - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -funcSchema = Joi.func(); - -funcSchema = funcSchema.arity(num); -funcSchema = funcSchema.minArity(num); -funcSchema = funcSchema.maxArity(num); -funcSchema = funcSchema.ref(); - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -numSchema = Joi.number(); - -numSchema = numSchema.min(num); -numSchema = numSchema.min(ref); -numSchema = numSchema.max(num); -numSchema = numSchema.max(ref); -numSchema = numSchema.greater(num); -numSchema = numSchema.greater(ref); -numSchema = numSchema.less(num); -numSchema = numSchema.less(ref); -numSchema = numSchema.integer(); -numSchema = numSchema.precision(num); -numSchema = numSchema.multiple(num); -numSchema = numSchema.positive(); -numSchema = numSchema.negative(); - -namespace common { - numSchema = numSchema.allow(x); - numSchema = numSchema.allow(x, x); - numSchema = numSchema.allow([x, x, x]); - numSchema = numSchema.valid(x); - numSchema = numSchema.valid(x, x); - numSchema = numSchema.valid([x, x, x]); - numSchema = numSchema.only(x); - numSchema = numSchema.only(x, x); - numSchema = numSchema.only([x, x, x]); - numSchema = numSchema.equal(x); - numSchema = numSchema.equal(x, x); - numSchema = numSchema.equal([x, x, x]); - numSchema = numSchema.invalid(x); - numSchema = numSchema.invalid(x, x); - numSchema = numSchema.invalid([x, x, x]); - numSchema = numSchema.disallow(x); - numSchema = numSchema.disallow(x, x); - numSchema = numSchema.disallow([x, x, x]); - numSchema = numSchema.not(x); - numSchema = numSchema.not(x, x); - numSchema = numSchema.not([x, x, x]); - - numSchema = numSchema.default(x); - - numSchema = numSchema.required(); - numSchema = numSchema.optional(); - numSchema = numSchema.forbidden(); - - numSchema = numSchema.description(str); - numSchema = numSchema.notes(str); - numSchema = numSchema.notes(strArr); - numSchema = numSchema.tags(str); - numSchema = numSchema.tags(strArr); - - numSchema = numSchema.meta(obj); - numSchema = numSchema.example(obj); - numSchema = numSchema.unit(str); - - numSchema = numSchema.options(validOpts); - numSchema = numSchema.strict(); - numSchema = numSchema.concat(x); - - altSchema = numSchema.when(str, whenOpts); - altSchema = numSchema.when(ref, whenOpts); -} - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -objSchema = Joi.object(); -objSchema = Joi.object(schemaMap); - -objSchema = objSchema.keys(); -objSchema = objSchema.keys(schemaMap); - -objSchema = objSchema.min(num); -objSchema = objSchema.max(num); -objSchema = objSchema.length(num); - -objSchema = objSchema.pattern(exp, schema); - -objSchema = objSchema.and(str); -objSchema = objSchema.and(str, str); -objSchema = objSchema.and(str, str, str); -objSchema = objSchema.and(strArr); - -objSchema = objSchema.nand(str); -objSchema = objSchema.nand(str, str); -objSchema = objSchema.nand(str, str, str); -objSchema = objSchema.nand(strArr); - -objSchema = objSchema.or(str); -objSchema = objSchema.or(str, str); -objSchema = objSchema.or(str, str, str); -objSchema = objSchema.or(strArr); - -objSchema = objSchema.xor(str); -objSchema = objSchema.xor(str, str); -objSchema = objSchema.xor(str, str, str); -objSchema = objSchema.xor(strArr); - -objSchema = objSchema.with(str, str); -objSchema = objSchema.with(str, strArr); - -objSchema = objSchema.without(str, str); -objSchema = objSchema.without(str, strArr); - -objSchema = objSchema.rename(str, str); -objSchema = objSchema.rename(str, str, renOpts); - -objSchema = objSchema.assert(str, schema); -objSchema = objSchema.assert(str, schema, str); -objSchema = objSchema.assert(ref, schema); -objSchema = objSchema.assert(ref, schema, str); - -objSchema = objSchema.unknown(); -objSchema = objSchema.unknown(bool); - -objSchema = objSchema.type(func); -objSchema = objSchema.type(func, str); - -objSchema = objSchema.requiredKeys(str); -objSchema = objSchema.requiredKeys(str, str); -objSchema = objSchema.requiredKeys(strArr); - -objSchema = objSchema.optionalKeys(str); -objSchema = objSchema.optionalKeys(str, str); -objSchema = objSchema.optionalKeys(strArr); - -namespace common { - objSchema = objSchema.allow(x); - objSchema = objSchema.allow(x, x); - objSchema = objSchema.allow([x, x, x]); - objSchema = objSchema.valid(x); - objSchema = objSchema.valid(x, x); - objSchema = objSchema.valid([x, x, x]); - objSchema = objSchema.only(x); - objSchema = objSchema.only(x, x); - objSchema = objSchema.only([x, x, x]); - objSchema = objSchema.equal(x); - objSchema = objSchema.equal(x, x); - objSchema = objSchema.equal([x, x, x]); - objSchema = objSchema.invalid(x); - objSchema = objSchema.invalid(x, x); - objSchema = objSchema.invalid([x, x, x]); - objSchema = objSchema.disallow(x); - objSchema = objSchema.disallow(x, x); - objSchema = objSchema.disallow([x, x, x]); - objSchema = objSchema.not(x); - objSchema = objSchema.not(x, x); - objSchema = objSchema.not([x, x, x]); - - objSchema = objSchema.default(x); - - objSchema = objSchema.required(); - objSchema = objSchema.optional(); - objSchema = objSchema.forbidden(); - - objSchema = objSchema.description(str); - objSchema = objSchema.notes(str); - objSchema = objSchema.notes(strArr); - objSchema = objSchema.tags(str); - objSchema = objSchema.tags(strArr); - - objSchema = objSchema.meta(obj); - objSchema = objSchema.example(obj); - objSchema = objSchema.unit(str); - - objSchema = objSchema.options(validOpts); - objSchema = objSchema.strict(); - objSchema = objSchema.concat(x); - - altSchema = objSchema.when(str, whenOpts); - altSchema = objSchema.when(ref, whenOpts); -} - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -strSchema = Joi.string(); - -strSchema = strSchema.insensitive(); -strSchema = strSchema.min(num); -strSchema = strSchema.min(num, str); -strSchema = strSchema.min(ref); -strSchema = strSchema.min(ref, str); -strSchema = strSchema.max(num); -strSchema = strSchema.max(num, str); -strSchema = strSchema.max(ref); -strSchema = strSchema.max(ref, str); -strSchema = strSchema.creditCard(); -strSchema = strSchema.length(num); -strSchema = strSchema.length(num, str); -strSchema = strSchema.length(ref); -strSchema = strSchema.length(ref, str); -strSchema = strSchema.regex(exp); -strSchema = strSchema.regex(exp, str); -strSchema = strSchema.replace(exp, str); -strSchema = strSchema.replace(str, str); -strSchema = strSchema.alphanum(); -strSchema = strSchema.token(); -strSchema = strSchema.email(); -strSchema = strSchema.email(emailOpts); -strSchema = strSchema.ip(); -strSchema = strSchema.ip(ipOpts); -strSchema = strSchema.uri(); -strSchema = strSchema.uri(uriOpts); -strSchema = strSchema.guid(); -strSchema = strSchema.guid({version: ['uuidv1', 'uuidv2', 'uuidv3', 'uuidv4', 'uuidv5']}); -strSchema = strSchema.guid({version: 'uuidv4'}); -strSchema = strSchema.hex(); -strSchema = strSchema.hostname(); -strSchema = strSchema.isoDate(); -strSchema = strSchema.lowercase(); -strSchema = strSchema.uppercase(); -strSchema = strSchema.trim(); - -namespace common { - strSchema = strSchema.allow(x); - strSchema = strSchema.allow(x, x); - strSchema = strSchema.allow([x, x, x]); - strSchema = strSchema.valid(x); - strSchema = strSchema.valid(x, x); - strSchema = strSchema.valid([x, x, x]); - strSchema = strSchema.only(x); - strSchema = strSchema.only(x, x); - strSchema = strSchema.only([x, x, x]); - strSchema = strSchema.equal(x); - strSchema = strSchema.equal(x, x); - strSchema = strSchema.equal([x, x, x]); - strSchema = strSchema.invalid(x); - strSchema = strSchema.invalid(x, x); - strSchema = strSchema.invalid([x, x, x]); - strSchema = strSchema.disallow(x); - strSchema = strSchema.disallow(x, x); - strSchema = strSchema.disallow([x, x, x]); - strSchema = strSchema.not(x); - strSchema = strSchema.not(x, x); - strSchema = strSchema.not([x, x, x]); - - strSchema = strSchema.default(x); - - strSchema = strSchema.required(); - strSchema = strSchema.optional(); - strSchema = strSchema.forbidden(); - - strSchema = strSchema.description(str); - strSchema = strSchema.notes(str); - strSchema = strSchema.notes(strArr); - strSchema = strSchema.tags(str); - strSchema = strSchema.tags(strArr); - - strSchema = strSchema.meta(obj); - strSchema = strSchema.example(obj); - strSchema = strSchema.unit(str); - - strSchema = strSchema.options(validOpts); - strSchema = strSchema.strict(); - strSchema = strSchema.concat(x); - - altSchema = strSchema.when(str, whenOpts); - altSchema = strSchema.when(ref, whenOpts); -} - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -schema = Joi.alternatives(); -schema = Joi.alternatives().try(schemaArr); -schema = Joi.alternatives().try(schema, schema); - -schema = Joi.alternatives(schemaArr); -schema = Joi.alternatives(schema, anySchema, boolSchema); - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -schema = Joi.lazy(() => schema) - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -namespace validate_tests { - { - Joi.validate(value, obj); - Joi.validate(value, schema); - Joi.validate(value, schema, validOpts); - Joi.validate(value, schema, validOpts, (err, value) => { - x = value; - str = err.message; - str = err.details[0].path; - str = err.details[0].message; - str = err.details[0].type; - }); - Joi.validate(value, schema, (err, value) => { - x = value; - str = err.message; - str = err.details[0].path; - str = err.details[0].message; - str = err.details[0].type; - }); - // variant - Joi.validate(num, schema, validOpts, (err, value) => { - num = value; - }); - - // plain opts - Joi.validate(value, {}); - } - - { - let value = { username: 'example', password: 'example' }; - let schema = Joi.object().keys({ - username: Joi.string().max(255).required(), - password: Joi.string().regex(/^[a-zA-Z0-9]{3,255}$/).required(), - }); - let returnValue: Joi.ValidationResult; - - returnValue = Joi.validate(value); - value = Joi.validate(value, (err, value) => value); - - returnValue = Joi.validate(value, schema); - returnValue = Joi.validate(value, obj); - value = Joi.validate(value, obj, (err, value) => value); - value = Joi.validate(value, schema, (err, value) => value); - - returnValue = Joi.validate(value, schema, validOpts); - returnValue = Joi.validate(value, obj, validOpts); - value = Joi.validate(value, obj, validOpts, (err, value) => value); - value = Joi.validate(value, schema, validOpts, (err, value) => value); - } -} - - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -schema = Joi.compile(obj); - -Joi.assert(obj, schema); -Joi.assert(obj, schema, str); -Joi.assert(obj, schema, err); - -Joi.attempt(obj, schema); -Joi.attempt(obj, schema, str); -Joi.attempt(obj, schema, err); - -ref = Joi.ref(str, refOpts); -ref = Joi.ref(str); - -Joi.isRef(ref); - -schema = Joi.reach(schema, ''); - -const Joi2 = Joi.extend({ name: '', base: schema }); - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -schema = Joi.allow(x, x); -schema = Joi.allow([x, x, x]); -schema = Joi.valid(x); -schema = Joi.valid(x, x); -schema = Joi.valid([x, x, x]); -schema = Joi.only(x); -schema = Joi.only(x, x); -schema = Joi.only([x, x, x]); -schema = Joi.equal(x); -schema = Joi.equal(x, x); -schema = Joi.equal([x, x, x]); -schema = Joi.invalid(x); -schema = Joi.invalid(x, x); -schema = Joi.invalid([x, x, x]); -schema = Joi.disallow(x); -schema = Joi.disallow(x, x); -schema = Joi.disallow([x, x, x]); -schema = Joi.not(x); -schema = Joi.not(x, x); -schema = Joi.not([x, x, x]); - -schema = Joi.required(); -schema = Joi.optional(); -schema = Joi.forbidden(); -schema = Joi.strip(); - -schema = Joi.description(str); -schema = Joi.notes(str); -schema = Joi.notes(strArr); -schema = Joi.tags(str); -schema = Joi.tags(strArr); - -schema = Joi.meta(obj); -schema = Joi.example(obj); -schema = Joi.unit(str); - -schema = Joi.options(validOpts); -schema = Joi.strict(); -schema = Joi.strict(bool); -schema = Joi.concat(x); - -schema = Joi.when(str, whenOpts); -schema = Joi.when(ref, whenOpts); - -schema = Joi.label(str); -schema = Joi.raw(); -schema = Joi.raw(bool); -schema = Joi.empty(); -schema = Joi.empty(str); -schema = Joi.empty(anySchema); diff --git a/joi/v6/joi-tests.ts b/joi/v6/joi-tests.ts deleted file mode 100644 index 265bbd045c..0000000000 --- a/joi/v6/joi-tests.ts +++ /dev/null @@ -1,774 +0,0 @@ -/// -/// - -import Joi = require('joi'); - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -var x: any = null; -var value: any = null; -var num: number = 0; -var str: string = ''; -var bool: boolean = false; -var exp: RegExp = null; -var obj: Object = null; -var date: Date = null; -var bin: NodeBuffer = null; -var err: Error = null; -var func: Function = null; - -var anyArr: any[] = []; -var numArr: number[] = []; -var strArr: string[] = []; -var boolArr: boolean[] = []; -var expArr: RegExp[] = []; -var objArr: Object[] = []; -var bufArr: NodeBuffer[] = []; -var errArr: Error[] = []; -var funcArr: Function[] = []; - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -var schema: Joi.Schema = null; - -var anySchema: Joi.AnySchema = null; -var numSchema: Joi.NumberSchema = null; -var strSchema: Joi.StringSchema = null; -var arrSchema: Joi.ArraySchema = null; -var boolSchema: Joi.BooleanSchema = null; -var binSchema: Joi.BinarySchema = null; -var dateSchema: Joi.DateSchema = null; -var funcSchema: Joi.FunctionSchema = null; -var objSchema: Joi.ObjectSchema = null; -var altSchema: Joi.AlternativesSchema = null; - -var schemaArr: Joi.Schema[] = []; - -var ref: Joi.Reference = null; - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -var validOpts: Joi.ValidationOptions = null; - -validOpts = {abortEarly: bool}; -validOpts = {convert: bool}; -validOpts = {allowUnknown: bool}; -validOpts = {skipFunctions: bool}; -validOpts = {stripUnknown: bool}; -validOpts = {language: bool}; -validOpts = {presence: str}; -validOpts = {context: obj}; - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -var renOpts: Joi.RenameOptions = null; - -renOpts = {alias: bool}; -renOpts = {multiple: bool}; -renOpts = {override: bool}; -renOpts = {ignoreUndefined: bool}; - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -var emailOpts: Joi.EmailOptions = null; - -emailOpts = {errorLevel: num}; -emailOpts = {errorLevel: bool}; -emailOpts = {tldWhitelist: strArr}; -emailOpts = {tldWhitelist: obj}; -emailOpts = {minDomainAtoms: num}; - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -var ipOpts: Joi.IpOptions = null; - -ipOpts = {version: str}; -ipOpts = {version: strArr}; -ipOpts = {cidr: str}; - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -var uriOpts: Joi.UriOptions = null; - -uriOpts = {scheme: str}; -uriOpts = {scheme: exp}; -uriOpts = {scheme: strArr}; -uriOpts = {scheme: expArr}; - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -var whenOpts: Joi.WhenOptions = null; - -whenOpts = {is: x}; -whenOpts = {is: schema, then: schema}; -whenOpts = {is: schema, otherwise: schema}; - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -var refOpts: Joi.ReferenceOptions = null; - -refOpts = {separator: str}; -refOpts = {contextPrefix: str}; - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -var validErr: Joi.ValidationError = null; -var validErrItem: Joi.ValidationErrorItem; - -validErrItem= { - message: str, - type: str, - path: str -}; - -validErrItem = { - message: str, - type: str, - path: str, - options: validOpts -}; - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -schema = anySchema; -schema = numSchema; -schema = strSchema; -schema = arrSchema; -schema = boolSchema; -schema = binSchema; -schema = dateSchema; -schema = funcSchema; -schema = objSchema; - -schema = ref; - -anySchema = anySchema; -anySchema = numSchema; -anySchema = strSchema; -anySchema = arrSchema; -anySchema = boolSchema; -anySchema = binSchema; -anySchema = dateSchema; -anySchema = funcSchema; -anySchema = objSchema; - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -var schemaMap: Joi.SchemaMap = null; - -schemaMap = { - a: numSchema, - b: strSchema -}; - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -anySchema = Joi.any(); - -namespace common { - anySchema = anySchema.allow(x); - anySchema = anySchema.allow(x, x); - anySchema = anySchema.allow([x, x, x]); - anySchema = anySchema.valid(x); - anySchema = anySchema.valid(x, x); - anySchema = anySchema.valid([x, x, x]); - anySchema = anySchema.only(x); - anySchema = anySchema.only(x, x); - anySchema = anySchema.only([x, x, x]); - anySchema = anySchema.equal(x); - anySchema = anySchema.equal(x, x); - anySchema = anySchema.equal([x, x, x]); - anySchema = anySchema.invalid(x); - anySchema = anySchema.invalid(x, x); - anySchema = anySchema.invalid([x, x, x]); - anySchema = anySchema.disallow(x); - anySchema = anySchema.disallow(x, x); - anySchema = anySchema.disallow([x, x, x]); - anySchema = anySchema.not(x); - anySchema = anySchema.not(x, x); - anySchema = anySchema.not([x, x, x]); - - anySchema = anySchema.default(); - anySchema = anySchema.default(x); - anySchema = anySchema.default(x, str); - - anySchema = anySchema.required(); - anySchema = anySchema.optional(); - anySchema = anySchema.forbidden(); - anySchema = anySchema.strip(); - - anySchema = anySchema.description(str); - anySchema = anySchema.notes(str); - anySchema = anySchema.notes(strArr); - anySchema = anySchema.tags(str); - anySchema = anySchema.tags(strArr); - - anySchema = anySchema.meta(obj); - anySchema = anySchema.example(obj); - anySchema = anySchema.unit(str); - - anySchema = anySchema.options(validOpts); - anySchema = anySchema.strict(); - anySchema = anySchema.strict(bool); - anySchema = anySchema.concat(x); - - altSchema = anySchema.when(str, whenOpts); - altSchema = anySchema.when(ref, whenOpts); - - anySchema = anySchema.label(str); - anySchema = anySchema.raw(); - anySchema = anySchema.raw(bool); - anySchema = anySchema.empty(); - anySchema = anySchema.empty(str); - anySchema = anySchema.empty(anySchema); -} - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -arrSchema = Joi.array(); - -arrSchema = arrSchema.sparse(); -arrSchema = arrSchema.sparse(bool); -arrSchema = arrSchema.single(); -arrSchema = arrSchema.single(bool); -arrSchema = arrSchema.min(num); -arrSchema = arrSchema.max(num); -arrSchema = arrSchema.length(num); -arrSchema = arrSchema.unique(); - -arrSchema = arrSchema.items(numSchema); -arrSchema = arrSchema.items(numSchema, strSchema); -arrSchema = arrSchema.items([numSchema, strSchema]); - - -// - - - - - - - - - -namespace common_copy_paste { - // use search & replace from any - arrSchema = arrSchema.allow(x); - arrSchema = arrSchema.allow(x, x); - arrSchema = arrSchema.allow([x, x, x]); - arrSchema = arrSchema.valid(x); - arrSchema = arrSchema.valid(x, x); - arrSchema = arrSchema.valid([x, x, x]); - arrSchema = arrSchema.only(x); - arrSchema = arrSchema.only(x, x); - arrSchema = arrSchema.only([x, x, x]); - arrSchema = arrSchema.equal(x); - arrSchema = arrSchema.equal(x, x); - arrSchema = arrSchema.equal([x, x, x]); - arrSchema = arrSchema.invalid(x); - arrSchema = arrSchema.invalid(x, x); - arrSchema = arrSchema.invalid([x, x, x]); - arrSchema = arrSchema.disallow(x); - arrSchema = arrSchema.disallow(x, x); - arrSchema = arrSchema.disallow([x, x, x]); - arrSchema = arrSchema.not(x); - arrSchema = arrSchema.not(x, x); - arrSchema = arrSchema.not([x, x, x]); - - arrSchema = arrSchema.default(x); - - arrSchema = arrSchema.required(); - arrSchema = arrSchema.optional(); - arrSchema = arrSchema.forbidden(); - - arrSchema = arrSchema.description(str); - arrSchema = arrSchema.notes(str); - arrSchema = arrSchema.notes(strArr); - arrSchema = arrSchema.tags(str); - arrSchema = arrSchema.tags(strArr); - - arrSchema = arrSchema.meta(obj); - arrSchema = arrSchema.example(obj); - arrSchema = arrSchema.unit(str); - - arrSchema = arrSchema.options(validOpts); - arrSchema = arrSchema.strict(); - arrSchema = arrSchema.concat(x); - - altSchema = arrSchema.when(str, whenOpts); - altSchema = arrSchema.when(ref, whenOpts); -} - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -boolSchema = Joi.bool(); -boolSchema = Joi.boolean(); - -namespace common_copy_paste { - boolSchema = boolSchema.allow(x); - boolSchema = boolSchema.allow(x, x); - boolSchema = boolSchema.allow([x, x, x]); - boolSchema = boolSchema.valid(x); - boolSchema = boolSchema.valid(x, x); - boolSchema = boolSchema.valid([x, x, x]); - boolSchema = boolSchema.only(x); - boolSchema = boolSchema.only(x, x); - boolSchema = boolSchema.only([x, x, x]); - boolSchema = boolSchema.equal(x); - boolSchema = boolSchema.equal(x, x); - boolSchema = boolSchema.equal([x, x, x]); - boolSchema = boolSchema.invalid(x); - boolSchema = boolSchema.invalid(x, x); - boolSchema = boolSchema.invalid([x, x, x]); - boolSchema = boolSchema.disallow(x); - boolSchema = boolSchema.disallow(x, x); - boolSchema = boolSchema.disallow([x, x, x]); - boolSchema = boolSchema.not(x); - boolSchema = boolSchema.not(x, x); - boolSchema = boolSchema.not([x, x, x]); - - boolSchema = boolSchema.default(x); - - boolSchema = boolSchema.required(); - boolSchema = boolSchema.optional(); - boolSchema = boolSchema.forbidden(); - - boolSchema = boolSchema.description(str); - boolSchema = boolSchema.notes(str); - boolSchema = boolSchema.notes(strArr); - boolSchema = boolSchema.tags(str); - boolSchema = boolSchema.tags(strArr); - - boolSchema = boolSchema.meta(obj); - boolSchema = boolSchema.example(obj); - boolSchema = boolSchema.unit(str); - - boolSchema = boolSchema.options(validOpts); - boolSchema = boolSchema.strict(); - boolSchema = boolSchema.concat(x); - - altSchema = boolSchema.when(str, whenOpts); - altSchema = boolSchema.when(ref, whenOpts); -} - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -binSchema = Joi.binary(); - -binSchema = binSchema.encoding(str); -binSchema = binSchema.min(num); -binSchema = binSchema.max(num); -binSchema = binSchema.length(num); - -namespace common { - binSchema = binSchema.allow(x); - binSchema = binSchema.allow(x, x); - binSchema = binSchema.allow([x, x, x]); - binSchema = binSchema.valid(x); - binSchema = binSchema.valid(x, x); - binSchema = binSchema.valid([x, x, x]); - binSchema = binSchema.only(x); - binSchema = binSchema.only(x, x); - binSchema = binSchema.only([x, x, x]); - binSchema = binSchema.equal(x); - binSchema = binSchema.equal(x, x); - binSchema = binSchema.equal([x, x, x]); - binSchema = binSchema.invalid(x); - binSchema = binSchema.invalid(x, x); - binSchema = binSchema.invalid([x, x, x]); - binSchema = binSchema.disallow(x); - binSchema = binSchema.disallow(x, x); - binSchema = binSchema.disallow([x, x, x]); - binSchema = binSchema.not(x); - binSchema = binSchema.not(x, x); - binSchema = binSchema.not([x, x, x]); - - binSchema = binSchema.default(x); - - binSchema = binSchema.required(); - binSchema = binSchema.optional(); - binSchema = binSchema.forbidden(); - - binSchema = binSchema.description(str); - binSchema = binSchema.notes(str); - binSchema = binSchema.notes(strArr); - binSchema = binSchema.tags(str); - binSchema = binSchema.tags(strArr); - - binSchema = binSchema.meta(obj); - binSchema = binSchema.example(obj); - binSchema = binSchema.unit(str); - - binSchema = binSchema.options(validOpts); - binSchema = binSchema.strict(); - binSchema = binSchema.concat(x); - - altSchema = binSchema.when(str, whenOpts); - altSchema = binSchema.when(ref, whenOpts); -} - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -dateSchema = Joi.date(); - -dateSchema = dateSchema.min(date); -dateSchema = dateSchema.max(date); - -dateSchema = dateSchema.min(str); -dateSchema = dateSchema.max(str); - -dateSchema = dateSchema.min(num); -dateSchema = dateSchema.max(num); - -dateSchema = dateSchema.min(ref); -dateSchema = dateSchema.max(ref); - -dateSchema = dateSchema.format(str); -dateSchema = dateSchema.format(strArr); - -dateSchema = dateSchema.iso(); - -namespace common { - dateSchema = dateSchema.allow(x); - dateSchema = dateSchema.allow(x, x); - dateSchema = dateSchema.allow([x, x, x]); - dateSchema = dateSchema.valid(x); - dateSchema = dateSchema.valid(x, x); - dateSchema = dateSchema.valid([x, x, x]); - dateSchema = dateSchema.only(x); - dateSchema = dateSchema.only(x, x); - dateSchema = dateSchema.only([x, x, x]); - dateSchema = dateSchema.equal(x); - dateSchema = dateSchema.equal(x, x); - dateSchema = dateSchema.equal([x, x, x]); - dateSchema = dateSchema.invalid(x); - dateSchema = dateSchema.invalid(x, x); - dateSchema = dateSchema.invalid([x, x, x]); - dateSchema = dateSchema.disallow(x); - dateSchema = dateSchema.disallow(x, x); - dateSchema = dateSchema.disallow([x, x, x]); - dateSchema = dateSchema.not(x); - dateSchema = dateSchema.not(x, x); - dateSchema = dateSchema.not([x, x, x]); - - dateSchema = dateSchema.default(x); - - dateSchema = dateSchema.required(); - dateSchema = dateSchema.optional(); - dateSchema = dateSchema.forbidden(); - - dateSchema = dateSchema.description(str); - dateSchema = dateSchema.notes(str); - dateSchema = dateSchema.notes(strArr); - dateSchema = dateSchema.tags(str); - dateSchema = dateSchema.tags(strArr); - - dateSchema = dateSchema.meta(obj); - dateSchema = dateSchema.example(obj); - dateSchema = dateSchema.unit(str); - - dateSchema = dateSchema.options(validOpts); - dateSchema = dateSchema.strict(); - dateSchema = dateSchema.concat(x); - - altSchema = dateSchema.when(str, whenOpts); - altSchema = dateSchema.when(ref, whenOpts); -} - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -funcSchema = Joi.func(); - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -numSchema = Joi.number(); - -numSchema = numSchema.min(num); -numSchema = numSchema.min(ref); -numSchema = numSchema.max(num); -numSchema = numSchema.max(ref); -numSchema = numSchema.greater(num); -numSchema = numSchema.greater(ref); -numSchema = numSchema.less(num); -numSchema = numSchema.less(ref); -numSchema = numSchema.integer(); -numSchema = numSchema.precision(num); -numSchema = numSchema.multiple(num); -numSchema = numSchema.positive(); -numSchema = numSchema.negative(); - -namespace common { - numSchema = numSchema.allow(x); - numSchema = numSchema.allow(x, x); - numSchema = numSchema.allow([x, x, x]); - numSchema = numSchema.valid(x); - numSchema = numSchema.valid(x, x); - numSchema = numSchema.valid([x, x, x]); - numSchema = numSchema.only(x); - numSchema = numSchema.only(x, x); - numSchema = numSchema.only([x, x, x]); - numSchema = numSchema.equal(x); - numSchema = numSchema.equal(x, x); - numSchema = numSchema.equal([x, x, x]); - numSchema = numSchema.invalid(x); - numSchema = numSchema.invalid(x, x); - numSchema = numSchema.invalid([x, x, x]); - numSchema = numSchema.disallow(x); - numSchema = numSchema.disallow(x, x); - numSchema = numSchema.disallow([x, x, x]); - numSchema = numSchema.not(x); - numSchema = numSchema.not(x, x); - numSchema = numSchema.not([x, x, x]); - - numSchema = numSchema.default(x); - - numSchema = numSchema.required(); - numSchema = numSchema.optional(); - numSchema = numSchema.forbidden(); - - numSchema = numSchema.description(str); - numSchema = numSchema.notes(str); - numSchema = numSchema.notes(strArr); - numSchema = numSchema.tags(str); - numSchema = numSchema.tags(strArr); - - numSchema = numSchema.meta(obj); - numSchema = numSchema.example(obj); - numSchema = numSchema.unit(str); - - numSchema = numSchema.options(validOpts); - numSchema = numSchema.strict(); - numSchema = numSchema.concat(x); - - altSchema = numSchema.when(str, whenOpts); - altSchema = numSchema.when(ref, whenOpts); -} - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -objSchema = Joi.object(); -objSchema = Joi.object(schemaMap); - -objSchema = objSchema.keys(); -objSchema = objSchema.keys(schemaMap); - -objSchema = objSchema.min(num); -objSchema = objSchema.max(num); -objSchema = objSchema.length(num); - -objSchema = objSchema.pattern(exp, schema); - -objSchema = objSchema.and(str); -objSchema = objSchema.and(str, str); -objSchema = objSchema.and(str, str, str); -objSchema = objSchema.and(strArr); - -objSchema = objSchema.nand(str); -objSchema = objSchema.nand(str, str); -objSchema = objSchema.nand(str, str, str); -objSchema = objSchema.nand(strArr); - -objSchema = objSchema.or(str); -objSchema = objSchema.or(str, str); -objSchema = objSchema.or(str, str, str); -objSchema = objSchema.or(strArr); - -objSchema = objSchema.xor(str); -objSchema = objSchema.xor(str, str); -objSchema = objSchema.xor(str, str, str); -objSchema = objSchema.xor(strArr); - -objSchema = objSchema.with(str, str); -objSchema = objSchema.with(str, strArr); - -objSchema = objSchema.without(str, str); -objSchema = objSchema.without(str, strArr); - -objSchema = objSchema.rename(str, str); -objSchema = objSchema.rename(str, str, renOpts); - -objSchema = objSchema.assert(str, schema); -objSchema = objSchema.assert(str, schema, str); -objSchema = objSchema.assert(ref, schema); -objSchema = objSchema.assert(ref, schema, str); - -objSchema = objSchema.unknown(); -objSchema = objSchema.unknown(bool); - -objSchema = objSchema.type(func); -objSchema = objSchema.type(func, str); - -objSchema = objSchema.requiredKeys(str); -objSchema = objSchema.requiredKeys(str, str); -objSchema = objSchema.requiredKeys(strArr); - -objSchema = objSchema.optionalKeys(str); -objSchema = objSchema.optionalKeys(str, str); -objSchema = objSchema.optionalKeys(strArr); - -namespace common { - objSchema = objSchema.allow(x); - objSchema = objSchema.allow(x, x); - objSchema = objSchema.allow([x, x, x]); - objSchema = objSchema.valid(x); - objSchema = objSchema.valid(x, x); - objSchema = objSchema.valid([x, x, x]); - objSchema = objSchema.only(x); - objSchema = objSchema.only(x, x); - objSchema = objSchema.only([x, x, x]); - objSchema = objSchema.equal(x); - objSchema = objSchema.equal(x, x); - objSchema = objSchema.equal([x, x, x]); - objSchema = objSchema.invalid(x); - objSchema = objSchema.invalid(x, x); - objSchema = objSchema.invalid([x, x, x]); - objSchema = objSchema.disallow(x); - objSchema = objSchema.disallow(x, x); - objSchema = objSchema.disallow([x, x, x]); - objSchema = objSchema.not(x); - objSchema = objSchema.not(x, x); - objSchema = objSchema.not([x, x, x]); - - objSchema = objSchema.default(x); - - objSchema = objSchema.required(); - objSchema = objSchema.optional(); - objSchema = objSchema.forbidden(); - - objSchema = objSchema.description(str); - objSchema = objSchema.notes(str); - objSchema = objSchema.notes(strArr); - objSchema = objSchema.tags(str); - objSchema = objSchema.tags(strArr); - - objSchema = objSchema.meta(obj); - objSchema = objSchema.example(obj); - objSchema = objSchema.unit(str); - - objSchema = objSchema.options(validOpts); - objSchema = objSchema.strict(); - objSchema = objSchema.concat(x); - - altSchema = objSchema.when(str, whenOpts); - altSchema = objSchema.when(ref, whenOpts); -} - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -strSchema = Joi.string(); - -strSchema = strSchema.insensitive(); -strSchema = strSchema.min(num); -strSchema = strSchema.min(num, str); -strSchema = strSchema.min(ref); -strSchema = strSchema.min(ref, str); -strSchema = strSchema.max(num); -strSchema = strSchema.max(num, str); -strSchema = strSchema.max(ref); -strSchema = strSchema.max(ref, str); -strSchema = strSchema.creditCard(); -strSchema = strSchema.length(num); -strSchema = strSchema.length(num, str); -strSchema = strSchema.length(ref); -strSchema = strSchema.length(ref, str); -strSchema = strSchema.regex(exp); -strSchema = strSchema.regex(exp, str); -strSchema = strSchema.replace(exp, str); -strSchema = strSchema.replace(str, str); -strSchema = strSchema.alphanum(); -strSchema = strSchema.token(); -strSchema = strSchema.email(); -strSchema = strSchema.email(emailOpts); -strSchema = strSchema.ip(); -strSchema = strSchema.ip(ipOpts); -strSchema = strSchema.uri(); -strSchema = strSchema.uri(uriOpts); -strSchema = strSchema.guid(); -strSchema = strSchema.hex(); -strSchema = strSchema.hostname(); -strSchema = strSchema.isoDate(); -strSchema = strSchema.lowercase(); -strSchema = strSchema.uppercase(); -strSchema = strSchema.trim(); - -namespace common { - strSchema = strSchema.allow(x); - strSchema = strSchema.allow(x, x); - strSchema = strSchema.allow([x, x, x]); - strSchema = strSchema.valid(x); - strSchema = strSchema.valid(x, x); - strSchema = strSchema.valid([x, x, x]); - strSchema = strSchema.only(x); - strSchema = strSchema.only(x, x); - strSchema = strSchema.only([x, x, x]); - strSchema = strSchema.equal(x); - strSchema = strSchema.equal(x, x); - strSchema = strSchema.equal([x, x, x]); - strSchema = strSchema.invalid(x); - strSchema = strSchema.invalid(x, x); - strSchema = strSchema.invalid([x, x, x]); - strSchema = strSchema.disallow(x); - strSchema = strSchema.disallow(x, x); - strSchema = strSchema.disallow([x, x, x]); - strSchema = strSchema.not(x); - strSchema = strSchema.not(x, x); - strSchema = strSchema.not([x, x, x]); - - strSchema = strSchema.default(x); - - strSchema = strSchema.required(); - strSchema = strSchema.optional(); - strSchema = strSchema.forbidden(); - - strSchema = strSchema.description(str); - strSchema = strSchema.notes(str); - strSchema = strSchema.notes(strArr); - strSchema = strSchema.tags(str); - strSchema = strSchema.tags(strArr); - - strSchema = strSchema.meta(obj); - strSchema = strSchema.example(obj); - strSchema = strSchema.unit(str); - - strSchema = strSchema.options(validOpts); - strSchema = strSchema.strict(); - strSchema = strSchema.concat(x); - - altSchema = strSchema.when(str, whenOpts); - altSchema = strSchema.when(ref, whenOpts); -} - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -schema = Joi.alternatives(schemaArr); -schema = Joi.alternatives(schema, anySchema, boolSchema); - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -Joi.validate(value, obj); -Joi.validate(value, schema); -Joi.validate(value, schema, validOpts); -Joi.validate(value, schema, validOpts, (err, value) => { - x = value; - str = err.message; - str = err.details[0].path; - str = err.details[0].message; - str = err.details[0].type; -}); -Joi.validate(value, schema, (err, value) => { - x = value; - str = err.message; - str = err.details[0].path; - str = err.details[0].message; - str = err.details[0].type; -}); -// variant -Joi.validate(num, schema, validOpts, (err, value) => { - num = value; -}); - -// plain opts -Joi.validate(value, {}); - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -schema = Joi.compile(obj); - -Joi.assert(obj, schema); -Joi.assert(obj, schema, str); -Joi.assert(obj, schema, err); - -ref = Joi.ref(str, refOpts); -ref = Joi.ref(str); diff --git a/jointjs/index.d.ts b/jointjs/index.d.ts deleted file mode 100644 index 95e2b2b7e3..0000000000 --- a/jointjs/index.d.ts +++ /dev/null @@ -1,896 +0,0 @@ -// Type definitions for Joint JS 1.0.1 -// Project: http://www.jointjs.com/ -// Definitions by: Aidan Reel , David Durman , Ewout Van Gossum , Federico Caselli , Chris Moran -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// typings: https://github.com/CaselIT/typings-jointjs - -/// - - -declare namespace joint { - export var g: any; - export var V: any; - - namespace dia { - interface Size { - width: number; - height: number; - } - - interface Point { - x: number; - y: number; - } - - interface BBox extends Point, Size { } - - interface TranslateOptions { - restrictedArea?: BBox; - transition?: TransitionOptions; - } - - interface TransitionOptions { - delay?: number; - duration?: number; - timingFunction?: (t: number) => number; - valueFunction?: (a: any, b: any) => (t: number) => any; - } - - interface DfsBfsOptions { - inbound?: boolean; - outbound?: boolean; - deep?: boolean; - } - - interface ExploreOptions { - breadthFirst?: boolean; - deep?: boolean; - } - - class Graph extends Backbone.Model { - constructor(attributes?: any, options?: { cellNamespace: any }); - addCell(cell: Cell | Cell[]): this; - addCells(cells: Cell[]): this; - resetCells(cells: Cell[], options?: any): this; - getCell(id: string): Cell; - getElements(): Element[]; - getLinks(): Link[]; - getCells(): Cell[]; - getFirstCell(): Cell; - getLastCell(): Cell; - getConnectedLinks(element: Cell, options?: { inbound?: boolean, outbound?: boolean, deep?: boolean }): Link[]; - disconnectLinks(cell: Cell, options?: any): void; - removeLinks(cell: Cell, options?: any): void; - translate(tx: number, ty?: number, options?: TranslateOptions): void; - cloneCells(cells: Cell[]): { [id: string]: Cell }; - getSubgraph(cells: Cell[], options?: { deep?: boolean }): Cell[]; - cloneSubgraph(cells: Cell[], options?: { deep?: boolean }): { [id: string]: Cell }; - dfs(element: Element, iteratee: (element: Element, distance: number) => boolean, options?: DfsBfsOptions, visited?: Object, distance?: number): void; - bfs(element: Element, iteratee: (element: Element, distance: number) => boolean, options?: DfsBfsOptions): void; - search(element: Element, iteratee: (element: Element, distance: number) => boolean, options?: { breadthFirst?: boolean }): void; - getSuccessors(element: Element, options?: ExploreOptions): Element[]; - getPredecessors(element: Element, options?: ExploreOptions): Element[]; - isSuccessor(elementA: Element, elementB: Element): boolean; - isPredecessor(elementA: Element, elementB: Element): boolean; - isSource(element: Element): boolean; - isSink(element: Element): boolean; - getSources(): Element[]; - getSinks(): Element[]; - getNeighbors(element: Element, options?: DfsBfsOptions): Element[]; - isNeighbor(elementA: Element, elementB: Element, options?: { inbound?: boolean, outbound?: boolean; }): boolean; - getCommonAncestor(...cells: Cell[]): Element; - toJSON(): any; - fromJSON(json: any, options?: any): this; - clear(options?: any): this; - findModelsFromPoint(rect: BBox): Element[]; - findModelsUnderElement(element: Element, options?: { searchBy?: 'bbox' | 'center' | 'origin' | 'corner' | 'topRight' | 'bottomLeft' }): Element[]; - getBBox(elements: Element[], options?: any): BBox; - toGraphLib(): any; // graphlib graph object - findModelsInArea(rect: BBox, options?: any): BBox | boolean; - getCellsBBox(cells: Cell[], options?: any): BBox; - getInboundEdges(node: string): Object; - getOutboundEdges(node: string): Object; - hasActiveBatch(name?: string): number | boolean; - maxZIndex(): number; - removeCells(cells: Cell[], options?: any): this; - resize(width: number, height: number, options?: number): this; - resizeCells(width: number, height: number, cells: Cell[], options?: number): this; - set(key: Object | string, value: any, options?: any): this; - startBatch(name: string, data?: Object): any; - stopBatch(name: string, data?: Object): any; - } - - class Cell extends Backbone.Model { - id: string; - toJSON(): any; - remove(options?: { disconnectLinks?: boolean }): this; - toFront(options?: { deep?: boolean }): this; - toBack(options?: { deep?: boolean }): this; - getAncestors(): Cell[]; - isEmbeddedIn(element: Element, options?: { deep: boolean }): boolean; - prop(key: string): any; - prop(object: any): this; - prop(key: string, value: any, options?: any): this; - removeProp(path: string, options?: any): this; - attr(key: string): any; - attr(object: SVGAttributes): this; - attr(key: string, value: any): this; - clone(): Cell; - clone(opt: { deep?: boolean }): Cell | Cell[]; - removeAttr(path: string | string[], options?: any): this; - transition(path: string, value?: any, options?: TransitionOptions, delim?: string): number; - getTransitions(): string[]; - stopTransitions(path?: string, delim?: string): this; - addTo(graph: Graph, options?: any): this; - isLink(): boolean; - embed(cell: Cell, options?: any): this; - findView(paper: Paper): CellView; - getEmbeddedCells(options?: any): Cell[]; - initialize(options?: any): void; - isElement(): boolean; - isEmbedded(): boolean; - processPorts(): void; - startBatch(name: string, options?: any): this; - stopBatch(name: string, options?: any): this; - unembed(cell: Cell, options?: any): this; - } - - type Padding = number | { - top?: number; - right?: number; - bottom?: number; - left?: number - }; - - class Element extends Cell { - translate(tx: number, ty?: number, options?: TranslateOptions): this; - position(options?: { parentRelative: boolean }): Point; - position(x: number, y: number, options?: { parentRelative?: boolean }): this; - resize(width: number, height: number, options?: { direction?: 'left' | 'right' | 'top' | 'bottom' | 'top-right' | 'top-left' | 'bottom-left' | 'bottom-right' }): this; - rotate(deg: number, absolute?: boolean, origin?: Point): this; - embed(cell: Cell): this; - unembed(cell: Cell): this; - getEmbeddedCells(options?: ExploreOptions): Cell[]; - fitEmbeds(options?: { deep?: boolean, padding?: Padding }): this; - getBBox(options?: any): BBox; - findView(paper: Paper): ElementView; - isElement(): boolean; - scale(scaleX: number, scaleY: number, origin?: Point, options?: any): this; - addPort(port: any, opt?: any): this; - addPorts(ports: any[], opt?: any): this; - removePort(port: any, opt?: any): this; - hasPorts(): boolean; - hasPort(id: string): boolean; - getPorts(): any[]; - getPort(id: string): any; - getPortIndex(port: any): number; - portProp(portId: string, path: any, value?: any, opt?: any): joint.dia.Element; - } - - interface CSSSelector { - [key: string]: string | number | Object; // Object added to support special attributes like filter http://jointjs.com/api#SpecialAttributes:filter - } - - interface SVGAttributes { - [selector: string]: CSSSelector; - } - - interface CellAttributes { - [key: string]: any; - } - - interface TextAttrs extends SVGAttributes { - text?: { - [key: string]: string | number; - text?: string; - }; - } - - interface Label { - position: number; - attrs?: TextAttrs; - } - interface LinkAttributes extends CellAttributes { - source?: Point | { id: string, selector?: string, port?: string }; - target?: Point | { id: string, selector?: string, port?: string }; - labels?: Label[]; - vertices?: Point[]; - smooth?: boolean; - attrs?: TextAttrs; - z?: number; - } - - class Link extends Cell { - markup: string; - labelMarkup: string; - toolMakup: string; - vertexMarkup: string; - arrowHeadMarkup: string; - - constructor(attributes?: LinkAttributes, options?: Object); - disconnect(): this; - label(index?: number): any; - label(index: number, value: Label): this; - reparent(options?: any): Element; - findView(paper: Paper): LinkView; - getSourceElement(): Element; - getTargetElement(): Element; - hasLoop(options?: { deep?: boolean }): boolean; - applyToPoints(fn: Function, options?: any): this; - getRelationshipAncestor(): Element; - isLink(): boolean; - isRelationshipEmbeddedIn(element: Element): boolean; - scale(sx: number, sy: number, origin: Point, optionts?: any): this; - translate(tx: number, ty: number, options?: any): this; - } - - interface ManhattanRouterArgs { - excludeTypes?: string[]; - excludeEnds?: 'source' | 'target'; - startDirections?: ['left' | 'right' | 'top' | 'bottom']; - endDirections?: ['left' | 'right' | 'top' | 'bottom']; - } - - interface PaperOptions extends Backbone.ViewOptions { - el?: string | JQuery | HTMLElement; - width?: number; - height?: number; - origin?: Point; - gridSize?: number; - perpendicularLinks?: boolean; - elementView?: (element: Element) => ElementView | ElementView; - linkView?: (link: Link) => LinkView | LinkView; - defaultLink?: ((cellView: CellView, magnet: SVGElement) => Link) | Link; - defaultRouter?: ((vertices: Point[], args: Object, linkView: LinkView) => Point[]) | { name: string, args?: ManhattanRouterArgs }; - defaultConnector?: ((sourcePoint: Point, targetPoint: Point, vertices: Point[], args: Object, linkView: LinkView) => string) | { name: string, args?: { radius?: number } }; - interactive?: ((cellView: CellView, event: string) => boolean) | boolean | { vertexAdd?: boolean, vertexMove?: boolean, vertexRemove?: boolean, arrowheadMove?: boolean }; - validateMagnet?: (cellView: CellView, magnet: SVGElement) => boolean; - validateConnection?: (cellViewS: CellView, magnetS: SVGElement, cellViewT: CellView, magnetT: SVGElement, end: 'source' | 'target', linkView: LinkView) => boolean; - linkConnectionPoint?: (linkView: LinkView, view: ElementView, magnet: SVGElement, reference: Point) => Point; - snapLinks?: boolean | { radius: number }; - linkPinning?: boolean; - markAvailable?: boolean; - async?: boolean | { batchZise: number }; - embeddingMode?: boolean; - validateEmbedding?: (childView: ElementView, parentView: ElementView) => boolean; - restrictTranslate?: ((elementView: ElementView) => BBox) | boolean; - guard?: (evt: Event, view: CellView) => boolean; - multiLinks?: boolean; - cellViewNamespace?: Object; - /** useful undocumented option */ - clickThreshold?: number; - highlighting?: any; - } - - interface ScaleContentOptions { - padding?: number; - preserveAspectRatio?: boolean; - minScale?: number; - minScaleX?: number; - minScaleY?: number; - maxScale?: number; - maxScaleX?: number; - maxScaleY?: number; - scaleGrid?: number; - fittingBBox?: BBox; - } - - interface FitToContentOptions { - gridWidth?: number; - gridHeight?: number; - padding?: Padding; - allowNewOrigin?: 'negative' | 'positive' | 'any'; - minWidth?: number; - minHeight?: number; - maxWidth?: number; - maxHeight?: number; - } - - class Paper extends Backbone.View { - constructor(options?: PaperOptions); - options: PaperOptions; - svg: SVGElement; - viewport: SVGGElement; - defs: SVGDefsElement; - setDimensions(width: number, height: number): void; - setOrigin(x: number, y: number): void; - scale(sx: number, sy?: number, ox?: number, oy?: number): this; - findView(element: any): CellView; - findViewByModel(model: Cell | string): CellView; - findViewsFromPoint(point: Point): ElementView[]; - findViewsInArea(rect: BBox, options?: { strict?: boolean }): CellView[]; - fitToContent(options?: FitToContentOptions): void; - scaleContentToFit(options?: ScaleContentOptions): void; - getContentBBox(): BBox; - clientToLocalPoint(p: Point): Point; - - rotate(deg: number, ox?: number, oy?: number): Paper; // @todo not released yet though it's in the source code already - - afterRenderViews(): void; - asyncRenderViews(cells: Cell[], options?: any): void; - beforeRenderViews(cells: Cell[]): Cell[]; - cellMouseout(evt: Event): void; - cellMouseover(evt: Event): void; - clearGrid(): this; - contextmenu(evt: Event): void; - createViewForModel(cell: Cell): CellView; - drawGrid(options?: any): this; - fitToContent(gridWidth?: number, gridHeight?: number, padding?: number, options?: any): void; - getArea(): BBox; - getDefaultLink(cellView: CellView, magnet: HTMLElement): Link; - getModelById(id: string): Cell; - getRestrictedArea(): BBox; - guard(evt: Event, view: CellView): boolean; - linkAllowed(linkViewOrModel: LinkView | Link): boolean; - mouseclick(evt: Event): void; - mousedblclick(evt: Event): void; - mousewheel(evt: Event): void; - onCellAdded(cell: Cell, graph: Graph, options: Object): void; - onCellHighlight(cellView: CellView, magnetEl: HTMLElement, options?: any): void; - onCellUnhighlight(cellView: CellView, magnetEl: HTMLElement, options?: any): void; - onRemove(): void; - pointerdown(evt: Event): void; - pointermove(evt: Event): void; - pointerup(evt: Event): void; - remove(): this; - removeView(cell: Cell): CellView; - removeViews(): void; - renderView(cell: Cell): CellView; - resetViews(cellsCollection: Cell[], options: any): void; - resolveHighlighter(options?: any): boolean | Object; - setGridSize(gridSize: number): this; - setInteractivity(value: any): void; - snapToGrid(p: Point): Point; - sortViews(): void; - } - - - interface GradientOptions { - type: 'linearGradient' | 'radialGradient'; - stops: Array<{ - offset: string; - color: string; - opacity?: number; - }>; - } - class CellViewGeneric extends Backbone.View { - getBBox(options?: { useModelGeometry?: boolean }): BBox; - highlight(el?: any, options?: any): this; - unhighlight(el?: any, options?: any): this; - applyFilter(selector: string | HTMLElement, filter: Object): void; - applyGradient(selector: string | HTMLElement, attr: 'fill' | 'stroke', gradient: GradientOptions): void; - can(feature: string): boolean; - findBySelector(selector: string): JQuery; - findMagnet(el: any): HTMLElement; - getSelector(el: HTMLElement, prevSelector: string): string; - getStrokeBBox(el: any): BBox; // string|HTMLElement|Vectorizer - mouseout(evt: Event): void; - mouseover(evt: Event): void; - mousewheel(evt: Event, x: number, y: number, delta: number): void - notify(eventName: string): void; - onChangeAttrs(cell: Cell, attrs: Backbone.ViewOptions, options?: any): this; - onSetTheme(oldTheme: string, newTheme: string): void; - pointerclick(evt: Event, x: number, y: number): void; - pointerdblclick(evt: Event, x: number, y: number): void; - pointerdown(evt: Event, x: number, y: number): void; - pointermove(evt: Event, x: number, y: number): void; - pointerup(evt: Event, x: number, y: number): void; - remove(): this; - setInteractivity(value: any): void; - setTheme(theme: string, options?: any): this; - } - - class CellView extends CellViewGeneric { } - - interface ElementViewAttributes { - style?: string; - text?: string; - html?: string; - "ref-x"?: string | number; - "ref-y"?: string | number; - "ref-dx"?: number; - "ref-dy"?: number; - "ref-width"?: string | number; - "ref-height"?: string | number; - ref?: string; - "x-alignment"?: 'middle' | 'right' | number; - "y-alignment"?: 'middle' | 'bottom' | number; - port?: string; - } - class ElementView extends CellViewGeneric { - scale(sx: number, sy: number): void; // @todo Documented in source but not released - finalizeEmbedding(options?: any): void; - getBBox(options?: any): BBox; - pointerdown(evt: Event, x: number, y: number): void; - pointermove(evt: Event, x: number, y: number): void; - pointerup(evt: Event, x: number, y: number): void; - positionRelative(vel: any, bbox: BBox, attributes: ElementViewAttributes, nodesBySelector?: Object): void; // Vectorizer - prepareEmbedding(options?: any): void; - processEmbedding(options?: any): void; - render(): this; - renderMarkup(): void; - resize(): void; - rotate(): void; - translate(model: Backbone.Model, changes?: any, options?: any): void; - update(cell: Cell, renderingOnlyAttrs?: Object): void; - } - - class LinkView extends CellViewGeneric { - options: { - shortLinkLength?: number, - doubleLinkTools?: boolean, - longLinkLength?: number, - linkToolsOffset?: number, - doubleLinkToolsOffset?: number, - sampleInterval: number - }; - getConnectionLength(): number; - sendToken(token: SVGElement, duration?: number, callback?: () => void): void; - addVertex(vertex: Point): number; - getPointAtLength(length: number): Point; // Marked as public api in source but not in the documents - createWatcher(endType: { id: string }): Function; - findRoute(oldVertices: Point[]): Point[]; - getConnectionPoint(end: 'source' | 'target', selectorOrPoint: Element | Point, referenceSelectorOrPoint: Element | Point): Point; - getPathData(vertices: Point[]): any; - onEndModelChange(endType: 'source' | 'target', endModel?: Element, opt?: any): void; - onLabelsChange(): void; - onSourceChange(cell: Cell, sourceEnd: { id: string }, options: any): void; - onTargetChange(cell: Cell, targetEnd: { id: string }, options: any): void; - onToolsChange(): void; - onVerticesChange(cell: Cell, changed: any, options: any): void; - pointerdown(evt: Event, x: number, y: number): void; - pointermove(evt: Event, x: number, y: number): void; - pointerup(evt: Event, x: number, y: number): void; - removeVertex(idx: number): this; - render(): this; - renderArrowheadMarkers(): this; - renderLabels(): this; - renderTools(): this; - renderVertexMarkers(): this; - startArrowheadMove(end: 'source' | 'target', options?: any): void; - startListening(): void; - update(model: any, attributes: any, options?: any): this; - updateArrowheadMarkers(): this; - updateAttributes(): void; - updateConnection(options?: any): void; - updateLabelPositions(): this; - updateToolsPosition(): this; - } - } - - namespace ui { } - - namespace shapes { - interface GenericAttributes extends dia.CellAttributes { - position?: dia.Point; - size?: dia.Size; - angle?: number; - attrs?: T; - } - interface ShapeAttrs extends dia.CSSSelector { - fill?: string; - stroke?: string; - r?: string | number; - rx?: string | number; - ry?: string | number; - cx?: string | number; - cy?: string | number; - height?: string | number; - width?: string | number; - transform?: string; - points?: string; - 'stroke-width'?: string | number; - 'ref-x'?: string | number; - 'ref-y'?: string | number; - ref?: string - } - - namespace basic { - class Generic extends dia.Element { - constructor(attributes?: GenericAttributes, options?: Object); - } - interface RectAttrs extends dia.TextAttrs { - rect?: ShapeAttrs; - } - class Rect extends Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - class Text extends Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - interface CircleAttrs extends dia.TextAttrs { - circle?: ShapeAttrs; - } - class Circle extends Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - interface EllipseAttrs extends dia.TextAttrs { - ellipse?: ShapeAttrs; - } - class Ellipse extends Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - interface PolygonAttrs extends dia.TextAttrs { - polygon?: ShapeAttrs; - } - class Polygon extends Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - interface PolylineAttrs extends dia.TextAttrs { - polyline?: ShapeAttrs; - } - class Polyline extends Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - class Image extends Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - interface PathAttrs extends dia.TextAttrs { - path?: ShapeAttrs; - } - class Path extends Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - interface RhombusAttrs extends dia.TextAttrs { - path?: ShapeAttrs; - } - class Rhombus extends Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - interface TextBlockAttrs extends dia.TextAttrs { - rect?: ShapeAttrs; - } - class TextBlock extends Generic { - constructor(attributes?: GenericAttributes, options?: Object); - updateSize(cell: dia.Cell, size: dia.Size): void; - updateContent(cell: dia.Cell, content: string): void; - } - } - - namespace chess { - class KingWhite extends basic.Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - class KingBlack extends basic.Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - class QueenWhite extends basic.Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - class QueenBlack extends basic.Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - class RookWhite extends basic.Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - class RookBlack extends basic.Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - class BishopWhite extends basic.Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - class BishopBlack extends basic.Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - class KnightWhite extends basic.Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - class KnightBlack extends basic.Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - class PawnWhite extends basic.Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - class PawnBlack extends basic.Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - } - - namespace devs { - interface ModelAttributes extends GenericAttributes { - inPorts?: string[]; - outPorts?: string[]; - ports?: Object; - } - class Model extends basic.Generic { - constructor(attributes?: ModelAttributes, options?: Object); - changeInGroup(properties: any, opt?: any): boolean; - changeOutGroup(properties: any, opt?: any): boolean; - createPortItem(group: string, port: string): any; - createPortItems(group: string, ports: string[]): any[]; - addOutPort(port: string, opt?: any): this; - addInPort(port: string, opt?: any): this; - removeOutPort(port: string, opt?: any): this; - removeInPort(port: string, opt?: any): this; - } - class Coupled extends Model { - constructor(attributes?: ModelAttributes, options?: Object); - } - class Atomic extends Model { - constructor(attributes?: ModelAttributes, options?: Object); - } - class Link extends dia.Link { - constructor(attributes?: dia.LinkAttributes, options?: Object); - } - } - - namespace erd { - class Entity extends basic.Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - class WeakEntity extends Entity { - constructor(attributes?: GenericAttributes, options?: Object); - } - class Relationship extends dia.Element { - constructor(attributes?: GenericAttributes, options?: Object); - } - class IdentifyingRelationship extends Relationship { - constructor(attributes?: GenericAttributes, options?: Object); - } - interface AttributeAttrs extends dia.TextAttrs { - ellipse?: ShapeAttrs; - } - class Attribute extends dia.Element { - constructor(attributes?: GenericAttributes, options?: Object); - } - class Multivalued extends Attribute { - constructor(attributes?: GenericAttributes, options?: Object); - } - class Derived extends Attribute { - constructor(attributes?: GenericAttributes, options?: Object); - } - class Key extends Attribute { - constructor(attributes?: GenericAttributes, options?: Object); - } - class Normal extends Attribute { - constructor(attributes?: GenericAttributes, options?: Object); - } - interface ISAAttrs extends dia.Element { - polygon?: ShapeAttrs; - } - class ISA extends dia.Element { - constructor(attributes?: GenericAttributes, options?: Object); - } - class Line extends dia.Link { - constructor(attributes?: dia.LinkAttributes, options?: Object); - cardinality(value: string | number): void; - } - } - - namespace fsa { - class State extends basic.Circle { - constructor(attributes?: GenericAttributes, options?: Object); - } - class StartState extends dia.Element { - constructor(attributes?: GenericAttributes, options?: Object); - } - class EndState extends dia.Element { - constructor(attributes?: GenericAttributes, options?: Object); - } - class Arrow extends dia.Link { - constructor(attributes?: dia.LinkAttributes, options?: Object); - } - } - - namespace logic { - interface LogicAttrs extends ShapeAttrs { - ref?: string; - 'ref-x'?: number | string; - 'ref-dx'?: number | string; - 'ref-y'?: number | string; - 'ref-dy'?: number | string; - magnet?: boolean; - 'class'?: string; - port?: string; - } - interface IOAttrs extends dia.TextAttrs { - circle?: LogicAttrs; - } - class Gate extends basic.Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - class IO extends Gate { - constructor(attributes?: GenericAttributes, options?: Object); - } - class Input extends IO { - constructor(attributes?: GenericAttributes, options?: Object); - } - class Output extends IO { - constructor(attributes?: GenericAttributes, options?: Object); - } - class Gate11 extends Gate { - constructor(attributes?: GenericAttributes, options?: Object); - } - class Gate21 extends Gate { - constructor(attributes?: GenericAttributes, options?: Object); - } - interface Image { - 'xlink:href'?: string; - } - interface ImageAttrs extends LogicAttrs { - image?: Image; - } - class Repeater extends Gate11 { - constructor(attributes?: GenericAttributes, options?: Object); - operation(input: any): any; - } - class Note extends Gate11 { - constructor(attributes?: GenericAttributes, options?: Object); - operation(input: any): boolean; - } - class Or extends Gate21 { - constructor(attributes?: GenericAttributes, options?: Object); - operation(input1: any, input2: any): boolean; - } - class And extends Gate21 { - constructor(attributes?: GenericAttributes, options?: Object); - operation(input1: any, input2: any): boolean; - } - class Nor extends Gate21 { - constructor(attributes?: GenericAttributes, options?: Object); - operation(input1: any, input2: any): boolean; - } - class Nand extends Gate21 { - constructor(attributes?: GenericAttributes, options?: Object); - operation(input1: any, input2: any): boolean; - } - class Xor extends Gate21 { - constructor(attributes?: GenericAttributes, options?: Object); - operation(input1: any, input2: any): boolean; - } - class Xnor extends Gate21 { - constructor(attributes?: GenericAttributes, options?: Object); - operation(input1: any, input2: any): boolean; - } - interface WireArgs extends dia.LinkAttributes { - router?: Object; - connector?: Object; - } - class Wire extends dia.Link { - constructor(attributes?: WireArgs, options?: Object); - } - } - - namespace org { - interface MemberAttrs { - rect?: ShapeAttrs; - image?: ShapeAttrs; - } - class Member extends dia.Element { - constructor(attributes?: GenericAttributes, options?: Object); - } - class Arrow extends dia.Link { - constructor(attributes?: dia.LinkAttributes, options?: Object); - } - } - - namespace pn { - class Place extends basic.Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - class PlaceView extends dia.ElementView { - renderTokens(): void; - } - class Transition extends basic.Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - class Link extends dia.Link { - constructor(attributes?: dia.LinkAttributes, options?: Object); - } - } - - namespace uml { - interface ClassAttributes extends GenericAttributes { - name: string[]; - attributes: string[]; - methods: string[]; - } - class Class extends basic.Generic { - constructor(attributes?: ClassAttributes, options?: Object); - getClassName(): string[]; - updateRectangles(): void; - } - class ClassView extends dia.ElementView { - } - class Abstract extends Class { - constructor(attributes?: ClassAttributes, options?: Object); - } - class AbstractView extends ClassView { - constructor(attributes?: ClassAttributes, options?: Object); - } - class Interface extends Class { - constructor(attributes?: ClassAttributes, options?: Object); - } - class InterfaceView extends ClassView { - constructor(attributes?: ClassAttributes, options?: Object); - } - class Generalization extends dia.Link { - constructor(attributes?: dia.LinkAttributes, options?: Object); - } - class Implementation extends dia.Link { - constructor(attributes?: dia.LinkAttributes, options?: Object); - } - class Aggregation extends dia.Link { - constructor(attributes?: dia.LinkAttributes, options?: Object); - } - class Composition extends dia.Link { - constructor(attributes?: dia.LinkAttributes, options?: Object); - } - class Association extends dia.Link { - constructor(attributes?: dia.LinkAttributes, options?: Object); - } - interface StateAttributes extends GenericAttributes { - events?: string[]; - } - class State extends basic.Generic { - constructor(attributes?: GenericAttributes, options?: Object); - updateName(): void; - updateEvents(): void; - updatePath(): void; - } - class StartState extends basic.Circle { - constructor(attributes?: GenericAttributes, options?: Object); - } - class EndState extends basic.Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - class Transition extends dia.Link { - constructor(attributes?: dia.LinkAttributes, options?: Object); - } - } - } - - namespace util { - - namespace format { - export function number(specifier: string, value: number): string; - } - - export function uuid(): string; - export function guid(obj?: Object): string; - export function nextFrame(callback: () => void, context?: Object): number; - export function cancelFrame(requestId: number): void; - export function flattenObject(object: Object, delim: string, stop: (node: any) => boolean): any; - export function getByPath(object: Object, path: string, delim: string): any; - export function setByPath(object: Object, path: string, value: Object, delim: string): any; - export function unsetByPath(object: Object, path: string, delim: string): any; - export function breakText(text: string, size: dia.Size, attrs?: dia.SVGAttributes, options?: { svgDocument?: SVGElement }): string; - export function normalizeSides(box: number | { x?: number, y?: number, height?: number, width?: number }): dia.BBox; - export function getElementBBox(el: Element): dia.BBox; - export function setAttributesBySelector(el: Element, attrs: dia.SVGAttributes): void; - export function sortElements(elements: Element[] | string | JQuery, comparator: (a: Element, b: Element) => number): Element[]; - export function shapePerimeterConnectionPoint(linkView: dia.LinkView, view: dia.ElementView, magnet: SVGElement, ref: dia.Point): dia.Point; - export function imageToDataUri(url: string, callback: (err: Error, dataUri: string) => void): void; - - // Not documented but used in examples - /** @deprecated use lodash _.defaultsDeep */ - export function deepSupplement(objects: any, defaultIndicator?: any): any; - - // Private functions - /** @deprecated use lodash _.assign */ - export function mixin(objects: any[]): any; - /** @deprecated use lodash _.defaults */ - export function supplement(objects: any[]): any; - /** @deprecated use lodash _.mixin */ - export function deepMixin(objects: any[]): any; - } - - namespace layout { - - interface LayoutOptions { - nodeSep?: number; - edgeSep?: number; - rankSep?: number; - rankDir?: 'TB' | 'BT' | 'LR' | 'RL'; - marginX?: number; - marginY?: number; - resizeCluster?: boolean; - setPosition?: (element: dia.Element, position: dia.BBox) => void; - setLinkVertices?: (link: dia.Link, vertices: Position[]) => void; - } - - export class DirectedGraph { - static layout(graph: dia.Graph | dia.Cell[], options?: LayoutOptions): dia.BBox; - } - } -} diff --git a/jquery-galleria/jquery-galleria-tests.ts b/jquery-galleria/jquery-galleria-tests.ts deleted file mode 100644 index edf0ceb3cc..0000000000 --- a/jquery-galleria/jquery-galleria-tests.ts +++ /dev/null @@ -1,23 +0,0 @@ - -namespace JqueryGalleriaTests { - var container = document.createElement("galleria"); - - var gOptions: GalleriaJS.GalleriaOptions; - - gOptions.lightbox = true; - gOptions.autoplay = true; - - Galleria.run("galleria", gOptions); - - gOptions.lightbox = false; - - Galleria.ready(function() { - this.configure(gOptions).refreshImage(); - }); - - Galleria.run("galleria"); - - gOptions.autoplay = false; - - Galleria.run(); -} diff --git a/jquery-mask-plugin/index.d.ts b/jquery-mask-plugin/index.d.ts deleted file mode 100644 index 61f3a69359..0000000000 --- a/jquery-mask-plugin/index.d.ts +++ /dev/null @@ -1,75 +0,0 @@ -// Type definitions for jQuery Mask Plugin 1.14 -// Project: https://igorescobar.github.io/jQuery-Mask-Plugin/ -// Definitions by: Anže Videnič , Igor Escobar -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -declare namespace jQueryMask { - - interface Invalid { - p: number; - v: string; - e: string; - } - - interface Options { - maskElements?: string; - dataMaskAttr?: string; - dataMask?: boolean; - watchInterval?: number; - watchInputs?: boolean; - watchDataMask?: boolean; - byPassKeys?: number[]; - translation?: Translation; - selectOnFocus?: boolean; - reverse?: boolean; - clearIfNotMatch?: boolean; - onComplete?(value: string, e: Event, $element: JQuery, options: Options): void; - onKeyPress?(value: string, e: Event, $element: JQuery, options: Options): void; - onChange?(value: string, e: Event, $element: JQuery, options: Options): void; - onInvalid?(value: string, e: Event, $element: JQuery, invalid: Invalid[], options: Options): void; - } - - interface Pattern { - pattern?: RegExp; - recursive?: boolean; - optional?: boolean; - fallback?: string; - } - - interface Translation { - [key: string]: Pattern | {} | undefined; - placeholder?: string; - } - -} - -interface JQuery { - - /** - * Applies the mask to the matching selector elements. - * @param mask should be a string or a function. - * @param options should be an options object. - * @returns The element. - */ - mask(mask: ((value: string) => string) | string, options?: jQueryMask.Options): JQuery; - - /** - * Seek and destroy. - * @returns The element. - */ - unmask(): JQuery; - - /** - * Gets the value of the field without the mask. - * @returns Value without the mask. - */ - cleanVal(): string; - - /** - * Gets masked value programmatically - * @returns Masked value. - */ - masked(value: string): string; -} \ No newline at end of file diff --git a/jquery-mask-plugin/tslint.json b/jquery-mask-plugin/tslint.json deleted file mode 100644 index f05741c59b..0000000000 --- a/jquery-mask-plugin/tslint.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "../tslint.json", - "rules": { - "forbidden-types": false - } -} diff --git a/jquery-steps/index.d.ts b/jquery-steps/index.d.ts deleted file mode 100644 index 6abe640417..0000000000 --- a/jquery-steps/index.d.ts +++ /dev/null @@ -1,358 +0,0 @@ -// Type definitions for jQuery Steps v1.1.1 -// Project: http://www.jquery-steps.com/ -// Definitions by: Joseph Blank -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Updated by: Nicholas Wong - -interface JQuery { - steps(param?: JQuerySteps.Settings): JQuerySteps.JQuerySteps; -} - -declare module JQuerySteps { - - //#region "JQuerySteps" - - export interface JQuerySteps { - /** - * Adds a new step. (chainable) - */ - add(step: Step): JQuerySteps; - - /** - * Inserts a new step to a specific position. (chainable) - */ - insert(index: number, step: Step): JQuerySteps; - - /** - * Removes a specific step by an given index. - */ - remove(index: number): boolean; - - /** - * Gets the current step object. - */ - getCurrentStep(): Step; - - /** - * Gets the current step index. - */ - getCurrentIndex(): number; - - /** - * Gets a specific step object by index. - */ - getStep(index: number): Step; - - /** - * Routes to the previous step. - */ - next(): boolean; - - /** - * Routes to the next step. - */ - previous(): boolean; - - /** - * Triggers the onFinishing and onFinished event. - */ - finish(): void; - - /** - * Removes the control functionality completely and transforms the current state to the initial HTML structure. - */ - destroy(): void; - - /** - * Skips a certain amount of steps. Not yet implemented! - */ - skip(count: number): boolean; - } - - //#endregion "JQuerySteps" - - //#region "Settings" - export interface Settings { - //#region "Appearance" - - /** - * The header tag is used to find the step button text within the declared wizard area. Default value is h1. - */ - headerTag?: string; - - /** - * The body tag is used to find the step content within the declared wizard area. Default value is div. - */ - bodyTag?: string; - - /** - * The content container tag which will be used to wrap all step contents. Default value is div. - */ - contentContainerTag?: string; - - /** - * The action container tag which will be used to wrap the pagination navigation. Default value is div. - */ - actionContainerTag?: string; - - /** - * The steps container tag which will be used to wrap the steps navigation. Default value is div. - */ - stepsContainerTag?: string; - - /** - * The css class which will be added to the outer component wrapper. Default value is wizard. - */ - cssClass?: string; - - /** - * Determines whether the steps are vertically or horizontally oriented. Default value is horizontal or 0. - * This can be horizontal (0) or vertical (1). - */ - stepsOrientation?: string|number; - - //#endregion "Appearance" - - //#region "Templates" - - /** - * The title template which will be used to create a step button. Default value is span class="number">#index#.
              #title#. - */ - titleTemplate?: string; - - /** - * The loading template which will be used to create the loading animation. Default value is #text#. - */ - loadingTemplate?: string; - - //#endregion "Templates" - - //#region "Behavior" - - /** - * Sets the focus to the first wizard instance in order to enable the key navigation from the begining if true. Default value is false. - */ - autoFocus?: boolean; - - /** - * Enables all steps from the begining if true (all steps are clickable). Default value is false. - */ - enableAllSteps?: boolean; - - /** - * Enables keyboard navigation if true (arrow left and arrow right). Default value is true. - */ - enableKeyNavigation?: boolean; - - /** - * Enables pagination (next, previous and finish button) if true. Default value is true. - */ - enablePagination?: boolean; - - /** - * Suppresses pagination if a form field is focused. Default value is true. - */ - suppressPaginationOnFocus?: boolean; - - /** - * Enables cache for async loaded or iframe embedded content. Default value is true. - */ - enableContentCache?: boolean; - - /** - * Shows the cancel button if enabled. Default value is false. - */ - enableCancelButton?: boolean; - - /** - * Shows the finish button if enabled. Default value is true. - */ - enableFinishButton?: boolean; - - /** - * Shows the finish button always (on each step; right beside the next button) if true. Otherwise the next button will be replaced by the finish button if the last step becomes active. Default value is false. - */ - showFinishButtonAlways?: boolean; - - /** - * Prevents jumping to a previous step. Default value is false. - */ - forceMoveForward?: boolean; - - /** - * Saves the current state (step position) to a cookie. By coming next time the last active step becomes activated. Default value is false. - */ - saveState?: boolean; - - /** - * The position to start on (zero-based). Default value is 0. - */ - startIndex?: number; - - //#endregion "Behavior" - - //#region "Transition Effects" - - /** - * The animation effect which will be used for step transitions. Default value is none or 0. - * This can be none (0), fade (1), slide (2) or slideLeft (3). - */ - transitionEffect?: string|number; - - /** - * Animation speed for step transitions (in milliseconds). Default value is 200. - */ - transitionEffectSpeed?: number; - - //#endregion "Transition Effects" - - //#region "Events" - - /** - * Fires before the step changes and can be used to prevent step changing by returning false. - */ - onStepChanging?: FunctionOnStepChanging; - - /** - * Fires after the step has changed. - */ - onStepChanged?: FunctionOnStepChanged; - - /** - * Fires after cancellation. - */ - onCanceled?: FunctionOnCancelled; - - /** - * Fires before finishing and can be used to prevent completion by returning false. Very useful for form validation. - */ - onFinishing?: FunctionOnFinishing; - - /** - * Fires after completion. - */ - onFinished?: FunctionOnFinished; - - /** - * Fires when the wizard is initialized. - */ - onInit?: FunctionOnInit; - - /** - * Fires after async content is loaded. - */ - onContentLoaded?: FunctionOnContentLoaded; - - //#endregion "Events" - - //#region "Labels" - - labels?: LabelSettings; - - //#endregion "Labels" - } - //#endregion "Settings" - - //#region "Label Settings" - - interface LabelSettings { - - /** - * Label for the cancel button. Default value is Cancel. - */ - cancel?: string; - - /** - * This label is important for accessability reasons. Indicates which step is activated. Default value is current step:. - */ - current?: string; - - /** - * This label is important for accessability reasons and describes the kind of navigation. Default value is Pagination. - */ - pagination?: string; - - /** - * Label for the finish button. Default value is Finish. - */ - finish?: string; - - /** - * Label for the next button. Default value is Next. - */ - next?: string; - - /** - * Label for the previous button. Default value is Previous. - */ - previous?: string; - - /** - * Label for the loading animation. Default value is Loading ... . - */ - loading?: string; - - } - - //#endregion "Label Settings" - - //#region "Callback Functions" - - interface FunctionOnStepChanging { - (event: string, currentIndex: number, newIndex: number): boolean; - } - - interface FunctionOnStepChanged { - (event: string, currentIndex: number, priorIndex: number): void; - } - - interface FunctionOnCancelled { - (event: string): void; - } - - interface FunctionOnFinishing { - (event: string, currentIndex: number): boolean; - } - - interface FunctionOnFinished { - (event: string, currentIndex: number): void; - } - - interface FunctionOnInit { - (event: string, currentIndex: number): void; - } - - interface FunctionOnContentLoaded { - (event: string, currentIndex: number): void; - } - - //#endregion "Callback Functions" - - //#region "Step Object" - - interface Step { - - /** - * The step title (HTML). - */ - title?: string; - - /** - * The step content (HTML). - */ - content?: string; - - /** - * Indicates how the content will be loaded. - * This can be html (0), iframe (1), or async (2). - */ - contentMode?: string|number; - - /** - * The URI that refers to the content. - */ - contentUrl?: string; - } - - //#endregion "Step Object" -} diff --git a/jquery-urlparam/jquery-urlparam-tests.ts b/jquery-urlparam/jquery-urlparam-tests.ts deleted file mode 100644 index a8ca144bb3..0000000000 --- a/jquery-urlparam/jquery-urlparam-tests.ts +++ /dev/null @@ -1,4 +0,0 @@ -/// - - -console.log($.urlParam('variable')); diff --git a/jquery.are-you-sure/jquery.are-you-sure-tests.ts b/jquery.are-you-sure/jquery.are-you-sure-tests.ts deleted file mode 100644 index cd400f90c1..0000000000 --- a/jquery.are-you-sure/jquery.are-you-sure-tests.ts +++ /dev/null @@ -1,18 +0,0 @@ -// Type definitions for jquery.are-you-sure.js -// Project: https://github.com/codedance/jquery.AreYouSure -// Definitions by: Jon Egerton -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -//Use defaults -$("test").areYouSure(); - -//Use all settings -$("test").areYouSure({ - message: "Oops - sure you wanna leave?", - dirtyClass: "soiled", - fieldSelector: "input[type='text']", - change: function () { alert("changed");}, - silent: true -}) \ No newline at end of file diff --git a/jquery.fancytree/index.d.ts b/jquery.fancytree/index.d.ts deleted file mode 100644 index 5533e89cb7..0000000000 --- a/jquery.fancytree/index.d.ts +++ /dev/null @@ -1,864 +0,0 @@ -// Type definitions for jquery.fancytree 2.7.0 -// Project: https://github.com/mar10/fancytree -// Definitions by: Peter Palotas -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - - -/// -/// - -declare namespace JQueryUI { - interface UI { - fancytree: Fancytree.FancytreeStatic; - } -} - -interface JQuery { - fancytree(options?: Fancytree.FancytreeOptions): Fancytree.Fancytree; - fancytree(option?: string, ...rest: any[]): any; -} - -declare namespace Fancytree { - interface Fancytree { - $div: JQuery; - - rootNode: FancytreeNode; - - /** Activate node with a given key and fire focus and - * activate events. A prevously activated node will be - * deactivated. If activeVisible option is set, all parents - * will be expanded as necessary. Pass key = false, to deactivate - * the current node only. - * - * @returns {FancytreeNode} activate node (null, if not found) - */ - activateKey(key: string): FancytreeNode; - - /** (experimental) - * - * @returns resolved, when all patches have been applied - */ - applyPatch(patchList: NodePatch[]): JQueryPromise; - - /** [ext-clones] Replace a refKey with a new one. */ - changeRefKey(oldRefKey: string, newRefKey: string): void; - - /** [ext-persist] Remove persistence cookies of the given type(s). - * Called like $("#tree").fancytree("getTree").clearCookies("active expanded focus selected"); */ - clearCookies(): void; - - /** [ext-filter] Reset the filter. */ - clearFilter(): void; - - /** Return the number of nodes. */ - count(): number; - - /** Write to browser console if debugLevel >= 2 (prepending tree name) */ - debug(msg: any): void; - - /** [ext-filter] Dimm or hide whole branches. - * @returns {integer} count - */ - filterBranches(filter: string): number; - - /** [ext-filter] Dimm or hide whole branches. - * @returns {integer} count - */ - filterBranches(filter: (node: FancytreeNode) => boolean): number; - - /** [ext-filter] Dimm or hide nodes. - * @returns {integer} count - */ - filterNodes(filter: string, leavesOnly?: boolean): number; - - /** [ext-filter] Dimm or hide nodes. - * @returns {integer} count - */ - filterNodes(filter: (node: FancytreeNode) => boolean, leavesOnly?: boolean): number; - - /** Find the next visible node that starts with `match`, starting at `startNode` and wrap-around at the end. - * - * @returns matching node or null - */ - findNextNode(match: string, startNode?: FancytreeNode): FancytreeNode; - - /** Find the next visible node that starts with `match`, starting at `startNode` and wrap-around at the end. - * - * @returns matching node or null - */ - findNextNode(match: (node: FancytreeNode) => boolean, startNode?: FancytreeNode): FancytreeNode; - - /** Generate INPUT elements that can be submitted with html forms. In selectMode 3 only the topmost selected nodes are considered. */ - generateFormElements(selected?: boolean, active?: boolean): void; - - /** Return the currently active node or null. */ - getActiveNode(): FancytreeNode; - - /** Return the first top level node if any (not the invisible root node). */ - getFirstChild(): FancytreeNode; - - /** Return node that has keyboard focus. - * - * @param ifTreeHasFocus (default: false) (not yet implemented) - */ - getFocusNode(ifTreeHasFocus?: boolean): FancytreeNode; - - /** Return node with a given key or null if not found. - * - * @param searchRoot (optional) only search below this node. - */ - getNodeByKey(key: string, searchRoot?: FancytreeNode): FancytreeNode; - - /** [ext-clones] Return all nodes with a given refKey (null if not found). - * - * @param rootNode optionally restrict results to descendants of this node. - */ - getNodesByRef(refKey: string, rootNode?: FancytreeNode): FancytreeNode[]; - - /** [ext-persist] Return persistence information from cookies Called like $("#tree").fancytree("getTree").getPersistData(); */ - getPersistData(): void; - - /** Return the invisible system root node. */ - getRootNode(): FancytreeNode; - - /** Return an array of selected nodes. - * - * @param stopOnParents only return the topmost selected node (useful with selectMode 3) - */ - getSelectedNodes(stopOnParents?: boolean): FancytreeNode[]; - - /** Return true if the tree control has keyboard focus */ - hasFocus(): boolean; - - /** Write to browser console if debugLevel >= 1 (prepending tree name) */ - info(msg: any): void; - - /** [ext-edit] Check if any node in this tree in edit mode. */ - isEditing(): FancytreeNode; - - /** Make sure that a node with a given ID is loaded, by traversing - and loading - its parents. This method is ment for lazy hierarchies. A callback is executed for every node as we go. - * - * @param keyPathList one or more key paths (e.g. '/3/2_1/7') - * @param callback callback(node, status) is called for every visited node ('loading', 'loaded', 'ok', 'error') - */ - loadKeyPath(keyPathList: string[], callback: (node: FancytreeNode, status: string) => void): JQueryPromise; - - /** Make sure that a node with a given ID is loaded, by traversing - and loading - its parents. This method is ment for lazy hierarchies. A callback is executed for every node as we go. - * - * @param keyPath a key path (e.g. '/3/2_1/7') - * @param callback callback(node, status) is called for every visited node ('loading', 'loaded', 'ok', 'error') - */ - loadKeyPath(keyPath: string, callback: (node: FancytreeNode, status: string) => void): JQueryPromise; - - /** Re-fire beforeActivate and activate events. */ - reactivate(): void; - - /** Reload tree from source and return a promise. - * - * @param source optional new source (defaults to initial source data) - */ - reload(source?: any): JQueryPromise; - - /** Render tree (i.e. create DOM elements for all top-level nodes). - * - * @param force create DOM elements, even is parent is collapsed (default = false) - * @param deep (default = false) - */ - render(force?: boolean, deep?: boolean): void; - - /** @param flag (default = true) */ - setFocus(flag?: boolean): void; - - /** Return all nodes as nested list of NodeData. - * - * @param callback Called for every node - * @param includeRoot Returns the hidden system root node (and its children) (default = false) - */ - toDict(includeRoot?: boolean, callback?: (node: FancytreeNode) => void): any; - - /** Call fn(node) for all nodes. - * - * @param fn the callback function. Return false to stop iteration, return "skip" to skip this node and children only. - * @returns false, if the iterator was stopped. - */ - visit(fn: (node: FancytreeNode) => any): boolean; - - /** Write warning to browser console (prepending tree info) */ - warn(msg: any): void; - } - - /** A FancytreeNode represents the hierarchical data model and operations. */ - interface FancytreeNode { - //#region Properties - /** The tree instance */ - tree: Fancytree; - /** The parent node */ - parent: FancytreeNode; - /** Node id (must be unique inside the tree) */ - key: string; - /** Display name (may contain HTML) */ - title: string; - /** Contains all extra data that was passed on node creation */ - data: Object; - /** Array of child nodes. For lazy nodes, null or undefined means 'not yet loaded'. Use an empty array to define a node that has no children. */ - children: FancytreeNode[]; - /** Use isExpanded(), setExpanded() to access this property. */ - expanded: boolean; - /** Addtional CSS classes, added to the node's ``. */ - extraClasses: string; - /** Folder nodes have different default icons and click behavior. Note: Also non-folders may have children. */ - folder: boolean; - /** null or type of temporarily generated system node like 'loading', or 'error'. */ - statusNodeType: string; - /** True if this node is loaded on demand, i.e. on first expansion. */ - lazy: boolean; - /** Alternative description used as hover banner */ - tooltip: string; - //#endregion - - //#region Methods - /** - * Append (or insert) a list of child nodes. - * - * @param children array of child node definitions (also single child accepted) - * @param insertBefore child node to insert nodes before. If omitted, the new children is appended. - * @returns The first child added. - */ - addChildren(children: Fancytree.NodeData[], insertBefore?: FancytreeNode): FancytreeNode; - /** - * Append (or insert) a list of child nodes. - * - * @param children array of child node definitions (also single child accepted) - * @param insertBefore key of the child node to insert nodes before. If omitted, the new children is appended. - * @returns The first child added. - */ - addChildren(children: Fancytree.NodeData[], insertBefore?: string): FancytreeNode; - /** - * Append (or insert) a list of child nodes. - * - * @param children array of child node definitions (also single child accepted) - * @param insertBefore index of the child node to insert nodes before. If omitted, the new children is appended. - * @returns The first child added. - */ - addChildren(children: Fancytree.NodeData[], insertBefore?: number): FancytreeNode; - /** - * Append (or insert) a single child node. - * - * @param child node to add - * @param insertBefore child node to insert this node before. If omitted, the new child is appended. - * @returns The child added. - */ - addChildren(child: Fancytree.NodeData, insertBefore?: FancytreeNode): FancytreeNode; - /** - * Append (or insert) a single child node. - * - * @param child node to add - * @param insertBefore key of the child node to insert this node before. If omitted, the new child is appended. - * @returns The child added. - */ - addChildren(child: Fancytree.NodeData, insertBefore?: string): FancytreeNode; - /** - * Append (or insert) a single child node. - * - * @param child node to add - * @param insertBefore index of the child node to insert this node before. If omitted, the new child is appended. - * @returns The child added. - */ - addChildren(child: Fancytree.NodeData, insertBefore?: number): FancytreeNode; - - - /** Append or prepend a node, or append a child node. This a convenience function that calls addChildren() - * - * @param mode 'before', 'after', 'firstChild', or 'child' ('over' is a synonym for 'child') (default='child') - * @returns new node. - */ - addNode(node: NodeData, mode?: string): FancytreeNode; - - /** Modify existing child nodes. */ - applyPatch(patch: NodePatch): JQueryPromise; - - /** Collapse all sibling nodes. */ - collapseSiblings(): JQueryPromise; - - /** Copy this node as sibling or child of `node`. - * - * @param node source node - * @param mode 'before' | 'after' | 'child' (default='child') - * @param map callback function(NodeData) that could modify the new node - * @returns new node. - */ - copyTo(node: FancytreeNode, mode?: string, map?: (node: NodeData) => void) : FancytreeNode; - - /** Count direct and indirect children. - * - * @param deep pass 'false' to only count direct children. (default=true) - */ - countChildren(deep?: boolean): number; - - /** Write to browser console if debugLevel >= 2 (prepending node info) */ - debug(msg: any): void; - - /** [ext-edit] Create a new child or sibling node and start edit mode. - * - * @param mode 'before', 'after', or 'child' (default='child') - * @param init NodeData (or simple title string) - */ - editCreateNode(mode?: string, init?: Object): void; - - /** [ext-edit] Stop inline editing. - * - * @param applyChanges false: cancel edit, true: save (if modified) - */ - editEnd(applyChanges: boolean): void; - - /** [ext-edit] Start inline editing of current node title. */ - editStart(): void; - - /** Find all nodes that contain `match` in the title. - * - * @param match string to search for - */ - findAll(match: string): FancytreeNode[]; - - /** Find all nodes that contain `match` in the title. - * - * @param match a function that returns `true` if a node is matched. - */ - findAll(match: (node: FancytreeNode) => boolean): FancytreeNode[]; - - /** Find first node that contains `match` in the title (not including self). - * - * @param match string to search for - */ - findFirst(match: string): FancytreeNode; - - /** Find first node that contains `match` in the title (not including self). - * - * @param match a function that returns `true` if a node is matched. - */ - findFirst(match: (node: FancytreeNode) => boolean): FancytreeNode; - - /** Fix selection status, after this node was (de)selected in multi-hier mode. This includes (de)selecting all children. */ - fixSelection3AfterClick(): void; - - /** Fix selection status for multi-hier mode. Only end-nodes are considered to update the descendants branch and parents. Should be called after this node has loaded new children or after children have been modified using the API. */ - fixSelection3FromEndNodes(): void; - - /** Update node data. If dict contains 'children', then also replace the hole sub tree. */ - fromDict(dict: NodeData): void; - - /** Return the list of child nodes (undefined for unexpanded lazy nodes). */ - getChildren(): FancytreeNode[]; - - /** [ext-clones] Return a list of clone-nodes or null. */ - getCloneList(includeSelf?: boolean): FancytreeNode[]; - - /** Return the first child node or null. */ - getFirstChild(): FancytreeNode; - - /** Return the 0-based child index. */ - getIndex(): number; - - /** Return the hierarchical child index (1-based, e.g. '3.2.4'). */ - getIndexHier(): string; - - /** Return the parent keys separated by options.keyPathSeparator, e.g. "id_1/id_17/id_32". */ - getKeyPath(excludeSelf: boolean): string; - - /** Return the last child of this node or null. */ - getLastChild(): FancytreeNode; - - /** Return node depth. 0: System root node, 1: visible top-level node, 2: first sub-level, ... . */ - getLevel(): number; - - /** Return the successor node (under the same parent) or null. */ - getNextSibling(): FancytreeNode; - - /** Return the parent node (null for the system root node). */ - getParent(): FancytreeNode; - - /**Return an array of all parent nodes (top-down). - * - * @param includeRoot Include the invisible system root node. (default=false) - * @param includeSelf Include the node itself (default=false). - */ - getParentList(includeRoot: boolean, includeSelf: boolean): FancytreeNode[]; - - /** Return the predecessor node (under the same parent) or null. */ - getPrevSibling(): FancytreeNode; - - /** Return true if node has children. Return undefined if not sure, i.e. the node is lazy and not yet loaded). */ - hasChildren(): boolean; - - /** Return true if node has keyboard focus. */ - hasFocus(): boolean; - - /** Write to browser console if debugLevel >= 1 (prepending node info) */ - info(msg: string): void; - - /** Return true if node is active (see also FancytreeNode.isSelected). */ - isActive(): boolean; - - /** Return true if node is a direct child of otherNode. */ - isChildOf(otherNode: FancytreeNode): boolean; - - /** [ext-clones] Return true if this node has at least another clone with same refKey. */ - isClone(): boolean; - - /** Return true, if node is a direct or indirect sub node of otherNode. */ - isDescendantOf(otherNode: FancytreeNode): boolean; - - /** [ext-edit] Check if this node is in edit mode. */ - isEditing(): boolean; - - /** Return true if node is expanded. */ - isExpanded(): boolean; - - /** Return true if node is the first node of its parent's children. */ - isFirstSibling(): boolean; - - /** Return true if node is a folder, i.e. has the node.folder attribute set. */ - isFolder(): boolean; - - /** Return true if node is the last node of its parent's children. */ - isLastSibling(): boolean; - - /** Return true if node is lazy (even if data was already loaded) */ - isLazy(): boolean; - - /** Return true if node is lazy and loaded. For non-lazy nodes always return true. */ - isLoaded(): boolean; - - /**Return true if children are currently beeing loaded, i.e. a Ajax request is pending. */ - isLoading(): boolean; - - /** Return true if this is the (invisible) system root node. */ - isRootNode(): boolean; - - /** Return true if node is selected, i.e. has a checkmark set (see also FancytreeNode#isActive). */ - isSelected(): boolean; - - /** Return true if this node is a temporarily generated system node like 'loading', or 'error' (node.statusNodeType contains the type). */ - isStatusNode(): boolean; - - /** Return true if this a top level node, i.e. a direct child of the (invisible) system root node. */ - isTopLevel(): boolean; - - /** Return true if node is lazy and not yet loaded. For non-lazy nodes always return false. */ - isUndefined(): boolean; - - /** Return true if all parent nodes are expanded. Note: this does not check whether the node is scrolled into the visible part of the screen. */ - isVisible(): boolean; - - /** Load all children of a lazy node if neccessary. The *expanded* state is maintained. - * - * @param forceReload Pass true to discard any existing nodes before. - */ - load(forceReload?: boolean): JQueryPromise; - - /** Expand all parents and optionally scroll into visible area as neccessary. Promise is resolved, when lazy loading and animations are done. - * - * @param opts passed to `setExpanded()`. Defaults to {noAnimation: false, noEvents: false, scrollIntoView: true} - */ - makeVisible(opts?: Object): JQueryPromise; - - /** Move this node to targetNode. - * - * @param mode 'child': append this node as last child of targetNode. - * This is the default. To be compatble with the D'n'd - * hitMode, we also accept 'over'. - * 'before': add this node as sibling before targetNode. - * 'after': add this node as sibling after targetNode. - * - * @param map optional callback(FancytreeNode) to allow modifcations - */ - moveTo(targetNode: FancytreeNode, mode: string, map?: (node: FancytreeNode) => void): void; - - /** Set focus relative to this node and optionally activate. - * - * @param where The keyCode that would normally trigger this move, e.g. `$.ui.keyCode.LEFT` would collapse the node if it is expanded or move to the parent oterwise. - * @param activate (default=true) - */ - navigate(where: number, activate?: boolean): JQueryPromise; - - /** Remove this node (not allowed for system root). */ - remove(): void; - - /** Remove childNode from list of direct children. */ - removeChild(childNode: FancytreeNode): void; - - /** Remove all child nodes and descendents. This converts the node into a leaf. - * If this was a lazy node, it is still considered 'loaded'; call node.resetLazy() in order to trigger lazyLoad on next expand. - */ - removeChildren(): void; - - /** This method renders and updates all HTML markup that is required to display this node in its current state. - * - * @param force re-render, even if html markup was already created - * @param deep also render all descendants, even if parent is collapsed - */ - render(force?: boolean, deep?: boolean): void; - - /** Update element's CSS classes according to node state. */ - renderStatus(): void; - - /** Create HTML markup for the node's outer (expander, checkbox, icon, and title). */ - renderTitle(): void; - - /** [ext-clones] Update key and/or refKey for an existing node. */ - reRegister(key: string, refKey: string): boolean; - - /** Remove all children, collapse, and set the lazy-flag, so that the lazyLoad event is triggered on next expand. */ - resetLazy(): void; - - /** Schedule activity for delayed execution (cancel any pending request). scheduleAction('cancel') will only cancel a pending request (if any). */ - scheduleAction(mode: string, ms: number) : void; - - /** - * @param effects animation options. - * @param options {topNode: null, effects: ..., parent: ...} this node will remain visible in any case, even if `this` is outside the scroll pane. - */ - scrollIntoView(effects?: boolean, options?: Object): JQueryPromise; - - /** - * @param effects animation options. - * @param options {topNode: null, effects: ..., parent: ...} this node will remain visible in any case, even if `this` is outside the scroll pane. - */ - scrollIntoView(effects?: Object, options?: Object): JQueryPromise; - - /** - * @param flag pass false to deactivate - * @param opts additional options. Defaults to {noEvents: false} - */ - setActive(flag?: boolean, opts?: Object): JQueryPromise; - - /** - * @param flag pass false to collapse. - * @param opts additional options. Defaults to {noAnimation:false, noEvents:false} - */ - setExpanded(flag?: boolean, opts?: Object): JQueryPromise; - - /** - * Set keyboard focus to this node. - * - * @param flag pass false to blur. - */ - setFocus(flag?: boolean): void; - - /** - * Select this node, i.e. check the checkbox. - * - * @param flag pass false to deselect. - */ - setSelected(flag?: boolean): void; - - /** - * Mark a lazy node as 'error', 'loading', or 'ok'. - * - * @param status 'error', 'ok' - */ - setStatus(status: string, message?: string, details?: string): void; - - /** Rename this node. */ - setTitle(title: string): void; - - /** - * Sort child list by title. - * - * @param cmp custom compare function(a, b) that returns -1, 0, or 1 (defaults to sort by title). - * @param deep pass true to sort all descendant nodes - */ - sortChildren(cmp?: (a: FancytreeNode, b: FancytreeNode) => number, deep?: boolean): void; - - /** - * Convert node (or whole branch) into a plain object. The result is compatible with node.addChildren(). - * - * @param recursive include child nodes. - * @param callback callback(dict) is called for every node, in order to allow modifications - */ - toDict(recursive?: boolean, callback?: (dict: NodeData) => void): NodeData; - - /** Flip expanded status. */ - toggleExpanded(): void; - - /** Flip selection status. */ - toggleSelected(): void; - - /** - * Call fn(node) for all child nodes. - * Stop iteration, if fn() returns false. Skip current branch, - * if fn() returns "skip". Return false if iteration was stopped. - * - * @param fn the callback function. Return false to stop iteration, return "skip" to skip this node and its children only. - * @param includeSelf (default=false) - */ - visit(fn: (node: FancytreeNode) => any, includeSelf?: boolean): boolean; - - /** - * Call fn(node) for all child nodes and recursively load lazy children. - * Note: If you need this method, you probably should consider to review your architecture! Recursivley loading nodes is - * a perfect way for lazy programmers to flood the server with requests ;-) - * - * @param fn the callback function. Return false to stop iteration, return "skip" to skip this node and its children only. - * @param includeSelf (default=false) - */ - visitAndLoad(fn: (node: FancytreeNode) => any, includeSelf?: boolean): JQueryPromise; - - /** - * Call fn(node) for all parent nodes, bottom-up, including invisible system root. - * Stop iteration, if fn() returns false. - * Return false if iteration was stopped. - * - * @param fn the callback function. Return false to stop iteration, return "skip" to skip this node and its children only. - * @param includeSelf (default=false) - */ - visitParents(fn: (node: FancytreeNode) => any, includeSelf?: boolean): boolean; - - /** - * Write warning to browser console (prepending node info) - */ - warn(msg: any): void; - //#endregion - } - - enum FancytreeClickFolderMode { - activate = 1, - expand = 2, - activate_and_expand = 3, - activate_dblclick_expands = 4 - } - - enum FancytreeSelectMode { - single = 1, - multi = 2, - mutlti_hier = 3 - } - - /** Context object passed to events and hook functions. */ - interface EventData { - /** The tree instance */ - tree: Fancytree; - /** The jQuery UI tree widget */ - widget: Object; - /** Shortcut to tree.options */ - options: FancytreeOptions; - /** The jQuery Event that initially triggered this call */ - originalEvent: JQueryEventObject; - /** The node that this call applies to (`null` for tree events) */ - node: FancytreeNode; - /** (output parameter) Event handlers can return values back to the - * caller. Used by `lazyLoad`, `postProcess`, ... */ - result: any; - /** (only for click and dblclick events) 'title' | 'prefix' | 'expander' | 'checkbox' | 'icon' */ - targetType: string; - /** (only for postProcess event) Original ajax response */ - response: any; - } - - /** The `this` context of any event function is set to tree's the HTMLDivElement */ - interface FancytreeEvents { - /** 'data.node' was deactivated. */ - activate?(event: JQueryEventObject, data: EventData): void; - /** Return false to prevent default processing */ - beforeActivate?(event: JQueryEventObject, data: EventData): boolean; - /** Return `false` to prevent default processing */ - beforeExpand?(event: JQueryEventObject, data: EventData): boolean; - /** Return `false` to prevent default processing */ - beforeSelect?(event: JQueryEventObject, data: EventData): boolean; - /** `data.node` lost keyboard focus */ - blur?(event: JQueryEventObject, data: EventData): void; - /** `data.tree` lost keyboard focus */ - blurTree?(event: JQueryEventObject, data: EventData): void; - /** `data.node` was clicked. `data.targetType` contains the region ("title", "expander", ...). Return `false` to prevent default processing, i.e. activating, etc. */ - click?(event: JQueryEventObject, data: EventData): boolean; - /** `data.node` was collapsed */ - collapse?(event: JQueryEventObject, data: EventData): void; - /** Widget was created (called only once, even if re-initialized). */ - create?(event: JQueryEventObject, data: EventData): void; - /** Allow tweaking and binding, after node was created for the first time (NOTE: this event is only available as callback, but not for bind()) */ - createNode?(event: JQueryEventObject, data: EventData): void; - /** `data.node` was double-clicked. `data.targetType` contains the region ("title", "expander", ...). Return `false` to prevent default processing, i.e. expanding, etc. */ - dblclick?(event: JQueryEventObject, data: EventData): boolean; - /** `data.node` was deactivated */ - deactivate?(event: JQueryEventObject, data: EventData): void; - /** `data.node` was expanded */ - expand?(event: JQueryEventObject, data: EventData): void; - /** `data.node` received keyboard focus */ - focus?(event: JQueryEventObject, data: EventData): void; - /**`data.tree` received keyboard focus */ - focusTree?(event: JQueryEventObject, data: EventData): void; - /** Widget was (re-)initialized. */ - init?(event: JQueryEventObject, data: EventData): void; - /** `data.node` received key. `event.which` contains the key. Return `false` to prevent default processing, i.e. navigation. Call `data.result = "preventNav";` to prevent navigation but still allow default handling inside embedded input controls. */ - keydown?(event: JQueryEventObject, data: EventData): boolean; - /** (currently unused) */ - keypress?(event: JQueryEventObject, data: EventData): void; - /** `data.node` is a lazy node that is expanded for the first time. The new child data must be returned in the `data.result` property (see `source` option for available formats). */ - lazyLoad?(event: JQueryEventObject, data: EventData): void; - /** Node data was loaded, i.e. `node.nodeLoadChildren()` finished */ - loadChildren?(event: JQueryEventObject, data: EventData): void; - /** A load error occured. Return `false` to prevent default processing. */ - loadError?(event: JQueryEventObject, data: EventData): boolean; - /** Allows to modify the ajax response. */ - postProcess?(event: JQueryEventObject, data: EventData): void; - /** `data.node` was removed (NOTE: this event is only available as callback, but not for bind()) */ - removeNode?(event: JQueryEventObject, data: EventData): void; - /** (used by table extension) */ - renderColumns?(event: JQueryEventObject, data: EventData): void; - /** Allow tweaking after node state was rendered (NOTE: this event is only available as callback, but not for bind()) */ - renderNode?(event: JQueryEventObject, data: EventData): void; - /** Allow replacing the `` markup (NOTE: this event is only available as callback, but not for bind()) */ - renderTitle?(event: JQueryEventObject, data: EventData): void; - /** ext-persist has expanded, selected, and activated the previous state */ - restore?(event: JQueryEventObject, data: EventData): void; - /** `data.node` was selected */ - select?(event: JQueryEventObject, data: EventData): void; - } - - interface FancytreeOptions extends FancytreeEvents { - /** Make sure that the active node is always visible, i.e. its parents are expanded (default: true). */ - activeVisible?: boolean; - /** Default options for ajax requests. */ - ajax?: Object; - /** (default: false) Add WAI-ARIA attributes to markup */ - aria?: boolean; - /** Activate a node when focused with the keyboard (default: true) */ - autoActivate?: boolean; - /** Automatically collapse all siblings, when a node is expanded (default: false). */ - autoCollapse?: boolean; - /** Scroll node into visible area, when focused by keyboard (default: false). */ - autoScroll?: boolean; - /** Display checkboxes to allow selection (default: false) */ - checkbox?: boolean; - /** Defines what happens, when the user click a folder node. (default: activate_dblclick_expands) */ - clickFolderMode?: FancytreeClickFolderMode; - /** 0..2 (null: use global setting $.ui.fancytree.debugInfo) */ - debugLevel?: number; - /** callback(node) is called for new nodes without a key. Must return a new unique key. (default null: generates default keys like that: "_" + counter) */ - defaultKey?: (node: FancytreeNode) => string; - /** Accept passing ajax data in a property named `d` (default: true). */ - enableAspx?: boolean; - /** List of active extensions (default: []) */ - extensions?: string[]; - /** Set focus when node is checked by a mouse click (default: false) */ - focusOnSelect?: boolean; - /** Add `id="..."` to node markup (default: true). */ - generateIds?: boolean; - /** Display node icons (default: true) */ - icons?: boolean; - /** (default: "ft_") */ - idPrefix?: string; - /** Path to a folder containing icons (default: null, using 'skin/' subdirectory). */ - imagePath?: string; - /** Support keyboard navigation (default: true). */ - keyboard?: boolean; - /** (default: "/") */ - keyPathSeparator?: string; - /** 2: top-level nodes are not collapsible (default: 1) */ - minExpandLevel?: number; - /** navigate to next node by typing the first letters (default: false) */ - quicksearch?: boolean; - /** optional margins for node.scrollIntoView() (default: {top: 0, bottom: 0}) */ - scrollOfs?: Object; - /** scrollable container for node.scrollIntoView() (default: $container) */ - scrollParent?: JQuery; - /** default: multi_hier */ - selectMode?: FancytreeSelectMode; - /** Used to Initialize the tree. */ - source?: any; - /** Translation table */ - strings?: Object; - /** Add tabindex='0' to container, so tree can be reached using TAB */ - tabbable?: boolean; - /** Add tabindex='0' to node title span, so it can receive keyboard focus */ - titlesTabbable?: boolean; - /** Animation options, false:off (default: { effect: "blind", options: {direction: "vertical", scale: "box"}, duration: 200 }) */ - toggleEffect?: Object; - } - - /** Data object passed to FancytreeNode() constructor. Note: typically these attributes are accessed by meber methods, e.g. `node.isExpanded()` and `node.setSelected(false)`. */ - interface NodeData { - /** node text (may contain HTML tags) */ - title: string; - icon?: string; - /** unique key for this node (auto-generated if omitted) */ - key?: string; - /** (reserved) */ - refKey?: string; - expanded?: boolean; - /** (initialization only, but will not be stored with the node). */ - active?: boolean; - /** (initialization only, but will not be stored with the node). */ - focus?: boolean; - folder?: boolean; - hideCheckbox?: boolean; - lazy?: boolean; - selected?: boolean; - unselectable?: boolean; - /** optional array of child nodes */ - children?: NodeData[]; - tooltip?: string; - /** class names added to the node markup (separate with space) */ - extraClasses?: string; - /** all properties from will be copied to `node.data` */ - data?: Object; - } - - /** Data object similar to NodeData, but with additional options. - * May be passed to FancytreeNode#applyPatch (Every property that is omitted (or set to undefined) will be ignored) */ - interface NodePatch { - /** (not yet implemented) */ - appendChildren?: NodeData; - /** (not yet implemented) */ - replaceChildren?: NodeData; - /** (not yet implemented) */ - insertChildren?: NodeData; - } - - /** May be passed to Fancytree#applyPatch. */ - interface TreePatch { - [key: string]: NodePatch; - } - - interface FancytreeStatic { - buildType: string; - debugLevel: number; - version: string; - - /** Throw an error if condition fails (debug method). */ - assert(cond: boolean, msg: string): void; - - /** Return a function that executes *fn* at most every *timeout* ms. */ - debounce void>(timeout: number, fn: T, invokeAsap?: boolean, ctx?: any): T; - - debug(msg: string): void; - - error(msg: string): void; - - escapeHtml(s: string): string; - - getEventTarget(event: Event): Object; - - getEventTargetType(event: Event): string; - - getNode(el: JQuery): FancytreeNode; - getNode(el: Event): FancytreeNode; - getNode(el: Element): FancytreeNode; - - info(msg: string): void; - - /** Convert a keydown event to a string like 'ctrl+a', 'ctrl+shift+f2'. */ - keyEventToString(event: Event): string; - - /** Parse tree data from HTML markup */ - parseHtml($ul: JQuery): NodeData[]; - - /** Add Fancytree extension definition to the list of globally available extensions. */ - registerExtension(definition: Object): void; - - unescapeHtml(s: string): string; - - warn(msg: string): void; - } -} - diff --git a/jquery.form/jquery.form-tests.ts b/jquery.form/jquery.form-tests.ts deleted file mode 100644 index f115a97f57..0000000000 --- a/jquery.form/jquery.form-tests.ts +++ /dev/null @@ -1,191 +0,0 @@ -/// - -// Basic usage - -jQuery('#myFormId').ajaxForm(); - -jQuery('#myFormId').ajaxSubmit(); - -var queryString1 : string = jQuery('#myFormId').formSerialize(); - -var queryString2 : string = jQuery('#myFormId .specialFields').fieldSerialize(); - -var valueArray1 : string[] = jQuery('#myFormId :password').fieldValue(); - -var valueArray2: string[] = jQuery('#myUncheckedCheckbox').fieldValue(false); - -var value1: string = jQuery.fieldValue(document.getElementById("some_id")); - -var value2: string = jQuery.fieldValue(document.getElementById("some_id"), false); - -jQuery('#myFormId').resetForm(); - -jQuery('#myFormId').clearForm(); - -jQuery('#myFormId .specialFields').clearFields(); - -// Debug - -jQuery.fn.ajaxSubmit.debug = true; - -// ajaxForm - -// bind form using 'ajaxForm' -$('#myForm1').ajaxForm({ - target: '#output1', // target element(s) to be updated with server response - beforeSubmit: function (formData, jqForm, options) { // pre-submit callback - // formData is an array; here we use $.param to convert it to a string to display it - // but the form plugin does this for you automatically when it submits the data - var queryString = $.param(formData); - - // jqForm is a jQuery object encapsulating the form element. To access the - // DOM element for the form do this: - // var formElement = jqForm[0]; - - alert('About to submit: \n\n' + queryString); - - // here we could return false to prevent the form from being submitted; - // returning anything other than false will allow the form submit to continue - return true; - }, - success: function (responseText, statusText, xhr) { // post-submit callback - // for normal html responses, the first argument to the success callback - // is the XMLHttpRequest object's responseText property - - // if the ajaxForm method was passed an Options Object with the dataType - // property set to 'xml' then the first argument to the success callback - // is the XMLHttpRequest object's responseXML property - - // if the ajaxForm method was passed an Options Object with the dataType - // property set to 'json' then the first argument to the success callback - // is the json data object returned by the server - - alert('status: ' + statusText + '\n\nresponseText: \n' + responseText + - '\n\nThe output div should have already been updated with the responseText.'); - } - - // other available options: - //url: url // override for form's 'action' attribute - //type: type // 'get' or 'post', override for form's 'method' attribute - //dataType: null // 'xml', 'script', or 'json' (expected server response type) - //clearForm: true // clear all form fields after successful submit - //resetForm: true // reset the form after successful submit - - // $.ajax options can be used here too, for example: - //timeout: 3000 -}); - -// ajaxSubmit - -$('#myForm2').ajaxSubmit({ - target: '#output2', // target element(s) to be updated with server response - beforeSubmit: function (formData, jqForm, options) { // pre-submit callback - // formData is an array; here we use $.param to convert it to a string to display it - // but the form plugin does this for you automatically when it submits the data - var queryString = $.param(formData); - - // jqForm is a jQuery object encapsulating the form element. To access the - // DOM element for the form do this: - // var formElement = jqForm[0]; - - alert('About to submit: \n\n' + queryString); - - // here we could return false to prevent the form from being submitted; - // returning anything other than false will allow the form submit to continue - return true; - }, - success: function showResponse(responseText, statusText, xhr) { // post-submit callback - // for normal html responses, the first argument to the success callback - // is the XMLHttpRequest object's responseText property - - // if the ajaxSubmit method was passed an Options Object with the dataType - // property set to 'xml' then the first argument to the success callback - // is the XMLHttpRequest object's responseXML property - - // if the ajaxSubmit method was passed an Options Object with the dataType - // property set to 'json' then the first argument to the success callback - // is the json data object returned by the server - - alert('status: ' + statusText + '\n\nresponseText: \n' + responseText + - '\n\nThe output div should have already been updated with the responseText.'); - } - - // other available options: - //url: url // override for form's 'action' attribute - //type: type // 'get' or 'post', override for form's 'method' attribute - //dataType: null // 'xml', 'script', or 'json' (expected server response type) - //clearForm: true // clear all form fields after successful submit - //resetForm: true // reset the form after successful submit - - // $.ajax options can be used here too, for example: - //timeout: 3000 -}); - -// Validation - -$('#myForm2').ajaxForm({ - beforeSubmit: function (formData, jqForm, options) { - // formData is an array of objects representing the name and value of each field - // that will be sent to the server; it takes the following form: - // - // [ - // { name: username, value: valueOfUsernameInput }, - // { name: password, value: valueOfPasswordInput } - // ] - // - // To validate, we can examine the contents of this array to see if the - // username and password fields have values. If either value evaluates - // to false then we return false from this method. - - for (var i = 0; i < formData.length; i++) { - if (!formData[i].value) { - alert('Please enter a value for both Username and Password'); - return false; - } - } - alert('Both fields contain values.'); - } -}); - -// JSON - -$('#jsonForm').ajaxForm({ - // dataType identifies the expected content type of the server response - dataType: 'json', - - // success identifies the function to invoke when the server response - // has been received - success: function (data) { - // 'data' is the json object returned from the server - alert(data.message); - } -}); - -// XML - -$('#xmlForm').ajaxForm({ - // dataType identifies the expected content type of the server response - dataType: 'xml', - - // success identifies the function to invoke when the server response - // has been received - success: function (responseXML) { - // 'responseXML' is the XML document returned by the server; we use - // jQuery to extract the content of the message node from the XML doc - var message = $('message', responseXML).text(); - alert(message); - } -}); - -// HTML - -$('#htmlForm').ajaxForm({ - // target identifies the element(s) to update with the server response - target: '#htmlExampleTarget', - - // success identifies the function to invoke when the server response - // has been received; here we apply a fade-in effect to the new content - success: function () { - $('#htmlExampleTarget').fadeIn('slow'); - } -}); \ No newline at end of file diff --git a/jquery.payment/index.d.ts b/jquery.payment/index.d.ts deleted file mode 100644 index 341e695a9a..0000000000 --- a/jquery.payment/index.d.ts +++ /dev/null @@ -1,121 +0,0 @@ -// Type definitions for jQuery.payment -// Project: https://github.com/stripe/jquery.payment -// Definitions by: Eric J. Smith , John Rutherford -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare namespace JQueryPayment { - - interface Payment { - /** - * Validates a card number: - * * Validates numbers - * * Validates Luhn algorithm - * * Validates length - * - * @param cardNumber The card number to validate. - */ - validateCardNumber(cardNumber: string): boolean; - - /** - * Validates a card expiry: - * * Validates numbers - * * Validates in the future - * * Supports year shorthand - * - * @param year The year to validate. - * @param month The months to validate. - */ - validateCardExpiry(year: string, month: string): boolean; - - /** - * Validates a card expiry: - * * Validates numbers - * * Validates in the future - * * Supports year shorthand - * - * @param expiry An object with the year and month to validate. - */ - validateCardExpiry(expiry: ExpiryInfo): boolean; - - /** - * Validates a card CVC: - * * Validates number - * * Validates length to 4 - * - * @param cvc The CVC value to validate. - * @param type Optional card type. - */ - validateCardCVC(cvc: string, type?: string): boolean; - - /** - * Returns a card type. The function will return null if the card type can't be determined. - * - * @param cardNumber The card number to parse. - */ - cardType(cardNumber: string): string; - - /** - * Parses a credit card expiry in the form of MM/YYYY, returning an object containing the month and - * year. Shorthand years, such as 13 are also supported (and converted into the longhand, e.g. 2013). - * - * @param monthYear The value to parse. - */ - cardExpiryVal(monthYear: string): ExpiryInfo; - - /** - * Array of objects that describe valid card types. - */ - cards: CardInfo[]; - } - - interface ExpiryInfo { - month: number; - year: number; - } - - interface CardInfo { - /** - * Card type - */ - type?: string; - - /** - * Regex used to identify the card type. For the best experience, this should be - * the shortest pattern that can guarantee the card is of a particular type. - */ - pattern?: RegExp; - - /** - * Array of prefixes used to identify the card type. - */ - patterns?: number[]; - - /** - * Array of valid card number lengths. - */ - length?: number[]; - - /** - * Array of valid card CVC lengths. - */ - cvcLength?: number[]; - - /** - * Boolean indicating whether a valid card number should satisfy the Luhn check. - */ - luhn?: boolean; - - /** - * Regex used to format the card number. Each match is joined with a space. - */ - format?: RegExp; - } -} - -interface JQuery { - payment(command: string): JQuery; -} - -interface JQueryStatic { - payment: JQueryPayment.Payment; -} diff --git a/jquery.timer/jquery.timer-tests.ts b/jquery.timer/jquery.timer-tests.ts deleted file mode 100644 index e5d1cdaa3a..0000000000 --- a/jquery.timer/jquery.timer-tests.ts +++ /dev/null @@ -1,31 +0,0 @@ -/// - - - // Create the timer - $("body").timer( - function () { - console.log("This function just got called"); - }, 10000, true - ); - - $("body").timer.set({ time: 5000 }); // Change the time from 10000 millseconds to 5000 milliseconds - $("body").timer.toggle(false); // Reset the timer - $("body").timer.stop(); // Stop the timer - $("body").timer.play(); // Start / play the timer - - // #region Outputting if timer is active or not - var isTimerActive = $("body").timer.isActive; // Define boolean isActive as isTimerActive - if (isTimerActive == true){ - console.log("Timer is active!"); - } - else{ - console.log("Timer is not active!"); - } - // #endregion - - // #region Get time remaining - console.log("Time remaining on timer: " + $("body").timer.remaining.toString); - // #endregion - - $("body").timer.stop(); // Stop the timer once more for the purpose of the tests (to test once()) - $("body").timer.once(1000); // Run the timer ONCE in 1 second \ No newline at end of file diff --git a/jquery.tools/index.d.ts b/jquery.tools/index.d.ts deleted file mode 100644 index e511a961fd..0000000000 --- a/jquery.tools/index.d.ts +++ /dev/null @@ -1,161 +0,0 @@ -// Type definitions for jQuery TOOLS 1.2 -// Project: https://github.com/jquerytools/jquerytools -// Definitions by: Joe Skeen -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - - -/// - -declare interface JQuery { - overlay(opts?: JQueryTools.overlay.OverlayOptions): JQuery; - overlay(opts?: JQueryTools.overlay.OverlayOptions): T; - data(key: 'overlay'): JQueryTools.overlay.Overlay; -} - -declare interface JQueryStatic { - tools: JQueryTools.ToolsStatic; -} - -/** jQuery Tools (http://jquerytools.github.io/documentation/overlay/index.html) */ -declare namespace JQueryTools { - interface ToolsStatic { - overlay: overlay.OverlayStatic; - } - - namespace overlay { - interface OverlayStatic { - addEffect(effectName: string, - effectFn: (this: Overlay, position: CssOptions, done: () => void) => void, - closeFn: (this: Overlay, done: () => void) => void): void; - } - - interface CssOptions { - [key: string]: any; - } - - interface OverlayOptions { - /** - * A jQuery selector for the closing elements inside the overlay. These - * can be any elements such as links, buttons or images. If this is not - * supplied, a close element is auto-generated. Read more about this in - * defining close actions. - */ - close?: JQuery; - /** - * By default, overlays are closed when the mouse is clicked outside the - * overlay area. Setting this property to false suppresses this behaviour - * which is suitable for modal dialogs. - * @default true - */ - closeOnClick?: boolean; - /** - * By default, overlays are closed when the ESC keyboard key is pressed. - * Setting this property to false suppresses this behaviour. - * @default true - */ - closeOnEsc?: boolean; - /** The speed to close the overlay, in milliseconds */ - closeSpeed?: number; - /** - * The effect to be used when an overlay is opened and closed. This can - * dramatically change the behaviour of the overlay. By default this tool - * uses an effect called "default" which is a simple show/hide effect. - * @default 'default' - */ - effect?: string; - /** - * since 1.2.0. whether overlay stays in the same position while the screen - * is scrolled. This is the default behaviour for all browsers except IE6 - * and below. IE6 does not support fixed positioning. If this property is - * set to false then the overlay is positioned in relationship to the document - * so that when the screen is scrolled then the overlay moves along with the document. - * @default true - */ - fixed?: boolean; - /** - * Previously known as expose. Overlay is very often used together with the - * Mask Tool. Because of this, the support for this feature has been built - * inside the tool. This option accepts the mask configuration. This is either - * a simple string specifying the background color of the mask or a more complex - * object literal specifying more configuration variables. See an example of an - * overlay together with mask. By default masking is disabled. - */ - mask?: string | MaskOptions; - /** - * Specifies how far from the left-hand edge of the screen the overlay should be - * placed. By default the overlay is horizontally centered with the value "center" - * but you can also supply a numerical value specifying a distance in pixels. - * @default 'center' - */ - left?: 'center' | number; - /** - * If enabled then the overlay loads immediately after it has been initialized. - * @default false - */ - load?: boolean; - /** - * By default, there can be only one overlay on the page at once. Setting this - * property to false allows you to have multiple overlay instances. - * @default true - */ - oneInstance?: boolean; - /** - * The speed of the fade-in animation on the "default" effect. Valid values are - * 'slow', 'normal' and 'fast', or you can supply a numerical value (in milliseconds). - * By setting this property to 0, the overlay will appear immediately without any animation. - * @default 'normal' - */ - speed?: 'slow' | 'normal' | 'fast' | number; - /** - * The element to be overlayed (if not specified in the rel attribute of the triggering element). - */ - target?: Element; - /** - * Specifies how far from the top edge of the screen the overlay should be placed. - * Acceptable values are an integer number specifying a distance in pixels, a string - * (such as '15%') specifying a percentage value or "center" in which case the overlay - * is vertically centered. Percentage values work consistently at different screen resolutions. - * @default '10%' - */ - top?: string | number; - - /** - * before the overlay is displayed. The overlay has already been positioned at the - * location from where it will start animating. - */ - onBeforeLoad?: (this: Overlay, event: JQueryEventObject) => void; - /** when the overlay has completely been displayed */ - onLoad?: (this: Overlay, event: JQueryEventObject) => void; - /** before the overlay is closed */ - onBeforeClose?: (this: Overlay, event: JQueryEventObject) => void; - /** when the overlay is closed */ - onClose?: (this: Overlay, event: JQueryEventObject) => void; - } - - interface MaskOptions { - /** CSS color string (i.e. hex value) */ - color?: string; - /** load speed in milliseconds */ - loadSpeed?: number; - /** Opacity of mask. Between 0 and 1. */ - opacity?: number; - } - - interface Overlay { - /** Closes the overlay. */ - close(): Overlay; - /** Returns the closing element(s) as a jQuery object. */ - getClosers(): JQuery; - /** Returns the configuration for the overlay. */ - getConf(): OverlayOptions; - /** Returns the overlayed element as a jQuery object. */ - getOverlay(): JQuery; - /** Returns the triggering element as a jQuery object. */ - getTrigger(): JQuery; - /** Returns `true` if the overlay is opened. */ - isOpened(): boolean; - /** Opens the overlay. */ - load(): Overlay; - } - } -} diff --git a/jquery.tools/jquery.tools-tests.ts b/jquery.tools/jquery.tools-tests.ts deleted file mode 100644 index 0a435ccf02..0000000000 --- a/jquery.tools/jquery.tools-tests.ts +++ /dev/null @@ -1,181 +0,0 @@ -/// - -/* from documentation at http://jquerytools.github.io/documentation/overlay/index.html */ - - $("img[rel]").overlay(); - - var triggers = $(".modalInput").overlay({ -  - // some mask tweaks suitable for modal dialogs - mask: { - color: '#ebecff', - loadSpeed: 200, - opacity: 0.9 - }, -  - closeOnClick: false - }); - - var buttons = $("#yesno button").click(function(this: JQuery, e: JQueryEventObject) { -  - // get user input - var yes = buttons.index(this) === 0; -  - // do something with the answer - triggers.eq(0).html("You clicked " + (yes ? "yes" : "no")); - }); - -// select one or more elements to be overlay triggers -$(".my_overlay_trigger").overlay({ - // one configuration property - mask: { - color: '#ccc' - }, - // another property - top: 50 - // ... the rest of the configuration properties -}); - -$("#prompt form").submit(function(this: JQuery, e: JQueryEventObject) { -  - // close the overlay - triggers.eq(1).overlay().close(); - // or more straightforward: - triggers.data('overlay').close(); -  - // get user input - var input = $("input", this).val(); -  - // do something with the answer - triggers.eq(1).html(input); -  - // do not submit the form - return e.preventDefault(); - }); - -$.tools.overlay.addEffect('', () => {}, () => {}); - -/* custom effects */ -$.tools.overlay.addEffect("myEffect", function(position, done) { - /* - - 'this' variable is a reference to the overlay API - - here we use jQuery's fadeIn() method to perform the effect - */ - this.getOverlay().css(position).fadeIn(this.getConf().speed, done); - }, -  - // close function - function(done) { - // fade out the overlay - this.getOverlay().fadeOut(this.getConf().closeSpeed, done); - } -); - -$("#apple img[rel]").overlay({effect: 'apple'}); - - // select the overlay element - and "make it an overlay" - $("#facebox").overlay({ - // custom top position - top: 260, - // some mask tweaks suitable for facebox-looking dialogs - mask: { - // you might also consider a "transparent" color for the mask - color: '#fff', - // load mask a little faster - loadSpeed: 200, - // very transparent - opacity: 0.5 - }, - // disable this for modal dialog-type of overlays - closeOnClick: false, - // load it immediately after the construction - load: true -}); - -$(function() { -  - // if the function argument is given to overlay, - // it is assumed to be the onBeforeLoad event listener - $("a[rel]").overlay({ -  - mask: 'darkred', - effect: 'apple', -  - onBeforeLoad() { - // grab wrapper element inside content - var wrap = this.getOverlay().find(".contentWrap"); -  - // load the page specified in the trigger - wrap.load(this.getTrigger().attr("href")); - } -  - }); -}); - -$(() => { - // positions for each overlay - var positions = [ - [0, 530], - [400, 20], - [400, 530], - [0, 20] - ]; -  - // setup triggers - $("button[rel]").each(function(this: JQuery, i: number) { -  - $(this).overlay({ -  - // common configuration for each overlay - oneInstance: false, - closeOnClick: false, -  - // setup custom finish position - top: positions[i][0], - left: positions[i][1], -  - // use apple effect - effect: 'apple' -  - }); - }); -}); - -// loading animation -$.tools.overlay.addEffect("drop", function(css, done) { -  - // use Overlay API to gain access to crucial elements - var conf = this.getConf(), - overlay = this.getOverlay(); -  - // determine initial position for the overlay - if (conf.fixed) { - css['position'] = 'fixed'; - } else { - css['top'] += $(window).scrollTop(); - css['left'] += $(window).scrollLeft(); - css['position'] = 'absolute'; - } -  - // position the overlay and show it - overlay.css(css).show(); -  - // begin animating with our custom easing - overlay.animate( - { top: '+=55', opacity: 1, width: '+=20'}, 400, 'drop', done - ); -  - /* closing animation */ -}, function(done) { - this.getOverlay().animate( - { top: '-=55', opacity: 0, width: '-=20' }, 300, 'drop', - function(this: JQuery) { - $(this).hide(); - done.call(null); - }); -}); - -$("img[rel]").overlay({ - effect: 'drop', - mask: '#789' -}); diff --git a/jquery.tools/tslint.json b/jquery.tools/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/jquery.tools/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/jquery.total-storage/jquery.total-storage-tests.ts b/jquery.total-storage/jquery.total-storage-tests.ts deleted file mode 100644 index 0a23dd67cf..0000000000 --- a/jquery.total-storage/jquery.total-storage-tests.ts +++ /dev/null @@ -1,20 +0,0 @@ -// Type definitions for jQueryTotalStorage 1.1.2 -// Project: https://github.com/Upstatement/jquery-total-storage -// Definitions by: Jeremy Brooks -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -//direct call -$.totalStorage("test_key1", "test_value"); -var val1:string = $.totalStorage("test_key"); - -//set/get -$.totalStorage.setItem("test_key2", 123); -var val2:number = $.totalStorage.getItem("test_key2"); - -//get all items -var list = $.totalStorage.getAll(); - -//delete item -var deleted = $.totalStorage.deleteItem("test_key1"); \ No newline at end of file diff --git a/jquery.validation/index.d.ts b/jquery.validation/index.d.ts deleted file mode 100644 index 2bb690c07e..0000000000 --- a/jquery.validation/index.d.ts +++ /dev/null @@ -1,317 +0,0 @@ -// Type definitions for jquery.validation 1.13.1 -// Project: http://jqueryvalidation.org/ -// Definitions by: François de Campredon , John Reilly -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - - -/// - - -declare namespace JQueryValidation -{ - type RulesDictionary = { [name: string]: any }; - - type ShouldValidatePredicate = boolean|((element: HTMLElement, event: JQueryEventObject) => void); - - interface ValidationOptions - { - /** - * Enables debug mode. If true, the form is not submitted and certain errors are displayed on the console (will check if a window.console property exists). Try to enable when a form is just submitted instead of validation stopping the submit. - * - * default: false - */ - debug?: boolean; - /** - * Use this class to create error labels, to look for existing error labels and to add it to invalid elements. - * - * default: "error" - */ - errorClass?: string; - /** - * Hide and show this container when validating. - */ - errorContainer?: string; - /** - * Use this element type to create error messages and to look for existing error messages. The default, "label", has the advantage of creating a meaningful link between error message and invalid field using the for attribute (which is always used, regardless of element type). - * - * default: "label" - */ - errorElement?: string; - /** - * Hide and show this container when validating. (eg "#messageBox") - */ - errorLabelContainer?: string; - /** - * Customize placement of created error labels. First argument: The created error label as a jQuery object. Second argument: The invalid element as a jQuery object. - * - * default: Places the error label after the invalid element - */ - errorPlacement?: (error: JQuery, element: JQuery) => void; - /** - * If enabled, removes the errorClass from the invalid elements and hides all error messages whenever the element is focused. Avoid combination with focusInvalid. - * - * default: false - */ - focusCleanup?: boolean; - /** - * Focus the last active or first invalid element on submit via validator.focusInvalid(). The last active element is the one that had focus when the form was submitted, avoiding stealing its focus. If there was no element focused, the first one in the form gets it, unless this option is turned off. - * - * default: true - */ - focusInvalid?: boolean; - /** - * Specify grouping of error messages. A group consists of an arbitrary group name as the key and a space separated list of element names as the value. Use errorPlacement to control where the group message is placed. - */ - groups?: { [groupName: string]: string }; - /** - * How to highlight invalid fields. Override to decide which fields and how to highlight. - * - * default: Adds errorClass (see the option) to the element - */ - highlight?: (element: HTMLElement, errorClass: string, validClass: string) => void; - /** - * Elements to ignore when validating, simply filtering them out. jQuery's not-method is used, therefore everything that is accepted by not() can be passed as this option. Inputs of type submit and reset are always ignored, so are disabled elements. - */ - ignore?: string; - /** - * Set to skip reading messages from the title attribute, helps to avoid issues with Google Toolbar; default is false for compability, the message-from-title is likely to be completely removed in a future release. - * - * default: false - */ - ignoreTitle?: boolean; - /** - * Callback for custom code when an invalid form is submitted. Called with an event object as the first argument, and the validator as the second. - */ - invalidHandler?: (event: JQueryEventObject, validator: Validator) => void; - /** - * Key/value pairs defining custom messages. Key is the name of an element, value the message to display for that element. Instead of a plain message, another map with specific messages for each rule can be used. Overrides the title attribute of an element or the default message for the method (in that order). Each message can be a String or a Callback. The callback is called in the scope of the validator, with the rule's parameters as the first argument and the element as the second, and must return a String to display as the message. - * - * default: the default message for the method used - */ - messages?: Object; - meta?: string; - /** - * Boolean or Function. Validate checkboxes and radio buttons on click. Set to false to disable. - * - * Set to a Function to decide for yourself when to run validation. - * A boolean true is not a valid value. - */ - onclick?: ShouldValidatePredicate; - /** - * Boolean or Function. Validate elements (except checkboxes/radio buttons) on blur. If nothing is entered, all rules are skipped, except when the field was already marked as invalid. - * - * Set to a Function to decide for yourself when to run validation. - * A boolean true is not a valid value. - */ - onfocusout?: ShouldValidatePredicate; - /** - * Boolean or Function. Validate elements on keyup. As long as the field is not marked as invalid, nothing happens. Otherwise, all rules are checked on each key up event. Set to false to disable. - * - * Set to a Function to decide for yourself when to run validation. - * A boolean true is not a valid value. - */ - onkeyup?: ShouldValidatePredicate; - /** - * Validate the form on submit. Set to false to use only other events for validation. - * Set to a Function to decide for yourself when to run validation. - * A boolean true is not a valid value. - * - * default: true - */ - onsubmit?: boolean; - /** - * A custom message display handler. Gets the map of errors as the first argument and an array of errors as the second, called in the context of the validator object. The arguments contain only those elements currently validated, which can be a single element when doing validation onblur/keyup. You can trigger (in addition to your own messages) the default behaviour by calling this.defaultShowErrors(). - */ - rules?: RulesDictionary; - /** - * A custom message display handler. Gets the map of errors as the first argument and an array of errors as the second, called in the context of the validator object. The arguments contain only those elements currently validated, which can be a single element when doing validation onblur/keyup. You can trigger (in addition to your own messages) the default behaviour by calling this.defaultShowErrors(). - */ - showErrors?: (errorMap: ErrorDictionary, errorList: ErrorListItem[]) => void; - /** - * Callback for handling the actual submit when the form is valid. Gets the form and the event object. Replaces the default submit. The right place to submit a form via Ajax after it is validated. - */ - submitHandler?: (form: HTMLFormElement, event?: JQueryEventObject) => void; - /** - * String or Function. If specified, the error label is displayed to show a valid element. If a String is given, it is added as a class to the label. If a Function is given, it is called with the label (as a jQuery object) and the validated input (as a DOM element). The label can be used to add a text like "ok!". - */ - success?: string|{($label: JQuery, validatedInput: HTMLElement):void}; - /** - * Called to revert changes made by option highlight, same arguments as highlight. - * - * default: Removes the errorClass - */ - unhighlight?: (element: HTMLElement, errorClass: string, validClass: string) => void; - /** - * This class is added to an element after it was validated and considered valid. - * - * default: "valid" - */ - validClass?: string; - /** - * Wrap error labels with the specified element. Useful in combination with errorLabelContainer to create a list of error messages. - * - * default: window - */ - wrapper?: string; - } - - interface ErrorDictionary - { - [name: string]: string; - } - - interface ErrorListItem - { - message: string; - element: HTMLElement; - } - - interface ValidatorStatic - { - /** - * Add a compound class method - useful to refactor common combinations of rules into a single class. - * - * @param name The name of the class rule to add - * @param rules The compound rules - */ - addClassRules(name: string, rules: RulesDictionary): void; - /** - * Add a compound class method - useful to refactor common combinations of rules into a single class. - * - * @param rules A map of className-rules pairs - */ - addClassRules(rules: RulesDictionary): void; - /** - * Add a custom validation method. It must consist of a name (must be a legal javascript identifier), a javascript based function and a default string message. - * - * @param name The name of the method used to identify it and referencing it; this must be a valid JavaScript identifier - * @param method The actual method implementation, returning true if an element is valid. First argument: Current value. Second argument: Validated element. Third argument: Parameters. - */ - addMethod(name: string, method: (value: any, element: HTMLElement, params: any) => boolean, message?: string): void; - /** - * Add a custom validation method. It must consist of a name (must be a legal javascript identifier), a predicate function and a message generating function. - * - * @param name The name of the method used to identify it and referencing it; this must be a valid JavaScript identifier - * @param method The actual method implementation, returning true if an element is valid. First argument: Current value. Second argument: Validated element. Third argument: Parameters. - * @param message Message generator. First argument: Parameters. Second argument: Validated element. - */ - addMethod(name: string, method: (value: any, element: HTMLElement, params: any) => boolean, message?: (params: any, element: HTMLElement) => string): void; - /** - * Replaces {n} placeholders with arguments. - * - * @param template The string to format. - */ - format(template: string): ( (...args: any[]) => string); - format(template: string, ...args: any[]): string; - /** - * Modify default settings for validation. - * - * @param options Options to set as default. - */ - setDefaults(defaults: ValidationOptions): void; - - messages: { [index: string]: string }; - methods: { [index: string]: Function }; - } - - interface Validator - { - element(element: string|JQuery): boolean; - checkForm(): boolean; - /** - * Validates the form, returns true if it is valid, false otherwise. - */ - form(): boolean; - - elementValue(element: Element): any; - - invalidElements(): HTMLElement[]; - - /** - * Returns the number of invalid fields. - */ - numberOfInvalids(): number; - /** - * Resets the controlled form. - */ - resetForm(): void; - - settings: ValidationOptions; - /** - * Show the specified messages. - * - * @param errors One or more key/value pairs of input names and messages. - */ - showErrors(errors: any): void; - - hideErrors(): void; - - valid(): boolean; - validElements(): HTMLElement[]; - size(): number; - focusInvalid(): void; - errorMap: ErrorDictionary; - errorList: ErrorListItem[]; - } -} - -interface JQuery -{ - /** - * Remove the specified attributes from the first matched element and return them. - * - * @param attributes A space-separated list of attribute names to remove. - */ - removeAttrs(attributes: string): any; - - /** - * Returns the validations rules for the first selected element - */ - rules(): any; - - /** - * Removes the specified rules and returns all rules for the first matched element. - * - * @param command "remove" - * @param rules Removes and returns all rules. Manipulates only rules specified via rules-option or via rules("add"). - */ - rules(command: string): any; - /** - * Removes the specified rules and returns all rules for the first matched element. - * - * @param command "remove" - * @param rules The space-separated names of rules to remove and return. Manipulates only rules specified via rules-option or via rules("add"). - */ - rules(command: string, rules: string): any; - /** - * Adds the specified rules and returns all rules for the first matched element. Requires that the parent form is validated, that is, $("form").validate() is called first - * - * @param command "add" - * @param rules The rules to add. Accepts the same format as the rules-option of the validate-method. - */ - rules(command: string, rules: JQueryValidation.RulesDictionary): any; - - /** - * Checks whether the selected form is valid or whether all selected elements are valid. - */ - valid(): boolean; - - /** - * Validates the selected form. - * - * @param options options for validation - */ - validate(options?: JQueryValidation.ValidationOptions): JQueryValidation.Validator; -} - -interface JQueryStatic -{ - /** - * Replaces {n} placeholders with arguments. - * - * @param template The string to format. - */ - format(template: string, ...arguments: string[]): string; - - validator: JQueryValidation.ValidatorStatic; -} diff --git a/jquery.validation/jquery.validation-tests.ts b/jquery.validation/jquery.validation-tests.ts deleted file mode 100644 index 0b2de520f2..0000000000 --- a/jquery.validation/jquery.validation-tests.ts +++ /dev/null @@ -1,267 +0,0 @@ -/// -/// - - -function test_validate() { - $("#commentForm").validate(); - $(".selector").validate({ - debug: true - }); - $(".selector").validate({ - submitHandler: function (form) { - $(form).ajaxSubmit(); - } - }); - $(".selector").validate({ - invalidHandler: function (form, validator) { - var errors = validator.numberOfInvalids(); - if (errors) { - var message = errors == 1 - ? 'You missed 1 field. It has been highlighted' - : 'You missed ' + errors + ' fields. They have been highlighted'; - $("div.error span").html(message); - $("div.error").show(); - } else { - $("div.error").hide(); - } - } - }); - $("#myform").validate({ - ignore: ".ignore" - }); - $(".selector").validate({ - rules: { - name: "required", - email: { - required: true, - email: true - } - } - }); - $(".selector").validate({ - rules: { - name: { - required: true, - minlength: 2 - } - }, - messages: { - name: { - required: "We need your email address to contact you", - minlength: jQuery.format("At least {0} characters required!") - } - } - }); - $("#myform").validate({ - groups: { - username: "fname lname" - }, - errorPlacement: function (error, element) { - if (element.attr("name") == "fname" - || element.attr("name") == "lname") - error.insertAfter("#lastname"); - else - error.insertAfter(element); - }, - debug: true - }); - $(".selector").validate({ - onsubmit: false - }); - $(".selector").validate({ - onfocusout: false - }); - $(".selector").validate({ - onkeyup: false - }); - $(".selector").validate({ - onclick: false - }); - $(".selector").validate({ - onfocusout: (elt) => { }, - onkeyup: (elt) => { }, - onclick: (elt) => { } - }); - $(".selector").validate({ - onfocusout: (elt, event) => { }, - onkeyup: (elt, event) => { }, - onclick: (elt, event) => { } - }); - - $(".selector").validate({ - focusInvalid: false - }); - $(".selector").validate({ - focusCleanup: true - }); - $("#myform").validate({ - meta: "validate", - submitHandler: function () { alert("Submitted!") } - }); - $(".selector").validate({ - errorClass: "invalid" - }); - $(".selector").validate({ - validClass: "success" - }); - $(".selector").validate({ - errorElement: "em" - }); - $(".selector").validate({ - wrapper: "li" - }); - $("#myform").validate({ - errorLabelContainer: "#messageBox", - wrapper: "li", - submitHandler: function () { alert("Submitted!") } - }); - $("#myform").validate({ - errorContainer: "#messageBox1, #messageBox2", - errorLabelContainer: "#messageBox1 ul", - wrapper: "li", debug: true, - submitHandler: function () { alert("Submitted!") } - }); - $(".selector").validate({ - showErrors: function (errorMap: JQueryValidation.ErrorDictionary, errorList: JQueryValidation.ErrorListItem[]) { - $("#summary").html("Your form contains " + this.numberOfInvalids() + " errors, see details below."); - this.defaultShowErrors(); - } - }); - $("#myform").validate({ - errorPlacement: function (error, element) { - error.appendTo(element.parent("td").next("td")); - }, - debug: true - }); - $("#myform").validate({ - success: "valid", - submitHandler: function () { alert("Submitted!") } - }); - $("#myform").validate({ - success: function (label) { - label.addClass("valid").text("Ok!") - }, - submitHandler: function () { alert("Submitted!") } - }); - $(".selector").validate({ - highlight: function (element, errorClass) { - $(element).fadeOut(function () { - $(element).fadeIn(); - }); - } - }); - $(".selector").validate({ - highlight: function (element: HTMLInputElement, errorClass, validClass) { - $(element).addClass(errorClass).removeClass(validClass); - $((element).form).find("label[for=" + element.id + "]") - .addClass(errorClass); - }, - unhighlight: function (element: HTMLInputElement, errorClass, validClass) { - $(element).removeClass(errorClass).addClass(validClass); - $((element).form).find("label[for=" + element.id + "]") - .removeClass(errorClass); - } - }); - $(".selector").validate({ - ignoreTitle: true - }); - // onSubmit, onfocusout, onkeyup, onclick - $('.selector').validate({ - onsubmit: false, - onfocusout: false, - onkeyup: false, - onclick: false, - }); - $('.selector').validate({ - onfocusout: () => {}, - onkeyup: () => {}, - onclick: function(elt) { return 2; } - }); -} - -function test_methods() { - $("#myform").validate(); - $("a.check").click(function () { - alert("Valid: " + $("#myform").valid()); - return false; - }); - $("#myinput").rules("add", { - required: true, - minlength: 2, - messages: { - required: "Required input", - minlength: jQuery.format("Please, at least {0} characters are necessary") - } - }); - $("#myinput").rules("remove"); - $("#myinput").rules("remove", "min max"); - $("#myinput").rules("add", { - required: true, - minlength: 2, - messages: { - required: "Required input", - minlength: jQuery.format("Please, at least {0} characters are necessary") - } - }); - $("#skip").click(function () { - var rules = $("#myinput").removeAttrs("min max"); - $("#myform").submit(); - $("#myinput").attr(rules); - }); - $("#myform").validate().checkForm(); - $("#myform").validate().form(); - $("#myform").validate().element("#myselect"); - $("#myform").validate().element($("#myselect")); - var validator = $("#myform").validate(); - validator.resetForm(); - validator.showErrors({ "firstname": "I know that your firstname is Pete, Pete!" }); - validator.hideErrors(); - var isValid: boolean = validator.valid(); - var size: number = validator.size(); - var errorMap: JQueryValidation.ErrorDictionary = validator.errorMap; - var errorList: JQueryValidation.ErrorListItem[] = validator.errorList; - - $("#summary").text(validator.numberOfInvalids() + " field(s) are invalid"); - var invalidElements: HTMLElement[] = validator.invalidElements(); - var validElements: HTMLElement[] = validator.validElements(); -} - -function test_static_methods() { - jQuery.validator.setDefaults({ - debug: true - }); - jQuery.validator.addMethod("domain", function (value, element) { - return this.optional(element) || /^http:\/\/mycorporatedomain.com/.test(value); - }, "Please specify the correct domain for your documents"); - jQuery.validator.addClassRules({ - name: { - required: true, - minlength: 2 - }, - zip: { - required: true, - digits: true, - minlength: 5, - maxlength: 5 - } - }); - jQuery.validator.addClassRules({ - name: { - required: true, - minlength: 2 - }, - zip: { - required: true, - digits: true, - minlength: 5, - maxlength: 5 - } - }); - - // jQuery.validator.format - jQuery.validator.format('{0}'); - jQuery.validator.format('{0} {1}')('a', 2); - jQuery.validator.format('{0} {1}', 'a', 2); - jQuery.validator.format('{0} {1}', ['a', 2]); -} - \ No newline at end of file diff --git a/jquery/index.d.ts b/jquery/index.d.ts deleted file mode 100644 index 3a785530aa..0000000000 --- a/jquery/index.d.ts +++ /dev/null @@ -1,3779 +0,0 @@ -// Type definitions for jQuery 1.10.x / 2.0.x -// Project: http://jquery.com/ -// Definitions by: Boris Yankov , Christian Hoffmeister , Steve Fenton , Diullei Gomes , Tass Iliopoulos , Jason Swearingen , Sean Hill , Guus Goossens , Kelly Summerlin , Basarat Ali Syed , Nicholas Wolverson , Derek Cicerone , Andrew Gaspar , James Harrison Fisher , Seikichi Kondo , Benjamin Jackman , Poul Sorensen , Josh Strobl , John Reilly , Dick van den Brink , Thomas Schulz -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/* ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - - -/** - * Interface for the AJAX setting that will configure the AJAX request - * @see {@link https://api.jquery.com/jQuery.ajax/#jQuery-ajax-settings} - */ -interface JQueryAjaxSettings { - /** - * The content type sent in the request header that tells the server what kind of response it will accept in return. If the accepts setting needs modification, it is recommended to do so once in the $.ajaxSetup() method. - */ - accepts?: any; - /** - * By default, all requests are sent asynchronously (i.e. this is set to true by default). If you need synchronous requests, set this option to false. Cross-domain requests and dataType: "jsonp" requests do not support synchronous operation. Note that synchronous requests may temporarily lock the browser, disabling any actions while the request is active. As of jQuery 1.8, the use of async: false with jqXHR ($.Deferred) is deprecated; you must use the success/error/complete callback options instead of the corresponding methods of the jqXHR object such as jqXHR.done() or the deprecated jqXHR.success(). - */ - async?: boolean; - /** - * A pre-request callback function that can be used to modify the jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object before it is sent. Use this to set custom headers, etc. The jqXHR and settings objects are passed as arguments. This is an Ajax Event. Returning false in the beforeSend function will cancel the request. As of jQuery 1.5, the beforeSend option will be called regardless of the type of request. - */ - beforeSend? (jqXHR: JQueryXHR, settings: JQueryAjaxSettings): any; - /** - * If set to false, it will force requested pages not to be cached by the browser. Note: Setting cache to false will only work correctly with HEAD and GET requests. It works by appending "_={timestamp}" to the GET parameters. The parameter is not needed for other types of requests, except in IE8 when a POST is made to a URL that has already been requested by a GET. - */ - cache?: boolean; - /** - * A function to be called when the request finishes (after success and error callbacks are executed). The function gets passed two arguments: The jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object and a string categorizing the status of the request ("success", "notmodified", "error", "timeout", "abort", or "parsererror"). As of jQuery 1.5, the complete setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event. - */ - complete? (jqXHR: JQueryXHR, textStatus: string): any; - /** - * An object of string/regular-expression pairs that determine how jQuery will parse the response, given its content type. (version added: 1.5) - */ - contents?: { [key: string]: any; }; - //According to jQuery.ajax source code, ajax's option actually allows contentType to set to "false" - // https://github.com/DefinitelyTyped/DefinitelyTyped/issues/742 - /** - * When sending data to the server, use this content type. Default is "application/x-www-form-urlencoded; charset=UTF-8", which is fine for most cases. If you explicitly pass in a content-type to $.ajax(), then it is always sent to the server (even if no data is sent). The W3C XMLHttpRequest specification dictates that the charset is always UTF-8; specifying another charset will not force the browser to change the encoding. - */ - contentType?: any; - /** - * This object will be made the context of all Ajax-related callbacks. By default, the context is an object that represents the ajax settings used in the call ($.ajaxSettings merged with the settings passed to $.ajax). - */ - context?: any; - /** - * An object containing dataType-to-dataType converters. Each converter's value is a function that returns the transformed value of the response. (version added: 1.5) - */ - converters?: { [key: string]: any; }; - /** - * If you wish to force a crossDomain request (such as JSONP) on the same domain, set the value of crossDomain to true. This allows, for example, server-side redirection to another domain. (version added: 1.5) - */ - crossDomain?: boolean; - /** - * Data to be sent to the server. It is converted to a query string, if not already a string. It's appended to the url for GET-requests. See processData option to prevent this automatic processing. Object must be key-value pairs. If value is an Array, jQuery serializes multiple values with same key based on the value of the traditional setting (described below). - */ - data?: any; - /** - * A function to be used to handle the raw response data of XMLHttpRequest.This is a pre-filtering function to sanitize the response. You should return the sanitized data. The function accepts two arguments: The raw data returned from the server and the 'dataType' parameter. - */ - dataFilter? (data: any, ty: any): any; - /** - * The type of data that you're expecting back from the server. If none is specified, jQuery will try to infer it based on the MIME type of the response (an XML MIME type will yield XML, in 1.4 JSON will yield a JavaScript object, in 1.4 script will execute the script, and anything else will be returned as a string). - */ - dataType?: string; - /** - * A function to be called if the request fails. The function receives three arguments: The jqXHR (in jQuery 1.4.x, XMLHttpRequest) object, a string describing the type of error that occurred and an optional exception object, if one occurred. Possible values for the second argument (besides null) are "timeout", "error", "abort", and "parsererror". When an HTTP error occurs, errorThrown receives the textual portion of the HTTP status, such as "Not Found" or "Internal Server Error." As of jQuery 1.5, the error setting can accept an array of functions. Each function will be called in turn. Note: This handler is not called for cross-domain script and cross-domain JSONP requests. This is an Ajax Event. - */ - error? (jqXHR: JQueryXHR, textStatus: string, errorThrown: string): any; - /** - * Whether to trigger global Ajax event handlers for this request. The default is true. Set to false to prevent the global handlers like ajaxStart or ajaxStop from being triggered. This can be used to control various Ajax Events. - */ - global?: boolean; - /** - * An object of additional header key/value pairs to send along with requests using the XMLHttpRequest transport. The header X-Requested-With: XMLHttpRequest is always added, but its default XMLHttpRequest value can be changed here. Values in the headers setting can also be overwritten from within the beforeSend function. (version added: 1.5) - */ - headers?: { [key: string]: any; }; - /** - * Allow the request to be successful only if the response has changed since the last request. This is done by checking the Last-Modified header. Default value is false, ignoring the header. In jQuery 1.4 this technique also checks the 'etag' specified by the server to catch unmodified data. - */ - ifModified?: boolean; - /** - * Allow the current environment to be recognized as "local," (e.g. the filesystem), even if jQuery does not recognize it as such by default. The following protocols are currently recognized as local: file, *-extension, and widget. If the isLocal setting needs modification, it is recommended to do so once in the $.ajaxSetup() method. (version added: 1.5.1) - */ - isLocal?: boolean; - /** - * Override the callback function name in a jsonp request. This value will be used instead of 'callback' in the 'callback=?' part of the query string in the url. So {jsonp:'onJSONPLoad'} would result in 'onJSONPLoad=?' passed to the server. As of jQuery 1.5, setting the jsonp option to false prevents jQuery from adding the "?callback" string to the URL or attempting to use "=?" for transformation. In this case, you should also explicitly set the jsonpCallback setting. For example, { jsonp: false, jsonpCallback: "callbackName" } - */ - jsonp?: any; - /** - * Specify the callback function name for a JSONP request. This value will be used instead of the random name automatically generated by jQuery. It is preferable to let jQuery generate a unique name as it'll make it easier to manage the requests and provide callbacks and error handling. You may want to specify the callback when you want to enable better browser caching of GET requests. As of jQuery 1.5, you can also use a function for this setting, in which case the value of jsonpCallback is set to the return value of that function. - */ - jsonpCallback?: any; - /** - * The HTTP method to use for the request (e.g. "POST", "GET", "PUT"). (version added: 1.9.0) - */ - method?: string; - /** - * A MIME type to override the XHR MIME type. (version added: 1.5.1) - */ - mimeType?: string; - /** - * A password to be used with XMLHttpRequest in response to an HTTP access authentication request. - */ - password?: string; - /** - * By default, data passed in to the data option as an object (technically, anything other than a string) will be processed and transformed into a query string, fitting to the default content-type "application/x-www-form-urlencoded". If you want to send a DOMDocument, or other non-processed data, set this option to false. - */ - processData?: boolean; - /** - * Only applies when the "script" transport is used (e.g., cross-domain requests with "jsonp" or "script" dataType and "GET" type). Sets the charset attribute on the script tag used in the request. Used when the character set on the local page is not the same as the one on the remote script. - */ - scriptCharset?: string; - /** - * An object of numeric HTTP codes and functions to be called when the response has the corresponding code. f the request is successful, the status code functions take the same parameters as the success callback; if it results in an error (including 3xx redirect), they take the same parameters as the error callback. (version added: 1.5) - */ - statusCode?: { [key: string]: any; }; - /** - * A function to be called if the request succeeds. The function gets passed three arguments: The data returned from the server, formatted according to the dataType parameter; a string describing the status; and the jqXHR (in jQuery 1.4.x, XMLHttpRequest) object. As of jQuery 1.5, the success setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event. - */ - success? (data: any, textStatus: string, jqXHR: JQueryXHR): any; - /** - * Set a timeout (in milliseconds) for the request. This will override any global timeout set with $.ajaxSetup(). The timeout period starts at the point the $.ajax call is made; if several other requests are in progress and the browser has no connections available, it is possible for a request to time out before it can be sent. In jQuery 1.4.x and below, the XMLHttpRequest object will be in an invalid state if the request times out; accessing any object members may throw an exception. In Firefox 3.0+ only, script and JSONP requests cannot be cancelled by a timeout; the script will run even if it arrives after the timeout period. - */ - timeout?: number; - /** - * Set this to true if you wish to use the traditional style of parameter serialization. - */ - traditional?: boolean; - /** - * The type of request to make ("POST" or "GET"), default is "GET". Note: Other HTTP request methods, such as PUT and DELETE, can also be used here, but they are not supported by all browsers. - */ - type?: string; - /** - * A string containing the URL to which the request is sent. - */ - url?: string; - /** - * A username to be used with XMLHttpRequest in response to an HTTP access authentication request. - */ - username?: string; - /** - * Callback for creating the XMLHttpRequest object. Defaults to the ActiveXObject when available (IE), the XMLHttpRequest otherwise. Override to provide your own implementation for XMLHttpRequest or enhancements to the factory. - */ - xhr?: any; - /** - * An object of fieldName-fieldValue pairs to set on the native XHR object. For example, you can use it to set withCredentials to true for cross-domain requests if needed. In jQuery 1.5, the withCredentials property was not propagated to the native XHR and thus CORS requests requiring it would ignore this flag. For this reason, we recommend using jQuery 1.5.1+ should you require the use of it. (version added: 1.5.1) - */ - xhrFields?: { [key: string]: any; }; -} - -/** - * Interface for the jqXHR object - * @see {@link https://api.jquery.com/jQuery.ajax/#jqXHR} - */ -interface JQueryXHR extends XMLHttpRequest, JQueryPromise { - /** - * The .overrideMimeType() method may be used in the beforeSend() callback function, for example, to modify the response content-type header. As of jQuery 1.5.1, the jqXHR object also contains the overrideMimeType() method (it was available in jQuery 1.4.x, as well, but was temporarily removed in jQuery 1.5). - */ - overrideMimeType(mimeType: string): any; - /** - * Cancel the request. - * - * @param statusText A string passed as the textStatus parameter for the done callback. Default value: "canceled" - */ - abort(statusText?: string): void; - /** - * Incorporates the functionality of the .done() and .fail() methods, allowing (as of jQuery 1.8) the underlying Promise to be manipulated. Refer to deferred.then() for implementation details. - */ - then(doneCallback: (data: any, textStatus: string, jqXHR: JQueryXHR) => R|JQueryPromise, failCallback?: (jqXHR: JQueryXHR, textStatus: string, errorThrown: any) => void): JQueryPromise; - /** - * Property containing the parsed response if the response content type is json - */ - responseJSON?: any; - /** - * A function to be called if the request fails. - */ - error(xhr: JQueryXHR, textStatus: string, errorThrown: string): void; -} - -/** - * Interface for the JQuery callback - * @see {@link https://api.jquery.com/category/callbacks-object/} - */ -interface JQueryCallback { - /** - * Add a callback or a collection of callbacks to a callback list. - * - * @param callbacks A function, or array of functions, that are to be added to the callback list. - * @see {@link https://api.jquery.com/callbacks.add/} - */ - add(callbacks: Function): JQueryCallback; - /** - * Add a callback or a collection of callbacks to a callback list. - * - * @param callbacks A function, or array of functions, that are to be added to the callback list. - * @see {@link https://api.jquery.com/callbacks.add/} - */ - add(callbacks: Function[]): JQueryCallback; - - /** - * Disable a callback list from doing anything more. - * @see {@link https://api.jquery.com/callbacks.disable/} - */ - disable(): JQueryCallback; - - /** - * Determine if the callbacks list has been disabled. - * @see {@link https://api.jquery.com/callbacks.disabled/} - */ - disabled(): boolean; - - /** - * Remove all of the callbacks from a list. - * @see {@link https://api.jquery.com/callbacks.empty/} - */ - empty(): JQueryCallback; - - /** - * Call all of the callbacks with the given arguments - * - * @param arguments The argument or list of arguments to pass back to the callback list. - * @see {@link https://api.jquery.com/callbacks.fire/} - */ - fire(...arguments: any[]): JQueryCallback; - - /** - * Determine if the callbacks have already been called at least once. - * @see {@link https://api.jquery.com/callbacks.fired/} - */ - fired(): boolean; - - /** - * Call all callbacks in a list with the given context and arguments. - * - * @param context A reference to the context in which the callbacks in the list should be fired. - * @param arguments An argument, or array of arguments, to pass to the callbacks in the list. - * @see {@link https://api.jquery.com/callbacks.fireWith/} - */ - fireWith(context?: any, args?: any[]): JQueryCallback; - - /** - * Determine whether a supplied callback is in a list - * - * @param callback The callback to search for. - * @see {@link https://api.jquery.com/callbacks.has/} - */ - has(callback: Function): boolean; - - /** - * Lock a callback list in its current state. - * @see {@link https://api.jquery.com/callbacks.lock/} - */ - lock(): JQueryCallback; - - /** - * Determine if the callbacks list has been locked. - * @see {@link https://api.jquery.com/callbacks.locked/} - */ - locked(): boolean; - - /** - * Remove a callback or a collection of callbacks from a callback list. - * - * @param callbacks A function, or array of functions, that are to be removed from the callback list. - * @see {@link https://api.jquery.com/callbacks.remove/} - */ - remove(callbacks: Function): JQueryCallback; - /** - * Remove a callback or a collection of callbacks from a callback list. - * - * @param callbacks A function, or array of functions, that are to be removed from the callback list. - * @see {@link https://api.jquery.com/callbacks.remove/} - */ - remove(callbacks: Function[]): JQueryCallback; -} - -/** - * Allows jQuery Promises to interop with non-jQuery promises - */ -interface JQueryGenericPromise { - /** - * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. - * - * @param doneFilter A function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @see {@link https://api.jquery.com/deferred.then/#deferred-then-doneFilter-failFilter-progressFilter} - */ - then(doneFilter: (value?: T, ...values: any[]) => U|JQueryPromise, failFilter?: (...reasons: any[]) => any, progressFilter?: (...progression: any[]) => any): JQueryPromise; - - /** - * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. - * - * @param doneFilter A function that is called when the Deferred is resolved. - * @param failFilter An optional function that is called when the Deferred is rejected. - * @see {@link https://api.jquery.com/deferred.then/#deferred-then-doneFilter-failFilter-progressFilter} - */ - then(doneFilter: (value?: T, ...values: any[]) => void, failFilter?: (...reasons: any[]) => any, progressFilter?: (...progression: any[]) => any): JQueryPromise; -} - -/** - * Interface for the JQuery promise/deferred callbacks - */ -interface JQueryPromiseCallback { - (value?: T, ...args: any[]): void; -} - -interface JQueryPromiseOperator { - (callback1: JQueryPromiseCallback|JQueryPromiseCallback[], ...callbacksN: Array|JQueryPromiseCallback[]>): JQueryPromise; -} - -/** - * Interface for the JQuery promise, part of callbacks - * @see {@link https://api.jquery.com/category/deferred-object/} - */ -interface JQueryPromise extends JQueryGenericPromise { - /** - * Determine the current state of a Deferred object. - * @see {@link https://api.jquery.com/deferred.state/} - */ - state(): string; - /** - * Add handlers to be called when the Deferred object is either resolved or rejected. - * - * @param alwaysCallback1 A function, or array of functions, that is called when the Deferred is resolved or rejected. - * @param alwaysCallbackN Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected. - * @see {@link https://api.jquery.com/deferred.always/} - */ - always(alwaysCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...alwaysCallbackN: Array|JQueryPromiseCallback[]>): JQueryPromise; - /** - * Add handlers to be called when the Deferred object is resolved. - * - * @param doneCallback1 A function, or array of functions, that are called when the Deferred is resolved. - * @param doneCallbackN Optional additional functions, or arrays of functions, that are called when the Deferred is resolved. - * @see {@link https://api.jquery.com/deferred.done/} - */ - done(doneCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...doneCallbackN: Array|JQueryPromiseCallback[]>): JQueryPromise; - /** - * Add handlers to be called when the Deferred object is rejected. - * - * @param failCallback1 A function, or array of functions, that are called when the Deferred is rejected. - * @param failCallbackN Optional additional functions, or arrays of functions, that are called when the Deferred is rejected. - * @see {@link https://api.jquery.com/deferred.fail/} - */ - fail(failCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...failCallbackN: Array|JQueryPromiseCallback[]>): JQueryPromise; - /** - * Add handlers to be called when the Deferred object generates progress notifications. - * - * @param progressCallback1 A function, or array of functions, to be called when the Deferred generates progress notifications. - * @param progressCallbackN Optional additional functions, or arrays of functions, to be called when the Deferred generates progress notifications. - * @see {@link https://api.jquery.com/deferred.progress/} - */ - progress(progressCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...progressCallbackN: Array|JQueryPromiseCallback[]>): JQueryPromise; - - // Deprecated - given no typings - pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise; - - /** - * Return a Deferred's Promise object. - * - * @param target Object onto which the promise methods have to be attached - * @see {@link https://api.jquery.com/deferred.promise/} - */ - promise(target?: any): JQueryPromise; -} - -/** - * Interface for the JQuery deferred, part of callbacks - * @see {@link https://api.jquery.com/category/deferred-object/} - */ -interface JQueryDeferred extends JQueryGenericPromise { - /** - * Determine the current state of a Deferred object. - * @see {@link https://api.jquery.com/deferred.state/} - */ - state(): string; - /** - * Add handlers to be called when the Deferred object is either resolved or rejected. - * - * @param alwaysCallback1 A function, or array of functions, that is called when the Deferred is resolved or rejected. - * @param alwaysCallbackN Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected. - * @see {@link https://api.jquery.com/deferred.always/} - */ - always(alwaysCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...alwaysCallbackN: Array|JQueryPromiseCallback[]>): JQueryDeferred; - /** - * Add handlers to be called when the Deferred object is resolved. - * - * @param doneCallback1 A function, or array of functions, that are called when the Deferred is resolved. - * @param doneCallbackN Optional additional functions, or arrays of functions, that are called when the Deferred is resolved. - * @see {@link https://api.jquery.com/deferred.done/} - */ - done(doneCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...doneCallbackN: Array|JQueryPromiseCallback[]>): JQueryDeferred; - /** - * Add handlers to be called when the Deferred object is rejected. - * - * @param failCallback1 A function, or array of functions, that are called when the Deferred is rejected. - * @param failCallbackN Optional additional functions, or arrays of functions, that are called when the Deferred is rejected. - * @see {@link https://api.jquery.com/deferred.fail/} - */ - fail(failCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...failCallbackN: Array|JQueryPromiseCallback[]>): JQueryDeferred; - /** - * Add handlers to be called when the Deferred object generates progress notifications. - * - * @param progressCallback1 A function, or array of functions, to be called when the Deferred generates progress notifications. - * @param progressCallbackN Optional additional functions, or arrays of functions, to be called when the Deferred generates progress notifications. - * @see {@link https://api.jquery.com/deferred.progress/} - */ - progress(progressCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...progressCallbackN: Array|JQueryPromiseCallback[]>): JQueryDeferred; - - /** - * Call the progressCallbacks on a Deferred object with the given args. - * - * @param args Optional arguments that are passed to the progressCallbacks. - * @see {@link https://api.jquery.com/deferred.notify/} - */ - notify(value?: any, ...args: any[]): JQueryDeferred; - - /** - * Call the progressCallbacks on a Deferred object with the given context and args. - * - * @param context Context passed to the progressCallbacks as the this object. - * @param args Optional arguments that are passed to the progressCallbacks. - * @see {@link https://api.jquery.com/deferred.notifyWith/} - */ - notifyWith(context: any, args?: any[]): JQueryDeferred; - - /** - * Reject a Deferred object and call any failCallbacks with the given args. - * - * @param args Optional arguments that are passed to the failCallbacks. - * @see {@link https://api.jquery.com/deferred.reject/} - */ - reject(value?: any, ...args: any[]): JQueryDeferred; - /** - * Reject a Deferred object and call any failCallbacks with the given context and args. - * - * @param context Context passed to the failCallbacks as the this object. - * @param args An optional array of arguments that are passed to the failCallbacks. - * @see {@link https://api.jquery.com/deferred.rejectWith/} - */ - rejectWith(context: any, args?: any[]): JQueryDeferred; - - /** - * Resolve a Deferred object and call any doneCallbacks with the given args. - * - * @param value First argument passed to doneCallbacks. - * @param args Optional subsequent arguments that are passed to the doneCallbacks. - * @see {@link https://api.jquery.com/deferred.resolve/} - */ - resolve(value?: T, ...args: any[]): JQueryDeferred; - - /** - * Resolve a Deferred object and call any doneCallbacks with the given context and args. - * - * @param context Context passed to the doneCallbacks as the this object. - * @param args An optional array of arguments that are passed to the doneCallbacks. - * @see {@link https://api.jquery.com/deferred.resolveWith/} - */ - resolveWith(context: any, args?: T[]): JQueryDeferred; - - /** - * Return a Deferred's Promise object. - * - * @param target Object onto which the promise methods have to be attached - * @see {@link https://api.jquery.com/deferred.promise/} - */ - promise(target?: any): JQueryPromise; - - // Deprecated - given no typings - pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise; -} - -/** - * Interface of the JQuery extension of the W3C event object - * @see {@link https://api.jquery.com/category/events/event-object/} - */ -interface BaseJQueryEventObject extends Event { - /** - * The current DOM element within the event bubbling phase. - * @see {@link https://api.jquery.com/event.currentTarget/} - */ - currentTarget: Element; - /** - * An optional object of data passed to an event method when the current executing handler is bound. - * @see {@link https://api.jquery.com/event.data/} - */ - data: any; - /** - * The element where the currently-called jQuery event handler was attached. - * @see {@link https://api.jquery.com/event.delegateTarget/} - */ - delegateTarget: Element; - /** - * Returns whether event.preventDefault() was ever called on this event object. - * @see {@link https://api.jquery.com/event.isDefaultPrevented/} - */ - isDefaultPrevented(): boolean; - /** - * Returns whether event.stopImmediatePropagation() was ever called on this event object. - * @see {@link https://api.jquery.com/event.isImmediatePropagationStopped/} - */ - isImmediatePropagationStopped(): boolean; - /** - * Returns whether event.stopPropagation() was ever called on this event object. - * @see {@link https://api.jquery.com/event.isPropagationStopped/} - */ - isPropagationStopped(): boolean; - /** - * The namespace specified when the event was triggered. - * @see {@link https://api.jquery.com/event.namespace/} - */ - namespace: string; - /** - * The browser's original Event object. - * @see {@link https://api.jquery.com/category/events/event-object/} - */ - originalEvent: Event; - /** - * If this method is called, the default action of the event will not be triggered. - * @see {@link https://api.jquery.com/event.preventDefault/} - */ - preventDefault(): any; - /** - * The other DOM element involved in the event, if any. - * @see {@link https://api.jquery.com/event.relatedTarget/} - */ - relatedTarget: Element; - /** - * The last value returned by an event handler that was triggered by this event, unless the value was undefined. - * @see {@link https://api.jquery.com/event.result/} - */ - result: any; - /** - * Keeps the rest of the handlers from being executed and prevents the event from bubbling up the DOM tree. - * @see {@link https://api.jquery.com/event.stopImmediatePropagation/} - */ - stopImmediatePropagation(): void; - /** - * Prevents the event from bubbling up the DOM tree, preventing any parent handlers from being notified of the event. - * @see {@link https://api.jquery.com/event.stopPropagation/} - */ - stopPropagation(): void; - /** - * The DOM element that initiated the event. - * @see {@link https://api.jquery.com/event.target/} - */ - target: Element; - /** - * The mouse position relative to the left edge of the document. - * @see {@link https://api.jquery.com/event.pageX/} - */ - pageX: number; - /** - * The mouse position relative to the top edge of the document. - * @see {@link https://api.jquery.com/event.pageY/} - */ - pageY: number; - /** - * For key or mouse events, this property indicates the specific key or button that was pressed. - * @see {@link https://api.jquery.com/event.which/} - */ - which: number; - /** - * Indicates whether the META key was pressed when the event fired. - * @see {@link https://api.jquery.com/event.metaKey/} - */ - metaKey: boolean; -} - -interface JQueryInputEventObject extends BaseJQueryEventObject { - altKey: boolean; - ctrlKey: boolean; - metaKey: boolean; - shiftKey: boolean; -} - -interface JQueryMouseEventObject extends JQueryInputEventObject { - button: number; - clientX: number; - clientY: number; - offsetX: number; - offsetY: number; - pageX: number; - pageY: number; - screenX: number; - screenY: number; -} - -interface JQueryKeyEventObject extends JQueryInputEventObject { - char: any; - charCode: number; - key: any; - keyCode: number; -} - -interface JQueryEventObject extends BaseJQueryEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject{ -} - -/** - * A collection of properties that represent the presence of different browser features or bugs. - * - * Intended for jQuery's internal use; specific properties may be removed when they are no longer needed internally - * to improve page startup performance. For your own project's feature-detection needs, we strongly recommend the - * use of an external library such as {@link http://modernizr.com/|Modernizr} instead of dependency on properties - * in jQuery.support. - * - * @deprecated since version 1.9 - */ -interface JQuerySupport { - ajax?: boolean; - boxModel?: boolean; - changeBubbles?: boolean; - checkClone?: boolean; - checkOn?: boolean; - cors?: boolean; - cssFloat?: boolean; - hrefNormalized?: boolean; - htmlSerialize?: boolean; - leadingWhitespace?: boolean; - noCloneChecked?: boolean; - noCloneEvent?: boolean; - opacity?: boolean; - optDisabled?: boolean; - optSelected?: boolean; - scriptEval? (): boolean; - style?: boolean; - submitBubbles?: boolean; - tbody?: boolean; -} - -interface JQueryParam { - /** - * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. - * - * @param obj An array or object to serialize. - */ - (obj: any): string; - - /** - * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. - * - * @param obj An array or object to serialize. - * @param traditional A Boolean indicating whether to perform a traditional "shallow" serialization. - */ - (obj: any, traditional: boolean): string; -} - -/** - * The interface used to construct jQuery events (with $.Event). It is - * defined separately instead of inline in JQueryStatic to allow - * overriding the construction function with specific strings - * returning specific event objects. - */ -interface JQueryEventConstructor { - (name: string, eventProperties?: any): JQueryEventObject; - new (name: string, eventProperties?: any): JQueryEventObject; -} - -/** - * The interface used to specify coordinates. - */ -interface JQueryCoordinates { - left: number; - top: number; -} - -/** - * Elements in the array returned by serializeArray() - */ -interface JQuerySerializeArrayElement { - name: string; - value: string; -} - -/** - * @see {@link https://api.jquery.com/animate/} - */ -interface JQueryAnimationOptions { - /** - * A string or number determining how long the animation will run. - */ - duration?: any; - /** - * A string indicating which easing function to use for the transition. - */ - easing?: string; - /** - * A function to call once the animation is complete. - */ - complete?: Function; - /** - * A function to be called for each animated property of each animated element. This function provides an opportunity to modify the Tween object to change the value of the property before it is set. - */ - step?: (now: number, tween: any) => any; - /** - * A function to be called after each step of the animation, only once per animated element regardless of the number of animated properties. (version added: 1.8) - */ - progress?: (animation: JQueryPromise, progress: number, remainingMs: number) => any; - /** - * A function to call when the animation begins. (version added: 1.8) - */ - start?: (animation: JQueryPromise) => any; - /** - * A function to be called when the animation completes (its Promise object is resolved). (version added: 1.8) - */ - done?: (animation: JQueryPromise, jumpedToEnd: boolean) => any; - /** - * A function to be called when the animation fails to complete (its Promise object is rejected). (version added: 1.8) - */ - fail?: (animation: JQueryPromise, jumpedToEnd: boolean) => any; - /** - * A function to be called when the animation completes or stops without completing (its Promise object is either resolved or rejected). (version added: 1.8) - */ - always?: (animation: JQueryPromise, jumpedToEnd: boolean) => any; - /** - * A Boolean indicating whether to place the animation in the effects queue. If false, the animation will begin immediately. As of jQuery 1.7, the queue option can also accept a string, in which case the animation is added to the queue represented by that string. When a custom queue name is used the animation does not automatically start; you must call .dequeue("queuename") to start it. - */ - queue?: any; - /** - * A map of one or more of the CSS properties defined by the properties argument and their corresponding easing functions. (version added: 1.4) - */ - specialEasing?: Object; -} - -interface JQueryEasingFunction { - ( percent: number ): number; -} - -interface JQueryEasingFunctions { - [ name: string ]: JQueryEasingFunction; - linear: JQueryEasingFunction; - swing: JQueryEasingFunction; -} - -/** - * Static members of jQuery (those on $ and jQuery themselves) - * - * @see {@link https://api.jquery.com/Types/#jQuery} - */ -interface JQueryStatic { - - /** - * Perform an asynchronous HTTP (Ajax) request. - * - * @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup(). - * @see {@link https://api.jquery.com/jQuery.ajax/#jQuery-ajax-settings} - */ - ajax(settings: JQueryAjaxSettings): JQueryXHR; - /** - * Perform an asynchronous HTTP (Ajax) request. - * - * @param url A string containing the URL to which the request is sent. - * @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup(). - * @see {@link https://api.jquery.com/jQuery.ajax/#jQuery-ajax-url-settings} - */ - ajax(url: string, settings?: JQueryAjaxSettings): JQueryXHR; - - /** - * Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax(). - * - * @param dataTypes An optional string containing one or more space-separated dataTypes - * @param handler A handler to set default values for future Ajax requests. - * @see {@link https://api.jquery.com/jQuery.ajaxPrefilter/} - */ - ajaxPrefilter(dataTypes: string, handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void; - /** - * Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax(). - * - * @param handler A handler to set default values for future Ajax requests. - * @see {@link https://api.jquery.com/jQuery.ajaxPrefilter/} - */ - ajaxPrefilter(handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void; - - /** - * Creates an object that handles the actual transmission of Ajax data. - * - * @param dataType A string identifying the data type to use. - * @param handler A handler to return the new transport object to use with the data type provided in the first argument. - * @see {@link https://api.jquery.com/jQuery.ajaxTransport/} - */ - ajaxTransport(dataType: string, handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void; - - ajaxSettings: JQueryAjaxSettings; - - /** - * Set default values for future Ajax requests. Its use is not recommended. - * - * @param options A set of key/value pairs that configure the default Ajax request. All options are optional. - * @see {@link https://api.jquery.com/jQuery.ajaxSetup/} - */ - ajaxSetup(options: JQueryAjaxSettings): void; - - /** - * Load data from the server using a HTTP GET request. - * - * @param url A string containing the URL to which the request is sent. - * @param success A callback function that is executed if the request succeeds. - * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html). - * @see {@link https://api.jquery.com/jQuery.get/#jQuery-get-url-data-success-dataType} - */ - get(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; - /** - * Load data from the server using a HTTP GET request. - * - * @param url A string containing the URL to which the request is sent. - * @param data A plain object or string that is sent to the server with the request. - * @param success A callback function that is executed if the request succeeds. - * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html). - * @see {@link https://api.jquery.com/jQuery.get/#jQuery-get-url-data-success-dataType} - */ - get(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; - /** - * Load data from the server using a HTTP GET request. - * - * @param settings The JQueryAjaxSettings to be used for the request - * @see {@link https://api.jquery.com/jQuery.get/#jQuery-get-settings} - */ - get(settings : JQueryAjaxSettings): JQueryXHR; - /** - * Load JSON-encoded data from the server using a GET HTTP request. - * - * @param url A string containing the URL to which the request is sent. - * @param success A callback function that is executed if the request succeeds. - * @see {@link https://api.jquery.com/jQuery.getJSON/} - */ - getJSON(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR; - /** - * Load JSON-encoded data from the server using a GET HTTP request. - * - * @param url A string containing the URL to which the request is sent. - * @param data A plain object or string that is sent to the server with the request. - * @param success A callback function that is executed if the request succeeds. - * @see {@link https://api.jquery.com/jQuery.getJSON/} - */ - getJSON(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR; - /** - * Load a JavaScript file from the server using a GET HTTP request, then execute it. - * - * @param url A string containing the URL to which the request is sent. - * @param success A callback function that is executed if the request succeeds. - * @see {@link https://api.jquery.com/jQuery.getScript/} - */ - getScript(url: string, success?: (script: string, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR; - - /** - * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. - * - * @see {@link https://api.jquery.com/jQuery.param/} - */ - param: JQueryParam; - - /** - * Load data from the server using a HTTP POST request. - * - * @param url A string containing the URL to which the request is sent. - * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case. - * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). - * @see {@link https://api.jquery.com/jQuery.post/#jQuery-post-url-data-success-dataType} - */ - post(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; - /** - * Load data from the server using a HTTP POST request. - * - * @param url A string containing the URL to which the request is sent. - * @param data A plain object or string that is sent to the server with the request. - * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case. - * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). - * @see {@link https://api.jquery.com/jQuery.post/#jQuery-post-url-data-success-dataType} - */ - post(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; - /** - * Load data from the server using a HTTP POST request. - * - * @param settings The JQueryAjaxSettings to be used for the request - * @see {@link https://api.jquery.com/jQuery.post/#jQuery-post-settings} - */ - post(settings : JQueryAjaxSettings): JQueryXHR; - /** - * A multi-purpose callbacks list object that provides a powerful way to manage callback lists. - * - * @param flags An optional list of space-separated flags that change how the callback list behaves. - * @see {@link https://api.jquery.com/jQuery.Callbacks/} - */ - Callbacks(flags?: string): JQueryCallback; - - /** - * Holds or releases the execution of jQuery's ready event. - * - * @param hold Indicates whether the ready hold is being requested or released - * @see {@link https://api.jquery.com/jQuery.holdReady/} - */ - holdReady(hold: boolean): void; - - /** - * Accepts a string containing a CSS selector which is then used to match a set of elements. - * - * @param selector A string containing a selector expression - * @param context A DOM Element, Document, or jQuery to use as context - * @see {@link https://api.jquery.com/jQuery/#jQuery-selector-context} - */ - (selector: string, context?: Element|JQuery): JQuery; - - /** - * Accepts a string containing a CSS selector which is then used to match a set of elements. - * - * @param element A DOM element to wrap in a jQuery object. - * @see {@link https://api.jquery.com/jQuery/#jQuery-element} - */ - (element: Element): JQuery; - - /** - * Accepts a string containing a CSS selector which is then used to match a set of elements. - * - * @param elementArray An array containing a set of DOM elements to wrap in a jQuery object. - * @see {@link https://api.jquery.com/jQuery/#jQuery-elementArray} - */ - (elementArray: Element[]): JQuery; - - /** - * Binds a function to be executed when the DOM has finished loading. - * - * @param callback A function to execute after the DOM is ready. - * @see {@link https://api.jquery.com/jQuery/#jQuery-callback} - */ - (callback: (jQueryAlias?: JQueryStatic) => any): JQuery; - - /** - * Accepts a string containing a CSS selector which is then used to match a set of elements. - * - * @param object A plain object to wrap in a jQuery object. - * @see {@link https://api.jquery.com/jQuery/#jQuery-object} - */ - (object: {}): JQuery; - - /** - * Accepts a string containing a CSS selector which is then used to match a set of elements. - * - * @param object An existing jQuery object to clone. - * @see {@link https://api.jquery.com/jQuery/#jQuery-object} - */ - (object: JQuery): JQuery; - - /** - * Specify a function to execute when the DOM is fully loaded. - * @see {@link https://api.jquery.com/jQuery/#jQuery} - */ - (): JQuery; - - /** - * Creates DOM elements on the fly from the provided string of raw HTML. - * - * @param html A string of HTML to create on the fly. Note that this parses HTML, not XML. - * @param ownerDocument A document in which the new elements will be created. - * @see {@link https://api.jquery.com/jQuery/#jQuery-html-ownerDocument} - */ - (html: string, ownerDocument?: Document): JQuery; - - /** - * Creates DOM elements on the fly from the provided string of raw HTML. - * - * @param html A string defining a single, standalone, HTML element (e.g.
              or
              ). - * @param attributes An object of attributes, events, and methods to call on the newly-created element. - * @see {@link https://api.jquery.com/jQuery/#jQuery-html-attributes} - */ - (html: string, attributes: Object): JQuery; - - /** - * Relinquish jQuery's control of the $ variable. - * - * @param removeAll A Boolean indicating whether to remove all jQuery variables from the global scope (including jQuery itself). - * @see {@link https://api.jquery.com/jQuery.noConflict/} - */ - noConflict(removeAll?: boolean): JQueryStatic; - - /** - * Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events. - * - * @param deferreds One or more Deferred objects, or plain JavaScript objects. - * @see {@link https://api.jquery.com/jQuery.when/} - */ - when(...deferreds: Array/* as JQueryDeferred */>): JQueryPromise; - - /** - * Hook directly into jQuery to override how particular CSS properties are retrieved or set, normalize CSS property naming, or create custom properties. - * @see {@link https://api.jquery.com/jQuery.cssHooks/} - */ - cssHooks: { [key: string]: any; }; - - /** - * An object containing all CSS properties that may be used without a unit. The .css() method uses this object to see if it may append px to unitless values. - * @see {@link https://api.jquery.com/jQuery.cssNumber/} - */ - cssNumber: any; - - /** - * Store arbitrary data associated with the specified element. Returns the value that was set. - * - * @param element The DOM element to associate with the data. - * @param key A string naming the piece of data to set. - * @param value The new data value. - * @see {@link https://api.jquery.com/jQuery.data/#jQuery-data-element-key-value} - */ - data(element: Element, key: string, value: T): T; - /** - * Returns value at named data store for the element, as set by jQuery.data(element, name, value), or the full data store for the element. - * - * @param element The DOM element to associate with the data. - * @param key A string naming the piece of data to set. - * @see {@link https://api.jquery.com/jQuery.data/#jQuery-data-element-key} - */ - data(element: Element, key: string): any; - /** - * Returns value at named data store for the element, as set by jQuery.data(element, name, value), or the full data store for the element. - * - * @param element The DOM element to associate with the data. - * @see {@link https://api.jquery.com/jQuery.data/#jQuery-data-element} - */ - data(element: Element): any; - - /** - * Execute the next function on the queue for the matched element. - * - * @param element A DOM element from which to remove and execute a queued function. - * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. - * @see {@link https://api.jquery.com/jQuery.dequeue/} - */ - dequeue(element: Element, queueName?: string): void; - - /** - * Determine whether an element has any jQuery data associated with it. - * - * @param element A DOM element to be checked for data. - * @see {@link https://api.jquery.com/jQuery.hasData/} - */ - hasData(element: Element): boolean; - - /** - * Show the queue of functions to be executed on the matched element. - * - * @param element A DOM element to inspect for an attached queue. - * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. - * @see {@link https://api.jquery.com/jQuery.queue/#jQuery-queue-element-queueName} - */ - queue(element: Element, queueName?: string): any[]; - /** - * Manipulate the queue of functions to be executed on the matched element. - * - * @param element A DOM element where the array of queued functions is attached. - * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. - * @param newQueue An array of functions to replace the current queue contents. - * @see {@link https://api.jquery.com/jQuery.queue/#jQuery-queue-element-queueName-newQueue} - */ - queue(element: Element, queueName: string, newQueue: Function[]): JQuery; - /** - * Manipulate the queue of functions to be executed on the matched element. - * - * @param element A DOM element on which to add a queued function. - * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. - * @param callback The new function to add to the queue. - * @see {@link https://api.jquery.com/jQuery.queue/#jQuery-queue-element-queueName-callback} - */ - queue(element: Element, queueName: string, callback: Function): JQuery; - - /** - * Remove a previously-stored piece of data. - * - * @param element A DOM element from which to remove data. - * @param name A string naming the piece of data to remove. - * @see {@link https://api.jquery.com/jQuery.removeData/} - */ - removeData(element: Element, name?: string): JQuery; - - /** - * A constructor function that returns a chainable utility object with methods to register multiple callbacks into callback queues, invoke callback queues, and relay the success or failure state of any synchronous or asynchronous function. - * - * @param beforeStart A function that is called just before the constructor returns. - * @see {@link https://api.jquery.com/jQuery.Deferred/} - */ - Deferred(beforeStart?: (deferred: JQueryDeferred) => any): JQueryDeferred; - - /** - * Effects - */ - - easing: JQueryEasingFunctions; - - fx: { - tick: () => void; - /** - * The rate (in milliseconds) at which animations fire. - * @see {@link https://api.jquery.com/jQuery.fx.interval/} - */ - interval: number; - stop: () => void; - speeds: { slow: number; fast: number; }; - /** - * Globally disable all animations. - * @see {@link https://api.jquery.com/jQuery.fx.off/} - */ - off: boolean; - step: any; - }; - - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param func The function whose context will be changed. - * @param context The object to which the context (this) of the function should be set. - * @param additionalArguments Any number of arguments to be passed to the function referenced in the function argument. - * @see {@link https://api.jquery.com/jQuery.proxy/#jQuery-proxy-function-context-additionalArguments} - */ - proxy(func: (...args: any[]) => any, context: Object, ...additionalArguments: any[]): any; - /** - * Takes a function and returns a new one that will always have a particular context. - * - * @param context The object to which the context (this) of the function should be set. - * @param name The name of the function whose context will be changed (should be a property of the context object). - * @param additionalArguments Any number of arguments to be passed to the function named in the name argument. - * @see {@link https://api.jquery.com/jQuery.proxy/#jQuery-proxy-context-name-additionalArguments} - */ - proxy(context: Object, name: string, ...additionalArguments: any[]): any; - - Event: JQueryEventConstructor; - - /** - * Takes a string and throws an exception containing it. - * - * @param message The message to send out. - * @see {@link https://api.jquery.com/jQuery.error/} - */ - error(message: any): JQuery; - - expr: any; - fn: any; //TODO: Decide how we want to type this - - isReady: boolean; - - // Properties - support: JQuerySupport; - - /** - * Check to see if a DOM element is a descendant of another DOM element. - * - * @param container The DOM element that may contain the other element. - * @param contained The DOM element that may be contained by (a descendant of) the other element. - * @see {@link https://api.jquery.com/jQuery.contains/} - */ - contains(container: Element, contained: Element): boolean; - - /** - * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. - * - * @param collection The object or array to iterate over. - * @param callback The function that will be executed on every object. - * @see {@link https://api.jquery.com/jQuery.each/#jQuery-each-array-callback} - */ - each( - collection: T[], - callback: (indexInArray: number, valueOfElement: T) => any - ): any; - - /** - * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. - * - * @param collection The object or array to iterate over. - * @param callback The function that will be executed on every object. - * @see {@link https://api.jquery.com/jQuery.each/#jQuery-each-object-callback} - */ - each( - collection: any, - callback: (indexInArray: any, valueOfElement: any) => any - ): any; - - /** - * Merge the contents of two or more objects together into the first object. - * - * @param target An object that will receive the new properties if additional objects are passed in or that will extend the jQuery namespace if it is the sole argument. - * @param object1 An object containing additional properties to merge in. - * @param objectN Additional objects containing properties to merge in. - * @see {@link https://api.jquery.com/jQuery.extend/#jQuery-extend-target-object1-objectN} - */ - extend(target: any, object1?: any, ...objectN: any[]): any; - /** - * Merge the contents of two or more objects together into the first object. - * - * @param deep If true, the merge becomes recursive (aka. deep copy). - * @param target The object to extend. It will receive the new properties. - * @param object1 An object containing additional properties to merge in. - * @param objectN Additional objects containing properties to merge in. - * @see {@link https://api.jquery.com/jQuery.extend/#jQuery-extend-deep-target-object1-objectN} - */ - extend(deep: boolean, target: any, object1?: any, ...objectN: any[]): any; - - /** - * Execute some JavaScript code globally. - * - * @param code The JavaScript code to execute. - * @see {@link https://api.jquery.com/jQuery.globalEval/} - */ - globalEval(code: string): any; - - /** - * Finds the elements of an array which satisfy a filter function. The original array is not affected. - * - * @param array The array to search through. - * @param func The function to process each item against. The first argument to the function is the item, and the second argument is the index. The function should return a Boolean value. this will be the global window object. - * @param invert If "invert" is false, or not provided, then the function returns an array consisting of all elements for which "callback" returns true. If "invert" is true, then the function returns an array consisting of all elements for which "callback" returns false. - * @see {@link https://api.jquery.com/jQuery.grep/} - */ - grep(array: T[], func: (elementOfArray?: T, indexInArray?: number) => boolean, invert?: boolean): T[]; - - /** - * Search for a specified value within an array and return its index (or -1 if not found). - * - * @param value The value to search for. - * @param array An array through which to search. - * @param fromIndex The index of the array at which to begin the search. The default is 0, which will search the whole array. - * @see {@link https://api.jquery.com/jQuery.inArray/} - */ - inArray(value: T, array: T[], fromIndex?: number): number; - - /** - * Determine whether the argument is an array. - * - * @param obj Object to test whether or not it is an array. - * @see {@link https://api.jquery.com/jQuery.isArray/} - */ - isArray(obj: any): boolean; - /** - * Check to see if an object is empty (contains no enumerable properties). - * - * @param obj The object that will be checked to see if it's empty. - * @see {@link https://api.jquery.com/jQuery.isEmptyObject/} - */ - isEmptyObject(obj: any): boolean; - /** - * Determine if the argument passed is a JavaScript function object. - * - * @param obj Object to test whether or not it is a function. - * @see {@link https://api.jquery.com/jQuery.isFunction/} - */ - isFunction(obj: any): boolean; - /** - * Determines whether its argument is a number. - * - * @param value The value to be tested. - * @see {@link https://api.jquery.com/jQuery.isNumeric/} - */ - isNumeric(value: any): boolean; - /** - * Check to see if an object is a plain object (created using "{}" or "new Object"). - * - * @param obj The object that will be checked to see if it's a plain object. - * @see {@link https://api.jquery.com/jQuery.isPlainObject/} - */ - isPlainObject(obj: any): boolean; - /** - * Determine whether the argument is a window. - * - * @param obj Object to test whether or not it is a window. - * @see {@link https://api.jquery.com/jQuery.isWindow/} - */ - isWindow(obj: any): boolean; - /** - * Check to see if a DOM node is within an XML document (or is an XML document). - * - * @param node The DOM node that will be checked to see if it's in an XML document. - * @see {@link https://api.jquery.com/jQuery.isXMLDoc/} - */ - isXMLDoc(node: Node): boolean; - - /** - * Convert an array-like object into a true JavaScript array. - * - * @param obj Any object to turn into a native Array. - * @see {@link https://api.jquery.com/jQuery.makeArray/} - */ - makeArray(obj: any): any[]; - - /** - * Translate all items in an array or object to new array of items. - * - * @param array The Array to translate. - * @param callback The function to process each item against. The first argument to the function is the array item, the second argument is the index in array The function can return any value. Within the function, this refers to the global (window) object. - * @see {@link https://api.jquery.com/jQuery.map/#jQuery-map-array-callback} - */ - map(array: T[], callback: (elementOfArray?: T, indexInArray?: number) => U): U[]; - /** - * Translate all items in an array or object to new array of items. - * - * @param arrayOrObject The Array or Object to translate. - * @param callback The function to process each item against. The first argument to the function is the value; the second argument is the index or key of the array or object property. The function can return any value to add to the array. A returned array will be flattened into the resulting array. Within the function, this refers to the global (window) object. - * @see {@link https://api.jquery.com/jQuery.map/#jQuery-map-object-callback} - */ - map(arrayOrObject: any, callback: (value?: any, indexOrKey?: any) => any): any; - - /** - * Merge the contents of two arrays together into the first array. - * - * @param first The first array to merge, the elements of second added. - * @param second The second array to merge into the first, unaltered. - * @see {@link https://api.jquery.com/jQuery.merge/} - */ - merge(first: T[], second: T[]): T[]; - - /** - * An empty function. - * @see {@link https://api.jquery.com/jQuery.noop/} - */ - noop(): any; - - /** - * Return a number representing the current time. - * @see {@link https://api.jquery.com/jQuery.now/} - */ - now(): number; - - /** - * Takes a well-formed JSON string and returns the resulting JavaScript object. - * - * @param json The JSON string to parse. - * @see {@link https://api.jquery.com/jQuery.parseJSON/} - */ - parseJSON(json: string): any; - - /** - * Parses a string into an XML document. - * - * @param data a well-formed XML string to be parsed - * @see {@link https://api.jquery.com/jQuery.parseXML/} - */ - parseXML(data: string): XMLDocument; - - /** - * Remove the whitespace from the beginning and end of a string. - * - * @param str Remove the whitespace from the beginning and end of a string. - * @see {@link https://api.jquery.com/jQuery.trim/} - */ - trim(str: string): string; - - /** - * Determine the internal JavaScript [[Class]] of an object. - * - * @param obj Object to get the internal JavaScript [[Class]] of. - * @see {@link https://api.jquery.com/jQuery.type/} - */ - type(obj: any): string; - - /** - * Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on arrays of DOM elements, not strings or numbers. - * - * @param array The Array of DOM elements. - * @see {@link https://api.jquery.com/jQuery.unique/} - */ - unique(array: Element[]): Element[]; - - /** - * Parses a string into an array of DOM nodes. - * - * @param data HTML string to be parsed - * @param context DOM element to serve as the context in which the HTML fragment will be created - * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string - * @see {@link https://api.jquery.com/jQuery.parseHTML/} - */ - parseHTML(data: string, context?: HTMLElement, keepScripts?: boolean): any[]; - - /** - * Parses a string into an array of DOM nodes. - * - * @param data HTML string to be parsed - * @param context DOM element to serve as the context in which the HTML fragment will be created - * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string - * @see {@link https://api.jquery.com/jQuery.parseHTML/} - */ - parseHTML(data: string, context?: Document, keepScripts?: boolean): any[]; -} - -/** - * The jQuery instance members - * - * @see {@link https://api.jquery.com/Types/#jQuery} - */ -interface JQuery { - /** - * Register a handler to be called when Ajax requests complete. This is an AjaxEvent. - * - * @param handler The function to be invoked. - * @see {@link https://api.jquery.com/ajaxComplete/} - */ - ajaxComplete(handler: (event: JQueryEventObject, XMLHttpRequest: XMLHttpRequest, ajaxOptions: any) => any): JQuery; - /** - * Register a handler to be called when Ajax requests complete with an error. This is an Ajax Event. - * - * @param handler The function to be invoked. - * @see {@link https://api.jquery.com/ajaxError/} - */ - ajaxError(handler: (event: JQueryEventObject, jqXHR: JQueryXHR, ajaxSettings: JQueryAjaxSettings, thrownError: any) => any): JQuery; - /** - * Attach a function to be executed before an Ajax request is sent. This is an Ajax Event. - * - * @param handler The function to be invoked. - * @see {@link https://api.jquery.com/ajaxSend/} - */ - ajaxSend(handler: (event: JQueryEventObject, jqXHR: JQueryXHR, ajaxOptions: JQueryAjaxSettings) => any): JQuery; - /** - * Register a handler to be called when the first Ajax request begins. This is an Ajax Event. - * - * @param handler The function to be invoked. - * @see {@link https://api.jquery.com/ajaxStart/} - */ - ajaxStart(handler: () => any): JQuery; - /** - * Register a handler to be called when all Ajax requests have completed. This is an Ajax Event. - * - * @param handler The function to be invoked. - * @see {@link https://api.jquery.com/ajaxStop/} - */ - ajaxStop(handler: () => any): JQuery; - /** - * Attach a function to be executed whenever an Ajax request completes successfully. This is an Ajax Event. - * - * @param handler The function to be invoked. - * @see {@link https://api.jquery.com/ajaxSuccess/} - */ - ajaxSuccess(handler: (event: JQueryEventObject, XMLHttpRequest: XMLHttpRequest, ajaxOptions: JQueryAjaxSettings) => any): JQuery; - - /** - * Load data from the server and place the returned HTML into the matched element. - * - * @param url A string containing the URL to which the request is sent. - * @param data A plain object or string that is sent to the server with the request. - * @param complete A callback function that is executed when the request completes. - * @see {@link https://api.jquery.com/load/} - */ - load(url: string, data?: string|Object, complete?: (responseText: string, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any): JQuery; - - /** - * Encode a set of form elements as a string for submission. - * @see {@link https://api.jquery.com/serialize/} - */ - serialize(): string; - /** - * Encode a set of form elements as an array of names and values. - * @see {@link https://api.jquery.com/serializeArray/} - */ - serializeArray(): JQuerySerializeArrayElement[]; - - /** - * Adds the specified class(es) to each of the set of matched elements. - * - * @param className One or more space-separated classes to be added to the class attribute of each matched element. - * @see {@link https://api.jquery.com/addClass/#addClass-className} - */ - addClass(className: string): JQuery; - /** - * Adds the specified class(es) to each of the set of matched elements. - * - * @param func A function returning one or more space-separated class names to be added to the existing class name(s). Receives the index position of the element in the set and the existing class name(s) as arguments. Within the function, this refers to the current element in the set. - * @see {@link https://api.jquery.com/addClass/#addClass-function} - */ - addClass(func: (index: number, className: string) => string): JQuery; - - /** - * Add the previous set of elements on the stack to the current set, optionally filtered by a selector. - * @see {@link https://api.jquery.com/addBack/} - */ - addBack(selector?: string): JQuery; - - /** - * Get the value of an attribute for the first element in the set of matched elements. - * - * @param attributeName The name of the attribute to get. - * @see {@link https://api.jquery.com/attr/#attr-attributeName} - */ - attr(attributeName: string): string; - /** - * Set one or more attributes for the set of matched elements. - * - * @param attributeName The name of the attribute to set. - * @param value A value to set for the attribute. If this is `null`, the attribute will be deleted. - * @see {@link https://api.jquery.com/attr/#attr-attributeName-value} - */ - attr(attributeName: string, value: string|number|null): JQuery; - /** - * Set one or more attributes for the set of matched elements. - * - * @param attributeName The name of the attribute to set. - * @param func A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old attribute value as arguments. - * @see {@link https://api.jquery.com/attr/#attr-attributeName-function} - */ - attr(attributeName: string, func: (index: number, attr: string) => string|number): JQuery; - /** - * Set one or more attributes for the set of matched elements. - * - * @param attributes An object of attribute-value pairs to set. - * @see {@link https://api.jquery.com/attr/#attr-attributes} - */ - attr(attributes: Object): JQuery; - - /** - * Determine whether any of the matched elements are assigned the given class. - * - * @param className The class name to search for. - * @see {@link https://api.jquery.com/hasClass/} - */ - hasClass(className: string): boolean; - - /** - * Get the HTML contents of the first element in the set of matched elements. - * @see {@link https://api.jquery.com/html/#html} - */ - html(): string; - /** - * Set the HTML contents of each element in the set of matched elements. - * - * @param htmlString A string of HTML to set as the content of each matched element. - * @see {@link https://api.jquery.com/html/#html-htmlString} - */ - html(htmlString: string): JQuery; - /** - * Set the HTML contents of each element in the set of matched elements. - * - * @param func A function returning the HTML content to set. Receives the index position of the element in the set and the old HTML value as arguments. jQuery empties the element before calling the function; use the oldhtml argument to reference the previous content. Within the function, this refers to the current element in the set. - * @see {@link https://api.jquery.com/html/#html-function} - */ - html(func: (index: number, oldhtml: string) => string): JQuery; - - /** - * Get the value of a property for the first element in the set of matched elements. - * - * @param propertyName The name of the property to get. - * @see {@link https://api.jquery.com/prop/#prop-propertyName} - */ - prop(propertyName: string): any; - /** - * Set one or more properties for the set of matched elements. - * - * @param propertyName The name of the property to set. - * @param value A value to set for the property. - * @see {@link https://api.jquery.com/prop/#prop-propertyName-value} - */ - prop(propertyName: string, value: string|number|boolean): JQuery; - /** - * Set one or more properties for the set of matched elements. - * - * @param properties An object of property-value pairs to set. - * @see {@link https://api.jquery.com/prop/#prop-properties} - */ - prop(properties: Object): JQuery; - /** - * Set one or more properties for the set of matched elements. - * - * @param propertyName The name of the property to set. - * @param func A function returning the value to set. Receives the index position of the element in the set and the old property value as arguments. Within the function, the keyword this refers to the current element. - * @see {@link https://api.jquery.com/prop/#prop-propertyName-function} - */ - prop(propertyName: string, func: (index: number, oldPropertyValue: any) => any): JQuery; - - /** - * Remove an attribute from each element in the set of matched elements. - * - * @param attributeName An attribute to remove; as of version 1.7, it can be a space-separated list of attributes. - * @see {@link https://api.jquery.com/removeAttr/} - */ - removeAttr(attributeName: string): JQuery; - - /** - * Remove a single class, multiple classes, or all classes from each element in the set of matched elements. - * - * @param className One or more space-separated classes to be removed from the class attribute of each matched element. - * @see {@link https://api.jquery.com/removeClass/#removeClass-className} - */ - removeClass(className?: string): JQuery; - /** - * Remove a single class, multiple classes, or all classes from each element in the set of matched elements. - * - * @param func A function returning one or more space-separated class names to be removed. Receives the index position of the element in the set and the old class value as arguments. - * @see {@link https://api.jquery.com/removeClass/#removeClass-function} - */ - removeClass(func: (index: number, className: string) => string): JQuery; - - /** - * Remove a property for the set of matched elements. - * - * @param propertyName The name of the property to remove. - * @see {@link https://api.jquery.com/removeProp/} - */ - removeProp(propertyName: string): JQuery; - - /** - * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument. - * - * @param className One or more class names (separated by spaces) to be toggled for each element in the matched set. - * @param swtch A Boolean (not just truthy/falsy) value to determine whether the class should be added or removed. - * @see {@link https://api.jquery.com/toggleClass/#toggleClass-className} - */ - toggleClass(className: string, swtch?: boolean): JQuery; - /** - * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument. - * - * @param swtch A boolean value to determine whether the class should be added or removed. - * @see {@link https://api.jquery.com/toggleClass/#toggleClass-state} - */ - toggleClass(swtch?: boolean): JQuery; - /** - * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument. - * - * @param func A function that returns class names to be toggled in the class attribute of each element in the matched set. Receives the index position of the element in the set, the old class value, and the switch as arguments. - * @param swtch A boolean value to determine whether the class should be added or removed. - * @see {@link https://api.jquery.com/toggleClass/#toggleClass-function-state} - */ - toggleClass(func: (index: number, className: string, swtch: boolean) => string, swtch?: boolean): JQuery; - - /** - * Get the current value of the first element in the set of matched elements. - * @see {@link https://api.jquery.com/val/#val} - */ - val(): any; - /** - * Set the value of each element in the set of matched elements. - * - * @param value A string of text, an array of strings or number corresponding to the value of each matched element to set as selected/checked. - * @see {@link https://api.jquery.com/val/#val-value} - */ - val(value: string|string[]|number): JQuery; - /** - * Set the value of each element in the set of matched elements. - * - * @param func A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments. - * @see {@link https://api.jquery.com/val/#val-function} - */ - val(func: (index: number, value: string) => string): JQuery; - - /** - * Get the value of style properties for the first element in the set of matched elements. - * - * @param propertyName A CSS property. - * @see {@link https://api.jquery.com/css/#css-propertyName} - */ - css(propertyName: string): string; - /** - * Set one or more CSS properties for the set of matched elements. - * - * @param propertyName A CSS property name. - * @param value A value to set for the property. - * @see {@link https://api.jquery.com/css/#css-propertyName-value} - */ - css(propertyName: string, value: string|number): JQuery; - /** - * Set one or more CSS properties for the set of matched elements. - * - * @param propertyName A CSS property name. - * @param value A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments. - * @see {@link https://api.jquery.com/css/#css-propertyName-function} - */ - css(propertyName: string, value: (index: number, value: string) => string|number): JQuery; - /** - * Set one or more CSS properties for the set of matched elements. - * - * @param properties An object of property-value pairs to set. - * @see {@link https://api.jquery.com/css/#css-properties} - */ - css(properties: Object): JQuery; - - /** - * Get the current computed height for the first element in the set of matched elements. - * @see {@link https://api.jquery.com/height/#height} - */ - height(): number; - /** - * Set the CSS height of every matched element. - * - * @param value An integer representing the number of pixels, or an integer with an optional unit of measure appended (as a string). - * @see {@link https://api.jquery.com/height/#height-value} - */ - height(value: number|string): JQuery; - /** - * Set the CSS height of every matched element. - * - * @param func A function returning the height to set. Receives the index position of the element in the set and the old height as arguments. Within the function, this refers to the current element in the set. - * @see {@link https://api.jquery.com/height/#height-function} - */ - height(func: (index: number, height: number) => number|string): JQuery; - - /** - * Get the current computed height for the first element in the set of matched elements, including padding but not border. - * @see {@link https://api.jquery.com/innerHeight/#innerHeight} - */ - innerHeight(): number; - - /** - * Sets the inner height on elements in the set of matched elements, including padding but not border. - * - * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). - * @see {@link https://api.jquery.com/innerHeight/#innerHeight-value} - */ - innerHeight(value: number|string): JQuery; - - /** - * Get the current computed width for the first element in the set of matched elements, including padding but not border. - * @see {@link https://api.jquery.com/innerWidth/#innerWidth} - */ - innerWidth(): number; - - /** - * Sets the inner width on elements in the set of matched elements, including padding but not border. - * - * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). - * @see {@link https://api.jquery.com/innerWidth/#innerWidth-value} - */ - innerWidth(value: number|string): JQuery; - - /** - * Get the current coordinates of the first element in the set of matched elements, relative to the document. - * @see {@link https://api.jquery.com/offset/#offset} - */ - offset(): JQueryCoordinates; - /** - * An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements. - * - * @param coordinates An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements. - * @see {@link https://api.jquery.com/offset/#offset-coordinates} - */ - offset(coordinates: JQueryCoordinates): JQuery; - /** - * An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements. - * - * @param func A function to return the coordinates to set. Receives the index of the element in the collection as the first argument and the current coordinates as the second argument. The function should return an object with the new top and left properties. - * @see {@link https://api.jquery.com/offset/#offset-function} - */ - offset(func: (index: number, coords: JQueryCoordinates) => JQueryCoordinates): JQuery; - - /** - * Get the current computed height for the first element in the set of matched elements, including padding, border, and optionally margin. Returns an integer (without "px") representation of the value or null if called on an empty set of elements. - * - * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation. - * @see {@link https://api.jquery.com/outerHeight/#outerHeight-includeMargin} - */ - outerHeight(includeMargin?: boolean): number; - - /** - * Sets the outer height on elements in the set of matched elements, including padding and border. - * - * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). - * @see {@link https://api.jquery.com/outerHeight/#outerHeight-value} - */ - outerHeight(value: number|string): JQuery; - - /** - * Get the current computed width for the first element in the set of matched elements, including padding and border. - * - * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation. - * @see {@link https://api.jquery.com/outerWidth/#outerWidth-includeMargin} - */ - outerWidth(includeMargin?: boolean): number; - - /** - * Sets the outer width on elements in the set of matched elements, including padding and border. - * - * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). - * @see {@link https://api.jquery.com/outerWidth/#outerWidth-value} - */ - outerWidth(value: number|string): JQuery; - - /** - * Get the current coordinates of the first element in the set of matched elements, relative to the offset parent. - * @see {@link https://api.jquery.com/position/} - */ - position(): JQueryCoordinates; - - /** - * Get the current horizontal position of the scroll bar for the first element in the set of matched elements or set the horizontal position of the scroll bar for every matched element. - * @see {@link https://api.jquery.com/scrollLeft/#scrollLeft} - */ - scrollLeft(): number; - /** - * Set the current horizontal position of the scroll bar for each of the set of matched elements. - * - * @param value An integer indicating the new position to set the scroll bar to. - * @see {@link https://api.jquery.com/scrollLeft/#scrollLeft-value} - */ - scrollLeft(value: number): JQuery; - - /** - * Get the current vertical position of the scroll bar for the first element in the set of matched elements or set the vertical position of the scroll bar for every matched element. - * @see {@link https://api.jquery.com/scrollTop/#scrollTop} - */ - scrollTop(): number; - /** - * Set the current vertical position of the scroll bar for each of the set of matched elements. - * - * @param value An integer indicating the new position to set the scroll bar to. - * @see {@link https://api.jquery.com/scrollTop/#scrollTop-value} - */ - scrollTop(value: number): JQuery; - - /** - * Get the current computed width for the first element in the set of matched elements. - * @see {@link https://api.jquery.com/width/#width} - */ - width(): number; - /** - * Set the CSS width of each element in the set of matched elements. - * - * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). - * @see {@link https://api.jquery.com/width/#width-value} - */ - width(value: number|string): JQuery; - /** - * Set the CSS width of each element in the set of matched elements. - * - * @param func A function returning the width to set. Receives the index position of the element in the set and the old width as arguments. Within the function, this refers to the current element in the set. - * @see {@link https://api.jquery.com/width/#width-function} - */ - width(func: (index: number, width: number) => number|string): JQuery; - - /** - * Remove from the queue all items that have not yet been run. - * - * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. - * @see {@link https://api.jquery.com/clearQueue/} - */ - clearQueue(queueName?: string): JQuery; - - /** - * Store arbitrary data associated with the matched elements. - * - * @param key A string naming the piece of data to set. - * @param value The new data value; it can be any JavaScript type including Array or Object. - * @see {@link https://api.jquery.com/data/#data-key-value} - */ - data(key: string, value: any): JQuery; - /** - * Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute. - * - * @param key Name of the data stored. - * @see {@link https://api.jquery.com/data/#data-key} - */ - data(key: string): any; - /** - * Store arbitrary data associated with the matched elements. - * - * @param obj An object of key-value pairs of data to update. - * @see {@link https://api.jquery.com/data/#data-obj} - */ - data(obj: { [key: string]: any; }): JQuery; - /** - * Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute. - * @see {@link https://api.jquery.com/data/#data} - */ - data(): any; - - /** - * Execute the next function on the queue for the matched elements. - * - * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. - * @see {@link https://api.jquery.com/dequeue/} - */ - dequeue(queueName?: string): JQuery; - - /** - * Remove a previously-stored piece of data. - * - * @param name A string naming the piece of data to delete or space-separated string naming the pieces of data to delete. - * @see {@link https://api.jquery.com/removeData/#removeData-name} - */ - removeData(name: string): JQuery; - /** - * Remove a previously-stored piece of data. - * - * @param list An array of strings naming the pieces of data to delete. - * @see {@link https://api.jquery.com/removeData/#removeData-list} - */ - removeData(list: string[]): JQuery; - /** - * Remove all previously-stored piece of data. - * @see {@link https://api.jquery.com/removeData/} - */ - removeData(): JQuery; - - /** - * Return a Promise object to observe when all actions of a certain type bound to the collection, queued or not, have finished. - * - * @param type The type of queue that needs to be observed. (default: fx) - * @param target Object onto which the promise methods have to be attached - * @see {@link https://api.jquery.com/promise/} - */ - promise(type?: string, target?: Object): JQueryPromise; - - /** - * Perform a custom animation of a set of CSS properties. - * - * @param properties An object of CSS properties and values that the animation will move toward. - * @param duration A string or number determining how long the animation will run. - * @param complete A function to call once the animation is complete. - * @see {@link https://api.jquery.com/animate/#animate-properties-duration-easing-complete} - */ - animate(properties: Object, duration?: string|number, complete?: Function): JQuery; - /** - * Perform a custom animation of a set of CSS properties. - * - * @param properties An object of CSS properties and values that the animation will move toward. - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. (default: swing) - * @param complete A function to call once the animation is complete. - * @see {@link https://api.jquery.com/animate/#animate-properties-duration-easing-complete} - */ - animate(properties: Object, duration?: string|number, easing?: string, complete?: Function): JQuery; - /** - * Perform a custom animation of a set of CSS properties. - * - * @param properties An object of CSS properties and values that the animation will move toward. - * @param options A map of additional options to pass to the method. - * @see {@link https://api.jquery.com/animate/#animate-properties-options} - */ - animate(properties: Object, options: JQueryAnimationOptions): JQuery; - - /** - * Set a timer to delay execution of subsequent items in the queue. - * - * @param duration An integer indicating the number of milliseconds to delay execution of the next item in the queue. - * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. - * @see {@link https://api.jquery.com/delay/} - */ - delay(duration: number, queueName?: string): JQuery; - - /** - * Display the matched elements by fading them to opaque. - * - * @param duration A string or number determining how long the animation will run. - * @param complete A function to call once the animation is complete. - * @see {@link https://api.jquery.com/fadeIn/#fadeIn-duration-complete} - */ - fadeIn(duration?: number|string, complete?: Function): JQuery; - /** - * Display the matched elements by fading them to opaque. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete. - * @see {@link https://api.jquery.com/fadeIn/#fadeIn-duration-easing-complete} - */ - fadeIn(duration?: number|string, easing?: string, complete?: Function): JQuery; - /** - * Display the matched elements by fading them to opaque. - * - * @param options A map of additional options to pass to the method. - * @see {@link https://api.jquery.com/fadeIn/#fadeIn-options} - */ - fadeIn(options: JQueryAnimationOptions): JQuery; - - /** - * Hide the matched elements by fading them to transparent. - * - * @param duration A string or number determining how long the animation will run. - * @param complete A function to call once the animation is complete. - * @see {@link https://api.jquery.com/fadeOut/#fadeOut-duration-complete} - */ - fadeOut(duration?: number|string, complete?: Function): JQuery; - /** - * Hide the matched elements by fading them to transparent. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete. - * @see {@link https://api.jquery.com/fadeOut/#fadeOut-duration-easing-complete} - */ - fadeOut(duration?: number|string, easing?: string, complete?: Function): JQuery; - /** - * Hide the matched elements by fading them to transparent. - * - * @param options A map of additional options to pass to the method. - * @see {@link https://api.jquery.com/fadeOut/#fadeOut-options} - */ - fadeOut(options: JQueryAnimationOptions): JQuery; - - /** - * Adjust the opacity of the matched elements. - * - * @param duration A string or number determining how long the animation will run. - * @param opacity A number between 0 and 1 denoting the target opacity. - * @param complete A function to call once the animation is complete. - * @see {@link https://api.jquery.com/fadeTo/#fadeTo-duration-opacity-complete} - */ - fadeTo(duration: string|number, opacity: number, complete?: Function): JQuery; - /** - * Adjust the opacity of the matched elements. - * - * @param duration A string or number determining how long the animation will run. - * @param opacity A number between 0 and 1 denoting the target opacity. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete. - * @see {@link https://api.jquery.com/fadeTo/#fadeTo-duration-opacity-easing-complete} - */ - fadeTo(duration: string|number, opacity: number, easing?: string, complete?: Function): JQuery; - - /** - * Display or hide the matched elements by animating their opacity. - * - * @param duration A string or number determining how long the animation will run. - * @param complete A function to call once the animation is complete. - * @see {@link https://api.jquery.com/fadeToggle/#fadeToggle-duration-easing-complete} - */ - fadeToggle(duration?: number|string, complete?: Function): JQuery; - /** - * Display or hide the matched elements by animating their opacity. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete. - * @see {@link https://api.jquery.com/fadeToggle/#fadeToggle-duration-easing-complete} - */ - fadeToggle(duration?: number|string, easing?: string, complete?: Function): JQuery; - /** - * Display or hide the matched elements by animating their opacity. - * - * @param options A map of additional options to pass to the method. - * @see {@link https://api.jquery.com/fadeToggle/#fadeToggle-options} - */ - fadeToggle(options: JQueryAnimationOptions): JQuery; - - /** - * Stop the currently-running animation, remove all queued animations, and complete all animations for the matched elements. - * - * @param queue The name of the queue in which to stop animations. - * @see {@link https://api.jquery.com/finish/} - */ - finish(queue?: string): JQuery; - - /** - * Hide the matched elements. - * - * @param duration A string or number determining how long the animation will run. - * @param complete A function to call once the animation is complete. - * @see {@link https://api.jquery.com/hide/#hide} - */ - hide(duration?: number|string, complete?: Function): JQuery; - /** - * Hide the matched elements. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete. - * @see {@link https://api.jquery.com/hide/#hide-duration-easing-complete} - */ - hide(duration?: number|string, easing?: string, complete?: Function): JQuery; - /** - * Hide the matched elements. - * - * @param options A map of additional options to pass to the method. - * @see {@link https://api.jquery.com/hide/#hide-options} - */ - hide(options: JQueryAnimationOptions): JQuery; - - /** - * Display the matched elements. - * - * @param duration A string or number determining how long the animation will run. - * @param complete A function to call once the animation is complete. - * @see {@link https://api.jquery.com/show/#show} - */ - show(duration?: number|string, complete?: Function): JQuery; - /** - * Display the matched elements. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete. - * @see {@link https://api.jquery.com/show/#show-duration-easing-complete} - */ - show(duration?: number|string, easing?: string, complete?: Function): JQuery; - /** - * Display the matched elements. - * - * @param options A map of additional options to pass to the method. - * @see {@link https://api.jquery.com/show/#show-options} - */ - show(options: JQueryAnimationOptions): JQuery; - - /** - * Display the matched elements with a sliding motion. - * - * @param duration A string or number determining how long the animation will run. - * @param complete A function to call once the animation is complete. - * @see {@link https://api.jquery.com/slideDown/#slideDown-duration-complete} - */ - slideDown(duration?: number|string, complete?: Function): JQuery; - /** - * Display the matched elements with a sliding motion. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete. - * @see {@link https://api.jquery.com/slideDown/#slideDown-duration-easing-complete} - */ - slideDown(duration?: number|string, easing?: string, complete?: Function): JQuery; - /** - * Display the matched elements with a sliding motion. - * - * @param options A map of additional options to pass to the method. - * @see {@link https://api.jquery.com/slideDown/#slideDown-options} - */ - slideDown(options: JQueryAnimationOptions): JQuery; - - /** - * Display or hide the matched elements with a sliding motion. - * - * @param duration A string or number determining how long the animation will run. - * @param complete A function to call once the animation is complete. - * @see {@link https://api.jquery.com/slideToggle/#slideToggle-duration-complete} - */ - slideToggle(duration?: number|string, complete?: Function): JQuery; - /** - * Display or hide the matched elements with a sliding motion. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete. - * @see {@link https://api.jquery.com/slideToggle/#slideToggle-duration-easing-complete} - */ - slideToggle(duration?: number|string, easing?: string, complete?: Function): JQuery; - /** - * Display or hide the matched elements with a sliding motion. - * - * @param options A map of additional options to pass to the method. - * @see {@link https://api.jquery.com/slideToggle/#slideToggle-options} - */ - slideToggle(options: JQueryAnimationOptions): JQuery; - - /** - * Hide the matched elements with a sliding motion. - * - * @param duration A string or number determining how long the animation will run. - * @param complete A function to call once the animation is complete. - * @see {@link https://api.jquery.com/slideUp/#slideUp-duration-complete} - */ - slideUp(duration?: number|string, complete?: Function): JQuery; - /** - * Hide the matched elements with a sliding motion. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete. - * @see {@link https://api.jquery.com/slideUp/#slideUp-duration-easing-complete} - */ - slideUp(duration?: number|string, easing?: string, complete?: Function): JQuery; - /** - * Hide the matched elements with a sliding motion. - * - * @param options A map of additional options to pass to the method. - * @see {@link https://api.jquery.com/slideUp/#slideUp-options} - */ - slideUp(options: JQueryAnimationOptions): JQuery; - - /** - * Stop the currently-running animation on the matched elements. - * - * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false. - * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false. - * @see {@link https://api.jquery.com/stop/#stop-clearQueue-jumpToEnd} - */ - stop(clearQueue?: boolean, jumpToEnd?: boolean): JQuery; - /** - * Stop the currently-running animation on the matched elements. - * - * @param queue The name of the queue in which to stop animations. - * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false. - * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false. - * @see {@link https://api.jquery.com/stop/#stop-queue-clearQueue-jumpToEnd} - */ - stop(queue?: string, clearQueue?: boolean, jumpToEnd?: boolean): JQuery; - - /** - * Display or hide the matched elements. - * - * @param duration A string or number determining how long the animation will run. - * @param complete A function to call once the animation is complete. - * @see {@link https://api.jquery.com/toggle/#toggle-duration-complete} - */ - toggle(duration?: number|string, complete?: Function): JQuery; - /** - * Display or hide the matched elements. - * - * @param duration A string or number determining how long the animation will run. - * @param easing A string indicating which easing function to use for the transition. - * @param complete A function to call once the animation is complete. - * @see {@link https://api.jquery.com/toggle/#toggle-duration-easing-complete} - */ - toggle(duration?: number|string, easing?: string, complete?: Function): JQuery; - /** - * Display or hide the matched elements. - * - * @param options A map of additional options to pass to the method. - * @see {@link https://api.jquery.com/toggle/#toggle-options} - */ - toggle(options: JQueryAnimationOptions): JQuery; - /** - * Display or hide the matched elements. - * - * @param showOrHide A Boolean indicating whether to show or hide the elements. - * @see {@link https://api.jquery.com/toggle/#toggle-display} - */ - toggle(showOrHide: boolean): JQuery; - - /** - * Attach a handler to an event for the elements. - * - * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/bind/#bind-eventType-eventData-handler} - */ - bind(eventType: string, eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Attach a handler to an event for the elements. - * - * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/bind/#bind-eventType-eventData-handler} - */ - bind(eventType: string, handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Attach a handler to an event for the elements. - * - * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. - * @param eventData An object containing data that will be passed to the event handler. - * @param preventBubble Setting the third argument to false will attach a function that prevents the default action from occurring and stops the event from bubbling. The default is true. - * @see {@link https://api.jquery.com/bind/#bind-eventType-eventData-preventBubble} - */ - bind(eventType: string, eventData: any, preventBubble: boolean): JQuery; - /** - * Attach a handler to an event for the elements. - * - * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. - * @param preventBubble Setting the third argument to false will attach a function that prevents the default action from occurring and stops the event from bubbling. The default is true. - * @see {@link https://api.jquery.com/bind/#bind-eventType-eventData-preventBubble} - */ - bind(eventType: string, preventBubble: boolean): JQuery; - /** - * Attach a handler to an event for the elements. - * - * @param events An object containing one or more DOM event types and functions to execute for them. - * @see {@link https://api.jquery.com/bind/#bind-events} - */ - bind(events: any): JQuery; - - /** - * Trigger the "blur" event on an element - * @see {@link https://api.jquery.com/blur/#blur} - */ - blur(): JQuery; - /** - * Bind an event handler to the "blur" JavaScript event - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/blur/#blur-handler} - */ - blur(handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind an event handler to the "blur" JavaScript event - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/blur/#blur-eventData-handler} - */ - blur(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Trigger the "change" event on an element. - * @see {@link https://api.jquery.com/change/#change} - */ - change(): JQuery; - /** - * Bind an event handler to the "change" JavaScript event - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/change/#change-handler} - */ - change(handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind an event handler to the "change" JavaScript event - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/change/#change-eventData-handler} - */ - change(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Trigger the "click" event on an element. - * @see {@link https://api.jquery.com/click/#click} - */ - click(): JQuery; - /** - * Bind an event handler to the "click" JavaScript event - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/click/#click-handler} - */ - click(handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind an event handler to the "click" JavaScript event - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/click/#click-eventData-handler} - */ - click(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Trigger the "contextmenu" event on an element. - * @see {@link https://api.jquery.com/contextmenu/#contextmenu} - */ - contextmenu(): JQuery; - /** - * Bind an event handler to the "contextmenu" JavaScript event. - * - * @param handler A function to execute when the event is triggered. - * @see {@link https://api.jquery.com/contextmenu/#contextmenu-handler} - */ - contextmenu(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - /** - * Bind an event handler to the "contextmenu" JavaScript event. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute when the event is triggered. - * @see {@link https://api.jquery.com/contextmenu/#contextmenu-eventData-handler} - */ - contextmenu(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - - /** - * Trigger the "dblclick" event on an element. - * @see {@link https://api.jquery.com/dblclick/#dblclick} - */ - dblclick(): JQuery; - /** - * Bind an event handler to the "dblclick" JavaScript event - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/dblclick/#dblclick-handler} - */ - dblclick(handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind an event handler to the "dblclick" JavaScript event - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/dblclick/#dblclick-eventData-handler} - */ - dblclick(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Attach a handler to one or more events for all elements that match the selector, now or in the future, based on a specific set of root elements. - * @see {@link https://api.jquery.com/delegate/#delegate-selector-eventType-handler} - */ - delegate(selector: any, eventType: string, handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Attach a handler to one or more events for all elements that match the selector, now or in the future, based on a specific set of root elements. - * @see {@link https://api.jquery.com/delegate/#delegate-selector-eventType-eventData-handler} - */ - delegate(selector: any, eventType: string, eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Trigger the "focus" event on an element. - * @see {@link https://api.jquery.com/focus/#focus} - */ - focus(): JQuery; - /** - * Bind an event handler to the "focus" JavaScript event - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/focus/#focus-handler} - */ - focus(handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind an event handler to the "focus" JavaScript event - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/focus/#focus-eventData-handler} - */ - focus(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Trigger the "focusin" event on an element. - * @see {@link https://api.jquery.com/focusin/#focusin} - */ - focusin(): JQuery; - /** - * Bind an event handler to the "focusin" JavaScript event - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/focusin/#focusin-handler} - */ - focusin(handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind an event handler to the "focusin" JavaScript event - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/focusin/#focusin-eventData-handler} - */ - focusin(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Trigger the "focusout" event on an element. - * @see {@link https://api.jquery.com/focusout/#focusout} - */ - focusout(): JQuery; - /** - * Bind an event handler to the "focusout" JavaScript event - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/focusout/#focusout-handler} - */ - focusout(handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind an event handler to the "focusout" JavaScript event - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/focusout/#focusout-eventData-handler} - */ - focusout(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Bind two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements. - * - * @param handlerIn A function to execute when the mouse pointer enters the element. - * @param handlerOut A function to execute when the mouse pointer leaves the element. - * @see {@link https://api.jquery.com/hover/#hover-handlerIn-handlerOut} - */ - hover(handlerIn: (eventObject: JQueryEventObject) => any, handlerOut: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind a single handler to the matched elements, to be executed when the mouse pointer enters or leaves the elements. - * - * @param handlerInOut A function to execute when the mouse pointer enters or leaves the element. - * @see {@link https://api.jquery.com/hover/#hover-handlerInOut} - */ - hover(handlerInOut: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Trigger the "keydown" event on an element. - * @see {@link https://api.jquery.com/keydown/#keydown} - */ - keydown(): JQuery; - /** - * Bind an event handler to the "keydown" JavaScript event - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/keydown/#keydown-handler} - */ - keydown(handler: (eventObject: JQueryKeyEventObject) => any): JQuery; - /** - * Bind an event handler to the "keydown" JavaScript event - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/keydown/#keydown-eventData-handler} - */ - keydown(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery; - - /** - * Trigger the "keypress" event on an element. - * @see {@link https://api.jquery.com/keypress/#keypress} - */ - keypress(): JQuery; - /** - * Bind an event handler to the "keypress" JavaScript event - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/keypress/#keypress-handler} - */ - keypress(handler: (eventObject: JQueryKeyEventObject) => any): JQuery; - /** - * Bind an event handler to the "keypress" JavaScript event - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/keypress/#keypress-eventData-handler} - */ - keypress(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery; - - /** - * Trigger the "keyup" event on an element. - * @see {@link https://api.jquery.com/keyup/#keyup} - */ - keyup(): JQuery; - /** - * Bind an event handler to the "keyup" JavaScript event - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/keyup/#keyup-handler} - */ - keyup(handler: (eventObject: JQueryKeyEventObject) => any): JQuery; - /** - * Bind an event handler to the "keyup" JavaScript event - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/keyup/#keyup-eventData-handler} - */ - keyup(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery; - - /** - * Bind an event handler to the "load" JavaScript event. - * - * @param handler A function to execute when the event is triggered. - * @see {@link https://api.jquery.com/load/} - */ - load(handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind an event handler to the "load" JavaScript event. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute when the event is triggered. - * @see {@link https://api.jquery.com/load/} - */ - load(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Trigger the "mousedown" event on an element. - * @see {@link https://api.jquery.com/mousedown/#mousedown} - */ - mousedown(): JQuery; - /** - * Bind an event handler to the "mousedown" JavaScript event. - * - * @param handler A function to execute when the event is triggered. - * @see {@link https://api.jquery.com/mousedown/#mousedown-handler} - */ - mousedown(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - /** - * Bind an event handler to the "mousedown" JavaScript event. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute when the event is triggered. - * @see {@link https://api.jquery.com/mousedown/#mousedown-eventData-handler} - */ - mousedown(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - - /** - * Trigger the "mouseenter" event on an element. - * @see {@link https://api.jquery.com/mouseenter/#mouseenter} - */ - mouseenter(): JQuery; - /** - * Bind an event handler to be fired when the mouse enters an element. - * - * @param handler A function to execute when the event is triggered. - * @see {@link https://api.jquery.com/mouseenter/#mouseenter-handler} - */ - mouseenter(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - /** - * Bind an event handler to be fired when the mouse enters an element. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute when the event is triggered. - * @see {@link https://api.jquery.com/mouseenter/#mouseenter-eventData-handler} - */ - mouseenter(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - - /** - * Trigger the "mouseleave" event on an element. - * @see {@link https://api.jquery.com/mouseleave/#mouseleave} - */ - mouseleave(): JQuery; - /** - * Bind an event handler to be fired when the mouse leaves an element. - * - * @param handler A function to execute when the event is triggered. - * @see {@link https://api.jquery.com/mouseleave/#mouseleave-handler} - */ - mouseleave(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - /** - * Bind an event handler to be fired when the mouse leaves an element. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute when the event is triggered. - * @see {@link https://api.jquery.com/mouseleave/#mouseleave-eventData-handler} - */ - mouseleave(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - - /** - * Trigger the "mousemove" event on an element. - * @see {@link https://api.jquery.com/mousemove/#mousemove} - */ - mousemove(): JQuery; - /** - * Bind an event handler to the "mousemove" JavaScript event. - * - * @param handler A function to execute when the event is triggered. - * @see {@link https://api.jquery.com/mousemove/#mousemove-handler} - */ - mousemove(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - /** - * Bind an event handler to the "mousemove" JavaScript event. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute when the event is triggered. - * @see {@link https://api.jquery.com/mousemove/#mousemove-eventData-handler} - */ - mousemove(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - - /** - * Trigger the "mouseout" event on an element. - * @see {@link https://api.jquery.com/mouseout/#mouseout} - */ - mouseout(): JQuery; - /** - * Bind an event handler to the "mouseout" JavaScript event. - * - * @param handler A function to execute when the event is triggered. - * @see {@link https://api.jquery.com/mouseout/#mouseout-handler} - */ - mouseout(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - /** - * Bind an event handler to the "mouseout" JavaScript event. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute when the event is triggered. - * @see {@link https://api.jquery.com/mouseout/#mouseout-eventData-handler} - */ - mouseout(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - - /** - * Trigger the "mouseover" event on an element. - * @see {@link https://api.jquery.com/mouseover/#mouseover} - */ - mouseover(): JQuery; - /** - * Bind an event handler to the "mouseover" JavaScript event. - * - * @param handler A function to execute when the event is triggered. - * @see {@link https://api.jquery.com/mouseover/#mouseover-handler} - */ - mouseover(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - /** - * Bind an event handler to the "mouseover" JavaScript event. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute when the event is triggered. - * @see {@link https://api.jquery.com/mouseover/#mouseover-eventData-handler} - */ - mouseover(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - - /** - * Trigger the "mouseup" event on an element. - * @see {@link https://api.jquery.com/mouseup/#mouseup} - */ - mouseup(): JQuery; - /** - * Bind an event handler to the "mouseup" JavaScript event. - * - * @param handler A function to execute when the event is triggered. - * @see {@link https://api.jquery.com/mouseup/#mouseup-handler} - */ - mouseup(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - /** - * Bind an event handler to the "mouseup" JavaScript event. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute when the event is triggered. - * @see {@link https://api.jquery.com/mouseup/#mouseup-eventData-handler} - */ - mouseup(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; - - /** - * Remove an event handler. - * @see {@link https://api.jquery.com/off/#off} - */ - off(): JQuery; - /** - * Remove an event handler. - * - * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin". - * @param selector A selector which should match the one originally passed to .on() when attaching event handlers. - * @param handler A handler function previously attached for the event(s), or the special value false. - * @see {@link https://api.jquery.com/off/#off-events-selector-handler} - */ - off(events: string, selector?: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Remove an event handler. - * - * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin". - * @param handler A handler function previously attached for the event(s), or the special value false. Takes handler with extra args that can be attached with on(). - * @see {@link https://api.jquery.com/off/#off-events-selector-handler} - */ - off(events: string, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; - /** - * Remove an event handler. - * - * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin". - * @param handler A handler function previously attached for the event(s), or the special value false. - * @see {@link https://api.jquery.com/off/#off-events-selector-handler} - */ - off(events: string, handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Remove an event handler. - * - * @param events An object where the string keys represent one or more space-separated event types and optional namespaces, and the values represent handler functions previously attached for the event(s). - * @param selector A selector which should match the one originally passed to .on() when attaching event handlers. - * @see {@link https://api.jquery.com/off/#off-events-selector} - */ - off(events: { [key: string]: any; }, selector?: string): JQuery; - - /** - * Attach an event handler function for one or more events to the selected elements. - * - * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. Rest parameter args is for optional parameters passed to jQuery.trigger(). Note that the actual parameters on the event handler function must be marked as optional (? syntax). - * @see {@link https://api.jquery.com/on/#on-events-selector-data-handler} - */ - on(events: string, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; - /** - * Attach an event handler function for one or more events to the selected elements. - * - * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @param data Data to be passed to the handler in event.data when an event is triggered. - * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. - * @see {@link https://api.jquery.com/on/#on-events-selector-data-handler} - */ - on(events: string, data : any, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; - /** - * Attach an event handler function for one or more events to the selected elements. - * - * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. - * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. - * @see {@link https://api.jquery.com/on/#on-events-selector-data-handler} - */ - on(events: string, selector: string, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; - /** - * Attach an event handler function for one or more events to the selected elements. - * - * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. - * @param data Data to be passed to the handler in event.data when an event is triggered. - * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. - * @see {@link https://api.jquery.com/on/#on-events-selector-data-handler} - */ - on(events: string, selector: string, data: any, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; - /** - * Attach an event handler function for one or more events to the selected elements. - * - * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). - * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element. - * @param data Data to be passed to the handler in event.data when an event occurs. - * @see {@link https://api.jquery.com/on/#on-events-selector-data} - */ - on(events: { [key: string]: any; }, selector?: string, data?: any): JQuery; - /** - * Attach an event handler function for one or more events to the selected elements. - * - * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). - * @param data Data to be passed to the handler in event.data when an event occurs. - * @see {@link https://api.jquery.com/on/#on-events-selector-data} - */ - on(events: { [key: string]: any; }, data?: any): JQuery; - - /** - * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. - * - * @param events A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names. - * @param handler A function to execute at the time the event is triggered. - * @see {@link https://api.jquery.com/one/#one-events-data-handler} - */ - one(events: string, handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. - * - * @param events A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names. - * @param data An object containing data that will be passed to the event handler. - * @param handler A function to execute at the time the event is triggered. - * @see {@link https://api.jquery.com/one/#one-events-data-handler} - */ - one(events: string, data: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. - * - * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. - * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. - * @see {@link https://api.jquery.com/one/#one-events-selector-data-handler} - */ - one(events: string, selector: string, handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. - * - * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. - * @param data Data to be passed to the handler in event.data when an event is triggered. - * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. - * @see {@link https://api.jquery.com/one/#one-events-selector-data-handler} - */ - one(events: string, selector: string, data: any, handler: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. - * - * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). - * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element. - * @param data Data to be passed to the handler in event.data when an event occurs. - * @see {@link https://api.jquery.com/one/#one-events-selector-data} - */ - one(events: { [key: string]: any; }, selector?: string, data?: any): JQuery; - - /** - * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. - * - * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). - * @param data Data to be passed to the handler in event.data when an event occurs. - * @see {@link https://api.jquery.com/one/#one-events-selector-data} - */ - one(events: { [key: string]: any; }, data?: any): JQuery; - - - /** - * Specify a function to execute when the DOM is fully loaded. - * - * @param handler A function to execute after the DOM is ready. - * @see {@link https://api.jquery.com/ready/} - */ - ready(handler: (jQueryAlias?: JQueryStatic) => any): JQuery; - - /** - * Trigger the "resize" event on an element. - * @see {@link https://api.jquery.com/resize/#resize} - */ - resize(): JQuery; - /** - * Bind an event handler to the "resize" JavaScript event. - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/resize/#resize-handler} - */ - resize(handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind an event handler to the "resize" JavaScript event. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/resize/#resize-eventData-handler} - */ - resize(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Trigger the "scroll" event on an element. - * @see {@link https://api.jquery.com/scroll/#scroll} - */ - scroll(): JQuery; - /** - * Bind an event handler to the "scroll" JavaScript event. - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/scroll/#scroll-handler} - */ - scroll(handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind an event handler to the "scroll" JavaScript event. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/scroll/#scroll-eventData-handler} - */ - scroll(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Trigger the "select" event on an element. - * @see {@link https://api.jquery.com/select/#select} - */ - select(): JQuery; - /** - * Bind an event handler to the "select" JavaScript event. - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/select/#select-handler} - */ - select(handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind an event handler to the "select" JavaScript event. - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/select/#select-eventData-handler} - */ - select(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Trigger the "submit" event on an element. - * @see {@link https://api.jquery.com/submit/#submit} - */ - submit(): JQuery; - /** - * Bind an event handler to the "submit" JavaScript event - * - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/submit/#submit-handler} - */ - submit(handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind an event handler to the "submit" JavaScript event - * - * @param eventData An object containing data that will be passed to the event handler. - * @param handler A function to execute each time the event is triggered. - * @see {@link https://api.jquery.com/submit/#submit-eventData-handler} - */ - submit(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Execute all handlers and behaviors attached to the matched elements for the given event type. - * - * @param eventType A string containing a JavaScript event type, such as click or submit. - * @param extraParameters Additional parameters to pass along to the event handler. - * @see {@link https://api.jquery.com/trigger/#trigger-eventType-extraParameters} - */ - trigger(eventType: string, extraParameters?: any[]|Object): JQuery; - /** - * Execute all handlers and behaviors attached to the matched elements for the given event type. - * - * @param event A jQuery.Event object. - * @param extraParameters Additional parameters to pass along to the event handler. - * @see {@link https://api.jquery.com/trigger/#trigger-event-extraParameters} - */ - trigger(event: JQueryEventObject, extraParameters?: any[]|Object): JQuery; - - /** - * Execute all handlers attached to an element for an event. - * - * @param eventType A string containing a JavaScript event type, such as click or submit. - * @param extraParameters An array of additional parameters to pass along to the event handler. - * @see {@link https://api.jquery.com/triggerHandler/#triggerHandler-eventType-extraParameters} - */ - triggerHandler(eventType: string, ...extraParameters: any[]): Object; - - /** - * Execute all handlers attached to an element for an event. - * - * @param event A jQuery.Event object. - * @param extraParameters An array of additional parameters to pass along to the event handler. - * @see {@link https://api.jquery.com/triggerHandler/#triggerHandler-event-extraParameters} - */ - triggerHandler(event: JQueryEventObject, ...extraParameters: any[]): Object; - - /** - * Remove a previously-attached event handler from the elements. - * - * @param eventType A string containing a JavaScript event type, such as click or submit. - * @param handler The function that is to be no longer executed. - * @see {@link https://api.jquery.com/unbind/#unbind-eventType-handler} - */ - unbind(eventType?: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Remove a previously-attached event handler from the elements. - * - * @param eventType A string containing a JavaScript event type, such as click or submit. - * @param fls Unbinds the corresponding 'return false' function that was bound using .bind( eventType, false ). - * @see {@link https://api.jquery.com/unbind/#unbind-eventType-false} - */ - unbind(eventType: string, fls: boolean): JQuery; - /** - * Remove a previously-attached event handler from the elements. - * - * @param evt A JavaScript event object as passed to an event handler. - * @see {@link https://api.jquery.com/unbind/#unbind-event} - */ - unbind(evt: any): JQuery; - - /** - * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. - * @see {@link https://api.jquery.com/undelegate/#undelegate} - */ - undelegate(): JQuery; - /** - * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. - * - * @param selector A selector which will be used to filter the event results. - * @param eventType A string containing a JavaScript event type, such as "click" or "keydown" - * @param handler A function to execute at the time the event is triggered. - * @see {@link https://api.jquery.com/undelegate/#undelegate-selector-eventType} - */ - undelegate(selector: string, eventType: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. - * - * @param selector A selector which will be used to filter the event results. - * @param events An object of one or more event types and previously bound functions to unbind from them. - * @see {@link https://api.jquery.com/undelegate/#undelegate-selector-events} - */ - undelegate(selector: string, events: Object): JQuery; - /** - * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. - * - * @param namespace A string containing a namespace to unbind all events from. - * @see {@link https://api.jquery.com/undelegate/#undelegate-namespace} - */ - undelegate(namespace: string): JQuery; - - /** - * Bind an event handler to the "unload" JavaScript event. (DEPRECATED from v1.8) - * - * @param handler A function to execute when the event is triggered. - * @see {@link https://api.jquery.com/unload/#unload-handler} - */ - unload(handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind an event handler to the "unload" JavaScript event. (DEPRECATED from v1.8) - * - * @param eventData A plain object of data that will be passed to the event handler. - * @param handler A function to execute when the event is triggered. - * @see {@link https://api.jquery.com/unload/#unload-eventData-handler} - */ - unload(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * The DOM node context originally passed to jQuery(); if none was passed then context will likely be the document. (DEPRECATED from v1.10) - * @see {@link https://api.jquery.com/context/} - */ - context: Element; - - jquery: string; - - /** - * Bind an event handler to the "error" JavaScript event. (DEPRECATED from v1.8) - * - * @param handler A function to execute when the event is triggered. - * @see {@link https://api.jquery.com/error/#error-handler} - */ - error(handler: (eventObject: JQueryEventObject) => any): JQuery; - /** - * Bind an event handler to the "error" JavaScript event. (DEPRECATED from v1.8) - * - * @param eventData A plain object of data that will be passed to the event handler. - * @param handler A function to execute when the event is triggered. - * @see {@link https://api.jquery.com/error/#error-eventData-handler} - */ - error(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; - - /** - * Add a collection of DOM elements onto the jQuery stack. - * - * @param elements An array of elements to push onto the stack and make into a new jQuery object. - * @see {@link https://api.jquery.com/pushStack/#pushStack-elements} - */ - pushStack(elements: any[]): JQuery; - /** - * Add a collection of DOM elements onto the jQuery stack. - * - * @param elements An array of elements to push onto the stack and make into a new jQuery object. - * @param name The name of a jQuery method that generated the array of elements. - * @param arguments The arguments that were passed in to the jQuery method (for serialization). - * @see {@link https://api.jquery.com/pushStack/#pushStack-elements-name-arguments} - */ - pushStack(elements: any[], name: string, arguments: any[]): JQuery; - - /** - * Insert content, specified by the parameter, after each element in the set of matched elements. - * - * @param content1 HTML string, DOM element, DocumentFragment, array of elements, or jQuery object to insert after each element in the set of matched elements. - * @param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert after each element in the set of matched elements. - * @see {@link https://api.jquery.com/after/#after-content-content} - */ - after(content1: JQuery|any[]|Element|DocumentFragment|Text|string, ...content2: any[]): JQuery; - /** - * Insert content, specified by the parameter, after each element in the set of matched elements. - * - * @param func A function that returns an HTML string, DOM element(s), or jQuery object to insert after each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. - * @see {@link https://api.jquery.com/after/#after-function} - */ - after(func: (index: number, html: string) => string|Element|JQuery): JQuery; - - /** - * Insert content, specified by the parameter, to the end of each element in the set of matched elements. - * - * @param content1 DOM element, DocumentFragment, array of elements, HTML string, or jQuery object to insert at the end of each element in the set of matched elements. - * @param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the end of each element in the set of matched elements. - * @see {@link https://api.jquery.com/append/#append-content-content} - */ - append(content1: JQuery|any[]|Element|DocumentFragment|Text|string, ...content2: any[]): JQuery; - /** - * Insert content, specified by the parameter, to the end of each element in the set of matched elements. - * - * @param func A function that returns an HTML string, DOM element(s), or jQuery object to insert at the end of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set. - * @see {@link https://api.jquery.com/append/#append-function} - */ - append(func: (index: number, html: string) => string|Element|JQuery): JQuery; - - /** - * Insert every element in the set of matched elements to the end of the target. - * - * @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements will be inserted at the end of the element(s) specified by this parameter. - * @see {@link https://api.jquery.com/appendTo/} - */ - appendTo(target: JQuery|any[]|Element|string): JQuery; - - /** - * Insert content, specified by the parameter, before each element in the set of matched elements. - * - * @param content1 HTML string, DOM element, DocumentFragment, array of elements, or jQuery object to insert before each element in the set of matched elements. - * @param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert before each element in the set of matched elements. - * @see {@link https://api.jquery.com/before/#before-content-content} - */ - before(content1: JQuery|any[]|Element|DocumentFragment|Text|string, ...content2: any[]): JQuery; - /** - * Insert content, specified by the parameter, before each element in the set of matched elements. - * - * @param func A function that returns an HTML string, DOM element(s), or jQuery object to insert before each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. - * @see {@link https://api.jquery.com/before/#before-function} - */ - before(func: (index: number, html: string) => string|Element|JQuery): JQuery; - - /** - * Create a deep copy of the set of matched elements. - * - * @param withDataAndEvents A Boolean indicating whether event handlers and data should be copied along with the elements. The default value is false. - * @param deepWithDataAndEvents A Boolean indicating whether event handlers and data for all children of the cloned element should be copied. By default its value matches the first argument's value (which defaults to false). - * @see {@link https://api.jquery.com/clone/} - */ - clone(withDataAndEvents?: boolean, deepWithDataAndEvents?: boolean): JQuery; - - /** - * Remove the set of matched elements from the DOM. - * - * @param selector A selector expression that filters the set of matched elements to be removed. - * @see {@link https://api.jquery.com/detach/} - */ - detach(selector?: string): JQuery; - - /** - * Remove all child nodes of the set of matched elements from the DOM. - * @see {@link https://api.jquery.com/empty/} - */ - empty(): JQuery; - - /** - * Insert every element in the set of matched elements after the target. - * - * @param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted after the element(s) specified by this parameter. - * @see {@link https://api.jquery.com/insertAfter/} - */ - insertAfter(target: JQuery|any[]|Element|Text|string): JQuery; - - /** - * Insert every element in the set of matched elements before the target. - * - * @param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted before the element(s) specified by this parameter. - * @see {@link https://api.jquery.com/insertBefore/} - */ - insertBefore(target: JQuery|any[]|Element|Text|string): JQuery; - - /** - * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. - * - * @param content1 DOM element, DocumentFragment, array of elements, HTML string, or jQuery object to insert at the beginning of each element in the set of matched elements. - * @param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the beginning of each element in the set of matched elements. - * @see {@link https://api.jquery.com/prepend/#prepend-content-content} - */ - prepend(content1: JQuery|any[]|Element|DocumentFragment|Text|string, ...content2: any[]): JQuery; - /** - * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. - * - * @param func A function that returns an HTML string, DOM element(s), or jQuery object to insert at the beginning of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set. - * @see {@link https://api.jquery.com/prepend/#prepend-function} - */ - prepend(func: (index: number, html: string) => string|Element|JQuery): JQuery; - - /** - * Insert every element in the set of matched elements to the beginning of the target. - * - * @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements will be inserted at the beginning of the element(s) specified by this parameter. - * @see {@link https://api.jquery.com/prependTo/} - */ - prependTo(target: JQuery|any[]|Element|string): JQuery; - - /** - * Remove the set of matched elements from the DOM. - * - * @param selector A selector expression that filters the set of matched elements to be removed. - * @see {@link https://api.jquery.com/remove/} - */ - remove(selector?: string): JQuery; - - /** - * Replace each target element with the set of matched elements. - * - * @param target A selector string, jQuery object, DOM element, or array of elements indicating which element(s) to replace. - * @see {@link https://api.jquery.com/replaceAll/} - */ - replaceAll(target: JQuery|any[]|Element|string): JQuery; - - /** - * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed. - * - * @param newContent The content to insert. May be an HTML string, DOM element, array of DOM elements, or jQuery object. - * @see {@link https://api.jquery.com/replaceWith/#replaceWith-newContent} - */ - replaceWith(newContent: JQuery|any[]|Element|Text|string): JQuery; - /** - * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed. - * - * @param func A function that returns content with which to replace the set of matched elements. - * @see {@link https://api.jquery.com/replaceWith/#replaceWith-function} - */ - replaceWith(func: () => Element|JQuery): JQuery; - - /** - * Get the combined text contents of each element in the set of matched elements, including their descendants. - * @see {@link https://api.jquery.com/text/#text} - */ - text(): string; - /** - * Set the content of each element in the set of matched elements to the specified text. - * - * @param text The text to set as the content of each matched element. When Number or Boolean is supplied, it will be converted to a String representation. - * @see {@link https://api.jquery.com/text/#text-text} - */ - text(text: string|number|boolean): JQuery; - /** - * Set the content of each element in the set of matched elements to the specified text. - * - * @param func A function returning the text content to set. Receives the index position of the element in the set and the old text value as arguments. - * @see {@link https://api.jquery.com/text/#text-function} - */ - text(func: (index: number, text: string) => string): JQuery; - - /** - * Retrieve all the elements contained in the jQuery set, as an array. - * @name toArray - * @see {@link https://api.jquery.com/toArray/} - */ - toArray(): HTMLElement[]; - - /** - * Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place. - * @see {@link https://api.jquery.com/unwrap/} - */ - unwrap(): JQuery; - - /** - * Wrap an HTML structure around each element in the set of matched elements. - * - * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements. - * @see {@link https://api.jquery.com/wrap/#wrap-wrappingElement} - */ - wrap(wrappingElement: JQuery|Element|string): JQuery; - /** - * Wrap an HTML structure around each element in the set of matched elements. - * - * @param func A callback function returning the HTML content or jQuery object to wrap around the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. - * @see {@link https://api.jquery.com/wrap/#wrap-function} - */ - wrap(func: (index: number) => string|JQuery): JQuery; - - /** - * Wrap an HTML structure around all elements in the set of matched elements. - * - * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements. - * @see {@link https://api.jquery.com/wrapAll/#wrapAll-wrappingElement} - */ - wrapAll(wrappingElement: JQuery|Element|string): JQuery; - /** - * Wrap an HTML structure around all elements in the set of matched elements. - * - * @param func A callback function returning the HTML content or jQuery object to wrap around all the matched elements. Within the function, this refers to the first element in the set. - * @see {@link https://api.jquery.com/wrapAll/#wrapAll-function} - */ - wrapAll(func: (index: number) => string): JQuery; - - /** - * Wrap an HTML structure around the content of each element in the set of matched elements. - * - * @param wrappingElement An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap around the content of the matched elements. - * @see {@link https://api.jquery.com/wrapInner/#wrapInner-wrappingElement} - */ - wrapInner(wrappingElement: JQuery|Element|string): JQuery; - /** - * Wrap an HTML structure around the content of each element in the set of matched elements. - * - * @param func A callback function which generates a structure to wrap around the content of the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. - * @see {@link https://api.jquery.com/wrapInner/#wrapInner-function} - */ - wrapInner(func: (index: number) => string): JQuery; - - /** - * Iterate over a jQuery object, executing a function for each matched element. - * - * @param func A function to execute for each matched element. - * @see {@link https://api.jquery.com/each/} - */ - each(func: (index: number, elem: Element) => any): JQuery; - - /** - * Retrieve one of the elements matched by the jQuery object. - * - * @param index A zero-based integer indicating which element to retrieve. - * @see {@link https://api.jquery.com/get/#get-index} - */ - get(index: number): HTMLElement; - /** - * Retrieve the elements matched by the jQuery object. - * @alias toArray - * @see {@link https://api.jquery.com/get/#get} - */ - get(): HTMLElement[]; - - /** - * Search for a given element from among the matched elements. - * @see {@link https://api.jquery.com/index/#index} - */ - index(): number; - /** - * Search for a given element from among the matched elements. - * - * @param selector A selector representing a jQuery collection in which to look for an element. - * @see {@link https://api.jquery.com/index/#index-selector} - */ - index(selector: string|JQuery|Element): number; - - /** - * The number of elements in the jQuery object. - * @see {@link https://api.jquery.com/length/} - */ - length: number; - /** - * A selector representing selector passed to jQuery(), if any, when creating the original set. - * version deprecated: 1.7, removed: 1.9 - * @see {@link https://api.jquery.com/selector/} - */ - selector: string; - [index: string]: any; - [index: number]: HTMLElement; - - /** - * Add elements to the set of matched elements. - * - * @param selector A string representing a selector expression to find additional elements to add to the set of matched elements. - * @param context The point in the document at which the selector should begin matching; similar to the context argument of the $(selector, context) method. - * @see {@link https://api.jquery.com/add/#add-selector} - */ - add(selector: string, context?: Element): JQuery; - /** - * Add elements to the set of matched elements. - * - * @param elements One or more elements to add to the set of matched elements. - * @see {@link https://api.jquery.com/add/#add-elements} - */ - add(...elements: Element[]): JQuery; - /** - * Add elements to the set of matched elements. - * - * @param html An HTML fragment to add to the set of matched elements. - * @see {@link https://api.jquery.com/add/#add-html} - */ - add(html: string): JQuery; - /** - * Add elements to the set of matched elements. - * - * @param obj An existing jQuery object to add to the set of matched elements. - * @see {@link https://api.jquery.com/add/#add-selection} - */ - add(obj: JQuery): JQuery; - - /** - * Get the children of each element in the set of matched elements, optionally filtered by a selector. - * - * @param selector A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/children/} - */ - children(selector?: string): JQuery; - - /** - * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. - * - * @param selector A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/closest/#closest-selector} - */ - closest(selector: string): JQuery; - /** - * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. - * - * @param selector A string containing a selector expression to match elements against. - * @param context A DOM element within which a matching element may be found. If no context is passed in then the context of the jQuery set will be used instead. - * @see {@link https://api.jquery.com/closest/#closest-selector-context} - */ - closest(selector: string, context?: Element): JQuery; - /** - * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. - * - * @param obj A jQuery object to match elements against. - * @see {@link https://api.jquery.com/closest/#closest-selection} - */ - closest(obj: JQuery): JQuery; - /** - * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. - * - * @param element An element to match elements against. - * @see {@link https://api.jquery.com/closest/#closest-element} - */ - closest(element: Element): JQuery; - - /** - * Get an array of all the elements and selectors matched against the current element up through the DOM tree. - * - * @param selectors An array or string containing a selector expression to match elements against (can also be a jQuery object). - * @param context A DOM element within which a matching element may be found. If no context is passed in then the context of the jQuery set will be used instead. - * @see {@link https://api.jquery.com/closest/#closest-selectors-context} - */ - closest(selectors: any, context?: Element): any[]; - - /** - * Get the children of each element in the set of matched elements, including text and comment nodes. - * @see {@link https://api.jquery.com/contents/} - */ - contents(): JQuery; - - /** - * End the most recent filtering operation in the current chain and return the set of matched elements to its previous state. - * @see {@link https://api.jquery.com/end/} - */ - end(): JQuery; - - /** - * Reduce the set of matched elements to the one at the specified index. - * - * @param index An integer indicating the 0-based position of the element. OR An integer indicating the position of the element, counting backwards from the last element in the set. - * @see {@link https://api.jquery.com/eq/} - */ - eq(index: number): JQuery; - - /** - * Reduce the set of matched elements to those that match the selector or pass the function's test. - * - * @param selector A string containing a selector expression to match the current set of elements against. - * @see {@link https://api.jquery.com/filter/#filter-selector} - */ - filter(selector: string): JQuery; - /** - * Reduce the set of matched elements to those that match the selector or pass the function's test. - * - * @param func A function used as a test for each element in the set. this is the current DOM element. - * @see {@link https://api.jquery.com/filter/#filter-function} - */ - filter(func: (index: number, element: Element) => any): JQuery; - /** - * Reduce the set of matched elements to those that match the selector or pass the function's test. - * - * @param element An element to match the current set of elements against. - * @see {@link https://api.jquery.com/filter/#filter-elements} - */ - filter(element: Element): JQuery; - /** - * Reduce the set of matched elements to those that match the selector or pass the function's test. - * - * @param obj An existing jQuery object to match the current set of elements against. - * @see {@link https://api.jquery.com/filter/#filter-selection} - */ - filter(obj: JQuery): JQuery; - - /** - * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. - * - * @param selector A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/find/#find-selector} - */ - find(selector: string): JQuery; - /** - * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. - * - * @param element An element to match elements against. - * @see {@link https://api.jquery.com/find/#find-element} - */ - find(element: Element): JQuery; - /** - * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. - * - * @param obj A jQuery object to match elements against. - * @see {@link https://api.jquery.com/find/#find-element} - */ - find(obj: JQuery): JQuery; - - /** - * Reduce the set of matched elements to the first in the set. - * @see {@link https://api.jquery.com/first/} - */ - first(): JQuery; - - /** - * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element. - * - * @param selector A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/has/#has-selector} - */ - has(selector: string): JQuery; - /** - * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element. - * - * @param contained A DOM element to match elements against. - * @see {@link https://api.jquery.com/has/#has-contained} - */ - has(contained: Element): JQuery; - - /** - * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. - * - * @param selector A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/is/#is-selector} - */ - is(selector: string): boolean; - /** - * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. - * - * @param func A function used as a test for the set of elements. It accepts one argument, index, which is the element's index in the jQuery collection.Within the function, this refers to the current DOM element. - * @see {@link https://api.jquery.com/is/#is-function} - */ - is(func: (index: number, element: Element) => boolean): boolean; - /** - * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. - * - * @param obj An existing jQuery object to match the current set of elements against. - * @see {@link https://api.jquery.com/is/#is-selection} - */ - is(obj: JQuery): boolean; - /** - * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. - * - * @param elements One or more elements to match the current set of elements against. - * @see {@link https://api.jquery.com/is/#is-elements} - */ - is(elements: any): boolean; - - /** - * Reduce the set of matched elements to the final one in the set. - * @see {@link https://api.jquery.com/last/} - */ - last(): JQuery; - - /** - * Pass each element in the current matched set through a function, producing a new jQuery object containing the return values. - * - * @param callback A function object that will be invoked for each element in the current set. - * @see {@link https://api.jquery.com/map/} - */ - map(callback: (index: number, domElement: Element) => any): JQuery; - - /** - * Get the immediately following sibling of each element in the set of matched elements. If a selector is provided, it retrieves the next sibling only if it matches that selector. - * - * @param selector A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/next/} - */ - next(selector?: string): JQuery; - - /** - * Get all following siblings of each element in the set of matched elements, optionally filtered by a selector. - * - * @param selector A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/nextAll/} - */ - nextAll(selector?: string): JQuery; - - /** - * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed. - * - * @param selector A string containing a selector expression to indicate where to stop matching following sibling elements. - * @param filter A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/nextUntil/#nextUntil-selector-filter} - */ - nextUntil(selector?: string, filter?: string): JQuery; - /** - * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed. - * - * @param element A DOM node or jQuery object indicating where to stop matching following sibling elements. - * @param filter A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/nextUntil/#nextUntil-element-filter} - */ - nextUntil(element?: Element, filter?: string): JQuery; - /** - * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed. - * - * @param obj A DOM node or jQuery object indicating where to stop matching following sibling elements. - * @param filter A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/nextUntil/#nextUntil-element-filter} - */ - nextUntil(obj?: JQuery, filter?: string): JQuery; - - /** - * Remove elements from the set of matched elements. - * - * @param selector A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/not/#not-selector} - */ - not(selector: string): JQuery; - /** - * Remove elements from the set of matched elements. - * - * @param func A function used as a test for each element in the set. this is the current DOM element. - * @see {@link https://api.jquery.com/not/#not-function} - */ - not(func: (index: number, element: Element) => boolean): JQuery; - /** - * Remove elements from the set of matched elements. - * - * @param elements One or more DOM elements to remove from the matched set. - * @see {@link https://api.jquery.com/not/#not-selection} - */ - not(elements: Element|Element[]): JQuery; - /** - * Remove elements from the set of matched elements. - * - * @param obj An existing jQuery object to match the current set of elements against. - * @see {@link https://api.jquery.com/not/#not-selection} - */ - not(obj: JQuery): JQuery; - - /** - * Get the closest ancestor element that is positioned. - * @see {@link https://api.jquery.com/offsetParent/} - */ - offsetParent(): JQuery; - - /** - * Get the parent of each element in the current set of matched elements, optionally filtered by a selector. - * - * @param selector A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/parent/} - */ - parent(selector?: string): JQuery; - - /** - * Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector. - * - * @param selector A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/parents/} - */ - parents(selector?: string): JQuery; - - /** - * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object. - * - * @param selector A string containing a selector expression to indicate where to stop matching ancestor elements. - * @param filter A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/parentsUntil/#parentsUntil-selector-filter} - */ - parentsUntil(selector?: string, filter?: string): JQuery; - /** - * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object. - * - * @param element A DOM node or jQuery object indicating where to stop matching ancestor elements. - * @param filter A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/parentsUntil/#parentsUntil-element-filter} - */ - parentsUntil(element?: Element, filter?: string): JQuery; - /** - * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object. - * - * @param obj A DOM node or jQuery object indicating where to stop matching ancestor elements. - * @param filter A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/parentsUntil/#parentsUntil-element-filter} - */ - parentsUntil(obj?: JQuery, filter?: string): JQuery; - - /** - * Get the immediately preceding sibling of each element in the set of matched elements, optionally filtered by a selector. - * - * @param selector A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/prev/} - */ - prev(selector?: string): JQuery; - - /** - * Get all preceding siblings of each element in the set of matched elements, optionally filtered by a selector. - * - * @param selector A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/prevAll/} - */ - prevAll(selector?: string): JQuery; - - /** - * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object. - * - * @param selector A string containing a selector expression to indicate where to stop matching preceding sibling elements. - * @param filter A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/prevUntil/#prevUntil-selector-filter} - */ - prevUntil(selector?: string, filter?: string): JQuery; - /** - * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object. - * - * @param element A DOM node or jQuery object indicating where to stop matching preceding sibling elements. - * @param filter A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/prevUntil/#prevUntil-element-filter} - */ - prevUntil(element?: Element, filter?: string): JQuery; - /** - * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object. - * - * @param obj A DOM node or jQuery object indicating where to stop matching preceding sibling elements. - * @param filter A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/prevUntil/#prevUntil-element-filter} - */ - prevUntil(obj?: JQuery, filter?: string): JQuery; - - /** - * Get the siblings of each element in the set of matched elements, optionally filtered by a selector. - * - * @param selector A string containing a selector expression to match elements against. - * @see {@link https://api.jquery.com/siblings/} - */ - siblings(selector?: string): JQuery; - - /** - * Reduce the set of matched elements to a subset specified by a range of indices. - * - * @param start An integer indicating the 0-based position at which the elements begin to be selected. If negative, it indicates an offset from the end of the set. - * @param end An integer indicating the 0-based position at which the elements stop being selected. If negative, it indicates an offset from the end of the set. If omitted, the range continues until the end of the set. - * @see {@link https://api.jquery.com/slice/} - */ - slice(start: number, end?: number): JQuery; - - /** - * Show the queue of functions to be executed on the matched elements. - * - * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. - * @see {@link https://api.jquery.com/queue/#queue-queueName} - */ - queue(queueName?: string): any[]; - /** - * Manipulate the queue of functions to be executed, once for each matched element. - * - * @param newQueue An array of functions to replace the current queue contents. - * @see {@link https://api.jquery.com/queue/#queue-queueName-newQueue} - */ - queue(newQueue: Function[]): JQuery; - /** - * Manipulate the queue of functions to be executed, once for each matched element. - * - * @param callback The new function to add to the queue, with a function to call that will dequeue the next item. - * @see {@link https://api.jquery.com/queue/#queue-queueName-callback} - */ - queue(callback: Function): JQuery; - /** - * Manipulate the queue of functions to be executed, once for each matched element. - * - * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. - * @param newQueue An array of functions to replace the current queue contents. - * @see {@link https://api.jquery.com/queue/#queue-queueName-newQueue} - */ - queue(queueName: string, newQueue: Function[]): JQuery; - /** - * Manipulate the queue of functions to be executed, once for each matched element. - * - * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. - * @param callback The new function to add to the queue, with a function to call that will dequeue the next item. - * @see {@link https://api.jquery.com/queue/#queue-queueName-callback} - */ - queue(queueName: string, callback: Function): JQuery; -} -declare module "jquery" { - export = $; -} -declare var jQuery: JQueryStatic; -declare var $: JQueryStatic; diff --git a/js-beautify/index.d.ts b/js-beautify/index.d.ts deleted file mode 100644 index ea67ddbad2..0000000000 --- a/js-beautify/index.d.ts +++ /dev/null @@ -1,74 +0,0 @@ -// Type definitions for js_beautify -// Project: https://github.com/beautify-web/js-beautify/ -// Definitions by: Josh Goldberg , Hans Windhoff -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -interface JsBeautifyOptions { - indent_size?: number; - indent_char?: string; - eol?: string; - indent_level?: number; - indent_with_tabs?: boolean; - preserve_newlines?: boolean; - max_preserve_newlines?: number; - jslint_happy?: boolean; - space_after_anon_function?: boolean; - brace_style?: 'collapse-preserve-inline'|'collapse'|'expand'|'end-expand'|'none'; - keep_array_indentation?: boolean; - keep_function_indentation?: boolean; - space_before_conditional?: boolean; - break_chained_methods?: boolean; - eval_code?: boolean; - unescape_strings?: boolean; - wrap_line_length?: number; - wrap_attributes?: 'auto'|'force' ; - wrap_attributes_indent_size?: number; - end_with_newline?: boolean; -} - -interface HTMLBeautifyOptions { - indent_size?: number; - indent_char?: string; - indent_with_tabs?: boolean; - eol?: string; - end_with_newline?: boolean; - preserve_newlines?: boolean; - max_preserve_newlines?: number; - indent_inner_html?: boolean; - brace_style?: 'collapse-preserve-inline'|'collapse'|'expand'|'end-expand'|'none'; - indent_scripts?: boolean; - wrap_line_length?: number; - wrap_attributes?: 'auto'|'force' ; - wrap_attributes_indent_size?: number; - unformatted?: string; - extra_liners?: string; -} - -interface CSSBeautifyOptions { - indent_size?: number; - indent_char?: string; - indent_with_tabs?: boolean; - eol?: string; - end_with_newline?: boolean; - selector_separator_newline?: boolean; - newline_between_rules?: boolean; -} - -interface jsb{ - (js_source_text: string, options?: JsBeautifyOptions) : string ; - js:(js_source_text: string, options?: JsBeautifyOptions) => string ; - beautify_js:(js_source_text: string, options?: JsBeautifyOptions) => string ; - - css:(js_source_text: string, options?: CSSBeautifyOptions) => string ; - css_beautify:(js_source_text: string, options?: CSSBeautifyOptions) => string ; - - html:(js_source_text: string, options?: HTMLBeautifyOptions) => string ; - html_beautify:(js_source_text: string, options?: HTMLBeautifyOptions) => string ; -} - -declare var js_beautify:jsb; -declare module "js-beautify" -{ - export = js_beautify; -} - diff --git a/js-data-http/index.d.ts b/js-data-http/index.d.ts deleted file mode 100644 index 2fa9c0e09a..0000000000 --- a/js-data-http/index.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -// Type definitions for JSData Http Adapter 1.2 -// Project: https://github.com/js-data/js-data-http 2.2 -// Definitions by: Stefan Steinhart -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -import * as JSData from 'js-data'; - -declare module 'js-data' { - - interface DSHttpAdapterOptions { - serialize?: (resourceName: string, data: any) => any; - deserialize?: (resourceName: string, data: any) => any; - queryTransform?: (resourceName: string, params: DSFilterParams) => any; - httpConfig?: any; - forceTrailingSlash?: boolean; - log?: boolean | ((message?: any, ...optionalParams: any[]) => void); - error?: boolean | ((message?: any, ...optionalParams: any[]) => void); - basePath?: string; - verbsUseBasePath?: string; - } - - interface DSHttpAdapterPromiseResolveType { - data: any; - headers: any; - status: number; - config: any; - } - - interface DSHttpAdapter extends IDSAdapter { - - new(options?: DSHttpAdapterOptions): DSHttpAdapter; - - defaults: DSHttpAdapterOptions; - http: any; - - // DSHttpAdapter uses axios so options are axios config objects. - HTTP(options?: Object): JSDataPromise; - DEL(url: string, data?: Object, options?: Object): JSDataPromise; - GET(url: string, data?: Object, options?: Object): JSDataPromise; - POST(url: string, data?: Object, options?: Object): JSDataPromise; - PUT(url: string, data?: Object, options?: Object): JSDataPromise; - } -} - -declare var DSHttpAdapter: JSData.DSHttpAdapter; -export = DSHttpAdapter; -export as namespace DSHttpAdapter; \ No newline at end of file diff --git a/js-data-http/tslint.json b/js-data-http/tslint.json deleted file mode 100644 index 394d3ce319..0000000000 --- a/js-data-http/tslint.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../tslint.json", - "rules": { - "forbidden-types": false, - "no-misused-new": false - } -} diff --git a/js-md5/index.d.ts b/js-md5/index.d.ts deleted file mode 100644 index 690279bbe4..0000000000 --- a/js-md5/index.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Type definitions for js-md5 0.4 -// Project: https://github.com/emn178/js-md5 -// Definitions by: Michael McCarthy -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped/ - -declare namespace md5 { - type message = string | any[] | Uint8Array | ArrayBuffer; - - interface Md5 { - array: () => number[]; - arrayBuffer: () => ArrayBuffer; - buffer: () => ArrayBuffer; - digest: () => number[]; - hex: () => string; - toString: () => string; - update: (message: message) => Md5; - } - - interface md5 { - (message: message): string; - hex: (message: message) => string; - array: (message: message) => number[]; - digest: (message: message) => number[]; - arrayBuffer: (message: message) => ArrayBuffer; - buffer: (message: message) => ArrayBuffer; - create: () => Md5; - update: (message: message) => Md5; - } -} - -declare const md5: md5.md5; -export = md5; diff --git a/js-md5/tslint.json b/js-md5/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/js-md5/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/js-quantities/index.d.ts b/js-quantities/index.d.ts deleted file mode 100644 index 5d4a8df304..0000000000 --- a/js-quantities/index.d.ts +++ /dev/null @@ -1,73 +0,0 @@ -// Type definitions for JS-quantities 1.6 -// Project: http://gentooboontoo.github.io/js-quantities/ -// Definitions by: William Rummler -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare const Qty: Qty.Type; - -declare interface Qty { - readonly numerator: string[]; - readonly denominator: string[]; - readonly scalar: number; - readonly baseScalar: number; - readonly initValue: string; - units(): string; - isCompatible(value: Qty.UnitSource): boolean; - kind(): string; - isUnitless(): boolean; - isBase(): boolean; - toBase(): Qty; - toFloat(): number; - to(value: Qty.UnitSource): Qty; - inverse(): Qty; - eq(value: Qty.UnitSource): boolean; - same(value: Qty.UnitSource): boolean; - lt(value: Qty.UnitSource): boolean; - lte(value: Qty.UnitSource): boolean; - gt(value: Qty.UnitSource): boolean; - gte(value: Qty.UnitSource): boolean; - compareTo(value: Qty): Qty.ComparisonResult; - add(value: Qty.Source): Qty; - sub(value: Qty.Source): Qty; - mul(value: Qty.Source): Qty; - div(value: Qty.Source): Qty; - toPrec(value: Qty.Source): Qty; - toString(valueOrPrecision?: Qty.Source): string; - toString(value: string, precision: number): string; - format(formatter?: Qty.Formatter): string; - format(value: string, formatter?: Qty.Formatter): string; -} - -declare namespace Qty { - - interface Type { - (value: Source): Qty; - (value: number, unit: string): Qty; - new (value: Source): Qty; - new (value: number, unit: string): Qty; - parse(value: string): Qty; - getKinds(): string[]; - getUnits(kind?: string): string[]; - getAliases(unit: string): string[]; - swiftConverter(sourceUnit: string, targetUnit: string): Converter; - formatter: Formatter; - readonly Error: any; - mulSafe(n1: number, n2: number): number; - divSafe(n1: number, n2: number): number; - } - - interface Converter { - (sourceValue: number): number; - (sourceValues: number[]): number[]; - } - - type Formatter = (scalar: number, unit: string) => string; - - type ComparisonResult = -1 | 0 | 1; - - type Source = UnitSource | number; - - type UnitSource = Qty | string; -} - -export default Qty; diff --git a/js-quantities/tslint.json b/js-quantities/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/js-quantities/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/js-yaml/index.d.ts b/js-yaml/index.d.ts deleted file mode 100644 index b4a5d36bae..0000000000 --- a/js-yaml/index.d.ts +++ /dev/null @@ -1,92 +0,0 @@ -// Type definitions for js-yaml 3.5.2 -// Project: https://github.com/nodeca/js-yaml -// Definitions by: Bart van der Schoor , Sebastian Clausen -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare namespace jsyaml { - export function safeLoad(str: string, opts?: LoadOptions): any; - export function load(str: string, opts?: LoadOptions): any; - - export class Type implements TypeConstructorOptions { - constructor(tag: string, opts?: TypeConstructorOptions); - tag: string; - } - export class Schema { - constructor(definition: SchemaDefinition); - public static create(args: any[]): Schema; - } - - export function safeLoadAll(str: string, iterator: (doc: any) => void, opts?: LoadOptions): any; - export function loadAll(str: string, iterator: (doc: any) => void, opts?: LoadOptions): any; - - export function safeDump(obj: any, opts?: DumpOptions): string; - export function dump(obj: any, opts?: DumpOptions): string; - - export interface LoadOptions { - // string to be used as a file path in error/warning messages. - filename?: string; - // makes the loader to throw errors instead of warnings. - strict?: boolean; - // specifies a schema to use. - schema?: any; - } - - export interface DumpOptions { - // indentation width to use (in spaces). - indent?: number; - // do not throw on invalid types (like function in the safe schema) and skip pairs and single values with such types. - skipInvalid?: boolean; - // specifies level of nesting, when to switch from block to flow style for collections. -1 means block style everwhere - flowLevel?: number; - // Each tag may have own set of styles. - "tag" => "style" map. - styles?: Object; - // specifies a schema to use. - schema?: any; - // if true, sort keys when dumping YAML. If a function, use the function to sort the keys. (default: false) - sortKeys?: boolean; - // set max line width. (default: 80) - lineWidth?: number; - // if true, don't convert duplicate objects into references (default: false) - noRefs?: boolean; - // if true don't try to be compatible with older yaml versions. Currently: don't quote "yes", "no" and so on, as required for YAML 1.1 (default: false) - noCompatMode?: boolean; - } - - export interface TypeConstructorOptions { - kind?: string; - resolve?: Function; - construct?: Function; - instanceOf?: Object; - predicate?: string; - represent?: Function; - defaultStyle?: string; - styleAliases?: Object; - } - - export interface SchemaDefinition { - implicit?: any[]; - explicit?: any[]; - include?: any[]; - } - - // only strings, arrays and plain objects: http://www.yaml.org/spec/1.2/spec.html#id2802346 - export var FAILSAFE_SCHEMA: any; - // only strings, arrays and plain objects: http://www.yaml.org/spec/1.2/spec.html#id2802346 - export var JSON_SCHEMA: any; - // same as JSON_SCHEMA: http://www.yaml.org/spec/1.2/spec.html#id2804923 - export var CORE_SCHEMA: any; - // all supported YAML types, without unsafe ones (!!js/undefined, !!js/regexp and !!js/function): http://yaml.org/type/ - export var DEFAULT_SAFE_SCHEMA: any; - // all supported YAML types. - export var DEFAULT_FULL_SCHEMA: any; - export var MINIMAL_SCHEMA: any; - export var SAFE_SCHEMA: any; - - export class YAMLException extends Error { - constructor(reason?: any, mark?: any); - toString(compact?: boolean): string; - } -} - -export = jsyaml; -export as namespace jsyaml; diff --git a/jsnlog/index.d.ts b/jsnlog/index.d.ts deleted file mode 100644 index e252d5cf36..0000000000 --- a/jsnlog/index.d.ts +++ /dev/null @@ -1,116 +0,0 @@ -// Type definitions for JSNLog 2.17 -// Project: https://github.com/mperdeck/jsnlog.js -// Definitions by: Mattijs Perdeck -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -// ------------------------------- -// Full documentation is at -// http://jsnlog.com -// ------------------------------- - -/** -* Copyright 2016 Mattijs Perdeck. -* -* This project is licensed under the MIT license. -* -* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -// Declarations of all interfaces and ambient objects, except for JL itself. -// Provides strong typing in both jsnlog.ts itself and in TypeScript programs that use -// JSNLog. - -declare namespace JL { - - interface JSNLogOptions { - enabled?: boolean; - maxMessages?: number; - defaultAjaxUrl?: string; - clientIP?: string; - requestId?: string; - defaultBeforeSend?: (xhr: XMLHttpRequest) => void; - serialize?: (obj: any) => string; - } - - interface JSNLogFilterOptions { - level?: number; - ipRegex?: string; - userAgentRegex?: string; - disallow?: string; - } - - interface JSNLogLoggerOptions extends JSNLogFilterOptions { - appenders?: JSNLogAppender[]; - onceOnly?: string[]; - } - - // Base for all appender options types - interface JSNLogAppenderOptions extends JSNLogFilterOptions { - sendWithBufferLevel?: number; - storeInBufferLevel?: number; - bufferSize?: number; - batchSize?: number; - } - - interface JSNLogAjaxAppenderOptions extends JSNLogAppenderOptions { - url?: string; - beforeSend?: (xhr: XMLHttpRequest) => void; - } - - interface JSNLogLogger { - setOptions(options: JSNLogLoggerOptions): JSNLogLogger; - - trace(logObject: any): JSNLogLogger; - debug(logObject: any): JSNLogLogger; - info(logObject: any): JSNLogLogger; - warn(logObject: any): JSNLogLogger; - error(logObject: any): JSNLogLogger; - fatal(logObject: any): JSNLogLogger; - fatalException(logObject: any, e: any): JSNLogLogger; - log(level: number, logObject: any, e?: any): JSNLogLogger; - } - - interface JSNLogAppender { - setOptions(options: JSNLogAppenderOptions): JSNLogAppender; - } - - interface JSNLogAjaxAppender extends JSNLogAppender { - setOptions(options: JSNLogAjaxAppenderOptions): JSNLogAjaxAppender; - } - - interface JSNLogConsoleAppender extends JSNLogAppender { - } -} - -declare function __jsnlog_configure(jsnlog: any): void; - - -// Ambient declaration of the JL function itself -declare function JL(loggerName?: string): JL.JSNLogLogger; - -// Definitions that need to be kept out of the main namespace definition, -// because otherwise during compilation of jsnlog.ts it complains that you can't -// overload ambient declarations with non-ambient declarations. - -declare namespace JL { - export function setOptions(options: JSNLogOptions): void; - export function createAjaxAppender(appenderName: string): JSNLogAjaxAppender; - export function createConsoleAppender(appenderName: string): JSNLogConsoleAppender; - - export class Exception { - constructor(data: any, inner?: any); - } - - export function getOffLevel(): number; - export function getTraceLevel(): number; - export function getDebugLevel(): number; - export function getInfoLevel(): number; - export function getWarnLevel(): number; - export function getErrorLevel(): number; - export function getFatalLevel(): number; - export function getAllLevel(): number; -} diff --git a/jsnlog/jsnlog-tests.ts b/jsnlog/jsnlog-tests.ts deleted file mode 100644 index c988234394..0000000000 --- a/jsnlog/jsnlog-tests.ts +++ /dev/null @@ -1,88 +0,0 @@ - - -// ---------------------------------------------------------- -// JL - -var offLevel: number = JL.getOffLevel(); -var traceLevel: number = JL.getTraceLevel(); -var debugLevel: number = JL.getDebugLevel(); -var infoLevel: number = JL.getInfoLevel(); -var warnLevel: number = JL.getWarnLevel(); -var errorLevel: number = JL.getErrorLevel(); -var fatalLevel: number = JL.getFatalLevel(); -var allLevel: number = JL.getAllLevel(); - -JL.setOptions({ - enabled: true, - maxMessages: 5, - defaultAjaxUrl: '/jsnlog.logger', - clientIP: '0.0.0.0', - requestId: 'a reuest id', - defaultBeforeSend: null, - serialize: (obj) => JSON.stringify(obj) -}); - -// ---------------------------------------------------------- -// Exception - -var e = new JL.Exception("i is too small!"); - -// ---------------------------------------------------------- -// Ajax Appender - -var ajaxAppender1: JL.JSNLogAjaxAppender = JL.createAjaxAppender('ajaxAppender'); - -ajaxAppender1.setOptions({ - level: 5000, - ipRegex: 'a regex', - userAgentRegex: 'a user agent string', - disallow: 'regex matching suppressed messages', - sendWithBufferLevel: 5000, - storeInBufferLevel: 2000, - bufferSize: 10, - batchSize: 2, - url: '/jsnlog.logger', - beforeSend: null -}); - -// ---------------------------------------------------------- -// Console Appender - -var consoleAppender1: JL.JSNLogConsoleAppender = JL.createConsoleAppender('consoleAppender'); - -consoleAppender1.setOptions({ - level: 5000, - ipRegex: 'a regex', - userAgentRegex: 'a user agent string', - disallow: 'regex matching suppressed messages', - sendWithBufferLevel: 5000, - storeInBufferLevel: 2000, - bufferSize: 10, - batchSize: 2 -}); - - -// ---------------------------------------------------------- -// Loggers - -var logger1: JL.JSNLogLogger = JL('mylogger'); - -var exception = {}; - -logger1.trace('log message').debug({ x: 1, y: 2}); -logger1.info(() => 5); -logger1.warn('log message'); -logger1.error('log message'); -logger1.fatal('log message'); -logger1.fatalException('log message', exception); -logger1.log(4000, 'log message', exception); - -logger1.setOptions({ - level: 5000, - ipRegex: 'a regex', - userAgentRegex: 'a user agent string', - disallow: 'regex matching suppressed messages', - appenders: [ ajaxAppender1, consoleAppender1 ], - onceOnly: [ 'regex1', 'regex2' ] -}); - diff --git a/jsnlog/tsconfig.json b/jsnlog/tsconfig.json deleted file mode 100644 index c42c9adc71..0000000000 --- a/jsnlog/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "jsnlog-tests.ts" - ] -} \ No newline at end of file diff --git a/jsnlog/tslint.json b/jsnlog/tslint.json deleted file mode 100644 index 1b7fef4ac6..0000000000 --- a/jsnlog/tslint.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../tslint.json", - "rules": { - "max-line-length": false, - "no-empty-interface": false - } -} diff --git a/json-patch/index.d.ts b/json-patch/index.d.ts deleted file mode 100644 index bb70cff6c6..0000000000 --- a/json-patch/index.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -// Type definitions for json-patch -// Project: https://github.com/bruth/jsonpatch-js -// Definitions by: vvakame -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare namespace jsonpatch { - type OpPatch = AddPath | RemovePath | ReplacePath | MovePath | CopyPath | TestPath; - interface Patch { - op: string; - } - interface AddPath extends Patch { - path: string; - value: any; - } - interface RemovePath extends Patch { - path: string; - } - interface ReplacePath extends Patch { - path: string; - value: any; - } - interface MovePath extends Patch { - from: string; - path: string; - } - interface CopyPath extends Patch { - from: string; - path: string; - } - interface TestPath extends Patch { - path: string; - value: any; - } - - function apply(document: any, patches: OpPatch[]): any; - function compile(patches: OpPatch[]): (document: any) => any; -} - -export = jsonpatch; -export as namespace jsonpatch; diff --git a/json-patch/json-patch-tests.ts b/json-patch/json-patch-tests.ts deleted file mode 100644 index 3c3ff51f22..0000000000 --- a/json-patch/json-patch-tests.ts +++ /dev/null @@ -1,34 +0,0 @@ -import jsonpatch = require("json-patch"); -import jp = require("json-patch"); - -// Add property, result: {foo: 'bar'} -jsonpatch.apply({}, [{ op: 'add', path: '/foo', value: 'bar' }]); -// Add array element, result: {foo: [1, 2, 3]} -jsonpatch.apply({ foo: [1, 3] }, [{ op: 'add', path: '/foo/1', value: 2 }]); -// Complex, result: {foo: [{bar: 'baz'}]} -jsonpatch.apply({ foo: [{}] }, [{ op: 'add', path: '/foo/0/bar', value: 'baz' }]); - -// Remove property, result: {} -jsonpatch.apply({ foo: 'bar' }, [{ op: 'remove', path: '/foo' }]); -// Remove array element, result: {foo: [1, 3]} -jsonpatch.apply({ foo: [1, 2, 3] }, [{ op: 'remove', path: '/foo/1' }]); -// Complex, result: {foo: [{}]} -jsonpatch.apply({ foo: [{ bar: 'baz' }] }, [{ op: 'remove', path: '/foo/0/bar' }]); - -// Replace property, result: {foo: 1} -jsonpatch.apply({ foo: 'bar' }, [{ op: 'replace', path: '/foo', value: 1 }]); -// Repalce array element, result: {foo: [1, 4, 3]} -jsonpatch.apply({ foo: [1, 2, 3] }, [{ op: 'replace', path: '/foo/1', value: 4 }]); -// Complex, result: {foo: [{bar: 1}]} -jsonpatch.apply({ foo: [{ bar: 'baz' }] }, [{ op: 'replace', path: '/foo/0/bar', value: 1 }]); - -// Move property, result {bar: [1, 2, 3]} -jsonpatch.apply({ foo: [1, 2, 3] }, [{ op: 'move', from: '/foo', path: '/bar' }]); -// Copy property, result {foo: [1, 2, 3], bar: 2} -jsonpatch.apply({ foo: [1, 2, 3] }, [{ op: 'copy', from: '/foo/1', path: '/bar' }]); -// Test equality of property to value, result: true -jsonpatch.apply({ foo: 'bar' }, [{ op: 'test', path: '/foo', value: 'bar' }]); - -jsonpatch.compile([{ op: 'test', path: '/foo', value: 'bar' }])({ foo: 'bar' }); - -jp.apply({}, [{ op: 'add', path: '/foo', value: 'bar' }]); diff --git a/json-stable-stringify/index.d.ts b/json-stable-stringify/index.d.ts deleted file mode 100644 index 3339d8f28e..0000000000 --- a/json-stable-stringify/index.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -// Type definitions for json-stable-stringify 1.0 -// Project: https://github.com/substack/json-stable-stringify -// Definitions by: Matt Frantz -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - - - -declare function stringify(obj: any, opts?: stringify.Comparator | stringify.Options): string; - -declare namespace stringify { - - interface Element { - key: string; - value: any; - } - - type Comparator = (a: Element, b: Element) => number; - - type Replacer = (key: string, value: any) => any; - - interface Options { - cmp?: Comparator; - space?: number | string; - replacer?: Replacer; - } -} - -export = stringify; diff --git a/json-stable-stringify/json-stable-stringify-tests.ts b/json-stable-stringify/json-stable-stringify-tests.ts deleted file mode 100644 index 761d01d06a..0000000000 --- a/json-stable-stringify/json-stable-stringify-tests.ts +++ /dev/null @@ -1,47 +0,0 @@ -import stringify = require('json-stable-stringify'); - -var obj = { c: 8, b: [{z: 6, y: 5, x: 4}, 7], a: 3 }; - -{ - console.log(stringify(obj)); -} - -{ - // Second arg can be a stringify.Comparator function. - var s: string = stringify(obj, (a: stringify.Element, b: stringify.Element): number => a.key < b.key ? 1 : -1); - console.log(s); -} - -{ - // Can specify Comparator in an Options object. - function reverse(a: stringify.Element, b: stringify.Element): number { - return a.value < b.value ? 1 : -1; - } - var opts: stringify.Options = { cmp: reverse }; - var s: string = stringify(obj, opts); - console.log(s); -} - -{ - // Space can be a string. - var s: string = stringify(obj, { space: ' ' }); - console.log(s); -} - -{ - // Space can be an integer. - var s: string = stringify(obj, { space: 2 }); - console.log(s); -} - -{ - // The replacer option can remove or modify values. - function removeStrings(key: string, value: any): any { - if (typeof value === "string") { - return undefined; - } - return value; - } - var s: string = stringify(obj, { replacer: removeStrings }); - console.log(s); -} diff --git a/json-stable-stringify/tslint.json b/json-stable-stringify/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/json-stable-stringify/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/jsonrpc-serializer/tslint.json b/jsonrpc-serializer/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/jsonrpc-serializer/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/jui-core/index.d.ts b/jui-core/index.d.ts deleted file mode 100644 index 0f1184c0a3..0000000000 --- a/jui-core/index.d.ts +++ /dev/null @@ -1,824 +0,0 @@ -// Type definitions for jui-core 2.0 -// Project: https://github.com/juijs/jui-core -// Definitions by: JinHo Park -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -declare var jui: JuiStatic; - -interface UtilBase { - /** - * @property browser check browser agent - * @property {Boolean} browser.webkit Webkit 브라우저 체크 - * @property {Boolean} browser.mozilla Mozilla 브라우저 체크 - * @property {Boolean} browser.msie IE 브라우저 체크 */ - browser: { - webkit: boolean, - mozilla: boolean, - msie: boolean - }; - - /** - * @property {Boolean} isTouch - * check touch device - */ - isTouch: boolean; - - /** - * @method inherit - * - * 프로토타입 기반의 상속 제공 - * - * @param {Function} ctor base Class - * @param {Function} superCtor super Class - */ - inherit( ctor: ((...args: any[]) => any), superCtor: ((...args: any[]) => any) ): void; - - /** - * @method extend - * - * implements object extend - * - * @param {Object|Function} origin - * @param {Object|Function} add - * @param {Boolean} skip - * @return {Object} - */ - extend(origin: any, add: any, skip: boolean): any; - - /** - * convert px to integer - * @param {String or Number} px - * @return {Number} - */ - pxToInt(px: string| number): number; - - /** - * @method clone - * implements object clone - * @param {Array/Object} obj 복사할 객체 - * @return {Array} - */ - clone(obj: any): any[]; - - /** - * @method deepClone - * implements object deep clone - * @param obj - * @param emit - * @return {*} - */ - deepClone(obj: any, emit: any): any[]; - - /** - * @method sort - * use QuickSort - * @param {Array} array - * @return {QuickSort} - */ - sort(array: any[]): UtilQuickSort; - - /** - * @method runtime - * - * caculate callback runtime - * - * @param {String} name - * @param {Function} callback - */ - runtime(name: string, callback: ((...args: any[]) => void)): void; - - /** - * @method template - * parsing template string - * @param html - * @param obj - */ - template(html: string, obj?: any): ((obj: any) => string) | string; - - /** - * @method resize - * add event in window resize event - * @param {Function} callback - * @param {Number} ms delay time - */ - resize(callback: ((...args: any[]) => void), ms: number): void; - - /** - * @method index - * - * IndexParser 객체 생성 - * - * @return {KeyParser} - */ - index(): UtilKeyParser; - - /** - * @method chunk - * split array by length - * @param {Array} arr - * @param {Number} len - * @return {Array} - */ - chunk(arr: any[], len: number): any[]; - - /** - * @method typeCheck - * check data type - * @param {String} t type string - * @param {Object} v value object - * @return {Boolean} - */ - typeCheck(typeName: string, value: any): boolean; - - - typeCheckObj(uiObj: any, list: any): void; - - /** - * @method dataToCsv - * - * data 를 csv 로 변환한다. - * - * @param {Array} keys - * @param {Array} dataList - * @param {Number} dataSize - * @return {String} 변환된 csv 문자열 - */ - dataToCsv(keys: string[] , dataList: any[], dataSize: number): string; - - /** - * @method dataToCsv2 - * - * @param {Object} options - * @return {String} - */ - dataToCsv2(options: any): string; - - /** - * @method fileToCsv - * - * file 에서 csv 컨텐츠 로드 - * - * @param {File} file - * @param {Function} callback - */ - fileToCsv(fileText: string, callback: ((data: any) => void)): void; - - /** - * @method csvToBase64 - * - * csv 다운로드 링크로 변환 - * - * @param {String} csv - * @return {String} data uri string - */ - csvToBase64(csv: string): string; - - /** - * @method csvToData - * - * @param {Array} keys - * @param {String} csv - * @param {Number} csvNumber - * @return {Array} - */ - csvToData(keys: string[], csv: string, csvNumber: number): any[]; - - /** - * @method getCsvFields - * - * csv 에서 필드 얻어오기 - * - * @param {Array} fields - * @param {Array} csvFields - * @return {Array} - */ - getCsvFields(fields: string[], csvFields: string[]): string[]; - - /** - * @method svgToBase64 - * - * xml 문자열로 svg datauri 생성 - * - * @param {String} xml - * @return {String} 변환된 data uri 링크 - */ - svgToBase64(xml: string): string; - - /** - * @method dateFormat - * - * implements date format function - * - * yyyy : 4 digits year - * yy : 2 digits year - * y : 1 digit year - * - * @param {Date} date - * @param {String} format date format string - * @param {Boolean} utc - * @return {string} - */ - dateFormat(date: Date, format: string, utc?: boolean): string; - - /** - * @method createId - * - * 유니크 아이디 생성 - * - * @param {String} key prefix string - * @return {String} 생성된 아이디 문자열 - */ - createId(key: string): string; - - /** - * @method btoa - * - * Base64 인코딩 - * - * @return {String} - */ - btoa(input: any): string; - - /** - * @method atob - * - * Base64 디코딩 - * - * @return {Any} - */ - atob(input: string): any; - - /** - * implement async loop without blocking ui - * - * @param {Number} total loop count - * @param {Object} context - * @returns {Function} - */ - timeLoop(total: number, context?: any): ((index: number) => void); - - /** - * @method loop - * - * 최적화된 루프 생성 (5단계로 나눔) - * - * @param {Number} total loop count - * @param {Object} [context=null] - * @return {Function} 최적화된 루프 콜백 (index, groupIndex 2가지 파라미터를 받는다.) - */ - loop(total: number, context?: any): ((index: number, groupIndex: number) => void ); - - /** - * @method loopArray - * - * 배열을 사용해서 최적화된 루프로 생성한다. - * - * - * @param {Array} data 루프로 생성될 배열 - * @param {Object} [context=null] - * @return {Function} 최적화된 루프 콜백 (data, index, groupIndex 3가지 파라미터를 받는다.) - */ - loopArray(data: any[], context?: any): ((data: any, index: number, groupIndex: number) => void ); - - /** - * @method makeIndex - * - * 배열의 키 기반 인덱스를 생성한다. - * - * 개별 값 별로 멀티 인덱스를 생성한다. - * - * @param {Array} data - * @param {String} keyField - * @return {Object} 생성된 인덱스 - */ - makeIndex(data: any[], keyField: string): any; - - /** - * @method startsWith - * Check that it matches the starting string search string. - * - * @param {String} string - * @param {String} searchString - * @param {Number} [position=0] - * @return {Number} position - */ - startsWith(str: string, searchString: string, position?: number): number; - - /** - * @method endsWith - * Check that it matches the end of a string search string. - * - * @param {String} string - * @param {String} searchString - * @return {Number} position - */ - endsWith(str: string, searchString: string, position?: number): number; - - inArray(target: any, list: any[]): number; - - - trim(text: string): string; - - ready: ((...args: any[]) => void); - - param(data: any): string; - - ajax(data: any): void; - - scrollWidth(): number; -} - -interface JuiStatic { - /** - * @method ready - * - * ready 타임에 실행될 callback 정의 - * - * @param {Function} callback - */ - ready(depends?: string[], callback?: (...args: any[]) => void): void; - - /** - * @method defineUI - * - * 사용자가 실제로 사용할 수 있는 UI 클래스를 정의 - * - * @param {String} name 모듈 로드와 상속에 사용될 이름을 정한다. - * @param {Array} depends 'define'이나 'defineUI'로 정의된 클래스나 객체를 인자로 받을 수 있다. - * @param {Function} callback UI 클래스를 해당 콜백 함수 내에서 클래스 형태로 구현하고 리턴해야 한다. - */ - defineUI(name: string, depends: string[], callback: () => void, parent?: string): void; - - /** - * @method define - * - * UI 클래스에서 사용될 클래스를 정의하고, 자유롭게 상속할 수 있는 클래스를 정의 - * - * @param {String} name 모듈 로드와 상속에 사용될 이름을 정한다. - * @param {Array} depends 'define'이나 'defineUI'로 정의된 클래스나 객체를 인자로 받을 수 있다. - * @param {Function} callback UI 클래스를 해당 콜백 함수 내에서 클래스 형태로 구현하고 리턴해야 한다. - * @param {String} parent 상속받을 클래스 - */ - define(name: string, depends: string[], callback: () => void, parent?: string): void; - - /** - * @method redefine - * - * UI 클래스에서 사용될 클래스를 정의하고, 자유롭게 상속할 수 있는 클래스를 정의 - * - * @param {String} name 모듈 로드와 상속에 사용될 이름을 정한다. - * @param {Array} depends 'define'이나 'defineUI'로 정의된 클래스나 객체를 인자로 받을 수 있다. - * @param {Function} callback UI 클래스를 해당 콜백 함수 내에서 클래스 형태로 구현하고 리턴해야 한다. - * @param {String} parent 상속받을 클래스 - */ - redefine(name: string, depends: string[], callback: () => void, parent?: string): void; - - /** - * define과 defineUI로 정의된 클래스 또는 객체를 가져온다. - * - * @param name 가져온 클래스 또는 객체의 이름 - * @return {*} - */ - include(name: string): any; - - /** - * define과 defineUI로 정의된 모든 클래스와 객체를 가져온다. - * - * @return {Array} - */ - includeAll(): any[]; - - /** - * @method add - * Adds a component object created - * - * @param {Object} ui UI instance - */ - add(uiIns: any): void; - - - /** - * @method emit - * Generates a custom event to an applicable component - * - * @param {String} key Selector or UI type - * @param {String} type Event type - * @param {Array} args Event arguments - */ - emit(key: string, type: string, args: any[]): void; - - /** - * @method get - * Gets a component currently created - * - * @param {Integer/String} key - * @returns {Object/Array} UI instance - */ - get(key: number|string): any; - - /** - * @method getAll - * Gets all components currently created - * - * @return {Array} UI instances - */ - getAll(): any[]; - - /** - * @method create - * It is possible to create a component dynamically after the ready point - * - * @param {String} type UI type - * @param {String/DOMElement} selector - * @param {Object} options - * @return {Object} - */ - create(type: string, selector: any, options?: {}): any; -} - -interface UICollection { - destroy(): void; -} - -interface UICore { - - tpl?: any; - - event?: any; - - root?: any; - - /** - * @method emit - * Generates a custom event. The first parameter is the type of a custom event. A function defined as an option or on method is called - * - * @param {String} type Event type - * @param {Function} args Event Arguments - * @return {Mixed} - */ - emit(type: string, args: () => void): any; - - /** - * @method on - * A callback function defined as an on method is run when an emit method is called - * - * @param {String} type Event type - * @param {Function} callback - */ - on(type: string, callback: () => void): void; - - /** - * @method off - * Removes a custom event of an applicable type or callback handler - * - * @param {String} type Event type - */ - off(type: string): void; - - /** - * @method addValid - * Check the parameter type of a UI method and generates an alarm when a wrong value is entered - * - * @param {String} name Method name - * @param {Array} params Parameters - */ - addValid(name: string, params: any[]): void; - - /** - * @method callBefore - * Sets a callback function that is called before a UI method is run - * - * @param {String} name Method name - * @param {Function} callback - * @return {Mixed} - */ - callBefore(name: string, callback: () => void): void; - - /** - * @method callAfter - * Sets a callback function that is called after a UI method is run - * - * @param {String} name Method name - * @param {Function} callback - * @return {Mixed} - */ - callAfter(name: string, callback: () => void): void; - - /** - * @method callDelay - * Sets a callback function and the delay time before/after a UI method is run - * - * @param {String} name Method name - * @param {Function} callback - */ - callDelay(name: string, callObj: () => void): void; - - /** - * @method setTpl - * Dynamically defines the template method of a UI - * - * @param {String} name Template name - * @param {String} html Template markup - */ - setTpl(name: string, html: string): void; - - /** - * @method setOption - * Dynamically defines the options of a UI - * - * @param {String} key - * @param {Mixed} value - */ - setOption(key: string, value: any): void; - - /** - * @method destroy - * Removes all events set in a UI obejct and the DOM element - * - */ - destroy(): void; -} - -//noinspection TypeScriptUnresolvedVariable -export interface UIEvent extends UICore { - - root?: any; - - /** - * @method find - * Get the child element of the root element - * - * @param {String/HTMLElement} Selector - * @returns {*|jQuery} - */ - find(selector: any): JQuery; -} - -export class ColorScale { - domain(color: string, color2: string): this; - ticks(max: number): this; -} - -export interface UtilColor { - /** - * @method format - * - * convert color to format string - * - * // hex - * color.format({ r : 255, g : 255, b : 255 }, 'hex') // #FFFFFF - * - * // rgb - * color.format({ r : 255, g : 255, b : 255 }, 'rgb') // rgba(255, 255, 255, 0.5); - * - * // rgba - * color.format({ r : 255, g : 255, b : 255, a : 0.5 }, 'rgb') // rgba(255, 255, 255, 0.5); - * - * @param {Object} obj obj has r, g, b and a attributes - * @param {"hex"/"rgb"} type format string type - * @returns {*} - */ - format(obj: any, type: string): string; - - /** - * @method scale - * - * get color scale - * - * var c = color.scale().domain('#FF0000', '#00FF00'); - * - * // get middle color - * c(0.5) == #808000 - * - * // get middle color list - * c.ticks(20); // return array , [startColor, ......, endColor ] - * - * @returns {func} scale function - */ - scale(): ColorScale; - - /** - * @method map - * - * create color map - * - * var colorList = color.map(['#352a87', '#0f5cdd', '#00b5a6', '#ffc337', '#fdff00'], count) - * - * @param {Array} color_list - * @param {Number} count a divide number - * @returns {Array} converted color list - */ - map(color_list: string[], count: number): string[]; - - /** - * @method rgb - * - * parse string to rgb color - * - * color.rgb("#FF0000") === { r : 255, g : 0, b : 0 } - * - * color.rgb("rgb(255, 0, 0)") == { r : 255, g : 0, b : } - * - * @param {String} str color string - * @returns {Object} rgb object - */ - rgb(str: string): any; - - /** - * @method HSVtoRGB - * - * convert hsv to rgb - * - * color.HSVtoRGB(0,0,1) === #FFFFF === { r : 255, g : 0, b : 0 } - * - * @param {Number} H hue color number (min : 0, max : 360) - * @param {Number} S Saturation number (min : 0, max : 1) - * @param {Number} V Value number (min : 0, max : 1 ) - * @returns {Object} - */ - HSVtoRGB(H: number, S: number, V: number): any; - - /** - * @method RGBtoHSV - * - * convert rgb to hsv - * - * color.RGBtoHSV(0, 0, 255) === { h : 240, s : 1, v : 1 } === '#FFFF00' - * - * @param {Number} R red color value - * @param {Number} G green color value - * @param {Number} B blue color value - * @return {Object} hsv color code - */ - RGBtoHSV(R: number, G: number, B: number): any; - - /** - * @method lighten - * - * rgb 컬러 밝은 농도로 변환 - * - * @param {String} color RGB color code - * @param {Number} rate 밝은 농도 - * @return {String} - */ - lighten(color: string, rate: number): string; - - /** - * @method darken - * - * rgb 컬러 어두운 농도로 변환 - * - * @param {String} color RGB color code - * @param {Number} rate 어두운 농도 - * @return {String} - */ - darken(color: string, rate: number): string; -} - -interface UtilBase64 { - encode(input: string): string; - decode(input: string): string; -} - -interface UtilKeyParser { - /** - * @method isIndexDepth - * - * @param {String} index - * @return {Boolean} - */ - isIndexDepth(index: string): boolean; - - /** - * @method getIndexList - * - * @param {String} index - * @return {Array} - */ - getIndexList(index: string): boolean; - - /** - * @method changeIndex - * - * - * @param {String} index - * @param {String} targetIndex - * @param {String} rootIndex - * @return {String} - */ - changeIndex(index: string, targetIndex: string, rootIndex: string): string; - - /** - * @method getNextIndex - * - * @param {String} index - * @return {String} - */ - getNextIndex(index: string): string; - - /** - * @method getParentIndex - * - * - * @param {String} index - * @returns {*} - */ - getParentIndex(index: string): string; -} - -interface UtilMath { - /** - * @method rotate - * - * 2d rotate - * - * @param {Number} x - * @param {Number} y - * @param {Number} radian roate 할 radian - * @return {Object} - * @return {Number} return.x 변환된 x - * @return {Number} return.y 변환된 y - * - */ - rotate(x: number, y: number, radian: number): any; - - resize(maxWidth: number, maxHeight: number, objectWidth: number, objectHeight: number): any; - - /** - * @method radian - * - * convert degree to radian - * - * @param {Number} degree - * @return {Number} radian - */ - radian(degree: number): number; - - /** - * @method degree - * - * convert radian to degree - * - * @param {Number} radian - * @return {Number} degree - */ - degree(radian: number): number; - - angle(x1: number, y1: number, x2: number, y2: number): number; - - /** - * @method interpolateNumber - * - * a, b 의 중간값 계산을 위한 callback 함수 만들기 - * - * @param {Number} a first value - * @param {Number} b second value - * @return {Function} - */ - interpolateNumber(a: number, b: number): () => void; - - // 중간값 round 해서 계산하기 - interpolateRound(a: number, b: number): () => void; - - round(num: number, fixed: number): number; - - plus(a: number, b: number): number; - - minus(a: number, b: number): number; - - multi(a: number, b: number): number; - - div(a: number, b: number): number; - - remain(a: number, b: number): number; - - /** - * 특정 구간의 값을 자동으로 계산 - * - * @param {Object} min - * @param {Object} max - * @param {Object} ticks - * @param {Object} isNice - */ - nice(min: number, max: number, ticks: number, isNice: boolean): any; - - matrix(a: T[], b: T[]): T[]; - - matrix3d(a: T[], b: T[]): T[]; - - inverseMatrix3d(a: any[]): any[]; - -} - -export interface UtilScaleOrdinal extends Function { - (x: number): number; - domain(values: any[]): UtilScaleOrdinal; - range(values: any[]): UtilScaleOrdinal; - rangePoints(interval: number, padding?: number): () => void; - rangeBands(interval: number, padding?: number, outerPadding?: number): () => void; - invert(x: number): number; -} - -export type UtilQuickSort = (array: number[], isClone: boolean) => this; diff --git a/jui-core/tslint.json b/jui-core/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/jui-core/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/jui-grid/index.d.ts b/jui-grid/index.d.ts deleted file mode 100644 index 0fee7cc271..0000000000 --- a/jui-grid/index.d.ts +++ /dev/null @@ -1,996 +0,0 @@ -// Type definitions for jui-grid 2.0 -// Project: https://github.com/juijs/jui-grid -// Definitions by: Jin-Ho Park -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -import {UIEvent} from 'jui-core'; - -export interface GridColumn { - (index: number|string): this; - - /** @property {HTMLElement} [element=null] TH element of a specified column */ - element: any; - - /** @property {String} [order="asc"] Column sort state */ - order: "asc"|"desc"; - - /** @property {String} [name=null] Column name */ - name?: string; - - /** @property {Array} data Data from all rows belonging for a specified column */ - data: any[]; - - /** @property {Array} list TD element of all rows belonging to a specified column */ - list: any[]; - - /** @property {Integer} index Column index */ - index: number; - - /** @property {"show"/"hide"/"resize"} [type="show"] The current column state */ - type: "show"|"hide"|"resize"; - - /** @property {Integer} [width=null] Column width */ - width?: number; - - hide(): void; - show(): void; -} - -export interface GridRow { - /** @property {Array} data Data of a specifiedrow. */ - data: any[]; - - /** @property {Integer} seq Data of a sequence. */ - seq: number; - - /** @property {Integer} [rownum=null] The unique number of a child row under the specified parent row if a parent row exists. */ - rownum?: number; - - /** @property {String/Integer} [index=null] Index of a specified row. In the case of a tree structure, a depth is given. */ - index: number|string; - - /** @property {HTMLElement} [element=null] TR element of a specified row. */ - element: any; - - /** @property {Array} list List of TD elements of a specified row. */ - list: any[]; - - /** @property {Object} list List of hidden TD element. */ - hidden: {}; - - /** @property {uix.table.row} parent Variable that refers to the parent row. */ - parent?: GridRow; - - /** @property {Array} children List of child rows. */ - children: any[]; - - /** @property {Integer} [depth=0] The depth of the current row in the case of a tree structure. */ - depth: number; - - /** @property {"open"/"fold"} [type="fold"] State value that indicates whether a child row is shown or hidden. */ - type: "open"|"fold"; - - /** @property {Function} [type="null"] State value that indicates whether a child row is shown or hidden. */ - tpl?: () => void; - - setIndex(rownum: number|string): void; - reload(columns: GridColumn[], seq: any, xssFilter: any): void; - destroy(): void; - isLeaf(): boolean; - fold(): void; - open(): void; - appendChild(row: GridRow): void; - insertChild(rownum: number, row: GridRow, isReload?: any): void; - removeChild(index: number|string): void; - lastChild(): GridRow; - lastChildLeaf(lastRow: GridRow): GridRow|any; - showCell(index: number): void; - hideCell(index: number): void; -} - -export interface GridBase { - appendRow(index: number|string, data?: {}): GridRow; - insertRow(index: number|string, data: {}): GridRow; - updateRow(index: number|string, data: {}): GridRow; - moveRow(index: number|string, targetIndex: number|string): void; - removeRow(index: number|string): void; - openRow(index: number|string): void; - openRowAll(): void; - foldRow(index: number|string): void; - foldRowAll(): void; - removeRows(): void; - sortRows(name: string, isDesc: boolean): void; - appendColumn(tplType: string, dataList: any[]): void; - removeColumn(index: number|string): void; - hideColumn(index: number|string): void; - showColumn(index: number|string): void; - getColumnCount(): number; - getRowCount(): number; - getColumn(index?: number|string): GridColumn|GridColumn[]; - getRow(index?: number|string): GridRow|GridRow[]; - getRowAll(index: number|string): GridRow[]; - getRowParent(index: number|string): GridRow; - setColumn(index: number|string, column: GridColumn): void; - setRow(index: number|string, row: GridRow): void; -} - -export interface GridTable extends UIEvent { - (selector: any, options?: { - tpl?: any, - - event?: any, - /** - * @cfg {Array} [fields=null] - * Sets the name of columns in the order of being displayed on the table screen. - */ - fields?: any[], - - /** - * @cfg {Array} [csv=null] - * Sets the column key shown when converted to a CSV string. - */ - csv?: any[], - - /** - * @cfg {Array} [csvNames=null] - * Sets the name of a column shown when converting to a CSV string, which must be defined in the same order as the CSV option. - */ - csvNames?: any[], - - /** - * @cfg {Array} [csvNumber=null] - * Sets the column key to be changed to a number form when converted to a CSV string. - */ - csvNumber?: any[], - - /** - * @cfg {Array} data - * Sets the initial row list of a table. - */ - data?: any[], - - /** - * @cfg {Boolean/Array} [colshow=false] - * Sets a column index shown when the Show/Hide Column menu is enabled. - */ - colshow?: boolean|any[], - - /** - * @cfg {Boolean} [scroll=false] - * Determines whether to use a table scroll. - */ - scroll?: boolean, - - /** - * @cfg {Integer} [scrollHeight=200] - * Sets the reference height of a body area when using a table scroll. - */ - scrollHeight?: number, - - /** - * @cfg {Integer} [width=0] - * Sets the area of a table. - */ - width?: number, - - /** - * @cfg {Boolean} [expand=false] - * Determines whether to use an extended row area. - */ - expand?: boolean, - - /** - * @cfg {Boolean} [expandEvent=true] - * Sets the Show/Hide state of an extended row area when clicking on a row. - */ - expandEvent?: boolean, - - /** - * @cfg {Boolean|Array} [editRow=false] - * Determines whether to use a modified row area. - */ - editRow?: boolean|any[], - - /** - * @cfg {Boolean} [editEvent=true] - * Sets the Show/Hide state of an extended row area when doubleclicking on a row/cell. - */ - editEvent?: boolean, - - /** - * @cfg {Boolean} [resize=false] - * Determines whether to use the column resizing function. - */ - resize?: boolean, - - /** - * @cfg {Boolean/Array} [sort=false] - * Determines whether to use the table sort function. - */ - sort?: boolean|any[], - - /** - * @cfg {Integer} [sortIndex=null] - * Determines whether to use the table sort function. - */ - sortIndex?: number, - - /** - * @cfg {String} [sortOrder="asc"] - * Determines whether to use the table sort function. - */ - sortOrder?: "asc"|"desc", - - /** - * @cfg {Boolean} [sortEvent=true] - * Determines whether to use the sort function when you click on a column. - */ - sortEvent?: boolean, - - /** - * @cfg {Boolean} [moveRow=false] - * Determines whether to use the move function when you fire row draggable event. - */ - moveRow?: boolean, - - }): this; - - root?: any; - - /** - * @method update - * Updates the list of rows or modifies the row at a specified index. - * - * @param {Array} rows - */ - update(indexOrRows?: any, rows?: any): void; - /** - * @method updateTree - * It is possible to configure a tree table using an object array with the index and data properties. - * - * @param {Array} rows - */ - updateTree(rows: any[]): void; - - /** - * @method append - * Add a row or a child row to at a specified index. - * - * @param {RowObject} row - */ - append(rowOrIndex?: number|any, row?: any): void; - - /** - * @method insert - * Adds a row at a specified index. - * - * @param {Integer} index - * @param {RowObject} row - */ - insert(index: number, dataList: {}): void; - - /** - * @method select - * Adds a selected class to a row at a specified index and gets an instance of the applicable row. - * - * @param {Integer} index - * @return {RowObject} row - */ - select(index: number): GridRow; - - /** - * @method unselect - * Removes a selected class from a selected row and gets an instance of the row in question. - * - * @return {RowObject} row - */ - unselect(): GridRow; - - /** - * @method check - * Add a checked class to a row at a specified index. - * - * @param {Integer} index - */ - check(index: number): void; - - /** - * @method uncheck - * Removes a checked class from a row at a specified index. - * - * @param {Integer} index - */ - uncheck(index: number): void; - - /** - * @method uncheckAll - * Removes checked classes from all rows. - */ - uncheckAll(): void; - - /** - * @method remove - * Remove a row at a specified index. - * - * @param {Integer} index - */ - remove(index: number): void; - - /** - * @method reset - * Removes all rows. - */ - reset(): void; - - /** - * @method move - * Moves a row iat a specified index to the target index. - * - * @param {Integer} index - * @param {Integer} targetIndex - */ - move(index: number, targetIndex: number): void; - - /** - * @method sort - * Moves a row iat a specified index to the target index. - * - * @param {Integer} index - * @param {String} order "asc" or "desc" - */ - sort(index: number, order: string, e?: any): void; - - /** - * @method scroll - * Sets the scroll based on the height of a table. - * - * @param {Integer} height - */ - scroll(height: number): void; - - /** - * @method open - * Shows a child row of a specified index. - * - * @param {Integer} index - */ - open(index: number): void; - - /** - * @method fold - * Hides a child row of a specified index. - * - * @param {Integer} index - */ - fold(index: number): void; - - /** - * @method openAll - * Shows all child rows of a specified index. - */ - openAll(): void; - - /** - * @method foldAll - * Hides all child rows of a specified index. - */ - foldAll(): void; - - /** - * @method resize - * Resets the inner scroll and columns of a table. - */ - resize(): void; - - /** - * @method resizeColumns - * Resets the sizes of all columns of a table. - */ - resizeColumns(): void; - - /** - * @method size - * Gets the size of all the rows of a table. - * - * @return {Integer} size - */ - size(): number; - - /** - * @method count - * Gets the number of trows of a table. - * - * @return {Integer} count - */ - count(): number; - - /** - * @method list - * Gets all the rows of a table. - * - * @return {Array} rows - */ - list(): GridRow[]; - - /** - * @method listData - * Gets the data of all the rows of a table. - * - * @return {Array} datas - */ - listData(): any[]; - - /** - * @method listAll - * Gets all the rows of a table including child rows. - * - * @return {Array} rows - */ - listAll(): GridRow[]; - - /** - * @method listChecked - * Gets all rows in a check state. - * - * @return {Array} rows - */ - listChecked(): GridRow[]; - - /** - * @method listColumn - * Gets all columns. - * - * @return {Array} columns - */ - listColumn(): GridColumn; - - /** - * @method get - * Gets the row at the specified index. - * - * @param {Integer} index - * @return {RowObject} row - */ - get(index: number): GridRow; - - /** - * @method getAll - * Gets all rows of at the specified index including child rows. - * - * @param {Integer} index - * @return {Array} rows - */ - getAll(index: number): GridRow[]; - - /** - * @method getColumn - * Gets the column at the specified index. - * - * @param {"Integer"/"String"} key index or column key - * @return {ColumnObject} column - */ - getColumn(index: number|string): GridColumn; - - /** - * @method showColumn - * Shows the column index (or column name). - * - * @param {"Integer"/"String"} key index or column name - */ - showColumn(index: number|string, e?: any): void; - - /** - * @method hideColumn - * Hides the column index (or column name). - * - * @param {"Integer"/"String"} key index or column name - */ - hideColumn(index: number|string, e?: any): void; - - /** - * @method initColumns - * It is possible to determine the index or name of the column to be shown in an array. - * - * @param {"Integer"/"String"} key index or column name - */ - initColumns(keys: any): void; - - /** - * @method showColumnMenu - * Shows the Show/Hide Column menu at specified coordinates. - * - * @param {Integer} x - * @param {Integer} y - */ - showColumnMenu(x: number, y: number): void; - - /** - * @method hideColumnMenu - * Hides the Show/Hide Column menu. - */ - hideColumnMenu(): void; - - /** - * @method toggleColumnMenu - * Shows or hides the Show/Hide Column menu. - * - * @param {Integer} x - * @param {Integer} y - */ - toggleColumnMenu(x: number, y: number): void; - - /** - * @method showExpand - * Shows the extended row area of a specified index. - * - * @param {Integer} index - */ - showExpand(index: number, obj?: any, e?: any): void; - - /** - * @method hideExpand - * Hides the extended row area of a specified index. - */ - hideExpand(e?: any): void; - - /** - * @method getExpand - * Get a row in which the extended area is currently activated. - * - * @return {RowObject} row - */ - getExpand(): GridRow; - - /** - * @method showEditRow - * Shows the modified row area of a specified index. - * - * @param {Integer} index - */ - showEditRow(index: number, e?: any): void; - - /** - * @method hideEditRow - * Hides the modified row area of a specified index. - */ - hideEditRow(data?: any): void; - - /** - * @method getEditRow - * Get a row in which the modified area is currently activated. - * - * @return {RowObject} row - */ - getEditRow(): GridRow; - - /** - * @method setCsv - * Updates a table using a CVS string. - */ - setCsv(csvOrKey: any, key?: any): void; - - /** - * @method setCsvFile - * Updates a table using a CVS file. - */ - setCsvFile(fileOrKey: any, key?: any): void; - - /** - * @method getCsv - * Gets the data of a table as a CSV string. - * - * @param {Boolean} isTree - * @return {String} csv - */ - getCsv(isTree: boolean): string; - - /** - * @method getCsvBase64 - * Gets the data of a table as a CSV string encoded as base64. - * - * @param {Boolean} isTree - * @return {String} base64 - */ - getCsvBase64(isTree: boolean): string; - - /** - * @method downloadCsv - * Downloads the data of a table as a CSV file. - * - * @param {String} name - * @param {Boolean} isTree - */ - downloadCsv(name: string, isTree: boolean): void; - - /** - * @method activeIndex - * Gets the index of a row that is activated in an extended/modified/selected state. - * - * @return {Integer} index - */ - activeIndex(): number; -} - -export interface GridXTable extends UIEvent { - (selector: any, options?: { - - }): this; - - render(isTree?: boolean): void; - - /** - * @method select - * Adds a selected class to a row at a specified index and gets an instance of the applicable row. - * - * @param {Integer} index - * @return {RowObject} row - */ - select(index: number): GridRow; - - /** - * @method unselect - * Removes a selected class from a selected row and gets an instance of the row in question. - * - * @return {RowObject} row - */ - unselect(): GridRow; - - /** - * @method update - * Updates the list of rows or modifies the row at a specified index. - * - * @param {Array} rows - */ - update(dataList: any[]): void; - - /** - * @method updateTree - * It is possible to configure a tree table using an object array with the index and data properties. - * - * @param {Array} rows - */ - updateTree(tree: any[]): void; - - /** - * @method append - * Add a row or a child row to at a specified index. - * - * @param {RowObject} row - * @param {RowObject} row - */ - append(index: number, data: {}): void; - /** - * @method open - * Shows a child row of a specified index. - * - * @param {Integer} index - */ - open(index: number|string): void; - - /** - * @method fold - * Hides a child row of a specified index. - * - * @param {Integer} index - */ - fold(index: number|string): void; - - /** - * @method openAll - * Shows all child rows of a specified index. - */ - openAll(index: number|string): void; - - /** - * @method foldAll - * Hides all child rows of a specified index. - */ - foldAll(index: number|string): void; - - /** - * @method next - * Changes to the next page. - */ - next(): void; - - /** - * @method page - * Changes to the page of at a specified index. - * - * @param {Integer} index - */ - page(pNo: number): void; - - /** - * @method sort - * Moves a row iat a specified index to the target index. - * - * @param {Integer} index - * @param {String} order "asc" or "desc" - */ - sort(index: number, order: "asc"|"desc", e?: any, isNotLoading?: any): void; - - /** - * @method filter - * Filters columns at a specified to locate rows that contain keywords in the cell value. - * - * @param {Function} callback - */ - filter(callback: (data: any) => void): void; - - /** - * @method rollback - * Returns filtered rows to the original state. - */ - rollback(): void; - - /** - * @method clear - * Remove all row elements. - */ - clear(): void; - - /** - * @method clear - * Remove all data - */ - reset(): void; - - /** - * @method resize - * Resets the inner scroll and columns of a table. - */ - resize(): void; - - /** - * @method scrollWidth - * Sets the scroll based on the width of a table. - * - * @param {Integer} width - */ - scrollWidth(scrollWidth: number, isInit?: boolean): void; - - /** - * @method scrollHeight - * Sets the scroll based on the height of a table. - * - * @param {Integer} height - */ - scrollHeight(h: number): void; - - /** - * @method scrollTop - * Sets the scroll based on the height of a table. - * - * @param {Integer|String} index - * @param {Integer} dist - */ - scrollTop(index: number|string, dist: number): void; - - /** - * @deprecated - * @method height - * Sets the scroll based on the height of a table. - * - * @param {Integer} height - */ - height(h: number): void; - - /** - * @method size - * Gets the size of all the rows of a table. - * - * @return {Integer} size - */ - size(): number; - - /** - * @method count - * Gets the number of trows of a table. - * - * @return {Integer} count - */ - count(): number; - - /** - * @method list - * Gets all the rows of a table. - * - * @return {Array} rows - */ - list(): GridRow[]; - - /** - * @method listColumn - * Gets all columns. - * - * @return {Array} columns - */ - listColumn(): GridColumn[]; - - /** - * @method listData - * Gets the data of all the rows of a table. - * - * @return {Array} datas - */ - listData(): any[]; - - /** - * @method get - * Gets the row at the specified index. - * - * @param {Integer|String} index - * @return {RowObject} row - */ - get(index: number): GridRow; - - getAll(index: number, _result?: any): GridRow[]; - - /** - * @method getColumn - * Gets the column at the specified index. - * - * @param {"Integer"/"String"} key index or column key - * @return {ColumnObject} column - */ - getColumn(index: number|string): GridColumn; - - /** - * @method getData - * Gets the data at the specified index. - * - * @param {"Integer"/"String"} key index - * @return {ColumnObject} data - */ - getData(index: number|string): any; - - /** - * @method showColumn - * Shows the column index (or column name). - * - * @param {"Integer"/"String"} key index or column name - */ - showColumn(index: number|string): void; - - /** - * @method hideColumn - * Hides the column index (or column name). - * - * @param {"Integer"/"String"} key index or column name - */ - hideColumn(index: number|string): void; - - /** - * @method initColumns - * It is possible to determine the index or name of the column to be shown in an array. - * - * @param {"Integer"/"String"} key index or column name - */ - initColumns(keys: number|string): void; - - /** - * @method showColumnMenu - * Shows the Show/Hide Column menu at specified coordinates. - * - * @param {Integer} x - * @param {Integer} y - */ - showColumnMenu(x: number, y: number): void; - - /** - * @method hideColumnMenu - * Hides the Show/Hide Column menu. - */ - hideColumnMenu(): void; - - /** - * @method toggleColumnMenu - * Shows or hides the Show/Hide Column menu. - * - * @param {Integer} x - * @param {Integer} y - */ - toggleColumnMenu(x: number, y: number): void; - - /** - * @method showExpand - * Shows the extended row area of a specified index. - * - * @param {Integer} index - */ - showExpand(index: number, obj: any): void; - - /** - * @method hideExpand - * Hides the extended row area of a specified index. - */ - hideExpand(index: number): void; - - /** - * @method getExpand - * Get a row in which the extended area is currently activated. - * - * @return {RowObject} row - */ - getExpand(): GridRow; - - /** - * @method showLoading - * Shows the loading screen for the specified delay time. - * - * @param {Integer} delay - */ - showLoading(delay: number): void; - - /** - * @method hideLoading - * Hides the loading screen. - */ - hideLoading(): void; - - /** - * @method setCsv - * Updates a table using a CVS string. - */ - setCsv(csv: string): void; - - /** - * @method setCsvFile - * Updates a table using a CVS file. - */ - setCsvFile(file: any): void; - - /** - * @method getCsv - * Gets the data of a table as a CSV string. - * - * @param {Boolean} isTree - * @return {String} csv - */ - getCsv(): string; - - /** - * @method getCsvBase64 - * Gets the data of a table as a CSV string encoded as base64. - * - * @param {Boolean} isTree - * @return {String} base64 - */ - getCsvBase64(): string; - - /** - * @method downloadCsv - * Downloads the data of a table as a CSV file. - * - * @param {String} name - * @param {Boolean} isTree - */ - downloadCsv(name: string): void; - - /** - * @method rowFunc - * Ir is possible to use a function for all row data applicable to the column (or column name) of a specified column (or column name). Currently only SUM and AVG are supported. - * - * @param {"sum"/"svg"} funcType - * @param {Integer} columnIndex - * @param {Function} callback - */ - rowFunc(type: "sum"|"avg", index: number, callback: (data: any) => void): any; - - /** - * @method getPage - * Gets the current page of a table. - * - * @return {Integer} page - */ - getPage(): number; - - /** - * @method activeIndex - * Gets the index of a row that is activated in an extended/modified/selected state. - * - * @return {Integer} index - */ - activeIndex(): number; -} diff --git a/jui-grid/tslint.json b/jui-grid/tslint.json deleted file mode 100644 index f05741c59b..0000000000 --- a/jui-grid/tslint.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "../tslint.json", - "rules": { - "forbidden-types": false - } -} diff --git a/jui/index.d.ts b/jui/index.d.ts deleted file mode 100644 index c1dec57e39..0000000000 --- a/jui/index.d.ts +++ /dev/null @@ -1,1380 +0,0 @@ -// Type definitions for jui 2.0 -// Project: https://github.com/juijs/jui#readme -// Definitions by: Jin-Ho Park -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -import {UIEvent} from 'jui-core'; - -export interface UIAccordion extends UIEvent { - - (selector: any, options?: { - tpl?: any, - event?: any, - /** - * @cfg {Integer} [index=null] - * Sets an enabled node - */ - index?: number, - - /** - * @cfg {Boolean} [autoFold=false] - * When you click on a node, the node folding - */ - autoFold?: boolean, - - /** - * @cfg {Boolean} [multipanel=false] - * - */ - multipanel?: boolean - }) : this; - - /** - * @method activeIndex - * Gets the index of the currently enabled node - * - * @return {Integer} Index - */ - activeIndex(): number; -} - -export interface UIAutoComplete { - (selector: any, options?: { - tpl?: any, - event?: any, - /** - * @cfg {String/DOMElement} [target=null] - * Designates a target selector when an autofill route is not a target - */ - target?: any, - - /** - * @cfg {Array} words - * Designates words subject to autofill - */ - words?: string[] - }) : this; - - /** - * @method update - * Updates words subject to autofill - * - * @param {Array} words - * - */ - update(newWords: string[]): void; - - /** - * @method close - * Close the active drop-down - * - */ - close(): void; - - /** - * @method list - * Gets filtered words subject to autofill - * - * @return {Array} words - */ - list(): string[]; -} - -export interface UIColorPicker { - (selector: any, options?: { - tpl?: any, - event?: any, - type?: string, - color?: string - }) : this; - - getColor(type: string): string|{}; - - setColor(value: string|{}): void; - -} - - -export interface UICombo { - (selector: any, options?: { - tpl?: any, - event?: any, - /** - * @cfg {Integer} [index=0] - * Determines an initial selection button with a specified index - */ - index?: number, - - /** - * @cfg {String} [value=0] - * Determines an initial selection button with a specified value - */ - value?: string, - - /** - * @cfg {Integer} [width=0] - * Determines the horizontal size of a combo box - */ - width?: number, - - /** - * @cfg {Integer} [height=100] - * Determines an initial selection button with a specified value - */ - height?: number, - - /** - * @cfg {Boolean} [keydown=false] - * It is possible to select a node using the keyboard - */ - keydown?: boolean, - - /** - * @cfg {"top"/"bottom"} [position="bottom"] - * It is possible to determine an initial selection button with a specified value - */ - position?: "top"|"bottom", - - /** - * @cfg {Boolean} [flex=true] - * Drop-down menu is varied by changing the width function - */ - flex?: boolean - }) : this; - - /** - * @method setIndex - * Selects a button of a specified index - * - * @param {Number} index - */ - setIndex(index: number): void; - - /** - * @method setValue - * Selects a button having a specified value - * - * @param {Mixed} value - */ - setValue(value: any): void; - - /** - * @method getData - * Gets the data of the button currently selected - * - * @return {Object} - */ - getData(): {}; - - /** - * @method getValue - * Gets the value of the button currently selected - * - * @return {Mixed} - */ - getValue(): any; - - /** - * @method getText - * Gets the markup text of the button currently selected - * - * @return {String} - */ - getText(): string; - - /** - * @method open - * Shows the element list of a combo box - */ - open(e: any): void; - - /** - * @method fold - * Hides the element list of a combo box - */ - fold(): void; - - /** - * @method reload - * Re-defines a combo box - */ - reload(): void; -} - - -export interface UIDatePicker { - (selector: any, options?: { - tpl?: any, - event?: any, - /** - * @cfg {"daily"/"monthly"/"yearly"} [type="daily"] - * Determines the type of a calendar - */ - type?: "daily"|"monthly"|"yearly", - - /** - * @cfg {String} [titleFormat="yyyy.MM"] - * Title format of a calendar - */ - titleFormat?: string, - - /** - * @cfg {String} [format="yyyy-MM-dd"] - * Format of the date handed over when selecting a specific date - */ - format?: string, - - /** - * @cfg {Date} [date="now"] - * Selects a specific date as a basic - */ - date?: "now"|Date, - - /** - * @cfg {Date} [minDate="null"] - * Selects a specific minimum date - */ - minDate?: Date, - - /** - * @cfg {Date} [maxDate="null"] - * Selects a specific maximum date - */ - maxDate?: Date - }) : this; - - /** - * @method page - * Outputs a calendar that fits the year/month entered - * - * @param {Integer} year - * @param {Integer} month - */ - page(y: number, m: number): void; - - /** - * @method prev - * Outputs a calendar that fits the previous year/month - * - */ - prev(e: any, moveYear?: boolean): void; - - /** - * @method next - * Outputs a calendar that fits the next year/month - * - */ - next(e: any, moveYear?: boolean): void; - - /** - * @method select - * Selects today if there is no value, or selects a date applicable to a timestamp or year/month/date - * - * @param {"year"/"month"/"date"/"timestamp"/"Date"} - */ - select( ...args: any[]): void; - - /** - * @method addTime - * Selects a date corresponding to the time added to the currently selected date - * - * @param {"Integer"/"Date"} time Timestamp or Date - */ - addTime(time: number|Date): void; - - /** - * @method getDate - * Gets the value of the date currently selected - * - * @return {Date} Date object - */ - getDate(): Date; - - /** - * @method getTime - * Gets the timestamp value of the date currently selected - * - * @return {Integer} Timestamp - */ - getTime(): number; - - /** - * @method getFormat - * Gets a date string that fits the format entered - * - * @return {String} format Formatted date string - */ - getFormat(format: string): string; - - /** - * @method reload - * Reloads the datepicker - */ - reload(): void; -} - -export interface UIDropdown { - (selector: any, options?: { - tpl?: any, - event?: any, - /** - * @cfg {Boolean} [close=true] - * Closes the Auto when clicking on the dropdown list - */ - close?: boolean, - - /** - * @cfg {Boolean} [keydown=false] - * It is possible to choose anything on the dropdown list with the arrow keys on the keyboard - */ - keydown?: boolean, - - /** - * @cfg {Integer} [left=0] - * Sets the X coordinate of the dropdown list - */ - left?: number, - - /** - * @cfg {Integer} [top=0] - * Sets the Y coordinate of the dropdown list - */ - top?: number, - - /** - * @cfg {Integer} [width=0] - * Determines the horizontal size of a dropdown list - */ - width?: number, - - /** - * @cfg {Integer} [height=0] - * Determines the vertical size of a dropdown list - */ - height?: number, - - /** - * @cfg {Array} nodes - * Sets a dropdown list to data rather than markup - */ - nodes?: any[] - }): this; - - /** - * @method update - * Changes the dropdown list - * - * @param {Array} nodes Dropdown list - */ - update(nodes: any[]): void; - - /** - * @method hide - * Hides the dropdown - */ - hide(): void; - - /** - * @method show - * Shows a dropdown at the specified coordinates - * - * @param {Integer} x - * @param {Integer} y - */ - show(x: number, y: number): void; - - /** - * @method move - * Moves a dropdown to the specified coordinates - * - * @param {Integer} x - * @param {Integer} y - */ - move(x: number, y: number): void; - - /** - * @method reload - * Reloads the dropdown list - */ - reload(): void; -} - - -export interface UIModal { - (selector: any, options?: { - tpl?: any, - event?: any, - /** - * @cfg {"black"/"gray"} [color="black"] - * Determines the color of a modal - */ - color?: "black"|"gray", - - /** - * @cfg {Float} [opacity=0.4] - * Sets the transparency of a modal - */ - opacity?: number, - - /** - * @cfg {String/DOMElement} [target="body"] - * Sets a selector on which a modal is shown - */ - target?: string|any, - - /** - * @cfg {Integer} [index=0] - * Determines the sequence (index) of a modal - */ - index?: number, - - /** - * @cfg {Boolean} [clone=false] - * Copies an existing modal and shows it - */ - clone?: boolean, - - /** - * @cfg {Boolean} [autoHide=true] - * Automatically hides a modal when clicking on it - */ - autoHide?: boolean - }): this; - - /** - * @method hide - * Hides a modal - */ - hide(): void; - - /** - * @method show - * Shows a modal - */ - show(): void; - - /** - * @method resize - * Re-adjust the location of a modal - */ - resize(): void; -} - - -export interface UINotify { - (selector: any, options?: { - tpl?: any, - event?: any, - /** - * @cfg {"top"/"top-lefet"/"top-right"/"bottom"/"bottom-left"/"bottom-right"} [position="top-right"] - * Designates the location where a notice message is added - */ - position?: "top"|"top-lefet"|"top-right"|"bottom"|"bottom-left"|"bottom-right", - - /** - * @cfg {Integer} [padding=12] - * Determines the margin value of a notice message (the margin value may be in object form rather than a numeric value) - */ - padding?: number, - - /** - * @cfg {Integer} [distance=5] - * Determines each margin value when there are multiple notice messages - */ - distance?: number, - - /** - * @cfg {Integer} [timeout=3000] - * Determines the duration for which a notice message is displayed (the message does not disappear when the value is 0) - */ - timeout?: number, - - /** - * @cfg {Integer} [showDuration=500] - * Determines the duration of an effect when a notice message is shown - */ - showDuration?: number, - - /** - * @cfg {Integer} [hideDuration=500] - * Determines the duration of an effect when a notice message disappears - */ - hideDuration?: number, - - /** - * @cfg {String} [showEasing="swing"] - * Determines an effect when a notice message is shown (see CSS3 specifications) - */ - showEasing?: string, - - /** - * @cfg {String} [hideEasing="linear"] - * Determines an effect when a notice message disappears (see CSS3 specifications) - */ - hideEasing?: string - }): this; - - /** - * @method add - * Adds a notice message. The value passed is the data object shown by the notice template - * - * @param {Object} data - * @param {Integer} timeout - */ - add(data: {}, timeout: number): void; - - /** - * @method reset - * Removes all notice messages that are enabled - */ - reset(): void; -} - -export interface UIPaging { - (selector: any, options?: { - tpl?: any, - event?: any, - /** - * @cfg {Integer} [count=0] - * Total number of data records subject to paging) - */ - count?: number, - - /** - * @cfg {Integer} [pageCount=10] - * Number of data records per page - */ - pageCount?: number, - - /** - * @cfg {Integer} [screenCount=5] - * Number of pages shown on the paging screen - */ - screenCount?: number - }): this; - - /** - * @method reload - * Reloads the number of specified data records, or reloads the initially configured number of data records if there is no parameter - * - * @param {Integer} count Data total count - */ - reload(count: number): void; - - /** - * @method page - * Changes to a specified page number, and gets the currently enabled page number if there is no parameter - * - * @param {Integer} pNo Page number - */ - page(pNo: number): void; - - /** - * @method next - * Changes to the next page - */ - next(): void; - - /** - * @method prev - * Changes to the previous page - */ - prev(): void; - - /** - * @method first - * Changes to the first page - */ - first(): void; - - /** - * @method last - * Changes to the last page - */ - last(): void; -} - -export interface UIProgress { - (selector: any, options?: { - tpl?: any, - event?: any, - type?: "simple" | "flat", // simple or flat - orient?: "horizontal"|"vertical", // or vertical, - min?: number, - max?: number, - value?: number, - striped?: boolean, // or true - animated?: boolean // or true - }): this; - - setAnimated(isAnimated: boolean): void; - setStriped(isStriped: boolean): void; - setValue(v: number): void; - getValue(): number; - -} - -export interface UIProperty { - (selector: any, options?: { - tpl?: any, - event?: any, - sort?: string, // name, group, type - viewport?: string, - items?: any[] - }): this; - - loadItems(newItems: any[]): void; - - addItem(item: {}|any[]): void; - - // remove item by key or title - removeItem(item: {}): void; - - /** - * @method getGroupList - * - * get a list of group's title. - */ - getGroupList(): any[]; - - /** - * @method collapsed - * - * collapse group's children - * - * @param {String} id - */ - collapsed(id: string): void; - - /** - * @method expanded - * - * expand group's children - * - * @param {String} id - */ - expanded(id: string): void; - - /** - * @method getValue - * - * get a list of property's value - * - * @param {String} [key=null] if key is null, value is all properties. - */ - getValue(key?: string): {} | any[]; - - getDefaultValue(): any[]; - - initValue(obj: {}): void; - - /** - * @method getValue - * - * set a list of property's value - * - * @param {Object} obj - */ - setValue(obj: {}): void; - - findRender(key: string): any; - findItem(key: string): any; - updateValue(key: string, value: any): void; - getAllValue(key: string): any; - refreshValue($dom: any, newValue: any): void; -} - -export interface UISelect { - (selector: any, options?: { - tpl?: any, - event?: any, - items?: any[], - placeholder?: string, - align?: 'left'|'right', - valign?: 'top'|'bottom', - multi?: boolean - }): this; - - setValue(value: any|any[]): void; - getValue(): any| any[]; - setSelectedIndex(index: number): void; - getSelectedIndex(): number; - update(data: any[]): void; -} - -export interface UISlider { - (selector: any, options?: { - tpl?: any, - event?: any, - type?: "single"|"double", // or double - orient?: "horizontal"|"vertical", // or vertical, - min?: number, - max?: number, - step?: number, - from?: number, - to?: number, - tooltip?: boolean, - format?: string, - progress?: boolean - - }): this; - - /** - * @method setFromValue - * set FromHandle's value - * - * @param {Number} - */ - setFromValue(value: number): void; - - /** - * @method setToValue - * set ToHandle's value - * - * @param {Number} - */ - setToValue(value: number): void; - - /** - * @method getFromValue - * get FromHandle's value - * - * @return {Number} value - */ - getFromValue(): number; - - /** - * @method getToValue - * get ToHandle's value - * - * @return {Number} value - */ - getToValue(): number; - -} - - -export interface UISplitter { - (selector: any, options?: { - tpl?: any, - event?: any, - /** - * @cfg {String} [splitterClass='ui-splitter'] - * set splitter's class for design - */ - splitterClass?: string, - - /** - * @cfg {String} [hideClass='hide'] - * set splitter's hide class for design - */ - hideClass?: string, - - /** - * @cfg {Number} [barSize=4] - * set splitter's bar size - */ - barSize?: number, - - /** - * @cfg {Object} [barStyle={}] - * set custom splitter bar style - */ - barStyle?: {}, - - /** - * @cfg {"vertical"/"horizontal"} [direction='vertical'] - * set bar's direction - */ - direction?: 'vertical'|'horizontal', - - /** - * @cfg {String/Number} [initSize='50%'] - * set first panel's default width or height - */ - initSize?: string|number, - - /** - * @cfg {Number/Array} [minSize=30] - * set panel's minimum width or height - * - * if minSize is number , minSize is conver to array - * - * minSize[0] is first panel's minimum size - * minSize[1] is second panel's minimum size - * - */ - minSize?: number|number[], - - /** - * @cfg {String} [items=[]] - * - * set items to placed in vertical or horizontal - * - * support max two times - * - */ - items?: any[], - - /** - * @cfg {Boolean} [fixed=false] - * - * if fixed is true, panels can not resize. - * - */ - fixed?: boolean - }): this; - - setDirection(d: 'horizontal' | 'vertical'): void; - - setInitSize(size: number): void; - setHide(index: number): void; - setShow(index: number): void; - toggle(index: number): void; -} - -export interface UISwitch { - (selector: any, options?: { - tpl?: any, - event?: any, - checked?: boolean, - toggleEvent?: string - }): this; - - getValue(): boolean; - - setValue(value: boolean): void; - - toggle(): void; -} - -export interface UITab { - - (selector: any, options?: { - tpl?: any, - event?: any, - /** - * @cfg {String/DOMElement} [target=""] - * Determines a selector in the area to become the content of a tab - */ - target?: string|any, - - /** - * @cfg {Integer} [index=0] - * Sets an enabled tab - */ - index?: number, - - /** - * @cfg {Boolean} [drag=false] - * Changes the tab location through dragging - */ - drag?: boolean, - - /** - * @cfg {Array} nodes - * Sets a tab list to data rather than markup - */ - nodes?: any[] - }): this; - /** - * @method update - * Changes the tab list - * - * @param {Array} nodes - */ - update(nodes: any[]): void; - - /** - * @method insert - * Adds a tab at a specified index - * - * @param {Integer} index - * @param {Object} node - */ - insert(index: number, node: {}): void; - - /** - * @method append - * Adds a tab to the last node - * - * @param {Object} node - */ - append(node: {}): void; - - /** - * @method prepend - * Adds a tab to the first node - * - * @param {Object} node - */ - prepend(node: {}): void; - - /** - * @method remove - * Removes a tab at a specified index - * - * @param {Integer} index - */ - remove(index: number): void; - - /** - * @method move - * Changes a specified tab to a tab at a target index - * - * @param {Integer} index - * @param {Integer} targetIndex - */ - move(index: number, targetIndex: number): void; - - /** - * @method show - * Enables the tab at a specified index - * - * @param {Integer} index - */ - show(index: number): void; - - /** - * @method enable - * Enables the tab at a specified index - * - * @param {Integer} index - */ - enable(index: number): void; - - /** - * @method disable - * Disables the tab at a specified index - * - * @param {Integer} index - */ - disable(index: number): void; - - /** - * @method activeIndex - * Gets the index of the currently enabled tab - * - * @return {Integer} - */ - activeIndex(): number; -} - -export interface UITooltip { - (selector: any, options?: { - tpl?: any, - event?: any, - /** - * @cfg {String} [color="black"] - * Determines the color of a tooltip - */ - color?: string, - - /** - * @cfg {"top"/"bottom"/"left"/"right"} [position="top"] - * Determines the location where a tooltip is shown - */ - position?: "top"|"bottom"|"left"|"right", - - /** - * @cfg {Integer} [width=150] - * Determines the horizontal size of a tooltip - */ - width?: number, - - /** - * @cfg {"left"/"right"/"center"} [align="left"] - * Determines the alignment state inside a tooltip - */ - align?: "left"|"right"|"center", - - /** - * @cfg {Integer} [delay=0] - * Determines the event time when a tooltip is shown - */ - delay?: number, - - /** - * @cfg {String} [showType="mouseover"] - * Determines the type of event that triggers a tooltip - */ - showType?: string, - - /** - * @cfg {String} [hideType="mouseout"] - * Determines the type of event that hides a tooltip - */ - hideType?: string, - - /** - * @cfg {String} [title=""] - * Sets the content of a tooltip (referring to the title properties in markup) - */ - title?: string, - - }): this; - - /** - * @method update - * Changes the content of a tooltip - * - * @param {String} text - */ - update(newTitle: string): void; -} - -export interface UITreeNode { - /** @property {Array} [data=null] Data of a specifiednode */ - data?: any[]; - - /** @property {HTMLElement} [element=null] LI element of a specified node */ - element?: any; - - /** @property {Integer} [index=null] Index of a specified node */ - index?: number; - - /** @property {Integer} [nodenum=null] Unique number of a specifiede node at the current depth */ - nodenum?: number; - - /** @property {ui.tree.node} [parent=null] Variable that refers to the parent of the current node */ - parent?: UITreeNode; - - /** @property {Array} [children=null] List of child nodes of a specified node */ - children?: UITreeNode[]; - - /** @property {Integer} [depth=0] Depth of a specified node */ - depth?: number; - - /** @property {String} [type='open'] State value that indicates whether a child node is shown or hidden */ - type?: string; -} - -export interface UITreeBase { - appendNode(...args: any[]): UITreeNode; - insertNode(index: string, data: any): UITreeNode; - updateNode(index: string, data: any): UITreeNode; - removeNode(index: string): void; - removeNodes(): void; - openNode(index: string): void; - foldNode(index: string): void; - openNodeAll(index: string): void; - foldNodeAll(index: string): void; - - moveNode(index: string, targetIndex: number): void; - - getNode(index: string): UITreeNode; - - getNodeAll(index: string): UITreeNode[]; - - getNodeParent(index: string): UITreeNode; - - getRoot(): UITreeNode; -} - -export interface UITree { - (selector: any, options?: { - tpl?: any, - event?: any, - /** - * @cfg {NodeObject} [root=null] - * Adds a root node (required). - */ - root?: UITreeNode, - - /** - * @cfg {Boolean} [rootHide=false] - * Hides a root node. - */ - rootHide?: boolean, - - /** - * @cfg {Boolean} [rootFold=false] - * Folds up a root node. - */ - rootFold?: boolean, - - /** - * @cfg {Boolean} [drag=false] - * It is possible to drag the movement of a node. - */ - drag?: boolean, - - /** - * @cfg {Boolean} [dragChild=true] - * It is possible to drag the node movement but the node is not changed to a child node of the target node. - */ - dragChild?: boolean - }): this; - - /** - * @method update - * Changes to the node at a specified index. - * - * @param {String} index - * @param {Array} data - */ - update(index: string, data: any[]): void; - - /** - * @method append - * Adds to a child node at a specified index. - * - * @param {Array/String} param1 index or data - * @param {Array} param2 null or data - */ - append(...args: any[]): void; - - /** - * @method insert - * Adds a node at a specified index. - * - * @param {String} index - * @param {Array} data - */ - insert(index: string, data: any[]): void; - - /** - * @method select - * Adds a node at a specified index. - * - * @param {String} index - * @return {NodeObject} node - */ - select(index: string): UITreeNode; - - /** - * @method unselect - * Removes the 'active' class from a selected node and gets an instance of the specified node. - */ - unselect(): void; - - /** - * @method remove - * Deletes a node at a specified index. - * - * @param {String} index - */ - remove(index: string): void; - /** - * @method reset - * Deletes all child nodes except for a root. - */ - reset(): void; - - /** - * @method move - * Moves a node at a specified index to the target index. - * - * @param {String} index - * @param {String} targetIndex - */ - move(index: string, targetIndex: string): void; - /** - * @method open - * Shows a child node at a specified index. - * - * @param {String} index - */ - open(index: string, e: any): void; - - /** - * @method fold - * Folds up a child node at a specified index. - * - * @param {String} index - */ - fold(index: string, e: any): void; - /** - * @method openAll - * Shows all child nodes at a specified index. - * - * @param {String} index - */ - openAll(index: string): void; - - /** - * @method foldAll - * Folds up all child nodes at a specified index. - * - * @param {String} index - */ - foldAll(index: string): void; - - /** - * @method list - * Return all nodes of the root. - * - * @return {Array} nodes - */ - list(): UITreeNode[]; - - /** - * @method listAll - * Returns all child nodes. - * - * @return {Array} nodes - */ - listAll(): UITreeNode[]; - - /** - * @method listParent - * Returns all parent nodes at a specified index. - * - * @param {String} index - * @return {Array} nodes - */ - listParents(index: string): UITreeNode[]; - - /** - * @method get - * Gets a node at a specified index - * - * @param {String} index - * @return {NodeObject} node - */ - get(index: string): UITreeNode; - - /** - * @method getAll - * Gets all nodes at a specified index including child nodes. - * - * @param {String} index - * @return {Array} nodes - */ - getAll(index: string): UITreeNode[]; - - /** - * @method activeIndex - * Gets the index of a node that is activated in an active state. - * - * @return {Integer} index - */ - activeIndex(): number; -} - -export interface UIWindow { - (selector: any, options?: { - tpl?: any, - event?: any, - /** - * @cfg {Integer} [width=400] - * Determines the horizontal size of a window - */ - width?: number, - - /** - * @cfg {Integer} [height=300] - * Determines the height of a window - */ - height?: number, - - /** - * @cfg {String/Integer} [left="auto"] - * Determines the X coordinate of a window - */ - left?: string|number, - - /** - * @cfg {String/Integer} [top="auto"] - * Determines the Y coordinate of a window - */ - top?: string|number, - - /** - * @cfg {String/Integer} [right="auto"] - * Determines the X coordinate based on the right side of a window - */ - right?: string|number, - - /** - * @cfg {String/Integer} [bottom="auto"] - * Determines the Y coordinate based on the bottom side of a window - */ - bottom?: string|number, - - /** - * @cfg {Boolean} [modal=false] - * Applies a modal UI to a window - */ - modal?: boolean, - - /** - * @cfg {Boolean} [move=true] - * It is possible to move a window - */ - move?: boolean, - - /** - * @cfg {Boolean} [resize=true] - * It is possible to resize a window - */ - resize?: boolean, - - /** - * @cfg {Integer} [modalIndex=0] - * Determines the z-index property of a modal UI - */ - modalIndex?: number - }): this; - - /** - * @method hide - * Hides a window - */ - hide(): void; - - /** - * @method show - * Shows a window at specified coordinates - * - * @param {Integer} x - * @param {Integer} y - */ - show(x: number, y: number): void; - - /** - * @method move - * Moves a window at specified coordinates - * - * @param {Integer} x - * @param {Integer} y - */ - move(x: number, y: number): void; - - /** - * @method update - * Changes the markup in the body area of a window - * - * @param {String} html - */ - update(html: string): void; - - /** - * @method setTitle - * Changes the markup of the title tag in the head area of a window - * - * @param {String} title - */ - setTitle(html: string): void; - - /** - * @method setSize - * Changes the horizontal/vertical size of a window - * - * @param {Integer} width - * @param {Integer} height - */ - setSize(w: number, h: number): void; - - /** - * @method resize - * Designates a scroll area if there is a lot of content in the window body area - */ - resize(): void; - - /** - * @method resizeModal - * Re-adjust the location of a modal window - */ - resizeModal(): void; -} diff --git a/jui/tslint.json b/jui/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/jui/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/jump.js/index.d.ts b/jump.js/index.d.ts deleted file mode 100644 index fdef97c712..0000000000 --- a/jump.js/index.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -// Type definitions for jump.js 1.0 -// Project: https://github.com/callmecavs/jump.js -// Definitions by: rhysd -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare type TransitionFunc = (t: number, b: number, c: number, d: number) => number; -declare interface JumpOptions { - duration?: number; - offset?: number; - callback?: () => void; - easing?: TransitionFunc; - a11y?: boolean; -} -declare type Jump = (target: string | Element | number, opts?: JumpOptions) => void; -declare const jump: Jump; -export = jump; diff --git a/jump.js/tslint.json b/jump.js/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/jump.js/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/jwt-simple/index.d.ts b/jwt-simple/index.d.ts deleted file mode 100644 index 1ae8f18519..0000000000 --- a/jwt-simple/index.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -// Type definitions for jwt-simple v0.5.0 -// Project: https://github.com/hokaccha/node-jwt-simple -// Definitions by: Ken Fukuyama , Gael Magnan -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/** - * Decode jwt - * @param token - * @param key - * @param noVerify - * @param algorithm default is HS256 - * @api public - */ -export function decode(token: any, key: string, noVerify?: boolean): any; -/** - * Encode jwt - * @param payload - * @param key - * @param algorithm default is HS256 - * @param options - * @api public - */ -export function encode(payload: any, key: string, algorithm?: string): string; diff --git a/kafka-node/index.d.ts b/kafka-node/index.d.ts deleted file mode 100644 index a9992ccc52..0000000000 --- a/kafka-node/index.d.ts +++ /dev/null @@ -1,166 +0,0 @@ -// Type definitions for kafka-node 1.3.3 -// Project: https://github.com/SOHU-Co/kafka-node/ -// Definitions by: Daniel Imrie-Situnayake , Bill -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - - -// # Classes -export declare class Client { - constructor(connectionString: string, clientId: string, options?: ZKOptions); - close(callback?: Function): void; - topicExists(topics: Array, callback: Function): void; - refreshMetadata(topics: Array, cb?: (error: any, data: any) => any): void; - close(cb: (error: any) => any): void; -} - -export declare class Producer { - constructor(client: Client, options?: any, customPartitioner?: any); - on(eventName: string, cb: () => any): void; - on(eventName: string, cb: (error: any) => any): void; - send(payloads: Array, cb: (error: any, data: any) => any): void; - createTopics(topics: Array, async: boolean, cb?: (error: any, data: any) => any): void; - close(cb: (error: any) => any): void; -} - -export declare class HighLevelProducer { - constructor(client: Client, options?: any, customPartitioner?: any); - on(eventName: string, cb: () => any): void; - on(eventName: string, cb: (error: any) => any): void; - send(payloads: Array, cb: (error: any, data: any) => any): void; - createTopics(topics: Array, async: boolean, cb?: (error: any, data: any) => any): void; - close(cb: (error: any) => any): void; -} - -export declare class Consumer { - constructor(client: Client, fetchRequests: Array, options: ConsumerOptions); - on(eventName: string, cb: (message: string) => any): void; - on(eventName: string, cb: (error: any) => any): void; - addTopics(topics: Array, cb: (error: any, added: boolean) => any): void; - addTopics(topics: Array, cb: (error: any, added: boolean) => any, fromOffset: boolean): void; - removeTopics(topics: Array, cb: (error: any, removed: boolean) => any): void; - commit(cb: (error: any, data: any) => any): void; - setOffset(topic: string, partition: number, offset: number): void; - pause(): void; - resume(): void; - pauseTopics(topics: Array /* Array */): void; - resumeTopics(topics: Array /* Array */): void; - close(force: boolean, cb: () => any): void; -} - -export declare class HighLevelConsumer { - constructor(client: Client, payloads: Array, options: ConsumerOptions); - on(eventName: string, cb: (message: string) => any): void; - on(eventName: string, cb: (error: any) => any): void; - addTopics(topics: Array, cb: (error: any, added: boolean) => any): void; - addTopics(topics: Array, cb: (error: any, added: boolean) => any, fromOffset: boolean): void; - removeTopics(topics: Array, cb: (error: any, removed: boolean) => any): void; - commit(cb: (error: any, data: any) => any): void; - setOffset(topic: string, partition: number, offset: number): void; - pause(): void; - resume(): void; - pauseTopics(topics: Array /* Array */): void; - resumeTopics(topics: Array /* Array */): void; - close(force: boolean, cb: () => any): void; -} - -export declare class ConsumerGroup { - constructor(options: ConsumerGroupOptions, topics: string[]); - on(eventName: string, cb: (message: string) => any): void; - on(eventName: string, cb: (error: any) => any): void; - close(force: boolean, cb: (error: any) => any): void; -} - -export declare class Offset { - constructor(client: Client); - on(eventName: string, cb: () => any): void; - fetch(payloads: Array, cb: (error: any, data: any) => any): void; - commit(groupId: string, payloads: Array, cb: (error: any, data: any) => any): void; - fetchCommits(groupId: string, payloads: Array, cb: (error: any, data: any) => any): void; - fetchLatestOffsets(topics: Array, cb: (error: any, data: any) => any): void; - fetchEarliestOffsets(topics: Array, cb: (error: any, data: any) => any): void; - on(eventName: string, cb: (error: any) => any): void; -} - -export declare class KeyedMessage { - constructor(key: string, message: string); -} - -// # Interfaces -export interface AckBatchOptions { - noAckBatchSize: number | null, - noAckBatchAge: number | null -} - -export interface ZKOptions { - sessionTimeout?: number; - spinDelay?: number; - retries?: number; -} - -export interface ProduceRequest { - topic: string; - messages: any; // Array | Array | string | KeyedMessage - key?: any; - partition?: number; - attributes?: number; -} - -export interface ConsumerOptions { - groupId?: string; - id?: string; - autoCommit?: boolean; - autoCommitIntervalMs?: number; - fetchMaxWaitMs?: number; - fetchMinBytes?: number; - fetchMaxBytes?: number; - fromOffset?: boolean; - encoding?: string; -} - -export interface CustomPartitionAssignmentProtocol { - name: string; - version: number; - userData: {}; - assign: (topicPattern: any, groupMembers: any, callback: (error: any, result: any) => void) => void; -} - -export interface ConsumerGroupOptions { - host: string; - zk?: ZKOptions; - batch?: AckBatchOptions; - ssl?: boolean; - id: string; - groupId: string; - sessionTimeout: number; - protocol: Array<"roundrobin" | "range" | CustomPartitionAssignmentProtocol>; - fromOffset: "earliest" | "latest" | "none"; - migrateHLC: false; - migrateRolling: true; -} - -export interface Topic { - topic: string; - offset?: number; - encoding?: string; - autoCommit?: boolean; -} - -export interface OffsetRequest { - topic: string; - partition?: number; - time?: number; - maxNum?: number; -} - -export interface OffsetCommitRequest { - topic: string; - partition?: number; - offset: number; - metadata?: string; -} - -export interface OffsetFetchRequest { - topic: string; - partition?: number; - offset?: number; -} diff --git a/karma-coverage/tsconfig.json b/karma-coverage/tsconfig.json deleted file mode 100644 index 57290fb7be..0000000000 --- a/karma-coverage/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "karma-coverage-tests.ts" - ] -} \ No newline at end of file diff --git a/karma/index.d.ts b/karma/index.d.ts deleted file mode 100644 index 8cae4a0fa4..0000000000 --- a/karma/index.d.ts +++ /dev/null @@ -1,403 +0,0 @@ -// Type definitions for karma v0.13.9 -// Project: https://github.com/karma-runner/karma -// Definitions by: Tanguy Krotoff -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// -/// - -// See Karma public API https://karma-runner.github.io/0.13/dev/public-api.html -import Promise = require('bluebird'); -import https = require('https'); -import log4js = require('log4js'); - -declare namespace karma { - interface Karma { - /** - * `start` method is deprecated since 0.13. It will be removed in 0.14. - * Please use - * - * server = new Server(config, [done]) - * server.start() - * - * instead. - */ - server: DeprecatedServer; - Server: Server; - runner: Runner; - stopper: Stopper; - launcher: Launcher; - VERSION: string; - } - - interface LauncherStatic { - generateId(): string; - //TODO: injector should be of type `di.Injector` - new (emitter: NodeJS.EventEmitter, injector: any): Launcher; - } - - interface Launcher { - Launcher: LauncherStatic; - //TODO: Can this return value ever be typified? - launch(names: string[], protocol: string, hostname: string, port: number, urlRoot: string): any[]; - kill(id: string, callback: Function): boolean; - restart(id: string): boolean; - killAll(callback: Function): void; - areAllCaptured(): boolean; - markCaptured(id: string): void; - } - - interface DeprecatedServer { - start(options?: any, callback?: ServerCallback): void; - } - - interface Runner { - run(options?: ConfigOptions | ConfigFile, callback?: ServerCallback): void; - } - - - interface Stopper { - /** - * This function will signal a running server to stop. The equivalent of karma stop. - */ - stop(options?: ConfigOptions, callback?: ServerCallback): void; - } - - - interface TestResults { - disconnected: boolean; - error: boolean; - exitCode: number; - failed: number; - success: number; - } - - interface Server extends NodeJS.EventEmitter { - new (options?: ConfigOptions | ConfigFile, callback?: ServerCallback): Server; - /** - * Start the server - */ - start(): void; - /** - * Get properties from the injector - * @param token - */ - get(token: string): any; - /** - * Force a refresh of the file list - */ - refreshFiles(): Promise; - - on(event: string, listener: Function): this; - - /** - * Listen to the 'run_complete' event. - */ - on(event: 'run_complete', listener: (browsers: any, results: TestResults) => void): this; - - ///** - // * Backward-compatibility with karma-intellij bundled with WebStorm. - // * Deprecated since version 0.13, to be removed in 0.14 - // */ - //static start(): void; - } - - interface ServerCallback { - (exitCode: number): void; - } - - interface Config { - set: (config: ConfigOptions) => void; - LOG_DISABLE: string; - LOG_ERROR: string; - LOG_WARN: string; - LOG_INFO: string; - LOG_DEBUG: string; - } - - interface ConfigFile { - configFile: string; - } - - interface ConfigOptions { - /** - * @description Enable or disable watching files and executing the tests whenever one of these files changes. - * @default true - */ - autoWatch?: boolean; - /** - * @description When Karma is watching the files for changes, it tries to batch multiple changes into a single run - * so that the test runner doesn't try to start and restart running tests more than it should. - * The configuration setting tells Karma how long to wait (in milliseconds) after any changes have occurred - * before starting the test process again. - * @default 250 - */ - autoWatchBatchDelay?: number; - /** - * @default '' - * @description The root path location that will be used to resolve all relative paths defined in files and exclude. - * If the basePath configuration is a relative path then it will be resolved to - * the __dirname of the configuration file. - */ - basePath?: string; - /** - * @default 2000 - * @description How long does Karma wait for a browser to reconnect (in ms). - *

              - * With a flaky connection it is pretty common that the browser disconnects, - * but the actual test execution is still running without any problems. Karma does not treat a disconnection - * as immediate failure and will wait browserDisconnectTimeout (ms). - * If the browser reconnects during that time, everything is fine. - *

              - */ - browserDisconnectTimeout?: number; - /** - * @default 0 - * @description The number of disconnections tolerated. - *

              - * The disconnectTolerance value represents the maximum number of tries a browser will attempt - * in the case of a disconnection. Usually any disconnection is considered a failure, - * but this option allows you to define a tolerance level when there is a flaky network link between - * the Karma server and the browsers. - *

              - */ - browserDisconnectTolerance?: number; - /** - * @default 10000 - * @description How long will Karma wait for a message from a browser before disconnecting from it (in ms). - *

              - * If, during test execution, Karma does not receive any message from a browser within - * browserNoActivityTimeout (ms), it will disconnect from the browser - *

              - */ - browserNoActivityTimeout?: number; - /** - * @default [] - * Possible Values: - *
                - *
              • Chrome (launcher comes installed with Karma)
              • - *
              • ChromeCanary (launcher comes installed with Karma)
              • - *
              • PhantomJS (launcher comes installed with Karma)
              • - *
              • Firefox (launcher requires karma-firefox-launcher plugin)
              • - *
              • Opera (launcher requires karma-opera-launcher plugin)
              • - *
              • Internet Explorer (launcher requires karma-ie-launcher plugin)
              • - *
              • Safari (launcher requires karma-safari-launcher plugin)
              • - *
              - * @description A list of browsers to launch and capture. When Karma starts up, it will also start up each browser - * which is placed within this setting. Once Karma is shut down, it will shut down these browsers as well. - * You can capture any browser manually by opening the browser and visiting the URL where - * the Karma web server is listening (by default it is http://localhost:9876/). - */ - browsers?: string[]; - /** - * @default 60000 - * @description Timeout for capturing a browser (in ms). - *

              - * The captureTimeout value represents the maximum boot-up time allowed for a - * browser to start and connect to Karma. If any browser does not get captured within the timeout, Karma - * will kill it and try to launch it again and, after three attempts to capture it, Karma will give up. - *

              - */ - captureTimeout?: number; - client?: ClientOptions; - /** - * @default true - * @description Enable or disable colors in the output (reporters and logs). - */ - colors?: boolean; - /** - * @default [] - * @description List of files/patterns to exclude from loaded files. - */ - exclude?: string[]; - /** - * @default [] - * @description List of files/patterns to load in the browser. - */ - files?: (FilePattern | string)[]; - /** - * @default [] - * @description List of test frameworks you want to use. Typically, you will set this to ['jasmine'], ['mocha'] or ['qunit']... - * Please note just about all frameworks in Karma require an additional plugin/framework library to be installed (via NPM). - */ - frameworks?: string[]; - /** - * @default 'localhost' - * @description Hostname to be used when capturing browsers. - */ - hostname?: string; - /** - * @default {} - * @description Options object to be used by Node's https class. - * Object description can be found in the - * [NodeJS.org API docs](https://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener) - */ - httpsServerOptions?: https.ServerOptions; - /** - * @default config.LOG_INFO - * Possible values: - *
                - *
              • config.LOG_DISABLE
              • - *
              • config.LOG_ERROR
              • - *
              • config.LOG_WARN
              • - *
              • config.LOG_INFO
              • - *
              • config.LOG_DEBUG
              • - *
              - * @description Level of logging. - */ - logLevel?: string; - /** - * @default [{type: 'console'}] - * @description A list of log appenders to be used. See the documentation for [log4js] for more information. - */ - loggers?: log4js.AppenderConfigBase[]; - /** - * @default ['karma-*'] - * @description List of plugins to load. A plugin can be a string (in which case it will be required - * by Karma) or an inlined plugin - Object. - * By default, Karma loads all sibling NPM modules which have a name starting with karma-*. - * Note: Just about all plugins in Karma require an additional library to be installed (via NPM). - */ - plugins?: any[]; - /** - * @default 9876 - * @description The port where the web server will be listening. - */ - port?: number; - /** - * @default {'**\/*.coffee': 'coffee'} - * @description A map of preprocessors to use. - * - * Preprocessors can be loaded through [plugins]. - * - * Note: Just about all preprocessors in Karma (other than CoffeeScript and some other defaults) - * require an additional library to be installed (via NPM). - * - * Be aware that preprocessors may be transforming the files and file types that are available at run time. For instance, - * if you are using the "coverage" preprocessor on your source files, if you then attempt to interactively debug - * your tests, you'll discover that your expected source code is completely changed from what you expected. Because - * of that, you'll want to engineer this so that your automated builds use the coverage entry in the "reporters" list, - * but your interactive debugging does not. - * - */ - preprocessors?: { [name: string]: string | string[] } - /** - * @default 'http:' - * Possible Values: - *
                - *
              • http:
              • - *
              • https:
              • - *
              - * @description Protocol used for running the Karma webserver. - * Determines the use of the Node http or https class. - * Note: Using 'https:' requires you to specify httpsServerOptions. - */ - protocol?: string; - /** - * @default {} - * @description A map of path-proxy pairs. - */ - proxies?: { [path: string]: string } - /** - * @default true - * @description Whether or not Karma or any browsers should raise an error when an inavlid SSL certificate is found. - */ - proxyValidateSSL?: boolean; - /** - * @default 0 - * @description Karma will report all the tests that are slower than given time limit (in ms). - * This is disabled by default (since the default value is 0). - */ - reportSlowerThan?: number; - /** - * @default ['progress'] - * Possible Values: - *
                - *
              • dots
              • - *
              • progress
              • - *
              - * @description A list of reporters to use. - * Additional reporters, such as growl, junit, teamcity or coverage can be loaded through plugins. - * Note: Just about all additional reporters in Karma (other than progress) require an additional library to be installed (via NPM). - */ - reporters?: string[]; - /** - * @default false - * @description Continuous Integration mode. - * If true, Karma will start and capture all configured browsers, run tests and then exit with an exit code of 0 or 1 depending - * on whether all tests passed or any tests failed. - */ - singleRun?: boolean; - /** - * @default ['polling', 'websocket'] - * @description An array of allowed transport methods between the browser and testing server. This configuration setting - * is handed off to [socket.io](http://socket.io/) (which manages the communication - * between browsers and the testing server). - */ - transports?: string[]; - /** - * @default '/' - * @description The base url, where Karma runs. - * All of Karma's urls get prefixed with the urlRoot. This is helpful when using proxies, as - * sometimes you might want to proxy a url that is already taken by Karma. - */ - urlRoot?: string; - } - - interface ClientOptions { - /** - * @default undefined - * @description When karma run is passed additional arguments on the command-line, they - * are passed through to the test adapter as karma.config.args (an array of strings). - * The client.args option allows you to set this value for actions other than run. - * How this value is used is up to your test adapter - you should check your adapter's - * documentation to see how (and if) it uses this value. - */ - args?: string[]; - /** - * @default true - * @description Run the tests inside an iFrame or a new window - * If true, Karma runs the tests inside an iFrame. If false, Karma runs the tests in a new window. Some tests may not run in an - * iFrame and may need a new window to run. - */ - useIframe?: boolean; - /** - * @default true - * @description Capture all console output and pipe it to the terminal. - */ - captureConsole?: boolean; - } - - interface FilePattern { - /** - * The pattern to use for matching. This property is mandatory. - */ - pattern: string; - /** - * @default true - * @description If autoWatch is true all files that have set watched to true will be watched - * for changes. - */ - watched?: boolean; - /** - * @default true - * @description Should the files be included in the browser using + * + * @example + * AMD + * // main.js + * require.config({ + * paths: { + * braintreeClient: 'https://js.braintreegateway.com/web/3.0.2/js/client.min' + * } + * }); + * + * require(['braintreeClient'], function (braintreeClient) { + * braintreeClient.create(...); + * }); + */ +declare namespace braintree { + /** @type {module:braintree-web/client} */ + export var client: braintree.Client; + + /** @type {module:braintree-web/paypal} */ + export var paypal: braintree.PayPal; + + /** @type {module:braintree-web/hosted-fields} */ + export var hostedFields: braintree.HostedFields; + + /** @type {module:braintree-web/three-d-secure} */ + export var threeDSecure: braintree.ThreeDSecure; + + /** @type {module:braintree-web/data-collector} */ + export var dataCollector: braintree.DataCollector; + + /** @type {module:braintree-web/american-express} */ + export var americanExpress: braintree.AmericanExpress; + + /** @type {module:braintree-web/unionpay} */ + export var unionpay: braintree.UnionPay; + + /** @type {module:braintree-web/apple-pay} */ + export var applePay: braintree.ApplePay; + + /** @type {module:braintree-web/us-bank-account} */ + export var usBankAccount: braintree.USBankAccount; + + /** + * @description The current version of the SDK, i.e. `3.0.2`. + * @type {string} + */ + export var VERSION: string; +} + +export = braintree; +export as namespace braintree; diff --git a/types/braintree-web/test/node.ts b/types/braintree-web/test/node.ts new file mode 100644 index 0000000000..9eed5b228d --- /dev/null +++ b/types/braintree-web/test/node.ts @@ -0,0 +1,440 @@ +import * as braintree from 'braintree-web'; + +let version: string = braintree.VERSION; + +let clientToken: string = "eyJ2ZXJzaW9uIjoyLCJhdXRob3JpemF0aW9uRmluZ2VycHJpbnQiOiI0YjlhYzVmYmI4ZTNkYzQzMmFkZjJhNzBlNjZlMWNjY2M5ODRkYzE4ZTM4YmY4NjYzZTM5NjM3NWZjYmQzY2U5fGNyZWF0ZWRfYXQ9MjAxNi0wOS0wOFQwNTowMzo0MC4xNjk1NTUwMzUrMDAwMFx1MDAyNm1lcmNoYW50X2lkPTM0OHBrOWNnZjNiZ3l3MmJcdTAwMjZwdWJsaWNfa2V5PTJuMjQ3ZHY4OWJxOXZtcHIiLCJjb25maWdVcmwiOiJodHRwczovL2FwaS5zYW5kYm94LmJyYWludHJlZWdhdGV3YXkuY29tOjQ0My9tZXJjaGFudHMvMzQ4cGs5Y2dmM2JneXcyYi9jbGllbnRfYXBpL3YxL2NvbmZpZ3VyYXRpb24iLCJjaGFsbGVuZ2VzIjpbXSwiZW52aXJvbm1lbnQiOiJzYW5kYm94IiwiY2xpZW50QXBpVXJsIjoiaHR0cHM6Ly9hcGkuc2FuZGJveC5icmFpbnRyZWVnYXRld2F5LmNvbTo0NDMvbWVyY2hhbnRzLzM0OHBrOWNnZjNiZ3l3MmIvY2xpZW50X2FwaSIsImFzc2V0c1VybCI6Imh0dHBzOi8vYXNzZXRzLmJyYWludHJlZWdhdGV3YXkuY29tIiwiYXV0aFVybCI6Imh0dHBzOi8vYXV0aC52ZW5tby5zYW5kYm94LmJyYWludHJlZWdhdGV3YXkuY29tIiwiYW5hbHl0aWNzIjp7InVybCI6Imh0dHBzOi8vY2xpZW50LWFuYWx5dGljcy5zYW5kYm94LmJyYWludHJlZWdhdGV3YXkuY29tLzM0OHBrOWNnZjNiZ3l3MmIifSwidGhyZWVEU2VjdXJlRW5hYmxlZCI6dHJ1ZSwicGF5cGFsRW5hYmxlZCI6dHJ1ZSwicGF5cGFsIjp7ImRpc3BsYXlOYW1lIjoiQWNtZSBXaWRnZXRzLCBMdGQuIChTYW5kYm94KSIsImNsaWVudElkIjpudWxsLCJwcml2YWN5VXJsIjoiaHR0cDovL2V4YW1wbGUuY29tL3BwIiwidXNlckFncmVlbWVudFVybCI6Imh0dHA6Ly9leGFtcGxlLmNvbS90b3MiLCJiYXNlVXJsIjoiaHR0cHM6Ly9hc3NldHMuYnJhaW50cmVlZ2F0ZXdheS5jb20iLCJhc3NldHNVcmwiOiJodHRwczovL2NoZWNrb3V0LnBheXBhbC5jb20iLCJkaXJlY3RCYXNlVXJsIjpudWxsLCJhbGxvd0h0dHAiOnRydWUsImVudmlyb25tZW50Tm9OZXR3b3JrIjp0cnVlLCJlbnZpcm9ubWVudCI6Im9mZmxpbmUiLCJ1bnZldHRlZE1lcmNoYW50IjpmYWxzZSwiYnJhaW50cmVlQ2xpZW50SWQiOiJtYXN0ZXJjbGllbnQzIiwiYmlsbGluZ0FncmVlbWVudHNFbmFibGVkIjp0cnVlLCJtZXJjaGFudEFjY291bnRJZCI6ImFjbWV3aWRnZXRzbHRkc2FuZGJveCIsImN1cnJlbmN5SXNvQ29kZSI6IlVTRCJ9LCJjb2luYmFzZUVuYWJsZWQiOmZhbHNlLCJtZXJjaGFudElkIjoiMzQ4cGs5Y2dmM2JneXcyYiIsInZlbm1vIjoib2ZmIn0="; + +braintree.client.create({ + authorization: clientToken +}, function (error: braintree.BraintreeError, clientInstance: any) { + + var form: HTMLFormElement = document.getElementById('my-form-id') as HTMLFormElement; + var data: { creditCard: braintree.CreditCardInfo } = { + creditCard: { + number: form['cc-number'].value, + cvv: form['cc-cvv'].value, + expirationDate: form['cc-date'].value, + billingAddress: { + postalCode: form['cc-postal'].value + } + } + }; + + clientInstance.request({ + endpoint: 'payment_methods/credit_cards', + method: 'post', + data: data + }, function (requestErr: braintree.BraintreeError, response: { creditCards: any[]; }) { + if (requestErr) { throw new Error(requestErr.message); } + + console.log('Got nonce:', response.creditCards[0].nonce); + }); + + braintree.hostedFields.create({ + client: clientInstance, + styles: { + 'input': { + 'font-size': '16pt', + 'color': '#3A3A3A' + }, + + '.number': { + 'font-family': 'monospace' + }, + '.valid': { + 'color': 'green' + } + }, + fields: { + number: { + selector: '#card-number' + }, + cvv: { + selector: '#cvv', + type: 'password' + }, + expirationMonth: { + selector: '#expiration-month', + select: { + options: ["01 - Jan", "02 - Feb", "03 - Mar", "04 - Apr", "05 - May", "06 - Jun", "07 - Jul", "08 - Aug", "09 - Sep", "10 - Oct", "11 - Nov", "12 - Dec"] + } + }, + expirationYear: { + selector: '#expiration-year', + select: true + } + } + }, function (hostedFieldsErr?: braintree.BraintreeError, hostedFieldsInstance?: any) { + + if (hostedFieldsErr) { + // Handle error in Hosted Fields creation + console.log(`Error Code: ${error.code}, Type: ${error.type}, Message: ${error.message}, Details: ${error.details}`); + return; + } + + let form = new HTMLFormElement(); + + form.addEventListener('submit', function (event: Event) { + event.preventDefault(); + + hostedFieldsInstance.tokenize(function (tokenizeErr: braintree.BraintreeError, payload: braintree.HostedFieldsTokenizePayload) { + if (tokenizeErr) { + // Handle error in Hosted Fields tokenization + switch (tokenizeErr.code) { + case 'HOSTED_FIELDS_FIELDS_EMPTY': + console.error('All fields are empty! Please fill out the form.'); + break; + case 'HOSTED_FIELDS_FIELDS_INVALID': + console.error('Some fields are invalid:', tokenizeErr.details.invalidFieldKeys); + break; + case 'HOSTED_FIELDS_FAILED_TOKENIZATION': + console.error('Tokenization failed server side. Is the card valid?'); + break; + case 'HOSTED_FIELDS_TOKENIZATION_NETWORK_ERROR': + console.error('Network error occurred when tokenizing.'); + break; + default: + console.error('Something bad happened!', tokenizeErr); + } + return; + } + + // Put `payload.nonce` into the `payment-method-nonce` input, and then + // submit the form. Alternatively, you could send the nonce to your server + // with AJAX. + (document.querySelector('input[name="payment-method-nonce"]') as HTMLInputElement).value = payload.nonce; + form.submit(); + }); + }, false); + + hostedFieldsInstance.on('focus', function (event: braintree.HostedFieldsStateObject) { + console.log(event.emittedBy, 'has been focused'); + }); + + hostedFieldsInstance.teardown(function (teardownErr: braintree.BraintreeError) { + if (teardownErr) { + console.error('Could not tear down Hosted Fields!'); + } else { + console.info('Hosted Fields has been torn down!'); + } + }); + + hostedFieldsInstance.tokenize({ + vault: true + }, function (tokenizeErr: braintree.BraintreeError, payload: braintree.HostedFieldsTokenizePayload) { + if (tokenizeErr) { + console.error(tokenizeErr); + } else { + console.log('Got nonce:', payload.nonce); + } + }); + + hostedFieldsInstance.addClass('number', 'custom-class', function (addClassErr: braintree.BraintreeError) { + if (addClassErr) { + console.error(addClassErr); + } + }); + + hostedFieldsInstance.addClass('number', 'custom-class', function (addClassErr: braintree.BraintreeError) { + if (addClassErr) { + console.error(addClassErr); + return; + } + + // some time later... + hostedFieldsInstance.removeClass('number', 'custom-class'); + }); + + hostedFieldsInstance.setPlaceholder('number', '4111 1111 1111 1111', function (placeholderErr: braintree.BraintreeError) { + if (placeholderErr) { + console.error(placeholderErr); + } + }); + + hostedFieldsInstance.on('cardTypeChange', function (event: braintree.HostedFieldsStateObject) { + // Update the placeholder value if there is only one possible card type + if (event.cards.length === 1) { + braintree.hostedFields.setPlaceholder('cvv', event.cards[0].code.name, function (placeholderErr: braintree.BraintreeError) { + if (placeholderErr) { + // Handle errors, such as invalid field name + console.error(placeholderErr); + } + }); + } + }); + + hostedFieldsInstance.clear('number', function (clearErr: braintree.BraintreeError) { + if (clearErr) { + console.error(clearErr); + } + }); + + hostedFieldsInstance.clear('number'); + hostedFieldsInstance.clear('cvv'); + hostedFieldsInstance.clear('expirationDate'); + + var state = braintree.hostedFields.getState(); + + var formValid = Object.keys(state.fields).every(function (key) { + return state.fields[key].isValid; + }); + }); + + braintree.applePay.create({ client: clientInstance }, function (createErr?: braintree.BraintreeError, applePayInstance?: any) { + if (createErr) { + // Handle error in client creation + console.log(`Error Code: ${error.code}, Type: ${error.type}, Message: ${error.message}, Details: ${error.details}`); + + return; + } + + let request = { + countryCode: 'US', + currencyCode: 'USD', + supportedNetworks: ['visa', 'masterCard'], + merchantCapabilities: ['supports3DS'], + total: { label: 'Your Label', amount: '10.00' }, + }; + + var paymentRequest = braintree.applePay.createPaymentRequest(request); + + console.log(paymentRequest); + // { total: { }, countryCode: 'US', currencyCode: 'USD', merchantCapabilities: [ ], supportedNetworks: [ ] } + }); + + braintree.applePay.create({ client: clientInstance }, function (createErr, applePayInstance) { + let request = { + countryCode: 'US', + currencyCode: 'USD', + supportedNetworks: ['visa', 'masterCard'], + merchantCapabilities: ['supports3DS'], + total: { label: 'Your Label', amount: '10.00' }, + }; + + var session = new braintree.ApplePaySession(1, request); + + session.onvalidatemerchant = function (event: { validationURL: string }) { + braintree.applePay.performValidation({ + validationURL: event.validationURL + }, function (err, validationData) { + if (err) { + console.error(err); + session.abort(); + return; + } + session.completeMerchantValidation(validationData); + }); + }; + }); + + braintree.applePay.create({ client: clientInstance }, function (createErr, applePayInstance) { + let request = { + countryCode: 'US', + currencyCode: 'USD', + supportedNetworks: ['visa', 'masterCard'], + merchantCapabilities: ['supports3DS'], + total: { label: 'Your Label', amount: '10.00' }, + }; + + var session = new braintree.ApplePaySession(1, request); + + session.onpaymentauthorized = function (event) { + braintree.applePay.tokenize({ + token: event.payment.token + }, function (err, tokenizedPayload) { + if (err) { + session.completePayment(braintree.ApplePayStatusCodes.STATUS_FAILURE); + return; + } + session.completePayment(braintree.ApplePayStatusCodes.STATUS_SUCCESS); + + // Send the tokenizedPayload to your server. + }); + }; + }); + + braintree.paypal.create({ + client: clientInstance + }, function (createErr, paypalInstance) { + if (createErr) { + if (createErr.code === 'PAYPAL_BROWSER_NOT_SUPPORTED') { + console.error('This browser is not supported.'); + } else { + console.error('Error!', createErr); + } + } + + let button = new HTMLButtonElement(); + + button.addEventListener('click', function () { + // Disable the button so that we don't attempt to open multiple popups. + button.setAttribute('disabled', 'disabled'); + + // Because PayPal tokenization opens a popup, this must be called + // as a result of a user action, such as a button click. + paypalInstance.tokenize({ + flow: 'vault' // Required + // Any other tokenization options + }, function (tokenizeErr: braintree.BraintreeError, payload: braintree.PayPalTokenizePayload) { + button.removeAttribute('disabled'); + + if (tokenizeErr) { + // Handle tokenization errors or premature flow closure + + switch (tokenizeErr.code) { + case 'PAYPAL_POPUP_CLOSED': + console.error('Customer closed PayPal popup.'); + break; + case 'PAYPAL_ACCOUNT_TOKENIZATION_FAILED': + console.error('PayPal tokenization failed. See details:', tokenizeErr.details); + break; + case 'PAYPAL_FLOW_FAILED': + console.error('Unable to initialize PayPal flow. Are your options correct?', tokenizeErr.details); + break; + default: + console.error('Error!', tokenizeErr); + } + } else { + // Submit payload.nonce to your server + } + }); + }); + }); + + braintree.unionpay.create({ client: clientInstance }, function (createErr, unionpayInstance) { + if (createErr) { + console.error(createErr); + return; + } + + unionpayInstance.fetchCapabilities({ + card: { + number: '4111111111111111' + } + }, function (fetchErr: braintree.BraintreeError, cardCapabilities: braintree.UnionPayFetchCapabilitiesPayload) { + if (fetchErr) { + console.error(fetchErr); + return; + } + + if (cardCapabilities.isUnionPay) { + if (cardCapabilities.unionPay && !cardCapabilities.unionPay.isSupported) { + // Braintree cannot process this UnionPay card. + // Ask the user for a different card. + return; + } + + if (cardCapabilities.isDebit) { + // CVV and expiration date are not required + } else { + // CVV and expiration date are required + } + + // Show mobile phone number field for enrollment + } + }); + + unionpayInstance.enroll({ + card: { + number: '4111111111111111', + expirationMonth: '12', + expirationYear: '2038' + }, + mobile: { + countryCode: '62', + number: '111111111111' + } + }, function (enrollErr: braintree.BraintreeError, response: braintree.UnionPayEnrollPayload) { + if (enrollErr) { + console.error(enrollErr); + return; + } + + if (response.smsCodeRequired) { + // If smsCodeRequired, wait for SMS auth code from customer + // Then use response.enrollmentId during {@link UnionPay#tokenize} + } else { + // SMS code is not required from the user. + // {@link UnionPay#tokenize} can be called immediately + } + }); + + let enrollResponse: { + enrollmentId: string + }; + + unionpayInstance.tokenize({ + card: { + number: '4111111111111111', + expirationMonth: '12', + expirationYear: '2038', + cvv: '123' + }, + enrollmentId: enrollResponse.enrollmentId, // Returned from enroll + smsCode: '11111' // Received by customer's phone, if SMS enrollment was required. Otherwise it should be omitted + }, function (tokenizeErr: braintree.BraintreeError, response: braintree.UnionPayTokenizePayload) { + if (tokenizeErr) { + console.error(tokenizeErr); + return; + } + + // Send response.nonce to your server + }); + + unionpayInstance.teardown(function (teardownErr: braintree.BraintreeError) { + if (teardownErr) { + console.error('Could not tear down UnionPay.'); + } else { + console.log('UnionPay has been torn down.'); + } + }); + }); +}); + +let existingNonce = "fake-valid-nonce"; +let submitNonceToServer: (nonce: string) => void; + +braintree.threeDSecure.verifyCard({ + nonce: existingNonce, + amount: 123.45, + addFrame: function (err, iframe) { + // Set up your UI and add the iframe. + let my3DSContainer = document.createElement('div'); + my3DSContainer.appendChild(iframe); + document.body.appendChild(my3DSContainer); + }, + removeFrame: function () { + let my3DSContainer = document.createElement('div'); + + // Remove UI that you added in addFrame. + document.body.removeChild(my3DSContainer); + } +}, function (err: braintree.BraintreeError, payload: braintree.ThreeDSecureVerifyPayload) { + if (err) { + console.error(err); + return; + } + + if (payload.liabilityShifted) { + // Liablity has shifted + submitNonceToServer(payload.nonce); + } else if (payload.liabilityShiftPossible) { + // Liablity may still be shifted + // Decide if you want to submit the nonce + } else { + // Liablity has not shifted and will not shift + // Decide if you want to submit the nonce + } +}); + +braintree.threeDSecure.cancelVerifyCard(function (err: braintree.BraintreeError, verifyPayload: braintree.ThreeDSecureVerifyPayload) { + if (err) { + // Handle error + console.log(err.message); // No verification payload available + return; + } + + verifyPayload.nonce; // The nonce returned from the 3ds lookup call + verifyPayload.liabilityShifted; // boolean + verifyPayload.liabilityShiftPossible; // boolean +}); diff --git a/types/braintree-web/test/web.ts b/types/braintree-web/test/web.ts new file mode 100644 index 0000000000..22073363d4 --- /dev/null +++ b/types/braintree-web/test/web.ts @@ -0,0 +1,438 @@ +let version: string = braintree.VERSION; + +let clientToken: string = "eyJ2ZXJzaW9uIjoyLCJhdXRob3JpemF0aW9uRmluZ2VycHJpbnQiOiI0YjlhYzVmYmI4ZTNkYzQzMmFkZjJhNzBlNjZlMWNjY2M5ODRkYzE4ZTM4YmY4NjYzZTM5NjM3NWZjYmQzY2U5fGNyZWF0ZWRfYXQ9MjAxNi0wOS0wOFQwNTowMzo0MC4xNjk1NTUwMzUrMDAwMFx1MDAyNm1lcmNoYW50X2lkPTM0OHBrOWNnZjNiZ3l3MmJcdTAwMjZwdWJsaWNfa2V5PTJuMjQ3ZHY4OWJxOXZtcHIiLCJjb25maWdVcmwiOiJodHRwczovL2FwaS5zYW5kYm94LmJyYWludHJlZWdhdGV3YXkuY29tOjQ0My9tZXJjaGFudHMvMzQ4cGs5Y2dmM2JneXcyYi9jbGllbnRfYXBpL3YxL2NvbmZpZ3VyYXRpb24iLCJjaGFsbGVuZ2VzIjpbXSwiZW52aXJvbm1lbnQiOiJzYW5kYm94IiwiY2xpZW50QXBpVXJsIjoiaHR0cHM6Ly9hcGkuc2FuZGJveC5icmFpbnRyZWVnYXRld2F5LmNvbTo0NDMvbWVyY2hhbnRzLzM0OHBrOWNnZjNiZ3l3MmIvY2xpZW50X2FwaSIsImFzc2V0c1VybCI6Imh0dHBzOi8vYXNzZXRzLmJyYWludHJlZWdhdGV3YXkuY29tIiwiYXV0aFVybCI6Imh0dHBzOi8vYXV0aC52ZW5tby5zYW5kYm94LmJyYWludHJlZWdhdGV3YXkuY29tIiwiYW5hbHl0aWNzIjp7InVybCI6Imh0dHBzOi8vY2xpZW50LWFuYWx5dGljcy5zYW5kYm94LmJyYWludHJlZWdhdGV3YXkuY29tLzM0OHBrOWNnZjNiZ3l3MmIifSwidGhyZWVEU2VjdXJlRW5hYmxlZCI6dHJ1ZSwicGF5cGFsRW5hYmxlZCI6dHJ1ZSwicGF5cGFsIjp7ImRpc3BsYXlOYW1lIjoiQWNtZSBXaWRnZXRzLCBMdGQuIChTYW5kYm94KSIsImNsaWVudElkIjpudWxsLCJwcml2YWN5VXJsIjoiaHR0cDovL2V4YW1wbGUuY29tL3BwIiwidXNlckFncmVlbWVudFVybCI6Imh0dHA6Ly9leGFtcGxlLmNvbS90b3MiLCJiYXNlVXJsIjoiaHR0cHM6Ly9hc3NldHMuYnJhaW50cmVlZ2F0ZXdheS5jb20iLCJhc3NldHNVcmwiOiJodHRwczovL2NoZWNrb3V0LnBheXBhbC5jb20iLCJkaXJlY3RCYXNlVXJsIjpudWxsLCJhbGxvd0h0dHAiOnRydWUsImVudmlyb25tZW50Tm9OZXR3b3JrIjp0cnVlLCJlbnZpcm9ubWVudCI6Im9mZmxpbmUiLCJ1bnZldHRlZE1lcmNoYW50IjpmYWxzZSwiYnJhaW50cmVlQ2xpZW50SWQiOiJtYXN0ZXJjbGllbnQzIiwiYmlsbGluZ0FncmVlbWVudHNFbmFibGVkIjp0cnVlLCJtZXJjaGFudEFjY291bnRJZCI6ImFjbWV3aWRnZXRzbHRkc2FuZGJveCIsImN1cnJlbmN5SXNvQ29kZSI6IlVTRCJ9LCJjb2luYmFzZUVuYWJsZWQiOmZhbHNlLCJtZXJjaGFudElkIjoiMzQ4cGs5Y2dmM2JneXcyYiIsInZlbm1vIjoib2ZmIn0="; + +braintree.client.create({ + authorization: clientToken +}, function (error: braintree.BraintreeError, clientInstance: any) { + + var form: HTMLFormElement = document.getElementById('my-form-id') as HTMLFormElement; + var data: { creditCard: braintree.CreditCardInfo } = { + creditCard: { + number: form['cc-number'].value, + cvv: form['cc-cvv'].value, + expirationDate: form['cc-date'].value, + billingAddress: { + postalCode: form['cc-postal'].value + } + } + }; + + clientInstance.request({ + endpoint: 'payment_methods/credit_cards', + method: 'post', + data: data + }, function (requestErr: braintree.BraintreeError, response: { creditCards: any[]; }) { + if (requestErr) { throw new Error(requestErr.message); } + + console.log('Got nonce:', response.creditCards[0].nonce); + }); + + braintree.hostedFields.create({ + client: clientInstance, + styles: { + 'input': { + 'font-size': '16pt', + 'color': '#3A3A3A' + }, + + '.number': { + 'font-family': 'monospace' + }, + '.valid': { + 'color': 'green' + } + }, + fields: { + number: { + selector: '#card-number' + }, + cvv: { + selector: '#cvv', + type: 'password' + }, + expirationMonth: { + selector: '#expiration-month', + select: { + options: ["01 - Jan", "02 - Feb", "03 - Mar", "04 - Apr", "05 - May", "06 - Jun", "07 - Jul", "08 - Aug", "09 - Sep", "10 - Oct", "11 - Nov", "12 - Dec"] + } + }, + expirationYear: { + selector: '#expiration-year', + select: true + } + } + }, function (hostedFieldsErr?: braintree.BraintreeError, hostedFieldsInstance?: any) { + + if (hostedFieldsErr) { + // Handle error in Hosted Fields creation + console.log(`Error Code: ${error.code}, Type: ${error.type}, Message: ${error.message}, Details: ${error.details}`); + return; + } + + let form = new HTMLFormElement(); + + form.addEventListener('submit', function (event: Event) { + event.preventDefault(); + + hostedFieldsInstance.tokenize(function (tokenizeErr: braintree.BraintreeError, payload: braintree.HostedFieldsTokenizePayload) { + if (tokenizeErr) { + // Handle error in Hosted Fields tokenization + switch (tokenizeErr.code) { + case 'HOSTED_FIELDS_FIELDS_EMPTY': + console.error('All fields are empty! Please fill out the form.'); + break; + case 'HOSTED_FIELDS_FIELDS_INVALID': + console.error('Some fields are invalid:', tokenizeErr.details.invalidFieldKeys); + break; + case 'HOSTED_FIELDS_FAILED_TOKENIZATION': + console.error('Tokenization failed server side. Is the card valid?'); + break; + case 'HOSTED_FIELDS_TOKENIZATION_NETWORK_ERROR': + console.error('Network error occurred when tokenizing.'); + break; + default: + console.error('Something bad happened!', tokenizeErr); + } + return; + } + + // Put `payload.nonce` into the `payment-method-nonce` input, and then + // submit the form. Alternatively, you could send the nonce to your server + // with AJAX. + (document.querySelector('input[name="payment-method-nonce"]') as HTMLInputElement).value = payload.nonce; + form.submit(); + }); + }, false); + + hostedFieldsInstance.on('focus', function (event: braintree.HostedFieldsStateObject) { + console.log(event.emittedBy, 'has been focused'); + }); + + hostedFieldsInstance.teardown(function (teardownErr: braintree.BraintreeError) { + if (teardownErr) { + console.error('Could not tear down Hosted Fields!'); + } else { + console.info('Hosted Fields has been torn down!'); + } + }); + + hostedFieldsInstance.tokenize({ + vault: true + }, function (tokenizeErr: braintree.BraintreeError, payload: braintree.HostedFieldsTokenizePayload) { + if (tokenizeErr) { + console.error(tokenizeErr); + } else { + console.log('Got nonce:', payload.nonce); + } + }); + + hostedFieldsInstance.addClass('number', 'custom-class', function (addClassErr: braintree.BraintreeError) { + if (addClassErr) { + console.error(addClassErr); + } + }); + + hostedFieldsInstance.addClass('number', 'custom-class', function (addClassErr: braintree.BraintreeError) { + if (addClassErr) { + console.error(addClassErr); + return; + } + + // some time later... + hostedFieldsInstance.removeClass('number', 'custom-class'); + }); + + hostedFieldsInstance.setPlaceholder('number', '4111 1111 1111 1111', function (placeholderErr: braintree.BraintreeError) { + if (placeholderErr) { + console.error(placeholderErr); + } + }); + + hostedFieldsInstance.on('cardTypeChange', function (event: braintree.HostedFieldsStateObject) { + // Update the placeholder value if there is only one possible card type + if (event.cards.length === 1) { + braintree.hostedFields.setPlaceholder('cvv', event.cards[0].code.name, function (placeholderErr: braintree.BraintreeError) { + if (placeholderErr) { + // Handle errors, such as invalid field name + console.error(placeholderErr); + } + }); + } + }); + + hostedFieldsInstance.clear('number', function (clearErr: braintree.BraintreeError) { + if (clearErr) { + console.error(clearErr); + } + }); + + hostedFieldsInstance.clear('number'); + hostedFieldsInstance.clear('cvv'); + hostedFieldsInstance.clear('expirationDate'); + + var state = braintree.hostedFields.getState(); + + var formValid = Object.keys(state.fields).every(function (key) { + return state.fields[key].isValid; + }); + }); + + braintree.applePay.create({ client: clientInstance }, function (createErr?: braintree.BraintreeError, applePayInstance?: any) { + if (createErr) { + // Handle error in client creation + console.log(`Error Code: ${error.code}, Type: ${error.type}, Message: ${error.message}, Details: ${error.details}`); + + return; + } + + let request = { + countryCode: 'US', + currencyCode: 'USD', + supportedNetworks: ['visa', 'masterCard'], + merchantCapabilities: ['supports3DS'], + total: { label: 'Your Label', amount: '10.00' }, + }; + + var paymentRequest = braintree.applePay.createPaymentRequest(request); + + console.log(paymentRequest); + // { total: { }, countryCode: 'US', currencyCode: 'USD', merchantCapabilities: [ ], supportedNetworks: [ ] } + }); + + braintree.applePay.create({ client: clientInstance }, function (createErr, applePayInstance) { + let request = { + countryCode: 'US', + currencyCode: 'USD', + supportedNetworks: ['visa', 'masterCard'], + merchantCapabilities: ['supports3DS'], + total: { label: 'Your Label', amount: '10.00' }, + }; + + var session = new braintree.ApplePaySession(1, request); + + session.onvalidatemerchant = function (event: { validationURL: string }) { + braintree.applePay.performValidation({ + validationURL: event.validationURL + }, function (err, validationData) { + if (err) { + console.error(err); + session.abort(); + return; + } + session.completeMerchantValidation(validationData); + }); + }; + }); + + braintree.applePay.create({ client: clientInstance }, function (createErr, applePayInstance) { + let request = { + countryCode: 'US', + currencyCode: 'USD', + supportedNetworks: ['visa', 'masterCard'], + merchantCapabilities: ['supports3DS'], + total: { label: 'Your Label', amount: '10.00' }, + }; + + var session = new braintree.ApplePaySession(1, request); + + session.onpaymentauthorized = function (event) { + braintree.applePay.tokenize({ + token: event.payment.token + }, function (err, tokenizedPayload) { + if (err) { + session.completePayment(braintree.ApplePayStatusCodes.STATUS_FAILURE); + return; + } + session.completePayment(braintree.ApplePayStatusCodes.STATUS_SUCCESS); + + // Send the tokenizedPayload to your server. + }); + }; + }); + + braintree.paypal.create({ + client: clientInstance + }, function (createErr, paypalInstance) { + if (createErr) { + if (createErr.code === 'PAYPAL_BROWSER_NOT_SUPPORTED') { + console.error('This browser is not supported.'); + } else { + console.error('Error!', createErr); + } + } + + let button = new HTMLButtonElement(); + + button.addEventListener('click', function () { + // Disable the button so that we don't attempt to open multiple popups. + button.setAttribute('disabled', 'disabled'); + + // Because PayPal tokenization opens a popup, this must be called + // as a result of a user action, such as a button click. + paypalInstance.tokenize({ + flow: 'vault' // Required + // Any other tokenization options + }, function (tokenizeErr: braintree.BraintreeError, payload: braintree.PayPalTokenizePayload) { + button.removeAttribute('disabled'); + + if (tokenizeErr) { + // Handle tokenization errors or premature flow closure + + switch (tokenizeErr.code) { + case 'PAYPAL_POPUP_CLOSED': + console.error('Customer closed PayPal popup.'); + break; + case 'PAYPAL_ACCOUNT_TOKENIZATION_FAILED': + console.error('PayPal tokenization failed. See details:', tokenizeErr.details); + break; + case 'PAYPAL_FLOW_FAILED': + console.error('Unable to initialize PayPal flow. Are your options correct?', tokenizeErr.details); + break; + default: + console.error('Error!', tokenizeErr); + } + } else { + // Submit payload.nonce to your server + } + }); + }); + }); + + braintree.unionpay.create({ client: clientInstance }, function (createErr, unionpayInstance) { + if (createErr) { + console.error(createErr); + return; + } + + unionpayInstance.fetchCapabilities({ + card: { + number: '4111111111111111' + } + }, function (fetchErr: braintree.BraintreeError, cardCapabilities: braintree.UnionPayFetchCapabilitiesPayload) { + if (fetchErr) { + console.error(fetchErr); + return; + } + + if (cardCapabilities.isUnionPay) { + if (cardCapabilities.unionPay && !cardCapabilities.unionPay.isSupported) { + // Braintree cannot process this UnionPay card. + // Ask the user for a different card. + return; + } + + if (cardCapabilities.isDebit) { + // CVV and expiration date are not required + } else { + // CVV and expiration date are required + } + + // Show mobile phone number field for enrollment + } + }); + + unionpayInstance.enroll({ + card: { + number: '4111111111111111', + expirationMonth: '12', + expirationYear: '2038' + }, + mobile: { + countryCode: '62', + number: '111111111111' + } + }, function (enrollErr: braintree.BraintreeError, response: braintree.UnionPayEnrollPayload) { + if (enrollErr) { + console.error(enrollErr); + return; + } + + if (response.smsCodeRequired) { + // If smsCodeRequired, wait for SMS auth code from customer + // Then use response.enrollmentId during {@link UnionPay#tokenize} + } else { + // SMS code is not required from the user. + // {@link UnionPay#tokenize} can be called immediately + } + }); + + let enrollResponse: { + enrollmentId: string + }; + + unionpayInstance.tokenize({ + card: { + number: '4111111111111111', + expirationMonth: '12', + expirationYear: '2038', + cvv: '123' + }, + enrollmentId: enrollResponse.enrollmentId, // Returned from enroll + smsCode: '11111' // Received by customer's phone, if SMS enrollment was required. Otherwise it should be omitted + }, function (tokenizeErr: braintree.BraintreeError, response: braintree.UnionPayTokenizePayload) { + if (tokenizeErr) { + console.error(tokenizeErr); + return; + } + + // Send response.nonce to your server + }); + + unionpayInstance.teardown(function (teardownErr: braintree.BraintreeError) { + if (teardownErr) { + console.error('Could not tear down UnionPay.'); + } else { + console.log('UnionPay has been torn down.'); + } + }); + }); +}); + +let existingNonce = "fake-valid-nonce"; +let submitNonceToServer: (nonce: string) => void; + +braintree.threeDSecure.verifyCard({ + nonce: existingNonce, + amount: 123.45, + addFrame: function (err, iframe) { + // Set up your UI and add the iframe. + let my3DSContainer = document.createElement('div'); + my3DSContainer.appendChild(iframe); + document.body.appendChild(my3DSContainer); + }, + removeFrame: function () { + let my3DSContainer = document.createElement('div'); + + // Remove UI that you added in addFrame. + document.body.removeChild(my3DSContainer); + } +}, function (err: braintree.BraintreeError, payload: braintree.ThreeDSecureVerifyPayload) { + if (err) { + console.error(err); + return; + } + + if (payload.liabilityShifted) { + // Liablity has shifted + submitNonceToServer(payload.nonce); + } else if (payload.liabilityShiftPossible) { + // Liablity may still be shifted + // Decide if you want to submit the nonce + } else { + // Liablity has not shifted and will not shift + // Decide if you want to submit the nonce + } +}); + +braintree.threeDSecure.cancelVerifyCard(function (err: braintree.BraintreeError, verifyPayload: braintree.ThreeDSecureVerifyPayload) { + if (err) { + // Handle error + console.log(err.message); // No verification payload available + return; + } + + verifyPayload.nonce; // The nonce returned from the 3ds lookup call + verifyPayload.liabilityShifted; // boolean + verifyPayload.liabilityShiftPossible; // boolean +}); diff --git a/types/braintree-web/tsconfig.json b/types/braintree-web/tsconfig.json new file mode 100644 index 0000000000..d326f77f12 --- /dev/null +++ b/types/braintree-web/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "test/web.ts", + "test/node.ts" + ] +} diff --git a/breeze/breeze-tests.ts b/types/breeze/breeze-tests.ts similarity index 100% rename from breeze/breeze-tests.ts rename to types/breeze/breeze-tests.ts diff --git a/types/breeze/index.d.ts b/types/breeze/index.d.ts new file mode 100644 index 0000000000..323e9a8f87 --- /dev/null +++ b/types/breeze/index.d.ts @@ -0,0 +1,1146 @@ +// Type definitions for Breeze 1.6.3 +// Project: http://www.breezejs.com/ +// Definitions by: Boris Yankov , IdeaBlade +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// Updated Jan 14 2011 - Jay Traband ( www.ideablade.com). +// Updated Aug 13 2013 - Steve Schmitt ( www.ideablade.com). +// Updated Sep 26 2013 for Breeze 1.4.3 - Steve Schmitt ( www.ideablade.com). +// Updated Jul 22 2014 for Breeze 1.4.16 - Steve Schmitt ( www.ideablade.com) +// Updated Aug 22 2014 for Breeze 1.4.17 and removing Q dependency - Steve Schmitt ( www.ideablade.com) +// Updated Jan 16 2015 for Breeze 1.4.17 to add support for noimplicitany - Kevin Wilson ( www.kwilson.me.uk ) +// Updated Jan 20 2015 for Breeze 1.5.2 and merging changes from DefinitelyTyped +// Updated Feb 28 2015 add any/all clause on Predicate +// Updated Jun 27 2016 - Marcel Good (www.ideablade.com) +// Updated Jun 29 2016 - Marcel Good (www.ideablade.com) +// Updated Jul 15 2016 - Added methods to JsonResultsAdapter - Steve Schmitt +// Updated Sep 23 2016 - Added core methods +// Updated March 5 2017 - Eliminate promises.IPromise and replace with Promise + +declare namespace breeze.core { + + export interface ErrorCallback { + (error: Error): void; + } + + export interface IEnum { + contains(object: any): boolean; + fromName(name: string): EnumSymbol; + getNames(): string[]; + getSymbols(): EnumSymbol[]; + } + + export class Enum implements IEnum { + constructor(name: string, methodObj?: any); + + addSymbol(propertiesObj?: any): EnumSymbol; + contains(object: any): boolean; + fromName(name: string): EnumSymbol; + getNames(): string[]; + getSymbols(): EnumSymbol[]; + static isSymbol(object: any): boolean; + resolveSymbols(): void; + } + + export class EnumSymbol { + parentEnum: IEnum; + + getName(): string; + toString(): string; + } + + export class Event { + constructor(name: string, publisher: any, defaultErrorCallback?: ErrorCallback); + + static enable(eventName: string, target: any): void; + static enable(eventName: string, target: any, isEnabled: boolean): void; + static enable(eventName: string, target: any, isEnabled: Function): void; + + static isEnabled(eventName: string, target: any): boolean; + publish(data: any, publishAsync?: boolean, errorCallback?: ErrorCallback): void; + publishAsync(data: any, errorCallback?: ErrorCallback): void; + subscribe(callback?: (data: any) => void): number; + unsubscribe(unsubKey: number): boolean; + clear(): void; + } + + export function objectForEach(obj: Object, kvfn: (key: string, value: any) => void): void; + + export function extend(target: Object, source: Object): Object; + export function propEq(propertyName: string, value: any): (obj: Object) => boolean; + export function pluck(propertyName: string): (obj: Object) => any; + export function arrayEquals(a1: any[], a2: any[], equalsFn: (e1: any, e2: any) => boolean): boolean; + export function arrayFirst(a1: any[], predicate: (e: any) => boolean): any; + export function arrayIndexOf(a1: any[], predicate: (e: any) => boolean): number; + export function arrayRemoveItem(array: any[], item: any, shouldRemoveMultiple: boolean): any; + export function arrayRemoveItem(array: any[], predicate: (e: any) => boolean, shouldRemoveMultiple: boolean): any; + export function arrayZip(a1: any[], a2: any[], callback: (e1: any, e2: any) => any): any[]; + + export function requireLib(libnames: string, errMessage: string): Object; + export function using(obj: Object, property: string, tempValue: any, fn: () => any): any; + export function memoize(fn: (...any: any[]) => any): any; + export function getUuid(): string; + export function durationToSeconds(duration: string): number; + + export function isDate(o: any): boolean; + export function isGuid(o: any): boolean; + export function isDuration(o: any): boolean; + export function isFunction(o: any): boolean; + export function isEmpty(o: any): boolean; + export function isNumeric(o: any): boolean; + + export function stringStartsWith(str: string, prefix: string): boolean; + export function stringEndsWith(str: string, suffix: string): boolean; + export function formatString(format: string, ...args: any[]): string; + + /** Change text to title case with spaces, e.g. 'myPropertyName12' to 'My Property Name 12' */ + export function titleCase(str: string): string; + + /** Return the ES5 property descriptor for the property, which may be on a prototype of the object */ + export function getPropertyDescriptor(obj: any, propertyName: string): PropertyDescriptor + + /** safely perform toJSON logic on objects with cycles. Replacer function can map or exclude properties. */ + export function toJSONSafe(obj: any, replacer: (prop: string, val: any) => any): any + + /** Default value replacer for toJSONSafe. Replaces entityAspect and other internal properties with undefined. */ + export function toJSONSafeReplacer(prop: string, val: any): any + +} + +declare namespace breeze { + + export interface Entity { + entityAspect: EntityAspect; + entityType: EntityType; + } + + export interface ComplexObject { + complexAspect: ComplexAspect; + complexType: ComplexType; + } + + export interface IProperty { + name: string; + nameOnServer: string; + displayName: string; + parentType: IStructuralType; + validators: Validator[]; + isDataProperty: boolean; + isNavigationProperty: boolean; + } + + export interface IStructuralType { + complexProperties: DataProperty[]; + dataProperties: DataProperty[]; + name: string; + namespace: string; + shortName: string; + unmappedProperties: DataProperty[]; + validators: Validator[]; + } + + export class AutoGeneratedKeyType { + static Identity: AutoGeneratedKeyType; + static KeyGenerator: AutoGeneratedKeyType; + static None: AutoGeneratedKeyType; + } + + export class ComplexAspect { + complexObject: ComplexObject; + getEntityAspect(): EntityAspect; + parent: Object; + parentProperty: DataProperty; + getPropertyPath(propName: string): string; + originalValues: Object; + } + + export class ComplexType implements IStructuralType { + complexProperties: DataProperty[]; + dataProperties: DataProperty[]; + name: string; + namespace: string; + shortName: string; + unmappedProperties: DataProperty[]; + validators: Validator[]; + addProperty(dataProperty: DataProperty): ComplexType; + getProperties(): DataProperty[]; + } + + export class DataProperty implements IProperty { + complexTypeName: string; + concurrencyMode: string; + dataType: DataTypeSymbol; + defaultValue: any; + isComplexProperty: boolean; + isDataProperty: boolean; + isInherited: boolean; + isNavigationProperty: boolean; + isNullable: boolean; + isPartOfKey: boolean; + isUnmapped: boolean; + + maxLength: number; + name: string; + nameOnServer: string; + displayName: string; + parentType: IStructuralType; + relatedNavigationProperty: NavigationProperty; + validators: Validator[]; + constructor(config: DataPropertyOptions); + } + + export interface DataPropertyOptions { + complexTypeName?: string; + concurrencyMode?: string; + custom?: any; + dataType?: DataTypeSymbol; + defaultValue?: any; + displayName?: string; + isNullable?: boolean; + isPartOfKey?: boolean; + isScalar?: boolean; + isUnmapped?: boolean; + maxLength?: number; + name?: string; + nameOnServer?: string; + validators?: Validator[]; + } + + export class DataService { + adapterInstance: DataServiceAdapter; + adapterName: string; + hasServerMetadata: boolean; + serviceName: string; + uriBuilderName: string; + jsonResultsAdapter: JsonResultsAdapter; + useJsonp: boolean; + constructor(config: DataServiceOptions); + using(config: DataServiceOptions): DataService; + } + + export interface DataServiceOptions { + serviceName?: string; + adapterName?: string; + uriBuilderName?: string; + hasServerMetadata?: boolean; + jsonResultsAdapter?: JsonResultsAdapter; + useJsonp?: boolean; + } + + export class DataServiceAdapter { + checkForRecomposition(interfaceInitializedArgs: { interfaceName: string; isDefault: boolean }): void; + initialize(): void; + fetchMetadata(metadataStore: MetadataStore, dataService: DataService): Promise; + executeQuery(mappingContext: { getUrl: () => string; query: EntityQuery; dataService: DataService }): Promise; + saveChanges(saveContext: { resourceName: string; dataService: DataService }, saveBundle: Object): Promise; + JsonResultsAdapter: JsonResultsAdapter; + } + + export class JsonResultsAdapter { + name: string; + extractResults: (data: {}) => {}; + extractSaveResults: (data: {}) => any[]; + extractKeyMappings: (data: {}) => KeyMapping[]; + visitNode: (node: {}, queryContext: QueryContext, nodeContext: NodeContext) => { entityType?: EntityType; nodeId?: any; nodeRefId?: any; ignore?: boolean; }; + constructor(config: { + name: string; + extractResults?: (data: {}) => {}; + extractSaveResults?: (data: {}) => any[]; + extractKeyMappings?: (data: {}) => KeyMapping[]; + visitNode: (node: {}, queryContext: QueryContext, nodeContext: NodeContext) => { entityType?: EntityType; nodeId?: any; nodeRefId?: any; ignore?: boolean; }; + }); + } + + export interface QueryContext { + url: string; + query: EntityQuery | string; + entityManager: EntityManager; + dataService: DataService; + queryOptions: QueryOptions; + } + + export interface NodeContext { + nodeType: string; + propertyName: string; + } + + export class DataTypeSymbol extends breeze.core.EnumSymbol { + defaultValue: any; + isNumeric: boolean; + isDate: boolean; + } + export interface DataType extends breeze.core.IEnum { + Binary: DataTypeSymbol; + Boolean: DataTypeSymbol; + Byte: DataTypeSymbol; + DateTime: DataTypeSymbol; + DateTimeOffset: DataTypeSymbol; + Decimal: DataTypeSymbol; + Double: DataTypeSymbol; + Guid: DataTypeSymbol; + Int16: DataTypeSymbol; + Int32: DataTypeSymbol; + Int64: DataTypeSymbol; + Single: DataTypeSymbol; + String: DataTypeSymbol; + Time: DataTypeSymbol; + Undefined: DataTypeSymbol; + + toDataType(typeName: string): DataTypeSymbol; + parseDateFromServer(date: any): Date; + defaultValue: any; + isNumeric: boolean; + isInteger: boolean; + + /** Function to convert a value from string to this DataType. Note that this will be called each time a property is changed, so make it fast. */ + parse: (val: any, sourceTypeName: string) => any; + + /** Function to format this DataType for OData queries. */ + fmtOData: (val: any) => any; + + /** Optional function to get the next value for key generation, if this datatype is used as a key. Uses an internal table of previous values. */ + getNext?: () => any; + + /** Optional function to normalize a data value for comparison, if its value cannot be used directly. Note that this will be called each time a property is changed, so make it fast. */ + normalize?: (val: any) => any; + + /** Optional function to get the next value when the datatype is used as a concurrency property. */ + getConcurrencyValue?: (val: any) => any; + + /** Optional function to convert a raw (server) value from string to this DataType. */ + parseRawValue?: (val: any) => any; + } + export var DataType: DataType; + + export class EntityActionSymbol extends breeze.core.EnumSymbol { + } + export interface EntityAction extends breeze.core.IEnum { + AcceptChanges: EntityActionSymbol; + Attach: EntityActionSymbol; + AttachOnImport: EntityActionSymbol; + AttachOnQuery: EntityActionSymbol; + Clear: EntityActionSymbol; + Detach: EntityActionSymbol; + EntityStateChange: EntityActionSymbol; + MergeOnImport: EntityActionSymbol; + MergeOnSave: EntityActionSymbol; + MergeOnQuery: EntityActionSymbol; + PropertyChange: EntityActionSymbol; + RejectChanges: EntityActionSymbol; + } + export var EntityAction: EntityAction; + + export class EntityAspect { + entity: Entity; + entityManager: EntityManager; + entityState: EntityStateSymbol; + isBeingSaved: boolean; + originalValues: Object; + extraMetadata: Object; + + propertyChanged: PropertyChangedEvent; + validationErrorsChanged: ValidationErrorsChangedEvent; + + acceptChanges(): void; + addValidationError(validationError: ValidationError): void; + clearValidationErrors(): void; + getKey(forceRefresh?: boolean): EntityKey; + + getValidationErrors(): ValidationError[]; + getValidationErrors(property: string): ValidationError[]; + getValidationErrors(property: IProperty): ValidationError[]; + hasValidationErrors: boolean; + + isNavigationPropertyLoaded(navigationProperty: string): boolean; + isNavigationPropertyLoaded(navigationProperty: NavigationProperty): boolean; + + loadNavigationProperty(navigationProperty: string, callback?: Function, errorCallback?: Function): Promise; + loadNavigationProperty(navigationProperty: NavigationProperty, callback?: Function, errorCallback?: Function): Promise; + + rejectChanges(): void; + + removeValidationError(validator: Validator): void; + removeValidationError(validator: Validator, property: DataProperty): void; + removeValidationError(validator: Validator, property: NavigationProperty): void; + removeValidationError(validationError: ValidationError): void; + + setAdded(): void; + setDeleted(): void; + setDetached(): void; + setModified(): void; + setUnchanged(): void; + setEntityState(entityState: EntityStateSymbol): void; + validateEntity(): boolean; + + validateProperty(property: string, context?: any): boolean; + validateProperty(property: DataProperty, context?: any): boolean; + validateProperty(property: NavigationProperty, context?: any): boolean; + } + + export class PropertyChangedEventArgs { + entity: Entity; + property: IProperty; + propertyName: string; + oldValue: any; + newValue: any; + parent: any; + } + + export class PropertyChangedEvent extends breeze.core.Event { + subscribe(callback?: (data: PropertyChangedEventArgs) => void): number; + } + + export class ValidationErrorsChangedEventArgs { + entity: Entity; + added: ValidationError[]; + removed: ValidationError[]; + } + + export class ValidationErrorsChangedEvent extends breeze.core.Event { + subscribe(callback?: (data: ValidationErrorsChangedEventArgs) => void): number; + } + + export class EntityKey { + constructor(entityType: EntityType, keyValue: any); + constructor(entityType: EntityType, keyValues: any[]); + + equals(entityKey: EntityKey): boolean; + static equals(k1: EntityKey, k2: EntityKey): boolean; + entityType: EntityType; + values: any[]; + } + + export interface EntityByKeyResult { + entity: Entity; + entityKey: EntityKey; + fromCache: boolean; + } + export interface ExportEntitiesOptions { + asString: boolean; // default true + includeMetadata: boolean; // default true + } + + export class EntityManager { + dataService: DataService; + keyGeneratorCtor: Function; + metadataStore: MetadataStore; + queryOptions: QueryOptions; + saveOptions: SaveOptions; + serviceName: string; + validationOptions: ValidationOptions; + + entityChanged: EntityChangedEvent; + hasChangesChanged: HasChangesChangedEvent; + validationErrorsChanged: ValidationErrorsChangedEvent; + + constructor(config?: EntityManagerOptions); + constructor(config?: string); + + acceptChanges(): void; + addEntity(entity: Entity): Entity; + attachEntity(entity: Entity, entityState?: EntityStateSymbol, mergeStrategy?: MergeStrategySymbol): Entity; + clear(): void; + createEmptyCopy(): EntityManager; + createEntity(typeName: string, config?: {}, entityState?: EntityStateSymbol, mergeStrategy?: MergeStrategySymbol): Entity; + createEntity(entityType: EntityType, config?: {}, entityState?: EntityStateSymbol, mergeStrategy?: MergeStrategySymbol): Entity; + detachEntity(entity: Entity): boolean; + executeQuery(query: string, callback?: ExecuteQuerySuccessCallback, errorCallback?: ExecuteQueryErrorCallback): Promise; + executeQuery(query: EntityQuery, callback?: ExecuteQuerySuccessCallback, errorCallback?: ExecuteQueryErrorCallback): Promise; + + executeQueryLocally(query: EntityQuery): Entity[]; + exportEntities(entities?: Entity[], includeMetadata?: boolean): string; + exportEntities(entities?: Entity[], options?: ExportEntitiesOptions): any; // string | Object + fetchEntityByKey(typeName: string, keyValue: any, checkLocalCacheFirst?: boolean): Promise; + fetchEntityByKey(typeName: string, keyValues: any[], checkLocalCacheFirst?: boolean): Promise; + fetchEntityByKey(entityKey: EntityKey): Promise; + fetchMetadata(callback?: (schema: any) => void, errorCallback?: breeze.core.ErrorCallback): Promise; + generateTempKeyValue(entity: Entity): any; + getChanges(): Entity[]; + getChanges(entityTypeName: string): Entity[]; + getChanges(entityTypeNames: string[]): Entity[]; + getChanges(entityType: EntityType): Entity[]; + getChanges(entityTypes: EntityType[]): Entity[]; + + getEntities(entityTypeName: string, entityState?: EntityStateSymbol): Entity[]; + getEntities(entityTypeNames?: string[], entityState?: EntityStateSymbol): Entity[]; + getEntities(entityTypeName?: string, entityStates?: EntityStateSymbol[]): Entity[]; + getEntities(entityTypeNames?: string[], entityStates?: EntityStateSymbol[]): Entity[]; + + getEntities(entityType: EntityType, entityState?: EntityStateSymbol): Entity[]; + getEntities(entityTypes?: EntityType[], entityState?: EntityStateSymbol): Entity[]; + getEntities(entityType?: EntityType, entityStates?: EntityStateSymbol[]): Entity[]; + getEntities(entityTypes?: EntityType[], entityStates?: EntityStateSymbol[]): Entity[]; + + getEntityByKey(typeName: string, keyValue: any): Entity; + getEntityByKey(typeName: string, keyValues: any[]): Entity; + getEntityByKey(entityKey: EntityKey): Entity; + + hasChanges(): boolean; + hasChanges(entityTypeName: string): boolean; + hasChanges(entityTypeNames: string[]): boolean; + hasChanges(entityType: EntityType): boolean; + hasChanges(entityTypes: EntityType[]): boolean; + + static importEntities(exportedString: string, config?: { mergeStrategy?: MergeStrategySymbol; metadataVersionFn?: (any: any) => void }): EntityManager; + static importEntities(exportedData: Object, config?: { mergeStrategy?: MergeStrategySymbol; metadataVersionFn?: (any: any) => void }): EntityManager; + importEntities(exportedString: string, config?: { mergeStrategy?: MergeStrategySymbol; metadataVersionFn?: (any: any) => void }): { entities: Entity[]; tempKeyMapping: { [key: string] : EntityKey } }; + importEntities(exportedData: Object, config?: { mergeStrategy?: MergeStrategySymbol; metadataVersionFn?: (any: any) => void }): { entities: Entity[]; tempKeyMapping: { [key: string]: EntityKey } }; + + rejectChanges(): Entity[]; + saveChanges(entities?: Entity[], saveOptions?: SaveOptions, callback?: SaveChangesSuccessCallback, errorCallback?: SaveChangesErrorCallback): Promise; + setProperties(config: EntityManagerProperties): void; + } + + export interface EntityManagerOptions { + serviceName?: string; + dataService?: DataService; + metadataStore?: MetadataStore; + queryOptions?: QueryOptions; + saveOptions?: SaveOptions; + validationOptions?: ValidationOptions; + keyGeneratorCtor?: Function; + } + + export interface EntityManagerProperties { + serviceName?: string; + dataService?: DataService; + metadataStore?: MetadataStore; + queryOptions?: QueryOptions; + saveOptions?: SaveOptions; + validationOptions?: ValidationOptions; + keyGeneratorCtor?: Function; + } + + export interface ExecuteQuerySuccessCallback { + (data: QueryResult): void; + } + + export interface ExecuteQueryErrorCallback { + (error: { query: EntityQuery; httpResponse: HttpResponse; entityManager: EntityManager; message?: string; stack?:string }): void; + } + + export interface SaveChangesSuccessCallback { + (saveResult: SaveResult): void; + } + + export interface EntityError { + entity: Entity; + errorMessage: string; + errorName: string; + isServerError: boolean; + propertyName: string; + } + + export interface SaveChangesErrorCallback { + (error: { + entityErrors: EntityError[]; + httpResponse: HttpResponse; + message: string; + stack?: string; + status?: number + }): void; + } + + export class EntityChangedEventArgs { + entity: Entity; + entityAction: EntityActionSymbol; + args: Object; + } + + export class EntityChangedEvent extends breeze.core.Event { + subscribe(callback?: (data: EntityChangedEventArgs) => void): number; + } + + export class HasChangesChangedEventArgs { + entityManager: EntityManager; + hasChanges: boolean; + } + + export class HasChangesChangedEvent extends breeze.core.Event { + subscribe(callback?: (data: HasChangesChangedEventArgs) => void): number; + } + + export class EntityQuery { + entityManager: EntityManager; + orderByClause: OrderByClause; + parameters: Object; + queryOptions: QueryOptions; + resourceName: string; + resultEntityType: EntityType; + skipCount: number; + takeCount: number; + wherePredicate: Predicate; + + constructor(resourceName?: string); + /** Create query from an expression tree */ + constructor(tree: Object); + + execute(callback?: ExecuteQuerySuccessCallback, errorCallback?: ExecuteQueryErrorCallback): Promise; + executeLocally(): Entity[]; + expand(propertyPaths: string[]): EntityQuery; + expand(propertyPaths: string): EntityQuery; + static from(resourceName: string): EntityQuery; + from(resourceName: string): EntityQuery; + static fromEntities(entity: Entity): EntityQuery; + static fromEntities(entities: Entity[]): EntityQuery; + static fromEntityKey(entityKey: EntityKey): EntityQuery; + static fromEntityNavigation(entity: Entity, navigationProperty: NavigationProperty): EntityQuery; + inlineCount(enabled?: boolean): EntityQuery; + noTracking(enabled?: boolean): EntityQuery; + orderBy(propertyPaths: string, isDescending?: boolean): EntityQuery; + orderBy(propertyPaths: string[], isDescending?: boolean): EntityQuery; + orderByDesc(propertyPaths: string): EntityQuery; + orderByDesc(propertyPaths: string[]): EntityQuery; + select(propertyPaths: string): EntityQuery; + select(propertyPaths: string[]): EntityQuery; + skip(count: number): EntityQuery; + take(count: number): EntityQuery; + top(count: number): EntityQuery; + toType(typeName: string): EntityQuery; + toType(type: EntityType): EntityQuery; + + using(obj: EntityManager): EntityQuery; + using(obj: DataService): EntityQuery; + using(obj: JsonResultsAdapter): EntityQuery; + using(obj: QueryOptions): EntityQuery; + using(obj: MergeStrategySymbol): EntityQuery; + using(obj: FetchStrategySymbol): EntityQuery; + + where(predicate: Predicate): EntityQuery; + where(property: string, operator: string, value: any): EntityQuery; + where(property: string, operator: FilterQueryOpSymbol, value: any): EntityQuery; + where(property: string, filterop: FilterQueryOpSymbol, property2: string, filterop2: FilterQueryOpSymbol, value: any): EntityQuery; // for any/all clauses + where(property: string, filterop: string, property2: string, filterop2: string, value: any): EntityQuery; // for any/all clauses + where(predicate: FilterQueryOpSymbol): EntityQuery; + where(anArray: IRecursiveArray): EntityQuery; + + withParameters(params: Object): EntityQuery; + + toJSON(): string; + } + + export interface OrderByClause { + } + + export class EntityStateSymbol extends breeze.core.EnumSymbol { + isAdded(): boolean; + isAddedModifiedOrDeleted(): boolean; + isDeleted(): boolean; + isDetached(): boolean; + isModified(): boolean; + isUnchanged(): boolean; + isUnchangedOrModified(): boolean; + } + export interface EntityState extends breeze.core.IEnum { + Added: EntityStateSymbol; + Deleted: EntityStateSymbol; + Detached: EntityStateSymbol; + Modified: EntityStateSymbol; + Unchanged: EntityStateSymbol; + } + export var EntityState: EntityState; + + export class EntityType implements IStructuralType { + autoGeneratedKeyType: AutoGeneratedKeyType; + baseEntityType: EntityType; + complexProperties: DataProperty[]; + concurrencyProperties: DataProperty[]; + dataProperties: DataProperty[]; + defaultResourceName: string; + foreignKeyProperties: DataProperty[]; + isAbstract: boolean; + keyProperties: DataProperty[]; + metadataStore: MetadataStore; + name: string; + namespace: string; + navigationProperties: NavigationProperty[]; + shortName: string; + unmappedProperties: DataProperty[]; + validators: Validator[]; + + constructor(config: MetadataStore); + constructor(config: EntityTypeOptions); + + addProperty(property: IProperty): void; + addValidator(validator: Validator, property?: IProperty): void; + createEntity(initialValues?: Object): Entity; + getCtor(): Function; + getDataProperty(propertyName: string): DataProperty; + getNavigationProperty(propertyName: string): NavigationProperty; + getProperties(): IProperty[]; + getProperty(propertyPath: string, throwIfNotFound?: boolean): IProperty; + getPropertyNames(): string[]; + getSelfAndSubtypes(): EntityType[]; + isSubtypeOf(entityType: EntityType): boolean; + setProperties(config: EntityTypeProperties): void; + toString(): string; + } + + export interface EntityTypeOptions { + shortName?: string; + namespace?: string; + autoGeneratedKeyType?: AutoGeneratedKeyType; + defaultResourceName?: string; + dataProperties?: DataProperty[]; + navigationProperties?: NavigationProperty[]; + } + + export interface EntityTypeProperties { + autoGeneratedKeyType?: AutoGeneratedKeyType; + defaultResourceName?: string; + serializerFn?: (dataProperty: DataProperty, value: any) => any; + } + + export class FetchStrategySymbol extends breeze.core.EnumSymbol { + private foo; // to distinguish this class from MergeStrategySymbol + } + export interface FetchStrategy extends breeze.core.IEnum { + FromLocalCache: FetchStrategySymbol; + FromServer: FetchStrategySymbol; + } + export var FetchStrategy: FetchStrategy; + + export class FilterQueryOpSymbol extends breeze.core.EnumSymbol { + } + export interface FilterQueryOp extends breeze.core.IEnum { + Contains: FilterQueryOpSymbol; + EndsWith: FilterQueryOpSymbol; + Equals: FilterQueryOpSymbol; + GreaterThan: FilterQueryOpSymbol; + GreaterThanOrEqual: FilterQueryOpSymbol; + IsTypeOf: FilterQueryOpSymbol; + LessThan: FilterQueryOpSymbol; + LessThanOrEqual: FilterQueryOpSymbol; + NotEquals: FilterQueryOpSymbol; + StartsWith: FilterQueryOpSymbol; + Any: FilterQueryOpSymbol; + All: FilterQueryOpSymbol; + } + export var FilterQueryOp: FilterQueryOp; + + export class LocalQueryComparisonOptions { + static caseInsensitiveSQL: LocalQueryComparisonOptions; + static defaultInstance: LocalQueryComparisonOptions; + + constructor(config: { name?: string; isCaseSensitive?: boolean; usesSql92CompliantStringComparison?: boolean; }); + + setAsDefault(): void; + } + + export class MergeStrategySymbol extends breeze.core.EnumSymbol { + } + export interface MergeStrategy extends breeze.core.IEnum { + OverwriteChanges: MergeStrategySymbol; + PreserveChanges: MergeStrategySymbol; + SkipMerge: MergeStrategySymbol; + Disallowed: MergeStrategySymbol; + } + export var MergeStrategy: MergeStrategy; + + export class MetadataStore { + constructor(); + constructor(config?: MetadataStoreOptions); + namingConvention: NamingConvention; + addDataService(dataService: DataService, shouldOverwrite?: boolean): void; + addEntityType(structuralType: IStructuralType): void; + exportMetadata(): string; + fetchMetadata(dataService: string, callback?: (data: any) => void, errorCallback?: breeze.core.ErrorCallback): Promise; + fetchMetadata(dataService: DataService, callback?: (data: any) => void, errorCallback?: breeze.core.ErrorCallback): Promise; + getDataService(serviceName: string): DataService; + getEntityType(entityTypeName: string, okIfNotFound?: boolean): IStructuralType; + getEntityTypes(): IStructuralType[]; + hasMetadataFor(serviceName: string): boolean; + static importMetadata(exportedString: string): MetadataStore; + static normalizeTypeName(typeName: string): string; + importMetadata(exportedString: string, allowMerge?: boolean): MetadataStore; + isEmpty(): boolean; + registerEntityTypeCtor(entityTypeName: string, entityCtor: Function, initializationFn?: (entity: Entity) => void, noTrackingFn?: (node: Object, entityType: EntityType) => Object): void; + trackUnmappedType(entityCtor: Function, interceptor?: Function): void; + setEntityTypeForResourceName(resourceName: string, entityType: EntityType): void; + setEntityTypeForResourceName(resourceName: string, entityTypeName: string): void; + getEntityTypeNameForResourceName(resourceName: string): string; + setProperties(config: { name?: string; serializerFn?: Function }): void; + } + + export interface MetadataStoreOptions { + namingConvention?: NamingConvention; + localQueryComparisonOptions?: LocalQueryComparisonOptions; + } + + export class NamingConvention { + static camelCase: NamingConvention; + static defaultInstance: NamingConvention; + static none: NamingConvention; + + constructor(config: NamingConventionOptions); + + clientPropertyNameToServer(clientPropertyName: string): string; + clientPropertyNameToServer(clientPropertyName: string, property: IProperty): string; + + serverPropertyNameToClient(serverPropertyName: string): string; + serverPropertyNameToClient(serverPropertyName: string, property: IProperty): string; + + setAsDefault(): NamingConvention; + } + + export interface NamingConventionOptions { + serverPropertyNameToClient?: (name: string) => string; + clientPropertyNameToServer?: (name: string) => string; + } + + export class NavigationProperty implements IProperty { + associationName: string; + entityType: EntityType; + foreignKeyNames: string[]; + inverse: NavigationProperty; + isDataProperty: boolean; + isNavigationProperty: boolean; + isScalar: boolean; + name: string; + nameOnServer: string; + displayName: string; + parentType: IStructuralType; + relatedDataProperties: DataProperty[]; + validators: Validator[]; + + constructor(config: NavigationPropertyOptions); + } + + export interface NavigationPropertyOptions { + name?: string; + nameOnServer?: string; + entityTypeName: string; + isScalar?: boolean; + associationName?: string; + foreignKeyNames?: string[]; + foreignKeyNamesOnServer?: string[]; + validators?: Validator[]; + } + + export interface IRecursiveArray { + [i: number]: T | IRecursiveArray; + } + + export class Predicate { + constructor(); + constructor(property: string, operator: string, value: any); + constructor(property: string, operator: FilterQueryOpSymbol, value: any); + constructor(property: string, operator: string, value: { value: any; isLiteral?: boolean; dataType?: breeze.DataType }); + constructor(property: string, operator: FilterQueryOpSymbol, value: { value: any; isLiteral?: boolean; dataType?: breeze.DataType }); + constructor(property: string, filterop: FilterQueryOpSymbol, property2: string, filterop2: FilterQueryOpSymbol, value: any); // for any/all clauses + constructor(property: string, filterop: string, property2: string, filterop2: string, value: any); // for any/all clauses + constructor(passthru: string); + constructor(predicate: Predicate); + constructor(anArray: IRecursiveArray); + + and: PredicateMethod; + static and: PredicateMethod; + + static create: PredicateMethod; + + static isPredicate(o: any): boolean; + + static not(predicate: Predicate): Predicate; + not(): Predicate; + + static or: PredicateMethod; + or: PredicateMethod; + + toFunction(): Function; + toString(): string; + validate(entityType: EntityType): void; + + toJSON(): string; + } + + export interface PredicateMethod { + (predicates: Predicate[]): Predicate; + (...predicates: Predicate[]): Predicate; + (property: string, operator: string, value: any, valueIsLiteral?: boolean): Predicate; + (property: string, operator: FilterQueryOpSymbol, value: any, valueIsLiteral?: boolean): Predicate; + (property: string, filterop: FilterQueryOpSymbol, property2: string, filterop2: FilterQueryOpSymbol, value: any): Predicate; // for any/all clauses + (property: string, filterop: string, property2: string, filterop2: string, value: any): Predicate; // for any/all clauses + } + + export class QueryOptions { + static defaultInstance: QueryOptions; + fetchStrategy: FetchStrategySymbol; + mergeStrategy: MergeStrategySymbol; + /** Whether query should return cached deleted entities (false by default) */ + includeDeleted: boolean + + constructor(config?: QueryOptionsConfiguration); + + setAsDefault(): void; + using(config: QueryOptionsConfiguration): QueryOptions; + using(config: MergeStrategySymbol): QueryOptions; + using(config: FetchStrategySymbol): QueryOptions; + } + + export interface QueryOptionsConfiguration { + fetchStrategy?: FetchStrategySymbol; + mergeStrategy?: MergeStrategySymbol; + } + + export interface HttpResponse { + config: any; + data: Entity[]; + error?: any; + saveContext?: any; + status: number; + getHeaders(headerName: string): string + } + + export interface QueryResult { + /** Top level entities returned */ + results: Entity[]; + /** Query that was executed */ + query: EntityQuery; + /** Raw response from the server */ + httpResponse: HttpResponse; + /** EntityManager that executed the query */ + entityManager?: EntityManager; + /** Total number of results available on the server */ + inlineCount?: number; + /** All entities returned by the query. Differs from results when an expand is used. */ + retrievedEntities?: Entity[] + } + + export class SaveOptions { + allowConcurrentSaves: boolean; + resourceName: string; + dataService: DataService; + tag: Object; + static defaultInstance: SaveOptions; + + constructor(config?: { allowConcurrentSaves?: boolean; resourceName?: string; dataService?: DataService; tag?: any }); + + setAsDefault(): SaveOptions; + using(config: SaveOptionsConfiguration): SaveOptions; + } + + export interface SaveOptionsConfiguration { + allowConcurrentSaves?: boolean; + resourceName?: string; + dataService?: DataService; + tag?: Object; + } + + export interface SaveResult { + entities: Entity[]; + keyMappings: KeyMapping[]; + XHR: XMLHttpRequest; + } + + export interface KeyMapping { + entityTypeName: string; + tempValue: any; + realValue: any; + } + + export class ValidationError { + key: string; + context: any; + errorMessage: string; + property: IProperty; + propertyName: string; + validator: Validator; + getKey: (validator: Validator, property: string) => string; + + constructor(validator: Validator, context: any, errorMessage: string, key: string); + } + + export class ValidationOptions { + static defaultInstance: ValidationOptions; + validateOnAttach: boolean; + validateOnPropertyChange: boolean; + validateOnQuery: boolean; + validateOnSave: boolean; + + constructor(config?: ValidationOptionsConfiguration); + + setAsDefault(): ValidationOptions; + using(config: ValidationOptionsConfiguration): ValidationOptions; + } + + export interface ValidationOptionsConfiguration { + validateOnAttach?: boolean; + validateOnSave?: boolean; + validateOnQuery?: boolean; + validateOnPropertyChange?: boolean; + } + + export class Validator { + /** Map of standard error message templates keyed by validator name.*/ + static messageTemplates: any; + context: any; + name: string; + + constructor(name: string, validatorFn: ValidatorFunction, context?: any); + + static bool(): Validator; + /** integer between 0 and 255 inclusive */ + static byte(context?: { messageTemplate?: string }): Validator; + static date(): Validator; + /** Returns a ISO 8601 duration string Validator. */ + static duration(): Validator; + /** Validators number, double, and single are all the same */ + static number(context?: { messageTemplate?: string }): Validator; + /** Validators number, double, and single are all the same */ + static double(context?: { messageTemplate?: string }): Validator; + /** Validators number, double, and single are all the same */ + static single(context?: { messageTemplate?: string }): Validator; + + static guid(): Validator; + static int16(context?: { messageTemplate?: string }): Validator; + static int32(context?: { messageTemplate?: string }): Validator; + static int64(context?: { messageTemplate?: string }): Validator; + /** Same as int64 */ + static integer(context?: { messageTemplate?: string }): Validator; + static maxLength(context: { maxLength: number; messageTemplate?: string }): Validator; + static required(context?: { messageTemplate?: string }): Validator; + static string(): Validator; + static stringLength(context: { maxLength: number; minLength: number; messageTemplate?: string }): Validator; + /** Returns a credit card number validator that performs a Luhn algorithm checksum test for plausability */ + static creditCard(context?: { messageTemplate?: string }): Validator; + /** Returns a regular expression validator; the expression must be specified in the context parameter */ + static regularExpression(context: { expression: RegExp; messageTemplate?: string }): Validator; + /** Returns the email address validator */ + static emailAddress(context?: { messageTemplate?: string }): Validator; + /** Returns the phone validator, which handles prefix, country code, area code, and local number, with [-/. ] break characters. */ + static phone(context?: { messageTemplate?: string }): Validator; + /** Returns the URL (protocol required) validator */ + static url(context?: { messageTemplate?: string }): Validator; + /** Always returns true */ + static none(): Validator; + + /** Creates a validator instance from a JSON object or an array of instances from an array of JSON objects. */ + static fromJSON(json: string): Validator; + /** Register a validator instance so that any deserialized metadata can reference it. */ + static register(validator: Validator): void; + /** Register a validator factory so that any deserialized metadata can reference it. */ + static registerFactory(fn: () => Validator, name: string): void; + /** Creates a regular expression validator with a fixed expression. */ + static makeRegExpValidator(validatorName: string, expression: RegExp, defaultMessage: string, context?: any): Validator; + + /** Run this validator against the specified value. + @param value {Object} Value to validate + @param additionalContext {Object} Any additional contextual information that the Validator can make use of. + @return {ValidationError|null} A ValidationError if validation fails, null otherwise */ + validate(value: any, context?: any): ValidationError; + + /** Returns the message generated by the most recent execution of this Validator. */ + getMessage(): string; + } + + export interface ValidatorFunction { + (value: any, context: ValidatorFunctionContext): void; + } + + export interface ValidatorFunctionContext { + value: any; + validatorName: string; + displayName: string; + messageTemplate: string; + message?: string; + } + + export var metadataVersion: string; + export var remoteAccess_odata: string; + export var remoteAccess_webApi: string; + export var version: string; + +} + +declare namespace breeze.config { + + export var ajax: string; + export var dataService: string; + export var functionRegistry: Object; + /** + Returns the ctor function used to implement a specific interface with a specific adapter name. + @param interfaceName {String} One of the following interface names "ajax", "dataService" or "modelLibrary" + @param adapterName {String} The name of any previously registered adapter. If this parameter is omitted then + this method returns the "default" adapter for this interface. If there is no default adapter, then a null is returned. + @returns {Function|null} Returns either a ctor function or null. + **/ + export function getAdapter(interfaceName: string, adapterName?: string): Function; + /** + Returns the adapter instance corresponding to the specified interface and adapter names. + @param interfaceName {String} The name of the interface. + @param adapterName {String} - The name of a previously registered adapter. If this parameter is + omitted then the default implementation of the specified interface is returned. If there is + no defaultInstance of this interface, then the first registered instance of this interface is returned. + @return {an instance of the specified adapter} + **/ + export function getAdapterInstance(interfaceName: string, adapterName?: string): Object; + /** + Initializes a single adapter implementation. Initialization means either newing a instance of the + specified interface and then calling "initialize" on it or simply calling "initialize" on the instance + if it already exists. + @param interfaceName {String} The name of the interface to which the adapter to initialize belongs. + @param adapterName {String} - The name of a previously registered adapter to initialize. + @param isDefault=true {Boolean} - Whether to make this the default "adapter" for this interface. + @return {an instance of the specified adapter} + **/ + export function initializeAdapterInstance(interfaceName: string, adapterName: string, isDefault?: boolean): Object; + + export interface AdapterInstancesConfig { + /** the name of a previously registered "ajax" adapter */ + ajax?: string; + /** the name of a previously registered "dataService" adapter */ + dataService?: string; + /** the name of a previously registered "modelLibrary" adapter */ + modelLibary?: string; + /** the name of a previously registered "uriBuilder" adapter */ + uriBuilder?: string; + } + /** + Initializes a collection of adapter implementations and makes each one the default for its corresponding interface. + @param config {AdapterInstancesConfig} + @return [array of instances] + **/ + export function initializeAdapterInstances(config: AdapterInstancesConfig): Object[]; + export var interfaceInitialized: Event; + export var interfaceRegistry: Object; + export var objectRegistry: Object; + /** + Method use to register implementations of standard breeze interfaces. Calls to this method are usually + made as the last step within an adapter implementation. + @param interfaceName {String} - one of the following interface names "ajax", "dataService" or "modelLibrary" + @param adapterCtor {Function} - an ctor function that returns an instance of the specified interface. + **/ + export function registerAdapter(interfaceName: string, adapterCtor: Function): void; + export function registerFunction(fn: Function, fnName: string): void; + export function registerType(ctor: Function, typeName: string): void; + //static setProperties(config: Object): void; //deprecated + /** + Set the promise implementation, if Q.js is not found. + @param q - implementation of promise. @see http://wiki.commonjs.org/wiki/Promises/A + */ + export function setQ(q: breeze.promises.IPromiseService): void; + export var stringifyPad: string; + export var typeRegistry: Object; + +} + +/** Promises interface used by Breeze. Usually implemented by Q (https://github.com/kriskowal/q) or angular.$q using breeze.config.setQ(impl) */ +declare namespace breeze.promises { + + export interface IDeferred { + promise: Promise; + resolve(value: T): void; + reject(reason: any): void; + } + + export interface IPromiseService { + defer(): IDeferred; + reject(reason?: any): Promise; + resolve(object: T): Promise; + resolve(object: Promise): Promise; + } +} + +declare module "breeze" { + export = breeze; +} diff --git a/breeze/tsconfig.json b/types/breeze/tsconfig.json similarity index 100% rename from breeze/tsconfig.json rename to types/breeze/tsconfig.json diff --git a/brorand/brorand-tests.ts b/types/brorand/brorand-tests.ts similarity index 100% rename from brorand/brorand-tests.ts rename to types/brorand/brorand-tests.ts diff --git a/brorand/index.d.ts b/types/brorand/index.d.ts similarity index 100% rename from brorand/index.d.ts rename to types/brorand/index.d.ts diff --git a/brorand/tsconfig.json b/types/brorand/tsconfig.json similarity index 100% rename from brorand/tsconfig.json rename to types/brorand/tsconfig.json diff --git a/browser-bunyan/browser-bunyan-tests.ts b/types/browser-bunyan/browser-bunyan-tests.ts similarity index 83% rename from browser-bunyan/browser-bunyan-tests.ts rename to types/browser-bunyan/browser-bunyan-tests.ts index ffb2ebf7a7..47f439a07e 100644 --- a/browser-bunyan/browser-bunyan-tests.ts +++ b/types/browser-bunyan/browser-bunyan-tests.ts @@ -1,6 +1,6 @@ import * as bunyan from "browser-bunyan"; -var log = bunyan.createLogger({ +const log = bunyan.createLogger({ name: 'play', serializers: bunyan.stdSerializers }); diff --git a/types/browser-bunyan/index.d.ts b/types/browser-bunyan/index.d.ts new file mode 100644 index 0000000000..bb243e4324 --- /dev/null +++ b/types/browser-bunyan/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for browser-bunyan 0.4 +// Project: https://github.com/philmander/browser-bunyan +// Definitions by: Paul Lockwood +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import bunyan = require("bunyan"); + +declare module "bunyan" { + function ConsoleFormattedStream(): void; +} + +export = bunyan; diff --git a/browser-bunyan/tsconfig.json b/types/browser-bunyan/tsconfig.json similarity index 100% rename from browser-bunyan/tsconfig.json rename to types/browser-bunyan/tsconfig.json diff --git a/types/browser-bunyan/tslint.json b/types/browser-bunyan/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/browser-bunyan/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/browser-fingerprint/browser-fingerprint-tests.ts b/types/browser-fingerprint/browser-fingerprint-tests.ts similarity index 100% rename from browser-fingerprint/browser-fingerprint-tests.ts rename to types/browser-fingerprint/browser-fingerprint-tests.ts diff --git a/browser-fingerprint/index.d.ts b/types/browser-fingerprint/index.d.ts similarity index 100% rename from browser-fingerprint/index.d.ts rename to types/browser-fingerprint/index.d.ts diff --git a/browser-fingerprint/tsconfig.json b/types/browser-fingerprint/tsconfig.json similarity index 100% rename from browser-fingerprint/tsconfig.json rename to types/browser-fingerprint/tsconfig.json diff --git a/types/browser-fingerprint/tslint.json b/types/browser-fingerprint/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/browser-fingerprint/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/browser-harness/browser-harness-tests.ts b/types/browser-harness/browser-harness-tests.ts similarity index 100% rename from browser-harness/browser-harness-tests.ts rename to types/browser-harness/browser-harness-tests.ts diff --git a/browser-harness/index.d.ts b/types/browser-harness/index.d.ts similarity index 100% rename from browser-harness/index.d.ts rename to types/browser-harness/index.d.ts diff --git a/browser-harness/tsconfig.json b/types/browser-harness/tsconfig.json similarity index 100% rename from browser-harness/tsconfig.json rename to types/browser-harness/tsconfig.json diff --git a/browser-pack/browser-pack-tests.ts b/types/browser-pack/browser-pack-tests.ts similarity index 100% rename from browser-pack/browser-pack-tests.ts rename to types/browser-pack/browser-pack-tests.ts diff --git a/browser-pack/index.d.ts b/types/browser-pack/index.d.ts similarity index 100% rename from browser-pack/index.d.ts rename to types/browser-pack/index.d.ts diff --git a/browser-pack/tsconfig.json b/types/browser-pack/tsconfig.json similarity index 100% rename from browser-pack/tsconfig.json rename to types/browser-pack/tsconfig.json diff --git a/browser-resolve/browser-resolve-tests.ts b/types/browser-resolve/browser-resolve-tests.ts similarity index 95% rename from browser-resolve/browser-resolve-tests.ts rename to types/browser-resolve/browser-resolve-tests.ts index 2225f7754c..7d08de726f 100644 --- a/browser-resolve/browser-resolve-tests.ts +++ b/types/browser-resolve/browser-resolve-tests.ts @@ -1,5 +1,3 @@ -/// - import * as browserResolve from 'browser-resolve'; function basic_test_async(callback: (err?: Error, resolved?: string) => void) { diff --git a/browser-resolve/index.d.ts b/types/browser-resolve/index.d.ts similarity index 100% rename from browser-resolve/index.d.ts rename to types/browser-resolve/index.d.ts diff --git a/browser-resolve/tsconfig.json b/types/browser-resolve/tsconfig.json similarity index 100% rename from browser-resolve/tsconfig.json rename to types/browser-resolve/tsconfig.json diff --git a/browser-sync/browser-sync-tests.ts b/types/browser-sync/browser-sync-tests.ts similarity index 100% rename from browser-sync/browser-sync-tests.ts rename to types/browser-sync/browser-sync-tests.ts diff --git a/browser-sync/index.d.ts b/types/browser-sync/index.d.ts similarity index 100% rename from browser-sync/index.d.ts rename to types/browser-sync/index.d.ts diff --git a/browser-sync/tsconfig.json b/types/browser-sync/tsconfig.json similarity index 100% rename from browser-sync/tsconfig.json rename to types/browser-sync/tsconfig.json diff --git a/browserify/browserify-tests.ts b/types/browserify/browserify-tests.ts similarity index 100% rename from browserify/browserify-tests.ts rename to types/browserify/browserify-tests.ts diff --git a/browserify/index.d.ts b/types/browserify/index.d.ts similarity index 100% rename from browserify/index.d.ts rename to types/browserify/index.d.ts diff --git a/browserify/tsconfig.json b/types/browserify/tsconfig.json similarity index 100% rename from browserify/tsconfig.json rename to types/browserify/tsconfig.json diff --git a/bs58/bs58-tests.ts b/types/bs58/bs58-tests.ts similarity index 100% rename from bs58/bs58-tests.ts rename to types/bs58/bs58-tests.ts diff --git a/bs58/index.d.ts b/types/bs58/index.d.ts similarity index 100% rename from bs58/index.d.ts rename to types/bs58/index.d.ts diff --git a/bs58/tsconfig.json b/types/bs58/tsconfig.json similarity index 100% rename from bs58/tsconfig.json rename to types/bs58/tsconfig.json diff --git a/bson/bson-tests.ts b/types/bson/bson-tests.ts similarity index 100% rename from bson/bson-tests.ts rename to types/bson/bson-tests.ts diff --git a/types/bson/index.d.ts b/types/bson/index.d.ts new file mode 100644 index 0000000000..67df319bf6 --- /dev/null +++ b/types/bson/index.d.ts @@ -0,0 +1,225 @@ +// Type definitions for bson 1.0.4 +// Project: https://github.com/mongodb/js-bson +// Definitions by: Hiroki Horiuchi +// Federico Caselli +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +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 class Binary { + static SUBTYPE_DEFAULT: number; + static SUBTYPE_FUNCTION: number; + static SUBTYPE_BYTE_ARRAY: number; + static SUBTYPE_UUID_OLD: number; + static SUBTYPE_UUID: number; + static SUBTYPE_MD5: number; + static SUBTYPE_USER_DEFINED: number; + + constructor(buffer: Buffer, subType?: number); + + /** The length of the binary. */ + length(): number; + /** Updates this binary with byte_value */ + put(byte_value: number | string): void; + /** Reads length bytes starting at position. */ + read(position: number, length: number): Buffer; + /** Returns the value of this binary as a string. */ + value(): string; + /** Writes a buffer or string to the binary */ + write(buffer: Buffer | string, offset: number): void; +} +export class Code { + constructor(code: string | Function, scope?: any); +} +export class DBRef { + constructor(namespace: string, oid: ObjectID, db?: string); +} +export class Double { + constructor(value: number); + + valueOf(): number; +} +export class Long { + static MAX_VALUE: Long; + static MIN_VALUE: Long; + static NEG_ONE: Long; + static ONE: Long; + static ZERO: Long; + + static fromInt(i: number): Long; + static fromNumber(n: number): Long; + static fromBits(lowBits: number, highBits: number): Long; + static fromString(s: string, opt_radix?: number): Long; + + constructor(low: number, high: number); + + add(other: Long): Long; + and(other: Long): Long; + compare(other: Long): number; + div(other: Long): Long; + equals(other: Long): boolean; + getHighBits(): number; + getLowBits(): number; + getLowBitsUnsigned(): number; + getNumBitsAbs(): number; + greaterThan(other: Long): number; + greaterThanOrEqual(other: Long): number; + isNegative(): boolean; + isOdd(): boolean; + isZero(): boolean; + lessThan(other: Long): boolean; + lessThanOrEqual(other: Long): boolean; + modulo(other: Long): Long; + multiply(other: Long): Long; + negate(): Long; + not(): Long; + notEquals(other: Long): boolean; + or(other: Long): Long; + shiftLeft(other: number): Long; + shiftRight(other: number): Long; + shiftRightUnsigned(other: number): Long; + subtract(other: Long): Long; + toInt(): number; + toJSON(): string; + toNumber(): number; + toString(radix?: number): string; + xor(other: Long): Long; +} +export class Decimal128 { + static fromString(s: string): Decimal128; + + constructor(bytes: Buffer); + + toJSON(): string; + toString(): string; +} +export class MaxKey { + constructor(); +} +export class MinKey { + constructor(); +} +export class ObjectID { + /** + * Create a new ObjectID instance + * @param {(string|number|ObjectID)} id Can be a 24 byte hex string, 12 byte binary string or a Number. + */ + constructor(id?: string | number | ObjectID); + /** The generation time of this ObjectID instance */ + generationTime: number; + /** + * Creates an ObjectID from a hex string representation of an ObjectID. + * @param {string} hexString create a ObjectID from a passed in 24 byte hexstring. + * @return {ObjectID} return the created ObjectID + */ + static createFromHexString(hexString: string): ObjectID; + /** + * Creates an ObjectID from a second based number, with the rest of the ObjectID zeroed out. Used for comparisons or sorting the ObjectID. + * @param {number} time an integer number representing a number of seconds. + * @return {ObjectID} return the created ObjectID + */ + static createFromTime(time: number): ObjectID; + /** + * Checks if a value is a valid bson ObjectID + * + * @return {boolean} return true if the value is a valid bson ObjectID, return false otherwise. + */ + static isValid(id: string | number | ObjectID): boolean; + /** + * Compares the equality of this ObjectID with `otherID`. + * @param {object} otherID ObjectID instance to compare against. + * @return {boolean} the result of comparing two ObjectID's + */ + equals(otherID: ObjectID): boolean; + /** + * Generate a 12 byte id string used in ObjectID's + * @param {number} time optional parameter allowing to pass in a second based timestamp. + * @return {string} return the 12 byte id binary string. + */ + generate(time?: number): string; + /** + * Returns the generation date (accurate up to the second) that this ID was generated. + * @return {date} the generation date + */ + getTimestamp(): Date; + /** + * Return the ObjectID id as a 24 byte hex string representation + * @return {string} return the 24 byte hex string representation. + */ + toHexString(): string; +} +export { ObjectID as ObjectId }; +export class BSONRegExp { + constructor(pattern: string, options: string); +} +export class Symbol { + constructor(value: string); +} +export class Timestamp { + constructor(low: number, high: number); + + static MAX_VALUE: Timestamp; + static MIN_VALUE: Timestamp; + static NEG_ONE: Timestamp; + static ONE: Timestamp; + static ZERO: Timestamp; + + static fromBits(lowBits: number, highBits: number): Timestamp; + static fromInt(value: number): Timestamp; + static fromNumber(value: number): Timestamp; + static fromString(str: string, radix?: number): Timestamp; + + add(other: Timestamp): Timestamp; + and(other: Timestamp): Timestamp; + compare(other: Timestamp): number; + div(other: Timestamp): Timestamp; + equals(other: Timestamp): boolean; + getHighBits(): number; + getLowBits(): number; + getLowBitsUnsigned(): number; + getNumBitsAbs(): number; + greaterThan(other: Timestamp): number; + greaterThanOrEqual(other: Timestamp): number; + isNegative(): boolean; + isOdd(): boolean; + isZero(): boolean; + lessThan(other: Timestamp): boolean; + lessThanOrEqual(other: Timestamp): boolean; + modulo(other: Timestamp): Timestamp; + multiply(other: Timestamp): Timestamp; + negate(): Timestamp; + not(): Timestamp; + notEquals(other: Timestamp): boolean; + or(other: Timestamp): Timestamp; + shiftLeft(other: number): Timestamp; + shiftRight(other: number): Timestamp; + shiftRightUnsigned(other: number): Timestamp; + subtract(other: Timestamp): Timestamp; + toInt(): number; + toJSON(): string; + toNumber(): number; + toString(radix?: number): string; + xor(other: Timestamp): Timestamp; +} diff --git a/bson/tsconfig.json b/types/bson/tsconfig.json similarity index 100% rename from bson/tsconfig.json rename to types/bson/tsconfig.json diff --git a/bucks/bucks-tests.ts b/types/bucks/bucks-tests.ts similarity index 100% rename from bucks/bucks-tests.ts rename to types/bucks/bucks-tests.ts diff --git a/bucks/index.d.ts b/types/bucks/index.d.ts similarity index 100% rename from bucks/index.d.ts rename to types/bucks/index.d.ts diff --git a/bucks/tsconfig.json b/types/bucks/tsconfig.json similarity index 100% rename from bucks/tsconfig.json rename to types/bucks/tsconfig.json diff --git a/buffer-compare/buffer-compare-tests.ts b/types/buffer-compare/buffer-compare-tests.ts similarity index 100% rename from buffer-compare/buffer-compare-tests.ts rename to types/buffer-compare/buffer-compare-tests.ts diff --git a/buffer-compare/index.d.ts b/types/buffer-compare/index.d.ts similarity index 100% rename from buffer-compare/index.d.ts rename to types/buffer-compare/index.d.ts diff --git a/buffer-compare/tsconfig.json b/types/buffer-compare/tsconfig.json similarity index 100% rename from buffer-compare/tsconfig.json rename to types/buffer-compare/tsconfig.json diff --git a/buffer-equal/buffer-equal-tests.ts b/types/buffer-equal/buffer-equal-tests.ts similarity index 100% rename from buffer-equal/buffer-equal-tests.ts rename to types/buffer-equal/buffer-equal-tests.ts diff --git a/buffer-equal/index.d.ts b/types/buffer-equal/index.d.ts similarity index 100% rename from buffer-equal/index.d.ts rename to types/buffer-equal/index.d.ts diff --git a/buffer-equal/tsconfig.json b/types/buffer-equal/tsconfig.json similarity index 100% rename from buffer-equal/tsconfig.json rename to types/buffer-equal/tsconfig.json diff --git a/buffers/buffers-tests.ts b/types/buffers/buffers-tests.ts similarity index 100% rename from buffers/buffers-tests.ts rename to types/buffers/buffers-tests.ts diff --git a/buffers/index.d.ts b/types/buffers/index.d.ts similarity index 100% rename from buffers/index.d.ts rename to types/buffers/index.d.ts diff --git a/buffers/tsconfig.json b/types/buffers/tsconfig.json similarity index 100% rename from buffers/tsconfig.json rename to types/buffers/tsconfig.json diff --git a/bufferstream/bufferstream-tests.ts b/types/bufferstream/bufferstream-tests.ts similarity index 80% rename from bufferstream/bufferstream-tests.ts rename to types/bufferstream/bufferstream-tests.ts index 06cbd43e28..609e8828c7 100644 --- a/bufferstream/bufferstream-tests.ts +++ b/types/bufferstream/bufferstream-tests.ts @@ -1,8 +1,6 @@ - - import BufferStream = require('bufferstream'); -var stream = new BufferStream({encoding: 'utf8', size: 'flexible'}); +const stream = new BufferStream({encoding: 'utf8', size: 'flexible'}); stream.enable(); stream.disable(); stream.split('//', ':'); @@ -11,4 +9,3 @@ stream.on('split', (chunk: any, token: any) => { }); stream.write("buffer:stream//23"); console.log(stream.toString()); - diff --git a/types/bufferstream/index.d.ts b/types/bufferstream/index.d.ts new file mode 100644 index 0000000000..0642fd8740 --- /dev/null +++ b/types/bufferstream/index.d.ts @@ -0,0 +1,89 @@ +// Type definitions for bufferstream 0.6 +// Project: https://github.com/dodo/node-bufferstream +// Definitions by: Bart van der Schoor +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import stream = require('stream'); + +export = BufferStream; + +declare class BufferStream extends stream.Duplex { + constructor(options?: BufferStream.Opts); + + /* + different buffer behaviors can be triggered by size: + + none when output drains, bufferstream drains too + flexible buffers everthing that it gets and not piping out + TODO buffer has given size. buffers everthing until buffer is full. when buffer is full then the stream will drain + */ + setSize(size: string | number): void; // can be one of ['none', 'flexible', ] + /* + enables stream buffering default + */ + enable(): void; + /* + flushes buffer and disables stream buffering. BufferStream now pipes all data as long as the output accepting data. when the output is draining BufferStream will buffer all input temporary. + + token[s] buffer splitters (should be String or Buffer) + + disables given tokens. wont flush until no splitter tokens are left. + */ + disable(tokens?: string[] | Buffer[]): void; + disable(token: string, ...tokens: string[]): void; + disable(token: Buffer, ...tokens: Buffer[]): void; + /* + each time BufferStream finds a splitter token in the input data it will emit a split event. this also works for binary data. + + token[s] buffer splitters (should be String or Buffer) + */ + split(tokens: string[] | Buffer[]): void; + split(token: string, ...tokens: string[]): void; + split(token: Buffer, ...tokens: Buffer[]): void; + /* + returns Buffer. + */ + getBuffer(): Buffer; + /* + returns Buffer. + */ + buffer: Buffer; + /* + shortcut for buffer.toString() + */ + toString(): string; + /* + shortcut for buffer.length + */ + length: number; +} // https://github.com/dodo/node-bufferstream/blob/master/src/buffer-stream.coffee#L28 + +declare namespace BufferStream { + interface Opts { + /* + default encoding for writing strings + */ + encoding?: string; + /* + if true and the source is a child_process the stream will block the entire process (timeouts wont work anymore, but splitting and listening on data still works, because they work sync) + */ + blocking?: boolean; + /* + defines buffer level or sets buffer to given size (see ↓setSize for more) + */ + size?: any; + /* + immediately call disable + */ + disabled?: boolean; + /* + short form for: + split(token, function (chunk) {emit('data', chunk)}) + */ + // String or Buffer + split?: any; + } + const fn: {warn: boolean}; +} diff --git a/bufferstream/postbuffer.d.ts b/types/bufferstream/postbuffer.d.ts similarity index 100% rename from bufferstream/postbuffer.d.ts rename to types/bufferstream/postbuffer.d.ts diff --git a/bufferstream/tsconfig.json b/types/bufferstream/tsconfig.json similarity index 100% rename from bufferstream/tsconfig.json rename to types/bufferstream/tsconfig.json diff --git a/types/bufferstream/tslint.json b/types/bufferstream/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/bufferstream/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/bull/bull-tests.tsx b/types/bull/bull-tests.tsx similarity index 100% rename from bull/bull-tests.tsx rename to types/bull/bull-tests.tsx diff --git a/bull/index.d.ts b/types/bull/index.d.ts similarity index 100% rename from bull/index.d.ts rename to types/bull/index.d.ts diff --git a/bull/tsconfig.json b/types/bull/tsconfig.json similarity index 100% rename from bull/tsconfig.json rename to types/bull/tsconfig.json diff --git a/bunnymq/bunnymq-tests.ts b/types/bunnymq/bunnymq-tests.ts similarity index 100% rename from bunnymq/bunnymq-tests.ts rename to types/bunnymq/bunnymq-tests.ts diff --git a/bunnymq/index.d.ts b/types/bunnymq/index.d.ts similarity index 100% rename from bunnymq/index.d.ts rename to types/bunnymq/index.d.ts diff --git a/bunnymq/tsconfig.json b/types/bunnymq/tsconfig.json similarity index 100% rename from bunnymq/tsconfig.json rename to types/bunnymq/tsconfig.json diff --git a/types/bunyan-blackhole/bunyan-blackhole-tests.ts b/types/bunyan-blackhole/bunyan-blackhole-tests.ts new file mode 100644 index 0000000000..553d6f52ea --- /dev/null +++ b/types/bunyan-blackhole/bunyan-blackhole-tests.ts @@ -0,0 +1,22 @@ +import blackhole = require("bunyan-blackhole"); + +const logsLaboursLost = blackhole("lost"); + +const rotten = new Error("Something is rotten in the state of Denmark"); + +logsLaboursLost.info(rotten, "Play %s", "Hamlet"); +logsLaboursLost.debug(rotten, "Play %s", "King Lear"); +logsLaboursLost.trace(rotten, "Play %s", "Much Ado About Nothing"); +logsLaboursLost.warn(rotten, "Play %s", "All's Well That Ends Well"); +logsLaboursLost.error(rotten, "Play %s", "Romeo and Juliet"); + +logsLaboursLost.error("Something is rotten in the state of Denmark"); + +logsLaboursLost.debug({character: "Marcellus", play: "King Lear"}, "Friends of my soul, you twain"); +logsLaboursLost.trace({play: "All's Well That Ends Well"}, "Love all, trust a few, do wrong to none"); +logsLaboursLost.info({play: "Much Ado About Nothing"}, "Let me be that I am and seek not to alter me."); +logsLaboursLost.warn({play: "All's Well That Ends Well"}, "Love all, trust a few, do wrong to none"); +logsLaboursLost.error({play: "All's Well That Ends Well"}, "Love all, trust a few, do wrong to none"); + +const hamlet = logsLaboursLost.child({play: "Hamlet"}); +hamlet.info({character: "Polonius"}, "Though this be madness, yet there is method in't"); diff --git a/types/bunyan-blackhole/index.d.ts b/types/bunyan-blackhole/index.d.ts new file mode 100644 index 0000000000..f8be6fc730 --- /dev/null +++ b/types/bunyan-blackhole/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for bunyan-blackhole 0.2 +// Project: https://github.com/Floby/node-bunyan-blackhole +// Definitions by: Olivier Chevet +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import * as Logger from "bunyan"; + +/** + * Constructor. + * @param {string} [name] name of the blackhole Logger + * @return {Logger} A bunyan logger . + */ +declare function bunyanBlackHole(name: string): Logger; +export = bunyanBlackHole; diff --git a/types/bunyan-blackhole/tsconfig.json b/types/bunyan-blackhole/tsconfig.json new file mode 100644 index 0000000000..cddd529d29 --- /dev/null +++ b/types/bunyan-blackhole/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "bunyan-blackhole-tests.ts" + ] +} \ No newline at end of file diff --git a/types/bunyan-blackhole/tslint.json b/types/bunyan-blackhole/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/bunyan-blackhole/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/bunyan-config/bunyan-config-tests.ts b/types/bunyan-config/bunyan-config-tests.ts similarity index 100% rename from bunyan-config/bunyan-config-tests.ts rename to types/bunyan-config/bunyan-config-tests.ts diff --git a/bunyan-config/index.d.ts b/types/bunyan-config/index.d.ts similarity index 100% rename from bunyan-config/index.d.ts rename to types/bunyan-config/index.d.ts diff --git a/bunyan-config/tsconfig.json b/types/bunyan-config/tsconfig.json similarity index 100% rename from bunyan-config/tsconfig.json rename to types/bunyan-config/tsconfig.json diff --git a/bunyan-logentries/bunyan-logentries-tests.ts b/types/bunyan-logentries/bunyan-logentries-tests.ts similarity index 100% rename from bunyan-logentries/bunyan-logentries-tests.ts rename to types/bunyan-logentries/bunyan-logentries-tests.ts diff --git a/bunyan-logentries/index.d.ts b/types/bunyan-logentries/index.d.ts similarity index 100% rename from bunyan-logentries/index.d.ts rename to types/bunyan-logentries/index.d.ts diff --git a/bunyan-logentries/tsconfig.json b/types/bunyan-logentries/tsconfig.json similarity index 100% rename from bunyan-logentries/tsconfig.json rename to types/bunyan-logentries/tsconfig.json diff --git a/bunyan-prettystream/bunyan-prettystream-tests.ts b/types/bunyan-prettystream/bunyan-prettystream-tests.ts similarity index 100% rename from bunyan-prettystream/bunyan-prettystream-tests.ts rename to types/bunyan-prettystream/bunyan-prettystream-tests.ts diff --git a/bunyan-prettystream/index.d.ts b/types/bunyan-prettystream/index.d.ts similarity index 100% rename from bunyan-prettystream/index.d.ts rename to types/bunyan-prettystream/index.d.ts diff --git a/bunyan-prettystream/tsconfig.json b/types/bunyan-prettystream/tsconfig.json similarity index 100% rename from bunyan-prettystream/tsconfig.json rename to types/bunyan-prettystream/tsconfig.json diff --git a/bunyan/bunyan-tests.ts b/types/bunyan/bunyan-tests.ts similarity index 97% rename from bunyan/bunyan-tests.ts rename to types/bunyan/bunyan-tests.ts index 91b45765d1..acf382c7c2 100644 --- a/bunyan/bunyan-tests.ts +++ b/types/bunyan/bunyan-tests.ts @@ -86,26 +86,32 @@ var object = { test: 123 }; +log.trace(); log.trace(buffer); log.trace(error); log.trace(object); log.trace('Hello, %s', 'world!'); +log.debug(); log.debug(buffer); log.debug(error); log.debug(object); log.debug('Hello, %s', 'world!'); +log.info(); log.info(buffer); log.info(error); log.info(object); log.info('Hello, %s', 'world!'); +log.warn(); log.warn(buffer); log.warn(error); log.warn(object); log.warn('Hello, %s', 'world!'); +log.error(); log.error(buffer); log.error(error); log.error(object); log.error('Hello, %s', 'world!'); +log.fatal(); log.fatal(buffer); log.fatal(error); log.fatal(object); diff --git a/types/bunyan/index.d.ts b/types/bunyan/index.d.ts new file mode 100644 index 0000000000..060fa8eaa3 --- /dev/null +++ b/types/bunyan/index.d.ts @@ -0,0 +1,279 @@ +// Type definitions for node-bunyan +// Project: https://github.com/trentm/node-bunyan +// Definitions by: Alex Mikhalev +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import { EventEmitter } from 'events'; + +declare class Logger extends EventEmitter { + constructor(options: Logger.LoggerOptions); + addStream(stream: Logger.Stream): void; + addSerializers(serializers: Logger.Serializers | Logger.StdSerializers): void; + child(options: Logger.LoggerOptions, simple?: boolean): Logger; + child(obj: Object, simple?: boolean): Logger; + reopenFileStreams(): void; + + level(): string | number; + level(value: number | string): void; + levels(name: number | string, value: number | string): void; + + fields: any; + src: boolean; + + /** + * Returns a boolean: is the `trace` level enabled? + * + * This is equivalent to `log.isTraceEnabled()` or `log.isEnabledFor(TRACE)` in log4j. + */ + trace(): boolean; + + /** + * Special case to log an `Error` instance to the record. + * This adds an `err` field with exception details + * (including the stack) and sets `msg` to the exception + * message or you can specify the `msg`. + */ + trace(error: Error, format?: any, ...params: any[]): void; + + trace(buffer: Buffer, format?: any, ...params: any[]): void; + + /** + * Uses `util.format` for msg formatting. + */ + trace(format: string | number, ...params: any[]): void; + + /** + * The first field can optionally be a "fields" object, which + * is merged into the log record. + * + * To pass in an Error *and* other fields, use the `err` + * field name for the Error instance. + */ + trace(obj: Object, format?: any, ...params: any[]): void; + + /** + * Returns a boolean: is the `debug` level enabled? + * + * This is equivalent to `log.isDebugEnabled()` or `log.isEnabledFor(DEBUG)` in log4j. + */ + debug(): boolean; + + /** + * Special case to log an `Error` instance to the record. + * This adds an `err` field with exception details + * (including the stack) and sets `msg` to the exception + * message or you can specify the `msg`. + */ + debug(error: Error, format?: any, ...params: any[]): void; + + debug(buffer: Buffer, format?: any, ...params: any[]): void; + + /** + * Uses `util.format` for msg formatting. + */ + debug(format: string | number, ...params: any[]): void; + + /** + * The first field can optionally be a "fields" object, which + * is merged into the log record. + * + * To pass in an Error *and* other fields, use the `err` + * field name for the Error instance. + */ + debug(obj: Object, format?: any, ...params: any[]): void; + + /** + * Returns a boolean: is the `info` level enabled? + * + * This is equivalent to `log.isInfoEnabled()` or `log.isEnabledFor(INFO)` in log4j. + */ + info(): boolean; + + /** + * Special case to log an `Error` instance to the record. + * This adds an `err` field with exception details + * (including the stack) and sets `msg` to the exception + * message or you can specify the `msg`. + */ + info(error: Error, format?: any, ...params: any[]): void; + + info(buffer: Buffer, format?: any, ...params: any[]): void; + + /** + * Uses `util.format` for msg formatting. + */ + info(format: string | number, ...params: any[]): void; + + /** + * The first field can optionally be a "fields" object, which + * is merged into the log record. + * + * To pass in an Error *and* other fields, use the `err` + * field name for the Error instance. + */ + info(obj: Object, format?: any, ...params: any[]): void; + + /** + * Returns a boolean: is the `warn` level enabled? + * + * This is equivalent to `log.isWarnEnabled()` or `log.isEnabledFor(WARN)` in log4j. + */ + warn(): boolean; + + /** + * Special case to log an `Error` instance to the record. + * This adds an `err` field with exception details + * (including the stack) and sets `msg` to the exception + * message or you can specify the `msg`. + */ + warn(error: Error, format?: any, ...params: any[]): void; + + warn(buffer: Buffer, format?: any, ...params: any[]): void; + + /** + * Uses `util.format` for msg formatting. + */ + warn(format: string | number, ...params: any[]): void; + + /** + * The first field can optionally be a "fields" object, which + * is merged into the log record. + * + * To pass in an Error *and* other fields, use the `err` + * field name for the Error instance. + */ + warn(obj: Object, format?: any, ...params: any[]): void; + + /** + * Returns a boolean: is the `error` level enabled? + * + * This is equivalent to `log.isErrorEnabled()` or `log.isEnabledFor(ERROR)` in log4j. + */ + error(): boolean; + + /** + * Special case to log an `Error` instance to the record. + * This adds an `err` field with exception details + * (including the stack) and sets `msg` to the exception + * message or you can specify the `msg`. + */ + error(error: Error, format?: any, ...params: any[]): void; + + error(buffer: Buffer, format?: any, ...params: any[]): void; + + /** + * Uses `util.format` for msg formatting. + */ + error(format: string | number, ...params: any[]): void; + + /** + * The first field can optionally be a "fields" object, which + * is merged into the log record. + * + * To pass in an Error *and* other fields, use the `err` + * field name for the Error instance. + */ + error(obj: Object, format?: any, ...params: any[]): void; + + /** + * Returns a boolean: is the `fatal` level enabled? + * + * This is equivalent to `log.isFatalEnabled()` or `log.isEnabledFor(FATAL)` in log4j. + */ + fatal(): boolean; + + /** + * Special case to log an `Error` instance to the record. + * This adds an `err` field with exception details + * (including the stack) and sets `msg` to the exception + * message or you can specify the `msg`. + */ + fatal(error: Error, format?: any, ...params: any[]): void; + + fatal(buffer: Buffer, format?: any, ...params: any[]): void; + + /** + * Uses `util.format` for msg formatting. + */ + fatal(format: string | number, ...params: any[]): void; + + /** + * The first field can optionally be a "fields" object, which + * is merged into the log record. + * + * To pass in an Error *and* other fields, use the `err` + * field name for the Error instance. + */ + fatal(obj: Object, format?: any, ...params: any[]): void; +} + +declare namespace Logger { + const TRACE: number; + const DEBUG: number; + const INFO: number; + const WARN: number; + const ERROR: number; + const FATAL: number; + + const stdSerializers: StdSerializers; + + function createLogger(options: LoggerOptions): Logger; + + function safeCycles(): (key: string, value: any) => any; + + function resolveLevel(value: number | string): number; + + interface Stream { + type?: string; + level?: number | string; + path?: string; + stream?: NodeJS.WritableStream | Stream; + closeOnExit?: boolean; + period?: string; + count?: number; + } + + interface LoggerOptions { + name: string; + streams?: Stream[]; + level?: string | number; + stream?: NodeJS.WritableStream; + serializers?: Serializers | StdSerializers; + src?: boolean; + [custom: string]: any; + } + + interface Serializer { + (input:any): any; + } + + interface Serializers { + [key: string]: Serializer + } + + interface StdSerializers { + err: Serializer; + res: Serializer; + req: Serializer; + } + + interface RingBufferOptions { + limit?: number; + } + + class RingBuffer extends EventEmitter { + constructor(options: RingBufferOptions); + + writable: boolean; + records: any[]; + + write(record: any): void; + end(record?: any): void; + destroy(): void; + destroySoon(): void; + } +} + +export = Logger; diff --git a/bunyan/tsconfig.json b/types/bunyan/tsconfig.json similarity index 100% rename from bunyan/tsconfig.json rename to types/bunyan/tsconfig.json diff --git a/busboy/busboy-tests.ts b/types/busboy/busboy-tests.ts similarity index 100% rename from busboy/busboy-tests.ts rename to types/busboy/busboy-tests.ts diff --git a/busboy/index.d.ts b/types/busboy/index.d.ts similarity index 100% rename from busboy/index.d.ts rename to types/busboy/index.d.ts diff --git a/busboy/tsconfig.json b/types/busboy/tsconfig.json similarity index 100% rename from busboy/tsconfig.json rename to types/busboy/tsconfig.json diff --git a/business-rules-engine/Utils.d.ts b/types/business-rules-engine/Utils.d.ts similarity index 100% rename from business-rules-engine/Utils.d.ts rename to types/business-rules-engine/Utils.d.ts diff --git a/business-rules-engine/Validation.d.ts b/types/business-rules-engine/Validation.d.ts similarity index 99% rename from business-rules-engine/Validation.d.ts rename to types/business-rules-engine/Validation.d.ts index 0dd8283dc2..7f61f517be 100644 --- a/business-rules-engine/Validation.d.ts +++ b/types/business-rules-engine/Validation.d.ts @@ -3,8 +3,6 @@ // Definitions by: Roman Samec // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// - declare namespace Validation { interface IErrorCustomMessage { (config: any, args: any): string; diff --git a/business-rules-engine/business-rules-engine-tests.ts b/types/business-rules-engine/business-rules-engine-tests.ts similarity index 96% rename from business-rules-engine/business-rules-engine-tests.ts rename to types/business-rules-engine/business-rules-engine-tests.ts index 3ffbe2948c..4ae31155f2 100644 --- a/business-rules-engine/business-rules-engine-tests.ts +++ b/types/business-rules-engine/business-rules-engine-tests.ts @@ -1,4 +1,3 @@ -/// import * as Validators from 'business-rules-engine/node-validators'; import Validation = require("business-rules-engine"); diff --git a/types/business-rules-engine/index.d.ts b/types/business-rules-engine/index.d.ts new file mode 100644 index 0000000000..a74bcf180d --- /dev/null +++ b/types/business-rules-engine/index.d.ts @@ -0,0 +1,244 @@ +// Type definitions for business-rules-engine v1.0.20 +// Project: https://github.com/rsamec/form +// Definitions by: Roman Samec +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// Source: typings/business-rules-engine/Validation.d.ts + +import * as Q from "q"; + +declare namespace Validation { + interface IErrorCustomMessage { + (config: any, args: any): string; + } + interface IPropertyValidator { + isAcceptable(s: any): boolean; + customMessage?: IErrorCustomMessage; + tagName?: string; + } + interface IStringValidator extends IPropertyValidator { + isAcceptable(s: string): boolean; + } + interface IAsyncPropertyValidator { + isAcceptable(s: any): Q.Promise; + customMessage?: IErrorCustomMessage; + isAsync: boolean; + tagName?: string; + } + interface IAsyncStringPropertyValidator extends IAsyncPropertyValidator { + isAcceptable(s: string): Q.Promise; + } + enum CompareOperator { + LessThan = 0, + LessThanEqual = 1, + Equal = 2, + NotEqual = 3, + GreaterThanEqual = 4, + GreaterThan = 5, + } + interface IError { + HasError: boolean; + ErrorMessage: string; + TranslateArgs?: IErrorTranslateArgs; + } + interface IErrorTranslateArgs { + TranslateId: string; + MessageArgs: any; + CustomMessage?: IErrorCustomMessage; + } + interface IOptional { + (): boolean; + } + interface IValidationFailure extends IError { + IsAsync: boolean; + Error: IError; + } + interface IValidationResult { + Name: string; + Add(validationResult: IValidationResult): void; + Remove(index: number): void; + Children: IValidationResult[]; + HasErrors: boolean; + HasErrorsDirty: boolean; + ErrorMessage: string; + ErrorCount: number; + Optional?: IOptional; + TranslateArgs?: IErrorTranslateArgs[]; + } + interface IValidate { + (args: IError): void; + } + interface IAsyncValidate { + (args: IError): Q.Promise; + } + interface IValidatorFce { + Name: string; + ValidationFce?: IValidate; + AsyncValidationFce?: IAsyncValidate; + } + interface IValidator { + Validate(context: any): IValidationFailure; + ValidateAsync(context: any): Q.Promise; + Error: IError; + } + interface IAbstractValidator { + RuleFor(prop: string, validator: IPropertyValidator): any; + ValidationFor(prop: string, validatorFce: IValidatorFce): any; + Validation(validatorFce: IValidatorFce): any; + ValidatorFor(prop: string, validator: IAbstractValidator): any; + CreateRule(name: string): IAbstractValidationRule; + CreateAbstractRule(name: string): IAbstractValidationRule; + CreateAbstractListRule(name: string): IAbstractValidationRule; + ForList: boolean; + } + interface IAbstractValidationRule { + Validate(context: T): IValidationResult; + ValidateAsync(context: T): Q.Promise; + ValidateAll(context: T): Q.Promise; + ValidateProperty(context: T, propName: string): void; + ValidationResult: IValidationResult; + Rules: { + [name: string]: IPropertyValidationRule; + }; + Validators: { + [name: string]: IValidator; + }; + Children: { + [name: string]: IAbstractValidationRule; + }; + } + interface IPropertyValidationRule { + Validators: { + [name: string]: any; + }; + Validate(context: IValidationContext): IValidationFailure[]; + ValidateAsync(context: IValidationContext): Q.Promise; + } + interface IValidationContext { + Value: string; + Key: string; + Data: T; + } + class Error implements IError { + public HasError: boolean; + public ErrorMessage: string; + constructor(); + } + class ValidationFailure implements IError { + public Error: IError; + public IsAsync: boolean; + constructor(Error: IError, IsAsync: boolean); + public HasError : boolean; + public ErrorMessage : string; + public TranslateArgs : IErrorTranslateArgs; + } + class ValidationResult implements IValidationResult { + public Name: string; + constructor(Name: string); + public IsDirty: boolean; + public Children : IValidationResult[]; + public Add(error: IValidationResult): void; + public Remove(index: number): void; + public Optional: IOptional; + public TranslateArgs: IErrorTranslateArgs[]; + public HasErrorsDirty : boolean; + public HasErrors : boolean; + public ErrorCount : number; + public ErrorMessage : string; + } + class CompositeValidationResult implements IValidationResult { + public Name: string; + public Children: IValidationResult[]; + constructor(Name: string); + public Optional: IOptional; + public AddFirst(error: IValidationResult): void; + public Add(error: IValidationResult): void; + public Remove(index: number): void; + public HasErrorsDirty : boolean; + public HasErrors : boolean; + public ErrorCount : number; + public ErrorMessage : string; + public TranslateArgs : IErrorTranslateArgs[]; + public LogErrors(headerMessage?: string): void; + public Errors : { + [name: string]: IValidationResult; + }; + private FlattenErros; + public SetDirty(): void; + public SetPristine(): void; + private SetDirtyEx(node, dirty); + private flattenErrors(node, errorCollection); + private traverse(node, indent); + } + class AbstractValidator implements IAbstractValidator { + public Validators: { + [name: string]: IPropertyValidator[]; + }; + public AbstractValidators: { + [name: string]: IAbstractValidator; + }; + public ValidationFunctions: { + [name: string]: IValidatorFce[]; + }; + public RuleFor(prop: string, validator: IPropertyValidator): void; + public ValidationFor(prop: string, fce: IValidatorFce): void; + public Validation(fce: IValidatorFce): void; + public ValidatorFor(prop: string, validator: IAbstractValidator, forList?: boolean): void; + public CreateAbstractRule(name: string): IAbstractValidationRule; + public CreateAbstractListRule(name: string): IAbstractValidationRule; + public CreateRule(name: string): IAbstractValidationRule; + public ForList: boolean; + } + class MessageLocalization { + static customMsg: string; + static defaultMessages: { + "required": string; + "remote": string; + "email": string; + "url": string; + "date": string; + "dateISO": string; + "number": string; + "digits": string; + "signedDigits": string; + "creditcard": string; + "equalTo": string; + "maxlength": string; + "minlength": string; + "rangelength": string; + "range": string; + "max": string; + "min": string; + "step": string; + "contains": string; + "mask": string; + "custom": string; + }; + static ValidationMessages: { + "required": string; + "remote": string; + "email": string; + "url": string; + "date": string; + "dateISO": string; + "number": string; + "digits": string; + "signedDigits": string; + "creditcard": string; + "equalTo": string; + "maxlength": string; + "minlength": string; + "rangelength": string; + "range": string; + "max": string; + "min": string; + "step": string; + "contains": string; + "mask": string; + "custom": string; + }; + static GetValidationMessage(validator: any): string; + } +} +export = Validation; +export as namespace Validation; diff --git a/business-rules-engine/node-validators.d.ts b/types/business-rules-engine/node-validators.d.ts similarity index 99% rename from business-rules-engine/node-validators.d.ts rename to types/business-rules-engine/node-validators.d.ts index 73746eef92..fa2b9cb39e 100644 --- a/business-rules-engine/node-validators.d.ts +++ b/types/business-rules-engine/node-validators.d.ts @@ -3,7 +3,6 @@ // Definitions by: Roman Samec // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// /// import Validation = require("business-rules-engine"); diff --git a/business-rules-engine/package.json b/types/business-rules-engine/package.json similarity index 100% rename from business-rules-engine/package.json rename to types/business-rules-engine/package.json diff --git a/types/business-rules-engine/tsconfig.json b/types/business-rules-engine/tsconfig.json new file mode 100644 index 0000000000..a80b05099b --- /dev/null +++ b/types/business-rules-engine/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "paths": { + "q": [ "q/v0" ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "node-validators.d.ts", + "Utils.d.ts", + "Validation.d.ts", + "business-rules-engine-tests.ts" + ] +} \ No newline at end of file diff --git a/bwip-js/bwip-js-tests.ts b/types/bwip-js/bwip-js-tests.ts similarity index 100% rename from bwip-js/bwip-js-tests.ts rename to types/bwip-js/bwip-js-tests.ts diff --git a/bwip-js/index.d.ts b/types/bwip-js/index.d.ts similarity index 100% rename from bwip-js/index.d.ts rename to types/bwip-js/index.d.ts diff --git a/bwip-js/tsconfig.json b/types/bwip-js/tsconfig.json similarity index 100% rename from bwip-js/tsconfig.json rename to types/bwip-js/tsconfig.json diff --git a/byline/byline-tests.ts b/types/byline/byline-tests.ts similarity index 100% rename from byline/byline-tests.ts rename to types/byline/byline-tests.ts diff --git a/byline/index.d.ts b/types/byline/index.d.ts similarity index 100% rename from byline/index.d.ts rename to types/byline/index.d.ts diff --git a/byline/tsconfig.json b/types/byline/tsconfig.json similarity index 100% rename from byline/tsconfig.json rename to types/byline/tsconfig.json diff --git a/bytebuffer/bytebuffer-tests.ts b/types/bytebuffer/bytebuffer-tests.ts similarity index 100% rename from bytebuffer/bytebuffer-tests.ts rename to types/bytebuffer/bytebuffer-tests.ts diff --git a/bytebuffer/index.d.ts b/types/bytebuffer/index.d.ts similarity index 100% rename from bytebuffer/index.d.ts rename to types/bytebuffer/index.d.ts diff --git a/bytebuffer/tsconfig.json b/types/bytebuffer/tsconfig.json similarity index 100% rename from bytebuffer/tsconfig.json rename to types/bytebuffer/tsconfig.json diff --git a/bytes/bytes-tests.ts b/types/bytes/bytes-tests.ts similarity index 100% rename from bytes/bytes-tests.ts rename to types/bytes/bytes-tests.ts diff --git a/bytes/index.d.ts b/types/bytes/index.d.ts similarity index 100% rename from bytes/index.d.ts rename to types/bytes/index.d.ts diff --git a/bytes/tsconfig.json b/types/bytes/tsconfig.json similarity index 100% rename from bytes/tsconfig.json rename to types/bytes/tsconfig.json diff --git a/c3/c3-tests.ts b/types/c3/c3-tests.ts similarity index 99% rename from c3/c3-tests.ts rename to types/c3/c3-tests.ts index 4a0695af1f..d9057eabb6 100644 --- a/c3/c3-tests.ts +++ b/types/c3/c3-tests.ts @@ -368,7 +368,9 @@ function line_examples() { data: {}, line: { connectNull: true, - step_type: "step-after" + step: { + type: "step-after" + } } }); } diff --git a/types/c3/index.d.ts b/types/c3/index.d.ts new file mode 100644 index 0000000000..748b19bfc5 --- /dev/null +++ b/types/c3/index.d.ts @@ -0,0 +1,1083 @@ +// Type definitions for C3js v0.4 +// Project: http://c3js.org/ +// Definitions by: Marc Climent +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import * as d3 from "d3"; + +export = c3; +export as namespace c3; + +declare namespace c3 { + + type PrimitiveArray = Array; + type FormatFunction = (v: any, id: string, i: number, j: number) => void; + + interface TargetIds { + ids: ArrayOrString; + } + + type ArrayOrString = Array | string; + + interface ChartConfiguration { + /** + * The CSS selector or the element which the chart will be set to. D3 selection object can be specified. If other chart is set already, it will be replaced with the new one (only one chart can be set in one element). + * If this option is not specified, the chart will be generated but not be set. Instead, we can access the element by chart.element and set it by ourselves. + * Note: When chart is not binded, c3 starts observing if chart.element is binded by MutationObserver. In this case, polyfill is required in IE9 and IE10 becuase they do not support MutationObserver. On the other hand, if chart always will be binded, polyfill will not be required because MutationObserver will never be called. + */ + bindto?: string | HTMLElement | d3.Selection; + size?: { + /** + * The desired width of the chart element. + * If this option is not specified, the width of the chart will be calculated by the size of the parent element it's appended to. + * Note: This option should be specified if possible because it can improve its performance because some size calculations will be skipped by an explicit value. + */ + width?: number; + /** + * The desired height of the chart element. + * If this option is not specified, the height of the chart will be calculated by the size of the parent element it's appended to. + */ + height?: number; + }; + + padding?: { + /** + * The padding on the top of the chart. + */ + top?: number; + /** + * The padding on the right of the chart. + */ + right?: number; + /** + * The padding on the bottom of the chart. + */ + bottom?: number; + /** + * The padding on the left of the chart. + */ + left?: number; + }; + + color?: { + /** + * Set custom color pattern. + */ + pattern?: Array; + threshold?: any; // Undocumented + }; + + interaction?: { + /** + * Indicate if the chart should have interactions. + * If false is set, all of interactions (showing/hiding tooltip, selection, mouse events, etc) will be disabled. + */ + enabled?: boolean; + }; + + transition?: { + /** + * Set duration of transition (in milliseconds) for chart animation. + * Note: If 0 or null set, transition will be skipped. So, this makes initial rendering faster especially in case you have a lot of data. + */ + duration?: number; + }; + + /** + * Set a callback to execute when the chart is initialized. + */ + oninit?: () => void; + + /** + * Set a callback which is executed when the chart is rendered. Basically, this callback will be called in each time when the chart is redrawed. + */ + onrendered?: () => void; + + /** + * Set a callback to execute when mouse enters the chart. + */ + onmouseover?: () => void; + + /** + * Set a callback to execute when mouse leaves the chart. + */ + onmouseout?: () => void; + + /** + * Set a callback to execute when user resizes the screen. + */ + onresize?: () => void; + + /** + * Set a callback to execute when screen resize finished. + */ + onresized?: () => void; + + data: Data; + + axis?: Axis; + + grid?: Grid; + + /** + * Show rectangles inside the chart. + * This option accepts array including object that has axis, start, end and class. The keys start, end and class are optional. + * axis must be x, y or y2. start and end should be the value where regions start and end. If not specified, the edge values will be used. If timeseries x axis, date string, Date object and unixtime integer can be used. If class is set, the region element will have it as class. + */ + regions?: Array; + + legend?: LegendOptions; + + tooltip?: TooltipOptions; + + subchart?: SubchartOptions; + + zoom?: ZoomOptions; + + point?: PointOptions; + + line?: { + /** + * Set if null data point will be connected or not. + * If true set, the region of null data will be connected without any data point. If false set, the region of null data will not be connected and get empty. + */ + connectNull?: boolean; + /** + * Change step type for step chart. 'step', 'step-before' and 'step-after' can be used. + */ + step?: { + type: string; + }; + }; + + area?: { + /** + * Set if min or max value will be 0 on area chart. + */ + zerobased?: boolean; + }; + + bar?: { + /** + * Change the width of bar chart. If ratio is specified, change the width of bar chart by ratio. + */ + width?: number | { ratio: number }; + /** + * Set if min or max value will be 0 on bar chart. + */ + zerobased?: boolean; + }; + + pie?: { + label?: { + /** + * Show or hide label on each pie piece. + */ + show?: boolean; + /** + * Set formatter for the label on each pie piece. + */ + format?: (value: number, ratio: number, id: string) => string; + /** + * Set threshold to show/hide labels. + */ + threshold?: number + }; + /** + * Enable or disable expanding pie pieces. + */ + expand?: boolean; + }; + + donut?: { + label?: { + /** + * Show or hide label on each donut piece. + */ + show?: boolean; + /** + * Set formatter for the label on each donut piece. + */ + format?: (value: number, ratio: number, id: string) => string; + /** + * Set threshold to show/hide labels. + */ + threshold?: number + }; + /** + * Enable or disable expanding pie pieces. + */ + expand?: boolean; + /** + * Set width of donut chart. + */ + width?: number; + /** + * Set title of donut chart. + */ + title?: string; + }; + + gauge?: { + label?: { + /** + * Show or hide label on gauge. + */ + show?: boolean; + /** + * Set formatter for the label on gauge. + */ + format?: (value: any, ratio: number) => string; + }; + /** + * Enable or disable expanding gauge. + */ + expand?: boolean; + /** + * Set min value of the gauge. + */ + min?: number; + /** + * Set max value of the gauge. + */ + max?: number; + /** + * Set units of the gauge. + */ + units?: string; + /** + * Set width of gauge chart. + */ + width?: number; + }; + + spline?: { + interpolation?: { + /** + * Set custom spline interpolation + */ + type?: 'linear' | 'linear-closed' | 'basis' | 'basis-open' | 'basis-closed' | 'bundle' | 'cardinal' | 'cardinal-open' | 'cardinal-closed' | 'monotone'; + }; + }; + } + + interface Data { + /** + * Load a CSV or JSON file from a URL. Note that this will not work if loading via the "file://" protocol as most browsers with block XMLHTTPRequests. + */ + url?: string; + /** + * Parse a JSON object for data. + */ + json?: Object; + /** + * Load data from a multidimensional array, with the first element containing the data names, the following containing related data in that order. + */ + rows?: Array; + /* + * Load data from a multidimensional array, with each element containing an array consisting of a datum name and associated data values. + */ + columns?: Array; + /** + * Used if loading JSON via data.url + */ + mimeType?: string; + /** + * Choose which JSON object keys correspond to desired data. + */ + keys?: { x?: string; value: Array; }; + /** + * Specify the key of x values in the data. + * We can show the data with non-index x values by this option. This option is required when the type of x axis is timeseries. If this option is set on category axis, the values of the data on the key will be used for category names. + */ + x?: string; + /** + * Specify the keys of the x values for each data. + * This option can be used if we want to show the data that has different x values. + */ + xs?: { [key: string]: string }; + /** + * Set a format to parse string specifed as x. + * Default is %Y-%m-%d + */ + xFormat?: string; + //xLocaltime?: any; + //xSort?: any; + /** + * Set custom data name. + */ + names?: { [key: string]: string }; + /** + * Set custom data class. + * If this option is specified, the element g for the data has an additional class that has the prefix c3-target- (e.g. c3-target-additional-data1-class). + */ + classes?: { [key: string]: string }; + /** + * Set groups for the data for stacking. + */ + groups?: Array>; + /** + * Set y axis the data related to. y and y2 can be used. + */ + axes?: { [key: string]: string }; + /** + * Set chart type at once. + * If this option is specified, the type will be applied to every data. This setting can be overwritten by data.types. + * Available Values: line, spline, step, area, area-spline, area-step, bar, scatter, pie, donut, gauge + */ + type?: string; + /** + * Set chart type for each data. + * This setting overwrites data.type setting. + */ + types?: { [key: string]: string }; + /** + * Show labels on each data points or set formatter function for data labels. + * The formatter function receives 4 arguments such as v, id, i, j and it must return a string that will be shown as the label. The arguments are: + * - v is the value of the data point where the label is shown. + * - id is the id of the data where the label is shown. + * - i is the index of the data point where the label is shown. + * - j is the sub index of the data point where the label is shown. + * Formatter function can be defined for each data by specifying as an object and D3 formatter function can be set (e.g. d3.format('$')) + */ + labels?: boolean | + { format: FormatFunction } | + { format: { [key: string]: FormatFunction } }; + /** + * Define the order of the data. + * This option changes the order of stacking the data and pieces of pie/donut. If null specified, it will be the order the data loaded. If function specified, it will be used to sort the data and it will recieve the data as argument. + * Available Values: desc, asc, function (data1, data2) { ... }, null + */ + order?: string | ((...data: string[]) => void); + /** + * Define regions for each data. + * The values must be an array for each data and it should include an object that has start, end, style. If start is not set, the start will be the first data point. If end is not set, the end will be the last data point. + * Currently this option supports only line chart and dashed style. If this option specified, the line will be dashed only in the regions. + */ + regions?: { [key: string]: any }; + /** + * Set color converter function. + * This option should a function and the specified function receives color (e.g. '#ff0000') and d that has data parameters like id, value, index, etc. And it must return a string that represents color (e.g. '#00ff00'). + */ + color?: (color: string, d: any) => string | d3.Rgb; + /** + * Set color for each data. + */ + colors?: { [key: string]: string | d3.Rgb }; + /** + * Hide each data when the chart appears. + * If true specified, all of data will be hidden. If multiple ids specified as an array, those will be hidden. + */ + hide?: boolean | Array; + /** + * Set text displayed when empty data. + */ + empty?: { label: { text: string } }; + + selection?: { + enabled?: boolean; + grouped?: boolean; + multiple?: boolean; + draggable?: boolean; + isselectable?: (d?: any) => boolean; + }; + /** + * Set a callback for click event on each data point. + * This callback will be called when each data point clicked and will receive d and element as the arguments. + * - d is the data clicked and element is the element clicked. In this callback, this will be the Chart object. + */ + onclick?: (d: any, element: any) => void; + /** + * Set a callback for mouseover event on each data point. + * This callback will be called when mouse cursor moves onto each data point and will receive d as the argument. + * - d is the data where mouse cursor moves onto. In this callback, this will be the Chart object. + */ + onmouseover?: (d: any, element?: any) => void; + /** + * Set a callback for mouseout event on each data point. + * This callback will be called when mouse cursor moves out each data point and will receive d as the argument. + * - d is the data where mouse cursor moves out. In this callback, this will be the Chart object. + */ + onmouseout?: (d: any, element?: any) => void; + + onselected?: (d: any, element?: any) => void; + + onunselected?: (d: any, element?: any) => void; + } + + interface Axis { + /** + * Switch x and y axis position. + */ + rotated?: boolean; + x?: XAxisConfiguration; + y?: YAxisConfiguration; + y2?: YAxisConfiguration; + } + + interface XAxisConfiguration { + /** + * Show or hide x axis. + */ + show?: boolean; + /** + * Set type of x axis (timeseries, category, indexed) + */ + type?: string; + /** + * Set how to treat the timezone of x values. + * If true, treat x value as localtime. If false, convert to UTC internally. + */ + localtime?: boolean; + /** + * Set category names on category axis. + * This must be an array that includes category names in string. If category names are included in the date by data.x option, this is not required. + */ + categories?: Array; + + tick?: XTickConfiguration; + /** + * Set max value of x axis range. + */ + max?: number; + /** + * Set min value of x axis range. + */ + min?: number; + /** + * Set padding for x axis. + * If this option is set, the range of x axis will increase/decrease according to the values. If no padding is needed in the ragen of x axis, 0 should be set. On category axis, this option will be ignored. + */ + padding?: { + left?: number; + right?: number; + }; + /** + * Set height of x axis. + * The height of x axis can be set manually by this option. If you need more space for x axis, please use this option for that. The unit is pixel. + */ + height?: number; + /** + * Set default extent for subchart and zoom. This can be an array or function that returns an array. + */ + extent?: Array | (() => Array); + /** + * Set label on x axis. + * You can set x axis label and change its position by this option. string and object can be passed and we can change the poisiton by passing object that has position key. Available position differs according to the axis direction (vertical or horizontal). If string set, the position will be the default. + * Valid horizontal positions: inner-right (Default), inner-center, inner-left, outer-right, outer-center, outer-left + * Valid vertical positions: inner-top, inner-middle, inner-bottom, outer-top, outer-middle, outer-bottom + */ + label?: string | { text: string; position: string }; + } + + interface YAxisConfiguration { + /** + * Show or hide y axis. + */ + show?: boolean; + /** + * Show y axis inside of the chart. + */ + inner?: boolean; + /** + * Set max value of y axis. + */ + max?: number; + /** + * Set min value of y axis. + */ + min?: number; + /** + * Change the direction of y axis. + * If true set, the direction will be from the top to the bottom. + */ + inverted?: boolean; + /** + * Set center value of y axis. + */ + center?: number; + /** + * Set label on y axis. This option works in the same way as axis.x.label. + * Valid horizontal positions: inner-right (Default), inner-center, inner-left, outer-right, outer-center, outer-left + * Valid vertical positions: inner-top, inner-middle, inner-bottom, outer-top, outer-middle, outer-bottom + */ + label?: string | { text: string; position: string }; + tick?: YTickConfiguration; + /** + * Set padding for y axis. + * You can set padding for y axis to create more space on the edge of the axis. This option accepts object and it can include top and bottom. top, bottom will be treated as pixels. + */ + padding?: { + top?: number; + bottom?: number; + }; + /** + * Set default range of y axis. This option set the default value for y axis when there is no data on init. + */ + default?: Array; + + } + + interface XTickConfiguration { + /** + * Centerise ticks on category axis + */ + centered?: boolean; + /** + * A function to format tick value. Format string is also available for timeseries data. + */ + format?: string | ((x: number | Date) => string | number); + /** + * Setting for culling ticks. + * If true is set, the ticks will be culled, then only limitted tick text will be shown. This option does not hide the tick lines. If false is set, all of ticks will be shown. + */ + culling?: boolean | CullingConfiguration; + /** + * The number of x axis ticks to show. + * This option hides tick lines together with tick text. If this option is used on timeseries axis, the ticks position will be determined precisely and not nicely positioned (e.g. it will have rough second value). + */ + count?: number; + /** + * Fit x axis ticks. + * If true set, the ticks will be positioned nicely. If false set, the ticks will be positioned according to x value of the data points. + */ + fit?: boolean; + /** + * Set the x values of ticks manually. + * If this option is provided, the position of the ticks will be determined based on those values. This option works with timeseries data and the x values will be parsed accoding to the type of the value and data.xFormat option. + */ + values?: Array | Array; + /** + * Rotate x axis tick text. If you set negative value, it will rotate to opposite direction. + */ + rotate?: number; + /** + * Show x axis outer tick. + */ + outer?: boolean; + multiline?: boolean; // Undocumented + } + + interface YTickConfiguration { + /** + * Set formatter for y axis tick text. + * This option accepts d3.format object as well as a function you define. + */ + format?: (x: number) => string; + /** + * Show or hide outer tick. + */ + outer?: boolean; + /** + * Set the y values of ticks manually. + */ + values?: Array; + /** + * The number of y axis ticks to show. + * The position of the ticks will be calculated precisely, so the values on the ticks will not be rounded nicely. In the case, axis.y.tick.format or axis.y.tick.values will be helpful. + */ + count?: number; + } + + interface CullingConfiguration { + /** + * The number of tick texts will be adjusted to less than this value. + */ + max: number; + } + + interface Grid { + x?: { + /** + * Show grids along x axis. + */ + show?: boolean; + /** + * Show additional grid lines along x axis. + * This option accepts array including object that has value, text, position and class. text, position and class are optional. For position, start, middle and end (default) are available. + * If x axis is category axis, value can be category name. If x axis is timeseries axis, value can be date string, Date object and unixtime integer. + */ + lines?: Array; + }; + y?: { + /** + * Show grids along y axis. + */ + show?: boolean; + /** + * Show additional grid lines along y axis. + * This option accepts array including object that has value, text, position and class. + */ + lines?: Array; + }; + } + + interface LineOptions { + value: number; + text?: string; + axis?: string; + position?: string; + class?: string; + } + + interface RegionOptions { + axis?: string; + start?: string | number | Date; + end?: string | number | Date; + class?: string; + } + + interface LegendOptions { + /** + * Show or hide legend. + */ + show?: boolean; + /** + * Hide legend + * If true given, all legend will be hidden. If string or array given, only the legend that has the id will be hidden. + */ + hide?: boolean | ArrayOrString; + /** + * Change the position of legend. + * Currently bottom, right and inset are supported. + */ + position?: string; + /** + * Change inset legend attributes. + * This option accepts object that has the keys anchor, x, y and step. + * anchor decides the position of the legend. These anchors are available: top-left, top-right, bottom-left, bottom-right + * x and y set the position of the legend based on the anchor. + * step defines the max step the lagend has (e.g. If 2 set and legend has 3 legend item, the legend 2 columns). + */ + inset?: { + anchor?: string; + x?: number; + y?: number; + step?: number; + }; + + item?: { + /** + * Set click event handler to the legend item. + */ + onclick?: (id: any) => void; + /** + * Set mouseover event handler to the legend item. + */ + onmouseover?: (id: any) => void; + /** + * Set mouseout event handler to the legend item. + */ + onmouseout?: (id: any) => void; + }; + } + + interface TooltipOptions { + /** + * Show or hide tooltip. + */ + show?: boolean; + /** + * Set if tooltip is grouped or not for the data points. + */ + grouped?: boolean; + format?: { + /** + * Set format for the title of tooltip. Specified function receives x of the data point to show. + */ + title?: (x: any) => string; + /** + * Set format for the name of each data in tooltip. Specified function receives name, ratio, id and index of the data point to show. ratio will be undefined if the chart is not donut/pie/gauge. + */ + name?: (name: string, ratio: number, id: string, index: number) => string; + /** + * Set format for the value of each data in tooltip. + * Specified function receives name, ratio, id and index of the data point to show. ratio will be undefined if the chart is not donut/pie/gauge. + * If undefined returned, the row of that value will be skipped. + */ + value?: (value: any, ratio: number, id: string, index: number) => string; + }; + /** + * 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 }; + /** + * 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. + */ + contents?: (data: any, defaultTitleFormat: string, defaultValueFormat: string, color: any) => string; + } + + interface SubchartOptions { + /** + * Show sub chart on the bottom of the chart. + */ + show?: boolean; + size?: { + /** + * Change the height of the subchart. + */ + height: number; + }; + /** + * Set callback for brush event. + * Specified function receives the current zoomed x domain. + */ + onbrush?: (domain: any) => void; + } + + interface ZoomOptions { + /** + * Enable zooming. + */ + enabled?: boolean; + /** + * Enable to rescale after zooming. If true set, y domain will be updated according to the zoomed region. + */ + rescale?: boolean; + /** + * Change zoom extent. + */ + extent?: [number, number]; + /** + * Set callback that is called when the chart is zooming. Specified function receives the zoomed domain. + */ + onzoom?: (domain: any) => void; + /** + * Set callback that is called when zooming starts. Specified function receives the zoom event. + */ + onzoomstart?: (event: Event) => void; + /** + * Set callback that is called when zooming ends. Specified function receives the zoomed domain. + */ + onzoomend?: (domain: any) => void; + } + + interface PointOptions { + /** + * Whether to show each point in line. + */ + show?: boolean; + /** + * The radius size of each point. + */ + r?: number | ((d: any) => number); + + focus?: { + expand: { + /** + * Whether to expand each point on focus. + */ + enabled?: boolean; + /** + * The radius size of each point on focus. + */ + r?: number + }; + }; + + select?: { + /** + * The radius size of each point on selected. + */ + r?: number; + }; + } + + interface ChartAPI { + /** + * This API highlights specified targets and fade out the others. + * You can specify multiple targets by giving an array that includes id as String. If no argument is given, all of targets will be highlighted. + */ + focus(targetIds?: ArrayOrString): void; + /** + * This API fades out specified targets and reverts the others. + * You can specify multiple targets by giving an array that includes id as String. If no argument is given, all of targets will be faded out. + */ + defocus(targetIds?: ArrayOrString): void; + /** + * This API reverts specified targets. + * You can specify multiple targets by giving an array that includes id as String. If no argument is given, all of targets will be reverted. + */ + revert(targetIds?: ArrayOrString): void; + + /** + * This API shows specified targets. + * You can specify multiple targets by giving an array that includes id as String. If no argument is given, all of targets will be shown. + * If withLegend is set true, legend will be shown together with the specified data. + */ + show(targetIds?: ArrayOrString, options?: { withLegend: boolean }): void; + /** + * This API hides specified targets. + * You can specify multiple targets by giving an array that includes id as String. If no argument is given, all of targets will be hidden. + * If withLegend is set true, legend will be hidden together with the specified data. + */ + hide(targetIds?: ArrayOrString, options?: { withLegend: boolean }): void; + /** + * This API toggles (shows or hides) specified targets. + * You can specify multiple targets by giving an array that includes id as String. If no argument is given, all of targets will be toggles. + * If withLegend is set true, legend will be toggled together with the specified data. + */ + toggle(targetIds?: ArrayOrString, options?: { withLegend: boolean }): void; + /** + * Load data to the chart. + * If url, json, rows and columns given, the data will be loaded. If data that has the same target id is given, the chart will be updated. Otherwise, new target will be added. + * If classes given, the classes specifed by data.classes will be updated. classes must be Object that has target id as keys. + * If categories given, the categories specifed by axis.x.categories or data.x will be updated. categories must be Array. + * If axes given, the axes specifed by data.axes will be updated. axes must be Object that has target id as keys. + * If colors given, the colors specifed by data.colors will be updated. colors must be Object that has target id as keys. + * If type or types given, the type of targets will be updated. type must be String and types must be Object. + * If unload given, data will be unloaded before loading new data. If true given, all of data will be unloaded. If target ids given as String or Array, specified targets will be unloaded. + * If done given, the specified function will be called after data loded. + * NOTE: unload should be used if some data needs to be unloaded simultaneously. If you call unload API soon after/before load instead of unload param, chart will not be rendered properly because of cancel of animation. + * NOTE: done will be called after data loaded, but it's not after rendering. It's because rendering will finish after some transition and there is some time lag between loading and rendering. + */ + load(args: { + url?: string; + json?: Object; + keys?: { x?: string; value: Array; } + rows?: Array; + columns?: Array; + classes?: { [key: string]: string }; + categories?: Array; + axes?: { [key: string]: string }; + colors?: { [key: string]: string | d3.Rgb }; + type?: string; + types?: { [key: string]: string }; + unload?: boolean | ArrayOrString; + done?: () => any; + }): void; + /** + * Unload data to the chart. + * You can specify multiple targets by giving an array that includes id as String. If no argument is given, all of targets will be toggles. + * If ids given, the data that has specified target id will be unloaded. ids should be String or Array. If ids is not specified, all data will be unloaded. + * If done given, the specified function will be called after data loded. + * NOTE: If you call load API soon after/before unload, unload param of load should be used. Otherwise chart will not be rendered properly because of cancel of animation. + * NOTE: done will be called after data loaded, but it's not after rendering. It's because rendering will finish after some transition and there is some time lag between loading and rendering. + */ + unload(targetIds?: TargetIds, done?: () => any): any; + /** + * Flow data to the chart. By this API, you can append new data points to the chart. + * If json, rows and columns given, the data will be loaded. If data that has the same target id is given, the chart will be appended. Otherwise, new target will be added. One of these is required when calling. If json specified, keys is required as well as data.json + * If to is given, the lower x edge will move to that point. If not given, the lower x edge will move by the number of given data points. + * If length is given, the lower x edge will move by the number of this argument. + * If duration is given, the duration of the transition will be specified value. If not given, transition.duration will be used as default. + * If done is given, the specified function will be called when flow ends. + */ + flow(args: { + json?: Object; + keys?: { x?: string; value: Array; } + rows?: Array; + columns?: Array; + to?: any; + length?: number; + duration?: number; + done?: () => any; + }): void; + /** + * Change data point state to selected. By this API, you can select data points. To use this API, data.selection.enabled needs to be set true. + * @param ids Specify target ids to be selected. If this argument is not given, all targets will be the candidate. + * @param indices Specify indices to be selected. If this argument is not given, all data points will be the candidate. + * @param resetOthers If this argument is set true, the data points that are not specified by ids, indices will be unselected. + */ + select(ids?: Array, indices?: Array, resetOthers?: boolean): void; + /** + * Change data point state to unselected. By this API, you can unselect data points. To use this API, data.selection.enabled needs to be set true. + * @param ids Specify target ids to be unselected. If this argument is not given, all targets will be the candidate. + * @param indices Specify indices to be unselected. If this argument is not given, all data points will be the candidate. + */ + unselect(ids?: Array, indices?: Array): void; + /** + * Get selected data points. By this API, you can get selected data points information. To use this API, data.selection.enabled needs to be set true. + * @param targetId You can filter the result by giving target id that you want to get. If not given, all of data points will be returned. + */ + selected(targetId?: string): Data; + /** + * Change the type of the chart. + * @param type Specify the type to be transformed. The types listed in data.type can be used. + * @param targetIds Specify targets to be transformed. If not given, all targets will be the candidate. + */ + transform(type: string, targetIds?: ArrayOrString): void; + /** + * Update groups for the targets. + * @param groups This argument needs to be an Array that includes one or more Array that includes target ids to be grouped. + */ + groups(groups: Array>): void; + + xgrids: GridOperations; + + ygrids: GridOperations; + + regions: { + /** + * Update regions. + * @param regions Regions will be replaced with this argument. The format of this argument is the same as regions. + */ + (regions: Array): void; + /** + * Add new region. This API adds new region instead of replacing like regions. + * @param grids New region will be added. The format of this argument is the same as regions and it's possible to give an Object if only one region will be added. + */ + add(regions: Array | Object): void; + /** + * 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; + }; + + data: { + /** + * Get data loaded in the chart. + * @param targetIds If this argument is given, this API returns the specified target data. If this argument is not given, all of data will be returned. + */ + (targetIds?: ArrayOrString): Data; + /** + * Get data shown in the chart. + * @param targetIds If this argument is given, this API filters the data with specified target ids. If this argument is not given, all shown data will be returned. + */ + shown(targetIds?: ArrayOrString): Data; + /** + * Get values of the data loaded in the chart. + * @param targetIds This API returns the values of specified target. If this argument is not given, null will be retruned. + */ + values(targetIds?: ArrayOrString): Array; + /** + * Get and set names of the data loaded in the chart. + * @param names If this argument is given, the names of data will be updated. If not given, the current names will be returned. The format of this argument is the same as data.names. + */ + names(names?: { [key: string]: string }): { [key: string]: string }; + /** + * Get and set colors of the data loaded in the chart. + * @param colors If this argument is given, the colors of data will be updated. If not given, the current colors will be returned. The format of this argument is the same as data.colors. + */ + colors(colors?: { [key: string]: string | d3.Rgb }): { [key: string]: string }; + /** + * Get and set axes of the data loaded in the chart. + * @param axes If this argument is given, the axes of data will be updated. If not given, the current axes will be returned. The format of this argument is the same as data.axes. + */ + axes(axes?: { [key: string]: string }): { [key: string]: string }; + }; + + /** + * Gets and sets the value a category + * @param index Index of the category to get or set + * @param category: Value of the category to update + */ + category(index: number, category?: string): string; + + /** + * Get and set the categories + * @param categories: Value of the categories to update + */ + categories(categories?: Array): Array; + + /** + * Get the color for the specified targetId + */ + color(targetId: string): string; + + /** + * Get and set x values for the chart. + * @param x If x is given, x values of every target will be updated. If no argument is given, current x values will be returned as an Object whose keys are the target ids. + */ + x(x?: PrimitiveArray): PrimitiveArray; + + /** + * Get and set x values for the chart. + * @param x If x is given, x values of every target will be updated. If no argument is given, current x values will be returned as an Object whose keys are the target ids. + */ + xs(xs?: { [key: string]: PrimitiveArray }): { [key: string]: PrimitiveArray }; + + axis: { + /** + * Get and set axis labels. + * @param labels If labels is given, specified axis' label will be updated. + */ + labels(labels?: { [key: string]: string }): { [key: string]: string } + /** + * Get and set axis min value. + * @param min If min is given, specified axis' min value will be updated. If no argument is given, the current min values for each axis will be returned. + */ + min(min?: number | { [key: string]: number }): number | { [key: string]: number } + /** + * Get and set axis max value. + * @param max If max is given, specified axis' max value will be updated. If no argument is given, the current max values for each axis will be returned. + */ + max(max?: number | { [key: string]: number }): number | { [key: string]: number } + /** + * 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 } } + }; + + legend: { + /** + * Show legend for each target. + * @param targetIds If targetIds is given, specified target's legend will be shown. If only one target is the candidate, String can be passed. If no argument is given, all of target's legend will be shown. + */ + show(targetIds?: ArrayOrString): void; + /** + * Hide legend for each target. + * @param targetIds If targetIds is given, specified target's legend will be hidden. If only one target is the candidate, String can be passed. If no argument is given, all of target's legend will be hidden. + */ + hide(targetIds?: ArrayOrString): void; + }; + + zoom: { + /** + * Zoom by giving x domain. + * @param domain If domain is given, the chart will be zoomed to the given domain. If no argument is given, the current zoomed domain will be returned. + */ + (domain?: Array): Array; + + /** + * Enable and disable zooming. + * @param enabled If enabled is true, the feature of zooming will be enabled. If false is given, it will be disabled. + */ + enable(enabled: boolean): void; + }; + + /** + * Unzoom to the original domain. + */ + unzoom(): void; + + /** + * 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; + + /** + * Force to redraw. + */ + flush(): void; + + /** + * Reset the chart object and remove element and events completely. + */ + destroy(): void; + } + + interface GridOperations { + /** + * Update the x/y grid lines. + * @param grids X/Y grid lines will be replaced with this argument. The format of this argument is the same as grid.x.lines or grid.y.lines. + */ + (grids: Array): void; + /** + * Add x/y grid lines. This API adds new x/y grid lines instead of replacing like xgrids. + * @param grids New x/y grid lines will be added. The format of this argument is the same as grid.x.lines or grid.y.lines and it's possible to give an Object if only one line will be added. + */ + add(grids: Array | Object): void; + /** + * 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; + } + + export function generate(config: ChartConfiguration): ChartAPI; +} diff --git a/c3/tsconfig.json b/types/c3/tsconfig.json similarity index 100% rename from c3/tsconfig.json rename to types/c3/tsconfig.json diff --git a/cache-manager/cache-manager-tests.ts b/types/cache-manager/cache-manager-tests.ts similarity index 100% rename from cache-manager/cache-manager-tests.ts rename to types/cache-manager/cache-manager-tests.ts diff --git a/cache-manager/index.d.ts b/types/cache-manager/index.d.ts similarity index 100% rename from cache-manager/index.d.ts rename to types/cache-manager/index.d.ts diff --git a/cache-manager/tsconfig.json b/types/cache-manager/tsconfig.json similarity index 100% rename from cache-manager/tsconfig.json rename to types/cache-manager/tsconfig.json diff --git a/cachefactory/cachefactory-tests.ts b/types/cachefactory/cachefactory-tests.ts similarity index 94% rename from cachefactory/cachefactory-tests.ts rename to types/cachefactory/cachefactory-tests.ts index 73397dd8bf..32eeb63257 100644 --- a/cachefactory/cachefactory-tests.ts +++ b/types/cachefactory/cachefactory-tests.ts @@ -1,5 +1,3 @@ -/// - CacheFactory.get('test'); CacheFactory.createCache('test', { diff --git a/cachefactory/index.d.ts b/types/cachefactory/index.d.ts similarity index 100% rename from cachefactory/index.d.ts rename to types/cachefactory/index.d.ts diff --git a/cachefactory/tsconfig.json b/types/cachefactory/tsconfig.json similarity index 100% rename from cachefactory/tsconfig.json rename to types/cachefactory/tsconfig.json diff --git a/cal-heatmap/cal-heatmap-tests.ts b/types/cal-heatmap/cal-heatmap-tests.ts similarity index 99% rename from cal-heatmap/cal-heatmap-tests.ts rename to types/cal-heatmap/cal-heatmap-tests.ts index 47020b811c..ff0e3c0d06 100644 --- a/cal-heatmap/cal-heatmap-tests.ts +++ b/types/cal-heatmap/cal-heatmap-tests.ts @@ -1,6 +1,4 @@ - /// -/// var cal = new CalHeatMap(); cal.init(); diff --git a/cal-heatmap/index.d.ts b/types/cal-heatmap/index.d.ts similarity index 100% rename from cal-heatmap/index.d.ts rename to types/cal-heatmap/index.d.ts diff --git a/cal-heatmap/tsconfig.json b/types/cal-heatmap/tsconfig.json similarity index 100% rename from cal-heatmap/tsconfig.json rename to types/cal-heatmap/tsconfig.json diff --git a/callsite/callsite-tests.ts b/types/callsite/callsite-tests.ts similarity index 100% rename from callsite/callsite-tests.ts rename to types/callsite/callsite-tests.ts diff --git a/callsite/index.d.ts b/types/callsite/index.d.ts similarity index 100% rename from callsite/index.d.ts rename to types/callsite/index.d.ts diff --git a/callsite/tsconfig.json b/types/callsite/tsconfig.json similarity index 100% rename from callsite/tsconfig.json rename to types/callsite/tsconfig.json diff --git a/calq/calq-tests.ts b/types/calq/calq-tests.ts similarity index 100% rename from calq/calq-tests.ts rename to types/calq/calq-tests.ts diff --git a/calq/index.d.ts b/types/calq/index.d.ts similarity index 100% rename from calq/index.d.ts rename to types/calq/index.d.ts diff --git a/calq/tsconfig.json b/types/calq/tsconfig.json similarity index 100% rename from calq/tsconfig.json rename to types/calq/tsconfig.json diff --git a/types/camelcase-keys/camelcase-keys-tests.ts b/types/camelcase-keys/camelcase-keys-tests.ts new file mode 100644 index 0000000000..099b8c4a14 --- /dev/null +++ b/types/camelcase-keys/camelcase-keys-tests.ts @@ -0,0 +1,10 @@ +import camelcaseKeys = require('camelcase-keys'); + +camelcaseKeys({'foo-bar': true}); +// => {fooBar: true} + +camelcaseKeys({'foo-bar': true, nested: {unicorn_rainbow: true}}, {deep: true}); +// => {fooBar: true, nested: {unicornRainbow: true}} + +camelcaseKeys({_: [], 'foo-bar': true}); +// => {_: [], fooBar: true} diff --git a/camelcase-keys/index.d.ts b/types/camelcase-keys/index.d.ts similarity index 100% rename from camelcase-keys/index.d.ts rename to types/camelcase-keys/index.d.ts diff --git a/camelcase-keys/tsconfig.json b/types/camelcase-keys/tsconfig.json similarity index 100% rename from camelcase-keys/tsconfig.json rename to types/camelcase-keys/tsconfig.json diff --git a/types/camelcase-keys/tslint.json b/types/camelcase-keys/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/camelcase-keys/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/camelcase/camelcase-tests.ts b/types/camelcase/camelcase-tests.ts similarity index 100% rename from camelcase/camelcase-tests.ts rename to types/camelcase/camelcase-tests.ts diff --git a/camelcase/index.d.ts b/types/camelcase/index.d.ts similarity index 100% rename from camelcase/index.d.ts rename to types/camelcase/index.d.ts diff --git a/camelcase/tsconfig.json b/types/camelcase/tsconfig.json similarity index 100% rename from camelcase/tsconfig.json rename to types/camelcase/tsconfig.json diff --git a/camljs/camljs-tests.ts b/types/camljs/camljs-tests.ts similarity index 100% rename from camljs/camljs-tests.ts rename to types/camljs/camljs-tests.ts diff --git a/camljs/index.d.ts b/types/camljs/index.d.ts similarity index 100% rename from camljs/index.d.ts rename to types/camljs/index.d.ts diff --git a/camljs/tsconfig.json b/types/camljs/tsconfig.json similarity index 100% rename from camljs/tsconfig.json rename to types/camljs/tsconfig.json diff --git a/camo/camo-tests.ts b/types/camo/camo-tests.ts similarity index 100% rename from camo/camo-tests.ts rename to types/camo/camo-tests.ts diff --git a/camo/index.d.ts b/types/camo/index.d.ts similarity index 100% rename from camo/index.d.ts rename to types/camo/index.d.ts diff --git a/camo/tsconfig.json b/types/camo/tsconfig.json similarity index 100% rename from camo/tsconfig.json rename to types/camo/tsconfig.json diff --git a/cannon/cannon-tests.ts b/types/cannon/cannon-tests.ts similarity index 100% rename from cannon/cannon-tests.ts rename to types/cannon/cannon-tests.ts diff --git a/cannon/index.d.ts b/types/cannon/index.d.ts similarity index 100% rename from cannon/index.d.ts rename to types/cannon/index.d.ts diff --git a/cannon/tsconfig.json b/types/cannon/tsconfig.json similarity index 100% rename from cannon/tsconfig.json rename to types/cannon/tsconfig.json diff --git a/canvas-gauges/canvas-gauges-tests.ts b/types/canvas-gauges/canvas-gauges-tests.ts similarity index 100% rename from canvas-gauges/canvas-gauges-tests.ts rename to types/canvas-gauges/canvas-gauges-tests.ts diff --git a/types/canvas-gauges/index.d.ts b/types/canvas-gauges/index.d.ts new file mode 100644 index 0000000000..e5b4f69047 --- /dev/null +++ b/types/canvas-gauges/index.d.ts @@ -0,0 +1,292 @@ +// Type definitions for canvas-gauges v2.1.3 +// Project: https://github.com/Mikhus/canvas-gauges +// Definitions by: Mikhus +// Definitions: https://github.com/Mikhus/DefinitelyTyped + +declare namespace CanvasGauges { + export type FontStyle = 'normal' | 'italic' | 'oblique'; + export type FontWeight = 'normal' | 'bold' | 'bolder' | 'lighter' | + '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900'; + + export type RenderTarget = string|HTMLElement; + + export interface AnimationRule { + (percent: number): number; + } + + export interface Highlight { + from: number, + to: number, + color: string + } + + export interface EventListeners { + [key: string]: Function|[Function] + } + + export type MajorTicks = string[]|number[]; + + export interface GenericOptions { + renderTo: RenderTarget, + width?: number, + height?: number, + minValue?: number, + maxValue?: number, + value?: number, + units?: string|boolean, + exactTicks?: boolean, + majorTicks?: MajorTicks, + minorTicks?: number, + strokeTicks?: boolean, + animatedValue?: boolean, + animateOnInit?: boolean, + title?: string|boolean, + borders?: boolean, + numbersMargin?: number, + listeners?: EventListeners, + valueInt?: number, + valueDec?: number, + majorTicksInt?: number, + majorTicksDec?: number, + animation?: boolean, + animationDuration?: number, + animationRule?: string|AnimationRule, + colorPlate?: string, + colorPlateEnd?: string, + colorMajorTicks?: string, + colorMinorTicks?: string, + colorTitle?: string, + colorUnits?: string, + colorNumbers?: string, + colorNeedle?: string, + colorNeedleEnd?: string, + colorValueText?: string, + colorValueTextShadow?: string, + colorBorderShadow?: string, + colorBorderOuter?: string, + colorBorderOuterEnd?: string, + colorBorderMiddle?: string, + colorBorderMiddleEnd?: string, + colorBorderInner?: string, + colorBorderInnerEnd?: string, + colorValueBoxRect?: string, + colorValueBoxRectEnd?: string, + colorValueBoxBackground?: string, + colorValueBoxShadow?: string, + colorNeedleShadowUp?: string, + colorNeedleShadowDown?: string, + colorBarStroke?: string, + colorBar?: string, + colorBarProgress?: string, + colorBarShadow?: string, + fontNumbers?: string, + fontTitle?: string, + fontUnits?: string, + fontValue?: string, + fontTitleSize?: number, + fontValueSize?: number, + fontUnitsSize?: number, + fontNumbersSize?: number, + fontTitleStyle?: FontStyle, + fontValueStyle?: FontStyle, + fontUnitsStyle?: FontStyle, + fontNumbersStyle?: FontStyle, + fontTitleWeight?: FontWeight, + fontValueWeight?: FontWeight, + fontUnitsWeight?: FontWeight, + fontNumbersWeight?: FontWeight, + needle?: boolean, + needleShadow?: boolean, + needleType?: string, + needleStart?: number, + needleEnd?: number, + needleWidth?: number, + borderOuterWidth?: number, + borderMiddleWidth?: number, + borderInnerWidth?: number, + borderShadowWidth?: number, + valueBox?: boolean, + valueBoxWidth?: number, + valueBoxStroke?: number, + valueText?: string, + valueTextShadow?: boolean, + valueBoxBorderRadius?: number, + highlights?: Highlight[], + highlightsWidth?: number, + barWidth?: number, + barStrokeWidth?: number, + barProgress?: boolean, + barShadow?: number + } + + export interface RadialGaugeOptions extends GenericOptions { + ticksAngle?: number, + startAngle?: number, + colorNeedleCircleOuter?: string, + colorNeedleCircleOuterEnd?: string, + colorNeedleCircleInner?: string, + colorNeedleCircleInnerEnd?: string, + needleCircleSize?: number, + needleCircleInner?: boolean, + needleCircleOuter?: boolean, + animationTarget?: string, + useMinPath?: boolean + } + + export interface LinearGaugeOptions extends GenericOptions { + borderRadius?: number, + barBeginCircle?: number, + colorBarEnd?: string, + colorBarProgressEnd?: string, + tickSide?: string, + needleSide?: string, + numberSide?: string, + ticksWidth?: number, + ticksWidthMinor?: number, + ticksPadding?: number, + barLength?: number + } + + export interface DrawEventCallback { + (percent: number): any; + } + + export interface EndEventCallback { + (): any; + } + + export interface rules { + linear: AnimationRule, + quad: AnimationRule, + dequad: AnimationRule, + quint: AnimationRule, + dequint: AnimationRule, + cycle: AnimationRule, + decycle: AnimationRule, + bounce: AnimationRule, + debounce: AnimationRule, + elastic: AnimationRule, + delastic: AnimationRule + } + + export class Animation { + public duration: number; + public rule: string|AnimationRule; + public draw: DrawEventCallback; + public end: EndEventCallback; + + public static rules: rules; + + constructor(rule?: string|AnimationRule, duration?: number, + draw?: DrawEventCallback, end?: EndEventCallback); + + public animate(draw?: DrawEventCallback, end?: EndEventCallback): any; + public destroy(): any; + } + + export class SmartCanvas { + public element: HTMLCanvasElement; + public elementClone: HTMLCanvasElement; + public context: CanvasRenderingContext2D; + public contextClone: CanvasRenderingContext2D; + public drawWidth: number; + public drawHeight: number; + public drawX: number; + public drawY: number; + public minSide: number; + public width: number; + public height: number; + + constructor(element: HTMLCanvasElement, + width?: number, + height?: number); + + public init(): any; + public onRedraw(): any; + public destroy(): any; + public commit(): SmartCanvas; + public redraw(): SmartCanvas; + + public pixelRatio: number; + public static redraw(): any; + public static collection: Array; + } + + export class DomObserver { + public Type: BaseGauge; + public mutationsObserved: boolean; + public isObservable: boolean; + public options: GenericOptions; + public element: string; + public type: string; + + constructor(options: GenericOptions, + element: string, + type: string); + + public isValidNode(node: Node|HTMLElement): boolean; + public traverse(): any; + public observe(records: MutationRecord[]): any; + public process(node: Node|HTMLElement): BaseGauge; + + public static parse(value: any): any; + public static toDashed(camelCase: string): string; + public static toAttributeName(str: string): string; + static domReady(handler: Function): any; + } + + export abstract class BaseGauge { + public type: BaseGauge; + public options: GenericOptions; + public canvas: SmartCanvas; + public animation: Animation; + public value: number; + public static readonly version: number; + + constructor(options: GenericOptions); + + public update(options: GenericOptions): BaseGauge; + public destroy(): any; + public abstract draw(): BaseGauge; + + public static initialize(type: string, options: GenericOptions): any; + public static fromElement(element: HTMLElement): any; + public static ensureValue(value: number): number; + } + + export class RadialGauge extends BaseGauge { + public type: RadialGauge; + public options: RadialGaugeOptions; + + constructor(options: RadialGaugeOptions); + + public draw(): RadialGauge; + } + + export class LinearGauge extends BaseGauge { + public type: LinearGauge; + public options: LinearGaugeOptions; + + constructor(options: LinearGaugeOptions); + + public draw(): LinearGauge; + } + + export interface Collection extends Array { + get: (id: number | string) => BaseGauge; + } +} + +declare module 'canvas-gauges' { + export = CanvasGauges; +} + +interface Document { + gauges: CanvasGauges.Collection; +} + +interface Window { + BaseGauge: CanvasGauges.BaseGauge; + RadialGauge: CanvasGauges.RadialGauge; + LinearGauge: CanvasGauges.LinearGauge; +} diff --git a/canvas-gauges/tsconfig.json b/types/canvas-gauges/tsconfig.json similarity index 100% rename from canvas-gauges/tsconfig.json rename to types/canvas-gauges/tsconfig.json diff --git a/canvasjs/canvasjs-tests.ts b/types/canvasjs/canvasjs-tests.ts similarity index 100% rename from canvasjs/canvasjs-tests.ts rename to types/canvasjs/canvasjs-tests.ts diff --git a/canvasjs/index.d.ts b/types/canvasjs/index.d.ts similarity index 100% rename from canvasjs/index.d.ts rename to types/canvasjs/index.d.ts diff --git a/canvasjs/tsconfig.json b/types/canvasjs/tsconfig.json similarity index 100% rename from canvasjs/tsconfig.json rename to types/canvasjs/tsconfig.json diff --git a/cash/index.d.ts b/types/cash/index.d.ts similarity index 100% rename from cash/index.d.ts rename to types/cash/index.d.ts diff --git a/cash/tsconfig.json b/types/cash/tsconfig.json similarity index 100% rename from cash/tsconfig.json rename to types/cash/tsconfig.json diff --git a/types/casperjs/index.d.ts b/types/casperjs/index.d.ts new file mode 100644 index 0000000000..e8388d17c7 --- /dev/null +++ b/types/casperjs/index.d.ts @@ -0,0 +1,310 @@ +// Type definitions for CasperJS v1.0.29 +// Project: http://casperjs.org/ +// Definitions by: Jed Mao +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + + +export function create(options?: CasperOptions): Casper; + +export function selectXPath(expression: string): Object; + +export class Casper { + + constructor(options: CasperOptions); + + test: Tester; + options: CasperOptions; + + // Properties + __utils__: ClientUtils; + + // Methods + back(): Casper; + base64encode(url: string, method?: string, data?: any): string; + bypass(nb: number): any; + click(selector: string): boolean; + clickLabel(label: string, tag?: string): boolean; + capture(targetFilePath: string, clipRect: ClipRect): Casper; + captureBase64(format: string): string; + captureBase64(format: string, area: string): string; + captureBase64(format: string, area: ClipRect): string; + captureBase64(format: string, area: any): string; + captureSelector(targetFile: string, selector: string): Casper; + clear(): Casper; + debugHTML(selector?: string, outer?: boolean): Casper; + debugPage(): Casper; + die(message: string, status?: number): Casper; + download(url: string, target?: string, method?: string, data?: any): Casper; + each(array: T[], fn: (this: Casper, item: T, index: number) => void): Casper; + echo(message: string, style?: string): Casper; + evaluate(fn: (...args: any[]) => T, ...args: any[]): T + evaluateOrDie(fn: () => any, message?: string, status?: number): Casper; + exit(status?: number): Casper; + exists(selector: string): boolean; + fetchText(selector: string): string; + forward(): Casper; + log(message: string, level?: string, space?: string): Casper; + fill(selector: string, values: any, submit?: boolean): void; + fillSelectors(selector: string, values: any, submit?: boolean): void; + fillXPath(selector: string, values: any, submit?: boolean): void; + getCurrentUrl(): string; + getElementAttribute(selector: string, attribute: string): string; + getElementsAttribute(selector: string, attribute: string): string; + getElementBounds(selector: string): ElementBounds; + getElementsBounds(selector: string): ElementBounds[]; + getElementInfo(selector: string): ElementInfo; + getElementsInfo(selector: string): ElementInfo; + getFormValues(selector: string): any; + getGlobal(name: string): any; + getHTML(selector?: string, outer?: boolean): string; + getPageContent(): string; + getTitle(): string; + mouseEvent(type: string, selector: string): boolean; + open(location: string, settings: OpenSettings): Casper; + reload(then?: (response: HttpResponse) => void): Casper; + repeat(times: number, then: Function): Casper; + resourceExists(test: Function): boolean; + resourceExists(test: string): boolean; + run(onComplete: Function, time?: number): Casper; + scrollTo(x: number, y: number): Casper; + scrollToBottom(): Casper; + sendKeys(selector: string, keys: string, options?: any): Casper; + setHttpAuth(username: string, password: string): Casper; + start(url?: string, then?: (response: HttpResponse) => void): Casper; + status(asString: boolean): any; + then(fn: (this: Casper) => void): Casper; + thenBypass(nb: number): Casper; + thenBypassIf(condition: any, nb: number): Casper; + thenBypassUnless(condition: any, nb: number): Casper; + thenClick(selector: string): Casper; + thenEvaluate(fn: () => any, ...args: any[]): Casper; + thenOpen(location: string, then?: (response: HttpResponse) => void): Casper; + thenOpen(location: string, options?: OpenSettings, then?: (response: HttpResponse) => void): Casper; + thenOpenAndEvaluate(location: string, then?: Function, ...args: any[]): Casper; + toString(): string; + unwait(): Casper; + userAgent(agent: string): string; + viewport(width: number, height: number): Casper; + visible(selector: string): boolean; + wait(timeout: number, then?: Function): Casper; + waitFor(testFx: Function, then?: Function, onTimeout?: Function, timeout?: number): Casper; + waitForAlert(then: Function, onTimeout?: Function, timeout?: number): Casper; + waitForPopup(urlPattern: string, then?: Function, onTimeout?: Function, timeout?: number): Casper; + waitForPopup(urlPattern: RegExp, then?: Function, onTimeout?: Function, timeout?: number): Casper; + waitForUrl(url: string, then?: Function, onTimeout?: Function, timeout?: number): Casper; + waitForUrl(url: RegExp, then?: Function, onTimeout?: Function, timeout?: number): Casper; + waitForSelector(selector: string, then?: Function, onTimeout?: Function, timeout?: number): Casper; + waitWhileSelector(selector: string, then?: Function, onTimeout?: Function, timeout?: number): Casper; + waitForResource(testFx: Function, then?: Function, onTimeout?: Function, timeout?: number): Casper; + waitForText(pattern: string, then?: Function, onTimeout?: Function, timeout?: number): Casper; + waitForText(pattern: RegExp, then?: Function, onTimeout?: Function, timeout?: number): Casper; + waitUntilVisible(selector: string, then?: Function, onTimeout?: Function, timeout?: number): Casper; + waitWhileVisible(selector: string, then?: Function, onTimeout?: Function, timeout?: number): Casper; + warn(message: string): Casper; + withFrame(frameInfo: string, then: Function): Casper; + withFrame(frameInfo: number, then: Function): Casper; + withPopup(popupInfo: string, step: Function): Casper; + withPopup(popupInfo: RegExp, step: Function): Casper; + zoom(factor: number): Casper; + removeAllFilters(filter: string): Casper; + setFilter(filter: string, cb: Function): boolean; +} + +interface HttpResponse { + contentType: string; + headers: any[]; + id: number; + redirectURL: string; + stage: string; + status: number; + statusText: string; + time: string; + url: string; +} + +interface OpenSettings { + method: string; + data: any; + headers: any; +} + +interface ElementBounds { + top: number; + left: number; + width: number; + height: number; +} + +interface ElementInfo { + nodeName: string; + attributes: any; + tag: string; + html: string; + text: string; + x: number; + y: number; + width: number; + height: number; + visible: boolean; +} + +interface CasperOptions { + clientScripts?: any[]; + exitOnError?: boolean; + httpStatusHandlers?: any; + logLevel?: string; + onAlert?: Function; + onDie?: Function; + onError?: Function; + onLoadError?: Function; + onPageInitialized?: Function; + onResourceReceived?: Function; + onResourceRequested?: Function; + onStepComplete?: Function; + onStepTimeout?: Function; + onTimeout?: Function; + onWaitTimeout?: Function; + page?: WebPage; + pageSettings?: any; + remoteScripts?: any[]; + safeLogs?: boolean; + silentErrors?: boolean; + stepTimeout?: number; + timeout?: number; + verbose?: boolean; + viewportSize?: any; + retryTimeout?: number; + waitTimeout?: number; +} + +interface ClientUtils { + echo(message: string): void; + encode(contents: string): void; + exists(selector: string): void; + findAll(selector: string): void; + findOne(selector: string): void; + getBase64(url: string, method?: string, data?: any): void; + getBinary(url: string, method?: string, data?: any): void; + getDocumentHeight(): void; + getElementBounds(selector: string): void; + getElementsBounds(selector: string): void; + getElementByXPath(expression: string, scope?: HTMLElement): void; + getElementsByXPath(expression: string, scope?: HTMLElement): void; + getFieldValue(inputName: string): void; + getFormValues(selector: string): void; + mouseEvent(type: string, selector: string): void; + removeElementsByXPath(expression: string): void; + sendAJAX(url: string, method?: string, data?: any, async?: boolean): void; + visible(selector: string): void; +} + +interface Colorizer { + colorize(text: string, styleName: string): void; + format(text: string, style: any): void; +} + +interface Tester { + assert(condition: boolean, message?: string): any; + assertDoesntExist(selector: string, message?: string): any; + assertElementCount(selctor: string, expected: number, message?: string): any; + assertEquals(testValue: any, expected: any, message?: string): any; + assertEval(fn: Function, message: string, args: any): any; + assertEvalEquals(fn: Function, expected: any, message?: string, args?: any): any; + assertExists(selector: string, message?: string): any; + assertFalsy(subject: any, message?: string): any; + assertField(inputName: string, expected: string, message?: string): any; + assertFieldName(inputName: string, expected: string, message?: string, options?: any): any; + assertFieldCSS(cssSelector: string, expected: string, message?: string): any; + assertFieldXPath(xpathSelector: string, expected: string, message?: string): any; + assertHttpStatus(status: number, message?: string): any; + assertMatch(subject: any, pattern: RegExp, message?: string): any; + assertNot(subject: any, message?: string): any; + assertNotEquals(testValue: any, expected: any, message?: string): any; + assertNotVisible(selector: string, message?: string): any; + assertRaises(fn: Function, args: any[], message?: string): any; + assertSelectorDoesntHaveText(selector: string, text: string, message?: string): any; + assertSelectorExists(selector: string, message?: string): any; + assertSelectorHasText(selector: string, text: string, message?: string): any; + assertResourceExists(testFx: Function, message?: string): any; + assertTextExists(expected: string, message?: string): any; + assertTextDoesntExist(unexpected: string, message: string): any; + assertTitle(expected: string, message?: string): any; + assertTitleMatch(pattern: RegExp, message?: string): any; + assertTruthy(subject: any, message?: string): any; + assertType(input: any, type: string, message?: string): any; + assertInstanceOf(input: any, ctor: Function, message?: string): any; + assertUrlMatch(pattern: string, message?: string): any; + assertUrlMatch(pattern: RegExp, message?: string): any; + assertVisible(selector: string, message?: string): any; + + /* since 1.1 */ + begin(description: string, planned: number, suite: Function): any; + begin(description: string, suite: Function): any; + begin(description: string, planned: number, config: Object): any; + begin(description: string, config: Object): any; + + colorize(message: string, style: string): any; + comment(message: string): any; + done(expected?: number): any; + error(message: string): any; + fail(message: string): any; + formatMessage(message: string, style: string): any; + getFailures(): Cases; + getPasses(): Cases; + info(message: string): any; + pass(message: string): any; + renderResults(exit: boolean, status: number, save: string): any; + + setup(fn: Function): any; + skip(nb: number, message: string): any; + tearDown(fn: Function): any; +} + +interface Cases { + length: number; + cases: Case[]; +} + +interface Case { + success: boolean; + type: string; + standard: string; + file: string; + values: CaseValues; +} + +interface CaseValues { + subject: boolean; + expected: boolean; +} + +interface Utils { + betterTypeOf(input: any): any; + dump(value: any): any; + fileExt(file: string): any; + fillBlanks(text: string, pad: number): any; + format(f: string, ...args: any[]): any; + getPropertyPath(obj: any, path: string): any; + inherits(ctor: any, superCtor: any): any; + isArray(value: any): any; + isCasperObject(value: any): any; + isClipRect(value: any): any; + isFalsy(subject: any): any; + isFunction(value: any): any; + isJsFile(file: string): any; + isNull(value: any): any; + isNumber(value: any): any; + isObject(value: any): any; + isRegExp(value: any): any; + isString(value: any): any; + isTruthy(subject: any): any; + isType(what: any, type: string): any; + isUndefined(value: any): any; + isWebPage(what: any): any; + mergeObjects(origin: any, add: any): any; + node(name: string, attributes: any): any; + serialize(value: any): any; + unique(array: any[]): any; +} diff --git a/casperjs/tsconfig.json b/types/casperjs/tsconfig.json similarity index 100% rename from casperjs/tsconfig.json rename to types/casperjs/tsconfig.json diff --git a/cassandra-driver/cassandra-driver-tests.ts b/types/cassandra-driver/cassandra-driver-tests.ts similarity index 89% rename from cassandra-driver/cassandra-driver-tests.ts rename to types/cassandra-driver/cassandra-driver-tests.ts index 9feee249ac..e5d8f2ab60 100644 --- a/cassandra-driver/cassandra-driver-tests.ts +++ b/types/cassandra-driver/cassandra-driver-tests.ts @@ -1,5 +1,3 @@ -/// - import * as cassandra from 'cassandra-driver'; import * as util from 'util'; diff --git a/cassandra-driver/index.d.ts b/types/cassandra-driver/index.d.ts similarity index 100% rename from cassandra-driver/index.d.ts rename to types/cassandra-driver/index.d.ts diff --git a/cassandra-driver/tsconfig.json b/types/cassandra-driver/tsconfig.json similarity index 100% rename from cassandra-driver/tsconfig.json rename to types/cassandra-driver/tsconfig.json diff --git a/cbor/cbor-tests.ts b/types/cbor/cbor-tests.ts similarity index 97% rename from cbor/cbor-tests.ts rename to types/cbor/cbor-tests.ts index e1a7abb9cf..eb84201b97 100644 --- a/cbor/cbor-tests.ts +++ b/types/cbor/cbor-tests.ts @@ -1,5 +1,3 @@ -/// - import cbor = require('cbor'); import assert = require('assert'); import fs = require('fs'); diff --git a/cbor/index.d.ts b/types/cbor/index.d.ts similarity index 100% rename from cbor/index.d.ts rename to types/cbor/index.d.ts diff --git a/cbor/tsconfig.json b/types/cbor/tsconfig.json similarity index 100% rename from cbor/tsconfig.json rename to types/cbor/tsconfig.json diff --git a/types/ccap/ccap-tests.ts b/types/ccap/ccap-tests.ts new file mode 100644 index 0000000000..12a38a9f60 --- /dev/null +++ b/types/ccap/ccap-tests.ts @@ -0,0 +1,21 @@ +import * as ccap from 'ccap'; + +const captcha1 = ccap(); + +const width = 0; +const height = 0; +const offset = 0; +const captcha2 = ccap(width, height, offset); + +const captcha3 = ccap({ + width: 256, // set width,default is 256 + height: 60, // set height,default is 60 + offset: 40, // set text spacing,default is 40 + quality: 100, // set pic quality,default is 50 + fontsize: 57, // set font size,default is 57 + // Custom the function to generate captcha text + generate() { + // generate captcha text here + return 'text'; // return the captcha text + } +}); diff --git a/types/ccap/index.d.ts b/types/ccap/index.d.ts new file mode 100644 index 0000000000..32b7ce2e16 --- /dev/null +++ b/types/ccap/index.d.ts @@ -0,0 +1,26 @@ +// Type definitions for ccap 0.6 +// Project: https://github.com/DoubleSpout/ccap +// Definitions by: taoqf +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +interface Captcha { + get(): [string, Buffer]; +} + +interface Options { + width?: number; // set width,default is 256 + height?: number; // set height,default is 60 + offset?: number; // set text spacing,default is 40 + quality?: number; // set pic quality,default is 50 + fontsize?: number; // set font size,default is 57 + // Custom the function to generate captcha text + generate?(): string; +} + +declare function ccap(width: number, height: number, offset: number): Captcha; +declare function ccap(options?: Options): Captcha; + +declare namespace ccap { } +export = ccap; diff --git a/types/ccap/tsconfig.json b/types/ccap/tsconfig.json new file mode 100644 index 0000000000..d1c1d4d626 --- /dev/null +++ b/types/ccap/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ccap-tests.ts" + ] +} diff --git a/types/ccap/tslint.json b/types/ccap/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/ccap/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/chai-as-promised/chai-as-promised-tests.ts b/types/chai-as-promised/chai-as-promised-tests.ts similarity index 98% rename from chai-as-promised/chai-as-promised-tests.ts rename to types/chai-as-promised/chai-as-promised-tests.ts index 7e22c575aa..7dceef924a 100644 --- a/chai-as-promised/chai-as-promised-tests.ts +++ b/types/chai-as-promised/chai-as-promised-tests.ts @@ -1,8 +1,5 @@ -/// - import chai = require('chai'); import chaiAsPromised = require('chai-as-promised'); -import Q = require('q'); chai.use(chaiAsPromised); @@ -47,7 +44,7 @@ thenableNum.should.be.fulfilled.then(function () { thenableNum.should.equal("after"); }).should.notify(() => console.log('done')); -Q.all([ +Promise.all([ thenableNum.should.become("happy"), thenableNum.should.eventually.have.property("fun times"), thenableNum.should.be.rejectedWith(TypeError, "only joyful types are allowed") diff --git a/chai-as-promised/index.d.ts b/types/chai-as-promised/index.d.ts similarity index 100% rename from chai-as-promised/index.d.ts rename to types/chai-as-promised/index.d.ts diff --git a/chai-as-promised/tsconfig.json b/types/chai-as-promised/tsconfig.json similarity index 100% rename from chai-as-promised/tsconfig.json rename to types/chai-as-promised/tsconfig.json diff --git a/chai-datetime/chai-datetime-tests.ts b/types/chai-datetime/chai-datetime-tests.ts similarity index 100% rename from chai-datetime/chai-datetime-tests.ts rename to types/chai-datetime/chai-datetime-tests.ts diff --git a/chai-datetime/index.d.ts b/types/chai-datetime/index.d.ts similarity index 100% rename from chai-datetime/index.d.ts rename to types/chai-datetime/index.d.ts diff --git a/chai-datetime/tsconfig.json b/types/chai-datetime/tsconfig.json similarity index 100% rename from chai-datetime/tsconfig.json rename to types/chai-datetime/tsconfig.json diff --git a/chai-dom/chai-dom-tests.ts b/types/chai-dom/chai-dom-tests.ts similarity index 100% rename from chai-dom/chai-dom-tests.ts rename to types/chai-dom/chai-dom-tests.ts diff --git a/chai-dom/index.d.ts b/types/chai-dom/index.d.ts similarity index 100% rename from chai-dom/index.d.ts rename to types/chai-dom/index.d.ts diff --git a/chai-dom/tsconfig.json b/types/chai-dom/tsconfig.json similarity index 100% rename from chai-dom/tsconfig.json rename to types/chai-dom/tsconfig.json diff --git a/chai-enzyme/chai-enzyme-tests.tsx b/types/chai-enzyme/chai-enzyme-tests.tsx similarity index 91% rename from chai-enzyme/chai-enzyme-tests.tsx rename to types/chai-enzyme/chai-enzyme-tests.tsx index 7e7ef027ed..8fc64e2711 100644 --- a/chai-enzyme/chai-enzyme-tests.tsx +++ b/types/chai-enzyme/chai-enzyme-tests.tsx @@ -1,7 +1,3 @@ -/// -/// -/// - import * as React from "react"; import * as chaiEnzyme from "chai-enzyme"; import { expect } from "chai"; @@ -34,7 +30,7 @@ expect(wrapper).to.have.ref("test"); expect(wrapper).to.be.selected(); expect(wrapper).to.have.tagName("div"); expect(wrapper).to.have.text(""); -expect(wrapper).to.have.Type(Test); +expect(wrapper).to.have.type(Test); expect(wrapper).to.have.value("test"); expect(wrapper).to.have.attr("test", "test"); expect(wrapper).to.have.data("test", "Test"); diff --git a/chai-enzyme/index.d.ts b/types/chai-enzyme/index.d.ts similarity index 100% rename from chai-enzyme/index.d.ts rename to types/chai-enzyme/index.d.ts diff --git a/chai-enzyme/tsconfig.json b/types/chai-enzyme/tsconfig.json similarity index 100% rename from chai-enzyme/tsconfig.json rename to types/chai-enzyme/tsconfig.json diff --git a/chai-fuzzy/chai-fuzzy-tests.ts b/types/chai-fuzzy/chai-fuzzy-tests.ts similarity index 100% rename from chai-fuzzy/chai-fuzzy-tests.ts rename to types/chai-fuzzy/chai-fuzzy-tests.ts diff --git a/chai-fuzzy/index.d.ts b/types/chai-fuzzy/index.d.ts similarity index 100% rename from chai-fuzzy/index.d.ts rename to types/chai-fuzzy/index.d.ts diff --git a/chai-fuzzy/tsconfig.json b/types/chai-fuzzy/tsconfig.json similarity index 100% rename from chai-fuzzy/tsconfig.json rename to types/chai-fuzzy/tsconfig.json diff --git a/chai-http/chai-http-tests.ts b/types/chai-http/chai-http-tests.ts similarity index 100% rename from chai-http/chai-http-tests.ts rename to types/chai-http/chai-http-tests.ts diff --git a/chai-http/index.d.ts b/types/chai-http/index.d.ts similarity index 100% rename from chai-http/index.d.ts rename to types/chai-http/index.d.ts diff --git a/chai-http/tsconfig.json b/types/chai-http/tsconfig.json similarity index 100% rename from chai-http/tsconfig.json rename to types/chai-http/tsconfig.json diff --git a/chai-jquery/chai-jquery-tests.ts b/types/chai-jquery/chai-jquery-tests.ts similarity index 100% rename from chai-jquery/chai-jquery-tests.ts rename to types/chai-jquery/chai-jquery-tests.ts diff --git a/chai-jquery/index.d.ts b/types/chai-jquery/index.d.ts similarity index 100% rename from chai-jquery/index.d.ts rename to types/chai-jquery/index.d.ts diff --git a/chai-jquery/tsconfig.json b/types/chai-jquery/tsconfig.json similarity index 100% rename from chai-jquery/tsconfig.json rename to types/chai-jquery/tsconfig.json diff --git a/chai-json-schema/chai-json-schema-tests.ts b/types/chai-json-schema/chai-json-schema-tests.ts similarity index 99% rename from chai-json-schema/chai-json-schema-tests.ts rename to types/chai-json-schema/chai-json-schema-tests.ts index 5d4715a76e..7273ac60cc 100644 --- a/chai-json-schema/chai-json-schema-tests.ts +++ b/types/chai-json-schema/chai-json-schema-tests.ts @@ -65,4 +65,3 @@ const data2 = [true, 123]; expect(chai.tv4.validate(data1, schema)).to.be.true; expect(chai.tv4.validate(data2, schema)).to.be.false; - diff --git a/types/chai-json-schema/index.d.ts b/types/chai-json-schema/index.d.ts new file mode 100644 index 0000000000..69aec8bec7 --- /dev/null +++ b/types/chai-json-schema/index.d.ts @@ -0,0 +1,29 @@ +// Type definitions for chai-json-schema 1.4 +// Project: https://github.com/chaijs/chai-json-schema/ +// Definitions by: Ulrich Heiniger +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// +// +import tv4 = require('tv4'); + +declare global { + namespace Chai { + interface Assert { + jsonSchema(value: any, schema: any, msg?: string): void; + notJsonSchema(value: any, schema: any, msg?: string): void; + } + + interface LanguageChains { + jsonSchema(schema: any, msg?: string): void; + } + + interface ChaiStatic { + tv4: tv4.TV4; + } + } +} + +declare function chaiJsonSchema(chai: any, utils: any): void; +declare namespace chaiJsonSchema { } +export = chaiJsonSchema; diff --git a/chai-json-schema/tsconfig.json b/types/chai-json-schema/tsconfig.json similarity index 100% rename from chai-json-schema/tsconfig.json rename to types/chai-json-schema/tsconfig.json diff --git a/types/chai-json-schema/tslint.json b/types/chai-json-schema/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/chai-json-schema/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/chai-oequal/chai-oequal-tests.ts b/types/chai-oequal/chai-oequal-tests.ts similarity index 100% rename from chai-oequal/chai-oequal-tests.ts rename to types/chai-oequal/chai-oequal-tests.ts diff --git a/chai-oequal/index.d.ts b/types/chai-oequal/index.d.ts similarity index 100% rename from chai-oequal/index.d.ts rename to types/chai-oequal/index.d.ts diff --git a/chai-oequal/tsconfig.json b/types/chai-oequal/tsconfig.json similarity index 100% rename from chai-oequal/tsconfig.json rename to types/chai-oequal/tsconfig.json diff --git a/types/chai-oequal/tslint.json b/types/chai-oequal/tslint.json new file mode 100644 index 0000000000..075fa88707 --- /dev/null +++ b/types/chai-oequal/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "no-single-declare-module": false + } +} diff --git a/chai-spies/chai-spies-tests.ts b/types/chai-spies/chai-spies-tests.ts similarity index 98% rename from chai-spies/chai-spies-tests.ts rename to types/chai-spies/chai-spies-tests.ts index 7ac0610e4d..326b1e0137 100644 --- a/chai-spies/chai-spies-tests.ts +++ b/types/chai-spies/chai-spies-tests.ts @@ -1,6 +1,3 @@ -/// -/// - import * as chai from 'chai'; import * as spies from 'chai-spies'; import * as Mocha from 'mocha'; diff --git a/chai-spies/index.d.ts b/types/chai-spies/index.d.ts similarity index 100% rename from chai-spies/index.d.ts rename to types/chai-spies/index.d.ts diff --git a/chai-spies/tsconfig.json b/types/chai-spies/tsconfig.json similarity index 100% rename from chai-spies/tsconfig.json rename to types/chai-spies/tsconfig.json diff --git a/chai-string/chai-string-tests.ts b/types/chai-string/chai-string-tests.ts similarity index 100% rename from chai-string/chai-string-tests.ts rename to types/chai-string/chai-string-tests.ts diff --git a/chai-string/index.d.ts b/types/chai-string/index.d.ts similarity index 100% rename from chai-string/index.d.ts rename to types/chai-string/index.d.ts diff --git a/chai-string/tsconfig.json b/types/chai-string/tsconfig.json similarity index 100% rename from chai-string/tsconfig.json rename to types/chai-string/tsconfig.json diff --git a/chai-subset/chai-subset-tests.ts b/types/chai-subset/chai-subset-tests.ts similarity index 85% rename from chai-subset/chai-subset-tests.ts rename to types/chai-subset/chai-subset-tests.ts index 33cf036cf8..717f86cb33 100644 --- a/chai-subset/chai-subset-tests.ts +++ b/types/chai-subset/chai-subset-tests.ts @@ -1,14 +1,11 @@ - - import chai = require('chai'); import chaiSubset = require('chai-subset'); chai.use(chaiSubset); -var expect = chai.expect; -var assert = chai.assert; +const { assert, expect } = chai; function test_containSubset() { - var obj = { + const obj = { a: 'b', c: 'd', e: { @@ -34,7 +31,7 @@ function test_containSubset() { } function test_notContainSubset() { - var obj = { + const obj = { a: 'b', c: 'd', e: { @@ -50,7 +47,7 @@ function test_notContainSubset() { } function test_arrayContainSubset() { - var list = [{a: 'a', b: 'b'}, {v: 'f', d: {z: 'g'}} ]; + const list = [{a: 'a', b: 'b'}, {v: 'f', d: {z: 'g'}} ]; expect(list).to.containSubset([{a: 'a', b: 'b'}]); list.should.containSubset([{a: 'a', b: 'b'}]); @@ -58,7 +55,7 @@ function test_arrayContainSubset() { } function test_arrayNotContainSubset() { - var list = [{a: 'a', b: 'b'}, {v: 'f', d: {z: 'g'}} ]; + const list = [{a: 'a', b: 'b'}, {v: 'f', d: {z: 'g'}} ]; expect(list).not.to.containSubset([{a: 'a', b: 'bd'}]); list.should.not.containSubset([{a: 'a', b: 'bd'}]); diff --git a/chai-subset/index.d.ts b/types/chai-subset/index.d.ts similarity index 100% rename from chai-subset/index.d.ts rename to types/chai-subset/index.d.ts diff --git a/chai-subset/tsconfig.json b/types/chai-subset/tsconfig.json similarity index 100% rename from chai-subset/tsconfig.json rename to types/chai-subset/tsconfig.json diff --git a/types/chai-subset/tslint.json b/types/chai-subset/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/chai-subset/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/chai-things/chai-things-tests.ts b/types/chai-things/chai-things-tests.ts similarity index 100% rename from chai-things/chai-things-tests.ts rename to types/chai-things/chai-things-tests.ts diff --git a/chai-things/index.d.ts b/types/chai-things/index.d.ts similarity index 100% rename from chai-things/index.d.ts rename to types/chai-things/index.d.ts diff --git a/chai-things/tsconfig.json b/types/chai-things/tsconfig.json similarity index 100% rename from chai-things/tsconfig.json rename to types/chai-things/tsconfig.json diff --git a/chai-xml/chai-xml-tests.ts b/types/chai-xml/chai-xml-tests.ts similarity index 100% rename from chai-xml/chai-xml-tests.ts rename to types/chai-xml/chai-xml-tests.ts diff --git a/chai-xml/index.d.ts b/types/chai-xml/index.d.ts similarity index 100% rename from chai-xml/index.d.ts rename to types/chai-xml/index.d.ts diff --git a/chai-xml/tsconfig.json b/types/chai-xml/tsconfig.json similarity index 100% rename from chai-xml/tsconfig.json rename to types/chai-xml/tsconfig.json diff --git a/types/chai-xml/tslint.json b/types/chai-xml/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/chai-xml/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/chai/chai-tests.ts b/types/chai/chai-tests.ts new file mode 100644 index 0000000000..756212995d --- /dev/null +++ b/types/chai/chai-tests.ts @@ -0,0 +1,1662 @@ +import * as chai from "chai"; + +const expect = chai.expect; +const assert = chai.assert; +const should = chai.should(); + +function chaiVersion(): string { + return chai.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() { + should.fail('foo', 'bar'); + should.fail('foo', 'bar', 'should fail'); + + expect.fail('foo', 'bar'); + expect.fail('foo', 'bar', 'should fail'); +} + +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; + + expect('test').to.be.true; + 'test'.should.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; + + expect('').to.be.ok; + ''.should.be.ok; + + expect('test').to.not.be.ok; + 'test'.should.not.be.ok; +} + +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; + + expect('').to.be.false; + ''.should.be.false; +} + +function _null() { + expect(null).to.be.null; + should.equal(null, null); + expect(false).to.not.be.null; + false.should.not.be.null; + + expect('').to.be.null; + ''.should.be.null; +} + +function _undefined() { + expect(undefined).to.be.undefined; + should.equal(undefined, undefined); + expect(null).to.not.be.undefined; + should.not.equal(null, undefined); + + expect('').to.be.undefined; + ''.should.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() { + const foo = 'bar'; + expect(foo).to.exist; + should.exist(foo); + expect(void (0)).to.not.exist; + should.not.exist(void (0)); +} + +function argumentsTest() { + const 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'); + + expect('test').to.not.be.a('string'); + 'test'.should.not.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 + + expect(5).to.not.be.a('number', 'blah'); + (5).should.not.be.a('number', 'blah'); +} + +class Foo { } +function _instanceof() { + expect(new Foo()).to.be.an.instanceof(Foo); + (new Foo()).should.be.an.instanceof(Foo); + + expect(3).to.an.instanceof(Foo, 'blah'); + (3).should.an.instanceof(Foo, 'blah'); +} + +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); + + expect(5).to.not.be.within(4, 6, 'blah'); + (5).should.not.be.within(4, 6, 'blah'); + + expect(10).to.be.within(50, 100, 'blah'); + (10).should.be.within(50, 100, 'blah'); + + expect('foo').to.have.length.within(5, 7, 'blah'); + 'foo'.should.have.length.within(5, 7, 'blah'); + + expect([1, 2, 3]).to.have.length.within(5, 7, 'blah'); + [1, 2, 3].should.have.length.within(5, 7, 'blah'); +} + +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); + + expect(5).to.be.above(6, 'blah'); + (5).should.be.above(6, 'blah'); + + expect(10).to.not.be.above(6, 'blah'); + (10).should.not.be.above(6, 'blah'); + + expect('foo').to.have.length.above(4, 'blah'); + 'foo'.should.have.length.above(4, 'blah'); + + expect([1, 2, 3]).to.have.length.above(4, 'blah'); + [1, 2, 3].should.have.length.above(4, 'blah'); +} + +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); + + expect(5).to.be.at.least(6, 'blah'); + (5).should.be.at.least(6, 'blah'); + + expect(10).to.not.be.at.least(6, 'blah'); + (10).should.not.be.at.least(6, 'blah'); + + expect('foo').to.have.length.of.at.least(4, 'blah'); + 'foo'.should.have.length.of.at.least(4, 'blah'); + + expect([1, 2, 3]).to.have.length.of.at.least(4, 'blah'); + [1, 2, 3].should.have.length.of.at.least(4, 'blah'); + + 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'); +} + +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); + + expect(6).to.be.below(5, 'blah'); + (6).should.be.below(5, 'blah'); + + expect(6).to.not.be.below(10, 'blah'); + (6).should.not.be.below(10, 'blah'); + + expect('foo').to.have.length.below(2, 'blah'); + 'foo'.should.have.length.below(2, 'blah'); + + expect([1, 2, 3]).to.have.length.below(2, 'blah'); + [1, 2, 3].should.have.length.below(2, 'blah'); +} + +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); + + expect(6).to.be.at.most(5, 'blah'); + (6).should.be.at.most(5, 'blah'); + + expect(6).to.not.be.at.most(10, 'blah'); + (6).should.not.be.at.most(10, 'blah'); + + expect('foo').to.have.length.of.at.most(2, 'blah'); + 'foo'.should.have.length.of.at.most(2, 'blah'); + + expect([1, 2, 3]).to.have.length.of.at.most(2, 'blah'); + [1, 2, 3].should.have.length.of.at.most(2, 'blah'); + + expect([1, 2]).to.not.have.length.of.at.most(2, 'blah'); + [1, 2].should.not.have.length.of.at.most(2, 'blah'); +} + +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/); + + expect('foobar').to.match(/^bar/i, 'blah'); + 'foobar'.should.match(/^bar/i, 'blah'); + + expect('foobar').to.not.match(/^foo/i, 'blah'); + 'foobar'.should.not.match(/^foo/i, 'blah'); +} + +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); + + expect(4).to.have.length(3, 'blah'); + (4).should.have.length(3, 'blah'); + + expect('asd').to.not.have.length(3, 'blah'); + 'asd'.should.not.have.length(3, 'blah'); +} + +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); + + expect(4).to.eql(3, 'blah'); + (4).should.eql(3, 'blah'); +} + +class Buffer { + constructor(arr: number[]) { + } +} +function buffer() { + expect(new Buffer([1])).to.eql(new Buffer([1])); + (new Buffer([1])).should.eql(new Buffer([1])); + + expect(new Buffer([0])).to.eql(new Buffer([1])); + (new Buffer([0])).should.eql(new Buffer([1])); +} + +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); + + expect(4).to.equal(3, 'blah'); + (4).should.equal(3, 'blah'); + should.equal(4, 3, 'blah'); + + expect('4').to.equal(4, 'blah'); + '4'.should.equal(4, 'blah'); + should.equal(4, 4, 'blah'); +} + +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); +} + +function deepEqual3() { + const a = new Date(1, 2, 3); + const 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; + + expect('').not.to.be.empty; + ''.should.not.be.empty; + + expect('foo').to.be.empty; + 'foo'.should.be.empty; + 'foo'.should.be.empty; + + expect([]).not.to.be.empty; + [].should.not.be.empty; + + expect(['foo']).to.be.empty; + ['foo'].should.be.empty; + + expect(new FakeArgs).not.to.be.empty; + (new FakeArgs).should.not.be.empty; + + expect({ arguments: 0 }).to.be.empty; + ({ arguments: 0 }).should.be.empty; + + expect({}).not.to.be.empty; + ({}).should.not.be.empty; + + expect({ foo: 'bar' }).to.be.empty; + ({ foo: 'bar' }).should.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'); + + expect('asd').to.have.property('foo'); + 'asd'.should.have.property('foo'); + + expect({ foo: { bar: 'baz' } }) + .to.have.property('foo.bar'); + + ({ foo: { bar: 'baz' } }).should.have.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'); + + expect({ 'foo.bar': 'baz' }) + .to.have.deep.property('foo.bar'); + ({ 'foo.bar': 'baz' }).should + .have.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); + + expect('asd').to.have.property('length', 4, 'blah'); + 'asd'.should.have.property('length', 4, 'blah'); + + expect('asd').to.not.have.property('length', 3, 'blah'); + 'asd'.should.not.have.property('length', 3, 'blah'); + + expect('asd').to.not.have.property('foo', 3, 'blah'); + 'asd'.should.not.have.property('foo', 3, 'blah'); + + expect('asd').to.have.property('constructor', Number, 'blah'); + 'asd'.should.have.property('constructor', Number, 'blah'); +} + +function deepProperty2() { + expect({ foo: { bar: 'baz' } }) + .to.have.deep.property('foo.bar', 'baz'); + ({ foo: { bar: 'baz' } }).should + .have.deep.property('foo.bar', 'baz'); + + expect({ foo: { bar: 'baz' } }) + .to.have.deep.property('foo.bar', 'quux', 'blah'); + ({ foo: { bar: 'baz' } }).should + .have.deep.property('foo.bar', 'quux', 'blah'); + 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'); + expect({ foo: 5 }) + .to.not.have.deep.property('foo.bar', 'baz', 'blah'); + ({ foo: 5 }).should + .not.have.deep.property('foo.bar', 'baz', 'blah'); +} + +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'); + + expect({ length: 12 }).to.not.have.ownProperty('length', 'blah'); + ({ length: 12 }).should.not.have.ownProperty('length', 'blah'); +} + +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'); + + expect(3).to.have.string('baz'); + (3).should.have.string('baz'); + + expect('foobar').to.have.string('baz', 'blah'); + 'foobar'.should.have.string('baz', 'blah'); + + expect('foobar').to.not.have.string('bar', 'blah'); + 'foobar'.should.not.have.string('bar', 'blah'); +} + +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); + + expect(['foo', 'bar']).includes('foo'); + ['foo', 'bar'].should.includes('foo'); + + expect(['foo']).to.include('bar', 'blah'); + ['foo'].should.include('bar', 'blah'); + + expect(['bar', 'foo']).to.not.include('foo', 'blah'); + ['bar', 'foo'].should.not.include('foo', 'blah'); +} + +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'); + + expect({ foo: 1 }).to.have.keys(); + ({ foo: 1 }).should.have.keys(); + + expect({ foo: 1 }).to.have.keys([]); + ({ foo: 1 }).should.have.keys([]); + + expect({ foo: 1 }).to.not.have.keys([]); + ({ foo: 1 }).should.not.have.keys([]); + + expect({ foo: 1 }).to.contain.keys([]); + ({ foo: 1 }).should.contain.keys([]); + + expect({ foo: 1 }).to.have.keys(['bar']); + ({ foo: 1 }).should.have.keys(['bar']); + + expect({ foo: 1 }).to.have.keys(['bar', 'baz']); + ({ foo: 1 }).should.have.keys(['bar', 'baz']); + + expect({ foo: 1 }).to.have.keys(['foo', 'bar', 'baz']); + ({ foo: 1 }).should.have.keys(['foo', 'bar', 'baz']); + + expect({ foo: 1 }).to.not.have.keys(['foo']); + ({ foo: 1 }).should.not.have.keys(['foo']); + + expect({ foo: 1 }).to.not.have.keys(['foo']); + ({ foo: 1 }).should.not.have.keys(['foo']); + + expect({ foo: 1, bar: 2 }).to.not.have.keys(['foo', 'bar']); + ({ foo: 1, bar: 2 }).should.not.have.keys(['foo', 'bar']); + + expect({ foo: 1 }).to.not.contain.keys(['foo']); + ({ foo: 1 }).should.not.contain.keys(['foo']); + + expect({ foo: 1 }).to.contain.keys('foo', 'bar'); + ({ foo: 1 }).should.contain.keys('foo', 'bar'); +} + +function chaining() { + const tea = { name: 'chai', extras: ['milk', 'sugar', 'smile'] }; + expect(tea).to.have.property('extras').with.lengthOf(3); + tea.should.have.property('extras').with.lengthOf(3); + + expect(tea).to.have.property('extras').with.lengthOf(4); + tea.should.have.property('extras').with.lengthOf(4); + + 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); + + const specificError = new RangeError('boo'); + + const 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'); + + expect(goodFn).to.throw(); + goodFn.should.throw(); + should.throw(goodFn); + + expect(goodFn).to.throw(ReferenceError); + goodFn.should.throw(ReferenceError); + should.throw(goodFn, ReferenceError); + + expect(goodFn).to.throw(specificError); + goodFn.should.throw(specificError); + should.throw(goodFn, specificError); + + expect(badFn).to.not.throw(); + badFn.should.not.throw(); + should.not.throw(badFn); + + expect(badFn).to.throw(ReferenceError); + badFn.should.throw(ReferenceError); + should.throw(badFn, ReferenceError); + + expect(badFn).to.throw(specificError); + badFn.should.throw(specificError); + should.throw(badFn, specificError); + + expect(badFn).to.not.throw(Error); + badFn.should.not.throw(Error); + should.not.throw(badFn, Error); + + expect(refErrFn).to.not.throw(ReferenceError); + refErrFn.should.not.throw(ReferenceError); + should.not.throw(refErrFn, ReferenceError); + + expect(badFn).to.throw(PoorlyConstructedError); + badFn.should.throw(PoorlyConstructedError); + should.throw(badFn, PoorlyConstructedError); + + expect(ickyErrFn).to.not.throw(PoorlyConstructedError); + ickyErrFn.should.not.throw(PoorlyConstructedError); + should.not.throw(ickyErrFn, PoorlyConstructedError); + + expect(ickyErrFn).to.throw(ReferenceError); + ickyErrFn.should.throw(ReferenceError); + should.throw(ickyErrFn, ReferenceError); + + expect(specificErrFn).to.throw(new ReferenceError('eek')); + specificErrFn.should.throw(new ReferenceError('eek')); + should.throw(specificErrFn, new ReferenceError('eek')); + + expect(specificErrFn).to.not.throw(specificError); + specificErrFn.should.not.throw(specificError); + should.not.throw(specificErrFn, specificError); + + expect(badFn).to.not.throw(/testing/); + badFn.should.not.throw(/testing/); + should.not.throw(badFn, /testing/); + + expect(badFn).to.throw(/hello/); + badFn.should.throw(/hello/); + should.throw(badFn, /hello/); + + expect(badFn).to.throw(Error, /hello/, 'blah'); + badFn.should.throw(Error, /hello/, 'blah'); + should.throw(badFn, Error, /hello/, 'blah'); + + expect(badFn).to.throw(Error, 'hello', 'blah'); + badFn.should.throw(Error, 'hello', 'blah'); + should.throw(badFn, Error, 'hello', 'blah'); +} + +function use() { + chai.use((_chai) => { + _chai.can.use.any(); + }); + + let expect = chai + .use((_chai, util) => {}) + .use((_chai, util) => {}) + .expect; +} + +class Klass { + val: number; + constructor() { this.val = 0; } + bar() { } + + static baz() { } +} + +function respondTo() { + const 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'); + + expect(Klass).to.respondTo('baz', 'constructor'); + Klass.should.respondTo('baz', 'constructor'); + + expect(obj).to.respondTo('baz', 'object'); + obj.should.respondTo('baz', 'object'); +} + +function satisfy() { + function matcher(num: number) { + return num === 1; + } + + expect(1).to.satisfy(matcher); + (1).should.satisfy(matcher); + + expect(2).to.satisfy(matcher, 'blah'); + (2).should.satisfy(matcher, 'blah'); +} + +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); + + expect(2).to.be.closeTo(1.0, 0.5, 'blah'); + (2).should.be.closeTo(1.0, 0.5, 'blah'); + + expect(-10).to.be.closeTo(20, 29, 'blah'); + (-10).should.be.closeTo(20, 29, 'blah'); +} + +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); + + expect(2).to.be.approximately(1.0, 0.5, 'blah'); + (2).should.be.approximately(1.0, 0.5, 'blah'); + + expect(-10).to.be.approximately(20, 29, 'blah'); + (-10).should.be.approximately(20, 29, 'blah'); +} + +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() { + const obj = { val: 10 }; + const inc = () => { obj.val++; }; + const dec = () => { obj.val--; }; + const 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"); +} + +function oneOf() { + const 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; + +interface FieldObj { + field: any; +} + +class CrashyObject { + inspect(): void { + throw new Error('Arg\'s inspect() called even though the test passed'); + } +} + +suite('assert', () => { + + test('assert', () => { + const foo: string = 'bar'; + assert(foo === 'bar', 'expected foo to equal `bar`'); + + assert(foo === 'baz', 'expected foo to equal `bar`'); + }); + + test('isTrue', () => { + assert.isTrue(true); + assert.isTrue(false); + assert.isTrue(1); + assert.isTrue('test'); + }); + + test('ok', () => { + assert.ok(true); + assert.ok(1); + assert.ok('test'); + assert.isOk(true); + assert.isOk(1); + assert.isOk('test'); + assert.ok(false); + assert.ok(0); + assert.ok(''); + }); + + test('notOk', () => { + assert.notOk(false); + assert.notOk(0); + assert.notOk(''); + assert.isNotOk(false); + assert.isNotOk(0); + assert.isNotOk(''); + assert.notOk(true); + assert.notOk(1); + assert.notOk('test'); + }); + + test('isFalse', () => { + assert.isFalse(false); + assert.isFalse(true); + assert.isFalse(0); + }); + + test('equal', () => { + assert.equal(void (0), undefined); + }); + + test('typeof / notTypeOf', () => { + assert.typeOf('test', 'string'); + assert.typeOf(true, 'boolean'); + assert.typeOf(5, 'number'); + assert.typeOf(5, 'string'); + }); + + test('notTypeOf', () => { + assert.notTypeOf('test', 'number'); + assert.notTypeOf(5, 'number'); + }); + + test('instanceOf', () => { + assert.instanceOf(new Foo(), Foo); + assert.instanceOf(5, Foo); + assert.instanceOf(new CrashyObject(), CrashyObject); + }); + + test('notInstanceOf', () => { + assert.notInstanceOf(new Foo(), String); + assert.notInstanceOf(new Foo(), Foo); + }); + + test('isObject', () => { + assert.isObject({}); + assert.isObject(new Foo()); + assert.isObject(true); + assert.isObject(Foo); + assert.isObject('foo'); + }); + + test('isNotObject', () => { + assert.isNotObject(5); + assert.isNotObject({}); + }); + + test('notEqual', () => { + assert.notEqual(3, 4); + assert.notEqual(5, 5); + }); + + test('strictEqual', () => { + assert.strictEqual('foo', 'foo'); + }); + + test('notStrictEqual', () => { + assert.notStrictEqual(5, 5); + }); + + test('deepEqual', () => { + assert.deepEqual({ tea: 'chai' }, { tea: 'chai' }); + assert.deepEqual({ tea: 'chai' }, { tea: 'black' }); + + const obja = Object.create({ tea: 'chai' }) + , objb = Object.create({ tea: 'chai' }); + + assert.deepEqual(obja, objb); + + const obj1 = Object.create({ tea: 'chai' }) + , obj2 = Object.create({ tea: 'black' }); + + assert.deepEqual(obj1, obj2); + }); + + test('deepEqual (ordering)', () => { + const a = { a: 'b', c: 'd' } + , b = { c: 'd', a: 'b' }; + assert.deepEqual(a, b); + }); + + test('deepEqual (circular)', () => { + const circularObject: any = {} + , secondCircularObject: any = {}; + circularObject.field = circularObject; + secondCircularObject.field = secondCircularObject; + + assert.deepEqual(circularObject, secondCircularObject); + + secondCircularObject.field2 = secondCircularObject; + assert.deepEqual(circularObject, secondCircularObject); + }); + + test('notDeepEqual', () => { + assert.notDeepEqual({ tea: 'jasmine' }, { tea: 'chai' }); + assert.notDeepEqual({ tea: 'chai' }, { tea: 'chai' }); + }); + + test('notDeepEqual (circular)', () => { + const circularObject: any = {} + , secondCircularObject: any = { tea: 'jasmine' }; + circularObject.field = circularObject; + secondCircularObject.field = secondCircularObject; + + assert.notDeepEqual(circularObject, secondCircularObject); + + delete secondCircularObject.tea; + assert.notDeepEqual(circularObject, secondCircularObject); + }); + + test('isNull', () => { + assert.isNull(null); + assert.isNull(undefined); + }); + + test('isNotNull', () => { + assert.isNotNull(undefined); + assert.isNotNull(null); + }); + + test('isUndefined', () => { + assert.isUndefined(undefined); + assert.isUndefined(null); + }); + + test('isDefined', () => { + assert.isDefined(null); + assert.isDefined(undefined); + }); + + test('isNaN', () => { + assert.isNaN(NaN); + assert.isNaN(12); + }); + + test('isNotNaN', () => { + assert.isNotNaN(12); + assert.isNotNaN(NaN); + }); + + test('isFunction', () => { + const func = () => { + }; + assert.isFunction(func); + assert.isFunction({}); + }); + + test('isNotFunction', () => { + assert.isNotFunction(5); + assert.isNotFunction(() => {}); + }); + + test('isArray', () => { + assert.isArray([]); + assert.isArray(new Array()); + assert.isArray({}); + }); + + test('isNotArray', () => { + assert.isNotArray(3); + assert.isNotArray([]); + assert.isNotArray(new Array()); + }); + + test('isString', () => { + assert.isString('Foo'); + assert.isString(new String('foo')); + assert.isString(1); + }); + + test('isNotString', () => { + assert.isNotString(3); + assert.isNotString(['hello']); + assert.isNotString('hello'); + }); + + test('isNumber', () => { + assert.isNumber(1); + assert.isNumber(Number('3')); + assert.isNumber('1'); + }); + + test('isNotNumber', () => { + assert.isNotNumber('hello'); + assert.isNotNumber([5]); + assert.isNotNumber(4); + }); + + test('isBoolean', () => { + assert.isBoolean(true); + assert.isBoolean(false); + assert.isBoolean('1'); + }); + + test('isNotBoolean', () => { + assert.isNotBoolean('true'); + assert.isNotBoolean(true); + assert.isNotBoolean(false); + }); + + test('include', () => { + assert.include('foobar', 'bar'); + assert.include([1, 2, 3], 3); + assert.include('foobar', 'baz'); + assert.include(undefined, 'bar'); + }); + + test('notInclude', () => { + assert.notInclude('foobar', 'baz'); + assert.notInclude([1, 2, 3], 4); + assert.notInclude('foobar', 'bar'); + assert.notInclude(undefined, 'bar'); + }); + + test('lengthOf', () => { + assert.lengthOf([1, 2, 3], 3); + assert.lengthOf('foobar', 6); + assert.lengthOf('foobar', 5); + assert.lengthOf(1, 5); + }); + + test('match', () => { + assert.match('foobar', /^foo/); + assert.notMatch('foobar', /^bar/); + assert.match('foobar', /^bar/i); + assert.notMatch('foobar', /^foo/i); + }); + + test('property', () => { + const obj = { foo: { bar: 'baz' } }; + const simpleObj = { foo: 'bar' } as any; + assert.property(obj, 'foo'); + assert.deepProperty(obj, 'foo.bar'); + assert.notDeepProperty(obj, 'foo.baz'); + assert.deepPropertyVal(obj, 'foo.bar', 'baz'); + assert.deepPropertyNotVal(simpleObj, 'foo.bar', 'flow'); + assert.property(simpleObj, 'baz'); + assert.deepProperty(obj, 'foo.baz'); + assert.notProperty(obj, 'foo'); + assert.notDeepProperty(obj, 'foo.bar'); + assert.propertyVal(simpleObj, 'foo', 'ball'); + assert.deepPropertyVal(obj, 'foo.bar', 'ball'); + assert.propertyNotVal(simpleObj, 'foo', 'bar'); + assert.deepPropertyNotVal(simpleObj, 'foo.bar', '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'); + + assert.throws(() => { + throw new Error('foo'); + }, TypeError); + + assert.throws(() => { + throw new Error('foo'); + }, 'bar'); + + assert.throws(() => { + throw new Error('foo'); + }, Error, 'bar'); + + assert.throws(() => { + throw new Error('foo'); + }, TypeError, 'bar'); + + assert.throws(() => {}); + + assert.throws(() => { + throw new Error(''); + }, 'bar'); + + assert.throws(() => { + throw new Error(''); + }, /bar/); + }); + + test('doesNotThrow', () => { + assert.doesNotThrow(() => { }); + assert.doesNotThrow(() => { }, 'foo'); + + assert.doesNotThrow(() => { + throw new Error('foo'); + }); + }); + + test('ifError', () => { + assert.ifError(false); + assert.ifError(null); + assert.ifError(undefined); + assert.ifError('foo'); + }); + + 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); + assert.operator(2, '<', 1); + assert.operator(1, '>', 2); + assert.operator(1, '==', 2); + assert.operator(2, '<=', 1); + assert.operator(1, '>=', 2); + assert.operator(1, '!=', 1); + assert.operator(1, '!==', '1'); + }); + + test('closeTo', () => { + assert.closeTo(1.5, 1.0, 0.5); + assert.closeTo(10, 20, 20); + assert.closeTo(-10, 20, 30); + assert.closeTo(2, 1.0, 0.5); + assert.closeTo(-10, 20, 29); + }); + + test('approximately', () => { + assert.approximately(1.5, 1.0, 0.5); + assert.approximately(10, 20, 20); + assert.approximately(-10, 20, 30); + assert.approximately(2, 1.0, 0.5); + assert.approximately(-10, 20, 29); + }); + + test('members', () => { + assert.includeMembers([1, 2, 3], [2, 3]); + assert.includeMembers([1, 2, 3], []); + assert.includeMembers([1, 2, 3], [3]); + assert.includeMembers([5, 6], [7, 8]); + assert.includeMembers([5, 6], [5, 6, 0]); + }); + + test('memberEquals', () => { + assert.sameMembers([], []); + assert.sameMembers([1, 2, 3], [3, 2, 1]); + assert.sameMembers([4, 2], [4, 2]); + assert.sameMembers([], [1, 2]); + assert.sameMembers([1, 54], [6, 1, 54]); + }); + + + test('isAbove', () => { + assert.isAbove(10, 5); + assert.isAbove(1, 5); + assert.isAbove(5, 5); + }); + + test('isBelow', () => { + assert.isBelow(5, 10); + assert.isBelow(5, 1); + assert.isBelow(5, 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({}); }); + + test('isNotTrue', () => { + assert.isNotTrue(false); + assert.isNotTrue(true); + }); + + test('isNotFalse', () => { + assert.isNotFalse(true); + assert.isNotFalse(false); + }); + + test('isAtLeast', () => { + assert.isAtLeast(5, 3); + assert.isAtLeast(5, 5); + assert.isAtLeast(3, 5); + }); + + test('isAtMost', () => { + assert.isAtMost(3, 5); + assert.isAtMost(5, 5); + assert.isAtMost(5, 3); + }); + + test('oneOf', () => { + const obj = { z: 3 }; + + assert.oneOf(5, [1, 5, 4]); + assert.oneOf('z', ['x', 'y', 'z']); + assert.oneOf(obj, [obj]); + assert.oneOf(5, [1, [5], 4]); + assert.oneOf('z', ['w', 'x', 'y']); + assert.oneOf(obj, [{ z: 3 }]); + }); + + test('changes', () => { + const obj = { z: 3 }; + + assert.changes(() => {}, obj, 'z'); + assert.changes(() => {}, obj, 'z', 'message'); + }); + + test('doesNotChange', () => { + const obj = { z: 3 }; + + assert.doesNotChange(() => {}, obj, 'z'); + assert.doesNotChange(() => {}, obj, 'z', 'message'); + }); + + test('increases', () => { + const obj = { z: 3 }; + + assert.increases(() => {}, obj, 'z'); + assert.increases(() => {}, obj, 'z', 'message'); + }); + + test('doesNotIncrease', () => { + const obj = { z: 3 }; + + assert.doesNotIncrease(() => {}, obj, 'z'); + assert.doesNotIncrease(() => {}, obj, 'z', 'message'); + }); + + test('decreases', () => { + const obj = { z: 3 }; + + assert.decreases(() => {}, obj, 'z'); + assert.decreases(() => {}, obj, 'z', 'message'); + }); + + test('doesNotDecrease', () => { + const obj = { z: 3 }; + + assert.doesNotDecrease(() => {}, obj, 'z'); + assert.doesNotDecrease(() => {}, obj, 'z', 'message'); + }); + + test('ifError', () => { + const obj = { z: 3 }; + + assert.ifError(obj); + assert.ifError(obj, 'message'); + }); + + test('extensible', () => { + const obj = { z: 3 }; + + assert.extensible(obj); + assert.extensible(obj, 'message'); + }); + + test('isNotExtensible', () => { + const obj = { z: 3 }; + + assert.isNotExtensible(obj); + assert.isNotExtensible(obj, 'message'); + }); + + test('isSealed', () => { + const obj = { z: 3 }; + + assert.isSealed(obj); + assert.isSealed(obj, 'message'); + }); + + test('sealed', () => { + const obj = { z: 3 }; + + assert.sealed(obj); + assert.sealed(obj, 'message'); + }); + + test('isNotSealed', () => { + const obj = { z: 3 }; + + assert.isNotSealed(obj); + assert.isNotSealed(obj, 'message'); + }); + + test('notSealed', () => { + const obj = { z: 3 }; + + assert.notSealed(obj); + assert.notSealed(obj, 'message'); + }); + + test('isFrozen', () => { + const obj = { z: 3 }; + + assert.isFrozen(obj); + assert.isFrozen(obj, 'message'); + }); + + test('frozen', () => { + const obj = { z: 3 }; + + assert.frozen(obj); + assert.frozen(obj, 'message'); + }); + + test('isNotFrozen', () => { + const obj = { z: 3 }; + + assert.isNotFrozen(obj); + assert.isNotFrozen(obj, 'message'); + }); + + test('notFrozen', () => { + const obj = { z: 3 }; + + assert.notFrozen(obj); + assert.notFrozen(obj, 'message'); + }); +}); \ No newline at end of file diff --git a/types/chai/index.d.ts b/types/chai/index.d.ts new file mode 100644 index 0000000000..73f62290f5 --- /dev/null +++ b/types/chai/index.d.ts @@ -0,0 +1,1252 @@ +// Type definitions for chai 3.5.0 +// Project: http://chaijs.com/ +// Definitions by: Jed Mao , +// Bart van der Schoor , +// Andrew Brown , +// Olivier Chevet , +// Matt Wistrand , +// Josh Goldberg +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// + +declare namespace Chai { + + interface ChaiStatic { + expect: ExpectStatic; + should(): Should; + /** + * Provides a way to extend the internals of Chai + */ + use(fn: (chai: any, utils: any) => void): ChaiStatic; + assert: AssertStatic; + config: Config; + AssertionError: typeof AssertionError; + version: string; + } + + export interface ExpectStatic extends AssertionStatic { + fail(actual?: any, expected?: any, message?: string, operator?: Operator): void; + } + + export interface AssertStatic extends Assert { + } + + export interface AssertionStatic { + (target: any, message?: string): Assertion; + } + + export type Operator = string; // "==" | "===" | ">" | ">=" | "<" | "<=" | "!=" | "!=="; + + export type OperatorComparable = boolean | null | number | string | undefined | Date; + + 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?: Operator): 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: CloseTo; + approximately: CloseTo; + members: Members; + increase: PropertyChange; + increases: PropertyChange; + decrease: PropertyChange; + decreases: PropertyChange; + change: PropertyChange; + changes: PropertyChange; + extensible: Assertion; + sealed: Assertion; + frozen: Assertion; + oneOf(list: any[], message?: string): 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 CloseTo { + (expected: number, delta: number, message?: string): Assertion; + } + + interface Deep { + equal: Equal; + equals: Equal; + eq: 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, property: string, message?: string): Assertion; + } + + export interface Assert { + /** + * @param expression Expression to test for truthiness. + * @param message Message to display on error. + */ + (expression: any, message?: string): void; + + /** + * Throws a failure. + * + * @type T Type of the objects. + * @param actual Actual value. + * @param expected Potential expected value. + * @param message Message to display on error. + * @param operator Comparison operator, if not strict equality. + * @remarks Node.js assert module-compatible. + */ + fail(actual?: T, expected?: T, message?: string, operator?: Operator): void; + + /** + * Asserts that object is truthy. + * + * @type T Type of object. + * @param object Object to test. + * @param message Message to display on error. + */ + isOk(value: T, message?: string): void; + + /** + * Asserts that object is truthy. + * + * @type T Type of object. + * @param object Object to test. + * @param message Message to display on error. + */ + ok(value: T, message?: string): void; + + /** + * Asserts that object is falsy. + * + * @type T Type of object. + * @param object Object to test. + * @param message Message to display on error. + */ + isNotOk(value: T, message?: string): void; + + /** + * Asserts that object is falsy. + * + * @type T Type of object. + * @param object Object to test. + * @param message Message to display on error. + */ + notOk(value: T, message?: string): void; + + /** + * Asserts non-strict equality (==) of actual and expected. + * + * @type T Type of the objects. + * @param actual Actual value. + * @param expected Potential expected value. + * @param message Message to display on error. + */ + equal(actual: T, expected: T, message?: string): void; + + /** + * Asserts non-strict inequality (==) of actual and expected. + * + * @type T Type of the objects. + * @param actual Actual value. + * @param expected Potential expected value. + * @param message Message to display on error. + */ + notEqual(actual: T, expected: T, message?: string): void; + + /** + * Asserts strict equality (===) of actual and expected. + * + * @type T Type of the objects. + * @param actual Actual value. + * @param expected Potential expected value. + * @param message Message to display on error. + */ + strictEqual(actual: T, expected: T, message?: string): void; + + /** + * Asserts strict inequality (==) of actual and expected. + * + * @type T Type of the objects. + * @param actual Actual value. + * @param expected Potential expected value. + * @param message Message to display on error. + */ + notStrictEqual(actual: T, expected: T, message?: string): void; + + /** + * Asserts that actual is deeply equal to expected. + * + * @type T Type of the objects. + * @param actual Actual value. + * @param expected Potential expected value. + * @param message Message to display on error. + */ + deepEqual(actual: T, expected: T, message?: string): void; + + /** + * Asserts that actual is not deeply equal to expected. + * + * @type T Type of the objects. + * @param actual Actual value. + * @param expected Potential expected value. + * @param message Message to display on error. + */ + notDeepEqual(actual: T, expected: T, message?: string): void; + + /** + * Asserts valueToCheck is strictly greater than (>) valueToBeAbove. + * + * @param valueToCheck Actual value. + * @param valueToBeAbove Minimum Potential expected value. + * @param message Message to display on error. + */ + isAbove(valueToCheck: number, valueToBeAbove: number, message?: string): void; + + /** + * Asserts valueToCheck is greater than or equal to (>=) valueToBeAtLeast. + * + * @param valueToCheck Actual value. + * @param valueToBeAtLeast Minimum Potential expected value. + * @param message Message to display on error. + */ + isAtLeast(valueToCheck: number, valueToBeAtLeast: number, message?: string): void; + + /** + * Asserts valueToCheck is strictly less than (<) valueToBeBelow. + * + * @param valueToCheck Actual value. + * @param valueToBeBelow Minimum Potential expected value. + * @param message Message to display on error. + */ + isBelow(valueToCheck: number, valueToBeBelow: number, message?: string): void; + + /** + * Asserts valueToCheck is greater than or equal to (>=) valueToBeAtMost. + * + * @param valueToCheck Actual value. + * @param valueToBeAtMost Minimum Potential expected value. + * @param message Message to display on error. + */ + isAtMost(valueToCheck: number, valueToBeAtMost: number, message?: string): void; + + /** + * Asserts that value is true. + * + * @type T Type of value. + * @param value Actual value. + * @param message Message to display on error. + */ + isTrue(value: T, message?: string): void; + + /** + * Asserts that value is false. + * + * @type T Type of value. + * @param value Actual value. + * @param message Message to display on error. + */ + isFalse(value: T, message?: string): void; + + /** + * Asserts that value is not true. + * + * @type T Type of value. + * @param value Actual value. + * @param message Message to display on error. + */ + isNotTrue(value: T, message?: string): void; + + /** + * Asserts that value is not false. + * + * @type T Type of value. + * @param value Actual value. + * @param message Message to display on error. + */ + isNotFalse(value: T, message?: string): void; + + /** + * Asserts that value is null. + * + * @type T Type of value. + * @param value Actual value. + * @param message Message to display on error. + */ + isNull(value: T, message?: string): void; + + /** + * Asserts that value is not null. + * + * @type T Type of value. + * @param value Actual value. + * @param message Message to display on error. + */ + isNotNull(value: T, message?: string): void; + + /** + * Asserts that value is not null. + * + * @type T Type of value. + * @param value Actual value. + * @param message Message to display on error. + */ + isNaN(value: T, message?: string): void; + + /** + * Asserts that value is not null. + * + * @type T Type of value. + * @param value Actual value. + * @param message Message to display on error. + */ + isNotNaN(value: T, message?: string): void; + + /** + * Asserts that value is undefined. + * + * @type T Type of value. + * @param value Actual value. + * @param message Message to display on error. + */ + isUndefined(value: T, message?: string): void; + + /** + * Asserts that value is not undefined. + * + * @type T Type of value. + * @param value Actual value. + * @param message Message to display on error. + */ + isDefined(value: T, message?: string): void; + + /** + * Asserts that value is a function. + * + * @type T Type of value. + * @param value Actual value. + * @param message Message to display on error. + */ + isFunction(value: T, message?: string): void; + + /** + * Asserts that value is not a function. + * + * @type T Type of value. + * @param value Actual value. + * @param message Message to display on error. + */ + isNotFunction(value: T, message?: string): void; + + /** + * Asserts that value is an object of type 'Object' + * (as revealed by Object.prototype.toString). + * + * @type T Type of value. + * @param value Actual value. + * @param message Message to display on error. + * @remarks The assertion does not match subclassed objects. + */ + isObject(value: T, message?: string): void; + + /** + * Asserts that value is not an object of type 'Object' + * (as revealed by Object.prototype.toString). + * + * @type T Type of value. + * @param value Actual value. + * @param message Message to display on error. + */ + isNotObject(value: T, message?: string): void; + + /** + * Asserts that value is an array. + * + * @type T Type of value. + * @param value Actual value. + * @param message Message to display on error. + */ + isArray(value: T, message?: string): void; + + /** + * Asserts that value is not an array. + * + * @type T Type of value. + * @param value Actual value. + * @param message Message to display on error. + */ + isNotArray(value: T, message?: string): void; + + /** + * Asserts that value is a string. + * + * @type T Type of value. + * @param value Actual value. + * @param message Message to display on error. + */ + isString(value: T, message?: string): void; + + /** + * Asserts that value is not a string. + * + * @type T Type of value. + * @param value Actual value. + * @param message Message to display on error. + */ + isNotString(value: T, message?: string): void; + + /** + * Asserts that value is a number. + * + * @type T Type of value. + * @param value Actual value. + * @param message Message to display on error. + */ + isNumber(value: T, message?: string): void; + + /** + * Asserts that value is not a number. + * + * @type T Type of value. + * @param value Actual value. + * @param message Message to display on error. + */ + isNotNumber(value: T, message?: string): void; + + /** + * Asserts that value is a boolean. + * + * @type T Type of value. + * @param value Actual value. + * @param message Message to display on error. + */ + isBoolean(value: T, message?: string): void; + + /** + * Asserts that value is not a boolean. + * + * @type T Type of value. + * @param value Actual value. + * @param message Message to display on error. + */ + isNotBoolean(value: T, message?: string): void; + + /** + * Asserts that value's type is name, as determined by Object.prototype.toString. + * + * @type T Type of value. + * @param value Actual value. + * @param name Potential expected type name of value. + * @param message Message to display on error. + */ + typeOf(value: T, name: string, message?: string): void; + + /** + * Asserts that value's type is not name, as determined by Object.prototype.toString. + * + * @type T Type of value. + * @param value Actual value. + * @param name Potential expected type name of value. + * @param message Message to display on error. + */ + notTypeOf(value: T, name: string, message?: string): void; + + /** + * Asserts that value is an instance of constructor. + * + * @type T Type of value. + * @param value Actual value. + * @param constructor Potential expected contructor of value. + * @param message Message to display on error. + */ + instanceOf(value: T, constructor: Function, message?: string): void; + + /** + * Asserts that value is not an instance of constructor. + * + * @type T Type of value. + * @param value Actual value. + * @param constructor Potential expected contructor of value. + * @param message Message to display on error. + */ + notInstanceOf(value: T, type: Function, message?: string): void; + + /** + * Asserts that haystack includes needle. + * + * @param haystack Container string. + * @param needle Potential expected substring of haystack. + * @param message Message to display on error. + */ + include(haystack: string, needle: string, message?: string): void; + + /** + * Asserts that haystack includes needle. + * + * @type T Type of values in haystack. + * @param haystack Container array. + * @param needle Potential value contained in haystack. + * @param message Message to display on error. + */ + include(haystack: T[], needle: T, message?: string): void; + + /** + * Asserts that haystack does not include needle. + * + * @param haystack Container string. + * @param needle Potential expected substring of haystack. + * @param message Message to display on error. + */ + notInclude(haystack: string, needle: any, message?: string): void; + + /** + * Asserts that haystack does not include needle. + * + * @type T Type of values in haystack. + * @param haystack Container array. + * @param needle Potential value contained in haystack. + * @param message Message to display on error. + */ + notInclude(haystack: any[], needle: any, message?: string): void; + + /** + * Asserts that value matches the regular expression regexp. + * + * @param value Actual value. + * @param regexp Potential match of value. + * @param message Message to display on error. + */ + match(value: string, regexp: RegExp, message?: string): void; + + /** + * Asserts that value does not match the regular expression regexp. + * + * @param value Actual value. + * @param regexp Potential match of value. + * @param message Message to display on error. + */ + notMatch(expected: any, regexp: RegExp, message?: string): void; + + /** + * Asserts that object has a property named by property. + * + * @type T Type of object. + * @param object Container object. + * @param property Potential contained property of object. + * @param message Message to display on error. + */ + property(object: T, property: string /* keyof T */, message?: string): void; + + /** + * Asserts that object has a property named by property. + * + * @type T Type of object. + * @param object Container object. + * @param property Potential contained property of object. + * @param message Message to display on error. + */ + notProperty(object: T, property: string /* keyof T */, message?: string): void; + + /** + * Asserts that object has a property named by property, which can be a string + * using dot- and bracket-notation for deep reference. + * + * @type T Type of object. + * @param object Container object. + * @param property Potential contained property of object. + * @param message Message to display on error. + */ + deepProperty(object: T, property: string, message?: string): void; + + /** + * Asserts that object does not have a property named by property, which can be a + * string using dot- and bracket-notation for deep reference. + * + * @type T Type of object. + * @param object Container object. + * @param property Potential contained property of object. + * @param message Message to display on error. + */ + notDeepProperty(object: T, property: string, message?: string): void; + + /** + * Asserts that object has a property named by property with value given by value. + * + * @type T Type of object. + * @type V Type of value. + * @param object Container object. + * @param property Potential contained property of object. + * @param value Potential expected property value. + * @param message Message to display on error. + */ + propertyVal(object: T, property: string /* keyof T */, value: V, message?: string): void; + + /** + * Asserts that object has a property named by property with value given by value. + * + * @type T Type of object. + * @type V Type of value. + * @param object Container object. + * @param property Potential contained property of object. + * @param value Potential expected property value. + * @param message Message to display on error. + */ + propertyNotVal(object: T, property: string /* keyof T */, value: V, message?: string): void; + + /** + * Asserts that object has a property named by property, which can be a string + * using dot- and bracket-notation for deep reference. + * + * @type T Type of object. + * @type V Type of value. + * @param object Container object. + * @param property Potential contained property of object. + * @param value Potential expected property value. + * @param message Message to display on error. + */ + deepPropertyVal(object: T, property: string, value: V, message?: string): void; + + /** + * Asserts that object does not have a property named by property, which can be a + * string using dot- and bracket-notation for deep reference. + * + * @type T Type of object. + * @type V Type of value. + * @param object Container object. + * @param property Potential contained property of object. + * @param value Potential expected property value. + * @param message Message to display on error. + */ + deepPropertyNotVal(object: T, property: string, value: V, message?: string): void; + + /** + * Asserts that object has a length property with the expected value. + * + * @type T Type of object. + * @param object Container object. + * @param length Potential expected length of object. + * @param message Message to display on error. + */ + lengthOf(object: T, length: number, message?: string): void; + + /** + * Asserts that fn will throw an error. + * + * @param fn Function that may throw. + * @param message Message to display on error. + */ + throw(fn: Function, message?: string): void; + + /** + * Asserts that function will throw an error with message matching regexp. + * + * @param fn Function that may throw. + * @param regExp Potential expected message match. + * @param message Message to display on error. + */ + throw(fn: Function, regExp: RegExp): void; + + /** + * Asserts that function will throw an error that is an instance of constructor. + * + * @param fn Function that may throw. + * @param constructor Potential expected error constructor. + * @param message Message to display on error. + */ + throw(fn: Function, constructor: Function, message?: string): void; + + /** + * Asserts that function will throw an error that is an instance of constructor + * and an error with message matching regexp. + * + * @param fn Function that may throw. + * @param constructor Potential expected error constructor. + * @param message Message to display on error. + */ + throw(fn: Function, constructor: Function, regExp: RegExp): void; + + /** + * Asserts that fn will throw an error. + * + * @param fn Function that may throw. + * @param message Message to display on error. + */ + throws(fn: Function, message?: string): void; + + /** + * Asserts that function will throw an error with message matching regexp. + * + * @param fn Function that may throw. + * @param regExp Potential expected message match. + * @param message Message to display on error. + */ + throws(fn: Function, regExp: RegExp): void; + + /** + * Asserts that function will throw an error that is an instance of constructor. + * + * @param fn Function that may throw. + * @param constructor Potential expected error constructor. + * @param message Message to display on error. + */ + throws(fn: Function, errType: Function, message?: string): void; + + /** + * Asserts that function will throw an error that is an instance of constructor + * and an error with message matching regexp. + * + * @param fn Function that may throw. + * @param constructor Potential expected error constructor. + * @param message Message to display on error. + */ + throws(fn: Function, errType: Function, regExp: RegExp): void; + + /** + * Asserts that fn will throw an error. + * + * @param fn Function that may throw. + * @param message Message to display on error. + */ + Throw(fn: Function, message?: string): void; + + /** + * Asserts that function will throw an error with message matching regexp. + * + * @param fn Function that may throw. + * @param regExp Potential expected message match. + * @param message Message to display on error. + */ + Throw(fn: Function, regExp: RegExp): void; + + /** + * Asserts that function will throw an error that is an instance of constructor. + * + * @param fn Function that may throw. + * @param constructor Potential expected error constructor. + * @param message Message to display on error. + */ + Throw(fn: Function, errType: Function, message?: string): void; + + /** + * Asserts that function will throw an error that is an instance of constructor + * and an error with message matching regexp. + * + * @param fn Function that may throw. + * @param constructor Potential expected error constructor. + * @param message Message to display on error. + */ + Throw(fn: Function, errType: Function, regExp: RegExp): void; + + /** + * Asserts that fn will not throw an error. + * + * @param fn Function that may throw. + * @param message Message to display on error. + */ + doesNotThrow(fn: Function, message?: string): void; + + /** + * Asserts that function will throw an error with message matching regexp. + * + * @param fn Function that may throw. + * @param regExp Potential expected message match. + * @param message Message to display on error. + */ + doesNotThrow(fn: Function, regExp: RegExp): void; + + /** + * Asserts that function will throw an error that is an instance of constructor. + * + * @param fn Function that may throw. + * @param constructor Potential expected error constructor. + * @param message Message to display on error. + */ + doesNotThrow(fn: Function, errType: Function, message?: string): void; + + /** + * Asserts that function will throw an error that is an instance of constructor + * and an error with message matching regexp. + * + * @param fn Function that may throw. + * @param constructor Potential expected error constructor. + * @param message Message to display on error. + */ + doesNotThrow(fn: Function, errType: Function, regExp: RegExp): void; + + /** + * Compares two values using operator. + * + * @param val1 Left value during comparison. + * @param operator Comparison operator. + * @param val2 Right value during comparison. + * @param message Message to display on error. + */ + operator(val1: OperatorComparable, operator: Operator, val2: OperatorComparable, message?: string): void; + + /** + * Asserts that the target is equal to expected, to within a +/- delta range. + * + * @param actual Actual value + * @param expected Potential expected value. + * @param delta Maximum differenced between values. + * @param message Message to display on error. + */ + closeTo(actual: number, expected: number, delta: number, message?: string): void; + + /** + * Asserts that the target is equal to expected, to within a +/- delta range. + * + * @param actual Actual value + * @param expected Potential expected value. + * @param delta Maximum differenced between values. + * @param message Message to display on error. + */ + approximately(act: number, exp: number, delta: number, message?: string): void; + + /** + * Asserts that set1 and set2 have the same members. Order is not take into account. + * + * @type T Type of set values. + * @param set1 Actual set of values. + * @param set2 Potential expected set of values. + * @param message Message to display on error. + */ + sameMembers(set1: T[], set2: T[], message?: string): void; + + /** + * Asserts that set1 and set2 have the same members using deep equality checking. + * Order is not take into account. + * + * @type T Type of set values. + * @param set1 Actual set of values. + * @param set2 Potential expected set of values. + * @param message Message to display on error. + */ + sameDeepMembers(set1: T[], set2: T[], message?: string): void; + + /** + * Asserts that subset is included in superset. Order is not take into account. + * + * @type T Type of set values. + * @param superset Actual set of values. + * @param subset Potential contained set of values. + * @param message Message to display on error. + */ + includeMembers(superset: T[], subset: T[], message?: string): void; + + /** + * Asserts that subset is included in superset using deep equality checking. + * Order is not take into account. + * + * @type T Type of set values. + * @param superset Actual set of values. + * @param subset Potential contained set of values. + * @param message Message to display on error. + */ + includeDeepMembers(superset: T[], subset: T[], message?: string): void; + + /** + * Asserts that non-object, non-array value inList appears in the flat array list. + * + * @type T Type of list values. + * @param inList Value expected to be in the list. + * @param list List of values. + * @param message Message to display on error. + */ + oneOf(inList: T, list: T[], message?: string): void; + + /** + * Asserts that a function changes the value of a property. + * + * @type T Type of object. + * @param modifier Function to run. + * @param object Container object. + * @param property Property of object expected to be modified. + * @param message Message to display on error. + */ + changes(modifier: Function, object: T, property: string /* keyof T */, message?: string): void + + /** + * Asserts that a function does not change the value of a property. + * + * @type T Type of object. + * @param modifier Function to run. + * @param object Container object. + * @param property Property of object expected not to be modified. + * @param message Message to display on error. + */ + doesNotChange(modifier: Function, object: T, property: string /* keyof T */, message?: string): void + + /** + * Asserts that a function increases an object property. + * + * @type T Type of object. + * @param modifier Function to run. + * @param object Container object. + * @param property Property of object expected to be increased. + * @param message Message to display on error. + */ + increases(modifier: Function, object: T, property: string /* keyof T */, message?: string): void + + /** + * Asserts that a function does not increase an object property. + * + * @type T Type of object. + * @param modifier Function to run. + * @param object Container object. + * @param property Property of object expected not to be increased. + * @param message Message to display on error. + */ + doesNotIncrease(modifier: Function, object: T, property: string /* keyof T */, message?: string): void + + /** + * Asserts that a function decreases an object property. + * + * @type T Type of object. + * @param modifier Function to run. + * @param object Container object. + * @param property Property of object expected to be decreased. + * @param message Message to display on error. + */ + decreases(modifier: Function, object: T, property: string /* keyof T */, message?: string): void + + /** + * Asserts that a function does not decrease an object property. + * + * @type T Type of object. + * @param modifier Function to run. + * @param object Container object. + * @param property Property of object expected not to be decreased. + * @param message Message to display on error. + */ + doesNotDecrease(modifier: Function, object: T, property: string /* keyof T */, message?: string): void + + /** + * Asserts if value is not a false value, and throws if it is a true value. + * + * @type T Type of object. + * @param object Actual value. + * @param message Message to display on error. + * @remarks This is added to allow for chai to be a drop-in replacement for + * Node’s assert class. + */ + ifError(object: T, message?: string): void; + + /** + * Asserts that object is extensible (can have new properties added to it). + * + * @type T Type of object + * @param object Actual value. + * @param message Message to display on error. + */ + isExtensible(object: T, message?: string): void; + + /** + * Asserts that object is extensible (can have new properties added to it). + * + * @type T Type of object + * @param object Actual value. + * @param message Message to display on error. + */ + extensible(object: T, message?: string): void; + + /** + * Asserts that object is not extensible. + * + * @type T Type of object + * @param object Actual value. + * @param message Message to display on error. + */ + isNotExtensible(object: T, message?: string): void; + + /** + * Asserts that object is not extensible. + * + * @type T Type of object + * @param object Actual value. + * @param message Message to display on error. + */ + notExtensible(object: T, message?: string): void; + + /** + * Asserts that object is sealed (can have new properties added to it + * and its existing properties cannot be removed). + * + * @type T Type of object + * @param object Actual value. + * @param message Message to display on error. + */ + isSealed(object: T, message?: string): void; + + /** + * Asserts that object is sealed (can have new properties added to it + * and its existing properties cannot be removed). + * + * @type T Type of object + * @param object Actual value. + * @param message Message to display on error. + */ + sealed(object: T, message?: string): void; + + /** + * Asserts that object is not sealed. + * + * @type T Type of object + * @param object Actual value. + * @param message Message to display on error. + */ + isNotSealed(object: T, message?: string): void; + + /** + * Asserts that object is not sealed. + * + * @type T Type of object + * @param object Actual value. + * @param message Message to display on error. + */ + notSealed(object: T, message?: string): void; + + /** + * Asserts that object is frozen (cannot have new properties added to it + * and its existing properties cannot be removed). + * + * @type T Type of object + * @param object Actual value. + * @param message Message to display on error. + */ + isFrozen(object: T, message?: string): void; + + /** + * Asserts that object is frozen (cannot have new properties added to it + * and its existing properties cannot be removed). + * + * @type T Type of object + * @param object Actual value. + * @param message Message to display on error. + */ + frozen(object: T, message?: string): void; + + /** + * Asserts that object is not frozen (cannot have new properties added to it + * and its existing properties cannot be removed). + * + * @type T Type of object + * @param object Actual value. + * @param message Message to display on error. + */ + isNotFrozen(object: T, message?: string): void; + + /** + * Asserts that object is not frozen (cannot have new properties added to it + * and its existing properties cannot be removed). + * + * @type T Type of object + * @param object Actual value. + * @param message Message to display on error. + */ + notFrozen(object: T, message?: string): void; + } + + export interface Config { + /** + * Default: false + */ + includeStack: boolean; + + /** + * Default: true + */ + showDiff: boolean; + + /** + * Default: 40 + */ + truncateThreshold: number; + } + + export class AssertionError { + constructor(message: string, _props?: any, ssf?: Function); + name: string; + message: string; + showDiff: boolean; + stack: string; + } +} + +declare const chai: Chai.ChaiStatic; + +declare module "chai" { + export = chai; +} + +interface Object { + should: Chai.Assertion; +} diff --git a/chai/tsconfig.json b/types/chai/tsconfig.json similarity index 100% rename from chai/tsconfig.json rename to types/chai/tsconfig.json diff --git a/chai/v2/index.d.ts b/types/chai/v2/index.d.ts similarity index 100% rename from chai/v2/index.d.ts rename to types/chai/v2/index.d.ts diff --git a/chai/v2/tsconfig.json b/types/chai/v2/tsconfig.json similarity index 100% rename from chai/v2/tsconfig.json rename to types/chai/v2/tsconfig.json diff --git a/chalk/chalk-tests.ts b/types/chalk/chalk-tests.ts similarity index 100% rename from chalk/chalk-tests.ts rename to types/chalk/chalk-tests.ts diff --git a/chalk/index.d.ts b/types/chalk/index.d.ts similarity index 100% rename from chalk/index.d.ts rename to types/chalk/index.d.ts diff --git a/chalk/tsconfig.json b/types/chalk/tsconfig.json similarity index 100% rename from chalk/tsconfig.json rename to types/chalk/tsconfig.json diff --git a/chance/chance-tests.ts b/types/chance/chance-tests.ts similarity index 100% rename from chance/chance-tests.ts rename to types/chance/chance-tests.ts diff --git a/chance/index.d.ts b/types/chance/index.d.ts similarity index 100% rename from chance/index.d.ts rename to types/chance/index.d.ts diff --git a/chance/tsconfig.json b/types/chance/tsconfig.json similarity index 100% rename from chance/tsconfig.json rename to types/chance/tsconfig.json diff --git a/change-emitter/change-emitter-tests.ts b/types/change-emitter/change-emitter-tests.ts similarity index 100% rename from change-emitter/change-emitter-tests.ts rename to types/change-emitter/change-emitter-tests.ts diff --git a/change-emitter/index.d.ts b/types/change-emitter/index.d.ts similarity index 100% rename from change-emitter/index.d.ts rename to types/change-emitter/index.d.ts diff --git a/change-emitter/tsconfig.json b/types/change-emitter/tsconfig.json similarity index 100% rename from change-emitter/tsconfig.json rename to types/change-emitter/tsconfig.json diff --git a/types/charm/charm-tests.ts b/types/charm/charm-tests.ts new file mode 100644 index 0000000000..09dc93184e --- /dev/null +++ b/types/charm/charm-tests.ts @@ -0,0 +1,26 @@ +import getCharm = require("charm"); +const charm = getCharm(); +charm.pipe(process.stdout); +charm.reset(); + +const colors: getCharm.CharmColor[] = [ 'red', 'cyan', 'yellow', 'green', 'blue' ]; +const text = 'Always after me lucky charms.'; + +let offset = 0; +const iv = setInterval(() => { + let y = 0; + let dy = 1; + for (let i = 0; i < 40; i++) { + const color = colors[(i + offset) % colors.length]; + const c = text[(i + offset) % text.length]; + charm + .move(1, dy) + .foreground(color) + .write(c) + ; + y += dy; + if (y <= 0 || y >= 5) dy *= -1; + } + charm.position(0, 1); + offset ++; +}, 150); diff --git a/charm/index.d.ts b/types/charm/index.d.ts similarity index 100% rename from charm/index.d.ts rename to types/charm/index.d.ts diff --git a/charm/tsconfig.json b/types/charm/tsconfig.json similarity index 100% rename from charm/tsconfig.json rename to types/charm/tsconfig.json diff --git a/types/charm/tslint.json b/types/charm/tslint.json new file mode 100644 index 0000000000..a62d0d4e68 --- /dev/null +++ b/types/charm/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "ban-types": false + } +} diff --git a/chart.js/chart.js-tests.ts b/types/chart.js/chart.js-tests.ts similarity index 100% rename from chart.js/chart.js-tests.ts rename to types/chart.js/chart.js-tests.ts diff --git a/types/chart.js/index.d.ts b/types/chart.js/index.d.ts new file mode 100644 index 0000000000..cad58a2aa8 --- /dev/null +++ b/types/chart.js/index.d.ts @@ -0,0 +1,437 @@ +// Type definitions for Chart.js 2.4.0 +// Project: https://github.com/nnnick/Chart.js +// Definitions by: Alberto Nuti +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare class Chart { + static readonly Chart: typeof Chart; + constructor( + context: string | JQuery | CanvasRenderingContext2D | HTMLCanvasElement | string[] | CanvasRenderingContext2D[] | HTMLCanvasElement[], + options: Chart.ChartConfiguration + ); + config: Chart.ChartConfiguration; + data: Chart.ChartData; + destroy: () => {}; + update: (duration?: any, lazy?: any) => {}; + render: (duration?: any, lazy?: any) => {}; + stop: () => {}; + resize: () => {}; + clear: () => {}; + toBase64: () => string; + generateLegend: () => {}; + getElementAtEvent: (e: any) => {}; + getElementsAtEvent: (e: any) => {}[]; + getDatasetAtEvent: (e: any) => {}[]; + + static defaults: { + global: Chart.ChartOptions; + } +} + +declare namespace Chart { + export type ChartType = 'line' | 'bar' | 'radar' | 'doughnut' | 'polarArea' | 'bubble'; + + export type TimeUnit = 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year'; + + export type ScaleType = 'category' | 'linear' | 'logarithmic' | 'time' | 'radialLinear'; + + export type PositionType = 'left' | 'right' | 'top' | 'bottom'; + + export interface ChartLegendItem { + text?: string; + fillStyle?: string; + hidden?: boolean; + lineCap?: string; + lineDash?: number[]; + lineDashOffset?: number; + lineJoin?: string; + lineWidth?: number; + strokeStyle?: string; + } + + export interface ChartTooltipItem { + xLabel?: string; + yLabel?: string; + datasetIndex?: number; + index?: number; + } + + export interface ChartTooltipCallback { + beforeTitle?: (item?: ChartTooltipItem[], data?: any) => void; + title?: (item?: ChartTooltipItem[], data?: any) => void; + afterTitle?: (item?: ChartTooltipItem[], data?: any) => void; + beforeBody?: (item?: ChartTooltipItem[], data?: any) => void; + beforeLabel?: (tooltipItem?: ChartTooltipItem, data?: any) => void; + label?: (tooltipItem?: ChartTooltipItem, data?: any) => void; + afterLabel?: (tooltipItem?: ChartTooltipItem, data?: any) => void; + afterBody?: (item?: ChartTooltipItem[], data?: any) => void; + beforeFooter?: (item?: ChartTooltipItem[], data?: any) => void; + footer?: (item?: ChartTooltipItem[], data?: any) => void; + afterFooter?: (item?: ChartTooltipItem[], data?: any) => void; + } + + export interface ChartAnimationParameter { + chartInstance?: any; + animationObject?: any; + } + + export interface ChartPoint { + x?: number | string | Date; + y?: number; + } + + export interface ChartConfiguration { + type?: ChartType | string; + data?: ChartData; + options?: ChartOptions; + } + + export interface ChartData { + + } + + export interface LinearChartData extends ChartData { + labels?: string[]; + datasets?: ChartDataSets[]; + } + + export interface ChartOptions { + responsive?: boolean; + responsiveAnimationDuration?: number; + maintainAspectRatio?: boolean; + events?: string[]; + onClick?: (any?: any) => any; + title?: ChartTitleOptions; + legend?: ChartLegendOptions; + tooltips?: ChartTooltipOptions; + hover?: ChartHoverOptions; + animation?: ChartAnimationOptions; + elements?: ChartElementsOptions; + scales?: ChartScales; + cutoutPercentage?: number; + } + + export interface ChartFontOptions { + defaultFontColor?: ChartColor; + defaultFontFamily?: string; + defaultFontSize?: number; + defaultFontStyle?: string; + } + + export interface ChartTitleOptions { + display?: boolean; + position?: string; + fullWdith?: boolean; + fontSize?: number; + fontFamily?: string; + fontColor?: ChartColor; + fontStyle?: string; + padding?: number; + text?: string; + } + + export interface ChartLegendOptions { + display?: boolean; + position?: string; + fullWidth?: boolean; + onClick?: (event: any, legendItem: any) => void; + labels?: ChartLegendLabelOptions; + } + + export interface ChartLegendLabelOptions { + boxWidth?: number; + fontSize?: number; + fontStyle?: number; + fontColor?: ChartColor; + fontFamily?: string; + padding?: number; + generateLabels?: (chart: any) => any; + } + + export interface ChartTooltipOptions { + enabled?: boolean; + custom?: (a: any) => void; + mode?: string; + backgroundColor?: ChartColor; + titleFontFamily?: string; + titleFontSize?: number; + titleFontStyle?: string; + titleFontColor?: ChartColor; + titleSpacing?: number; + titleMarginBottom?: number; + bodyFontFamily?: string; + bodyFontSize?: number; + bodyFontStyle?: string; + bodyFontColor?: ChartColor; + bodySpacing?: number; + footerFontFamily?: string; + footerFontSize?: number; + footerFontStyle?: string; + footerFontColor?: ChartColor; + footerSpacing?: number; + footerMarginTop?: number; + xPadding?: number; + yPadding?: number; + caretSize?: number; + cornerRadius?: number; + multiKeyBackground?: string; + callbacks?: ChartTooltipCallback; + } + + export interface ChartHoverOptions { + mode?: string; + animationDuration?: number; + onHover?: (active: any) => void; + } + + export interface ChartAnimationObject { + currentStep?: number; + numSteps?: number; + easing?: string; + render?: (arg: any) => void; + onAnimationProgress?: (arg: any) => void; + onAnimationComplete?: (arg: any) => void; + } + + export interface ChartAnimationOptions { + duration?: number; + easing?: string; + onProgress?: (chart: any) => void; + onComplete?: (chart: any) => void; + } + + export interface ChartElementsOptions { + point?: ChartPointOptions; + line?: ChartLineOptions; + arc?: ChartArcOptions; + rectangle?: ChartRectangleOptions; + } + + export interface ChartArcOptions { + backgroundColor?: ChartColor; + borderColor?: ChartColor; + borderWidth?: number; + } + + export interface ChartLineOptions { + tension?: number; + backgroundColor?: ChartColor; + borderWidth?: number; + borderColor?: ChartColor; + borderCapStyle?: string; + borderDash?: any[]; + borderDashOffset?: number; + borderJoinStyle?: string; + } + + export interface ChartPointOptions { + radius?: number; + pointStyle?: string; + backgroundColor?: ChartColor; + borderWidth?: number; + borderColor?: ChartColor; + hitRadius?: number; + hoverRadius?: number; + hoverBorderWidth?: number; + } + + export interface ChartRectangleOptions { + backgroundColor?: ChartColor; + borderWidth?: number; + borderColor?: ChartColor; + borderSkipped?: string; + } + export interface GridLineOptions { + display?: boolean; + color?: ChartColor; + lineWidth?: number; + drawBorder?: boolean; + drawOnChartArea?: boolean; + drawticks?: boolean; + tickMarkLength?: number; + zeroLineWidth?: number; + zeroLineColor?: ChartColor; + offsetGridLines?: boolean; + } + + export interface ScaleTitleOptions { + display?: boolean; + labelString?: string; + fontColor?: ChartColor; + fontFamily?: string; + fontSize?: number; + fontStyle?: string; + } + + export interface TickOptions { + autoSkip?: boolean; + callback?: (value: any, index: any, values: any) => string; + display?: boolean; + fontColor?: ChartColor; + fontFamily?: string; + fontSize?: number; + fontStyle?: string; + labelOffset?: number; + maxRotation?: number; + minRotation?: number; + mirror?: boolean; + padding?: number; + reverse?: boolean; + min?: any; + max?: any; + } + export interface AngleLineOptions { + display?: boolean; + color?: ChartColor; + lineWidth?: number; + } + + export interface PointLabelOptions { + callback?: (arg: any) => any; + fontColor?: ChartColor; + fontFamily?: string; + fontSize?: number; + fontStyle?: string; + } + + export interface TickOptions { + backdropColor?: ChartColor; + backdropPaddingX?: number; + backdropPaddingY?: number; + maxTicksLimit?: number; + showLabelBackdrop?: boolean; + } + export interface LinearTickOptions extends TickOptions { + beginAtZero?: boolean; + min?: number; + max?: number; + maxTicksLimit?: number; + stepSize?: number; + suggestedMin?: number; + suggestedMax?: number; + } + + export interface LogarithmicTickOptions extends TickOptions { + min?: number; + max?: number; + } + + type ChartColor = string | CanvasGradient | CanvasPattern; + + export interface ChartDataSets { + backgroundColor?: ChartColor; + borderWidth?: number; + borderColor?: ChartColor; + borderCapStyle?: string; + borderDash?: number[]; + borderDashOffset?: number; + borderJoinStyle?: string; + data?: number[] | ChartPoint[]; + fill?: boolean; + label?: string; + lineTension?: number; + pointBorderColor?: ChartColor | ChartColor[]; + pointBackgroundColor?: ChartColor | ChartColor[]; + pointBorderWidth?: number | number[]; + pointRadius?: number | number[]; + pointHoverRadius?: number | number[]; + pointHitRadius?: number | number[]; + pointHoverBackgroundColor?: ChartColor | ChartColor[]; + pointHoverBorderColor?: ChartColor | ChartColor[]; + pointHoverBorderWidth?: number | number[]; + pointStyle?: string | string[] | HTMLImageElement | HTMLImageElement[]; + xAxisID?: string; + yAxisID?: string; + } + + export interface ChartScales { + type?: ScaleType | string; + display?: boolean; + position?: PositionType | string; + beforeUpdate?: (scale?: any) => void; + beforeSetDimension?: (scale?: any) => void; + beforeDataLimits?: (scale?: any) => void; + beforeBuildTicks?: (scale?: any) => void; + beforeTickToLabelConversion?: (scale?: any) => void; + beforeCalculateTickRotation?: (scale?: any) => void; + beforeFit?: (scale?: any) => void; + afterUpdate?: (scale?: any) => void; + afterSetDimension?: (scale?: any) => void; + afterDataLimits?: (scale?: any) => void; + afterBuildTicks?: (scale?: any) => void; + afterTickToLabelConversion?: (scale?: any) => void; + afterCalculateTickRotation?: (scale?: any) => void; + afterFit?: (scale?: any) => void; + gridLines?: GridLineOptions; + scaleLabel?: ScaleTitleOptions; + ticks?: TickOptions; + xAxes?: ChartXAxe[]; + yAxes?: ChartYAxe[]; + } + + export interface CommonAxe { + type?: ScaleType | string; + display?: boolean; + id?: string; + stacked?: boolean; + position?: string; + ticks?: TickOptions; + gridLines?: GridLineOptions; + barThickness?: number; + scaleLabel?: ScaleTitleOptions; + } + + export interface ChartXAxe extends CommonAxe { + categoryPercentage?: number; + barPercentage?: number; + time?: TimeScale; + } + + export interface ChartYAxe extends CommonAxe { + } + + export interface LinearScale extends ChartScales { + ticks?: LinearTickOptions; + } + + export interface LogarithmicScale extends ChartScales { + ticks?: LogarithmicTickOptions; + } + + export interface TimeDisplayFormat { + millisecond?: string; + second?: string; + minute?: string; + hour?: string; + day?: string; + week?: string; + month?: string; + quarter?: string; + year?: string; + } + + export interface TimeScale extends ChartScales { + displayFormats?: TimeDisplayFormat; + isoWeekday?: boolean; + max?: string; + min?: string; + parser?: string | ((arg: any) => any); + round?: TimeUnit; + tooltipFormat?: string; + unit?: TimeUnit; + unitStepSize?: number; + minUnit?: TimeUnit; + } + + export interface RadialLinearScale { + lineArc?: boolean; + angleLines?: AngleLineOptions; + pointLabels?: PointLabelOptions; + ticks?: TickOptions; + } +} + +export = Chart; +export as namespace Chart; diff --git a/chart.js/tsconfig.json b/types/chart.js/tsconfig.json similarity index 100% rename from chart.js/tsconfig.json rename to types/chart.js/tsconfig.json diff --git a/chartist/chartist-tests.ts b/types/chartist/chartist-tests.ts similarity index 100% rename from chartist/chartist-tests.ts rename to types/chartist/chartist-tests.ts diff --git a/chartist/index.d.ts b/types/chartist/index.d.ts similarity index 100% rename from chartist/index.d.ts rename to types/chartist/index.d.ts diff --git a/chartist/tsconfig.json b/types/chartist/tsconfig.json similarity index 100% rename from chartist/tsconfig.json rename to types/chartist/tsconfig.json diff --git a/chartjs/chartjs-tests.ts b/types/chartjs/chartjs-tests.ts similarity index 100% rename from chartjs/chartjs-tests.ts rename to types/chartjs/chartjs-tests.ts diff --git a/chartjs/index.d.ts b/types/chartjs/index.d.ts similarity index 100% rename from chartjs/index.d.ts rename to types/chartjs/index.d.ts diff --git a/chartjs/tsconfig.json b/types/chartjs/tsconfig.json similarity index 100% rename from chartjs/tsconfig.json rename to types/chartjs/tsconfig.json diff --git a/checkstyle-formatter/index.d.ts b/types/checkstyle-formatter/index.d.ts similarity index 100% rename from checkstyle-formatter/index.d.ts rename to types/checkstyle-formatter/index.d.ts diff --git a/checkstyle-formatter/tsconfig.json b/types/checkstyle-formatter/tsconfig.json similarity index 100% rename from checkstyle-formatter/tsconfig.json rename to types/checkstyle-formatter/tsconfig.json diff --git a/types/checkstyle-formatter/tslint.json b/types/checkstyle-formatter/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/checkstyle-formatter/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/checksum/checksum-tests.ts b/types/checksum/checksum-tests.ts similarity index 100% rename from checksum/checksum-tests.ts rename to types/checksum/checksum-tests.ts diff --git a/checksum/index.d.ts b/types/checksum/index.d.ts similarity index 100% rename from checksum/index.d.ts rename to types/checksum/index.d.ts diff --git a/checksum/tsconfig.json b/types/checksum/tsconfig.json similarity index 100% rename from checksum/tsconfig.json rename to types/checksum/tsconfig.json diff --git a/cheerio/cheerio-tests.ts b/types/cheerio/cheerio-tests.ts similarity index 96% rename from cheerio/cheerio-tests.ts rename to types/cheerio/cheerio-tests.ts index 5b1f6511ec..1c0848eef7 100644 --- a/cheerio/cheerio-tests.ts +++ b/types/cheerio/cheerio-tests.ts @@ -55,6 +55,10 @@ var $multiEl = $('selector', 'selector', 'selector'); $el.attr('id'); $el.attr('id', 'favorite').html(); +// props +$el.prop('style') +$el.prop('style', 'none').html() + // data $el.data(); $el.data('apple-color'); @@ -86,6 +90,7 @@ $el.is(() => { */ // serializeArray $('
              ').serializeArray(); +$('
              ').serialize(); /** * Traversing @@ -217,6 +222,9 @@ $el.eq(0).addBack('.class').length * Manipulation */ +$('
            • Plum
            • ').appendTo($el) +$el.prependTo($('
            • Plum
            • ')) + // .append( content, [content, ...] ) $el.append('
            • Plum
            • ').html(); $el.append('
            • Plum
            • ', '
            • Plum
            • ').html(); diff --git a/types/cheerio/index.d.ts b/types/cheerio/index.d.ts new file mode 100644 index 0000000000..4096a0f9c2 --- /dev/null +++ b/types/cheerio/index.d.ts @@ -0,0 +1,275 @@ +// Type definitions for Cheerio v0.22.0 +// Project: https://github.com/cheeriojs/cheerio +// Definitions by: Bret Little , VILIC VANE , Wayne Maurer , Umar Nizamani +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface Cheerio { + // Document References + // Cheerio https://github.com/cheeriojs/cheerio + // JQuery http://api.jquery.com + + [index: number]: CheerioElement; + length: number; + + // Attributes + + attr(name: string): string; + attr(name: string, value: any): Cheerio; + + data(): any; + data(name: string): any; + data(name: string, value: any): any; + + val(): string; + val(value: string): Cheerio; + + removeAttr(name: string): Cheerio; + + has(selector: string): Cheerio; + has(element: CheerioElement): Cheerio; + + hasClass(className: string): boolean; + addClass(classNames: string): Cheerio; + + removeClass(): Cheerio; + removeClass(className: string): Cheerio; + removeClass(func: (index: number, className: string) => string): Cheerio; + + toggleClass(className: string): Cheerio; + toggleClass(className: string, toggleSwitch: boolean): Cheerio; + toggleClass(toggleSwitch?: boolean): Cheerio; + toggleClass(func: (index: number, className: string, toggleSwitch: boolean) => string, toggleSwitch?: boolean): Cheerio; + + is(selector: string): boolean; + is(element: CheerioElement): boolean; + is(element: CheerioElement[]): boolean; + is(selection: Cheerio): boolean; + is(func: (index: number, element: CheerioElement) => boolean): boolean; + + // Form + serialize(): string; + serializeArray(): {name: string, value: string}[]; + + // Traversing + + find(selector: string): Cheerio; + find(element: Cheerio): Cheerio; + + parent(selector?: string): Cheerio; + parents(selector?: string): Cheerio; + parentsUntil(selector?: string, filter?: string): Cheerio; + parentsUntil(element: CheerioElement, filter?: string): Cheerio; + parentsUntil(element: Cheerio, filter?: string): Cheerio; + + prop(name: string): any; + prop(name: string, value: any): Cheerio; + + closest(): Cheerio; + closest(selector: string): Cheerio; + + next(selector?: string): Cheerio; + nextAll(): Cheerio; + nextAll(selector: string): Cheerio; + + nextUntil(selector?: string, filter?: string): Cheerio; + nextUntil(element: CheerioElement, filter?: string): Cheerio; + nextUntil(element: Cheerio, filter?: string): Cheerio; + + prev(selector?: string): Cheerio; + prevAll(): Cheerio; + prevAll(selector: string): Cheerio; + + prevUntil(selector?: string, filter?: string): Cheerio; + prevUntil(element: CheerioElement, filter?: string): Cheerio; + prevUntil(element: Cheerio, filter?: string): Cheerio; + + slice(start: number, end?: number): Cheerio; + + siblings(selector?: string): Cheerio; + + children(selector?: string): Cheerio; + + contents(): Cheerio; + + each(func: (index: number, element: CheerioElement) => any): Cheerio; + map(func: (index: number, element: CheerioElement) => any): Cheerio; + + filter(selector: string): Cheerio; + filter(selection: Cheerio): Cheerio; + filter(element: CheerioElement): Cheerio; + filter(elements: CheerioElement[]): Cheerio; + filter(func: (index: number, element: CheerioElement) => boolean): Cheerio; + + not(selector: string): Cheerio; + not(selection: Cheerio): Cheerio; + not(element: CheerioElement): Cheerio; + not(func: (index: number, element: CheerioElement) => boolean): Cheerio; + + first(): Cheerio; + last(): Cheerio; + + eq(index: number): Cheerio; + + get(): string[]; + get(): CheerioElement[]; + get(index: number): CheerioElement; + + index(): number; + index(selector: string): number; + index(selection: Cheerio): number; + + end(): Cheerio; + + add(selectorOrHtml: string): Cheerio; + add(selector: string, context: Document): Cheerio; + add(element: CheerioElement): Cheerio; + add(elements: CheerioElement[]): Cheerio; + add(selection: Cheerio): Cheerio; + + addBack():Cheerio; + addBack(filter: string):Cheerio; + + // Manipulation + appendTo(target: Cheerio) : Cheerio + prependTo(target: Cheerio) : Cheerio + + append(content: string, ...contents: any[]): Cheerio; + append(content: Document, ...contents: any[]): Cheerio; + append(content: Document[], ...contents: any[]): Cheerio; + append(content: Cheerio, ...contents: any[]): Cheerio; + + prepend(content: string, ...contents: any[]): Cheerio; + prepend(content: Document, ...contents: any[]): Cheerio; + prepend(content: Document[], ...contents: any[]): Cheerio; + prepend(content: Cheerio, ...contents: any[]): Cheerio; + + after(content: string, ...contents: any[]): Cheerio; + after(content: Document, ...contents: any[]): Cheerio; + after(content: Document[], ...contents: any[]): Cheerio; + after(content: Cheerio, ...contents: any[]): Cheerio; + + insertAfter(content: string): Cheerio; + insertAfter(content: Document): Cheerio; + insertAfter(content: Cheerio): Cheerio; + + before(content: string, ...contents: any[]): Cheerio; + before(content: Document, ...contents: any[]): Cheerio; + before(content: Document[], ...contents: any[]): Cheerio; + before(content: Cheerio, ...contents: any[]): Cheerio; + + insertBefore(content: string): Cheerio; + insertBefore(content: Document): Cheerio; + insertBefore(content: Cheerio): Cheerio; + + remove(selector?: string): Cheerio; + + replaceWith(content: string): Cheerio; + replaceWith(content: CheerioElement): Cheerio; + replaceWith(content: CheerioElement[]): Cheerio; + replaceWith(content: Cheerio): Cheerio; + replaceWith(content: () => Cheerio): Cheerio; + + empty(): Cheerio; + + html(): string; + html(html: string): Cheerio; + + text(): string; + text(text: string): Cheerio; + + // See https://github.com/cheeriojs/cheerio/issues/731 + /*wrap(content: string): Cheerio; + wrap(content: Document): Cheerio; + wrap(content: Cheerio): Cheerio;*/ + + css(propertyName: string): string; + css(propertyNames: string[]): string[]; + css(propertyName: string, value: string): Cheerio; + css(propertyName: string, value: number): Cheerio; + css(propertyName: string, func: (index: number, value: string) => string): Cheerio; + css(propertyName: string, func: (index: number, value: string) => number): Cheerio; + css(properties: Object): Cheerio; + + // Rendering + + // Miscellaneous + + clone(): Cheerio; + + // Not Documented + + toArray(): CheerioElement[]; +} + +interface CheerioOptionsInterface { + // Document References + // Cheerio https://github.com/cheeriojs/cheerio + // HTMLParser2 https://github.com/fb55/htmlparser2/wiki/Parser-options + // DomHandler https://github.com/fb55/DomHandler + + xmlMode?: boolean; + decodeEntities?: boolean; + lowerCaseTags?: boolean; + lowerCaseAttributeNames?: boolean; + recognizeCDATA?: boolean; + recognizeSelfClosing?: boolean; + normalizeWhitespace?: boolean; +} + +interface CheerioSelector { + (selector: string): Cheerio; + (selector: string, context: string): Cheerio; + (selector: string, context: CheerioElement): Cheerio; + (selector: string, context: CheerioElement[]): Cheerio; + (selector: string, context: Cheerio): Cheerio; + (selector: string, context: string, root: string): Cheerio; + (selector: string, context: CheerioElement, root: string): Cheerio; + (selector: string, context: CheerioElement[], root: string): Cheerio; + (selector: string, context: Cheerio, root: string): Cheerio; + (selector: any): Cheerio; +} + +interface CheerioStatic extends CheerioSelector { + // Document References + // Cheerio https://github.com/cheeriojs/cheerio + // JQuery http://api.jquery.com + xml(): string; + root(): Cheerio; + contains(container: CheerioElement, contained: CheerioElement): boolean; + parseHTML(data: string, context?: Document, keepScripts?: boolean): Document[]; + + html(options?: CheerioOptionsInterface): string; + html(selector: string, options?: CheerioOptionsInterface): string; + html(element: Cheerio, options?: CheerioOptionsInterface): string; + html(element: CheerioElement, options?: CheerioOptionsInterface): string; +} + +interface CheerioElement { + // Document References + // Node Console + tagName: string; + type: string; + name: string; + attribs: {[attr: string]: string}; + children: CheerioElement[]; + childNodes: CheerioElement[]; + lastChild: CheerioElement; + next: CheerioElement; + nextSibling: CheerioElement; + prev: CheerioElement; + previousSibling: CheerioElement; + parent: CheerioElement; + parentNode: CheerioElement; + nodeValue: string; +} + +interface CheerioAPI extends CheerioSelector { + load(html: string, options?: CheerioOptionsInterface): CheerioStatic; + load(element: CheerioElement, options?: CheerioOptionsInterface): CheerioStatic; +} + +declare var cheerio:CheerioAPI; + +declare module "cheerio" { + export = cheerio; +} diff --git a/cheerio/tsconfig.json b/types/cheerio/tsconfig.json similarity index 100% rename from cheerio/tsconfig.json rename to types/cheerio/tsconfig.json diff --git a/types/chocolatechipjs/chocolatechipjs-tests.ts b/types/chocolatechipjs/chocolatechipjs-tests.ts new file mode 100644 index 0000000000..bbb6ae72e3 --- /dev/null +++ b/types/chocolatechipjs/chocolatechipjs-tests.ts @@ -0,0 +1,421 @@ +// ChocolateChipStatic -- DOM creation, etc. +$(function() { + alert('Ready to do stuff!'); +}); +const docRoot = $(); +const divTag = $('div'); +const divClass = $('.div'); +const divID = $('#div'); +const divAttr = $('[name=div]'); +const documentElement = $(); +const divTag2 = $(divTag); +const nodeName = divTag2[0].nodeName; + +// Assorted properties and functions on ChocolateChipStatic: +const version = $.version; +const libraryName = $.libraryName; +const els = $('li'); +const madeEls = $.make('

              Stuff

              '); +const moreEls = $.html('

              Stuff

              '); +const oldTag = $('#oldTag'); +const newTag = $('#newTag'); +$.replace(oldTag, newTag); +$.require('./scripts/myscript.js', function() { + $.noop; +}); +$.defer(function() { + console.log("This comes after Squawk!"); +}); +const concatenation = $.concat('This', ' ', 'is', ' ', 'a', ' ', 'string', '.'); +const arrayOfStringWords = $.w('This is a string'); + +// Boolean tests: +$.isString('This is a string'); +$.isArray([1, 2, 3]); +$.isFunction($.noop); +$.isObject({ name: 'Me' }); +$.isObject(new Object()); +$.isEmptyObject({}); +$.isNumber(123); +$.isInteger(123); +$.isInteger(123.123); // should return false +$.isFloat(123.123); // should return true +const newUuid = $.makeUuid(); +$.each(['a', 'b', 'c'], function(ctx: string, idx: number) { + console.log(ctx); + console.log(idx); +}); + +// Plugin interface for ChocolateChipElementArray: +$.fn.extend({ + whateverProperty: "whatever", + whateverMethod() { + alert("Whatever!"); + } +}); + +// ChocolateChipElementArray extensions: +$('li').each(function(ctx, idx) { + console.log(ctx.nodeName); +}); +const uniqueElements = $('li').unique(); +const secondElement = $('li').eq(1); +const lastElement = $('li').eq(-1); +const whichIndex = $('li').index($('.selected')); +const whichListItemIndex = $('li').eq(3).index(); +$('.elems').is('div').each(function(ctx) { + console.log('This element is a div.'); +}); +$('.elems').isnt('p').each(function() { + console.log('This element is not a paragraph tag.'); +}); +$('li').has('p').each(function(ctx) { + console.log('This list item has a paragraph tag.'); +}); +$('li').hasnt('p').each(function(ctx) { + console.log('This list item does not have a paragraph tag.'); +}); +$('ul').find('li').each(function(ctx) { + console.log(ctx); +}); +$('li').css('color'); +$('li').css('color', 'red'); +$('li').css({ color: "red", "background-color": "yellow" }); +const elemWidth = $('#header').width(); +const elemHeight = $('#header').height(); +const offset = $('h1').offset(); +console.log(offset.top); +console.log(offset.left); +console.log(offset.bottom); +console.log(offset.right); +$('li.selected').prependTo('#selectedItems'); +$('li.selected').appendTo('#selectedItems'); +$('ul').before("

              Subtitle

              "); +$('ul').after("

              Footer stuff here.

              "); +const h1Text = $('h1').text(); +$('h1').text('The New Title'); +$('ul').insert("
            • 1
            • 2
            • 3
            • ", "first"); +$('ul').insert("
            • 1
            • 2
            • 3
            • ", "last"); +$('ul').insert("
            • 1
            • 2
            • 3
            • ", 3); +$('ul').insert("
            • 1
            • 2
            • 3
            • "); +$('ul').html('
            • 1
            • <2/li>
            • 3
            • '); +$('ul').html(''); +const listContent = $('ul').html(); +$('ul').prepend('
            • The title
            • '); +$('ul').append('
            • The Last Item
            • '); +const inputName = $('input').attr('name'); +$('input').attr('name', 'wobba'); +const inputProperty = $('input').prop('disabled'); +$('input[type=checked]').prop('checked', true); +$('input').removeProp('disabled'); +$('input').hasAttr('disabled').css('border', 'solid 1px red'); +$('input').removeAttr('disabled'); +$('article').hasClass('current').css('display', 'block'); +$('article').addClass('current'); +$('article').removeClass('current'); +$('article').toggleClass("current"); +$('h1').dataset('status', 'ready'); +const theStatus = $('h1').dataset('status'); +const theText = $('textarea').val(); +$('textarea').val('This is the new text.'); +$('input').disable(); +$('input').enable(); +$('ul').hide(); +$('ul').hide('slow'); +$('ul').hide('fast'); +$('ul').hide(1000); +$('ul').hide('fast', function() { + console.log('Finished hiding these.'); +}); +$('ul').show(); +$('ul').show('slow'); +$('ul').show('fast'); +$('ul').show(1000); +$('ul').show('fast', function() { + console.log('Finished hiding these.'); +}); +$('#list').prev().css('display', 'none'); +$('#list').next().css('display', 'none'); +$('ul').first().css('font-weight', 'bold'); +$('ul').last().css('font-style', 'italic'); +$('ul').children().css('display', 'block'); +$('li').parent().css('border', 'solid 2px green'); +$('#list').ancestor('article').css('margin', "20px"); +$('#list').ancestor(5).css('margin', "20px"); +$('#list').closest('article').css('margin', "20px"); +$('button').siblings().css('padding', "20px"); +$('button').siblings("p").css('padding', "20px"); +const cloned = $('#list').clone(); +$('#list').wrap('
              '); +$('#list').unwrap(); +$('#list').remove(); +$('#list').empty(); +const thePrice = $('#list').data('price'); +$('#list').data('price', '$1000'); +$('#list').removeData('price'); + +// Animate: +$('#list').animate({ + transform: "rotate3d(30, 150, 200, 180deg) scale(3) translate3d(-50%, -30%, 140%)", + opacity: .25, + "transform-style": "preserve-3d", + perspective: 500 +}, + '2s', + "ease-in-out" + ); + +// Form to JSON: +$.form2JSON($('form')[0], '.'); + +// Strings: +$.camelize("this-is-a-string"); // should return "thisIsAString" +$.deCamelize("thisIsAString"); // Should return "this-is-a-string" +$.capitalize("a string"); // Should return "A string" +$.capitalize("a string", true); // Should return "A STRING" + +// Booleans: +const isiPhone = $.isiPhone; +const isiPad = $.isiPad; +const isiPod = $.isiPod; +const isiOS = $.isiOS; +const isAndroid = $.isAndroid; +const isWebOS = $.isWebOS; +const isBlackberry = $.isBlackberry; +const isTouchEnabled = $.isTouchEnabled; +const isOnline = $.isOnline; +const isStandalone = $.isStandalone; +const isiOS6 = $.isiOS6; +const isiOS7 = $.isiOS7; +const isWin = $.isWin; +const isWinPhone = $.isWinPhone; +const isIE10 = $.isIE10; +const isIE11 = $.isIE11; +const isWebkit = $.isWebkit; +const isMobile = $.isMobile; +const isDesktop = $.isDesktop; +const isSafari = $.isSafari; +const isNativeAndroid = $.isNativeAndroid; + +// Events: +$('li').bind('click', function() { + $.noop; +}, false); +$('li').unbind('click', function() { + $.noop; +}, false); +$('ul').delegate('click', 'li', function() { + $.noop; +}, false); +$('ul').undelegate('click', 'li', function() { + $.noop; +}, false); +$('li').on('click', function() { + $.noop; +}); +$('ul').on('click', 'li', function() { + console.log($(this).text()); +}); +$('li').off('click'); +$('li').off('click', 'li'); +$('button').trigger('click'); + +$('.selected').data('selection', 'This is awesome!'); // set the value of data value to "This is Awesome!" +$('.selected').data('selection'); // return the data value of "selection" on ".selected" + +// Promises: +let myPromise = new Promise(function(resolve, reject) { + $.noop; +}); + +myPromise = new Promise(function(resolve, reject) { + // Resolve the promise: + resolve('Success!'); + // or reject it: + // reject('Lost in Space!'); +}); +myPromise.then(function(value) { + // Success: + console.log(value); + }, + // Opps! There was a problem: + function(reason) { + console.log(reason); +}); + +// Fetch API +// =========== +// GET: +interface WineObject { + data: WineInterface[]; +} +interface WineInterface { + wine: { + name: string; + }; +} +fetch('../data/wines.json') +.then($.json) +.then(function(obj: any): any { + $('#message_ajax').empty(); + obj.data.forEach(function(wine: any) { + $('#message_ajax').append('
            • ' + wine.name + '
            • '); + }); +}); + +// POST: +interface postData { + email: string; + name: string; + msg: string; +} +const formData = $.serialize($('form')[0]); +fetch('../controllers/php-post.php', { + method: 'post', + headers: { + "Content-type": "application/x-www-form-urlencoded; charset=UTF-8" + }, + body: formData +}) +.then($.json) +.then(function(data: any): any { + if (data.email_check === "valid") { + $("#message_ajax").html("
              " + data.email + " is a valid e-mail address. Thank you, " + data.name + ".
              "); + $("#message_ajax").append('

              ' + data.msg + '

              '); + } else { + $("#message_ajax").html("
              Sorry " + data.name + ", " + data.email + " is NOT a valid e-mail address. Try again.
              "); + } +}); +// PUT: +interface putData { + base: string; + result: string; + fileName: string; +} +const putData = $('#fileText').val(); +fetch('../controllers/php-put.php', { + method: 'put', + headers: { + "Content-type": "application/x-www-form-urlencoded; charset=UTF-8" + }, + body: putData +}) +.then($.json) +.then(function(data: any): any { + console.dir(data.base); + $("#message_ajax").append('

              ' + data.result + '

              '); + $("#message_ajax").append('

              The file name is: ' + data.fileName + '

              '); +}) +.catch(function(error: Error) { + console.log(error); + $("#message_ajax").html("
              Sorry, put was not successful.
              "); +}); + +// DELETE: +interface deleteData { + result: string; +} +const file = $('#fileName').val(); +fetch('../controllers/php-delete.php', { + method: 'delete', + headers: { + "Content-type": "application/x-www-form-urlencoded; charset=UTF-8" + }, + body: file +}) +.then($.json) +.then(function(data: any): any { + $("#message_ajax").html("
              DELETE was sent to the server successfully.
              "); + $("#message_ajax").append('

              ' + data.result + '

              '); +}, +function(data: any) { + console.log('PROBLEM'); + console.log(data); +}) +.catch(function(error: any) { + $("#message_ajax").html("
              Sorry, 'DELETE' was not successful.
              "); + error.reject(); +}); + +// Timeout: +const formData2 = $.serialize($('form')[0]); +fetch('../controllers/php-post.php', { + method: 'post', + headers: { + "Content-type": "application/x-www-form-urlencoded; charset=UTF-8" + }, + body: formData, + // Set timeout: + timeout: 10000 +}) + .then($.json) + .then(function (data: any): any { + if (data.email_check === "valid") { + $("#message_ajax").html("
              " + data.email + " is a valid e-mail address. Thank you, " + data.name + ".
              "); + $("#message_ajax").append('

              ' + data.msg + '

              '); + } else { + $("#message_ajax").html("
              Sorry " + data.name + ", " + data.email + " is NOT a valid e-mail address. Try again.
              "); + } + }) + // Catch timeout: + .catch(function(error) { + console.log(error); + }); + +// $.jsonp: +$.jsonp('https://api.github.com/users/rbiggs/repos?name=chipper', {timeout: 10000}) +.then($.json) +.then(function(obj: any): any { + console.log(obj); + obj.data.forEach(function(repo: any): any { + $('#message_ajax').append("
            • " + repo.name + "
            • "); + }); +}) +.catch(function(error: any): any { + $('#message_ajax').append("
            • " + error.message + "
            • "); +}); + +// Templates: +const myTemplate = '
            • Name: [[= data.name]]
            • '; +const userInfo = { + name: 'Wobba', + age: 100, + job: 'Rocket Scientist', + salary: '$1,000,000,000' +}; +const parsedTempl8 = $.template(myTemplate); +$('#user').html(parsedTempl8(userInfo)); + +// Output a simple array of data: +const simpleArray = ['One', 'Two', 'Three', 'Four', 'Five']; +const repeaterTmplate1 = '
            • [[= data ]]
            • '; +$.template.repeater($('#arrayList'), repeaterTmplate1, simpleArray); + +// Output an array of objects: +const luminaries = { + persons: + [ + { firstName: "Albert", lastName: "Einstein" }, + { firstName: "Steven", lastName: "Hawking" }, + { firstName: "Neil", lastName: "deGrasse Tyson" }, + { firstName: "Leonardo", lastName: "Da Vinci" }, + { firstName: "Nicholas", lastName: "Copernicus" } + ] +}; +const repeaterTmplate2 = '
            • [[= data.firstName ]], [[= data.lastName]]
            • '; +// Pass in the array of persons: +$.template.repeater($('#objectArrayList'), repeaterTmplate2, luminaries.persons); + +// Code for declarative repeater: +$.template.data['myRepeater'] = [{ name: "Joe" }, { name: "Sally" }, {name: "Tom" }]; +$.template.repeater(); + +// Pub/Sub: +const arraySubscriber = function(topic: string, data: any): any { + $('.list').append('
            • ' + topic + '

              ' + data + '

            • '); +}; +const newsSubscription = $.subscribe('news/update', arraySubscriber); +$.publish('news/update', 'The New York Stock Exchange rose an unprecedented 1000 points in just three minutes. Analysts and investors are confused and uncertain how to respond.'); +$.unsubscribe('news/update'); +// Due to being unsubscribed above, this does nothing: +$.publish('news/update', 'We have nothing further to comment at this time.'); diff --git a/types/chocolatechipjs/index.d.ts b/types/chocolatechipjs/index.d.ts new file mode 100644 index 0000000000..0e33e087c3 --- /dev/null +++ b/types/chocolatechipjs/index.d.ts @@ -0,0 +1,1293 @@ +// Type definitions for chocolatechip 4.0 +// Project: https://github.com/chocolatechipui/ChocolateChipJS +// Definitions by: Robert Biggs +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +interface ChocolateChipStatic { + /** + * Accepts a string containing a CSS selector which is then used to match a set of elements. + * + * @param selector A string containing a selector expression + * @param context A DOM HTMLElement to use as context + * @return HTMLElement[] + */ + (selector: string | HTMLElement | Document, context?: HTMLElement | ChocolateChipElementArray): ChocolateChipElementArray; + + /** + * Binds a function to be executed when the DOM has finished loading. + * + * @param callback A function to execute after the DOM is ready. + * @return void + */ + (callback: () => any): void; + + /** + * Accepts a string containing a CSS selector which is then used to match a set of elements. + * + * @param element A DOM element to wrap in an array. + * @return HTMLElement[] + */ + (element: HTMLElement): ChocolateChipElementArray; + + /** + * Accepts a string containing a CSS selector which is then used to match a set of elements. + * + * @param elementArray An array of DOM elements to convert into a ChocolateChip Collection. + * @return HTMLElement[] + */ + (elementArray: ChocolateChipElementArray): ChocolateChipElementArray; + + /** + * Accepts the document element and returns it wrapped in an array. + * + * @param document The document object. + * @return document[] + */ + (document: Document): Document[]; + + /** + * If no argument is provided, return the document as a ChocolateChipElementArray. + * @return Document[] + */ + (): Document[]; + + /** + * Extend the ChocolateChipJS object itself with the provided object. + * + * @param object The object to add to ChocolateChipJS. + * @return The ChocolateChipJS object. + */ + extend(object: Object): Object; + + /** + * Extend a target object with another object. + * + * @param target An object to extend. + * @param object The object to add to the target. + * @return The extended object. + */ + extend(target: Object, object: Object): Object; + + /** + * The base for extending ChocolateChipJS collections, which are arrays of elements. + */ + fn: { + /** + * This method adds the provided object to the Array prototype to make it available to all arrays of HTML elements. + * + * @param object And object to add to element arrays. + * @return The extended array of elements. + */ + extend(object: Object): HTMLElement[]; + }; + + /** + * Contains the version of ChocolateChipJS in use. + */ + version: string; + + /** + * Contains the name of the library (ChocolateChip). + */ + libraryName: string; + + /** + * An empty function. + * + * @return void. + */ + noop(): void; + + /** + * Uuid number. + */ + uuid: number; + + /** + * Create a random number to use as a uuid. + * + * @return number. + */ + uuidNum(): number; + + /** + * Creates a uuid using uuidNum(). + * + * @return A string. + */ + makeUuid(): string; + + /** + * Create a ChocolateChip collection object by creating elements from an HTML string. + * + * @param selector + * @return any + */ + make(selector: string): ChocolateChipElementArray; + + /** + * Create a ChocolateChip collection object by creating elements from an HTML string. This is an alias for $.make. + * + * @param selector + * @return any + */ + html(selector: string): ChocolateChipElementArray; + + /** + * Replace one element with another. + * + * @param new HTMLElement + * @param old HTMLElement + * @return HTMLElement[] + */ + replace(newElement: ChocolateChipElementArray, oldElement: ChocolateChipElementArray): void; + + /** + * Load a JavaScript file from a url, then execute it. + * + * @param url A string containing the URL where the script resides. + * @param callback A callback function that is executed after the script loads. + * @return void + */ + require(url: string, callback: Function): Function; + + /** + * Process JavaScript returned by Ajax request. An optional name can be used to create a custom variable name by which the data is exposed, otherwise it is exposed with the variable "data". + * + * @param url A string containing the URL where the script resides. + * @param callback A callback function that is executed after the script loads. + * @return Function + */ + processJSON(json: string, name?: string): any; + + /** + * This method takes a referenced form and serializes its element names and values, which it returns as a string. This is required if you want to send form data. + * + * @param element A string, HTML element or ChocolateChipElementArray containing a reference to a from. + * @return An encode string form element names and values. + */ + serialize(element: any): string; + + /** + * Parse the data in a Promise response as JSON. + * + * @param response The response from a Promise. + * @result + */ + json(reponse: Response): JSON; + + /** + * This method will defer the execution of a function until the call stack is clear. + * + * @param callback A function to execute. + * @param duration The number of milliseconds to delay execution. + * @return any + */ + delay(callback: Function, duration?: number): any; + + /** + * The method will defer the execution of its callback until the call stack is clear. + * + * @param callback A callback to execute after a delay. + * @return Function. + */ + defer(callback: Function): Function; + + /** + * This method makes sure a method always returns an array. + * If no values are available to return, it returns and empty array. + * This is to make sure that methods that expect a chainable array will not throw and exception. + * + * @param result The result of a method to test if it can be returned in an array. + * @return An array holding the results of a method, otherwise an empty array. + */ + returnResult(result: HTMLElement[]): any[]; + + /** + * This method allows you to execute a callback on each item in an array of elements. + * + * @param array An array of elements. + * @param callback A callback to execute on each element. This has two parameters: the context, followed by the index of the current iteration. + */ + each(array: T[], callback: (ctx: T, idx: number) => any): any; + + /** + * This method will concatenate strings or values as a cleaner alternative to using the '+' operator. + * + * @param string or number A comma separated series of strings to concatenate. + * @return string + */ + concat(...string: string[]): string; + + /** + * This method takes a space-delimited string of words and returns it as an array where the individual words are indices. + * + * @param string Any string with values separated by spaces. + * @return string[] + */ + w(string: string): string[]; + + /** + * This method converts a string of hyphenated tokens into a camel cased string. + * + * @param string A string of hyphenated tokens. + * @return string + */ + camelize(string: string): string; + + /** + * This method converts a camel case string into lowercase with hyphens. + * + * @param string A camel case string. + * @return string + */ + deCamelize(string: string): string; + + /** + * This method capitalizes the first letter of a string. + * + * @param string A string. + * @param boolean A boolean value. + * @return string + */ + capitalize(string: string, boolean?: boolean): string; + + /** + * Determine whether the argument is a string. + * + * @param obj Object to test whether or not it is a string. + * @return boolean + */ + isString(obj: any): boolean; + + /** + * Determine whether the argument is an array. + * + * @param obj Object to test whether or not it is an array. + * @return boolean + */ + isArray(obj: any): boolean; + + /** + * Determine whether the argument is a function. + * + * @param obj Object to test whether or not it is an function. + * @return boolean + */ + isFunction(obj: any): boolean; + + /** + * Determine whether the argument is an object. + * + * @param obj Object to test whether or not it is an object. + * @return boolean + */ + isObject(obj: any): boolean; + + /** + * Determine whether the argument is an empty object. + * + * @param obj Object to test whether or not it is an empty object. + * @return boolean + */ + isEmptyObject(obj: any): boolean; + + /** + * Determine whether the argument is an empty object. + * + * @param obj Object to test whether or not it is an empty object. + * @return boolean + */ + isEmptyObject(obj: any): boolean; + + /** + * Determine whether the argument is a number. + * + * @param obj Object to test whether or not it is a number. + * @return boolean + */ + isNumber(obj: any): boolean; + + /** + * Determine whether the argument is an integer. + * + * @param obj Object to test whether or not it is an integer. + * @return boolean + */ + isInteger(obj: any): boolean; + + /** + * Determine whether the argument is a float. + * + * @param obj Object to test whether or not it is a float. + * @return boolean + */ + isFloat(obj: any): boolean; + + /** + * Whether device is iPhone. + */ + isiPhone: boolean; + + /** + * Whether device is iPad. + */ + isiPad: boolean; + + /** + * Whether device is iPod. + */ + isiPod: boolean; + + /** + * Whether OS is iOS. + */ + isiOS: boolean; + + /** + * Whether OS is Android + */ + isAndroid: boolean; + + /** + * Whether OS is WebOS. + */ + isWebOS: boolean; + + /** + * Whether OS is Blackberry. + */ + isBlackberry: boolean; + + /** + * Whether OS supports touch events. + */ + isTouchEnabled: boolean; + + /** + * Whether there is a network connection. + */ + isOnline: boolean; + + /** + * Whether app is running in stanalone mode. + */ + isStandalone: boolean; + + /** + * Whether OS is iOS 6. + */ + isiOS6: boolean; + + /** + * Whether OS i iOS 7. + */ + isiOS7: boolean; + + /** + * Whether OS is Windows. + */ + isWin: boolean; + + /** + * Whether device is Windows Phone. + */ + isWinPhone: boolean; + + /** + * Whether browser is IE10. + */ + isIE10: boolean; + + /** + * Whether browser is IE11. + */ + isIE11: boolean; + + /** + * Whether browser is Webkit based. + */ + isWebkit: boolean; + + /** + * Whether browser is running on mobile device. + */ + isMobile: boolean; + + /** + * Whether browser is running on desktop. + */ + isDesktop: boolean; + + /** + * Whether browser is Safari. + */ + isSafari: boolean; + + /** + * Whether browser is Chrome. + */ + isChrome: boolean; + + /** + * Is native Android browser (not mobile Chrome). + */ + isNativeAndroid: boolean; + + /** + * Serialize + */ + serialize(form: HTMLFormElement | ChocolateChipElementArray): string; + + /** + * Grabs values from a form and converts them into a JSON object. + * + * @param rootNode: string | HTMLElement A form whose values you want to convert to JSON. + * @param delimiter string A delimiter to namespace your form values. The default is "." + * You use the form input's name to set up the namespace structure for your JSON, e.g. name="newUser.name.first". + */ + form2JSON(rootNode: string | HTMLElement, delimiter: string): Object; + + /** + * Subscribe to a publication. You provide the topic you want to subscribe to, as well as a callback to execute when a publication occurs. + * Any data passed by the publisher is exposed to the callback as its second parameter. The callback's first parameter is the published topic. + * + * @param topic string A topic to subscribe to. This can be a single term, or any type of namespaced term with delimiters. + * @data any You can receive any type: string, number, array, object, etc. + * @return any + */ + subscribe(topic: string, callback: (topic: string, data: any) => any): boolean; + + /** + * Unsubscribe from a topic. Pass this the topic you wish to unsubscribe from. The subscription will be terminated immediately. + * + * @param topic string The name of the topic to unsubscribe from. + * @return void + */ + unsubscribe(topic: string): void; + + /** + * Publish a topic with data for the topic's subscribers to receive. + * + * @param topic string The topic you wish to publish. + * @param data The data to send with the publication. This can be of any type: string, number, array, object, etc. + * @return void + */ + publish(topic: string, data: any): string; + + /** + * Object used to store string templates and parsed templates. + * + * @param string A string defining the template. + * @param string A label used to access an object's properties in the template. If none is provided it defaults to "data": [[= data.name]]. + * @return void + */ + templates: Object; + + /** + * This method returns a parsed template. + * + */ + template: { + /** + * This method parses a string and an optoinal variable name and returns a parsed template in the form of a function. You can then pass this function data to get rendered nodes. + * + * @param template A string of markup to use as a template. + * @param variable An option name to use in the template. If it were "myData": [[= myData.name]]. Otherwise it defaults to "data": [[= data.name]]. + * @return A function. + */ + (template: string, variable?: string): Function; + + /** + * The repeater method used to rendering iterable template data. + */ + repeater: { + /** + * Use this method to render declarative temlate repeaters. This expects a "data-repeater" attribute whose value points to data stored on $.template.data. + */ + (): void; + + /** + * A method to repeated output a template. + * + * @param element The target container into which the content will be inserted. + * @param template A string of markup. + * @param data The iterable data the template will consume. + * @return void. + */ + (element: ChocolateChipElementArray, template: string, data: any): void; + } + + /** + * An object that holds the reference to the controller for a repeater. + * This is used to cache the data that a repeater uses. After the repeater is rendered, the reference is deleted from this object. + * Example: $.template.data["myRepeater"] = [{name: "Joe"}, {name: "Sue"}]; + * + */ + data: any; + + /** + * Use this value to output an index value in a template repeater. + */ + index: number; + }; + + /** + * ATENTION: DO NOT TOUCH! + * This is the ChocolateChipJS cache. + * This is used to store details about registered events and data. + * You should not touch any of these values, even though they are exposed, as this can seriously impair the behavior of your app. + * + * data: this is used by $(element).data() to store data. + * events: this is used by the event system. + */ + chch_cache: { + /** + * DO NOT TOUCH! This hold data stored by $(element).data(). + */ + data: {}; + + /** + * DO NOT TOUCH! This stores information about registered events. + */ + events: { + keys: any[]; + values: any[]; + set: Function; + hasKey: Function; + _delete: Function; + } + }; +} + +/** + * Interface for ChocolateChipJS Element Collections. + */ +interface ChocolateChipElementArray extends Array { + /** + * Iterate over an Array object, executing a function for each matched element. + * + * @param Function + * @return void + */ + each(func: (ctx: any, idx: number) => void): void; + + /** + * Sorts an array and removes duplicates before returning it. + * + * @return Array + */ + unique(): ChocolateChipElementArray; + + /** + * This method returns the element at the position in the array indicated by the argument. This is a zero-based number. + * When dealing with document nodes, this allows you to cherry pick a node from its collection based on its + * position amongst its siblings. + * + * @param number Index value indicating the node you wish to access from a collection. This is zero-based. + * @return HTMLElement + */ + eq(index: number): ChocolateChipElementArray; + + /** + * Search for a given element from among the matched elements on a collection. + * This method returns the index value as an integer. + * + * @return number + */ + index(): number; + + /** + * Search for a given element from among the matched elements on a collection. + * This method returns the index value as an integer. + * + * @param selector A selector representing an element to look for in a collection of elements. + * @return number + */ + index(selector: string | HTMLElement[]): number; + + /** + * Check the current matched set of elements against a selector or element and return it + * if it matches the given arguments. + * + * @param selector A string containing a selector expression to match elements against. + * @return HTMLElement[] + */ + is(selector: string): ChocolateChipElementArray; + + /** + * Check the current matched set of elements against a selector or element and return it + * if it matches the given arguments. + * + * @param elements One or more elements to match the current set of elements against. + * @ return HTMLElement[] + */ + is(element: any): ChocolateChipElementArray; + + /** + * Check the current matched set of elements against a selector or element and return it + * if it does not match the given arguments. + * + * @param selector A string containing a selector expression to match elements against. + * @ return HTMLElement[] + */ + isnt(selector: string): ChocolateChipElementArray; + + /** + * Check the current matched set of elements against a selector or element and return it + * if it does not match the given arguments. + * + * @param elements One or more elements to match the current set of elements against. + * @ return HTMLElement[] + */ + isnt(element: any): ChocolateChipElementArray; + + /** + * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element. + * + * @param selector A string containing a selector expression to match elements against. + * @ return HTMLElement[] + */ + has(selector: string): ChocolateChipElementArray; + + /** + * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element. + * + * @param contained A DOM element to match elements against. + * @ return HTMLElement[] + */ + has(contained: HTMLElement): ChocolateChipElementArray; + + /** + * Reduce the set of matched elements to those that have a descendant that does not match the selector or DOM element. + * + * @param selector A string containing a selector expression to match elements against. + * @ return HTMLElement[] + */ + hasnt(selector: string): ChocolateChipElementArray; + + /** + * Reduce the set of matched elements to those that have a descendant that does not match the selector or DOM element. + * + * @param contained A DOM element to match elements against. + * @ return HTMLElement[] + */ + hasnt(contained: HTMLElement): ChocolateChipElementArray; + + /** + * Same overload as is present in the base type + */ + find(predicate: (value: HTMLElement, index: number, obj: HTMLElement[]) => boolean, thisArg?: any): HTMLElement; + + /** + * Get the descendants of each element in the current set of matched elements, filtered by a selector or element. + * + * @param selector A string containing a selector expression to match elements against. + * @ return HTMLElement[] + */ + find(selector: string): ChocolateChipElementArray; + + /** + * Get the descendants of each element in the current set of matched elements, filtered by a selector or element. + * + * @param element An element to match elements against. + * @ return HTMLElement[] + */ + find(element: HTMLElement): ChocolateChipElementArray; + + /** + * Get the immediately preceding sibling of each element in the set of matched elements. + * + * @ return HTMLElement[] + */ + prev(): ChocolateChipElementArray; + + /** + * Get the immediately following sibling of each element in the set of matched elements. + * + * @ return HTMLElement[] + */ + next(): ChocolateChipElementArray; + + /** + * Reduce the set of matched elements to the first in the set. + */ + first(): ChocolateChipElementArray; + + /** + * Reduce the set of matched elements to the last in the set. + * + * @return HTMLElement[] + */ + last(): ChocolateChipElementArray; + + /** + * Get the children of each element in the set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + * @return HTMLElement[] + */ + children(selector?: string): ChocolateChipElementArray; + + /** + * Get the parent of each element in the current set of matched elements, optionally filtered by a selector. + * If multiple elements have the same parent, only one instance of the parent is returned. + * + * @param selector A string containing a selector expression to match elements against. + * @return HTMLElement[] + */ + parent(selector?: string): ChocolateChipElementArray; + + /** + * For each element in the set, get the first element that matches the selector by testing the element + * itself and traversing up through its ancestors in the DOM tree, or, if a number is provided, + * retrieving that ancestor based on its distance from the element. + * + * @param selector A string containing a selector expression to match elements against. + * @return HTMLElement[] + */ + ancestor(selector: string | number): ChocolateChipElementArray; + + /** + * For each element in the set, get the first element that matches the selector by testing the element + * itself and traversing up through its ancestors in the DOM tree. + * + * @param selector A string containing a selector expression to match elements against. + * @return HTMLElement[] + */ + closest(selector: string | number): ChocolateChipElementArray; + + /** + * Get the siblings of each element in the set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + * @return HTMLElement[] + */ + siblings(selector?: string): ChocolateChipElementArray; + + /** + * Get the HTML contents of the first element in the set of matched elements. + * + * @return HTMLElement[] + */ + html(): ChocolateChipElementArray; + + /** + * Set the HTML contents of each element in the set of matched elements. + * + * @param htmlString A string of HTML to set as the content of each matched element. + * @return HTMLElement[] + */ + html(htmlString: string): ChocolateChipElementArray; + + /** + * Get the value of style properties for the first element in the set of matched elements. + * + * @param propertyName A CSS property. + * @return string + */ + css(propertyName: string): string; + + /** + * Set one or more CSS properties for the set of matched elements using a quoted string. + * + * @param propertyName A CSS property name. + * @param value A value to set for the property. + * @return HTMLElement[] + */ + css(propertyName: string, value: string): ChocolateChipElementArray; + + /** + * Set one or more CSS properties for the set of matched elements. + * + * @param properties An object of property-value pairs to set. + * @return HTMLElement[] + */ + css(properties: Object): ChocolateChipElementArray; + + /** + * Get the value of an attribute for the first element in the set of matched elements. + * + * @param attributeName The name of the attribute to get. + * @return string + */ + attr(attributeName: string): string; + + /** + * Set an attribute for the set of matched elements. + * + * @param attributeName A string indicating the attribute to set. + * @param value A string indicating the value to set the attribute to. + * @return HTMLElement[] + */ + attr(attributeName: string, value: string): ChocolateChipElementArray; + + /** + * Remove an attribute from a node. + * + * @param attributeName A string indicating the attribute to remove. + * @return HTMLElement[] + */ + removeAttr(attributeName: string): ChocolateChipElementArray; + + /** + * Return any of the matched elements that have the given attribute. + * + * @param className The class name to search for. + * @return HTMLElement[] + */ + hasAttr(attributeName: string): ChocolateChipElementArray; + + /** + * Test whether an attribute exists on the first element in the set of matched elements. The value returned is a boolean. + * + * @param attributeName The name of the attribute to get. + * @return boolean + */ + prop(propertyName: string): boolean; + + /** + * Set an property for the set of matched elements. + * + * @param propertyName A string indicating the property to set. + * @param value A string indicating the value to set the property to. + * @return HTMLElement[] + */ + prop(propertyName: string, value: any | boolean): ChocolateChipElementArray; + + /** + * Remove an element property. + * + * @param property The property to remove. + * @return HTMLElement[] + */ + removeProp(property: string): ChocolateChipElementArray; + + /** + * Adds the specified class(es) to each of the set of matched elements. + * + * @param className One or more space-separated classes to be added to the class attribute of each matched element. + * @return HTMLElement[] + */ + addClass(className: string): ChocolateChipElementArray; + + /** + * Remove a single class or multiple classes from each element in the set of matched elements. + * + * @param className One or more space-separated classes to be removed from the class attribute of each matched element. + * @return HTMLElement[] + */ + removeClass(className?: string): ChocolateChipElementArray; + + /** + * Add or remove a classe from each element in the set of matched elements, depending on whether the class is present or not. + * + * @param className One or more class names (separated by spaces) to be toggled for each element in the matched set. + * @return HTMLElement[] + */ + toggleClass(className: string, swtch?: boolean): ChocolateChipElementArray; + + /** + * Return any of the matched elements that have the given class. + * + * @param className The class name to search for. + * @return HTMLElement[] + */ + hasClass(className: string): ChocolateChipElementArray; + + /** + * Store arbitrary data associated with the matched elements. + * + * @param key A string naming the piece of data to set. + * @param value The new data value; it can be any Javascript type including Array or Object. + * @return HTMLElement[] + */ + data(key: string, value: any): ChocolateChipElementArray; + + /** + * Return the value at the named data store for the first element in the element collection, as set by + * data(name). + * + * @param key Name of the data stored. + * @return any + */ + data(key: string): any; + + /** + * Remove the value at the named data store for the first element in the element collection, as set by data(name, value). + * + * @param key Name of the data stored. + * @return any + */ + removeData(key?: string): any; + + /** + * Store string data associated with the matched elements. + * + * @param key A string naming the piece of data to set. + * @param value The new data value; it must be a string. You can convert JSON into a string to use with this. + * @return HTMLElement[] + */ + dataset(key: string, value: any): ChocolateChipElementArray; + + /** + * Retrieve a dataset key's value for the first element in the element collection. + * + * @param key A string naming the piece of data to set. + * @return HTMLElement[] + */ + dataset(key: string): ChocolateChipElementArray; + + /** + * Return the value at the named data store for the first element in the element collection, as set by data(name, value). + * + * @param key Name of the data stored. + * @return any + */ + data(key: string): any; + + /** + * Store arbitrary data associated with the matched element. + * + * @param key A string naming the piece of data to set. + * @param value The new data value; it can be any Javascript type including Array or Object. + * @return HTMLElement[] + */ + data(key: string, value?: any): ChocolateChipElementArray; + + /** + * Get the current value of the first element in the set of matched elements. + */ + val(): any; + + /** + * Set the value of each element in the set of matched elements. + * + * @param value A string of text or an array of strings corresponding to the value of each matched element + * to set as selected/checked. + * @return any + */ + val(value: string): ChocolateChipElementArray; + + /** + * Set the property of an element to enabled by removing the "disabled" attribute. + * + * @return HTMLElement[] + */ + enable(): ChocolateChipElementArray; + + /** + * Set the property of an element to "disabled". + * + * @return HTMLElement[] + */ + disable(): ChocolateChipElementArray; + + /** + * Display the matched elements. + * + * @param speed A string or number determining how long the animation will run. + * @param callback A function to call once the animation is complete. + * @return HTMLElement[] + */ + show(duration?: number | string, callback?: Function): ChocolateChipElementArray; + + /** + * Hide the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param callback A function to call once the animation is complete. + * @return HTMLElement[] + */ + hide(duration?: number | string, callback?: Function): ChocolateChipElementArray; + + /** + * Insert content, specified by the parameter, before each element in the set of matched elements. + * + * @param content HTML string, DOM element, array of elements to insert before each element in the set of matched elements. + * @return HTMLElement[] + */ + before(content: ChocolateChipElementArray | HTMLElement | string): ChocolateChipElementArray; + + /** + * Insert content, specified by the parameter, after each element in the set of matched elements. + * + * @param content HTML string, DOM element, array of elements to insert after each element in the set of matched elements. + * @return HTMLElement[] + */ + after(content: ChocolateChipElementArray | HTMLElement | string): ChocolateChipElementArray; + + /** + * Insert content, specified by the parameter, to the end of each element in the set of matched elements. + * + * @param content DOM element, array of elements, or HTML string to insert at the end of each element in the set + * of matched elements. + * @return HTMLElement[] + */ + append(content: ChocolateChipElementArray | HTMLElement | Text | string): ChocolateChipElementArray; + + /** + * Insert content, specified by the parameter, at the beginning of each element in the set of matched elements. + * + * @param content DOM element, array of elements, or HTML string to insert at the beginning of each element in the set of matched elements. + * @return HTMLElement[] + */ + prepend(content: ChocolateChipElementArray | HTMLElement | Text | string): ChocolateChipElementArray; + + /** + * Insert every element in the set of matched elements to the beginning of the target. + * + * @param target A selector, element, or HTML string. The matched set of elements will be inserted at the beginning of the element specified by this parameter. + * @return HTMLElement[] + */ + prependTo(target: any[] | HTMLElement | string): ChocolateChipElementArray; + + /** + * Insert every element in the set of matched elements to the end of the target. + * + * @param target A selector, element, or HTML string. The matched set of elements will be inserted at the end of the element specified by this parameter. + * If no position value is provided it will simply append the content to the target. + * @return HTMLElement[] + */ + appendTo(target: any[] | HTMLElement | string): ChocolateChipElementArray; + + /** + * Insert element(s) into the target element. + * + * @return HTMLElement[] + */ + insert(content: string, position?: number | string): ChocolateChipElementArray; + + /** + * Create a copy of the set of matched elements. + * + * @param value A Boolean indicating whether to copy the element(s) with their children. A true value copies the children. + * @return HTMLElement[] + */ + clone(value?: boolean): ChocolateChipElementArray; + + /** + * Wrap an HTML structure around each element in the set of matched elements. + * + * @param wrappingElement A selector or HTML string specifying the structure to wrap around the matched elements. + * @return HTMLElement[] + */ + wrap(wrappingElement: string): ChocolateChipElementArray; + + /** + * Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place. + * + * @return HTMLElement[] + */ + unwrap(): ChocolateChipElementArray; + + /** + * Remove the set of matched elements from the DOM. If there are any attached events, this will remove them to prevent memory leaks. + * + * @param selector A selector expression that filters the set of matched elements to be removed. + * @return HTMLElement[] + */ + remove(selector?: string): ChocolateChipElementArray; + + /** + * Remove all child nodes of the set of matched elements from the DOM. + * + * @return HTMLElement[] + */ + empty(): ChocolateChipElementArray; + + /** + * Get an object of the current coordinates of the first element in the set of matched elements, relative to the document. + * These are: top, left, bottom and right. The values are numbers representing pixel values. + * @return Object + */ + offset(): { + top: number; + bottom: number; + left: number; + right: number; + }; + + /** + * Get the current computed width for the first element in the set of matched elements, + * including padding but excluding borders. + * + * @return number + */ + width(): number; + + /** + * Get the current computed height for the first element in the set of matched elements, + * including padding but excluding borders. + * + * @return number + */ + height(): number; + + /** + * Get the combined text contents of each element in the set of matched elements, including their descendants. + * + * @return string + */ + text(): string; + + /** + * Set the content of each element in the set of matched elements to the specified text. + * + * @param text + * The text to set as the content of each matched element. + * When Number is supplied, it will be converted to a String representation. + * To delete text, use ChocolateChipElementArray.empty() or ChocolateChipElementArray.remove(). + * @return HTMLElement + */ + text(text: string | number): HTMLElement; + + /** + * A method to animate DOM nodes using CSS. This uses CSS transitions. + * + * @param options And object of key value pairs define the CSS properties and values to animate. + * @param duration A string representing the time. Should have a time identifier: "200s", "200ms", etc. + * @param easing A string indicating the easing for the animation, such as "ease-out", "ease-in", "ease-in-out". + * @return void + */ + animate(options: Object, duration?: string, easing?: string): void; + + /** + * Attach a handler to an event for the elements. + * + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param handler A function to execute each time the event is triggered. + * @param useCapture Setting the third argument to true will trigger event bubbling. The default is false. + * @return ChocolateChipStatic + */ + bind(eventType: string, handler: (eventObject: Event) => any, useCapture?: boolean): ChocolateChipStatic; + + /** + * Remove a handler for an event from the elements. + * + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param handler A function to execute each time the event is triggered. + * @param useCapture Setting the third argument to true will trigger event bubbling. The default is false. + * @return ChocolateChipStatic + */ + unbind(eventType?: string, handler?: (eventObject: Event) => any, useCapture?: boolean): ChocolateChipStatic; + + /** + * Add a delegated event to listen for the provided event on the descendant elements. + * + * @param selector A string defining the descendant elements to listen on for the designated event. + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param handler A function to execute each time the event is triggered. The keyword "this" will refer + * to the element receiving the event. + * @param useCapture Setting the third argument to true will trigger event bubbling. The default is false. + * @return ChocolateChipStatic + */ + delegate(selector: any, eventType: string, handler: (eventObject: Event) => any, useCapture?: boolean): ChocolateChipStatic; + + /** + * Add a delegated event to listen for the provided event on the descendant elements. + * + * @param selector A string defining the descendant elements are listening for the event. + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param handler A function handler assigned to this event. + * @param useCapture Setting the third argument to true will trigger event bubbling. The default is false. + * @return ChocolateChipStatic + */ + undelegate(selector?: any, eventType?: string, handler?: (eventObject: Event) => any, useCapture?: boolean): ChocolateChipStatic; + + /** + * Add a handler to an event for elements. If a selector is provided as the second argument, this implements a delegated event. + * + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param selector A string defining the descendant elements are listening for the event. + * @param handler A function handler assigned to this event. + * @param useCapture Setting the third argument to true will trigger event bubbling. The default is false. + * @return ChocolateChipStatic + */ + on(eventType: string, selector: any, handler?: (eventObject: Event) => any, capturePhase?: boolean): ChocolateChipStatic; + + /** + * Remove a handler for an event from the elements. If the second argument is a selector, it tries to undelegate the event. + * If no arugments are provided, it removes all events from the element(s). + * + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param selector A string defining the descendant elements are listening for the event. + * @param handler A function handler assigned to this event. + * @param useCapture Setting the third argument to true will trigger event bubbling. The default is false. + * @return ChocolateChipStatic + */ + off(eventType?: string, selector?: any, handler?: (eventObject: Event) => any, capturePhase?: boolean): ChocolateChipStatic; + + /** + * Trigger an event on an element. + * + * @param eventType The event to trigger. + * @return void + */ + trigger(eventType: string): void; +} + +type DOMString = string; +type OpenEndedDictionary = Object; + +/** + * Headers Interface. This defines the methods exposed by the Headers object. + */ +interface Headers { + (headers?: any): void; + append(name: string, value: string): void; + delete(name: string): any; + get(name: string): any; + getAll(name: string): any; + has(name: string): any; + set(name: string, value: string): any; + forEach(callback: Function, thisArg: any): any; +} + +interface RequestInit { + timeout?: number; +} + +interface ChocolateChipStatic { + /** + * A cache to hold callbacks execute by the response from a JSONP request. + * This is an array of strings. + * By default these values get purged when the callback execute and exposes the data returned by the request. + */ + JSONPCallbacks: string[]; + /** + * Method to perform JSONP request. + * + * @param url A string defining the url to target. + * @param options And object literal of properties: {timeout? number, callbackName?: string, clear?: boolean} + */ + jsonp(url: string, options?: { + /** + * A number representing milliseconds to express when to refect a JSONP request. + */ + timeout?: number; + + /** + * The optional name for the callback when the server response will execute. + * The default value is "callback". + * However some sites may use a different name for their JSONP function. + * Consult the documentation on the site to ascertain the correct value for this callback. + */ + callbackName?: string; + + /** + * This value determines whether the callbacks and script associate with JSONP persist or are purged after the request returns. By default this is set to true, meaning that they will be purged. + */ + clear?: boolean; + }): any; +} + +interface Window { + chocolatechipjs: ChocolateChipStatic; + $: ChocolateChipStatic; + jsonp: any; +} +declare var $: ChocolateChipStatic; + +declare var chocolatechipjs: ChocolateChipStatic; diff --git a/chocolatechipjs/tsconfig.json b/types/chocolatechipjs/tsconfig.json similarity index 100% rename from chocolatechipjs/tsconfig.json rename to types/chocolatechipjs/tsconfig.json diff --git a/types/chocolatechipjs/tslint.json b/types/chocolatechipjs/tslint.json new file mode 100644 index 0000000000..e502fddef8 --- /dev/null +++ b/types/chocolatechipjs/tslint.json @@ -0,0 +1,10 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + // TODOs + "adjacent-overload-signatures": false, + "ban-types": false, + "only-arrow-functions": false, + "unified-signatures": false + } +} diff --git a/types/chokidar/chokidar-tests.ts b/types/chokidar/chokidar-tests.ts new file mode 100644 index 0000000000..13e5fe6a90 --- /dev/null +++ b/types/chokidar/chokidar-tests.ts @@ -0,0 +1,57 @@ +import * as fs from 'fs'; +import chokidar = require('chokidar'); + +const watcher = chokidar.watch('file, dir, or glob', { + ignored: /[\/\\]\./, persistent: true +}); + +const log = console.log.bind(console); + +watcher + .on('add', (path: string) => { + log('File', path, 'has been added'); + }) + .on('addDir', (path: string) => { + log('Directory', path, 'has been added'); + }) + .on('change', (path: string) => { + log('File', path, 'has been changed'); + }) + .on('unlink', (path: string) => { + log('File', path, 'has been removed'); + }) + .on('unlinkDir', (path: string) => { + log('Directory', path, 'has been removed'); + }) + .on('error', (error: any) => { + log('Error happened', error); + }) + .on('ready', () => { + log('Initial scan complete. Ready for changes.'); + }) + .on('raw', (event: string, path: string, details: any) => { + log('Raw event info:', event, path, details); + }); + +// 'add', 'addDir' and 'change' events also receive stat() results as second +// argument when available: http://nodejs.org/api/fs.html#fs_class_fs_stats +watcher.on('change', (path: string, stats: fs.Stats) => { + if (stats) { + console.log('File', path, 'changed size to', stats.size); + } +}); + +// Watch new files. +watcher.add('new-file'); +watcher.add(['new-file-2', 'new-file-3', '**/other-file*']); + +// Un-watch some files. +watcher.unwatch('new-file*'); + +// Only needed if watching is `persistent: true`. +watcher.close(); + +// One-liner +chokidar.watch('.', { ignored: /[\/\\]\./ }).on('all', (event: string, path: string) => { + console.log(event, path); +}); diff --git a/types/chokidar/index.d.ts b/types/chokidar/index.d.ts new file mode 100644 index 0000000000..dd0569656c --- /dev/null +++ b/types/chokidar/index.d.ts @@ -0,0 +1,160 @@ +// Type definitions for chokidar 1.6.1 +// Project: https://github.com/paulmillr/chokidar +// Definitions by: Stefan Steinhart , Felix Becker +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import * as fs from 'fs'; +import {EventEmitter} from 'events'; + +/** + * The object's keys are all the directories (using absolute paths unless the `cwd` option was + * used), and the values are arrays of the names of the items contained in each directory. + */ +export interface WatchedPaths { + [directory: string]: string[]; +} + +export class FSWatcher extends EventEmitter implements fs.FSWatcher { + + /** + * Add files, directories, or glob patterns for tracking. Takes an array of strings or just one + * string. + */ + add(paths: string | string[]): void; + + /** + * Stop watching files, directories, or glob patterns. Takes an array of strings or just one + * string. + */ + unwatch(paths: string | string[]): void; + + /** + * Returns an object representing all the paths on the file system being watched by this + * `FSWatcher` instance. The object's keys are all the directories (using absolute paths unless + * the `cwd` option was used), and the values are arrays of the names of the items contained in + * each directory. + */ + getWatched(): WatchedPaths; + + /** + * Removes all listeners from watched files. + */ + close(): void; +} + +export interface WatchOptions { + + /** + * Indicates whether the process should continue to run as long as files are being watched. If + * set to `false` when using `fsevents` to watch, no more events will be emitted after `ready`, + * even if the process continues to run. + */ + persistent?: boolean; + + /** + * ([anymatch](https://github.com/es128/anymatch)-compatible definition) Defines files/paths to + * be ignored. The whole relative or absolute path is tested, not just filename. If a function + * with two arguments is provided, it gets called twice per path - once with a single argument + * (the path), second time with two arguments (the path and the + * [`fs.Stats`](http://nodejs.org/api/fs.html#fs_class_fs_stats) object of that path). + */ + ignored?: any; + + /** + * If set to `false` then `add`/`addDir` events are also emitted for matching paths while + * instantiating the watching as chokidar discovers these file paths (before the `ready` event). + */ + ignoreInitial?: boolean; + + /** + * When `false`, only the symlinks themselves will be watched for changes instead of following + * the link references and bubbling events through the link's path. + */ + followSymlinks?: boolean; + + /** + * The base directory from which watch `paths` are to be derived. Paths emitted with events will + * be relative to this. + */ + cwd?: string; + + /** + * Whether to use fs.watchFile (backed by polling), or fs.watch. If polling leads to high CPU + * utilization, consider setting this to `false`. It is typically necessary to **set this to + * `true` to successfully watch files over a network**, and it may be necessary to successfully + * watch files in other non-standard situations. Setting to `true` explicitly on OS X overrides + * the `useFsEvents` default. + */ + usePolling?: boolean; + + /** + * Whether to use the `fsevents` watching interface if available. When set to `true` explicitly + * and `fsevents` is available this supercedes the `usePolling` setting. When set to `false` on + * OS X, `usePolling: true` becomes the default. + */ + useFsEvents?: boolean; + + /** + * If relying upon the [`fs.Stats`](http://nodejs.org/api/fs.html#fs_class_fs_stats) object that + * may get passed with `add`, `addDir`, and `change` events, set this to `true` to ensure it is + * provided even in cases where it wasn't already available from the underlying watch events. + */ + alwaysStat?: boolean; + + /** + * If set, limits how many levels of subdirectories will be traversed. + */ + depth?: number; + + /** + * Interval of file system polling. + */ + interval?: number; + + /** + * Interval of file system polling for binary files. ([see list of binary extensions](https://gi + * thub.com/sindresorhus/binary-extensions/blob/master/binary-extensions.json)) + */ + binaryInterval?: number; + + /** + * Indicates whether to watch files that don't have read permissions if possible. If watching + * fails due to `EPERM` or `EACCES` with this set to `true`, the errors will be suppressed + * silently. + */ + ignorePermissionErrors?: boolean; + + /** + * `true` if `useFsEvents` and `usePolling` are `false`). Automatically filters out artifacts + * that occur when using editors that use "atomic writes" instead of writing directly to the + * source file. If a file is re-added within 100 ms of being deleted, Chokidar emits a `change` + * event rather than `unlink` then `add`. If the default of 100 ms does not work well for you, + * you can override it by setting `atomic` to a custom value, in milliseconds. + */ + atomic?: boolean | number; + + /** + * can be set to an object in order to adjust timing params: + */ + awaitWriteFinish?: AwaitWriteFinishOptions; +} + +export interface AwaitWriteFinishOptions { + + /** + * Amount of time in milliseconds for a file size to remain constant before emitting its event. + */ + stabilityThreshold?: number; + + /** + * File size polling interval. + */ + pollInterval?: number; +} + +/** + * produces an instance of `FSWatcher`. + */ +export function watch(paths: string | string[], options?: WatchOptions): FSWatcher; diff --git a/chokidar/tsconfig.json b/types/chokidar/tsconfig.json similarity index 100% rename from chokidar/tsconfig.json rename to types/chokidar/tsconfig.json diff --git a/chosen-js/chosen-js-tests.ts b/types/chosen-js/chosen-js-tests.ts similarity index 100% rename from chosen-js/chosen-js-tests.ts rename to types/chosen-js/chosen-js-tests.ts diff --git a/chosen-js/index.d.ts b/types/chosen-js/index.d.ts similarity index 100% rename from chosen-js/index.d.ts rename to types/chosen-js/index.d.ts diff --git a/chosen-js/tsconfig.json b/types/chosen-js/tsconfig.json similarity index 100% rename from chosen-js/tsconfig.json rename to types/chosen-js/tsconfig.json diff --git a/chroma-js/chroma-js-tests.ts b/types/chroma-js/chroma-js-tests.ts similarity index 100% rename from chroma-js/chroma-js-tests.ts rename to types/chroma-js/chroma-js-tests.ts diff --git a/chroma-js/index.d.ts b/types/chroma-js/index.d.ts similarity index 100% rename from chroma-js/index.d.ts rename to types/chroma-js/index.d.ts diff --git a/chroma-js/tsconfig.json b/types/chroma-js/tsconfig.json similarity index 100% rename from chroma-js/tsconfig.json rename to types/chroma-js/tsconfig.json diff --git a/chroma-js/v0/chroma-js-tests.ts b/types/chroma-js/v0/chroma-js-tests.ts similarity index 100% rename from chroma-js/v0/chroma-js-tests.ts rename to types/chroma-js/v0/chroma-js-tests.ts diff --git a/chroma-js/v0/index.d.ts b/types/chroma-js/v0/index.d.ts similarity index 100% rename from chroma-js/v0/index.d.ts rename to types/chroma-js/v0/index.d.ts diff --git a/chroma-js/v0/tsconfig.json b/types/chroma-js/v0/tsconfig.json similarity index 100% rename from chroma-js/v0/tsconfig.json rename to types/chroma-js/v0/tsconfig.json diff --git a/chrome/chrome-app.d.ts b/types/chrome/chrome-app.d.ts similarity index 100% rename from chrome/chrome-app.d.ts rename to types/chrome/chrome-app.d.ts diff --git a/chrome/chrome-cast.d.ts b/types/chrome/chrome-cast.d.ts similarity index 100% rename from chrome/chrome-cast.d.ts rename to types/chrome/chrome-cast.d.ts diff --git a/types/chrome/index.d.ts b/types/chrome/index.d.ts new file mode 100644 index 0000000000..8fe0f9b993 --- /dev/null +++ b/types/chrome/index.d.ts @@ -0,0 +1,7726 @@ +// Type definitions for Chrome extension development +// Project: http://developer.chrome.com/extensions/ +// Definitions by: Matthew Kimber , otiai10 , couven92 , RReverser , sreimer15 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +//////////////////// +// Global object +//////////////////// +interface Window { + chrome: typeof chrome; +} + +//////////////////// +// Accessibility Features +//////////////////// +/** + * Use the chrome.accessibilityFeatures API to manage Chrome's accessibility features. This API relies on the ChromeSetting prototype of the type API for getting and setting individual accessibility features. In order to get feature states the extension must request accessibilityFeatures.read permission. For modifying feature state, the extension needs accessibilityFeatures.modify permission. Note that accessibilityFeatures.modify does not imply accessibilityFeatures.read permission. + * Availability: Since Chrome 37. + * Permissions: "accessibilityFeatures.read" + * Important: This API works only on Chrome OS. + */ +declare namespace chrome.accessibilityFeatures { + interface AccessibilityFeaturesGetArg { + /** Optional. Whether to return the value that applies to the incognito session (default false). */ + incognito?: boolean; + } + + interface AccessibilityFeaturesCallbackArg { + /** The value of the setting. */ + value: any; + /** + * One of + * • not_controllable: cannot be controlled by any extension + * • controlled_by_other_extensions: controlled by extensions with higher precedence + * • controllable_by_this_extension: can be controlled by this extension + * • controlled_by_this_extension: controlled by this extension + */ + levelOfControl: string; + /** Optional. Whether the effective value is specific to the incognito session. This property will only be present if the incognito property in the details parameter of get() was true. */ + incognitoSpecific?: boolean; + } + + interface AccessibilityFeaturesSetArg { + /** + * The value of the setting. + * Note that every setting has a specific value type, which is described together with the setting. An extension should not set a value of a different type. + */ + value: any; + /** + * Optional. + * The scope of the ChromeSetting. One of + * • regular: setting for the regular profile (which is inherited by the incognito profile if not overridden elsewhere), + * • regular_only: setting for the regular profile only (not inherited by the incognito profile), + * • incognito_persistent: setting for the incognito profile that survives browser restarts (overrides regular preferences), + * • incognito_session_only: setting for the incognito profile that can only be set during an incognito session and is deleted when the incognito session ends (overrides regular and incognito_persistent preferences). + */ + scope?: string; + } + + interface AccessibilityFeaturesClearArg { + /** + * Optional. + * The scope of the ChromeSetting. One of + * • regular: setting for the regular profile (which is inherited by the incognito profile if not overridden elsewhere), + * • regular_only: setting for the regular profile only (not inherited by the incognito profile), + * • incognito_persistent: setting for the incognito profile that survives browser restarts (overrides regular preferences), + * • incognito_session_only: setting for the incognito profile that can only be set during an incognito session and is deleted when the incognito session ends (overrides regular and incognito_persistent preferences). + */ + scope?: string; + } + + interface AccessibilityFeaturesSetting { + /** + * Gets the value of a setting. + * @param details Which setting to consider. + * @param callback The callback parameter should be a function that looks like this: + * function(object details) {...}; + */ + get(details: AccessibilityFeaturesGetArg, callback: (details: AccessibilityFeaturesCallbackArg) => void): void; + /** + * Sets the value of a setting. + * @param details Which setting to change. + * @param callback Called at the completion of the set operation. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + set(details: AccessibilityFeaturesSetArg, callback?: () => void): void; + /** + * Clears the setting, restoring any default value. + * @param details Which setting to clear. + * @param callback Called at the completion of the clear operation. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + clear(details: AccessibilityFeaturesClearArg, callback?: () => void): void; + } + + var spokenFeedback: AccessibilityFeaturesSetting; + var largeCursor: AccessibilityFeaturesSetting; + var stickyKeys: AccessibilityFeaturesSetting; + var highContrast: AccessibilityFeaturesSetting; + var screenMagnifier: AccessibilityFeaturesSetting; + var autoclick: AccessibilityFeaturesSetting; + var virtualKeyboard: AccessibilityFeaturesSetting; + var animationPolicy: AccessibilityFeaturesSetting; +} + +//////////////////// +// Alarms +//////////////////// +/** + * Use the chrome.alarms API to schedule code to run periodically or at a specified time in the future. + * Availability: Since Chrome 22. + * Permissions: "alarms" + */ +declare namespace chrome.alarms { + interface AlarmCreateInfo { + /** Optional. Length of time in minutes after which the onAlarm event should fire. */ + delayInMinutes?: number; + /** Optional. If set, the onAlarm event should fire every periodInMinutes minutes after the initial event specified by when or delayInMinutes. If not set, the alarm will only fire once. */ + periodInMinutes?: number; + /** Optional. Time at which the alarm should fire, in milliseconds past the epoch (e.g. Date.now() + n). */ + when?: number; + } + + interface Alarm { + /** Optional. If not null, the alarm is a repeating alarm and will fire again in periodInMinutes minutes. */ + periodInMinutes?: number; + /** Time at which this alarm was scheduled to fire, in milliseconds past the epoch (e.g. Date.now() + n). For performance reasons, the alarm may have been delayed an arbitrary amount beyond this. */ + scheduledTime: number; + /** Name of this alarm. */ + name: string; + } + + interface AlarmEvent extends chrome.events.Event<(alarm: Alarm) => void> {} + + /** + * Creates an alarm. Near the time(s) specified by alarmInfo, the onAlarm event is fired. If there is another alarm with the same name (or no name if none is specified), it will be cancelled and replaced by this alarm. + * In order to reduce the load on the user's machine, Chrome limits alarms to at most once every 1 minute but may delay them an arbitrary amount more. That is, setting delayInMinutes or periodInMinutes to less than 1 will not be honored and will cause a warning. when can be set to less than 1 minute after "now" without warning but won't actually cause the alarm to fire for at least 1 minute. + * To help you debug your app or extension, when you've loaded it unpacked, there's no limit to how often the alarm can fire. + * @param alarmInfo Describes when the alarm should fire. The initial time must be specified by either when or delayInMinutes (but not both). If periodInMinutes is set, the alarm will repeat every periodInMinutes minutes after the initial event. If neither when or delayInMinutes is set for a repeating alarm, periodInMinutes is used as the default for delayInMinutes. + */ + export function create(alarmInfo: AlarmCreateInfo): void; + /** + * Creates an alarm. Near the time(s) specified by alarmInfo, the onAlarm event is fired. If there is another alarm with the same name (or no name if none is specified), it will be cancelled and replaced by this alarm. + * In order to reduce the load on the user's machine, Chrome limits alarms to at most once every 1 minute but may delay them an arbitrary amount more. That is, setting delayInMinutes or periodInMinutes to less than 1 will not be honored and will cause a warning. when can be set to less than 1 minute after "now" without warning but won't actually cause the alarm to fire for at least 1 minute. + * To help you debug your app or extension, when you've loaded it unpacked, there's no limit to how often the alarm can fire. + * @param name Optional name to identify this alarm. Defaults to the empty string. + * @param alarmInfo Describes when the alarm should fire. The initial time must be specified by either when or delayInMinutes (but not both). If periodInMinutes is set, the alarm will repeat every periodInMinutes minutes after the initial event. If neither when or delayInMinutes is set for a repeating alarm, periodInMinutes is used as the default for delayInMinutes. + */ + export function create(name: string, alarmInfo: AlarmCreateInfo): void; + /** + * Gets an array of all the alarms. + * @param callback The callback parameter should be a function that looks like this: + * function(array of Alarm alarms) {...}; + */ + export function getAll(callback: (alarms: Alarm[]) => void): void; + /** + * Clears all alarms. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function(boolean wasCleared) {...}; + */ + export function clearAll(callback?: (wasCleared: boolean) => void): void; + /** + * Clears the alarm with the given name. + * @param name The name of the alarm to clear. Defaults to the empty string. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function(boolean wasCleared) {...}; + */ + export function clear(name?: string, callback?: (wasCleared: boolean) => void): void; + /** + * Clears the alarm without a name. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function(boolean wasCleared) {...}; + */ + export function clear(callback: (wasCleared: boolean) => void): void; + /** + * Retrieves details about the specified alarm. + * @param callback The callback parameter should be a function that looks like this: + * function( Alarm alarm) {...}; + */ + export function get(callback: (alarm: Alarm) => void): void; + /** + * Retrieves details about the specified alarm. + * @param name The name of the alarm to get. Defaults to the empty string. + * @param callback The callback parameter should be a function that looks like this: + * function( Alarm alarm) {...}; + */ + export function get(name: string, callback: (alarm: Alarm) => void): void; + + /** Fired when an alarm has elapsed. Useful for event pages. */ + var onAlarm: AlarmEvent; +} + +/** + * Use the chrome.browser API to interact with the Chrome browser associated with + * the current application and Chrome profile. + */ +declare namespace chrome.browser { + interface Options { + /** The URL to navigate to when the new tab is initially opened. */ + url: string; + } + + /** + * Opens a new tab in a browser window associated with the current application + * and Chrome profile. If no browser window for the Chrome profile is opened, + * a new one is opened prior to creating the new tab. + * @param options Configures how the tab should be opened. + * @param callback Called when the tab was successfully + * created, or failed to be created. If failed, runtime.lastError will be set. + */ + export function openTab(options: Options, callback: () => void): void; + + /** + * Opens a new tab in a browser window associated with the current application + * and Chrome profile. If no browser window for the Chrome profile is opened, + * a new one is opened prior to creating the new tab. Since Chrome 42 only. + * @param options Configures how the tab should be opened. + */ + export function openTab(options: Options): void; +} + +//////////////////// +// Bookmarks +//////////////////// +/** + * Use the chrome.bookmarks API to create, organize, and otherwise manipulate bookmarks. Also see Override Pages, which you can use to create a custom Bookmark Manager page. + * Availability: Since Chrome 5. + * Permissions: "bookmarks" + */ +declare namespace chrome.bookmarks { + /** A node (either a bookmark or a folder) in the bookmark tree. Child nodes are ordered within their parent folder. */ + interface BookmarkTreeNode { + /** Optional. The 0-based position of this node within its parent folder. */ + index?: number; + /** Optional. When this node was created, in milliseconds since the epoch (new Date(dateAdded)). */ + dateAdded?: number; + /** The text displayed for the node. */ + title: string; + /** Optional. The URL navigated to when a user clicks the bookmark. Omitted for folders. */ + url?: string; + /** Optional. When the contents of this folder last changed, in milliseconds since the epoch. */ + dateGroupModified?: number; + /** The unique identifier for the node. IDs are unique within the current profile, and they remain valid even after the browser is restarted. */ + id: string; + /** Optional. The id of the parent folder. Omitted for the root node. */ + parentId?: string; + /** Optional. An ordered list of children of this node. */ + children?: BookmarkTreeNode[]; + /** + * Optional. + * Since Chrome 37. + * Indicates the reason why this node is unmodifiable. The managed value indicates that this node was configured by the system administrator or by the custodian of a supervised user. Omitted if the node can be modified by the user and the extension (default). + */ + unmodifiable?: any; + } + + interface BookmarkRemoveInfo { + index: number; + parentId: string; + } + + interface BookmarkMoveInfo { + index: number; + oldIndex: number; + parentId: string; + oldParentId: string; + } + + interface BookmarkChangeInfo { + url?: string; + title: string; + } + + interface BookmarkReorderInfo { + childIds: string[]; + } + + interface BookmarkRemovedEvent extends chrome.events.Event<(id: string, removeInfo: BookmarkRemoveInfo) => void> {} + + interface BookmarkImportEndedEvent extends chrome.events.Event<() => void> {} + + interface BookmarkMovedEvent extends chrome.events.Event<(id: string, moveInfo: BookmarkMoveInfo) => void> {} + + interface BookmarkImportBeganEvent extends chrome.events.Event<() => void> {} + + interface BookmarkChangedEvent extends chrome.events.Event<(id: string, changeInfo: BookmarkChangeInfo) => void> {} + + interface BookmarkCreatedEvent extends chrome.events.Event<(id: string, bookmark: BookmarkTreeNode) => void> {} + + interface BookmarkChildrenReordered extends chrome.events.Event<(id: string, reorderInfo: BookmarkReorderInfo) => void> {} + + interface BookmarkSearchQuery { + query?: string; + url?: string; + title?: string; + } + + interface BookmarkCreateArg { + /** Optional. Defaults to the Other Bookmarks folder. */ + parentId?: string; + index?: number; + title?: string; + url?: string; + } + + interface BookmarkDestinationArg { + parentId?: string; + index?: number; + } + + interface BookmarkChangesArg { + title?: string; + url?: string; + } + + /** @deprecated since Chrome 38. Bookmark write operations are no longer limited by Chrome. */ + var MAX_WRITE_OPERATIONS_PER_HOUR: number; + /** @deprecated since Chrome 38. Bookmark write operations are no longer limited by Chrome. */ + var MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE: number; + + /** + * Searches for BookmarkTreeNodes matching the given query. Queries specified with an object produce BookmarkTreeNodes matching all specified properties. + * @param query A string of words and quoted phrases that are matched against bookmark URLs and titles. + * @param callback The callback parameter should be a function that looks like this: + * function(array of BookmarkTreeNode results) {...}; + */ + export function search(query: string, callback: (results: BookmarkTreeNode[]) => void): void; + /** + * Searches for BookmarkTreeNodes matching the given query. Queries specified with an object produce BookmarkTreeNodes matching all specified properties. + * @param query An object with one or more of the properties query, url, and title specified. Bookmarks matching all specified properties will be produced. + * @param callback The callback parameter should be a function that looks like this: + * function(array of BookmarkTreeNode results) {...}; + */ + export function search(query: BookmarkSearchQuery, callback: (results: BookmarkTreeNode[]) => void): void; + /** + * Retrieves the entire Bookmarks hierarchy. + * @param callback The callback parameter should be a function that looks like this: + * function(array of BookmarkTreeNode results) {...}; + */ + export function getTree(callback: (results: BookmarkTreeNode[]) => void): void; + /** + * Retrieves the recently added bookmarks. + * @param numberOfItems The maximum number of items to return. + * @param callback The callback parameter should be a function that looks like this: + * function(array of BookmarkTreeNode results) {...}; + */ + export function getRecent(numberOfItems: number, callback: (results: BookmarkTreeNode[]) => void): void; + /** + * Retrieves the specified BookmarkTreeNode. + * @param id A single string-valued id + * @param callback The callback parameter should be a function that looks like this: + * function(array of BookmarkTreeNode results) {...}; + */ + export function get(id: string, callback: (results: BookmarkTreeNode[]) => void): void; + /** + * Retrieves the specified BookmarkTreeNode. + * @param idList An array of string-valued ids + * @param callback The callback parameter should be a function that looks like this: + * function(array of BookmarkTreeNode results) {...}; + */ + export function get(idList: string[], callback: (results: BookmarkTreeNode[]) => void): void; + /** + * Creates a bookmark or folder under the specified parentId. If url is NULL or missing, it will be a folder. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function( BookmarkTreeNode result) {...}; + */ + export function create(bookmark: BookmarkCreateArg, callback?: (result: BookmarkTreeNode) => void): void; + /** + * Moves the specified BookmarkTreeNode to the provided location. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function( BookmarkTreeNode result) {...}; + */ + export function move(id: string, destination: BookmarkDestinationArg, callback?: (result: BookmarkTreeNode) => void): void; + /** + * Updates the properties of a bookmark or folder. Specify only the properties that you want to change; unspecified properties will be left unchanged. Note: Currently, only 'title' and 'url' are supported. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function( BookmarkTreeNode result) {...}; + */ + export function update(id: string, changes: BookmarkChangesArg, callback?: (result: BookmarkTreeNode) => void): void; + /** + * Removes a bookmark or an empty bookmark folder. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function remove(id: string, callback?: Function): void; + /** + * Retrieves the children of the specified BookmarkTreeNode id. + * @param callback The callback parameter should be a function that looks like this: + * function(array of BookmarkTreeNode results) {...}; + */ + export function getChildren(id: string, callback: (results: BookmarkTreeNode[]) => void): void; + /** + * Since Chrome 14. + * Retrieves part of the Bookmarks hierarchy, starting at the specified node. + * @param id The ID of the root of the subtree to retrieve. + * @param callback The callback parameter should be a function that looks like this: + * function(array of BookmarkTreeNode results) {...}; + */ + export function getSubTree(id: string, callback: (results: BookmarkTreeNode[]) => void): void; + /** + * Recursively removes a bookmark folder. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function removeTree(id: string, callback?: Function): void; + + /** Fired when a bookmark or folder is removed. When a folder is removed recursively, a single notification is fired for the folder, and none for its contents. */ + var onRemoved: BookmarkRemovedEvent; + /** Fired when a bookmark import session is ended. */ + var onImportEnded: BookmarkImportEndedEvent; + /** Fired when a bookmark import session is begun. Expensive observers should ignore onCreated updates until onImportEnded is fired. Observers should still handle other notifications immediately. */ + var onImportBegan: BookmarkImportBeganEvent; + /** Fired when a bookmark or folder changes. Note: Currently, only title and url changes trigger this. */ + var onChanged: BookmarkChangedEvent; + /** Fired when a bookmark or folder is moved to a different parent folder. */ + var onMoved: BookmarkMovedEvent; + /** Fired when a bookmark or folder is created. */ + var onCreated: BookmarkCreatedEvent; + /** Fired when the children of a folder have changed their order due to the order being sorted in the UI. This is not called as a result of a move(). */ + var onChildrenReordered: BookmarkChildrenReordered; +} + +//////////////////// +// Browser Action +//////////////////// +/** + * Use browser actions to put icons in the main Google Chrome toolbar, to the right of the address bar. In addition to its icon, a browser action can also have a tooltip, a badge, and a popup. + * Availability: Since Chrome 5. + * Manifest: "browser_action": {...} + */ +declare namespace chrome.browserAction { + interface BadgeBackgroundColorDetails { + /** An array of four integers in the range [0,255] that make up the RGBA color of the badge. For example, opaque red is [255, 0, 0, 255]. Can also be a string with a CSS value, with opaque red being #FF0000 or #F00. */ + color: any; + /** Optional. Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */ + tabId?: number; + } + + interface BadgeTextDetails { + /** Any number of characters can be passed, but only about four can fit in the space. */ + text: string; + /** Optional. Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */ + tabId?: number; + } + + interface TitleDetails { + /** The string the browser action should display when moused over. */ + title: string; + /** Optional. Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */ + tabId?: number; + } + + interface TabDetails { + /** Optional. Specify the tab to get the information. If no tab is specified, the non-tab-specific information is returned. */ + tabId?: number; + } + + interface TabIconDetails { + /** Optional. Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals scale, then image with size scale * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.imageData = {'19': foo}' */ + path?: any; + /** Optional. Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */ + tabId?: number; + /** Optional. Either an ImageData object or a dictionary {size -> ImageData} representing icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals scale, then image with size scale * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'19': foo}' */ + imageData?: ImageData; + } + + interface PopupDetails { + /** Optional. Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */ + tabId?: number; + /** The html file to show in a popup. If set to the empty string (''), no popup is shown. */ + popup: string; + } + + interface BrowserClickedEvent extends chrome.events.Event<(tab: chrome.tabs.Tab) => void> {} + + /** + * Since Chrome 22. + * Enables the browser action for a tab. By default, browser actions are enabled. + * @param tabId The id of the tab for which you want to modify the browser action. + */ + export function enable(tabId?: number): void; + /** Sets the background color for the badge. */ + export function setBadgeBackgroundColor(details: BadgeBackgroundColorDetails): void; + /** Sets the badge text for the browser action. The badge is displayed on top of the icon. */ + export function setBadgeText(details: BadgeTextDetails): void; + /** Sets the title of the browser action. This shows up in the tooltip. */ + export function setTitle(details: TitleDetails): void; + /** + * Since Chrome 19. + * Gets the badge text of the browser action. If no tab is specified, the non-tab-specific badge text is returned. + * @param callback The callback parameter should be a function that looks like this: + * function(string result) {...}; + */ + export function getBadgeText(details: TabDetails, callback: (result: string) => void): void; + /** Sets the html document to be opened as a popup when the user clicks on the browser action's icon. */ + export function setPopup(details: PopupDetails): void; + /** + * Since Chrome 22. + * Disables the browser action for a tab. + * @param tabId The id of the tab for which you want to modify the browser action. + */ + export function disable(tabId?: number): void; + /** + * Since Chrome 19. + * Gets the title of the browser action. + * @param callback The callback parameter should be a function that looks like this: + * function(string result) {...}; + */ + export function getTitle(details: TabDetails, callback: (result: string) => void): void; + /** + * Since Chrome 19. + * Gets the background color of the browser action. + * @param callback The callback parameter should be a function that looks like this: + * function( ColorArray result) {...}; + */ + export function getBadgeBackgroundColor(details: TabDetails, callback: (result: number[]) => void): void; + /** + * Since Chrome 19. + * Gets the html document set as the popup for this browser action. + * @param callback The callback parameter should be a function that looks like this: + * function(string result) {...}; + */ + export function getPopup(details: TabDetails, callback: (result: string) => void): void; + /** + * Sets the icon for the browser action. The icon can be specified either as the path to an image file or as the pixel data from a canvas element, or as dictionary of either one of those. Either the path or the imageData property must be specified. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function setIcon(details: TabIconDetails, callback?: Function): void; + + /** Fired when a browser action icon is clicked. This event will not fire if the browser action has a popup. */ + var onClicked: BrowserClickedEvent; +} + +//////////////////// +// Browsing Data +//////////////////// +/** + * Use the chrome.browsingData API to remove browsing data from a user's local profile. + * Availability: Since Chrome 19. + * Permissions: "browsingData" + */ +declare namespace chrome.browsingData { + interface OriginTypes { + /** Optional. Websites that have been installed as hosted applications (be careful!). */ + protectedWeb?: boolean; + /** Optional. Extensions and packaged applications a user has installed (be _really_ careful!). */ + extension?: boolean; + /** Optional. Normal websites. */ + unprotectedWeb?: boolean; + } + + /** Options that determine exactly what data will be removed. */ + interface RemovalOptions { + /** + * Optional. + * Since Chrome 21. + * An object whose properties specify which origin types ought to be cleared. If this object isn't specified, it defaults to clearing only "unprotected" origins. Please ensure that you really want to remove application data before adding 'protectedWeb' or 'extensions'. + */ + originTypes?: OriginTypes; + /** Optional. Remove data accumulated on or after this date, represented in milliseconds since the epoch (accessible via the getTime method of the JavaScript Date object). If absent, defaults to 0 (which would remove all browsing data). */ + since?: number; + } + + /** + * Since Chrome 27. + * A set of data types. Missing data types are interpreted as false. + */ + interface DataTypeSet { + /** Optional. Websites' WebSQL data. */ + webSQL?: boolean; + /** Optional. Websites' IndexedDB data. */ + indexedDB?: boolean; + /** Optional. The browser's cookies. */ + cookies?: boolean; + /** Optional. Stored passwords. */ + passwords?: boolean; + /** Optional. Server-bound certificates. */ + serverBoundCertificates?: boolean; + /** Optional. The browser's download list. */ + downloads?: boolean; + /** Optional. The browser's cache. Note: when removing data, this clears the entire cache: it is not limited to the range you specify. */ + cache?: boolean; + /** Optional. Websites' appcaches. */ + appcache?: boolean; + /** Optional. Websites' file systems. */ + fileSystems?: boolean; + /** Optional. Plugins' data. */ + pluginData?: boolean; + /** Optional. Websites' local storage data. */ + localStorage?: boolean; + /** Optional. The browser's stored form data. */ + formData?: boolean; + /** Optional. The browser's history. */ + history?: boolean; + /** + * Optional. + * Since Chrome 39. + * Service Workers. + */ + serviceWorkers?: boolean; + } + + interface SettingsCallback { + options: RemovalOptions; + /** All of the types will be present in the result, with values of true if they are both selected to be removed and permitted to be removed, otherwise false. */ + dataToRemove: DataTypeSet; + /** All of the types will be present in the result, with values of true if they are permitted to be removed (e.g., by enterprise policy) and false if not. */ + dataRemovalPermitted: DataTypeSet; + } + + /** + * Since Chrome 26. + * Reports which types of data are currently selected in the 'Clear browsing data' settings UI. Note: some of the data types included in this API are not available in the settings UI, and some UI settings control more than one data type listed here. + * @param callback The callback parameter should be a function that looks like this: + * function(object result) {...}; + */ + export function settings(callback: (result: SettingsCallback) => void): void; + /** + * Clears plugins' data. + * @param callback Called when plugins' data has been cleared. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function removePluginData(options: RemovalOptions, callback?: () => void): void; + /** + * Clears the browser's stored form data (autofill). + * @param callback Called when the browser's form data has been cleared. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function removeFormData(options: RemovalOptions, callback?: () => void): void; + /** + * Clears websites' file system data. + * @param callback Called when websites' file systems have been cleared. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function removeFileSystems(options: RemovalOptions, callback?: () => void): void; + /** + * Clears various types of browsing data stored in a user's profile. + * @param dataToRemove The set of data types to remove. + * @param callback Called when deletion has completed. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function remove(options: RemovalOptions, dataToRemove: DataTypeSet, callback?: () => void): void; + /** + * Clears the browser's stored passwords. + * @param callback Called when the browser's passwords have been cleared. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function removePasswords(options: RemovalOptions, callback?: () => void): void; + /** + * Clears the browser's cookies and server-bound certificates modified within a particular timeframe. + * @param callback Called when the browser's cookies and server-bound certificates have been cleared. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function removeCookies(options: RemovalOptions, callback?: () => void): void; + /** + * Clears websites' WebSQL data. + * @param callback Called when websites' WebSQL databases have been cleared. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function removeWebSQL(options: RemovalOptions, callback?: () => void): void; + /** + * Clears websites' appcache data. + * @param callback Called when websites' appcache data has been cleared. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function removeAppcache(options: RemovalOptions, callback?: () => void): void; + /** + * Clears the browser's list of downloaded files (not the downloaded files themselves). + * @param callback Called when the browser's list of downloaded files has been cleared. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function removeDownloads(options: RemovalOptions, callback?: () => void): void; + /** + * Clears websites' local storage data. + * @param callback Called when websites' local storage has been cleared. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function removeLocalStorage(options: RemovalOptions, callback?: () => void): void; + /** + * Clears the browser's cache. + * @param callback Called when the browser's cache has been cleared. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function removeCache(options: RemovalOptions, callback?: () => void): void; + /** + * Clears the browser's history. + * @param callback Called when the browser's history has cleared. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function removeHistory(options: RemovalOptions, callback?: () => void): void; + /** + * Clears websites' IndexedDB data. + * @param callback Called when websites' IndexedDB data has been cleared. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function removeIndexedDB(options: RemovalOptions, callback?: () => void): void; +} + +//////////////////// +// Commands +//////////////////// +/** + * Use the commands API to add keyboard shortcuts that trigger actions in your extension, for example, an action to open the browser action or send a command to the extension. + * Availability: Since Chrome 25. + * Manifest: "commands": {...} + */ +declare namespace chrome.commands { + interface Command { + /** Optional. The name of the Extension Command */ + name?: string; + /** Optional. The Extension Command description */ + description?: string; + /** Optional. The shortcut active for this command, or blank if not active. */ + shortcut?: string; + } + + interface CommandEvent extends chrome.events.Event<(command: string) => void> {} + + /** + * Returns all the registered extension commands for this extension and their shortcut (if active). + * @param callback Called to return the registered commands. + * If you specify the callback parameter, it should be a function that looks like this: + * function(array of Command commands) {...}; + */ + export function getAll(callback: (commands: Command[]) => void): void; + + /** Fired when a registered command is activated using a keyboard shortcut. */ + var onCommand: CommandEvent; +} + +//////////////////// +// Content Settings +//////////////////// +/** + * Use the chrome.contentSettings API to change settings that control whether websites can use features such as cookies, JavaScript, and plugins. More generally speaking, content settings allow you to customize Chrome's behavior on a per-site basis instead of globally. + * Availability: Since Chrome 16. + * Permissions: "contentSettings" + */ +declare namespace chrome.contentSettings { + interface ClearDetails { + /** + * Optional. + * Where to clear the setting (default: regular). + * The scope of the ContentSetting. One of + * * regular: setting for regular profile (which is inherited by the incognito profile if not overridden elsewhere), + * * incognito_session_only: setting for incognito profile that can only be set during an incognito session and is deleted when the incognito session ends (overrides regular settings). + */ + scope?: string; + } + + interface SetDetails { + /** Optional. The resource identifier for the content type. */ + resourceIdentifier?: ResourceIdentifier; + /** The setting applied by this rule. See the description of the individual ContentSetting objects for the possible values. */ + setting: any; + /** Optional. The pattern for the secondary URL. Defaults to matching all URLs. For details on the format of a pattern, see Content Setting Patterns. */ + secondaryPattern?: string; + /** Optional. Where to set the setting (default: regular). */ + scope?: string; + /** The pattern for the primary URL. For details on the format of a pattern, see Content Setting Patterns. */ + primaryPattern: string; + } + + interface GetDetails { + /** Optional. The secondary URL for which the content setting should be retrieved. Defaults to the primary URL. Note that the meaning of a secondary URL depends on the content type, and not all content types use secondary URLs. */ + secondaryUrl?: string; + /** Optional. A more specific identifier of the type of content for which the settings should be retrieved. */ + resourceIdentifier?: ResourceIdentifier; + /** Optional. Whether to check the content settings for an incognito session. (default false) */ + incognito?: boolean; + /** The primary URL for which the content setting should be retrieved. Note that the meaning of a primary URL depends on the content type. */ + primaryUrl: string; + } + + interface ReturnedDetails { + /** The content setting. See the description of the individual ContentSetting objects for the possible values. */ + setting: any; + } + + interface ContentSetting { + /** + * Clear all content setting rules set by this extension. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + clear(details: ClearDetails, callback?: () => void): void; + /** + * Applies a new content setting rule. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + set(details: SetDetails, callback?: () => void): void; + /** + * @param callback The callback parameter should be a function that looks like this: + * function(array of ResourceIdentifier resourceIdentifiers) {...}; + * Parameter resourceIdentifiers: A list of resource identifiers for this content type, or undefined if this content type does not use resource identifiers. + */ + getResourceIdentifiers(callback: (resourceIdentifiers?: ResourceIdentifier[]) => void): void; + /** + * Gets the current content setting for a given pair of URLs. + * @param callback The callback parameter should be a function that looks like this: + * function(object details) {...}; + */ + get(details: GetDetails, callback: (details: ReturnedDetails) => void): void; + } + + /** The only content type using resource identifiers is contentSettings.plugins. For more information, see Resource Identifiers. */ + interface ResourceIdentifier { + /** The resource identifier for the given content type. */ + id: string; + /** Optional. A human readable description of the resource. */ + description?: string; + } + + /** + * Whether to allow cookies and other local data to be set by websites. One of + * allow: Accept cookies, + * block: Block cookies, + * session_only: Accept cookies only for the current session. + * Default is allow. + * The primary URL is the URL representing the cookie origin. The secondary URL is the URL of the top-level frame. + */ + var cookies: ContentSetting; + /** + * Whether to allow sites to show pop-ups. One of + * allow: Allow sites to show pop-ups, + * block: Don't allow sites to show pop-ups. + * Default is block. + * The primary URL is the URL of the top-level frame. The secondary URL is not used. + */ + var popups: ContentSetting; + /** + * Whether to run JavaScript. One of + * allow: Run JavaScript, + * block: Don't run JavaScript. + * Default is allow. + * The primary URL is the URL of the top-level frame. The secondary URL is not used. + */ + var javascript: ContentSetting; + /** + * Whether to allow sites to show desktop notifications. One of + * allow: Allow sites to show desktop notifications, + * block: Don't allow sites to show desktop notifications, + * ask: Ask when a site wants to show desktop notifications. + * Default is ask. + * The primary URL is the URL of the document which wants to show the notification. The secondary URL is not used. + */ + var notifications: ContentSetting; + /** + * Whether to run plugins. One of + * allow: Run plugins automatically, + * block: Don't run plugins automatically, + * detect_important_content: Only run automatically those plugins that are detected as the website's main content. + * Default is allow. + * The primary URL is the URL of the top-level frame. The secondary URL is not used. + */ + var plugins: ContentSetting; + /** + * Whether to show images. One of + * allow: Show images, + * block: Don't show images. + * Default is allow. + * The primary URL is the URL of the top-level frame. The secondary URL is the URL of the image. + */ + var images: ContentSetting; + /** + * Since Chrome 42. + * Whether to allow Geolocation. One of + * allow: Allow sites to track your physical location, + * block: Don't allow sites to track your physical location, + * ask: Ask before allowing sites to track your physical location. + * Default is ask. + * The primary URL is the URL of the document which requested location data. The secondary URL is the URL of the top-level frame (which may or may not differ from the requesting URL). + */ + var location: ContentSetting; + /** + * Since Chrome 42. + * Whether to allow sites to toggle the fullscreen mode. One of + * allow: Allow sites to toggle the fullscreen mode, + * ask: Ask when a site wants to toggle the fullscreen mode. + * Default is ask. + * The primary URL is the URL of the document which requested to toggle the fullscreen mode. The secondary URL is the URL of the top-level frame (which may or may not differ from the requesting URL). + */ + var fullscreen: ContentSetting; + /** + * Since Chrome 42. + * Whether to allow sites to disable the mouse cursor. One of + * allow: Allow sites to disable the mouse cursor, + * block: Don't allow sites to disable the mouse cursor, + * ask: Ask when a site wants to disable the mouse cursor. + * Default is ask. + * The primary URL is the URL of the top-level frame. The secondary URL is not used. + */ + var mouselock: ContentSetting; + /** + * Since Chrome 42. + * Whether to allow sites to run plugins unsandboxed. One of + * allow: Allow sites to run plugins unsandboxed, + * block: Don't allow sites to run plugins unsandboxed, + * ask: Ask when a site wants to run a plugin unsandboxed. + * Default is ask. + * The primary URL is the URL of the top-level frame. The secondary URL is not used. + */ + var unsandboxedPlugins: ContentSetting; + /** + * Since Chrome 42. + * Whether to allow sites to download multiple files automatically. One of + * allow: Allow sites to download multiple files automatically, + * block: Don't allow sites to download multiple files automatically, + * ask: Ask when a site wants to download files automatically after the first file. + * Default is ask. + * The primary URL is the URL of the top-level frame. The secondary URL is not used. + */ + var automaticDownloads: ContentSetting; +} + +//////////////////// +// Context Menus +//////////////////// +/** + * Use the chrome.contextMenus API to add items to Google Chrome's context menu. You can choose what types of objects your context menu additions apply to, such as images, hyperlinks, and pages. + * Availability: Since Chrome 6. + * Permissions: "contextMenus" + */ +declare namespace chrome.contextMenus { + interface OnClickData { + /** + * Optional. + * Since Chrome 35. + * The text for the context selection, if any. + */ + selectionText?: string; + /** + * Optional. + * Since Chrome 35. + * A flag indicating the state of a checkbox or radio item after it is clicked. + */ + checked?: boolean; + /** + * Since Chrome 35. + * The ID of the menu item that was clicked. + */ + menuItemId: any; + /** + * Optional. + * Since Chrome 35. + * The URL of the frame of the element where the context menu was clicked, if it was in a frame. + */ + frameUrl?: string; + /** + * Since Chrome 35. + * A flag indicating whether the element is editable (text input, textarea, etc.). + */ + editable: boolean; + /** + * Optional. + * Since Chrome 35. + * One of 'image', 'video', or 'audio' if the context menu was activated on one of these types of elements. + */ + mediaType?: string; + /** + * Optional. + * Since Chrome 35. + * A flag indicating the state of a checkbox or radio item before it was clicked. + */ + wasChecked?: boolean; + /** + * Since Chrome 35. + * The URL of the page where the menu item was clicked. This property is not set if the click occured in a context where there is no current page, such as in a launcher context menu. + */ + pageUrl: string; + /** + * Optional. + * Since Chrome 35. + * If the element is a link, the URL it points to. + */ + linkUrl?: string; + /** + * Optional. + * Since Chrome 35. + * The parent ID, if any, for the item clicked. + */ + parentMenuItemId?: any; + /** + * Optional. + * Since Chrome 35. + * Will be present for elements with a 'src' URL. + */ + srcUrl?: string; + } + + interface CreateProperties { + /** Optional. Lets you restrict the item to apply only to documents whose URL matches one of the given patterns. (This applies to frames as well.) For details on the format of a pattern, see Match Patterns. */ + documentUrlPatterns?: string[]; + /** Optional. The initial state of a checkbox or radio item: true for selected and false for unselected. Only one radio item can be selected at a time in a given group of radio items. */ + checked?: boolean; + /** Optional. The text to be displayed in the item; this is required unless type is 'separator'. When the context is 'selection', you can use %s within the string to show the selected text. For example, if this parameter's value is "Translate '%s' to Pig Latin" and the user selects the word "cool", the context menu item for the selection is "Translate 'cool' to Pig Latin". */ + title?: string; + /** Optional. List of contexts this menu item will appear in. Defaults to ['page'] if not specified. */ + contexts?: string[]; + /** + * Optional. + * Since Chrome 20. + * Whether this context menu item is enabled or disabled. Defaults to true. + */ + enabled?: boolean; + /** Optional. Similar to documentUrlPatterns, but lets you filter based on the src attribute of img/audio/video tags and the href of anchor tags. */ + targetUrlPatterns?: string[]; + /** + * Optional. + * A function that will be called back when the menu item is clicked. Event pages cannot use this; instead, they should register a listener for chrome.contextMenus.onClicked. + * @param info Information sent when a context menu item is clicked. + * @param tab The details of the tab where the click took place. Note: this parameter only present for extensions. + */ + onclick?: (info: OnClickData, tab: chrome.tabs.Tab) => void; + /** Optional. The ID of a parent menu item; this makes the item a child of a previously added item. */ + parentId?: any; + /** Optional. The type of menu item. Defaults to 'normal' if not specified. */ + type?: string; + /** + * Optional. + * Since Chrome 21. + * The unique ID to assign to this item. Mandatory for event pages. Cannot be the same as another ID for this extension. + */ + id?: string; + } + + interface UpdateProperties { + documentUrlPatterns?: string[]; + checked?: boolean; + title?: string; + contexts?: string[]; + /** Optional. Since Chrome 20. */ + enabled?: boolean; + targetUrlPatterns?: string[]; + onclick?: Function; + /** Optional. Note: You cannot change an item to be a child of one of its own descendants. */ + parentId?: any; + type?: string; + } + + interface MenuClickedEvent extends chrome.events.Event<(info: OnClickData, tab?: chrome.tabs.Tab) => void> {} + + /** + * Since Chrome 38. + * The maximum number of top level extension items that can be added to an extension action context menu. Any items beyond this limit will be ignored. + */ + var ACTION_MENU_TOP_LEVEL_LIMIT: number; + + /** + * Removes all context menu items added by this extension. + * @param callback Called when removal is complete. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function removeAll(callback?: () => void): void; + /** + * Creates a new context menu item. Note that if an error occurs during creation, you may not find out until the creation callback fires (the details will be in chrome.runtime.lastError). + * @param callback Called when the item has been created in the browser. If there were any problems creating the item, details will be available in chrome.runtime.lastError. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function create(createProperties: CreateProperties, callback?: () => void): void; + /** + * Updates a previously created context menu item. + * @param id The ID of the item to update. + * @param updateProperties The properties to update. Accepts the same values as the create function. + * @param callback Called when the context menu has been updated. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function update(id: string, updateProperties: UpdateProperties, callback?: () => void): void; + /** + * Updates a previously created context menu item. + * @param id The ID of the item to update. + * @param updateProperties The properties to update. Accepts the same values as the create function. + * @param callback Called when the context menu has been updated. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function update(id: number, updateProperties: UpdateProperties, callback?: () => void): void; + /** + * Removes a context menu item. + * @param menuItemId The ID of the context menu item to remove. + * @param callback Called when the context menu has been removed. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function remove(menuItemId: string, callback?: () => void): void; + /** + * Removes a context menu item. + * @param menuItemId The ID of the context menu item to remove. + * @param callback Called when the context menu has been removed. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function remove(menuItemId: number, callback?: () => void): void; + + /** + * Since Chrome 21. + * Fired when a context menu item is clicked. + */ + var onClicked: MenuClickedEvent; +} + +//////////////////// +// Cookies +//////////////////// +/** + * Use the chrome.cookies API to query and modify cookies, and to be notified when they change. + * Availability: Since Chrome 6. + * Permissions: "cookies", host permissions + */ +declare namespace chrome.cookies { + /** Represents information about an HTTP cookie. */ + interface Cookie { + /** The domain of the cookie (e.g. "www.google.com", "example.com"). */ + domain: string; + /** The name of the cookie. */ + name: string; + /** The ID of the cookie store containing this cookie, as provided in getAllCookieStores(). */ + storeId: string; + /** The value of the cookie. */ + value: string; + /** True if the cookie is a session cookie, as opposed to a persistent cookie with an expiration date. */ + session: boolean; + /** True if the cookie is a host-only cookie (i.e. a request's host must exactly match the domain of the cookie). */ + hostOnly: boolean; + /** Optional. The expiration date of the cookie as the number of seconds since the UNIX epoch. Not provided for session cookies. */ + expirationDate?: number; + /** The path of the cookie. */ + path: string; + /** True if the cookie is marked as HttpOnly (i.e. the cookie is inaccessible to client-side scripts). */ + httpOnly: boolean; + /** True if the cookie is marked as Secure (i.e. its scope is limited to secure channels, typically HTTPS). */ + secure: boolean; + } + + /** Represents a cookie store in the browser. An incognito mode window, for instance, uses a separate cookie store from a non-incognito window. */ + interface CookieStore { + /** The unique identifier for the cookie store. */ + id: string; + /** Identifiers of all the browser tabs that share this cookie store. */ + tabIds: number[]; + } + + interface GetAllDetails { + /** Optional. Restricts the retrieved cookies to those whose domains match or are subdomains of this one. */ + domain?: string; + /** Optional. Filters the cookies by name. */ + name?: string; + /** Optional. Restricts the retrieved cookies to those that would match the given URL. */ + url?: string; + /** Optional. The cookie store to retrieve cookies from. If omitted, the current execution context's cookie store will be used. */ + storeId?: string; + /** Optional. Filters out session vs. persistent cookies. */ + session?: boolean; + /** Optional. Restricts the retrieved cookies to those whose path exactly matches this string. */ + path?: string; + /** Optional. Filters the cookies by their Secure property. */ + secure?: boolean; + } + + interface SetDetails { + /** Optional. The domain of the cookie. If omitted, the cookie becomes a host-only cookie. */ + domain?: string; + /** Optional. The name of the cookie. Empty by default if omitted. */ + name?: string; + /** The request-URI to associate with the setting of the cookie. This value can affect the default domain and path values of the created cookie. If host permissions for this URL are not specified in the manifest file, the API call will fail. */ + url: string; + /** Optional. The ID of the cookie store in which to set the cookie. By default, the cookie is set in the current execution context's cookie store. */ + storeId?: string; + /** Optional. The value of the cookie. Empty by default if omitted. */ + value?: string; + /** Optional. The expiration date of the cookie as the number of seconds since the UNIX epoch. If omitted, the cookie becomes a session cookie. */ + expirationDate?: number; + /** Optional. The path of the cookie. Defaults to the path portion of the url parameter. */ + path?: string; + /** Optional. Whether the cookie should be marked as HttpOnly. Defaults to false. */ + httpOnly?: boolean; + /** Optional. Whether the cookie should be marked as Secure. Defaults to false. */ + secure?: boolean; + } + + interface Details { + name: string; + url: string; + storeId?: string; + } + + interface CookieChangeInfo { + /** Information about the cookie that was set or removed. */ + cookie: Cookie; + /** True if a cookie was removed. */ + removed: boolean; + /** + * Since Chrome 12. + * The underlying reason behind the cookie's change. + */ + cause: string; + } + + interface CookieChangedEvent extends chrome.events.Event<(changeInfo: CookieChangeInfo) => void> {} + + /** + * Lists all existing cookie stores. + * @param callback The callback parameter should be a function that looks like this: + * function(array of CookieStore cookieStores) {...}; + * Parameter cookieStores: All the existing cookie stores. + */ + export function getAllCookieStores(callback: (cookieStores: CookieStore[]) => void): void; + /** + * Retrieves all cookies from a single cookie store that match the given information. The cookies returned will be sorted, with those with the longest path first. If multiple cookies have the same path length, those with the earliest creation time will be first. + * @param details Information to filter the cookies being retrieved. + * @param callback The callback parameter should be a function that looks like this: + * function(array of Cookie cookies) {...}; + * Parameter cookies: All the existing, unexpired cookies that match the given cookie info. + */ + export function getAll(details: GetAllDetails, callback: (cookies: Cookie[]) => void): void; + /** + * Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist. + * @param details Details about the cookie being set. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function( Cookie cookie) {...}; + * Optional parameter cookie: Contains details about the cookie that's been set. If setting failed for any reason, this will be "null", and "chrome.runtime.lastError" will be set. + */ + export function set(details: SetDetails, callback?: (cookie: Cookie | null) => void): void; + /** + * Deletes a cookie by name. + * @param details Information to identify the cookie to remove. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function(object details) {...}; + */ + export function remove(details: Details, callback?: (details: Details) => void): void; + /** + * Retrieves information about a single cookie. If more than one cookie of the same name exists for the given URL, the one with the longest path will be returned. For cookies with the same path length, the cookie with the earliest creation time will be returned. + * @param details Details to identify the cookie being retrieved. + * @param callback The callback parameter should be a function that looks like this: + * function( Cookie cookie) {...}; + * Parameter cookie: Contains details about the cookie. This parameter is null if no such cookie was found. + */ + export function get(details: Details, callback: (cookie: Cookie | null) => void): void; + + /** Fired when a cookie is set or removed. As a special case, note that updating a cookie's properties is implemented as a two step process: the cookie to be updated is first removed entirely, generating a notification with "cause" of "overwrite" . Afterwards, a new cookie is written with the updated values, generating a second notification with "cause" "explicit". */ + var onChanged: CookieChangedEvent; +} + +//////////////////// +// Debugger +//////////////////// +/** + * The chrome.debugger API serves as an alternate transport for Chrome's remote debugging protocol. Use chrome.debugger to attach to one or more tabs to instrument network interaction, debug JavaScript, mutate the DOM and CSS, etc. Use the Debuggee tabId to target tabs with sendCommand and route events by tabId from onEvent callbacks. + * Availability: Since Chrome 18. + * Permissions: "debugger" + */ +// TODO: Uncomment when Microsoft/TypeScript#8312 is merged in +// declare module chrome.debugger { +// /** Debuggee identifier. Either tabId or extensionId must be specified */ +// interface Debuggee { +// /** Optional. The id of the tab which you intend to debug. */ +// tabId?: number; +// /** +// * Optional. +// * Since Chrome 27. +// * The id of the extension which you intend to debug. Attaching to an extension background page is only possible when 'silent-debugger-extension-api' flag is enabled on the target browser. +// */ +// extensionId?: string; +// /** +// * Optional. +// * Since Chrome 28. +// * The opaque id of the debug target. +// */ +// targetId?: string; +// } +// +// /** +// * Since Chrome 28. +// * Debug target information +// */ +// interface TargetInfo { +// /** Target type. */ +// type: string; +// /** Target id. */ +// id: string; +// /** +// * Optional. +// * Since Chrome 30. +// * The tab id, defined if type == 'page'. +// */ +// tabId?: number; +// /** +// * Optional. +// * Since Chrome 30. +// * The extension id, defined if type = 'background_page'. +// */ +// extensionId?: string; +// /** True if debugger is already attached. */ +// attached: boolean; +// /** Target page title. */ +// title: string; +// /** Target URL. */ +// url: string; +// /** Optional. Target favicon URL. */ +// faviconUrl?: string; +// } +// +// interface DebuggerDetachedEvent extends chrome.events.Event<(source: Debuggee, reason: string) => void> {} +// +// interface DebuggerEventEvent extends chrome.events.Event<(source: Debuggee, method: string, params?: Object) => void> {} +// +// /** +// * Attaches debugger to the given target. +// * @param target Debugging target to which you want to attach. +// * @param requiredVersion Required debugging protocol version ("0.1"). One can only attach to the debuggee with matching major version and greater or equal minor version. List of the protocol versions can be obtained in the documentation pages. +// * @param callback Called once the attach operation succeeds or fails. Callback receives no arguments. If the attach fails, runtime.lastError will be set to the error message. +// * If you specify the callback parameter, it should be a function that looks like this: +// * function() {...}; +// */ +// export function attach(target: Debuggee, requiredVersion: string, callback?: () => void): void; +// /** +// * Detaches debugger from the given target. +// * @param target Debugging target from which you want to detach. +// * @param callback Called once the detach operation succeeds or fails. Callback receives no arguments. If the detach fails, runtime.lastError will be set to the error message. +// * If you specify the callback parameter, it should be a function that looks like this: +// * function() {...}; +// */ +// export function detach(target: Debuggee, callback?: () => void): void; +// /** +// * Sends given command to the debugging target. +// * @param target Debugging target to which you want to send the command. +// * @param method Method name. Should be one of the methods defined by the remote debugging protocol. +// * @param commandParams Since Chrome 22. +// * JSON object with request parameters. This object must conform to the remote debugging params scheme for given method. +// * @param callback Response body. If an error occurs while posting the message, the callback will be called with no arguments and runtime.lastError will be set to the error message. +// * If you specify the callback parameter, it should be a function that looks like this: +// * function(object result) {...}; +// */ +// export function sendCommand(target: Debuggee, method: string, commandParams?: Object, callback?: (result?: Object) => void): void; +// /** +// * Since Chrome 28. +// * Returns the list of available debug targets. +// * @param callback The callback parameter should be a function that looks like this: +// * function(array of TargetInfo result) {...}; +// * Parameter result: Array of TargetInfo objects corresponding to the available debug targets. +// */ +// export function getTargets(callback: (result: TargetInfo[]) => void): void; +// +// /** Fired when browser terminates debugging session for the tab. This happens when either the tab is being closed or Chrome DevTools is being invoked for the attached tab. */ +// var onDetach: DebuggerDetachedEvent; +// /** Fired whenever debugging target issues instrumentation event. */ +// var onEvent: DebuggerEventEvent; +// } + +//////////////////// +// Declarative Content +//////////////////// +/** + * Use the chrome.declarativeContent API to take actions depending on the content of a page, without requiring permission to read the page's content. + * Availability: Since Chrome 33. + * Permissions: "declarativeContent" + */ +declare namespace chrome.declarativeContent { + interface PageStateUrlDetails { + /** Optional. Matches if the host name of the URL contains a specified string. To test whether a host name component has a prefix 'foo', use hostContains: '.foo'. This matches 'www.foobar.com' and 'foo.com', because an implicit dot is added at the beginning of the host name. Similarly, hostContains can be used to match against component suffix ('foo.') and to exactly match against components ('.foo.'). Suffix- and exact-matching for the last components need to be done separately using hostSuffix, because no implicit dot is added at the end of the host name. */ + hostContains?: string; + /** Optional. Matches if the host name of the URL is equal to a specified string. */ + hostEquals?: string; + /** Optional. Matches if the host name of the URL starts with a specified string. */ + hostPrefix?: string; + /** Optional. Matches if the host name of the URL ends with a specified string. */ + hostSuffix?: string; + /** Optional. Matches if the path segment of the URL contains a specified string. */ + pathContains?: string; + /** Optional. Matches if the path segment of the URL is equal to a specified string. */ + pathEquals?: string; + /** Optional. Matches if the path segment of the URL starts with a specified string. */ + pathPrefix?: string; + /** Optional. Matches if the path segment of the URL ends with a specified string. */ + pathSuffix?: string; + /** Optional. Matches if the query segment of the URL contains a specified string. */ + queryContains?: string; + /** Optional. Matches if the query segment of the URL is equal to a specified string. */ + queryEquals?: string; + /** Optional. Matches if the query segment of the URL starts with a specified string. */ + queryPrefix?: string; + /** Optional. Matches if the query segment of the URL ends with a specified string. */ + querySuffix?: string; + /** Optional. Matches if the URL (without fragment identifier) contains a specified string. Port numbers are stripped from the URL if they match the default port number. */ + urlContains?: string; + /** Optional. Matches if the URL (without fragment identifier) is equal to a specified string. Port numbers are stripped from the URL if they match the default port number. */ + urlEquals?: string; + /** Optional. Matches if the URL (without fragment identifier) matches a specified regular expression. Port numbers are stripped from the URL if they match the default port number. The regular expressions use the RE2 syntax. */ + urlMatches?: string; + /** Optional. Matches if the URL without query segment and fragment identifier matches a specified regular expression. Port numbers are stripped from the URL if they match the default port number. The regular expressions use the RE2 syntax. */ + originAndPathMatches?: string; + /** Optional. Matches if the URL (without fragment identifier) starts with a specified string. Port numbers are stripped from the URL if they match the default port number. */ + urlPrefix?: string; + /** Optional. Matches if the URL (without fragment identifier) ends with a specified string. Port numbers are stripped from the URL if they match the default port number. */ + urlSuffix?: string; + /** Optional. Matches if the scheme of the URL is equal to any of the schemes specified in the array. */ + schemes?: string[]; + /** Optional. Matches if the port of the URL is contained in any of the specified port lists. For example [80, 443, [1000, 1200]] matches all requests on port 80, 443 and in the range 1000-1200. */ + ports?: (number | number[])[]; + } + + /** Matches the state of a web page by various criteria. */ + interface PageStateMatcher { + /** Optional. Filters URLs for various criteria. See event filtering. All criteria are case sensitive. */ + pageUrl?: PageStateUrlDetails; + /** Optional. Matches if all of the CSS selectors in the array match displayed elements in a frame with the same origin as the page's main frame. All selectors in this array must be compound selectors to speed up matching. Note that listing hundreds of CSS selectors or CSS selectors that match hundreds of times per page can still slow down web sites. */ + css?: string[]; + /** + * Optional. + * Since Chrome 45. Warning: this is the current Beta channel. More information available on the API documentation pages. + * Matches if the bookmarked state of the page is equal to the specified value. Requres the bookmarks permission. + */ + isBookmarked?: boolean; + } +} + +//////////////////// +// Declarative Web Request +//////////////////// +declare namespace chrome.declarativeWebRequest { + interface HeaderFilter { + nameEquals?: string; + valueContains?: any; + nameSuffix?: string; + valueSuffix?: string; + valuePrefix?: string; + nameContains?: any; + valueEquals?: string; + namePrefix?: string; + } + + interface AddResponseHeader { + name: string; + value: string; + } + + interface RemoveResponseCookie { + filter: ResponseCookie; + } + + interface RemoveResponseHeader { + name: string; + value?: string; + } + + interface RequestMatcher { + contentType?: string[]; + url?: chrome.events.UrlFilter; + excludeContentType?: string[]; + excludeResponseHeader?: HeaderFilter[]; + resourceType?: string; + responseHeaders?: HeaderFilter[]; + } + + interface IgnoreRules { + lowerPriorityThan: number; + } + + interface RedirectToEmptyDocument { } + + interface RedirectRequest { + redirectUrl: string; + } + + interface ResponseCookie { + domain?: string; + name?: string; + expires?: string; + maxAge?: number; + value?: string; + path?: string; + httpOnly?: string; + secure?: string; + } + + interface AddResponseCookie { + cookie: ResponseCookie; + } + + interface EditResponseCookie { + filter: ResponseCookie; + modification: ResponseCookie; + } + + interface CancelRequest { } + + interface RemoveRequestHeader { + name: string; + } + + interface EditRequestCookie { + filter: RequestCookie; + modification: RequestCookie; + } + + interface SetRequestHeader { + name: string; + value: string; + } + + interface RequestCookie { + name?: string; + value?: string; + } + + interface RedirectByRegEx { + to: string; + from: string; + } + + interface RedirectToTransparentImage { } + + interface AddRequestCookie { + cookie: RequestCookie; + } + + interface RemoveRequestCookie { + filter: RequestCookie; + } + + interface RequestedEvent extends chrome.events.Event {} + + var onRequest: RequestedEvent; +} + +//////////////////// +// DesktopCapture +//////////////////// +/** + * Desktop Capture API that can be used to capture content of screen, individual windows or tabs. + * Availability: Since Chrome 34. + * Permissions: "desktopCapture" + */ +declare namespace chrome.desktopCapture { + /** + * Shows desktop media picker UI with the specified set of sources. + * @param sources Set of sources that should be shown to the user. + * @param callback The callback parameter should be a function that looks like this: + * function(string streamId) {...}; + * Parameter streamId: An opaque string that can be passed to getUserMedia() API to generate media stream that corresponds to the source selected by the user. If user didn't select any source (i.e. canceled the prompt) then the callback is called with an empty streamId. The created streamId can be used only once and expires after a few seconds when it is not used. + */ + export function chooseDesktopMedia(sources: string[], callback: (streamId: string) => void): number; + /** + * Shows desktop media picker UI with the specified set of sources. + * @param sources Set of sources that should be shown to the user. + * @param targetTab Optional tab for which the stream is created. If not specified then the resulting stream can be used only by the calling extension. The stream can only be used by frames in the given tab whose security origin matches tab.url. + * @param callback The callback parameter should be a function that looks like this: + * function(string streamId) {...}; + * Parameter streamId: An opaque string that can be passed to getUserMedia() API to generate media stream that corresponds to the source selected by the user. If user didn't select any source (i.e. canceled the prompt) then the callback is called with an empty streamId. The created streamId can be used only once and expires after a few seconds when it is not used. + */ + export function chooseDesktopMedia(sources: string[], targetTab: chrome.tabs.Tab, callback: (streamId: string) => void): number; + /** + * Hides desktop media picker dialog shown by chooseDesktopMedia(). + * @param desktopMediaRequestId Id returned by chooseDesktopMedia() + */ + export function cancelChooseDesktopMedia(desktopMediaRequestId: number): void; +} + +//////////////////// +// Dev Tools - Inspected Window +//////////////////// +/** + * Use the chrome.devtools.inspectedWindow API to interact with the inspected window: obtain the tab ID for the inspected page, evaluate the code in the context of the inspected window, reload the page, or obtain the list of resources within the page. + * Availability: Since Chrome 18. + */ +declare namespace chrome.devtools.inspectedWindow { + /** A resource within the inspected page, such as a document, a script, or an image. */ + interface Resource { + /** The URL of the resource. */ + url: string; + /** + * Gets the content of the resource. + * @param callback A function that receives resource content when the request completes. + * The callback parameter should be a function that looks like this: + * function(string content, string encoding) {...}; + * Parameter content: Content of the resource (potentially encoded). + * Parameter encoding: Empty if content is not encoded, encoding name otherwise. Currently, only base64 is supported. + */ + getContent(callback: (content: string, encoding: string) => void): void; + /** + * Sets the content of the resource. + * @param content New content of the resource. Only resources with the text type are currently supported. + * @param commit True if the user has finished editing the resource, and the new content of the resource should be persisted; false if this is a minor change sent in progress of the user editing the resource. + * @param callback A function called upon request completion. + * If you specify the callback parameter, it should be a function that looks like this: + * function(object error) {...}; + * Optional parameter error: Set to undefined if the resource content was set successfully; describes error otherwise. + */ + setContent(content: string, commit: boolean, callback?: (error: Object) => void): void; + } + + interface ReloadOptions { + /** Optional. If specified, the string will override the value of the User-Agent HTTP header that's sent while loading the resources of the inspected page. The string will also override the value of the navigator.userAgent property that's returned to any scripts that are running within the inspected page. */ + userAgent?: string; + /** Optional. When true, the loader will ignore the cache for all inspected page resources loaded before the load event is fired. The effect is similar to pressing Ctrl+Shift+R in the inspected window or within the Developer Tools window. */ + ignoreCache?: boolean; + /** Optional. If specified, the script will be injected into every frame of the inspected page immediately upon load, before any of the frame's scripts. The script will not be injected after subsequent reloads—for example, if the user presses Ctrl+R. */ + injectedScript?: string; + /** + * Optional. + * If specified, this script evaluates into a function that accepts three string arguments: the source to preprocess, the URL of the source, and a function name if the source is an DOM event handler. The preprocessorerScript function should return a string to be compiled by Chrome in place of the input source. In the case that the source is a DOM event handler, the returned source must compile to a single JS function. + * @deprecated Deprecated since Chrome 41. Please avoid using this parameter, it will be removed soon. + */ + preprocessorScript?: string; + } + + interface EvaluationExceptionInfo { + /** Set if the error occurred on the DevTools side before the expression is evaluated. */ + isError: boolean; + /** Set if the error occurred on the DevTools side before the expression is evaluated. */ + code: string; + /** Set if the error occurred on the DevTools side before the expression is evaluated. */ + description: string; + /** Set if the error occurred on the DevTools side before the expression is evaluated, contains the array of the values that may be substituted into the description string to provide more information about the cause of the error. */ + details: any[]; + /** Set if the evaluated code produces an unhandled exception. */ + isException: boolean; + /** Set if the evaluated code produces an unhandled exception. */ + value: string; + } + + interface ResourceAddedEvent extends chrome.events.Event<(resource: Resource) => void> {} + + interface ResourceContentCommittedEvent extends chrome.events.Event<(resource: Resource, content: string) => void> {} + + /** The ID of the tab being inspected. This ID may be used with chrome.tabs.* API. */ + var tabId: number; + + /** Reloads the inspected page. */ + export function reload(reloadOptions: ReloadOptions): void; + /** + * Evaluates a JavaScript expression in the context of the main frame of the inspected page. The expression must evaluate to a JSON-compliant object, otherwise an exception is thrown. The eval function can report either a DevTools-side error or a JavaScript exception that occurs during evaluation. In either case, the result parameter of the callback is undefined. In the case of a DevTools-side error, the isException parameter is non-null and has isError set to true and code set to an error code. In the case of a JavaScript error, isException is set to true and value is set to the string value of thrown object. + * @param expression An expression to evaluate. + * @param callback A function called when evaluation completes. + * If you specify the callback parameter, it should be a function that looks like this: + * function(object result, object exceptionInfo) {...}; + * Parameter result: The result of evaluation. + * Parameter exceptionInfo: An object providing details if an exception occurred while evaluating the expression. + */ + export function eval(expression: string, callback?: (result: Object, exceptionInfo: EvaluationExceptionInfo) => void): void; + /** + * Retrieves the list of resources from the inspected page. + * @param callback A function that receives the list of resources when the request completes. + * The callback parameter should be a function that looks like this: + * function(array of Resource resources) {...}; + */ + export function getResources(callback: (resources: Resource[]) => void): void; + + /** Fired when a new resource is added to the inspected page. */ + var onResourceAdded: ResourceAddedEvent; + /** Fired when a new revision of the resource is committed (e.g. user saves an edited version of the resource in the Developer Tools). */ + var onResourceContentCommitted: ResourceContentCommittedEvent; +} + +//////////////////// +// Dev Tools - Network +//////////////////// +/** + * Use the chrome.devtools.network API to retrieve the information about network requests displayed by the Developer Tools in the Network panel. + * Availability: Since Chrome 18. + */ +declare namespace chrome.devtools.network { + /** Represents a network request for a document resource (script, image and so on). See HAR Specification for reference. */ + interface Request { + /** + * Returns content of the response body. + * @param callback A function that receives the response body when the request completes. + * The callback parameter should be a function that looks like this: + * function(string content, string encoding) {...}; + * Parameter content: Content of the response body (potentially encoded). + * Parameter encoding: Empty if content is not encoded, encoding name otherwise. Currently, only base64 is supported. + */ + getContent(callback: (content: string, encoding: string) => void): void; + } + + interface RequestFinishedEvent extends chrome.events.Event<(request: Request) => void> {} + + interface NavigatedEvent extends chrome.events.Event<(url: string) => void> {} + + /** + * Returns HAR log that contains all known network requests. + * @param callback A function that receives the HAR log when the request completes. + * The callback parameter should be a function that looks like this: + * function(object harLog) {...}; + * Parameter harLog: A HAR log. See HAR specification for details. + */ + export function getHAR(callback: (harLog: Object) => void): void; + + /** Fired when a network request is finished and all request data are available. */ + var onRequestFinished: RequestFinishedEvent; + /** Fired when the inspected window navigates to a new page. */ + var onNavigated: NavigatedEvent; +} + +//////////////////// +// Dev Tools - Panels +//////////////////// +/** + * Use the chrome.devtools.panels API to integrate your extension into Developer Tools window UI: create your own panels, access existing panels, and add sidebars. + * Availability: Since Chrome 18. + */ +declare namespace chrome.devtools.panels { + interface PanelShownEvent extends chrome.events.Event<(window: chrome.windows.Window) => void> {} + + interface PanelHiddenEvent extends chrome.events.Event<() => void> {} + + interface PanelSearchEvent extends chrome.events.Event<(action: string, queryString?: string) => void> {} + + /** Represents a panel created by extension. */ + interface ExtensionPanel { + /** + * Appends a button to the status bar of the panel. + * @param iconPath Path to the icon of the button. The file should contain a 64x24-pixel image composed of two 32x24 icons. The left icon is used when the button is inactive; the right icon is displayed when the button is pressed. + * @param tooltipText Text shown as a tooltip when user hovers the mouse over the button. + * @param disabled Whether the button is disabled. + */ + createStatusBarButton(iconPath: string, tooltipText: string, disabled: boolean): Button; + /** Fired when the user switches to the panel. */ + onShown: PanelShownEvent; + /** Fired when the user switches away from the panel. */ + onHidden: PanelHiddenEvent; + /** Fired upon a search action (start of a new search, search result navigation, or search being canceled). */ + onSearch: PanelSearchEvent; + } + + interface ButtonClickedEvent extends chrome.events.Event<() => void> {} + + /** A button created by the extension. */ + interface Button { + /** + * Updates the attributes of the button. If some of the arguments are omitted or null, the corresponding attributes are not updated. + * @param iconPath Path to the new icon of the button. + * @param tooltipText Text shown as a tooltip when user hovers the mouse over the button. + * @param disabled Whether the button is disabled. + */ + update(iconPath?: string | null, tooltipText?: string | null, disabled?: boolean | null): void; + /** Fired when the button is clicked. */ + onClicked: ButtonClickedEvent; + } + + interface SelectionChangedEvent extends chrome.events.Event<() => void> {} + + /** Represents the Elements panel. */ + interface ElementsPanel { + /** + * Creates a pane within panel's sidebar. + * @param title Text that is displayed in sidebar caption. + * @param callback A callback invoked when the sidebar is created. + * If you specify the callback parameter, it should be a function that looks like this: + * function( ExtensionSidebarPane result) {...}; + * Parameter result: An ExtensionSidebarPane object for created sidebar pane. + */ + createSidebarPane(title: string, callback?: (result: ExtensionSidebarPane) => void): void; + /** Fired when an object is selected in the panel. */ + onSelectionChanged: SelectionChangedEvent; + } + + /** + * Since Chrome 41. + * Represents the Sources panel. + */ + interface SourcesPanel { + /** + * Creates a pane within panel's sidebar. + * @param title Text that is displayed in sidebar caption. + * @param callback A callback invoked when the sidebar is created. + * If you specify the callback parameter, it should be a function that looks like this: + * function( ExtensionSidebarPane result) {...}; + * Parameter result: An ExtensionSidebarPane object for created sidebar pane. + */ + createSidebarPane(title: string, callback?: (result: ExtensionSidebarPane) => void): void; + /** Fired when an object is selected in the panel. */ + onSelectionChanged: SelectionChangedEvent; + } + + interface ExtensionSidebarPaneShownEvent extends chrome.events.Event<(window: chrome.windows.Window) => void> {} + + interface ExtensionSidebarPaneHiddenEvent extends chrome.events.Event<() => void> {} + + /** A sidebar created by the extension. */ + interface ExtensionSidebarPane { + /** + * Sets the height of the sidebar. + * @param height A CSS-like size specification, such as '100px' or '12ex'. + */ + setHeight(height: string): void; + /** + * Sets an expression that is evaluated within the inspected page. The result is displayed in the sidebar pane. + * @param expression An expression to be evaluated in context of the inspected page. JavaScript objects and DOM nodes are displayed in an expandable tree similar to the console/watch. + * @param rootTitle An optional title for the root of the expression tree. + * @param callback A callback invoked after the sidebar pane is updated with the expression evaluation results. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + setExpression(expression: string, rootTitle?: string, callback?: () => void): void; + /** + * Sets an expression that is evaluated within the inspected page. The result is displayed in the sidebar pane. + * @param expression An expression to be evaluated in context of the inspected page. JavaScript objects and DOM nodes are displayed in an expandable tree similar to the console/watch. + * @param callback A callback invoked after the sidebar pane is updated with the expression evaluation results. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + setExpression(expression: string, callback?: () => void): void; + /** + * Sets a JSON-compliant object to be displayed in the sidebar pane. + * @param jsonObject An object to be displayed in context of the inspected page. Evaluated in the context of the caller (API client). + * @param rootTitle An optional title for the root of the expression tree. + * @param callback A callback invoked after the sidebar is updated with the object. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + setObject(jsonObject: Object, rootTitle?: string, callback?: () => void): void; + /** + * Sets a JSON-compliant object to be displayed in the sidebar pane. + * @param jsonObject An object to be displayed in context of the inspected page. Evaluated in the context of the caller (API client). + * @param callback A callback invoked after the sidebar is updated with the object. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + setObject(jsonObject: Object, callback?: () => void): void; + /** + * Sets an HTML page to be displayed in the sidebar pane. + * @param path Relative path of an extension page to display within the sidebar. + */ + setPage(path: string): void; + /** Fired when the sidebar pane becomes visible as a result of user switching to the panel that hosts it. */ + onShown: ExtensionSidebarPaneShownEvent; + /** Fired when the sidebar pane becomes hidden as a result of the user switching away from the panel that hosts the sidebar pane. */ + onHidden: ExtensionSidebarPaneHiddenEvent; + } + + /** Elements panel. */ + var elements: ElementsPanel; + /** + * Since Chrome 38. + * Sources panel. + */ + var sources: SourcesPanel; + + /** + * Creates an extension panel. + * @param title Title that is displayed next to the extension icon in the Developer Tools toolbar. + * @param iconPath Path of the panel's icon relative to the extension directory. + * @param pagePath Path of the panel's HTML page relative to the extension directory. + * @param callback A function that is called when the panel is created. + * If you specify the callback parameter, it should be a function that looks like this: + * function( ExtensionPanel panel) {...}; + * Parameter panel: An ExtensionPanel object representing the created panel. + */ + export function create(title: string, iconPath: string, pagePath: string, callback?: (panel: ExtensionPanel) => void): void; + /** + * Specifies the function to be called when the user clicks a resource link in the Developer Tools window. To unset the handler, either call the method with no parameters or pass null as the parameter. + * @param callback A function that is called when the user clicks on a valid resource link in Developer Tools window. Note that if the user clicks an invalid URL or an XHR, this function is not called. + * If you specify the callback parameter, it should be a function that looks like this: + * function( devtools.inspectedWindow.Resource resource) {...}; + * Parameter resource: A devtools.inspectedWindow.Resource object for the resource that was clicked. + */ + export function setOpenResourceHandler(callback?: (resource: chrome.devtools.inspectedWindow.Resource) => void): void; + /** + * Since Chrome 38. + * Requests DevTools to open a URL in a Developer Tools panel. + * @param url The URL of the resource to open. + * @param lineNumber Specifies the line number to scroll to when the resource is loaded. + * @param callback A function that is called when the resource has been successfully loaded. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function openResource(url: string, lineNumber: number, callback: () => void): void; +} + +//////////////////// +// Document Scan +//////////////////// +/** + * Use the chrome.documentScan API to discover and retrieve images from attached paper document scanners. + * Availability: Since Chrome 44. + * Permissions: "documentScan" + * Important: This API works only on Chrome OS. + */ +declare namespace chrome.documentScan { + interface DocumentScanOptions { + /** Optional. The MIME types that are accepted by the caller. */ + mimeTypes?: string[]; + /** Optional. The number of scanned images allowed (defaults to 1). */ + maxImages?: number; + } + + interface DocumentScanCallbackArg { + /** The data image URLs in a form that can be passed as the "src" value to an image tag. */ + dataUrls: string[]; + /** The MIME type of dataUrls. */ + mimeType: string; + } + + /** + * Performs a document scan. On success, the PNG data will be sent to the callback. + * @param options Object containing scan parameters. + * @param callback Called with the result and data from the scan. + * The callback parameter should be a function that looks like this: + * function(object result) {...}; + */ + export function scan(options: DocumentScanOptions, callback: (result: DocumentScanCallbackArg) => void): void; +} + +//////////////////// +// Dev Tools - Downloads +//////////////////// +/** + * Use the chrome.downloads API to programmatically initiate, monitor, manipulate, and search for downloads. + * Availability: Since Chrome 31. + * Permissions: "downloads" + */ +declare namespace chrome.downloads { + interface HeaderNameValuePair { + /** Name of the HTTP header. */ + name: string; + /** Value of the HTTP header. */ + value: string; + } + + interface DownloadOptions { + /** Optional. Post body. */ + body?: string; + /** Optional. Use a file-chooser to allow the user to select a filename regardless of whether filename is set or already exists. */ + saveAs?: boolean; + /** The URL to download. */ + url: string; + /** Optional. A file path relative to the Downloads directory to contain the downloaded file, possibly containing subdirectories. Absolute paths, empty paths, and paths containing back-references ".." will cause an error. onDeterminingFilename allows suggesting a filename after the file's MIME type and a tentative filename have been determined. */ + filename?: string; + /** Optional. Extra HTTP headers to send with the request if the URL uses the HTTP[s] protocol. Each header is represented as a dictionary containing the keys name and either value or binaryValue, restricted to those allowed by XMLHttpRequest. */ + headers?: HeaderNameValuePair[]; + /** Optional. The HTTP method to use if the URL uses the HTTP[S] protocol. */ + method?: string; + /** Optional. The action to take if filename already exists. */ + conflictAction?: string; + } + + interface DownloadDelta { + /** Optional. The change in danger, if any. */ + danger?: StringDelta; + /** Optional. The change in url, if any. */ + url?: StringDelta; + /** Optional. The change in totalBytes, if any. */ + totalBytes?: DoubleDelta; + /** Optional. The change in filename, if any. */ + filename?: StringDelta; + /** Optional. The change in paused, if any. */ + paused?: BooleanDelta; + /** Optional. The change in state, if any. */ + state?: StringDelta; + /** Optional. The change in mime, if any. */ + mime?: StringDelta; + /** Optional. The change in fileSize, if any. */ + fileSize?: DoubleDelta; + /** Optional. The change in startTime, if any. */ + startTime?: DoubleDelta; + /** Optional. The change in error, if any. */ + error?: StringDelta; + /** Optional. The change in endTime, if any. */ + endTime?: DoubleDelta; + /** The id of the DownloadItem that changed. */ + id: number; + /** Optional. The change in canResume, if any. */ + canResume?: BooleanDelta; + /** Optional. The change in exists, if any. */ + exists?: BooleanDelta; + } + + interface BooleanDelta { + current?: boolean; + previous?: boolean; + } + + /** Since Chrome 34. */ + interface DoubleDelta { + current?: number; + previous?: number; + } + + interface StringDelta { + current?: string; + previous?: string; + } + + interface DownloadItem { + /** Number of bytes received so far from the host, without considering file compression. */ + bytesReceived: number; + /** Indication of whether this download is thought to be safe or known to be suspicious. */ + danger: string; + /** Absolute URL. */ + url: string; + /** Number of bytes in the whole file, without considering file compression, or -1 if unknown. */ + totalBytes: number; + /** Absolute local path. */ + filename: string; + /** True if the download has stopped reading data from the host, but kept the connection open. */ + paused: boolean; + /** Indicates whether the download is progressing, interrupted, or complete. */ + state: string; + /** The file's MIME type. */ + mime: string; + /** Number of bytes in the whole file post-decompression, or -1 if unknown. */ + fileSize: number; + /** The time when the download began in ISO 8601 format. May be passed directly to the Date constructor: chrome.downloads.search({}, function(items){items.forEach(function(item){console.log(new Date(item.startTime))})}) */ + startTime: string; + /** Optional. Why the download was interrupted. Several kinds of HTTP errors may be grouped under one of the errors beginning with SERVER_. Errors relating to the network begin with NETWORK_, errors relating to the process of writing the file to the file system begin with FILE_, and interruptions initiated by the user begin with USER_. */ + error?: string; + /** Optional. The time when the download ended in ISO 8601 format. May be passed directly to the Date constructor: chrome.downloads.search({}, function(items){items.forEach(function(item){if (item.endTime) console.log(new Date(item.endTime))})}) */ + endTime?: string; + /** An identifier that is persistent across browser sessions. */ + id: number; + /** False if this download is recorded in the history, true if it is not recorded. */ + incognito: boolean; + /** Absolute URL. */ + referrer: string; + /** Optional. Estimated time when the download will complete in ISO 8601 format. May be passed directly to the Date constructor: chrome.downloads.search({}, function(items){items.forEach(function(item){if (item.estimatedEndTime) console.log(new Date(item.estimatedEndTime))})}) */ + estimatedEndTime?: string; + /** True if the download is in progress and paused, or else if it is interrupted and can be resumed starting from where it was interrupted. */ + canResume: boolean; + /** Whether the downloaded file still exists. This information may be out of date because Chrome does not automatically watch for file removal. Call search() in order to trigger the check for file existence. When the existence check completes, if the file has been deleted, then an onChanged event will fire. Note that search() does not wait for the existence check to finish before returning, so results from search() may not accurately reflect the file system. Also, search() may be called as often as necessary, but will not check for file existence any more frequently than once every 10 seconds. */ + exists: boolean; + /** Optional. The identifier for the extension that initiated this download if this download was initiated by an extension. Does not change once it is set. */ + byExtensionId?: string; + /** Optional. The localized name of the extension that initiated this download if this download was initiated by an extension. May change if the extension changes its name or if the user changes their locale. */ + byExtensionName?: string; + } + + interface GetFileIconOptions { + /** Optional. * The size of the returned icon. The icon will be square with dimensions size * size pixels. The default and largest size for the icon is 32x32 pixels. The only supported sizes are 16 and 32. It is an error to specify any other size. + */ + size?: number; + } + + interface DownloadQuery { + /** Optional. Set elements of this array to DownloadItem properties in order to sort search results. For example, setting orderBy=['startTime'] sorts the DownloadItem by their start time in ascending order. To specify descending order, prefix with a hyphen: '-startTime'. */ + orderBy?: string[]; + /** Optional. Limits results to DownloadItem whose url matches the given regular expression. */ + urlRegex?: string; + /** Optional. Limits results to DownloadItem that ended before the given ms since the epoch. */ + endedBefore?: number; + /** Optional. Limits results to DownloadItem whose totalBytes is greater than the given integer. */ + totalBytesGreater?: number; + /** Optional. Indication of whether this download is thought to be safe or known to be suspicious. */ + danger?: string; + /** Optional. Number of bytes in the whole file, without considering file compression, or -1 if unknown. */ + totalBytes?: number; + /** Optional. True if the download has stopped reading data from the host, but kept the connection open. */ + paused?: boolean; + /** Optional. Limits results to DownloadItem whose filename matches the given regular expression. */ + filenameRegex?: string; + /** Optional. This array of search terms limits results to DownloadItem whose filename or url contain all of the search terms that do not begin with a dash '-' and none of the search terms that do begin with a dash. */ + query?: string[]; + /** Optional. Limits results to DownloadItem whose totalBytes is less than the given integer. */ + totalBytesLess?: number; + /** Optional. The id of the DownloadItem to query. */ + id?: number; + /** Optional. Number of bytes received so far from the host, without considering file compression. */ + bytesReceived?: number; + /** Optional. Limits results to DownloadItem that ended after the given ms since the epoch. */ + endedAfter?: number; + /** Optional. Absolute local path. */ + filename?: string; + /** Optional. Indicates whether the download is progressing, interrupted, or complete. */ + state?: string; + /** Optional. Limits results to DownloadItem that started after the given ms since the epoch. */ + startedAfter?: number; + /** Optional. The file's MIME type. */ + mime?: string; + /** Optional. Number of bytes in the whole file post-decompression, or -1 if unknown. */ + fileSize?: number; + /** Optional. The time when the download began in ISO 8601 format. */ + startTime?: number; + /** Optional. Absolute URL. */ + url?: string; + /** Optional. Limits results to DownloadItem that started before the given ms since the epoch. */ + startedBefore?: number; + /** Optional. The maximum number of matching DownloadItem returned. Defaults to 1000. Set to 0 in order to return all matching DownloadItem. See search for how to page through results. */ + limit?: number; + /** Optional. Why a download was interrupted. */ + error?: number; + /** Optional. The time when the download ended in ISO 8601 format. */ + endTime?: number; + /** Optional. Whether the downloaded file exists; */ + exists?: boolean; + } + + interface DownloadFilenameSuggestion { + /** The DownloadItem's new target DownloadItem.filename, as a path relative to the user's default Downloads directory, possibly containing subdirectories. Absolute paths, empty paths, and paths containing back-references ".." will be ignored. */ + filename: string; + /** Optional. The action to take if filename already exists. */ + conflictAction?: string; + } + + interface DownloadChangedEvent extends chrome.events.Event<(downloadDelta: DownloadDelta) => void> {} + + interface DownloadCreatedEvent extends chrome.events.Event<(downloadItem: DownloadItem) => void> {} + + interface DownloadErasedEvent extends chrome.events.Event<(downloadId: number) => void> {} + + interface DownloadDeterminingFilenameEvent extends chrome.events.Event<(downloadItem: DownloadItem, suggest: (suggestion?: DownloadFilenameSuggestion) => void) => void> {} + + /** + * Find DownloadItem. Set query to the empty object to get all DownloadItem. To get a specific DownloadItem, set only the id field. To page through a large number of items, set orderBy: ['-startTime'], set limit to the number of items per page, and set startedAfter to the startTime of the last item from the last page. + * @param callback The callback parameter should be a function that looks like this: + * function(array of DownloadItem results) {...}; + */ + export function search(query: DownloadQuery, callback: (results: DownloadItem[]) => void): void; + /** + * Pause the download. If the request was successful the download is in a paused state. Otherwise runtime.lastError contains an error message. The request will fail if the download is not active. + * @param downloadId The id of the download to pause. + * @param callback Called when the pause request is completed. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function pause(downloadId: number, callback?: () => void): void; + /** + * Retrieve an icon for the specified download. For new downloads, file icons are available after the onCreated event has been received. The image returned by this function while a download is in progress may be different from the image returned after the download is complete. Icon retrieval is done by querying the underlying operating system or toolkit depending on the platform. The icon that is returned will therefore depend on a number of factors including state of the download, platform, registered file types and visual theme. If a file icon cannot be determined, runtime.lastError will contain an error message. + * @param downloadId The identifier for the download. + * @param callback A URL to an image that represents the download. + * The callback parameter should be a function that looks like this: + * function(string iconURL) {...}; + */ + export function getFileIcon(downloadId: number, callback: (iconURL: string) => void): void; + /** + * Retrieve an icon for the specified download. For new downloads, file icons are available after the onCreated event has been received. The image returned by this function while a download is in progress may be different from the image returned after the download is complete. Icon retrieval is done by querying the underlying operating system or toolkit depending on the platform. The icon that is returned will therefore depend on a number of factors including state of the download, platform, registered file types and visual theme. If a file icon cannot be determined, runtime.lastError will contain an error message. + * @param downloadId The identifier for the download. + * @param callback A URL to an image that represents the download. + * The callback parameter should be a function that looks like this: + * function(string iconURL) {...}; + */ + export function getFileIcon(downloadId: number, options: GetFileIconOptions, callback: (iconURL: string) => void): void; + /** + * Resume a paused download. If the request was successful the download is in progress and unpaused. Otherwise runtime.lastError contains an error message. The request will fail if the download is not active. + * @param downloadId The id of the download to resume. + * @param callback Called when the resume request is completed. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function resume(downloadId: number, callback?: () => void): void; + /** + * Cancel a download. When callback is run, the download is cancelled, completed, interrupted or doesn't exist anymore. + * @param downloadId The id of the download to cancel. + * @param callback Called when the cancel request is completed. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function cancel(downloadId: number, callback?: () => void): void; + /** + * Download a URL. If the URL uses the HTTP[S] protocol, then the request will include all cookies currently set for its hostname. If both filename and saveAs are specified, then the Save As dialog will be displayed, pre-populated with the specified filename. If the download started successfully, callback will be called with the new DownloadItem's downloadId. If there was an error starting the download, then callback will be called with downloadId=undefined and runtime.lastError will contain a descriptive string. The error strings are not guaranteed to remain backwards compatible between releases. Extensions must not parse it. + * @param options What to download and how. + * @param callback Called with the id of the new DownloadItem. + * If you specify the callback parameter, it should be a function that looks like this: + * function(integer downloadId) {...}; + */ + export function download(options: DownloadOptions, callback?: (downloadId: number) => void): void; + /** + * Open the downloaded file now if the DownloadItem is complete; otherwise returns an error through runtime.lastError. Requires the "downloads.open" permission in addition to the "downloads" permission. An onChanged event will fire when the item is opened for the first time. + * @param downloadId The identifier for the downloaded file. + */ + export function open(downloadId: number): void; + /** + * Show the downloaded file in its folder in a file manager. + * @param downloadId The identifier for the downloaded file. + */ + export function show(downloadId: number): void; + /** Show the default Downloads folder in a file manager. */ + export function showDefaultFolder(): void; + /** + * Erase matching DownloadItem from history without deleting the downloaded file. An onErased event will fire for each DownloadItem that matches query, then callback will be called. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function(array of integer erasedIds) {...}; + */ + export function erase(query: DownloadQuery, callback: (erasedIds: number[]) => void): void; + /** + * Remove the downloaded file if it exists and the DownloadItem is complete; otherwise return an error through runtime.lastError. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function removeFile(downloadId: number, callback?: () => void): void; + /** + * Prompt the user to accept a dangerous download. Can only be called from a visible context (tab, window, or page/browser action popup). Does not automatically accept dangerous downloads. If the download is accepted, then an onChanged event will fire, otherwise nothing will happen. When all the data is fetched into a temporary file and either the download is not dangerous or the danger has been accepted, then the temporary file is renamed to the target filename, the |state| changes to 'complete', and onChanged fires. + * @param downloadId The identifier for the DownloadItem. + * @param callback Called when the danger prompt dialog closes. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function acceptDanger(downloadId: number, callback: () => void): void; + /** Initiate dragging the downloaded file to another application. Call in a javascript ondragstart handler. */ + export function drag(downloadId: number): void; + /** Enable or disable the gray shelf at the bottom of every window associated with the current browser profile. The shelf will be disabled as long as at least one extension has disabled it. Enabling the shelf while at least one other extension has disabled it will return an error through runtime.lastError. Requires the "downloads.shelf" permission in addition to the "downloads" permission. */ + export function setShelfEnabled(enabled: boolean): void; + + /** When any of a DownloadItem's properties except bytesReceived and estimatedEndTime changes, this event fires with the downloadId and an object containing the properties that changed. */ + var onChanged: DownloadChangedEvent; + /** This event fires with the DownloadItem object when a download begins. */ + var onCreated: DownloadCreatedEvent; + /** Fires with the downloadId when a download is erased from history. */ + var onErased: DownloadErasedEvent; + /** During the filename determination process, extensions will be given the opportunity to override the target DownloadItem.filename. Each extension may not register more than one listener for this event. Each listener must call suggest exactly once, either synchronously or asynchronously. If the listener calls suggest asynchronously, then it must return true. If the listener neither calls suggest synchronously nor returns true, then suggest will be called automatically. The DownloadItem will not complete until all listeners have called suggest. Listeners may call suggest without any arguments in order to allow the download to use downloadItem.filename for its filename, or pass a suggestion object to suggest in order to override the target filename. If more than one extension overrides the filename, then the last extension installed whose listener passes a suggestion object to suggest wins. In order to avoid confusion regarding which extension will win, users should not install extensions that may conflict. If the download is initiated by download and the target filename is known before the MIME type and tentative filename have been determined, pass filename to download instead. */ + var onDeterminingFilename: DownloadDeterminingFilenameEvent; +} + +//////////////////// +// Enterprise Platform Keys +//////////////////// +/** + * Use the chrome.enterprise.platformKeys API to generate hardware-backed keys and to install certificates for these keys. The certificates will be managed by the platform and can be used for TLS authentication, network access or by other extension through chrome.platformKeys. + * Availability: Since Chrome 37. + * Permissions: "enterprise.platformKeys" + * Important: This API works only on Chrome OS. + * Note: This API is only for extensions pre-installed by policy. + */ +declare namespace chrome.enterprise.platformKeys { + interface Token { + /** + * Uniquely identifies this Token. + * Static IDs are "user" and "system", referring to the platform's user-specific and the system-wide hardware token, respectively. Any other tokens (with other identifiers) might be returned by enterprise.platformKeys.getTokens. + */ + id: string; + /** + * Implements the WebCrypto's SubtleCrypto interface. The cryptographic operations, including key generation, are hardware-backed. + * Only non-extractable RSASSA-PKCS1-V1_5 keys with modulusLength up to 2048 can be generated. Each key can be used for signing data at most once. + * Keys generated on a specific Token cannot be used with any other Tokens, nor can they be used with window.crypto.subtle. Equally, Key objects created with window.crypto.subtle cannot be used with this interface. + */ + subtleCrypto: SubtleCrypto; + } + + /** + * Returns the available Tokens. In a regular user's session the list will always contain the user's token with id "user". If a system-wide TPM token is available, the returned list will also contain the system-wide token with id "system". The system-wide token will be the same for all sessions on this device (device in the sense of e.g. a Chromebook). + * @param callback Invoked by getTokens with the list of available Tokens. + * The callback parameter should be a function that looks like this: + * function(array of Token tokens) {...}; + * Parameter tokens: The list of available tokens. + */ + export function getToken(callback: (tokens: Token[]) => void): void; + /** + * Returns the list of all client certificates available from the given token. Can be used to check for the existence and expiration of client certificates that are usable for a certain authentication. + * @param tokenId The id of a Token returned by getTokens. + * @param callback Called back with the list of the available certificates. + * The callback parameter should be a function that looks like this: + * function(array of ArrayBuffer certificates) {...}; + * Parameter certificates: The list of certificates, each in DER encoding of a X.509 certificate. + */ + export function getCertificates(tokenId: string, callback: (certificates: ArrayBuffer) => void): void; + /** + * Imports certificate to the given token if the certified key is already stored in this token. After a successful certification request, this function should be used to store the obtained certificate and to make it available to the operating system and browser for authentication. + * @param tokenId The id of a Token returned by getTokens. + * @param certificate The DER encoding of a X.509 certificate. + * @param callback Called back when this operation is finished. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function importCertificate(tokenId: string, certificate: ArrayBuffer, callback?: () => void): void; + /** + * Removes certificate from the given token if present. Should be used to remove obsolete certificates so that they are not considered during authentication and do not clutter the certificate choice. Should be used to free storage in the certificate store. + * @param tokenId The id of a Token returned by getTokens. + * @param certificate The DER encoding of a X.509 certificate. + * @param callback Called back when this operation is finished. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function removeCertificate(tokenId: string, certificate: ArrayBuffer, callback?: () => void): void; +} + +//////////////////// +// Events +//////////////////// +/** + * The chrome.events namespace contains common types used by APIs dispatching events to notify you when something interesting happens. + * Availability: Since Chrome 21. + */ +declare namespace chrome.events { + /** Filters URLs for various criteria. See event filtering. All criteria are case sensitive. */ + interface UrlFilter { + /** Optional. Matches if the scheme of the URL is equal to any of the schemes specified in the array. */ + schemes?: string[]; + /** + * Optional. + * Since Chrome 23. + * Matches if the URL (without fragment identifier) matches a specified regular expression. Port numbers are stripped from the URL if they match the default port number. The regular expressions use the RE2 syntax. + */ + urlMatches?: string; + /** Optional. Matches if the path segment of the URL contains a specified string. */ + pathContains?: string; + /** Optional. Matches if the host name of the URL ends with a specified string. */ + hostSuffix?: string; + /** Optional. Matches if the host name of the URL starts with a specified string. */ + hostPrefix?: string; + /** Optional. Matches if the host name of the URL contains a specified string. To test whether a host name component has a prefix 'foo', use hostContains: '.foo'. This matches 'www.foobar.com' and 'foo.com', because an implicit dot is added at the beginning of the host name. Similarly, hostContains can be used to match against component suffix ('foo.') and to exactly match against components ('.foo.'). Suffix- and exact-matching for the last components need to be done separately using hostSuffix, because no implicit dot is added at the end of the host name. */ + hostContains?: string; + /** Optional. Matches if the URL (without fragment identifier) contains a specified string. Port numbers are stripped from the URL if they match the default port number. */ + urlContains?: string; + /** Optional. Matches if the query segment of the URL ends with a specified string. */ + querySuffix?: string; + /** Optional. Matches if the URL (without fragment identifier) starts with a specified string. Port numbers are stripped from the URL if they match the default port number. */ + urlPrefix?: string; + /** Optional. Matches if the host name of the URL is equal to a specified string. */ + hostEquals?: string; + /** Optional. Matches if the URL (without fragment identifier) is equal to a specified string. Port numbers are stripped from the URL if they match the default port number. */ + urlEquals?: string; + /** Optional. Matches if the query segment of the URL contains a specified string. */ + queryContains?: string; + /** Optional. Matches if the path segment of the URL starts with a specified string. */ + pathPrefix?: string; + /** Optional. Matches if the path segment of the URL is equal to a specified string. */ + pathEquals?: string; + /** Optional. Matches if the path segment of the URL ends with a specified string. */ + pathSuffix?: string; + /** Optional. Matches if the query segment of the URL is equal to a specified string. */ + queryEquals?: string; + /** Optional. Matches if the query segment of the URL starts with a specified string. */ + queryPrefix?: string; + /** Optional. Matches if the URL (without fragment identifier) ends with a specified string. Port numbers are stripped from the URL if they match the default port number. */ + urlSuffix?: string; + /** Optional. Matches if the port of the URL is contained in any of the specified port lists. For example [80, 443, [1000, 1200]] matches all requests on port 80, 443 and in the range 1000-1200. */ + ports?: any[]; + /** + * Optional. + * Since Chrome 28. + * Matches if the URL without query segment and fragment identifier matches a specified regular expression. Port numbers are stripped from the URL if they match the default port number. The regular expressions use the RE2 syntax. + */ + originAndPathMatches?: string; + } + + /** An object which allows the addition and removal of listeners for a Chrome event. */ + interface Event { + /** + * Registers an event listener callback to an event. + * @param callback Called when an event occurs. The parameters of this function depend on the type of event. + * The callback parameter should be a function that looks like this: + * function() {...}; + */ + addListener(callback: T): void; + /** + * Returns currently registered rules. + * @param callback Called with registered rules. + * The callback parameter should be a function that looks like this: + * function(array of Rule rules) {...}; + * Parameter rules: Rules that were registered, the optional parameters are filled with values. + */ + getRules(callback: (rules: Rule[]) => void): void; + /** + * Returns currently registered rules. + * @param ruleIdentifiers If an array is passed, only rules with identifiers contained in this array are returned. + * @param callback Called with registered rules. + * The callback parameter should be a function that looks like this: + * function(array of Rule rules) {...}; + * Parameter rules: Rules that were registered, the optional parameters are filled with values. + */ + getRules(ruleIdentifiers: string[], callback: (rules: Rule[]) => void): void; + /** + * @param callback Listener whose registration status shall be tested. + */ + hasListener(callback: T): boolean; + /** + * Unregisters currently registered rules. + * @param ruleIdentifiers If an array is passed, only rules with identifiers contained in this array are unregistered. + * @param callback Called when rules were unregistered. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + removeRules(ruleIdentifiers?: string[], callback?: () => void): void; + /** + * Unregisters currently registered rules. + * @param callback Called when rules were unregistered. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + removeRules(callback?: () => void): void; + /** + * Registers rules to handle events. + * @param rules Rules to be registered. These do not replace previously registered rules. + * @param callback Called with registered rules. + * If you specify the callback parameter, it should be a function that looks like this: + * function(array of Rule rules) {...}; + * Parameter rules: Rules that were registered, the optional parameters are filled with values. + */ + addRules(rules: Rule[], callback?: (rules: Rule[]) => void): void; + /** + * Deregisters an event listener callback from an event. + * @param callback Listener that shall be unregistered. + * The callback parameter should be a function that looks like this: + * function() {...}; + */ + removeListener(callback: T): void; + hasListeners(): boolean; + } + + /** Description of a declarative rule for handling events. */ + interface Rule { + /** Optional. Optional priority of this rule. Defaults to 100. */ + priority?: number; + /** List of conditions that can trigger the actions. */ + conditions: any[]; + /** Optional. Optional identifier that allows referencing this rule. */ + id?: string; + /** List of actions that are triggered if one of the condtions is fulfilled. */ + actions: any[]; + /** + * Optional. + * Since Chrome 28. + * Tags can be used to annotate rules and perform operations on sets of rules. + */ + tags?: string[]; + } +} + +//////////////////// +// Extension +//////////////////// +/** + * The chrome.extension API has utilities that can be used by any extension page. It includes support for exchanging messages between an extension and its content scripts or between extensions, as described in detail in Message Passing. + * Availability: Since Chrome 5. + */ +declare namespace chrome.extension { + interface FetchProperties { + /** Optional. The window to restrict the search to. If omitted, returns all views. */ + windowId?: number; + /** Optional. The type of view to get. If omitted, returns all views (including background pages and tabs). Valid values: 'tab', 'notification', 'popup'. */ + type?: string; + } + + interface LastError { + /** Description of the error that has taken place. */ + message: string; + } + + interface OnRequestEvent extends chrome.events.Event<((request: any, sender: runtime.MessageSender, sendResponse: (response: any) => void) => void) | ((sender: runtime.MessageSender, sendResponse: (response: any) => void) => void)> {} + + /** + * Since Chrome 7. + * True for content scripts running inside incognito tabs, and for extension pages running inside an incognito process. The latter only applies to extensions with 'split' incognito_behavior. + */ + var inIncognitoContext: boolean; + /** Set for the lifetime of a callback if an ansychronous extension api has resulted in an error. If no error has occured lastError will be undefined. */ + var lastError: LastError; + + /** Returns the JavaScript 'window' object for the background page running inside the current extension. Returns null if the extension has no background page. */ + export function getBackgroundPage(): Window | null; + /** + * Converts a relative path within an extension install directory to a fully-qualified URL. + * @param path A path to a resource within an extension expressed relative to its install directory. + */ + export function getURL(path: string): string; + /** + * Sets the value of the ap CGI parameter used in the extension's update URL. This value is ignored for extensions that are hosted in the Chrome Extension Gallery. + * Since Chrome 9. + */ + export function setUpdateUrlData(data: string): void; + /** Returns an array of the JavaScript 'window' objects for each of the pages running inside the current extension. */ + export function getViews(fetchProperties?: FetchProperties): Window[]; + /** + * Retrieves the state of the extension's access to the 'file://' scheme (as determined by the user-controlled 'Allow access to File URLs' checkbox. + * Since Chrome 12. + * @param callback The callback parameter should be a function that looks like this: + * function(boolean isAllowedAccess) {...}; + * Parameter isAllowedAccess: True if the extension can access the 'file://' scheme, false otherwise. + */ + export function isAllowedFileSchemeAccess(callback: (isAllowedAccess: boolean) => void): void; + /** + * Retrieves the state of the extension's access to Incognito-mode (as determined by the user-controlled 'Allowed in Incognito' checkbox. + * Since Chrome 12. + * @param callback The callback parameter should be a function that looks like this: + * function(boolean isAllowedAccess) {...}; + * Parameter isAllowedAccess: True if the extension has access to Incognito mode, false otherwise. + */ + export function isAllowedIncognitoAccess(callback: (isAllowedAccess: boolean) => void): void; + /** + * Sends a single request to other listeners within the extension. Similar to runtime.connect, but only sends a single request with an optional response. The extension.onRequest event is fired in each page of the extension. + * @deprecated Deprecated since Chrome 33. Please use runtime.sendMessage. + * @param extensionId The extension ID of the extension you want to connect to. If omitted, default is your own extension. + * @param responseCallback If you specify the responseCallback parameter, it should be a function that looks like this: + * function(any response) {...}; + * Parameter response: The JSON response object sent by the handler of the request. If an error occurs while connecting to the extension, the callback will be called with no arguments and runtime.lastError will be set to the error message. + */ + export function sendRequest(extensionId: string, request: any, responseCallback?: (response: any) => void): void; + /** + * Sends a single request to other listeners within the extension. Similar to runtime.connect, but only sends a single request with an optional response. The extension.onRequest event is fired in each page of the extension. + * @deprecated Deprecated since Chrome 33. Please use runtime.sendMessage. + * @param responseCallback If you specify the responseCallback parameter, it should be a function that looks like this: + * function(any response) {...}; + * Parameter response: The JSON response object sent by the handler of the request. If an error occurs while connecting to the extension, the callback will be called with no arguments and runtime.lastError will be set to the error message. + */ + export function sendRequest(request: any, responseCallback?: (response: any) => void): void; + /** + * Returns an array of the JavaScript 'window' objects for each of the tabs running inside the current extension. If windowId is specified, returns only the 'window' objects of tabs attached to the specified window. + * @deprecated Deprecated since Chrome 33. Please use extension.getViews {type: "tab"}. + */ + export function getExtensionTabs(windowId?: number): Window[]; + + /** + * Fired when a request is sent from either an extension process or a content script. + * @deprecated Deprecated since Chrome 33. Please use runtime.onMessage. + */ + var onRequest: OnRequestEvent; + /** + * Fired when a request is sent from another extension. + * @deprecated Deprecated since Chrome 33. Please use runtime.onMessageExternal. + */ + var onRequestExternal: OnRequestEvent; +} + +//////////////////// +// File Browser Handler +//////////////////// +/** + * Use the chrome.fileBrowserHandler API to extend the Chrome OS file browser. For example, you can use this API to enable users to upload files to your website. + * Availability: Since Chrome 12. + * Permissions: "fileBrowserHandler" + * Important: This API works only on Chrome OS. + */ +declare namespace chrome.fileBrowserHandler { + interface SelectionParams { + /** + * Optional. + * List of file extensions that the selected file can have. The list is also used to specify what files to be shown in the select file dialog. Files with the listed extensions are only shown in the dialog. Extensions should not include the leading '.'. Example: ['jpg', 'png'] + * Since Chrome 23. + */ + allowedFileExtensions?: string[]; + /** Suggested name for the file. */ + suggestedName: string; + } + + interface SelectionResult { + /** Optional. Selected file entry. It will be null if a file hasn't been selected. */ + entry?: Object | null; + /** Whether the file has been selected. */ + success: boolean; + } + + /** Event details payload for fileBrowserHandler.onExecute event. */ + interface FileHandlerExecuteEventDetails { + /** Optional. The ID of the tab that raised this event. Tab IDs are unique within a browser session. */ + tab_id?: number; + /** Array of Entry instances representing files that are targets of this action (selected in ChromeOS file browser). */ + entries: any[]; + } + + interface FileBrowserHandlerExecuteEvent extends chrome.events.Event<(id: string, details: FileHandlerExecuteEventDetails) => void> {} + + /** + * Prompts user to select file path under which file should be saved. When the file is selected, file access permission required to use the file (read, write and create) are granted to the caller. The file will not actually get created during the function call, so function caller must ensure its existence before using it. The function has to be invoked with a user gesture. + * Since Chrome 21. + * @param selectionParams Parameters that will be used while selecting the file. + * @param callback Function called upon completion. + * The callback parameter should be a function that looks like this: + * function(object result) {...}; + * Parameter result: Result of the method. + */ + export function selectFile(selectionParams: SelectionParams, callback: (result: SelectionResult) => void): void; + + /** Fired when file system action is executed from ChromeOS file browser. */ + var onExecute: FileBrowserHandlerExecuteEvent; +} + +//////////////////// +// File System Provider +//////////////////// +/** + * Use the chrome.fileSystemProvider API to create file systems, that can be accessible from the file manager on Chrome OS. + * Availability: Since Chrome 40. + * Permissions: "fileSystemProvider" + * Important: This API works only on Chrome OS. + */ +declare namespace chrome.fileSystemProvider { + interface OpenedFileInfo { + /** A request ID to be be used by consecutive read/write and close requests. */ + openRequestId: number; + /** The path of the opened file. */ + filePath: string; + /** Whether the file was opened for reading or writing. */ + mode: string; + } + + interface FileWatchersInfo { + /** The path of the entry being observed. */ + entryPath: string; + /** Whether watching should include all child entries recursively. It can be true for directories only. */ + recursive: boolean; + /** Optional. Tag used by the last notification for the watcher. */ + lastTag?: string; + } + + interface EntryMetadata { + /** True if it is a directory. */ + isDirectory: boolean; + /** Name of this entry (not full path name). Must not contain '/'. For root it must be empty. */ + name: string; + /** File size in bytes. */ + size: number; + /** The last modified time of this entry. */ + modificationTime: Date; + /** Optional. Mime type for the entry. */ + mimeType?: string; + /** Optional. Thumbnail image as a data URI in either PNG, JPEG or WEBP format, at most 32 KB in size. Optional, but can be provided only when explicitly requested by the onGetMetadataRequested event. */ + thumbnail?: string; + } + + interface FileSystemInfo { + /** The identifier of the file system. */ + fileSystemId: string; + /** A human-readable name for the file system. */ + displayName: string; + /** Whether the file system supports operations which may change contents of the file system (such as creating, deleting or writing to files). */ + writable: boolean; + /** + * The maximum number of files that can be opened at once. If 0, then not limited. + * @since Since Chrome 42. + */ + openedFilesLimit: number; + /** + * List of currently opened files. + * @since Since Chrome 42. + */ + openedFiles: OpenedFileInfo[]; + /** + * Optional. + * Whether the file system supports the tag field for observing directories. + * @since Since Chrome 45. Warning: this is the current Beta channel. + */ + supportsNotifyTag?: boolean; + /** + * List of watchers. + * @since Since Chrome 45. Warning: this is the current Beta channel. + */ + watchers: FileWatchersInfo[]; + } + + /** @since Since Chrome 45. Warning: this is the current Beta channel. */ + interface GetActionsRequestedOptions { + /** The identifier of the file system related to this operation. */ + fileSystemId: string; + /** The unique identifier of this request. */ + requestId: number; + /** The path of the entry to return the list of actions for. */ + entryPath: string; + } + + /** @since Since Chrome 45. Warning: this is the current Beta channel. */ + interface Action { + /** The identifier of the action. Any string or CommonActionId for common actions. */ + id: string; + /** Optional. The title of the action. It may be ignored for common actions. */ + title?: string; + } + + /** @since Since Chrome 45. Warning: this is the current Beta channel. */ + interface ExecuteActionRequestedOptions { + /** The identifier of the file system related to this operation. */ + fileSystemId: string; + /** The unique identifier of this request. */ + requestId: number; + /** The path of the entry to be used for the action. */ + entryPath: string; + /** The identifier of the action to be executed. */ + actionId: string; + } + + interface MountOptions { + /** The string indentifier of the file system. Must be unique per each extension. */ + fileSystemId: string; + /** A human-readable name for the file system. */ + displayName: string; + /** Optional. Whether the file system supports operations which may change contents of the file system (such as creating, deleting or writing to files). */ + writable?: boolean; + /** + * Optional. + * The maximum number of files that can be opened at once. If not specified, or 0, then not limited. + * @since Since Chrome 41. + */ + openedFilesLimit?: number; + /** + * Optional. + * Whether the file system supports the tag field for observed directories. + * @since Since Chrome 45. Warning: this is the current Beta channel. + */ + supportsNotifyTag?: boolean; + } + + interface UnmountOptions { + /** The identifier of the file system to be unmounted. */ + fileSystemId: string; + } + + interface NotificationChange { + /** The path of the changed entry. */ + entryPath: string; + /** The type of the change which happened to the entry. */ + changeType: string; + } + + interface NotificationOptions { + /** The identifier of the file system related to this change. */ + fileSystemId: string; + /** The path of the observed entry. */ + observedPath: string; + /** Mode of the observed entry. */ + recursive: boolean; + /** The type of the change which happened to the observed entry. If it is DELETED, then the observed entry will be automatically removed from the list of observed entries. */ + changeType: string; + /** Optional. List of changes to entries within the observed directory (including the entry itself) */ + changes?: NotificationChange[]; + /** Optional. Tag for the notification. Required if the file system was mounted with the supportsNotifyTag option. Note, that this flag is necessary to provide notifications about changes which changed even when the system was shutdown. */ + tag?: string; + } + + interface RequestedEventOptions { + /** The identifier of the file system related to this operation. */ + fileSystemId: string; + /** The unique identifier of this request. */ + requestId: number; + } + + interface EntryPathRequestedEventOptions extends RequestedEventOptions { + /** The path of the entry to which this operation is related to. */ + entryPath: string; + } + + interface MetadataRequestedEventOptions extends EntryPathRequestedEventOptions { + /** Set to true if the thumbnail is requested. */ + thumbnail: boolean; + } + + interface DirectoryPathRequestedEventOptions extends RequestedEventOptions { + /** The path of the directory which is to be operated on. */ + directoryPath: string; + } + + interface FilePathRequestedEventOptions extends RequestedEventOptions { + /** The path of the entry for the operation */ + filePath: string; + } + + interface OpenFileRequestedEventOptions extends FilePathRequestedEventOptions { + /** Whether the file will be used for reading or writing. */ + mode: string; + } + + interface OpenedFileRequestedEventOptions extends RequestedEventOptions { + /** A request ID used to open the file. */ + openRequestId: number; + } + + interface OpenedFileOffsetRequestedEventOptions extends OpenedFileRequestedEventOptions { + /** Position in the file (in bytes) to start reading from. */ + offset: number; + /** Number of bytes to be returned. */ + length: number; + } + + interface DirectoryPathRecursiveRequestedEventOptions extends DirectoryPathRequestedEventOptions { + /** Whether the operation is recursive (for directories only). */ + recursive: boolean; + } + + interface EntryPathRecursiveRequestedEventOptions extends EntryPathRequestedEventOptions { + /** Whether the operation is recursive (for directories only). */ + recursive: boolean; + } + + interface SourceTargetPathRequestedEventOptions extends RequestedEventOptions { + /** The source path for the operation. */ + sourcePath: string; + /** The destination path for the operation. */ + targetPath: string; + } + + interface FilePathLengthRequestedEventOptions extends FilePathRequestedEventOptions { + /** Number of bytes to be retained after the operation completes. */ + length: number; + } + + interface OpenedFileIoRequestedEventOptions extends OpenedFileRequestedEventOptions { + /** Position in the file (in bytes) to start operating from. */ + offset: number; + /** Buffer of bytes to be operated on the file. */ + data: ArrayBuffer; + } + + interface OperationRequestedEventOptions extends RequestedEventOptions { + /** An ID of the request to which this operation is related. */ + operationRequestId: number; + } + + interface RequestedEvent extends chrome.events.Event<(options: RequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {} + + interface MetadataRequestedEvent extends chrome.events.Event<(options: MetadataRequestedEventOptions, successCallback: (metadata: EntryMetadata) => void, errorCallback: (error: string) => void) => void> {} + + interface DirectoryPathRequestedEvent extends chrome.events.Event<(options: DirectoryPathRequestedEventOptions, successCallback: (entries: EntryMetadata[], hasMore: boolean) => void, errorCallback: (error: string) => void) => void> {} + + interface OpenFileRequestedEvent extends chrome.events.Event<(options: OpenFileRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {} + + interface OpenedFileRequestedEvent extends chrome.events.Event<(options: OpenedFileRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {} + + interface OpenedFileOffsetRequestedEvent extends chrome.events.Event<(options: OpenedFileOffsetRequestedEventOptions, successCallback: (data: ArrayBuffer, hasMore: boolean) => void, errorCallback: (error: string) => void) => void> {} + + interface DirectoryPathRecursiveRequestedEvent extends chrome.events.Event<(options: DirectoryPathRecursiveRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {} + + interface EntryPathRecursiveRequestedEvent extends chrome.events.Event<(options: EntryPathRecursiveRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {} + + interface FilePathRequestedEvent extends chrome.events.Event<(options: FilePathRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {} + + interface SourceTargetPathRequestedEvent extends chrome.events.Event<(options: SourceTargetPathRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {} + + interface FilePathLengthRequestedEvent extends chrome.events.Event<(options: FilePathLengthRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {} + + interface OpenedFileIoRequestedEvent extends chrome.events.Event<(options: OpenedFileIoRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {} + + interface OperationRequestedEvent extends chrome.events.Event<(options: OperationRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {} + + interface OptionlessRequestedEvent extends chrome.events.Event<(successCallback: Function, errorCallback: (error: string) => void) => void> {} + + /** + * Mounts a file system with the given fileSystemId and displayName. displayName will be shown in the left panel of Files.app. displayName can contain any characters including '/', but cannot be an empty string. displayName must be descriptive but doesn't have to be unique. The fileSystemId must not be an empty string. + * Depending on the type of the file system being mounted, the source option must be set appropriately. + * In case of an error, runtime.lastError will be set with a corresponding error code. + * @param callback A generic result callback to indicate success or failure. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function mount(options: MountOptions, callback?: () => void): void; + /** + * Unmounts a file system with the given fileSystemId. It must be called after onUnmountRequested is invoked. Also, the providing extension can decide to perform unmounting if not requested (eg. in case of lost connection, or a file error). + * In case of an error, runtime.lastError will be set with a corresponding error code. + * @param callback A generic result callback to indicate success or failure. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function unmount(options: UnmountOptions, callback?: () => void): void; + /** + * Returns all file systems mounted by the extension. + * @param callback Callback to receive the result of getAll function. + * The callback parameter should be a function that looks like this: + * function(array of FileSystemInfo fileSystems) {...}; + */ + export function getAll(callback: (fileSystems: FileSystemInfo[]) => void): void; + /** + * Returns information about a file system with the passed fileSystemId. + * @since Since Chrome 42. + * @param callback Callback to receive the result of get function. + * The callback parameter should be a function that looks like this: + * function(FileSystemInfo fileSystem) {...}; + */ + export function get(fileSystemId: string, callback: (fileSystem: FileSystemInfo) => void): void; + /** + * Notifies about changes in the watched directory at observedPath in recursive mode. If the file system is mounted with supportsNofityTag, then tag must be provided, and all changes since the last notification always reported, even if the system was shutdown. The last tag can be obtained with getAll. + * To use, the file_system_provider.notify manifest option must be set to true. + * Value of tag can be any string which is unique per call, so it's possible to identify the last registered notification. Eg. if the providing extension starts after a reboot, and the last registered notification's tag is equal to "123", then it should call notify for all changes which happened since the change tagged as "123". It cannot be an empty string. + * Not all providers are able to provide a tag, but if the file system has a changelog, then the tag can be eg. a change number, or a revision number. + * Note that if a parent directory is removed, then all descendant entries are also removed, and if they are watched, then the API must be notified about the fact. Also, if a directory is renamed, then all descendant entries are in fact removed, as there is no entry under their original paths anymore. + * In case of an error, runtime.lastError will be set will a corresponding error code. + * @param callback A generic result callback to indicate success or failure. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function notify(options: NotificationOptions, callback: () => void): void; + + /** Raised when unmounting for the file system with the fileSystemId identifier is requested. In the response, the unmount API method must be called together with successCallback. If unmounting is not possible (eg. due to a pending operation), then errorCallback must be called. */ + var onUnmountRequested: RequestedEvent; + /** Raised when metadata of a file or a directory at entryPath is requested. The metadata must be returned with the successCallback call. In case of an error, errorCallback must be called. */ + var onGetMetadataRequested: MetadataRequestedEvent; + /** Raised when contents of a directory at directoryPath are requested. The results must be returned in chunks by calling the successCallback several times. In case of an error, errorCallback must be called. */ + var onReadDirectoryRequested: DirectoryPathRequestedEvent; + /** Raised when opening a file at filePath is requested. If the file does not exist, then the operation must fail. Maximum number of files opened at once can be specified with MountOptions. */ + var onOpenFileRequested: OpenFileRequestedEvent; + /** Raised when opening a file previously opened with openRequestId is requested to be closed. */ + var onCloseFileRequested: OpenedFileRequestedEvent; + /** Raised when reading contents of a file opened previously with openRequestId is requested. The results must be returned in chunks by calling successCallback several times. In case of an error, errorCallback must be called. */ + var onReadFileRequested: OpenedFileOffsetRequestedEvent; + /** Raised when creating a directory is requested. The operation must fail with the EXISTS error if the target directory already exists. If recursive is true, then all of the missing directories on the directory path must be created. */ + var onCreateDirectoryRequested: DirectoryPathRecursiveRequestedEvent; + /** Raised when deleting an entry is requested. If recursive is true, and the entry is a directory, then all of the entries inside must be recursively deleted as well. */ + var onDeleteEntryRequested: EntryPathRecursiveRequestedEvent; + /** Raised when creating a file is requested. If the file already exists, then errorCallback must be called with the "EXISTS" error code. */ + var onCreateFileRequested: FilePathRequestedEvent; + /** Raised when copying an entry (recursively if a directory) is requested. If an error occurs, then errorCallback must be called. */ + var onCopyEntryRequested: SourceTargetPathRequestedEvent; + /** Raised when moving an entry (recursively if a directory) is requested. If an error occurs, then errorCallback must be called. */ + var onMoveEntryRequested: SourceTargetPathRequestedEvent; + /** Raised when truncating a file to a desired length is requested. If an error occurs, then errorCallback must be called. */ + var onTruncateRequested: FilePathLengthRequestedEvent; + /** Raised when writing contents to a file opened previously with openRequestId is requested. */ + var onWriteFileRequested: OpenedFileIoRequestedEvent; + /** Raised when aborting an operation with operationRequestId is requested. The operation executed with operationRequestId must be immediately stopped and successCallback of this abort request executed. If aborting fails, then errorCallback must be called. Note, that callbacks of the aborted operation must not be called, as they will be ignored. Despite calling errorCallback, the request may be forcibly aborted. */ + var onAbortRequested: OperationRequestedEvent; + /** + * Raised when showing a configuration dialog for fileSystemId is requested. If it's handled, the file_system_provider.configurable manfiest option must be set to true. + * @since Since Chrome 44. + */ + var onConfigureRequested: RequestedEvent; + /** + * Raised when showing a dialog for mounting a new file system is requested. If the extension/app is a file handler, then this event shouldn't be handled. Instead app.runtime.onLaunched should be handled in order to mount new file systems when a file is opened. For multiple mounts, the file_system_provider.multiple_mounts manifest option must be set to true. + * @since Since Chrome 44. + */ + var onMountRequested: OptionlessRequestedEvent; + /** + * Raised when setting a new directory watcher is requested. If an error occurs, then errorCallback must be called. + * @since Since Chrome 45. Warning: this is the current Beta channel. + */ + var onAddWatcherRequested: EntryPathRecursiveRequestedEvent; + /** + * Raised when the watcher should be removed. If an error occurs, then errorCallback must be called. + * @since Since Chrome 45. Warning: this is the current Beta channel. + */ + var onRemoveWatcherRequested: EntryPathRecursiveRequestedEvent; +} + +//////////////////// +// Font Settings +//////////////////// +/** + * Use the chrome.fontSettings API to manage Chrome's font settings. + * Availability: Since Chrome 22. + * Permissions: "fontSettings" + */ +declare namespace chrome.fontSettings { + /** Represents a font name. */ + interface FontName { + /** The display name of the font. */ + displayName: string; + /** The font ID. */ + fontId: string; + } + + interface DefaultFontSizeDetails { + /** The font size in pixels. */ + pixelSize: number; + } + + interface FontDetails { + /** The generic font family for the font. */ + genericFamily: string; + /** Optional. The script for the font. If omitted, the global script font setting is affected. */ + script?: string; + } + + interface FullFontDetails { + /** The generic font family for which the font setting has changed. */ + genericFamily: string; + /** The level of control this extension has over the setting. */ + levelOfControl: string; + /** Optional. The script code for which the font setting has changed. */ + script?: string; + /** The font ID. See the description in getFont. */ + fontId: string; + } + + interface FontDetailsResult { + /** The level of control this extension has over the setting. */ + levelOfControl: string; + /** The font ID. Rather than the literal font ID preference value, this may be the ID of the font that the system resolves the preference value to. So, fontId can differ from the font passed to setFont, if, for example, the font is not available on the system. The empty string signifies fallback to the global script font setting. */ + fontId: string; + } + + interface FontSizeDetails { + /** The font size in pixels. */ + pixelSize: number; + /** The level of control this extension has over the setting. */ + levelOfControl: string; + } + + interface SetFontSizeDetails { + /** The font size in pixels. */ + pixelSize: number; + } + + interface SetFontDetails extends FontDetails { + /** The font ID. The empty string means to fallback to the global script font setting. */ + fontId: string; + } + + interface DefaultFixedFontSizeChangedEvent extends chrome.events.Event<(details: FontSizeDetails) => void> {} + + interface DefaultFontSizeChangedEvent extends chrome.events.Event<(details: FontSizeDetails) => void> {} + + interface MinimumFontSizeChangedEvent extends chrome.events.Event<(details: FontSizeDetails) => void> {} + + interface FontChangedEvent extends chrome.events.Event<(details: FullFontDetails) => void> {} + + /** + * Sets the default font size. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function setDefaultFontSize(details: DefaultFontSizeDetails, callback?: Function): void; + /** + * Gets the font for a given script and generic font family. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function(object details) {...}; + */ + export function getFont(details: FontDetails, callback?: (details: FontDetailsResult) => void): void; + /** + * Gets the default font size. + * @param details This parameter is currently unused. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function(object details) {...}; + */ + export function getDefaultFontSize(details?: Object, callback?: (options: FontSizeDetails) => void): void; + /** + * Gets the minimum font size. + * @param details This parameter is currently unused. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function(object details) {...}; + */ + export function getMinimumFontSize(details?: FontSizeDetails, callback?: (options: FontSizeDetails) => void): void; + /** + * Sets the minimum font size. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function setMinimumFontSize(details: SetFontSizeDetails, callback?: Function): void; + /** + * Gets the default size for fixed width fonts. + * @param details This parameter is currently unused. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function(object details) {...}; + */ + export function getDefaultFixedFontSize(details?: Object, callback?: (details: FontSizeDetails) => void): void; + /** + * Clears the default font size set by this extension, if any. + * @param details This parameter is currently unused. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function clearDefaultFontSize(details?: Object, callback?: Function): void; + /** + * Sets the default size for fixed width fonts. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function setDefaultFixedFontSize(details: SetFontSizeDetails, callback?: Function): void; + /** + * Clears the font set by this extension, if any. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function clearFont(details: FontDetails, callback?: Function): void; + /** + * Sets the font for a given script and generic font family. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function(object details) {...}; + */ + export function setFont(details: SetFontDetails, callback?: Function): void; + /** + * Clears the minimum font size set by this extension, if any. + * @param details This parameter is currently unused. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function clearMinimumFontSize(details?: Object, callback?: Function): void; + /** + * Gets a list of fonts on the system. + * @param callback The callback parameter should be a function that looks like this: + * function(array of FontName results) {...}; + */ + export function getFontList(callback: (results: FontName[]) => void): void; + /** + * Clears the default fixed font size set by this extension, if any. + * @param details This parameter is currently unused. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function clearDefaultFixedFontSize(details: Object, callback?: Function): void; + + /** Fired when the default fixed font size setting changes. */ + var onDefaultFixedFontSizeChanged: DefaultFixedFontSizeChangedEvent; + /** Fired when the default font size setting changes. */ + var onDefaultFontSizeChanged: DefaultFontSizeChangedEvent; + /** Fired when the minimum font size setting changes. */ + var onMinimumFontSizeChanged: MinimumFontSizeChangedEvent; + /** Fired when a font setting changes. */ + var onFontChanged: FontChangedEvent; +} + +//////////////////// +// Google Cloud Messaging +//////////////////// +/** + * Use chrome.gcm to enable apps and extensions to send and receive messages through the Google Cloud Messaging Service. + * Availability: Since Chrome 35. + * Permissions: "gcm" + */ +declare namespace chrome.gcm { + interface OutgoingMessage { + /** The ID of the server to send the message to as assigned by Google API Console. */ + destinationId: string; + /** The ID of the message. It must be unique for each message in scope of the applications. See the Cloud Messaging documentation for advice for picking and handling an ID. */ + messageId: string; + /** Optional. Time-to-live of the message in seconds. If it is not possible to send the message within that time, an onSendError event will be raised. A time-to-live of 0 indicates that the message should be sent immediately or fail if it's not possible. The maximum and a default value of time-to-live is 86400 seconds (1 day). */ + timeToLive?: number; + /** Message data to send to the server. Case-insensitive goog. and google, as well as case-sensitive collapse_key are disallowed as key prefixes. Sum of all key/value pairs should not exceed gcm.MAX_MESSAGE_SIZE. */ + data: Object; + } + + interface IncomingMessage { + /** The message data. */ + data: Object; + /** + * Optional. + * The sender who issued the message. + * @since Since Chrome 41. + */ + from?: string; + /** + * Optional. + * The collapse key of a message. See Collapsible Messages section of Cloud Messaging documentation for details. + */ + collapseKey?: string; + } + + interface GcmError { + /** The error message describing the problem. */ + errorMessage: string; + /** Optional. The ID of the message with this error, if error is related to a specific message. */ + messageId?: string; + /** Additional details related to the error, when available. */ + detail: Object; + } + + interface MessageReceptionEvent extends chrome.events.Event<(message: IncomingMessage) => void> {} + + interface MessageDeletionEvent extends chrome.events.Event<() => void> {} + + interface GcmErrorEvent extends chrome.events.Event<(error: GcmError) => void> {} + + /** The maximum size (in bytes) of all key/value pairs in a message. */ + var MAX_MESSAGE_SIZE: number; + + /** + * Registers the application with GCM. The registration ID will be returned by the callback. If register is called again with the same list of senderIds, the same registration ID will be returned. + * @param senderIds A list of server IDs that are allowed to send messages to the application. It should contain at least one and no more than 100 sender IDs. + * @param callback Function called when registration completes. It should check runtime.lastError for error when registrationId is empty. + * The callback parameter should be a function that looks like this: + * function(string registrationId) {...}; + * Parameter registrationId: A registration ID assigned to the application by the GCM. + */ + export function register(senderIds: string[], callback: (registrationId: string) => void): void; + /** + * Unregisters the application from GCM. + * @param callback A function called after the unregistration completes. Unregistration was successful if runtime.lastError is not set. + * The callback parameter should be a function that looks like this: + * function() {...}; + */ + export function unregister(callback: () => void): void; + /** + * Sends a message according to its contents. + * @param message A message to send to the other party via GCM. + * @param callback A function called after the message is successfully queued for sending. runtime.lastError should be checked, to ensure a message was sent without problems. + * The callback parameter should be a function that looks like this: + * function(string messageId) {...}; + * Parameter messageId: The ID of the message that the callback was issued for. + */ + export function send(message: OutgoingMessage, callback: (messageId: string) => void): void; + + /** Fired when a message is received through GCM. */ + var onMessage: MessageReceptionEvent; + /** Fired when a GCM server had to delete messages sent by an app server to the application. See Messages deleted event section of Cloud Messaging documentation for details on handling this event. */ + var onMessagesDeleted: MessageDeletionEvent; + /** Fired when it was not possible to send a message to the GCM server. */ + var onSendError: GcmErrorEvent; +} + +//////////////////// +// History +//////////////////// +/** + * Use the chrome.history API to interact with the browser's record of visited pages. You can add, remove, and query for URLs in the browser's history. To override the history page with your own version, see Override Pages. + * Availability: Since Chrome 5. + * Permissions: "history" + */ +declare namespace chrome.history { + /** An object encapsulating one visit to a URL. */ + interface VisitItem { + /** The transition type for this visit from its referrer. */ + transition: string; + /** Optional. When this visit occurred, represented in milliseconds since the epoch. */ + visitTime?: number; + /** The unique identifier for this visit. */ + visitId: string; + /** The visit ID of the referrer. */ + referringVisitId: string; + /** The unique identifier for the item. */ + id: string; + } + + /** An object encapsulating one result of a history query. */ + interface HistoryItem { + /** Optional. The number of times the user has navigated to this page by typing in the address. */ + typedCount?: number; + /** Optional. The title of the page when it was last loaded. */ + title?: string; + /** Optional. The URL navigated to by a user. */ + url?: string; + /** Optional. When this page was last loaded, represented in milliseconds since the epoch. */ + lastVisitTime?: number; + /** Optional. The number of times the user has navigated to this page. */ + visitCount?: number; + /** The unique identifier for the item. */ + id: string; + } + + interface HistoryQuery { + /** A free-text query to the history service. Leave empty to retrieve all pages. */ + text: string; + /** Optional. The maximum number of results to retrieve. Defaults to 100. */ + maxResults?: number; + /** Optional. Limit results to those visited after this date, represented in milliseconds since the epoch. */ + startTime?: number; + /** Optional. Limit results to those visited before this date, represented in milliseconds since the epoch. */ + endTime?: number; + } + + interface Url { + /** The URL for the operation. It must be in the format as returned from a call to history.search. */ + url: string; + } + + interface Range { + /** Items added to history before this date, represented in milliseconds since the epoch. */ + endTime: number; + /** Items added to history after this date, represented in milliseconds since the epoch. */ + startTime: number; + } + + interface RemovedResult { + /** True if all history was removed. If true, then urls will be empty. */ + allHistory: boolean; + /** Optional. */ + urls?: string[]; + } + + interface HistoryVisitedEvent extends chrome.events.Event<(result: HistoryItem) => void> {} + + interface HistoryVisitRemovedEvent extends chrome.events.Event<(removed: RemovedResult) => void> {} + + /** + * Searches the history for the last visit time of each page matching the query. + * @param callback The callback parameter should be a function that looks like this: + * function(array of HistoryItem results) {...}; + */ + export function search(query: HistoryQuery, callback: (results: HistoryItem[]) => void): void; + /** + * Adds a URL to the history at the current time with a transition type of "link". + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function addUrl(details: Url, callback?: () => void): void; + /** + * Removes all items within the specified date range from the history. Pages will not be removed from the history unless all visits fall within the range. + * @param callback The callback parameter should be a function that looks like this: + * function() {...}; + */ + export function deleteRange(range: Range, callback: () => void): void; + /** + * Deletes all items from the history. + * @param callback The callback parameter should be a function that looks like this: + * function() {...}; + */ + export function deleteAll(callback: () => void): void; + /** + * Retrieves information about visits to a URL. + * @param callback The callback parameter should be a function that looks like this: + * function(array of VisitItem results) {...}; + */ + export function getVisits(details: Url, callback: (results: VisitItem[]) => void): void; + /** + * Removes all occurrences of the given URL from the history. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function deleteUrl(details: Url, callback?: () => void): void; + + /** Fired when a URL is visited, providing the HistoryItem data for that URL. This event fires before the page has loaded. */ + var onVisited: HistoryVisitedEvent; + /** Fired when one or more URLs are removed from the history service. When all visits have been removed the URL is purged from history. */ + var onVisitRemoved: HistoryVisitRemovedEvent; +} + +//////////////////// +// i18n +//////////////////// +/** + * Use the chrome.i18n infrastructure to implement internationalization across your whole app or extension. + * @since Chrome 5. + */ +declare namespace chrome.i18n { + /** Holds detected ISO language code and its percentage in the input string */ + interface DetectedLanguage { + /** An ISO language code such as 'en' or 'fr'. + * For a complete list of languages supported by this method, see [kLanguageInfoTable]{@link https://src.chromium.org/viewvc/chrome/trunk/src/third_party/cld/languages/internal/languages.cc}. + * For an unknown language, 'und' will be returned, which means that [percentage] of the text is unknown to CLD */ + language: string; + + /** The percentage of the detected language */ + percentage: number; + } + + /** Holds detected language reliability and array of DetectedLanguage */ + interface LanguageDetectionResult { + /** CLD detected language reliability */ + isReliable: boolean; + + /** Array of detectedLanguage */ + languages: DetectedLanguage[]; + } + + /** + * Gets the accept-languages of the browser. This is different from the locale used by the browser; to get the locale, use i18n.getUILanguage. + * @param callback The callback parameter should be a function that looks like this: + * function(array of string languages) {...}; + * Parameter languages: Array of the accept languages of the browser, such as en-US,en,zh-CN + */ + export function getAcceptLanguages(callback: (languages: string[]) => void): void; + /** + * Gets the localized string for the specified message. If the message is missing, this method returns an empty string (''). If the format of the getMessage() call is wrong — for example, messageName is not a string or the substitutions array has more than 9 elements — this method returns undefined. + * @param messageName The name of the message, as specified in the messages.json file. + * @param substitutions Optional. Up to 9 substitution strings, if the message requires any. + */ + export function getMessage(messageName: string, substitutions?: any): string; + /** + * Gets the browser UI language of the browser. This is different from i18n.getAcceptLanguages which returns the preferred user languages. + * @since Chrome 35. + */ + export function getUILanguage(): string; + + /** Detects the language of the provided text using CLD. + * @param text User input string to be translated. + * @param callback The callback parameter should be a function that looks like this: function(object result) {...}; + */ + export function detectLanguage(text: string, callback: (result: LanguageDetectionResult) => void): void; +} + +//////////////////// +// Identity +//////////////////// +/** + * Use the chrome.identity API to get OAuth2 access tokens. + * Permissions: "identity" + * @since Chrome 29. + */ +declare namespace chrome.identity { + /** @since Chrome 32. */ + interface AccountInfo { + /** A unique identifier for the account. This ID will not change for the lifetime of the account. */ + id: string; + } + + interface TokenDetails { + /** + * Optional. + * Fetching a token may require the user to sign-in to Chrome, or approve the application's requested scopes. If the interactive flag is true, getAuthToken will prompt the user as necessary. When the flag is false or omitted, getAuthToken will return failure any time a prompt would be required. + */ + interactive?: boolean; + /** + * Optional. + * The account ID whose token should be returned. If not specified, the primary account for the profile will be used. + * account is only supported when the "enable-new-profile-management" flag is set. + * @since Chrome 37. + */ + account?: AccountInfo; + /** + * Optional. + * A list of OAuth2 scopes to request. + * When the scopes field is present, it overrides the list of scopes specified in manifest.json. + * @since Chrome 37. + */ + scopes?: string[]; + } + + interface UserInfo { + /** An email address for the user account signed into the current profile. Empty if the user is not signed in or the identity.email manifest permission is not specified. */ + email: string; + /** A unique identifier for the account. This ID will not change for the lifetime of the account. Empty if the user is not signed in or (in M41+) the identity.email manifest permission is not specified. */ + id: string; + } + + interface TokenInformation { + /** The specific token that should be removed from the cache. */ + token: string; + } + + interface WebAuthFlowOptions { + /** The URL that initiates the auth flow. */ + url: string; + /** + * Optional. + * Whether to launch auth flow in interactive mode. + * Since some auth flows may immediately redirect to a result URL, launchWebAuthFlow hides its web view until the first navigation either redirects to the final URL, or finishes loading a page meant to be displayed. + * If the interactive flag is true, the window will be displayed when a page load completes. If the flag is false or omitted, launchWebAuthFlow will return with an error if the initial navigation does not complete the flow. + */ + interactive?: boolean; + } + + interface SignInChangeEvent extends chrome.events.Event<(account: AccountInfo, signedIn: boolean) => void> {} + + /** + * Retrieves a list of AccountInfo objects describing the accounts present on the profile. + * getAccounts is only supported on dev channel. + * Dev channel only. + */ + export function getAccounts(callback: (accounts: AccountInfo[]) => void): void; + /** + * Gets an OAuth2 access token using the client ID and scopes specified in the oauth2 section of manifest.json. + * The Identity API caches access tokens in memory, so it's ok to call getAuthToken non-interactively any time a token is required. The token cache automatically handles expiration. + * For a good user experience it is important interactive token requests are initiated by UI in your app explaining what the authorization is for. Failing to do this will cause your users to get authorization requests, or Chrome sign in screens if they are not signed in, with with no context. In particular, do not use getAuthToken interactively when your app is first launched. + * @param details Token options. + * @param callback Called with an OAuth2 access token as specified by the manifest, or undefined if there was an error. + * If you specify the callback parameter, it should be a function that looks like this: + * function(string token) {...}; + */ + export function getAuthToken(details: TokenDetails, callback?: (token: string) => void): void; + /** + * Retrieves email address and obfuscated gaia id of the user signed into a profile. + * This API is different from identity.getAccounts in two ways. The information returned is available offline, and it only applies to the primary account for the profile. + * @since Chrome 37. + */ + export function getProfileUserInfo(callback: (userInfo: UserInfo) => void): void; + /** + * Removes an OAuth2 access token from the Identity API's token cache. + * If an access token is discovered to be invalid, it should be passed to removeCachedAuthToken to remove it from the cache. The app may then retrieve a fresh token with getAuthToken. + * @param details Token information. + * @param callback Called when the token has been removed from the cache. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function removeCachedAuthToken(details: TokenInformation, callback?: () => void): void; + /** + * Starts an auth flow at the specified URL. + * This method enables auth flows with non-Google identity providers by launching a web view and navigating it to the first URL in the provider's auth flow. When the provider redirects to a URL matching the pattern https://.chromiumapp.org/*, the window will close, and the final redirect URL will be passed to the callback function. + * For a good user experience it is important interactive auth flows are initiated by UI in your app explaining what the authorization is for. Failing to do this will cause your users to get authorization requests with no context. In particular, do not launch an interactive auth flow when your app is first launched. + * @param details WebAuth flow options. + * @param callback Called with the URL redirected back to your application. + * The callback parameter should be a function that looks like this: + * function(string responseUrl) {...}; + */ + export function launchWebAuthFlow(details: WebAuthFlowOptions, callback: (responseUrl?: string) => void): void; + /** + * Generates a redirect URL to be used in launchWebAuthFlow. + * The generated URLs match the pattern https://.chromiumapp.org/*. + * @since Chrome 33. + * @param path Optional. The path appended to the end of the generated URL. + */ + export function getRedirectURL(path?: string): string; + + /** + * Fired when signin state changes for an account on the user's profile. + * @since Chrome 33. + */ + var onSignInChanged: SignInChangeEvent; +} + +//////////////////// +// Idle +//////////////////// +/** + * Use the chrome.idle API to detect when the machine's idle state changes. + * Permissions: "idle" + * @since Chrome 6. + */ +declare namespace chrome.idle { + interface IdleStateChangedEvent extends chrome.events.Event<(newState: string) => void> {} + + /** + * Returns "locked" if the system is locked, "idle" if the user has not generated any input for a specified number of seconds, or "active" otherwise. + * @param detectionIntervalInSeconds The system is considered idle if detectionIntervalInSeconds seconds have elapsed since the last user input detected. + * Since Chrome 25. + * @param callback The callback parameter should be a function that looks like this: + * function( IdleState newState) {...}; + */ + export function queryState(detectionIntervalInSeconds: number, callback: (newState: string) => void): void; + /** + * Sets the interval, in seconds, used to determine when the system is in an idle state for onStateChanged events. The default interval is 60 seconds. + * @since Chrome 25. + * @param intervalInSeconds Threshold, in seconds, used to determine when the system is in an idle state. + */ + export function setDetectionInterval(intervalInSeconds: number): void; + + /** Fired when the system changes to an active, idle or locked state. The event fires with "locked" if the screen is locked or the screensaver activates, "idle" if the system is unlocked and the user has not generated any input for a specified number of seconds, and "active" when the user generates input on an idle system. */ + var onStateChanged: IdleStateChangedEvent; +} + +//////////////////// +// Input - IME +//////////////////// +/** + * Use the chrome.input.ime API to implement a custom IME for Chrome OS. This allows your extension to handle keystrokes, set the composition, and manage the candidate window. + * Permissions: "input" + * @since Chrome 21. + */ +declare namespace chrome.input.ime { + /** See http://www.w3.org/TR/DOM-Level-3-Events/#events-KeyboardEvent */ + interface KeyboardEvent { + /** + * Optional. + * Whether or not the SHIFT key is pressed. + */ + shiftKey?: boolean; + /** + * Optional. + * Whether or not the ALT key is pressed. + */ + altKey?: boolean; + /** The ID of the request. */ + requestId: string; + /** Value of the key being pressed */ + key: string; + /** + * Optional. + * Whether or not the CTRL key is pressed. + */ + ctrlKey?: boolean; + /** One of keyup or keydown. */ + type: string; + /** + * Optional. + * The extension ID of the sender of this keyevent. + * @since Chrome 34. + */ + extensionId?: string; + /** + * Optional. + * Value of the physical key being pressed. The value is not affected by current keyboard layout or modifier state. + * @since Chrome 26. + */ + code: string; + /** + * Optional. + * The deprecated HTML keyCode, which is system- and implementation-dependent numerical code signifying the unmodified identifier associated with the key pressed. + * @since Chrome 37. + */ + keyCode?: number; + /** + * Optional. + * Whether or not the CAPS_LOCK is enabled. + * @since Chrome 29. + */ + capsLock?: boolean; + } + + /** Describes an input Context */ + interface InputContext { + /** This is used to specify targets of text field operations. This ID becomes invalid as soon as onBlur is called. */ + contextID: number; + /** Type of value this text field edits, (Text, Number, URL, etc) */ + type: string; + /** + * Whether the text field wants auto-correct. + * @since Chrome 40. + */ + autoCorrect: boolean; + /** + * Whether the text field wants auto-complete. + * @since Chrome 40. + */ + autoComplete: boolean; + /** + * Whether the text field wants spell-check. + * @since Chrome 40. + */ + spellCheck: boolean; + } + + /** + * A menu item used by an input method to interact with the user from the language menu. + * @since Chrome 30. + */ + interface MenuItem { + /** String that will be passed to callbacks referencing this MenuItem. */ + id: string; + /** Optional. Text displayed in the menu for this item. */ + label?: string; + /** Optional. The type of menu item. */ + style?: string; + /** Optional. Indicates this item is visible. */ + visible?: boolean; + /** Indicates this item should be drawn with a check. */ + checked?: boolean; + /** Indicates this item is enabled. */ + enabled?: boolean; + } + + interface ImeParameters { + /** MenuItems to use. */ + items: MenuItem[]; + /** ID of the engine to use */ + engineID: string; + } + + interface CommitTextParameters { + /** The text to commit */ + text: string; + /** ID of the context where the text will be committed */ + contextID: number; + } + + interface CandidateUsage { + /** The title string of details description. */ + title: string; + /** The body string of detail description. */ + body: string; + } + + interface CandidateTemplate { + /** The candidate */ + candidate: string; + /** The candidate's id */ + id: number; + /** + * Optional. + * The id to add these candidates under + */ + parentId?: number; + /** + * Optional. + * Short string displayed to next to the candidate, often the shortcut key or index + */ + label?: string; + /** + * Optional. + * Additional text describing the candidate + */ + annotation?: string; + /** + * Optional. + * The usage or detail description of word. + */ + usage?: CandidateUsage; + } + + interface CandidatesParameters { + /** ID of the context that owns the candidate window. */ + contextID: number; + /** List of candidates to show in the candidate window */ + candidates: CandidateTemplate[]; + } + + interface CompositionParameterSegment { + /** Index of the character to start this segment at */ + start: number; + /** Index of the character to end this segment after. */ + end: number; + /** The type of the underline to modify this segment. */ + style: string; + } + + interface CompositionParameters { + /** ID of the context where the composition text will be set */ + contextID: number; + /** Text to set */ + text: string; + /** Optional. List of segments and their associated types. */ + segments: CompositionParameterSegment[]; + /** Position in the text of the cursor. */ + cursor: number; + /** Optional. Position in the text that the selection starts at. */ + selectionStart?: number; + /** Optional. Position in the text that the selection ends at. */ + selectionEnd?: number; + } + + interface MenuItemParameters { + items: Object[]; + engineId: string; + } + + interface CandidateWindowParameterProperties { + /** + * Optional. + * True to show the cursor, false to hide it. + */ + cursorVisible?: boolean; + /** + * Optional. + * True if the candidate window should be rendered vertical, false to make it horizontal. + */ + vertical?: boolean; + /** + * Optional. + * The number of candidates to display per page. + */ + pageSize?: number; + /** + * Optional. + * True to display the auxiliary text, false to hide it. + */ + auxiliaryTextVisible?: boolean; + /** + * Optional. + * Text that is shown at the bottom of the candidate window. + */ + auxiliaryText?: string; + /** + * Optional. + * True to show the Candidate window, false to hide it. + */ + visible?: boolean; + /** + * Optional. + * Where to display the candidate window. + * @since Chrome 28. + */ + windowPosition?: string; + } + + interface CandidateWindowParameter { + /** ID of the engine to set properties on. */ + engineID: string; + properties: CandidateWindowParameterProperties; + } + + interface ClearCompositionParameters { + /** ID of the context where the composition will be cleared */ + contextID: number; + } + + interface CursorPositionParameters { + /** ID of the candidate to select. */ + candidateID: number; + /** ID of the context that owns the candidate window. */ + contextID: number; + } + + interface SendKeyEventParameters { + /** ID of the context where the key events will be sent, or zero to send key events to non-input field. */ + contextID: number; + /** Data on the key event. */ + keyData: KeyboardEvent[]; + } + + interface DeleteSurroundingTextParameters { + /** ID of the engine receiving the event. */ + engineID: string; + /** ID of the context where the surrounding text will be deleted. */ + contextID: number; + /** The offset from the caret position where deletion will start. This value can be negative. */ + offset: number; + /** The number of characters to be deleted */ + length: number; + } + + interface SurroundingTextInfo { + /** The text around cursor. */ + text: string; + /** The ending position of the selection. This value indicates caret position if there is no selection. */ + focus: number; + /** The beginning position of the selection. This value indicates caret position if is no selection. */ + anchor: number; + } + + interface BlurEvent extends chrome.events.Event<(contextID: number) => void> {} + + interface CandidateClickedEvent extends chrome.events.Event<(engineID: string, candidateID: number, button: string) => void> {} + + interface KeyEventEvent extends chrome.events.Event<(engineID: string, keyData: KeyboardEvent) => void> {} + + interface DeactivatedEvent extends chrome.events.Event<(engineID: string) => void> {} + + interface InputContextUpdateEvent extends chrome.events.Event<(context: InputContext) => void> {} + + interface ActivateEvent extends chrome.events.Event<(engineID: string, screen: string) => void> {} + + interface FocusEvent extends chrome.events.Event<(context: InputContext) => void> {} + + interface MenuItemActivatedEvent extends chrome.events.Event<(engineID: string, name: string) => void> {} + + interface SurroundingTextChangedEvent extends chrome.events.Event<(engineID: string, surroundingInfo: SurroundingTextInfo) => void> {} + + interface InputResetEvent extends chrome.events.Event<(engineID: string) => void> {} + + /** + * Adds the provided menu items to the language menu when this IME is active. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function setMenuItems(parameters: ImeParameters, callback?: () => void): void; + /** + * Commits the provided text to the current input. + * @param callback Called when the operation completes with a boolean indicating if the text was accepted or not. On failure, chrome.runtime.lastError is set. + * If you specify the callback parameter, it should be a function that looks like this: + * function(boolean success) {...}; + */ + export function commitText(parameters: CommitTextParameters, callback?: (success: boolean) => void): void; + /** + * Sets the current candidate list. This fails if this extension doesn't own the active IME + * @param callback Called when the operation completes. + * If you specify the callback parameter, it should be a function that looks like this: + * function(boolean success) {...}; + */ + export function setCandidates(parameters: CandidatesParameters, callback?: (success: boolean) => void): void; + /** + * Set the current composition. If this extension does not own the active IME, this fails. + * @param callback Called when the operation completes with a boolean indicating if the text was accepted or not. On failure, chrome.runtime.lastError is set. + * If you specify the callback parameter, it should be a function that looks like this: + * function(boolean success) {...}; + */ + export function setComposition(parameters: CompositionParameters, callback?: (success: boolean) => void): void; + /** + * Updates the state of the MenuItems specified + * @param callback Called when the operation completes + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function updateMenuItems(parameters: MenuItemParameters, callback?: () => void): void; + /** + * Sets the properties of the candidate window. This fails if the extension doesn't own the active IME + * @param callback Called when the operation completes. + * If you specify the callback parameter, it should be a function that looks like this: + * function(boolean success) {...}; + */ + export function setCandidateWindowProperties(parameters: CandidateWindowParameter, callback?: (success: boolean) => void): void; + /** + * Clear the current composition. If this extension does not own the active IME, this fails. + * @param callback Called when the operation completes with a boolean indicating if the text was accepted or not. On failure, chrome.runtime.lastError is set. + * If you specify the callback parameter, it should be a function that looks like this: + * function(boolean success) {...}; + */ + export function clearComposition(parameters: ClearCompositionParameters, callback?: (success: boolean) => void): void; + /** + * Set the position of the cursor in the candidate window. This is a no-op if this extension does not own the active IME. + * @param callback Called when the operation completes + * If you specify the callback parameter, it should be a function that looks like this: + * function(boolean success) {...}; + */ + export function setCursorPosition(parameters: CursorPositionParameters, callback?: (success: boolean) => void): void; + /** + * Sends the key events. This function is expected to be used by virtual keyboards. When key(s) on a virtual keyboard is pressed by a user, this function is used to propagate that event to the system. + * @since Chrome 33. + * @param callback Called when the operation completes. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function sendKeyEvents(parameters: SendKeyEventParameters, callback?: () => void): void; + /** + * Hides the input view window, which is popped up automatically by system. If the input view window is already hidden, this function will do nothing. + * @since Chrome 34. + */ + export function hideInputView(): void; + /** + * Deletes the text around the caret. + * @since Chrome 27. + */ + export function deleteSurroundingText(parameters: DeleteSurroundingTextParameters, callback?: () => void): void; + /** + * Indicates that the key event received by onKeyEvent is handled. This should only be called if the onKeyEvent listener is asynchronous. + * @since Chrome 25. + * @param requestId Request id of the event that was handled. This should come from keyEvent.requestId + * @param response True if the keystroke was handled, false if not + */ + export function keyEventHandled(requestId: string, response: boolean): void; + + /** This event is sent when focus leaves a text box. It is sent to all extensions that are listening to this event, and enabled by the user. */ + var onBlur: BlurEvent; + /** This event is sent if this extension owns the active IME. */ + var onCandidateClicked: CandidateClickedEvent; + /** This event is sent if this extension owns the active IME. */ + var onKeyEvent: KeyEventEvent; + /** This event is sent when an IME is deactivated. It signals that the IME will no longer be receiving onKeyPress events. */ + var onDeactivated: DeactivatedEvent; + /** This event is sent when the properties of the current InputContext change, such as the the type. It is sent to all extensions that are listening to this event, and enabled by the user. */ + var onInputContextUpdate: InputContextUpdateEvent; + /** This event is sent when an IME is activated. It signals that the IME will be receiving onKeyPress events. */ + var onActivate: ActivateEvent; + /** This event is sent when focus enters a text box. It is sent to all extensions that are listening to this event, and enabled by the user. */ + var onFocus: FocusEvent; + /** Called when the user selects a menu item */ + var onMenuItemActivated: MenuItemActivatedEvent; + /** + * Called when the editable string around caret is changed or when the caret position is moved. The text length is limited to 100 characters for each back and forth direction. + * @since Chrome 27. + */ + var onSurroundingTextChanged: SurroundingTextChangedEvent; + /** + * This event is sent when chrome terminates ongoing text input session. + * @since Chrome 29. + */ + var onReset: InputResetEvent; +} + +//////////////////// +// Management +//////////////////// +/** + * The chrome.management API provides ways to manage the list of extensions/apps that are installed and running. It is particularly useful for extensions that override the built-in New Tab page. + * Permissions: "management" + * @since Chrome 8. + */ +declare namespace chrome.management { + /** Information about an installed extension, app, or theme. */ + interface ExtensionInfo { + /** + * Optional. + * A reason the item is disabled. + * @since Chrome 17. + */ + disabledReason?: string; + /** Optional. The launch url (only present for apps). */ + appLaunchUrl?: string; + /** + * The description of this extension, app, or theme. + * @since Chrome 9. + */ + description: string; + /** + * Returns a list of API based permissions. + * @since Chrome 9. + */ + permissions: string[]; + /** + * Optional. + * A list of icon information. Note that this just reflects what was declared in the manifest, and the actual image at that url may be larger or smaller than what was declared, so you might consider using explicit width and height attributes on img tags referencing these images. See the manifest documentation on icons for more details. + */ + icons?: IconInfo[]; + /** + * Returns a list of host based permissions. + * @since Chrome 9. + */ + hostPermissions: string[]; + /** Whether it is currently enabled or disabled. */ + enabled: boolean; + /** + * Optional. + * The URL of the homepage of this extension, app, or theme. + * @since Chrome 11. + */ + homepageUrl?: string; + /** + * Whether this extension can be disabled or uninstalled by the user. + * @since Chrome 12. + */ + mayDisable: boolean; + /** + * How the extension was installed. + * @since Chrome 22. + */ + installType: string; + /** The version of this extension, app, or theme. */ + version: string; + /** The extension's unique identifier. */ + id: string; + /** + * Whether the extension, app, or theme declares that it supports offline. + * @since Chrome 15. + */ + offlineEnabled: boolean; + /** + * Optional. + * The update URL of this extension, app, or theme. + * @since Chrome 16. + */ + updateUrl?: string; + /** + * The type of this extension, app, or theme. + * @since Chrome 23. + */ + type: string; + /** The url for the item's options page, if it has one. */ + optionsUrl: string; + /** The name of this extension, app, or theme. */ + name: string; + /** + * A short version of the name of this extension, app, or theme. + * @since Chrome 31. + */ + shortName: string; + /** + * True if this is an app. + * @deprecated since Chrome 33. Please use management.ExtensionInfo.type. + */ + isApp: boolean; + /** + * Optional. + * The app launch type (only present for apps). + * @since Chrome 37. + */ + launchType?: string; + /** + * Optional. + * The currently available launch types (only present for apps). + * @since Chrome 37. + */ + availableLaunchTypes?: string[]; + } + + /** Information about an icon belonging to an extension, app, or theme. */ + interface IconInfo { + /** The URL for this icon image. To display a grayscale version of the icon (to indicate that an extension is disabled, for example), append ?grayscale=true to the URL. */ + url: string; + /** A number representing the width and height of the icon. Likely values include (but are not limited to) 128, 48, 24, and 16. */ + size: number; + } + + interface UninstallOptions { + /** + * Optional. + * Whether or not a confirm-uninstall dialog should prompt the user. Defaults to false for self uninstalls. If an extension uninstalls another extension, this parameter is ignored and the dialog is always shown. + */ + showConfirmDialog?: boolean; + } + + interface ManagementDisabledEvent extends chrome.events.Event<(info: ExtensionInfo) => void> {} + + interface ManagementUninstalledEvent extends chrome.events.Event<(id: string) => void> {} + + interface ManagementInstalledEvent extends chrome.events.Event<(info: ExtensionInfo) => void> {} + + interface ManagementEnabledEvent extends chrome.events.Event<(info: ExtensionInfo) => void> {} + + /** + * Enables or disables an app or extension. + * @param id This should be the id from an item of management.ExtensionInfo. + * @param enabled Whether this item should be enabled or disabled. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function setEnabled(id: string, enabled: boolean, callback?: () => void): void; + /** + * Returns a list of permission warnings for the given extension id. + * @since Chrome 15. + * @param id The ID of an already installed extension. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function(array of string permissionWarnings) {...}; + */ + export function getPermissionWarningsById(id: string, callback?: (permissionWarnings: string[]) => void): void; + /** + * Returns information about the installed extension, app, or theme that has the given ID. + * @since Chrome 9. + * @param id The ID from an item of management.ExtensionInfo. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function( ExtensionInfo result) {...}; + */ + export function get(id: string, callback?: (result: ExtensionInfo) => void): void; + /** + * Returns a list of information about installed extensions and apps. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function(array of ExtensionInfo result) {...}; + */ + export function getAll(callback?: (result: ExtensionInfo[]) => void): void; + /** + * Returns a list of permission warnings for the given extension manifest string. Note: This function can be used without requesting the 'management' permission in the manifest. + * @since Chrome 15. + * @param manifestStr Extension manifest JSON string. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function(array of string permissionWarnings) {...}; + */ + export function getPermissionWarningsByManifest(manifestStr: string, callback?: (permissionwarnings: string[]) => void): void; + /** + * Launches an application. + * @param id The extension id of the application. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function launchApp(id: string, callback?: () => void): void; + /** + * Uninstalls a currently installed app or extension. + * @since Chrome 21. + * @param id This should be the id from an item of management.ExtensionInfo. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function uninstall(id: string, options?: UninstallOptions, callback?: () => void): void; + /** + * Uninstalls a currently installed app or extension. + * @deprecated since Chrome 21. The options parameter was added to this function. + * @param id This should be the id from an item of management.ExtensionInfo. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function uninstall(id: string, callback?: () => void): void; + /** + * Returns information about the calling extension, app, or theme. Note: This function can be used without requesting the 'management' permission in the manifest. + * @since Chrome 39. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function( ExtensionInfo result) {...}; + */ + export function getSelf(callback?: (result: ExtensionInfo) => void): void; + /** + * Uninstalls the calling extension. + * Note: This function can be used without requesting the 'management' permission in the manifest. + * @since Chrome 26. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function uninstallSelf(options?: UninstallOptions, callback?: () => void): void; + /** + * Uninstalls the calling extension. + * Note: This function can be used without requesting the 'management' permission in the manifest. + * @since Chrome 26. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function uninstallSelf(callback?: () => void): void; + /** + * Display options to create shortcuts for an app. On Mac, only packaged app shortcuts can be created. + * @since Chrome 37. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function createAppShortcut(id: string, callback?: () => void): void; + /** + * Set the launch type of an app. + * @since Chrome 37. + * @param id This should be the id from an app item of management.ExtensionInfo. + * @param launchType The target launch type. Always check and make sure this launch type is in ExtensionInfo.availableLaunchTypes, because the available launch types vary on different platforms and configurations. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function setLaunchType(id: string, launchType: string, callback?: () => void): void; + /** + * Generate an app for a URL. Returns the generated bookmark app. + * @since Chrome 37. + * @param url The URL of a web page. The scheme of the URL can only be "http" or "https". + * @param title The title of the generated app. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function( ExtensionInfo result) {...}; + */ + export function generateAppForLink(url: string, title: string, callback?: (result: ExtensionInfo) => void): void; + + /** Fired when an app or extension has been disabled. */ + var onDisabled: ManagementDisabledEvent; + /** Fired when an app or extension has been uninstalled. */ + var onUninstalled: ManagementUninstalledEvent; + /** Fired when an app or extension has been installed. */ + var onInstalled: ManagementInstalledEvent; + /** Fired when an app or extension has been enabled. */ + var onEnabled: ManagementEnabledEvent; +} + +//////////////////// +// Notifications +//////////////////// +/** + * Use the networking.config API to authenticate to captive portals. + * Permissions: "networking.config" + * Important: This API works only on Chrome OS. + * @since Chrome 43. + */ +declare namespace chrome.networking.config { + interface NetworkInfo { + /** Currently only WiFi supported. */ + Type: string; + /** Optional. A unique identifier of the network. */ + GUID?: string; + /** Optional. A hex-encoded byte sequence. */ + HexSSID?: string; + /** Optional. The decoded SSID of the network (default encoding is UTF-8). To filter for non-UTF-8 SSIDs, use HexSSID instead. */ + SSID?: string; + /** Optional. The basic service set identification (BSSID) uniquely identifying the basic service set. BSSID is represented as a human readable, hex-encoded string with bytes separated by colons, e.g. 45:67:89:ab:cd:ef. */ + BSSID?: string; + /** Optional. Identifier indicating the security type of the network. Valid values are None, WEP-PSK, WPA-PSK and WPA-EAP. */ + Security?: string; + } + + interface CaptivePorttalDetectedEvent extends chrome.events.Event<(networkInfo: NetworkInfo) => void> {} + + /** + * Allows an extension to define network filters for the networks it can handle. A call to this function will remove all filters previously installed by the extension before setting the new list. + * @param networks Network filters to set. Every NetworkInfo must either have the SSID or HexSSID set. Other fields will be ignored. + * @param callback Called back when this operation is finished. + * The callback parameter should be a function that looks like this: + * function() {...}; + */ + export function setNetworkFilter(networks: NetworkInfo[], callback: () => void): void; + /** + * Called by the extension to notify the network config API that it finished a captive portal authentication attempt and hand over the result of the attempt. This function must only be called with the GUID of the latest onCaptivePortalDetected event. + * @param GUID Unique network identifier obtained from onCaptivePortalDetected. + * @param result The result of the authentication attempt. + * unhandled: The extension does not handle this network or captive portal (e.g. server end-point not found or not compatible). + * succeeded: The extension handled this network and authenticated successfully. + * rejected: The extension handled this network, tried to authenticate, however was rejected by the server. + * failed: The extension handled this network, tried to authenticate, however failed due to an unspecified error. + * @param callback Called back when this operation is finished. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function finishAuthentication(GUID: string, result: string, callback?: () => void): void; + + /** This event fires everytime a captive portal is detected on a network matching any of the currently registered network filters and the user consents to use the extension for authentication. Network filters may be set using the setNetworkFilter. Upon receiving this event the extension should start its authentication attempt with the captive portal. When the extension finishes its attempt, it must call finishAuthentication with the GUID received with this event and the appropriate authentication result. */ + var onCaptivePortalDetected: CaptivePorttalDetectedEvent; +} + +//////////////////// +// Notifications +// https://developer.chrome.com/extensions/notifications +//////////////////// +/** + * Use the chrome.notifications API to create rich notifications using templates and show these notifications to users in the system tray. + * Permissions: "notifications" + * @since Chrome 28. + */ +declare namespace chrome.notifications { + interface ButtonOptions { + title: string; + iconUrl?: string; + } + + interface ItemOptions { + /** Title of one item of a list notification. */ + title: string; + /** Additional details about this item. */ + message: string; + } + + interface NotificationOptions { + /** Optional. Which type of notification to display. Required for notifications.create method. */ + type?: string; + /** + * Optional. + * A URL to the sender's avatar, app icon, or a thumbnail for image notifications. + * URLs can be a data URL, a blob URL, or a URL relative to a resource within this extension's .crx file Required for notifications.create method. + */ + iconUrl?: string; + /** Optional. Title of the notification (e.g. sender name for email). Required for notifications.create method. */ + title?: string; + /** Optional. Main notification content. Required for notifications.create method. */ + message?: string; + /** + * Optional. + * Alternate notification content with a lower-weight font. + * @since Chrome 31. + */ + contextMessage?: string; + /** Optional. Priority ranges from -2 to 2. -2 is lowest priority. 2 is highest. Zero is default. */ + priority?: number; + /** Optional. A timestamp associated with the notification, in milliseconds past the epoch (e.g. Date.now() + n). */ + eventTime?: number; + /** Optional. Text and icons for up to two notification action buttons. */ + buttons?: ButtonOptions[]; + /** Optional. Items for multi-item notifications. */ + items?: ItemOptions[]; + /** + * Optional. + * Current progress ranges from 0 to 100. + * @since Chrome 30. + */ + progress?: number; + /** + * Optional. + * Whether to show UI indicating that the app will visibly respond to clicks on the body of a notification. + * @since Chrome 32. + */ + isClickable?: boolean; + /** + * Optional. + * A URL to the app icon mask. URLs have the same restrictions as iconUrl. The app icon mask should be in alpha channel, as only the alpha channel of the image will be considered. + * @since Chrome 38. + */ + appIconMaskUrl?: string; + /** Optional. A URL to the image thumbnail for image-type notifications. URLs have the same restrictions as iconUrl. */ + imageUrl?: string; + /** + * Indicates that the notification should remain visible on screen until the user activates or dismisses the notification. + * This defaults to false. + * @since Chrome 50 + */ + requireInteraction?: boolean; + } + + interface NotificationClosedEvent extends chrome.events.Event<(notificationId: string, byUser: boolean) => void> {} + + interface NotificationClickedEvent extends chrome.events.Event<(notificationId: string) => void> {} + + interface NotificationButtonClickedEvent extends chrome.events.Event<(notificationId: string, buttonIndex: number) => void> {} + + interface NotificationPermissionLevelChangedEvent extends chrome.events.Event<(level: string) => void> {} + + interface NotificationShowSettingsEvent extends chrome.events.Event<() => void> {} + + /** The notification closed, either by the system or by user action. */ + export var onClosed: NotificationClosedEvent; + /** The user clicked in a non-button area of the notification. */ + export var onClicked: NotificationClickedEvent; + /** The user pressed a button in the notification. */ + export var onButtonClicked: NotificationButtonClickedEvent; + /** + * The user changes the permission level. + * @since Chrome 32. + */ + export var onPermissionLevelChanged: NotificationPermissionLevelChangedEvent; + /** + * The user clicked on a link for the app's notification settings. + * @since Chrome 32. + */ + export var onShowSettings: NotificationShowSettingsEvent; + + /** + * Creates and displays a notification. + * @param notificationId Identifier of the notification. If not set or empty, an ID will automatically be generated. If it matches an existing notification, this method first clears that notification before proceeding with the create operation. + * The notificationId parameter is required before Chrome 42. + * @param options Contents of the notification. + * @param callback Returns the notification id (either supplied or generated) that represents the created notification. + * The callback is required before Chrome 42. + * If you specify the callback parameter, it should be a function that looks like this: + * function(string notificationId) {...}; + */ + export function create(notificationId: string, options: NotificationOptions, callback?: (notificationId: string) => void): void; + /** + * Creates and displays a notification. + * @param notificationId Identifier of the notification. If not set or empty, an ID will automatically be generated. If it matches an existing notification, this method first clears that notification before proceeding with the create operation. + * The notificationId parameter is required before Chrome 42. + * @param options Contents of the notification. + * @param callback Returns the notification id (either supplied or generated) that represents the created notification. + * The callback is required before Chrome 42. + * If you specify the callback parameter, it should be a function that looks like this: + * function(string notificationId) {...}; + */ + export function create(options: NotificationOptions, callback?: (notificationId: string) => void): void; + /** + * Updates an existing notification. + * @param notificationId The id of the notification to be updated. This is returned by notifications.create method. + * @param options Contents of the notification to update to. + * @param callback Called to indicate whether a matching notification existed. + * The callback is required before Chrome 42. + * If you specify the callback parameter, it should be a function that looks like this: + * function(boolean wasUpdated) {...}; + */ + export function update(notificationId: string, options: NotificationOptions, callback?: (wasUpdated: boolean) => void): void; + /** + * Clears the specified notification. + * @param notificationId The id of the notification to be cleared. This is returned by notifications.create method. + * @param callback Called to indicate whether a matching notification existed. + * The callback is required before Chrome 42. + * If you specify the callback parameter, it should be a function that looks like this: + * function(boolean wasCleared) {...}; + */ + export function clear(notificationId: string, callback?: (wasCleared: boolean) => void): void; + /** + * Retrieves all the notifications. + * @since Chrome 29. + * @param callback Returns the set of notification_ids currently in the system. + * The callback parameter should be a function that looks like this: + * function(object notifications) {...}; + */ + export function getAll(callback: (notifications: Object) => void): void; + /** + * Retrieves whether the user has enabled notifications from this app or extension. + * @since Chrome 32. + * @param callback Returns the current permission level. + * The callback parameter should be a function that looks like this: + * function( PermissionLevel level) {...}; + */ + export function getPermissionLevel(callback: (level: string) => void): void; +} + +//////////////////// +// Omnibox +//////////////////// +/** + * The omnibox API allows you to register a keyword with Google Chrome's address bar, which is also known as the omnibox. + * Manifest: "omnibox": {...} + * @since Chrome 9. + */ +declare namespace chrome.omnibox { + /** A suggest result. */ + interface SuggestResult { + /** The text that is put into the URL bar, and that is sent to the extension when the user chooses this entry. */ + content: string; + /** The text that is displayed in the URL dropdown. Can contain XML-style markup for styling. The supported tags are 'url' (for a literal URL), 'match' (for highlighting text that matched what the user's query), and 'dim' (for dim helper text). The styles can be nested, eg. dimmed match. You must escape the five predefined entities to display them as text: stackoverflow.com/a/1091953/89484 */ + description: string; + } + + interface Suggestion { + /** The text that is displayed in the URL dropdown. Can contain XML-style markup for styling. The supported tags are 'url' (for a literal URL), 'match' (for highlighting text that matched what the user's query), and 'dim' (for dim helper text). The styles can be nested, eg. dimmed match. */ + description: string; + } + + interface OmniboxInputEnteredEvent extends chrome.events.Event<(text: string) => void> {} + + interface OmniboxInputChangedEvent extends chrome.events.Event<(text: string, suggest: (suggestResults: SuggestResult[]) => void) => void> {} + + interface OmniboxInputStartedEvent extends chrome.events.Event<() => void> {} + + interface OmniboxInputCancelledEvent extends chrome.events.Event<() => void> {} + + /** + * Sets the description and styling for the default suggestion. The default suggestion is the text that is displayed in the first suggestion row underneath the URL bar. + * @param suggestion A partial SuggestResult object, without the 'content' parameter. + */ + export function setDefaultSuggestion(suggestion: Suggestion): void; + + /** User has accepted what is typed into the omnibox. */ + var onInputEntered: OmniboxInputEnteredEvent; + /** User has changed what is typed into the omnibox. */ + var onInputChanged: OmniboxInputChangedEvent; + /** User has started a keyword input session by typing the extension's keyword. This is guaranteed to be sent exactly once per input session, and before any onInputChanged events. */ + var onInputStarted: OmniboxInputStartedEvent; + /** User has ended the keyword input session without accepting the input. */ + var onInputCancelled: OmniboxInputCancelledEvent; +} + +//////////////////// +// Page Action +//////////////////// +/** + * Use the chrome.pageAction API to put icons inside the address bar. Page actions represent actions that can be taken on the current page, but that aren't applicable to all pages. + * Manifest: "page_action": {...} + * @since Chrome 5. + */ +declare namespace chrome.pageAction { + interface PageActionClickedEvent extends chrome.events.Event<(tab: chrome.tabs.Tab) => void> {} + + interface TitleDetails { + /** The id of the tab for which you want to modify the page action. */ + tabId: number; + /** The tooltip string. */ + title: string; + } + + interface GetDetails { + /** Specify the tab to get the title from. */ + tabId: number; + } + + interface PopupDetails { + /** The id of the tab for which you want to modify the page action. */ + tabId: number; + /** The html file to show in a popup. If set to the empty string (''), no popup is shown. */ + popup: string; + } + + interface IconDetails { + /** The id of the tab for which you want to modify the page action. */ + tabId: number; + /** + * Optional. + * @deprecated This argument is ignored. + */ + iconIndex?: number; + /** + * Optional. + * Either an ImageData object or a dictionary {size -> ImageData} representing icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals scale, then image with size scale * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'19': foo}' + */ + imageData?: ImageData; + /** + * Optional. + * Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals scale, then image with size scale * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.imageData = {'19': foo}' + */ + path?: any; + } + + /** + * Shows the page action. The page action is shown whenever the tab is selected. + * @param tabId The id of the tab for which you want to modify the page action. + */ + export function hide(tabId: number): void; + /** + * Shows the page action. The page action is shown whenever the tab is selected. + * @param tabId The id of the tab for which you want to modify the page action. + */ + export function show(tabId: number): void; + /** Sets the title of the page action. This is displayed in a tooltip over the page action. */ + export function setTitle(details: TitleDetails): void; + /** Sets the html document to be opened as a popup when the user clicks on the page action's icon. */ + export function setPopup(details: PopupDetails): void; + /** + * Gets the title of the page action. + * @since Chrome 19. + * @param callback The callback parameter should be a function that looks like this: + * function(string result) {...}; + */ + export function getTitle(details: GetDetails, callback: (result: string) => void): void; + /** + * Gets the html document set as the popup for this page action. + * @since Chrome 19. + * @param callback The callback parameter should be a function that looks like this: + * function(string result) {...}; + */ + export function getPopup(details: GetDetails, callback: (result: string) => void): void; + /** + * Sets the icon for the page action. The icon can be specified either as the path to an image file or as the pixel data from a canvas element, or as dictionary of either one of those. Either the path or the imageData property must be specified. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function setIcon(details: IconDetails, callback?: () => void): void; + + /** Fired when a page action icon is clicked. This event will not fire if the page action has a popup. */ + var onClicked: PageActionClickedEvent; +} + +//////////////////// +// Page Capture +//////////////////// +/** + * Use the chrome.pageCapture API to save a tab as MHTML. + * Permissions: "pageCapture" + * @since Chrome 18. + */ +declare namespace chrome.pageCapture { + interface SaveDetails { + /** The id of the tab to save as MHTML. */ + tabId: number; + } + + /** + * Saves the content of the tab with given id as MHTML. + * @param callback Called when the MHTML has been generated. + * The callback parameter should be a function that looks like this: + * function(binary mhtmlData) {...}; + * Parameter mhtmlData: The MHTML data as a Blob. + */ + export function saveAsMHTML(details: SaveDetails, callback: (mhtmlData: any) => void): void; +} + +//////////////////// +// Permissions +//////////////////// +/** + * Use the chrome.permissions API to request declared optional permissions at run time rather than install time, so users understand why the permissions are needed and grant only those that are necessary. + * @since Chrome 16. + */ +declare namespace chrome.permissions { + interface Permissions { + /** + * Optional. + * List of named permissions (does not include hosts or origins). Anything listed here must appear in the optional_permissions list in the manifest. + */ + origins?: string[]; + /** + * Optional. + * List of origin permissions. Anything listed here must be a subset of a host that appears in the optional_permissions list in the manifest. For example, if http://*.example.com/ or http://* appears in optional_permissions, you can request an origin of http://help.example.com/. Any path is ignored. + */ + permissions?: string[]; + } + + interface PermissionsRemovedEvent { + /** + * @param callback The callback parameter should be a function that looks like this: + * function( Permissions permissions) {...}; + * Parameter permissions: The permissions that have been removed. + */ + addListener(callback: (permissions: Permissions) => void): void; + } + + interface PermissionsAddedEvent { + /** + * @param callback The callback parameter should be a function that looks like this: + * function( Permissions permissions) {...}; + * Parameter permissions: The newly acquired permissions. + */ + addListener(callback: (permissions: Permissions) => void): void; + } + + /** + * Checks if the extension has the specified permissions. + * @param callback The callback parameter should be a function that looks like this: + * function(boolean result) {...}; + * Parameter result: True if the extension has the specified permissions. + */ + export function contains(permissions: Permissions, callback: (result: boolean) => void): void; + /** + * Gets the extension's current set of permissions. + * @param callback The callback parameter should be a function that looks like this: + * function( Permissions permissions) {...}; + * Parameter permissions: The extension's active permissions. + */ + export function getAll(callback: (permissions: Permissions) => void): void; + /** + * Requests access to the specified permissions. These permissions must be defined in the optional_permissions field of the manifest. If there are any problems requesting the permissions, runtime.lastError will be set. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function(boolean granted) {...}; + * Parameter granted: True if the user granted the specified permissions. + */ + export function request(permissions: Permissions, callback?: (granted: boolean) => void): void; + /** + * Removes access to the specified permissions. If there are any problems removing the permissions, runtime.lastError will be set. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function(boolean removed) {...}; + * Parameter removed: True if the permissions were removed. + */ + export function remove(permissions: Permissions, callback?: (removed: boolean) => void): void; + + /** Fired when access to permissions has been removed from the extension. */ + var onRemoved: PermissionsRemovedEvent; + /** Fired when the extension acquires new permissions. */ + var onAdded: PermissionsAddedEvent; +} + +//////////////////// +// Platform Keys +//////////////////// +/** + * Use the chrome.platformKeys API to access client certificates managed by the platform. If the user or policy grants the permission, an extension can use such a certficate in its custom authentication protocol. E.g. this allows usage of platform managed certificates in third party VPNs (see chrome.vpnProvider). + * Permissions: "platformKeys" + * Important: This API works only on Chrome OS. + * @since Chrome 45. + */ +declare namespace chrome.platformKeys { + interface Match { + /** The DER encoding of a X.509 certificate. */ + certificate: ArrayBuffer; + /** The KeyAlgorithm of the certified key. This contains algorithm parameters that are inherent to the key of the certificate (e.g. the key length). Other parameters like the hash function used by the sign function are not included. */ + keyAlgorithm: KeyAlgorithm; + } + + interface ClientCertificateSelectRequestDetails { + /** This field is a list of the types of certificates requested, sorted in order of the server's preference. Only certificates of a type contained in this list will be retrieved. If certificateTypes is the empty list, however, certificates of any type will be returned. */ + certificateTypes: string[]; + /** List of distinguished names of certificate authorities allowed by the server. Each entry must be a DER-encoded X.509 DistinguishedName. */ + certificateAuthorities: ArrayBuffer[]; + } + + interface ClientCertificateSelectDetails { + /** Only certificates that match this request will be returned. */ + request: ClientCertificateSelectRequestDetails; + /** + * Optional. + * If given, the selectClientCertificates operates on this list. Otherwise, obtains the list of all certificates from the platform's certificate stores that are available to this extensions. Entries that the extension doesn't have permission for or which doesn't match the request, are removed. + */ + clientCerts?: ArrayBuffer[]; + /** If true, the filtered list is presented to the user to manually select a certificate and thereby granting the extension access to the certificate(s) and key(s). Only the selected certificate(s) will be returned. If is false, the list is reduced to all certificates that the extension has been granted access to (automatically or manually). */ + interactive: boolean; + } + + interface ServerCertificateVerificationDetails { + /** Each chain entry must be the DER encoding of a X.509 certificate, the first entry must be the server certificate and each entry must certify the entry preceding it. */ + serverCertificateChain: ArrayBuffer[]; + /** The hostname of the server to verify the certificate for, e.g. the server that presented the serverCertificateChain. */ + hostname: string; + } + + interface ServerCertificateVerificationResult { + /** The result of the trust verification: true if trust for the given verification details could be established and false if trust is rejected for any reason. */ + trusted: boolean; + /** + * If the trust verification failed, this array contains the errors reported by the underlying network layer. Otherwise, this array is empty. + * Note: This list is meant for debugging only and may not contain all relevant errors. The errors returned may change in future revisions of this API, and are not guaranteed to be forwards or backwards compatible. + */ + debug_errors: string[]; + } + + /** + * This function filters from a list of client certificates the ones that are known to the platform, match request and for which the extension has permission to access the certificate and its private key. If interactive is true, the user is presented a dialog where he can select from matching certificates and grant the extension access to the certificate. The selected/filtered client certificates will be passed to callback. + * @param callback The callback parameter should be a function that looks like this: + * function(array of Match matches) {...}; + * Parameter matches: The list of certificates that match the request, that the extension has permission for and, if interactive is true, that were selected by the user. + */ + export function selectClientCertificates(details: ClientCertificateSelectDetails, callback: (matches: Match[]) => void): void; + /** + * Passes the key pair of certificate for usage with platformKeys.subtleCrypto to callback. + * @param certificate The certificate of a Match returned by selectClientCertificates. + * @param parameters Determines signature/hash algorithm parameters additionally to the parameters fixed by the key itself. The same parameters are accepted as by WebCrypto's importKey function, e.g. RsaHashedImportParams for a RSASSA-PKCS1-v1_5 key. For RSASSA-PKCS1-v1_5 keys, additionally the parameters { 'hash': { 'name': 'none' } } are supported. The sign function will then apply PKCS#1 v1.5 padding and but not hash the given data. + * @param callback The public and private CryptoKey of a certificate which can only be used with platformKeys.subtleCrypto. + * The callback parameter should be a function that looks like this: + * function(object publicKey, object privateKey) {...}; + * Optional parameter privateKey: Might be null if this extension does not have access to it. + */ + export function getKeyPair(certificate: ArrayBuffer, parameters: Object, callback: (publicKey: CryptoKey, privateKey: CryptoKey | null) => void): void; + /** An implementation of WebCrypto's SubtleCrypto that allows crypto operations on keys of client certificates that are available to this extension. */ + export function subtleCrypto(): SubtleCrypto; + /** + * Checks whether details.serverCertificateChain can be trusted for details.hostname according to the trust settings of the platform. Note: The actual behavior of the trust verification is not fully specified and might change in the future. The API implementation verifies certificate expiration, validates the certification path and checks trust by a known CA. The implementation is supposed to respect the EKU serverAuth and to support subject alternative names. + * @param callback The callback parameter should be a function that looks like this: + * function(object result) {...}; + */ + export function verifyTLSServerCertificate(details: ServerCertificateVerificationDetails, callback: (result: ServerCertificateVerificationResult) => void): void; +} + +//////////////////// +// Power +//////////////////// +/** + * Use the chrome.power API to override the system's power management features. + * Permissions: "power" + * @since Chrome 27. + */ +declare namespace chrome.power { + /** Requests that power management be temporarily disabled. |level| describes the degree to which power management should be disabled. If a request previously made by the same app is still active, it will be replaced by the new request. */ + export function requestKeepAwake(level: string): void; + /** Releases a request previously made via requestKeepAwake(). */ + export function releaseKeepAwake(): void; +} + +//////////////////// +// Printer Provider +//////////////////// +/** + * The chrome.printerProvider API exposes events used by print manager to query printers controlled by extensions, to query their capabilities and to submit print jobs to these printers. + * Permissions: "printerProvider" + * @since Chrome 44. + */ +declare namespace chrome.printerProvider { + interface PrinterInfo { + /** Unique printer ID. */ + id: string; + /** Printer's human readable name. */ + name: string; + /** Optional. Printer's human readable description. */ + description?: string; + } + + interface PrinterCapabilities { + /** Device capabilities in CDD format. */ + capabilities: any; + } + + interface PrintJob { + /** ID of the printer which should handle the job. */ + printerId: string; + /** The print job title. */ + title: string; + /** Print ticket in CJT format. */ + ticket: Object; + /** The document content type. Supported formats are "application/pdf" and "image/pwg-raster". */ + contentType: string; + /** Blob containing the document data to print. Format must match |contentType|. */ + document: Blob; + } + + interface PrinterRequestedEvent extends chrome.events.Event<(resultCallback: (printerInfo: PrinterInfo[]) => void) => void> {} + + interface PrinterInfoRequestedEvent extends chrome.events.Event<(device: any, resultCallback: (printerInfo?: PrinterInfo) => void) => void> {} + + interface CapabilityRequestedEvent extends chrome.events.Event<(printerId: string, resultCallback: (capabilities: PrinterCapabilities) => void) => void> {} + + interface PrintRequestedEvent extends chrome.events.Event<(printJob: PrintJob, resultCallback: (result: string) => void) => void> {} + + /** Event fired when print manager requests printers provided by extensions. */ + export var onGetPrintersRequested: PrinterRequestedEvent; + /** + * Event fired when print manager requests information about a USB device that may be a printer. + * Note: An application should not rely on this event being fired more than once per device. If a connected device is supported it should be returned in the onGetPrintersRequested event. + * @since Chrome 45. + */ + export var onGetUsbPrinterInfoRequested: PrinterInfoRequestedEvent; + /** Event fired when print manager requests printer capabilities. */ + export var onGetCapabilityRequested: CapabilityRequestedEvent; + /** Event fired when print manager requests printing. */ + export var onPrintRequested: PrintRequestedEvent; +} + +//////////////////// +// Privacy +//////////////////// +/** + * Use the chrome.privacy API to control usage of the features in Chrome that can affect a user's privacy. This API relies on the ChromeSetting prototype of the type API for getting and setting Chrome's configuration. + * Permissions: "privacy" + * The Chrome Privacy Whitepaper gives background detail regarding the features which this API can control. + * @since Chrome 18. + */ +declare namespace chrome.privacy { + interface Services { + /** since Chrome 20. */ + spellingServiceEnabled: chrome.types.ChromeSetting; + searchSuggestEnabled: chrome.types.ChromeSetting; + instantEnabled: chrome.types.ChromeSetting; + alternateErrorPagesEnabled: chrome.types.ChromeSetting; + safeBrowsingEnabled: chrome.types.ChromeSetting; + autofillEnabled: chrome.types.ChromeSetting; + translationServiceEnabled: chrome.types.ChromeSetting; + /** @since Chrome 38. */ + passwordSavingEnabled: chrome.types.ChromeSetting; + /** @since Chrome 42. */ + hotwordSearchEnabled: chrome.types.ChromeSetting; + /** @since Chrome 42. */ + safeBrowsingExtendedReportingEnabled: chrome.types.ChromeSetting; + } + + interface Network { + networkPredictionEnabled: chrome.types.ChromeSetting; + /** @since Chrome 42. */ + webRTCMultipleRoutesEnabled: chrome.types.ChromeSetting; + /** @since Chrome 47. Warning: this is the current Dev channel. */ + webRTCNonProxiedUdpEnabled: chrome.types.ChromeSetting; + } + + interface Websites { + thirdPartyCookiesAllowed: chrome.types.ChromeSetting; + referrersEnabled: chrome.types.ChromeSetting; + hyperlinkAuditingEnabled: chrome.types.ChromeSetting; + /** @since Chrome 21. */ + protectedContentEnabled: chrome.types.ChromeSetting; + } + + /** Settings that enable or disable features that require third-party network services provided by Google and your default search provider. */ + var services: Services; + /** Settings that influence Chrome's handling of network connections in general. */ + var network: Network; + /** Settings that determine what information Chrome makes available to websites. */ + var websites: Websites; +} + +//////////////////// +// Proxy +//////////////////// +/** + * Use the chrome.proxy API to manage Chrome's proxy settings. This API relies on the ChromeSetting prototype of the type API for getting and setting the proxy configuration. + * Permissions: "proxy" + * @since Chrome 13. + */ +declare namespace chrome.proxy { + /** An object holding proxy auto-config information. Exactly one of the fields should be non-empty. */ + interface PacScript { + /** Optional. URL of the PAC file to be used. */ + url?: string; + /** Optional. If true, an invalid PAC script will prevent the network stack from falling back to direct connections. Defaults to false. */ + mandatory?: boolean; + /** Optional. A PAC script. */ + data?: string; + } + + /** An object encapsulating a complete proxy configuration. */ + interface ProxyConfig { + /** Optional. The proxy rules describing this configuration. Use this for 'fixed_servers' mode. */ + rules?: ProxyRules; + /** Optional. The proxy auto-config (PAC) script for this configuration. Use this for 'pac_script' mode. */ + pacScript?: PacScript; + /** + * 'direct' = Never use a proxy + * 'auto_detect' = Auto detect proxy settings + * 'pac_script' = Use specified PAC script + * 'fixed_servers' = Manually specify proxy servers + * 'system' = Use system proxy settings + */ + mode: string; + } + + /** An object encapsulating a single proxy server's specification. */ + interface ProxyServer { + /** The URI of the proxy server. This must be an ASCII hostname (in Punycode format). IDNA is not supported, yet. */ + host: string; + /** Optional. The scheme (protocol) of the proxy server itself. Defaults to 'http'. */ + scheme?: string; + /** Optional. The port of the proxy server. Defaults to a port that depends on the scheme. */ + port?: number; + } + + /** An object encapsulating the set of proxy rules for all protocols. Use either 'singleProxy' or (a subset of) 'proxyForHttp', 'proxyForHttps', 'proxyForFtp' and 'fallbackProxy'. */ + interface ProxyRules { + /** Optional. The proxy server to be used for FTP requests. */ + proxyForFtp?: ProxyServer; + /** Optional. The proxy server to be used for HTTP requests. */ + proxyForHttp?: ProxyServer; + /** Optional. The proxy server to be used for everthing else or if any of the specific proxyFor... is not specified. */ + fallbackProxy?: ProxyServer; + /** Optional. The proxy server to be used for all per-URL requests (that is http, https, and ftp). */ + singleProxy?: ProxyServer; + /** Optional. The proxy server to be used for HTTPS requests. */ + proxyForHttps?: ProxyServer; + /** Optional. List of servers to connect to without a proxy server. */ + bypassList?: string[]; + } + + interface ErrorDetails { + /** Additional details about the error such as a JavaScript runtime error. */ + details: string; + /** The error description. */ + error: string; + /** If true, the error was fatal and the network transaction was aborted. Otherwise, a direct connection is used instead. */ + fatal: boolean; + } + + interface ProxyErrorEvent extends chrome.events.Event<(details: ErrorDetails) => void> {} + + var settings: chrome.types.ChromeSetting; + /** Notifies about proxy errors. */ + var onProxyError: ProxyErrorEvent; +} + +//////////////////// +// Runtime +//////////////////// +/** + * Use the chrome.runtime API to retrieve the background page, return details about the manifest, and listen for and respond to events in the app or extension lifecycle. You can also use this API to convert the relative path of URLs to fully-qualified URLs. + * @since Chrome 22 + */ +declare namespace chrome.runtime { + /** This will be defined during an API method callback if there was an error */ + var lastError: LastError | undefined; + /** The ID of the extension/app. */ + var id: string; + + interface LastError { + /** Optional. Details about the error which occurred. */ + message?: string; + } + + interface ConnectInfo { + name?: string; + } + + interface InstalledDetails { + /** + * The reason that this event is being dispatched. + * One of: "install", "update", "chrome_update", or "shared_module_update" + */ + reason: string; + /** + * Optional. + * Indicates the previous version of the extension, which has just been updated. This is present only if 'reason' is 'update'. + */ + previousVersion?: string; + /** + * Optional. + * Indicates the ID of the imported shared module extension which updated. This is present only if 'reason' is 'shared_module_update'. + * @since Chrome 29. + */ + id?: string; + } + + interface MessageOptions { + /** Whether the TLS channel ID will be passed into onMessageExternal for processes that are listening for the connection event. */ + includeTlsChannelId?: boolean; + } + + /** + * An object containing information about the script context that sent a message or request. + * @since Chrome 26. + */ + interface MessageSender { + /** The ID of the extension or app that opened the connection, if any. */ + id?: string; + /** The tabs.Tab which opened the connection, if any. This property will only be present when the connection was opened from a tab (including content scripts), and only if the receiver is an extension, not an app. */ + tab?: chrome.tabs.Tab; + /** + * The frame that opened the connection. 0 for top-level frames, positive for child frames. This will only be set when tab is set. + * @since Chrome 41. + */ + frameId?: number; + /** + * The URL of the page or frame that opened the connection. If the sender is in an iframe, it will be iframe's URL not the URL of the page which hosts it. + * @since Chrome 28. + */ + url?: string; + /** + * The TLS channel ID of the page or frame that opened the connection, if requested by the extension or app, and if available. + * @since Chrome 32. + */ + tlsChannelId?: string; + } + + /** + * An object containing information about the current platform. + * @since Chrome 36. + */ + interface PlatformInfo { + /** + * The operating system chrome is running on. + * One of: "mac", "win", "android", "cros", "linux", or "openbsd" + */ + os: string; + /** + * The machine's processor architecture. + * One of: "arm", "x86-32", or "x86-64" + */ + arch: string; + /** + * The native client architecture. This may be different from arch on some platforms. + * One of: "arm", "x86-32", or "x86-64" + */ + nacl_arch: string; + } + + /** + * An object which allows two way communication with other pages. + * @since Chrome 26. + */ + interface Port { + postMessage: (message: Object) => void; + disconnect: () => void; + /** + * Optional. + * This property will only be present on ports passed to onConnect/onConnectExternal listeners. + */ + sender?: MessageSender; + /** An object which allows the addition and removal of listeners for a Chrome event. */ + onDisconnect: PortDisconnectEvent; + /** An object which allows the addition and removal of listeners for a Chrome event. */ + onMessage: PortMessageEvent; + name: string; + } + + interface UpdateAvailableDetails { + /** The version number of the available update. */ + version: string; + } + + interface UpdateCheckDetails { + /** The version of the available update. */ + version: string; + } + + interface PortDisconnectEvent extends chrome.events.Event<(port: Port) => void> {} + + interface PortMessageEvent extends chrome.events.Event<(message: Object, port: Port) => void> {} + + interface ExtensionMessageEvent extends chrome.events.Event<(message: any, sender: MessageSender, sendResponse: (response: any) => void) => void> {} + + interface ExtensionConnectEvent extends chrome.events.Event<(port: Port) => void> {} + + interface RuntimeInstalledEvent extends chrome.events.Event<(details: InstalledDetails) => void> {} + + interface RuntimeEvent extends chrome.events.Event<() => void> {} + + interface RuntimeRestartRequiredEvent extends chrome.events.Event<(reason: string) => void> {} + + interface RuntimeUpdateAvailableEvent extends chrome.events.Event<(details: UpdateAvailableDetails) => void> {} + + interface ManifestIcons { + [size: number]: string; + } + + interface ManifestAction { + default_icon?: ManifestIcons; + default_title?: string; + default_popup?: string; + } + + interface SearchProvider { + name?: string; + keyword?: string; + favicon_url?: string; + search_url: string; + encoding?: string; + suggest_url?: string; + instant_url?: string; + image_url?: string; + search_url_post_params?: string; + suggest_url_post_params?: string; + instant_url_post_params?: string; + image_url_post_params?: string; + alternate_urls?: string[]; + prepopulated_id?: number; + is_default?: boolean; + } + + interface Manifest { + // Required + manifest_version: number; + name: string; + version: string; + + // Recommended + default_locale?: string; + description?: string; + icons?: ManifestIcons; + + // Pick one (or none) + browser_action?: ManifestAction; + page_action?: ManifestAction; + + // Optional + author?: any; + automation?: any; + background?: { + scripts?: string[]; + page?: string; + persistent?: boolean; + }; + background_page?: string; + chrome_settings_overrides?: { + homepage?: string; + search_provider?: SearchProvider; + startup_pages?: string[]; + }; + chrome_ui_overrides?: { + bookmarks_ui?: { + remove_bookmark_shortcut?: boolean; + remove_button?: boolean; + } + }; + chrome_url_overrides?: { + bookmarks?: string; + history?: string; + newtab?: string; + }; + commands?: { + [name: string]: { + suggested_key?: { + default?: string; + windows?: string; + mac?: string; + chromeos?: string; + linux?: string; + }; + description?: string; + global?: boolean + } + }; + content_capabilities?: { + matches?: string[]; + permissions?: string[]; + }; + content_scripts?: { + matches?: string[]; + exclude_matches?: string[]; + css?: string[]; + js?: string[]; + run_at?: string; + all_frames?: boolean; + include_globs?: string[]; + exclude_globs?: string[]; + }[]; + content_security_policy?: string; + converted_from_user_script?: boolean; + copresence?: any; + current_locale?: string; + devtools_page?: string; + event_rules?: { + event?: string; + actions?: { + type: string; + }[]; + conditions?: chrome.declarativeContent.PageStateMatcher[] + }[]; + externally_connectable?: { + ids?: string[]; + matches?: string[]; + accepts_tls_channel_id?: boolean; + }; + file_browser_handlers?: { + id?: string; + default_title?: string; + file_filters?: string[]; + }[]; + file_system_provider_capabilities?: { + configurable?: boolean; + watchable?: boolean; + multiple_mounts?: boolean; + source?: string; + }; + homepage_url?: string; + import?: { + id: string; + minimum_version?: string + }[]; + export?: { + whitelist?: string[] + }; + incognito?: string; + input_components?: { + name?: string; + type?: string; + id?: string; + description?: string; + language?: string; + layouts?: any[]; + }[]; + key?: string; + minimum_chrome_version?: string; + nacl_modules?: { + path: string; + mime_type: string; + }[]; + oauth2?: { + client_id: string; + scopes?: string[]; + }; + offline_enabled?: boolean; + omnibox?: { + keyword: string; + }; + optional_permissions?: string[]; + options_page?: string; + options_ui?: { + page?: string; + chrome_style?: boolean; + open_in_tab?: boolean; + }; + permissions?: string[]; + platforms?: { + nacl_arch?: string; + sub_package_path: string; + }[]; + plugins?: { + path: string; + }[]; + requirements?: { + '3D'?: { + features?: string[] + }; + plugins?: { + npapi?: boolean; + } + }; + sandbox?: { + pages: string[]; + content_security_policy?: string; + }; + short_name?: string; + signature?: any; + spellcheck?: { + dictionary_language?: string; + dictionary_locale?: string; + dictionary_format?: string; + dictionary_path?: string; + }; + storage?: { + managed_schema: string + }; + system_indicator?: any; + tts_engine?: { + voices: { + voice_name: string; + lang?: string; + gender?: string; + event_types?: string[]; + }[] + }; + update_url?: string; + version_name?: string; + web_accessible_resources?: string[]; + [key: string]: any; + } + + /** + * Attempts to connect to connect listeners within an extension/app (such as the background page), or other extensions/apps. This is useful for content scripts connecting to their extension processes, inter-app/extension communication, and web messaging. Note that this does not connect to any listeners in a content script. Extensions may connect to content scripts embedded in tabs via tabs.connect. + * @since Chrome 26. + */ + export function connect(connectInfo?: ConnectInfo): Port; + /** + * Attempts to connect to connect listeners within an extension/app (such as the background page), or other extensions/apps. This is useful for content scripts connecting to their extension processes, inter-app/extension communication, and web messaging. Note that this does not connect to any listeners in a content script. Extensions may connect to content scripts embedded in tabs via tabs.connect. + * @since Chrome 26. + * @param extensionId Optional. + * The ID of the extension or app to connect to. If omitted, a connection will be attempted with your own extension. Required if sending messages from a web page for web messaging. + */ + export function connect(extensionId: string, connectInfo?: ConnectInfo): Port; + /** + * Connects to a native application in the host machine. + * @since Chrome 28. + * @param application The name of the registered application to connect to. + */ + export function connectNative(application: string): Port; + /** Retrieves the JavaScript 'window' object for the background page running inside the current extension/app. If the background page is an event page, the system will ensure it is loaded before calling the callback. If there is no background page, an error is set. */ + export function getBackgroundPage(callback: (backgroundPage?: Window) => void): void; + /** + * Returns details about the app or extension from the manifest. The object returned is a serialization of the full manifest file. + * @returns The manifest details. + */ + export function getManifest(): Manifest; + /** + * Returns a DirectoryEntry for the package directory. + * @since Chrome 29. + */ + export function getPackageDirectoryEntry(callback: (directoryEntry: DirectoryEntry) => void): void; + /** + * Returns information about the current platform. + * @since Chrome 29. + * @param callback Called with results + */ + export function getPlatformInfo(callback: (platformInfo: PlatformInfo) => void): void; + /** + * Converts a relative path within an app/extension install directory to a fully-qualified URL. + * @param path A path to a resource within an app/extension expressed relative to its install directory. + */ + export function getURL(path: string): string; + /** + * Reloads the app or extension. + * @since Chrome 25. + */ + export function reload(): void; + /** + * Requests an update check for this app/extension. + * @since Chrome 25. + * @param callback + * Parameter status: Result of the update check. One of: "throttled", "no_update", or "update_available" + * Optional parameter details: If an update is available, this contains more information about the available update. + */ + export function requestUpdateCheck(callback: (status: string, details?: UpdateCheckDetails) => void): void; + /** + * Restart the ChromeOS device when the app runs in kiosk mode. Otherwise, it's no-op. + * @since Chrome 32. + */ + export function restart(): void; + /** + * Sends a single message to event listeners within your extension/app or a different extension/app. Similar to runtime.connect but only sends a single message, with an optional response. If sending to your extension, the runtime.onMessage event will be fired in each page, or runtime.onMessageExternal, if a different extension. Note that extensions cannot send messages to content scripts using this method. To send messages to content scripts, use tabs.sendMessage. + * @since Chrome 26. + * @param responseCallback Optional + * Parameter response: The JSON response object sent by the handler of the message. If an error occurs while connecting to the extension, the callback will be called with no arguments and runtime.lastError will be set to the error message. + */ + export function sendMessage(message: any, responseCallback?: (response: any) => void): void; + /** + * Sends a single message to event listeners within your extension/app or a different extension/app. Similar to runtime.connect but only sends a single message, with an optional response. If sending to your extension, the runtime.onMessage event will be fired in each page, or runtime.onMessageExternal, if a different extension. Note that extensions cannot send messages to content scripts using this method. To send messages to content scripts, use tabs.sendMessage. + * @since Chrome 32. + * @param responseCallback Optional + * Parameter response: The JSON response object sent by the handler of the message. If an error occurs while connecting to the extension, the callback will be called with no arguments and runtime.lastError will be set to the error message. + */ + export function sendMessage(message: any, options: MessageOptions, responseCallback?: (response: any) => void): void; + /** + * Sends a single message to event listeners within your extension/app or a different extension/app. Similar to runtime.connect but only sends a single message, with an optional response. If sending to your extension, the runtime.onMessage event will be fired in each page, or runtime.onMessageExternal, if a different extension. Note that extensions cannot send messages to content scripts using this method. To send messages to content scripts, use tabs.sendMessage. + * @since Chrome 26. + * @param extensionId The ID of the extension/app to send the message to. If omitted, the message will be sent to your own extension/app. Required if sending messages from a web page for web messaging. + * @param responseCallback Optional + * Parameter response: The JSON response object sent by the handler of the message. If an error occurs while connecting to the extension, the callback will be called with no arguments and runtime.lastError will be set to the error message. + */ + export function sendMessage(extensionId: string, message: any, responseCallback?: (response: any) => void): void; + /** + * Sends a single message to event listeners within your extension/app or a different extension/app. Similar to runtime.connect but only sends a single message, with an optional response. If sending to your extension, the runtime.onMessage event will be fired in each page, or runtime.onMessageExternal, if a different extension. Note that extensions cannot send messages to content scripts using this method. To send messages to content scripts, use tabs.sendMessage. + * @since Chrome 32. + * @param extensionId The ID of the extension/app to send the message to. If omitted, the message will be sent to your own extension/app. Required if sending messages from a web page for web messaging. + * @param responseCallback Optional + * Parameter response: The JSON response object sent by the handler of the message. If an error occurs while connecting to the extension, the callback will be called with no arguments and runtime.lastError will be set to the error message. + */ + export function sendMessage(extensionId: string, message: any, options: MessageOptions, responseCallback?: (response: any) => void): void; + /** + * Send a single message to a native application. + * @since Chrome 28. + * @param application The of the native messaging host. + * @param message The message that will be passed to the native messaging host. + * @param responseCallback Optional. + * Parameter response: The response message sent by the native messaging host. If an error occurs while connecting to the native messaging host, the callback will be called with no arguments and runtime.lastError will be set to the error message. + */ + export function sendNativeMessage(application: string, message: Object, responseCallback?: (response: any) => void): void; + /** + * Sets the URL to be visited upon uninstallation. This may be used to clean up server-side data, do analytics, and implement surveys. Maximum 255 characters. + * @since Chrome 41. + * @param url Since Chrome 34. + * 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; + /** + * 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. + * If your Extension does not declare an options page, or Chrome failed to create one for some other reason, the callback will set lastError. + * @since Chrome 42. + */ + export function openOptionsPage(callback?: () => void): void; + + /** + * Fired when a connection is made from either an extension process or a content script. + * @since Chrome 26. + */ + var onConnect: ExtensionConnectEvent; + /** + * Fired when a connection is made from another extension. + * @since Chrome 26. + */ + var onConnectExternal: ExtensionConnectEvent; + /** Sent to the event page just before it is unloaded. This gives the extension opportunity to do some clean up. Note that since the page is unloading, any asynchronous operations started while handling this event are not guaranteed to complete. If more activity for the event page occurs before it gets unloaded the onSuspendCanceled event will be sent and the page won't be unloaded. */ + var onSuspend: RuntimeEvent; + /** + * Fired when a profile that has this extension installed first starts up. This event is not fired when an incognito profile is started, even if this extension is operating in 'split' incognito mode. + * @since Chrome 23. + */ + var onStartup: RuntimeEvent; + /** Fired when the extension is first installed, when the extension is updated to a new version, and when Chrome is updated to a new version. */ + var onInstalled: RuntimeInstalledEvent; + /** Sent after onSuspend to indicate that the app won't be unloaded after all. */ + var onSuspendCanceled: RuntimeEvent; + /** + * Fired when a message is sent from either an extension process or a content script. + * @since Chrome 26. + */ + var onMessage: ExtensionMessageEvent; + /** + * Fired when a message is sent from another extension/app. Cannot be used in a content script. + * @since Chrome 26. + */ + var onMessageExternal: ExtensionMessageEvent; + /** + * Fired when an app or the device that it runs on needs to be restarted. The app should close all its windows at its earliest convenient time to let the restart to happen. If the app does nothing, a restart will be enforced after a 24-hour grace period has passed. Currently, this event is only fired for Chrome OS kiosk apps. + * @since Chrome 29. + */ + var onRestartRequired: RuntimeRestartRequiredEvent; + /** + * Fired when an update is available, but isn't installed immediately because the app is currently running. If you do nothing, the update will be installed the next time the background page gets unloaded, if you want it to be installed sooner you can explicitly call chrome.runtime.reload(). If your extension is using a persistent background page, the background page of course never gets unloaded, so unless you call chrome.runtime.reload() manually in response to this event the update will not get installed until the next time chrome itself restarts. If no handlers are listening for this event, and your extension has a persistent background page, it behaves as if chrome.runtime.reload() is called in response to this event. + * @since Chrome 25. + */ + var onUpdateAvailable: RuntimeUpdateAvailableEvent; + /** + * @deprecated since Chrome 33. Please use chrome.runtime.onRestartRequired. + * Fired when a Chrome update is available, but isn't installed immediately because a browser restart is required. + */ + var onBrowserUpdateAvailable: RuntimeEvent; +} + +//////////////////// +// Script Badge +//////////////////// +declare namespace chrome.scriptBadge { + interface GetPopupDetails { + tabId: number; + } + + interface AttentionDetails { + tabId: number; + } + + interface SetPopupDetails { + tabId: number; + popup: string; + } + + interface ScriptBadgeClickedEvent extends chrome.events.Event<(tab: chrome.tabs.Tab) => void> {} + + export function getPopup(details: GetPopupDetails, callback: Function): void; + export function getAttention(details: AttentionDetails): void; + export function setPopup(details: SetPopupDetails): void; + + var onClicked: ScriptBadgeClickedEvent; +} + +//////////////////// +// Sessions +//////////////////// +/** + * Use the chrome.sessions API to query and restore tabs and windows from a browsing session. + * Permissions: "sessions" + * @since Chrome 37. + */ +declare namespace chrome.sessions { + interface Filter { + /** + * Optional. + * The maximum number of entries to be fetched in the requested list. Omit this parameter to fetch the maximum number of entries (sessions.MAX_SESSION_RESULTS). + */ + maxResults?: number; + } + + interface Session { + /** The time when the window or tab was closed or modified, represented in milliseconds since the epoch. */ + lastModified: number; + /** + * Optional. + * The tabs.Tab, if this entry describes a tab. Either this or sessions.Session.window will be set. + */ + tab?: tabs.Tab; + /** + * Optional. + * The windows.Window, if this entry describes a window. Either this or sessions.Session.tab will be set. + */ + window?: windows.Window; + } + + interface Device { + /** The name of the foreign device. */ + deviceName: string; + /** A list of open window sessions for the foreign device, sorted from most recently to least recently modified session. */ + sessions: Session[]; + } + + interface SessionChangedEvent extends chrome.events.Event<() => void> {} + + /** The maximum number of sessions.Session that will be included in a requested list. */ + export var MAX_SESSION_RESULTS: number; + + /** + * Gets the list of recently closed tabs and/or windows. + * @param callback + * Parameter sessions: The list of closed entries in reverse order that they were closed (the most recently closed tab or window will be at index 0). The entries may contain either tabs or windows. + */ + export function getRecentlyClosed(filter: Filter, callback: (sessions: Session[]) => void): void; + /** + * Gets the list of recently closed tabs and/or windows. + * @param callback + * Parameter sessions: The list of closed entries in reverse order that they were closed (the most recently closed tab or window will be at index 0). The entries may contain either tabs or windows. + */ + export function getRecentlyClosed(callback: (sessions: Session[]) => void): void; + /** + * Retrieves all devices with synced sessions. + * @param callback + * Parameter devices: The list of sessions.Device objects for each synced session, sorted in order from device with most recently modified session to device with least recently modified session. tabs.Tab objects are sorted by recency in the windows.Window of the sessions.Session objects. + */ + export function getDevices(filter: Filter, callback: (devices: Device[]) => void): void; + /** + * Retrieves all devices with synced sessions. + * @param callback + * Parameter devices: The list of sessions.Device objects for each synced session, sorted in order from device with most recently modified session to device with least recently modified session. tabs.Tab objects are sorted by recency in the windows.Window of the sessions.Session objects. + */ + export function getDevices(callback: (devices: Device[]) => void): void; + /** + * Reopens a windows.Window or tabs.Tab, with an optional callback to run when the entry has been restored. + * @param sessionId Optional. + * The windows.Window.sessionId, or tabs.Tab.sessionId to restore. If this parameter is not specified, the most recently closed session is restored. + * @param callback Optional. + * Parameter restoredSession: A sessions.Session containing the restored windows.Window or tabs.Tab object. + */ + export function restore(sessionId?: string, callback?: (restoredSession: Session) => void): void; + + /** Fired when recently closed tabs and/or windows are changed. This event does not monitor synced sessions changes. */ + export var onChanged: SessionChangedEvent; +} + +//////////////////// +// Storage +//////////////////// +/** + * Use the chrome.storage API to store, retrieve, and track changes to user data. + * Permissions: "storage" + * @since Chrome 20. + */ +declare namespace chrome.storage { + 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; + /** + * Gets the amount of space (in bytes) being used by one or more items. + * @param keys A single key or list of keys to get the total usage for. An empty list will return 0. Pass in null to get the total usage of all of 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 | string[] | null, 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). + */ + clear(callback?: () => void): void; + /** + * Sets multiple items. + * @param items An object which gives each key/value pair to update storage with. Any other key/value pairs in storage will not be affected. + * Primitive values such as numbers will serialize as expected. Values with a typeof "object" and "function" will typically serialize to {}, with the exception of Array (serializes as expected), Date, and Regex (serialize using their String representation). + * @param callback Optional. + * Callback on success, or on failure (in which case runtime.lastError will be set). + */ + set(items: Object, callback?: () => void): void; + /** + * 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). + */ + 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). + */ + remove(keys: string[], callback?: () => void): void; + /** + * Gets one or more items from 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: { [key: string]: any }) => void): void; + /** + * Gets one or more items from storage. + * @param keys A single key to get, list of keys to get, or a dictionary specifying default values. + * 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 | string[] | Object | null, callback: (items: { [key: string]: any }) => void): void; + } + + interface StorageChange { + /** Optional. The new value of the item, if there is a new value. */ + newValue?: any; + /** Optional. The old value of the item, if there was an old value. */ + 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; + } + + 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; + /** 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; + /** 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; + /** 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; + /** + * 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; + /** + * 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<(changes: { [key: string]: StorageChange }, areaName: string) => 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. + */ + var managed: StorageArea; + + /** Fired when one or more items change. */ + var onChanged: StorageChangedEvent; +} + +//////////////////// +// Socket +//////////////////// +declare namespace chrome.socket { + interface CreateInfo { + socketId: number; + } + + interface AcceptInfo { + resultCode: number; + socketId?: number; + } + + interface ReadInfo { + resultCode: number; + data: ArrayBuffer; + } + + interface WriteInfo { + bytesWritten: number; + } + + interface RecvFromInfo { + resultCode: number; + data: ArrayBuffer; + port: number; + address: string; + } + + interface SocketInfo { + socketType: string; + localPort?: number; + peerAddress?: string; + peerPort?: number; + localAddress?: string; + connected: boolean; + } + + interface NetworkInterface { + name: string; + address: string; + } + + export function create(type: string, options?: Object, callback?: (createInfo: CreateInfo) => void): void; + export function destroy(socketId: number): void; + export function connect(socketId: number, hostname: string, port: number, callback: (result: number) => void): void; + export function bind(socketId: number, address: string, port: number, callback: (result: number) => void): void; + export function disconnect(socketId: number): void; + export function read(socketId: number, bufferSize?: number, callback?: (readInfo: ReadInfo) => void): void; + export function write(socketId: number, data: ArrayBuffer, callback?: (writeInfo: WriteInfo) => void): void; + export function recvFrom(socketId: number, bufferSize?: number, callback?: (recvFromInfo: RecvFromInfo) => void): void; + export function sendTo(socketId: number, data: ArrayBuffer, address: string, port: number, callback?: (writeInfo: WriteInfo) => void): void; + export function listen(socketId: number, address: string, port: number, backlog?: number, callback?: (result: number) => void): void; + export function accept(socketId: number, callback?: (acceptInfo: AcceptInfo) => void): void; + export function setKeepAlive(socketId: number, enable: boolean, delay?: number, callback?: (result: boolean) => void): void; + export function setNoDelay(socketId: number, noDelay: boolean, callback?: (result: boolean) => void): void; + export function getInfo(socketId: number, callback: (result: SocketInfo) => void): void; + export function getNetworkList(callback: (result: NetworkInterface[]) => void): void; +} + +//////////////////// +// System CPU +//////////////////// +/** + * Use the system.cpu API to query CPU metadata. + * Permissions: "system.cpu" + * @since Chrome 32. + */ +declare namespace chrome.system.cpu { + interface ProcessorUsage { + /** The cumulative time used by userspace programs on this processor. */ + user: number; + /** The cumulative time used by kernel programs on this processor. */ + kernel: number; + /** The cumulative time spent idle by this processor. */ + idle: number; + /** The total cumulative time for this processor. This value is equal to user + kernel + idle. */ + total: number; + } + + interface ProcessorInfo { + /** Cumulative usage info for this logical processor. */ + usage: ProcessorUsage; + } + + interface CpuInfo { + /** The number of logical processors. */ + numOfProcessors: number; + /** The architecture name of the processors. */ + archName: string; + /** The model name of the processors. */ + modelName: string; + /** + * A set of feature codes indicating some of the processor's capabilities. + * The currently supported codes are "mmx", "sse", "sse2", "sse3", "ssse3", "sse4_1", "sse4_2", and "avx". + */ + features: string[]; + /** Information about each logical processor. */ + processors: ProcessorInfo[]; + } + + /** Queries basic CPU information of the system. */ + export function getInfo(callback: (info: CpuInfo) => void): void; +} + +//////////////////// +// System Memory +//////////////////// +/** + * The chrome.system.memory API. + * Permissions: "system.memory" + * @since Chrome 32. + */ +declare namespace chrome.system.memory { + interface MemoryInfo { + /** The total amount of physical memory capacity, in bytes. */ + capacity: number; + /** The amount of available capacity, in bytes. */ + availableCapacity: number; + } + + /** Get physical memory information. */ + export function getInfo(callback: (info: MemoryInfo) => void): void; +} + +//////////////////// +// System Storage +//////////////////// +/** + * Use the chrome.system.storage API to query storage device information and be notified when a removable storage device is attached and detached. + * Permissions: "system.storage" + * @since Chrome 30. + */ +declare namespace chrome.system.storage { + interface StorageUnitInfo { + /** The transient ID that uniquely identifies the storage device. This ID will be persistent within the same run of a single application. It will not be a persistent identifier between different runs of an application, or between different applications. */ + id: string; + /** The name of the storage unit. */ + name: string; + /** + * The media type of the storage unit. + * fixed: The storage has fixed media, e.g. hard disk or SSD. + * removable: The storage is removable, e.g. USB flash drive. + * unknown: The storage type is unknown. + */ + type: string; + /** The total amount of the storage space, in bytes. */ + capacity: number; + } + + interface StorageCapacityInfo { + /** A copied |id| of getAvailableCapacity function parameter |id|. */ + id: string; + /** The available capacity of the storage device, in bytes. */ + availableCapacity: number; + } + + interface SystemStorageAttachedEvent extends chrome.events.Event<(info: StorageUnitInfo) => void> {} + + interface SystemStorageDetachedEvent extends chrome.events.Event<(id: string) => void> {} + + /** Get the storage information from the system. The argument passed to the callback is an array of StorageUnitInfo objects. */ + export function getInfo(callback: (info: StorageUnitInfo[]) => void): void; + /** + * Ejects a removable storage device. + * @param callback + * Parameter result: success: The ejection command is successful -- the application can prompt the user to remove the device; in_use: The device is in use by another application. The ejection did not succeed; the user should not remove the device until the other application is done with the device; no_such_device: There is no such device known. failure: The ejection command failed. + */ + export function ejectDevice(id: string, callback: (result: string) => void): void; + /** + * Get the available capacity of a specified |id| storage device. The |id| is the transient device ID from StorageUnitInfo. + * @since Dev channel only. + */ + export function getAvailableCapacity(id: string, callback: (info: StorageCapacityInfo) => void): void; + + /** Fired when a new removable storage is attached to the system. */ + export var onAttached: SystemStorageAttachedEvent; + /** Fired when a removable storage is detached from the system. */ + export var onDetached: SystemStorageDetachedEvent; +} + +//////////////////// +// TabCapture +//////////////////// +/** + * Use the chrome.tabCapture API to interact with tab media streams. + * Permissions: "tabCapture" + * @since Chrome 31. + */ +declare namespace chrome.tabCapture { + interface CaptureInfo { + /** The id of the tab whose status changed. */ + tabId: number; + /** + * The new capture status of the tab. + * One of: "pending", "active", "stopped", or "error" + */ + status: string; + /** Whether an element in the tab being captured is in fullscreen mode. */ + fullscreen: boolean; + } + + interface CaptureOptions { + /** Optional. */ + audio?: boolean; + /** Optional. */ + video?: boolean; + /** Optional. */ + audioConstraints?: MediaStreamConstraints; + /** Optional. */ + videoConstraints?: MediaStreamConstraints; + } + + interface CaptureStatusChangedEvent extends chrome.events.Event<(info: CaptureInfo) => void> {} + + /** + * Captures the visible area of the currently active tab. Capture can only be started on the currently active tab after the extension has been invoked. Capture is maintained across page navigations within the tab, and stops when the tab is closed, or the media stream is closed by the extension. + * @param options Configures the returned media stream. + * @param callback Callback with either the tab capture stream or null. + */ + export function capture(options: CaptureOptions, callback: (stream: MediaStream | null) => void): void; + /** + * Returns a list of tabs that have requested capture or are being captured, i.e. status != stopped and status != error. This allows extensions to inform the user that there is an existing tab capture that would prevent a new tab capture from succeeding (or to prevent redundant requests for the same tab). + * @param callback Callback invoked with CaptureInfo[] for captured tabs. + */ + export function getCapturedTabs(callback: (result: CaptureInfo[]) => void): void; + + /** Event fired when the capture status of a tab changes. This allows extension authors to keep track of the capture status of tabs to keep UI elements like page actions in sync. */ + var onStatusChanged: CaptureStatusChangedEvent; +} + +//////////////////// +// Tabs +//////////////////// +/** + * Use the chrome.tabs API to interact with the browser's tab system. You can use this API to create, modify, and rearrange tabs in the browser. + * Permissions: The majority of the chrome.tabs API can be used without declaring any permission. However, the "tabs" permission is required in order to populate the url, title, and favIconUrl properties of Tab. + * @since Chrome 5. + */ +declare namespace chrome.tabs { + /** + * Tab muted state and the reason for the last state change. + * @since Chrome 46. Warning: this is the current Beta channel. + */ + interface MutedInfo { + /** Whether the tab is prevented from playing sound (but hasn't necessarily recently produced sound). Equivalent to whether the muted audio indicator is showing. */ + muted: boolean; + /** + * Optional. + * The reason the tab was muted or unmuted. Not set if the tab's mute state has never been changed. + * "user": A user input action has set/overridden the muted state. + * "capture": Tab capture started, forcing a muted state change. + * "extension": An extension, identified by the extensionId field, set the muted state. + */ + reason?: string; + /** + * Optional. + * The ID of the extension that changed the muted state. Not set if an extension was not the reason the muted state last changed. + */ + extensionId?: string; + } + + interface Tab { + /** + * Optional. + * Either loading or complete. + */ + status?: string; + /** The zero-based index of the tab within its window. */ + index: number; + /** + * Optional. + * The ID of the tab that opened this tab, if any. This property is only present if the opener tab still exists. + * @since Chrome 18. + */ + openerTabId?: number; + /** + * Optional. + * The title of the tab. This property is only present if the extension's manifest includes the "tabs" permission. + */ + title?: string; + /** + * Optional. + * The URL the tab is displaying. This property is only present if the extension's manifest includes the "tabs" permission. + */ + url?: string; + /** + * Whether the tab is pinned. + * @since Chrome 9. + */ + pinned: boolean; + /** + * Whether the tab is highlighted. + * @since Chrome 16. + */ + highlighted: boolean; + /** The ID of the window the tab is contained within. */ + windowId: number; + /** + * Whether the tab is active in its window. (Does not necessarily mean the window is focused.) + * @since Chrome 16. + */ + active: boolean; + /** + * Optional. + * The URL of the tab's favicon. This property is only present if the extension's manifest includes the "tabs" permission. It may also be an empty string if the tab is loading. + */ + favIconUrl?: string; + /** + * Optional. + * The ID of the tab. Tab IDs are unique within a browser session. Under some circumstances a Tab may not be assigned an ID, for example when querying foreign tabs using the sessions API, in which case a session ID may be present. Tab ID can also be set to chrome.tabs.TAB_ID_NONE for apps and devtools windows. + */ + id?: number; + /** Whether the tab is in an incognito window. */ + incognito: boolean; + /** + * Whether the tab is selected. + * @deprecated since Chrome 33. Please use tabs.Tab.highlighted. + */ + selected: boolean; + /** + * Optional. + * Whether the tab has produced sound over the past couple of seconds (but it might not be heard if also muted). Equivalent to whether the speaker audio indicator is showing. + * @since Chrome 45. + */ + audible?: boolean; + /** + * Optional. + * Current tab muted state and the reason for the last state change. + * @since Chrome 46. Warning: this is the current Beta channel. + */ + mutedInfo?: MutedInfo; + /** + * Optional. The width of the tab in pixels. + * @since Chrome 31. + */ + width?: number; + /** + * Optional. The height of the tab in pixels. + * @since Chrome 31. + */ + height?: number; + /** + * Optional. The session ID used to uniquely identify a Tab obtained from the sessions API. + * @since Chrome 31. + */ + sessionId?: string; + } + + /** + * Defines how zoom changes in a tab are handled and at what scope. + * @since Chrome 38. + */ + interface ZoomSettings { + /** + * Optional. + * Defines how zoom changes are handled, i.e. which entity is responsible for the actual scaling of the page; defaults to "automatic". + * "automatic": Zoom changes are handled automatically by the browser. + * "manual": Overrides the automatic handling of zoom changes. The onZoomChange event will still be dispatched, and it is the responsibility of the extension to listen for this event and manually scale the page. This mode does not support per-origin zooming, and will thus ignore the scope zoom setting and assume per-tab. + * "disabled": Disables all zooming in the tab. The tab will revert to the default zoom level, and all attempted zoom changes will be ignored. + */ + mode?: string; + /** + * Optional. + * Defines whether zoom changes will persist for the page's origin, or only take effect in this tab; defaults to per-origin when in automatic mode, and per-tab otherwise. + * "per-origin": Zoom changes will persist in the zoomed page's origin, i.e. all other tabs navigated to that same origin will be zoomed as well. Moreover, per-origin zoom changes are saved with the origin, meaning that when navigating to other pages in the same origin, they will all be zoomed to the same zoom factor. The per-origin scope is only available in the automatic mode. + * "per-tab": Zoom changes only take effect in this tab, and zoom changes in other tabs will not affect the zooming of this tab. Also, per-tab zoom changes are reset on navigation; navigating a tab will always load pages with their per-origin zoom factors. + */ + scope?: string; + /** + * Optional. + * Used to return the default zoom level for the current tab in calls to tabs.getZoomSettings. + * @since Chrome 43. + */ + defaultZoomFactor?: number; + } + + interface InjectDetails { + /** + * Optional. + * If allFrames is true, implies that the JavaScript or CSS should be injected into all frames of current page. By default, it's false and is only injected into the top frame. + */ + allFrames?: boolean; + /** + * Optional. JavaScript or CSS code to inject. + * Warning: Be careful using the code parameter. Incorrect use of it may open your extension to cross site scripting attacks. + */ + code?: string; + /** + * Optional. The soonest that the JavaScript or CSS will be injected into the tab. + * One of: "document_start", "document_end", or "document_idle" + * @since Chrome 20. + */ + runAt?: string; + /** Optional. JavaScript or CSS file to inject. */ + file?: string; + /** + * Optional. + * The frame where the script or CSS should be injected. Defaults to 0 (the top-level frame). + * @since Chrome 39. + */ + frameId?: number; + /** + * Optional. + * If matchAboutBlank is true, then the code is also injected in about:blank and about:srcdoc frames if your extension has access to its parent document. Code cannot be inserted in top-level about:-frames. By default it is false. + * @since Chrome 39. + */ + matchAboutBlank?: boolean; + } + + interface CreateProperties { + /** Optional. The position the tab should take in the window. The provided value will be clamped to between zero and the number of tabs in the window. */ + index?: number; + /** + * Optional. + * The ID of the tab that opened this tab. If specified, the opener tab must be in the same window as the newly created tab. + * @since Chrome 18. + */ + openerTabId?: number; + /** + * Optional. + * The URL to navigate the tab to initially. Fully-qualified URLs must include a scheme (i.e. 'http://www.google.com', not 'www.google.com'). Relative URLs will be relative to the current page within the extension. Defaults to the New Tab Page. + */ + url?: string; + /** + * Optional. Whether the tab should be pinned. Defaults to false + * @since Chrome 9. + */ + pinned?: boolean; + /** Optional. The window to create the new tab in. Defaults to the current window. */ + windowId?: number; + /** + * Optional. + * Whether the tab should become the active tab in the window. Does not affect whether the window is focused (see windows.update). Defaults to true. + * @since Chrome 16. + */ + active?: boolean; + /** + * Optional. Whether the tab should become the selected tab in the window. Defaults to true + * @deprecated since Chrome 33. Please use active. + */ + selected?: boolean; + } + + interface MoveProperties { + /** The position to move the window to. -1 will place the tab at the end of the window. */ + index: number; + /** Optional. Defaults to the window the tab is currently in. */ + windowId?: number; + } + + interface UpdateProperties { + /** + * Optional. Whether the tab should be pinned. + * @since Chrome 9. + */ + pinned?: boolean; + /** + * Optional. The ID of the tab that opened this tab. If specified, the opener tab must be in the same window as this tab. + * @since Chrome 18. + */ + openerTabId?: number; + /** Optional. A URL to navigate the tab to. */ + url?: string; + /** + * Optional. Adds or removes the tab from the current selection. + * @since Chrome 16. + */ + highlighted?: boolean; + /** + * Optional. Whether the tab should be active. Does not affect whether the window is focused (see windows.update). + * @since Chrome 16. + */ + active?: boolean; + /** + * Optional. Whether the tab should be selected. + * @deprecated since Chrome 33. Please use highlighted. + */ + selected?: boolean; + /** + * Optional. Whether the tab should be muted. + * @since Chrome 45. + */ + muted?: boolean; + } + + interface CaptureVisibleTabOptions { + /** + * Optional. + * When format is "jpeg", controls the quality of the resulting image. This value is ignored for PNG images. As quality is decreased, the resulting image will have more visual artifacts, and the number of bytes needed to store it will decrease. + */ + quality?: number; + /** + * Optional. The format of an image. + * One of: "jpeg", or "png" + */ + format?: string; + } + + interface ReloadProperties { + /** Optional. Whether using any local cache. Default is false. */ + bypassCache?: boolean; + } + + interface ConnectInfo { + /** Optional. Will be passed into onConnect for content scripts that are listening for the connection event. */ + name?: string; + /** + * Open a port to a specific frame identified by frameId instead of all frames in the tab. + * @since Chrome 41. + */ + frameId?: number; + } + + interface MessageSendOptions { + /** Optional. Send a message to a specific frame identified by frameId instead of all frames in the tab. */ + frameId?: number; + } + + interface HighlightInfo { + /** One or more tab indices to highlight. */ + tabs: number | number[]; + /** Optional. The window that contains the tabs. */ + windowId?: number; + } + + interface QueryInfo { + /** + * Optional. Whether the tabs have completed loading. + * One of: "loading", or "complete" + */ + status?: string; + /** + * Optional. Whether the tabs are in the last focused window. + * @since Chrome 19. + */ + lastFocusedWindow?: boolean; + /** Optional. The ID of the parent window, or windows.WINDOW_ID_CURRENT for the current window. */ + windowId?: number; + /** + * Optional. The type of window the tabs are in. + * One of: "normal", "popup", "panel", "app", or "devtools" + */ + windowType?: string; + /** Optional. Whether the tabs are active in their windows. */ + active?: boolean; + /** + * Optional. The position of the tabs within their windows. + * @since Chrome 18. + */ + index?: number; + /** Optional. Match page titles against a pattern. */ + title?: string; + /** Optional. Match tabs against one or more URL patterns. Note that fragment identifiers are not matched. */ + url?: string | string[]; + /** + * Optional. Whether the tabs are in the current window. + * @since Chrome 19. + */ + currentWindow?: boolean; + /** Optional. Whether the tabs are highlighted. */ + highlighted?: boolean; + /** Optional. Whether the tabs are pinned. */ + pinned?: boolean; + /** + * Optional. Whether the tabs are audible. + * @since Chrome 45. + */ + audible?: boolean; + /** + * Optional. Whether the tabs are muted. + * @since Chrome 45. + */ + muted?: boolean; + } + + interface TabHighlightInfo { + windowId: number; + tabIds: number[]; + } + + interface TabRemoveInfo { + /** + * The window whose tab is closed. + * @since Chrome 25. + */ + windowId: number; + /** True when the tab is being closed because its window is being closed. */ + isWindowClosing: boolean; + } + + interface TabAttachInfo { + newPosition: number; + newWindowId: number; + } + + interface TabChangeInfo { + /** Optional. The status of the tab. Can be either loading or complete. */ + status?: string; + /** + * The tab's new pinned state. + * @since Chrome 9. + */ + pinned?: boolean; + /** Optional. The tab's URL if it has changed. */ + url?: string; + /** + * The tab's new audible state. + * @since Chrome 45. + */ + audible?: boolean; + /** + * The tab's new muted state and the reason for the change. + * @since Chrome 46. Warning: this is the current Beta channel. + */ + mutedInfo?: MutedInfo; + /** + * The tab's new favicon URL. + * @since Chrome 27. + */ + favIconUrl?: string; + /** + * The tab's new title. + * @since Chrome 48. + */ + title?: string; + } + + interface TabMoveInfo { + toIndex: number; + windowId: number; + fromIndex: number; + } + + interface TabDetachInfo { + oldWindowId: number; + oldPosition: number; + } + + interface TabActiveInfo { + /** The ID of the tab that has become active. */ + tabId: number; + /** The ID of the window the active tab changed inside of. */ + windowId: number; + } + + interface TabWindowInfo { + /** The ID of the window of where the tab is located. */ + windowId: number; + } + + interface ZoomChangeInfo { + tabId: number; + oldZoomFactor: number; + newZoomFactor: number; + zoomSettings: ZoomSettings; + } + + interface TabHighlightedEvent extends chrome.events.Event<(highlightInfo: HighlightInfo) => void> {} + + interface TabRemovedEvent extends chrome.events.Event<(tabId: number, removeInfo: TabRemoveInfo) => void> {} + + interface TabUpdatedEvent extends chrome.events.Event<(tabId: number, changeInfo: TabChangeInfo, tab: Tab) => void> {} + + interface TabAttachedEvent extends chrome.events.Event<(tabId: number, attachInfo: TabAttachInfo) => void> {} + + interface TabMovedEvent extends chrome.events.Event<(tabId: number, moveInfo: TabMoveInfo) => void> {} + + interface TabDetachedEvent extends chrome.events.Event<(tabId: number, detachInfo: TabDetachInfo) => void> {} + + interface TabCreatedEvent extends chrome.events.Event<(tab: Tab) => void> {} + + interface TabActivatedEvent extends chrome.events.Event<(activeInfo: TabActiveInfo) => void> {} + + interface TabReplacedEvent extends chrome.events.Event<(addedTabId: number, removedTabId: number) => void> {} + + interface TabSelectedEvent extends chrome.events.Event<(tabId: number, selectInfo: TabWindowInfo) => void> {} + + interface TabZoomChangeEvent extends chrome.events.Event<(ZoomChangeInfo: ZoomChangeInfo) => void> {} + + /** + * Injects JavaScript code into a page. For details, see the programmatic injection section of the content scripts doc. + * @param details Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time. + * @param callback Optional. Called after all the JavaScript has been executed. + * Parameter result: The result of the script in every injected frame. + */ + export function executeScript(details: InjectDetails, callback?: (result: any[]) => void): void; + /** + * Injects JavaScript code into a page. For details, see the programmatic injection section of the content scripts doc. + * @param tabId Optional. The ID of the tab in which to run the script; defaults to the active tab of the current window. + * @param details Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time. + * @param callback Optional. Called after all the JavaScript has been executed. + * Parameter result: The result of the script in every injected frame. + */ + export function executeScript(tabId: number, details: InjectDetails, callback?: (result: any[]) => void): void; + /** Retrieves details about the specified tab. */ + export function get(tabId: number, callback: (tab: Tab) => void): void; + /** + * Gets details about all tabs in the specified window. + * @deprecated since Chrome 33. Please use tabs.query {windowId: windowId}. + */ + export function getAllInWindow(callback: (tab: Tab) => void): void; + /** + * Gets details about all tabs in the specified window. + * @deprecated since Chrome 33. Please use tabs.query {windowId: windowId}. + * @param windowId Optional. Defaults to the current window. + */ + export function getAllInWindow(windowId: number, callback: (tab: Tab) => void): void; + /** Gets the tab that this script call is being made from. May be undefined if called from a non-tab context (for example: a background page or popup view). */ + export function getCurrent(callback: (tab?: Tab) => void): void; + /** + * Gets the tab that is selected in the specified window. + * @deprecated since Chrome 33. Please use tabs.query {active: true}. + */ + export function getSelected(callback: (tab: Tab) => void): void; + /** + * Gets the tab that is selected in the specified window. + * @deprecated since Chrome 33. Please use tabs.query {active: true}. + * @param windowId Optional. Defaults to the current window. + */ + export function getSelected(windowId: number, callback: (tab: Tab) => void): void; + /** + * Creates a new tab. + * @param callback Optional. + * Parameter tab: Details about the created tab. Will contain the ID of the new tab. + */ + export function create(createProperties: CreateProperties, callback?: (tab: Tab) => void): void; + /** + * Moves one or more tabs to a new position within its window, or to a new window. Note that tabs can only be moved to and from normal (window.type === "normal") windows. + * @param tabId The tab to move. + * @param callback Optional. + * Parameter tab: Details about the moved tab. + */ + export function move(tabId: number, moveProperties: MoveProperties, callback?: (tab: Tab) => void): void; + /** + * Moves one or more tabs to a new position within its window, or to a new window. Note that tabs can only be moved to and from normal (window.type === "normal") windows. + * @param tabIds The tabs to move. + * @param callback Optional. + * Parameter tabs: Details about the moved tabs. + */ + export function move(tabIds: number[], moveProperties: MoveProperties, callback?: (tabs: Tab[]) => void): void; + /** + * Modifies the properties of a tab. Properties that are not specified in updateProperties are not modified. + * @param callback Optional. + * Optional parameter tab: Details about the updated tab. The tabs.Tab object doesn't contain url, title and favIconUrl if the "tabs" permission has not been requested. + */ + export function update(updateProperties: UpdateProperties, callback?: (tab?: Tab) => void): void; + /** + * Modifies the properties of a tab. Properties that are not specified in updateProperties are not modified. + * @param tabId Defaults to the selected tab of the current window. + * @param callback Optional. + * Optional parameter tab: Details about the updated tab. The tabs.Tab object doesn't contain url, title and favIconUrl if the "tabs" permission has not been requested. + */ + export function update(tabId: number, updateProperties: UpdateProperties, callback?: (tab?: Tab) => void): void; + /** + * Closes a tab. + * @param tabId The tab to close. + */ + export function remove(tabId: number, callback?: Function): void; + /** + * Closes several tabs. + * @param tabIds The list of tabs to close. + */ + export function remove(tabIds: number[], callback?: Function): void; + /** + * Captures the visible area of the currently active tab in the specified window. You must have permission to use this method. + * @param callback + * Parameter dataUrl: A data URL which encodes an image of the visible area of the captured tab. May be assigned to the 'src' property of an HTML Image element for display. + */ + export function captureVisibleTab(callback: (dataUrl: string) => void): void; + /** + * Captures the visible area of the currently active tab in the specified window. You must have permission to use this method. + * @param windowId Optional. The target window. Defaults to the current window. + * @param callback + * Parameter dataUrl: A data URL which encodes an image of the visible area of the captured tab. May be assigned to the 'src' property of an HTML Image element for display. + */ + export function captureVisibleTab(windowId: number, callback: (dataUrl: string) => void): void; + /** + * Captures the visible area of the currently active tab in the specified window. You must have permission to use this method. + * @param options Optional. Details about the format and quality of an image. + * @param callback + * Parameter dataUrl: A data URL which encodes an image of the visible area of the captured tab. May be assigned to the 'src' property of an HTML Image element for display. + */ + export function captureVisibleTab(options: CaptureVisibleTabOptions, callback: (dataUrl: string) => void): void; + /** + * Captures the visible area of the currently active tab in the specified window. You must have permission to use this method. + * @param windowId Optional. The target window. Defaults to the current window. + * @param options Optional. Details about the format and quality of an image. + * @param callback + * Parameter dataUrl: A data URL which encodes an image of the visible area of the captured tab. May be assigned to the 'src' property of an HTML Image element for display. + */ + export function captureVisibleTab(windowId: number, options: CaptureVisibleTabOptions, callback: (dataUrl: string) => void): void; + /** + * Reload a tab. + * @since Chrome 16. + * @param tabId The ID of the tab to reload; defaults to the selected tab of the current window. + */ + export function reload(tabId: number, reloadProperties?: ReloadProperties, callback?: () => void): void; + /** + * Reload the selected tab of the current window. + * @since Chrome 16. + */ + export function reload(reloadProperties: ReloadProperties, callback?: () => void): void; + /** + * Reload the selected tab of the current window. + * @since Chrome 16. + */ + export function reload(callback?: () => void): void; + /** + * Duplicates a tab. + * @since Chrome 23. + * @param tabId The ID of the tab which is to be duplicated. + * @param callback Optional. + * Optional parameter tab: Details about the duplicated tab. The tabs.Tab object doesn't contain url, title and favIconUrl if the "tabs" permission has not been requested. + */ + export function duplicate(tabId: number, callback?: (tab?: Tab) => void): void; + /** + * Sends a single message to the content script(s) in the specified tab, with an optional callback to run when a response is sent back. The runtime.onMessage event is fired in each content script running in the specified tab for the current extension. + * @since Chrome 20. + */ + export function sendMessage(tabId: number, message: any, responseCallback?: (response: any) => void): void; + /** + * Sends a single message to the content script(s) in the specified tab, with an optional callback to run when a response is sent back. The runtime.onMessage event is fired in each content script running in the specified tab for the current extension. + * @since Chrome 41. + * @param responseCallback Optional. + * Parameter response: The JSON response object sent by the handler of the message. If an error occurs while connecting to the specified tab, the callback will be called with no arguments and runtime.lastError will be set to the error message. + */ + export function sendMessage(tabId: number, message: any, options: MessageSendOptions, responseCallback?: (response: any) => void): void; + /** + * Sends a single request to the content script(s) in the specified tab, with an optional callback to run when a response is sent back. The extension.onRequest event is fired in each content script running in the specified tab for the current extension. + * @deprecated since Chrome 33. Please use runtime.sendMessage. + * @param responseCallback Optional. + * Parameter response: The JSON response object sent by the handler of the request. If an error occurs while connecting to the specified tab, the callback will be called with no arguments and runtime.lastError will be set to the error message. + */ + export function sendRequest(tabId: number, request: any, responseCallback?: (response: any) => void): void; + /** Connects to the content script(s) in the specified tab. The runtime.onConnect event is fired in each content script running in the specified tab for the current extension. */ + export function connect(tabId: number, connectInfo?: ConnectInfo): runtime.Port; + /** + * Injects CSS into a page. For details, see the programmatic injection section of the content scripts doc. + * @param details Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time. + * @param callback Optional. Called when all the CSS has been inserted. + */ + export function insertCSS(details: InjectDetails, callback?: Function): void; + /** + * Injects CSS into a page. For details, see the programmatic injection section of the content scripts doc. + * @param tabId Optional. The ID of the tab in which to insert the CSS; defaults to the active tab of the current window. + * @param details Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time. + * @param callback Optional. Called when all the CSS has been inserted. + */ + export function insertCSS(tabId: number, details: InjectDetails, callback?: Function): void; + /** + * Highlights the given tabs. + * @since Chrome 16. + * @param callback Optional. + * Parameter window: Contains details about the window whose tabs were highlighted. + */ + export function highlight(highlightInfo: HighlightInfo, callback: (window: chrome.windows.Window) => void): void; + /** + * Gets all tabs that have the specified properties, or all tabs if no properties are specified. + * @since Chrome 16. + */ + export function query(queryInfo: QueryInfo, callback: (result: Tab[]) => void): void; + /** + * Detects the primary language of the content in a tab. + * @param callback + * Parameter language: An ISO language code such as en or fr. For a complete list of languages supported by this method, see kLanguageInfoTable. The 2nd to 4th columns will be checked and the first non-NULL value will be returned except for Simplified Chinese for which zh-CN will be returned. For an unknown language, und will be returned. + */ + export function detectLanguage(callback: (language: string) => void): void; + /** + * Detects the primary language of the content in a tab. + * @param tabId Optional. Defaults to the active tab of the current window. + * @param callback + * Parameter language: An ISO language code such as en or fr. For a complete list of languages supported by this method, see kLanguageInfoTable. The 2nd to 4th columns will be checked and the first non-NULL value will be returned except for Simplified Chinese for which zh-CN will be returned. For an unknown language, und will be returned. + */ + export function detectLanguage(tabId: number, callback: (language: string) => void): void; + /** + * Zooms a specified tab. + * @since Chrome 42. + * @param zoomFactor The new zoom factor. Use a value of 0 here to set the tab to its current default zoom factor. Values greater than zero specify a (possibly non-default) zoom factor for the tab. + * @param callback Optional. Called after the zoom factor has been changed. + */ + export function setZoom(zoomFactor: number, callback?: () => void): void; + /** + * Zooms a specified tab. + * @since Chrome 42. + * @param tabId Optional. The ID of the tab to zoom; defaults to the active tab of the current window. + * @param zoomFactor The new zoom factor. Use a value of 0 here to set the tab to its current default zoom factor. Values greater than zero specify a (possibly non-default) zoom factor for the tab. + * @param callback Optional. Called after the zoom factor has been changed. + */ + export function setZoom(tabId: number, zoomFactor: number, callback?: () => void): void; + /** + * Gets the current zoom factor of a specified tab. + * @since Chrome 42. + * @param callback Called with the tab's current zoom factor after it has been fetched. + * Parameter zoomFactor: The tab's current zoom factor. + */ + export function getZoom(callback: (zoomFactor: number) => void): void; + /** + * Gets the current zoom factor of a specified tab. + * @since Chrome 42. + * @param tabId Optional. The ID of the tab to get the current zoom factor from; defaults to the active tab of the current window. + * @param callback Called with the tab's current zoom factor after it has been fetched. + * Parameter zoomFactor: The tab's current zoom factor. + */ + export function getZoom(tabId: number, callback: (zoomFactor: number) => void): void; + /** + * Sets the zoom settings for a specified tab, which define how zoom changes are handled. These settings are reset to defaults upon navigating the tab. + * @since Chrome 42. + * @param zoomSettings Defines how zoom changes are handled and at what scope. + * @param callback Optional. Called after the zoom settings have been changed. + */ + export function setZoomSettings(zoomSettings: ZoomSettings, callback?: () => void): void; + /** + * Sets the zoom settings for a specified tab, which define how zoom changes are handled. These settings are reset to defaults upon navigating the tab. + * @since Chrome 42. + * @param tabId Optional. The ID of the tab to change the zoom settings for; defaults to the active tab of the current window. + * @param zoomSettings Defines how zoom changes are handled and at what scope. + * @param callback Optional. Called after the zoom settings have been changed. + */ + export function setZoomSettings(tabId: number, zoomSettings: ZoomSettings, callback?: () => void): void; + /** + * Gets the current zoom settings of a specified tab. + * @since Chrome 42. + * @param callback Called with the tab's current zoom settings. + * Paramater zoomSettings: The tab's current zoom settings. + */ + export function getZoomSettings(callback: (zoomSettings: ZoomSettings) => void): void; + /** + * Gets the current zoom settings of a specified tab. + * @since Chrome 42. + * @param tabId Optional. The ID of the tab to get the current zoom settings from; defaults to the active tab of the current window. + * @param callback Called with the tab's current zoom settings. + * Paramater zoomSettings: The tab's current zoom settings. + */ + export function getZoomSettings(tabId: number, callback: (zoomSettings: ZoomSettings) => void): void; + + /** + * Fired when the highlighted or selected tabs in a window changes. + * @since Chrome 18. + */ + var onHighlighted: TabHighlightedEvent; + /** Fired when a tab is closed. */ + var onRemoved: TabRemovedEvent; + /** Fired when a tab is updated. */ + var onUpdated: TabUpdatedEvent; + /** Fired when a tab is attached to a window, for example because it was moved between windows. */ + var onAttached: TabAttachedEvent; + /** + * Fired when a tab is moved within a window. Only one move event is fired, representing the tab the user directly moved. Move events are not fired for the other tabs that must move in response. This event is not fired when a tab is moved between windows. For that, see tabs.onDetached. + */ + var onMoved: TabMovedEvent; + /** Fired when a tab is detached from a window, for example because it is being moved between windows. */ + var onDetached: TabDetachedEvent; + /** Fired when a tab is created. Note that the tab's URL may not be set at the time this event fired, but you can listen to onUpdated events to be notified when a URL is set. */ + var onCreated: TabCreatedEvent; + /** + * Fires when the active tab in a window changes. Note that the tab's URL may not be set at the time this event fired, but you can listen to onUpdated events to be notified when a URL is set. + * @since Chrome 18. + */ + var onActivated: TabActivatedEvent; + /** + * Fired when a tab is replaced with another tab due to prerendering or instant. + * @since Chrome 26. + */ + var onReplaced: TabReplacedEvent; + /** + * @deprecated since Chrome 33. Please use tabs.onActivated. + * Fires when the selected tab in a window changes. + */ + var onSelectionChanged: TabSelectedEvent; + /** + * @deprecated since Chrome 33. Please use tabs.onActivated. + * Fires when the selected tab in a window changes. Note that the tab's URL may not be set at the time this event fired, but you can listen to tabs.onUpdated events to be notified when a URL is set. + */ + var onActiveChanged: TabSelectedEvent; + /** + * @deprecated since Chrome 33. Please use tabs.onHighlighted. + * Fired when the highlighted or selected tabs in a window changes. + */ + var onHighlightChanged: TabHighlightedEvent; + /** + * Fired when a tab is zoomed. + * @since Chrome 38. + */ + var onZoomChange: TabZoomChangeEvent; + + /** + * An ID which represents the absence of a browser tab. + * @since Chrome 46. + */ + var TAB_ID_NONE: -1; +} + +//////////////////// +// Top Sites +//////////////////// +/** + * Use the chrome.topSites API to access the top sites that are displayed on the new tab page. + * Permissions: "topSites" + * @since Chrome 19. + */ +declare namespace chrome.topSites { + /** An object encapsulating a most visited URL, such as the URLs on the new tab page. */ + interface MostVisitedURL { + /** The most visited URL. */ + url: string; + /** The title of the page */ + title: string; + } + + /** Gets a list of top sites. */ + export function get(callback: (data: MostVisitedURL[]) => void): void; +} + +//////////////////// +// Text to Speech +//////////////////// +/** + * Use the chrome.tts API to play synthesized text-to-speech (TTS). See also the related ttsEngine API, which allows an extension to implement a speech engine. + * Permissions: "tts" + * @since Chrome 14. + */ +declare namespace chrome.tts { + /** An event from the TTS engine to communicate the status of an utterance. */ + interface TtsEvent { + /** Optional. The index of the current character in the utterance. */ + charIndex?: number; + /** Optional. The error description, if the event type is 'error'. */ + errorMessage?: string; + /** + * The type can be 'start' as soon as speech has started, 'word' when a word boundary is reached, 'sentence' when a sentence boundary is reached, 'marker' when an SSML mark element is reached, 'end' when the end of the utterance is reached, 'interrupted' when the utterance is stopped or interrupted before reaching the end, 'cancelled' when it's removed from the queue before ever being synthesized, or 'error' when any other error occurs. When pausing speech, a 'pause' event is fired if a particular utterance is paused in the middle, and 'resume' if an utterance resumes speech. Note that pause and resume events may not fire if speech is paused in-between utterances. + * One of: "start", "end", "word", "sentence", "marker", "interrupted", "cancelled", "error", "pause", or "resume" + */ + type: string; + } + + /** A description of a voice available for speech synthesis. */ + interface TtsVoice { + /** Optional. The language that this voice supports, in the form language-region. Examples: 'en', 'en-US', 'en-GB', 'zh-CN'. */ + lang?: string; + /** + * Optional. This voice's gender. + * One of: "male", or "female" + */ + gender?: string; + /** Optional. The name of the voice. */ + voiceName?: string; + /** The ID of the extension providing this voice. */ + extensionsId?: string; + /** All of the callback event types that this voice is capable of sending. */ + eventTypes?: string[]; + /** + * If true, the synthesis engine is a remote network resource. It may be higher latency and may incur bandwidth costs. + * @since Chrome 33. + */ + remote?: boolean; + } + + interface SpeakOptions { + /** Optional. Speaking volume between 0 and 1 inclusive, with 0 being lowest and 1 being highest, with a default of 1.0. */ + volume?: number; + /** + * Optional. + * If true, enqueues this utterance if TTS is already in progress. If false (the default), interrupts any current speech and flushes the speech queue before speaking this new utterance. + */ + enqueue?: boolean; + /** + * Optional. + * Speaking rate relative to the default rate for this voice. 1.0 is the default rate, normally around 180 to 220 words per minute. 2.0 is twice as fast, and 0.5 is half as fast. Values below 0.1 or above 10.0 are strictly disallowed, but many voices will constrain the minimum and maximum rates further—for example a particular voice may not actually speak faster than 3 times normal even if you specify a value larger than 3.0. + */ + rate?: number; + /** + * Optional. This function is called with events that occur in the process of speaking the utterance. + * @param event The update event from the text-to-speech engine indicating the status of this utterance. + */ + onEvent?: (event: TtsEvent) => void; + /** + * Optional. + * Speaking pitch between 0 and 2 inclusive, with 0 being lowest and 2 being highest. 1.0 corresponds to a voice's default pitch. + */ + pitch?: number; + /** Optional. The language to be used for synthesis, in the form language-region. Examples: 'en', 'en-US', 'en-GB', 'zh-CN'. */ + lang?: string; + /** Optional. The name of the voice to use for synthesis. If empty, uses any available voice. */ + voiceName?: string; + /** Optional. The extension ID of the speech engine to use, if known. */ + extensionId?: string; + /** + * Optional. Gender of voice for synthesized speech. + * One of: "male", or "female" + */ + gender?: string; + /** Optional. The TTS event types the voice must support. */ + requiredEventTypes?: string[]; + /** Optional. The TTS event types that you are interested in listening to. If missing, all event types may be sent. */ + desiredEventTypes?: string[]; + } + + /** Checks whether the engine is currently speaking. On Mac OS X, the result is true whenever the system speech engine is speaking, even if the speech wasn't initiated by Chrome. */ + export function isSpeaking(callback?: (speaking: boolean) => void): void; + /** Stops any current speech and flushes the queue of any pending utterances. In addition, if speech was paused, it will now be un-paused for the next call to speak. */ + export function stop(): void; + /** Gets an array of all available voices. */ + export function getVoices(callback?: (voices: TtsVoice[]) => void): void; + /** + * Speaks text using a text-to-speech engine. + * @param utterance The text to speak, either plain text or a complete, well-formed SSML document. Speech engines that do not support SSML will strip away the tags and speak the text. The maximum length of the text is 32,768 characters. + * @param callback Optional. Called right away, before speech finishes. Check chrome.runtime.lastError to make sure there were no errors. Use options.onEvent to get more detailed feedback. + */ + export function speak(utterance: string, callback?: Function): void; + /** + * Speaks text using a text-to-speech engine. + * @param utterance The text to speak, either plain text or a complete, well-formed SSML document. Speech engines that do not support SSML will strip away the tags and speak the text. The maximum length of the text is 32,768 characters. + * @param options Optional. The speech options. + * @param callback Optional. Called right away, before speech finishes. Check chrome.runtime.lastError to make sure there were no errors. Use options.onEvent to get more detailed feedback. + */ + export function speak(utterance: string, options: SpeakOptions, callback?: Function): void; + /** + * Pauses speech synthesis, potentially in the middle of an utterance. A call to resume or stop will un-pause speech. + * @since Chrome 29. + */ + export function pause(): void; + /** + * If speech was paused, resumes speaking where it left off. + * @since Chrome 29. + */ + export function resume(): void; +} + +//////////////////// +// Text to Speech Engine +//////////////////// +/** + * Use the chrome.ttsEngine API to implement a text-to-speech(TTS) engine using an extension. If your extension registers using this API, it will receive events containing an utterance to be spoken and other parameters when any extension or Chrome App uses the tts API to generate speech. Your extension can then use any available web technology to synthesize and output the speech, and send events back to the calling function to report the status. + * Permissions: "ttsEngine" + * @since Chrome 14. + */ +declare namespace chrome.ttsEngine { + interface SpeakOptions { + /** Optional. The language to be used for synthesis, in the form language-region. Examples: 'en', 'en-US', 'en-GB', 'zh-CN'. */ + lang?: string; + /** Optional. The name of the voice to use for synthesis. */ + voiceName?: string; + /** + * Optional. Gender of voice for synthesized speech. + * One of: "male", or "female" + */ + gender?: string; + /** Optional. Speaking volume between 0 and 1 inclusive, with 0 being lowest and 1 being highest, with a default of 1.0. */ + volume?: number; + /** + * Optional. + * Speaking rate relative to the default rate for this voice. 1.0 is the default rate, normally around 180 to 220 words per minute. 2.0 is twice as fast, and 0.5 is half as fast. This value is guaranteed to be between 0.1 and 10.0, inclusive. When a voice does not support this full range of rates, don't return an error. Instead, clip the rate to the range the voice supports. + */ + rate?: number; + /** Optional. Speaking pitch between 0 and 2 inclusive, with 0 being lowest and 2 being highest. 1.0 corresponds to this voice's default pitch. */ + pitch?: number; + } + + interface TtsEngineSpeakEvent extends chrome.events.Event<(utterance: string, options: SpeakOptions, sendTtsEvent: (event: chrome.tts.TtsEvent) => void) => void> {} + + /** Called when the user makes a call to tts.speak() and one of the voices from this extension's manifest is the first to match the options object. */ + var onSpeak: TtsEngineSpeakEvent; + /** Fired when a call is made to tts.stop and this extension may be in the middle of speaking. If an extension receives a call to onStop and speech is already stopped, it should do nothing (not raise an error). If speech is in the paused state, this should cancel the paused state. */ + var onStop: chrome.events.Event<() => void>; + /** + * Optional: if an engine supports the pause event, it should pause the current utterance being spoken, if any, until it receives a resume event or stop event. Note that a stop event should also clear the paused state. + * @since Chrome 29. + */ + var onPause: chrome.events.Event<() => void>; + /** + * Optional: if an engine supports the pause event, it should also support the resume event, to continue speaking the current utterance, if any. Note that a stop event should also clear the paused state. + * @since Chrome 29. + */ + var onResume: chrome.events.Event<() => void>; +} + +//////////////////// +// Types +//////////////////// +/** + * The chrome.types API contains type declarations for Chrome. + * @since Chrome 13. + */ +declare namespace chrome.types { + interface ChromeSettingClearDetails { + /** + * Optional. + * The scope of the ChromeSetting. One of + * • regular: setting for the regular profile (which is inherited by the incognito profile if not overridden elsewhere), + * • regular_only: setting for the regular profile only (not inherited by the incognito profile), + * • incognito_persistent: setting for the incognito profile that survives browser restarts (overrides regular preferences), + * • incognito_session_only: setting for the incognito profile that can only be set during an incognito session and is deleted when the incognito session ends (overrides regular and incognito_persistent preferences). + */ + scope?: string; + } + + interface ChromeSettingSetDetails extends ChromeSettingClearDetails { + /** + * The value of the setting. + * Note that every setting has a specific value type, which is described together with the setting. An extension should not set a value of a different type. + */ + value: any; + /** + * Optional. + * The scope of the ChromeSetting. One of + * • regular: setting for the regular profile (which is inherited by the incognito profile if not overridden elsewhere), + * • regular_only: setting for the regular profile only (not inherited by the incognito profile), + * • incognito_persistent: setting for the incognito profile that survives browser restarts (overrides regular preferences), + * • incognito_session_only: setting for the incognito profile that can only be set during an incognito session and is deleted when the incognito session ends (overrides regular and incognito_persistent preferences). + */ + scope?: string; + } + + interface ChromeSettingGetDetails { + /** Optional. Whether to return the value that applies to the incognito session (default false). */ + incognito?: boolean; + } + + /** + * @param details Details of the currently effective value. + */ + type DetailsCallback = (details: ChromeSettingGetResultDetails) => void; + + interface ChromeSettingGetResultDetails { + /** + * One of + * • not_controllable: cannot be controlled by any extension + * • controlled_by_other_extensions: controlled by extensions with higher precedence + * • controllable_by_this_extension: can be controlled by this extension + * • controlled_by_this_extension: controlled by this extension + */ + levelOfControl: string; + /** The value of the setting. */ + value: any; + /** + * Optional. + * Whether the effective value is specific to the incognito session. + * This property will only be present if the incognito property in the details parameter of get() was true. + */ + incognitoSpecific?: boolean; + } + + interface ChromeSettingChangedEvent extends chrome.events.Event {} + + /** An interface that allows access to a Chrome browser setting. See accessibilityFeatures for an example. */ + interface ChromeSetting { + /** + * Sets the value of a setting. + * @param details Which setting to change. + * @param callback Optional. Called at the completion of the set operation. + */ + set(details: ChromeSettingSetDetails, callback?: Function): void; + /** + * Gets the value of a setting. + * @param details Which setting to consider. + */ + get(details: ChromeSettingGetDetails, callback?: DetailsCallback): void; + /** + * Clears the setting, restoring any default value. + * @param details Which setting to clear. + * @param callback Optional. Called at the completion of the clear operation. + */ + clear(details: ChromeSettingClearDetails, callback?: Function): void; + /** Fired after the setting changes. */ + onChange: ChromeSettingChangedEvent; + } +} + +//////////////////// +// VPN Provider +//////////////////// +/** + * Use the chrome.vpnProvider API to implement a VPN client. + * Permissions: "vpnProvider" + * Important: This API works only on Chrome OS. + * @since Chrome 43. + */ +declare namespace chrome.vpnProvider { + interface VpnSessionParameters { + /** IP address for the VPN interface in CIDR notation. IPv4 is currently the only supported mode. */ + address: string; + /** Optional. Broadcast address for the VPN interface. (default: deduced from IP address and mask) */ + broadcastAddress?: string; + /** Optional. MTU setting for the VPN interface. (default: 1500 bytes) */ + mtu?: string; + /** + * Exclude network traffic to the list of IP blocks in CIDR notation from the tunnel. This can be used to bypass traffic to and from the VPN server. When many rules match a destination, the rule with the longest matching prefix wins. Entries that correspond to the same CIDR block are treated as duplicates. Such duplicates in the collated (exclusionList + inclusionList) list are eliminated and the exact duplicate entry that will be eliminated is undefined. + */ + exclusionList: string[]; + /** + * Include network traffic to the list of IP blocks in CIDR notation to the tunnel. This parameter can be used to set up a split tunnel. By default no traffic is directed to the tunnel. Adding the entry "0.0.0.0/0" to this list gets all the user traffic redirected to the tunnel. When many rules match a destination, the rule with the longest matching prefix wins. Entries that correspond to the same CIDR block are treated as duplicates. Such duplicates in the collated (exclusionList + inclusionList) list are eliminated and the exact duplicate entry that will be eliminated is undefined. + */ + inclusionList: string[]; + /** Optional. A list of search domains. (default: no search domain) */ + domainSearch?: string[]; + /** A list of IPs for the DNS servers. */ + dnsServer: string[]; + } + + interface VpnPlatformMessageEvent extends chrome.events.Event<(id: string, message: string, error: string) => void> {} + + interface VpnPacketReceptionEvent extends chrome.events.Event<(data: ArrayBuffer) => void> {} + + interface VpnConfigRemovalEvent extends chrome.events.Event<(id: string) => void> {} + + interface VpnConfigCreationEvent extends chrome.events.Event<(id: string, name: string, data: Object) => void> {} + + interface VpnUiEvent extends chrome.events.Event<(event: string, id?: string) => void> {} + + /** + * Creates a new VPN configuration that persists across multiple login sessions of the user. + * @param name The name of the VPN configuration. + * @param callback Called when the configuration is created or if there is an error. + * Parameter id: A unique ID for the created configuration, empty string on failure. + */ + export function createConfig(name: string, callback: (id: string) => void): void; + /** + * Destroys a VPN configuration created by the extension. + * @param id ID of the VPN configuration to destroy. + * @param callback Optional. Called when the configuration is destroyed or if there is an error. + */ + export function destroyConfig(id: string, callback?: Function): void; + /** + * Sets the parameters for the VPN session. This should be called immediately after "connected" is received from the platform. This will succeed only when the VPN session is owned by the extension. + * @param parameters The parameters for the VPN session. + * @param callback Called when the parameters are set or if there is an error. + */ + export function setParameters(parameters: VpnSessionParameters, callback: Function): void; + /** + * Sends an IP packet through the tunnel created for the VPN session. This will succeed only when the VPN session is owned by the extension. + * @param data The IP packet to be sent to the platform. + * @param callback Optional. Called when the packet is sent or if there is an error. + */ + export function sendPacket(data: ArrayBuffer, callback?: Function): void; + /** + * Notifies the VPN session state to the platform. This will succeed only when the VPN session is owned by the extension. + * @param state The VPN session state of the VPN client. + * connected: VPN connection was successful. + * failure: VPN connection failed. + * @param callback Optional. Called when the notification is complete or if there is an error. + */ + export function notifyConnectionStateChanged(state: string, callback?: Function): void; + + /** Triggered when a message is received from the platform for a VPN configuration owned by the extension. */ + var onPlatformMessage: VpnPlatformMessageEvent; + /** Triggered when an IP packet is received via the tunnel for the VPN session owned by the extension. */ + var onPacketReceived: VpnPacketReceptionEvent; + /** Triggered when a configuration created by the extension is removed by the platform. */ + var onConfigRemoved: VpnConfigRemovalEvent; + /** Triggered when a configuration is created by the platform for the extension. */ + var onConfigCreated: VpnConfigCreationEvent; + /** Triggered when there is a UI event for the extension. UI events are signals from the platform that indicate to the app that a UI dialog needs to be shown to the user. */ + var onUIEvent: VpnUiEvent; +} + +//////////////////// +// Wallpaper +//////////////////// +/** + * Use the chrome.wallpaper API to change the ChromeOS wallpaper. + * Permissions: "wallpaper" + * Important: This API works only on Chrome OS. + * @since Chrome 43. + */ +declare namespace chrome.wallpaper { + interface WallpaperDetails { + /** Optional. The jpeg or png encoded wallpaper image. */ + data?: any; + /** Optional. The URL of the wallpaper to be set. */ + url?: string; + /** + * The supported wallpaper layouts. + * One of: "STRETCH", "CENTER", or "CENTER_CROPPED" + */ + layout: string; + /** The file name of the saved wallpaper. */ + filename: string; + /** Optional. True if a 128x60 thumbnail should be generated. */ + thumbnail?: boolean; + } + + /** + * Sets wallpaper to the image at url or wallpaperData with the specified layout + * @param callback + * Optional parameter thumbnail: The jpeg encoded wallpaper thumbnail. It is generated by resizing the wallpaper to 128x60. + */ + export function setWallpaper(details: WallpaperDetails, callback: (thumbnail: any) => void): void; +} + +//////////////////// +// Web Navigation +//////////////////// +/** + * Use the chrome.webNavigation API to receive notifications about the status of navigation requests in-flight. + * Permissions: "webNavigation" + * @since Chrome 16. + */ +declare namespace chrome.webNavigation { + interface GetFrameDetails { + /** + * The ID of the process runs the renderer for this tab. + * @since Chrome 22. + */ + processId: number; + /** The ID of the tab in which the frame is. */ + tabId: number; + /** The ID of the frame in the given tab. */ + frameId: number; + } + + interface GetFrameResultDetails { + /** The URL currently associated with this frame, if the frame identified by the frameId existed at one point in the given tab. The fact that an URL is associated with a given frameId does not imply that the corresponding frame still exists. */ + url: string; + /** True if the last navigation in this frame was interrupted by an error, i.e. the onErrorOccurred event fired. */ + errorOccurred: boolean; + /** ID of frame that wraps the frame. Set to -1 of no parent frame exists. */ + parentFrameId: number; + } + + interface GetAllFrameDetails { + /** The ID of the tab. */ + tabId: number; + } + + interface GetAllFrameResultDetails extends GetFrameResultDetails { + /** The ID of the process runs the renderer for this tab. */ + processId: number; + /** The ID of the frame. 0 indicates that this is the main frame; a positive value indicates the ID of a subframe. */ + frameId: number; + } + + interface WebNavigationCallbackDetails { + /** The ID of the tab in which the navigation is about to occur. */ + tabId: number; + /** The time when the browser was about to start the navigation, in milliseconds since the epoch. */ + timeStamp: number; + } + + interface WebNavigationUrlCallbackDetails extends WebNavigationCallbackDetails { + url: string; + } + + interface WebNavigationReplacementCallbackDetails extends WebNavigationCallbackDetails { + /** The ID of the tab that was replaced. */ + replacedTabId: number; + } + + interface WebNavigationFramedCallbackDetails extends WebNavigationUrlCallbackDetails { + /** 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique for a given tab and process. */ + frameId: number; + /** + * The ID of the process runs the renderer for this tab. + * @since Chrome 22. + */ + processId: number; + } + + interface WebNavigationFramedErrorCallbackDetails extends WebNavigationFramedCallbackDetails { + /** The error description. */ + error: string; + } + + interface WebNavigationSourceCallbackDetails extends WebNavigationUrlCallbackDetails { + /** The ID of the tab in which the navigation is triggered. */ + sourceTabId: number; + /** + * The ID of the process runs the renderer for the source tab. + * @since Chrome 22. + */ + sourceProcessId: number; + /** The ID of the frame with sourceTabId in which the navigation is triggered. 0 indicates the main frame. */ + sourceFrameId: number; + } + + interface WebNavigationParentedCallbackDetails extends WebNavigationFramedCallbackDetails { + /** + * ID of frame that wraps the frame. Set to -1 of no parent frame exists. + * @since Chrome 24. + */ + parentFrameId: number; + } + + interface WebNavigationTransitionCallbackDetails extends WebNavigationFramedCallbackDetails { + /** + * Cause of the navigation. + * One of: "link", "typed", "auto_bookmark", "auto_subframe", "manual_subframe", "generated", "start_page", "form_submit", "reload", "keyword", or "keyword_generated" + */ + transitionType: string; + /** + * A list of transition qualifiers. + * Each element one of: "client_redirect", "server_redirect", "forward_back", or "from_address_bar" + */ + transitionQualifiers: string[]; + } + + interface WebNavigationEventFilter { + /** Conditions that the URL being navigated to must satisfy. The 'schemes' and 'ports' fields of UrlFilter are ignored for this event. */ + url: chrome.events.UrlFilter[]; + } + + interface WebNavigationEvent extends chrome.events.Event<(details: T) => void> { + addListener(callback: (details: T) => void, filters?: WebNavigationEventFilter): void; + } + + interface WebNavigationFramedEvent extends WebNavigationEvent {} + + interface WebNavigationFramedErrorEvent extends WebNavigationEvent {} + + interface WebNavigationSourceEvent extends WebNavigationEvent {} + + interface WebNavigationParentedEvent extends WebNavigationEvent {} + + interface WebNavigationTransitionalEvent extends WebNavigationEvent {} + + interface WebNavigationReplacementEvent extends WebNavigationEvent {} + + /** + * Retrieves information about the given frame. A frame refers to an

          , options?: any): Cheerio; diff --git a/enzyme/tslint.json b/enzyme/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/enzyme/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/es6-collections/index.d.ts b/es6-collections/index.d.ts deleted file mode 100644 index 7a87a6591f..0000000000 --- a/es6-collections/index.d.ts +++ /dev/null @@ -1,113 +0,0 @@ -// Type definitions for es6-collections v0.5.1 -// Project: https://github.com/WebReflection/es6-collections/ -// Definitions by: Ron Buckton -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/* ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - -interface IteratorResult { - done: boolean; - value?: T; -} - -interface Iterator { - next(value?: any): IteratorResult; - return?(value?: any): IteratorResult; - throw?(e?: any): IteratorResult; -} - -interface ForEachable { - forEach(callbackfn: (value: T) => void): void; -} - -interface Map { - clear(): void; - delete(key: K): boolean; - forEach(callbackfn: (value: V, index: K, map: Map) => void, thisArg?: any): void; - get(key: K): V; - has(key: K): boolean; - set(key: K, value?: V): Map; - entries(): Iterator<[K, V]>; - keys(): Iterator; - values(): Iterator; - size: number; -} - -interface MapConstructor { - new (): Map; - new (iterable: ForEachable<[K, V]>): Map; - prototype: Map; -} - -declare var Map: MapConstructor; - -interface Set { - add(value: T): Set; - clear(): void; - delete(value: T): boolean; - forEach(callbackfn: (value: T, index: T, set: Set) => void, thisArg?: any): void; - has(value: T): boolean; - entries(): Iterator<[T, T]>; - keys(): Iterator; - values(): Iterator; - size: number; -} - -interface SetConstructor { - new (): Set; - new (iterable: ForEachable): Set; - prototype: Set; -} - -declare var Set: SetConstructor; - -interface WeakMap { - delete(key: K): boolean; - clear(): void; - get(key: K): V; - has(key: K): boolean; - set(key: K, value?: V): WeakMap; -} - -interface WeakMapConstructor { - new (): WeakMap; - new (iterable: ForEachable<[K, V]>): WeakMap; - prototype: WeakMap; -} - -declare var WeakMap: WeakMapConstructor; - -interface WeakSet { - delete(value: T): boolean; - clear(): void; - add(value: T): WeakSet; - has(value: T): boolean; -} - -interface WeakSetConstructor { - new (): WeakSet; - new (iterable: ForEachable): WeakSet; - prototype: WeakSet; -} - -declare var WeakSet: WeakSetConstructor; - -declare module "es6-collections" { - var Map: MapConstructor; - var Set: SetConstructor; - var WeakMap: WeakMapConstructor; - var WeakSet: WeakSetConstructor; -} \ No newline at end of file diff --git a/es6-shim/index.d.ts b/es6-shim/index.d.ts deleted file mode 100644 index b2cad2f4ce..0000000000 --- a/es6-shim/index.d.ts +++ /dev/null @@ -1,669 +0,0 @@ -// Type definitions for es6-shim v0.31.2 -// Project: https://github.com/paulmillr/es6-shim -// Definitions by: Ron Buckton -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare type PropertyKey = string | number | symbol; - -interface IteratorResult { - done: boolean; - value?: T; -} - -interface IterableShim { - /** - * Shim for an ES6 iterable. Not intended for direct use by user code. - */ - "_es6-shim iterator_"(): Iterator; -} - -interface Iterator { - next(value?: any): IteratorResult; - return?(value?: any): IteratorResult; - throw?(e?: any): IteratorResult; -} - -interface IterableIteratorShim extends IterableShim, Iterator { - /** - * Shim for an ES6 iterable iterator. Not intended for direct use by user code. - */ - "_es6-shim iterator_"(): IterableIteratorShim; -} - -interface StringConstructor { - /** - * Return the String value whose elements are, in order, the elements in the List elements. - * If length is 0, the empty string is returned. - */ - fromCodePoint(...codePoints: number[]): string; - - /** - * String.raw is intended for use as a tag function of a Tagged Template String. When called - * as such the first argument will be a well formed template call site object and the rest - * parameter will contain the substitution values. - * @param template A well-formed template string call site representation. - * @param substitutions A set of substitution values. - */ - raw(template: TemplateStringsArray, ...substitutions: any[]): string; -} - -interface String { - /** - * Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point - * value of the UTF-16 encoded code point starting at the string element at position pos in - * the String resulting from converting this object to a String. - * If there is no element at that position, the result is undefined. - * If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos. - */ - codePointAt(pos: number): number; - - /** - * Returns true if searchString appears as a substring of the result of converting this - * object to a String, at one or more positions that are - * greater than or equal to position; otherwise, returns false. - * @param searchString search string - * @param position If position is undefined, 0 is assumed, so as to search all of the String. - */ - includes(searchString: string, position?: number): boolean; - - /** - * Returns true if the sequence of elements of searchString converted to a String is the - * same as the corresponding elements of this object (converted to a String) starting at - * endPosition – length(this). Otherwise returns false. - */ - endsWith(searchString: string, endPosition?: number): boolean; - - /** - * Returns a String value that is made from count copies appended together. If count is 0, - * T is the empty String is returned. - * @param count number of copies to append - */ - repeat(count: number): string; - - /** - * Returns true if the sequence of elements of searchString converted to a String is the - * same as the corresponding elements of this object (converted to a String) starting at - * position. Otherwise returns false. - */ - startsWith(searchString: string, position?: number): boolean; - - /** - * Returns an HTML anchor element and sets the name attribute to the text value - * @param name - */ - anchor(name: string): string; - - /** Returns a HTML element */ - big(): string; - - /** Returns a HTML element */ - blink(): string; - - /** Returns a HTML element */ - bold(): string; - - /** Returns a HTML element */ - fixed(): string - - /** Returns a HTML element and sets the color attribute value */ - fontcolor(color: string): string - - /** Returns a HTML element and sets the size attribute value */ - fontsize(size: number): string; - - /** Returns a HTML element and sets the size attribute value */ - fontsize(size: string): string; - - /** Returns an HTML element */ - italics(): string; - - /** Returns an HTML element and sets the href attribute value */ - link(url: string): string; - - /** Returns a HTML element */ - small(): string; - - /** Returns a HTML element */ - strike(): string; - - /** Returns a HTML element */ - sub(): string; - - /** Returns a HTML element */ - sup(): string; - - /** - * Shim for an ES6 iterable. Not intended for direct use by user code. - */ - "_es6-shim iterator_"(): IterableIteratorShim; -} - -interface ArrayConstructor { - /** - * Creates an array from an array-like object. - * @param arrayLike An array-like object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): Array; - - /** - * Creates an array from an iterable object. - * @param iterable An iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(iterable: IterableShim, mapfn: (v: T, k: number) => U, thisArg?: any): Array; - - /** - * Creates an array from an array-like object. - * @param arrayLike An array-like object to convert to an array. - */ - from(arrayLike: ArrayLike): Array; - - /** - * Creates an array from an iterable object. - * @param iterable An iterable object to convert to an array. - */ - from(iterable: IterableShim): Array; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: T[]): Array; -} - -interface Array { - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: T, index: number, obj: Array) => boolean, thisArg?: any): T; - - /** - * Returns the index of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: T) => boolean, thisArg?: any): number; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: T, start?: number, end?: number): T[]; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): T[]; - - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIteratorShim<[number, T]>; - - /** - * Returns an list of keys in the array - */ - keys(): IterableIteratorShim; - - /** - * Returns an list of values in the array - */ - values(): IterableIteratorShim; - - /** - * Shim for an ES6 iterable. Not intended for direct use by user code. - */ - "_es6-shim iterator_"(): IterableIteratorShim; -} - -interface NumberConstructor { - /** - * The value of Number.EPSILON is the difference between 1 and the smallest value greater than 1 - * that is representable as a Number value, which is approximately: - * 2.2204460492503130808472633361816 x 10‍−‍16. - */ - EPSILON: number; - - /** - * Returns true if passed value is finite. - * Unlike the global isFininte, Number.isFinite doesn't forcibly convert the parameter to a - * number. Only finite values of the type number, result in true. - * @param number A numeric value. - */ - isFinite(number: number): boolean; - - /** - * Returns true if the value passed is an integer, false otherwise. - * @param number A numeric value. - */ - isInteger(number: number): boolean; - - /** - * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a - * number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter - * to a number. Only values of the type number, that are also NaN, result in true. - * @param number A numeric value. - */ - isNaN(number: number): boolean; - - /** - * Returns true if the value passed is a safe integer. - * @param number A numeric value. - */ - isSafeInteger(number: number): boolean; - - /** - * The value of the largest integer n such that n and n + 1 are both exactly representable as - * a Number value. - * The value of Number.MIN_SAFE_INTEGER is 9007199254740991 2^53 − 1. - */ - MAX_SAFE_INTEGER: number; - - /** - * The value of the smallest integer n such that n and n − 1 are both exactly representable as - * a Number value. - * The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)). - */ - MIN_SAFE_INTEGER: number; - - /** - * Converts a string to a floating-point number. - * @param string A string that contains a floating-point number. - */ - parseFloat(string: string): number; - - /** - * Converts A string to an integer. - * @param s A string to convert into a number. - * @param radix A value between 2 and 36 that specifies the base of the number in numString. - * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. - * All other strings are considered decimal. - */ - parseInt(string: string, radix?: number): number; -} - -interface ObjectConstructor { - /** - * Copy the values of all of the enumerable own properties from one or more source objects to a - * target object. Returns the target object. - * @param target The target object to copy to. - * @param sources One or more source objects to copy properties from. - */ - assign(target: any, ...sources: any[]): any; - - /** - * Returns true if the values are the same value, false otherwise. - * @param value1 The first value. - * @param value2 The second value. - */ - is(value1: any, value2: any): boolean; - - /** - * Sets the prototype of a specified object o to object proto or null. Returns the object o. - * @param o The object to change its prototype. - * @param proto The value of the new prototype or null. - * @remarks Requires `__proto__` support. - */ - setPrototypeOf(o: any, proto: any): any; -} - -interface RegExp { - /** - * Returns a string indicating the flags of the regular expression in question. This field is read-only. - * The characters in this string are sequenced and concatenated in the following order: - * - * - "g" for global - * - "i" for ignoreCase - * - "m" for multiline - * - "u" for unicode - * - "y" for sticky - * - * If no flags are set, the value is the empty string. - */ - flags: string; -} - -interface Math { - /** - * Returns the number of leading zero bits in the 32-bit binary representation of a number. - * @param x A numeric expression. - */ - clz32(x: number): number; - - /** - * Returns the result of 32-bit multiplication of two numbers. - * @param x First number - * @param y Second number - */ - imul(x: number, y: number): number; - - /** - * Returns the sign of the x, indicating whether x is positive, negative or zero. - * @param x The numeric expression to test - */ - sign(x: number): number; - - /** - * Returns the base 10 logarithm of a number. - * @param x A numeric expression. - */ - log10(x: number): number; - - /** - * Returns the base 2 logarithm of a number. - * @param x A numeric expression. - */ - log2(x: number): number; - - /** - * Returns the natural logarithm of 1 + x. - * @param x A numeric expression. - */ - log1p(x: number): number; - - /** - * Returns the result of (e^x - 1) of x (e raised to the power of x, where e is the base of - * the natural logarithms). - * @param x A numeric expression. - */ - expm1(x: number): number; - - /** - * Returns the hyperbolic cosine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - cosh(x: number): number; - - /** - * Returns the hyperbolic sine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - sinh(x: number): number; - - /** - * Returns the hyperbolic tangent of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - tanh(x: number): number; - - /** - * Returns the inverse hyperbolic cosine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - acosh(x: number): number; - - /** - * Returns the inverse hyperbolic sine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - asinh(x: number): number; - - /** - * Returns the inverse hyperbolic tangent of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - atanh(x: number): number; - - /** - * Returns the square root of the sum of squares of its arguments. - * @param values Values to compute the square root for. - * If no arguments are passed, the result is +0. - * If there is only one argument, the result is the absolute value. - * If any argument is +Infinity or -Infinity, the result is +Infinity. - * If any argument is NaN, the result is NaN. - * If all arguments are either +0 or −0, the result is +0. - */ - hypot(...values: number[]): number; - - /** - * Returns the integral part of the a numeric expression, x, removing any fractional digits. - * If x is already an integer, the result is x. - * @param x A numeric expression. - */ - trunc(x: number): number; - - /** - * Returns the nearest single precision float representation of a number. - * @param x A numeric expression. - */ - fround(x: number): number; - - /** - * Returns an implementation-dependent approximation to the cube root of number. - * @param x A numeric expression. - */ - cbrt(x: number): number; -} - -interface PromiseLike { - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): PromiseLike; - then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => void): PromiseLike; -} - -/** - * Represents the completion of an asynchronous operation - */ -interface Promise { - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; - then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => void): Promise; - - /** - * Attaches a callback for only the rejection of the Promise. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of the callback. - */ - catch(onrejected?: (reason: any) => T | PromiseLike): Promise; - catch(onrejected?: (reason: any) => void): Promise; -} - -interface PromiseConstructor { - /** - * A reference to the prototype. - */ - prototype: Promise; - - /** - * Creates a new Promise. - * @param executor A callback used to initialize the promise. This callback is passed two arguments: - * a resolve callback used resolve the promise with a value or the result of another promise, - * and a reject callback used to reject the promise with a provided reason or error. - */ - new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: IterableShim>): Promise; - - /** - * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved - * or rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - race(values: IterableShim>): Promise; - - /** - * Creates a new rejected promise for the provided reason. - * @param reason The reason the promise was rejected. - * @returns A new rejected Promise. - */ - reject(reason: any): Promise; - - /** - * Creates a new rejected promise for the provided reason. - * @param reason The reason the promise was rejected. - * @returns A new rejected Promise. - */ - reject(reason: any): Promise; - - /** - * Creates a new resolved promise for the provided value. - * @param value A promise. - * @returns A promise whose internal state matches the provided promise. - */ - resolve(value: T | PromiseLike): Promise; - - /** - * Creates a new resolved promise . - * @returns A resolved promise. - */ - resolve(): Promise; -} - -declare var Promise: PromiseConstructor; - -interface Map { - clear(): void; - delete(key: K): boolean; - forEach(callbackfn: (value: V, index: K, map: Map) => void, thisArg?: any): void; - get(key: K): V; - has(key: K): boolean; - set(key: K, value?: V): Map; - size: number; - entries(): IterableIteratorShim<[K, V]>; - keys(): IterableIteratorShim; - values(): IterableIteratorShim; -} - -interface MapConstructor { - new (): Map; - new (iterable: IterableShim<[K, V]>): Map; - prototype: Map; -} - -declare var Map: MapConstructor; - -interface Set { - add(value: T): Set; - clear(): void; - delete(value: T): boolean; - forEach(callbackfn: (value: T, index: T, set: Set) => void, thisArg?: any): void; - has(value: T): boolean; - size: number; - entries(): IterableIteratorShim<[T, T]>; - keys(): IterableIteratorShim; - values(): IterableIteratorShim; - '_es6-shim iterator_'(): IterableIteratorShim; -} - -interface SetConstructor { - new (): Set; - new (iterable: IterableShim): Set; - prototype: Set; -} - -declare var Set: SetConstructor; - -interface WeakMap { - delete(key: K): boolean; - get(key: K): V; - has(key: K): boolean; - set(key: K, value?: V): WeakMap; -} - -interface WeakMapConstructor { - new (): WeakMap; - new (iterable: IterableShim<[K, V]>): WeakMap; - prototype: WeakMap; -} - -declare var WeakMap: WeakMapConstructor; - -interface WeakSet { - add(value: T): WeakSet; - delete(value: T): boolean; - has(value: T): boolean; -} - -interface WeakSetConstructor { - new (): WeakSet; - new (iterable: IterableShim): WeakSet; - prototype: WeakSet; -} - -declare var WeakSet: WeakSetConstructor; - -declare namespace Reflect { - function apply(target: Function, thisArgument: any, argumentsList: ArrayLike): any; - function construct(target: Function, argumentsList: ArrayLike): any; - function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean; - function deleteProperty(target: any, propertyKey: PropertyKey): boolean; - function enumerate(target: any): IterableIteratorShim; - function get(target: any, propertyKey: PropertyKey, receiver?: any): any; - function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor; - function getPrototypeOf(target: any): any; - function has(target: any, propertyKey: PropertyKey): boolean; - function isExtensible(target: any): boolean; - function ownKeys(target: any): Array; - function preventExtensions(target: any): boolean; - function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean; - function setPrototypeOf(target: any, proto: any): boolean; -} - -declare module "es6-shim" { - var String: StringConstructor; - var Array: ArrayConstructor; - var Number: NumberConstructor; - var Math: Math; - var Object: ObjectConstructor; - var Map: MapConstructor; - var Set: SetConstructor; - var WeakMap: WeakMapConstructor; - var WeakSet: WeakSetConstructor; - var Promise: PromiseConstructor; - namespace Reflect { - function apply(target: Function, thisArgument: any, argumentsList: ArrayLike): any; - function construct(target: Function, argumentsList: ArrayLike): any; - function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean; - function deleteProperty(target: any, propertyKey: PropertyKey): boolean; - function enumerate(target: any): Iterator; - function get(target: any, propertyKey: PropertyKey, receiver?: any): any; - function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor; - function getPrototypeOf(target: any): any; - function has(target: any, propertyKey: PropertyKey): boolean; - function isExtensible(target: any): boolean; - function ownKeys(target: any): Array; - function preventExtensions(target: any): boolean; - function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean; - function setPrototypeOf(target: any, proto: any): boolean; - } -} diff --git a/es6-weak-map/es6-weak-map-tests.ts b/es6-weak-map/es6-weak-map-tests.ts deleted file mode 100644 index 68f5ea7f43..0000000000 --- a/es6-weak-map/es6-weak-map-tests.ts +++ /dev/null @@ -1,18 +0,0 @@ -import WeakMap = require('es6-weak-map'); - -new WeakMap<{}, string>(); - -var tuples: Array<[number, string]> = [ [0, 'foo'], [1, 'bar'] ]; -new WeakMap(tuples); - -var map = new WeakMap<{}, string>(); -var obj = {}; - -map.set(obj, 'foo'); -map.get(obj); -map.has(obj); -map.delete(obj); -map.get(obj); -map.has(obj); -map.set(obj, 'bar'); -map.has(obj); diff --git a/es6-weak-map/tslint.json b/es6-weak-map/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/es6-weak-map/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/estree/index.d.ts b/estree/index.d.ts deleted file mode 100644 index 26bccf1731..0000000000 --- a/estree/index.d.ts +++ /dev/null @@ -1,536 +0,0 @@ -// Type definitions for ESTree AST specification -// Project: https://github.com/estree/estree -// Definitions by: RReverser -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -// This definition file follows a somewhat unusual format. ESTree allows -// runtime type checks based on the `type` parameter. In order to explain this -// to typescript we want to use discriminated union types: -// https://github.com/Microsoft/TypeScript/pull/9163 -// -// For ESTree this is a bit tricky because the high level interfaces like -// Node or Function are pulling double duty. We want to pass common fields down -// to the interfaces that extend them (like Identifier or -// ArrowFunctionExpression), but you can't extend a type union or enforce -// common fields on them. So we've split the high level interfaces into two -// types, a base type which passes down inhereted fields, and a type union of -// all types which extend the base type. Only the type union is exported, and -// the union is how other types refer to the collection of inheriting types. -// -// This makes the definitions file here somewhat more difficult to maintain, -// but it has the notable advantage of making ESTree much easier to use as -// an end user. - -interface BaseNode { - // Every leaf interface that extends BaseNode must specify a type property. - // The type property should be a string literal. For example, Identifier - // has: `type: "Identifier"` - - leadingComments?: Array; - trailingComments?: Array; - loc?: SourceLocation; - range?: [number, number]; -} -export type Node = - Identifier | Literal | Program | Function | SwitchCase | CatchClause | - VariableDeclarator | Statement | Expression | Property | - AssignmentProperty | Super | TemplateElement | SpreadElement | Pattern | - ClassBody | Class | MethodDefinition | ModuleDeclaration | ModuleSpecifier; - -export interface Comment { - value: string; -} - -interface SourceLocation { - source?: string; - start: Position; - end: Position; -} - -export interface Position { - /** >= 1 */ - line: number; - /** >= 0 */ - column: number; -} - -export interface Program extends BaseNode { - type: "Program"; - sourceType: "script" | "module"; - body: Array; -} - -interface BaseFunction extends BaseNode { - params: Array; - generator?: boolean; - async?: boolean; - // The body is either BlockStatement or Expression because arrow functions - // can have a body that's either. FunctionDeclarations and - // FunctionExpressions have only BlockStatement bodies. - body: BlockStatement | Expression; -} - -export type Function = - FunctionDeclaration | FunctionExpression | ArrowFunctionExpression; - - -export type Statement = - ExpressionStatement | BlockStatement | EmptyStatement | - DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | - BreakStatement | ContinueStatement | IfStatement | SwitchStatement | - ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | - ForStatement | ForInStatement | ForOfStatement | Declaration; -interface BaseStatement extends BaseNode { } - -export interface EmptyStatement extends BaseStatement { - type: "EmptyStatement"; -} - -export interface BlockStatement extends BaseStatement { - type: "BlockStatement"; - body: Array; -} - -export interface ExpressionStatement extends BaseStatement { - type: "ExpressionStatement"; - expression: Expression; -} - -export interface IfStatement extends BaseStatement { - type: "IfStatement"; - test: Expression; - consequent: Statement; - alternate?: Statement; -} - -export interface LabeledStatement extends BaseStatement { - type: "LabeledStatement"; - label: Identifier; - body: Statement; -} - -export interface BreakStatement extends BaseStatement { - type: "BreakStatement"; - label?: Identifier; -} - -export interface ContinueStatement extends BaseStatement { - type: "ContinueStatement"; - label?: Identifier; -} - -export interface WithStatement extends BaseStatement { - type: "WithStatement"; - object: Expression; - body: Statement; -} - -export interface SwitchStatement extends BaseStatement { - type: "SwitchStatement"; - discriminant: Expression; - cases: Array; -} - -export interface ReturnStatement extends BaseStatement { - type: "ReturnStatement"; - argument?: Expression; -} - -export interface ThrowStatement extends BaseStatement { - type: "ThrowStatement"; - argument: Expression; -} - -export interface TryStatement extends BaseStatement { - type: "TryStatement"; - block: BlockStatement; - handler?: CatchClause; - finalizer?: BlockStatement; -} - -export interface WhileStatement extends BaseStatement { - type: "WhileStatement"; - test: Expression; - body: Statement; -} - -export interface DoWhileStatement extends BaseStatement { - type: "DoWhileStatement"; - body: Statement; - test: Expression; -} - -export interface ForStatement extends BaseStatement { - type: "ForStatement"; - init?: VariableDeclaration | Expression; - test?: Expression; - update?: Expression; - body: Statement; -} - -interface BaseForXStatement extends BaseStatement { - left: VariableDeclaration | Expression; - right: Expression; - body: Statement; -} - -export interface ForInStatement extends BaseForXStatement { - type: "ForInStatement"; -} - -export interface DebuggerStatement extends BaseStatement { - type: "DebuggerStatement"; -} - -export type Declaration = - FunctionDeclaration | VariableDeclaration | ClassDeclaration; -interface BaseDeclaration extends BaseStatement { } - -export interface FunctionDeclaration extends BaseFunction, BaseDeclaration { - type: "FunctionDeclaration"; - id: Identifier; - body: BlockStatement; -} - -export interface VariableDeclaration extends BaseDeclaration { - type: "VariableDeclaration"; - declarations: Array; - kind: "var" | "let" | "const"; -} - -export interface VariableDeclarator extends BaseNode { - type: "VariableDeclarator"; - id: Pattern; - init?: Expression; -} - -type Expression = - ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | - ArrowFunctionExpression | YieldExpression | Literal | UnaryExpression | - UpdateExpression | BinaryExpression | AssignmentExpression | - LogicalExpression | MemberExpression | ConditionalExpression | - CallExpression | NewExpression | SequenceExpression | TemplateLiteral | - TaggedTemplateExpression | ClassExpression | MetaProperty | Identifier | - AwaitExpression; -export interface BaseExpression extends BaseNode { } - -export interface ThisExpression extends BaseExpression { - type: "ThisExpression"; -} - -export interface ArrayExpression extends BaseExpression { - type: "ArrayExpression"; - elements: Array; -} - -export interface ObjectExpression extends BaseExpression { - type: "ObjectExpression"; - properties: Array; -} - -export interface Property extends BaseNode { - type: "Property"; - key: Expression; - value: Expression | Pattern; // Could be an AssignmentProperty - kind: "init" | "get" | "set"; - method: boolean; - shorthand: boolean; - computed: boolean; -} - -export interface FunctionExpression extends BaseFunction, BaseExpression { - id?: Identifier; - type: "FunctionExpression"; - body: BlockStatement; -} - -export interface SequenceExpression extends BaseExpression { - type: "SequenceExpression"; - expressions: Array; -} - -export interface UnaryExpression extends BaseExpression { - type: "UnaryExpression"; - operator: UnaryOperator; - prefix: boolean; - argument: Expression; -} - -export interface BinaryExpression extends BaseExpression { - type: "BinaryExpression"; - operator: BinaryOperator; - left: Expression; - right: Expression; -} - -export interface AssignmentExpression extends BaseExpression { - type: "AssignmentExpression"; - operator: AssignmentOperator; - left: Pattern | MemberExpression; - right: Expression; -} - -export interface UpdateExpression extends BaseExpression { - type: "UpdateExpression"; - operator: UpdateOperator; - argument: Expression; - prefix: boolean; -} - -export interface LogicalExpression extends BaseExpression { - type: "LogicalExpression"; - operator: LogicalOperator; - left: Expression; - right: Expression; -} - -export interface ConditionalExpression extends BaseExpression { - type: "ConditionalExpression"; - test: Expression; - alternate: Expression; - consequent: Expression; -} - -interface BaseCallExpression extends BaseExpression { - callee: Expression | Super; - arguments: Array; -} -export type CallExpression = SimpleCallExpression | NewExpression; - -export interface SimpleCallExpression extends BaseCallExpression { - type: "CallExpression"; -} - -export interface NewExpression extends BaseCallExpression { - type: "NewExpression"; -} - -export interface MemberExpression extends BaseExpression, BasePattern { - type: "MemberExpression"; - object: Expression | Super; - property: Expression; - computed: boolean; -} - -export type Pattern = - Identifier | ObjectPattern | ArrayPattern | RestElement | - AssignmentPattern | MemberExpression; -interface BasePattern extends BaseNode { } - -export interface SwitchCase extends BaseNode { - type: "SwitchCase"; - test?: Expression; - consequent: Array; -} - -export interface CatchClause extends BaseNode { - type: "CatchClause"; - param: Pattern; - body: BlockStatement; -} - -export interface Identifier extends BaseNode, BaseExpression, BasePattern { - type: "Identifier"; - name: string; -} - -export type Literal = SimpleLiteral | RegExpLiteral; - -export interface SimpleLiteral extends BaseNode, BaseExpression { - type: "Literal"; - value: string | boolean | number | null; - raw: string; -} - -export interface RegExpLiteral extends BaseNode, BaseExpression { - type: "Literal"; - value: RegExp; - regex: { - pattern: string; - flags: string; - }; - raw: string; -} - -export type UnaryOperator = - "-" | "+" | "!" | "~" | "typeof" | "void" | "delete"; - -export type BinaryOperator = - "==" | "!=" | "===" | "!==" | "<" | "<=" | ">" | ">=" | "<<" | - ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "**" | "|" | "^" | "&" | "in" | - "instanceof"; - -export type LogicalOperator = "||" | "&&"; - -export type AssignmentOperator = - "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "**=" | "<<=" | ">>=" | ">>>=" | - "|=" | "^=" | "&="; - -export type UpdateOperator = "++" | "--"; - -export interface ForOfStatement extends BaseForXStatement { - type: "ForOfStatement"; -} - -export interface Super extends BaseNode { - type: "Super"; -} - -export interface SpreadElement extends BaseNode { - type: "SpreadElement"; - argument: Expression; -} - -export interface ArrowFunctionExpression extends BaseExpression, BaseFunction { - type: "ArrowFunctionExpression"; - expression: boolean; - body: BlockStatement | Expression; -} - -export interface YieldExpression extends BaseExpression { - type: "YieldExpression"; - argument?: Expression; - delegate: boolean; -} - -export interface TemplateLiteral extends BaseExpression { - type: "TemplateLiteral"; - quasis: Array; - expressions: Array; -} - -export interface TaggedTemplateExpression extends BaseExpression { - type: "TaggedTemplateExpression"; - tag: Expression; - quasi: TemplateLiteral; -} - -export interface TemplateElement extends BaseNode { - type: "TemplateElement"; - tail: boolean; - value: { - cooked: string; - raw: string; - }; -} - -export interface AssignmentProperty extends Property { - value: Pattern; - kind: "init"; - method: boolean; // false -} - -export interface ObjectPattern extends BasePattern { - type: "ObjectPattern"; - properties: Array; -} - -export interface ArrayPattern extends BasePattern { - type: "ArrayPattern"; - elements: Array; -} - -export interface RestElement extends BasePattern { - type: "RestElement"; - argument: Pattern; -} - -export interface AssignmentPattern extends BasePattern { - type: "AssignmentPattern"; - left: Pattern; - right: Expression; -} - -export type Class = ClassDeclaration | ClassExpression; -interface BaseClass extends BaseNode { - superClass?: Expression; - body: ClassBody; -} - -export interface ClassBody extends BaseNode { - type: "ClassBody"; - body: Array; -} - -export interface MethodDefinition extends BaseNode { - type: "MethodDefinition"; - key: Expression; - value: FunctionExpression; - kind: "constructor" | "method" | "get" | "set"; - computed: boolean; - static: boolean; -} - -export interface ClassDeclaration extends BaseClass, BaseDeclaration { - type: "ClassDeclaration"; - id: Identifier; -} - -export interface ClassExpression extends BaseClass, BaseExpression { - type: "ClassExpression"; - id?: Identifier; -} - -export interface MetaProperty extends BaseExpression { - type: "MetaProperty"; - meta: Identifier; - property: Identifier; -} - -export type ModuleDeclaration = - ImportDeclaration | ExportNamedDeclaration | ExportDefaultDeclaration | - ExportAllDeclaration; -interface BaseModuleDeclaration extends BaseNode { } - -export type ModuleSpecifier = - ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | - ExportSpecifier; -interface BaseModuleSpecifier extends BaseNode { - local: Identifier; -} - -export interface ImportDeclaration extends BaseModuleDeclaration { - type: "ImportDeclaration"; - specifiers: Array; - source: Literal; -} - -export interface ImportSpecifier extends BaseModuleSpecifier { - type: "ImportSpecifier"; - imported: Identifier; -} - -export interface ImportDefaultSpecifier extends BaseModuleSpecifier { - type: "ImportDefaultSpecifier"; -} - -export interface ImportNamespaceSpecifier extends BaseModuleSpecifier { - type: "ImportNamespaceSpecifier"; -} - -export interface ExportNamedDeclaration extends BaseModuleDeclaration { - type: "ExportNamedDeclaration"; - declaration?: Declaration; - specifiers: Array; - source?: Literal; -} - -export interface ExportSpecifier extends BaseModuleSpecifier { - type: "ExportSpecifier"; - exported: Identifier; -} - -export interface ExportDefaultDeclaration extends BaseModuleDeclaration { - type: "ExportDefaultDeclaration"; - declaration: Declaration | Expression; -} - -export interface ExportAllDeclaration extends BaseModuleDeclaration { - type: "ExportAllDeclaration"; - source: Literal; -} - -export interface AwaitExpression extends BaseExpression { - type: "AwaitExpression"; - argument: Expression; -} diff --git a/event-stream/tsconfig.json b/event-stream/tsconfig.json deleted file mode 100644 index 208ff51fe0..0000000000 --- a/event-stream/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "event-stream-tests.ts" - ] -} \ No newline at end of file diff --git a/eventemitter3/eventemitter3-tests.ts b/eventemitter3/eventemitter3-tests.ts deleted file mode 100644 index 9c8e379ec9..0000000000 --- a/eventemitter3/eventemitter3-tests.ts +++ /dev/null @@ -1,116 +0,0 @@ -'use strict'; - -import * as EventEmitter from 'eventemitter3'; - -const eventName = 'test'; -const eventSymbol: symbol = Symbol('test'); -const fn = () => console.log(1); - -// Extending EventEmitter -class TestEmitter extends EventEmitter { - constructor() { - super(); - } - - test() { - return this; - } -} - -const ee: TestEmitter = new TestEmitter(); - -// EventEmitter.prefixed -// should be boolean or string static property -const prefix = EventEmitter.prefixed; -if (typeof prefix === 'boolean') { - console.log(prefix.valueOf()); -} else { - console.log(prefix.length); -} - -// EventEmitter.eventNames() -// should return array of strings or symbols -ee.eventNames().every((event) => { - if (typeof event === 'symbol') { - return false; - } else { - return event.length > 0; - } -}); - -// EventEmitter.listeners() -// should return array of functions -ee.listeners(eventName).map((listener) => { - return listener.bind(this); -}); -// should accept symbol as event name -ee.listeners(eventSymbol).map((listener) => { - return listener.bind(this); -}); -// should return boolean with 'exists' flag -const hasListeners: boolean = ee.listeners(eventName, true); - -// EventEmitter.emit() -// should support any number of arguments -ee.emit(eventName, 1, true, {}, [], 'test', Symbol(), null); -// should accept symbol as event name -ee.emit(eventSymbol); - -// EventEmitter.addListener() and EventEmitter.on() -// should accept function -ee.on(eventName, fn); -ee.addListener(eventName, fn); -// should accept optional context argument -ee.on(eventName, fn, this); -ee.addListener(eventName, fn, this); -// should accept symbol as event name -ee.on(eventSymbol, fn); -ee.addListener(eventSymbol, fn); -// should support fluent interface -ee.on(eventSymbol, fn).test(); -ee.addListener(eventSymbol, fn).test(); - -// EventEmitter.once() -// should accept event name and function -ee.once(eventName, fn); -// should accept optional context argument -ee.once(eventName, fn, this); -ee.once(eventName, fn, {}); -// should accept symbol as event name -ee.once(eventSymbol, fn); -// should support fluent interface -ee.once(eventSymbol, fn).test(); - -// EventEmitter.removeListener() and EventEmitter.off() -// should accept event name -ee.removeListener(eventName); -ee.off(eventName); -// should accept optional function -ee.removeListener(eventName, fn); -ee.off(eventName, fn); -// should accept optional context argument -ee.removeListener(eventName, fn, {}); -ee.off(eventName, fn, {}); -// should accept optional boolean flag for removing listeners added with `EventEmitter.once()` -ee.removeListener(eventName, fn, null, true); -ee.off(eventName, fn, null, true); -// should accept symbol as event name -ee.removeListener(eventSymbol); -ee.off(eventSymbol); -// should support fluent interface -ee.removeListener(eventName).test(); -ee.off(eventName).test(); - -// EventEmitter.removeAllListeners() -// should not require any arguments -ee.removeAllListeners(); -// should accept optional event name -ee.removeAllListeners(eventName); -// should accept symbol as event name -ee.removeAllListeners(eventSymbol); -// should support fluent interface -ee.removeAllListeners(eventName).test(); - -// EventEmitter.setMaxListeners() -// should support fluent interface -ee.setMaxListeners().test(); \ No newline at end of file diff --git a/eventemitter3/index.d.ts b/eventemitter3/index.d.ts deleted file mode 100644 index 9c1fe2397e..0000000000 --- a/eventemitter3/index.d.ts +++ /dev/null @@ -1,122 +0,0 @@ -// Type definitions for EventEmitter3 1.2.0 -// Project: https://github.com/primus/eventemitter3 -// Definitions by: Yuichi Murata , Leon Yu , Boriss Nazarovs -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export = EventEmitter; - -declare namespace EventEmitter { - type EventEmitter = self; -} - -type self = EventEmitter; -/** - * Minimal EventEmitter interface that is molded against the Node.js - * EventEmitter interface. - */ -declare class EventEmitter { - static prefixed: string | boolean; - - static EventEmitter: { - new (): EventEmitter; - prefixed: string | boolean; - }; - - /** - * Minimal EventEmitter interface that is molded against the Node.js - * EventEmitter interface. - * - * @constructor - * @api public - */ - constructor(); - - /** - * Return an array listing the events for which the emitter has registered listeners. - * - * @returns {(string | symbol)[]} - */ - eventNames(): (string | symbol)[]; - - /** - * Return the listeners registered for a given event. - * - * @param {(string | symbol)} event The event name. - * @returns {Function[]} - */ - listeners(event: string | symbol): Function[]; - - /** - * Check if there listeners for a given event. - * If `exists` argument is not `true` lists listeners. - * - * @param {(string | symbol)} event The event name. - * @param {boolean} exists Only check if there are listeners. - * @returns {boolean} - */ - listeners(event: string | symbol, exists: boolean): boolean; - - /** - * Calls each of the listeners registered for a given event. - * - * @param {(string | symbol)} event The event name. - * @param {...*} args Arguments that are passed to registered listeners - * @returns {boolean} `true` if the event had listeners, else `false`. - */ - emit(event: string | symbol, ...args: any[]): boolean; - - /** - * Add a listener for a given event. - * - * @param {(string | symbol)} event The event name. - * @param {Function} fn The listener function. - * @param {*} [context=this] The context to invoke the listener with. - * @returns {EventEmitter} `this`. - */ - on(event: string | symbol, fn: Function, context?: any): this; - - /** - * Add a one-time listener for a given event. - * - * @param {(string | symbol)} event The event name. - * @param {Function} fn The listener function. - * @param {*} [context=this] The context to invoke the listener with. - * @returns {EventEmitter} `this`. - */ - once(event: string | symbol, fn: Function, context?: any): this; - - /** - * Remove the listeners of a given event. - * - * @param {(string | symbol)} event The event name. - * @param {Function} fn Only remove the listeners that match this function. - * @param {*} context Only remove the listeners that have this context. - * @param {boolean} once Only remove one-time listeners. - * @returns {EventEmitter} `this`. - */ - removeListener(event: string | symbol, fn?: Function, context?: any, once?: boolean): this; - - /** - * Remove all listeners, or those of the specified event. - * - * @param {(string | symbol)} event The event name. - * @returns {EventEmitter} `this`. - */ - removeAllListeners(event?: string | symbol): this; - - /** - * Alias method for `removeListener` - */ - off(event: string | symbol, fn?: Function, context?: any, once?: boolean): this; - - /** - * Alias method for `on` - */ - addListener(event: string | symbol, fn: Function, context?: any): this; - - /** - * This function doesn't apply anymore. - * @deprecated - */ - setMaxListeners(): this; -} diff --git a/eventemitter3/tsconfig.json b/eventemitter3/tsconfig.json deleted file mode 100644 index cc19c9433b..0000000000 --- a/eventemitter3/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": false, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "eventemitter3-tests.ts" - ] -} \ No newline at end of file diff --git a/evernote/index.d.ts b/evernote/index.d.ts deleted file mode 100644 index 18e0e13e1c..0000000000 --- a/evernote/index.d.ts +++ /dev/null @@ -1,6318 +0,0 @@ -// Type definitions for evernote v 1.25.8 -// Project: https://www.npmjs.com/package/evernote -// Definitions by: Zachary Collins -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -import { Thrift } from "thrift"; - -declare namespace Evernote { - interface Callback { - (err: EDAMUserException | EDAMSystemException | EDAMNotFoundException, v: T): void - } - - interface ClientConfig { - consumerKey?: string - consumerSecret?: string - sandbox?: boolean - token?: string - serviceHost?: string - additionalHeaders?: { [k: string]: string } - secret?: string - } - - class Client { - static "new": (config: ClientConfig) => Client - constructor(config: ClientConfig); - getNoteStore(): NoteStoreClient; - getUserStore(): UserStoreClient; - } - - - /** - * Numeric codes indicating the type of error that occurred on the - * service. - *